X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=vv%2FvvSlicerManagerCommand.cxx;h=5b35bdd826e9eb94797518a8fcd5f565a9e949bb;hb=000ac5b867a708575268c7c823db4fcbe727c2d6;hp=0977586210ec76100435824927e7d44d1e5a772d;hpb=78ae141332b4f8d5146952b08dced58e4d248e06;p=clitk.git diff --git a/vv/vvSlicerManagerCommand.cxx b/vv/vvSlicerManagerCommand.cxx index 0977586..5b35bdd 100644 --- a/vv/vvSlicerManagerCommand.cxx +++ b/vv/vvSlicerManagerCommand.cxx @@ -31,9 +31,11 @@ #include #include #include - +#include +#include #include "vvSlicer.h" #include "vvInteractorStyleNavigator.h" +#include "vtkTransform.h" #include @@ -80,6 +82,8 @@ void vvSlicerManagerCommand::Execute(vtkObject *caller, if (VisibleInWindow>-1) renderer=this->SM->GetSlicer(VisibleInWindow)->GetRenderer(); newLandmark = false; + + if (event == vtkCommand::StartPickEvent && VisibleInWindow == -1) { @@ -97,26 +101,24 @@ void vvSlicerManagerCommand::Execute(vtkObject *caller, if (event == vtkCommand::KeyPressEvent) { std::string KeyPress = isi->GetInteractor()->GetKeySym(); - if (KeyPress == "a") - { - this->SM->PrevImage(VisibleInWindow); - return; - } - if (KeyPress == "q") - { - this->SM->NextImage(VisibleInWindow); - return; - } + if (KeyPress == "Tab") + { + if(isi->GetInteractor()->GetShiftKey()) + this->SM->PrevImage(VisibleInWindow); + else + this->SM->NextImage(VisibleInWindow); + return; + } if (KeyPress == "f" || KeyPress == "F") { FlyToPosition(isi->GetInteractor(),this->SM->GetSlicer(VisibleInWindow)); - return; + return; + } + if (KeyPress == "w") + { + this->SM->SetLocalColorWindowing(VisibleInWindow); + return; } - if (KeyPress == "z") - { - this->SM->SetLocalColorWindowing(VisibleInWindow); - return; - } if (KeyPress == "0") { this->SM->SetPreset(0); @@ -192,13 +194,13 @@ void vvSlicerManagerCommand::Execute(vtkObject *caller, this->SM->UpdateWindowLevel(); return; } - if (KeyPress == "u") + if (KeyPress == "c") { this->SM->ToggleContourSuperposition(); this->SM->Render(); return; } - if (KeyPress == "i") + if (KeyPress == "l") { this->SM->ToggleInterpolation(); this->SM->Render(); @@ -210,7 +212,7 @@ void vvSlicerManagerCommand::Execute(vtkObject *caller, this->SM->Render(); return; } - if (KeyPress == "l") + if (KeyPress == "u") { this->SM->Reload(); this->SM->Render(); @@ -264,27 +266,28 @@ void vvSlicerManagerCommand::Execute(vtkObject *caller, if (KeyPress == "Right") this->SM->SetNextTSlice(VisibleInWindow); - if (KeyPress == "F1") + if (KeyPress == "F2") { this->SM->GetSlicer(VisibleInWindow)->GetAnnotation()->SetText(2,"Sagital\n"); this->SM->GetSlicer(VisibleInWindow)->SetSliceOrientation(0); this->SM->UpdateSliceRange(VisibleInWindow); this->SM->UpdateInfoOnCursorPosition(VisibleInWindow); } - if (KeyPress == "F2") + if (KeyPress == "F3") { this->SM->GetSlicer(VisibleInWindow)->GetAnnotation()->SetText(2,"Coronal\n"); this->SM->GetSlicer(VisibleInWindow)->SetSliceOrientation(1); this->SM->UpdateSliceRange(VisibleInWindow); this->SM->UpdateInfoOnCursorPosition(VisibleInWindow); } - if (KeyPress == "F3") + if (KeyPress == "F4") { this->SM->GetSlicer(VisibleInWindow)->GetAnnotation()->SetText(2,"Axial\n"); this->SM->GetSlicer(VisibleInWindow)->SetSliceOrientation(2); this->SM->UpdateSliceRange(VisibleInWindow); this->SM->UpdateInfoOnCursorPosition(VisibleInWindow); } + } //All type of mouse events @@ -296,6 +299,15 @@ void vvSlicerManagerCommand::Execute(vtkObject *caller, return; } + //DD(event); + // Mouse release HERE + if (event == vtkCommand::EndPickEvent) { + // DD(VisibleInWindow); + if (VisibleInWindow > -1) + this->SM->LeftButtonReleaseEvent(VisibleInWindow); + return; // no return !!!! ??? + } + if (event == vtkCommand::StartWindowLevelEvent) { mStartSlicer = -1; @@ -510,7 +522,10 @@ void vvSlicerManagerCommand::Dolly(double factor, vtkRenderWindowInteractor *int renderer->ResetCameraClippingRange(); //interactor->Render(); } +//------------------------------------------------------------------------------ + +//------------------------------------------------------------------------------ void vvSlicerManagerCommand::FlyToPosition(vtkRenderWindowInteractor *interactor,vvSlicer* slicer) { double flyFrom[3], flyTo[3]; @@ -579,3 +594,4 @@ void vvSlicerManagerCommand::FlyToPosition(vtkRenderWindowInteractor *interactor } } } +//------------------------------------------------------------------------------