From f70fbe00715aada6afbe7ee43f1ea78c81588b3d Mon Sep 17 00:00:00 2001 From: Kristian Bendiksen Date: Tue, 22 Oct 2019 09:54:31 +0200 Subject: [PATCH] #4819 Add methods to get case and time step name for RimContourMapProjection. --- .../RimContourMapProjection.cpp | 28 +++++++++++++++++++ .../RimContourMapProjection.h | 3 ++ 2 files changed, 31 insertions(+) diff --git a/ApplicationCode/ProjectDataModel/RimContourMapProjection.cpp b/ApplicationCode/ProjectDataModel/RimContourMapProjection.cpp index b6061b0f56..71484c74f7 100644 --- a/ApplicationCode/ProjectDataModel/RimContourMapProjection.cpp +++ b/ApplicationCode/ProjectDataModel/RimContourMapProjection.cpp @@ -243,6 +243,34 @@ QString RimContourMapProjection::resultAggregationText() const return m_resultAggregation().uiText(); } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +QString RimContourMapProjection::caseName() const +{ + RimCase* rimCase = baseView()->ownerCase(); + if ( !rimCase ) + { + return QString(); + } + + return rimCase->caseUserDescription.value(); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +QString RimContourMapProjection::currentTimeStepName() const +{ + RimCase* rimCase = baseView()->ownerCase(); + if ( !rimCase || m_currentResultTimestep == -1 ) + { + return QString(); + } + + return rimCase->timeStepName( m_currentResultTimestep ); +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationCode/ProjectDataModel/RimContourMapProjection.h b/ApplicationCode/ProjectDataModel/RimContourMapProjection.h index c5c9cc19cd..3fd30d9e67 100644 --- a/ApplicationCode/ProjectDataModel/RimContourMapProjection.h +++ b/ApplicationCode/ProjectDataModel/RimContourMapProjection.h @@ -89,6 +89,9 @@ public: QString resultAggregationText() const; + QString caseName() const; + QString currentTimeStepName() const; + double maxValue() const; double minValue() const;