3 #include "vtkInteractorStylePlane2D.h"
4 #include "vtkPlane2DView.h"
6 vtkInteractorStylePlane2D::vtkInteractorStylePlane2D()
10 //---------------------------------------------------------------------------
11 vtkInteractorStylePlane2D::~vtkInteractorStylePlane2D()
15 //---------------------------------------------------------------------------
16 bool vtkInteractorStylePlane2D::GetStateRotate()
21 //---------------------------------------------------------------------------
22 bool vtkInteractorStylePlane2D::OnLeftButtonDown() // vitual
25 _fordwareX = _vtkInteractorStyleBaseView->GetInteractor()->GetEventPosition()[0];
26 _fordwareY = _vtkInteractorStyleBaseView->GetInteractor()->GetEventPosition()[1];
27 vtkPlane2DView *vtkplane2Dview = (vtkPlane2DView*)(_vtkInteractorStyleBaseView->GetWxVtk2DBaseView());
28 vtkplane2Dview->RotationStart();
33 //---------------------------------------------------------------------------
34 bool vtkInteractorStylePlane2D::OnLeftButtonUp() // virtual
36 if (_stateRotate==true)
39 vtkPlane2DView *vtkplane2Dview = (vtkPlane2DView*)(_vtkInteractorStyleBaseView->GetWxVtk2DBaseView());
40 vtkplane2Dview->ResetBack();
41 // this->_vtkInteractorStyleBaseView->SetParent_refresh_waiting();
47 //---------------------------------------------------------------------------
48 bool vtkInteractorStylePlane2D::OnRightButtonUp() // virtual
50 if (_stateRotate==true){
51 //vtkPlane2DView *vtkplane2Dview = (vtkPlane2DView*)(_vtkInteractorStyleBaseView->GetWxVtk2DBaseView()); // JPRx
54 // vtkplane2Dview->RotationEnd();
61 //---------------------------------------------------------------------------
62 bool vtkInteractorStylePlane2D::OnMouseMove () // virtual
65 if (_stateRotate==true){
68 if (_vtkInteractorStyleBaseView->GetInteractor()->GetControlKey()==1)
72 if (_vtkInteractorStyleBaseView->GetInteractor()->GetShiftKey()==1)
76 int fx = _vtkInteractorStyleBaseView->GetInteractor()->GetEventPosition()[0];
77 int fy = _vtkInteractorStyleBaseView->GetInteractor()->GetEventPosition()[1];
78 vtkPlane2DView *vtkplane2Dview = (vtkPlane2DView*)(_vtkInteractorStyleBaseView->GetWxVtk2DBaseView());
79 vtkplane2Dview->RotationDrag( fx - _fordwareX , fy - _fordwareY , ok_v , ok_ang);
80 this->_vtkInteractorStyleBaseView->SetParent_refresh_waiting();
84 //-------------------------------------------------------------------
85 bool vtkInteractorStylePlane2D::OnLeftDClick() // virtual
87 int fx = _vtkInteractorStyleBaseView->GetInteractor()->GetEventPosition()[0];
88 int fy = _vtkInteractorStyleBaseView->GetInteractor()->GetEventPosition()[1];
93 vtkPlane2DView *vtkplane2Dview = (vtkPlane2DView*)(_vtkInteractorStyleBaseView->GetWxVtk2DBaseView());
94 vtkMPRBaseData *vtkmprbasedata = vtkplane2Dview->GetVtkmprbasedata();
96 vtkplane2Dview->TransfromCoordViewWorld2(xx,yy,zz);
98 vtkmprbasedata->SetX( xx );
99 vtkmprbasedata->SetY( yy );
100 vtkmprbasedata->SetZ( zz );
101 this->_vtkInteractorStyleBaseView->SetParent_refresh_waiting();