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
|
2019-09-06 03:40:57 -05:00
|
|
|
//
|
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.
|
2019-09-06 03:40:57 -05:00
|
|
|
//
|
2012-05-18 02:45:23 -05:00
|
|
|
// 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.
|
2019-09-06 03:40:57 -05:00
|
|
|
//
|
|
|
|
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
2012-05-18 02:45:23 -05:00
|
|
|
// for more details.
|
|
|
|
//
|
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#include "RimProject.h"
|
2013-05-06 03:55:00 -05:00
|
|
|
|
2018-11-05 07:28:07 -06:00
|
|
|
#include "RiaCompletionTypeCalculationScheduler.h"
|
|
|
|
#include "RiaFieldHandleTools.h"
|
|
|
|
#include "RiaFilePathTools.h"
|
2019-09-06 03:40:57 -05:00
|
|
|
#include "RiaGuiApplication.h"
|
2018-01-04 06:12:07 -06:00
|
|
|
#include "RiaProjectFileVersionTools.h"
|
2022-03-11 06:24:01 -06:00
|
|
|
#include "RiaTextStringTools.h"
|
2013-03-22 10:12:00 -05:00
|
|
|
#include "RiaVersionInfo.h"
|
2015-08-01 16:04:04 -05:00
|
|
|
|
2020-02-24 08:42:23 -06:00
|
|
|
#include "RicfCommandObject.h"
|
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-09-11 02:33:03 -05:00
|
|
|
#include "PlotTemplates/RimPlotTemplateFolderItem.h"
|
2019-04-05 03:11:30 -05:00
|
|
|
#include "RimAdvancedSnapshotExportDefinition.h"
|
2020-02-12 09:48:25 -06:00
|
|
|
#include "RimAnalysisPlotCollection.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"
|
2020-04-30 09:54:25 -05:00
|
|
|
#include "RimColorLegendCollection.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"
|
2020-04-17 02:31:42 -05:00
|
|
|
#include "RimCorrelationPlotCollection.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"
|
2021-05-26 05:10:45 -05:00
|
|
|
#include "RimEnsembleWellLogsCollection.h"
|
2023-02-16 13:05:12 -06:00
|
|
|
#include "RimFileWellPath.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"
|
2022-04-22 05:18:34 -05:00
|
|
|
#include "RimGridCalculationCollection.h"
|
2019-04-05 03:11:30 -05:00
|
|
|
#include "RimGridCrossPlotCollection.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-11-13 05:22:50 -06:00
|
|
|
#include "RimMultiPlotCollection.h"
|
2017-09-14 08:44:01 -05:00
|
|
|
#include "RimObservedDataCollection.h"
|
2019-09-06 03:40:57 -05:00
|
|
|
#include "RimObservedSummaryData.h"
|
2014-07-24 03:11:43 -05:00
|
|
|
#include "RimOilField.h"
|
2019-11-14 13:48:11 -06:00
|
|
|
#include "RimPlotWindow.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"
|
2023-03-24 09:36:10 -05:00
|
|
|
#include "RimSeismicDataCollection.h"
|
2023-08-07 09:35:59 -05:00
|
|
|
#include "RimSeismicView.h"
|
|
|
|
#include "RimSeismicViewCollection.h"
|
2020-11-04 06:46:17 -06:00
|
|
|
#include "RimStimPlanModelPlotCollection.h"
|
2019-12-09 02:21:06 -06:00
|
|
|
#include "RimSummaryCalculation.h"
|
2018-02-26 13:54:45 -06:00
|
|
|
#include "RimSummaryCalculationCollection.h"
|
2020-04-08 09:17:47 -05:00
|
|
|
#include "RimSummaryCaseCollection.h"
|
2017-09-06 09:32:46 -05:00
|
|
|
#include "RimSummaryCaseMainCollection.h"
|
2017-11-07 13:40:45 -06:00
|
|
|
#include "RimSummaryCrossPlotCollection.h"
|
2022-03-04 03:52:17 -06:00
|
|
|
#include "RimSummaryMultiPlotCollection.h"
|
2023-03-23 08:10:30 -05:00
|
|
|
#include "RimSummaryTableCollection.h"
|
2020-01-03 06:49:12 -06:00
|
|
|
#include "RimSurfaceCollection.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"
|
2020-11-13 03:56:25 -06:00
|
|
|
#include "RimVfpPlotCollection.h"
|
2015-09-07 07:29:46 -05:00
|
|
|
#include "RimViewLinker.h"
|
2015-09-08 03:17:35 -05:00
|
|
|
#include "RimViewLinkerCollection.h"
|
2019-10-09 02:21:28 -05:00
|
|
|
#include "RimViewWindow.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"
|
2020-01-03 06:49:12 -06:00
|
|
|
|
2022-12-08 00:08:22 -06:00
|
|
|
#include "Tools/RiaVariableMapper.h"
|
|
|
|
|
2020-11-13 08:37:08 -06:00
|
|
|
#ifdef USE_QTCHARTS
|
2021-04-28 06:45:04 -05:00
|
|
|
#include "RimEnsembleFractureStatisticsPlot.h"
|
|
|
|
#include "RimEnsembleFractureStatisticsPlotCollection.h"
|
2020-11-13 08:37:08 -06:00
|
|
|
#include "RimGridStatisticsPlot.h"
|
|
|
|
#include "RimGridStatisticsPlotCollection.h"
|
|
|
|
#endif
|
|
|
|
|
2019-06-17 02:11:38 -05:00
|
|
|
#include "SsiHubImportCommands/RimWellPathImport.h"
|
2013-02-14 06:16:56 -06:00
|
|
|
|
2018-01-19 05:52:50 -06:00
|
|
|
#include "RiuMainWindow.h"
|
2019-09-06 03:40:57 -05:00
|
|
|
#include "RiuPlotMainWindow.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>
|
2022-12-08 00:08:22 -06:00
|
|
|
|
2019-12-10 07:58:47 -06:00
|
|
|
#include <algorithm>
|
2015-11-18 02:35:38 -06:00
|
|
|
|
2020-02-24 08:42:23 -06:00
|
|
|
CAF_PDM_SOURCE_INIT( RimProject, "ResInsightProject" );
|
2012-05-18 02:45:23 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2012-05-18 02:45:23 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2023-04-14 07:07:45 -05:00
|
|
|
RimProject::RimProject()
|
2019-11-21 01:14:24 -06:00
|
|
|
: m_nextValidCaseId( 0 )
|
|
|
|
, m_nextValidCaseGroupId( 0 )
|
2022-06-13 06:54:55 -05:00
|
|
|
, m_nextValidViewId( -1 )
|
|
|
|
, m_nextValidPlotId( -1 )
|
2020-04-08 07:30:38 -05:00
|
|
|
, m_nextValidSummaryCaseId( 1 )
|
2020-04-08 09:17:47 -05:00
|
|
|
, m_nextValidEnsembleId( 1 )
|
2012-05-18 02:45:23 -05:00
|
|
|
{
|
2020-03-03 03:43:07 -06:00
|
|
|
CAF_PDM_InitScriptableObjectWithNameAndComment( "Project", "", "", "", "Project", "The ResInsight Project" );
|
2019-10-09 02:21:28 -05:00
|
|
|
|
2021-11-14 07:15:12 -06:00
|
|
|
CAF_PDM_InitField( &m_projectFileVersionString, "ProjectFileVersionString", QString( STRPRODUCTVER ), "" );
|
2019-09-06 03:40:57 -05:00
|
|
|
m_projectFileVersionString.uiCapability()->setUiHidden( true );
|
2012-05-18 02:45:23 -05:00
|
|
|
|
2021-11-14 07:15:12 -06:00
|
|
|
CAF_PDM_InitFieldNoDefault( &m_globalPathList, "ReferencedExternalFiles", "" );
|
2019-12-10 07:58:47 -06:00
|
|
|
m_globalPathList.uiCapability()->setUiHidden( true );
|
|
|
|
|
2021-11-14 07:15:12 -06:00
|
|
|
CAF_PDM_InitFieldNoDefault( &oilFields, "OilFields", "Oil Fields" );
|
2021-10-13 06:39:46 -05:00
|
|
|
oilFields.uiCapability()->setUiTreeHidden( true );
|
2013-02-14 07:30:01 -06:00
|
|
|
|
2021-11-14 07:15:12 -06:00
|
|
|
CAF_PDM_InitFieldNoDefault( &colorLegendCollection, "ColorLegendCollection", "Color Legend Collection" );
|
2020-04-30 09:54:25 -05:00
|
|
|
colorLegendCollection = new RimColorLegendCollection();
|
2020-05-13 07:28:06 -05:00
|
|
|
colorLegendCollection->createStandardColorLegends();
|
2020-04-30 09:54:25 -05:00
|
|
|
|
2022-01-07 01:31:52 -06:00
|
|
|
CAF_PDM_InitFieldNoDefault( &scriptCollection, "ScriptCollection", "Octave Scripts", ":/octave.png" );
|
2021-10-13 06:39:46 -05:00
|
|
|
scriptCollection.uiCapability()->setUiTreeHidden( true );
|
2019-07-30 03:36:05 -05:00
|
|
|
scriptCollection.xmlCapability()->disableIO();
|
2013-04-26 12:05:35 -05:00
|
|
|
|
2021-11-14 07:15:12 -06:00
|
|
|
CAF_PDM_InitFieldNoDefault( &wellPathImport, "WellPathImport", "WellPathImport" );
|
2013-09-06 06:06:39 -05:00
|
|
|
wellPathImport = new RimWellPathImport();
|
2021-10-13 06:39:46 -05:00
|
|
|
wellPathImport.uiCapability()->setUiTreeHidden( true );
|
2019-09-06 03:40:57 -05:00
|
|
|
wellPathImport.uiCapability()->setUiTreeChildrenHidden( true );
|
|
|
|
|
2022-08-19 07:30:25 -05:00
|
|
|
CAF_PDM_InitFieldNoDefault( &m_mainPlotCollection, "MainPlotCollection", "Plots" );
|
|
|
|
m_mainPlotCollection.uiCapability()->setUiTreeHidden( true );
|
2019-09-06 03:40:57 -05:00
|
|
|
|
2022-04-22 02:58:51 -05:00
|
|
|
CAF_PDM_InitFieldNoDefault( &viewLinkerCollection, "LinkedViews", "Linked Views", ":/LinkView.svg" );
|
2021-10-13 06:39:46 -05:00
|
|
|
viewLinkerCollection.uiCapability()->setUiTreeHidden( true );
|
2015-09-08 03:17:35 -05:00
|
|
|
viewLinkerCollection = new RimViewLinkerCollection;
|
2015-09-01 10:14:22 -05:00
|
|
|
|
2021-11-14 07:15:12 -06: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
|
|
|
|
2022-04-22 05:18:34 -05:00
|
|
|
CAF_PDM_InitFieldNoDefault( &gridCalculationCollection, "GridCalculationCollection", "Grid Calculation Collection" );
|
|
|
|
gridCalculationCollection = new RimGridCalculationCollection;
|
|
|
|
|
2021-11-14 07:15:12 -06:00
|
|
|
CAF_PDM_InitFieldNoDefault( &commandObjects, "CommandObjects", "Command Objects" );
|
2013-09-12 01:11:56 -05:00
|
|
|
|
2021-11-14 07:15:12 -06:00
|
|
|
CAF_PDM_InitFieldNoDefault( &multiSnapshotDefinitions, "MultiSnapshotDefinitions", "Multi Snapshot Definitions" );
|
2016-12-09 04:11:16 -06:00
|
|
|
|
2022-01-28 06:19:52 -06:00
|
|
|
CAF_PDM_InitFieldNoDefault( &mainWindowTreeViewStates, "TreeViewStates", "" );
|
|
|
|
mainWindowTreeViewStates.uiCapability()->setUiHidden( true );
|
|
|
|
CAF_PDM_InitFieldNoDefault( &mainWindowCurrentModelIndexPaths, "TreeViewCurrentModelIndexPaths", "" );
|
|
|
|
mainWindowCurrentModelIndexPaths.uiCapability()->setUiHidden( true );
|
2016-10-06 08:01:59 -05:00
|
|
|
|
2022-01-28 06:19:52 -06:00
|
|
|
CAF_PDM_InitFieldNoDefault( &plotWindowTreeViewStates, "PlotWindowTreeViewStates", "" );
|
|
|
|
plotWindowTreeViewStates.uiCapability()->setUiHidden( true );
|
|
|
|
CAF_PDM_InitFieldNoDefault( &plotWindowCurrentModelIndexPaths, "PlotWindowTreeViewCurrentModelIndexPaths", "" );
|
|
|
|
plotWindowCurrentModelIndexPaths.uiCapability()->setUiHidden( true );
|
2013-04-19 06:20:46 -05:00
|
|
|
|
2021-11-14 07:15:12 -06:00
|
|
|
CAF_PDM_InitField( &m_show3DWindow, "show3DWindow", true, "Show 3D Window" );
|
2019-09-06 03:40:57 -05:00
|
|
|
m_show3DWindow.uiCapability()->setUiHidden( true );
|
2016-10-04 07:23:34 -05:00
|
|
|
|
2021-11-14 07:15:12 -06:00
|
|
|
CAF_PDM_InitField( &m_showPlotWindow, "showPlotWindow", false, "Show Plot Window" );
|
2019-09-06 03:40:57 -05:00
|
|
|
m_showPlotWindow.uiCapability()->setUiHidden( true );
|
2016-10-04 07:23:34 -05:00
|
|
|
|
2023-03-09 01:54:28 -06:00
|
|
|
CAF_PDM_InitField( &m_showPlotWindowOnTopOf3DWindow, "showPlotWindowOnTopOf3DWindow", false, "Show Plot On Top" );
|
|
|
|
m_showPlotWindowOnTopOf3DWindow.uiCapability()->setUiHidden( true );
|
|
|
|
|
2022-10-31 07:26:26 -05:00
|
|
|
CAF_PDM_InitField( &m_subWindowsTiled3DWindow_OBSOLETE, "tiled3DWindow", false, "Tile 3D Window" );
|
|
|
|
m_subWindowsTiled3DWindow_OBSOLETE.uiCapability()->setUiHidden( true );
|
2019-04-02 12:18:00 -05:00
|
|
|
|
2022-10-31 07:26:26 -05:00
|
|
|
CAF_PDM_InitField( &m_subWindowsTiledPlotWindow_OBSOLETE, "tiledPlotWindow", false, "Tile Plot Window" );
|
|
|
|
m_subWindowsTiledPlotWindow_OBSOLETE.uiCapability()->setUiHidden( true );
|
2019-04-02 12:18:00 -05:00
|
|
|
|
2021-11-14 07:15:12 -06:00
|
|
|
CAF_PDM_InitFieldNoDefault( &m_dialogData, "DialogData", "DialogData" );
|
2017-06-30 09:14:15 -05:00
|
|
|
m_dialogData = new RimDialogData();
|
2021-10-13 06:39:46 -05:00
|
|
|
m_dialogData.uiCapability()->setUiTreeHidden( true );
|
2019-09-06 03:40:57 -05:00
|
|
|
m_dialogData.uiCapability()->setUiTreeChildrenHidden( true );
|
2017-06-30 09:14:15 -05:00
|
|
|
|
2013-06-12 02:36:50 -05:00
|
|
|
// Obsolete fields. The content is moved to OilFields and friends
|
2021-11-14 07:15:12 -06:00
|
|
|
CAF_PDM_InitFieldNoDefault( &casesObsolete, "Reservoirs", "" );
|
2022-06-02 08:57:00 -05:00
|
|
|
RiaFieldHandleTools::disableWriteAndSetFieldHidden( &casesObsolete );
|
2019-09-06 03:40:57 -05:00
|
|
|
|
2021-11-14 07:15:12 -06:00
|
|
|
CAF_PDM_InitFieldNoDefault( &caseGroupsObsolete, "CaseGroups", "" );
|
2022-06-02 08:57:00 -05:00
|
|
|
RiaFieldHandleTools::disableWriteAndSetFieldHidden( &caseGroupsObsolete );
|
2013-06-12 02:36:50 -05:00
|
|
|
|
2022-10-31 07:26:26 -05:00
|
|
|
CAF_PDM_InitFieldNoDefault( &m_subWindowsTileMode3DWindow, "TileMode3DWindow", "TileMode3DWindow" );
|
|
|
|
m_subWindowsTileMode3DWindow.uiCapability()->setUiHidden( true );
|
|
|
|
CAF_PDM_InitFieldNoDefault( &m_subWindowsTileModePlotWindow, "TileModePlotWindow", "TileModePlotWindow" );
|
|
|
|
m_subWindowsTileModePlotWindow.uiCapability()->setUiHidden( true );
|
|
|
|
|
2013-06-12 02:36:50 -05:00
|
|
|
// Initialization
|
|
|
|
|
2012-05-18 02:45:23 -05:00
|
|
|
scriptCollection = new RimScriptCollection();
|
2019-09-06 03:40:57 -05:00
|
|
|
scriptCollection->directory.uiCapability()->setUiHidden( true );
|
|
|
|
scriptCollection->uiCapability()->setUiName( "Scripts" );
|
|
|
|
scriptCollection->uiCapability()->setUiIconFromResourceString( ":/octave.png" );
|
2012-05-18 02:45:23 -05:00
|
|
|
|
2022-08-19 07:30:25 -05:00
|
|
|
m_mainPlotCollection = new RimMainPlotCollection();
|
2015-08-27 09:13:49 -05:00
|
|
|
|
2022-05-11 12:46:17 -05:00
|
|
|
CAF_PDM_InitFieldNoDefault( &m_plotTemplateTopFolder, "PlotTemplateCollection", "Plot Templates" );
|
|
|
|
m_plotTemplateTopFolder = new RimPlotTemplateFolderItem();
|
|
|
|
m_plotTemplateTopFolder.xmlCapability()->disableIO();
|
2019-09-11 02:33:03 -05:00
|
|
|
|
2013-06-07 07:54:02 -05:00
|
|
|
// For now, create a default first oilfield that contains the rest of the project
|
2019-09-06 03:40:57 -05:00
|
|
|
oilFields.push_back( new RimOilField );
|
2013-06-07 07:54:02 -05:00
|
|
|
|
2023-08-04 02:04:14 -05:00
|
|
|
setUiHidden( true );
|
2012-05-18 02:45:23 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2012-05-18 02:45:23 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2023-04-14 07:07:45 -05:00
|
|
|
RimProject::~RimProject()
|
2020-02-12 04:13:38 -06:00
|
|
|
{
|
|
|
|
}
|
2012-05-18 02:45:23 -05:00
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2020-04-22 07:35:25 -05:00
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
RimProject* RimProject::current()
|
|
|
|
{
|
|
|
|
return RiaApplication::instance()->project();
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2012-05-18 02:45:23 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
void RimProject::close()
|
|
|
|
{
|
2022-08-19 07:30:25 -05:00
|
|
|
if ( m_mainPlotCollection() )
|
2015-11-30 08:07:54 -06:00
|
|
|
{
|
2022-08-19 07:30:25 -05:00
|
|
|
m_mainPlotCollection()->deleteAllContainedObjects();
|
2016-05-25 07:05:31 -05:00
|
|
|
}
|
|
|
|
|
2022-05-31 06:08:07 -05:00
|
|
|
oilFields.deleteChildren();
|
2019-09-06 03:40:57 -05:00
|
|
|
oilFields.push_back( new RimOilField );
|
2013-06-12 02:36:50 -05:00
|
|
|
|
2022-05-31 06:08:07 -05:00
|
|
|
casesObsolete.deleteChildren();
|
|
|
|
caseGroupsObsolete.deleteChildren();
|
2012-05-18 02:45:23 -05:00
|
|
|
|
2022-05-31 06:08:07 -05:00
|
|
|
wellPathImport->regions().deleteChildren();
|
2013-09-06 08:59:25 -05:00
|
|
|
|
2022-05-31 06:08:07 -05:00
|
|
|
commandObjects.deleteChildren();
|
2013-09-13 03:42:27 -05:00
|
|
|
|
2022-05-31 06:08:07 -05:00
|
|
|
multiSnapshotDefinitions.deleteChildren();
|
2016-12-21 00:12:50 -06:00
|
|
|
|
2018-08-02 08:38:35 -05:00
|
|
|
m_dialogData->clearProjectSpecificData();
|
|
|
|
|
2017-10-18 04:18:43 -05:00
|
|
|
calculationCollection->deleteAllContainedObjects();
|
2022-04-22 05:18:34 -05:00
|
|
|
gridCalculationCollection->deleteAllContainedObjects();
|
2020-05-13 07:28:06 -05:00
|
|
|
colorLegendCollection->deleteCustomColorLegends();
|
2017-10-18 04:18:43 -05:00
|
|
|
|
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
|
|
|
|
2022-12-08 00:08:22 -06:00
|
|
|
m_globalPathList = "";
|
|
|
|
|
2022-01-28 06:19:52 -06:00
|
|
|
mainWindowCurrentModelIndexPaths = "";
|
|
|
|
mainWindowTreeViewStates = "";
|
|
|
|
plotWindowCurrentModelIndexPaths = "";
|
|
|
|
plotWindowTreeViewStates = "";
|
2019-10-18 08:32:20 -05:00
|
|
|
|
2019-12-09 02:21:06 -06:00
|
|
|
m_nextValidCaseId = 0;
|
|
|
|
m_nextValidCaseGroupId = 0;
|
2022-06-13 06:54:55 -05:00
|
|
|
m_nextValidViewId = -1;
|
|
|
|
m_nextValidPlotId = -1;
|
2020-04-08 07:30:38 -05:00
|
|
|
m_nextValidSummaryCaseId = 1;
|
2020-04-08 09:17:47 -05:00
|
|
|
m_nextValidEnsembleId = 1;
|
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
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -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
|
|
|
//--------------------------------------------------------------------------------------------------
|
2023-04-03 07:56:25 -05:00
|
|
|
void RimProject::beforeInitAfterRead()
|
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
|
|
|
{
|
2023-08-04 02:04:14 -05:00
|
|
|
distributePathsFromGlobalPathList();
|
2019-12-10 07:58:47 -06:00
|
|
|
|
2013-06-06 08:07:31 -05:00
|
|
|
// Create an empty oil field in case the project did not contain one
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( oilFields.size() < 1 )
|
2013-06-06 08:07:31 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
oilFields.push_back( new RimOilField );
|
2013-06-06 08:07:31 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
// Handle old project files with obsolete structure.
|
|
|
|
// Move caseGroupsObsolete and casesObsolete to oilFields()[idx]->analysisModels()
|
2023-02-26 03:48:40 -06:00
|
|
|
RimEclipseCaseCollection* analysisModels = activeOilField() ? activeOilField()->analysisModels() : nullptr;
|
2019-09-06 03:40:57 -05:00
|
|
|
bool movedOneRimIdenticalGridCaseGroup = false;
|
|
|
|
for ( size_t cgIdx = 0; cgIdx < caseGroupsObsolete.size(); ++cgIdx )
|
2013-06-06 08:07:31 -05:00
|
|
|
{
|
|
|
|
RimIdenticalGridCaseGroup* sourceCaseGroup = caseGroupsObsolete[cgIdx];
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( analysisModels )
|
2013-06-06 08:07:31 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
analysisModels->caseGroups.push_back( sourceCaseGroup );
|
2013-06-06 08:07:31 -05:00
|
|
|
movedOneRimIdenticalGridCaseGroup = true; // moved at least one so assume the others will be moved too...
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( movedOneRimIdenticalGridCaseGroup )
|
2013-06-06 08:07:31 -05:00
|
|
|
{
|
2022-05-31 06:08:07 -05:00
|
|
|
caseGroupsObsolete.clearWithoutDelete();
|
2013-06-06 08:07:31 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
bool movedOneRimCase = false;
|
2019-09-06 03:40:57 -05:00
|
|
|
for ( size_t cIdx = 0; cIdx < casesObsolete().size(); ++cIdx )
|
2013-06-06 08:07:31 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( analysisModels )
|
2013-06-06 08:07:31 -05:00
|
|
|
{
|
2015-09-01 10:04:08 -05:00
|
|
|
RimEclipseCase* sourceCase = casesObsolete[cIdx];
|
2019-09-06 03:40:57 -05:00
|
|
|
casesObsolete.set( cIdx, nullptr );
|
|
|
|
analysisModels->cases.push_back( sourceCase );
|
2013-06-06 08:07:31 -05:00
|
|
|
movedOneRimCase = true; // moved at least one so assume the others will be moved too...
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( movedOneRimCase )
|
2013-06-06 08:07:31 -05:00
|
|
|
{
|
2022-05-31 06:08:07 -05:00
|
|
|
casesObsolete.clearWithoutDelete();
|
2013-06-06 08:07:31 -05:00
|
|
|
}
|
2019-09-06 03:40:57 -05:00
|
|
|
|
2013-06-06 08:07:31 -05:00
|
|
|
// Set project pointer to each well path
|
2019-09-06 03:40:57 -05:00
|
|
|
for ( size_t oilFieldIdx = 0; oilFieldIdx < oilFields().size(); oilFieldIdx++ )
|
2013-06-06 08:07:31 -05:00
|
|
|
{
|
|
|
|
RimOilField* oilField = oilFields[oilFieldIdx];
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( oilField == nullptr || oilField->wellPathCollection == nullptr ) continue;
|
2013-06-06 08:07:31 -05:00
|
|
|
}
|
2022-10-31 07:26:26 -05:00
|
|
|
|
|
|
|
if ( m_subWindowsTiled3DWindow_OBSOLETE ) m_subWindowsTileMode3DWindow = RiaDefines::WindowTileMode::DEFAULT;
|
|
|
|
if ( m_subWindowsTiledPlotWindow_OBSOLETE ) m_subWindowsTileModePlotWindow = RiaDefines::WindowTileMode::DEFAULT;
|
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
|
|
|
}
|
|
|
|
|
2023-04-03 07:56:25 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
void RimProject::initAfterRead()
|
|
|
|
{
|
|
|
|
// Function moved to beforeInitAfterRead() to make sure that file path objects are replaced before other initAfterRead() is called
|
|
|
|
}
|
|
|
|
|
2012-05-18 02:45:23 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2012-05-18 02:45:23 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
void RimProject::setupBeforeSave()
|
|
|
|
{
|
2021-10-21 08:46:50 -05:00
|
|
|
if ( RiaGuiApplication::isRunning() )
|
2016-10-04 07:23:34 -05:00
|
|
|
{
|
2021-10-21 08:46:50 -05:00
|
|
|
RiaGuiApplication* guiApp = RiaGuiApplication::instance();
|
|
|
|
|
|
|
|
if ( guiApp )
|
|
|
|
{
|
2022-05-21 09:11:55 -05:00
|
|
|
m_show3DWindow = guiApp->isMain3dWindowVisible();
|
|
|
|
m_showPlotWindow = guiApp->isMainPlotWindowVisible();
|
2023-03-09 01:54:28 -06:00
|
|
|
|
|
|
|
if ( m_showPlotWindow )
|
|
|
|
{
|
|
|
|
auto plotWindow = RiuPlotMainWindow::instance();
|
|
|
|
m_showPlotWindowOnTopOf3DWindow = plotWindow->isTopLevel();
|
|
|
|
}
|
2021-10-21 08:46:50 -05:00
|
|
|
}
|
2016-10-04 07:23:34 -05:00
|
|
|
}
|
|
|
|
|
2012-05-18 02:45:23 -05:00
|
|
|
m_projectFileVersionString = STRPRODUCTVER;
|
|
|
|
}
|
|
|
|
|
2022-08-19 07:30:25 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
RimMainPlotCollection* RimProject::mainPlotCollection() const
|
|
|
|
{
|
|
|
|
return m_mainPlotCollection();
|
|
|
|
}
|
|
|
|
|
2019-12-10 07:58:47 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
bool RimProject::writeProjectFile()
|
|
|
|
{
|
2023-08-04 02:04:14 -05:00
|
|
|
transferPathsToGlobalPathList();
|
|
|
|
bool couldOpenFile = writeFile();
|
|
|
|
distributePathsFromGlobalPathList();
|
2019-12-10 07:58:47 -06:00
|
|
|
|
|
|
|
return couldOpenFile;
|
|
|
|
}
|
|
|
|
|
2012-05-18 02:45:23 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2013-04-24 00:35:31 -05:00
|
|
|
/// Support list of multiple script paths divided by ';'
|
2012-05-18 02:45:23 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2022-06-01 23:53:05 -05:00
|
|
|
void RimProject::setScriptDirectories( const QString& scriptDirectories, int maxFolderDepth )
|
2012-05-18 02:45:23 -05:00
|
|
|
{
|
2022-05-31 06:08:07 -05:00
|
|
|
scriptCollection->calcScripts().deleteChildren();
|
|
|
|
scriptCollection->subDirectories().deleteChildren();
|
2012-05-18 02:45:23 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
QStringList pathList = scriptDirectories.split( ';' );
|
|
|
|
foreach ( QString path, pathList )
|
2012-05-18 02:45:23 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
QDir dir( path );
|
|
|
|
if ( !path.isEmpty() && dir.exists() && dir.isReadable() )
|
2013-04-24 00:35:31 -05:00
|
|
|
{
|
|
|
|
RimScriptCollection* sharedScriptLocation = new RimScriptCollection;
|
2019-09-06 03:40:57 -05:00
|
|
|
sharedScriptLocation->directory = path;
|
|
|
|
sharedScriptLocation->setUiName( dir.dirName() );
|
2012-05-18 02:45:23 -05:00
|
|
|
|
2022-06-01 23:53:05 -05:00
|
|
|
sharedScriptLocation->readContentFromDisc( maxFolderDepth );
|
2012-05-18 02:45:23 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
scriptCollection->subDirectories.push_back( sharedScriptLocation );
|
2013-04-24 00:35:31 -05:00
|
|
|
}
|
2012-05-18 02:45:23 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-09-11 02:33:03 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
void RimProject::setPlotTemplateFolders( const QStringList& plotTemplateFolders )
|
|
|
|
{
|
2022-05-11 12:46:17 -05:00
|
|
|
if ( !m_plotTemplateTopFolder() )
|
2019-09-19 04:39:32 -05:00
|
|
|
{
|
2022-05-11 12:46:17 -05:00
|
|
|
m_plotTemplateTopFolder = new RimPlotTemplateFolderItem();
|
2019-09-19 04:39:32 -05:00
|
|
|
}
|
2019-09-11 02:33:03 -05:00
|
|
|
|
2022-05-11 12:46:17 -05:00
|
|
|
m_plotTemplateTopFolder->createRootFolderItemsFromFolderPaths( plotTemplateFolders );
|
2019-09-11 02:33:03 -05:00
|
|
|
}
|
|
|
|
|
2012-05-18 02:45:23 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
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
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2018-01-04 06:12:07 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
bool RimProject::isProjectFileVersionEqualOrOlderThan( const QString& otherProjectFileVersion ) const
|
2018-01-04 06:12:07 -06:00
|
|
|
{
|
|
|
|
QString candidateProjectFileVersion = projectFileVersionString();
|
|
|
|
|
2023-02-26 03:48:40 -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
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2013-04-08 01:44:33 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
void RimProject::setProjectFileNameAndUpdateDependencies( const QString& projectFileName )
|
2013-04-08 01:44:33 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
// Extract the filename of the project file when it was saved
|
2023-08-04 02:04:14 -05:00
|
|
|
QString oldProjectFileName = fileName;
|
2013-04-12 01:31:59 -05:00
|
|
|
// Replace with the new actual filename
|
2023-08-04 02:04:14 -05:00
|
|
|
fileName = projectFileName;
|
2013-04-08 05:01:40 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
QFileInfo fileInfo( projectFileName );
|
|
|
|
QString newProjectPath = fileInfo.path();
|
|
|
|
|
|
|
|
QFileInfo fileInfoOld( oldProjectFileName );
|
|
|
|
QString oldProjectPath = fileInfoOld.path();
|
2013-04-12 01:31:59 -05:00
|
|
|
|
2020-10-12 06:17:47 -05:00
|
|
|
std::vector<caf::FilePath*> filePaths = allFilePaths();
|
2019-09-06 03:40:57 -05:00
|
|
|
for ( caf::FilePath* filePath : filePaths )
|
2018-01-19 05:52:50 -06:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
bool foundFile = false;
|
2018-01-19 05:52:50 -06:00
|
|
|
std::vector<QString> searchedPaths;
|
|
|
|
|
2023-02-15 00:56:17 -06:00
|
|
|
QString filePathCandidate = filePath->path();
|
2017-08-03 06:21:19 -05:00
|
|
|
|
2023-02-26 03:48:40 -06:00
|
|
|
QString newFilePath = RimTools::relocateFile( filePathCandidate, newProjectPath, oldProjectPath, &foundFile, &searchedPaths );
|
2023-02-15 00:56:17 -06:00
|
|
|
filePath->setPath( newFilePath );
|
2018-01-08 03:37:57 -06:00
|
|
|
}
|
2016-08-24 01:30:12 -05:00
|
|
|
|
2013-10-24 02:50:16 -05:00
|
|
|
wellPathImport->updateFilePaths();
|
2023-02-16 13:05:12 -06:00
|
|
|
auto* wellPathColl = RimTools::wellPathCollection();
|
|
|
|
if ( wellPathColl )
|
|
|
|
{
|
|
|
|
for ( auto wellPath : wellPathColl->allWellPaths() )
|
|
|
|
{
|
|
|
|
if ( auto fileWellPath = dynamic_cast<RimFileWellPath*>( wellPath ) )
|
|
|
|
{
|
|
|
|
fileWellPath->updateFilePathsFromProjectPath( oldProjectPath, newProjectPath );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2013-05-08 03:41:56 -05:00
|
|
|
}
|
2013-04-08 05:01:40 -05:00
|
|
|
|
2020-04-08 07:30:38 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
void RimProject::assignCaseIdToSummaryCase( RimSummaryCase* summaryCase )
|
|
|
|
{
|
|
|
|
if ( summaryCase )
|
|
|
|
{
|
|
|
|
std::vector<RimSummaryCase*> summaryCases = allSummaryCases();
|
|
|
|
for ( RimSummaryCase* s : summaryCases )
|
|
|
|
{
|
|
|
|
m_nextValidSummaryCaseId = std::max( m_nextValidSummaryCaseId, s->caseId() + 1 );
|
|
|
|
}
|
|
|
|
|
|
|
|
summaryCase->setCaseId( m_nextValidSummaryCaseId++ );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-04-08 09:17:47 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
void RimProject::assignIdToEnsemble( RimSummaryCaseCollection* summaryCaseCollection )
|
|
|
|
{
|
|
|
|
if ( summaryCaseCollection )
|
|
|
|
{
|
|
|
|
std::vector<RimSummaryCaseCollection*> summaryGroups = RimProject::summaryGroups();
|
|
|
|
for ( RimSummaryCaseCollection* s : summaryGroups )
|
|
|
|
{
|
|
|
|
m_nextValidEnsembleId = std::max( m_nextValidEnsembleId, s->ensembleId() + 1 );
|
|
|
|
}
|
|
|
|
|
|
|
|
summaryCaseCollection->setEnsembleId( m_nextValidEnsembleId );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-04-30 13:51:25 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
std::vector<RimCase*> RimProject::allGridCases() const
|
|
|
|
{
|
|
|
|
std::vector<RimCase*> cases;
|
|
|
|
|
|
|
|
// TODO: Move code from allCases here
|
|
|
|
allCases( cases );
|
|
|
|
|
|
|
|
return cases;
|
|
|
|
}
|
|
|
|
|
2013-05-08 03:41:56 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2013-05-08 03:41:56 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
void RimProject::assignCaseIdToCase( RimCase* reservoirCase )
|
2013-05-08 03:41:56 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( reservoirCase )
|
2013-05-08 03:41:56 -05:00
|
|
|
{
|
2023-08-04 02:04:14 -05:00
|
|
|
std::vector<RimCase*> cases = descendantsIncludingThisOfType<RimCase>();
|
2019-10-09 02:21:28 -05:00
|
|
|
for ( RimCase* rimCase : cases )
|
|
|
|
{
|
2019-10-18 08:32:20 -05:00
|
|
|
m_nextValidCaseId = std::max( m_nextValidCaseId, rimCase->caseId() + 1 );
|
2019-10-09 02:21:28 -05:00
|
|
|
}
|
|
|
|
|
2022-08-18 00:12:23 -05:00
|
|
|
reservoirCase->setCaseId( m_nextValidCaseId++ );
|
2013-05-08 03:41:56 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-05-10 08:35:33 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2013-05-10 08:35:33 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
void RimProject::assignIdToCaseGroup( RimIdenticalGridCaseGroup* caseGroup )
|
2013-05-10 08:35:33 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( caseGroup )
|
2013-05-10 08:35:33 -05:00
|
|
|
{
|
2023-08-04 02:04:14 -05:00
|
|
|
std::vector<RimIdenticalGridCaseGroup*> identicalCaseGroups = descendantsIncludingThisOfType<RimIdenticalGridCaseGroup>();
|
2019-10-09 02:21:28 -05:00
|
|
|
|
|
|
|
for ( RimIdenticalGridCaseGroup* existingCaseGroup : identicalCaseGroups )
|
|
|
|
{
|
2019-10-18 08:32:20 -05:00
|
|
|
m_nextValidCaseGroupId = std::max( m_nextValidCaseGroupId, existingCaseGroup->groupId() + 1 );
|
2019-10-09 02:21:28 -05:00
|
|
|
}
|
|
|
|
|
2019-10-18 08:32:20 -05:00
|
|
|
caseGroup->groupId = m_nextValidCaseGroupId++;
|
2013-05-10 08:35:33 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-07-15 04:43:22 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-11-14 13:48:11 -06:00
|
|
|
void RimProject::assignViewIdToView( Rim3dView* view )
|
2019-07-15 04:43:22 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( view )
|
2019-07-15 04:43:22 -05:00
|
|
|
{
|
2022-06-13 06:54:55 -05:00
|
|
|
if ( m_nextValidViewId < 0 )
|
2019-10-09 02:21:28 -05:00
|
|
|
{
|
2023-08-04 02:04:14 -05:00
|
|
|
std::vector<Rim3dView*> views = descendantsIncludingThisOfType<Rim3dView>();
|
2022-06-13 06:54:55 -05:00
|
|
|
|
|
|
|
for ( Rim3dView* existingView : views )
|
|
|
|
{
|
|
|
|
m_nextValidViewId = std::max( m_nextValidViewId, existingView->id() + 1 );
|
|
|
|
}
|
2019-10-09 02:21:28 -05:00
|
|
|
}
|
|
|
|
|
2019-10-18 08:32:20 -05:00
|
|
|
view->setId( m_nextValidViewId++ );
|
2019-07-15 04:43:22 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-11-14 13:48:11 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
void RimProject::assignPlotIdToPlotWindow( RimPlotWindow* plotWindow )
|
|
|
|
{
|
|
|
|
if ( plotWindow )
|
|
|
|
{
|
2022-06-13 06:54:55 -05:00
|
|
|
if ( m_nextValidPlotId < 0 )
|
2019-11-14 13:48:11 -06:00
|
|
|
{
|
2023-08-04 02:04:14 -05:00
|
|
|
std::vector<RimPlotWindow*> plotWindows = descendantsIncludingThisOfType<RimPlotWindow>();
|
2022-06-13 06:54:55 -05:00
|
|
|
|
|
|
|
for ( RimPlotWindow* existingPlotWindow : plotWindows )
|
|
|
|
{
|
|
|
|
m_nextValidPlotId = std::max( m_nextValidPlotId, existingPlotWindow->id() + 1 );
|
|
|
|
}
|
2019-11-14 13:48:11 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
plotWindow->setId( m_nextValidPlotId++ );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-05-08 03:41:56 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2020-04-30 13:51:25 -05:00
|
|
|
/// TODO: This function is deprecated, use allGridCases()
|
2013-05-08 03:41:56 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
void RimProject::allCases( std::vector<RimCase*>& cases ) const
|
2013-05-08 03:41:56 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -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];
|
2019-09-06 03:40:57 -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();
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( analysisModels )
|
2013-05-08 03:41:56 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
for ( size_t caseIdx = 0; caseIdx < analysisModels->cases.size(); caseIdx++ )
|
2015-05-15 11:51:49 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
cases.push_back( analysisModels->cases[caseIdx] );
|
2015-05-15 11:51:49 -05:00
|
|
|
}
|
2019-09-06 03:40:57 -05:00
|
|
|
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];
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( cg == nullptr ) continue;
|
2015-05-15 11:51:49 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( cg->statisticsCaseCollection() )
|
2015-05-15 11:51:49 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
for ( size_t caseIdx = 0; caseIdx < cg->statisticsCaseCollection()->reservoirs.size(); caseIdx++ )
|
2015-05-18 08:23:51 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
cases.push_back( cg->statisticsCaseCollection()->reservoirs[caseIdx] );
|
2015-05-18 08:23:51 -05:00
|
|
|
}
|
2015-05-15 11:51:49 -05:00
|
|
|
}
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( cg->caseCollection() )
|
2015-05-15 11:51:49 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
for ( size_t caseIdx = 0; caseIdx < cg->caseCollection()->reservoirs.size(); caseIdx++ )
|
2015-05-18 08:23:51 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
cases.push_back( cg->caseCollection()->reservoirs[caseIdx] );
|
2015-05-18 08:23:51 -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
|
|
|
}
|
2013-06-06 08:07:31 -05:00
|
|
|
|
2015-05-15 11:51:49 -05:00
|
|
|
RimGeoMechModels* geomModels = oilField->geoMechModels();
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( geomModels )
|
2015-05-15 11:51:49 -05:00
|
|
|
{
|
2020-09-10 05:54:43 -05:00
|
|
|
for ( auto acase : geomModels->cases() )
|
2013-06-06 08:07:31 -05:00
|
|
|
{
|
2020-09-10 05:54:43 -05:00
|
|
|
cases.push_back( acase );
|
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
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -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;
|
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
for ( RimOilField* oilField : oilFields )
|
2016-05-31 06:42:27 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( !oilField ) continue;
|
2017-09-06 09:32:46 -05:00
|
|
|
RimSummaryCaseMainCollection* sumCaseMainColl = oilField->summaryCaseMainCollection();
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( sumCaseMainColl )
|
2016-05-31 06:42:27 -05:00
|
|
|
{
|
2017-09-07 07:13:51 -05:00
|
|
|
std::vector<RimSummaryCase*> allSummaryCases = sumCaseMainColl->allSummaryCases();
|
2022-05-11 03:47:12 -05:00
|
|
|
if ( !allSummaryCases.empty() )
|
|
|
|
{
|
|
|
|
sumCases.insert( sumCases.end(), allSummaryCases.begin(), allSummaryCases.end() );
|
|
|
|
}
|
2017-09-28 07:42:06 -05:00
|
|
|
}
|
|
|
|
|
2022-05-11 03:47:12 -05:00
|
|
|
auto& observedDataColl = oilField->observedDataCollection();
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( observedDataColl != nullptr && observedDataColl->allObservedSummaryData().size() > 0 )
|
2017-09-28 07:42:06 -05:00
|
|
|
{
|
2019-08-20 08:09:13 -05:00
|
|
|
auto observedData = observedDataColl->allObservedSummaryData();
|
2019-09-06 03:40:57 -05:00
|
|
|
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
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2018-04-06 01:16:14 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
std::vector<RimSummaryCaseCollection*> RimProject::summaryGroups() const
|
|
|
|
{
|
|
|
|
std::vector<RimSummaryCaseCollection*> groups;
|
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
for ( RimOilField* oilField : oilFields )
|
2018-04-06 01:16:14 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( !oilField ) continue;
|
2018-04-06 01:16:14 -05:00
|
|
|
RimSummaryCaseMainCollection* sumCaseMainColl = oilField->summaryCaseMainCollection();
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( sumCaseMainColl )
|
2018-04-06 01:16:14 -05:00
|
|
|
{
|
|
|
|
std::vector<RimSummaryCaseCollection*> g = sumCaseMainColl->summaryCaseCollections();
|
2019-09-06 03:40:57 -05:00
|
|
|
groups.insert( groups.end(), g.begin(), g.end() );
|
2018-04-06 01:16:14 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return groups;
|
|
|
|
}
|
|
|
|
|
2018-06-25 08:14:47 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2018-06-25 08:14:47 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
RimSummaryCaseMainCollection* RimProject::firstSummaryCaseMainCollection() const
|
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( oilFields.empty() ) return nullptr;
|
2018-06-25 08:14:47 -05:00
|
|
|
return oilFields[0]->summaryCaseMainCollection;
|
|
|
|
}
|
|
|
|
|
2017-09-18 13:27:20 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2015-09-07 06:33:27 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2022-11-24 03:46:54 -06:00
|
|
|
void RimProject::allNotLinkedViews( std::vector<Rim3dView*>& views )
|
2015-09-07 06:33:27 -05:00
|
|
|
{
|
|
|
|
std::vector<RimCase*> cases;
|
2019-09-06 03:40:57 -05:00
|
|
|
allCases( cases );
|
2015-09-07 06:33:27 -05:00
|
|
|
|
2022-11-24 03:46:54 -06:00
|
|
|
std::vector<Rim3dView*> alreadyLinkedViews;
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( viewLinkerCollection->viewLinker() )
|
2015-09-07 06:33:27 -05:00
|
|
|
{
|
2022-11-04 09:48:25 -05:00
|
|
|
alreadyLinkedViews = viewLinkerCollection->viewLinker()->allViews();
|
2015-09-07 06:33:27 -05:00
|
|
|
}
|
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
for ( size_t caseIdx = 0; caseIdx < cases.size(); caseIdx++ )
|
2015-09-07 06:33:27 -05:00
|
|
|
{
|
|
|
|
RimCase* rimCase = cases[caseIdx];
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( !rimCase ) continue;
|
2015-09-07 06:33:27 -05:00
|
|
|
|
2018-01-09 03:11:28 -06:00
|
|
|
std::vector<Rim3dView*> caseViews = rimCase->views();
|
2019-09-06 03:40:57 -05:00
|
|
|
for ( size_t viewIdx = 0; viewIdx < caseViews.size(); viewIdx++ )
|
2015-09-07 06:33:27 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
RimGridView* gridView = dynamic_cast<RimGridView*>( caseViews[viewIdx] );
|
|
|
|
|
|
|
|
if ( !gridView ) continue;
|
2018-01-15 07:52:22 -06:00
|
|
|
|
2015-09-07 06:33:27 -05:00
|
|
|
bool isLinked = false;
|
2019-09-06 03:40:57 -05:00
|
|
|
for ( size_t lnIdx = 0; lnIdx < alreadyLinkedViews.size(); lnIdx++ )
|
2015-09-07 06:33:27 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( gridView == alreadyLinkedViews[lnIdx] )
|
2015-09-07 06:33:27 -05:00
|
|
|
{
|
|
|
|
isLinked = true;
|
|
|
|
}
|
|
|
|
}
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( !isLinked )
|
2015-09-07 06:33:27 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
views.push_back( gridView );
|
2015-09-07 06:33:27 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-10-11 02:47:30 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
void RimProject::allViews( std::vector<Rim3dView*>& views ) const
|
|
|
|
{
|
|
|
|
std::vector<RimCase*> cases;
|
|
|
|
allCases( cases );
|
|
|
|
|
|
|
|
for ( size_t caseIdx = 0; caseIdx < cases.size(); caseIdx++ )
|
|
|
|
{
|
|
|
|
RimCase* rimCase = cases[caseIdx];
|
|
|
|
if ( !rimCase ) continue;
|
|
|
|
|
|
|
|
std::vector<Rim3dView*> caseViews = rimCase->views();
|
|
|
|
for ( size_t viewIdx = 0; viewIdx < caseViews.size(); viewIdx++ )
|
|
|
|
{
|
|
|
|
if ( caseViews[viewIdx] )
|
|
|
|
{
|
|
|
|
views.push_back( caseViews[viewIdx] );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2023-08-07 09:35:59 -05:00
|
|
|
|
|
|
|
for ( size_t oilFieldIdx = 0; oilFieldIdx < oilFields().size(); oilFieldIdx++ )
|
|
|
|
{
|
|
|
|
RimOilField* oilField = oilFields[oilFieldIdx];
|
|
|
|
if ( !oilField ) continue;
|
|
|
|
if ( !oilField->seismicViewCollection() ) continue;
|
|
|
|
|
|
|
|
for ( auto seisview : oilField->seismicViewCollection()->views() )
|
|
|
|
{
|
|
|
|
views.push_back( seisview );
|
|
|
|
}
|
|
|
|
}
|
2019-10-11 02:47:30 -05:00
|
|
|
}
|
|
|
|
|
2015-08-30 06:30:46 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2015-08-30 06:30:46 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
void RimProject::allVisibleViews( std::vector<Rim3dView*>& views ) const
|
2015-08-30 06:30:46 -05:00
|
|
|
{
|
|
|
|
std::vector<RimCase*> cases;
|
2019-09-06 03:40:57 -05:00
|
|
|
allCases( cases );
|
|
|
|
|
|
|
|
for ( size_t caseIdx = 0; caseIdx < cases.size(); caseIdx++ )
|
2015-08-30 06:30:46 -05:00
|
|
|
{
|
|
|
|
RimCase* rimCase = cases[caseIdx];
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( !rimCase ) continue;
|
2015-08-30 06:30:46 -05:00
|
|
|
|
2018-01-09 03:11:28 -06:00
|
|
|
std::vector<Rim3dView*> caseViews = rimCase->views();
|
2019-09-06 03:40:57 -05:00
|
|
|
for ( size_t viewIdx = 0; viewIdx < caseViews.size(); viewIdx++ )
|
2015-08-30 06:30:46 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( caseViews[viewIdx] && caseViews[viewIdx]->viewer() )
|
2015-08-30 06:30:46 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
views.push_back( caseViews[viewIdx] );
|
2015-08-30 06:30:46 -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
|
|
|
|
2018-01-15 07:52:22 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2018-01-15 07:52:22 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
void RimProject::allVisibleGridViews( std::vector<RimGridView*>& views ) const
|
2018-01-15 07:52:22 -06:00
|
|
|
{
|
|
|
|
std::vector<Rim3dView*> visibleViews;
|
2023-08-04 02:04:14 -05:00
|
|
|
allVisibleViews( visibleViews );
|
2018-01-15 07:52:22 -06:00
|
|
|
for ( Rim3dView* view : visibleViews )
|
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
RimGridView* gridView = dynamic_cast<RimGridView*>( view );
|
|
|
|
if ( gridView ) views.push_back( gridView );
|
2018-01-15 07:52:22 -06: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
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -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
|
|
|
//--------------------------------------------------------------------------------------------------
|
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;
|
2019-09-06 03:40:57 -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];
|
2019-09-06 03:40:57 -05: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
|
|
|
|
2019-09-06 03:40:57 -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
|
|
|
}
|
|
|
|
}
|
2023-08-07 09:35:59 -05:00
|
|
|
|
|
|
|
for ( auto seisview : activeOilField()->seismicViewCollection()->views() )
|
|
|
|
{
|
|
|
|
seisview->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
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2017-09-18 07:49:31 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -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();
|
2023-08-04 02:04:14 -05:00
|
|
|
for ( const auto& oilField : oilFields )
|
2017-09-18 07:49:31 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -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()
|
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
CVF_ASSERT( oilFields.size() == 1 );
|
|
|
|
|
2013-06-12 02:36:50 -05:00
|
|
|
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.
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
const RimOilField* RimProject::activeOilField() const
|
2017-05-31 09:16:28 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
CVF_ASSERT( oilFields.size() == 1 );
|
|
|
|
|
2017-05-31 09:16:28 -05:00
|
|
|
return oilFields[0];
|
|
|
|
}
|
|
|
|
|
2013-06-06 08:07:31 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -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;
|
2019-09-06 03:40:57 -05:00
|
|
|
allCases( cases );
|
2013-05-31 06:57:16 -05:00
|
|
|
|
|
|
|
cvf::BoundingBox projectBB;
|
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
for ( size_t i = 0; i < cases.size(); i++ )
|
2013-05-31 06:57:16 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
RimEclipseCase* rimCase = dynamic_cast<RimEclipseCase*>( cases[i] );
|
2013-05-31 06:57:16 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( rimCase && rimCase->eclipseCaseData() )
|
2013-05-31 06:57:16 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
for ( size_t gridIdx = 0; gridIdx < rimCase->eclipseCaseData()->gridCount(); gridIdx++ )
|
2013-05-31 06:57:16 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
RigGridBase* rigGrid = rimCase->eclipseCaseData()->grid( gridIdx );
|
2013-05-31 06:57:16 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
projectBB.add( rigGrid->boundingBox() );
|
2013-05-31 06:57:16 -05:00
|
|
|
}
|
|
|
|
}
|
2015-05-15 11:51:49 -05:00
|
|
|
else
|
|
|
|
{
|
|
|
|
// Todo : calculate BBox of GeoMechCase
|
|
|
|
}
|
2013-05-31 06:57:16 -05:00
|
|
|
}
|
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( projectBB.isValid() )
|
2013-05-31 06:57:16 -05:00
|
|
|
{
|
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;
|
2019-09-06 03:40:57 -05:00
|
|
|
wellPathImport->east = east;
|
|
|
|
wellPathImport->west = west;
|
2013-05-31 06:57:16 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-08-06 04:00:21 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2015-08-06 04:00:21 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -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
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
menuBuilder.appendToMenu( &contextMenu );
|
2015-08-06 04:00:21 -05:00
|
|
|
}
|
|
|
|
|
2015-08-18 09:36:37 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -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;
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2016-10-04 07:23:34 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
bool RimProject::showPlotWindow() const
|
|
|
|
{
|
|
|
|
return m_showPlotWindow;
|
|
|
|
}
|
|
|
|
|
2023-03-09 01:54:28 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
bool RimProject::showPlotWindowOnTop() const
|
|
|
|
{
|
|
|
|
return m_showPlotWindowOnTopOf3DWindow();
|
|
|
|
}
|
|
|
|
|
2019-04-02 12:18:00 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2022-10-31 07:26:26 -05:00
|
|
|
RiaDefines::WindowTileMode RimProject::subWindowsTileMode3DWindow() const
|
2019-04-02 12:18:00 -05:00
|
|
|
{
|
2022-10-31 07:26:26 -05:00
|
|
|
return m_subWindowsTileMode3DWindow();
|
2019-04-02 12:18:00 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2022-10-31 07:26:26 -05:00
|
|
|
RiaDefines::WindowTileMode RimProject::subWindowsTileModePlotWindow() const
|
2019-04-02 12:18:00 -05:00
|
|
|
{
|
2022-10-31 07:26:26 -05:00
|
|
|
return m_subWindowsTileModePlotWindow();
|
2019-04-02 12:18:00 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2022-10-31 07:26:26 -05:00
|
|
|
void RimProject::setSubWindowsTileMode3DWindow( RiaDefines::WindowTileMode tileMode )
|
2019-04-02 12:18:00 -05:00
|
|
|
{
|
2022-10-31 07:26:26 -05:00
|
|
|
m_subWindowsTileMode3DWindow = tileMode;
|
2019-04-02 12:18:00 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2022-10-31 07:26:26 -05:00
|
|
|
void RimProject::setSubWindowsTileModePlotWindow( RiaDefines::WindowTileMode tileMode )
|
2019-04-02 12:18:00 -05:00
|
|
|
{
|
2022-10-31 07:26:26 -05:00
|
|
|
m_subWindowsTileModePlotWindow = tileMode;
|
2019-04-02 12:18:00 -05:00
|
|
|
}
|
|
|
|
|
2017-05-31 09:16:28 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2017-05-31 09:16:28 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2017-06-02 03:35:52 -05:00
|
|
|
void RimProject::reloadCompletionTypeResultsInAllViews()
|
|
|
|
{
|
2022-05-05 04:29:07 -05:00
|
|
|
RiaCompletionTypeCalculationScheduler::instance()->clearCompletionTypeResultsInAllCases();
|
2018-09-11 05:41:45 -05:00
|
|
|
scheduleCreateDisplayModelAndRedrawAllViews();
|
2018-10-03 08:57:09 -05:00
|
|
|
|
2022-08-19 07:30:25 -05:00
|
|
|
m_mainPlotCollection()->scheduleUpdatePlotsWithCompletions();
|
2017-06-21 04:06:38 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -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
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2017-10-11 06:52:29 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
std::vector<RimEclipseCase*> RimProject::eclipseCases() const
|
|
|
|
{
|
|
|
|
std::vector<RimEclipseCase*> allCases;
|
2019-09-06 03:40:57 -05:00
|
|
|
for ( const auto& oilField : oilFields )
|
2017-10-11 06:52:29 -05:00
|
|
|
{
|
|
|
|
const auto& cases = oilField->analysisModels->cases;
|
2019-09-06 03:40:57 -05:00
|
|
|
allCases.insert( allCases.end(), cases.begin(), cases.end() );
|
2017-10-11 06:52:29 -05:00
|
|
|
}
|
|
|
|
return allCases;
|
|
|
|
}
|
|
|
|
|
2018-04-13 04:11:05 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2018-04-13 04:11:05 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
RimEclipseCase* RimProject::eclipseCaseFromGridFileName( const QString& gridFileName ) const
|
2018-04-13 04:11:05 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
for ( RimEclipseCase* eclCase : eclipseCases() )
|
2018-04-13 04:11:05 -05:00
|
|
|
{
|
2023-02-26 03:48:40 -06:00
|
|
|
if ( RiaFilePathTools::toInternalSeparator( eclCase->gridFileName() ) == RiaFilePathTools::toInternalSeparator( gridFileName ) )
|
2018-04-13 04:11:05 -05:00
|
|
|
{
|
|
|
|
return eclCase;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
|
2021-05-18 07:28:54 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
RimEclipseCase* RimProject::eclipseCaseFromCaseId( const int caseId ) const
|
|
|
|
{
|
|
|
|
for ( RimEclipseCase* eclCase : eclipseCases() )
|
|
|
|
{
|
|
|
|
if ( eclCase->caseId() == caseId )
|
|
|
|
{
|
|
|
|
return eclCase;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
|
2017-10-11 06:52:29 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2017-10-11 06:52:29 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
std::vector<QString> RimProject::simulationWellNames() const
|
|
|
|
{
|
|
|
|
std::set<QString> wellNames;
|
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
for ( RimOilField* oilField : oilFields )
|
2017-10-11 06:52:29 -05:00
|
|
|
{
|
|
|
|
auto analysisCaseColl = oilField->analysisModels();
|
2019-09-06 03:40:57 -05:00
|
|
|
for ( RimEclipseCase* eclCase : analysisCaseColl->cases() )
|
2017-10-11 06:52:29 -05:00
|
|
|
{
|
|
|
|
const auto& eclData = eclCase->eclipseCaseData();
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( eclData == nullptr ) continue;
|
2017-10-11 06:52:29 -05:00
|
|
|
|
|
|
|
const auto names = eclData->simulationWellNames();
|
2019-09-06 03:40:57 -05:00
|
|
|
wellNames.insert( names.begin(), names.end() );
|
2017-10-11 06:52:29 -05:00
|
|
|
}
|
|
|
|
}
|
2019-09-06 03:40:57 -05:00
|
|
|
return std::vector<QString>( wellNames.begin(), wellNames.end() );
|
2017-10-11 06:52:29 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2017-10-11 06:52:29 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
RimWellPath* RimProject::wellPathFromSimWellName( const QString& simWellName, int branchIndex )
|
2017-10-11 06:52:29 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
for ( RimWellPath* const path : allWellPaths() )
|
2017-10-11 06:52:29 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( QString::compare( path->associatedSimulationWellName(), simWellName ) == 0 &&
|
|
|
|
( 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
|
|
|
}
|
|
|
|
}
|
2023-08-15 06:37:23 -05:00
|
|
|
|
|
|
|
for ( RimWellPath* const path : allWellPaths() )
|
|
|
|
{
|
|
|
|
if ( QString::compare( path->name(), simWellName ) == 0 )
|
|
|
|
{
|
|
|
|
return path;
|
|
|
|
}
|
|
|
|
}
|
2017-10-11 06:52:29 -05:00
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
|
2017-10-25 02:55:00 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2017-10-25 02:55:00 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
RimWellPath* RimProject::wellPathByName( const QString& wellPathName ) const
|
2017-11-08 09:35:58 -06:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
for ( RimWellPath* const path : allWellPaths() )
|
2017-11-08 09:35:58 -06:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( path->name() == wellPathName ) return path;
|
2017-11-08 09:35:58 -06:00
|
|
|
}
|
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2017-11-08 09:35:58 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2017-10-25 02:55:00 -05:00
|
|
|
std::vector<RimWellPath*> RimProject::allWellPaths() const
|
|
|
|
{
|
2020-10-06 08:00:39 -05:00
|
|
|
std::vector<RimWellPath*> wellPaths;
|
2019-09-06 03:40:57 -05:00
|
|
|
for ( const auto& oilField : oilFields() )
|
2017-10-25 02:55:00 -05:00
|
|
|
{
|
|
|
|
auto wellPathColl = oilField->wellPathCollection();
|
2020-10-07 09:18:24 -05:00
|
|
|
for ( auto wellPath : wellPathColl->allWellPaths() )
|
2017-10-25 02:55:00 -05:00
|
|
|
{
|
2020-10-06 08:00:39 -05:00
|
|
|
wellPaths.push_back( wellPath );
|
2017-10-25 02:55:00 -05:00
|
|
|
}
|
|
|
|
}
|
2020-10-06 08:00:39 -05:00
|
|
|
return wellPaths;
|
2017-10-25 02:55:00 -05:00
|
|
|
}
|
|
|
|
|
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
|
2019-09-06 03:40:57 -05:00
|
|
|
for ( const auto& oilField : oilFields() )
|
2018-11-23 06:33:59 -06:00
|
|
|
{
|
|
|
|
auto annotationColl = oilField->annotationCollection();
|
2019-09-06 03:40:57 -05:00
|
|
|
for ( const auto& annotation : annotationColl->textAnnotations() )
|
2018-11-23 06:33:59 -06:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
annotations.push_back( annotation );
|
2018-11-23 06:33:59 -06:00
|
|
|
}
|
|
|
|
}
|
2018-11-26 07:48:06 -06:00
|
|
|
|
|
|
|
// 'Local' text annotations
|
|
|
|
std::vector<RimGridView*> visibleViews;
|
2019-09-06 03:40:57 -05:00
|
|
|
allVisibleGridViews( visibleViews );
|
|
|
|
for ( const auto& view : visibleViews )
|
2018-11-26 07:48:06 -06:00
|
|
|
{
|
2023-05-12 14:41:34 -05:00
|
|
|
std::vector<RimAnnotationInViewCollection*> annotationColls = view->descendantsIncludingThisOfType<RimAnnotationInViewCollection>();
|
2018-11-26 07:48:06 -06:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( annotationColls.size() == 1 )
|
2018-11-26 07:48:06 -06:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
for ( const auto& annotation : annotationColls.front()->textAnnotations() )
|
2018-11-26 07:48:06 -06:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
annotations.push_back( annotation );
|
2018-11-26 07:48:06 -06:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-11-23 06:33:59 -06:00
|
|
|
return annotations;
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
std::vector<RimReachCircleAnnotation*> RimProject::reachCircleAnnotations() const
|
|
|
|
{
|
|
|
|
std::vector<RimReachCircleAnnotation*> annotations;
|
2019-09-06 03:40:57 -05:00
|
|
|
for ( const auto& oilField : oilFields() )
|
2018-11-23 06:33:59 -06:00
|
|
|
{
|
|
|
|
auto annotationColl = oilField->annotationCollection();
|
2019-09-06 03:40:57 -05:00
|
|
|
for ( const auto& annotation : annotationColl->reachCircleAnnotations() )
|
2018-11-23 06:33:59 -06:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
annotations.push_back( annotation );
|
2018-11-23 06:33:59 -06:00
|
|
|
}
|
|
|
|
}
|
|
|
|
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;
|
2019-09-06 03:40:57 -05:00
|
|
|
for ( const auto& oilField : oilFields() )
|
2018-11-23 06:33:59 -06:00
|
|
|
{
|
|
|
|
auto annotationColl = oilField->annotationCollection();
|
2019-09-06 03:40:57 -05:00
|
|
|
for ( const auto& annotation : annotationColl->userDefinedPolylineAnnotations() )
|
2018-11-23 06:33:59 -06:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
annotations.push_back( annotation );
|
2018-11-23 06:33:59 -06:00
|
|
|
}
|
2018-11-26 07:06:17 -06:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
for ( const auto& annotation : annotationColl->polylinesFromFileAnnotations() )
|
2018-11-26 07:06:17 -06:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
annotations.push_back( annotation );
|
2018-11-26 07:06:17 -06:00
|
|
|
}
|
2018-11-23 06:33:59 -06:00
|
|
|
}
|
|
|
|
return annotations;
|
|
|
|
}
|
|
|
|
|
2017-10-20 09:10:45 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2017-10-20 09:10:45 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
std::vector<RimGeoMechCase*> RimProject::geoMechCases() const
|
|
|
|
{
|
|
|
|
std::vector<RimGeoMechCase*> cases;
|
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
for ( size_t oilFieldIdx = 0; oilFieldIdx < oilFields().size(); oilFieldIdx++ )
|
2017-10-20 09:10:45 -05:00
|
|
|
{
|
|
|
|
RimOilField* oilField = oilFields[oilFieldIdx];
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( !oilField ) continue;
|
2017-10-20 09:10:45 -05:00
|
|
|
|
|
|
|
RimGeoMechModels* geomModels = oilField->geoMechModels();
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( geomModels )
|
2017-10-20 09:10:45 -05:00
|
|
|
{
|
2020-09-10 05:54:43 -05:00
|
|
|
for ( auto acase : geomModels->cases() )
|
2017-10-20 09:10:45 -05:00
|
|
|
{
|
2020-09-10 05:54:43 -05:00
|
|
|
cases.push_back( acase );
|
2017-10-20 09:10:45 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return cases;
|
|
|
|
}
|
|
|
|
|
2017-12-20 06:14:43 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2017-12-20 06:14:43 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
std::vector<RimFractureTemplateCollection*> RimProject::allFractureTemplateCollections() const
|
|
|
|
{
|
|
|
|
std::vector<RimFractureTemplateCollection*> templColls;
|
2019-09-06 03:40:57 -05:00
|
|
|
std::vector<RimOilField*> rimOilFields;
|
2017-12-20 06:14:43 -06:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
allOilFields( rimOilFields );
|
|
|
|
for ( RimOilField* oilField : rimOilFields )
|
2017-12-20 06:14:43 -06:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
templColls.push_back( oilField->fractureDefinitionCollection() );
|
2017-12-20 06:14:43 -06:00
|
|
|
}
|
|
|
|
return templColls;
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2017-12-20 06:14:43 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
std::vector<RimFractureTemplate*> RimProject::allFractureTemplates() const
|
|
|
|
{
|
|
|
|
std::vector<RimFractureTemplate*> templates;
|
2019-09-06 03:40:57 -05:00
|
|
|
for ( RimFractureTemplateCollection* templColl : allFractureTemplateCollections() )
|
2017-12-20 06:14:43 -06:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
for ( RimFractureTemplate* templ : templColl->fractureTemplates() )
|
2017-12-20 06:14:43 -06:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
templates.push_back( templ );
|
2017-12-20 06:14:43 -06:00
|
|
|
}
|
|
|
|
}
|
|
|
|
return templates;
|
|
|
|
}
|
|
|
|
|
2018-12-13 12:49:37 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
std::vector<RimValveTemplateCollection*> RimProject::allValveTemplateCollections() const
|
|
|
|
{
|
|
|
|
std::vector<RimValveTemplateCollection*> templColls;
|
|
|
|
std::vector<RimOilField*> rimOilFields;
|
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
allOilFields( rimOilFields );
|
|
|
|
for ( RimOilField* oilField : rimOilFields )
|
2018-12-13 12:49:37 -06:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
templColls.push_back( oilField->valveTemplateCollection() );
|
2018-12-13 12:49:37 -06:00
|
|
|
}
|
|
|
|
return templColls;
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
std::vector<RimValveTemplate*> RimProject::allValveTemplates() const
|
|
|
|
{
|
|
|
|
std::vector<RimValveTemplate*> templates;
|
2019-09-06 03:40:57 -05:00
|
|
|
for ( RimValveTemplateCollection* templColl : allValveTemplateCollections() )
|
2018-12-13 12:49:37 -06:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
for ( RimValveTemplate* templ : templColl->valveTemplates() )
|
2018-12-13 12:49:37 -06:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
templates.push_back( templ );
|
2018-12-13 12:49:37 -06:00
|
|
|
}
|
|
|
|
}
|
|
|
|
return templates;
|
|
|
|
}
|
|
|
|
|
2018-08-28 04:12:05 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2018-08-28 04:12:05 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2021-01-21 05:58:46 -06:00
|
|
|
caf::AppEnum<RiaDefines::EclipseUnitSystem> RimProject::commonUnitSystemForAllCases() const
|
2018-08-28 04:12:05 -05:00
|
|
|
{
|
|
|
|
std::vector<RimCase*> rimCases;
|
2019-09-06 03:40:57 -05:00
|
|
|
allCases( rimCases );
|
2018-08-28 04:12:05 -05:00
|
|
|
|
2021-01-21 05:58:46 -06:00
|
|
|
RiaDefines::EclipseUnitSystem commonUnitSystem = RiaDefines::EclipseUnitSystem::UNITS_UNKNOWN;
|
2018-08-28 04:12:05 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
for ( const auto& c : rimCases )
|
2018-08-28 04:12:05 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
auto eclipseCase = dynamic_cast<RimEclipseCase*>( c );
|
|
|
|
if ( eclipseCase && eclipseCase->eclipseCaseData() )
|
2018-08-28 04:12:05 -05:00
|
|
|
{
|
2021-01-21 05:58:46 -06:00
|
|
|
if ( commonUnitSystem == RiaDefines::EclipseUnitSystem::UNITS_UNKNOWN )
|
2018-08-28 04:12:05 -05:00
|
|
|
{
|
|
|
|
commonUnitSystem = eclipseCase->eclipseCaseData()->unitsType();
|
|
|
|
}
|
2019-09-06 03:40:57 -05:00
|
|
|
else if ( commonUnitSystem != eclipseCase->eclipseCaseData()->unitsType() )
|
2018-08-28 04:12:05 -05:00
|
|
|
{
|
2021-01-21 05:58:46 -06:00
|
|
|
commonUnitSystem = RiaDefines::EclipseUnitSystem::UNITS_UNKNOWN;
|
2018-08-28 04:12:05 -05:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return commonUnitSystem;
|
|
|
|
}
|
|
|
|
|
2018-12-19 07:41:17 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
RimMeasurement* RimProject::measurement() const
|
|
|
|
{
|
|
|
|
return activeOilField()->measurement;
|
|
|
|
}
|
|
|
|
|
2019-09-11 02:33:03 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2022-05-25 04:01:45 -05:00
|
|
|
RimPlotTemplateFolderItem* RimProject::rootPlotTemplateItem() const
|
2019-09-11 02:33:03 -05:00
|
|
|
{
|
2022-05-11 12:46:17 -05:00
|
|
|
return m_plotTemplateTopFolder;
|
2019-09-11 02:33:03 -05:00
|
|
|
}
|
|
|
|
|
2020-10-12 06:17:47 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
std::vector<caf::FilePath*> RimProject::allFilePaths() const
|
|
|
|
{
|
|
|
|
std::vector<caf::FilePath*> filePaths;
|
|
|
|
fieldContentsByType( this, filePaths );
|
|
|
|
|
|
|
|
return filePaths;
|
|
|
|
}
|
|
|
|
|
2017-06-02 03:35:52 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2017-06-21 04:06:38 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
void RimProject::reloadCompletionTypeResultsForEclipseCase( RimEclipseCase* eclipseCase )
|
2017-06-21 04:06:38 -05:00
|
|
|
{
|
2018-01-09 03:11:28 -06:00
|
|
|
std::vector<Rim3dView*> views = eclipseCase->views();
|
2017-06-21 04:06:38 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
for ( size_t viewIdx = 0; viewIdx < views.size(); viewIdx++ )
|
2017-06-21 04:06:38 -05:00
|
|
|
{
|
|
|
|
views[viewIdx]->scheduleCreateDisplayModelAndRedraw();
|
|
|
|
}
|
|
|
|
|
2022-11-18 05:50:04 -06:00
|
|
|
RiaCompletionTypeCalculationScheduler::instance()->scheduleRecalculateCompletionTypeAndRedrawAllViews( { eclipseCase } );
|
2017-05-31 09:16:28 -05:00
|
|
|
}
|
|
|
|
|
2015-08-06 08:55:17 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2015-08-06 08:55:17 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
void RimProject::defineUiTreeOrdering( caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName /*= ""*/ )
|
2015-08-06 08:55:17 -05:00
|
|
|
{
|
2022-01-28 06:19:52 -06:00
|
|
|
if ( uiConfigName == "PlotWindow.Plots" )
|
2015-09-07 07:01:19 -05:00
|
|
|
{
|
2022-08-19 07:30:25 -05:00
|
|
|
if ( m_mainPlotCollection )
|
2016-06-27 04:07:01 -05:00
|
|
|
{
|
2022-08-19 07:30:25 -05:00
|
|
|
if ( m_mainPlotCollection->summaryMultiPlotCollection() )
|
2022-03-04 03:52:17 -06:00
|
|
|
{
|
2022-08-19 07:30:25 -05:00
|
|
|
uiTreeOrdering.add( m_mainPlotCollection->summaryMultiPlotCollection() );
|
2022-03-04 03:52:17 -06:00
|
|
|
}
|
|
|
|
|
2022-08-19 07:30:25 -05:00
|
|
|
if ( m_mainPlotCollection->analysisPlotCollection() )
|
2020-02-12 09:48:25 -06:00
|
|
|
{
|
2022-08-19 07:30:25 -05:00
|
|
|
uiTreeOrdering.add( m_mainPlotCollection->analysisPlotCollection() );
|
2016-06-27 04:07:01 -05:00
|
|
|
}
|
2017-09-26 03:49:13 -05:00
|
|
|
|
2022-08-19 07:30:25 -05:00
|
|
|
if ( m_mainPlotCollection->correlationPlotCollection() )
|
2020-04-17 02:31:42 -05:00
|
|
|
{
|
2022-08-19 07:30:25 -05:00
|
|
|
uiTreeOrdering.add( m_mainPlotCollection->correlationPlotCollection() );
|
2020-04-17 02:31:42 -05:00
|
|
|
}
|
|
|
|
|
2022-08-19 07:30:25 -05:00
|
|
|
if ( m_mainPlotCollection->summaryCrossPlotCollection() )
|
2019-01-14 04:14:18 -06:00
|
|
|
{
|
2022-08-19 07:30:25 -05:00
|
|
|
uiTreeOrdering.add( m_mainPlotCollection->summaryCrossPlotCollection() );
|
2019-01-14 04:14:18 -06:00
|
|
|
}
|
|
|
|
|
2023-03-23 08:10:30 -05:00
|
|
|
if ( m_mainPlotCollection->summaryTableCollection() )
|
|
|
|
{
|
|
|
|
uiTreeOrdering.add( m_mainPlotCollection->summaryTableCollection() );
|
|
|
|
}
|
|
|
|
|
2022-08-19 07:30:25 -05:00
|
|
|
if ( m_mainPlotCollection->wellLogPlotCollection() )
|
2019-01-14 04:14:18 -06:00
|
|
|
{
|
2022-08-19 07:30:25 -05:00
|
|
|
uiTreeOrdering.add( m_mainPlotCollection->wellLogPlotCollection() );
|
2019-01-14 04:14:18 -06:00
|
|
|
}
|
|
|
|
|
2022-08-19 07:30:25 -05:00
|
|
|
if ( m_mainPlotCollection->rftPlotCollection() )
|
2019-01-14 04:14:18 -06:00
|
|
|
{
|
2022-08-19 07:30:25 -05:00
|
|
|
uiTreeOrdering.add( m_mainPlotCollection->rftPlotCollection() );
|
2019-01-14 04:14:18 -06:00
|
|
|
}
|
2017-11-07 13:40:45 -06:00
|
|
|
|
2022-08-19 07:30:25 -05:00
|
|
|
if ( m_mainPlotCollection->pltPlotCollection() )
|
2016-06-27 04:07:01 -05:00
|
|
|
{
|
2022-08-19 07:30:25 -05:00
|
|
|
uiTreeOrdering.add( m_mainPlotCollection->pltPlotCollection() );
|
2016-06-27 04:07:01 -05:00
|
|
|
}
|
2017-01-13 02:50:43 -06:00
|
|
|
|
2022-08-19 07:30:25 -05:00
|
|
|
if ( m_mainPlotCollection->flowPlotCollection() )
|
2017-01-13 02:50:43 -06:00
|
|
|
{
|
2022-08-19 07:30:25 -05:00
|
|
|
uiTreeOrdering.add( m_mainPlotCollection->flowPlotCollection() );
|
2017-01-13 02:50:43 -06:00
|
|
|
}
|
2019-02-21 05:52:23 -06:00
|
|
|
|
2022-08-19 07:30:25 -05:00
|
|
|
if ( m_mainPlotCollection->gridCrossPlotCollection() )
|
2019-02-21 05:52:23 -06:00
|
|
|
{
|
2022-08-19 07:30:25 -05:00
|
|
|
uiTreeOrdering.add( m_mainPlotCollection->gridCrossPlotCollection() );
|
2019-02-21 05:52:23 -06:00
|
|
|
}
|
2019-03-18 06:41:44 -05:00
|
|
|
|
2022-08-19 07:30:25 -05:00
|
|
|
if ( m_mainPlotCollection->saturationPressurePlotCollection() )
|
2019-03-18 06:41:44 -05:00
|
|
|
{
|
2022-08-19 07:30:25 -05:00
|
|
|
uiTreeOrdering.add( m_mainPlotCollection->saturationPressurePlotCollection() );
|
2019-03-18 06:41:44 -05:00
|
|
|
}
|
2019-10-31 07:48:40 -05:00
|
|
|
|
2022-08-19 07:30:25 -05:00
|
|
|
if ( m_mainPlotCollection->multiPlotCollection() )
|
2019-10-31 07:48:40 -05:00
|
|
|
{
|
2022-08-19 07:30:25 -05:00
|
|
|
uiTreeOrdering.add( m_mainPlotCollection->multiPlotCollection() );
|
2019-10-31 07:48:40 -05:00
|
|
|
}
|
2020-05-13 23:39:55 -05:00
|
|
|
|
2022-08-19 07:30:25 -05:00
|
|
|
if ( m_mainPlotCollection->stimPlanModelPlotCollection() )
|
2020-05-13 23:39:55 -05:00
|
|
|
{
|
2022-08-19 07:30:25 -05:00
|
|
|
uiTreeOrdering.add( m_mainPlotCollection->stimPlanModelPlotCollection() );
|
2020-05-13 23:39:55 -05:00
|
|
|
}
|
2020-11-13 03:56:25 -06:00
|
|
|
|
2022-08-19 07:30:25 -05:00
|
|
|
if ( m_mainPlotCollection->vfpPlotCollection() )
|
2020-11-13 03:56:25 -06:00
|
|
|
{
|
2022-08-19 07:30:25 -05:00
|
|
|
uiTreeOrdering.add( m_mainPlotCollection->vfpPlotCollection() );
|
2020-11-13 03:56:25 -06:00
|
|
|
}
|
2020-11-13 08:37:08 -06:00
|
|
|
#ifdef USE_QTCHARTS
|
2023-02-26 03:48:40 -06:00
|
|
|
if ( m_mainPlotCollection->gridStatisticsPlotCollection() || m_mainPlotCollection->ensembleFractureStatisticsPlotCollection() )
|
2020-11-13 08:37:08 -06:00
|
|
|
{
|
2022-01-28 06:19:52 -06:00
|
|
|
auto statisticsItemCollection = uiTreeOrdering.add( "Statistics Plots", ":/Folder.png" );
|
2022-08-19 07:30:25 -05:00
|
|
|
if ( m_mainPlotCollection->gridStatisticsPlotCollection() )
|
|
|
|
statisticsItemCollection->add( m_mainPlotCollection->gridStatisticsPlotCollection() );
|
2021-04-28 06:45:04 -05:00
|
|
|
|
2022-08-19 07:30:25 -05:00
|
|
|
if ( m_mainPlotCollection->ensembleFractureStatisticsPlotCollection() )
|
|
|
|
statisticsItemCollection->add( m_mainPlotCollection->ensembleFractureStatisticsPlotCollection() );
|
2020-11-13 08:37:08 -06:00
|
|
|
}
|
|
|
|
#endif
|
2016-06-27 04:07:01 -05:00
|
|
|
}
|
2022-01-28 06:19:52 -06:00
|
|
|
}
|
|
|
|
else if ( uiConfigName == "PlotWindow.DataSources" )
|
|
|
|
{
|
|
|
|
RimOilField* oilField = activeOilField();
|
|
|
|
if ( oilField )
|
|
|
|
{
|
|
|
|
if ( oilField->summaryCaseMainCollection() )
|
|
|
|
{
|
|
|
|
uiTreeOrdering.add( oilField->summaryCaseMainCollection() );
|
|
|
|
}
|
|
|
|
if ( oilField->observedDataCollection() )
|
|
|
|
{
|
|
|
|
uiTreeOrdering.add( oilField->observedDataCollection() );
|
|
|
|
}
|
|
|
|
if ( oilField->ensembleWellLogsCollection() )
|
|
|
|
{
|
|
|
|
uiTreeOrdering.add( oilField->ensembleWellLogsCollection() );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2022-05-11 12:17:46 -05:00
|
|
|
else if ( uiConfigName == "PlotWindow.Scripts" || uiConfigName == "MainWindow.Scripts" )
|
2022-01-28 06:19:52 -06:00
|
|
|
{
|
2020-04-01 06:31:40 -05:00
|
|
|
uiTreeOrdering.add( scriptCollection() );
|
2016-06-27 04:07:01 -05:00
|
|
|
}
|
2022-05-11 12:46:17 -05:00
|
|
|
else if ( uiConfigName == "PlotWindow.Templates" )
|
|
|
|
{
|
|
|
|
uiTreeOrdering.add( m_plotTemplateTopFolder );
|
|
|
|
}
|
2022-05-11 12:17:46 -05:00
|
|
|
else if ( uiConfigName == "MainWindow.DataSources" )
|
|
|
|
{
|
|
|
|
RimOilField* oilField = activeOilField();
|
|
|
|
if ( oilField )
|
|
|
|
{
|
|
|
|
if ( oilField->analysisModels() ) uiTreeOrdering.add( oilField->analysisModels() );
|
|
|
|
}
|
|
|
|
}
|
2016-06-27 04:07:01 -05:00
|
|
|
else
|
2015-08-28 05:10:36 -05:00
|
|
|
{
|
2022-06-13 06:54:55 -05:00
|
|
|
// Use object instead of field to avoid duplicate entries in the tree view
|
|
|
|
uiTreeOrdering.add( viewLinkerCollection() );
|
2016-06-27 04:07:01 -05:00
|
|
|
|
|
|
|
RimOilField* oilField = activeOilField();
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( oilField )
|
2016-05-09 05:13:54 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( oilField->analysisModels() ) uiTreeOrdering.add( oilField->analysisModels() );
|
|
|
|
if ( oilField->geoMechModels() ) uiTreeOrdering.add( oilField->geoMechModels() );
|
|
|
|
if ( oilField->wellPathCollection() ) uiTreeOrdering.add( oilField->wellPathCollection() );
|
2020-01-03 06:49:12 -06:00
|
|
|
if ( oilField->surfaceCollection() ) uiTreeOrdering.add( oilField->surfaceCollection() );
|
2023-08-07 09:35:59 -05:00
|
|
|
if ( oilField->seismicDataCollection() )
|
|
|
|
{
|
|
|
|
auto child = uiTreeOrdering.add( "Seismic", ":/Seismic16x16.png" );
|
|
|
|
child->add( oilField->seismicDataCollection() );
|
|
|
|
child->add( oilField->seismicViewCollection() );
|
|
|
|
}
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( oilField->formationNamesCollection() ) uiTreeOrdering.add( oilField->formationNamesCollection() );
|
2023-02-26 03:48:40 -06:00
|
|
|
if ( oilField->completionTemplateCollection() ) uiTreeOrdering.add( oilField->completionTemplateCollection() );
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( oilField->annotationCollection() ) uiTreeOrdering.add( oilField->annotationCollection() );
|
2016-05-09 05:13:54 -05:00
|
|
|
}
|
2015-08-06 08:55:17 -05:00
|
|
|
|
2020-04-30 09:54:25 -05:00
|
|
|
uiTreeOrdering.add( colorLegendCollection() );
|
2016-06-27 04:07:01 -05:00
|
|
|
}
|
2015-08-06 08:55:17 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
uiTreeOrdering.skipRemainingChildren( true );
|
|
|
|
}
|
2019-12-10 07:58:47 -06:00
|
|
|
|
2022-12-08 00:08:22 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
void RimProject::transferPathsToGlobalPathList()
|
2019-12-10 07:58:47 -06:00
|
|
|
{
|
2022-12-08 00:08:22 -06:00
|
|
|
RiaVariableMapper variableMapper( m_globalPathList() );
|
2019-12-10 07:58:47 -06:00
|
|
|
|
2022-12-08 00:08:22 -06:00
|
|
|
std::vector<caf::FilePath*> filePaths = allFilePaths();
|
|
|
|
for ( caf::FilePath* filePath : filePaths )
|
2019-12-10 07:58:47 -06:00
|
|
|
{
|
2022-12-08 00:08:22 -06:00
|
|
|
QString path = filePath->path();
|
|
|
|
if ( !path.isEmpty() )
|
2019-12-10 07:58:47 -06:00
|
|
|
{
|
2022-12-08 00:08:22 -06:00
|
|
|
QString pathId = variableMapper.addPathAndGetId( path );
|
|
|
|
filePath->setPath( pathId );
|
2019-12-10 07:58:47 -06:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-12-08 00:08:22 -06:00
|
|
|
for ( auto summaryCase : allSummaryCases() )
|
2019-12-10 07:58:47 -06:00
|
|
|
{
|
2022-12-08 00:08:22 -06:00
|
|
|
if ( summaryCase->displayNameType() == RimCaseDisplayNameTools::DisplayName::CUSTOM )
|
2019-12-10 07:58:47 -06:00
|
|
|
{
|
2023-02-16 13:05:12 -06:00
|
|
|
// At this point, after the replace of variables into caf::FilePath objects, the variable name is
|
|
|
|
// stored in the summary case object. Read out the variable name and append "_name" for custom
|
|
|
|
// summary variables.
|
2019-12-10 07:58:47 -06:00
|
|
|
|
2022-12-08 00:08:22 -06:00
|
|
|
QString variableName = summaryCase->summaryHeaderFilename();
|
|
|
|
variableName = variableName.remove( RiaVariableMapper::variableToken() );
|
2019-12-10 07:58:47 -06:00
|
|
|
|
2022-12-08 00:08:22 -06:00
|
|
|
variableName = RiaVariableMapper::variableToken() + variableName + RiaVariableMapper::postfixName() +
|
|
|
|
RiaVariableMapper::variableToken();
|
2019-12-10 07:58:47 -06:00
|
|
|
|
2022-12-08 00:08:22 -06:00
|
|
|
QString variableValue = summaryCase->displayCaseName();
|
|
|
|
variableMapper.addVariable( variableName, variableValue );
|
2019-12-10 07:58:47 -06:00
|
|
|
|
2022-12-08 00:08:22 -06:00
|
|
|
summaryCase->setCustomCaseName( variableName );
|
2019-12-10 07:58:47 -06:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-12-08 00:08:22 -06:00
|
|
|
for ( auto gridCase : allGridCases() )
|
2019-12-10 07:58:47 -06:00
|
|
|
{
|
2022-12-08 00:08:22 -06:00
|
|
|
if ( gridCase->displayNameType() == RimCaseDisplayNameTools::DisplayName::CUSTOM )
|
|
|
|
{
|
2023-02-16 13:05:12 -06:00
|
|
|
// At this point, after the replace of variables into caf::FilePath objects, the variable name is
|
|
|
|
// stored in the summary case object. Read out the variable name and append "_name" for custom
|
|
|
|
// summary variables.
|
2019-12-10 07:58:47 -06:00
|
|
|
|
2022-12-08 00:08:22 -06:00
|
|
|
QString variableName = gridCase->gridFileName();
|
|
|
|
variableName = variableName.remove( RiaVariableMapper::variableToken() );
|
2019-12-10 07:58:47 -06:00
|
|
|
|
2022-12-08 00:08:22 -06:00
|
|
|
variableName = RiaVariableMapper::variableToken() + variableName + RiaVariableMapper::postfixName() +
|
|
|
|
RiaVariableMapper::variableToken();
|
2019-12-10 07:58:47 -06:00
|
|
|
|
2022-12-08 00:08:22 -06:00
|
|
|
QString variableValue = gridCase->caseUserDescription();
|
|
|
|
variableMapper.addVariable( variableName, variableValue );
|
2019-12-10 07:58:47 -06:00
|
|
|
|
2022-12-08 00:08:22 -06:00
|
|
|
gridCase->setCustomCaseName( variableName );
|
2019-12-10 07:58:47 -06:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-12-08 00:08:22 -06:00
|
|
|
variableMapper.replaceVariablesInValues();
|
|
|
|
|
|
|
|
m_globalPathList = variableMapper.variableTableAsText();
|
2019-12-10 07:58:47 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
void RimProject::distributePathsFromGlobalPathList()
|
|
|
|
{
|
2022-12-08 00:08:22 -06:00
|
|
|
RiaVariableMapper pathListMapper( m_globalPathList() );
|
2019-12-10 07:58:47 -06:00
|
|
|
|
2020-10-12 06:17:47 -05:00
|
|
|
std::vector<caf::FilePath*> filePaths = allFilePaths();
|
2019-12-10 07:58:47 -06:00
|
|
|
for ( caf::FilePath* filePath : filePaths )
|
|
|
|
{
|
|
|
|
QString pathIdCandidate = filePath->path().trimmed();
|
2022-12-08 00:08:22 -06:00
|
|
|
QStringList pathIdComponents = pathIdCandidate.split( RiaVariableMapper::variableToken() );
|
2019-12-10 07:58:47 -06:00
|
|
|
|
|
|
|
if ( pathIdComponents.size() == 3 && pathIdComponents[0].size() == 0 && pathIdComponents[1].size() > 0 &&
|
|
|
|
pathIdComponents[2].size() == 0 )
|
|
|
|
{
|
|
|
|
bool isFound = false;
|
2022-12-08 00:08:22 -06:00
|
|
|
QString path = pathListMapper.valueForVariable( pathIdCandidate, &isFound );
|
2019-12-10 07:58:47 -06:00
|
|
|
if ( isFound )
|
|
|
|
{
|
|
|
|
filePath->setPath( path );
|
|
|
|
}
|
2022-12-08 00:08:22 -06:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
for ( auto summaryCase : allSummaryCases() )
|
|
|
|
{
|
|
|
|
if ( summaryCase->displayNameType() == RimCaseDisplayNameTools::DisplayName::CUSTOM )
|
|
|
|
{
|
|
|
|
auto variableName = summaryCase->displayCaseName();
|
|
|
|
|
|
|
|
bool isFound = false;
|
|
|
|
QString variableValue = pathListMapper.valueForVariable( variableName, &isFound );
|
|
|
|
if ( isFound )
|
2019-12-10 07:58:47 -06:00
|
|
|
{
|
2022-12-08 00:08:22 -06:00
|
|
|
summaryCase->setCustomCaseName( variableValue );
|
|
|
|
}
|
|
|
|
else if ( variableName.contains( RiaVariableMapper::postfixName() + RiaVariableMapper::variableToken() ) )
|
|
|
|
{
|
2023-02-16 13:05:12 -06:00
|
|
|
// The variable name is not found in the variable list, but the name indicates a variable. Reset
|
|
|
|
// to full case name.
|
2022-12-08 00:08:22 -06:00
|
|
|
summaryCase->setDisplayNameOption( RimCaseDisplayNameTools::DisplayName::FULL_CASE_NAME );
|
2019-12-10 07:58:47 -06:00
|
|
|
}
|
|
|
|
}
|
2022-12-08 00:08:22 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
for ( auto gridCase : allGridCases() )
|
|
|
|
{
|
|
|
|
if ( gridCase->displayNameType() == RimCaseDisplayNameTools::DisplayName::CUSTOM )
|
2019-12-10 07:58:47 -06:00
|
|
|
{
|
2022-12-08 00:08:22 -06:00
|
|
|
auto variableName = gridCase->caseUserDescription();
|
|
|
|
|
|
|
|
bool isFound = false;
|
|
|
|
QString variableValue = pathListMapper.valueForVariable( variableName, &isFound );
|
|
|
|
if ( isFound )
|
|
|
|
{
|
|
|
|
gridCase->setCustomCaseName( variableValue );
|
|
|
|
}
|
|
|
|
else if ( variableName.contains( RiaVariableMapper::postfixName() + RiaVariableMapper::variableToken() ) )
|
|
|
|
{
|
2023-02-16 13:05:12 -06:00
|
|
|
// The variable name is not found in the variable list, but the name indicates a variable. Reset
|
|
|
|
// to full case name.
|
2022-12-08 00:08:22 -06:00
|
|
|
gridCase->setDisplayNameType( RimCaseDisplayNameTools::DisplayName::FULL_CASE_NAME );
|
|
|
|
}
|
2019-12-10 07:58:47 -06:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|