2 #include "vtkInteractorScrollZ.h"
3 #include "wxVtk2DBaseView.h"
4 //---------------------------------------------------------------------------
5 //---------------------------------------------------------------------------
6 //---------------------------------------------------------------------------
8 vtkInteractorScrollZ::vtkInteractorScrollZ()
12 //---------------------------------------------------------------------------
13 vtkInteractorScrollZ::~vtkInteractorScrollZ()
16 //---------------------------------------------------------------------------
17 bool vtkInteractorScrollZ::OnRightButtonDown()
19 vtkRenderWindowInteractor *interactor = _vtkInteractorStyleBaseView->GetInteractor();
20 printf("EED %p vtkInteractorScrollZ::OnRightButtonDown A", this );
21 if ((interactor->GetControlKey()==0) && (interactor->GetShiftKey()==0) ){
22 printf("EED %p vtkInteractorScrollZ::OnRightButtonDown B", this );
23 _stateFordware = true;
24 _fordwareX = interactor->GetEventPosition()[0];
25 _fordwareY = interactor->GetEventPosition()[1];
27 _sliceZ = _vtkInteractorStyleBaseView->GetWxVtk2DBaseView()->GetActualSlice();
29 _sliceZ = ((wxVtk2DBaseView*)_vtkInteractorStyleBaseView->GetWxVtk2DBaseView())->GetActualSlice();
33 //---------------------------------------------------------------------------
34 bool vtkInteractorScrollZ::OnRightButtonUp()
39 //---------------------------------------------------------------------------
40 bool vtkInteractorScrollZ::OnMouseMove ()
42 if (_stateFordware==true){
43 printf("EED %p vtkInteractorScrollZ::OnMouseMove \n", this);
44 //int fx = _vtkInteractorStyleBaseView->GetInteractor()->GetEventPosition()[0]; // JPRx
45 int fy = _vtkInteractorStyleBaseView->GetInteractor()->GetEventPosition()[1];
46 int delta = (_fordwareY - fy)/3;
48 _vtkInteractorStyleBaseView->GetWxVtk2DBaseView()->SetActualSlice( _sliceZ + delta);
50 ((wxVtk2DBaseView*)_vtkInteractorStyleBaseView->GetWxVtk2DBaseView())->SetActualSlice( _sliceZ + delta);
52 this->_vtkInteractorStyleBaseView->SetParent_refresh_waiting();
54 // wxCommandEvent newevent(wxEVT_COMMAND_MENU_SELECTED,12121);
55 // _vtkInteractorStyleBaseView->GetWxVtk2DBaseView()->GetWxVTKRenderWindowInteractor()->GetParent()->ProcessEvent(newevent);
57 //_wxvtk2Dbaseview->Refresh();