#include <vector>
#include <vtkSmartPointer.h>
+#include <vtkImageActorPointPlacer.h>
#include <vtkPropPicker.h>
+#include <vtkPointHandleRepresentation3D.h>
+#include <vtkSeedRepresentation.h>
+#include <cpExtensions/Interaction/SeedWidget.h>
// Forward definitions
+class vtkCommand;
class vtkImageActor;
namespace cpExtensions
typedef ImageInteractorStyle Self;
vtkTypeMacro( ImageInteractorStyle, BaseInteractorStyle );
+ // Callbacks types
+ typedef Superclass::TMouseCommand TMouseCommand;
+ typedef Superclass::TMouseWheelCommand TMouseWheelCommand;
+ typedef Superclass::TKeyCommand TKeyCommand;
+ typedef Superclass::TVoidCommand TVoidCommand;
+ typedef Superclass::TMouseMoveCommand TMouseMoveCommand;
+ typedef Superclass::TMouseClickCommand TMouseClickCommand;
+ typedef Superclass::TMouseDoubleClickCommand TMouseDoubleClickCommand;
+ typedef Superclass::TExposeCommand TExposeCommand;
+ typedef Superclass::TConfigureCommand TConfigureCommand;
+ typedef Superclass::TEnterCommand TEnterCommand;
+ typedef Superclass::TLeaveCommand TLeaveCommand;
+
+ // Widgets
+ struct TSeedWidget
+ {
+ vtkSmartPointer< vtkImageActorPointPlacer > Placer;
+ vtkSmartPointer< vtkPointHandleRepresentation3D > Handle;
+ vtkSmartPointer< vtkSeedRepresentation > Representation;
+ vtkSmartPointer< SeedWidget > Widget;
+
+ TSeedWidget(
+ vtkRenderWindowInteractor* interactor, vtkImageActor* actor
+ );
+ void On( );
+ void Off( );
+ };
+
public:
static Self* New( );
// Data for local picker
virtual void AssociateImageActor( vtkImageActor* actor );
+ // Widgets
+ void SeedWidgetOn( );
+ void SeedWidgetOff( );
+ void SetSeedWidgetCommand( vtkCommand* cmd );
+ unsigned int GetNumberOfSeeds( ) const;
+ void GetSeedAsPoint( unsigned int id, double pos[ 3 ] ) const;
+ void GetSeedAsIndex( unsigned int id, int pos[ 3 ] ) const;
+
protected:
ImageInteractorStyle( );
virtual ~ImageInteractorStyle( );
protected:
vtkSmartPointer< vtkPropPicker > m_PropPicker;
+
+ TSeedWidget* m_SeedWidget;
};
} // ecapseman