2012-05-18 02:45:23 -05:00
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
2014-09-23 08:04:57 -05:00
|
|
|
// Copyright (C) 2011- Statoil ASA
|
|
|
|
// Copyright (C) 2013- Ceetron Solutions AS
|
|
|
|
// Copyright (C) 2011-2012 Ceetron AS
|
2012-05-18 02:45:23 -05: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 08:41:52 -05:00
|
|
|
#include "RiaDefines.h"
|
2018-08-28 04:12:05 -05:00
|
|
|
#include "RiaEclipseUnitTools.h"
|
2017-05-31 09:16:28 -05:00
|
|
|
|
2015-08-01 16:04:04 -05:00
|
|
|
#include "cafPdmChildArrayField.h"
|
2015-07-31 11:58:23 -05:00
|
|
|
#include "cafPdmChildField.h"
|
2012-05-18 02:45:23 -05:00
|
|
|
#include "cafPdmDocument.h"
|
2017-10-11 06:52:29 -05:00
|
|
|
#include "cvfCollection.h"
|
2012-05-18 02:45:23 -05:00
|
|
|
|
2015-08-06 04:00:21 -05:00
|
|
|
#include <vector>
|
|
|
|
|
2017-01-10 02:51:39 -06:00
|
|
|
class RigEclipseCaseData;
|
2013-03-22 09:43:42 -05:00
|
|
|
class RigGridManager;
|
2013-05-06 03:55:00 -05:00
|
|
|
class RigMainGrid;
|
2017-10-11 06:52:29 -05:00
|
|
|
class RigWellPath;
|
2016-12-09 03:01:50 -06:00
|
|
|
|
2018-11-23 06:33:59 -06:00
|
|
|
class RimTextAnnotation;
|
|
|
|
class RimReachCircleAnnotation;
|
|
|
|
class RimPolylineAnnotation;
|
2017-10-23 07:42:38 -05:00
|
|
|
class RimSummaryCalculationCollection;
|
2015-07-31 11:58:23 -05:00
|
|
|
class RimCase;
|
2014-07-24 03:11:43 -05:00
|
|
|
class RimCommandObject;
|
2017-06-30 09:14:15 -05:00
|
|
|
class RimDialogData;
|
2015-07-31 11:58:23 -05:00
|
|
|
class RimEclipseCase;
|
2017-10-20 09:10:45 -05:00
|
|
|
class RimGeoMechCase;
|
2015-07-31 11:58:23 -05:00
|
|
|
class RimIdenticalGridCaseGroup;
|
2015-09-01 10:14:22 -05:00
|
|
|
class RimMainPlotCollection;
|
2017-09-18 13:27:20 -05:00
|
|
|
class RimMultiSnapshotDefinition;
|
|
|
|
class RimObservedData;
|
2015-07-31 11:58:23 -05:00
|
|
|
class RimOilField;
|
|
|
|
class RimScriptCollection;
|
2016-05-31 06:42:27 -05:00
|
|
|
class RimSummaryCase;
|
2018-04-06 01:16:14 -05:00
|
|
|
class RimSummaryCaseCollection;
|
2018-06-25 08:14:47 -05:00
|
|
|
class RimSummaryCaseMainCollection;
|
2018-01-09 03:11:28 -06:00
|
|
|
class Rim3dView;
|
2018-01-15 07:52:22 -06:00
|
|
|
class RimGridView;
|
2016-12-09 03:01:50 -06:00
|
|
|
class RimViewLinker;
|
|
|
|
class RimViewLinkerCollection;
|
2017-10-11 06:52:29 -05:00
|
|
|
class RimWellPath;
|
2017-10-20 09:10:45 -05:00
|
|
|
class RimWellPathImport;
|
2017-12-20 06:14:43 -06:00
|
|
|
class RimFractureTemplateCollection;
|
|
|
|
class RimFractureTemplate;
|
2012-05-18 02:45:23 -05:00
|
|
|
|
2015-08-06 08:55:17 -05:00
|
|
|
namespace caf
|
|
|
|
{
|
|
|
|
class PdmUiTreeOrdering;
|
|
|
|
}
|
|
|
|
|
2015-08-06 04:00:21 -05:00
|
|
|
|
|
|
|
class QAction;
|
2015-08-17 03:51:13 -05:00
|
|
|
class QMenu;
|
2015-08-06 04:00:21 -05:00
|
|
|
|
2012-05-18 02:45:23 -05:00
|
|
|
//==================================================================================================
|
|
|
|
///
|
|
|
|
///
|
|
|
|
//==================================================================================================
|
|
|
|
class RimProject : public caf::PdmDocument
|
|
|
|
{
|
|
|
|
CAF_PDM_HEADER_INIT;
|
|
|
|
|
|
|
|
public:
|
2013-05-08 03:41:56 -05:00
|
|
|
RimProject(void);
|
2018-10-18 12:45:57 -05:00
|
|
|
~RimProject(void) override;
|
2013-05-08 03:41:56 -05:00
|
|
|
|
2015-08-28 03:42:57 -05:00
|
|
|
caf::PdmChildArrayField<RimOilField*> oilFields;
|
|
|
|
caf::PdmChildField<RimScriptCollection*> scriptCollection;
|
|
|
|
caf::PdmChildField<RimWellPathImport*> wellPathImport;
|
|
|
|
caf::PdmChildField<RimMainPlotCollection*> mainPlotCollection;
|
2015-09-08 03:17:35 -05:00
|
|
|
caf::PdmChildField<RimViewLinkerCollection*> viewLinkerCollection;
|
2017-10-23 07:42:38 -05:00
|
|
|
caf::PdmChildField<RimSummaryCalculationCollection*> calculationCollection;
|
2015-08-28 03:42:57 -05:00
|
|
|
caf::PdmChildArrayField<RimCommandObject*> commandObjects;
|
2016-10-06 08:01:59 -05:00
|
|
|
|
2016-12-09 03:01:50 -06:00
|
|
|
caf::PdmChildArrayField<RimMultiSnapshotDefinition*> multiSnapshotDefinitions;
|
2016-12-16 07:05:11 -06:00
|
|
|
|
2016-10-06 08:01:59 -05:00
|
|
|
caf::PdmField<QString> mainWindowTreeViewState;
|
|
|
|
caf::PdmField<QString> mainWindowCurrentModelIndexPath;
|
2012-05-18 02:45:23 -05:00
|
|
|
|
2016-10-06 08:01:59 -05:00
|
|
|
caf::PdmField<QString> plotWindowTreeViewState;
|
|
|
|
caf::PdmField<QString> plotWindowCurrentModelIndexPath;
|
2015-08-25 05:40:55 -05:00
|
|
|
|
2013-05-08 03:41:56 -05:00
|
|
|
void setScriptDirectories(const QString& scriptDirectories);
|
|
|
|
QString projectFileVersionString() const;
|
2018-01-04 06:12:07 -06:00
|
|
|
bool isProjectFileVersionEqualOrOlderThan(const QString& otherProjectFileVersion) const;
|
2013-05-08 03:41:56 -05:00
|
|
|
void close();
|
2012-05-18 02:45:23 -05:00
|
|
|
|
2018-09-24 14:32:58 -05:00
|
|
|
void setProjectFileNameAndUpdateDependencies(const QString& projectFileName);
|
2013-04-08 01:44:33 -05:00
|
|
|
|
2015-05-15 11:51:49 -05:00
|
|
|
void assignCaseIdToCase(RimCase* reservoirCase);
|
2013-05-10 08:35:33 -05:00
|
|
|
void assignIdToCaseGroup(RimIdenticalGridCaseGroup* caseGroup);
|
2013-05-15 03:51:41 -05:00
|
|
|
|
2018-08-28 04:12:05 -05:00
|
|
|
void allCases(std::vector<RimCase*>& cases) const;
|
2017-12-01 02:34:43 -06:00
|
|
|
|
2018-11-07 01:41:04 -06:00
|
|
|
std::vector<RimSummaryCase*> allSummaryCases() const;
|
2018-04-06 01:16:14 -05:00
|
|
|
std::vector<RimSummaryCaseCollection*> summaryGroups() const;
|
2018-11-07 01:41:04 -06:00
|
|
|
RimSummaryCaseMainCollection* firstSummaryCaseMainCollection() const;
|
2018-06-25 08:14:47 -05:00
|
|
|
|
2018-01-09 03:11:28 -06:00
|
|
|
void allVisibleViews(std::vector<Rim3dView*>& views);
|
2018-01-15 07:52:22 -06:00
|
|
|
void allVisibleGridViews(std::vector<RimGridView*>& views);
|
|
|
|
void allNotLinkedViews(std::vector<RimGridView*>& views);
|
2015-08-30 06:30:46 -05:00
|
|
|
|
2018-10-03 08:57:09 -05:00
|
|
|
void scheduleCreateDisplayModelAndRedrawAllViews();
|
Added visualization of Well Paths in reservoir views.
Added PDM objects for a list of well paths (RimWellPathCollection) and for individual well paths (RimWellPath).
RimWellPathCollection uses RivWellPathCollectionPartMgr to generate visualization parts for each well path in the collection.
RimWellPath handles geometry defined in RigWellPath, and RivWellPathPartMgr is used to generate visualization parts. The well path visualization parts are generated by reusing RivPipeGeometryGenerator (also used for well pipes).
Added features:
- Select Open Well Paths in File menu to open one or more well path files, file format supported is Statoil JSON format.
- Each well path has a label showing the name, and the PDM window will show additional info (Id, Source System, UTM Zone, Update Date and User, Survey Type, File Path).
- Possible to turn on / off visibility, set thickness, set color for individual well paths.
- List of well paths including specified parameters/settings will be stored in project file.
- Possible to clip all well paths at a specified distance to the reservoir as this is the relevant area to see, and if showing whole well path it may be problematic for auto zoom etc.
Known problems:
- Well paths are not shown in some types of reservoir views, for instance reservoir views showing well pipes. Will look into this later.
p4#: 21658
2013-05-16 07:10:22 -05:00
|
|
|
|
2013-09-08 03:53:25 -05:00
|
|
|
void computeUtmAreaOfInterest();
|
2013-05-31 06:57:16 -05:00
|
|
|
|
2018-09-24 14:32:58 -05:00
|
|
|
void allOilFields(std::vector<RimOilField*>& allOilFields) const;
|
2017-09-18 07:49:31 -05:00
|
|
|
RimOilField* activeOilField();
|
|
|
|
const RimOilField* activeOilField() const;
|
2013-02-14 06:16:56 -06:00
|
|
|
|
2015-08-17 03:51:13 -05:00
|
|
|
void actionsBasedOnSelection(QMenu& contextMenu);
|
2015-08-06 04:00:21 -05:00
|
|
|
|
2016-10-04 07:23:34 -05:00
|
|
|
bool show3DWindow() const;
|
|
|
|
bool showPlotWindow() const;
|
|
|
|
|
2017-06-02 03:35:52 -05:00
|
|
|
void reloadCompletionTypeResultsInAllViews();
|
2017-06-21 04:06:38 -05:00
|
|
|
void reloadCompletionTypeResultsForEclipseCase(RimEclipseCase* eclipseCase);
|
2017-06-02 03:35:52 -05:00
|
|
|
|
2017-10-11 06:52:29 -05:00
|
|
|
RimDialogData* dialogData() const;
|
|
|
|
|
|
|
|
std::vector<RimEclipseCase*> eclipseCases() const;
|
2018-04-13 04:11:05 -05:00
|
|
|
RimEclipseCase* eclipseCaseFromGridFileName(const QString& gridFileName) const;
|
|
|
|
|
2017-10-11 06:52:29 -05:00
|
|
|
std::vector<QString> simulationWellNames() const;
|
2017-12-07 07:51:58 -06:00
|
|
|
|
2017-11-17 08:35:07 -06:00
|
|
|
RimWellPath* wellPathFromSimWellName(const QString& simWellName, int branchIndex = -1);
|
2017-11-08 09:35:58 -06:00
|
|
|
RimWellPath* wellPathByName(const QString& wellPathName) const;
|
2017-10-25 02:55:00 -05:00
|
|
|
std::vector<RimWellPath*> allWellPaths() const;
|
2018-11-23 06:33:59 -06:00
|
|
|
std::vector<RimTextAnnotation*> textAnnotations() const;
|
|
|
|
std::vector<RimReachCircleAnnotation*> reachCircleAnnotations() const;
|
|
|
|
std::vector<RimPolylineAnnotation*> polylineAnnotations() const;
|
2017-05-31 09:16:28 -05:00
|
|
|
|
2017-10-20 09:10:45 -05:00
|
|
|
std::vector<RimGeoMechCase*> geoMechCases() const;
|
|
|
|
|
2017-12-20 06:14:43 -06:00
|
|
|
std::vector<RimFractureTemplateCollection*> allFractureTemplateCollections() const;
|
|
|
|
std::vector<RimFractureTemplate*> allFractureTemplates() const;
|
|
|
|
|
2018-10-09 05:23:44 -05:00
|
|
|
RiaEclipseUnitTools::UnitSystemType commonUnitSystemForAllCases() const;
|
2018-08-28 04:12:05 -05:00
|
|
|
|
2012-05-18 02:45:23 -05:00
|
|
|
protected:
|
|
|
|
// Overridden methods
|
Added visualization of Well Paths in reservoir views.
Added PDM objects for a list of well paths (RimWellPathCollection) and for individual well paths (RimWellPath).
RimWellPathCollection uses RivWellPathCollectionPartMgr to generate visualization parts for each well path in the collection.
RimWellPath handles geometry defined in RigWellPath, and RivWellPathPartMgr is used to generate visualization parts. The well path visualization parts are generated by reusing RivPipeGeometryGenerator (also used for well pipes).
Added features:
- Select Open Well Paths in File menu to open one or more well path files, file format supported is Statoil JSON format.
- Each well path has a label showing the name, and the PDM window will show additional info (Id, Source System, UTM Zone, Update Date and User, Survey Type, File Path).
- Possible to turn on / off visibility, set thickness, set color for individual well paths.
- List of well paths including specified parameters/settings will be stored in project file.
- Possible to clip all well paths at a specified distance to the reservoir as this is the relevant area to see, and if showing whole well path it may be problematic for auto zoom etc.
Known problems:
- Well paths are not shown in some types of reservoir views, for instance reservoir views showing well pipes. Will look into this later.
p4#: 21658
2013-05-16 07:10:22 -05:00
|
|
|
void initScriptDirectories();
|
2018-10-18 12:45:57 -05:00
|
|
|
void initAfterRead() override;
|
|
|
|
void setupBeforeSave() override;
|
2012-05-18 02:45:23 -05:00
|
|
|
|
2018-10-18 12:45:57 -05:00
|
|
|
void defineUiTreeOrdering(caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName = "") override;
|
2015-08-06 08:55:17 -05:00
|
|
|
|
2018-01-19 05:52:50 -06:00
|
|
|
private:
|
|
|
|
template <typename T>
|
|
|
|
void fieldsByType(caf::PdmObjectHandle* object, std::vector<T*>& typedFields);
|
|
|
|
|
2012-05-18 02:45:23 -05:00
|
|
|
private:
|
2016-10-04 07:23:34 -05:00
|
|
|
caf::PdmField<QString> m_projectFileVersionString;
|
|
|
|
|
2017-06-30 09:14:15 -05:00
|
|
|
caf::PdmChildField<RimDialogData*> m_dialogData;
|
|
|
|
|
|
|
|
|
2016-10-04 07:23:34 -05:00
|
|
|
caf::PdmField<bool> m_show3DWindow;
|
|
|
|
caf::PdmField<bool> m_showPlotWindow;
|
2015-05-08 07:13:26 -05: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 07:23:34 -05:00
|
|
|
caf::PdmChildArrayField<RimEclipseCase*> casesObsolete; // obsolete
|
|
|
|
caf::PdmChildArrayField<RimIdenticalGridCaseGroup*> caseGroupsObsolete; // obsolete
|
2012-05-18 02:45:23 -05:00
|
|
|
};
|
2018-01-19 05:52:50 -06: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);
|
|
|
|
}
|
|
|
|
}
|