]> Creatis software - creaMaracasVisu.git/blob - lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkInteractorStyleBaseView2D.cxx
5971990bd1adda41d4618b7da269478202d8d5bb
[creaMaracasVisu.git] / lib / maracasVisuLib / src / interface / wxWindows / widgets / vtkInteractorStyleBaseView2D.cxx
1
2
3 #include "vtkInteractorStyleBaseView2D.h"
4 #include <vtkObjectFactory.h>
5
6 vtkStandardNewMacro(vtkInteractorStyleBaseView2D);
7
8 //---------------------------------------------------------------------------
9 vtkInteractorStyleBaseView2D::vtkInteractorStyleBaseView2D()
10 {
11         ////////////
12         // RaC 04-2010 This mechanism of adding new functionalities has to be made externally in order 
13         // to maintain a plugin architecture. 
14         // Remember: The manualInteractorWindowLevel changes the window level over the image
15         //           The vtkInteractorScrollZ changes the slice with right click interaction
16         //                       This vtkInteractorStyleBaseView2D gives the minimal interaction with a 2D scene
17         //
18         // _manualinteractorwindowlevel= new manualInteractorWindowLevel();
19         // AddInteractorStyleMaracas( _manualinteractorwindowlevel );
20         //
21         // _vtkInteractorScrollZ = new vtkInteractorScrollZ();
22         // AddInteractorStyleMaracas(_vtkInteractorScrollZ);
23         ////////////
24 }
25 //---------------------------------------------------------------------------
26 vtkInteractorStyleBaseView2D::~vtkInteractorStyleBaseView2D()
27 {
28 }
29
30 //---------------------------------------------------------------------------
31 void  vtkInteractorStyleBaseView2D::SetInteractorScrollZ(vtkInteractorScrollZ* interactorScroll)
32 {    
33         _vtkInteractorScrollZ = interactorScroll;
34         AddInteractorStyleMaracas(_vtkInteractorScrollZ);
35 }
36
37 //---------------------------------------------------------------------------
38 void  vtkInteractorStyleBaseView2D::SetInteractorWindowLevel(manualInteractorWindowLevel* interactorWindowLevel)
39 {    
40         _manualinteractorwindowlevel = interactorWindowLevel;
41         AddInteractorStyleMaracas(_manualinteractorwindowlevel);
42 }
43
44 //---------------------------------------------------------------------------
45 void  vtkInteractorStyleBaseView2D::OnRightButtonDown()  // virtual
46 {    
47         vtkInteractorStyleBaseView::OnRightButtonDown();
48
49         if ((GetInteractor()->GetControlKey()==1) && (GetInteractor()->GetShiftKey()==0) ){
50                 this->vtkInteractorStyleImage::OnRightButtonDown();
51         }
52 }
53
54 //---------------------------------------------------------------------------
55 void  vtkInteractorStyleBaseView2D::OnRightButtonUp()  // virtual
56 {
57         vtkInteractorStyleBaseView::OnRightButtonUp();
58         this->vtkInteractorStyleImage::OnRightButtonUp();
59 }
60 //---------------------------------------------------------------------------
61 void  vtkInteractorStyleBaseView2D::OnMouseMove () // virtual
62 {
63         vtkInteractorStyleBaseView::OnMouseMove();
64         this->vtkInteractorStyleImage::OnMouseMove();
65 }
66 //---------------------------------------------------------------------------
67 void  vtkInteractorStyleBaseView2D::OnLeftButtonDown() // virtual
68 {
69         vtkInteractorStyleBaseView::OnLeftButtonDown();
70
71         if ((GetInteractor()->GetControlKey()==0) && (GetInteractor()->GetShiftKey()==1) )
72         {
73                 this->vtkInteractorStyleImage::OnLeftButtonDown();
74         }
75 }
76 //---------------------------------------------------------------------------
77 void  vtkInteractorStyleBaseView2D::OnLeftButtonUp () // virtual
78 {
79         vtkInteractorStyleBaseView::OnLeftButtonUp();
80
81         this->vtkInteractorStyleImage::OnLeftButtonUp();
82 }
83 //---------------------------------------------------------------------------
84 void  vtkInteractorStyleBaseView2D::OnMiddleButtonDown () // virtual
85 {
86         vtkInteractorStyleBaseView::OnMiddleButtonDown();
87
88         if ((GetInteractor()->GetControlKey()==1) || (GetInteractor()->GetShiftKey()==1) )
89         {
90                 this->vtkInteractorStyleImage::OnLeftButtonDown();
91         }
92 }
93 //---------------------------------------------------------------------------
94 void vtkInteractorStyleBaseView2D::OnMiddleButtonUp () // virtual
95 {
96         vtkInteractorStyleBaseView::OnMiddleButtonUp();
97
98         if ((GetInteractor()->GetControlKey()==1) || (GetInteractor()->GetShiftKey()==1) )
99         {
100                 this->vtkInteractorStyleImage::OnLeftButtonUp();
101         }
102 }
103
104 //---------------------------------------------------------------------------
105 void vtkInteractorStyleBaseView2D::OnMouseWheelForward () // virtual
106 {
107         vtkInteractorStyleBaseView::OnMouseWheelForward();      
108         if ((GetInteractor()->GetControlKey()==0) || (GetInteractor()->GetShiftKey()==0) )
109         {
110                 this->vtkInteractorStyleImage::OnMouseWheelForward();
111         }
112 }
113
114 //---------------------------------------------------------------------------
115 void vtkInteractorStyleBaseView2D::OnMouseWheelBackward () // virtual
116 {
117         vtkInteractorStyleBaseView::OnMouseWheelBackward();     
118         if ((GetInteractor()->GetControlKey()==0) || (GetInteractor()->GetShiftKey()==0) )
119         {
120                 this->vtkInteractorStyleImage::OnMouseWheelBackward();
121         }
122 }
123
124