diff --git a/ApplicationCode/Commands/SummaryPlotCommands/RicSummaryCurveCreator.cpp b/ApplicationCode/Commands/SummaryPlotCommands/RicSummaryCurveCreator.cpp index f26f3f0223..45d72e8b27 100644 --- a/ApplicationCode/Commands/SummaryPlotCommands/RicSummaryCurveCreator.cpp +++ b/ApplicationCode/Commands/SummaryPlotCommands/RicSummaryCurveCreator.cpp @@ -368,10 +368,8 @@ std::set RicSummaryCurveCreator::getAllSummaryCaseNames() { std::set summaryCaseHashes; RimProject* proj = RiaApplication::instance()->project(); - std::vector cases; - - proj->allSummaryCases(cases); - + + std::vector cases = proj->allSummaryCases(); for (RimSummaryCase* rimCase : cases) { summaryCaseHashes.insert(rimCase->summaryHeaderFilename().toUtf8().constData()); @@ -387,9 +385,8 @@ std::set RicSummaryCurveCreator::getAllSummaryWellNames() { std::set summaryWellNames; RimProject* proj = RiaApplication::instance()->project(); - std::vector cases; - proj->allSummaryCases(cases); + std::vector cases = proj->allSummaryCases(); for (RimSummaryCase* rimCase : cases) { RifSummaryReaderInterface* reader = nullptr; diff --git a/ApplicationCode/ProjectDataModel/RimProject.cpp b/ApplicationCode/ProjectDataModel/RimProject.cpp index 8789f06818..517b1e2b18 100644 --- a/ApplicationCode/ProjectDataModel/RimProject.cpp +++ b/ApplicationCode/ProjectDataModel/RimProject.cpp @@ -547,9 +547,10 @@ void RimProject::allCases(std::vector& cases) //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -void RimProject::allSummaryCases(std::vector& sumCases) +std::vector RimProject::allSummaryCases() const { - sumCases.clear(); + std::vector sumCases; + for (RimOilField* oilField: oilFields) { if(!oilField) continue; @@ -567,24 +568,8 @@ void RimProject::allSummaryCases(std::vector& sumCases) sumCases.insert(sumCases.end(), observedData.begin(), observedData.end()); } } -} -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -void RimProject::allObservedData(std::vector& observedData) -{ - for (RimOilField* oilField : oilFields) - { - if (!oilField) continue; - RimObservedDataCollection* observedDataCollection = oilField->observedDataCollection(); - if (observedDataCollection) - { - observedData.clear(); - std::vector allObservedData = observedDataCollection->allObservedData(); - observedData.insert(observedData.end(), allObservedData.begin(), allObservedData.end()); - } - } + return sumCases; } //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationCode/ProjectDataModel/RimProject.h b/ApplicationCode/ProjectDataModel/RimProject.h index f8a80852c2..bb71149621 100644 --- a/ApplicationCode/ProjectDataModel/RimProject.h +++ b/ApplicationCode/ProjectDataModel/RimProject.h @@ -100,8 +100,9 @@ public: void assignIdToCaseGroup(RimIdenticalGridCaseGroup* caseGroup); void allCases(std::vector& cases); - void allSummaryCases(std::vector& sumCases); - void allObservedData(std::vector& observedData); + + std::vector allSummaryCases() const; + void allNotLinkedViews(std::vector& views); void allVisibleViews(std::vector& views); diff --git a/ApplicationCode/ProjectDataModel/Summary/RimSummaryCurve.cpp b/ApplicationCode/ProjectDataModel/Summary/RimSummaryCurve.cpp index 1a9152b932..1984dd8572 100644 --- a/ApplicationCode/ProjectDataModel/Summary/RimSummaryCurve.cpp +++ b/ApplicationCode/ProjectDataModel/Summary/RimSummaryCurve.cpp @@ -311,9 +311,8 @@ QList RimSummaryCurve::calculateValueOptions(const caf:: fieldNeedingOptions == &m_xValuesSummaryCase) { RimProject* proj = RiaApplication::instance()->project(); - std::vector cases; - proj->allSummaryCases(cases); + std::vector cases = proj->allSummaryCases(); cases.push_back(proj->calculationCollection->calculationSummaryCase());