mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Created navigationPolicyUpdate to be used from navigation policies
This commit is contained in:
@@ -133,7 +133,7 @@ bool RiuCadNavigation::handleInputEvent(QInputEvent* inputEvent)
|
||||
bool needRedraw = m_trackball->updateNavigation(translatedMousePosX, translatedMousePosY);
|
||||
if (needRedraw)
|
||||
{
|
||||
m_viewer->update();
|
||||
m_viewer->navigationPolicyUpdate();
|
||||
m_navigationUpdated = true;
|
||||
}
|
||||
isEventHandled = true;
|
||||
@@ -169,7 +169,7 @@ bool RiuCadNavigation::handleInputEvent(QInputEvent* inputEvent)
|
||||
cvf::Vec3d newVrp = vrp + trans;
|
||||
|
||||
m_viewer->mainCamera()->setFromLookAt(newPos,newVrp, up );
|
||||
m_viewer->update();
|
||||
m_viewer->navigationPolicyUpdate();
|
||||
}
|
||||
}
|
||||
isEventHandled = true;
|
||||
|
||||
@@ -134,7 +134,7 @@ bool RiuGeoQuestNavigation::handleInputEvent(QInputEvent* inputEvent)
|
||||
bool needRedraw = m_trackball->updateNavigation(translatedMousePosX, translatedMousePosY);
|
||||
if (needRedraw)
|
||||
{
|
||||
m_viewer->update();
|
||||
m_viewer->navigationPolicyUpdate();
|
||||
}
|
||||
}
|
||||
isEventHandled = true;
|
||||
@@ -245,6 +245,6 @@ void RiuGeoQuestNavigation::zoomAlongRay(cvf::Ray* ray, int delta)
|
||||
cvf::Vec3d newVrp = vrp + trans;
|
||||
|
||||
m_viewer->mainCamera()->setFromLookAt(newPos, newVrp, up );
|
||||
m_viewer->update();
|
||||
m_viewer->navigationPolicyUpdate();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -158,7 +158,7 @@ bool RiuRmsNavigation::handleInputEvent(QInputEvent* inputEvent)
|
||||
bool needRedraw = m_trackball->updateNavigation(translatedMousePosX, translatedMousePosY);
|
||||
if (needRedraw)
|
||||
{
|
||||
m_viewer->update();
|
||||
m_viewer->navigationPolicyUpdate();
|
||||
}
|
||||
}
|
||||
isEventHandled = true;
|
||||
@@ -269,6 +269,6 @@ void RiuRmsNavigation::zoomAlongRay(cvf::Ray* ray, int delta)
|
||||
cvf::Vec3d newVrp = vrp + trans;
|
||||
|
||||
m_viewer->mainCamera()->setFromLookAt(newPos, newVrp, up );
|
||||
m_viewer->update();
|
||||
m_viewer->navigationPolicyUpdate();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -501,7 +501,7 @@ void RiuViewer::updateNavigationPolicy()
|
||||
///
|
||||
/// All other updates should be redirected to caf::OpenGLWidget::update()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuViewer::update()
|
||||
void RiuViewer::navigationPolicyUpdate()
|
||||
{
|
||||
std::vector<RimView*> viewsToUpdate;
|
||||
|
||||
@@ -542,24 +542,11 @@ void RiuViewer::update()
|
||||
{
|
||||
viewsToUpdate[i]->viewer()->mainCamera()->setViewMatrix(mat);
|
||||
|
||||
// Make sure to call update on the base class of caf::Viewer to avoid calling
|
||||
// a virtual method and infinite recursion
|
||||
viewsToUpdate[i]->viewer()->issueBaseClassUpdate();
|
||||
viewsToUpdate[i]->viewer()->update();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuViewer::issueBaseClassUpdate()
|
||||
{
|
||||
// Call update on the base class of caf::Viewer
|
||||
// as caf::Viewer::update() is a virtual function
|
||||
|
||||
caf::OpenGLWidget::update();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -73,9 +73,7 @@ public:
|
||||
|
||||
void updateNavigationPolicy();
|
||||
|
||||
|
||||
virtual void update(); // Override of caf::Viewer::update()
|
||||
void issueBaseClassUpdate();
|
||||
virtual void navigationPolicyUpdate(); // Override of caf::Viewer::navigationPolicyUpdate()
|
||||
|
||||
void setCurrentFrame(int frameIndex);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user