1 /*=========================================================================
2 Program: vv http://www.creatis.insa-lyon.fr/rio/vv
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
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.
13 It is distributed under dual licence
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"
24 #define VTKIS_WINDOW_LEVEL 1024
25 #define VTKIS_PICK 1025
27 class vvInteractorStyleNavigator : public vtkInteractorStyle
31 static vvInteractorStyleNavigator *New();
32 vtkTypeRevisionMacro(vvInteractorStyleNavigator, vtkInteractorStyle);
33 void PrintSelf(ostream& os, vtkIndent indent);
36 // Some useful information for handling window level
37 vtkGetVector2Macro(WindowLevelStartPosition,int);
38 vtkGetVector2Macro(WindowLevelCurrentPosition,int);
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();
56 // Override the "fly-to" (f keypress) for images.
57 virtual void OnChar();
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();
66 // Interaction mode entry points used internally.
67 virtual void StartWindowLevel();
68 virtual void EndWindowLevel();
69 virtual void StartPick();
70 virtual void EndPick();
74 // We need to reimplement this because otherwise it returns the top renderer,
76 virtual void FindPokedRenderer(int, int);
79 vvInteractorStyleNavigator();
80 ~vvInteractorStyleNavigator();
82 static void ProcessEvents(vtkObject* object,
89 virtual void Dolly(double factor);
91 int WindowLevelStartPosition[2];
92 int WindowLevelCurrentPosition[2];
95 vvInteractorStyleNavigator(const vvInteractorStyleNavigator&); // Not implemented.
96 void operator=(const vvInteractorStyleNavigator&); // Not implemented.