1 /*=========================================================================
5 Author : Pierre Seroul (pierre.seroul@gmail.com)
8 Léon Bérard cancer center http://oncora1.lyon.fnclcc.fr
9 CREATIS-LRMN http://www.creatis.insa-lyon.fr
11 This program is free software: you can redistribute it and/or modify
12 it under the terms of the GNU General Public License as published by
13 the Free Software Foundation, version 3 of the License.
15 This program is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU General Public License for more details.
20 You should have received a copy of the GNU General Public License
21 along with this program. If not, see <http://www.gnu.org/licenses/>.
23 =========================================================================*/
24 #ifndef __vvInteractorStyleNavigator_h
25 #define __vvInteractorStyleNavigator_h
27 #include "vtkInteractorStyle.h"
31 #define VTKIS_WINDOW_LEVEL 1024
32 #define VTKIS_PICK 1025
34 class vvInteractorStyleNavigator : public vtkInteractorStyle
38 static vvInteractorStyleNavigator *New();
39 vtkTypeRevisionMacro(vvInteractorStyleNavigator, vtkInteractorStyle);
40 void PrintSelf(ostream& os, vtkIndent indent);
43 // Some useful information for handling window level
44 vtkGetVector2Macro(WindowLevelStartPosition,int);
45 vtkGetVector2Macro(WindowLevelCurrentPosition,int);
48 // Event bindings controlling the effects of pressing mouse buttons
49 // or moving the mouse.
50 virtual void OnMouseMove();
51 virtual void OnLeftButtonDown();
52 virtual void OnLeftButtonUp();
53 virtual void OnRightButtonDown();
54 virtual void OnRightButtonUp();
55 virtual void OnMiddleButtonDown();
56 virtual void OnMiddleButtonUp();
57 virtual void OnEnter();
58 virtual void OnLeave();
59 virtual void OnMouseWheelForward();
60 virtual void OnMouseWheelBackward();
63 // Override the "fly-to" (f keypress) for images.
64 virtual void OnChar();
66 // These methods for the different interactions in different modes
67 // are overridden in subclasses to perform the correct motion. Since
68 // they might be called from OnTimer, they do not have mouse coord parameters
69 // (use interactor's GetEventPosition and GetLastEventPosition)
70 virtual void WindowLevel();
73 // Interaction mode entry points used internally.
74 virtual void StartWindowLevel();
75 virtual void EndWindowLevel();
76 virtual void StartPick();
77 virtual void EndPick();
81 // We need to reimplement this because otherwise it returns the top renderer,
83 virtual void FindPokedRenderer(int, int);
86 vvInteractorStyleNavigator();
87 ~vvInteractorStyleNavigator();
89 static void ProcessEvents(vtkObject* object,
96 virtual void Dolly(double factor);
98 int WindowLevelStartPosition[2];
99 int WindowLevelCurrentPosition[2];
102 vvInteractorStyleNavigator(const vvInteractorStyleNavigator&); // Not implemented.
103 void operator=(const vvInteractorStyleNavigator&); // Not implemented.