diff --git a/ApplicationCode/ProjectDataModel/Rim2dIntersectionView.cpp b/ApplicationCode/ProjectDataModel/Rim2dIntersectionView.cpp index 7f394d3f4b..4757b5e3b2 100644 --- a/ApplicationCode/ProjectDataModel/Rim2dIntersectionView.cpp +++ b/ApplicationCode/ProjectDataModel/Rim2dIntersectionView.cpp @@ -551,7 +551,7 @@ void Rim2dIntersectionView::onCreateDisplayModel() void Rim2dIntersectionView::onUpdateCurrentTimeStep() { update3dInfo(); - updateLegends(); + onUpdateLegends(); if ( m_flatSimWellPipePartMgr.notNull() ) { @@ -623,7 +623,7 @@ void Rim2dIntersectionView::onUpdateCurrentTimeStep() //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -void Rim2dIntersectionView::updateLegends() +void Rim2dIntersectionView::onUpdateLegends() { m_legendObjectToSelect = nullptr; @@ -705,10 +705,6 @@ void Rim2dIntersectionView::onResetLegendsInViewer() /// //-------------------------------------------------------------------------------------------------- void Rim2dIntersectionView::onCreatePartCollectionFromSelection( cvf::Collection* parts ) {} -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -void Rim2dIntersectionView::onTimeStepChanged() {} //-------------------------------------------------------------------------------------------------- /// diff --git a/ApplicationCode/ProjectDataModel/Rim2dIntersectionView.h b/ApplicationCode/ProjectDataModel/Rim2dIntersectionView.h index 0da74e4019..43312ee204 100644 --- a/ApplicationCode/ProjectDataModel/Rim2dIntersectionView.h +++ b/ApplicationCode/ProjectDataModel/Rim2dIntersectionView.h @@ -82,7 +82,7 @@ public: bool handleOverlayItemPicked( const cvf::OverlayItem* pickedOverlayItem ) const; protected: - void updateLegends() override; + void onUpdateLegends() override; bool isGridVisualizationMode() const override; void axisLabels( cvf::String* xLabel, cvf::String* yLabel, cvf::String* zLabel ) override; @@ -90,7 +90,6 @@ protected: void onCreatePartCollectionFromSelection( cvf::Collection* parts ) override; void onClampCurrentTimestep() override; void onUpdateCurrentTimeStep() override; - void onTimeStepChanged() override; void onUpdateStaticCellColors() override; void onUpdateScaleTransform() override; cvf::Transform* scaleTransform() override; diff --git a/ApplicationCode/ProjectDataModel/Rim3dView.cpp b/ApplicationCode/ProjectDataModel/Rim3dView.cpp index 49a294edeb..edc2a92ff2 100644 --- a/ApplicationCode/ProjectDataModel/Rim3dView.cpp +++ b/ApplicationCode/ProjectDataModel/Rim3dView.cpp @@ -432,31 +432,6 @@ void Rim3dView::setComparisonView( Rim3dView* compView ) m_comparisonView.uiCapability()->updateConnectedEditors(); } -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -void Rim3dView::setCurrentTimeStepAndUpdate( int frameIndex ) -{ - setCurrentTimeStep( frameIndex ); - - this->onUpdateCurrentTimeStep(); - - if ( Rim3dView* depView = prepareComparisonView() ) - { - depView->onUpdateCurrentTimeStep(); - depView->appendAnnotationsToModel(); - depView->appendMeasurementToModel(); - - restoreComparisonView(); - } - - RimProject* project; - firstAncestorOrThisOfTypeAsserted( project ); - project->mainPlotCollection()->updateCurrentTimeStepInPlots(); - - appendAnnotationsToModel(); - appendMeasurementToModel(); -} //-------------------------------------------------------------------------------------------------- /// @@ -499,6 +474,32 @@ void Rim3dView::setCurrentTimeStep( int frameIndex ) this->hasUserRequestedAnimation = true; } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void Rim3dView::setCurrentTimeStepAndUpdate( int frameIndex ) +{ + setCurrentTimeStep( frameIndex ); + + this->onUpdateCurrentTimeStep(); + + if ( Rim3dView* depView = prepareComparisonView() ) + { + depView->onUpdateCurrentTimeStep(); + depView->appendAnnotationsToModel(); + depView->appendMeasurementToModel(); + + restoreComparisonView(); + } + + RimProject* project; + firstAncestorOrThisOfTypeAsserted( project ); + project->mainPlotCollection()->updateCurrentTimeStepInPlots(); + + appendAnnotationsToModel(); + appendMeasurementToModel(); +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- @@ -752,6 +753,14 @@ caf::PdmFieldHandle* Rim3dView::userDescriptionField() return m_nameConfig->nameField(); } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +caf::PdmFieldHandle* Rim3dView::backgroundColorField() +{ + return &m_backgroundColor; +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- @@ -1147,7 +1156,7 @@ void Rim3dView::applyBackgroundColorAndFontChanges() } updateGridBoxData(); updateAnnotationItems(); - updateLegends(); + onUpdateLegends(); } //-------------------------------------------------------------------------------------------------- @@ -1207,6 +1216,8 @@ void Rim3dView::updateDisplayModelVisibility() viewer()->setEnableMask( mask, false ); viewer()->setEnableMask( mask, true ); + this->onUpdateDisplayModelVisibility(); + viewer()->update(); } diff --git a/ApplicationCode/ProjectDataModel/Rim3dView.h b/ApplicationCode/ProjectDataModel/Rim3dView.h index 1d8d03d983..d6811dd615 100644 --- a/ApplicationCode/ProjectDataModel/Rim3dView.h +++ b/ApplicationCode/ProjectDataModel/Rim3dView.h @@ -144,7 +144,7 @@ public: bool isTimeStepDependentDataVisibleInThisOrComparisonView() const; // Updating - void updateCurrentTimeStepAndRedraw() override; + virtual void updateCurrentTimeStepAndRedraw(); virtual void scheduleGeometryRegen( RivCellSetEnum geometryType ) = 0; void scheduleCreateDisplayModelAndRedraw(); @@ -191,6 +191,7 @@ protected: bool hasVisibleTimeStepDependent3dWellLogCurves() const; void addWellPathsToModel( cvf::ModelBasicList* wellPathModelBasicList, const cvf::BoundingBox& wellPathClipBoundingBox ); + void updateDisplayModelVisibility(); void addDynamicWellPathsToModel( cvf::ModelBasicList* wellPathModelBasicList, const cvf::BoundingBox& wellPathClipBoundingBox ); @@ -203,18 +204,15 @@ protected: RiuViewer* nativeOrOverrideViewer() const; bool isUsingOverrideViewer() const; - // Implementation of RimNameConfigHolderInterface - void performAutoNameUpdate() override; - // Abstract methods to implement in subclasses virtual void axisLabels( cvf::String* xLabel, cvf::String* yLabel, cvf::String* zLabel ) = 0; virtual void onCreateDisplayModel() = 0; - virtual void updateDisplayModelVisibility(); - virtual void onClampCurrentTimestep() = 0; - virtual void onUpdateCurrentTimeStep() = 0; - virtual void onTimeStepChanged() = 0; + virtual void onUpdateDisplayModelVisibility(){}; + virtual void onClampCurrentTimestep() = 0; + virtual void onUpdateCurrentTimeStep() = 0; + virtual void onTimeStepChanged(){}; virtual bool isTimeStepDependentDataVisible() const = 0; virtual void onCreatePartCollectionFromSelection( cvf::Collection* parts ) = 0; @@ -224,12 +222,13 @@ protected: virtual cvf::Transform* scaleTransform() = 0; virtual void onResetLegendsInViewer() = 0; - virtual void updateLegends() = 0; - -protected: // Fields - caf::PdmField m_currentTimeStep; + virtual void onUpdateLegends() = 0; protected: + // Timestep Field. Children clamps this differently + caf::PdmField m_currentTimeStep; + + // 3D display model data cvf::ref m_wellPathPipeVizModel; cvf::ref m_crossSectionVizModel; cvf::ref m_highlightVizModel; @@ -238,17 +237,11 @@ protected: cvf::ref m_annotationsPartManager; cvf::ref m_measurementPartManager; -private: +protected: // Overridden PdmObject methods: - void setupBeforeSave() override; - -protected: caf::PdmFieldHandle* userDescriptionField() override; - caf::PdmFieldHandle* backgroundColorField() - { - return &m_backgroundColor; - } + caf::PdmFieldHandle* backgroundColorField(); void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, @@ -258,6 +251,9 @@ protected: QWidget* createViewWidget( QWidget* mainWindowParent ) override; void initAfterRead() override; +private: + void setupBeforeSave() override; + private: // Overridden ViewWindow methods: @@ -265,6 +261,9 @@ private: void deleteViewWidget() override; QWidget* viewWidget() override; + // Implementation of RimNameConfigHolderInterface + void performAutoNameUpdate() override final; + // Implementation of RiuViewerToViewInterface void setCameraPosition( const cvf::Mat4d& cameraPosition ) override; diff --git a/ApplicationCode/ProjectDataModel/RimEclipseContourMapView.cpp b/ApplicationCode/ProjectDataModel/RimEclipseContourMapView.cpp index e6c9f27686..996820c7a4 100644 --- a/ApplicationCode/ProjectDataModel/RimEclipseContourMapView.cpp +++ b/ApplicationCode/ProjectDataModel/RimEclipseContourMapView.cpp @@ -251,7 +251,7 @@ void RimEclipseContourMapView::updateGeometry() progress.setProgress( 30 ); } - updateLegends(); // To make sure the scalar mappers are set up correctly + onUpdateLegends(); // To make sure the scalar mappers are set up correctly appendWellsAndFracturesToModel(); { // Step 2: generate geometry. Takes about 60% of the time. @@ -373,7 +373,7 @@ void RimEclipseContourMapView::appendPickPointVisToModel() //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -void RimEclipseContourMapView::updateLegends() +void RimEclipseContourMapView::onUpdateLegends() { if ( nativeOrOverrideViewer() ) { @@ -459,7 +459,7 @@ void RimEclipseContourMapView::fieldChangedByUi( const caf::PdmFieldHandle* chan } else if ( changedField == &m_showScaleLegend ) { - updateLegends(); + onUpdateLegends(); scheduleCreateDisplayModelAndRedraw(); } } diff --git a/ApplicationCode/ProjectDataModel/RimEclipseContourMapView.h b/ApplicationCode/ProjectDataModel/RimEclipseContourMapView.h index 4b88041f7c..0b24b23749 100644 --- a/ApplicationCode/ProjectDataModel/RimEclipseContourMapView.h +++ b/ApplicationCode/ProjectDataModel/RimEclipseContourMapView.h @@ -51,7 +51,7 @@ protected: void appendContourMapProjectionToModel(); void appendContourLinesToModel(); void appendPickPointVisToModel(); - void updateLegends() override; + void onUpdateLegends() override; void updateViewWidgetAfterCreation() override; void updateViewFollowingRangeFilterUpdates() override; void onLoadDataAndUpdate() override; diff --git a/ApplicationCode/ProjectDataModel/RimEclipseView.cpp b/ApplicationCode/ProjectDataModel/RimEclipseView.cpp index 693d984bf6..cab8c8be0c 100644 --- a/ApplicationCode/ProjectDataModel/RimEclipseView.cpp +++ b/ApplicationCode/ProjectDataModel/RimEclipseView.cpp @@ -561,7 +561,7 @@ void RimEclipseView::onCreateDisplayModel() else { m_overlayInfoConfig()->update3DInfo(); - updateLegends(); + onUpdateLegends(); } std::vector characteristicsPlots; @@ -596,7 +596,7 @@ void RimEclipseView::onUpdateCurrentTimeStep() m_propertyFilterCollection()->updateFromCurrentTimeStep(); - updateLegends(); // To make sure the scalar mappers are set up correctly + onUpdateLegends(); // To make sure the scalar mappers are set up correctly updateVisibleGeometriesAndCellColors(); @@ -1070,10 +1070,8 @@ QString RimEclipseView::createAutoName() const //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -void RimEclipseView::updateDisplayModelVisibility() +void RimEclipseView::onUpdateDisplayModelVisibility() { - Rim3dView::updateDisplayModelVisibility(); - faultCollection()->updateConnectedEditors(); // This is required to update the read-only state of simulation wells @@ -1159,7 +1157,7 @@ std::vector RimEclipseView::indicesToVisibleGrids() const //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -void RimEclipseView::updateLegends() +void RimEclipseView::onUpdateLegends() { if ( nativeOrOverrideViewer() ) { diff --git a/ApplicationCode/ProjectDataModel/RimEclipseView.h b/ApplicationCode/ProjectDataModel/RimEclipseView.h index cc02c24dab..eb0a5b5e89 100644 --- a/ApplicationCode/ProjectDataModel/RimEclipseView.h +++ b/ApplicationCode/ProjectDataModel/RimEclipseView.h @@ -166,7 +166,7 @@ protected: private: QString createAutoName() const override; - void updateDisplayModelVisibility() override; + void onUpdateDisplayModelVisibility() override; std::vector indicesToVisibleGrids() const; void onUpdateScaleTransform() override; @@ -175,7 +175,7 @@ private: void onUpdateStaticCellColors() override; void updateStaticCellColors( RivCellSetEnum geometryType ); - void updateLegends() override; + void onUpdateLegends() override; void updateMinMaxValuesAndAddLegendToView( QString legendLabel, RimEclipseCellColors* resultColors, RigCaseCellResultsData* cellResultsData ); diff --git a/ApplicationCode/ProjectDataModel/RimGeoMechContourMapView.cpp b/ApplicationCode/ProjectDataModel/RimGeoMechContourMapView.cpp index 2eb683f048..76ea5fbbde 100644 --- a/ApplicationCode/ProjectDataModel/RimGeoMechContourMapView.cpp +++ b/ApplicationCode/ProjectDataModel/RimGeoMechContourMapView.cpp @@ -254,7 +254,7 @@ void RimGeoMechContourMapView::updateGeometry() { m_contourMapProjection->generateResultsIfNecessary( m_currentTimeStep() ); } - updateLegends(); + onUpdateLegends(); progress.setProgress( 30 ); } @@ -366,7 +366,7 @@ void RimGeoMechContourMapView::appendPickPointVisToModel() //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -void RimGeoMechContourMapView::updateLegends() +void RimGeoMechContourMapView::onUpdateLegends() { if ( nativeOrOverrideViewer() ) { @@ -452,7 +452,7 @@ void RimGeoMechContourMapView::fieldChangedByUi( const caf::PdmFieldHandle* chan } else if ( changedField == &m_showScaleLegend ) { - updateLegends(); + onUpdateLegends(); scheduleCreateDisplayModelAndRedraw(); } } diff --git a/ApplicationCode/ProjectDataModel/RimGeoMechContourMapView.h b/ApplicationCode/ProjectDataModel/RimGeoMechContourMapView.h index 9c941fe195..61b25eef3a 100644 --- a/ApplicationCode/ProjectDataModel/RimGeoMechContourMapView.h +++ b/ApplicationCode/ProjectDataModel/RimGeoMechContourMapView.h @@ -53,7 +53,7 @@ protected: void appendContourMapProjectionToModel(); void appendContourLinesToModel(); void appendPickPointVisToModel(); - void updateLegends() override; + void onUpdateLegends() override; void updateViewWidgetAfterCreation() override; void updateViewFollowingRangeFilterUpdates() override; void onLoadDataAndUpdate() override; diff --git a/ApplicationCode/ProjectDataModel/RimGeoMechView.cpp b/ApplicationCode/ProjectDataModel/RimGeoMechView.cpp index ad725f9f1e..d15c69e811 100644 --- a/ApplicationCode/ProjectDataModel/RimGeoMechView.cpp +++ b/ApplicationCode/ProjectDataModel/RimGeoMechView.cpp @@ -297,7 +297,7 @@ void RimGeoMechView::onCreateDisplayModel() } else { - updateLegends(); + onUpdateLegends(); m_vizLogic->updateStaticCellColors( -1 ); m_crossSectionCollection->applySingleColorEffect(); @@ -318,7 +318,7 @@ RimPropertyFilterCollection* RimGeoMechView::nativePropertyFilterCollection() //-------------------------------------------------------------------------------------------------- void RimGeoMechView::onUpdateCurrentTimeStep() { - updateLegends(); + onUpdateLegends(); if ( this->isTimeStepDependentDataVisibleInThisOrComparisonView() ) { @@ -430,7 +430,7 @@ void RimGeoMechView::onResetLegendsInViewer() //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -void RimGeoMechView::updateLegends() +void RimGeoMechView::onUpdateLegends() { if ( nativeOrOverrideViewer() ) { diff --git a/ApplicationCode/ProjectDataModel/RimGeoMechView.h b/ApplicationCode/ProjectDataModel/RimGeoMechView.h index 5278bd6cef..5978434d6d 100644 --- a/ApplicationCode/ProjectDataModel/RimGeoMechView.h +++ b/ApplicationCode/ProjectDataModel/RimGeoMechView.h @@ -128,7 +128,7 @@ private: void onResetLegendsInViewer() override; - void updateLegends() override; + void onUpdateLegends() override; void updateTensorLegendTextAndRanges( RimRegularLegendConfig* legendConfig, int timeStepIndex ); diff --git a/ApplicationCode/UserInterface/RiuViewerToViewInterface.h b/ApplicationCode/UserInterface/RiuViewerToViewInterface.h index 9fd0a60ca4..714952550b 100644 --- a/ApplicationCode/UserInterface/RiuViewerToViewInterface.h +++ b/ApplicationCode/UserInterface/RiuViewerToViewInterface.h @@ -57,7 +57,6 @@ public: virtual cvf::ref displayCoordTransform() const = 0; virtual void setCurrentTimeStepAndUpdate( int frameIndex ) = 0; - virtual void updateCurrentTimeStepAndRedraw() = 0; virtual void endAnimation() = 0; };