#1815 Observed data: Add function to return vector of all observed data

This commit is contained in:
Rebecca Cox 2017-09-18 20:27:20 +02:00
parent dd45f7c453
commit 16f8b9771f
4 changed files with 34 additions and 1 deletions

View File

@ -76,3 +76,15 @@ RimSummaryObservedDataFile* RimObservedDataCollection::createAndAddObservedDataF
return newObservedData;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::vector<RimObservedData*> RimObservedDataCollection::allObservedData()
{
std::vector<RimObservedData*> allObservedData;
allObservedData.insert(allObservedData.begin(), m_observedDataArray.begin(), m_observedDataArray.end());
return allObservedData;
}

View File

@ -36,6 +36,7 @@ public:
void removeObservedData(RimObservedData* observedData);
void addObservedData(RimObservedData* observedData);
RimSummaryObservedDataFile* createAndAddObservedDataFromFileName(const QString& fileName);
std::vector<RimObservedData*> allObservedData();
private:
caf::PdmChildArrayField<RimObservedData*> m_observedDataArray;

View File

@ -549,6 +549,24 @@ void RimProject::allSummaryCases(std::vector<RimSummaryCase*>& sumCases)
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimProject::allObservedData(std::vector<RimObservedData*>& observedData)
{
for (RimOilField* oilField : oilFields)
{
if (!oilField) continue;
RimObservedDataCollection* observedDataCollection = oilField->observedDataCollection();
if (observedDataCollection)
{
observedData.clear();
std::vector<RimObservedData*> allObservedData = observedDataCollection->allObservedData();
observedData.insert(observedData.end(), allObservedData.begin(), allObservedData.end());
}
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------

View File

@ -38,7 +38,8 @@ class RimDialogData;
class RimEclipseCase;
class RimIdenticalGridCaseGroup;
class RimMainPlotCollection;
class RimMultiSnapshotDefinition;
class RimMultiSnapshotDefinition;
class RimObservedData;
class RimOilField;
class RimScriptCollection;
class RimSummaryCase;
@ -94,6 +95,7 @@ public:
void allCases(std::vector<RimCase*>& cases);
void allSummaryCases(std::vector<RimSummaryCase*>& sumCases);
void allObservedData(std::vector<RimObservedData*>& observedData);
void allNotLinkedViews(std::vector<RimView*>& views);
void allVisibleViews(std::vector<RimView*>& views);