2 #include "vtkInteractorStyleBaseView3D.h"
4 #include "vtkObjectFactory.h"
6 vtkStandardNewMacro(vtkInteractorStyleBaseView3D);
8 //---------------------------------------------------------------------------
9 vtkInteractorStyleBaseView3D::vtkInteractorStyleBaseView3D(){
11 //---------------------------------------------------------------------------
12 vtkInteractorStyleBaseView3D::~vtkInteractorStyleBaseView3D(){
14 //---------------------------------------------------------------------------
15 void vtkInteractorStyleBaseView3D::OnRightButtonDown ()
17 vtkInteractorStyleBaseView::OnRightButtonDown();
20 if (GetInteractor()->GetControlKey()==1 ){
21 this->vtkInteractorStyleTrackballCamera::OnRightButtonDown();
24 this->FindPokedRenderer(this->Interactor->GetEventPosition()[0],
25 this->Interactor->GetEventPosition()[1]);
27 if (this->CurrentRenderer == NULL)
32 if (this->Interactor->GetControlKey()) {
37 //---------------------------------------------------------------------------
38 void vtkInteractorStyleBaseView3D::OnRightButtonUp ()
40 vtkInteractorStyleBaseView::OnRightButtonUp();
43 if (GetInteractor()->GetControlKey()==1 ){
44 this->vtkInteractorStyleTrackballCamera::OnRightButtonUp();
56 //---------------------------------------------------------------------------
57 void vtkInteractorStyleBaseView3D::OnMouseMove ()
59 vtkInteractorStyleBaseView::OnMouseMove();
61 // this->vtkInteractorStyleTrackballCamera::OnMouseMove();
63 // int x = this->Interactor->GetEventPosition()[0]; // JPRx
64 // int y = this->Interactor->GetEventPosition()[1]; // JPRx
67 // vtkRenderWindowInteractor *rwi = this->Interactor;
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
78 // this->FindPokedRenderer(x, y);
80 // this->InvokeEvent(vtkCommand::InteractionEvent, NULL);
84 // this->FindPokedRenderer(x, y);
86 // this->InvokeEvent(vtkCommand::InteractionEvent, NULL);
90 // this->FindPokedRenderer(x, y);
92 // this->InvokeEvent(vtkCommand::InteractionEvent, NULL);
96 // this->FindPokedRenderer(x, y);
98 // this->InvokeEvent(vtkCommand::InteractionEvent, NULL);
105 //---------------------------------------------------------------------------
106 void vtkInteractorStyleBaseView3D::OnLeftButtonDown()
108 // printf("EED creaMaracasVisu::vtkInteractorStyleBaseView3D::OnLeftButtonDown \n");
109 vtkInteractorStyleBaseView::OnLeftButtonDown();
111 if (GetInteractor()->GetControlKey()==1 ){
112 this->vtkInteractorStyleTrackballCamera::OnMiddleButtonDown();
114 this->vtkInteractorStyleTrackballCamera::OnLeftButtonDown();
119 this->FindPokedRenderer(this->Interactor->GetEventPosition()[0],
120 this->Interactor->GetEventPosition()[1]);
121 if (this->CurrentRenderer == NULL)
127 if ((GetInteractor()->GetControlKey()==0) && (GetInteractor()->GetShiftKey()==1) )
129 this->vtkInteractorStyleImage::OnLeftButtonDown();
133 if (this->Interactor->GetControlKey()) {
143 if (this->Interactor->GetShiftKey())
145 if (this->Interactor->GetControlKey())
156 if (this->Interactor->GetControlKey())
169 //---------------------------------------------------------------------------
170 void vtkInteractorStyleBaseView3D::OnLeftButtonUp ()
172 vtkInteractorStyleBaseView::OnLeftButtonUp();
175 if (GetInteractor()->GetControlKey()==1 ){
176 this->vtkInteractorStyleTrackballCamera::OnMiddleButtonUp();
178 this->vtkInteractorStyleTrackballCamera::OnLeftButtonUp();
193 //---------------------------------------------------------------------------
194 void vtkInteractorStyleBaseView3D::OnMiddleButtonDown ()
196 vtkInteractorStyleBaseView::OnMiddleButtonDown();
197 // this->vtkInteractorStyleTrackballCamera::OnMiddleButtonDown();
199 //---------------------------------------------------------------------------
200 void vtkInteractorStyleBaseView3D::OnMiddleButtonUp ()
202 vtkInteractorStyleBaseView::OnMiddleButtonUp();
204 // this->vtkInteractorStyleTrackballCamera::OnMiddleButtonUp();
208 //---------------------------------------------------------------------------
209 void vtkInteractorStyleBaseView3D::OnMouseWheelForward () // virtual
211 vtkInteractorStyleBaseView::OnMouseWheelForward();
212 if ((GetInteractor()->GetControlKey()==0) || (GetInteractor()->GetShiftKey()==0) )
214 this->vtkInteractorStyleImage::OnMouseWheelForward();
218 //---------------------------------------------------------------------------
219 void vtkInteractorStyleBaseView3D::OnMouseWheelBackward () // virtual
221 vtkInteractorStyleBaseView::OnMouseWheelBackward();
222 if ((GetInteractor()->GetControlKey()==0) || (GetInteractor()->GetShiftKey()==0) )
224 this->vtkInteractorStyleImage::OnMouseWheelBackward();