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.
|
|
|
|
//
|
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#include "RimProject.h"
|
2013-05-06 03:55:00 -05:00
|
|
|
|
2019-05-06 03:36:05 -05:00
|
|
|
#include "RiaGuiApplication.h"
|
2018-11-05 07:28:07 -06:00
|
|
|
#include "RiaCompletionTypeCalculationScheduler.h"
|
|
|
|
#include "RiaFieldHandleTools.h"
|
|
|
|
#include "RiaFilePathTools.h"
|
2018-01-04 06:12:07 -06:00
|
|
|
#include "RiaProjectFileVersionTools.h"
|
2013-03-22 10:12:00 -05:00
|
|
|
#include "RiaVersionInfo.h"
|
2015-08-01 16:04:04 -05:00
|
|
|
|
2017-01-10 02:51:39 -06:00
|
|
|
#include "RigEclipseCaseData.h"
|
2017-01-09 12:51:15 -06:00
|
|
|
#include "RigGridBase.h"
|
2015-08-01 16:04:04 -05:00
|
|
|
|
2019-04-05 03:11:30 -05:00
|
|
|
#include "RimAdvancedSnapshotExportDefinition.h"
|
2018-11-23 06:33:59 -06:00
|
|
|
#include "RimAnnotationCollection.h"
|
2018-11-26 07:48:06 -06:00
|
|
|
#include "RimAnnotationInViewCollection.h"
|
2015-08-25 05:40:55 -05:00
|
|
|
#include "RimCalcScript.h"
|
2015-11-18 02:35:38 -06:00
|
|
|
#include "RimCase.h"
|
2014-07-24 03:11:43 -05:00
|
|
|
#include "RimCaseCollection.h"
|
2015-08-01 16:04:04 -05:00
|
|
|
#include "RimCommandObject.h"
|
2018-12-13 12:49:37 -06:00
|
|
|
#include "RimCompletionTemplateCollection.h"
|
2015-11-18 02:35:38 -06:00
|
|
|
#include "RimContextCommandBuilder.h"
|
2017-06-30 09:14:15 -05:00
|
|
|
#include "RimDialogData.h"
|
2015-08-01 16:04:04 -05:00
|
|
|
#include "RimEclipseCase.h"
|
|
|
|
#include "RimEclipseCaseCollection.h"
|
2017-01-13 02:50:43 -06:00
|
|
|
#include "RimFlowPlotCollection.h"
|
2016-08-24 01:30:12 -05:00
|
|
|
#include "RimFormationNamesCollection.h"
|
2017-12-20 06:14:43 -06:00
|
|
|
#include "RimFractureTemplate.h"
|
2018-02-26 13:54:45 -06:00
|
|
|
#include "RimFractureTemplateCollection.h"
|
2015-08-01 16:04:04 -05:00
|
|
|
#include "RimGeoMechCase.h"
|
|
|
|
#include "RimGeoMechModels.h"
|
2019-04-05 03:11:30 -05:00
|
|
|
#include "RimGridCrossPlotCollection.h"
|
2016-11-16 02:21:27 -06:00
|
|
|
#include "RimGridSummaryCase.h"
|
2018-01-19 05:52:50 -06:00
|
|
|
#include "RimGridView.h"
|
2014-07-24 03:11:43 -05:00
|
|
|
#include "RimIdenticalGridCaseGroup.h"
|
2015-09-07 07:29:46 -05:00
|
|
|
#include "RimMainPlotCollection.h"
|
2018-12-19 07:41:17 -06:00
|
|
|
#include "RimMeasurement.h"
|
2019-04-05 03:11:30 -05:00
|
|
|
#include "RimObservedData.h"
|
2017-09-14 08:44:01 -05:00
|
|
|
#include "RimObservedDataCollection.h"
|
2014-07-24 03:11:43 -05:00
|
|
|
#include "RimOilField.h"
|
2018-01-08 03:37:57 -06:00
|
|
|
#include "RimPltPlotCollection.h"
|
2019-04-05 03:11:30 -05:00
|
|
|
#include "RimPolylinesFromFileAnnotation.h"
|
2018-01-08 03:37:57 -06:00
|
|
|
#include "RimRftPlotCollection.h"
|
2019-04-05 03:11:30 -05:00
|
|
|
#include "RimSaturationPressurePlotCollection.h"
|
2014-07-24 03:11:43 -05:00
|
|
|
#include "RimScriptCollection.h"
|
2018-02-26 13:54:45 -06:00
|
|
|
#include "RimSummaryCalculationCollection.h"
|
2017-09-06 09:32:46 -05:00
|
|
|
#include "RimSummaryCaseMainCollection.h"
|
2017-11-07 13:40:45 -06:00
|
|
|
#include "RimSummaryCrossPlotCollection.h"
|
2016-05-09 05:13:54 -05:00
|
|
|
#include "RimSummaryPlotCollection.h"
|
2018-01-19 05:52:50 -06:00
|
|
|
#include "RimTools.h"
|
2019-04-05 03:11:30 -05:00
|
|
|
#include "RimUserDefinedPolylinesAnnotation.h"
|
|
|
|
#include "RimValveTemplate.h"
|
|
|
|
#include "RimValveTemplateCollection.h"
|
2015-09-07 07:29:46 -05:00
|
|
|
#include "RimViewLinker.h"
|
2015-09-08 03:17:35 -05:00
|
|
|
#include "RimViewLinkerCollection.h"
|
2018-01-08 03:37:57 -06:00
|
|
|
#include "RimWellLogFile.h"
|
2015-09-07 07:29:46 -05:00
|
|
|
#include "RimWellLogPlotCollection.h"
|
2018-01-08 03:37:57 -06:00
|
|
|
#include "RimWellPath.h"
|
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
|
|
|
#include "RimWellPathCollection.h"
|
2019-06-17 02:11:38 -05:00
|
|
|
#include "SsiHubImportCommands/RimWellPathImport.h"
|
2013-02-14 06:16:56 -06:00
|
|
|
|
2018-04-26 23:28:08 -05:00
|
|
|
#include "RiuPlotMainWindow.h"
|
2018-01-19 05:52:50 -06:00
|
|
|
#include "RiuMainWindow.h"
|
2015-08-18 09:36:37 -05:00
|
|
|
|
2015-08-25 05:40:55 -05:00
|
|
|
#include "OctaveScriptCommands/RicExecuteScriptForCasesFeature.h"
|
|
|
|
|
|
|
|
#include "cafCmdFeature.h"
|
2015-11-18 02:35:38 -06:00
|
|
|
#include "cafCmdFeatureManager.h"
|
2017-11-18 18:12:39 -06:00
|
|
|
#include "cafCmdFeatureMenuBuilder.h"
|
2018-01-19 05:52:50 -06:00
|
|
|
#include "cafPdmUiTreeOrdering.h"
|
2017-01-09 12:51:15 -06:00
|
|
|
#include "cvfBoundingBox.h"
|
|
|
|
|
2019-05-06 03:36:05 -05:00
|
|
|
#include <QDebug>
|
2014-07-24 03:11:43 -05:00
|
|
|
#include <QDir>
|
2015-11-18 02:35:38 -06:00
|
|
|
#include <QMenu>
|
|
|
|
|
2015-08-17 03:51:13 -05:00
|
|
|
|
2012-05-18 02:45:23 -05:00
|
|
|
CAF_PDM_SOURCE_INIT(RimProject, "ResInsightProject");
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
RimProject::RimProject(void)
|
|
|
|
{
|
|
|
|
CAF_PDM_InitFieldNoDefault(&m_projectFileVersionString, "ProjectFileVersionString", "", "", "", "");
|
2015-08-05 06:27:36 -05:00
|
|
|
m_projectFileVersionString.uiCapability()->setUiHidden(true);
|
2012-05-18 02:45:23 -05:00
|
|
|
|
2013-05-08 03:41:56 -05:00
|
|
|
CAF_PDM_InitField(&nextValidCaseId, "NextValidCaseId", 0, "Next Valid Case ID", "", "" ,"");
|
2015-08-05 06:27:36 -05:00
|
|
|
nextValidCaseId.uiCapability()->setUiHidden(true);
|
2013-05-08 03:41:56 -05:00
|
|
|
|
2013-05-10 08:35:33 -05:00
|
|
|
CAF_PDM_InitField(&nextValidCaseGroupId, "NextValidCaseGroupId", 0, "Next Valid Case Group ID", "", "" ,"");
|
2015-08-05 06:27:36 -05:00
|
|
|
nextValidCaseGroupId.uiCapability()->setUiHidden(true);
|
2013-05-10 08:35:33 -05:00
|
|
|
|
2019-07-15 04:43:22 -05:00
|
|
|
CAF_PDM_InitField(&nextValidViewId, "NextValidViewId", 0, "Next Valid View ID", "", "", "");
|
|
|
|
nextValidViewId.uiCapability()->setUiHidden(true);
|
|
|
|
|
2013-06-12 02:36:50 -05:00
|
|
|
CAF_PDM_InitFieldNoDefault(&oilFields, "OilFields", "Oil Fields", "", "", "");
|
2015-08-05 06:27:36 -05:00
|
|
|
oilFields.uiCapability()->setUiHidden(true);
|
2013-02-14 07:30:01 -06:00
|
|
|
|
2018-05-07 04:30:19 -05:00
|
|
|
CAF_PDM_InitFieldNoDefault(&scriptCollection, "ScriptCollection", "Octave Scripts", ":/octave.png", "", "");
|
2015-08-20 08:48:37 -05:00
|
|
|
scriptCollection.uiCapability()->setUiHidden(true);
|
2019-07-30 03:36:05 -05:00
|
|
|
scriptCollection.xmlCapability()->disableIO();
|
2013-04-26 12:05:35 -05:00
|
|
|
|
2013-09-06 06:06:39 -05:00
|
|
|
CAF_PDM_InitFieldNoDefault(&wellPathImport, "WellPathImport", "WellPathImport", "", "", "");
|
|
|
|
wellPathImport = new RimWellPathImport();
|
2015-08-05 06:27:36 -05:00
|
|
|
wellPathImport.uiCapability()->setUiHidden(true);
|
2016-10-10 08:38:31 -05:00
|
|
|
wellPathImport.uiCapability()->setUiTreeChildrenHidden(true);
|
2013-09-06 06:06:39 -05:00
|
|
|
|
2015-10-15 03:18:59 -05:00
|
|
|
CAF_PDM_InitFieldNoDefault(&mainPlotCollection, "MainPlotCollection", "Plots", "", "", "");
|
2015-08-27 09:13:49 -05:00
|
|
|
mainPlotCollection.uiCapability()->setUiHidden(true);
|
|
|
|
|
2015-09-08 03:17:35 -05:00
|
|
|
CAF_PDM_InitFieldNoDefault(&viewLinkerCollection, "LinkedViews", "Linked Views (field in RimProject", ":/chain.png", "", "");
|
|
|
|
viewLinkerCollection.uiCapability()->setUiHidden(true);
|
|
|
|
viewLinkerCollection = new RimViewLinkerCollection;
|
2015-09-01 10:14:22 -05:00
|
|
|
|
2017-10-12 00:30:37 -05:00
|
|
|
CAF_PDM_InitFieldNoDefault(&calculationCollection, "CalculationCollection", "Calculation Collection", "", "", "");
|
2017-10-23 07:42:38 -05:00
|
|
|
calculationCollection = new RimSummaryCalculationCollection;
|
2017-10-12 00:30:37 -05:00
|
|
|
|
2017-11-30 06:44:18 -06:00
|
|
|
CAF_PDM_InitFieldNoDefault(&commandObjects, "CommandObjects", "Command Objects", "", "", "");
|
2015-08-05 06:27:36 -05:00
|
|
|
//wellPathImport.uiCapability()->setUiHidden(true);
|
2013-09-12 01:11:56 -05:00
|
|
|
|
2017-11-30 06:44:18 -06:00
|
|
|
CAF_PDM_InitFieldNoDefault(&multiSnapshotDefinitions, "MultiSnapshotDefinitions", "Multi Snapshot Definitions", "", "", "");
|
2016-12-09 04:11:16 -06:00
|
|
|
|
2016-10-06 08:01:59 -05:00
|
|
|
CAF_PDM_InitFieldNoDefault(&mainWindowTreeViewState, "TreeViewState", "", "", "", "");
|
|
|
|
mainWindowTreeViewState.uiCapability()->setUiHidden(true);
|
|
|
|
CAF_PDM_InitFieldNoDefault(&mainWindowCurrentModelIndexPath, "TreeViewCurrentModelIndexPath", "", "", "", "");
|
|
|
|
mainWindowCurrentModelIndexPath.uiCapability()->setUiHidden(true);
|
|
|
|
|
|
|
|
CAF_PDM_InitFieldNoDefault(&plotWindowTreeViewState, "PlotWindowTreeViewState", "", "", "", "");
|
|
|
|
plotWindowTreeViewState.uiCapability()->setUiHidden(true);
|
|
|
|
CAF_PDM_InitFieldNoDefault(&plotWindowCurrentModelIndexPath, "PlotWindowTreeViewCurrentModelIndexPath", "", "", "", "");
|
|
|
|
plotWindowCurrentModelIndexPath.uiCapability()->setUiHidden(true);
|
2013-04-19 06:20:46 -05:00
|
|
|
|
2016-10-04 07:23:34 -05:00
|
|
|
CAF_PDM_InitField(&m_show3DWindow, "show3DWindow", true, "Show 3D Window", "", "", "");
|
|
|
|
m_show3DWindow.uiCapability()->setUiHidden(true);
|
|
|
|
|
|
|
|
CAF_PDM_InitField(&m_showPlotWindow, "showPlotWindow", false, "Show Plot Window", "", "", "");
|
|
|
|
m_showPlotWindow.uiCapability()->setUiHidden(true);
|
|
|
|
|
2019-04-02 12:18:00 -05:00
|
|
|
CAF_PDM_InitField(&m_subWindowsTiled3DWindow, "tiled3DWindow", false, "Tile 3D Window", "", "", "");
|
|
|
|
m_subWindowsTiled3DWindow.uiCapability()->setUiHidden(true);
|
|
|
|
|
|
|
|
CAF_PDM_InitField(&m_subWindowsTiledPlotWindow, "tiledPlotWindow", false, "Tile Plot Window", "", "", "");
|
|
|
|
m_subWindowsTiledPlotWindow.uiCapability()->setUiHidden(true);
|
|
|
|
|
2017-06-30 09:14:15 -05:00
|
|
|
CAF_PDM_InitFieldNoDefault(&m_dialogData, "DialogData", "DialogData", "", "", "");
|
|
|
|
m_dialogData = new RimDialogData();
|
|
|
|
m_dialogData.uiCapability()->setUiHidden(true);
|
|
|
|
m_dialogData.uiCapability()->setUiTreeChildrenHidden(true);
|
|
|
|
|
2013-06-12 02:36:50 -05:00
|
|
|
// Obsolete fields. The content is moved to OilFields and friends
|
|
|
|
CAF_PDM_InitFieldNoDefault(&casesObsolete, "Reservoirs", "", "", "", "");
|
2018-11-05 07:28:07 -06:00
|
|
|
RiaFieldhandleTools::disableWriteAndSetFieldHidden(&casesObsolete);
|
|
|
|
|
2013-06-12 02:36:50 -05:00
|
|
|
CAF_PDM_InitFieldNoDefault(&caseGroupsObsolete, "CaseGroups", "", "", "", "");
|
2018-11-05 07:28:07 -06:00
|
|
|
RiaFieldhandleTools::disableWriteAndSetFieldHidden(&caseGroupsObsolete);
|
2013-06-12 02:36:50 -05:00
|
|
|
|
|
|
|
// Initialization
|
|
|
|
|
2012-05-18 02:45:23 -05:00
|
|
|
scriptCollection = new RimScriptCollection();
|
2015-08-05 06:27:36 -05:00
|
|
|
scriptCollection->directory.uiCapability()->setUiHidden(true);
|
2015-08-20 08:48:37 -05:00
|
|
|
scriptCollection->uiCapability()->setUiName("Scripts");
|
2019-05-06 04:08:59 -05:00
|
|
|
scriptCollection->uiCapability()->setUiIconFromResourceString(":/octave.png");
|
2012-05-18 02:45:23 -05:00
|
|
|
|
2015-08-27 09:13:49 -05:00
|
|
|
mainPlotCollection = new RimMainPlotCollection();
|
|
|
|
|
2013-06-07 07:54:02 -05:00
|
|
|
// For now, create a default first oilfield that contains the rest of the project
|
|
|
|
oilFields.push_back(new RimOilField);
|
|
|
|
|
2015-08-09 04:16:52 -05:00
|
|
|
this->setUiHidden(true);
|
2012-05-18 02:45:23 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
RimProject::~RimProject(void)
|
|
|
|
{
|
2013-02-14 06:16:56 -06:00
|
|
|
close();
|
|
|
|
|
2013-06-12 02:36:50 -05:00
|
|
|
oilFields.deleteAllChildObjects();
|
2012-05-18 02:45:23 -05:00
|
|
|
if (scriptCollection()) delete scriptCollection();
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
void RimProject::close()
|
|
|
|
{
|
2017-01-13 02:50:43 -06:00
|
|
|
if (mainPlotCollection())
|
2015-11-30 08:07:54 -06:00
|
|
|
{
|
2017-01-13 02:50:43 -06:00
|
|
|
mainPlotCollection()->deleteAllContainedObjects();
|
2016-05-25 07:05:31 -05:00
|
|
|
}
|
|
|
|
|
2013-06-06 08:07:31 -05:00
|
|
|
oilFields.deleteAllChildObjects();
|
2013-06-12 02:36:50 -05:00
|
|
|
oilFields.push_back(new RimOilField);
|
|
|
|
|
2013-06-06 08:07:31 -05:00
|
|
|
casesObsolete.deleteAllChildObjects();
|
|
|
|
caseGroupsObsolete.deleteAllChildObjects();
|
2012-05-18 02:45:23 -05:00
|
|
|
|
2013-10-24 02:53:27 -05:00
|
|
|
wellPathImport->regions().deleteAllChildObjects();
|
2013-09-06 08:59:25 -05:00
|
|
|
|
2013-09-13 03:42:27 -05:00
|
|
|
commandObjects.deleteAllChildObjects();
|
|
|
|
|
2016-12-21 00:12:50 -06:00
|
|
|
multiSnapshotDefinitions.deleteAllChildObjects();
|
|
|
|
|
2018-08-02 08:38:35 -05:00
|
|
|
m_dialogData->clearProjectSpecificData();
|
|
|
|
|
2017-10-18 04:18:43 -05:00
|
|
|
calculationCollection->deleteAllContainedObjects();
|
|
|
|
|
2015-09-16 07:26:25 -05:00
|
|
|
delete viewLinkerCollection->viewLinker();
|
2018-01-16 09:49:28 -06:00
|
|
|
viewLinkerCollection->viewLinker = nullptr;
|
2015-09-04 04:22:44 -05:00
|
|
|
|
2012-05-18 02:45:23 -05:00
|
|
|
fileName = "";
|
2013-05-08 03:41:56 -05:00
|
|
|
|
|
|
|
nextValidCaseId = 0;
|
2013-05-10 08:35:33 -05:00
|
|
|
nextValidCaseGroupId = 0;
|
2019-07-15 04:43:22 -05:00
|
|
|
nextValidViewId = 0;
|
2016-10-06 08:01:59 -05:00
|
|
|
mainWindowCurrentModelIndexPath = "";
|
|
|
|
mainWindowTreeViewState = "";
|
|
|
|
plotWindowCurrentModelIndexPath = "";
|
|
|
|
plotWindowTreeViewState = "";
|
2012-05-18 02:45:23 -05:00
|
|
|
}
|
|
|
|
|
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 RimProject::initAfterRead()
|
|
|
|
{
|
2013-06-06 08:07:31 -05:00
|
|
|
// Create an empty oil field in case the project did not contain one
|
|
|
|
if (oilFields.size() < 1)
|
|
|
|
{
|
|
|
|
oilFields.push_back(new RimOilField);
|
|
|
|
}
|
|
|
|
|
|
|
|
// Handle old project files with obsolete structure.
|
|
|
|
// Move caseGroupsObsolete and casesObsolete to oilFields()[idx]->analysisModels()
|
2018-01-16 09:49:28 -06:00
|
|
|
RimEclipseCaseCollection* analysisModels = activeOilField() ? activeOilField()->analysisModels() : nullptr;
|
2013-06-06 08:07:31 -05:00
|
|
|
bool movedOneRimIdenticalGridCaseGroup = false;
|
|
|
|
for (size_t cgIdx = 0; cgIdx < caseGroupsObsolete.size(); ++cgIdx)
|
|
|
|
{
|
|
|
|
RimIdenticalGridCaseGroup* sourceCaseGroup = caseGroupsObsolete[cgIdx];
|
|
|
|
if (analysisModels)
|
|
|
|
{
|
|
|
|
analysisModels->caseGroups.push_back(sourceCaseGroup);
|
2013-06-12 03:52:46 -05:00
|
|
|
//printf("Moved m_project->caseGroupsObsolete[%i] to first oil fields analysis models\n", cgIdx);
|
2013-06-06 08:07:31 -05:00
|
|
|
movedOneRimIdenticalGridCaseGroup = true; // moved at least one so assume the others will be moved too...
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (movedOneRimIdenticalGridCaseGroup)
|
|
|
|
{
|
|
|
|
caseGroupsObsolete.clear();
|
|
|
|
}
|
|
|
|
|
|
|
|
bool movedOneRimCase = false;
|
|
|
|
for (size_t cIdx = 0; cIdx < casesObsolete().size(); ++cIdx)
|
|
|
|
{
|
|
|
|
if (analysisModels)
|
|
|
|
{
|
2015-09-01 10:04:08 -05:00
|
|
|
RimEclipseCase* sourceCase = casesObsolete[cIdx];
|
2018-01-16 09:49:28 -06:00
|
|
|
casesObsolete.set(cIdx, nullptr);
|
2013-06-06 08:07:31 -05:00
|
|
|
analysisModels->cases.push_back(sourceCase);
|
2013-06-12 03:52:46 -05:00
|
|
|
//printf("Moved m_project->casesObsolete[%i] to first oil fields analysis models\n", cIdx);
|
2013-06-06 08:07:31 -05:00
|
|
|
movedOneRimCase = true; // moved at least one so assume the others will be moved too...
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (movedOneRimCase)
|
|
|
|
{
|
|
|
|
casesObsolete.clear();
|
|
|
|
}
|
2015-10-23 08:46:25 -05:00
|
|
|
|
|
|
|
if (casesObsolete().size() > 0 || caseGroupsObsolete.size() > 0)
|
|
|
|
{
|
|
|
|
//printf("RimProject::initAfterRead: Was not able to move all cases (%i left) or caseGroups (%i left) from Project to analysisModels",
|
|
|
|
// casesObsolete().size(), caseGroupsObsolete.size());
|
|
|
|
}
|
2013-06-06 08:07:31 -05:00
|
|
|
|
|
|
|
// Set project pointer to each well path
|
|
|
|
for (size_t oilFieldIdx = 0; oilFieldIdx < oilFields().size(); oilFieldIdx++)
|
|
|
|
{
|
|
|
|
RimOilField* oilField = oilFields[oilFieldIdx];
|
2018-01-16 09:49:28 -06:00
|
|
|
if (oilField == nullptr || oilField->wellPathCollection == nullptr) continue;
|
2013-06-06 08:07:31 -05:00
|
|
|
}
|
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
|
|
|
}
|
|
|
|
|
|
|
|
|
2012-05-18 02:45:23 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
void RimProject::setupBeforeSave()
|
|
|
|
{
|
2019-05-06 03:36:05 -05:00
|
|
|
RiaGuiApplication* guiApp = RiaGuiApplication::instance();
|
2016-10-04 07:23:34 -05:00
|
|
|
|
2019-05-06 03:36:05 -05:00
|
|
|
if (guiApp)
|
2016-10-04 07:23:34 -05:00
|
|
|
{
|
2019-05-06 03:36:05 -05:00
|
|
|
m_show3DWindow = guiApp->mainWindow()->isVisible();
|
|
|
|
m_showPlotWindow = guiApp->mainPlotWindow() && guiApp->mainPlotWindow()->isVisible();
|
2016-10-04 07:23:34 -05:00
|
|
|
}
|
|
|
|
|
2012-05-18 02:45:23 -05:00
|
|
|
m_projectFileVersionString = STRPRODUCTVER;
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2013-04-24 00:35:31 -05:00
|
|
|
/// Support list of multiple script paths divided by ';'
|
2012-05-18 02:45:23 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2013-04-24 00:35:31 -05:00
|
|
|
void RimProject::setScriptDirectories(const QString& scriptDirectories)
|
2012-05-18 02:45:23 -05:00
|
|
|
{
|
2012-06-26 09:10:41 -05:00
|
|
|
scriptCollection->calcScripts().deleteAllChildObjects();
|
|
|
|
scriptCollection->subDirectories().deleteAllChildObjects();
|
2012-05-18 02:45:23 -05:00
|
|
|
|
2013-04-24 00:35:31 -05:00
|
|
|
QStringList pathList = scriptDirectories.split(';');
|
|
|
|
foreach(QString path, pathList)
|
2012-05-18 02:45:23 -05:00
|
|
|
{
|
2013-04-24 00:35:31 -05:00
|
|
|
QDir dir(path);
|
|
|
|
if (!path.isEmpty() && dir.exists() && dir.isReadable())
|
|
|
|
{
|
|
|
|
RimScriptCollection* sharedScriptLocation = new RimScriptCollection;
|
|
|
|
sharedScriptLocation->directory = path;
|
|
|
|
sharedScriptLocation->setUiName(dir.dirName());
|
2012-05-18 02:45:23 -05:00
|
|
|
|
2013-04-24 00:35:31 -05:00
|
|
|
sharedScriptLocation->readContentFromDisc();
|
2012-05-18 02:45:23 -05:00
|
|
|
|
2013-04-24 00:35:31 -05:00
|
|
|
scriptCollection->subDirectories.push_back(sharedScriptLocation);
|
|
|
|
}
|
2012-05-18 02:45:23 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
QString RimProject::projectFileVersionString() const
|
|
|
|
{
|
|
|
|
return m_projectFileVersionString;
|
|
|
|
}
|
2013-02-14 06:16:56 -06:00
|
|
|
|
2018-01-04 06:12:07 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
bool RimProject::isProjectFileVersionEqualOrOlderThan(const QString& otherProjectFileVersion) const
|
|
|
|
{
|
|
|
|
QString candidateProjectFileVersion = projectFileVersionString();
|
|
|
|
|
2018-01-04 08:24:35 -06:00
|
|
|
return !RiaProjectFileVersionTools::isCandidateVersionNewerThanOther(candidateProjectFileVersion, otherProjectFileVersion);
|
2018-01-04 06:12:07 -06:00
|
|
|
}
|
2013-04-23 01:11:52 -05:00
|
|
|
|
2013-04-08 01:44:33 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2018-09-24 14:32:58 -05:00
|
|
|
void RimProject::setProjectFileNameAndUpdateDependencies(const QString& projectFileName)
|
2013-04-08 01:44:33 -05:00
|
|
|
{
|
2013-04-12 01:31:59 -05:00
|
|
|
// Extract the filename of the project file when it was saved
|
|
|
|
QString oldProjectFileName = this->fileName;
|
|
|
|
// Replace with the new actual filename
|
2018-09-24 14:32:58 -05:00
|
|
|
this->fileName = projectFileName;
|
2013-04-08 05:01:40 -05:00
|
|
|
|
2018-09-24 14:32:58 -05:00
|
|
|
QFileInfo fileInfo(projectFileName);
|
2013-04-12 01:31:59 -05:00
|
|
|
QString newProjectPath = fileInfo.path();
|
|
|
|
|
|
|
|
QFileInfo fileInfoOld(oldProjectFileName);
|
|
|
|
QString oldProjectPath = fileInfoOld.path();
|
2018-01-19 05:52:50 -06:00
|
|
|
|
|
|
|
std::vector<caf::FilePath*> filePaths;
|
2018-12-03 03:26:47 -06:00
|
|
|
fieldContentsByType(this, filePaths);
|
2018-01-19 05:52:50 -06:00
|
|
|
|
|
|
|
for (caf::FilePath* filePath : filePaths)
|
|
|
|
{
|
|
|
|
bool foundFile = false;
|
|
|
|
std::vector<QString> searchedPaths;
|
|
|
|
|
|
|
|
QString newFilePath = RimTools::relocateFile(filePath->path(), newProjectPath, oldProjectPath, &foundFile, &searchedPaths);
|
|
|
|
filePath->setPath(newFilePath);
|
|
|
|
}
|
2013-04-12 01:31:59 -05:00
|
|
|
|
2013-06-06 08:07:31 -05:00
|
|
|
// Loop over all cases and update file path
|
2013-04-08 05:01:40 -05:00
|
|
|
|
2015-05-15 11:51:49 -05:00
|
|
|
std::vector<RimCase*> cases;
|
2013-05-08 03:41:56 -05:00
|
|
|
allCases(cases);
|
|
|
|
for (size_t i = 0; i < cases.size(); i++)
|
2013-04-08 05:01:40 -05:00
|
|
|
{
|
2013-05-08 03:41:56 -05:00
|
|
|
cases[i]->updateFilePathsFromProjectPath(newProjectPath, oldProjectPath);
|
2013-04-08 05:01:40 -05:00
|
|
|
}
|
2013-10-24 02:50:16 -05:00
|
|
|
|
2018-01-08 07:03:27 -06:00
|
|
|
for (RimSummaryCase* summaryCase : allSummaryCases())
|
|
|
|
{
|
|
|
|
summaryCase->updateFilePathsFromProjectPath(newProjectPath, oldProjectPath);
|
|
|
|
}
|
|
|
|
|
2013-10-24 02:50:16 -05:00
|
|
|
// Update path to well path file cache
|
2016-08-24 01:30:12 -05:00
|
|
|
for(RimOilField* oilField: oilFields)
|
|
|
|
{
|
2018-01-16 09:49:28 -06:00
|
|
|
if (oilField == nullptr) continue;
|
|
|
|
if (oilField->wellPathCollection() != nullptr)
|
2017-05-03 05:31:45 -05:00
|
|
|
{
|
|
|
|
oilField->wellPathCollection()->updateFilePathsFromProjectPath(newProjectPath, oldProjectPath);
|
|
|
|
}
|
2018-01-16 09:49:28 -06:00
|
|
|
if (oilField->formationNamesCollection() != nullptr)
|
2016-08-24 01:30:12 -05:00
|
|
|
{
|
|
|
|
oilField->formationNamesCollection()->updateFilePathsFromProjectPath(newProjectPath, oldProjectPath);
|
|
|
|
}
|
2018-01-16 09:49:28 -06:00
|
|
|
if (oilField->summaryCaseMainCollection() != nullptr) {
|
2017-09-06 09:32:46 -05:00
|
|
|
oilField->summaryCaseMainCollection()->updateFilePathsFromProjectPath(newProjectPath, oldProjectPath);
|
2017-05-03 05:31:45 -05:00
|
|
|
}
|
2017-08-03 06:21:19 -05:00
|
|
|
|
|
|
|
CVF_ASSERT(oilField->fractureDefinitionCollection());
|
|
|
|
oilField->fractureDefinitionCollection()->updateFilePathsFromProjectPath(newProjectPath, oldProjectPath);
|
2016-08-24 01:30:12 -05:00
|
|
|
}
|
|
|
|
|
2018-01-08 03:37:57 -06:00
|
|
|
{
|
|
|
|
std::vector<RimWellLogFile*> rimWellLogFiles;
|
|
|
|
this->descendantsIncludingThisOfType(rimWellLogFiles);
|
|
|
|
|
|
|
|
for (auto rimWellLogFile : rimWellLogFiles)
|
|
|
|
{
|
|
|
|
rimWellLogFile->updateFilePathsFromProjectPath(newProjectPath, oldProjectPath);
|
|
|
|
}
|
|
|
|
}
|
2016-08-24 01:30:12 -05:00
|
|
|
|
2013-10-24 02:50:16 -05:00
|
|
|
wellPathImport->updateFilePaths();
|
2013-05-08 03:41:56 -05:00
|
|
|
}
|
2013-04-08 05:01:40 -05:00
|
|
|
|
2013-05-08 03:41:56 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2015-05-15 11:51:49 -05:00
|
|
|
void RimProject::assignCaseIdToCase(RimCase* reservoirCase)
|
2013-05-08 03:41:56 -05:00
|
|
|
{
|
|
|
|
if (reservoirCase)
|
|
|
|
{
|
|
|
|
reservoirCase->caseId = nextValidCaseId;
|
|
|
|
|
|
|
|
nextValidCaseId = nextValidCaseId + 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-05-10 08:35:33 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
void RimProject::assignIdToCaseGroup(RimIdenticalGridCaseGroup* caseGroup)
|
|
|
|
{
|
|
|
|
if (caseGroup)
|
|
|
|
{
|
|
|
|
caseGroup->groupId = nextValidCaseGroupId;
|
|
|
|
|
|
|
|
nextValidCaseGroupId = nextValidCaseGroupId + 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-07-15 04:43:22 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
void RimProject::assignViewIdToView(Rim3dView* view)
|
|
|
|
{
|
|
|
|
if (view)
|
|
|
|
{
|
|
|
|
view->setId(nextValidViewId);
|
|
|
|
nextValidViewId = nextValidViewId + 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-05-08 03:41:56 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2018-08-28 04:12:05 -05:00
|
|
|
void RimProject::allCases(std::vector<RimCase*>& cases) const
|
2013-05-08 03:41:56 -05:00
|
|
|
{
|
2013-06-06 08:07:31 -05:00
|
|
|
for (size_t oilFieldIdx = 0; oilFieldIdx < oilFields().size(); oilFieldIdx++)
|
2013-04-08 05:01:40 -05:00
|
|
|
{
|
2013-06-06 08:07:31 -05:00
|
|
|
RimOilField* oilField = oilFields[oilFieldIdx];
|
2015-05-15 11:51:49 -05:00
|
|
|
if (!oilField) continue;
|
2013-04-08 05:01:40 -05:00
|
|
|
|
2015-06-25 05:11:06 -05:00
|
|
|
RimEclipseCaseCollection* analysisModels = oilField->analysisModels();
|
2015-05-15 11:51:49 -05:00
|
|
|
if (analysisModels )
|
2013-05-08 03:41:56 -05:00
|
|
|
{
|
2015-05-15 11:51:49 -05:00
|
|
|
for (size_t caseIdx = 0; caseIdx < analysisModels->cases.size(); caseIdx++)
|
|
|
|
{
|
|
|
|
cases.push_back(analysisModels->cases[caseIdx]);
|
|
|
|
}
|
|
|
|
for (size_t cgIdx = 0; cgIdx < analysisModels->caseGroups.size(); cgIdx++)
|
2013-06-06 08:07:31 -05:00
|
|
|
{
|
2015-05-15 11:51:49 -05:00
|
|
|
// Load the Main case of each IdenticalGridCaseGroup
|
|
|
|
RimIdenticalGridCaseGroup* cg = analysisModels->caseGroups[cgIdx];
|
2018-01-16 09:49:28 -06:00
|
|
|
if (cg == nullptr) continue;
|
2015-05-15 11:51:49 -05:00
|
|
|
|
2015-05-18 08:23:51 -05:00
|
|
|
if (cg->statisticsCaseCollection())
|
2015-05-15 11:51:49 -05:00
|
|
|
{
|
2015-05-18 08:23:51 -05:00
|
|
|
for (size_t caseIdx = 0; caseIdx < cg->statisticsCaseCollection()->reservoirs.size(); caseIdx++)
|
|
|
|
{
|
|
|
|
cases.push_back(cg->statisticsCaseCollection()->reservoirs[caseIdx]);
|
|
|
|
}
|
2015-05-15 11:51:49 -05:00
|
|
|
}
|
2015-05-18 08:23:51 -05:00
|
|
|
if (cg->caseCollection())
|
2015-05-15 11:51:49 -05:00
|
|
|
{
|
2015-05-18 08:23:51 -05:00
|
|
|
for (size_t caseIdx = 0; caseIdx < cg->caseCollection()->reservoirs.size(); caseIdx++)
|
|
|
|
{
|
|
|
|
cases.push_back(cg->caseCollection()->reservoirs[caseIdx]);
|
|
|
|
}
|
2015-05-15 11:51:49 -05:00
|
|
|
}
|
2013-06-06 08:07:31 -05:00
|
|
|
}
|
2015-05-15 11:51:49 -05:00
|
|
|
}
|
2013-06-06 08:07:31 -05:00
|
|
|
|
2015-05-15 11:51:49 -05:00
|
|
|
RimGeoMechModels* geomModels = oilField->geoMechModels();
|
|
|
|
if (geomModels)
|
|
|
|
{
|
|
|
|
for (size_t caseIdx = 0; caseIdx < geomModels->cases.size(); caseIdx++)
|
2013-06-06 08:07:31 -05:00
|
|
|
{
|
2015-05-15 11:51:49 -05:00
|
|
|
cases.push_back(geomModels->cases[caseIdx]);
|
2013-06-06 08:07:31 -05:00
|
|
|
}
|
2013-04-08 05:01:40 -05:00
|
|
|
}
|
|
|
|
}
|
2013-04-08 01:44:33 -05:00
|
|
|
}
|
|
|
|
|
2016-05-31 06:42:27 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2017-12-01 02:34:43 -06:00
|
|
|
std::vector<RimSummaryCase*> RimProject::allSummaryCases() const
|
2016-05-31 06:42:27 -05:00
|
|
|
{
|
2017-12-01 02:34:43 -06:00
|
|
|
std::vector<RimSummaryCase*> sumCases;
|
|
|
|
|
2016-05-31 06:42:27 -05:00
|
|
|
for (RimOilField* oilField: oilFields)
|
|
|
|
{
|
|
|
|
if(!oilField) continue;
|
2017-09-06 09:32:46 -05:00
|
|
|
RimSummaryCaseMainCollection* sumCaseMainColl = oilField->summaryCaseMainCollection();
|
|
|
|
if(sumCaseMainColl)
|
2016-05-31 06:42:27 -05:00
|
|
|
{
|
2017-09-07 07:13:51 -05:00
|
|
|
std::vector<RimSummaryCase*> allSummaryCases = sumCaseMainColl->allSummaryCases();
|
|
|
|
sumCases.insert(sumCases.end(), allSummaryCases.begin(), allSummaryCases.end());
|
2017-09-28 07:42:06 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
auto observedDataColl = oilField->observedDataCollection();
|
|
|
|
if (observedDataColl != nullptr && observedDataColl->allObservedData().size() > 0)
|
|
|
|
{
|
|
|
|
auto observedData = observedDataColl->allObservedData();
|
|
|
|
sumCases.insert(sumCases.end(), observedData.begin(), observedData.end());
|
2016-05-31 06:42:27 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-12-01 02:34:43 -06:00
|
|
|
return sumCases;
|
2017-09-18 13:27:20 -05:00
|
|
|
}
|
|
|
|
|
2018-04-06 01:16:14 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
std::vector<RimSummaryCaseCollection*> RimProject::summaryGroups() const
|
|
|
|
{
|
|
|
|
std::vector<RimSummaryCaseCollection*> groups;
|
|
|
|
|
|
|
|
for (RimOilField* oilField : oilFields)
|
|
|
|
{
|
|
|
|
if (!oilField) continue;
|
|
|
|
RimSummaryCaseMainCollection* sumCaseMainColl = oilField->summaryCaseMainCollection();
|
|
|
|
if (sumCaseMainColl)
|
|
|
|
{
|
|
|
|
std::vector<RimSummaryCaseCollection*> g = sumCaseMainColl->summaryCaseCollections();
|
|
|
|
groups.insert(groups.end(), g.begin(), g.end());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return groups;
|
|
|
|
}
|
|
|
|
|
2018-06-25 08:14:47 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
RimSummaryCaseMainCollection* RimProject::firstSummaryCaseMainCollection() const
|
|
|
|
{
|
|
|
|
if (oilFields.empty()) return nullptr;
|
|
|
|
return oilFields[0]->summaryCaseMainCollection;
|
|
|
|
}
|
|
|
|
|
2017-09-18 13:27:20 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2015-09-07 06:33:27 -05:00
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2018-01-15 07:52:22 -06:00
|
|
|
void RimProject::allNotLinkedViews(std::vector<RimGridView*>& views)
|
2015-09-07 06:33:27 -05:00
|
|
|
{
|
|
|
|
std::vector<RimCase*> cases;
|
|
|
|
allCases(cases);
|
|
|
|
|
2018-01-15 07:52:22 -06:00
|
|
|
std::vector<RimGridView*> alreadyLinkedViews;
|
2015-09-16 07:26:25 -05:00
|
|
|
if (viewLinkerCollection->viewLinker())
|
2015-09-07 06:33:27 -05:00
|
|
|
{
|
2015-09-16 07:26:25 -05:00
|
|
|
viewLinkerCollection->viewLinker()->allViews(alreadyLinkedViews);
|
2015-09-07 06:33:27 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
for (size_t caseIdx = 0; caseIdx < cases.size(); caseIdx++)
|
|
|
|
{
|
|
|
|
RimCase* rimCase = cases[caseIdx];
|
|
|
|
if (!rimCase) continue;
|
|
|
|
|
2018-01-09 03:11:28 -06:00
|
|
|
std::vector<Rim3dView*> caseViews = rimCase->views();
|
2015-09-07 06:33:27 -05:00
|
|
|
for (size_t viewIdx = 0; viewIdx < caseViews.size(); viewIdx++)
|
|
|
|
{
|
2018-01-15 07:52:22 -06:00
|
|
|
RimGridView* gridView = dynamic_cast<RimGridView*>(caseViews[viewIdx]);
|
|
|
|
|
|
|
|
if (!gridView) continue;
|
|
|
|
|
2015-09-07 06:33:27 -05:00
|
|
|
bool isLinked = false;
|
|
|
|
for (size_t lnIdx = 0; lnIdx < alreadyLinkedViews.size(); lnIdx++)
|
|
|
|
{
|
2018-01-15 07:52:22 -06:00
|
|
|
if (gridView == alreadyLinkedViews[lnIdx])
|
2015-09-07 06:33:27 -05:00
|
|
|
{
|
|
|
|
isLinked = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (!isLinked)
|
|
|
|
{
|
2018-01-15 07:52:22 -06:00
|
|
|
views.push_back(gridView);
|
2015-09-07 06:33:27 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-08-30 06:30:46 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2018-11-26 07:48:06 -06:00
|
|
|
void RimProject::allVisibleViews(std::vector<Rim3dView*>& views) const
|
2015-08-30 06:30:46 -05:00
|
|
|
{
|
|
|
|
std::vector<RimCase*> cases;
|
|
|
|
allCases(cases);
|
|
|
|
|
|
|
|
for (size_t caseIdx = 0; caseIdx < cases.size(); caseIdx++)
|
|
|
|
{
|
|
|
|
RimCase* rimCase = cases[caseIdx];
|
|
|
|
if (!rimCase) continue;
|
|
|
|
|
2018-01-09 03:11:28 -06:00
|
|
|
std::vector<Rim3dView*> caseViews = rimCase->views();
|
2015-08-30 06:30:46 -05:00
|
|
|
for (size_t viewIdx = 0; viewIdx < caseViews.size(); viewIdx++)
|
|
|
|
{
|
|
|
|
if (caseViews[viewIdx] && caseViews[viewIdx]->viewer())
|
|
|
|
{
|
|
|
|
views.push_back(caseViews[viewIdx]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
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
|
|
|
|
2018-01-15 07:52:22 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2018-11-26 07:48:06 -06:00
|
|
|
void RimProject::allVisibleGridViews(std::vector<RimGridView*>& views) const
|
2018-01-15 07:52:22 -06:00
|
|
|
{
|
|
|
|
std::vector<Rim3dView*> visibleViews;
|
2018-11-23 06:33:59 -06:00
|
|
|
this->allVisibleViews(visibleViews);
|
2018-01-15 07:52:22 -06:00
|
|
|
for ( Rim3dView* view : visibleViews )
|
|
|
|
{
|
|
|
|
RimGridView* gridView = dynamic_cast<RimGridView*>(view);
|
|
|
|
if ( gridView ) views.push_back(gridView);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
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
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2018-09-11 05:41:45 -05:00
|
|
|
void RimProject::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
|
|
|
{
|
2015-05-15 11:51:49 -05:00
|
|
|
std::vector<RimCase*> cases;
|
2013-06-06 08:07:31 -05:00
|
|
|
allCases(cases);
|
|
|
|
for (size_t caseIdx = 0; caseIdx < cases.size(); caseIdx++)
|
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
|
|
|
{
|
2015-05-15 11:51:49 -05:00
|
|
|
RimCase* rimCase = cases[caseIdx];
|
2018-01-16 09:49:28 -06:00
|
|
|
if (rimCase == nullptr) continue;
|
2018-01-09 03:11:28 -06:00
|
|
|
std::vector<Rim3dView*> views = rimCase->views();
|
2013-06-06 08:07:31 -05:00
|
|
|
|
2015-05-15 11:51:49 -05:00
|
|
|
for (size_t viewIdx = 0; viewIdx < views.size(); viewIdx++)
|
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
|
|
|
{
|
2015-05-15 11:51:49 -05:00
|
|
|
views[viewIdx]->scheduleCreateDisplayModelAndRedraw();
|
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
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-09-18 07:49:31 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2018-09-24 14:32:58 -05:00
|
|
|
void RimProject::allOilFields(std::vector<RimOilField*>& allOilFields) const
|
2017-09-18 07:49:31 -05:00
|
|
|
{
|
2018-09-24 14:32:58 -05:00
|
|
|
allOilFields.clear();
|
2017-09-18 07:49:31 -05:00
|
|
|
for (const auto& oilField : this->oilFields)
|
|
|
|
{
|
2018-09-24 14:32:58 -05:00
|
|
|
allOilFields.push_back(oilField);
|
2017-09-18 07:49:31 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-05-31 06:57:16 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2013-06-06 08:07:31 -05:00
|
|
|
/// Currently there will be only one oil field in Resinsight, so return hardcoded first oil field
|
|
|
|
/// from the RimOilField collection.
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
RimOilField* RimProject::activeOilField()
|
|
|
|
{
|
2013-06-12 02:36:50 -05:00
|
|
|
CVF_ASSERT(oilFields.size() == 1);
|
|
|
|
|
|
|
|
return oilFields[0];
|
2013-06-06 08:07:31 -05:00
|
|
|
}
|
|
|
|
|
2017-05-31 09:16:28 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
/// Currently there will be only one oil field in Resinsight, so return hardcoded first oil field
|
|
|
|
/// from the RimOilField collection.
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
const RimOilField * RimProject::activeOilField() const
|
|
|
|
{
|
|
|
|
CVF_ASSERT(oilFields.size() == 1);
|
|
|
|
|
|
|
|
return oilFields[0];
|
|
|
|
}
|
|
|
|
|
2013-06-06 08:07:31 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2013-05-31 06:57:16 -05:00
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2013-09-08 03:53:25 -05:00
|
|
|
void RimProject::computeUtmAreaOfInterest()
|
2013-05-31 06:57:16 -05:00
|
|
|
{
|
2015-05-15 11:51:49 -05:00
|
|
|
std::vector<RimCase*> cases;
|
2013-05-31 06:57:16 -05:00
|
|
|
allCases(cases);
|
|
|
|
|
|
|
|
cvf::BoundingBox projectBB;
|
|
|
|
|
|
|
|
for (size_t i = 0; i < cases.size(); i++)
|
|
|
|
{
|
2015-05-15 11:51:49 -05:00
|
|
|
RimEclipseCase* rimCase = dynamic_cast<RimEclipseCase*>(cases[i]);
|
2013-05-31 06:57:16 -05:00
|
|
|
|
2017-03-15 03:10:16 -05:00
|
|
|
if (rimCase && rimCase->eclipseCaseData())
|
2013-05-31 06:57:16 -05:00
|
|
|
{
|
2017-03-15 03:10:16 -05:00
|
|
|
for (size_t gridIdx = 0; gridIdx < rimCase->eclipseCaseData()->gridCount(); gridIdx++ )
|
2013-05-31 06:57:16 -05:00
|
|
|
{
|
2017-03-15 03:10:16 -05:00
|
|
|
RigGridBase* rigGrid = rimCase->eclipseCaseData()->grid(gridIdx);
|
2013-05-31 06:57:16 -05:00
|
|
|
|
|
|
|
projectBB.add(rigGrid->boundingBox());
|
|
|
|
}
|
|
|
|
}
|
2015-05-15 11:51:49 -05:00
|
|
|
else
|
|
|
|
{
|
|
|
|
// Todo : calculate BBox of GeoMechCase
|
|
|
|
}
|
2013-05-31 06:57:16 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
if (projectBB.isValid())
|
|
|
|
{
|
2013-09-08 03:53:25 -05:00
|
|
|
double north, south, east, west;
|
2013-05-31 06:57:16 -05:00
|
|
|
|
2013-09-08 03:53:25 -05:00
|
|
|
north = projectBB.max().y();
|
|
|
|
south = projectBB.min().y();
|
|
|
|
|
|
|
|
west = projectBB.min().x();
|
|
|
|
east = projectBB.max().x();
|
|
|
|
|
|
|
|
wellPathImport->north = north;
|
|
|
|
wellPathImport->south = south;
|
|
|
|
wellPathImport->east = east;
|
|
|
|
wellPathImport->west = west;
|
2013-05-31 06:57:16 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-08-06 04:00:21 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2015-08-17 03:51:13 -05:00
|
|
|
void RimProject::actionsBasedOnSelection(QMenu& contextMenu)
|
2015-08-06 04:00:21 -05:00
|
|
|
{
|
2017-11-18 18:12:39 -06:00
|
|
|
caf::CmdFeatureMenuBuilder menuBuilder = RimContextCommandBuilder::commandsFromSelection();
|
2015-08-18 09:36:37 -05:00
|
|
|
|
2017-11-18 18:12:39 -06:00
|
|
|
menuBuilder.appendToMenu(&contextMenu);
|
2015-08-06 04:00:21 -05:00
|
|
|
}
|
|
|
|
|
2015-08-18 09:36:37 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2016-10-04 07:23:34 -05:00
|
|
|
bool RimProject::show3DWindow() const
|
|
|
|
{
|
|
|
|
return m_show3DWindow;
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
bool RimProject::showPlotWindow() const
|
|
|
|
{
|
|
|
|
return m_showPlotWindow;
|
|
|
|
}
|
|
|
|
|
2019-04-02 12:18:00 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
bool RimProject::subWindowsTiled3DWindow() const
|
|
|
|
{
|
|
|
|
return m_subWindowsTiled3DWindow;
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
bool RimProject::subWindowsTiledPlotWindow() const
|
|
|
|
{
|
|
|
|
return m_subWindowsTiledPlotWindow;
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
void RimProject::setSubWindowsTiledIn3DWindow(bool tiled)
|
|
|
|
{
|
|
|
|
m_subWindowsTiled3DWindow = tiled;
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
void RimProject::setSubWindowsTiledInPlotWindow(bool tiled)
|
|
|
|
{
|
|
|
|
m_subWindowsTiledPlotWindow = tiled;
|
|
|
|
}
|
|
|
|
|
2017-05-31 09:16:28 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2017-06-02 03:35:52 -05:00
|
|
|
void RimProject::reloadCompletionTypeResultsInAllViews()
|
|
|
|
{
|
2018-09-11 05:41:45 -05:00
|
|
|
scheduleCreateDisplayModelAndRedrawAllViews();
|
2018-01-12 04:31:01 -06:00
|
|
|
RiaCompletionTypeCalculationScheduler::instance()->scheduleRecalculateCompletionTypeAndRedrawAllViews();
|
2018-10-03 08:57:09 -05:00
|
|
|
|
|
|
|
this->mainPlotCollection()->updatePlotsWithCompletions();
|
2017-06-21 04:06:38 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2017-06-30 09:14:15 -05:00
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
RimDialogData* RimProject::dialogData() const
|
|
|
|
{
|
|
|
|
return m_dialogData;
|
|
|
|
}
|
|
|
|
|
2017-10-11 06:52:29 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
std::vector<RimEclipseCase*> RimProject::eclipseCases() const
|
|
|
|
{
|
|
|
|
std::vector<RimEclipseCase*> allCases;
|
|
|
|
for (const auto& oilField : oilFields)
|
|
|
|
{
|
|
|
|
const auto& cases = oilField->analysisModels->cases;
|
|
|
|
allCases.insert(allCases.end(), cases.begin(), cases.end());
|
|
|
|
}
|
|
|
|
return allCases;
|
|
|
|
}
|
|
|
|
|
2018-04-13 04:11:05 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
RimEclipseCase* RimProject::eclipseCaseFromGridFileName(const QString& gridFileName) const
|
|
|
|
{
|
|
|
|
for (RimEclipseCase* eclCase : eclipseCases())
|
|
|
|
{
|
|
|
|
if (RiaFilePathTools::toInternalSeparator(eclCase->gridFileName()) == RiaFilePathTools::toInternalSeparator(gridFileName))
|
|
|
|
{
|
|
|
|
return eclCase;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
|
2017-10-11 06:52:29 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
std::vector<QString> RimProject::simulationWellNames() const
|
|
|
|
{
|
|
|
|
std::set<QString> wellNames;
|
|
|
|
|
|
|
|
for (RimOilField* oilField : oilFields)
|
|
|
|
{
|
|
|
|
auto analysisCaseColl = oilField->analysisModels();
|
|
|
|
for (RimEclipseCase* eclCase : analysisCaseColl->cases())
|
|
|
|
{
|
|
|
|
const auto& eclData = eclCase->eclipseCaseData();
|
|
|
|
if (eclData == nullptr) continue;
|
|
|
|
|
|
|
|
const auto names = eclData->simulationWellNames();
|
|
|
|
wellNames.insert(names.begin(), names.end());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return std::vector<QString>(wellNames.begin(), wellNames.end());
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2017-11-17 08:35:07 -06:00
|
|
|
RimWellPath* RimProject::wellPathFromSimWellName(const QString& simWellName, int branchIndex)
|
2017-10-11 06:52:29 -05:00
|
|
|
{
|
2017-11-08 09:35:58 -06:00
|
|
|
for (RimWellPath* const path : allWellPaths())
|
2017-10-11 06:52:29 -05:00
|
|
|
{
|
2017-11-17 08:35:07 -06:00
|
|
|
if (QString::compare(path->associatedSimulationWellName(), simWellName) == 0 &&
|
2017-11-08 09:35:58 -06:00
|
|
|
(branchIndex < 0 || path->associatedSimulationWellBranch() == branchIndex))
|
2017-10-11 06:52:29 -05:00
|
|
|
{
|
2017-11-08 09:35:58 -06:00
|
|
|
return path;
|
2017-10-11 06:52:29 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
|
2017-10-25 02:55:00 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2017-11-08 09:35:58 -06:00
|
|
|
RimWellPath* RimProject::wellPathByName(const QString& wellPathName) const
|
|
|
|
{
|
|
|
|
for (RimWellPath* const path : allWellPaths())
|
|
|
|
{
|
|
|
|
if (path->name() == wellPathName) return path;
|
|
|
|
}
|
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2017-10-25 02:55:00 -05:00
|
|
|
std::vector<RimWellPath*> RimProject::allWellPaths() const
|
|
|
|
{
|
|
|
|
std::vector<RimWellPath*> paths;
|
|
|
|
for (const auto& oilField : oilFields())
|
|
|
|
{
|
|
|
|
auto wellPathColl = oilField->wellPathCollection();
|
|
|
|
for (const auto& path : wellPathColl->wellPaths)
|
|
|
|
{
|
|
|
|
paths.push_back(path);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return paths;
|
|
|
|
}
|
|
|
|
|
2018-11-23 06:33:59 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
std::vector<RimTextAnnotation*> RimProject::textAnnotations() const
|
|
|
|
{
|
|
|
|
std::vector<RimTextAnnotation*> annotations;
|
2018-11-26 07:48:06 -06:00
|
|
|
|
|
|
|
// 'Global' text annotations
|
2018-11-23 06:33:59 -06:00
|
|
|
for (const auto& oilField : oilFields())
|
|
|
|
{
|
|
|
|
auto annotationColl = oilField->annotationCollection();
|
|
|
|
for (const auto& annotation : annotationColl->textAnnotations())
|
|
|
|
{
|
|
|
|
annotations.push_back(annotation);
|
|
|
|
}
|
|
|
|
}
|
2018-11-26 07:48:06 -06:00
|
|
|
|
|
|
|
// 'Local' text annotations
|
|
|
|
std::vector<RimGridView*> visibleViews;
|
|
|
|
allVisibleGridViews(visibleViews);
|
|
|
|
for (const auto& view : visibleViews)
|
|
|
|
{
|
|
|
|
std::vector<RimAnnotationInViewCollection*> annotationColls;
|
|
|
|
view->descendantsIncludingThisOfType(annotationColls);
|
|
|
|
|
|
|
|
if (annotationColls.size() == 1)
|
|
|
|
{
|
|
|
|
for (const auto& annotation : annotationColls.front()->textAnnotations())
|
|
|
|
{
|
|
|
|
annotations.push_back(annotation);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-11-23 06:33:59 -06:00
|
|
|
return annotations;
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
std::vector<RimReachCircleAnnotation*> RimProject::reachCircleAnnotations() const
|
|
|
|
{
|
|
|
|
std::vector<RimReachCircleAnnotation*> annotations;
|
|
|
|
for (const auto& oilField : oilFields())
|
|
|
|
{
|
|
|
|
auto annotationColl = oilField->annotationCollection();
|
|
|
|
for (const auto& annotation : annotationColl->reachCircleAnnotations())
|
|
|
|
{
|
|
|
|
annotations.push_back(annotation);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return annotations;
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2018-11-26 07:06:17 -06:00
|
|
|
std::vector<RimPolylinesAnnotation*> RimProject::polylineAnnotations() const
|
2018-11-23 06:33:59 -06:00
|
|
|
{
|
2018-11-26 07:06:17 -06:00
|
|
|
std::vector<RimPolylinesAnnotation*> annotations;
|
2018-11-23 06:33:59 -06:00
|
|
|
for (const auto& oilField : oilFields())
|
|
|
|
{
|
|
|
|
auto annotationColl = oilField->annotationCollection();
|
2018-11-28 07:21:32 -06:00
|
|
|
for (const auto& annotation : annotationColl->userDefinedPolylineAnnotations())
|
2018-11-23 06:33:59 -06:00
|
|
|
{
|
|
|
|
annotations.push_back(annotation);
|
|
|
|
}
|
2018-11-26 07:06:17 -06:00
|
|
|
|
|
|
|
for (const auto& annotation : annotationColl->polylinesFromFileAnnotations())
|
|
|
|
{
|
|
|
|
annotations.push_back(annotation);
|
|
|
|
}
|
|
|
|
|
2018-11-23 06:33:59 -06:00
|
|
|
}
|
|
|
|
return annotations;
|
|
|
|
}
|
|
|
|
|
2017-10-20 09:10:45 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
std::vector<RimGeoMechCase*> RimProject::geoMechCases() const
|
|
|
|
{
|
|
|
|
std::vector<RimGeoMechCase*> cases;
|
|
|
|
|
|
|
|
for (size_t oilFieldIdx = 0; oilFieldIdx < oilFields().size(); oilFieldIdx++)
|
|
|
|
{
|
|
|
|
RimOilField* oilField = oilFields[oilFieldIdx];
|
|
|
|
if (!oilField) continue;
|
|
|
|
|
|
|
|
RimGeoMechModels* geomModels = oilField->geoMechModels();
|
|
|
|
if (geomModels)
|
|
|
|
{
|
|
|
|
for (size_t caseIdx = 0; caseIdx < geomModels->cases.size(); caseIdx++)
|
|
|
|
{
|
|
|
|
cases.push_back(geomModels->cases[caseIdx]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return cases;
|
|
|
|
}
|
|
|
|
|
2017-12-20 07:24:20 -06:00
|
|
|
|
2017-12-20 06:14:43 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
std::vector<RimFractureTemplateCollection*> RimProject::allFractureTemplateCollections() const
|
|
|
|
{
|
|
|
|
std::vector<RimFractureTemplateCollection*> templColls;
|
2018-09-24 14:32:58 -05:00
|
|
|
std::vector<RimOilField*> rimOilFields;
|
2017-12-20 06:14:43 -06:00
|
|
|
|
2018-09-24 14:32:58 -05:00
|
|
|
allOilFields(rimOilFields);
|
|
|
|
for (RimOilField* oilField : rimOilFields)
|
2017-12-20 06:14:43 -06:00
|
|
|
{
|
|
|
|
templColls.push_back(oilField->fractureDefinitionCollection());
|
|
|
|
}
|
|
|
|
return templColls;
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
std::vector<RimFractureTemplate*> RimProject::allFractureTemplates() const
|
|
|
|
{
|
|
|
|
std::vector<RimFractureTemplate*> templates;
|
|
|
|
for (RimFractureTemplateCollection* templColl : allFractureTemplateCollections())
|
|
|
|
{
|
2018-03-02 02:33:17 -06:00
|
|
|
for (RimFractureTemplate* templ : templColl->fractureTemplates())
|
2017-12-20 06:14:43 -06:00
|
|
|
{
|
|
|
|
templates.push_back(templ);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return templates;
|
|
|
|
}
|
|
|
|
|
2018-12-13 12:49:37 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
std::vector<RimValveTemplateCollection*> RimProject::allValveTemplateCollections() const
|
|
|
|
{
|
|
|
|
std::vector<RimValveTemplateCollection*> templColls;
|
|
|
|
std::vector<RimOilField*> rimOilFields;
|
|
|
|
|
|
|
|
allOilFields(rimOilFields);
|
|
|
|
for (RimOilField* oilField : rimOilFields)
|
|
|
|
{
|
|
|
|
templColls.push_back(oilField->valveTemplateCollection());
|
|
|
|
}
|
|
|
|
return templColls;
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
std::vector<RimValveTemplate*> RimProject::allValveTemplates() const
|
|
|
|
{
|
|
|
|
std::vector<RimValveTemplate*> templates;
|
|
|
|
for (RimValveTemplateCollection* templColl : allValveTemplateCollections())
|
|
|
|
{
|
|
|
|
for (RimValveTemplate* templ : templColl->valveTemplates())
|
|
|
|
{
|
|
|
|
templates.push_back(templ);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return templates;
|
|
|
|
}
|
|
|
|
|
2018-08-28 04:12:05 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2018-10-09 05:23:44 -05:00
|
|
|
RiaEclipseUnitTools::UnitSystemType RimProject::commonUnitSystemForAllCases() const
|
2018-08-28 04:12:05 -05:00
|
|
|
{
|
|
|
|
std::vector<RimCase*> rimCases;
|
|
|
|
allCases(rimCases);
|
|
|
|
|
|
|
|
RiaEclipseUnitTools::UnitSystem commonUnitSystem = RiaEclipseUnitTools::UNITS_UNKNOWN;
|
|
|
|
|
|
|
|
for (const auto& c : rimCases)
|
|
|
|
{
|
|
|
|
auto eclipseCase = dynamic_cast<RimEclipseCase*>(c);
|
|
|
|
if (eclipseCase && eclipseCase->eclipseCaseData())
|
|
|
|
{
|
|
|
|
if (commonUnitSystem == RiaEclipseUnitTools::UNITS_UNKNOWN)
|
|
|
|
{
|
|
|
|
commonUnitSystem = eclipseCase->eclipseCaseData()->unitsType();
|
|
|
|
}
|
|
|
|
else if (commonUnitSystem != eclipseCase->eclipseCaseData()->unitsType())
|
|
|
|
{
|
|
|
|
commonUnitSystem = RiaEclipseUnitTools::UNITS_UNKNOWN;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return commonUnitSystem;
|
|
|
|
}
|
|
|
|
|
2018-12-19 07:41:17 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
RimMeasurement* RimProject::measurement() const
|
|
|
|
{
|
|
|
|
return activeOilField()->measurement;
|
|
|
|
}
|
|
|
|
|
2017-06-02 03:35:52 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2017-06-21 04:06:38 -05:00
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
void RimProject::reloadCompletionTypeResultsForEclipseCase(RimEclipseCase* eclipseCase)
|
|
|
|
{
|
2018-01-09 03:11:28 -06:00
|
|
|
std::vector<Rim3dView*> views = eclipseCase->views();
|
2017-06-21 04:06:38 -05:00
|
|
|
|
|
|
|
for (size_t viewIdx = 0; viewIdx < views.size(); viewIdx++)
|
|
|
|
{
|
|
|
|
views[viewIdx]->scheduleCreateDisplayModelAndRedraw();
|
|
|
|
}
|
|
|
|
|
2018-05-09 01:39:36 -05:00
|
|
|
RiaCompletionTypeCalculationScheduler::instance()->scheduleRecalculateCompletionTypeAndRedrawAllViews(eclipseCase);
|
2017-05-31 09:16:28 -05:00
|
|
|
}
|
|
|
|
|
2015-08-06 08:55:17 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
void RimProject::defineUiTreeOrdering(caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName /*= ""*/)
|
|
|
|
{
|
2016-06-27 04:07:01 -05:00
|
|
|
if (uiConfigName == "PlotWindow")
|
2015-09-07 07:01:19 -05:00
|
|
|
{
|
2016-06-27 04:07:01 -05:00
|
|
|
{
|
2019-02-05 01:18:20 -06:00
|
|
|
auto itemCollection = uiTreeOrdering.add("Cases and Data", ":/Folder.png");
|
2019-01-14 04:14:18 -06:00
|
|
|
|
|
|
|
RimOilField* oilField = activeOilField();
|
|
|
|
if (oilField)
|
2017-09-14 08:44:01 -05:00
|
|
|
{
|
2019-01-14 04:14:18 -06:00
|
|
|
if (oilField->summaryCaseMainCollection())
|
|
|
|
{
|
|
|
|
itemCollection->add(oilField->summaryCaseMainCollection());
|
|
|
|
}
|
|
|
|
if (oilField->observedDataCollection())
|
|
|
|
{
|
|
|
|
itemCollection->add(oilField->observedDataCollection());
|
|
|
|
}
|
2017-09-14 08:44:01 -05:00
|
|
|
}
|
2016-06-27 04:07:01 -05:00
|
|
|
}
|
2015-09-07 07:01:19 -05:00
|
|
|
|
2016-06-27 04:07:01 -05:00
|
|
|
if (mainPlotCollection)
|
|
|
|
{
|
2019-01-14 06:54:19 -06:00
|
|
|
auto itemCollection = uiTreeOrdering.add("Plots", ":/Folder.png");
|
2019-01-14 04:14:18 -06:00
|
|
|
if (mainPlotCollection->summaryPlotCollection())
|
2016-06-27 04:07:01 -05:00
|
|
|
{
|
2019-01-14 04:14:18 -06:00
|
|
|
itemCollection->add(mainPlotCollection->summaryPlotCollection());
|
2016-06-27 04:07:01 -05:00
|
|
|
}
|
2017-09-26 03:49:13 -05:00
|
|
|
|
2019-01-14 04:14:18 -06:00
|
|
|
if (mainPlotCollection->summaryCrossPlotCollection())
|
|
|
|
{
|
|
|
|
itemCollection->add(mainPlotCollection->summaryCrossPlotCollection());
|
|
|
|
}
|
|
|
|
|
|
|
|
if (mainPlotCollection->wellLogPlotCollection())
|
|
|
|
{
|
|
|
|
itemCollection->add(mainPlotCollection->wellLogPlotCollection());
|
|
|
|
}
|
|
|
|
|
|
|
|
if (mainPlotCollection->rftPlotCollection())
|
|
|
|
{
|
|
|
|
itemCollection->add(mainPlotCollection->rftPlotCollection());
|
|
|
|
}
|
2017-11-07 13:40:45 -06:00
|
|
|
|
2019-01-14 04:14:18 -06:00
|
|
|
if (mainPlotCollection->pltPlotCollection())
|
2016-06-27 04:07:01 -05:00
|
|
|
{
|
2019-01-14 04:14:18 -06:00
|
|
|
itemCollection->add(mainPlotCollection->pltPlotCollection());
|
2016-06-27 04:07:01 -05:00
|
|
|
}
|
2017-01-13 02:50:43 -06:00
|
|
|
|
2019-01-14 04:14:18 -06:00
|
|
|
if (mainPlotCollection->flowPlotCollection())
|
2017-01-13 02:50:43 -06:00
|
|
|
{
|
2019-01-14 04:14:18 -06:00
|
|
|
itemCollection->add(mainPlotCollection->flowPlotCollection());
|
2017-01-13 02:50:43 -06:00
|
|
|
}
|
2019-02-21 05:52:23 -06:00
|
|
|
|
|
|
|
if (mainPlotCollection->gridCrossPlotCollection())
|
|
|
|
{
|
|
|
|
itemCollection->add(mainPlotCollection->gridCrossPlotCollection());
|
|
|
|
}
|
2019-03-18 06:41:44 -05:00
|
|
|
|
|
|
|
if (mainPlotCollection->saturationPressurePlotCollection())
|
|
|
|
{
|
|
|
|
itemCollection->add(mainPlotCollection->saturationPressurePlotCollection());
|
|
|
|
}
|
2016-06-27 04:07:01 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
2015-08-28 05:10:36 -05:00
|
|
|
{
|
2016-06-27 04:07:01 -05:00
|
|
|
if (viewLinkerCollection()->viewLinker())
|
2015-08-28 05:10:36 -05:00
|
|
|
{
|
2016-06-27 04:07:01 -05:00
|
|
|
// Use object instead of field to avoid duplicate entries in the tree view
|
|
|
|
uiTreeOrdering.add(viewLinkerCollection());
|
2015-08-28 05:10:36 -05:00
|
|
|
}
|
2016-06-27 04:07:01 -05:00
|
|
|
|
|
|
|
RimOilField* oilField = activeOilField();
|
|
|
|
if (oilField)
|
2016-05-09 05:13:54 -05:00
|
|
|
{
|
2016-12-16 07:38:27 -06:00
|
|
|
if (oilField->analysisModels()) uiTreeOrdering.add(oilField->analysisModels());
|
|
|
|
if (oilField->geoMechModels()) uiTreeOrdering.add(oilField->geoMechModels());
|
|
|
|
if (oilField->wellPathCollection()) uiTreeOrdering.add(oilField->wellPathCollection());
|
2018-01-04 08:04:58 -06:00
|
|
|
if (oilField->formationNamesCollection()) uiTreeOrdering.add(oilField->formationNamesCollection());
|
2018-12-13 12:49:37 -06:00
|
|
|
if (oilField->completionTemplateCollection()) uiTreeOrdering.add(oilField->completionTemplateCollection());
|
2018-11-23 06:33:59 -06:00
|
|
|
if (oilField->annotationCollection()) uiTreeOrdering.add(oilField->annotationCollection());
|
2016-05-09 05:13:54 -05:00
|
|
|
}
|
2015-08-06 08:55:17 -05:00
|
|
|
|
2016-06-27 04:07:01 -05:00
|
|
|
uiTreeOrdering.add(scriptCollection());
|
|
|
|
}
|
2016-12-09 03:01:50 -06:00
|
|
|
|
2017-03-22 09:57:04 -05:00
|
|
|
uiTreeOrdering.skipRemainingChildren(true);
|
2015-08-06 08:55:17 -05:00
|
|
|
}
|
|
|
|
|