mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
(#168) Parallel walk navigation working. Still things to fix
This commit is contained in:
@@ -69,8 +69,7 @@ bool RiuRmsNavigation::handleInputEvent(QInputEvent* inputEvent)
|
||||
if (hitSomething)
|
||||
{
|
||||
cvf::Vec3d pointOfInterest = hic.firstItem()->intersectionPoint();
|
||||
m_trackball->setRotationPoint(pointOfInterest);
|
||||
m_pointOfInterest = pointOfInterest;
|
||||
this->setPointOfInterest(pointOfInterest);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -202,11 +201,16 @@ bool RiuRmsNavigation::handleInputEvent(QInputEvent* inputEvent)
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuRmsNavigation::initializeRotationCenter()
|
||||
{
|
||||
if(m_isRotCenterInitialized || m_trackball.isNull() || !m_viewer->mainScene() || !m_viewer->currentScene()->boundingBox().isValid()) return;
|
||||
m_pointOfInterest = m_viewer->currentScene()->boundingBox().center();
|
||||
if (m_isRotCenterInitialized
|
||||
|| m_trackball.isNull()
|
||||
|| !m_viewer->currentScene()->boundingBox().isValid())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
m_trackball->setRotationPoint(m_pointOfInterest);
|
||||
m_isRotCenterInitialized = true;
|
||||
cvf::Vec3d pointOfInterest = m_viewer->currentScene()->boundingBox().center();
|
||||
|
||||
this->setPointOfInterest(pointOfInterest);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -251,6 +255,8 @@ void RiuRmsNavigation::setPointOfInterest(cvf::Vec3d poi)
|
||||
m_pointOfInterest = poi;
|
||||
m_trackball->setRotationPoint(poi);
|
||||
m_isRotCenterInitialized = true;
|
||||
m_viewer->updateParallelProjectionCameraPosFromPointOfInterestMove(m_pointOfInterest);
|
||||
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -269,7 +275,7 @@ void RiuRmsNavigation::zoomAlongRay(cvf::Ray* ray, int delta)
|
||||
cvf::Vec3d newVrp = vrp + trans;
|
||||
|
||||
m_viewer->mainCamera()->setFromLookAt(newPos, newVrp, up );
|
||||
m_viewer->updateParallelProjectionHeight(m_pointOfInterest);
|
||||
m_viewer->updateParallelProjectionHeightFromMoveZoom(m_pointOfInterest);
|
||||
|
||||
m_viewer->navigationPolicyUpdate();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user