mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
This commit is contained in:
@@ -10,6 +10,7 @@ ${CEE_CURRENT_LIST_DIR}RimFileSummaryCase.h
|
||||
${CEE_CURRENT_LIST_DIR}RimGridSummaryCase.h
|
||||
${CEE_CURRENT_LIST_DIR}RimSummaryCase.h
|
||||
${CEE_CURRENT_LIST_DIR}RimSummaryCaseMainCollection.h
|
||||
${CEE_CURRENT_LIST_DIR}RimSummaryCaseCollection.h
|
||||
${CEE_CURRENT_LIST_DIR}RimSummaryCurve.h
|
||||
${CEE_CURRENT_LIST_DIR}RimSummaryCurveAppearanceCalculator.h
|
||||
${CEE_CURRENT_LIST_DIR}RimSummaryCurveAutoName.h
|
||||
@@ -28,6 +29,7 @@ ${CEE_CURRENT_LIST_DIR}RimFileSummaryCase.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RimGridSummaryCase.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RimSummaryCase.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RimSummaryCaseMainCollection.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RimSummaryCaseCollection.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RimSummaryCurve.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RimSummaryCurveAppearanceCalculator.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RimSummaryCurveAutoName.cpp
|
||||
|
||||
@@ -0,0 +1,81 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2016- Statoil ASA
|
||||
//
|
||||
// ResInsight is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
// FITNESS FOR A PARTICULAR PURPOSE.
|
||||
//
|
||||
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
||||
// for more details.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
#include "RimSummaryCaseCollection.h"
|
||||
|
||||
#include "RimGridSummaryCase.h"
|
||||
#include "RimProject.h"
|
||||
#include "RimSummaryCase.h"
|
||||
|
||||
#include <QDir>
|
||||
|
||||
|
||||
CAF_PDM_SOURCE_INIT(RimSummaryCaseCollection,"SummaryCaseSubCollection");
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimSummaryCaseCollection::RimSummaryCaseCollection()
|
||||
{
|
||||
CAF_PDM_InitObject("Summary Case Group",":/Cases16x16.png","","");
|
||||
|
||||
CAF_PDM_InitFieldNoDefault(&m_cases,"SummaryCases","","","","");
|
||||
m_cases.uiCapability()->setUiHidden(true);
|
||||
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimSummaryCaseCollection::~RimSummaryCaseCollection()
|
||||
{
|
||||
m_cases.deleteAllChildObjects();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSummaryCaseCollection::deleteCase(RimSummaryCase* summaryCase)
|
||||
{
|
||||
m_cases.removeChildObject(summaryCase);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSummaryCaseCollection::addCase(RimSummaryCase* summaryCase)
|
||||
{
|
||||
m_cases.push_back(summaryCase);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimSummaryCase* RimSummaryCaseCollection::summaryCase(size_t idx)
|
||||
{
|
||||
return m_cases[idx];
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
size_t RimSummaryCaseCollection::summaryCaseCount()
|
||||
{
|
||||
return m_cases.size();
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2016- Statoil ASA
|
||||
//
|
||||
// ResInsight is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
// FITNESS FOR A PARTICULAR PURPOSE.
|
||||
//
|
||||
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
||||
// for more details.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
#pragma once
|
||||
|
||||
#include "cafPdmChildArrayField.h"
|
||||
#include "cafPdmObject.h"
|
||||
|
||||
class RimSummaryCase;
|
||||
|
||||
class RimSummaryCaseCollection : public caf::PdmObject
|
||||
{
|
||||
CAF_PDM_HEADER_INIT;
|
||||
public:
|
||||
RimSummaryCaseCollection();
|
||||
virtual ~RimSummaryCaseCollection();
|
||||
|
||||
RimSummaryCase* summaryCase(size_t idx);
|
||||
size_t summaryCaseCount();
|
||||
|
||||
void deleteCase(RimSummaryCase* summaryCase);
|
||||
void addCase(RimSummaryCase* summaryCase);
|
||||
|
||||
private:
|
||||
|
||||
private:
|
||||
caf::PdmChildArrayField<RimSummaryCase*> m_cases;
|
||||
};
|
||||
@@ -18,12 +18,14 @@
|
||||
#include "RimSummaryCaseMainCollection.h"
|
||||
|
||||
#include "RifEclipseSummaryTools.h"
|
||||
|
||||
#include "RimEclipseResultCase.h"
|
||||
#include "RimFileSummaryCase.h"
|
||||
#include "RimGridSummaryCase.h"
|
||||
#include "RimOilField.h"
|
||||
#include "RimProject.h"
|
||||
#include "RimSummaryCase.h"
|
||||
#include "RimSummaryCaseCollection.h"
|
||||
|
||||
#include <QDir>
|
||||
|
||||
@@ -37,9 +39,11 @@ RimSummaryCaseMainCollection::RimSummaryCaseMainCollection()
|
||||
{
|
||||
CAF_PDM_InitObject("Summary Cases",":/Cases16x16.png","","");
|
||||
|
||||
CAF_PDM_InitFieldNoDefault(&m_cases,"SummaryCases","","","","");
|
||||
m_cases.uiCapability()->setUiHidden(true);
|
||||
CAF_PDM_InitFieldNoDefault(&m_cases, "SummaryCases", "", "", "", "");
|
||||
CAF_PDM_InitFieldNoDefault(&m_caseCollections, "SummaryCaseCollections", "", "", "", "");
|
||||
|
||||
m_cases.uiCapability()->setUiHidden(true);
|
||||
m_caseCollections.uiCapability()->setUiHidden(true);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -48,6 +52,7 @@ RimSummaryCaseMainCollection::RimSummaryCaseMainCollection()
|
||||
RimSummaryCaseMainCollection::~RimSummaryCaseMainCollection()
|
||||
{
|
||||
m_cases.deleteAllChildObjects();
|
||||
m_caseCollections.deleteAllChildObjects();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -144,6 +149,24 @@ RimSummaryCase* RimSummaryCaseMainCollection::findSummaryCaseFromFileName(const
|
||||
void RimSummaryCaseMainCollection::deleteCase(RimSummaryCase* summaryCase)
|
||||
{
|
||||
m_cases.removeChildObject(summaryCase);
|
||||
for (RimSummaryCaseCollection* summaryCaseCollection : m_caseCollections)
|
||||
{
|
||||
summaryCaseCollection->deleteCase(summaryCase);
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSummaryCaseMainCollection::addCaseCollection(std::vector<RimSummaryCase*> summaryCases)
|
||||
{
|
||||
RimSummaryCaseCollection* summaryCaseCollection = new RimSummaryCaseCollection();
|
||||
for (RimSummaryCase* summaryCase : summaryCases)
|
||||
{
|
||||
m_cases.removeChildObject(summaryCase);
|
||||
summaryCaseCollection->addCase(summaryCase);
|
||||
}
|
||||
m_caseCollections.push_back(summaryCaseCollection);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -162,12 +185,33 @@ size_t RimSummaryCaseMainCollection::summaryCaseCount()
|
||||
return m_cases.size();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<RimSummaryCase*> RimSummaryCaseMainCollection::allSummaryCases()
|
||||
{
|
||||
std::vector<RimSummaryCase*> allCases;
|
||||
|
||||
for (RimSummaryCaseCollection* summaryCaseCollection : m_caseCollections)
|
||||
{
|
||||
std::vector<RimSummaryCase*> cases;
|
||||
summaryCaseCollection->descendantsIncludingThisOfType(cases);
|
||||
allCases.insert(allCases.end(), cases.begin(), cases.end());
|
||||
}
|
||||
|
||||
std::vector<RimSummaryCase*> cases;
|
||||
this->descendantsIncludingThisOfType(cases);
|
||||
allCases.insert(allCases.end(), cases.begin(), cases.end());
|
||||
|
||||
return allCases;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSummaryCaseMainCollection::loadAllSummaryCaseData()
|
||||
{
|
||||
for (RimSummaryCase* sumCase: m_cases)
|
||||
for (RimSummaryCase* sumCase: allSummaryCases())
|
||||
{
|
||||
if (sumCase) sumCase->loadCase();
|
||||
}
|
||||
|
||||
@@ -20,8 +20,11 @@
|
||||
#include "cafPdmChildArrayField.h"
|
||||
#include "cafPdmObject.h"
|
||||
|
||||
#include <vector>
|
||||
|
||||
class RimSummaryCase;
|
||||
class RimEclipseResultCase;
|
||||
class RimSummaryCaseCollection;
|
||||
|
||||
class RimSummaryCaseMainCollection : public caf::PdmObject
|
||||
{
|
||||
@@ -32,6 +35,8 @@ public:
|
||||
|
||||
RimSummaryCase* summaryCase(size_t idx);
|
||||
size_t summaryCaseCount();
|
||||
|
||||
std::vector<RimSummaryCase*> allSummaryCases();
|
||||
|
||||
void createSummaryCasesFromRelevantEclipseResultCases();
|
||||
RimSummaryCase* createAndAddSummaryCaseFromEclipseResultCase(RimEclipseResultCase* eclResCase);
|
||||
@@ -42,6 +47,7 @@ public:
|
||||
|
||||
void deleteCase(RimSummaryCase* summaryCase);
|
||||
|
||||
void addCaseCollection(std::vector<RimSummaryCase*> summaryCases);
|
||||
|
||||
void loadAllSummaryCaseData();
|
||||
|
||||
@@ -53,4 +59,5 @@ private:
|
||||
|
||||
private:
|
||||
caf::PdmChildArrayField<RimSummaryCase*> m_cases;
|
||||
caf::PdmChildArrayField<RimSummaryCaseCollection*> m_caseCollections;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user