mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-09 23:16:00 -06:00
This commit is contained in:
parent
75f350db10
commit
8991cfef0d
@ -8,6 +8,7 @@ set (SOURCE_GROUP_HEADER_FILES
|
||||
${CEE_CURRENT_LIST_DIR}RicCloseCaseFeature.h
|
||||
${CEE_CURRENT_LIST_DIR}RicCloseSummaryCaseFeature.h
|
||||
${CEE_CURRENT_LIST_DIR}RicCloseSummaryCaseCollectionFeature.h
|
||||
${CEE_CURRENT_LIST_DIR}RicCreateSummaryCaseCollectionFeature.h
|
||||
${CEE_CURRENT_LIST_DIR}RicGeoMechPropertyFilterFeatureImpl.h
|
||||
${CEE_CURRENT_LIST_DIR}RicGeoMechPropertyFilterInsertFeature.h
|
||||
${CEE_CURRENT_LIST_DIR}RicGeoMechPropertyFilterInsertExec.h
|
||||
@ -73,6 +74,7 @@ set (SOURCE_GROUP_SOURCE_FILES
|
||||
${CEE_CURRENT_LIST_DIR}RicCloseCaseFeature.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RicCloseSummaryCaseFeature.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RicCloseSummaryCaseCollectionFeature.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RicCreateSummaryCaseCollectionFeature.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RicGeoMechPropertyFilterFeatureImpl.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RicGeoMechPropertyFilterInsertFeature.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RicGeoMechPropertyFilterInsertExec.cpp
|
||||
|
@ -66,16 +66,6 @@ void RicCloseSummaryCaseCollectionFeature::onActionTriggered(bool isChecked)
|
||||
std::vector<RimSummaryCaseMainCollection*> summaryCaseMainCollections;
|
||||
caf::SelectionManager::instance()->objectsByType(&summaryCaseMainCollections);
|
||||
|
||||
for (RimSummaryCaseMainCollection* summaryCaseCollection : summaryCaseMainCollections)
|
||||
{
|
||||
std::vector<RimSummaryCase*> summaryCasesFromCollection;
|
||||
|
||||
for (int i = 0; i < summaryCaseCollection->summaryCaseCount(); i++)
|
||||
{
|
||||
summaryCasesFromCollection.push_back(summaryCaseCollection->summaryCase(i));
|
||||
}
|
||||
|
||||
RicCloseSummaryCaseFeature::deleteSummaryCases(summaryCasesFromCollection);
|
||||
}
|
||||
RicCloseSummaryCaseFeature::deleteSummaryCases(summaryCaseMainCollections[0]->allSummaryCases());
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,64 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2017- 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 "RicCreateSummaryCaseCollectionFeature.h"
|
||||
|
||||
#include "RimSummaryCase.h"
|
||||
#include "RimSummaryCaseMainCollection.h"
|
||||
|
||||
#include "cafPdmObject.h"
|
||||
#include "cafSelectionManager.h"
|
||||
|
||||
#include <QAction>
|
||||
|
||||
CAF_CMD_SOURCE_INIT(RicCreateSummaryCaseCollectionFeature, "RicCreateSummaryCaseCollectionFeature");
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RicCreateSummaryCaseCollectionFeature::isCommandEnabled()
|
||||
{
|
||||
std::vector<RimSummaryCase*> selection;
|
||||
caf::SelectionManager::instance()->objectsByType(&selection);
|
||||
|
||||
return (selection.size() > 0);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicCreateSummaryCaseCollectionFeature::onActionTriggered(bool isChecked)
|
||||
{
|
||||
std::vector<RimSummaryCase*> selection;
|
||||
caf::SelectionManager::instance()->objectsByType(&selection);
|
||||
|
||||
RimSummaryCaseMainCollection* summaryCaseMainCollection = nullptr;
|
||||
selection.at(0)->firstAncestorOrThisOfTypeAsserted(summaryCaseMainCollection);
|
||||
|
||||
summaryCaseMainCollection->addCaseCollection(selection);
|
||||
summaryCaseMainCollection->updateConnectedEditors();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicCreateSummaryCaseCollectionFeature::setupActionLook(QAction* actionToSetup)
|
||||
{
|
||||
actionToSetup->setText("Group Summary Cases");
|
||||
actionToSetup->setIcon(QIcon(":/Folder.png"));
|
||||
}
|
@ -0,0 +1,33 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2017- 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 "cafCmdFeature.h"
|
||||
|
||||
#include <vector>
|
||||
|
||||
class RicCreateSummaryCaseCollectionFeature : public caf::CmdFeature
|
||||
{
|
||||
CAF_CMD_HEADER_INIT;
|
||||
|
||||
protected:
|
||||
virtual bool isCommandEnabled() override;
|
||||
virtual void onActionTriggered(bool isChecked) override;
|
||||
virtual void setupActionLook(QAction* actionToSetup) override;
|
||||
};
|
@ -24,10 +24,12 @@
|
||||
#include "RimMainPlotCollection.h"
|
||||
#include "RimProject.h"
|
||||
#include "RimSummaryCase.h"
|
||||
#include "RimSummaryCaseCollection.h"
|
||||
#include "RimSummaryCaseMainCollection.h"
|
||||
#include "RimSummaryPlot.h"
|
||||
#include "RimSummaryPlotCollection.h"
|
||||
|
||||
|
||||
#include "cafPdmObject.h"
|
||||
#include "cafSelectionManager.h"
|
||||
|
||||
@ -87,17 +89,25 @@ void RicReloadSummaryCaseFeature::setupActionLook(QAction* actionToSetup)
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<RimSummaryCase*> RicReloadSummaryCaseFeature::selectedSummaryCases()
|
||||
{
|
||||
std::vector<RimSummaryCase*> caseSelection;
|
||||
caf::SelectionManager::instance()->objectsByType(&caseSelection);
|
||||
|
||||
std::vector<RimSummaryCaseMainCollection*> mainCollectionSelection;
|
||||
caf::SelectionManager::instance()->objectsByType(&mainCollectionSelection);
|
||||
|
||||
for (auto sumMainColl : mainCollectionSelection)
|
||||
if (mainCollectionSelection.size() > 0)
|
||||
{
|
||||
for (size_t i = 0; i < sumMainColl->summaryCaseCount(); i++)
|
||||
return mainCollectionSelection[0]->allSummaryCases();
|
||||
}
|
||||
|
||||
std::vector<RimSummaryCase*> caseSelection;
|
||||
caf::SelectionManager::instance()->objectsByType(&caseSelection);
|
||||
|
||||
std::vector<RimSummaryCaseCollection*> collectionSelection;
|
||||
caf::SelectionManager::instance()->objectsByType(&collectionSelection);
|
||||
|
||||
for (auto collection : collectionSelection)
|
||||
{
|
||||
for (size_t i = 0; i < collection->summaryCaseCount(); i++)
|
||||
{
|
||||
caseSelection.push_back(sumMainColl->summaryCase(i));
|
||||
caseSelection.push_back(collection->summaryCase(i));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -446,6 +446,7 @@ QStringList RimContextCommandBuilder::commandsFromSelection()
|
||||
commandIds << "RicCloseSummaryCaseFeature";
|
||||
commandIds << "RicCloseSummaryCaseCollectionFeature";
|
||||
commandIds << "RicReloadSummaryCaseFeature";
|
||||
commandIds << "RicCreateSummaryCaseCollectionFeature";
|
||||
|
||||
|
||||
// Fracture commands
|
||||
|
@ -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;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user