From d69de680f9ae84a4fa5296da83f7082f264b9a30 Mon Sep 17 00:00:00 2001 From: Jon Jenssen Date: Thu, 19 Dec 2024 13:09:09 +0100 Subject: [PATCH] Work in progress --- .../RicSnapshotFilenameGenerator.cpp | 2 +- .../ProjectDataModel/Rim2dIntersectionView.cpp | 2 +- .../ProjectDataModel/Rim3dView.cpp | 16 ++++++++++++++-- ApplicationLibCode/ProjectDataModel/Rim3dView.h | 13 +++++++------ .../RimAdvancedSnapshotExportDefinition.cpp | 2 +- .../RimStatisticsContourMapView.cpp | 8 ++++++++ .../RimStatisticsContourMapView.h | 5 +++-- .../UserInterface/RiuMainWindow.cpp | 2 +- 8 files changed, 36 insertions(+), 14 deletions(-) diff --git a/ApplicationLibCode/Commands/ExportCommands/RicSnapshotFilenameGenerator.cpp b/ApplicationLibCode/Commands/ExportCommands/RicSnapshotFilenameGenerator.cpp index 358e6b5dc3..0aae6219d5 100644 --- a/ApplicationLibCode/Commands/ExportCommands/RicSnapshotFilenameGenerator.cpp +++ b/ApplicationLibCode/Commands/ExportCommands/RicSnapshotFilenameGenerator.cpp @@ -62,7 +62,7 @@ QString RicSnapshotFilenameGenerator::generateSnapshotFileName( RimViewWindow* v //-------------------------------------------------------------------------------------------------- QString RicSnapshotFilenameGenerator::generateSnapshotFilenameForRimView( Rim3dView* rimView ) { - QStringList timeSteps = rimView->ownerCase()->timeStepStrings(); + QStringList timeSteps = rimView->timeStepStrings(); int timeStep = rimView->currentTimeStep(); QString fileName = diff --git a/ApplicationLibCode/ProjectDataModel/Rim2dIntersectionView.cpp b/ApplicationLibCode/ProjectDataModel/Rim2dIntersectionView.cpp index 156d756fc1..474489ca78 100644 --- a/ApplicationLibCode/ProjectDataModel/Rim2dIntersectionView.cpp +++ b/ApplicationLibCode/ProjectDataModel/Rim2dIntersectionView.cpp @@ -455,7 +455,7 @@ size_t Rim2dIntersectionView::onTimeStepCountRequested() { if ( isTimeStepDependentDataVisible() && ownerCase() ) { - return ownerCase()->timeStepStrings().size(); + return timeStepStrings().size(); } return 0; diff --git a/ApplicationLibCode/ProjectDataModel/Rim3dView.cpp b/ApplicationLibCode/ProjectDataModel/Rim3dView.cpp index 00d27d02ab..d299ad553a 100644 --- a/ApplicationLibCode/ProjectDataModel/Rim3dView.cpp +++ b/ApplicationLibCode/ProjectDataModel/Rim3dView.cpp @@ -604,13 +604,25 @@ size_t Rim3dView::timeStepCount() //-------------------------------------------------------------------------------------------------- QString Rim3dView::timeStepName( int frameIdx ) const { - if ( this->ownerCase() ) + if ( ownerCase() ) { - return this->ownerCase()->timeStepName( frameIdx ); + return ownerCase()->timeStepName( frameIdx ); } return QString( "" ); } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +QStringList Rim3dView::timeStepStrings() const +{ + if ( ownerCase() ) + { + return ownerCase()->timeStepStrings(); + } + return QStringList(); +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationLibCode/ProjectDataModel/Rim3dView.h b/ApplicationLibCode/ProjectDataModel/Rim3dView.h index 0a60790f77..7b77fa9d97 100644 --- a/ApplicationLibCode/ProjectDataModel/Rim3dView.h +++ b/ApplicationLibCode/ProjectDataModel/Rim3dView.h @@ -150,12 +150,13 @@ class Rim3dView : public RimViewWindow, public RiuViewerToViewInterface, public void forceShowWindowOn(); // Timestep control - int currentTimeStep() const; - void setCurrentTimeStep( int frameIdx ); - void setCurrentTimeStepAndUpdate( int frameIdx ) override; - bool isTimeStepDependentDataVisibleInThisOrComparisonView() const; - size_t timeStepCount(); - QString timeStepName( int frameIdx ) const override; + int currentTimeStep() const; + void setCurrentTimeStep( int frameIdx ); + void setCurrentTimeStepAndUpdate( int frameIdx ) override; + bool isTimeStepDependentDataVisibleInThisOrComparisonView() const; + size_t timeStepCount(); + QString timeStepName( int frameIdx ) const override; + virtual QStringList timeStepStrings() const; // Animation control caf::Signal<> updateAnimations; diff --git a/ApplicationLibCode/ProjectDataModel/RimAdvancedSnapshotExportDefinition.cpp b/ApplicationLibCode/ProjectDataModel/RimAdvancedSnapshotExportDefinition.cpp index e02f198250..2730c82324 100644 --- a/ApplicationLibCode/ProjectDataModel/RimAdvancedSnapshotExportDefinition.cpp +++ b/ApplicationLibCode/ProjectDataModel/RimAdvancedSnapshotExportDefinition.cpp @@ -162,7 +162,7 @@ void RimAdvancedSnapshotExportDefinition::getTimeStepStrings( QListownerCase()->timeStepStrings(); + timeSteps = view->timeStepStrings(); for ( int i = 0; i < timeSteps.size(); i++ ) { diff --git a/ApplicationLibCode/ProjectDataModel/RimStatisticsContourMapView.cpp b/ApplicationLibCode/ProjectDataModel/RimStatisticsContourMapView.cpp index 51311b0f06..4d036be839 100644 --- a/ApplicationLibCode/ProjectDataModel/RimStatisticsContourMapView.cpp +++ b/ApplicationLibCode/ProjectDataModel/RimStatisticsContourMapView.cpp @@ -239,3 +239,11 @@ size_t RimStatisticsContourMapView::onTimeStepCountRequested() return 0; } + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +QString RimStatisticsContourMapView::timeStepName( int frameIdx ) const +{ + return QString( "Step %1" ).arg( frameIdx ); +} diff --git a/ApplicationLibCode/ProjectDataModel/RimStatisticsContourMapView.h b/ApplicationLibCode/ProjectDataModel/RimStatisticsContourMapView.h index 0199c1c852..3b179a101a 100644 --- a/ApplicationLibCode/ProjectDataModel/RimStatisticsContourMapView.h +++ b/ApplicationLibCode/ProjectDataModel/RimStatisticsContourMapView.h @@ -39,8 +39,9 @@ class RimStatisticsContourMapView : public RimEclipseContourMapView void defineUiTreeOrdering( caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName = "" ) override; void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override; - void onClampCurrentTimestep() override; - size_t onTimeStepCountRequested() override; + void onClampCurrentTimestep() override; + size_t onTimeStepCountRequested() override; + QString timeStepName( int frameIdx ) const override; // void createContourMapGeometry(); void onUpdateLegends() override; diff --git a/ApplicationLibCode/UserInterface/RiuMainWindow.cpp b/ApplicationLibCode/UserInterface/RiuMainWindow.cpp index d1d8de2057..a3123bab47 100644 --- a/ApplicationLibCode/UserInterface/RiuMainWindow.cpp +++ b/ApplicationLibCode/UserInterface/RiuMainWindow.cpp @@ -1009,7 +1009,7 @@ void RiuMainWindow::refreshAnimationActions() if ( activeView->isTimeStepDependentDataVisibleInThisOrComparisonView() ) { - timeStepStrings = activeView->ownerCase()->timeStepStrings(); + timeStepStrings = activeView->timeStepStrings(); } else {