From 86cb90515b121f94e22d1940fc2e3808efe39efc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jacob=20St=C3=B8ren?= Date: Mon, 21 Oct 2019 09:01:35 +0200 Subject: [PATCH] #4894 Fix missing updates when changing zscale and using linked views. Prepare for fix of scalez-problems with comparison view --- .../ProjectDataModel/Rim3dView.cpp | 41 +++++++++---------- .../ProjectDataModel/RimEclipseView.cpp | 2 +- .../ProjectDataModel/RimGeoMechView.cpp | 2 +- .../ProjectDataModel/RimGridView.cpp | 8 ---- 4 files changed, 21 insertions(+), 32 deletions(-) diff --git a/ApplicationCode/ProjectDataModel/Rim3dView.cpp b/ApplicationCode/ProjectDataModel/Rim3dView.cpp index 9c3f918db7..42e97114f3 100644 --- a/ApplicationCode/ProjectDataModel/Rim3dView.cpp +++ b/ApplicationCode/ProjectDataModel/Rim3dView.cpp @@ -497,7 +497,7 @@ void Rim3dView::updateCurrentTimeStepAndRedraw() } std::set containerViews = this->viewsUsingThisAsComparisonView(); - if ( !containerViews.empty() && !isUsingOverrideViewer()) + if ( !containerViews.empty() && !isUsingOverrideViewer() ) { for ( auto view : containerViews ) { @@ -912,19 +912,6 @@ void Rim3dView::addMeasurementToModel( cvf::ModelBasicList* wellPathModelBasicLi wellPathModelBasicList->updateBoundingBoxesRecursive(); } -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -void Rim3dView::setScaleZAndUpdate( double scalingFactor ) -{ - this->scaleZ = scalingFactor; - updateScaleTransform(); - - this->updateGridBoxData(); - - this->scheduleCreateDisplayModelAndRedraw(); -} - //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- @@ -986,6 +973,16 @@ void Rim3dView::updateAnnotationItems() } } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void Rim3dView::setScaleZAndUpdate( double scalingFactor ) +{ + this->scaleZ = scalingFactor; + + updateScaling(); +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- @@ -1006,14 +1003,13 @@ void Rim3dView::updateScaling() viewer()->mainCamera()->setFromLookAt( eye, eye + dir, up ); viewer()->setPointOfInterest( poi ); - - updateScaleTransform(); - createDisplayModelAndRedraw(); - - viewer()->update(); - - updateZScaleLabel(); } + + updateScaleTransform(); + updateGridBoxData(); + updateZScaleLabel(); + + this->scheduleCreateDisplayModelAndRedraw(); } //-------------------------------------------------------------------------------------------------- @@ -1023,7 +1019,8 @@ void Rim3dView::updateZScaleLabel() { // Update Z scale label int scale = static_cast( scaleZ() ); - nativeOrOverrideViewer()->setZScale( scale ); + + if ( viewer() ) viewer()->setZScale( scale ); } //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationCode/ProjectDataModel/RimEclipseView.cpp b/ApplicationCode/ProjectDataModel/RimEclipseView.cpp index 5251a673a1..843f4b7b49 100644 --- a/ApplicationCode/ProjectDataModel/RimEclipseView.cpp +++ b/ApplicationCode/ProjectDataModel/RimEclipseView.cpp @@ -294,7 +294,7 @@ void RimEclipseView::fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) { - Rim3dView::fieldChangedByUi( changedField, oldValue, newValue ); + RimGridView::fieldChangedByUi( changedField, oldValue, newValue ); if ( changedField == &m_showInvalidCells ) { diff --git a/ApplicationCode/ProjectDataModel/RimGeoMechView.cpp b/ApplicationCode/ProjectDataModel/RimGeoMechView.cpp index da712ed486..72c71a70b5 100644 --- a/ApplicationCode/ProjectDataModel/RimGeoMechView.cpp +++ b/ApplicationCode/ProjectDataModel/RimGeoMechView.cpp @@ -756,7 +756,7 @@ void RimGeoMechView::fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) { - Rim3dView::fieldChangedByUi( changedField, oldValue, newValue ); + RimGridView::fieldChangedByUi( changedField, oldValue, newValue ); } //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationCode/ProjectDataModel/RimGridView.cpp b/ApplicationCode/ProjectDataModel/RimGridView.cpp index b75a523ecd..85fe7feaba 100644 --- a/ApplicationCode/ProjectDataModel/RimGridView.cpp +++ b/ApplicationCode/ProjectDataModel/RimGridView.cpp @@ -418,14 +418,6 @@ void RimGridView::fieldChangedByUi( const caf::PdmFieldHandle* changedField, viewLinker->updateCamera( this ); } } - else if ( changedField == &m_currentTimeStep ) - { - RimViewLinker* viewLinker = this->assosiatedViewLinker(); - if ( viewLinker ) - { - viewLinker->updateTimeStep( this, m_currentTimeStep ); - } - } } //--------------------------------------------------------------------------------------------------