#2842 Ensemble curve set. Update referring curve sets when adding or removing cases from an ensemble

This commit is contained in:
Bjørn Erik Jensen 2018-05-03 12:05:28 +02:00
parent 6f275e0915
commit 9150981e13
3 changed files with 23 additions and 1 deletions

View File

@ -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<QString> ensembleParameters() const;
QString createAutoName() const;

View File

@ -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<PdmObjectHandle*> referringObjects;
objectsWithReferringPtrFields(referringObjects);
for (PdmObjectHandle* obj : referringObjects)
{
RimEnsembleCurveSet* curveSet = dynamic_cast<RimEnsembleCurveSet*>(obj);
if (curveSet) curveSet->updateAllCurves();
}
}

View File

@ -42,6 +42,7 @@ public:
private:
caf::PdmFieldHandle* userDescriptionField() override;
void updateReferringCurveSets() const;
private:
caf::PdmChildArrayField<RimSummaryCase*> m_cases;