From 1de088ccbaa81eda561e344da17649d8f20762e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jacob=20St=C3=B8ren?= Date: Fri, 26 Jan 2018 08:41:44 +0100 Subject: [PATCH] #2333 Intersection View: Made default view and near/far clip planes behave --- .../Rim2dIntersectionView.cpp | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/ApplicationCode/ProjectDataModel/Rim2dIntersectionView.cpp b/ApplicationCode/ProjectDataModel/Rim2dIntersectionView.cpp index 168e62d026..09c144a97b 100644 --- a/ApplicationCode/ProjectDataModel/Rim2dIntersectionView.cpp +++ b/ApplicationCode/ProjectDataModel/Rim2dIntersectionView.cpp @@ -37,6 +37,11 @@ CAF_PDM_XML_ABSTRACT_SOURCE_INIT(Rim2dIntersectionView, "Intersection2dView"); +const cvf::Mat4d defaultIntersectinoViewMatrix(1, 0, 0, 0, + 0, 0, 1, 0, + 0, -1, 0, 1000, + 0, 0, 0, 1); + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- @@ -53,12 +58,7 @@ Rim2dIntersectionView::Rim2dIntersectionView(void) hasUserRequestedAnimation = true; isPerspectiveView = false; - cvf::Mat4d mx( 1, 0, 0, 0, - 0, 0, 1, 0, - 0, -1, 0, 100, - 0, 0, 0, 1); - - ((RiuViewerToViewInterface*)this)->setCameraPosition(mx ); + ((RiuViewerToViewInterface*)this)->setCameraPosition(defaultIntersectinoViewMatrix ); disableGridBox(); } @@ -251,11 +251,18 @@ void Rim2dIntersectionView::createDisplayModel() m_flatIntersectionPartMgr->applySingleColorEffect(); m_viewer->addStaticModelOnce(m_intersectionVizModel.p()); + + m_intersectionVizModel->updateBoundingBoxesRecursive(); if ( this->hasUserRequestedAnimation() ) { m_viewer->setCurrentFrame(m_currentTimeStep); } + + if ( this->viewer()->mainCamera()->viewMatrix() == defaultIntersectinoViewMatrix ) + { + this->zoomAll(); + } } //--------------------------------------------------------------------------------------------------