]> Creatis software - creaMaracasVisu.git/blob - lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkInteractorStyleBaseView3D.cxx
*** empty log message ***
[creaMaracasVisu.git] / lib / maracasVisuLib / src / interface / wxWindows / widgets / vtkInteractorStyleBaseView3D.cxx
1
2 #include "vtkInteractorStyleBaseView3D.h"
3
4 #include "vtkObjectFactory.h"
5
6 vtkStandardNewMacro(vtkInteractorStyleBaseView3D);
7
8 //---------------------------------------------------------------------------
9 vtkInteractorStyleBaseView3D::vtkInteractorStyleBaseView3D(){
10 }
11 //---------------------------------------------------------------------------
12 vtkInteractorStyleBaseView3D::~vtkInteractorStyleBaseView3D(){
13 }
14 //---------------------------------------------------------------------------
15 void  vtkInteractorStyleBaseView3D::OnRightButtonDown ()
16 {    
17         vtkInteractorStyleBaseView::OnRightButtonDown();
18
19 /*
20                 if (GetInteractor()->GetControlKey()==1 ){
21                         this->vtkInteractorStyleTrackballCamera::OnRightButtonDown();
22                 }
23 */
24   this->FindPokedRenderer(this->Interactor->GetEventPosition()[0], 
25                           this->Interactor->GetEventPosition()[1]);
26
27   if (this->CurrentRenderer == NULL)
28     {
29     return;
30     }
31
32   if (this->Interactor->GetControlKey()) {
33       this->StartDolly();
34   }
35
36 }
37 //---------------------------------------------------------------------------
38 void  vtkInteractorStyleBaseView3D::OnRightButtonUp () 
39 {
40         vtkInteractorStyleBaseView::OnRightButtonUp();
41
42 /*
43                 if (GetInteractor()->GetControlKey()==1 ){
44                         this->vtkInteractorStyleTrackballCamera::OnRightButtonUp();
45                 }
46 */
47
48                 
49   switch (this->State) 
50     {
51     case VTKIS_DOLLY:
52       this->EndDolly();
53       break;
54     }
55 }
56 //---------------------------------------------------------------------------
57 void  vtkInteractorStyleBaseView3D::OnMouseMove () 
58 {
59         vtkInteractorStyleBaseView::OnMouseMove();
60
61 //              this->vtkInteractorStyleTrackballCamera::OnMouseMove();
62
63  // int x = this->Interactor->GetEventPosition()[0]; // JPRx
64  // int y = this->Interactor->GetEventPosition()[1]; // JPRx
65
66
67  // vtkRenderWindowInteractor *rwi = this->Interactor;
68
69  // int lx =  rwi->GetLastEventPosition()[0]; // JPRx
70  // int ly =  rwi->GetLastEventPosition()[1]; // JPRx
71  // int dx = rwi->GetEventPosition()[0] ; // JPRx
72  // int dy = rwi->GetEventPosition()[1] ; // JPRx
73
74
75   switch (this->State) 
76     {
77     case VTKIS_ROTATE:
78  //     this->FindPokedRenderer(x, y);
79       this->Rotate();
80  //     this->InvokeEvent(vtkCommand::InteractionEvent, NULL);
81       break;
82
83     case VTKIS_PAN:
84  //     this->FindPokedRenderer(x, y);
85       this->Pan();
86  //     this->InvokeEvent(vtkCommand::InteractionEvent, NULL);
87       break;
88
89     case VTKIS_DOLLY:
90  //     this->FindPokedRenderer(x, y);
91       this->Dolly();
92  //     this->InvokeEvent(vtkCommand::InteractionEvent, NULL);
93       break;
94
95     case VTKIS_SPIN:
96  //     this->FindPokedRenderer(x, y);
97       this->Spin();
98  //     this->InvokeEvent(vtkCommand::InteractionEvent, NULL);
99       break;
100     }
101
102
103
104 }
105 //---------------------------------------------------------------------------
106 void  vtkInteractorStyleBaseView3D::OnLeftButtonDown ()
107 {
108         vtkInteractorStyleBaseView::OnLeftButtonDown();
109 /*
110                 if (GetInteractor()->GetControlKey()==1 ){
111                         this->vtkInteractorStyleTrackballCamera::OnMiddleButtonDown();
112                 } else {
113                         this->vtkInteractorStyleTrackballCamera::OnLeftButtonDown();
114                 }
115 */
116
117
118   this->FindPokedRenderer(this->Interactor->GetEventPosition()[0], 
119                           this->Interactor->GetEventPosition()[1]);
120   if (this->CurrentRenderer == NULL)
121     {
122     return;
123     }
124
125   if (this->Interactor->GetControlKey()) {
126       this->StartPan();
127   } else {
128       this->StartRotate();
129   }
130
131  /* 
132   if (this->Interactor->GetShiftKey()) 
133     {
134     if (this->Interactor->GetControlKey()) 
135       {
136       this->StartDolly();
137       }
138     else 
139       {
140       this->StartPan();
141       }
142     } 
143   else 
144     {
145     if (this->Interactor->GetControlKey()) 
146       {
147       this->StartSpin();
148       }
149     else 
150       {
151       this->StartRotate();
152       }
153     }
154 */
155
156
157 }
158 //---------------------------------------------------------------------------
159 void  vtkInteractorStyleBaseView3D::OnLeftButtonUp () 
160 {
161         vtkInteractorStyleBaseView::OnLeftButtonUp();
162
163 /*
164                 if (GetInteractor()->GetControlKey()==1 ){
165                         this->vtkInteractorStyleTrackballCamera::OnMiddleButtonUp();
166                 } else {
167                         this->vtkInteractorStyleTrackballCamera::OnLeftButtonUp();
168                 }
169 */
170   switch (this->State) 
171     {
172
173     case VTKIS_PAN:
174       this->EndPan();
175       break;
176
177     case VTKIS_ROTATE:
178       this->EndRotate();
179       break;
180     }
181 }
182 //---------------------------------------------------------------------------
183 void  vtkInteractorStyleBaseView3D::OnMiddleButtonDown () 
184 {
185         vtkInteractorStyleBaseView::OnMiddleButtonDown();
186         //              this->vtkInteractorStyleTrackballCamera::OnMiddleButtonDown();
187 }
188 //---------------------------------------------------------------------------
189 void  vtkInteractorStyleBaseView3D::OnMiddleButtonUp () 
190 {
191         vtkInteractorStyleBaseView::OnMiddleButtonUp();
192
193         //              this->vtkInteractorStyleTrackballCamera::OnMiddleButtonUp();
194 }