1 #ifndef __CPPLUGINS__EXTENSIONS__VISUALIZATION__IMAGEINTERACTORSTYLE__H__
2 #define __CPPLUGINS__EXTENSIONS__VISUALIZATION__IMAGEINTERACTORSTYLE__H__
4 #include <vtkInteractorStyleImage.h>
5 #include <vtkOrientationMarkerWidget.h>
6 #include <vtkPropPicker.h>
7 #include <vtkSmartPointer.h>
10 #include <vtkInteractorStyleImage.h>
11 #include <vtkLineWidget2.h>
12 #include <vtkLineRepresentation.h>
21 namespace Visualization
23 class ImageSliceActors;
28 class ImageInteractorStyle
29 : public vtkInteractorStyleImage
32 typedef ImageInteractorStyle Self;
41 vtkTypeMacro( ImageInteractorStyle, vtkInteractorStyleImage );
47 ImageSliceActors* slice_actors,
48 MPRActors* mpr_actors = NULL
51 void SetModeToNavigation( );
52 void SetModeToDeformation( );
53 virtual void SetInteractor(
54 vtkRenderWindowInteractor* interactor, const int& axis
58 // Event bindings controlling the effects of pressing mouse buttons
59 // or moving the mouse.
60 virtual void OnMouseMove( );
61 virtual void OnLeftButtonDown( );
62 virtual void OnLeftButtonUp( );
63 virtual void OnMiddleButtonDown( );
64 virtual void OnMiddleButtonUp( );
65 virtual void OnRightButtonDown( );
66 virtual void OnRightButtonUp( );
67 virtual void OnMouseWheelForward( );
68 virtual void OnMouseWheelBackward( );
71 // Override the "fly-to" (f keypress) for images.
72 virtual void OnChar( );
74 // These methods for the different interactions in different modes
75 // are overridden in subclasses to perform the correct motion. Since
76 // they might be called from OnTimer, they do not have mouse coord
77 // parameters (use interactor's GetEventPosition and
78 // GetLastEventPosition)
79 virtual void Rotate( );
83 virtual void WindowLevel( );
85 virtual void Slice( );
87 // Interaction mode entry points used internally.
88 virtual void StartWindowLevel( );
89 virtual void EndWindowLevel( );
90 virtual void StartPick( );
91 virtual void EndPick( );
92 virtual void StartSlice( );
93 virtual void EndSlice( );
96 ImageInteractorStyle( );
97 virtual ~ImageInteractorStyle( );
99 bool _PickPosition( double pos[ 3 ] );
100 void _UpdateCursor( );
103 // Purposely not implemented
104 ImageInteractorStyle( const Self& );
105 Self& operator=( const Self& );
108 Self::InteractionMode Mode;
110 ImageSliceActors* m_SliceActors;
111 MPRActors* m_MPRActors;
113 vtkSmartPointer< vtkOrientationMarkerWidget > OrientationWidget;
114 vtkSmartPointer< vtkPropPicker > PropPicker;
117 static const int SliceEvent;
126 #endif // __CPPLUGINS__EXTENSIONS__VISUALIZATION__IMAGEINTERACTORSTYLE__H__