diff --git a/ApplicationCode/ProjectDataModel/Summary/RimEnsembleCurveSet.h b/ApplicationCode/ProjectDataModel/Summary/RimEnsembleCurveSet.h index 740f625aff..9c905abf14 100644 --- a/ApplicationCode/ProjectDataModel/Summary/RimEnsembleCurveSet.h +++ b/ApplicationCode/ProjectDataModel/Summary/RimEnsembleCurveSet.h @@ -88,6 +88,8 @@ public: ColorMode colorMode() const; EnsembleParameterType currentEnsembleParameterType() const; + void updateAllCurves(); + private: caf::PdmFieldHandle* userDescriptionField() override; caf::PdmFieldHandle* objectToggleField(); @@ -110,7 +112,6 @@ private: void updateCurveColors(); void updateQwtPlotAxis(); - void updateAllCurves(); std::vector ensembleParameters() const; QString createAutoName() const; diff --git a/ApplicationCode/ProjectDataModel/Summary/RimSummaryCaseCollection.cpp b/ApplicationCode/ProjectDataModel/Summary/RimSummaryCaseCollection.cpp index 90d6e63f5e..beedbe85b7 100644 --- a/ApplicationCode/ProjectDataModel/Summary/RimSummaryCaseCollection.cpp +++ b/ApplicationCode/ProjectDataModel/Summary/RimSummaryCaseCollection.cpp @@ -19,6 +19,7 @@ #include "RimSummaryCaseCollection.h" #include "RimGridSummaryCase.h" +#include "RimEnsembleCurveSet.h" #include "RimProject.h" #include "RimSummaryCase.h" @@ -43,6 +44,7 @@ RimSummaryCaseCollection::RimSummaryCaseCollection() RimSummaryCaseCollection::~RimSummaryCaseCollection() { m_cases.deleteAllChildObjects(); + updateReferringCurveSets(); } //-------------------------------------------------------------------------------------------------- @@ -51,6 +53,7 @@ RimSummaryCaseCollection::~RimSummaryCaseCollection() void RimSummaryCaseCollection::removeCase(RimSummaryCase* summaryCase) { m_cases.removeChildObject(summaryCase); + updateReferringCurveSets(); } //-------------------------------------------------------------------------------------------------- @@ -59,6 +62,7 @@ void RimSummaryCaseCollection::removeCase(RimSummaryCase* summaryCase) void RimSummaryCaseCollection::addCase(RimSummaryCase* summaryCase) { m_cases.push_back(summaryCase); + updateReferringCurveSets(); } //-------------------------------------------------------------------------------------------------- @@ -92,3 +96,19 @@ caf::PdmFieldHandle* RimSummaryCaseCollection::userDescriptionField() { return &m_name; } + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimSummaryCaseCollection::updateReferringCurveSets() const +{ + // Update curve set referring to this group + std::vector referringObjects; + objectsWithReferringPtrFields(referringObjects); + + for (PdmObjectHandle* obj : referringObjects) + { + RimEnsembleCurveSet* curveSet = dynamic_cast(obj); + if (curveSet) curveSet->updateAllCurves(); + } +} diff --git a/ApplicationCode/ProjectDataModel/Summary/RimSummaryCaseCollection.h b/ApplicationCode/ProjectDataModel/Summary/RimSummaryCaseCollection.h index 8881db1d3b..efb9500549 100644 --- a/ApplicationCode/ProjectDataModel/Summary/RimSummaryCaseCollection.h +++ b/ApplicationCode/ProjectDataModel/Summary/RimSummaryCaseCollection.h @@ -42,6 +42,7 @@ public: private: caf::PdmFieldHandle* userDescriptionField() override; + void updateReferringCurveSets() const; private: caf::PdmChildArrayField m_cases;