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 RiuGeoQuestNavigation::handleInputEvent(QInputEvent* inputEvent)
|
||||
if (hitSomething)
|
||||
{
|
||||
cvf::Vec3d pointOfInterest = hic.firstItem()->intersectionPoint();
|
||||
m_trackball->setRotationPoint(pointOfInterest);
|
||||
m_pointOfInterest = pointOfInterest;
|
||||
this->setPointOfInterest(pointOfInterest);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -178,11 +177,16 @@ bool RiuGeoQuestNavigation::handleInputEvent(QInputEvent* inputEvent)
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuGeoQuestNavigation::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);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -227,6 +231,8 @@ void RiuGeoQuestNavigation::setPointOfInterest(cvf::Vec3d poi)
|
||||
m_pointOfInterest = poi;
|
||||
m_trackball->setRotationPoint(poi);
|
||||
m_isRotCenterInitialized = true;
|
||||
m_viewer->updateParallelProjectionCameraPosFromPointOfInterestMove(m_pointOfInterest);
|
||||
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -245,7 +251,7 @@ void RiuGeoQuestNavigation::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