vtkInteractorScrollZ.cxx

Go to the documentation of this file.
00001 
00002 #include "vtkInteractorScrollZ.h"
00003 #include "wxVtk2DBaseView.h"
00004 //---------------------------------------------------------------------------
00005 //---------------------------------------------------------------------------
00006 //---------------------------------------------------------------------------
00007 
00008 vtkInteractorScrollZ::vtkInteractorScrollZ()
00009 {
00010         _stateFordware=false;
00011 }
00012 //---------------------------------------------------------------------------
00013 vtkInteractorScrollZ::~vtkInteractorScrollZ()
00014 {
00015 }
00016 //---------------------------------------------------------------------------
00017 bool vtkInteractorScrollZ::OnRightButtonDown()
00018 {    
00019         vtkRenderWindowInteractor *interactor = _vtkInteractorStyleBaseView->GetInteractor();
00020         if ((interactor->GetControlKey()==0) && (interactor->GetShiftKey()==0) ){
00021                 _stateFordware  = true;
00022                 _fordwareX      = interactor->GetEventPosition()[0];
00023                 _fordwareY      = interactor->GetEventPosition()[1];
00024                 /*JCP 14/05/2009
00025                 _sliceZ         = _vtkInteractorStyleBaseView->GetWxVtk2DBaseView()->GetActualSlice();
00026                 */
00027                 _sliceZ         = ((wxVtk2DBaseView*)_vtkInteractorStyleBaseView->GetWxVtk2DBaseView())->GetActualSlice();
00028         }
00029         return true;
00030 }
00031 //---------------------------------------------------------------------------
00032 bool vtkInteractorScrollZ::OnRightButtonUp() 
00033 {
00034         _stateFordware=false;
00035         return true;
00036 }
00037 //---------------------------------------------------------------------------
00038 bool vtkInteractorScrollZ::OnMouseMove () 
00039 {
00040         if (_stateFordware==true){
00041             //int fx = _vtkInteractorStyleBaseView->GetInteractor()->GetEventPosition()[0];  // JPRx
00042         int fy = _vtkInteractorStyleBaseView->GetInteractor()->GetEventPosition()[1];
00043                 int delta = (_fordwareY - fy)/3;
00044                 /*JCP 14/05/2009
00045                 _vtkInteractorStyleBaseView->GetWxVtk2DBaseView()->SetActualSlice( _sliceZ + delta);
00046                 */
00047                 ((wxVtk2DBaseView*)_vtkInteractorStyleBaseView->GetWxVtk2DBaseView())->SetActualSlice( _sliceZ + delta);
00048 
00049                 this->_vtkInteractorStyleBaseView->SetParent_refresh_waiting();
00050 
00051         //      wxCommandEvent newevent(wxEVT_COMMAND_MENU_SELECTED,12121);
00052         //      _vtkInteractorStyleBaseView->GetWxVtk2DBaseView()->GetWxVTKRenderWindowInteractor()->GetParent()->ProcessEvent(newevent);
00053 
00054                 //_wxvtk2Dbaseview->Refresh();
00055         } 
00056         return true;
00057 }
00058 
00059 
00060 

Generated on 18 Mar 2010 for creaMaracasVisu_lib by  doxygen 1.6.1