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:
@@ -81,8 +81,7 @@ bool RiuCadNavigation::handleInputEvent(QInputEvent* inputEvent)
|
||||
if (hitSomething)
|
||||
{
|
||||
cvf::Vec3d pointOfInterest = hic.firstItem()->intersectionPoint();
|
||||
m_trackball->setRotationPoint(pointOfInterest);
|
||||
m_pointOfInterest = pointOfInterest;
|
||||
this->setPointOfInterest(pointOfInterest);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -170,7 +169,7 @@ bool RiuCadNavigation::handleInputEvent(QInputEvent* inputEvent)
|
||||
|
||||
m_viewer->mainCamera()->setFromLookAt(newPos,newVrp, up );
|
||||
|
||||
m_viewer->updateParallelProjectionHeight(m_pointOfInterest);
|
||||
m_viewer->updateParallelProjectionHeightFromMoveZoom(m_pointOfInterest);
|
||||
m_viewer->navigationPolicyUpdate();
|
||||
}
|
||||
}
|
||||
@@ -188,11 +187,16 @@ bool RiuCadNavigation::handleInputEvent(QInputEvent* inputEvent)
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuCadNavigation::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);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -237,4 +241,6 @@ void RiuCadNavigation::setPointOfInterest(cvf::Vec3d poi)
|
||||
m_pointOfInterest = poi;
|
||||
m_trackball->setRotationPoint(poi);
|
||||
m_isRotCenterInitialized = true;
|
||||
m_viewer->updateParallelProjectionCameraPosFromPointOfInterestMove(m_pointOfInterest);
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user