2012-05-18 09:45:23 +02:00
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
//
|
2014-09-23 15:04:57 +02:00
|
|
|
// Copyright (C) 2011- Statoil ASA
|
|
|
|
|
// Copyright (C) 2013- Ceetron Solutions AS
|
|
|
|
|
// Copyright (C) 2011-2012 Ceetron AS
|
2012-05-18 09:45:23 +02:00
|
|
|
//
|
|
|
|
|
// 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
|
|
|
|
|
|
2017-06-13 15:41:52 +02:00
|
|
|
#include "RiaDefines.h"
|
2017-05-31 16:16:28 +02:00
|
|
|
|
2015-08-01 23:04:04 +02:00
|
|
|
#include "cafPdmChildArrayField.h"
|
2015-07-31 18:58:23 +02:00
|
|
|
#include "cafPdmChildField.h"
|
2012-05-18 09:45:23 +02:00
|
|
|
#include "cafPdmDocument.h"
|
2017-10-11 13:52:29 +02:00
|
|
|
#include "cvfCollection.h"
|
2012-05-18 09:45:23 +02:00
|
|
|
|
2015-08-06 11:00:21 +02:00
|
|
|
#include <vector>
|
|
|
|
|
|
2017-01-10 09:51:39 +01:00
|
|
|
class RigEclipseCaseData;
|
2013-03-22 15:43:42 +01:00
|
|
|
class RigGridManager;
|
2013-05-06 10:55:00 +02:00
|
|
|
class RigMainGrid;
|
2017-10-11 13:52:29 +02:00
|
|
|
class RigWellPath;
|
2016-12-09 10:01:50 +01:00
|
|
|
|
2017-10-23 14:42:38 +02:00
|
|
|
class RimSummaryCalculationCollection;
|
2015-07-31 18:58:23 +02:00
|
|
|
class RimCase;
|
2014-07-24 10:11:43 +02:00
|
|
|
class RimCommandObject;
|
2017-06-30 16:14:15 +02:00
|
|
|
class RimDialogData;
|
2015-07-31 18:58:23 +02:00
|
|
|
class RimEclipseCase;
|
2017-10-20 16:10:45 +02:00
|
|
|
class RimGeoMechCase;
|
2015-07-31 18:58:23 +02:00
|
|
|
class RimIdenticalGridCaseGroup;
|
2015-09-01 17:14:22 +02:00
|
|
|
class RimMainPlotCollection;
|
2017-09-18 20:27:20 +02:00
|
|
|
class RimMultiSnapshotDefinition;
|
|
|
|
|
class RimObservedData;
|
2015-07-31 18:58:23 +02:00
|
|
|
class RimOilField;
|
|
|
|
|
class RimScriptCollection;
|
2016-05-31 13:42:27 +02:00
|
|
|
class RimSummaryCase;
|
2018-04-06 08:16:14 +02:00
|
|
|
class RimSummaryCaseCollection;
|
2018-01-09 10:11:28 +01:00
|
|
|
class Rim3dView;
|
2018-01-15 14:52:22 +01:00
|
|
|
class RimGridView;
|
2016-12-09 10:01:50 +01:00
|
|
|
class RimViewLinker;
|
|
|
|
|
class RimViewLinkerCollection;
|
2017-10-11 13:52:29 +02:00
|
|
|
class RimWellPath;
|
2017-10-20 16:10:45 +02:00
|
|
|
class RimWellPathImport;
|
2017-12-20 13:14:43 +01:00
|
|
|
class RimFractureTemplateCollection;
|
|
|
|
|
class RimFractureTemplate;
|
2012-05-18 09:45:23 +02:00
|
|
|
|
2015-08-06 15:55:17 +02:00
|
|
|
namespace caf
|
|
|
|
|
{
|
|
|
|
|
class PdmUiTreeOrdering;
|
|
|
|
|
}
|
|
|
|
|
|
2015-08-06 11:00:21 +02:00
|
|
|
|
|
|
|
|
class QAction;
|
2015-08-17 10:51:13 +02:00
|
|
|
class QMenu;
|
2015-08-06 11:00:21 +02:00
|
|
|
|
2012-05-18 09:45:23 +02:00
|
|
|
//==================================================================================================
|
|
|
|
|
///
|
|
|
|
|
///
|
|
|
|
|
//==================================================================================================
|
|
|
|
|
class RimProject : public caf::PdmDocument
|
|
|
|
|
{
|
|
|
|
|
CAF_PDM_HEADER_INIT;
|
|
|
|
|
|
|
|
|
|
public:
|
2013-05-08 10:41:56 +02:00
|
|
|
RimProject(void);
|
|
|
|
|
virtual ~RimProject(void);
|
|
|
|
|
|
2015-08-28 10:42:57 +02:00
|
|
|
caf::PdmChildArrayField<RimOilField*> oilFields;
|
|
|
|
|
caf::PdmChildField<RimScriptCollection*> scriptCollection;
|
|
|
|
|
caf::PdmChildField<RimWellPathImport*> wellPathImport;
|
|
|
|
|
caf::PdmChildField<RimMainPlotCollection*> mainPlotCollection;
|
2015-09-08 10:17:35 +02:00
|
|
|
caf::PdmChildField<RimViewLinkerCollection*> viewLinkerCollection;
|
2017-10-23 14:42:38 +02:00
|
|
|
caf::PdmChildField<RimSummaryCalculationCollection*> calculationCollection;
|
2015-08-28 10:42:57 +02:00
|
|
|
caf::PdmChildArrayField<RimCommandObject*> commandObjects;
|
2016-10-06 15:01:59 +02:00
|
|
|
|
2016-12-09 10:01:50 +01:00
|
|
|
caf::PdmChildArrayField<RimMultiSnapshotDefinition*> multiSnapshotDefinitions;
|
2016-12-16 14:05:11 +01:00
|
|
|
|
2016-10-06 15:01:59 +02:00
|
|
|
caf::PdmField<QString> mainWindowTreeViewState;
|
|
|
|
|
caf::PdmField<QString> mainWindowCurrentModelIndexPath;
|
2012-05-18 09:45:23 +02:00
|
|
|
|
2016-10-06 15:01:59 +02:00
|
|
|
caf::PdmField<QString> plotWindowTreeViewState;
|
|
|
|
|
caf::PdmField<QString> plotWindowCurrentModelIndexPath;
|
2015-08-25 12:40:55 +02:00
|
|
|
|
2013-05-08 10:41:56 +02:00
|
|
|
void setScriptDirectories(const QString& scriptDirectories);
|
|
|
|
|
QString projectFileVersionString() const;
|
2018-01-04 13:12:07 +01:00
|
|
|
bool isProjectFileVersionEqualOrOlderThan(const QString& otherProjectFileVersion) const;
|
2013-05-08 10:41:56 +02:00
|
|
|
void close();
|
2012-05-18 09:45:23 +02:00
|
|
|
|
2013-05-08 10:41:56 +02:00
|
|
|
void setProjectFileNameAndUpdateDependencies(const QString& fileName);
|
2013-04-08 08:44:33 +02:00
|
|
|
|
2015-05-15 18:51:49 +02:00
|
|
|
void assignCaseIdToCase(RimCase* reservoirCase);
|
2013-05-10 15:35:33 +02:00
|
|
|
void assignIdToCaseGroup(RimIdenticalGridCaseGroup* caseGroup);
|
2013-05-15 10:51:41 +02:00
|
|
|
|
2015-08-30 13:30:46 +02:00
|
|
|
void allCases(std::vector<RimCase*>& cases);
|
2017-12-01 09:34:43 +01:00
|
|
|
|
|
|
|
|
std::vector<RimSummaryCase*> allSummaryCases() const;
|
2018-04-06 08:16:14 +02:00
|
|
|
std::vector<RimSummaryCaseCollection*> summaryGroups() const;
|
2017-12-01 09:34:43 +01:00
|
|
|
|
2018-01-09 10:11:28 +01:00
|
|
|
void allVisibleViews(std::vector<Rim3dView*>& views);
|
2018-01-15 14:52:22 +01:00
|
|
|
void allVisibleGridViews(std::vector<RimGridView*>& views);
|
|
|
|
|
void allNotLinkedViews(std::vector<RimGridView*>& views);
|
2015-08-30 13:30:46 +02:00
|
|
|
|
2015-05-15 18:51:49 +02:00
|
|
|
void createDisplayModelAndRedrawAllViews();
|
2013-05-16 14:10:22 +02:00
|
|
|
|
2013-09-08 10:53:25 +02:00
|
|
|
void computeUtmAreaOfInterest();
|
2013-05-31 13:57:16 +02:00
|
|
|
|
2017-12-20 13:14:43 +01:00
|
|
|
void allOilFields(std::vector<RimOilField*>& oilFields) const;
|
2017-09-18 14:49:31 +02:00
|
|
|
RimOilField* activeOilField();
|
|
|
|
|
const RimOilField* activeOilField() const;
|
2013-02-14 13:16:56 +01:00
|
|
|
|
2015-08-17 10:51:13 +02:00
|
|
|
void actionsBasedOnSelection(QMenu& contextMenu);
|
2015-08-06 11:00:21 +02:00
|
|
|
|
2016-10-04 14:23:34 +02:00
|
|
|
bool show3DWindow() const;
|
|
|
|
|
bool showPlotWindow() const;
|
|
|
|
|
|
2017-06-02 10:35:52 +02:00
|
|
|
void reloadCompletionTypeResultsInAllViews();
|
2017-06-21 11:06:38 +02:00
|
|
|
void reloadCompletionTypeResultsForEclipseCase(RimEclipseCase* eclipseCase);
|
2017-06-02 10:35:52 +02:00
|
|
|
|
2017-10-11 13:52:29 +02:00
|
|
|
RimDialogData* dialogData() const;
|
|
|
|
|
|
|
|
|
|
std::vector<RimEclipseCase*> eclipseCases() const;
|
|
|
|
|
std::vector<QString> simulationWellNames() const;
|
2017-12-07 14:51:58 +01:00
|
|
|
|
2017-11-17 15:35:07 +01:00
|
|
|
RimWellPath* wellPathFromSimWellName(const QString& simWellName, int branchIndex = -1);
|
2017-11-08 16:35:58 +01:00
|
|
|
RimWellPath* wellPathByName(const QString& wellPathName) const;
|
2017-10-25 09:55:00 +02:00
|
|
|
std::vector<RimWellPath*> allWellPaths() const;
|
2017-05-31 16:16:28 +02:00
|
|
|
|
2017-10-20 16:10:45 +02:00
|
|
|
std::vector<RimGeoMechCase*> geoMechCases() const;
|
|
|
|
|
|
2017-12-20 13:14:43 +01:00
|
|
|
std::vector<RimFractureTemplateCollection*> allFractureTemplateCollections() const;
|
|
|
|
|
std::vector<RimFractureTemplate*> allFractureTemplates() const;
|
|
|
|
|
|
2012-05-18 09:45:23 +02:00
|
|
|
protected:
|
|
|
|
|
// Overridden methods
|
2013-05-16 14:10:22 +02:00
|
|
|
void initScriptDirectories();
|
2013-05-08 10:41:56 +02:00
|
|
|
virtual void initAfterRead();
|
|
|
|
|
virtual void setupBeforeSave();
|
2012-05-18 09:45:23 +02:00
|
|
|
|
2015-08-06 15:55:17 +02:00
|
|
|
virtual void defineUiTreeOrdering(caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName = "");
|
|
|
|
|
|
2018-01-19 12:52:50 +01:00
|
|
|
private:
|
|
|
|
|
template <typename T>
|
|
|
|
|
void fieldsByType(caf::PdmObjectHandle* object, std::vector<T*>& typedFields);
|
|
|
|
|
|
2012-05-18 09:45:23 +02:00
|
|
|
private:
|
2016-10-04 14:23:34 +02:00
|
|
|
caf::PdmField<QString> m_projectFileVersionString;
|
|
|
|
|
|
2017-06-30 16:14:15 +02:00
|
|
|
caf::PdmChildField<RimDialogData*> m_dialogData;
|
|
|
|
|
|
|
|
|
|
|
2016-10-04 14:23:34 +02:00
|
|
|
caf::PdmField<bool> m_show3DWindow;
|
|
|
|
|
caf::PdmField<bool> m_showPlotWindow;
|
2015-05-08 14:13:26 +02:00
|
|
|
|
|
|
|
|
caf::PdmField<int> nextValidCaseId; // Unique case ID within a project, used to identify a case from Octave scripts
|
|
|
|
|
caf::PdmField<int> nextValidCaseGroupId; // Unique case group ID within a project, used to identify a case group from Octave scripts
|
|
|
|
|
|
2016-10-04 14:23:34 +02:00
|
|
|
caf::PdmChildArrayField<RimEclipseCase*> casesObsolete; // obsolete
|
|
|
|
|
caf::PdmChildArrayField<RimIdenticalGridCaseGroup*> caseGroupsObsolete; // obsolete
|
2012-05-18 09:45:23 +02:00
|
|
|
};
|
2018-01-19 12:52:50 +01:00
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
|
///
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
|
template <typename T>
|
|
|
|
|
void RimProject::fieldsByType(caf::PdmObjectHandle* object, std::vector<T*>& typedFields)
|
|
|
|
|
{
|
|
|
|
|
if (!object) return;
|
|
|
|
|
|
|
|
|
|
std::vector<caf::PdmFieldHandle*> allFieldsInObject;
|
|
|
|
|
object->fields(allFieldsInObject);
|
|
|
|
|
|
|
|
|
|
std::vector<caf::PdmObjectHandle*> children;
|
|
|
|
|
|
|
|
|
|
for (const auto& field : allFieldsInObject)
|
|
|
|
|
{
|
|
|
|
|
caf::PdmField<T>* typedField = dynamic_cast<caf::PdmField<T>*>(field);
|
|
|
|
|
if (typedField) typedFields.push_back(&typedField->v());
|
|
|
|
|
|
|
|
|
|
caf::PdmField< std::vector<T> >* typedFieldInVector = dynamic_cast<caf::PdmField< std::vector<T> >*>(field);
|
|
|
|
|
if (typedFieldInVector)
|
|
|
|
|
{
|
|
|
|
|
for (T& typedFieldFromVector : typedFieldInVector->v())
|
|
|
|
|
{
|
|
|
|
|
typedFields.push_back(&typedFieldFromVector);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
field->childObjects(&children);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
for (const auto& child : children)
|
|
|
|
|
{
|
|
|
|
|
fieldsByType(child, typedFields);
|
|
|
|
|
}
|
|
|
|
|
}
|