]> Creatis software - clitk.git/blob - vv/vvInteractorStyleNavigator.h
Removed QVTKWidget, added installed libs for win
[clitk.git] / vv / vvInteractorStyleNavigator.h
1 /*=========================================================================
2
3  Program:   vv
4  Language:  C++
5  Author :   Pierre Seroul (pierre.seroul@gmail.com)
6
7 Copyright (C) 2008
8 Léon Bérard cancer center http://oncora1.lyon.fnclcc.fr
9 CREATIS-LRMN http://www.creatis.insa-lyon.fr
10
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.
14
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.
19
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/>.
22
23 =========================================================================*/
24 #ifndef __vvInteractorStyleNavigator_h
25 #define __vvInteractorStyleNavigator_h
26
27 #include "vtkInteractorStyle.h"
28
29 // Motion flags
30
31 #define VTKIS_WINDOW_LEVEL 1024
32 #define VTKIS_PICK         1025
33
34 class vvInteractorStyleNavigator : public vtkInteractorStyle
35
36 {
37 public:
38     static vvInteractorStyleNavigator *New();
39     vtkTypeRevisionMacro(vvInteractorStyleNavigator, vtkInteractorStyle);
40     void PrintSelf(ostream& os, vtkIndent indent);
41
42     // Description:
43     // Some useful information for handling window level
44     vtkGetVector2Macro(WindowLevelStartPosition,int);
45     vtkGetVector2Macro(WindowLevelCurrentPosition,int);
46
47     // Description:
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();
61
62     // Description:
63     // Override the "fly-to" (f keypress) for images.
64     virtual void OnChar();
65
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();
71     virtual void Pick();
72
73     // Interaction mode entry points used internally.
74     virtual void StartWindowLevel();
75     virtual void EndWindowLevel();
76     virtual void StartPick();
77     virtual void EndPick();
78     virtual void Dolly();
79     virtual void Pan();
80
81     // We need to reimplement this because otherwise it returns the top renderer,
82     // not the active one
83     virtual void FindPokedRenderer(int, int);
84
85 protected:
86     vvInteractorStyleNavigator();
87     ~vvInteractorStyleNavigator();
88
89     static void ProcessEvents(vtkObject* object,
90                               unsigned long event,
91                               void* clientdata,
92                               void* calldata);
93
94     double MotionFactor;
95
96     virtual void Dolly(double factor);
97
98     int WindowLevelStartPosition[2];
99     int WindowLevelCurrentPosition[2];
100
101 private:
102     vvInteractorStyleNavigator(const vvInteractorStyleNavigator&);  // Not implemented.
103     void operator=(const vvInteractorStyleNavigator&);  // Not implemented.
104 };
105
106 #endif