1 #ifndef __CPEXTENSIONS__INTERACTION__IMAGEINTERACTORSTYLE__H__
2 #define __CPEXTENSIONS__INTERACTION__IMAGEINTERACTORSTYLE__H__
4 #include <cpExtensions/Interaction/BaseInteractorStyle.h>
8 #include <vtkPropPicker.h>
9 #include <vtkSmartPointer.h>
11 #include <vtkImageActorPointPlacer.h>
12 #include <vtkPointHandleRepresentation3D.h>
13 #include <vtkSeedRepresentation.h>
14 #include <cpExtensions/Interaction/SeedWidget.h>
17 // Forward definitions
21 namespace cpExtensions
27 class cpExtensions_EXPORT ImageInteractorStyle
28 : public BaseInteractorStyle
31 typedef ImageInteractorStyle Self;
32 vtkTypeMacro( ImageInteractorStyle, BaseInteractorStyle );
35 typedef Superclass::TMouseCommand TMouseCommand;
36 typedef Superclass::TMouseWheelCommand TMouseWheelCommand;
37 typedef Superclass::TKeyCommand TKeyCommand;
38 typedef Superclass::TVoidCommand TVoidCommand;
39 typedef Superclass::TMouseMoveCommand TMouseMoveCommand;
40 typedef Superclass::TMouseClickCommand TMouseClickCommand;
41 typedef Superclass::TMouseDoubleClickCommand TMouseDoubleClickCommand;
42 typedef Superclass::TExposeCommand TExposeCommand;
43 typedef Superclass::TConfigureCommand TConfigureCommand;
44 typedef Superclass::TEnterCommand TEnterCommand;
45 typedef Superclass::TLeaveCommand TLeaveCommand;
51 vtkSmartPointer< vtkImageActorPointPlacer > Placer;
52 vtkSmartPointer< vtkPointHandleRepresentation3D > Handle;
53 vtkSmartPointer< vtkSeedRepresentation > Representation;
54 vtkSmartPointer< SeedWidget > Widget;
57 vtkRenderWindowInteractor* interactor, vtkImageActor* actor
67 virtual void SetCurrentRenderer( vtkRenderer* r ) VTK_OVERRIDE;
69 // Data for local picker
70 virtual void AssociateImageActor( vtkImageActor* actor );
75 void SeedWidgetOff( );
76 void SetSeedWidgetCommand( vtkCommand* cmd );
77 unsigned int GetNumberOfSeeds( ) const;
78 void GetSeedAsPoint( unsigned int id, double pos[ 3 ] ) const;
79 void GetSeedAsIndex( unsigned int id, int pos[ 3 ] ) const;
83 ImageInteractorStyle( );
84 virtual ~ImageInteractorStyle( );
86 void _ConfigureCamera( vtkImageActor* actor );
87 virtual bool _PickPosition( int idx[ 2 ], double pos[ 3 ] );
90 // Purposely not implemented
91 ImageInteractorStyle( const Self& );
92 Self& operator=( const Self& );
96 vtkSmartPointer< vtkPropPicker > m_PropPicker;
98 TSeedWidget* m_SeedWidget;
106 #endif // __CPEXTENSIONS__INTERACTION__IMAGEINTERACTORSTYLE__H__