1 #ifndef __CPPLUGINS__EXTENSIONS__VISUALIZATION__IMAGEINTERACTORSTYLE__H__
2 #define __CPPLUGINS__EXTENSIONS__VISUALIZATION__IMAGEINTERACTORSTYLE__H__
6 #include <vtkInteractorStyleImage.h>
7 #include <vtkOrientationMarkerWidget.h>
8 #include <vtkPropPicker.h>
9 #include <vtkSmartPointer.h>
12 #include <vtkInteractorStyleImage.h>
13 #include <vtkLineWidget2.h>
14 #include <vtkLineRepresentation.h>
23 namespace Visualization
25 class ImageSliceActors;
30 class ImageInteractorStyle
31 : public vtkInteractorStyleImage
34 typedef ImageInteractorStyle Self;
43 vtkTypeMacro( ImageInteractorStyle, vtkInteractorStyleImage );
49 ImageSliceActors* slice_actors,
50 MPRActors* mpr_actors = NULL
52 void AssociateInteractor( vtkRenderWindowInteractor* interactor );
54 void SetModeToNavigation( );
55 void SetModeToDeformation( );
56 virtual void SetInteractor(
57 vtkRenderWindowInteractor* interactor, const int& axis
60 unsigned long AddDoubleClickObserver( vtkCommand* observer );
61 void RemoveDoubleClickObserver( unsigned long tag );
62 void RemoveDoubleClickObserver( vtkCommand* observer );
63 void RemoveDoubleClickObservers( );
66 // Event bindings controlling the effects of pressing mouse buttons
67 // or moving the mouse.
68 virtual void OnMouseMove( );
69 virtual void OnLeftButtonDown( );
70 virtual void OnLeftButtonUp( );
71 virtual void OnMiddleButtonDown( );
72 virtual void OnMiddleButtonUp( );
73 virtual void OnRightButtonDown( );
74 virtual void OnRightButtonUp( );
75 virtual void OnMouseWheelForward( );
76 virtual void OnMouseWheelBackward( );
79 // Override the "fly-to" (f keypress) for images.
80 virtual void OnChar( );
82 // These methods for the different interactions in different modes
83 // are overridden in subclasses to perform the correct motion. Since
84 // they might be called from OnTimer, they do not have mouse coord
85 // parameters (use interactor's GetEventPosition and
86 // GetLastEventPosition)
88 virtual void Rotate( ) { }
89 virtual void Spin( ) { }
90 virtual void Zoom( ) { }
91 virtual void Pick( ) { }
92 virtual void Slice( ) { }
93 virtual void WindowLevel( );
95 // Interaction mode entry points used internally.
96 virtual void StartPick( ) { }
97 virtual void EndPick( ) { }
98 virtual void StartSlice( ) { }
99 virtual void EndSlice( ) { }
100 virtual void StartWindowLevel( );
101 virtual void EndWindowLevel( );
104 virtual void StartCursorMoving( );
105 virtual void EndCursorMoving( );
108 ImageInteractorStyle( );
109 virtual ~ImageInteractorStyle( );
111 void _RenderAssociateInteractors( );
112 bool _PickPosition( double pos[ 3 ] );
113 void _UpdateCursor( );
116 // Purposely not implemented
117 ImageInteractorStyle( const Self& );
118 Self& operator=( const Self& );
121 Self::InteractionMode Mode;
123 ImageSliceActors* m_SliceActors;
124 MPRActors* m_MPRActors;
126 vtkSmartPointer< vtkOrientationMarkerWidget > OrientationWidget;
127 vtkSmartPointer< vtkPropPicker > PropPicker;
129 std::vector< vtkRenderWindowInteractor* > AssociatedInteractors;
134 static const int DoubleClickEvent;
143 #endif // __CPPLUGINS__EXTENSIONS__VISUALIZATION__IMAGEINTERACTORSTYLE__H__