X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=vv%2FvvSlicerManagerCommand.cxx;h=805f51bea4bd943a23abc0ed4399d007b8dd8b8e;hb=fa8ffff2bc630030df29be49e0779da63398d7ba;hp=09a95456a2a1fc574933b63ca3349fb3c81615ff;hpb=2b7ad0af09d38433c0eaea432bd7e4ab1f43d935;p=clitk.git diff --git a/vv/vvSlicerManagerCommand.cxx b/vv/vvSlicerManagerCommand.cxx index 09a9545..805f51b 100644 --- a/vv/vvSlicerManagerCommand.cxx +++ b/vv/vvSlicerManagerCommand.cxx @@ -96,6 +96,7 @@ void vvSlicerManagerCommand::Execute(vtkObject *caller, if ( VisibleInWindow > -1 ) { if (event == vtkCommand::KeyPressEvent) { std::string KeyPress = isi->GetInteractor()->GetKeySym(); + bool bCtrlKey = isi->GetInteractor()->GetControlKey(); if (KeyPress == "Tab") { if(isi->GetInteractor()->GetShiftKey()) this->SM->PrevImage(VisibleInWindow); @@ -210,15 +211,13 @@ void vvSlicerManagerCommand::Execute(vtkObject *caller, return; } if (KeyPress == "g") { - double* cursorPos = this->SM->GetSlicer(VisibleInWindow)->GetCursorPosition(); - this->SM->GetSlicer(VisibleInWindow)->SetCurrentPosition( - cursorPos[0],cursorPos[1],cursorPos[2],cursorPos[3]); - this->SM->UpdateViews(1,VisibleInWindow); - this->SM->UpdateLinked(VisibleInWindow); - return; - } - if (KeyPress == "o") { - this->SM->GetSlicer(VisibleInWindow)->SetCurrentPosition(0,0,0,0); + if(bCtrlKey) + this->SM->GetSlicer(VisibleInWindow)->SetCurrentPosition(0,0,0,0); + else { + double* cursorPos = this->SM->GetSlicer(VisibleInWindow)->GetCursorPosition(); + this->SM->GetSlicer(VisibleInWindow)->SetCurrentPosition( + cursorPos[0],cursorPos[1],cursorPos[2],cursorPos[3]); + } this->SM->UpdateViews(1,VisibleInWindow); this->SM->UpdateLinked(VisibleInWindow); return;