From: Eduardo Davila Date: Sun, 17 Apr 2011 08:11:33 +0000 (+0000) Subject: no message X-Git-Tag: v1.0.4~139 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=4ddb59558edddc50b36205965fe4c8f9b754f0c6;hp=df48ad0b334114b5cd4aad84ffcef91d992c00f1;p=creaMaracasVisu.git no message --- diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualPaint/vtkInteractorManualPaint.cpp b/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualPaint/vtkInteractorManualPaint.cpp index ba0a778..4d9a620 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualPaint/vtkInteractorManualPaint.cpp +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualPaint/vtkInteractorManualPaint.cpp @@ -10,7 +10,7 @@ vtkInteractorManualPaint::vtkInteractorManualPaint(ManualPaintControler* mpc) { _manualPaintControler = mpc; _state = false; -// _auxZ = 0; + _stateKey = false; } //--------------------------------------------------------------------------- @@ -19,9 +19,21 @@ vtkInteractorManualPaint::~vtkInteractorManualPaint() } //--------------------------------------------------------------------------- -bool vtkInteractorManualPaint::OnLeftButtonDown() +bool vtkInteractorManualPaint::OnChar() { vtkRenderWindowInteractor *interactor = _vtkInteractorStyleBaseView->GetInteractor(); + + if (interactor->GetKeyCode()==97) + { + _stateKey=!_stateKey; + } + return true; +} + +//--------------------------------------------------------------------------- +bool vtkInteractorManualPaint::OnLeftButtonDown() +{ + vtkRenderWindowInteractor *interactor = _vtkInteractorStyleBaseView->GetInteractor(); if ( interactor->GetControlKey()==1 ){ _state = true; // wxVtk2DBaseView *wxvtk2Dbaseview = (wxVtk2DBaseView*)_vtkInteractorStyleBaseView->GetWxVtk2DBaseView(); @@ -40,7 +52,7 @@ bool vtkInteractorManualPaint::OnLeftButtonUp() //--------------------------------------------------------------------------- bool vtkInteractorManualPaint::OnMouseMove () { - if (_state==true) + if ((_state==true) || (_stateKey==true)) { wxVtk2DBaseView *wxvtk2Dbaseview = (wxVtk2DBaseView*)_vtkInteractorStyleBaseView->GetWxVtk2DBaseView(); wxVTKRenderWindowInteractor *wxVTKiren = wxvtk2Dbaseview->GetWxVTKRenderWindowInteractor(); diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualPaint/vtkInteractorManualPaint.h b/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualPaint/vtkInteractorManualPaint.h index c52d03f..ad65c03 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualPaint/vtkInteractorManualPaint.h +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualPaint/vtkInteractorManualPaint.h @@ -9,12 +9,14 @@ public: vtkInteractorManualPaint(ManualPaintControler* mpc); virtual ~vtkInteractorManualPaint(); + virtual bool OnChar(); virtual bool OnMouseMove(); virtual bool OnLeftButtonDown(); virtual bool OnLeftButtonUp(); private: bool _state; + bool _stateKey; ManualPaintControler *_manualPaintControler; protected: