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