From: Simon Rit Date: Wed, 15 Jun 2011 08:48:08 +0000 (+0200) Subject: Change key for going to coordinate system origin. Now CTRL+g X-Git-Tag: v1.3.0~318^2~9 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=a471980c0f56054516c65a3d3de76c6ae99dea0e;p=clitk.git Change key for going to coordinate system origin. Now CTRL+g --- diff --git a/vv/qt_ui/vvHelpDialog.ui b/vv/qt_ui/vvHelpDialog.ui index 2917b13..6c827c3 100644 --- a/vv/qt_ui/vvHelpDialog.ui +++ b/vv/qt_ui/vvHelpDialog.ui @@ -74,7 +74,7 @@ p, li { white-space: pre-wrap; } <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:12pt; font-weight:600;">u</span><span style=" font-size:12pt;">: </span><span style=" font-size:12pt; text-decoration: underline;">U</span><span style=" font-size:12pt;">pdate Image</span></p> <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:12pt; font-weight:600;">f</span><span style=" font-size:12pt;">: </span><span style=" font-size:12pt; text-decoration: underline;">F</span><span style=" font-size:12pt;">ly To Mouse Position</span></p> <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:12pt; font-weight:600;">g</span><span style=" font-size:12pt;">: </span><span style=" font-size:12pt; text-decoration: underline;">G</span><span style=" font-size:12pt;">o to Crosshair Position</span></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:12pt; font-weight:600;">o</span><span style=" font-size:12pt;">: Go to Image </span><span style=" font-size:12pt; text-decoration: underline;">O</span><span style=" font-size:12pt;">rigin</span></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:12pt; font-weight:600;">Ctrl+g</span><span style=" font-size:12pt;">: </span><span style=" font-size:12pt; text-decoration: underline;">G</span><span style=" font-size:12pt;">o to Coordinate System Origin</span></p> <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:12pt; font-weight:600;">h</span><span style=" font-size:12pt;">: </span><span style=" font-size:12pt; text-decoration: underline;">H</span><span style=" font-size:12pt;">ide Crosshair and corner annotations</span></p> <p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:12pt;"></p> <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:12pt; font-weight:600;">Up,Down</span><span style=" font-size:12pt;">: Change Slice</span></p> 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;