From 39801a201832807e143bebf963ca1f59e57c421a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jacob=20St=C3=B8ren?= Date: Wed, 16 Oct 2019 14:09:10 +0200 Subject: [PATCH] #4857 Handle comparison views in the custom 3D navigation policies --- ApplicationCode/UserInterface/RiuCadNavigation.cpp | 13 +------------ .../UserInterface/RiuGeoQuestNavigation.cpp | 13 +------------ ApplicationCode/UserInterface/RiuRmsNavigation.cpp | 13 +------------ 3 files changed, 3 insertions(+), 36 deletions(-) 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;