#2170 Summary Case: Simplified access function to all cases, remove unused function

This commit is contained in:
Magne Sjaastad 2017-12-01 09:34:43 +01:00
parent a2a7155d1c
commit 6103f290bf
4 changed files with 11 additions and 29 deletions

View File

@ -368,10 +368,8 @@ std::set<std::string> RicSummaryCurveCreator::getAllSummaryCaseNames()
{
std::set<std::string> summaryCaseHashes;
RimProject* proj = RiaApplication::instance()->project();
std::vector<RimSummaryCase*> cases;
proj->allSummaryCases(cases);
std::vector<RimSummaryCase*> cases = proj->allSummaryCases();
for (RimSummaryCase* rimCase : cases)
{
summaryCaseHashes.insert(rimCase->summaryHeaderFilename().toUtf8().constData());
@ -387,9 +385,8 @@ std::set<std::string> RicSummaryCurveCreator::getAllSummaryWellNames()
{
std::set<std::string> summaryWellNames;
RimProject* proj = RiaApplication::instance()->project();
std::vector<RimSummaryCase*> cases;
proj->allSummaryCases(cases);
std::vector<RimSummaryCase*> cases = proj->allSummaryCases();
for (RimSummaryCase* rimCase : cases)
{
RifSummaryReaderInterface* reader = nullptr;

View File

@ -547,9 +547,10 @@ void RimProject::allCases(std::vector<RimCase*>& cases)
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimProject::allSummaryCases(std::vector<RimSummaryCase*>& sumCases)
std::vector<RimSummaryCase*> RimProject::allSummaryCases() const
{
sumCases.clear();
std::vector<RimSummaryCase*> sumCases;
for (RimOilField* oilField: oilFields)
{
if(!oilField) continue;
@ -567,24 +568,8 @@ void RimProject::allSummaryCases(std::vector<RimSummaryCase*>& sumCases)
sumCases.insert(sumCases.end(), observedData.begin(), observedData.end());
}
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimProject::allObservedData(std::vector<RimSummaryCase*>& observedData)
{
for (RimOilField* oilField : oilFields)
{
if (!oilField) continue;
RimObservedDataCollection* observedDataCollection = oilField->observedDataCollection();
if (observedDataCollection)
{
observedData.clear();
std::vector<RimSummaryCase*> allObservedData = observedDataCollection->allObservedData();
observedData.insert(observedData.end(), allObservedData.begin(), allObservedData.end());
}
}
return sumCases;
}
//--------------------------------------------------------------------------------------------------

View File

@ -100,8 +100,9 @@ public:
void assignIdToCaseGroup(RimIdenticalGridCaseGroup* caseGroup);
void allCases(std::vector<RimCase*>& cases);
void allSummaryCases(std::vector<RimSummaryCase*>& sumCases);
void allObservedData(std::vector<RimSummaryCase*>& observedData);
std::vector<RimSummaryCase*> allSummaryCases() const;
void allNotLinkedViews(std::vector<RimView*>& views);
void allVisibleViews(std::vector<RimView*>& views);

View File

@ -311,9 +311,8 @@ QList<caf::PdmOptionItemInfo> RimSummaryCurve::calculateValueOptions(const caf::
fieldNeedingOptions == &m_xValuesSummaryCase)
{
RimProject* proj = RiaApplication::instance()->project();
std::vector<RimSummaryCase*> cases;
proj->allSummaryCases(cases);
std::vector<RimSummaryCase*> cases = proj->allSummaryCases();
cases.push_back(proj->calculationCollection->calculationSummaryCase());