]> Creatis software - creaMaracasVisu.git/blob - lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkInteractorScrollZ.cxx
*** empty log message ***
[creaMaracasVisu.git] / lib / maracasVisuLib / src / interface / wxWindows / widgets / vtkInteractorScrollZ.cxx
1
2 #include "vtkInteractorScrollZ.h"
3 #include "wxVtk2DBaseView.h"
4 //---------------------------------------------------------------------------
5 //---------------------------------------------------------------------------
6 //---------------------------------------------------------------------------
7
8 vtkInteractorScrollZ::vtkInteractorScrollZ()
9 {
10         _stateFordware=false;
11 }
12 //---------------------------------------------------------------------------
13 vtkInteractorScrollZ::~vtkInteractorScrollZ()
14 {
15 }
16 //---------------------------------------------------------------------------
17 bool vtkInteractorScrollZ::OnRightButtonDown()
18 {    
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];
26                 /*JCP 14/05/2009
27                 _sliceZ         = _vtkInteractorStyleBaseView->GetWxVtk2DBaseView()->GetActualSlice();
28                 */
29                 _sliceZ         = ((wxVtk2DBaseView*)_vtkInteractorStyleBaseView->GetWxVtk2DBaseView())->GetActualSlice();
30         }
31         return true;
32 }
33 //---------------------------------------------------------------------------
34 bool vtkInteractorScrollZ::OnRightButtonUp() 
35 {
36         _stateFordware=false;
37         return true;
38 }
39 //---------------------------------------------------------------------------
40 bool vtkInteractorScrollZ::OnMouseMove () 
41 {
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;
47                 /*JCP 14/05/2009
48                 _vtkInteractorStyleBaseView->GetWxVtk2DBaseView()->SetActualSlice( _sliceZ + delta);
49                 */
50                 ((wxVtk2DBaseView*)_vtkInteractorStyleBaseView->GetWxVtk2DBaseView())->SetActualSlice( _sliceZ + delta);
51
52                 this->_vtkInteractorStyleBaseView->SetParent_refresh_waiting();
53
54         //      wxCommandEvent newevent(wxEVT_COMMAND_MENU_SELECTED,12121);
55         //      _vtkInteractorStyleBaseView->GetWxVtk2DBaseView()->GetWxVTKRenderWindowInteractor()->GetParent()->ProcessEvent(newevent);
56
57                 //_wxvtk2Dbaseview->Refresh();
58         } 
59         return true;
60 }
61
62
63