diff --git a/ApplicationCode/UserInterface/RiuCadNavigation.cpp b/ApplicationCode/UserInterface/RiuCadNavigation.cpp index de5d61dfeb..ee560750b6 100644 --- a/ApplicationCode/UserInterface/RiuCadNavigation.cpp +++ b/ApplicationCode/UserInterface/RiuCadNavigation.cpp @@ -55,18 +55,7 @@ bool RiuCadNavigation::handleInputEvent( QInputEvent* inputEvent ) if ( me->button() == Qt::MidButton && me->modifiers() == Qt::NoModifier && isRotationEnabled() ) { - cvf::HitItemCollection hic; - bool hitSomething = m_viewer->rayPick( me->x(), me->y(), &hic ); - - if ( hitSomething ) - { - cvf::Vec3d pointOfInterest = hic.firstItem()->intersectionPoint(); - this->setPointOfInterest( pointOfInterest ); - } - else - { - initializeRotationCenter(); - } + this->pickAndSetPointOfInterest(me->x(), me->y()); m_trackball->startNavigation( cvf::ManipulatorTrackball::ROTATE, translatedMousePosX, translatedMousePosY ); m_isNavigating = true; diff --git a/ApplicationCode/UserInterface/RiuGeoQuestNavigation.cpp b/ApplicationCode/UserInterface/RiuGeoQuestNavigation.cpp index 2d2d3107ec..c5a302e373 100644 --- a/ApplicationCode/UserInterface/RiuGeoQuestNavigation.cpp +++ b/ApplicationCode/UserInterface/RiuGeoQuestNavigation.cpp @@ -55,18 +55,7 @@ bool RiuGeoQuestNavigation::handleInputEvent( QInputEvent* inputEvent ) if ( me->button() == Qt::LeftButton && isRotationEnabled() ) { - cvf::HitItemCollection hic; - bool hitSomething = m_viewer->rayPick( me->x(), me->y(), &hic ); - - if ( hitSomething ) - { - cvf::Vec3d pointOfInterest = hic.firstItem()->intersectionPoint(); - this->setPointOfInterest( pointOfInterest ); - } - else - { - initializeRotationCenter(); - } + this->pickAndSetPointOfInterest(me->x(), me->y()); m_trackball->startNavigation( cvf::ManipulatorTrackball::ROTATE, translatedMousePosX, translatedMousePosY ); m_isNavigating = true; diff --git a/ApplicationCode/UserInterface/RiuRmsNavigation.cpp b/ApplicationCode/UserInterface/RiuRmsNavigation.cpp index f33c6ad373..f777f54a64 100644 --- a/ApplicationCode/UserInterface/RiuRmsNavigation.cpp +++ b/ApplicationCode/UserInterface/RiuRmsNavigation.cpp @@ -55,18 +55,7 @@ bool RiuRmsNavigation::handleInputEvent( QInputEvent* inputEvent ) if ( me->button() == Qt::MidButton && isRotationEnabled() ) { - cvf::HitItemCollection hic; - bool hitSomething = m_viewer->rayPick( me->x(), me->y(), &hic ); - - if ( hitSomething ) - { - cvf::Vec3d pointOfInterest = hic.firstItem()->intersectionPoint(); - this->setPointOfInterest( pointOfInterest ); - } - else - { - initializeRotationCenter(); - } + this->pickAndSetPointOfInterest(me->x(), me->y()); m_trackball->startNavigation( cvf::ManipulatorTrackball::ROTATE, translatedMousePosX, translatedMousePosY ); m_isNavigating = true;