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
61 // Event bindings controlling the effects of pressing mouse buttons
62 // or moving the mouse.
63 virtual void OnMouseMove( );
64 virtual void OnLeftButtonDown( );
65 virtual void OnLeftButtonUp( );
66 virtual void OnMiddleButtonDown( );
67 virtual void OnMiddleButtonUp( );
68 virtual void OnRightButtonDown( );
69 virtual void OnRightButtonUp( );
70 virtual void OnMouseWheelForward( );
71 virtual void OnMouseWheelBackward( );
74 // Override the "fly-to" (f keypress) for images.
75 virtual void OnChar( );
77 // These methods for the different interactions in different modes
78 // are overridden in subclasses to perform the correct motion. Since
79 // they might be called from OnTimer, they do not have mouse coord
80 // parameters (use interactor's GetEventPosition and
81 // GetLastEventPosition)
83 virtual void Rotate( ) { }
84 virtual void Spin( ) { }
85 virtual void Zoom( ) { }
86 virtual void Pick( ) { }
87 virtual void Slice( ) { }
88 virtual void WindowLevel( );
90 // Interaction mode entry points used internally.
91 virtual void StartPick( ) { }
92 virtual void EndPick( ) { }
93 virtual void StartSlice( ) { }
94 virtual void EndSlice( ) { }
95 virtual void StartWindowLevel( );
96 virtual void EndWindowLevel( );
99 virtual void StartCursorMoving( );
100 virtual void EndCursorMoving( );
103 ImageInteractorStyle( );
104 virtual ~ImageInteractorStyle( );
106 void _RenderAssociateInteractors( );
107 bool _PickPosition( double pos[ 3 ] );
108 void _UpdateCursor( );
111 // Purposely not implemented
112 ImageInteractorStyle( const Self& );
113 Self& operator=( const Self& );
116 Self::InteractionMode Mode;
118 ImageSliceActors* m_SliceActors;
119 MPRActors* m_MPRActors;
121 vtkSmartPointer< vtkOrientationMarkerWidget > OrientationWidget;
122 vtkSmartPointer< vtkPropPicker > PropPicker;
124 std::vector< vtkRenderWindowInteractor* > AssociatedInteractors;
129 static const int SliceEvent;
138 #endif // __CPPLUGINS__EXTENSIONS__VISUALIZATION__IMAGEINTERACTORSTYLE__H__