2 #include "manualInteractorWindowLevel.h"
3 #include "wxVtk2DBaseView.h"
4 //-------------------------------------------------------------------
5 //-------------------------------------------------------------------
6 //-------------------------------------------------------------------
8 manualInteractorWindowLevel::manualInteractorWindowLevel()
10 _stateWindowLevel = false;
17 //-------------------------------------------------------------------
19 manualInteractorWindowLevel::~manualInteractorWindowLevel()
23 //-------------------------------------------------------------------
25 bool manualInteractorWindowLevel::OnMouseMove() // virtual
28 if (_stateWindowLevel==true)
31 wxVTKRenderWindowInteractor *wxVTKiren;
32 wxVTKiren = _vtkInteractorStyleBaseView->GetWxVtk2DBaseView()->GetWxVTKRenderWindowInteractor();
33 wxVTKiren->GetEventPosition( tmpPx , tmpPy );
34 int colorWin=_backWindow - 2*( _backPx - tmpPx );
35 int colorLev=_backLevel + 2*( _backPy - tmpPy );
54 vtkImageViewer2 *vtkimageviewer2;
55 vtkimageviewer2=((wxVtk2DBaseView*)_vtkInteractorStyleBaseView->GetWxVtk2DBaseView())->_imageViewer2XYZ->GetVtkImageViewer2();
56 vtkimageviewer2->SetColorWindow(colorWin);
57 vtkimageviewer2->SetColorLevel(colorLev);
58 // vtkimageviewer2->Render();
63 //-------------------------------------------------------------------
65 bool manualInteractorWindowLevel::OnMiddleButtonDown() // virtual
67 if ((_vtkInteractorStyleBaseView->GetInteractor()->GetControlKey()==0) &&
68 (_vtkInteractorStyleBaseView->GetInteractor()->GetShiftKey()==0) ){
70 _stateWindowLevel = true;
71 wxVTKRenderWindowInteractor *wxVTKiren;
72 wxVTKiren = _vtkInteractorStyleBaseView->GetWxVtk2DBaseView()->GetWxVTKRenderWindowInteractor();
73 wxVTKiren->GetEventPosition( _backPx , _backPy );
75 _backWindow = (int)(((wxVtk2DBaseView*)_vtkInteractorStyleBaseView->GetWxVtk2DBaseView())->_imageViewer2XYZ->GetVtkImageViewer2()->GetColorWindow());
76 _backLevel = (int)(((wxVtk2DBaseView*)_vtkInteractorStyleBaseView->GetWxVtk2DBaseView())->_imageViewer2XYZ->GetVtkImageViewer2()->GetColorLevel());
81 //-------------------------------------------------------------------
83 bool manualInteractorWindowLevel::OnMiddleButtonUp() // virtual
85 if (_stateWindowLevel==true)
87 _stateWindowLevel=false;