]> Creatis software - clitk.git/blob - vv/vvInteractorStyleNavigator.h
Debug RTStruct conversion with empty struc
[clitk.git] / vv / vvInteractorStyleNavigator.h
1 /*=========================================================================
2   Program:   vv                     http://www.creatis.insa-lyon.fr/rio/vv
3
4   Authors belong to: 
5   - University of LYON              http://www.universite-lyon.fr/
6   - Léon Bérard cancer center       http://www.centreleonberard.fr
7   - CREATIS CNRS laboratory         http://www.creatis.insa-lyon.fr
8
9   This software is distributed WITHOUT ANY WARRANTY; without even
10   the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
11   PURPOSE.  See the copyright notices for more information.
12
13   It is distributed under dual licence
14
15   - BSD        See included LICENSE.txt file
16   - CeCILL-B   http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
17 ===========================================================================**/
18 #ifndef __vvInteractorStyleNavigator_h
19 #define __vvInteractorStyleNavigator_h
20 #include "vtkInteractorStyle.h"
21
22 // Motion flags
23
24 #define VTKIS_WINDOW_LEVEL 1024
25 #define VTKIS_PICK_NEW     1025
26
27 class vvInteractorStyleNavigator : public vtkInteractorStyle
28
29 {
30 public:
31     static vvInteractorStyleNavigator *New();
32     vtkTypeMacro(vvInteractorStyleNavigator, vtkInteractorStyle);
33     void PrintSelf(ostream& os, vtkIndent indent);
34
35     // Description:
36     // Some useful information for handling window level
37     vtkGetVector2Macro(WindowLevelStartPosition,int);
38     vtkGetVector2Macro(WindowLevelCurrentPosition,int);
39
40     // Description:
41     // Event bindings controlling the effects of pressing mouse buttons
42     // or moving the mouse.
43     virtual void OnMouseMove();
44     virtual void OnLeftButtonDown();
45     virtual void OnLeftButtonUp();
46     virtual void OnRightButtonDown();
47     virtual void OnRightButtonUp();
48     virtual void OnMiddleButtonDown();
49     virtual void OnMiddleButtonUp();
50     virtual void OnEnter();
51     virtual void OnLeave();
52     virtual void OnMouseWheelForward();
53     virtual void OnMouseWheelBackward();
54
55     // Description:
56     // Override the "fly-to" (f keypress) for images.
57     virtual void OnChar();
58
59     // These methods for the different interactions in different modes
60     // are overridden in subclasses to perform the correct motion. Since
61     // they might be called from OnTimer, they do not have mouse coord parameters
62     // (use interactor's GetEventPosition and GetLastEventPosition)
63     virtual void WindowLevel();
64     virtual void Pick();
65
66     // Interaction mode entry points used internally.
67     virtual void StartWindowLevel();
68     virtual void EndWindowLevel();
69     virtual void StartPick();
70     virtual void EndPick();
71     virtual void Dolly();
72     virtual void Pan();
73
74     // We need to reimplement this because otherwise it returns the top renderer,
75     // not the active one
76     virtual void FindPokedRenderer(int, int);
77
78 protected:
79     vvInteractorStyleNavigator();
80     ~vvInteractorStyleNavigator();
81
82     static void ProcessEvents(vtkObject* object,
83                               unsigned long event,
84                               void* clientdata,
85                               void* calldata);
86
87     double MotionFactor;
88
89     virtual void Dolly(double factor);
90
91     int WindowLevelStartPosition[2];
92     int WindowLevelCurrentPosition[2];
93
94 private:
95     vvInteractorStyleNavigator(const vvInteractorStyleNavigator&);  // Not implemented.
96     void operator=(const vvInteractorStyleNavigator&);  // Not implemented.
97 };
98
99 #endif