]> Creatis software - creaMaracasVisu.git/blob - lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkInteractorStyleBaseView3D.cxx
no 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         printf("EED creaMaracasVisu::vtkInteractorStyleBaseView3D::OnLeftButtonDown \n");
109         vtkInteractorStyleBaseView::OnLeftButtonDown();
110 /*
111                 if (GetInteractor()->GetControlKey()==1 ){
112                         this->vtkInteractorStyleTrackballCamera::OnMiddleButtonDown();
113                 } else {
114                         this->vtkInteractorStyleTrackballCamera::OnLeftButtonDown();
115                 }
116 */
117
118
119   this->FindPokedRenderer(this->Interactor->GetEventPosition()[0], 
120                           this->Interactor->GetEventPosition()[1]);
121   if (this->CurrentRenderer == NULL)
122     {
123     return;
124     }
125
126   if (this->Interactor->GetControlKey()) {
127       this->StartPan();
128   } else {
129       this->StartRotate();
130   }
131
132  /* 
133   if (this->Interactor->GetShiftKey()) 
134     {
135     if (this->Interactor->GetControlKey()) 
136       {
137       this->StartDolly();
138       }
139     else 
140       {
141       this->StartPan();
142       }
143     } 
144   else 
145     {
146     if (this->Interactor->GetControlKey()) 
147       {
148       this->StartSpin();
149       }
150     else 
151       {
152       this->StartRotate();
153       }
154     }
155 */
156
157
158 }
159 //---------------------------------------------------------------------------
160 void  vtkInteractorStyleBaseView3D::OnLeftButtonUp () 
161 {
162         vtkInteractorStyleBaseView::OnLeftButtonUp();
163
164 /*
165                 if (GetInteractor()->GetControlKey()==1 ){
166                         this->vtkInteractorStyleTrackballCamera::OnMiddleButtonUp();
167                 } else {
168                         this->vtkInteractorStyleTrackballCamera::OnLeftButtonUp();
169                 }
170 */
171   switch (this->State) 
172     {
173
174     case VTKIS_PAN:
175       this->EndPan();
176       break;
177
178     case VTKIS_ROTATE:
179       this->EndRotate();
180       break;
181     }
182 }
183 //---------------------------------------------------------------------------
184 void  vtkInteractorStyleBaseView3D::OnMiddleButtonDown () 
185 {
186         vtkInteractorStyleBaseView::OnMiddleButtonDown();
187         //              this->vtkInteractorStyleTrackballCamera::OnMiddleButtonDown();
188 }
189 //---------------------------------------------------------------------------
190 void  vtkInteractorStyleBaseView3D::OnMiddleButtonUp () 
191 {
192         vtkInteractorStyleBaseView::OnMiddleButtonUp();
193
194         //              this->vtkInteractorStyleTrackballCamera::OnMiddleButtonUp();
195 }