From f9129e767f542b6a972a243d09d6baf4c1200d3e Mon Sep 17 00:00:00 2001 From: jonjenssen Date: Thu, 10 Jun 2021 14:27:21 +0200 Subject: [PATCH 001/308] Make sure fault_ra parameter file is overwritten. Adjust digits in loadstep strings to max number of steps. Always use 0 as first step for adv. processing. --- .../FileInterface/RifFaultRAJsonWriter.cpp | 4 +-- .../Faults/RimFaultRASettings.cpp | 25 ++++++++++++++++--- .../Faults/RimFaultRASettings.h | 3 ++- 3 files changed, 25 insertions(+), 7 deletions(-) diff --git a/ApplicationLibCode/FileInterface/RifFaultRAJsonWriter.cpp b/ApplicationLibCode/FileInterface/RifFaultRAJsonWriter.cpp index 355739ef34..23630bcf28 100644 --- a/ApplicationLibCode/FileInterface/RifFaultRAJsonWriter.cpp +++ b/ApplicationLibCode/FileInterface/RifFaultRAJsonWriter.cpp @@ -36,7 +36,7 @@ bool RifFaultRAJSonWriter::writeToPreprocFile( RimFaultRAPreprocSettings& settin outErrorText = "Unable to write to file \"" + filename + "\" - "; QFile file( filename ); - if ( file.open( QIODevice::ReadWrite ) ) + if ( file.open( QIODevice::ReadWrite | QIODevice::Truncate | QIODevice::Text ) ) { QTextStream stream( &file ); @@ -69,7 +69,7 @@ bool RifFaultRAJSonWriter::writeToPostprocFile( int faultID, RimFaultRAPostprocS outErrorText = "Unable to write to file \"" + filename + "\" - "; QFile file( filename ); - if ( file.open( QIODevice::ReadWrite ) ) + if ( file.open( QIODevice::ReadWrite | QIODevice::Truncate | QIODevice::Text ) ) { QTextStream stream( &file ); diff --git a/ApplicationLibCode/ProjectDataModel/Faults/RimFaultRASettings.cpp b/ApplicationLibCode/ProjectDataModel/Faults/RimFaultRASettings.cpp index da4adbf5b7..c43cae66d1 100644 --- a/ApplicationLibCode/ProjectDataModel/Faults/RimFaultRASettings.cpp +++ b/ApplicationLibCode/ProjectDataModel/Faults/RimFaultRASettings.cpp @@ -415,7 +415,8 @@ std::list RimFaultRASettings::basicParameters( int faultID //-------------------------------------------------------------------------------------------------- std::list RimFaultRASettings::advancedParameters( int faultID ) { - m_advancedParametersRI->setParameterValue( "eclipse_loadstep_start", loadStepStart() ); + bool advanced = true; + m_advancedParametersRI->setParameterValue( "eclipse_loadstep_start", loadStepStart( advanced ) ); m_advancedParametersRI->setParameterValue( "eclipse_loadstep_end", loadStepEnd() ); m_advancedParametersRI->setParameterValue( "faultid_calibration", faultID ); m_advancedParametersRI->setParameterValue( "abaqus_elastic_properties", elasticPropertiesFilename() ); @@ -505,9 +506,25 @@ QString RimFaultRASettings::advancedMacrisDatabase() const //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -QString RimFaultRASettings::loadStepStart() const +int RimFaultRASettings::timeStepDigits() const { - QString retval = QString( "PRESSURE_%1" ).arg( startTimeStepEclipseIndex(), 2, 10, QChar( '0' ) ); + if ( m_eclipseCase == nullptr ) return 1; + + int timesteps = m_eclipseCase->timeStepStrings().size(); + if ( timesteps <= 0 ) return 1; + + return 1 + (int)( std::log10( 1.0 * timesteps ) ); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +QString RimFaultRASettings::loadStepStart( bool advanced /* = false */ ) const +{ + int startStep = 0; + if ( !advanced ) startStep = startTimeStepEclipseIndex(); + + QString retval = QString( "PRESSURE_%1" ).arg( startStep, timeStepDigits(), 10, QChar( '0' ) ); return retval; } @@ -516,7 +533,7 @@ QString RimFaultRASettings::loadStepStart() const //-------------------------------------------------------------------------------------------------- QString RimFaultRASettings::loadStepEnd() const { - QString retval = QString( "PRESSURE_%1" ).arg( endTimeStepEclipseIndex(), 2, 10, QChar( '0' ) ); + QString retval = QString( "PRESSURE_%1" ).arg( endTimeStepEclipseIndex(), timeStepDigits(), 10, QChar( '0' ) ); return retval; } diff --git a/ApplicationLibCode/ProjectDataModel/Faults/RimFaultRASettings.h b/ApplicationLibCode/ProjectDataModel/Faults/RimFaultRASettings.h index e928b672db..bc5e683eba 100644 --- a/ApplicationLibCode/ProjectDataModel/Faults/RimFaultRASettings.h +++ b/ApplicationLibCode/ProjectDataModel/Faults/RimFaultRASettings.h @@ -64,7 +64,7 @@ class RimFaultRASettings : public caf::PdmObject int startTimeStepEclipseIndex() const; QString startTimeStepEclipse() const; - QString loadStepStart() const; + QString loadStepStart( bool advanced = false ) const; int endTimeStepEclipseIndex() const; QString endTimeStepEclipse() const; QString loadStepEnd() const; @@ -95,6 +95,7 @@ class RimFaultRASettings : public caf::PdmObject private: void setupResInsightParameters(); + int timeStepDigits() const; private: caf::PdmPtrField m_eclipseFRAGeneratedCase; From 1350c56eaf3ffa012254d37d5dac224e19a90cba Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Mon, 14 Jun 2021 08:01:28 +0200 Subject: [PATCH 002/308] Guard nullpointer access and catch exceptions --- .../RimEclipseResultDefinition.cpp | 5594 ++++++++--------- .../ProjectDataModel/RimVfpTableExtractor.cpp | 181 +- 2 files changed, 2885 insertions(+), 2890 deletions(-) diff --git a/ApplicationLibCode/ProjectDataModel/RimEclipseResultDefinition.cpp b/ApplicationLibCode/ProjectDataModel/RimEclipseResultDefinition.cpp index 904360b48c..c10d9df067 100644 --- a/ApplicationLibCode/ProjectDataModel/RimEclipseResultDefinition.cpp +++ b/ApplicationLibCode/ProjectDataModel/RimEclipseResultDefinition.cpp @@ -1,2797 +1,2797 @@ -///////////////////////////////////////////////////////////////////////////////// -// -// Copyright (C) 2011- Statoil ASA -// Copyright (C) 2013- Ceetron Solutions AS -// Copyright (C) 2011-2012 Ceetron AS -// -// ResInsight is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at -// for more details. -// -///////////////////////////////////////////////////////////////////////////////// - -#include "RimEclipseResultDefinition.h" - -#include "RiaColorTables.h" -#include "RiaColorTools.h" -#include "RiaLogging.h" -#include "RiaNncDefines.h" -#include "RiaQDateTimeTools.h" - -#include "RicfCommandObject.h" - -#include "RigActiveCellInfo.h" -#include "RigAllanDiagramData.h" -#include "RigCaseCellResultsData.h" -#include "RigEclipseCaseData.h" -#include "RigEclipseResultInfo.h" -#include "RigFlowDiagResultAddress.h" -#include "RigFlowDiagResults.h" -#include "RigFormationNames.h" -#include "RigVisibleCategoriesCalculator.h" - -#include "Rim3dView.h" -#include "Rim3dWellLogCurve.h" -#include "RimCellEdgeColors.h" -#include "RimColorLegend.h" -#include "RimContourMapProjection.h" -#include "RimEclipseCase.h" -#include "RimEclipseCellColors.h" -#include "RimEclipseContourMapProjection.h" -#include "RimEclipseContourMapView.h" -#include "RimEclipseFaultColors.h" -#include "RimEclipseInputProperty.h" -#include "RimEclipseInputPropertyCollection.h" -#include "RimEclipsePropertyFilter.h" -#include "RimEclipseResultCase.h" -#include "RimEclipseView.h" -#include "RimFlowDiagSolution.h" -#include "RimGridCrossPlot.h" -#include "RimGridCrossPlotDataSet.h" -#include "RimGridTimeHistoryCurve.h" -#include "RimIntersectionCollection.h" -#include "RimIntersectionResultDefinition.h" -#include "RimPlotCurve.h" -#include "RimProject.h" -#include "RimReservoirCellResultsStorage.h" -#include "RimSimWellInView.h" -#include "RimSimWellInViewCollection.h" -#include "RimTernaryLegendConfig.h" -#include "RimViewLinker.h" -#include "RimWellLogExtractionCurve.h" -#include "RimWellLogTrack.h" - -#ifdef USE_QTCHARTS -#include "RimGridStatisticsPlot.h" -#endif - -#include "cafCategoryMapper.h" -#include "cafPdmFieldScriptingCapability.h" -#include "cafPdmUiListEditor.h" -#include "cafPdmUiToolButtonEditor.h" -#include "cafPdmUiTreeSelectionEditor.h" -#include "cafUtils.h" - -#include - -namespace caf -{ -template <> -void RimEclipseResultDefinition::FlowTracerSelectionEnum::setUp() -{ - addItem( RimEclipseResultDefinition::FLOW_TR_INJ_AND_PROD, "FLOW_TR_INJ_AND_PROD", "All Injectors and Producers" ); - addItem( RimEclipseResultDefinition::FLOW_TR_PRODUCERS, "FLOW_TR_PRODUCERS", "All Producers" ); - addItem( RimEclipseResultDefinition::FLOW_TR_INJECTORS, "FLOW_TR_INJECTORS", "All Injectors" ); - addItem( RimEclipseResultDefinition::FLOW_TR_BY_SELECTION, "FLOW_TR_BY_SELECTION", "By Selection" ); - - setDefault( RimEclipseResultDefinition::FLOW_TR_INJ_AND_PROD ); -} -} // namespace caf - -CAF_PDM_SOURCE_INIT( RimEclipseResultDefinition, "ResultDefinition" ); - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -RimEclipseResultDefinition::RimEclipseResultDefinition( caf::PdmUiItemInfo::LabelPosType labelPosition ) - : m_isDeltaResultEnabled( false ) - , m_labelPosition( labelPosition ) - , m_ternaryEnabled( true ) -{ - CAF_PDM_InitScriptableObjectWithNameAndComment( "Result Definition", "", "", "", "EclipseResult", "An eclipse result definition" ); - - CAF_PDM_InitScriptableFieldNoDefault( &m_resultType, "ResultType", "Type", "", "", "" ); - m_resultType.uiCapability()->setUiHidden( true ); - - CAF_PDM_InitScriptableFieldNoDefault( &m_porosityModel, "PorosityModelType", "Porosity", "", "", "" ); - m_porosityModel.uiCapability()->setUiHidden( true ); - - CAF_PDM_InitScriptableField( &m_resultVariable, - "ResultVariable", - RiaResultNames::undefinedResultName(), - "Variable", - "", - "", - "" ); - m_resultVariable.uiCapability()->setUiHidden( true ); - - CAF_PDM_InitFieldNoDefault( &m_flowSolution, "FlowDiagSolution", "Solution", "", "", "" ); - m_flowSolution.uiCapability()->setUiHidden( true ); - - CAF_PDM_InitField( &m_timeLapseBaseTimestep, - "TimeLapseBaseTimeStep", - RigEclipseResultAddress::noTimeLapseValue(), - "Base Time Step", - "", - "", - "" ); - - CAF_PDM_InitFieldNoDefault( &m_differenceCase, "DifferenceCase", "Difference Case", "", "", "" ); - - CAF_PDM_InitField( &m_divideByCellFaceArea, "DivideByCellFaceArea", false, "Divide By Area", "", "", "" ); - - CAF_PDM_InitScriptableFieldNoDefault( &m_selectedInjectorTracers, "SelectedInjectorTracers", "Injector Tracers", "", "", "" ); - m_selectedInjectorTracers.uiCapability()->setUiHidden( true ); - - CAF_PDM_InitScriptableFieldNoDefault( &m_selectedProducerTracers, "SelectedProducerTracers", "Producer Tracers", "", "", "" ); - m_selectedProducerTracers.uiCapability()->setUiHidden( true ); - - CAF_PDM_InitScriptableFieldNoDefault( &m_selectedSouringTracers, "SelectedSouringTracers", "Tracers", "", "", "" ); - m_selectedSouringTracers.uiCapability()->setUiHidden( true ); - - CAF_PDM_InitScriptableFieldNoDefault( &m_flowTracerSelectionMode, "FlowTracerSelectionMode", "Tracers", "", "", "" ); - CAF_PDM_InitScriptableFieldNoDefault( &m_phaseSelection, "PhaseSelection", "Phases", "", "", "" ); - m_phaseSelection.uiCapability()->setUiLabelPosition( m_labelPosition ); - - CAF_PDM_InitScriptableField( &m_showOnlyVisibleCategoriesInLegend, - "ShowOnlyVisibleCategoriesInLegend", - true, - "Show Only Visible Categories In Legend", - "", - "", - "" ); - - // Ui only fields - - CAF_PDM_InitFieldNoDefault( &m_resultTypeUiField, "MResultType", "Type", "", "", "" ); - m_resultTypeUiField.xmlCapability()->disableIO(); - m_resultTypeUiField.uiCapability()->setUiLabelPosition( m_labelPosition ); - - CAF_PDM_InitFieldNoDefault( &m_porosityModelUiField, "MPorosityModelType", "Porosity", "", "", "" ); - m_porosityModelUiField.xmlCapability()->disableIO(); - m_porosityModelUiField.uiCapability()->setUiLabelPosition( m_labelPosition ); - - CAF_PDM_InitField( &m_resultVariableUiField, - "MResultVariable", - RiaResultNames::undefinedResultName(), - "Result Property", - "", - "", - "" ); - m_resultVariableUiField.xmlCapability()->disableIO(); - m_resultVariableUiField.uiCapability()->setUiEditorTypeName( caf::PdmUiListEditor::uiEditorTypeName() ); - m_resultVariableUiField.uiCapability()->setUiLabelPosition( m_labelPosition ); - - CAF_PDM_InitFieldNoDefault( &m_inputPropertyFileName, "InputPropertyFileName", "File Name", "", "", "" ); - m_inputPropertyFileName.xmlCapability()->disableIO(); - m_inputPropertyFileName.uiCapability()->setUiReadOnly( true ); - - CAF_PDM_InitFieldNoDefault( &m_flowSolutionUiField, "MFlowDiagSolution", "Solution", "", "", "" ); - m_flowSolutionUiField.xmlCapability()->disableIO(); - m_flowSolutionUiField.uiCapability()->setUiHidden( true ); // For now since there are only one to choose from - - CAF_PDM_InitField( &m_syncInjectorToProducerSelection, "MSyncSelectedInjProd", false, "Add Communicators ->", "", "", "" ); - m_syncInjectorToProducerSelection.uiCapability()->setUiEditorTypeName( caf::PdmUiToolButtonEditor::uiEditorTypeName() ); - - CAF_PDM_InitField( &m_syncProducerToInjectorSelection, "MSyncSelectedProdInj", false, "<- Add Communicators", "", "", "" ); - m_syncProducerToInjectorSelection.uiCapability()->setUiEditorTypeName( caf::PdmUiToolButtonEditor::uiEditorTypeName() ); - - CAF_PDM_InitFieldNoDefault( &m_selectedInjectorTracersUiField, "MSelectedInjectorTracers", "Injector Tracers", "", "", "" ); - m_selectedInjectorTracersUiField.xmlCapability()->disableIO(); - m_selectedInjectorTracersUiField.uiCapability()->setUiEditorTypeName( - caf::PdmUiTreeSelectionEditor::uiEditorTypeName() ); - m_selectedInjectorTracersUiField.uiCapability()->setUiLabelPosition( caf::PdmUiItemInfo::HIDDEN ); - - CAF_PDM_InitFieldNoDefault( &m_selectedProducerTracersUiField, "MSelectedProducerTracers", "Producer Tracers", "", "", "" ); - m_selectedProducerTracersUiField.xmlCapability()->disableIO(); - m_selectedProducerTracersUiField.uiCapability()->setUiEditorTypeName( - caf::PdmUiTreeSelectionEditor::uiEditorTypeName() ); - m_selectedProducerTracersUiField.uiCapability()->setUiLabelPosition( caf::PdmUiItemInfo::HIDDEN ); - - CAF_PDM_InitFieldNoDefault( &m_selectedSouringTracersUiField, "MSelectedSouringTracers", "Tracers", "", "", "" ); - m_selectedSouringTracersUiField.xmlCapability()->disableIO(); - m_selectedSouringTracersUiField.uiCapability()->setUiEditorTypeName( caf::PdmUiListEditor::uiEditorTypeName() ); - m_selectedSouringTracersUiField.uiCapability()->setUiLabelPosition( m_labelPosition ); -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -RimEclipseResultDefinition::~RimEclipseResultDefinition() -{ -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -void RimEclipseResultDefinition::simpleCopy( const RimEclipseResultDefinition* other ) -{ - this->setResultVariable( other->resultVariable() ); - this->setPorosityModel( other->porosityModel() ); - this->setResultType( other->resultType() ); - this->setFlowSolution( other->m_flowSolution() ); - this->setSelectedInjectorTracers( other->m_selectedInjectorTracers() ); - this->setSelectedProducerTracers( other->m_selectedProducerTracers() ); - this->setSelectedSouringTracers( other->m_selectedSouringTracers() ); - m_flowTracerSelectionMode = other->m_flowTracerSelectionMode(); - m_phaseSelection = other->m_phaseSelection; - - m_differenceCase = other->m_differenceCase(); - m_timeLapseBaseTimestep = other->m_timeLapseBaseTimestep(); - m_divideByCellFaceArea = other->m_divideByCellFaceArea(); -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -void RimEclipseResultDefinition::setEclipseCase( RimEclipseCase* eclipseCase ) -{ - m_eclipseCase = eclipseCase; - - assignFlowSolutionFromCase(); -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -RimEclipseCase* RimEclipseResultDefinition::eclipseCase() const -{ - return m_eclipseCase; -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -RigCaseCellResultsData* RimEclipseResultDefinition::currentGridCellResults() const -{ - if ( !m_eclipseCase ) return nullptr; - - return m_eclipseCase->results( m_porosityModel() ); -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -void RimEclipseResultDefinition::fieldChangedByUi( const caf::PdmFieldHandle* changedField, - const QVariant& oldValue, - const QVariant& newValue ) -{ - if ( &m_flowSolutionUiField == changedField || &m_resultTypeUiField == changedField || - &m_porosityModelUiField == changedField ) - { - // If the user are seeing the list with the actually selected result, - // select that result in the list. Otherwise select nothing. - - QStringList varList = getResultNamesForResultType( m_resultTypeUiField(), this->currentGridCellResults() ); - - bool isFlowDiagFieldsRelevant = ( m_resultType() == RiaDefines::ResultCatType::FLOW_DIAGNOSTICS ); - - if ( ( m_flowSolutionUiField() == m_flowSolution() || !isFlowDiagFieldsRelevant ) && - m_resultTypeUiField() == m_resultType() && m_porosityModelUiField() == m_porosityModel() ) - { - if ( varList.contains( resultVariable() ) ) - { - m_resultVariableUiField = resultVariable(); - } - - if ( isFlowDiagFieldsRelevant ) - { - m_selectedInjectorTracersUiField = m_selectedInjectorTracers(); - m_selectedProducerTracersUiField = m_selectedProducerTracers(); - } - else - { - m_selectedInjectorTracersUiField = std::vector(); - m_selectedProducerTracersUiField = std::vector(); - } - } - else - { - m_resultVariableUiField = ""; - m_selectedInjectorTracersUiField = std::vector(); - m_selectedProducerTracersUiField = std::vector(); - } - } - - if ( &m_resultVariableUiField == changedField ) - { - m_porosityModel = m_porosityModelUiField; - m_resultType = m_resultTypeUiField; - m_resultVariable = m_resultVariableUiField; - - if ( m_resultTypeUiField() == RiaDefines::ResultCatType::FLOW_DIAGNOSTICS ) - { - m_flowSolution = m_flowSolutionUiField(); - m_selectedInjectorTracers = m_selectedInjectorTracersUiField(); - m_selectedProducerTracers = m_selectedProducerTracersUiField(); - } - else if ( m_resultTypeUiField() == RiaDefines::ResultCatType::INJECTION_FLOODING ) - { - m_selectedSouringTracers = m_selectedSouringTracersUiField(); - } - else if ( m_resultTypeUiField() == RiaDefines::ResultCatType::INPUT_PROPERTY ) - { - m_inputPropertyFileName = getInputPropertyFileName( newValue.toString() ); - } - loadDataAndUpdate(); - } - - if ( &m_porosityModelUiField == changedField ) - { - m_porosityModel = m_porosityModelUiField; - m_resultVariableUiField = resultVariable(); - - RimEclipseView* eclipseView = nullptr; - this->firstAncestorOrThisOfType( eclipseView ); - if ( eclipseView ) - { - // Active cells can be different between matrix and fracture, make sure all geometry is recreated - eclipseView->scheduleReservoirGridGeometryRegen(); - } - - loadDataAndUpdate(); - } - - RimEclipseContourMapView* contourMapView = nullptr; - this->firstAncestorOrThisOfType( contourMapView ); - - if ( &m_differenceCase == changedField ) - { - m_timeLapseBaseTimestep = RigEclipseResultAddress::noTimeLapseValue(); - - if ( contourMapView ) - { - contourMapView->contourMapProjection()->updatedWeightingResult(); - } - - loadDataAndUpdate(); - } - - if ( &m_timeLapseBaseTimestep == changedField ) - { - if ( contourMapView ) - { - contourMapView->contourMapProjection()->updatedWeightingResult(); - } - - loadDataAndUpdate(); - } - - if ( &m_divideByCellFaceArea == changedField ) - { - loadDataAndUpdate(); - } - - if ( &m_flowTracerSelectionMode == changedField ) - { - loadDataAndUpdate(); - } - - if ( &m_selectedInjectorTracersUiField == changedField ) - { - changedTracerSelectionField( true ); - } - - if ( &m_selectedProducerTracersUiField == changedField ) - { - changedTracerSelectionField( false ); - } - - if ( &m_syncInjectorToProducerSelection == changedField ) - { - syncInjectorToProducerSelection(); - m_syncInjectorToProducerSelection = false; - } - - if ( &m_syncProducerToInjectorSelection == changedField ) - { - syncProducerToInjectorSelection(); - m_syncProducerToInjectorSelection = false; - } - - if ( &m_selectedSouringTracersUiField == changedField ) - { - if ( !m_resultVariable().isEmpty() ) - { - m_selectedSouringTracers = m_selectedSouringTracersUiField(); - loadDataAndUpdate(); - } - } - - if ( &m_phaseSelection == changedField ) - { - if ( m_phaseSelection() != RigFlowDiagResultAddress::PHASE_ALL ) - { - m_resultType = m_resultTypeUiField; - m_resultVariable = RIG_FLD_TOF_RESNAME; - m_resultVariableUiField = RIG_FLD_TOF_RESNAME; - } - loadDataAndUpdate(); - } - - if ( &m_showOnlyVisibleCategoriesInLegend == changedField ) - { - loadDataAndUpdate(); - } - - updateAnyFieldHasChanged(); -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -void RimEclipseResultDefinition::changedTracerSelectionField( bool injector ) -{ - m_flowSolution = m_flowSolutionUiField(); - - std::vector& selectedTracers = injector ? m_selectedInjectorTracers.v() : m_selectedProducerTracers.v(); - const std::vector& selectedTracersUi = injector ? m_selectedInjectorTracersUiField.v() - : m_selectedProducerTracersUiField.v(); - - selectedTracers = selectedTracersUi; - - loadDataAndUpdate(); -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -void RimEclipseResultDefinition::updateAnyFieldHasChanged() -{ - RimEclipsePropertyFilter* propFilter = nullptr; - this->firstAncestorOrThisOfType( propFilter ); - if ( propFilter ) - { - propFilter->updateConnectedEditors(); - } - - RimEclipseFaultColors* faultColors = nullptr; - this->firstAncestorOrThisOfType( faultColors ); - if ( faultColors ) - { - faultColors->updateConnectedEditors(); - } - - RimCellEdgeColors* cellEdgeColors = nullptr; - this->firstAncestorOrThisOfType( cellEdgeColors ); - if ( cellEdgeColors ) - { - cellEdgeColors->updateConnectedEditors(); - } - - RimEclipseCellColors* cellColors = nullptr; - this->firstAncestorOrThisOfType( cellColors ); - if ( cellColors ) - { - cellColors->updateConnectedEditors(); - } - - RimIntersectionResultDefinition* intersectResDef = nullptr; - this->firstAncestorOrThisOfType( intersectResDef ); - if ( intersectResDef ) - { - intersectResDef->updateConnectedEditors(); - } - - RimGridCrossPlotDataSet* crossPlotCurveSet = nullptr; - this->firstAncestorOrThisOfType( crossPlotCurveSet ); - if ( crossPlotCurveSet ) - { - crossPlotCurveSet->updateConnectedEditors(); - } - - RimPlotCurve* curve = nullptr; - this->firstAncestorOrThisOfType( curve ); - if ( curve ) - { - curve->updateConnectedEditors(); - } - - Rim3dWellLogCurve* rim3dWellLogCurve = nullptr; - this->firstAncestorOrThisOfType( rim3dWellLogCurve ); - if ( rim3dWellLogCurve ) - { - rim3dWellLogCurve->resetMinMaxValues(); - } - - RimEclipseContourMapProjection* contourMap = nullptr; - this->firstAncestorOrThisOfType( contourMap ); - if ( contourMap ) - { - contourMap->updatedWeightingResult(); - } - - RimWellLogTrack* wellLogTrack = nullptr; - this->firstAncestorOrThisOfType( wellLogTrack ); - if ( wellLogTrack ) - { - wellLogTrack->loadDataAndUpdate(); - wellLogTrack->updateEditors(); - } -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -void RimEclipseResultDefinition::setTofAndSelectTracer( const QString& tracerName ) -{ - setResultType( RiaDefines::ResultCatType::FLOW_DIAGNOSTICS ); - setResultVariable( "TOF" ); - setFlowDiagTracerSelectionType( FLOW_TR_BY_SELECTION ); - - if ( m_flowSolution() == nullptr ) - { - assignFlowSolutionFromCase(); - } - - if ( m_flowSolution() ) - { - RimFlowDiagSolution::TracerStatusType tracerStatus = m_flowSolution()->tracerStatusOverall( tracerName ); - - std::vector tracers; - tracers.push_back( tracerName ); - if ( ( tracerStatus == RimFlowDiagSolution::TracerStatusType::INJECTOR ) || - ( tracerStatus == RimFlowDiagSolution::TracerStatusType::VARYING ) ) - { - setSelectedInjectorTracers( tracers ); - } - - if ( ( tracerStatus == RimFlowDiagSolution::TracerStatusType::PRODUCER ) || - ( tracerStatus == RimFlowDiagSolution::TracerStatusType::VARYING ) ) - { - setSelectedProducerTracers( tracers ); - } - } -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -void RimEclipseResultDefinition::loadDataAndUpdate() -{ - Rim3dView* view = nullptr; - this->firstAncestorOrThisOfType( view ); - - loadResult(); - - RimEclipsePropertyFilter* propFilter = nullptr; - this->firstAncestorOrThisOfType( propFilter ); - if ( propFilter ) - { - propFilter->setToDefaultValues(); - propFilter->updateFilterName(); - - if ( view ) - { - view->scheduleGeometryRegen( PROPERTY_FILTERED ); - view->scheduleCreateDisplayModelAndRedraw(); - } - } - - RimEclipseCellColors* cellColors = nullptr; - this->firstAncestorOrThisOfType( cellColors ); - if ( cellColors ) - { - this->updateLegendCategorySettings(); - - if ( view ) - { - RimViewLinker* viewLinker = view->assosiatedViewLinker(); - if ( viewLinker ) - { - viewLinker->updateCellResult(); - } - RimGridView* eclView = dynamic_cast( view ); - if ( eclView ) eclView->intersectionCollection()->scheduleCreateDisplayModelAndRedraw2dIntersectionViews(); - } - } - - RimIntersectionResultDefinition* sepIntersectionResDef = nullptr; - this->firstAncestorOrThisOfType( sepIntersectionResDef ); - if ( sepIntersectionResDef && sepIntersectionResDef->isInAction() ) - { - if ( view ) view->scheduleCreateDisplayModelAndRedraw(); - RimGridView* gridView = dynamic_cast( view ); - if ( gridView ) gridView->intersectionCollection()->scheduleCreateDisplayModelAndRedraw2dIntersectionViews(); - } - - RimCellEdgeColors* cellEdgeColors = nullptr; - this->firstAncestorOrThisOfType( cellEdgeColors ); - if ( cellEdgeColors ) - { - cellEdgeColors->singleVarEdgeResultColors()->updateLegendCategorySettings(); - cellEdgeColors->loadResult(); - - if ( view ) - { - view->scheduleCreateDisplayModelAndRedraw(); - } - } - - RimGridCrossPlotDataSet* crossPlotCurveSet = nullptr; - this->firstAncestorOrThisOfType( crossPlotCurveSet ); - if ( crossPlotCurveSet ) - { - crossPlotCurveSet->destroyCurves(); - crossPlotCurveSet->loadDataAndUpdate( true ); - } - - RimPlotCurve* curve = nullptr; - this->firstAncestorOrThisOfType( curve ); - if ( curve ) - { - curve->loadDataAndUpdate( true ); - } - - Rim3dWellLogCurve* rim3dWellLogCurve = nullptr; - this->firstAncestorOrThisOfType( rim3dWellLogCurve ); - if ( rim3dWellLogCurve ) - { - rim3dWellLogCurve->updateCurveIn3dView(); - } - -#ifdef USE_QTCHARTS - RimGridStatisticsPlot* gridStatisticsPlot = nullptr; - this->firstAncestorOrThisOfType( gridStatisticsPlot ); - if ( gridStatisticsPlot ) - { - gridStatisticsPlot->loadDataAndUpdate(); - } -#endif -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -QList - RimEclipseResultDefinition::calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions, bool* useOptionsOnly ) -{ - QList options; - - if ( fieldNeedingOptions == &m_resultTypeUiField ) - { - bool hasSourSimRLFile = false; - RimEclipseResultCase* eclResCase = dynamic_cast( m_eclipseCase.p() ); - if ( eclResCase && eclResCase->eclipseCaseData() ) - { - hasSourSimRLFile = eclResCase->hasSourSimFile(); - } - -#ifndef USE_HDF5 - // If using ResInsight without HDF5 support, ignore SourSim files and - // do not show it as a result category. - hasSourSimRLFile = false; -#endif - - bool enableSouring = false; - -#ifdef USE_HDF5 - if ( m_eclipseCase.notNull() ) - { - RigCaseCellResultsData* cellResultsData = m_eclipseCase->results( this->porosityModel() ); - - if ( cellResultsData && cellResultsData->hasFlowDiagUsableFluxes() ) - { - enableSouring = true; - } - } -#endif /* USE_HDF5 */ - - RimGridTimeHistoryCurve* timeHistoryCurve; - this->firstAncestorOrThisOfType( timeHistoryCurve ); - - bool isSeparateFaultResult = false; - { - RimEclipseFaultColors* sepFaultResult; - this->firstAncestorOrThisOfType( sepFaultResult ); - if ( sepFaultResult ) isSeparateFaultResult = true; - } - - using ResCatEnum = caf::AppEnum; - for ( size_t i = 0; i < ResCatEnum::size(); ++i ) - { - RiaDefines::ResultCatType resType = ResCatEnum::fromIndex( i ); - - // Do not include flow diagnostics results if it is a time history curve - - if ( resType == RiaDefines::ResultCatType::FLOW_DIAGNOSTICS && ( timeHistoryCurve ) ) - { - continue; - } - - if ( resType == RiaDefines::ResultCatType::FLOW_DIAGNOSTICS && m_eclipseCase && - m_eclipseCase->eclipseCaseData()->hasFractureResults() ) - { - // Flow diagnostics is not supported for dual porosity models - continue; - } - - // Do not include SourSimRL if no SourSim file is loaded - - if ( resType == RiaDefines::ResultCatType::SOURSIMRL && ( !hasSourSimRLFile ) ) - { - continue; - } - - if ( resType == RiaDefines::ResultCatType::INJECTION_FLOODING && !enableSouring ) - { - continue; - } - - if ( resType == RiaDefines::ResultCatType::ALLAN_DIAGRAMS && !isSeparateFaultResult ) - { - continue; - } - - QString uiString = ResCatEnum::uiTextFromIndex( i ); - options.push_back( caf::PdmOptionItemInfo( uiString, resType ) ); - } - } - - if ( m_resultTypeUiField() == RiaDefines::ResultCatType::FLOW_DIAGNOSTICS ) - { - if ( fieldNeedingOptions == &m_resultVariableUiField ) - { - options.push_back( caf::PdmOptionItemInfo( timeOfFlightString( false ), RIG_FLD_TOF_RESNAME ) ); - if ( m_phaseSelection() == RigFlowDiagResultAddress::PHASE_ALL ) - { - options.push_back( caf::PdmOptionItemInfo( "Tracer Cell Fraction (Sum)", RIG_FLD_CELL_FRACTION_RESNAME ) ); - options.push_back( - caf::PdmOptionItemInfo( maxFractionTracerString( false ), RIG_FLD_MAX_FRACTION_TRACER_RESNAME ) ); - options.push_back( - caf::PdmOptionItemInfo( "Injector Producer Communication", RIG_FLD_COMMUNICATION_RESNAME ) ); - } - } - else if ( fieldNeedingOptions == &m_flowSolutionUiField ) - { - RimEclipseResultCase* eclCase = dynamic_cast( m_eclipseCase.p() ); - if ( eclCase ) - { - std::vector flowSols = eclCase->flowDiagSolutions(); - for ( RimFlowDiagSolution* flowSol : flowSols ) - { - options.push_back( caf::PdmOptionItemInfo( flowSol->userDescription(), flowSol ) ); - } - } - } - else if ( fieldNeedingOptions == &m_selectedInjectorTracersUiField ) - { - options = calcOptionsForSelectedTracerField( true ); - } - else if ( fieldNeedingOptions == &m_selectedProducerTracersUiField ) - { - options = calcOptionsForSelectedTracerField( false ); - } - } - else if ( m_resultTypeUiField() == RiaDefines::ResultCatType::INJECTION_FLOODING ) - { - if ( fieldNeedingOptions == &m_selectedSouringTracersUiField ) - { - RigCaseCellResultsData* cellResultsStorage = currentGridCellResults(); - if ( cellResultsStorage ) - { - QStringList dynamicResultNames = - cellResultsStorage->resultNames( RiaDefines::ResultCatType::DYNAMIC_NATIVE ); - - for ( const QString& resultName : dynamicResultNames ) - { - if ( !resultName.endsWith( "F" ) || resultName == RiaResultNames::completionTypeResultName() ) - { - continue; - } - options.push_back( caf::PdmOptionItemInfo( resultName, resultName ) ); - } - } - } - else if ( fieldNeedingOptions == &m_resultVariableUiField ) - { - options.push_back( caf::PdmOptionItemInfo( RIG_NUM_FLOODED_PV, RIG_NUM_FLOODED_PV ) ); - } - } - else - { - if ( fieldNeedingOptions == &m_resultVariableUiField ) - { - options = calcOptionsForVariableUiFieldStandard( m_resultTypeUiField(), - this->currentGridCellResults(), - showDerivedResultsFirstInVariableUiField(), - addPerCellFaceOptionsForVariableUiField(), - m_ternaryEnabled ); - } - else if ( fieldNeedingOptions == &m_differenceCase ) - { - options.push_back( caf::PdmOptionItemInfo( "None", nullptr ) ); - - RimEclipseCase* eclipseCase = nullptr; - this->firstAncestorOrThisOfTypeAsserted( eclipseCase ); - if ( eclipseCase && eclipseCase->eclipseCaseData() && eclipseCase->eclipseCaseData()->mainGrid() ) - { - RimProject* proj = nullptr; - eclipseCase->firstAncestorOrThisOfTypeAsserted( proj ); - - std::vector allCases = proj->eclipseCases(); - for ( RimEclipseCase* otherCase : allCases ) - { - if ( otherCase == eclipseCase ) continue; - - if ( otherCase->eclipseCaseData() && otherCase->eclipseCaseData()->mainGrid() ) - { - options.push_back( caf::PdmOptionItemInfo( QString( "%1 (#%2)" ) - .arg( otherCase->caseUserDescription() ) - .arg( otherCase->caseId() ), - otherCase, - false, - otherCase->uiIconProvider() ) ); - } - } - } - } - else if ( fieldNeedingOptions == &m_timeLapseBaseTimestep ) - { - RimEclipseCase* currentCase = nullptr; - this->firstAncestorOrThisOfTypeAsserted( currentCase ); - - RimEclipseCase* baseCase = currentCase; - if ( m_differenceCase ) - { - baseCase = m_differenceCase; - } - - options.push_back( caf::PdmOptionItemInfo( "Disabled", RigEclipseResultAddress::noTimeLapseValue() ) ); - - std::vector stepDates = baseCase->timeStepDates(); - for ( size_t stepIdx = 0; stepIdx < stepDates.size(); ++stepIdx ) - { - QString displayString = stepDates[stepIdx].toString( RiaQDateTimeTools::dateFormatString() ); - displayString += QString( " (#%1)" ).arg( stepIdx ); - - options.push_back( caf::PdmOptionItemInfo( displayString, static_cast( stepIdx ) ) ); - } - } - } - - ( *useOptionsOnly ) = true; - - return options; -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -RigEclipseResultAddress RimEclipseResultDefinition::eclipseResultAddress() const -{ - if ( isFlowDiagOrInjectionFlooding() ) return RigEclipseResultAddress(); - - const RigCaseCellResultsData* gridCellResults = this->currentGridCellResults(); - if ( gridCellResults ) - { - int timelapseTimeStep = RigEclipseResultAddress::noTimeLapseValue(); - int diffCaseId = RigEclipseResultAddress::noCaseDiffValue(); - - if ( isDeltaTimeStepActive() ) - { - timelapseTimeStep = m_timeLapseBaseTimestep(); - } - - if ( isDeltaCaseActive() ) - { - diffCaseId = m_differenceCase->caseId(); - } - - return RigEclipseResultAddress( m_resultType(), - m_resultVariable(), - timelapseTimeStep, - diffCaseId, - isDivideByCellFaceAreaActive() ); - } - else - { - return RigEclipseResultAddress(); - } -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -void RimEclipseResultDefinition::setFromEclipseResultAddress( const RigEclipseResultAddress& address ) -{ - RigEclipseResultAddress canonizedAddress = address; - - const RigCaseCellResultsData* gridCellResults = this->currentGridCellResults(); - if ( gridCellResults ) - { - auto rinfo = gridCellResults->resultInfo( address ); - if ( rinfo ) canonizedAddress = rinfo->eclipseResultAddress(); - } - - m_resultType = canonizedAddress.resultCatType(); - m_resultVariable = canonizedAddress.resultName(); - m_timeLapseBaseTimestep = canonizedAddress.deltaTimeStepIndex(); - m_divideByCellFaceArea = canonizedAddress.isDivideByCellFaceAreaActive(); - - if ( canonizedAddress.isDeltaCaseActive() ) - { - auto eclipseCases = RimProject::current()->eclipseCases(); - for ( RimEclipseCase* c : eclipseCases ) - { - if ( c && c->caseId() == canonizedAddress.deltaCaseId() ) - { - m_differenceCase = c; - } - } - } - - this->updateUiFieldsFromActiveResult(); -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -RigFlowDiagResultAddress RimEclipseResultDefinition::flowDiagResAddress() const -{ - CVF_ASSERT( isFlowDiagOrInjectionFlooding() ); - - if ( m_resultType() == RiaDefines::ResultCatType::FLOW_DIAGNOSTICS ) - { - size_t timeStep = 0; - - Rim3dView* rimView = nullptr; - this->firstAncestorOrThisOfType( rimView ); - if ( rimView ) - { - timeStep = rimView->currentTimeStep(); - } - RimWellLogExtractionCurve* wellLogExtractionCurve = nullptr; - this->firstAncestorOrThisOfType( wellLogExtractionCurve ); - if ( wellLogExtractionCurve ) - { - timeStep = static_cast( wellLogExtractionCurve->currentTimeStep() ); - } - - // Time history curves are not supported, since it requires the time - // step to access to be supplied. - RimGridTimeHistoryCurve* timeHistoryCurve = nullptr; - this->firstAncestorOrThisOfType( timeHistoryCurve ); - CVF_ASSERT( timeHistoryCurve == nullptr ); - - std::set selTracerNames; - if ( m_flowTracerSelectionMode == FLOW_TR_BY_SELECTION ) - { - for ( const QString& tName : m_selectedInjectorTracers() ) - { - selTracerNames.insert( tName.toStdString() ); - } - for ( const QString& tName : m_selectedProducerTracers() ) - { - selTracerNames.insert( tName.toStdString() ); - } - } - else - { - RimFlowDiagSolution* flowSol = m_flowSolution(); - if ( flowSol ) - { - std::vector tracerNames = flowSol->tracerNames(); - - if ( m_flowTracerSelectionMode == FLOW_TR_INJECTORS || m_flowTracerSelectionMode == FLOW_TR_INJ_AND_PROD ) - { - for ( const QString& tracerName : tracerNames ) - { - RimFlowDiagSolution::TracerStatusType status = - flowSol->tracerStatusInTimeStep( tracerName, timeStep ); - if ( status == RimFlowDiagSolution::TracerStatusType::INJECTOR ) - { - selTracerNames.insert( tracerName.toStdString() ); - } - } - } - - if ( m_flowTracerSelectionMode == FLOW_TR_PRODUCERS || m_flowTracerSelectionMode == FLOW_TR_INJ_AND_PROD ) - { - for ( const QString& tracerName : tracerNames ) - { - RimFlowDiagSolution::TracerStatusType status = - flowSol->tracerStatusInTimeStep( tracerName, timeStep ); - if ( status == RimFlowDiagSolution::TracerStatusType::PRODUCER ) - { - selTracerNames.insert( tracerName.toStdString() ); - } - } - } - } - } - - return RigFlowDiagResultAddress( m_resultVariable().toStdString(), m_phaseSelection(), selTracerNames ); - } - else - { - std::set selTracerNames; - for ( const QString& selectedTracerName : m_selectedSouringTracers() ) - { - selTracerNames.insert( selectedTracerName.toUtf8().constData() ); - } - return RigFlowDiagResultAddress( m_resultVariable().toStdString(), - RigFlowDiagResultAddress::PHASE_ALL, - selTracerNames ); - } -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -void RimEclipseResultDefinition::setFlowDiagTracerSelectionType( FlowTracerSelectionType selectionType ) -{ - m_flowTracerSelectionMode = selectionType; -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -QString RimEclipseResultDefinition::resultVariableUiName() const -{ - if ( resultType() == RiaDefines::ResultCatType::FLOW_DIAGNOSTICS ) - { - return flowDiagResUiText( false, 32 ); - } - - if ( isDivideByCellFaceAreaActive() ) - { - return m_resultVariable() + " /A"; - } - - return m_resultVariable(); -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -QString RimEclipseResultDefinition::resultVariableUiShortName() const -{ - if ( resultType() == RiaDefines::ResultCatType::FLOW_DIAGNOSTICS ) - { - return flowDiagResUiText( true, 24 ); - } - - if ( isDivideByCellFaceAreaActive() ) - { - return m_resultVariable() + " /A"; - } - - return m_resultVariable(); -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -QString RimEclipseResultDefinition::additionalResultText() const -{ - QStringList resultText; - - if ( isDeltaTimeStepActive() ) - { - std::vector stepDates; - const RigCaseCellResultsData* gridCellResults = this->currentGridCellResults(); - if ( gridCellResults ) - { - stepDates = gridCellResults->timeStepDates(); - resultText += - QString( "Base Time Step: %1" ) - .arg( stepDates[m_timeLapseBaseTimestep()].toString( RiaQDateTimeTools::dateFormatString() ) ); - } - } - if ( isDeltaCaseActive() ) - { - resultText += QString( "Base Case: %1" ).arg( m_differenceCase()->caseUserDescription() ); - } - return resultText.join( "
" ); -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -QString RimEclipseResultDefinition::additionalResultTextShort() const -{ - QString resultTextShort; - if ( isDeltaTimeStepActive() || isDeltaCaseActive() ) - { - QStringList resultTextLines; - resultTextLines += QString( "\nDiff. Options:" ); - if ( isDeltaCaseActive() ) - { - resultTextLines += QString( "Base Case: #%1" ).arg( m_differenceCase()->caseId() ); - } - if ( isDeltaTimeStepActive() ) - { - resultTextLines += QString( "Base Time: #%1" ).arg( m_timeLapseBaseTimestep() ); - } - resultTextShort = resultTextLines.join( "\n" ); - } - - return resultTextShort; -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -int RimEclipseResultDefinition::timeLapseBaseTimeStep() const -{ - return m_timeLapseBaseTimestep; -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -int RimEclipseResultDefinition::caseDiffIndex() const -{ - if ( m_differenceCase ) - { - return m_differenceCase->caseId(); - } - return -1; -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -void RimEclipseResultDefinition::loadResult() -{ - if ( isFlowDiagOrInjectionFlooding() ) return; // Will load automatically on access - - if ( m_eclipseCase ) - { - if ( !m_eclipseCase->ensureReservoirCaseIsOpen() ) - { - RiaLogging::error( "Could not open the Eclipse Grid file: " + m_eclipseCase->gridFileName() ); - return; - } - } - - if ( m_differenceCase ) - { - if ( !m_differenceCase->ensureReservoirCaseIsOpen() ) - { - RiaLogging::error( "Could not open the Eclipse Grid file: " + m_eclipseCase->gridFileName() ); - return; - } - } - - RigCaseCellResultsData* gridCellResults = this->currentGridCellResults(); - if ( gridCellResults ) - { - if ( isDeltaTimeStepActive() || isDeltaCaseActive() || isDivideByCellFaceAreaActive() ) - { - gridCellResults->createResultEntry( this->eclipseResultAddress(), false ); - } - - QString resultName = m_resultVariable(); - std::set eclipseResultNamesWithNncData = RiaResultNames::nncResultNames(); - if ( eclipseResultNamesWithNncData.find( resultName ) != eclipseResultNamesWithNncData.end() ) - { - eclipseCase()->ensureFaultDataIsComputed(); - - bool dataWasComputed = eclipseCase()->ensureNncDataIsComputed(); - if ( dataWasComputed ) - { - eclipseCase()->createDisplayModelAndUpdateAllViews(); - } - } - - gridCellResults->ensureKnownResultLoaded( this->eclipseResultAddress() ); - } -} - -//-------------------------------------------------------------------------------------------------- -/// Returns whether the result requested by the definition is a single frame result -/// The result needs to be loaded before asking -//-------------------------------------------------------------------------------------------------- -bool RimEclipseResultDefinition::hasStaticResult() const -{ - if ( isFlowDiagOrInjectionFlooding() ) return false; - - const RigCaseCellResultsData* gridCellResults = this->currentGridCellResults(); - RigEclipseResultAddress gridScalarResultIndex = this->eclipseResultAddress(); - - if ( hasResult() && gridCellResults->timeStepCount( gridScalarResultIndex ) == 1 ) - { - return true; - } - else - { - return false; - } -} - -//-------------------------------------------------------------------------------------------------- -/// Returns whether the result requested by the definition is loaded or possible to load from the result file -//-------------------------------------------------------------------------------------------------- -bool RimEclipseResultDefinition::hasResult() const -{ - if ( isFlowDiagOrInjectionFlooding() ) - { - if ( m_flowSolution() && !m_resultVariable().isEmpty() ) return true; - } - else if ( this->currentGridCellResults() ) - { - const RigCaseCellResultsData* gridCellResults = this->currentGridCellResults(); - - return gridCellResults->hasResultEntry( this->eclipseResultAddress() ); - } - - return false; -} - -//-------------------------------------------------------------------------------------------------- -/// Returns whether the result requested by the definition is a multi frame result -/// The result needs to be loaded before asking -//-------------------------------------------------------------------------------------------------- -bool RimEclipseResultDefinition::hasDynamicResult() const -{ - if ( hasResult() ) - { - if ( m_resultType() == RiaDefines::ResultCatType::DYNAMIC_NATIVE ) - { - return true; - } - else if ( m_resultType() == RiaDefines::ResultCatType::SOURSIMRL ) - { - return true; - } - else if ( m_resultType() == RiaDefines::ResultCatType::FLOW_DIAGNOSTICS ) - { - return true; - } - else if ( m_resultType() == RiaDefines::ResultCatType::INJECTION_FLOODING ) - { - return true; - } - - if ( this->currentGridCellResults() ) - { - const RigCaseCellResultsData* gridCellResults = this->currentGridCellResults(); - RigEclipseResultAddress gridScalarResultIndex = this->eclipseResultAddress(); - if ( gridCellResults->timeStepCount( gridScalarResultIndex ) > 1 ) - { - return true; - } - } - } - - return false; -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -void RimEclipseResultDefinition::initAfterRead() -{ - if ( m_flowSolution() == nullptr ) - { - assignFlowSolutionFromCase(); - } - - if ( m_resultVariable == "Formation Allen" ) - { - m_resultVariable = RiaResultNames::formationAllanResultName(); - m_resultType = RiaDefines::ResultCatType::ALLAN_DIAGRAMS; - } - else if ( m_resultVariable == "Binary Formation Allen" ) - { - m_resultVariable = RiaResultNames::formationBinaryAllanResultName(); - m_resultType = RiaDefines::ResultCatType::ALLAN_DIAGRAMS; - } - - m_porosityModelUiField = m_porosityModel; - m_resultTypeUiField = m_resultType; - m_resultVariableUiField = m_resultVariable; - - m_flowSolutionUiField = m_flowSolution(); - m_selectedInjectorTracersUiField = m_selectedInjectorTracers; - - this->updateUiIconFromToggleField(); -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -void RimEclipseResultDefinition::setResultType( RiaDefines::ResultCatType val ) -{ - m_resultType = val; - m_resultTypeUiField = val; -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -void RimEclipseResultDefinition::setPorosityModel( RiaDefines::PorosityModelType val ) -{ - m_porosityModel = val; - m_porosityModelUiField = val; -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -void RimEclipseResultDefinition::setResultVariable( const QString& val ) -{ - m_resultVariable = val; - m_resultVariableUiField = val; -} - -//-------------------------------------------------------------------------------------------------- -/// Return phase type if the current result is known to be of a particular -/// fluid phase type. Otherwise the method will return PHASE_NOT_APPLICABLE. -//-------------------------------------------------------------------------------------------------- -RiaDefines::PhaseType RimEclipseResultDefinition::resultPhaseType() const -{ - if ( QRegularExpression( "OIL" ).match( m_resultVariable() ).hasMatch() ) - { - return RiaDefines::PhaseType::OIL_PHASE; - } - else if ( QRegularExpression( "GAS" ).match( m_resultVariable() ).hasMatch() ) - { - return RiaDefines::PhaseType::GAS_PHASE; - } - else if ( QRegularExpression( "WAT" ).match( m_resultVariable() ).hasMatch() ) - { - return RiaDefines::PhaseType::WATER_PHASE; - } - return RiaDefines::PhaseType::PHASE_NOT_APPLICABLE; -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -RimFlowDiagSolution* RimEclipseResultDefinition::flowDiagSolution() const -{ - return m_flowSolution(); -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -void RimEclipseResultDefinition::setFlowSolution( RimFlowDiagSolution* flowSol ) -{ - this->m_flowSolution = flowSol; - this->m_flowSolutionUiField = flowSol; -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -void RimEclipseResultDefinition::setSelectedTracers( const std::vector& selectedTracers ) -{ - if ( m_flowSolution() == nullptr ) - { - assignFlowSolutionFromCase(); - } - if ( m_flowSolution() ) - { - std::vector injectorTracers; - std::vector producerTracers; - for ( const QString& tracerName : selectedTracers ) - { - RimFlowDiagSolution::TracerStatusType tracerStatus = m_flowSolution()->tracerStatusOverall( tracerName ); - if ( tracerStatus == RimFlowDiagSolution::TracerStatusType::INJECTOR ) - { - injectorTracers.push_back( tracerName ); - } - else if ( tracerStatus == RimFlowDiagSolution::TracerStatusType::PRODUCER ) - { - producerTracers.push_back( tracerName ); - } - else if ( tracerStatus == RimFlowDiagSolution::TracerStatusType::VARYING || - tracerStatus == RimFlowDiagSolution::TracerStatusType::UNDEFINED ) - { - injectorTracers.push_back( tracerName ); - producerTracers.push_back( tracerName ); - } - } - setSelectedInjectorTracers( injectorTracers ); - setSelectedProducerTracers( producerTracers ); - } -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -void RimEclipseResultDefinition::setSelectedInjectorTracers( const std::vector& selectedTracers ) -{ - this->m_selectedInjectorTracers = selectedTracers; - this->m_selectedInjectorTracersUiField = selectedTracers; -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -void RimEclipseResultDefinition::setSelectedProducerTracers( const std::vector& selectedTracers ) -{ - this->m_selectedProducerTracers = selectedTracers; - this->m_selectedProducerTracersUiField = selectedTracers; -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -void RimEclipseResultDefinition::setSelectedSouringTracers( const std::vector& selectedTracers ) -{ - this->m_selectedSouringTracers = selectedTracers; - this->m_selectedSouringTracersUiField = selectedTracers; -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -void RimEclipseResultDefinition::updateUiFieldsFromActiveResult() -{ - m_resultTypeUiField = m_resultType; - m_resultVariableUiField = resultVariable(); - m_selectedInjectorTracersUiField = m_selectedInjectorTracers; - m_selectedProducerTracersUiField = m_selectedProducerTracers; - m_selectedSouringTracersUiField = m_selectedSouringTracers; - m_porosityModelUiField = m_porosityModel; -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -void RimEclipseResultDefinition::enableDeltaResults( bool enable ) -{ - m_isDeltaResultEnabled = enable; -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -bool RimEclipseResultDefinition::isTernarySaturationSelected() const -{ - bool isTernary = - ( m_resultType() == RiaDefines::ResultCatType::DYNAMIC_NATIVE ) && - ( m_resultVariable().compare( RiaResultNames::ternarySaturationResultName(), Qt::CaseInsensitive ) == 0 ); - - return isTernary; -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -bool RimEclipseResultDefinition::isCompletionTypeSelected() const -{ - return ( m_resultType() == RiaDefines::ResultCatType::DYNAMIC_NATIVE && - m_resultVariable() == RiaResultNames::completionTypeResultName() ); -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -bool RimEclipseResultDefinition::hasCategoryResult() const -{ - if ( this->m_resultType() == RiaDefines::ResultCatType::FORMATION_NAMES && m_eclipseCase && - m_eclipseCase->eclipseCaseData() && !m_eclipseCase->eclipseCaseData()->formationNames().empty() ) - return true; - - if ( this->m_resultType() == RiaDefines::ResultCatType::DYNAMIC_NATIVE && - this->resultVariable() == RiaResultNames::completionTypeResultName() ) - return true; - - if ( this->m_resultType() == RiaDefines::ResultCatType::FLOW_DIAGNOSTICS && - m_resultVariable() == RIG_FLD_MAX_FRACTION_TRACER_RESNAME ) - return true; - - if ( this->resultVariable() == RiaResultNames::formationAllanResultName() || - this->resultVariable() == RiaResultNames::formationBinaryAllanResultName() ) - { - return true; - } - - if ( !this->hasStaticResult() ) return false; - - return RiaDefines::isNativeCategoryResult( this->resultVariable() ); -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -bool RimEclipseResultDefinition::isFlowDiagOrInjectionFlooding() const -{ - if ( this->m_resultType() == RiaDefines::ResultCatType::FLOW_DIAGNOSTICS || - this->m_resultType() == RiaDefines::ResultCatType::INJECTION_FLOODING ) - { - return true; - } - - return false; -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -void RimEclipseResultDefinition::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) -{ - uiOrdering.add( &m_resultTypeUiField ); - - if ( hasDualPorFractureResult() ) - { - uiOrdering.add( &m_porosityModelUiField ); - } - - if ( m_resultTypeUiField() == RiaDefines::ResultCatType::FLOW_DIAGNOSTICS ) - { - uiOrdering.add( &m_flowSolutionUiField ); - - uiOrdering.add( &m_flowTracerSelectionMode ); - - if ( m_flowTracerSelectionMode == FLOW_TR_BY_SELECTION ) - { - caf::PdmUiGroup* selectionGroup = uiOrdering.addNewGroup( "Tracer Selection" ); - selectionGroup->setEnableFrame( false ); - - caf::PdmUiGroup* injectorGroup = selectionGroup->addNewGroup( "Injectors" ); - injectorGroup->add( &m_selectedInjectorTracersUiField ); - injectorGroup->add( &m_syncInjectorToProducerSelection ); - - caf::PdmUiGroup* producerGroup = selectionGroup->addNewGroup( "Producers", false ); - producerGroup->add( &m_selectedProducerTracersUiField ); - producerGroup->add( &m_syncProducerToInjectorSelection ); - } - - uiOrdering.add( &m_phaseSelection ); - - if ( m_flowSolution() == nullptr ) - { - assignFlowSolutionFromCase(); - } - } - - if ( m_resultTypeUiField() == RiaDefines::ResultCatType::INJECTION_FLOODING ) - { - uiOrdering.add( &m_selectedSouringTracersUiField ); - } - - uiOrdering.add( &m_resultVariableUiField ); - if ( m_resultTypeUiField() == RiaDefines::ResultCatType::INPUT_PROPERTY ) - { - uiOrdering.add( &m_inputPropertyFileName ); - } - - if ( isDivideByCellFaceAreaPossible() ) - { - uiOrdering.add( &m_divideByCellFaceArea ); - - QString resultPropertyLabel = "Result Property"; - if ( isDivideByCellFaceAreaActive() ) - { - resultPropertyLabel += QString( "\nDivided by Area" ); - } - m_resultVariableUiField.uiCapability()->setUiName( resultPropertyLabel ); - } - - { - caf::PdmUiGroup* legendGroup = uiOrdering.addNewGroup( "Legend" ); - legendGroup->add( &m_showOnlyVisibleCategoriesInLegend ); - - bool showOnlyVisibleCategoriesOption = false; - - RimEclipseView* eclView = nullptr; - this->firstAncestorOrThisOfType( eclView ); - - if ( eclView ) - { - if ( eclView->cellResult() == this && this->hasCategoryResult() ) showOnlyVisibleCategoriesOption = true; - } - - if ( m_resultTypeUiField() == RiaDefines::ResultCatType::FLOW_DIAGNOSTICS && - m_resultVariableUiField() == RIG_FLD_MAX_FRACTION_TRACER_RESNAME ) - { - showOnlyVisibleCategoriesOption = true; - } - - legendGroup->setUiHidden( !showOnlyVisibleCategoriesOption ); - } - - if ( isDeltaCasePossible() || isDeltaTimeStepPossible() ) - { - caf::PdmUiGroup* differenceGroup = uiOrdering.addNewGroup( "Difference Options" ); - differenceGroup->setUiReadOnly( !( isDeltaTimeStepPossible() || isDeltaCasePossible() ) ); - - m_differenceCase.uiCapability()->setUiReadOnly( !isDeltaCasePossible() ); - m_timeLapseBaseTimestep.uiCapability()->setUiReadOnly( !isDeltaTimeStepPossible() ); - - if ( isDeltaCasePossible() ) differenceGroup->add( &m_differenceCase ); - if ( isDeltaTimeStepPossible() ) differenceGroup->add( &m_timeLapseBaseTimestep ); - - QString resultPropertyLabel = "Result Property"; - if ( isDeltaTimeStepActive() || isDeltaCaseActive() ) - { - resultPropertyLabel += QString( "\n%1" ).arg( additionalResultTextShort() ); - } - m_resultVariableUiField.uiCapability()->setUiName( resultPropertyLabel ); - } - - uiOrdering.skipRemainingFields( true ); -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -void RimEclipseResultDefinition::defineEditorAttribute( const caf::PdmFieldHandle* field, - QString uiConfigName, - caf::PdmUiEditorAttribute* attribute ) -{ - if ( m_resultTypeUiField() == RiaDefines::ResultCatType::FLOW_DIAGNOSTICS ) - { - if ( field == &m_resultVariableUiField ) - { - caf::PdmUiListEditorAttribute* listEditAttr = dynamic_cast( attribute ); - if ( listEditAttr ) - { - listEditAttr->m_heightHint = 50; - } - } - else if ( field == &m_syncInjectorToProducerSelection || field == &m_syncProducerToInjectorSelection ) - { - caf::PdmUiToolButtonEditorAttribute* toolButtonAttr = - dynamic_cast( attribute ); - if ( toolButtonAttr ) - { - toolButtonAttr->m_sizePolicy.setHorizontalPolicy( QSizePolicy::MinimumExpanding ); - } - } - } - if ( field == &m_resultVariableUiField ) - { - caf::PdmUiListEditorAttribute* listEditAttr = dynamic_cast( attribute ); - if ( listEditAttr ) - { - listEditAttr->m_allowHorizontalScrollBar = false; - } - } -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -bool RimEclipseResultDefinition::TracerComp::operator()( const QString& lhs, const QString& rhs ) const -{ - if ( !lhs.endsWith( "-XF" ) && rhs.endsWith( "-XF" ) ) - { - return true; - } - else if ( lhs.endsWith( "-XF" ) && !rhs.endsWith( "-XF" ) ) - { - return false; - } - else - { - return lhs < rhs; - } -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -void RimEclipseResultDefinition::assignFlowSolutionFromCase() -{ - RimFlowDiagSolution* defaultFlowDiagSolution = nullptr; - - RimEclipseResultCase* eclCase = dynamic_cast( m_eclipseCase.p() ); - - if ( eclCase ) - { - defaultFlowDiagSolution = eclCase->defaultFlowDiagSolution(); - } - this->setFlowSolution( defaultFlowDiagSolution ); -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -bool RimEclipseResultDefinition::hasDualPorFractureResult() -{ - if ( m_eclipseCase && m_eclipseCase->eclipseCaseData() ) - { - return m_eclipseCase->eclipseCaseData()->hasFractureResults(); - } - - return false; -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -QString RimEclipseResultDefinition::flowDiagResUiText( bool shortLabel, int maxTracerStringLength ) const -{ - QString uiText = QString::fromStdString( flowDiagResAddress().variableName ); - if ( flowDiagResAddress().variableName == RIG_FLD_TOF_RESNAME ) - { - uiText = timeOfFlightString( shortLabel ); - } - else if ( flowDiagResAddress().variableName == RIG_FLD_MAX_FRACTION_TRACER_RESNAME ) - { - uiText = maxFractionTracerString( shortLabel ); - } - - QString tracersString = selectedTracersString(); - - if ( !tracersString.isEmpty() ) - { - const QString postfix = "..."; - - if ( tracersString.size() > maxTracerStringLength + postfix.size() ) - { - tracersString = tracersString.left( maxTracerStringLength ); - tracersString += postfix; - } - uiText += QString( "\n%1" ).arg( tracersString ); - } - return uiText; -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -QList - RimEclipseResultDefinition::calcOptionsForVariableUiFieldStandard( RiaDefines::ResultCatType resultCatType, - const RigCaseCellResultsData* results, - bool showDerivedResultsFirst, - bool addPerCellFaceOptionItems, - bool ternaryEnabled ) -{ - CVF_ASSERT( resultCatType != RiaDefines::ResultCatType::FLOW_DIAGNOSTICS && - resultCatType != RiaDefines::ResultCatType::INJECTION_FLOODING ); - - if ( results ) - { - QList optionList; - - QStringList cellCenterResultNames; - QStringList cellFaceResultNames; - - for ( const QString& s : getResultNamesForResultType( resultCatType, results ) ) - { - if ( s == RiaResultNames::completionTypeResultName() ) - { - if ( results->timeStepDates().empty() ) continue; - } - - if ( RiaResultNames::isPerCellFaceResult( s ) ) - { - cellFaceResultNames.push_back( s ); - } - else - { - cellCenterResultNames.push_back( s ); - } - } - - cellCenterResultNames.sort(); - cellFaceResultNames.sort(); - - // Cell Center result names - for ( const QString& s : cellCenterResultNames ) - { - optionList.push_back( caf::PdmOptionItemInfo( s, s ) ); - } - - if ( addPerCellFaceOptionItems ) - { - for ( const QString& s : cellFaceResultNames ) - { - if ( showDerivedResultsFirst ) - { - optionList.push_front( caf::PdmOptionItemInfo( s, s ) ); - } - else - { - optionList.push_back( caf::PdmOptionItemInfo( s, s ) ); - } - } - - // Ternary Result - if ( ternaryEnabled ) - { - bool hasAtLeastOneTernaryComponent = false; - if ( cellCenterResultNames.contains( "SOIL" ) ) - hasAtLeastOneTernaryComponent = true; - else if ( cellCenterResultNames.contains( "SGAS" ) ) - hasAtLeastOneTernaryComponent = true; - else if ( cellCenterResultNames.contains( "SWAT" ) ) - hasAtLeastOneTernaryComponent = true; - - if ( resultCatType == RiaDefines::ResultCatType::DYNAMIC_NATIVE && hasAtLeastOneTernaryComponent ) - { - optionList.push_front( caf::PdmOptionItemInfo( RiaResultNames::ternarySaturationResultName(), - RiaResultNames::ternarySaturationResultName() ) ); - } - } - } - - optionList.push_front( - caf::PdmOptionItemInfo( RiaResultNames::undefinedResultName(), RiaResultNames::undefinedResultName() ) ); - - return optionList; - } - - return QList(); -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -void RimEclipseResultDefinition::setTernaryEnabled( bool enabled ) -{ - m_ternaryEnabled = enabled; -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -bool operator<( const cvf::Color3ub first, const cvf::Color3ub second ) -{ - if ( first.r() != second.r() ) return first.r() < second.r(); - if ( first.g() != second.g() ) return first.g() < second.g(); - if ( first.b() != second.b() ) return first.b() < second.b(); - - return false; -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -class TupleCompare -{ -public: - bool operator()( const std::tuple& t1, - const std::tuple& t2 ) const - { - using namespace std; - if ( get<0>( t1 ) != get<0>( t2 ) ) return get<0>( t1 ) < get<0>( t2 ); - if ( get<1>( t1 ) != get<1>( t2 ) ) return get<1>( t1 ) < get<1>( t2 ); - if ( get<2>( t1 ) != get<2>( t2 ) ) return get<2>( t1 ) < get<2>( t2 ); - - return false; - } -}; - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -void RimEclipseResultDefinition::updateRangesForExplicitLegends( RimRegularLegendConfig* legendConfigToUpdate, - RimTernaryLegendConfig* ternaryLegendConfigToUpdate, - int currentTimeStep ) - -{ - RimEclipseCase* rimEclipseCase = this->eclipseCase(); - - if ( this->hasResult() ) - { - if ( this->isFlowDiagOrInjectionFlooding() ) - { - CVF_ASSERT( currentTimeStep >= 0 ); - - double globalMin, globalMax; - double globalPosClosestToZero, globalNegClosestToZero; - RigFlowDiagResults* flowResultsData = this->flowDiagSolution()->flowDiagResults(); - RigFlowDiagResultAddress resAddr = this->flowDiagResAddress(); - - flowResultsData->minMaxScalarValues( resAddr, currentTimeStep, &globalMin, &globalMax ); - flowResultsData->posNegClosestToZero( resAddr, currentTimeStep, &globalPosClosestToZero, &globalNegClosestToZero ); - - double localMin, localMax; - double localPosClosestToZero, localNegClosestToZero; - if ( this->hasDynamicResult() ) - { - flowResultsData->minMaxScalarValues( resAddr, currentTimeStep, &localMin, &localMax ); - flowResultsData->posNegClosestToZero( resAddr, currentTimeStep, &localPosClosestToZero, &localNegClosestToZero ); - } - else - { - localMin = globalMin; - localMax = globalMax; - - localPosClosestToZero = globalPosClosestToZero; - localNegClosestToZero = globalNegClosestToZero; - } - - CVF_ASSERT( legendConfigToUpdate ); - - legendConfigToUpdate->disableAllTimeStepsRange( true ); - legendConfigToUpdate->setClosestToZeroValues( globalPosClosestToZero, - globalNegClosestToZero, - localPosClosestToZero, - localNegClosestToZero ); - legendConfigToUpdate->setAutomaticRanges( globalMin, globalMax, localMin, localMax ); - - if ( this->hasCategoryResult() ) - { - RimEclipseView* eclView = nullptr; - this->firstAncestorOrThisOfType( eclView ); - - if ( eclView ) - { - std::set, TupleCompare> categories; - - std::vector tracerNames = this->flowDiagSolution()->tracerNames(); - int tracerIndex = 0; - - for ( const auto& tracerName : tracerNames ) - { - cvf::Color3ub color( cvf::Color3::GRAY ); - - RimSimWellInView* well = eclView->wellCollection()->findWell( - RimFlowDiagSolution::removeCrossFlowEnding( tracerName ) ); - - if ( well ) color = cvf::Color3ub( well->wellPipeColor() ); - - categories.insert( std::make_tuple( tracerName, tracerIndex, color ) ); - ++tracerIndex; - } - - std::vector> categoryVector; - - if ( m_showOnlyVisibleCategoriesInLegend ) - { - std::set visibleTracers = - RigVisibleCategoriesCalculator::visibleFlowDiagCategories( *eclView, - *flowResultsData, - resAddr, - currentTimeStep ); - for ( auto tupIt : categories ) - { - int tracerIndex = std::get<1>( tupIt ); - if ( visibleTracers.count( tracerIndex ) ) categoryVector.push_back( tupIt ); - } - } - else - { - for ( auto tupIt : categories ) - { - categoryVector.push_back( tupIt ); - } - } - - legendConfigToUpdate->setCategoryItems( categoryVector ); - } - } - } - else - { - if ( !rimEclipseCase ) return; - - RigEclipseCaseData* eclipseCaseData = rimEclipseCase->eclipseCaseData(); - if ( !eclipseCaseData ) return; - - RigCaseCellResultsData* cellResultsData = eclipseCaseData->results( this->porosityModel() ); - cellResultsData->ensureKnownResultLoaded( this->eclipseResultAddress() ); - - double globalMin, globalMax; - double globalPosClosestToZero, globalNegClosestToZero; - - cellResultsData->minMaxCellScalarValues( this->eclipseResultAddress(), globalMin, globalMax ); - cellResultsData->posNegClosestToZero( this->eclipseResultAddress(), - globalPosClosestToZero, - globalNegClosestToZero ); - - double localMin, localMax; - double localPosClosestToZero, localNegClosestToZero; - if ( this->hasDynamicResult() && currentTimeStep >= 0 ) - { - cellResultsData->minMaxCellScalarValues( this->eclipseResultAddress(), currentTimeStep, localMin, localMax ); - cellResultsData->posNegClosestToZero( this->eclipseResultAddress(), - currentTimeStep, - localPosClosestToZero, - localNegClosestToZero ); - } - else - { - localMin = globalMin; - localMax = globalMax; - - localPosClosestToZero = globalPosClosestToZero; - localNegClosestToZero = globalNegClosestToZero; - } - - CVF_ASSERT( legendConfigToUpdate ); - - legendConfigToUpdate->disableAllTimeStepsRange( false ); - legendConfigToUpdate->setClosestToZeroValues( globalPosClosestToZero, - globalNegClosestToZero, - localPosClosestToZero, - localNegClosestToZero ); - legendConfigToUpdate->setAutomaticRanges( globalMin, globalMax, localMin, localMax ); - - if ( this->hasCategoryResult() ) - { - if ( this->resultType() == RiaDefines::ResultCatType::ALLAN_DIAGRAMS ) - { - if ( this->resultVariable() == RiaResultNames::formationAllanResultName() ) - { - const std::vector fnVector = eclipseCaseData->formationNames(); - std::vector fnameIdxes; - for ( int i = 0; i < static_cast( fnVector.size() ); i++ ) - { - fnameIdxes.push_back( i ); - } - - cvf::Color3ubArray legendBaseColors = legendConfigToUpdate->colorLegend()->colorArray(); - - cvf::ref formationColorMapper = new caf::CategoryMapper; - formationColorMapper->setCategories( fnameIdxes ); - formationColorMapper->setInterpolateColors( legendBaseColors ); - - const std::map, int>& formationCombToCategory = - eclipseCaseData->allanDiagramData()->formationCombinationToCategory(); - - std::vector> categories; - for ( int frmNameIdx : fnameIdxes ) - { - cvf::Color3ub formationColor = formationColorMapper->mapToColor( frmNameIdx ); - categories.emplace_back( std::make_tuple( fnVector[frmNameIdx], frmNameIdx, formationColor ) ); - } - - std::set visibleAllanCategories; - { - RimEclipseView* eclView = nullptr; - this->firstAncestorOrThisOfType( eclView ); - - visibleAllanCategories = RigVisibleCategoriesCalculator::visibleAllanCategories( eclView ); - } - - for ( auto [formationPair, categoryIndex] : formationCombToCategory ) - { - int frmIdx1 = formationPair.first; - int frmIdx2 = formationPair.second; - - if ( visibleAllanCategories.count( categoryIndex ) == 0 ) continue; - - int fnVectorSize = static_cast( fnVector.size() ); - if ( frmIdx1 >= fnVectorSize || frmIdx2 >= fnVectorSize ) continue; - - QString frmName1 = fnVector[frmIdx1]; - QString frmName2 = fnVector[frmIdx2]; - - cvf::Color3f formationColor1 = cvf::Color3f( formationColorMapper->mapToColor( frmIdx1 ) ); - cvf::Color3f formationColor2 = cvf::Color3f( formationColorMapper->mapToColor( frmIdx2 ) ); - - cvf::Color3ub blendColor = - cvf::Color3ub( RiaColorTools::blendCvfColors( formationColor1, formationColor2 ) ); - - categories.emplace_back( - std::make_tuple( frmName1 + "-" + frmName2, categoryIndex, blendColor ) ); - } - - legendConfigToUpdate->setCategoryItems( categories ); - } - else if ( this->resultVariable() == RiaResultNames::formationBinaryAllanResultName() ) - { - std::vector> categories; - categories.emplace_back( std::make_tuple( "Same formation", 0, cvf::Color3ub::BROWN ) ); - categories.emplace_back( std::make_tuple( "Different formation", 1, cvf::Color3ub::ORANGE ) ); - - legendConfigToUpdate->setCategoryItems( categories ); - } - } - else if ( this->resultType() == RiaDefines::ResultCatType::DYNAMIC_NATIVE && - this->resultVariable() == RiaResultNames::completionTypeResultName() ) - { - const std::vector& visibleCategories = - cellResultsData->uniqueCellScalarValues( this->eclipseResultAddress() ); - - std::vector supportedCompletionTypes = - { RiaDefines::WellPathComponentType::WELL_PATH, - RiaDefines::WellPathComponentType::FISHBONES, - RiaDefines::WellPathComponentType::PERFORATION_INTERVAL, - RiaDefines::WellPathComponentType::FRACTURE }; - - RiaColorTables::WellPathComponentColors colors = RiaColorTables::wellPathComponentColors(); - - std::vector> categories; - for ( auto completionType : supportedCompletionTypes ) - { - if ( std::find( visibleCategories.begin(), - visibleCategories.end(), - static_cast( completionType ) ) != visibleCategories.end() ) - { - QString categoryText = - caf::AppEnum::uiText( completionType ); - categories.push_back( std::make_tuple( categoryText, - static_cast( completionType ), - colors[completionType] ) ); - } - } - - legendConfigToUpdate->setCategoryItems( categories ); - } - else - { - auto uniqueValues = cellResultsData->uniqueCellScalarValues( this->eclipseResultAddress() ); - if ( this->eclipseResultAddress().resultCatType() == RiaDefines::ResultCatType::FORMATION_NAMES ) - { - std::vector fnVector = eclipseCaseData->formationNames(); - uniqueValues.resize( fnVector.size() ); - std::iota( uniqueValues.begin(), uniqueValues.end(), 0 ); - } - - cvf::Color3ubArray legendBaseColors = legendConfigToUpdate->colorLegend()->colorArray(); - - cvf::ref categoryMapper = new caf::CategoryMapper; - categoryMapper->setCategories( uniqueValues ); - categoryMapper->setInterpolateColors( legendBaseColors ); - - std::vector visibleCategoryValues = uniqueValues; - - if ( m_showOnlyVisibleCategoriesInLegend ) - { - RimEclipseView* eclView = nullptr; - this->firstAncestorOrThisOfType( eclView ); - if ( eclView && eclView->showWindow() ) - { - // Check if current result is cell result, and update the visible set of values - // TODO: Can be extended to the separate geometry results (separate fault result, separate - // intersection results), but this requires some refactoring - if ( eclView->cellResult() == this ) - { - std::set visibleCategorySet = - RigVisibleCategoriesCalculator::visibleCategories( eclView ); - - visibleCategoryValues.clear(); - visibleCategoryValues.insert( visibleCategoryValues.begin(), - visibleCategorySet.begin(), - visibleCategorySet.end() ); - } - } - } - std::vector> categoryVector; - - for ( auto value : visibleCategoryValues ) - { - cvf::Color3ub categoryColor = categoryMapper->mapToColor( value ); - - QString valueTxt; - if ( this->resultType() == RiaDefines::ResultCatType::FORMATION_NAMES ) - { - std::vector fnVector = eclipseCaseData->formationNames(); - - if ( value < static_cast( fnVector.size() ) ) - { - valueTxt = fnVector[value]; - } - } - else - valueTxt = QString( "%1" ).arg( value ); - - categoryVector.push_back( std::make_tuple( valueTxt, value, categoryColor ) ); - } - legendConfigToUpdate->setCategoryItems( categoryVector ); - } - } - } - } - - // Ternary legend update - { - if ( !rimEclipseCase ) return; - - RigEclipseCaseData* eclipseCase = rimEclipseCase->eclipseCaseData(); - if ( !eclipseCase ) return; - - RigCaseCellResultsData* cellResultsData = eclipseCase->results( this->porosityModel() ); - - size_t maxTimeStepCount = cellResultsData->maxTimeStepCount(); - if ( this->isTernarySaturationSelected() && maxTimeStepCount > 1 ) - { - RigCaseCellResultsData* gridCellResults = this->currentGridCellResults(); - { - RigEclipseResultAddress resAddr( RiaDefines::ResultCatType::DYNAMIC_NATIVE, "SOIL" ); - - if ( gridCellResults->ensureKnownResultLoaded( resAddr ) ) - { - double globalMin = 0.0; - double globalMax = 1.0; - double localMin = 0.0; - double localMax = 1.0; - - cellResultsData->minMaxCellScalarValues( resAddr, globalMin, globalMax ); - cellResultsData->minMaxCellScalarValues( resAddr, currentTimeStep, localMin, localMax ); - - ternaryLegendConfigToUpdate->setAutomaticRanges( RimTernaryLegendConfig::TERNARY_SOIL_IDX, - globalMin, - globalMax, - localMin, - localMax ); - } - } - - { - RigEclipseResultAddress resAddr( RiaDefines::ResultCatType::DYNAMIC_NATIVE, "SGAS" ); - - if ( gridCellResults->ensureKnownResultLoaded( resAddr ) ) - { - double globalMin = 0.0; - double globalMax = 1.0; - double localMin = 0.0; - double localMax = 1.0; - - cellResultsData->minMaxCellScalarValues( resAddr, globalMin, globalMax ); - cellResultsData->minMaxCellScalarValues( resAddr, currentTimeStep, localMin, localMax ); - - ternaryLegendConfigToUpdate->setAutomaticRanges( RimTernaryLegendConfig::TERNARY_SGAS_IDX, - globalMin, - globalMax, - localMin, - localMax ); - } - } - - { - RigEclipseResultAddress resAddr( RiaDefines::ResultCatType::DYNAMIC_NATIVE, "SWAT" ); - - if ( gridCellResults->ensureKnownResultLoaded( resAddr ) ) - { - double globalMin = 0.0; - double globalMax = 1.0; - double localMin = 0.0; - double localMax = 1.0; - - cellResultsData->minMaxCellScalarValues( resAddr, globalMin, globalMax ); - cellResultsData->minMaxCellScalarValues( resAddr, currentTimeStep, localMin, localMax ); - - ternaryLegendConfigToUpdate->setAutomaticRanges( RimTernaryLegendConfig::TERNARY_SWAT_IDX, - globalMin, - globalMax, - localMin, - localMax ); - } - } - } - } -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -void RimEclipseResultDefinition::updateLegendTitle( RimRegularLegendConfig* legendConfig, const QString& legendHeading ) -{ - QString title = legendHeading + this->resultVariableUiName(); - if ( !this->additionalResultTextShort().isEmpty() ) - { - title += additionalResultTextShort(); - } - - if ( this->hasDualPorFractureResult() ) - { - QString porosityModelText = caf::AppEnum::uiText( this->porosityModel() ); - - title += QString( "\nDual Por : %1" ).arg( porosityModelText ); - } - - legendConfig->setTitle( title ); -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -QList RimEclipseResultDefinition::calcOptionsForSelectedTracerField( bool injector ) -{ - QList options; - - RimFlowDiagSolution* flowSol = m_flowSolutionUiField(); - if ( flowSol ) - { - std::set sortedTracers = setOfTracersOfType( injector ); - - for ( const QString& tracerName : sortedTracers ) - { - QString postfix; - RimFlowDiagSolution::TracerStatusType status = flowSol->tracerStatusOverall( tracerName ); - if ( status == RimFlowDiagSolution::TracerStatusType::VARYING ) - { - postfix = " [I/P]"; - } - else if ( status == RimFlowDiagSolution::TracerStatusType::UNDEFINED ) - { - postfix = " [U]"; - } - options.push_back( caf::PdmOptionItemInfo( tracerName + postfix, tracerName ) ); - } - } - return options; -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -QString RimEclipseResultDefinition::timeOfFlightString( bool shorter ) const -{ - QString tofString; - bool multipleSelected = false; - if ( injectorSelectionState() != NONE_SELECTED && producerSelectionState() != NONE_SELECTED ) - { - tofString = shorter ? "Res.Time" : "Residence Time"; - multipleSelected = true; - } - else if ( injectorSelectionState() != NONE_SELECTED ) - { - tofString = shorter ? "Fwd.TOF" : "Forward Time of Flight"; - } - else if ( producerSelectionState() != NONE_SELECTED ) - { - tofString = shorter ? "Rev.TOF" : "Reverse Time of Flight"; - } - else - { - tofString = shorter ? "TOF" : "Time of Flight"; - } - - multipleSelected = multipleSelected || injectorSelectionState() >= MULTIPLE_SELECTED || - producerSelectionState() >= MULTIPLE_SELECTED; - - if ( multipleSelected && !shorter ) - { - tofString += " (Average)"; - } - - tofString += " [days]"; - // Conversion from seconds in flow module to days is done in RigFlowDiagTimeStepResult::setTracerTOF() - - return tofString; -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -QString RimEclipseResultDefinition::maxFractionTracerString( bool shorter ) const -{ - QString mfString; - if ( injectorSelectionState() >= ONE_SELECTED && producerSelectionState() == NONE_SELECTED ) - { - mfString = shorter ? "FloodReg" : "Flooding Region"; - if ( injectorSelectionState() >= MULTIPLE_SELECTED ) mfString += "s"; - } - else if ( injectorSelectionState() == NONE_SELECTED && producerSelectionState() >= ONE_SELECTED ) - { - mfString = shorter ? "DrainReg" : "Drainage Region"; - if ( producerSelectionState() >= MULTIPLE_SELECTED ) mfString += "s"; - } - else - { - mfString = shorter ? "Drain&FloodReg" : "Drainage/Flooding Regions"; - } - return mfString; -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -QString RimEclipseResultDefinition::selectedTracersString() const -{ - QStringList fullTracersList; - - FlowTracerSelectionState injectorState = injectorSelectionState(); - FlowTracerSelectionState producerState = producerSelectionState(); - - if ( injectorState == ALL_SELECTED && producerState == ALL_SELECTED ) - { - fullTracersList += caf::AppEnum::uiText( FLOW_TR_INJ_AND_PROD ); - } - else - { - if ( injectorState == ALL_SELECTED ) - { - fullTracersList += caf::AppEnum::uiText( FLOW_TR_INJECTORS ); - } - - if ( producerState == ALL_SELECTED ) - { - fullTracersList += caf::AppEnum::uiText( FLOW_TR_PRODUCERS ); - } - - if ( injectorSelectionState() == ONE_SELECTED || injectorSelectionState() == MULTIPLE_SELECTED ) - { - QStringList listOfSelectedInjectors; - for ( const QString& injector : m_selectedInjectorTracers() ) - { - listOfSelectedInjectors.push_back( injector ); - } - if ( !listOfSelectedInjectors.empty() ) - { - fullTracersList += listOfSelectedInjectors.join( ", " ); - } - } - - if ( producerSelectionState() == ONE_SELECTED || producerSelectionState() == MULTIPLE_SELECTED ) - { - QStringList listOfSelectedProducers; - for ( const QString& producer : m_selectedProducerTracers() ) - { - listOfSelectedProducers.push_back( producer ); - } - if ( !listOfSelectedProducers.empty() ) - { - fullTracersList.push_back( listOfSelectedProducers.join( ", " ) ); - } - } - } - - QString tracersText; - if ( !fullTracersList.empty() ) - { - tracersText = fullTracersList.join( ", " ); - } - return tracersText; -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -QStringList RimEclipseResultDefinition::getResultNamesForResultType( RiaDefines::ResultCatType resultCatType, - const RigCaseCellResultsData* results ) -{ - if ( resultCatType != RiaDefines::ResultCatType::FLOW_DIAGNOSTICS ) - { - if ( !results ) return QStringList(); - - return results->resultNames( resultCatType ); - } - else - { - QStringList flowVars; - flowVars.push_back( RIG_FLD_TOF_RESNAME ); - flowVars.push_back( RIG_FLD_CELL_FRACTION_RESNAME ); - flowVars.push_back( RIG_FLD_MAX_FRACTION_TRACER_RESNAME ); - flowVars.push_back( RIG_FLD_COMMUNICATION_RESNAME ); - return flowVars; - } -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -std::vector RimEclipseResultDefinition::allTracerNames() const -{ - std::vector tracerNames; - - RimFlowDiagSolution* flowSol = m_flowSolutionUiField(); - if ( flowSol ) - { - tracerNames = flowSol->tracerNames(); - } - - return tracerNames; -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -std::set RimEclipseResultDefinition::setOfTracersOfType( bool injector ) const -{ - std::set sortedTracers; - - RimFlowDiagSolution* flowSol = m_flowSolutionUiField(); - if ( flowSol ) - { - std::vector tracerNames = allTracerNames(); - for ( const QString& tracerName : tracerNames ) - { - RimFlowDiagSolution::TracerStatusType status = flowSol->tracerStatusOverall( tracerName ); - bool includeTracer = status == RimFlowDiagSolution::TracerStatusType::VARYING || - status == RimFlowDiagSolution::TracerStatusType::UNDEFINED; - includeTracer |= injector && status == RimFlowDiagSolution::TracerStatusType::INJECTOR; - includeTracer |= !injector && status == RimFlowDiagSolution::TracerStatusType::PRODUCER; - - if ( includeTracer ) - { - sortedTracers.insert( tracerName ); - } - } - } - return sortedTracers; -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -RimEclipseResultDefinition::FlowTracerSelectionState RimEclipseResultDefinition::injectorSelectionState() const -{ - if ( m_flowTracerSelectionMode == FLOW_TR_INJECTORS || m_flowTracerSelectionMode == FLOW_TR_INJ_AND_PROD ) - { - return ALL_SELECTED; - } - else if ( m_flowTracerSelectionMode == FLOW_TR_BY_SELECTION ) - { - if ( m_selectedInjectorTracers().size() == setOfTracersOfType( true ).size() ) - { - return ALL_SELECTED; - } - else if ( m_selectedInjectorTracers().size() == (size_t)1 ) - { - return ONE_SELECTED; - } - else if ( m_selectedInjectorTracers().size() > (size_t)1 ) - { - return MULTIPLE_SELECTED; - } - } - return NONE_SELECTED; -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -RimEclipseResultDefinition::FlowTracerSelectionState RimEclipseResultDefinition::producerSelectionState() const -{ - if ( m_flowTracerSelectionMode == FLOW_TR_PRODUCERS || m_flowTracerSelectionMode == FLOW_TR_INJ_AND_PROD ) - { - return ALL_SELECTED; - } - else if ( m_flowTracerSelectionMode == FLOW_TR_BY_SELECTION ) - { - if ( m_selectedProducerTracers().size() == setOfTracersOfType( false ).size() ) - { - return ALL_SELECTED; - } - else if ( m_selectedProducerTracers().size() == (size_t)1 ) - { - return ONE_SELECTED; - } - else if ( m_selectedProducerTracers().size() > (size_t)1 ) - { - return MULTIPLE_SELECTED; - } - } - return NONE_SELECTED; -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -void RimEclipseResultDefinition::syncInjectorToProducerSelection() -{ - const double epsilon = 1.0e-8; - - int timeStep = 0; - - Rim3dView* rimView = nullptr; - this->firstAncestorOrThisOfType( rimView ); - if ( rimView ) - { - timeStep = rimView->currentTimeStep(); - } - - RimFlowDiagSolution* flowSol = m_flowSolution(); - if ( flowSol && m_flowTracerSelectionMode == FLOW_TR_BY_SELECTION ) - { - std::set producers = setOfTracersOfType( false ); - - std::set newProducerSelection; - for ( const QString& selectedInjector : m_selectedInjectorTracers() ) - { - for ( const QString& producer : producers ) - { - std::pair commFluxes = - flowSol->flowDiagResults()->injectorProducerPairFluxes( selectedInjector.toStdString(), - producer.toStdString(), - timeStep ); - if ( std::abs( commFluxes.first ) > epsilon || std::abs( commFluxes.second ) > epsilon ) - { - newProducerSelection.insert( producer ); - } - } - } - // Add all currently selected producers to set - for ( const QString& selectedProducer : m_selectedProducerTracers() ) - { - newProducerSelection.insert( selectedProducer ); - } - std::vector newProducerVector( newProducerSelection.begin(), newProducerSelection.end() ); - setSelectedProducerTracers( newProducerVector ); - } -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -void RimEclipseResultDefinition::syncProducerToInjectorSelection() -{ - const double epsilon = 1.0e-8; - - int timeStep = 0; - - Rim3dView* rimView = nullptr; - this->firstAncestorOrThisOfType( rimView ); - if ( rimView ) - { - timeStep = rimView->currentTimeStep(); - } - - RimFlowDiagSolution* flowSol = m_flowSolution(); - if ( flowSol && m_flowTracerSelectionMode == FLOW_TR_BY_SELECTION ) - { - std::set injectors = setOfTracersOfType( true ); - - std::set newInjectorSelection; - for ( const QString& selectedProducer : m_selectedProducerTracers() ) - { - for ( const QString& injector : injectors ) - { - std::pair commFluxes = - flowSol->flowDiagResults()->injectorProducerPairFluxes( injector.toStdString(), - selectedProducer.toStdString(), - timeStep ); - if ( std::abs( commFluxes.first ) > epsilon || std::abs( commFluxes.second ) > epsilon ) - { - newInjectorSelection.insert( injector ); - } - } - } - // Add all currently selected injectors to set - for ( const QString& selectedInjector : m_selectedInjectorTracers() ) - { - newInjectorSelection.insert( selectedInjector ); - } - std::vector newInjectorVector( newInjectorSelection.begin(), newInjectorSelection.end() ); - setSelectedInjectorTracers( newInjectorVector ); - } -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -bool RimEclipseResultDefinition::isDeltaResultEnabled() const -{ - return m_isDeltaResultEnabled; -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -bool RimEclipseResultDefinition::isDeltaTimeStepPossible() const -{ - return isDeltaResultEnabled() && m_resultTypeUiField() == RiaDefines::ResultCatType::DYNAMIC_NATIVE && - !isTernarySaturationSelected(); -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -bool RimEclipseResultDefinition::isDeltaTimeStepActive() const -{ - return isDeltaTimeStepPossible() && m_timeLapseBaseTimestep() >= 0; -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -bool RimEclipseResultDefinition::isDeltaCasePossible() const -{ - return isDeltaResultEnabled() && !isTernarySaturationSelected() && - ( m_resultTypeUiField() == RiaDefines::ResultCatType::DYNAMIC_NATIVE || - m_resultTypeUiField() == RiaDefines::ResultCatType::STATIC_NATIVE || - m_resultTypeUiField() == RiaDefines::ResultCatType::GENERATED ); -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -bool RimEclipseResultDefinition::isDeltaCaseActive() const -{ - return isDeltaCasePossible() && m_differenceCase() != nullptr; -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -bool RimEclipseResultDefinition::isDivideByCellFaceAreaPossible() const -{ - QString str = m_resultVariable; - - // TODO : Move to RiaDefines or a separate file for cell face results - - if ( str == "FLRWATI+" ) return true; - if ( str == "FLRWATJ+" ) return true; - if ( str == "FLRWATK+" ) return true; - - if ( str == "FLROILI+" ) return true; - if ( str == "FLROILJ+" ) return true; - if ( str == "FLROILK+" ) return true; - - if ( str == "FLRGASI+" ) return true; - if ( str == "FLRGASJ+" ) return true; - if ( str == "FLRGASK+" ) return true; - - if ( str == "TRANX" ) return true; - if ( str == "TRANY" ) return true; - if ( str == "TRANZ" ) return true; - - if ( str == "riTRANX" ) return true; - if ( str == "riTRANY" ) return true; - if ( str == "riTRANZ" ) return true; - - return false; -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -bool RimEclipseResultDefinition::isDivideByCellFaceAreaActive() const -{ - return isDivideByCellFaceAreaPossible() && m_divideByCellFaceArea; -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -bool RimEclipseResultDefinition::showDerivedResultsFirstInVariableUiField() const -{ - // Cell Face result names - bool showDerivedResultsFirstInList = false; - RimEclipseFaultColors* rimEclipseFaultColors = nullptr; - this->firstAncestorOrThisOfType( rimEclipseFaultColors ); - - if ( rimEclipseFaultColors ) showDerivedResultsFirstInList = true; - - return showDerivedResultsFirstInList; -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -bool RimEclipseResultDefinition::addPerCellFaceOptionsForVariableUiField() const -{ - RimPlotCurve* curve = nullptr; - this->firstAncestorOrThisOfType( curve ); - - RimEclipsePropertyFilter* propFilter = nullptr; - this->firstAncestorOrThisOfType( propFilter ); - - RimCellEdgeColors* cellEdge = nullptr; - this->firstAncestorOrThisOfType( cellEdge ); - - if ( propFilter || curve || cellEdge ) - { - return false; - } - - return true; -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -QString RimEclipseResultDefinition::getInputPropertyFileName( const QString& resultName ) const -{ - RimEclipseCase* eclipseCase; - this->firstAncestorOrThisOfType( eclipseCase ); - - if ( eclipseCase ) - { - RimEclipseInputPropertyCollection* inputPropertyCollection = eclipseCase->inputPropertyCollection(); - if ( inputPropertyCollection ) - { - RimEclipseInputProperty* inputProperty = inputPropertyCollection->findInputProperty( resultName ); - if ( inputProperty ) - { - return inputProperty->fileName.v().path(); - } - } - } - - return ""; -} +///////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2011- Statoil ASA +// Copyright (C) 2013- Ceetron Solutions AS +// Copyright (C) 2011-2012 Ceetron AS +// +// ResInsight is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// + +#include "RimEclipseResultDefinition.h" + +#include "RiaColorTables.h" +#include "RiaColorTools.h" +#include "RiaLogging.h" +#include "RiaNncDefines.h" +#include "RiaQDateTimeTools.h" + +#include "RicfCommandObject.h" + +#include "RigActiveCellInfo.h" +#include "RigAllanDiagramData.h" +#include "RigCaseCellResultsData.h" +#include "RigEclipseCaseData.h" +#include "RigEclipseResultInfo.h" +#include "RigFlowDiagResultAddress.h" +#include "RigFlowDiagResults.h" +#include "RigFormationNames.h" +#include "RigVisibleCategoriesCalculator.h" + +#include "Rim3dView.h" +#include "Rim3dWellLogCurve.h" +#include "RimCellEdgeColors.h" +#include "RimColorLegend.h" +#include "RimContourMapProjection.h" +#include "RimEclipseCase.h" +#include "RimEclipseCellColors.h" +#include "RimEclipseContourMapProjection.h" +#include "RimEclipseContourMapView.h" +#include "RimEclipseFaultColors.h" +#include "RimEclipseInputProperty.h" +#include "RimEclipseInputPropertyCollection.h" +#include "RimEclipsePropertyFilter.h" +#include "RimEclipseResultCase.h" +#include "RimEclipseView.h" +#include "RimFlowDiagSolution.h" +#include "RimGridCrossPlot.h" +#include "RimGridCrossPlotDataSet.h" +#include "RimGridTimeHistoryCurve.h" +#include "RimIntersectionCollection.h" +#include "RimIntersectionResultDefinition.h" +#include "RimPlotCurve.h" +#include "RimProject.h" +#include "RimReservoirCellResultsStorage.h" +#include "RimSimWellInView.h" +#include "RimSimWellInViewCollection.h" +#include "RimTernaryLegendConfig.h" +#include "RimViewLinker.h" +#include "RimWellLogExtractionCurve.h" +#include "RimWellLogTrack.h" + +#ifdef USE_QTCHARTS +#include "RimGridStatisticsPlot.h" +#endif + +#include "cafCategoryMapper.h" +#include "cafPdmFieldScriptingCapability.h" +#include "cafPdmUiListEditor.h" +#include "cafPdmUiToolButtonEditor.h" +#include "cafPdmUiTreeSelectionEditor.h" +#include "cafUtils.h" + +#include + +namespace caf +{ +template <> +void RimEclipseResultDefinition::FlowTracerSelectionEnum::setUp() +{ + addItem( RimEclipseResultDefinition::FLOW_TR_INJ_AND_PROD, "FLOW_TR_INJ_AND_PROD", "All Injectors and Producers" ); + addItem( RimEclipseResultDefinition::FLOW_TR_PRODUCERS, "FLOW_TR_PRODUCERS", "All Producers" ); + addItem( RimEclipseResultDefinition::FLOW_TR_INJECTORS, "FLOW_TR_INJECTORS", "All Injectors" ); + addItem( RimEclipseResultDefinition::FLOW_TR_BY_SELECTION, "FLOW_TR_BY_SELECTION", "By Selection" ); + + setDefault( RimEclipseResultDefinition::FLOW_TR_INJ_AND_PROD ); +} +} // namespace caf + +CAF_PDM_SOURCE_INIT( RimEclipseResultDefinition, "ResultDefinition" ); + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RimEclipseResultDefinition::RimEclipseResultDefinition( caf::PdmUiItemInfo::LabelPosType labelPosition ) + : m_isDeltaResultEnabled( false ) + , m_labelPosition( labelPosition ) + , m_ternaryEnabled( true ) +{ + CAF_PDM_InitScriptableObjectWithNameAndComment( "Result Definition", "", "", "", "EclipseResult", "An eclipse result definition" ); + + CAF_PDM_InitScriptableFieldNoDefault( &m_resultType, "ResultType", "Type", "", "", "" ); + m_resultType.uiCapability()->setUiHidden( true ); + + CAF_PDM_InitScriptableFieldNoDefault( &m_porosityModel, "PorosityModelType", "Porosity", "", "", "" ); + m_porosityModel.uiCapability()->setUiHidden( true ); + + CAF_PDM_InitScriptableField( &m_resultVariable, + "ResultVariable", + RiaResultNames::undefinedResultName(), + "Variable", + "", + "", + "" ); + m_resultVariable.uiCapability()->setUiHidden( true ); + + CAF_PDM_InitFieldNoDefault( &m_flowSolution, "FlowDiagSolution", "Solution", "", "", "" ); + m_flowSolution.uiCapability()->setUiHidden( true ); + + CAF_PDM_InitField( &m_timeLapseBaseTimestep, + "TimeLapseBaseTimeStep", + RigEclipseResultAddress::noTimeLapseValue(), + "Base Time Step", + "", + "", + "" ); + + CAF_PDM_InitFieldNoDefault( &m_differenceCase, "DifferenceCase", "Difference Case", "", "", "" ); + + CAF_PDM_InitField( &m_divideByCellFaceArea, "DivideByCellFaceArea", false, "Divide By Area", "", "", "" ); + + CAF_PDM_InitScriptableFieldNoDefault( &m_selectedInjectorTracers, "SelectedInjectorTracers", "Injector Tracers", "", "", "" ); + m_selectedInjectorTracers.uiCapability()->setUiHidden( true ); + + CAF_PDM_InitScriptableFieldNoDefault( &m_selectedProducerTracers, "SelectedProducerTracers", "Producer Tracers", "", "", "" ); + m_selectedProducerTracers.uiCapability()->setUiHidden( true ); + + CAF_PDM_InitScriptableFieldNoDefault( &m_selectedSouringTracers, "SelectedSouringTracers", "Tracers", "", "", "" ); + m_selectedSouringTracers.uiCapability()->setUiHidden( true ); + + CAF_PDM_InitScriptableFieldNoDefault( &m_flowTracerSelectionMode, "FlowTracerSelectionMode", "Tracers", "", "", "" ); + CAF_PDM_InitScriptableFieldNoDefault( &m_phaseSelection, "PhaseSelection", "Phases", "", "", "" ); + m_phaseSelection.uiCapability()->setUiLabelPosition( m_labelPosition ); + + CAF_PDM_InitScriptableField( &m_showOnlyVisibleCategoriesInLegend, + "ShowOnlyVisibleCategoriesInLegend", + true, + "Show Only Visible Categories In Legend", + "", + "", + "" ); + + // Ui only fields + + CAF_PDM_InitFieldNoDefault( &m_resultTypeUiField, "MResultType", "Type", "", "", "" ); + m_resultTypeUiField.xmlCapability()->disableIO(); + m_resultTypeUiField.uiCapability()->setUiLabelPosition( m_labelPosition ); + + CAF_PDM_InitFieldNoDefault( &m_porosityModelUiField, "MPorosityModelType", "Porosity", "", "", "" ); + m_porosityModelUiField.xmlCapability()->disableIO(); + m_porosityModelUiField.uiCapability()->setUiLabelPosition( m_labelPosition ); + + CAF_PDM_InitField( &m_resultVariableUiField, + "MResultVariable", + RiaResultNames::undefinedResultName(), + "Result Property", + "", + "", + "" ); + m_resultVariableUiField.xmlCapability()->disableIO(); + m_resultVariableUiField.uiCapability()->setUiEditorTypeName( caf::PdmUiListEditor::uiEditorTypeName() ); + m_resultVariableUiField.uiCapability()->setUiLabelPosition( m_labelPosition ); + + CAF_PDM_InitFieldNoDefault( &m_inputPropertyFileName, "InputPropertyFileName", "File Name", "", "", "" ); + m_inputPropertyFileName.xmlCapability()->disableIO(); + m_inputPropertyFileName.uiCapability()->setUiReadOnly( true ); + + CAF_PDM_InitFieldNoDefault( &m_flowSolutionUiField, "MFlowDiagSolution", "Solution", "", "", "" ); + m_flowSolutionUiField.xmlCapability()->disableIO(); + m_flowSolutionUiField.uiCapability()->setUiHidden( true ); // For now since there are only one to choose from + + CAF_PDM_InitField( &m_syncInjectorToProducerSelection, "MSyncSelectedInjProd", false, "Add Communicators ->", "", "", "" ); + m_syncInjectorToProducerSelection.uiCapability()->setUiEditorTypeName( caf::PdmUiToolButtonEditor::uiEditorTypeName() ); + + CAF_PDM_InitField( &m_syncProducerToInjectorSelection, "MSyncSelectedProdInj", false, "<- Add Communicators", "", "", "" ); + m_syncProducerToInjectorSelection.uiCapability()->setUiEditorTypeName( caf::PdmUiToolButtonEditor::uiEditorTypeName() ); + + CAF_PDM_InitFieldNoDefault( &m_selectedInjectorTracersUiField, "MSelectedInjectorTracers", "Injector Tracers", "", "", "" ); + m_selectedInjectorTracersUiField.xmlCapability()->disableIO(); + m_selectedInjectorTracersUiField.uiCapability()->setUiEditorTypeName( + caf::PdmUiTreeSelectionEditor::uiEditorTypeName() ); + m_selectedInjectorTracersUiField.uiCapability()->setUiLabelPosition( caf::PdmUiItemInfo::HIDDEN ); + + CAF_PDM_InitFieldNoDefault( &m_selectedProducerTracersUiField, "MSelectedProducerTracers", "Producer Tracers", "", "", "" ); + m_selectedProducerTracersUiField.xmlCapability()->disableIO(); + m_selectedProducerTracersUiField.uiCapability()->setUiEditorTypeName( + caf::PdmUiTreeSelectionEditor::uiEditorTypeName() ); + m_selectedProducerTracersUiField.uiCapability()->setUiLabelPosition( caf::PdmUiItemInfo::HIDDEN ); + + CAF_PDM_InitFieldNoDefault( &m_selectedSouringTracersUiField, "MSelectedSouringTracers", "Tracers", "", "", "" ); + m_selectedSouringTracersUiField.xmlCapability()->disableIO(); + m_selectedSouringTracersUiField.uiCapability()->setUiEditorTypeName( caf::PdmUiListEditor::uiEditorTypeName() ); + m_selectedSouringTracersUiField.uiCapability()->setUiLabelPosition( m_labelPosition ); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RimEclipseResultDefinition::~RimEclipseResultDefinition() +{ +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimEclipseResultDefinition::simpleCopy( const RimEclipseResultDefinition* other ) +{ + this->setResultVariable( other->resultVariable() ); + this->setPorosityModel( other->porosityModel() ); + this->setResultType( other->resultType() ); + this->setFlowSolution( other->m_flowSolution() ); + this->setSelectedInjectorTracers( other->m_selectedInjectorTracers() ); + this->setSelectedProducerTracers( other->m_selectedProducerTracers() ); + this->setSelectedSouringTracers( other->m_selectedSouringTracers() ); + m_flowTracerSelectionMode = other->m_flowTracerSelectionMode(); + m_phaseSelection = other->m_phaseSelection; + + m_differenceCase = other->m_differenceCase(); + m_timeLapseBaseTimestep = other->m_timeLapseBaseTimestep(); + m_divideByCellFaceArea = other->m_divideByCellFaceArea(); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimEclipseResultDefinition::setEclipseCase( RimEclipseCase* eclipseCase ) +{ + m_eclipseCase = eclipseCase; + + assignFlowSolutionFromCase(); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RimEclipseCase* RimEclipseResultDefinition::eclipseCase() const +{ + return m_eclipseCase; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RigCaseCellResultsData* RimEclipseResultDefinition::currentGridCellResults() const +{ + if ( !m_eclipseCase ) return nullptr; + + return m_eclipseCase->results( m_porosityModel() ); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimEclipseResultDefinition::fieldChangedByUi( const caf::PdmFieldHandle* changedField, + const QVariant& oldValue, + const QVariant& newValue ) +{ + if ( &m_flowSolutionUiField == changedField || &m_resultTypeUiField == changedField || + &m_porosityModelUiField == changedField ) + { + // If the user are seeing the list with the actually selected result, + // select that result in the list. Otherwise select nothing. + + QStringList varList = getResultNamesForResultType( m_resultTypeUiField(), this->currentGridCellResults() ); + + bool isFlowDiagFieldsRelevant = ( m_resultType() == RiaDefines::ResultCatType::FLOW_DIAGNOSTICS ); + + if ( ( m_flowSolutionUiField() == m_flowSolution() || !isFlowDiagFieldsRelevant ) && + m_resultTypeUiField() == m_resultType() && m_porosityModelUiField() == m_porosityModel() ) + { + if ( varList.contains( resultVariable() ) ) + { + m_resultVariableUiField = resultVariable(); + } + + if ( isFlowDiagFieldsRelevant ) + { + m_selectedInjectorTracersUiField = m_selectedInjectorTracers(); + m_selectedProducerTracersUiField = m_selectedProducerTracers(); + } + else + { + m_selectedInjectorTracersUiField = std::vector(); + m_selectedProducerTracersUiField = std::vector(); + } + } + else + { + m_resultVariableUiField = ""; + m_selectedInjectorTracersUiField = std::vector(); + m_selectedProducerTracersUiField = std::vector(); + } + } + + if ( &m_resultVariableUiField == changedField ) + { + m_porosityModel = m_porosityModelUiField; + m_resultType = m_resultTypeUiField; + m_resultVariable = m_resultVariableUiField; + + if ( m_resultTypeUiField() == RiaDefines::ResultCatType::FLOW_DIAGNOSTICS ) + { + m_flowSolution = m_flowSolutionUiField(); + m_selectedInjectorTracers = m_selectedInjectorTracersUiField(); + m_selectedProducerTracers = m_selectedProducerTracersUiField(); + } + else if ( m_resultTypeUiField() == RiaDefines::ResultCatType::INJECTION_FLOODING ) + { + m_selectedSouringTracers = m_selectedSouringTracersUiField(); + } + else if ( m_resultTypeUiField() == RiaDefines::ResultCatType::INPUT_PROPERTY ) + { + m_inputPropertyFileName = getInputPropertyFileName( newValue.toString() ); + } + loadDataAndUpdate(); + } + + if ( &m_porosityModelUiField == changedField ) + { + m_porosityModel = m_porosityModelUiField; + m_resultVariableUiField = resultVariable(); + + RimEclipseView* eclipseView = nullptr; + this->firstAncestorOrThisOfType( eclipseView ); + if ( eclipseView ) + { + // Active cells can be different between matrix and fracture, make sure all geometry is recreated + eclipseView->scheduleReservoirGridGeometryRegen(); + } + + loadDataAndUpdate(); + } + + RimEclipseContourMapView* contourMapView = nullptr; + this->firstAncestorOrThisOfType( contourMapView ); + + if ( &m_differenceCase == changedField ) + { + m_timeLapseBaseTimestep = RigEclipseResultAddress::noTimeLapseValue(); + + if ( contourMapView ) + { + contourMapView->contourMapProjection()->updatedWeightingResult(); + } + + loadDataAndUpdate(); + } + + if ( &m_timeLapseBaseTimestep == changedField ) + { + if ( contourMapView ) + { + contourMapView->contourMapProjection()->updatedWeightingResult(); + } + + loadDataAndUpdate(); + } + + if ( &m_divideByCellFaceArea == changedField ) + { + loadDataAndUpdate(); + } + + if ( &m_flowTracerSelectionMode == changedField ) + { + loadDataAndUpdate(); + } + + if ( &m_selectedInjectorTracersUiField == changedField ) + { + changedTracerSelectionField( true ); + } + + if ( &m_selectedProducerTracersUiField == changedField ) + { + changedTracerSelectionField( false ); + } + + if ( &m_syncInjectorToProducerSelection == changedField ) + { + syncInjectorToProducerSelection(); + m_syncInjectorToProducerSelection = false; + } + + if ( &m_syncProducerToInjectorSelection == changedField ) + { + syncProducerToInjectorSelection(); + m_syncProducerToInjectorSelection = false; + } + + if ( &m_selectedSouringTracersUiField == changedField ) + { + if ( !m_resultVariable().isEmpty() ) + { + m_selectedSouringTracers = m_selectedSouringTracersUiField(); + loadDataAndUpdate(); + } + } + + if ( &m_phaseSelection == changedField ) + { + if ( m_phaseSelection() != RigFlowDiagResultAddress::PHASE_ALL ) + { + m_resultType = m_resultTypeUiField; + m_resultVariable = RIG_FLD_TOF_RESNAME; + m_resultVariableUiField = RIG_FLD_TOF_RESNAME; + } + loadDataAndUpdate(); + } + + if ( &m_showOnlyVisibleCategoriesInLegend == changedField ) + { + loadDataAndUpdate(); + } + + updateAnyFieldHasChanged(); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimEclipseResultDefinition::changedTracerSelectionField( bool injector ) +{ + m_flowSolution = m_flowSolutionUiField(); + + std::vector& selectedTracers = injector ? m_selectedInjectorTracers.v() : m_selectedProducerTracers.v(); + const std::vector& selectedTracersUi = injector ? m_selectedInjectorTracersUiField.v() + : m_selectedProducerTracersUiField.v(); + + selectedTracers = selectedTracersUi; + + loadDataAndUpdate(); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimEclipseResultDefinition::updateAnyFieldHasChanged() +{ + RimEclipsePropertyFilter* propFilter = nullptr; + this->firstAncestorOrThisOfType( propFilter ); + if ( propFilter ) + { + propFilter->updateConnectedEditors(); + } + + RimEclipseFaultColors* faultColors = nullptr; + this->firstAncestorOrThisOfType( faultColors ); + if ( faultColors ) + { + faultColors->updateConnectedEditors(); + } + + RimCellEdgeColors* cellEdgeColors = nullptr; + this->firstAncestorOrThisOfType( cellEdgeColors ); + if ( cellEdgeColors ) + { + cellEdgeColors->updateConnectedEditors(); + } + + RimEclipseCellColors* cellColors = nullptr; + this->firstAncestorOrThisOfType( cellColors ); + if ( cellColors ) + { + cellColors->updateConnectedEditors(); + } + + RimIntersectionResultDefinition* intersectResDef = nullptr; + this->firstAncestorOrThisOfType( intersectResDef ); + if ( intersectResDef ) + { + intersectResDef->updateConnectedEditors(); + } + + RimGridCrossPlotDataSet* crossPlotCurveSet = nullptr; + this->firstAncestorOrThisOfType( crossPlotCurveSet ); + if ( crossPlotCurveSet ) + { + crossPlotCurveSet->updateConnectedEditors(); + } + + RimPlotCurve* curve = nullptr; + this->firstAncestorOrThisOfType( curve ); + if ( curve ) + { + curve->updateConnectedEditors(); + } + + Rim3dWellLogCurve* rim3dWellLogCurve = nullptr; + this->firstAncestorOrThisOfType( rim3dWellLogCurve ); + if ( rim3dWellLogCurve ) + { + rim3dWellLogCurve->resetMinMaxValues(); + } + + RimEclipseContourMapProjection* contourMap = nullptr; + this->firstAncestorOrThisOfType( contourMap ); + if ( contourMap ) + { + contourMap->updatedWeightingResult(); + } + + RimWellLogTrack* wellLogTrack = nullptr; + this->firstAncestorOrThisOfType( wellLogTrack ); + if ( wellLogTrack ) + { + wellLogTrack->loadDataAndUpdate(); + wellLogTrack->updateEditors(); + } +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimEclipseResultDefinition::setTofAndSelectTracer( const QString& tracerName ) +{ + setResultType( RiaDefines::ResultCatType::FLOW_DIAGNOSTICS ); + setResultVariable( "TOF" ); + setFlowDiagTracerSelectionType( FLOW_TR_BY_SELECTION ); + + if ( m_flowSolution() == nullptr ) + { + assignFlowSolutionFromCase(); + } + + if ( m_flowSolution() ) + { + RimFlowDiagSolution::TracerStatusType tracerStatus = m_flowSolution()->tracerStatusOverall( tracerName ); + + std::vector tracers; + tracers.push_back( tracerName ); + if ( ( tracerStatus == RimFlowDiagSolution::TracerStatusType::INJECTOR ) || + ( tracerStatus == RimFlowDiagSolution::TracerStatusType::VARYING ) ) + { + setSelectedInjectorTracers( tracers ); + } + + if ( ( tracerStatus == RimFlowDiagSolution::TracerStatusType::PRODUCER ) || + ( tracerStatus == RimFlowDiagSolution::TracerStatusType::VARYING ) ) + { + setSelectedProducerTracers( tracers ); + } + } +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimEclipseResultDefinition::loadDataAndUpdate() +{ + Rim3dView* view = nullptr; + this->firstAncestorOrThisOfType( view ); + + loadResult(); + + RimEclipsePropertyFilter* propFilter = nullptr; + this->firstAncestorOrThisOfType( propFilter ); + if ( propFilter ) + { + propFilter->setToDefaultValues(); + propFilter->updateFilterName(); + + if ( view ) + { + view->scheduleGeometryRegen( PROPERTY_FILTERED ); + view->scheduleCreateDisplayModelAndRedraw(); + } + } + + RimEclipseCellColors* cellColors = nullptr; + this->firstAncestorOrThisOfType( cellColors ); + if ( cellColors ) + { + this->updateLegendCategorySettings(); + + if ( view ) + { + RimViewLinker* viewLinker = view->assosiatedViewLinker(); + if ( viewLinker ) + { + viewLinker->updateCellResult(); + } + RimGridView* eclView = dynamic_cast( view ); + if ( eclView ) eclView->intersectionCollection()->scheduleCreateDisplayModelAndRedraw2dIntersectionViews(); + } + } + + RimIntersectionResultDefinition* sepIntersectionResDef = nullptr; + this->firstAncestorOrThisOfType( sepIntersectionResDef ); + if ( sepIntersectionResDef && sepIntersectionResDef->isInAction() ) + { + if ( view ) view->scheduleCreateDisplayModelAndRedraw(); + RimGridView* gridView = dynamic_cast( view ); + if ( gridView ) gridView->intersectionCollection()->scheduleCreateDisplayModelAndRedraw2dIntersectionViews(); + } + + RimCellEdgeColors* cellEdgeColors = nullptr; + this->firstAncestorOrThisOfType( cellEdgeColors ); + if ( cellEdgeColors ) + { + cellEdgeColors->singleVarEdgeResultColors()->updateLegendCategorySettings(); + cellEdgeColors->loadResult(); + + if ( view ) + { + view->scheduleCreateDisplayModelAndRedraw(); + } + } + + RimGridCrossPlotDataSet* crossPlotCurveSet = nullptr; + this->firstAncestorOrThisOfType( crossPlotCurveSet ); + if ( crossPlotCurveSet ) + { + crossPlotCurveSet->destroyCurves(); + crossPlotCurveSet->loadDataAndUpdate( true ); + } + + RimPlotCurve* curve = nullptr; + this->firstAncestorOrThisOfType( curve ); + if ( curve ) + { + curve->loadDataAndUpdate( true ); + } + + Rim3dWellLogCurve* rim3dWellLogCurve = nullptr; + this->firstAncestorOrThisOfType( rim3dWellLogCurve ); + if ( rim3dWellLogCurve ) + { + rim3dWellLogCurve->updateCurveIn3dView(); + } + +#ifdef USE_QTCHARTS + RimGridStatisticsPlot* gridStatisticsPlot = nullptr; + this->firstAncestorOrThisOfType( gridStatisticsPlot ); + if ( gridStatisticsPlot ) + { + gridStatisticsPlot->loadDataAndUpdate(); + } +#endif +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +QList + RimEclipseResultDefinition::calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions, bool* useOptionsOnly ) +{ + QList options; + + if ( fieldNeedingOptions == &m_resultTypeUiField ) + { + bool hasSourSimRLFile = false; + RimEclipseResultCase* eclResCase = dynamic_cast( m_eclipseCase.p() ); + if ( eclResCase && eclResCase->eclipseCaseData() ) + { + hasSourSimRLFile = eclResCase->hasSourSimFile(); + } + +#ifndef USE_HDF5 + // If using ResInsight without HDF5 support, ignore SourSim files and + // do not show it as a result category. + hasSourSimRLFile = false; +#endif + + bool enableSouring = false; + +#ifdef USE_HDF5 + if ( m_eclipseCase.notNull() ) + { + RigCaseCellResultsData* cellResultsData = m_eclipseCase->results( this->porosityModel() ); + + if ( cellResultsData && cellResultsData->hasFlowDiagUsableFluxes() ) + { + enableSouring = true; + } + } +#endif /* USE_HDF5 */ + + RimGridTimeHistoryCurve* timeHistoryCurve; + this->firstAncestorOrThisOfType( timeHistoryCurve ); + + bool isSeparateFaultResult = false; + { + RimEclipseFaultColors* sepFaultResult; + this->firstAncestorOrThisOfType( sepFaultResult ); + if ( sepFaultResult ) isSeparateFaultResult = true; + } + + using ResCatEnum = caf::AppEnum; + for ( size_t i = 0; i < ResCatEnum::size(); ++i ) + { + RiaDefines::ResultCatType resType = ResCatEnum::fromIndex( i ); + + // Do not include flow diagnostics results if it is a time history curve + + if ( resType == RiaDefines::ResultCatType::FLOW_DIAGNOSTICS && ( timeHistoryCurve ) ) + { + continue; + } + + if ( resType == RiaDefines::ResultCatType::FLOW_DIAGNOSTICS && m_eclipseCase && + m_eclipseCase->eclipseCaseData() && m_eclipseCase->eclipseCaseData()->hasFractureResults() ) + { + // Flow diagnostics is not supported for dual porosity models + continue; + } + + // Do not include SourSimRL if no SourSim file is loaded + + if ( resType == RiaDefines::ResultCatType::SOURSIMRL && ( !hasSourSimRLFile ) ) + { + continue; + } + + if ( resType == RiaDefines::ResultCatType::INJECTION_FLOODING && !enableSouring ) + { + continue; + } + + if ( resType == RiaDefines::ResultCatType::ALLAN_DIAGRAMS && !isSeparateFaultResult ) + { + continue; + } + + QString uiString = ResCatEnum::uiTextFromIndex( i ); + options.push_back( caf::PdmOptionItemInfo( uiString, resType ) ); + } + } + + if ( m_resultTypeUiField() == RiaDefines::ResultCatType::FLOW_DIAGNOSTICS ) + { + if ( fieldNeedingOptions == &m_resultVariableUiField ) + { + options.push_back( caf::PdmOptionItemInfo( timeOfFlightString( false ), RIG_FLD_TOF_RESNAME ) ); + if ( m_phaseSelection() == RigFlowDiagResultAddress::PHASE_ALL ) + { + options.push_back( caf::PdmOptionItemInfo( "Tracer Cell Fraction (Sum)", RIG_FLD_CELL_FRACTION_RESNAME ) ); + options.push_back( + caf::PdmOptionItemInfo( maxFractionTracerString( false ), RIG_FLD_MAX_FRACTION_TRACER_RESNAME ) ); + options.push_back( + caf::PdmOptionItemInfo( "Injector Producer Communication", RIG_FLD_COMMUNICATION_RESNAME ) ); + } + } + else if ( fieldNeedingOptions == &m_flowSolutionUiField ) + { + RimEclipseResultCase* eclCase = dynamic_cast( m_eclipseCase.p() ); + if ( eclCase ) + { + std::vector flowSols = eclCase->flowDiagSolutions(); + for ( RimFlowDiagSolution* flowSol : flowSols ) + { + options.push_back( caf::PdmOptionItemInfo( flowSol->userDescription(), flowSol ) ); + } + } + } + else if ( fieldNeedingOptions == &m_selectedInjectorTracersUiField ) + { + options = calcOptionsForSelectedTracerField( true ); + } + else if ( fieldNeedingOptions == &m_selectedProducerTracersUiField ) + { + options = calcOptionsForSelectedTracerField( false ); + } + } + else if ( m_resultTypeUiField() == RiaDefines::ResultCatType::INJECTION_FLOODING ) + { + if ( fieldNeedingOptions == &m_selectedSouringTracersUiField ) + { + RigCaseCellResultsData* cellResultsStorage = currentGridCellResults(); + if ( cellResultsStorage ) + { + QStringList dynamicResultNames = + cellResultsStorage->resultNames( RiaDefines::ResultCatType::DYNAMIC_NATIVE ); + + for ( const QString& resultName : dynamicResultNames ) + { + if ( !resultName.endsWith( "F" ) || resultName == RiaResultNames::completionTypeResultName() ) + { + continue; + } + options.push_back( caf::PdmOptionItemInfo( resultName, resultName ) ); + } + } + } + else if ( fieldNeedingOptions == &m_resultVariableUiField ) + { + options.push_back( caf::PdmOptionItemInfo( RIG_NUM_FLOODED_PV, RIG_NUM_FLOODED_PV ) ); + } + } + else + { + if ( fieldNeedingOptions == &m_resultVariableUiField ) + { + options = calcOptionsForVariableUiFieldStandard( m_resultTypeUiField(), + this->currentGridCellResults(), + showDerivedResultsFirstInVariableUiField(), + addPerCellFaceOptionsForVariableUiField(), + m_ternaryEnabled ); + } + else if ( fieldNeedingOptions == &m_differenceCase ) + { + options.push_back( caf::PdmOptionItemInfo( "None", nullptr ) ); + + RimEclipseCase* eclipseCase = nullptr; + this->firstAncestorOrThisOfTypeAsserted( eclipseCase ); + if ( eclipseCase && eclipseCase->eclipseCaseData() && eclipseCase->eclipseCaseData()->mainGrid() ) + { + RimProject* proj = nullptr; + eclipseCase->firstAncestorOrThisOfTypeAsserted( proj ); + + std::vector allCases = proj->eclipseCases(); + for ( RimEclipseCase* otherCase : allCases ) + { + if ( otherCase == eclipseCase ) continue; + + if ( otherCase->eclipseCaseData() && otherCase->eclipseCaseData()->mainGrid() ) + { + options.push_back( caf::PdmOptionItemInfo( QString( "%1 (#%2)" ) + .arg( otherCase->caseUserDescription() ) + .arg( otherCase->caseId() ), + otherCase, + false, + otherCase->uiIconProvider() ) ); + } + } + } + } + else if ( fieldNeedingOptions == &m_timeLapseBaseTimestep ) + { + RimEclipseCase* currentCase = nullptr; + this->firstAncestorOrThisOfTypeAsserted( currentCase ); + + RimEclipseCase* baseCase = currentCase; + if ( m_differenceCase ) + { + baseCase = m_differenceCase; + } + + options.push_back( caf::PdmOptionItemInfo( "Disabled", RigEclipseResultAddress::noTimeLapseValue() ) ); + + std::vector stepDates = baseCase->timeStepDates(); + for ( size_t stepIdx = 0; stepIdx < stepDates.size(); ++stepIdx ) + { + QString displayString = stepDates[stepIdx].toString( RiaQDateTimeTools::dateFormatString() ); + displayString += QString( " (#%1)" ).arg( stepIdx ); + + options.push_back( caf::PdmOptionItemInfo( displayString, static_cast( stepIdx ) ) ); + } + } + } + + ( *useOptionsOnly ) = true; + + return options; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RigEclipseResultAddress RimEclipseResultDefinition::eclipseResultAddress() const +{ + if ( isFlowDiagOrInjectionFlooding() ) return RigEclipseResultAddress(); + + const RigCaseCellResultsData* gridCellResults = this->currentGridCellResults(); + if ( gridCellResults ) + { + int timelapseTimeStep = RigEclipseResultAddress::noTimeLapseValue(); + int diffCaseId = RigEclipseResultAddress::noCaseDiffValue(); + + if ( isDeltaTimeStepActive() ) + { + timelapseTimeStep = m_timeLapseBaseTimestep(); + } + + if ( isDeltaCaseActive() ) + { + diffCaseId = m_differenceCase->caseId(); + } + + return RigEclipseResultAddress( m_resultType(), + m_resultVariable(), + timelapseTimeStep, + diffCaseId, + isDivideByCellFaceAreaActive() ); + } + else + { + return RigEclipseResultAddress(); + } +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimEclipseResultDefinition::setFromEclipseResultAddress( const RigEclipseResultAddress& address ) +{ + RigEclipseResultAddress canonizedAddress = address; + + const RigCaseCellResultsData* gridCellResults = this->currentGridCellResults(); + if ( gridCellResults ) + { + auto rinfo = gridCellResults->resultInfo( address ); + if ( rinfo ) canonizedAddress = rinfo->eclipseResultAddress(); + } + + m_resultType = canonizedAddress.resultCatType(); + m_resultVariable = canonizedAddress.resultName(); + m_timeLapseBaseTimestep = canonizedAddress.deltaTimeStepIndex(); + m_divideByCellFaceArea = canonizedAddress.isDivideByCellFaceAreaActive(); + + if ( canonizedAddress.isDeltaCaseActive() ) + { + auto eclipseCases = RimProject::current()->eclipseCases(); + for ( RimEclipseCase* c : eclipseCases ) + { + if ( c && c->caseId() == canonizedAddress.deltaCaseId() ) + { + m_differenceCase = c; + } + } + } + + this->updateUiFieldsFromActiveResult(); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RigFlowDiagResultAddress RimEclipseResultDefinition::flowDiagResAddress() const +{ + CVF_ASSERT( isFlowDiagOrInjectionFlooding() ); + + if ( m_resultType() == RiaDefines::ResultCatType::FLOW_DIAGNOSTICS ) + { + size_t timeStep = 0; + + Rim3dView* rimView = nullptr; + this->firstAncestorOrThisOfType( rimView ); + if ( rimView ) + { + timeStep = rimView->currentTimeStep(); + } + RimWellLogExtractionCurve* wellLogExtractionCurve = nullptr; + this->firstAncestorOrThisOfType( wellLogExtractionCurve ); + if ( wellLogExtractionCurve ) + { + timeStep = static_cast( wellLogExtractionCurve->currentTimeStep() ); + } + + // Time history curves are not supported, since it requires the time + // step to access to be supplied. + RimGridTimeHistoryCurve* timeHistoryCurve = nullptr; + this->firstAncestorOrThisOfType( timeHistoryCurve ); + CVF_ASSERT( timeHistoryCurve == nullptr ); + + std::set selTracerNames; + if ( m_flowTracerSelectionMode == FLOW_TR_BY_SELECTION ) + { + for ( const QString& tName : m_selectedInjectorTracers() ) + { + selTracerNames.insert( tName.toStdString() ); + } + for ( const QString& tName : m_selectedProducerTracers() ) + { + selTracerNames.insert( tName.toStdString() ); + } + } + else + { + RimFlowDiagSolution* flowSol = m_flowSolution(); + if ( flowSol ) + { + std::vector tracerNames = flowSol->tracerNames(); + + if ( m_flowTracerSelectionMode == FLOW_TR_INJECTORS || m_flowTracerSelectionMode == FLOW_TR_INJ_AND_PROD ) + { + for ( const QString& tracerName : tracerNames ) + { + RimFlowDiagSolution::TracerStatusType status = + flowSol->tracerStatusInTimeStep( tracerName, timeStep ); + if ( status == RimFlowDiagSolution::TracerStatusType::INJECTOR ) + { + selTracerNames.insert( tracerName.toStdString() ); + } + } + } + + if ( m_flowTracerSelectionMode == FLOW_TR_PRODUCERS || m_flowTracerSelectionMode == FLOW_TR_INJ_AND_PROD ) + { + for ( const QString& tracerName : tracerNames ) + { + RimFlowDiagSolution::TracerStatusType status = + flowSol->tracerStatusInTimeStep( tracerName, timeStep ); + if ( status == RimFlowDiagSolution::TracerStatusType::PRODUCER ) + { + selTracerNames.insert( tracerName.toStdString() ); + } + } + } + } + } + + return RigFlowDiagResultAddress( m_resultVariable().toStdString(), m_phaseSelection(), selTracerNames ); + } + else + { + std::set selTracerNames; + for ( const QString& selectedTracerName : m_selectedSouringTracers() ) + { + selTracerNames.insert( selectedTracerName.toUtf8().constData() ); + } + return RigFlowDiagResultAddress( m_resultVariable().toStdString(), + RigFlowDiagResultAddress::PHASE_ALL, + selTracerNames ); + } +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimEclipseResultDefinition::setFlowDiagTracerSelectionType( FlowTracerSelectionType selectionType ) +{ + m_flowTracerSelectionMode = selectionType; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +QString RimEclipseResultDefinition::resultVariableUiName() const +{ + if ( resultType() == RiaDefines::ResultCatType::FLOW_DIAGNOSTICS ) + { + return flowDiagResUiText( false, 32 ); + } + + if ( isDivideByCellFaceAreaActive() ) + { + return m_resultVariable() + " /A"; + } + + return m_resultVariable(); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +QString RimEclipseResultDefinition::resultVariableUiShortName() const +{ + if ( resultType() == RiaDefines::ResultCatType::FLOW_DIAGNOSTICS ) + { + return flowDiagResUiText( true, 24 ); + } + + if ( isDivideByCellFaceAreaActive() ) + { + return m_resultVariable() + " /A"; + } + + return m_resultVariable(); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +QString RimEclipseResultDefinition::additionalResultText() const +{ + QStringList resultText; + + if ( isDeltaTimeStepActive() ) + { + std::vector stepDates; + const RigCaseCellResultsData* gridCellResults = this->currentGridCellResults(); + if ( gridCellResults ) + { + stepDates = gridCellResults->timeStepDates(); + resultText += + QString( "Base Time Step: %1" ) + .arg( stepDates[m_timeLapseBaseTimestep()].toString( RiaQDateTimeTools::dateFormatString() ) ); + } + } + if ( isDeltaCaseActive() ) + { + resultText += QString( "Base Case: %1" ).arg( m_differenceCase()->caseUserDescription() ); + } + return resultText.join( "
" ); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +QString RimEclipseResultDefinition::additionalResultTextShort() const +{ + QString resultTextShort; + if ( isDeltaTimeStepActive() || isDeltaCaseActive() ) + { + QStringList resultTextLines; + resultTextLines += QString( "\nDiff. Options:" ); + if ( isDeltaCaseActive() ) + { + resultTextLines += QString( "Base Case: #%1" ).arg( m_differenceCase()->caseId() ); + } + if ( isDeltaTimeStepActive() ) + { + resultTextLines += QString( "Base Time: #%1" ).arg( m_timeLapseBaseTimestep() ); + } + resultTextShort = resultTextLines.join( "\n" ); + } + + return resultTextShort; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +int RimEclipseResultDefinition::timeLapseBaseTimeStep() const +{ + return m_timeLapseBaseTimestep; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +int RimEclipseResultDefinition::caseDiffIndex() const +{ + if ( m_differenceCase ) + { + return m_differenceCase->caseId(); + } + return -1; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimEclipseResultDefinition::loadResult() +{ + if ( isFlowDiagOrInjectionFlooding() ) return; // Will load automatically on access + + if ( m_eclipseCase ) + { + if ( !m_eclipseCase->ensureReservoirCaseIsOpen() ) + { + RiaLogging::error( "Could not open the Eclipse Grid file: " + m_eclipseCase->gridFileName() ); + return; + } + } + + if ( m_differenceCase ) + { + if ( !m_differenceCase->ensureReservoirCaseIsOpen() ) + { + RiaLogging::error( "Could not open the Eclipse Grid file: " + m_eclipseCase->gridFileName() ); + return; + } + } + + RigCaseCellResultsData* gridCellResults = this->currentGridCellResults(); + if ( gridCellResults ) + { + if ( isDeltaTimeStepActive() || isDeltaCaseActive() || isDivideByCellFaceAreaActive() ) + { + gridCellResults->createResultEntry( this->eclipseResultAddress(), false ); + } + + QString resultName = m_resultVariable(); + std::set eclipseResultNamesWithNncData = RiaResultNames::nncResultNames(); + if ( eclipseResultNamesWithNncData.find( resultName ) != eclipseResultNamesWithNncData.end() ) + { + eclipseCase()->ensureFaultDataIsComputed(); + + bool dataWasComputed = eclipseCase()->ensureNncDataIsComputed(); + if ( dataWasComputed ) + { + eclipseCase()->createDisplayModelAndUpdateAllViews(); + } + } + + gridCellResults->ensureKnownResultLoaded( this->eclipseResultAddress() ); + } +} + +//-------------------------------------------------------------------------------------------------- +/// Returns whether the result requested by the definition is a single frame result +/// The result needs to be loaded before asking +//-------------------------------------------------------------------------------------------------- +bool RimEclipseResultDefinition::hasStaticResult() const +{ + if ( isFlowDiagOrInjectionFlooding() ) return false; + + const RigCaseCellResultsData* gridCellResults = this->currentGridCellResults(); + RigEclipseResultAddress gridScalarResultIndex = this->eclipseResultAddress(); + + if ( hasResult() && gridCellResults->timeStepCount( gridScalarResultIndex ) == 1 ) + { + return true; + } + else + { + return false; + } +} + +//-------------------------------------------------------------------------------------------------- +/// Returns whether the result requested by the definition is loaded or possible to load from the result file +//-------------------------------------------------------------------------------------------------- +bool RimEclipseResultDefinition::hasResult() const +{ + if ( isFlowDiagOrInjectionFlooding() ) + { + if ( m_flowSolution() && !m_resultVariable().isEmpty() ) return true; + } + else if ( this->currentGridCellResults() ) + { + const RigCaseCellResultsData* gridCellResults = this->currentGridCellResults(); + + return gridCellResults->hasResultEntry( this->eclipseResultAddress() ); + } + + return false; +} + +//-------------------------------------------------------------------------------------------------- +/// Returns whether the result requested by the definition is a multi frame result +/// The result needs to be loaded before asking +//-------------------------------------------------------------------------------------------------- +bool RimEclipseResultDefinition::hasDynamicResult() const +{ + if ( hasResult() ) + { + if ( m_resultType() == RiaDefines::ResultCatType::DYNAMIC_NATIVE ) + { + return true; + } + else if ( m_resultType() == RiaDefines::ResultCatType::SOURSIMRL ) + { + return true; + } + else if ( m_resultType() == RiaDefines::ResultCatType::FLOW_DIAGNOSTICS ) + { + return true; + } + else if ( m_resultType() == RiaDefines::ResultCatType::INJECTION_FLOODING ) + { + return true; + } + + if ( this->currentGridCellResults() ) + { + const RigCaseCellResultsData* gridCellResults = this->currentGridCellResults(); + RigEclipseResultAddress gridScalarResultIndex = this->eclipseResultAddress(); + if ( gridCellResults->timeStepCount( gridScalarResultIndex ) > 1 ) + { + return true; + } + } + } + + return false; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimEclipseResultDefinition::initAfterRead() +{ + if ( m_flowSolution() == nullptr ) + { + assignFlowSolutionFromCase(); + } + + if ( m_resultVariable == "Formation Allen" ) + { + m_resultVariable = RiaResultNames::formationAllanResultName(); + m_resultType = RiaDefines::ResultCatType::ALLAN_DIAGRAMS; + } + else if ( m_resultVariable == "Binary Formation Allen" ) + { + m_resultVariable = RiaResultNames::formationBinaryAllanResultName(); + m_resultType = RiaDefines::ResultCatType::ALLAN_DIAGRAMS; + } + + m_porosityModelUiField = m_porosityModel; + m_resultTypeUiField = m_resultType; + m_resultVariableUiField = m_resultVariable; + + m_flowSolutionUiField = m_flowSolution(); + m_selectedInjectorTracersUiField = m_selectedInjectorTracers; + + this->updateUiIconFromToggleField(); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimEclipseResultDefinition::setResultType( RiaDefines::ResultCatType val ) +{ + m_resultType = val; + m_resultTypeUiField = val; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimEclipseResultDefinition::setPorosityModel( RiaDefines::PorosityModelType val ) +{ + m_porosityModel = val; + m_porosityModelUiField = val; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimEclipseResultDefinition::setResultVariable( const QString& val ) +{ + m_resultVariable = val; + m_resultVariableUiField = val; +} + +//-------------------------------------------------------------------------------------------------- +/// Return phase type if the current result is known to be of a particular +/// fluid phase type. Otherwise the method will return PHASE_NOT_APPLICABLE. +//-------------------------------------------------------------------------------------------------- +RiaDefines::PhaseType RimEclipseResultDefinition::resultPhaseType() const +{ + if ( QRegularExpression( "OIL" ).match( m_resultVariable() ).hasMatch() ) + { + return RiaDefines::PhaseType::OIL_PHASE; + } + else if ( QRegularExpression( "GAS" ).match( m_resultVariable() ).hasMatch() ) + { + return RiaDefines::PhaseType::GAS_PHASE; + } + else if ( QRegularExpression( "WAT" ).match( m_resultVariable() ).hasMatch() ) + { + return RiaDefines::PhaseType::WATER_PHASE; + } + return RiaDefines::PhaseType::PHASE_NOT_APPLICABLE; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RimFlowDiagSolution* RimEclipseResultDefinition::flowDiagSolution() const +{ + return m_flowSolution(); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimEclipseResultDefinition::setFlowSolution( RimFlowDiagSolution* flowSol ) +{ + this->m_flowSolution = flowSol; + this->m_flowSolutionUiField = flowSol; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimEclipseResultDefinition::setSelectedTracers( const std::vector& selectedTracers ) +{ + if ( m_flowSolution() == nullptr ) + { + assignFlowSolutionFromCase(); + } + if ( m_flowSolution() ) + { + std::vector injectorTracers; + std::vector producerTracers; + for ( const QString& tracerName : selectedTracers ) + { + RimFlowDiagSolution::TracerStatusType tracerStatus = m_flowSolution()->tracerStatusOverall( tracerName ); + if ( tracerStatus == RimFlowDiagSolution::TracerStatusType::INJECTOR ) + { + injectorTracers.push_back( tracerName ); + } + else if ( tracerStatus == RimFlowDiagSolution::TracerStatusType::PRODUCER ) + { + producerTracers.push_back( tracerName ); + } + else if ( tracerStatus == RimFlowDiagSolution::TracerStatusType::VARYING || + tracerStatus == RimFlowDiagSolution::TracerStatusType::UNDEFINED ) + { + injectorTracers.push_back( tracerName ); + producerTracers.push_back( tracerName ); + } + } + setSelectedInjectorTracers( injectorTracers ); + setSelectedProducerTracers( producerTracers ); + } +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimEclipseResultDefinition::setSelectedInjectorTracers( const std::vector& selectedTracers ) +{ + this->m_selectedInjectorTracers = selectedTracers; + this->m_selectedInjectorTracersUiField = selectedTracers; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimEclipseResultDefinition::setSelectedProducerTracers( const std::vector& selectedTracers ) +{ + this->m_selectedProducerTracers = selectedTracers; + this->m_selectedProducerTracersUiField = selectedTracers; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimEclipseResultDefinition::setSelectedSouringTracers( const std::vector& selectedTracers ) +{ + this->m_selectedSouringTracers = selectedTracers; + this->m_selectedSouringTracersUiField = selectedTracers; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimEclipseResultDefinition::updateUiFieldsFromActiveResult() +{ + m_resultTypeUiField = m_resultType; + m_resultVariableUiField = resultVariable(); + m_selectedInjectorTracersUiField = m_selectedInjectorTracers; + m_selectedProducerTracersUiField = m_selectedProducerTracers; + m_selectedSouringTracersUiField = m_selectedSouringTracers; + m_porosityModelUiField = m_porosityModel; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimEclipseResultDefinition::enableDeltaResults( bool enable ) +{ + m_isDeltaResultEnabled = enable; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +bool RimEclipseResultDefinition::isTernarySaturationSelected() const +{ + bool isTernary = + ( m_resultType() == RiaDefines::ResultCatType::DYNAMIC_NATIVE ) && + ( m_resultVariable().compare( RiaResultNames::ternarySaturationResultName(), Qt::CaseInsensitive ) == 0 ); + + return isTernary; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +bool RimEclipseResultDefinition::isCompletionTypeSelected() const +{ + return ( m_resultType() == RiaDefines::ResultCatType::DYNAMIC_NATIVE && + m_resultVariable() == RiaResultNames::completionTypeResultName() ); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +bool RimEclipseResultDefinition::hasCategoryResult() const +{ + if ( this->m_resultType() == RiaDefines::ResultCatType::FORMATION_NAMES && m_eclipseCase && + m_eclipseCase->eclipseCaseData() && !m_eclipseCase->eclipseCaseData()->formationNames().empty() ) + return true; + + if ( this->m_resultType() == RiaDefines::ResultCatType::DYNAMIC_NATIVE && + this->resultVariable() == RiaResultNames::completionTypeResultName() ) + return true; + + if ( this->m_resultType() == RiaDefines::ResultCatType::FLOW_DIAGNOSTICS && + m_resultVariable() == RIG_FLD_MAX_FRACTION_TRACER_RESNAME ) + return true; + + if ( this->resultVariable() == RiaResultNames::formationAllanResultName() || + this->resultVariable() == RiaResultNames::formationBinaryAllanResultName() ) + { + return true; + } + + if ( !this->hasStaticResult() ) return false; + + return RiaDefines::isNativeCategoryResult( this->resultVariable() ); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +bool RimEclipseResultDefinition::isFlowDiagOrInjectionFlooding() const +{ + if ( this->m_resultType() == RiaDefines::ResultCatType::FLOW_DIAGNOSTICS || + this->m_resultType() == RiaDefines::ResultCatType::INJECTION_FLOODING ) + { + return true; + } + + return false; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimEclipseResultDefinition::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) +{ + uiOrdering.add( &m_resultTypeUiField ); + + if ( hasDualPorFractureResult() ) + { + uiOrdering.add( &m_porosityModelUiField ); + } + + if ( m_resultTypeUiField() == RiaDefines::ResultCatType::FLOW_DIAGNOSTICS ) + { + uiOrdering.add( &m_flowSolutionUiField ); + + uiOrdering.add( &m_flowTracerSelectionMode ); + + if ( m_flowTracerSelectionMode == FLOW_TR_BY_SELECTION ) + { + caf::PdmUiGroup* selectionGroup = uiOrdering.addNewGroup( "Tracer Selection" ); + selectionGroup->setEnableFrame( false ); + + caf::PdmUiGroup* injectorGroup = selectionGroup->addNewGroup( "Injectors" ); + injectorGroup->add( &m_selectedInjectorTracersUiField ); + injectorGroup->add( &m_syncInjectorToProducerSelection ); + + caf::PdmUiGroup* producerGroup = selectionGroup->addNewGroup( "Producers", false ); + producerGroup->add( &m_selectedProducerTracersUiField ); + producerGroup->add( &m_syncProducerToInjectorSelection ); + } + + uiOrdering.add( &m_phaseSelection ); + + if ( m_flowSolution() == nullptr ) + { + assignFlowSolutionFromCase(); + } + } + + if ( m_resultTypeUiField() == RiaDefines::ResultCatType::INJECTION_FLOODING ) + { + uiOrdering.add( &m_selectedSouringTracersUiField ); + } + + uiOrdering.add( &m_resultVariableUiField ); + if ( m_resultTypeUiField() == RiaDefines::ResultCatType::INPUT_PROPERTY ) + { + uiOrdering.add( &m_inputPropertyFileName ); + } + + if ( isDivideByCellFaceAreaPossible() ) + { + uiOrdering.add( &m_divideByCellFaceArea ); + + QString resultPropertyLabel = "Result Property"; + if ( isDivideByCellFaceAreaActive() ) + { + resultPropertyLabel += QString( "\nDivided by Area" ); + } + m_resultVariableUiField.uiCapability()->setUiName( resultPropertyLabel ); + } + + { + caf::PdmUiGroup* legendGroup = uiOrdering.addNewGroup( "Legend" ); + legendGroup->add( &m_showOnlyVisibleCategoriesInLegend ); + + bool showOnlyVisibleCategoriesOption = false; + + RimEclipseView* eclView = nullptr; + this->firstAncestorOrThisOfType( eclView ); + + if ( eclView ) + { + if ( eclView->cellResult() == this && this->hasCategoryResult() ) showOnlyVisibleCategoriesOption = true; + } + + if ( m_resultTypeUiField() == RiaDefines::ResultCatType::FLOW_DIAGNOSTICS && + m_resultVariableUiField() == RIG_FLD_MAX_FRACTION_TRACER_RESNAME ) + { + showOnlyVisibleCategoriesOption = true; + } + + legendGroup->setUiHidden( !showOnlyVisibleCategoriesOption ); + } + + if ( isDeltaCasePossible() || isDeltaTimeStepPossible() ) + { + caf::PdmUiGroup* differenceGroup = uiOrdering.addNewGroup( "Difference Options" ); + differenceGroup->setUiReadOnly( !( isDeltaTimeStepPossible() || isDeltaCasePossible() ) ); + + m_differenceCase.uiCapability()->setUiReadOnly( !isDeltaCasePossible() ); + m_timeLapseBaseTimestep.uiCapability()->setUiReadOnly( !isDeltaTimeStepPossible() ); + + if ( isDeltaCasePossible() ) differenceGroup->add( &m_differenceCase ); + if ( isDeltaTimeStepPossible() ) differenceGroup->add( &m_timeLapseBaseTimestep ); + + QString resultPropertyLabel = "Result Property"; + if ( isDeltaTimeStepActive() || isDeltaCaseActive() ) + { + resultPropertyLabel += QString( "\n%1" ).arg( additionalResultTextShort() ); + } + m_resultVariableUiField.uiCapability()->setUiName( resultPropertyLabel ); + } + + uiOrdering.skipRemainingFields( true ); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimEclipseResultDefinition::defineEditorAttribute( const caf::PdmFieldHandle* field, + QString uiConfigName, + caf::PdmUiEditorAttribute* attribute ) +{ + if ( m_resultTypeUiField() == RiaDefines::ResultCatType::FLOW_DIAGNOSTICS ) + { + if ( field == &m_resultVariableUiField ) + { + caf::PdmUiListEditorAttribute* listEditAttr = dynamic_cast( attribute ); + if ( listEditAttr ) + { + listEditAttr->m_heightHint = 50; + } + } + else if ( field == &m_syncInjectorToProducerSelection || field == &m_syncProducerToInjectorSelection ) + { + caf::PdmUiToolButtonEditorAttribute* toolButtonAttr = + dynamic_cast( attribute ); + if ( toolButtonAttr ) + { + toolButtonAttr->m_sizePolicy.setHorizontalPolicy( QSizePolicy::MinimumExpanding ); + } + } + } + if ( field == &m_resultVariableUiField ) + { + caf::PdmUiListEditorAttribute* listEditAttr = dynamic_cast( attribute ); + if ( listEditAttr ) + { + listEditAttr->m_allowHorizontalScrollBar = false; + } + } +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +bool RimEclipseResultDefinition::TracerComp::operator()( const QString& lhs, const QString& rhs ) const +{ + if ( !lhs.endsWith( "-XF" ) && rhs.endsWith( "-XF" ) ) + { + return true; + } + else if ( lhs.endsWith( "-XF" ) && !rhs.endsWith( "-XF" ) ) + { + return false; + } + else + { + return lhs < rhs; + } +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimEclipseResultDefinition::assignFlowSolutionFromCase() +{ + RimFlowDiagSolution* defaultFlowDiagSolution = nullptr; + + RimEclipseResultCase* eclCase = dynamic_cast( m_eclipseCase.p() ); + + if ( eclCase ) + { + defaultFlowDiagSolution = eclCase->defaultFlowDiagSolution(); + } + this->setFlowSolution( defaultFlowDiagSolution ); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +bool RimEclipseResultDefinition::hasDualPorFractureResult() +{ + if ( m_eclipseCase && m_eclipseCase->eclipseCaseData() ) + { + return m_eclipseCase->eclipseCaseData()->hasFractureResults(); + } + + return false; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +QString RimEclipseResultDefinition::flowDiagResUiText( bool shortLabel, int maxTracerStringLength ) const +{ + QString uiText = QString::fromStdString( flowDiagResAddress().variableName ); + if ( flowDiagResAddress().variableName == RIG_FLD_TOF_RESNAME ) + { + uiText = timeOfFlightString( shortLabel ); + } + else if ( flowDiagResAddress().variableName == RIG_FLD_MAX_FRACTION_TRACER_RESNAME ) + { + uiText = maxFractionTracerString( shortLabel ); + } + + QString tracersString = selectedTracersString(); + + if ( !tracersString.isEmpty() ) + { + const QString postfix = "..."; + + if ( tracersString.size() > maxTracerStringLength + postfix.size() ) + { + tracersString = tracersString.left( maxTracerStringLength ); + tracersString += postfix; + } + uiText += QString( "\n%1" ).arg( tracersString ); + } + return uiText; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +QList + RimEclipseResultDefinition::calcOptionsForVariableUiFieldStandard( RiaDefines::ResultCatType resultCatType, + const RigCaseCellResultsData* results, + bool showDerivedResultsFirst, + bool addPerCellFaceOptionItems, + bool ternaryEnabled ) +{ + CVF_ASSERT( resultCatType != RiaDefines::ResultCatType::FLOW_DIAGNOSTICS && + resultCatType != RiaDefines::ResultCatType::INJECTION_FLOODING ); + + if ( results ) + { + QList optionList; + + QStringList cellCenterResultNames; + QStringList cellFaceResultNames; + + for ( const QString& s : getResultNamesForResultType( resultCatType, results ) ) + { + if ( s == RiaResultNames::completionTypeResultName() ) + { + if ( results->timeStepDates().empty() ) continue; + } + + if ( RiaResultNames::isPerCellFaceResult( s ) ) + { + cellFaceResultNames.push_back( s ); + } + else + { + cellCenterResultNames.push_back( s ); + } + } + + cellCenterResultNames.sort(); + cellFaceResultNames.sort(); + + // Cell Center result names + for ( const QString& s : cellCenterResultNames ) + { + optionList.push_back( caf::PdmOptionItemInfo( s, s ) ); + } + + if ( addPerCellFaceOptionItems ) + { + for ( const QString& s : cellFaceResultNames ) + { + if ( showDerivedResultsFirst ) + { + optionList.push_front( caf::PdmOptionItemInfo( s, s ) ); + } + else + { + optionList.push_back( caf::PdmOptionItemInfo( s, s ) ); + } + } + + // Ternary Result + if ( ternaryEnabled ) + { + bool hasAtLeastOneTernaryComponent = false; + if ( cellCenterResultNames.contains( "SOIL" ) ) + hasAtLeastOneTernaryComponent = true; + else if ( cellCenterResultNames.contains( "SGAS" ) ) + hasAtLeastOneTernaryComponent = true; + else if ( cellCenterResultNames.contains( "SWAT" ) ) + hasAtLeastOneTernaryComponent = true; + + if ( resultCatType == RiaDefines::ResultCatType::DYNAMIC_NATIVE && hasAtLeastOneTernaryComponent ) + { + optionList.push_front( caf::PdmOptionItemInfo( RiaResultNames::ternarySaturationResultName(), + RiaResultNames::ternarySaturationResultName() ) ); + } + } + } + + optionList.push_front( + caf::PdmOptionItemInfo( RiaResultNames::undefinedResultName(), RiaResultNames::undefinedResultName() ) ); + + return optionList; + } + + return QList(); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimEclipseResultDefinition::setTernaryEnabled( bool enabled ) +{ + m_ternaryEnabled = enabled; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +bool operator<( const cvf::Color3ub first, const cvf::Color3ub second ) +{ + if ( first.r() != second.r() ) return first.r() < second.r(); + if ( first.g() != second.g() ) return first.g() < second.g(); + if ( first.b() != second.b() ) return first.b() < second.b(); + + return false; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +class TupleCompare +{ +public: + bool operator()( const std::tuple& t1, + const std::tuple& t2 ) const + { + using namespace std; + if ( get<0>( t1 ) != get<0>( t2 ) ) return get<0>( t1 ) < get<0>( t2 ); + if ( get<1>( t1 ) != get<1>( t2 ) ) return get<1>( t1 ) < get<1>( t2 ); + if ( get<2>( t1 ) != get<2>( t2 ) ) return get<2>( t1 ) < get<2>( t2 ); + + return false; + } +}; + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimEclipseResultDefinition::updateRangesForExplicitLegends( RimRegularLegendConfig* legendConfigToUpdate, + RimTernaryLegendConfig* ternaryLegendConfigToUpdate, + int currentTimeStep ) + +{ + RimEclipseCase* rimEclipseCase = this->eclipseCase(); + + if ( this->hasResult() ) + { + if ( this->isFlowDiagOrInjectionFlooding() ) + { + CVF_ASSERT( currentTimeStep >= 0 ); + + double globalMin, globalMax; + double globalPosClosestToZero, globalNegClosestToZero; + RigFlowDiagResults* flowResultsData = this->flowDiagSolution()->flowDiagResults(); + RigFlowDiagResultAddress resAddr = this->flowDiagResAddress(); + + flowResultsData->minMaxScalarValues( resAddr, currentTimeStep, &globalMin, &globalMax ); + flowResultsData->posNegClosestToZero( resAddr, currentTimeStep, &globalPosClosestToZero, &globalNegClosestToZero ); + + double localMin, localMax; + double localPosClosestToZero, localNegClosestToZero; + if ( this->hasDynamicResult() ) + { + flowResultsData->minMaxScalarValues( resAddr, currentTimeStep, &localMin, &localMax ); + flowResultsData->posNegClosestToZero( resAddr, currentTimeStep, &localPosClosestToZero, &localNegClosestToZero ); + } + else + { + localMin = globalMin; + localMax = globalMax; + + localPosClosestToZero = globalPosClosestToZero; + localNegClosestToZero = globalNegClosestToZero; + } + + CVF_ASSERT( legendConfigToUpdate ); + + legendConfigToUpdate->disableAllTimeStepsRange( true ); + legendConfigToUpdate->setClosestToZeroValues( globalPosClosestToZero, + globalNegClosestToZero, + localPosClosestToZero, + localNegClosestToZero ); + legendConfigToUpdate->setAutomaticRanges( globalMin, globalMax, localMin, localMax ); + + if ( this->hasCategoryResult() ) + { + RimEclipseView* eclView = nullptr; + this->firstAncestorOrThisOfType( eclView ); + + if ( eclView ) + { + std::set, TupleCompare> categories; + + std::vector tracerNames = this->flowDiagSolution()->tracerNames(); + int tracerIndex = 0; + + for ( const auto& tracerName : tracerNames ) + { + cvf::Color3ub color( cvf::Color3::GRAY ); + + RimSimWellInView* well = eclView->wellCollection()->findWell( + RimFlowDiagSolution::removeCrossFlowEnding( tracerName ) ); + + if ( well ) color = cvf::Color3ub( well->wellPipeColor() ); + + categories.insert( std::make_tuple( tracerName, tracerIndex, color ) ); + ++tracerIndex; + } + + std::vector> categoryVector; + + if ( m_showOnlyVisibleCategoriesInLegend ) + { + std::set visibleTracers = + RigVisibleCategoriesCalculator::visibleFlowDiagCategories( *eclView, + *flowResultsData, + resAddr, + currentTimeStep ); + for ( auto tupIt : categories ) + { + int tracerIndex = std::get<1>( tupIt ); + if ( visibleTracers.count( tracerIndex ) ) categoryVector.push_back( tupIt ); + } + } + else + { + for ( auto tupIt : categories ) + { + categoryVector.push_back( tupIt ); + } + } + + legendConfigToUpdate->setCategoryItems( categoryVector ); + } + } + } + else + { + if ( !rimEclipseCase ) return; + + RigEclipseCaseData* eclipseCaseData = rimEclipseCase->eclipseCaseData(); + if ( !eclipseCaseData ) return; + + RigCaseCellResultsData* cellResultsData = eclipseCaseData->results( this->porosityModel() ); + cellResultsData->ensureKnownResultLoaded( this->eclipseResultAddress() ); + + double globalMin, globalMax; + double globalPosClosestToZero, globalNegClosestToZero; + + cellResultsData->minMaxCellScalarValues( this->eclipseResultAddress(), globalMin, globalMax ); + cellResultsData->posNegClosestToZero( this->eclipseResultAddress(), + globalPosClosestToZero, + globalNegClosestToZero ); + + double localMin, localMax; + double localPosClosestToZero, localNegClosestToZero; + if ( this->hasDynamicResult() && currentTimeStep >= 0 ) + { + cellResultsData->minMaxCellScalarValues( this->eclipseResultAddress(), currentTimeStep, localMin, localMax ); + cellResultsData->posNegClosestToZero( this->eclipseResultAddress(), + currentTimeStep, + localPosClosestToZero, + localNegClosestToZero ); + } + else + { + localMin = globalMin; + localMax = globalMax; + + localPosClosestToZero = globalPosClosestToZero; + localNegClosestToZero = globalNegClosestToZero; + } + + CVF_ASSERT( legendConfigToUpdate ); + + legendConfigToUpdate->disableAllTimeStepsRange( false ); + legendConfigToUpdate->setClosestToZeroValues( globalPosClosestToZero, + globalNegClosestToZero, + localPosClosestToZero, + localNegClosestToZero ); + legendConfigToUpdate->setAutomaticRanges( globalMin, globalMax, localMin, localMax ); + + if ( this->hasCategoryResult() ) + { + if ( this->resultType() == RiaDefines::ResultCatType::ALLAN_DIAGRAMS ) + { + if ( this->resultVariable() == RiaResultNames::formationAllanResultName() ) + { + const std::vector fnVector = eclipseCaseData->formationNames(); + std::vector fnameIdxes; + for ( int i = 0; i < static_cast( fnVector.size() ); i++ ) + { + fnameIdxes.push_back( i ); + } + + cvf::Color3ubArray legendBaseColors = legendConfigToUpdate->colorLegend()->colorArray(); + + cvf::ref formationColorMapper = new caf::CategoryMapper; + formationColorMapper->setCategories( fnameIdxes ); + formationColorMapper->setInterpolateColors( legendBaseColors ); + + const std::map, int>& formationCombToCategory = + eclipseCaseData->allanDiagramData()->formationCombinationToCategory(); + + std::vector> categories; + for ( int frmNameIdx : fnameIdxes ) + { + cvf::Color3ub formationColor = formationColorMapper->mapToColor( frmNameIdx ); + categories.emplace_back( std::make_tuple( fnVector[frmNameIdx], frmNameIdx, formationColor ) ); + } + + std::set visibleAllanCategories; + { + RimEclipseView* eclView = nullptr; + this->firstAncestorOrThisOfType( eclView ); + + visibleAllanCategories = RigVisibleCategoriesCalculator::visibleAllanCategories( eclView ); + } + + for ( auto [formationPair, categoryIndex] : formationCombToCategory ) + { + int frmIdx1 = formationPair.first; + int frmIdx2 = formationPair.second; + + if ( visibleAllanCategories.count( categoryIndex ) == 0 ) continue; + + int fnVectorSize = static_cast( fnVector.size() ); + if ( frmIdx1 >= fnVectorSize || frmIdx2 >= fnVectorSize ) continue; + + QString frmName1 = fnVector[frmIdx1]; + QString frmName2 = fnVector[frmIdx2]; + + cvf::Color3f formationColor1 = cvf::Color3f( formationColorMapper->mapToColor( frmIdx1 ) ); + cvf::Color3f formationColor2 = cvf::Color3f( formationColorMapper->mapToColor( frmIdx2 ) ); + + cvf::Color3ub blendColor = + cvf::Color3ub( RiaColorTools::blendCvfColors( formationColor1, formationColor2 ) ); + + categories.emplace_back( + std::make_tuple( frmName1 + "-" + frmName2, categoryIndex, blendColor ) ); + } + + legendConfigToUpdate->setCategoryItems( categories ); + } + else if ( this->resultVariable() == RiaResultNames::formationBinaryAllanResultName() ) + { + std::vector> categories; + categories.emplace_back( std::make_tuple( "Same formation", 0, cvf::Color3ub::BROWN ) ); + categories.emplace_back( std::make_tuple( "Different formation", 1, cvf::Color3ub::ORANGE ) ); + + legendConfigToUpdate->setCategoryItems( categories ); + } + } + else if ( this->resultType() == RiaDefines::ResultCatType::DYNAMIC_NATIVE && + this->resultVariable() == RiaResultNames::completionTypeResultName() ) + { + const std::vector& visibleCategories = + cellResultsData->uniqueCellScalarValues( this->eclipseResultAddress() ); + + std::vector supportedCompletionTypes = + { RiaDefines::WellPathComponentType::WELL_PATH, + RiaDefines::WellPathComponentType::FISHBONES, + RiaDefines::WellPathComponentType::PERFORATION_INTERVAL, + RiaDefines::WellPathComponentType::FRACTURE }; + + RiaColorTables::WellPathComponentColors colors = RiaColorTables::wellPathComponentColors(); + + std::vector> categories; + for ( auto completionType : supportedCompletionTypes ) + { + if ( std::find( visibleCategories.begin(), + visibleCategories.end(), + static_cast( completionType ) ) != visibleCategories.end() ) + { + QString categoryText = + caf::AppEnum::uiText( completionType ); + categories.push_back( std::make_tuple( categoryText, + static_cast( completionType ), + colors[completionType] ) ); + } + } + + legendConfigToUpdate->setCategoryItems( categories ); + } + else + { + auto uniqueValues = cellResultsData->uniqueCellScalarValues( this->eclipseResultAddress() ); + if ( this->eclipseResultAddress().resultCatType() == RiaDefines::ResultCatType::FORMATION_NAMES ) + { + std::vector fnVector = eclipseCaseData->formationNames(); + uniqueValues.resize( fnVector.size() ); + std::iota( uniqueValues.begin(), uniqueValues.end(), 0 ); + } + + cvf::Color3ubArray legendBaseColors = legendConfigToUpdate->colorLegend()->colorArray(); + + cvf::ref categoryMapper = new caf::CategoryMapper; + categoryMapper->setCategories( uniqueValues ); + categoryMapper->setInterpolateColors( legendBaseColors ); + + std::vector visibleCategoryValues = uniqueValues; + + if ( m_showOnlyVisibleCategoriesInLegend ) + { + RimEclipseView* eclView = nullptr; + this->firstAncestorOrThisOfType( eclView ); + if ( eclView && eclView->showWindow() ) + { + // Check if current result is cell result, and update the visible set of values + // TODO: Can be extended to the separate geometry results (separate fault result, separate + // intersection results), but this requires some refactoring + if ( eclView->cellResult() == this ) + { + std::set visibleCategorySet = + RigVisibleCategoriesCalculator::visibleCategories( eclView ); + + visibleCategoryValues.clear(); + visibleCategoryValues.insert( visibleCategoryValues.begin(), + visibleCategorySet.begin(), + visibleCategorySet.end() ); + } + } + } + std::vector> categoryVector; + + for ( auto value : visibleCategoryValues ) + { + cvf::Color3ub categoryColor = categoryMapper->mapToColor( value ); + + QString valueTxt; + if ( this->resultType() == RiaDefines::ResultCatType::FORMATION_NAMES ) + { + std::vector fnVector = eclipseCaseData->formationNames(); + + if ( value < static_cast( fnVector.size() ) ) + { + valueTxt = fnVector[value]; + } + } + else + valueTxt = QString( "%1" ).arg( value ); + + categoryVector.push_back( std::make_tuple( valueTxt, value, categoryColor ) ); + } + legendConfigToUpdate->setCategoryItems( categoryVector ); + } + } + } + } + + // Ternary legend update + { + if ( !rimEclipseCase ) return; + + RigEclipseCaseData* eclipseCase = rimEclipseCase->eclipseCaseData(); + if ( !eclipseCase ) return; + + RigCaseCellResultsData* cellResultsData = eclipseCase->results( this->porosityModel() ); + + size_t maxTimeStepCount = cellResultsData->maxTimeStepCount(); + if ( this->isTernarySaturationSelected() && maxTimeStepCount > 1 ) + { + RigCaseCellResultsData* gridCellResults = this->currentGridCellResults(); + { + RigEclipseResultAddress resAddr( RiaDefines::ResultCatType::DYNAMIC_NATIVE, "SOIL" ); + + if ( gridCellResults->ensureKnownResultLoaded( resAddr ) ) + { + double globalMin = 0.0; + double globalMax = 1.0; + double localMin = 0.0; + double localMax = 1.0; + + cellResultsData->minMaxCellScalarValues( resAddr, globalMin, globalMax ); + cellResultsData->minMaxCellScalarValues( resAddr, currentTimeStep, localMin, localMax ); + + ternaryLegendConfigToUpdate->setAutomaticRanges( RimTernaryLegendConfig::TERNARY_SOIL_IDX, + globalMin, + globalMax, + localMin, + localMax ); + } + } + + { + RigEclipseResultAddress resAddr( RiaDefines::ResultCatType::DYNAMIC_NATIVE, "SGAS" ); + + if ( gridCellResults->ensureKnownResultLoaded( resAddr ) ) + { + double globalMin = 0.0; + double globalMax = 1.0; + double localMin = 0.0; + double localMax = 1.0; + + cellResultsData->minMaxCellScalarValues( resAddr, globalMin, globalMax ); + cellResultsData->minMaxCellScalarValues( resAddr, currentTimeStep, localMin, localMax ); + + ternaryLegendConfigToUpdate->setAutomaticRanges( RimTernaryLegendConfig::TERNARY_SGAS_IDX, + globalMin, + globalMax, + localMin, + localMax ); + } + } + + { + RigEclipseResultAddress resAddr( RiaDefines::ResultCatType::DYNAMIC_NATIVE, "SWAT" ); + + if ( gridCellResults->ensureKnownResultLoaded( resAddr ) ) + { + double globalMin = 0.0; + double globalMax = 1.0; + double localMin = 0.0; + double localMax = 1.0; + + cellResultsData->minMaxCellScalarValues( resAddr, globalMin, globalMax ); + cellResultsData->minMaxCellScalarValues( resAddr, currentTimeStep, localMin, localMax ); + + ternaryLegendConfigToUpdate->setAutomaticRanges( RimTernaryLegendConfig::TERNARY_SWAT_IDX, + globalMin, + globalMax, + localMin, + localMax ); + } + } + } + } +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimEclipseResultDefinition::updateLegendTitle( RimRegularLegendConfig* legendConfig, const QString& legendHeading ) +{ + QString title = legendHeading + this->resultVariableUiName(); + if ( !this->additionalResultTextShort().isEmpty() ) + { + title += additionalResultTextShort(); + } + + if ( this->hasDualPorFractureResult() ) + { + QString porosityModelText = caf::AppEnum::uiText( this->porosityModel() ); + + title += QString( "\nDual Por : %1" ).arg( porosityModelText ); + } + + legendConfig->setTitle( title ); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +QList RimEclipseResultDefinition::calcOptionsForSelectedTracerField( bool injector ) +{ + QList options; + + RimFlowDiagSolution* flowSol = m_flowSolutionUiField(); + if ( flowSol ) + { + std::set sortedTracers = setOfTracersOfType( injector ); + + for ( const QString& tracerName : sortedTracers ) + { + QString postfix; + RimFlowDiagSolution::TracerStatusType status = flowSol->tracerStatusOverall( tracerName ); + if ( status == RimFlowDiagSolution::TracerStatusType::VARYING ) + { + postfix = " [I/P]"; + } + else if ( status == RimFlowDiagSolution::TracerStatusType::UNDEFINED ) + { + postfix = " [U]"; + } + options.push_back( caf::PdmOptionItemInfo( tracerName + postfix, tracerName ) ); + } + } + return options; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +QString RimEclipseResultDefinition::timeOfFlightString( bool shorter ) const +{ + QString tofString; + bool multipleSelected = false; + if ( injectorSelectionState() != NONE_SELECTED && producerSelectionState() != NONE_SELECTED ) + { + tofString = shorter ? "Res.Time" : "Residence Time"; + multipleSelected = true; + } + else if ( injectorSelectionState() != NONE_SELECTED ) + { + tofString = shorter ? "Fwd.TOF" : "Forward Time of Flight"; + } + else if ( producerSelectionState() != NONE_SELECTED ) + { + tofString = shorter ? "Rev.TOF" : "Reverse Time of Flight"; + } + else + { + tofString = shorter ? "TOF" : "Time of Flight"; + } + + multipleSelected = multipleSelected || injectorSelectionState() >= MULTIPLE_SELECTED || + producerSelectionState() >= MULTIPLE_SELECTED; + + if ( multipleSelected && !shorter ) + { + tofString += " (Average)"; + } + + tofString += " [days]"; + // Conversion from seconds in flow module to days is done in RigFlowDiagTimeStepResult::setTracerTOF() + + return tofString; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +QString RimEclipseResultDefinition::maxFractionTracerString( bool shorter ) const +{ + QString mfString; + if ( injectorSelectionState() >= ONE_SELECTED && producerSelectionState() == NONE_SELECTED ) + { + mfString = shorter ? "FloodReg" : "Flooding Region"; + if ( injectorSelectionState() >= MULTIPLE_SELECTED ) mfString += "s"; + } + else if ( injectorSelectionState() == NONE_SELECTED && producerSelectionState() >= ONE_SELECTED ) + { + mfString = shorter ? "DrainReg" : "Drainage Region"; + if ( producerSelectionState() >= MULTIPLE_SELECTED ) mfString += "s"; + } + else + { + mfString = shorter ? "Drain&FloodReg" : "Drainage/Flooding Regions"; + } + return mfString; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +QString RimEclipseResultDefinition::selectedTracersString() const +{ + QStringList fullTracersList; + + FlowTracerSelectionState injectorState = injectorSelectionState(); + FlowTracerSelectionState producerState = producerSelectionState(); + + if ( injectorState == ALL_SELECTED && producerState == ALL_SELECTED ) + { + fullTracersList += caf::AppEnum::uiText( FLOW_TR_INJ_AND_PROD ); + } + else + { + if ( injectorState == ALL_SELECTED ) + { + fullTracersList += caf::AppEnum::uiText( FLOW_TR_INJECTORS ); + } + + if ( producerState == ALL_SELECTED ) + { + fullTracersList += caf::AppEnum::uiText( FLOW_TR_PRODUCERS ); + } + + if ( injectorSelectionState() == ONE_SELECTED || injectorSelectionState() == MULTIPLE_SELECTED ) + { + QStringList listOfSelectedInjectors; + for ( const QString& injector : m_selectedInjectorTracers() ) + { + listOfSelectedInjectors.push_back( injector ); + } + if ( !listOfSelectedInjectors.empty() ) + { + fullTracersList += listOfSelectedInjectors.join( ", " ); + } + } + + if ( producerSelectionState() == ONE_SELECTED || producerSelectionState() == MULTIPLE_SELECTED ) + { + QStringList listOfSelectedProducers; + for ( const QString& producer : m_selectedProducerTracers() ) + { + listOfSelectedProducers.push_back( producer ); + } + if ( !listOfSelectedProducers.empty() ) + { + fullTracersList.push_back( listOfSelectedProducers.join( ", " ) ); + } + } + } + + QString tracersText; + if ( !fullTracersList.empty() ) + { + tracersText = fullTracersList.join( ", " ); + } + return tracersText; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +QStringList RimEclipseResultDefinition::getResultNamesForResultType( RiaDefines::ResultCatType resultCatType, + const RigCaseCellResultsData* results ) +{ + if ( resultCatType != RiaDefines::ResultCatType::FLOW_DIAGNOSTICS ) + { + if ( !results ) return QStringList(); + + return results->resultNames( resultCatType ); + } + else + { + QStringList flowVars; + flowVars.push_back( RIG_FLD_TOF_RESNAME ); + flowVars.push_back( RIG_FLD_CELL_FRACTION_RESNAME ); + flowVars.push_back( RIG_FLD_MAX_FRACTION_TRACER_RESNAME ); + flowVars.push_back( RIG_FLD_COMMUNICATION_RESNAME ); + return flowVars; + } +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +std::vector RimEclipseResultDefinition::allTracerNames() const +{ + std::vector tracerNames; + + RimFlowDiagSolution* flowSol = m_flowSolutionUiField(); + if ( flowSol ) + { + tracerNames = flowSol->tracerNames(); + } + + return tracerNames; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +std::set RimEclipseResultDefinition::setOfTracersOfType( bool injector ) const +{ + std::set sortedTracers; + + RimFlowDiagSolution* flowSol = m_flowSolutionUiField(); + if ( flowSol ) + { + std::vector tracerNames = allTracerNames(); + for ( const QString& tracerName : tracerNames ) + { + RimFlowDiagSolution::TracerStatusType status = flowSol->tracerStatusOverall( tracerName ); + bool includeTracer = status == RimFlowDiagSolution::TracerStatusType::VARYING || + status == RimFlowDiagSolution::TracerStatusType::UNDEFINED; + includeTracer |= injector && status == RimFlowDiagSolution::TracerStatusType::INJECTOR; + includeTracer |= !injector && status == RimFlowDiagSolution::TracerStatusType::PRODUCER; + + if ( includeTracer ) + { + sortedTracers.insert( tracerName ); + } + } + } + return sortedTracers; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RimEclipseResultDefinition::FlowTracerSelectionState RimEclipseResultDefinition::injectorSelectionState() const +{ + if ( m_flowTracerSelectionMode == FLOW_TR_INJECTORS || m_flowTracerSelectionMode == FLOW_TR_INJ_AND_PROD ) + { + return ALL_SELECTED; + } + else if ( m_flowTracerSelectionMode == FLOW_TR_BY_SELECTION ) + { + if ( m_selectedInjectorTracers().size() == setOfTracersOfType( true ).size() ) + { + return ALL_SELECTED; + } + else if ( m_selectedInjectorTracers().size() == (size_t)1 ) + { + return ONE_SELECTED; + } + else if ( m_selectedInjectorTracers().size() > (size_t)1 ) + { + return MULTIPLE_SELECTED; + } + } + return NONE_SELECTED; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RimEclipseResultDefinition::FlowTracerSelectionState RimEclipseResultDefinition::producerSelectionState() const +{ + if ( m_flowTracerSelectionMode == FLOW_TR_PRODUCERS || m_flowTracerSelectionMode == FLOW_TR_INJ_AND_PROD ) + { + return ALL_SELECTED; + } + else if ( m_flowTracerSelectionMode == FLOW_TR_BY_SELECTION ) + { + if ( m_selectedProducerTracers().size() == setOfTracersOfType( false ).size() ) + { + return ALL_SELECTED; + } + else if ( m_selectedProducerTracers().size() == (size_t)1 ) + { + return ONE_SELECTED; + } + else if ( m_selectedProducerTracers().size() > (size_t)1 ) + { + return MULTIPLE_SELECTED; + } + } + return NONE_SELECTED; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimEclipseResultDefinition::syncInjectorToProducerSelection() +{ + const double epsilon = 1.0e-8; + + int timeStep = 0; + + Rim3dView* rimView = nullptr; + this->firstAncestorOrThisOfType( rimView ); + if ( rimView ) + { + timeStep = rimView->currentTimeStep(); + } + + RimFlowDiagSolution* flowSol = m_flowSolution(); + if ( flowSol && m_flowTracerSelectionMode == FLOW_TR_BY_SELECTION ) + { + std::set producers = setOfTracersOfType( false ); + + std::set newProducerSelection; + for ( const QString& selectedInjector : m_selectedInjectorTracers() ) + { + for ( const QString& producer : producers ) + { + std::pair commFluxes = + flowSol->flowDiagResults()->injectorProducerPairFluxes( selectedInjector.toStdString(), + producer.toStdString(), + timeStep ); + if ( std::abs( commFluxes.first ) > epsilon || std::abs( commFluxes.second ) > epsilon ) + { + newProducerSelection.insert( producer ); + } + } + } + // Add all currently selected producers to set + for ( const QString& selectedProducer : m_selectedProducerTracers() ) + { + newProducerSelection.insert( selectedProducer ); + } + std::vector newProducerVector( newProducerSelection.begin(), newProducerSelection.end() ); + setSelectedProducerTracers( newProducerVector ); + } +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimEclipseResultDefinition::syncProducerToInjectorSelection() +{ + const double epsilon = 1.0e-8; + + int timeStep = 0; + + Rim3dView* rimView = nullptr; + this->firstAncestorOrThisOfType( rimView ); + if ( rimView ) + { + timeStep = rimView->currentTimeStep(); + } + + RimFlowDiagSolution* flowSol = m_flowSolution(); + if ( flowSol && m_flowTracerSelectionMode == FLOW_TR_BY_SELECTION ) + { + std::set injectors = setOfTracersOfType( true ); + + std::set newInjectorSelection; + for ( const QString& selectedProducer : m_selectedProducerTracers() ) + { + for ( const QString& injector : injectors ) + { + std::pair commFluxes = + flowSol->flowDiagResults()->injectorProducerPairFluxes( injector.toStdString(), + selectedProducer.toStdString(), + timeStep ); + if ( std::abs( commFluxes.first ) > epsilon || std::abs( commFluxes.second ) > epsilon ) + { + newInjectorSelection.insert( injector ); + } + } + } + // Add all currently selected injectors to set + for ( const QString& selectedInjector : m_selectedInjectorTracers() ) + { + newInjectorSelection.insert( selectedInjector ); + } + std::vector newInjectorVector( newInjectorSelection.begin(), newInjectorSelection.end() ); + setSelectedInjectorTracers( newInjectorVector ); + } +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +bool RimEclipseResultDefinition::isDeltaResultEnabled() const +{ + return m_isDeltaResultEnabled; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +bool RimEclipseResultDefinition::isDeltaTimeStepPossible() const +{ + return isDeltaResultEnabled() && m_resultTypeUiField() == RiaDefines::ResultCatType::DYNAMIC_NATIVE && + !isTernarySaturationSelected(); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +bool RimEclipseResultDefinition::isDeltaTimeStepActive() const +{ + return isDeltaTimeStepPossible() && m_timeLapseBaseTimestep() >= 0; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +bool RimEclipseResultDefinition::isDeltaCasePossible() const +{ + return isDeltaResultEnabled() && !isTernarySaturationSelected() && + ( m_resultTypeUiField() == RiaDefines::ResultCatType::DYNAMIC_NATIVE || + m_resultTypeUiField() == RiaDefines::ResultCatType::STATIC_NATIVE || + m_resultTypeUiField() == RiaDefines::ResultCatType::GENERATED ); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +bool RimEclipseResultDefinition::isDeltaCaseActive() const +{ + return isDeltaCasePossible() && m_differenceCase() != nullptr; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +bool RimEclipseResultDefinition::isDivideByCellFaceAreaPossible() const +{ + QString str = m_resultVariable; + + // TODO : Move to RiaDefines or a separate file for cell face results + + if ( str == "FLRWATI+" ) return true; + if ( str == "FLRWATJ+" ) return true; + if ( str == "FLRWATK+" ) return true; + + if ( str == "FLROILI+" ) return true; + if ( str == "FLROILJ+" ) return true; + if ( str == "FLROILK+" ) return true; + + if ( str == "FLRGASI+" ) return true; + if ( str == "FLRGASJ+" ) return true; + if ( str == "FLRGASK+" ) return true; + + if ( str == "TRANX" ) return true; + if ( str == "TRANY" ) return true; + if ( str == "TRANZ" ) return true; + + if ( str == "riTRANX" ) return true; + if ( str == "riTRANY" ) return true; + if ( str == "riTRANZ" ) return true; + + return false; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +bool RimEclipseResultDefinition::isDivideByCellFaceAreaActive() const +{ + return isDivideByCellFaceAreaPossible() && m_divideByCellFaceArea; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +bool RimEclipseResultDefinition::showDerivedResultsFirstInVariableUiField() const +{ + // Cell Face result names + bool showDerivedResultsFirstInList = false; + RimEclipseFaultColors* rimEclipseFaultColors = nullptr; + this->firstAncestorOrThisOfType( rimEclipseFaultColors ); + + if ( rimEclipseFaultColors ) showDerivedResultsFirstInList = true; + + return showDerivedResultsFirstInList; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +bool RimEclipseResultDefinition::addPerCellFaceOptionsForVariableUiField() const +{ + RimPlotCurve* curve = nullptr; + this->firstAncestorOrThisOfType( curve ); + + RimEclipsePropertyFilter* propFilter = nullptr; + this->firstAncestorOrThisOfType( propFilter ); + + RimCellEdgeColors* cellEdge = nullptr; + this->firstAncestorOrThisOfType( cellEdge ); + + if ( propFilter || curve || cellEdge ) + { + return false; + } + + return true; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +QString RimEclipseResultDefinition::getInputPropertyFileName( const QString& resultName ) const +{ + RimEclipseCase* eclipseCase; + this->firstAncestorOrThisOfType( eclipseCase ); + + if ( eclipseCase ) + { + RimEclipseInputPropertyCollection* inputPropertyCollection = eclipseCase->inputPropertyCollection(); + if ( inputPropertyCollection ) + { + RimEclipseInputProperty* inputProperty = inputPropertyCollection->findInputProperty( resultName ); + if ( inputProperty ) + { + return inputProperty->fileName.v().path(); + } + } + } + + return ""; +} diff --git a/ApplicationLibCode/ProjectDataModel/RimVfpTableExtractor.cpp b/ApplicationLibCode/ProjectDataModel/RimVfpTableExtractor.cpp index 92efe10168..e8825f2d1d 100644 --- a/ApplicationLibCode/ProjectDataModel/RimVfpTableExtractor.cpp +++ b/ApplicationLibCode/ProjectDataModel/RimVfpTableExtractor.cpp @@ -1,93 +1,88 @@ -///////////////////////////////////////////////////////////////////////////////// -// -// Copyright (C) 2020- Equinor ASA -// -// ResInsight is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY -// WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at -// for more details. -// -///////////////////////////////////////////////////////////////////////////////// - -#include "RimVfpTableExtractor.h" - -// #include "RiaApplication.h" - -// #include "RimCase.h" -// #include "RimEclipseCase.h" -// #include "RimGeoMechCase.h" -// #include "RimOilField.h" -// #include "RimProject.h" -// #include "RimWellLogFile.h" -// #include "RimWellPath.h" -// #include "RimWellPathCollection.h" - -#include "cafPdmUiItem.h" -#include "cafUtils.h" - -// #include -// #include -// #include - -// #include "opm/parser/eclipse/EclipseState/Schedule/VFPInjTable.hpp" -// #include "opm/parser/eclipse/EclipseState/Schedule/VFPProdTable.hpp" -#include "opm/parser/eclipse/Parser/Parser.hpp" - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -std::vector RimVfpTableExtractor::extractVfpInjectionTables( const std::string& filename ) -{ - std::vector tables; - - Opm::Parser parser; - auto deck = parser.parseFile( filename ); - - std::string myKeyword = "VFPINJ"; - auto keywordList = deck.getKeywordList( myKeyword ); - - Opm::UnitSystem unitSystem; - - for ( auto kw : keywordList ) - { - auto name = kw->name(); - - Opm::VFPInjTable table( *kw, unitSystem ); - tables.push_back( table ); - } - - return tables; -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -std::vector RimVfpTableExtractor::extractVfpProductionTables( const std::string& filename ) -{ - std::vector tables; - - Opm::Parser parser; - auto deck = parser.parseFile( filename ); - - std::string myKeyword = "VFPPROD"; - auto keywordList = deck.getKeywordList( myKeyword ); - - Opm::UnitSystem unitSystem; - - for ( auto kw : keywordList ) - { - auto name = kw->name(); - - Opm::VFPProdTable table( *kw, unitSystem ); - tables.push_back( table ); - } - - return tables; -} +///////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2020- Equinor ASA +// +// ResInsight is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// + +#include "RimVfpTableExtractor.h" + +#include "cafPdmUiItem.h" +#include "cafUtils.h" + +#include "opm/parser/eclipse/Parser/Parser.hpp" + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +std::vector RimVfpTableExtractor::extractVfpInjectionTables( const std::string& filename ) +{ + std::vector tables; + + try + { + Opm::Parser parser; + auto deck = parser.parseFile( filename ); + + std::string myKeyword = "VFPINJ"; + auto keywordList = deck.getKeywordList( myKeyword ); + + Opm::UnitSystem unitSystem; + + for ( auto kw : keywordList ) + { + auto name = kw->name(); + + Opm::VFPInjTable table( *kw, unitSystem ); + tables.push_back( table ); + } + } + catch ( ... ) + { + } + + return tables; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +std::vector RimVfpTableExtractor::extractVfpProductionTables( const std::string& filename ) +{ + std::vector tables; + + try + { + Opm::Parser parser; + auto deck = parser.parseFile( filename ); + + std::string myKeyword = "VFPPROD"; + auto keywordList = deck.getKeywordList( myKeyword ); + + Opm::UnitSystem unitSystem; + + for ( auto kw : keywordList ) + { + auto name = kw->name(); + + Opm::VFPProdTable table( *kw, unitSystem ); + tables.push_back( table ); + } + } + catch ( ... ) + { + } + + return tables; +} From 01c137c2c8bda258863b4f8f4f7b0397e3465803 Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Mon, 14 Jun 2021 10:00:28 +0200 Subject: [PATCH 003/308] Add missing include --- .../ProjectDataModel/Faults/RimFaultRASettings.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ApplicationLibCode/ProjectDataModel/Faults/RimFaultRASettings.cpp b/ApplicationLibCode/ProjectDataModel/Faults/RimFaultRASettings.cpp index c43cae66d1..9bdd6a342c 100644 --- a/ApplicationLibCode/ProjectDataModel/Faults/RimFaultRASettings.cpp +++ b/ApplicationLibCode/ProjectDataModel/Faults/RimFaultRASettings.cpp @@ -43,6 +43,8 @@ #include +#include + CAF_PDM_SOURCE_INIT( RimFaultRASettings, "RimFaultRASettings" ); //-------------------------------------------------------------------------------------------------- From 47ad2fc21b9d6736043a7b323ebccff4dc19eef5 Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Mon, 14 Jun 2021 11:37:20 +0200 Subject: [PATCH 004/308] Python : Adjustment to setup.py.cmake --- GrpcInterface/Python/setup.py.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/GrpcInterface/Python/setup.py.cmake b/GrpcInterface/Python/setup.py.cmake index 498fa2194a..9f14dcab76 100644 --- a/GrpcInterface/Python/setup.py.cmake +++ b/GrpcInterface/Python/setup.py.cmake @@ -19,5 +19,5 @@ setup( license=license, packages=['rips'], package_data={'rips': ['*.py', 'generated/*.py', 'PythonExamples/*.py', 'tests/*.py']}, - install_requires=['grpcio>=1.20.0', protobuf, wheel] + install_requires=['grpcio>=1.20.0', 'protobuf', 'wheel'] ) \ No newline at end of file From 2383cd1088d227a9b38311d84f80392d19e8c032 Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Mon, 14 Jun 2021 11:44:06 +0200 Subject: [PATCH 005/308] Added object and field keywords for 2021.06 --- .../2021.06/ri-fieldKeywords.txt | 4114 +++++++++++++++++ .../2021.06/ri-objectKeywords.txt | 393 ++ 2 files changed, 4507 insertions(+) create mode 100644 ApplicationLibCode/Adm/projectfilekeywords/2021.06/ri-fieldKeywords.txt create mode 100644 ApplicationLibCode/Adm/projectfilekeywords/2021.06/ri-objectKeywords.txt diff --git a/ApplicationLibCode/Adm/projectfilekeywords/2021.06/ri-fieldKeywords.txt b/ApplicationLibCode/Adm/projectfilekeywords/2021.06/ri-fieldKeywords.txt new file mode 100644 index 0000000000..1285634d62 --- /dev/null +++ b/ApplicationLibCode/Adm/projectfilekeywords/2021.06/ri-fieldKeywords.txt @@ -0,0 +1,4114 @@ +// ResInsight version string : 2021.06.0 +// Report generated : man. jun 14 11:41:04 2021 +// +// + +AnalysisPlot - class RimAnalysisPlot + WindowController + ShowWindow + WindowGeometry + Id + (A)ViewId + ShowPlotTitle + ShowTrackLegends + TrackLegendsHorizontal + TitleFontSize + LegendDeltaFontSize + RowSpan + ColSpan + AnalysisPlotData + TimeStepFilter + TimeSteps + ReferenceCase + IsUsingAutoName + PlotDescription + BarOrientation + MajorGroupType + MediumGroupType + MinorGroupType + ValueSortOperation + groupForColors + UseTopBarsFilter + MaxBarCount + UseBarText + UseCaseInBarText + UseEnsembleInBarText + UseSummaryItemInBarText + UseTimeStepInBarText + UseQuantityInBarText + BarTextFontSize + ValueAxisProperties + PlotDataFilterCollection + +AnalysisPlotCollection - class RimAnalysisPlotCollection + AnalysisPlots + +AnalysisPlotDataEntry - class RimAnalysisPlotDataEntry + SummaryCase + Ensemble + SummaryAddress + IsEnsembleCurve + +Annotations - class RimAnnotationInViewCollection + IsActive + TextAnnotations + AnnotationPlaneDepth + SnapAnnotations + TextAnnotationsInView + ReachCircleAnnotationsInView + UserDefinedPolylinesAnnotationsInView + PolylinesFromFileAnnotationsInView + AnnotationFontSize + +AsciiDataCurve - class RimAsciiDataCurve + Show + CurveName + CurveDescription + LegendDescription + AutoName + Color + FillColor + Thickness + CurveInterpolation + LineStyle + FillStyle + PointSymbol + SymbolEdgeColor + SymbolSkipPxDist + ShowLegend + SymbolLabel + SymbolSize + ShowErrorBars + SymbolLabelPosition + PlotAxis + TimeSteps + Values + Title + +CalcScript - class RimCalcScript + AbsolutePath + +CalculatedSummaryCase - class RimCalculatedSummaryCase + ShortName + NameSetting + AutoShortyName + SummaryHeaderFilename + Id + (A)CaseId + +CellEdgeResultSlot - class RimCellEdgeColors + EnableCellEdgeColors + propertyType + CellEdgeVariable + UseXVariable + UseYVariable + UseZVariable + LegendDefinition + SingleVarEdgeResult + +CellPropertyFilter - class RimEclipsePropertyFilter + UserDescription + Active + FilterType + GridIndex + PropagateToSubGrids + SelectedValues + ResultDefinition + LowerBound + UpperBound + CategorySelection + +CellPropertyFilters - class RimEclipsePropertyFilterCollection + Active + PropertyFilters + +CellRangeFilter - class RimCellRangeFilter + UserDescription + Active + FilterType + GridIndex + PropagateToSubGrids + StartIndexI + CellCountI + StartIndexJ + CellCountJ + StartIndexK + CellCountK + +CellRangeFilterCollection - class RimCellFilterCollection + Active + CellFilters + RangeFilters + +ChangeDataSourceFeatureUi - class RimWellLogCurveCommonDataSource + CurveCase + TrajectoryType + CurveWellPath + SimulationWellName + BranchDetection + Branch + CurveTimeStep + WBSSmoothing + WBSSmoothingThreshold + +CmdFieldChangeExecData - class caf::CmdFieldChangeExecData + PathToField + +ColorLegend - class RimColorLegend + ColorLegendName + ColorLegendItems + +ColorLegendCollection - class RimColorLegendCollection + CustomColorLegends + +ColorLegendItem - class RimColorLegendItem + Color + CategoryValue + CategoryName + +CompletionTemplateCollection - class RimCompletionTemplateCollection + FractureTemplates + StimPlanModelTemplates + ValveTemplates + FractureGroupStatisticsCollection + +CorrelationMatrixPlot - class RimCorrelationMatrixPlot + WindowController + ShowWindow + WindowGeometry + Id + (A)ViewId + ShowPlotTitle + ShowTrackLegends + TrackLegendsHorizontal + TitleFontSize + LegendDeltaFontSize + RowSpan + ColSpan + AnalysisPlotData + TimeStepFilter + TimeStep + AutoTitle + PlotTitle + LabelFontSize + AxisTitleFontSize + AxisValueFontSize + UseCaseFilter + CurveSetForFiltering + EditCaseFilter + CorrelationAbsValues + CorrelationSorting + CorrelationAbsSorting + ExcludeParamsWithoutVariation + ShowOnlyTopNCorrelations + TopNFilterCount + LegendConfig + SelectedParameters + +CorrelationPlot - class RimCorrelationPlot + WindowController + ShowWindow + WindowGeometry + Id + (A)ViewId + ShowPlotTitle + ShowTrackLegends + TrackLegendsHorizontal + TitleFontSize + LegendDeltaFontSize + RowSpan + ColSpan + AnalysisPlotData + TimeStepFilter + TimeStep + AutoTitle + PlotTitle + LabelFontSize + AxisTitleFontSize + AxisValueFontSize + UseCaseFilter + CurveSetForFiltering + EditCaseFilter + CorrelationAbsValues + CorrelationAbsSorting + ExcludeParamsWithoutVariation + ShowOnlyTopNCorrelations + TopNFilterCount + SelectedParameters + +CorrelationPlotCollection - class RimCorrelationPlotCollection + CorrelationPlots + CorrelationReports + +CorrelationReportPlot - class RimCorrelationReportPlot + WindowController + ShowWindow + WindowGeometry + Id + (A)ViewId + ShowPlotTitle + ShowTrackLegends + TrackLegendsHorizontal + TitleFontSize + LegendDeltaFontSize + PlotWindowTitle + MatrixPlot + CorrelationPlot + CrossPlot + SubTitleFontSize + LabelFontSize + AxisTitleFontSize + AxisValueFontSize + +CrossSection - class RimExtrudedCurveIntersection + Active + ShowInactiveCells + UseSeparateIntersectionDataSource + SeparateIntersectionDataSource + UserDescription + Type + Direction + WellPath + SimulationWell + Points + AzimuthAngle + DipAngle + CustomExtrusionPoints + TwoAzimuthPoints + Branch + ExtentLength + lengthUp + lengthDown + +CrossSectionCollection - class RimIntersectionCollection + CrossSections + IntersectionBoxes + Active + +DataContainerFloat - class RimcDataContainerDouble + values + +DataContainerString - class RimcDataContainerString + values + +DataContainerTime - class RimcDataContainerTime + values + +DepthTrackPlot - class RimDepthTrackPlot + WindowController + ShowWindow + WindowGeometry + Id + (A)ViewId + ShowPlotTitle + ShowTrackLegends + TrackLegendsHorizontal + TitleFontSize + LegendDeltaFontSize + PlotDescription + DepthType + DepthUnit + MinimumDepth + MaximumDepth + ShowDepthGridLines + AutoScaleDepthEnabled + SubTitleFontSize + AxisTitleFontSize + AxisValueFontSize + NameConfig + Tracks + +DoubleParameter - class RimDoubleParameter + Name + Label + Description + Advanced + Valid + Value + +Eclipse2dViewCollection - class RimEclipseContourMapViewCollection + EclipseViews + +EclipseCase - class RimEclipseResultCase + Name + (A)CaseUserDescription + NameSetting + Id + (A)CaseId + FilePath + (A)CaseFileName + (A)GridFileName + DefaultFormationNames + TimeStepFilter + IntersectionViewCollection + ReservoirViews + MatrixModelResults + FractureModelResults + FlipXAxis + FlipYAxis + ContourMaps + InputPropertyCollection + UnitSystem + FlowDiagSolutions + SourSimFileName + +EclipseGeometrySelectionItem - class RimEclipseGeometrySelectionItem + EclipseCase + GridIndex + CellIndex + LocalIntersectionPoint + +ElasticProperties - class RimElasticProperties + FilePath + ShowScaledProperties + PropertyScalingCollection + +ElasticPropertyScaling - class RimElasticPropertyScaling + Name + IsChecked + Formation + Facies + Property + Scale + +ElasticPropertyScalingCollection - class RimElasticPropertyScalingCollection + ElasticPropertyScalings + +EnsembleFractureStatistics - class RimEnsembleFractureStatistics + Name + FilePaths + MeshAlignmentType + MeshType + NumberOfSamplesX + NumberOfSamplesY + AdaptiveMeanType + AdaptiveNumLayersType + AdaptiveNumLayers + SelectedStatisticsType + ComputeStatistics + +EnsembleFractureStatisticsPlot - class RimEnsembleFractureStatisticsPlot + WindowController + ShowWindow + WindowGeometry + Id + (A)ViewId + ShowPlotTitle + ShowTrackLegends + TrackLegendsHorizontal + TitleFontSize + LegendDeltaFontSize + PlotDescription + NumHistogramBins + HistogramBarColor + HistogramGapWidth + HistogramFrequencyType + Precision + TickNumberFormat + EnsembleFractureStatistics + Property + +EnsembleFractureStatisticsPlotCollection - class RimEnsembleFractureStatisticsPlotCollection + EnsembleFractureStatisticsPlots + +FaciesInitialPressureConfig - class RimFaciesInitialPressureConfig + IsChecked + FaciesName + FaciesValue + Fraction + +FaciesProperties - class RimFaciesProperties + FilePath + FaciesDefinition + ColorLegend + +Fault - class RimFaultInView + FaultName + ShowFault + Color + +Faults - class RimFaultInViewCollection + Active + ShowFaultFaces + ShowOppositeFaultFaces + ShowFaultsOutsideFilters + FaultFaceCulling + ShowFaultLabel + FaultLabelColor + ShowNNCs + HideNncsWhenNoResultIsAvailable + Faults + EnableFaultRA + FaultRASettings + +FileSummaryCase - class RimFileSummaryCase + ShortName + NameSetting + AutoShortyName + SummaryHeaderFilename + Id + (A)CaseId + IncludeRestartFiles + +FishbonesCollection - class RimFishbonesCollection + Name + IsChecked + FishbonesSubs + StartMD + MainBoreDiameter + MainBoreSkinFactor + +FishbonesMultipleSubs - class RimFishbones + Active + Name + Color + LateralCountPerSub + LateralLength + LateralExitAngle + LateralBuildAngle + LateralTubingDiameter + LateralOpenHoleRoghnessFactor + LateralTubingRoghnessFactor + LateralInstallSuccessFraction + IcdCount + IcdOrificeDiameter + IcdFlowCoefficient + SubsLocationMode + RangeStart + RangeEnd + RangeSubSpacing + RangeSubCount + LocationOfSubs + ValveLocations + SubsOrientationMode + InstallationRotationAngles + FixedInstallationRotationAngle + PipeProperties + +FishbonesPipeProperties - class RimFishbonesPipeProperties + LateralHoleDiameter + SkinFactor + +FlowCharacteristicsPlot - class RimFlowCharacteristicsPlot + WindowController + ShowWindow + WindowGeometry + FlowCase + FlowDiagSolution + TimeSelectionType + SelectedTimeSteps + SelectedTimeStepsUi + CellPVThreshold + ShowLegend + CellFilter + CellFilterView + TracerFilter + SelectedTracerNames + MinCommunication + MaxTof + +FlowDiagSolution - class RimFlowDiagSolution + UserDescription + +FlowPlotCollection - class RimFlowPlotCollection + FlowCharacteristicsPlot + DefaultWellAllocationPlot + WellDistributionPlotCollection + StoredWellAllocationPlots + StoredFlowCharacteristicsPlots + +FormationNames - class RimFormationNames + FormationNamesFileName + +FormationNamesCollectionObject - class RimFormationNamesCollection + FormationNamesList + +FractureContainment - class RimFractureContainment + IsUsingFractureContainment + TopKLayer + BaseKLayer + TruncateAtFaults + FaultThrowValue + +FractureDefinitionCollection - class RimFractureTemplateCollection + DefaultUnitForTemplates + FractureDefinitions + NextValidFractureTemplateId + +FractureGroupStatisticsCollection - class RimEnsembleFractureStatisticsCollection + FractureGroupStatistics + +GeoMech2dViewCollection - class RimGeoMechContourMapViewCollection + GeoMechViews + +GeoMechGeometrySelectionItem - class RimGeoMechGeometrySelectionItem + GeoMechCase + m_gridIndex + m_cellIndex + m_elementFace + m_hasIntersectionTriangle + m_intersectionTriangle_0 + m_intersectionTriangle_1 + m_intersectionTriangle_2 + m_localIntersectionPoint + +GeoMechPropertyFilter - class RimGeoMechPropertyFilter + UserDescription + Active + FilterType + GridIndex + PropagateToSubGrids + SelectedValues + ResultDefinition + LowerBound + UpperBound + +GeoMechPropertyFilters - class RimGeoMechPropertyFilterCollection + Active + PropertyFilters + +GeoMechResultDefinition - class RimGeoMechResultDefinition + ResultPositionType + ResultFieldName + ResultComponentName + TimeLapseBaseTimeStep + ReferenceTimeStep + CompactionRefLayer + NormalizeByHSP + NormalizationAirGap + +GeoMechResultSlot - class RimGeoMechCellColors + ResultPositionType + ResultFieldName + ResultComponentName + TimeLapseBaseTimeStep + ReferenceTimeStep + CompactionRefLayer + NormalizeByHSP + NormalizationAirGap + LegendDefinition + +GeoMechView - class RimGeoMechView + WindowController + ShowWindow + WindowGeometry + Id + (A)ViewId + NameConfig + CameraPosition + CameraPointOfInterest + PerspectiveProjection + GridZScale + BackgroundColor + (A)ViewBackgroundColor + MaximumFrameRate + AnimationMode + CurrentTimeStep + MeshMode + SurfaceMode + ShowGridBox + DisableLighting + ShowZScale + ComparisonView + FontSize + CrossSections + IntersectionResultDefColl + ReservoirSurfaceResultDefColl + GridCollection + OverlayInfoConfig + WellMeasurements + SurfaceInViewCollection + RangeFilters + GridCellResult + TensorResults + PropertyFilters + +GridCaseSurface - class RimGridCaseSurface + SurfaceUserDecription + SurfaceColor + DepthOffset + SourceCase + SliceIndex + +GridCollection - class RimGridCollection + IsActive + MainGrid + PersistentLgrs + +GridCrossPlotCurve - class RimGridCrossPlotCurve + Show + CurveName + CurveDescription + LegendDescription + AutoName + Color + FillColor + Thickness + CurveInterpolation + LineStyle + FillStyle + PointSymbol + SymbolEdgeColor + SymbolSkipPxDist + ShowLegend + SymbolLabel + SymbolSize + ShowErrorBars + SymbolLabelPosition + +GridCrossPlotCurveSet - class RimGridCrossPlotDataSet + Name + IsChecked + Case + TimeStep + VisibleCellView + Grouping + XAxisProperty + YAxisProperty + GroupingProperty + NameConfig + CrossPlotCurves + UseCustomColor + CustomColor + PlotCellFilterCollection + +GridInfo - class RimGridInfo + IsActive + GridName + GridIndex + +GridInfoCollection - class RimGridInfoCollection + IsActive + GridInfos + +GridStatisticsPlot - class RimGridStatisticsPlot + WindowController + ShowWindow + WindowGeometry + Id + (A)ViewId + ShowPlotTitle + ShowTrackLegends + TrackLegendsHorizontal + TitleFontSize + LegendDeltaFontSize + PlotDescription + NumHistogramBins + HistogramBarColor + HistogramGapWidth + HistogramFrequencyType + Precision + TickNumberFormat + Case + TimeStep + VisibleCellView + Property + +GridStatisticsPlotCollection - class RimGridStatisticsPlotCollection + GridStatisticsPlots + +GridSummaryCase - class RimGridSummaryCase + ShortName + NameSetting + AutoShortyName + SummaryHeaderFilename + Id + (A)CaseId + Associated3DCase + CachedCasename + Associated3DCaseGridFileName + IncludeRestartFiles + +GridTimeHistoryCurve - class RimGridTimeHistoryCurve + Show + CurveName + CurveDescription + LegendDescription + AutoName + Color + FillColor + Thickness + CurveInterpolation + LineStyle + FillStyle + PointSymbol + SymbolEdgeColor + SymbolSkipPxDist + ShowLegend + SymbolLabel + SymbolSize + ShowErrorBars + SymbolLabelPosition + GeometrySelectionText + EclipseResultDefinition + GeoMechResultDefinition + GeometrySelectionItem + PlotAxis + +IntegerParameter - class RimIntegerParameter + Name + Label + Description + Advanced + Valid + Value + +Intersection2dView - class Rim2dIntersectionView + WindowController + ShowWindow + WindowGeometry + Id + (A)ViewId + NameConfig + CameraPosition + CameraPointOfInterest + PerspectiveProjection + GridZScale + BackgroundColor + (A)ViewBackgroundColor + MaximumFrameRate + AnimationMode + CurrentTimeStep + MeshMode + SurfaceMode + ShowGridBox + DisableLighting + ShowZScale + ComparisonView + FontSize + Intersection + ShowDefiningPoints + ShowAxisLines + +Intersection2dViewCollection - class Rim2dIntersectionViewCollection + IntersectionViews + +IntersectionBox - class RimBoxIntersection + Active + ShowInactiveCells + UseSeparateIntersectionDataSource + SeparateIntersectionDataSource + UserDescription + singlePlaneState + MinXCoord + MaxXCoord + MinYCoord + MaxYCoord + MinDepth + MaxDepth + xySliderStepSize + DepthSliderStepSize + +IntersectionResultDefinition - class RimIntersectionResultDefinition + IsActive + Case + TimeStep + IntersectionResultDefinitionDescription + EclipseResultDef + GeoMechResultDef + LegendConfig + TernaryLegendConfig + +Legend - class RimRegularLegendConfig + ShowLegend + NumberOfLevels + Precision + TickNumberFormat + ColorRangeMode + ColorLegend + MappingMode + RangeType + UserDefinedMax + UserDefinedMin + CategoryColorMode + ResultVariableUsage + ResetDefaultValues + +MainPlotCollection - class RimMainPlotCollection + Show + WellLogPlotCollection + RftPlotCollection + PltPlotCollection + SummaryPlotCollection + AnalysisPlotCollection + CorrelationPlotCollection + SummaryCrossPlotCollection + FlowPlotCollection + Rim3dCrossPlotCollection + RimSaturationPressurePlotCollection + RimMultiPlotCollection + StimPlanModelPlotCollection + VfpPlotCollection + GridStatisticsPlotCollection + EnsembleFractureStatisticsPlotCollection + +MdiWindowController - class RimMdiWindowController + MainWindowID + xPos + yPos + Width + Height + IsMaximized + +MockModelSettings - class RimMockModelSettings + CellCountX + CellCountY + CellCountZ + TotalCellCount + ResultCount + TimeStepCount + +ModeledWellPath - class RimModeledWellPath + Name + (A)WellPathName + AirGap + DatumElevation + UnitSystem + SimWellName + SimBranchIndex + ShowWellPathLabel + ShowWellPath + WellPathRadiusScale + WellPathColor + Completions + CompletionSettings + WellLogFiles + CollectionOf3dWellLogCurves + WellPathFormationKeyInFile + WellPathFormationFilePath + WellPathAttributes + WellPathTieIn + WellPathGeometryDef + +MultiPlot - class RimMultiPlot + WindowController + ShowWindow + WindowGeometry + Id + (A)ViewId + ShowPlotTitle + ShowTrackLegends + TrackLegendsHorizontal + TitleFontSize + LegendDeltaFontSize + ShowTitleInPlot + PlotDescription + Plots + NumberOfColumns + RowsPerPage + ShowPlotTitles + MajorTickmarkCount + SubTitleFontSize + PagePreviewMode + +MultiSnapshotDefinition - class RimAdvancedSnapshotExportDefinition + IsActive + View + EclipseResultType + SelectedEclipseResults + TimeStepStart + TimeStepEnd + SnapShotDirection + RangeFilterStart + RangeFilterEnd + AdditionalCases + +NonNetLayers - class RimNonNetLayers + IsChecked + Cutoff + Facies + FaciesDefinition + +ObservedDataCollection - class RimObservedDataCollection + ObservedDataArray + ObservedFmuRftDataArray + +ObservedFmuRftData - class RimObservedFmuRftData + Name + Directory + +ParameterGroup - class RimParameterGroup + Parameters + Name + Expanded + +ParameterResultCrossPlot - class RimParameterResultCrossPlot + WindowController + ShowWindow + WindowGeometry + Id + (A)ViewId + ShowPlotTitle + ShowTrackLegends + TrackLegendsHorizontal + TitleFontSize + LegendDeltaFontSize + RowSpan + ColSpan + AnalysisPlotData + TimeStepFilter + TimeStep + AutoTitle + PlotTitle + LabelFontSize + AxisTitleFontSize + AxisValueFontSize + UseCaseFilter + CurveSetForFiltering + EditCaseFilter + EnsembleParameter + +PdmDocument - class caf::PdmDocument + DocumentFileName + +PdmObjectCollection - class caf::PdmObjectCollection + PdmObjects + +PdmObjectGroup - class caf::PdmObjectGroup + +Perforation - class RimPerforationInterval + Name + IsChecked + StartMeasuredDepth + EndMeasuredDepth + Diameter + SkinFactor + StartOfHistory + UseCustomStartDate + StartDate + UseCustomEndDate + EndDate + Valves + +PerforationCollection - class RimPerforationCollection + Name + IsChecked + Perforations + NonDarcyParameters + +PlotDataFilterCollection - class RimPlotDataFilterCollection + IsActive + PlotDataFiltersField + +PlotDataFilterItem - class RimPlotDataFilterItem + IsActive + FilterTarget + FilterAddressField + QuantityText + FilterOperation + MinTopN + Max + Min + EnsembleParameterValueCategories + ConsideredTimestepsType + ExplicitlySelectedTimeSteps + +PlotTemplateCollection - class RimPlotTemplateFolderItem + FolderName + FileNames + SubFolders + +PlotTemplateFileItem - class RimPlotTemplateFileItem + AbsolutePath + +PolyLineFilter - class RimPolygonFilter + UserDescription + Active + FilterType + GridIndex + PropagateToSubGrids + PolygonFilterType + PolyIncludeType + Targets + Case + ShowLines + ShowSpheres + LineThickness + SphereRadiusFactor + LineColor + SphereColor + EnableFiltering + EnableKFilter + KRangeFilter + PolygonPlaneDepth + LockPolygon + +PolygonFilter - class RimPolygonFilter + UserDescription + Active + FilterType + GridIndex + PropagateToSubGrids + PolygonFilterType + PolyIncludeType + Targets + Case + ShowLines + ShowSpheres + LineThickness + SphereRadiusFactor + LineColor + SphereColor + EnableFiltering + EnableKFilter + KRangeFilter + PolygonPlaneDepth + LockPolygon + +PolylineTarget - class RimPolylineTarget + IsEnabled + TargetPointXyd + +PolylinesFromFileAnnotation - class RimPolylinesFromFileAnnotation + IsActive + ClosePolyline + ShowLines + ShowSpheres + Appearance + PolyLineFilePath + PolyLineDescription + +PressureTable - class RimPressureTable + Items + PressureDate + +PressureTableItem - class RimPressureTableItem + Depth + InitialPressure + Pressure + +PropertyFilter - class RimPropertyFilter + UserDescription + Active + FilterType + GridIndex + PropagateToSubGrids + SelectedValues + +ResInsightAnalysisModels - class RimEclipseCaseCollection + Reservoirs + CaseGroups + +ResInsightGeoMechCase - class RimGeoMechCase + Name + (A)CaseUserDescription + NameSetting + Id + (A)CaseId + FilePath + (A)CaseFileName + (A)GridFileName + DefaultFormationNames + TimeStepFilter + IntersectionViewCollection + GeoMechViews + CaseCohesion + FrctionAngleDeg + ElementPropertyFileNames + BiotCoefficientType + BiotFixedCoefficient + BiotResultAddress + InitialPermeabilityType + InitialPermeabilityFixed + InitialPermeabilityAddress + PermeabilityExponent + WaterDensityShearSlipIndicator + ContourMaps + MudWeightWindowParameters + +ResInsightGeoMechModels - class RimGeoMechModels + Cases + +ResInsightOilField - class RimOilField + AnalysisModels + GeoMechModels + WellPathCollection + CompletionTemplateCollection + SummaryCaseCollection + FormationNamesCollection + ObservedDataCollection + AnnotationCollection + FractureDefinitionCollection + SurfaceCollection + +ResInsightProject - class RimProject + DocumentFileName + ProjectFileVersionString + ReferencedExternalFiles + OilFields + ColorLegendCollection + WellPathImport + MainPlotCollection + LinkedViews + CalculationCollection + CommandObjects + MultiSnapshotDefinitions + TreeViewState + TreeViewCurrentModelIndexPath + PlotWindowTreeViewState + PlotWindowTreeViewCurrentModelIndexPath + show3DWindow + showPlotWindow + tiled3DWindow + tiledPlotWindow + DialogData + Reservoirs + CaseGroups + +ResampleData - class RimcSummaryResampleData + TimeSteps + Values + +ReservoirCellResultStorage - class RimReservoirCellResultsStorage + ResultCacheFileName + ResultCacheEntries + +ReservoirView - class RimEclipseView + WindowController + ShowWindow + WindowGeometry + Id + (A)ViewId + NameConfig + CameraPosition + CameraPointOfInterest + PerspectiveProjection + GridZScale + BackgroundColor + (A)ViewBackgroundColor + MaximumFrameRate + AnimationMode + CurrentTimeStep + MeshMode + SurfaceMode + ShowGridBox + DisableLighting + ShowZScale + ComparisonView + FontSize + CrossSections + IntersectionResultDefColl + ReservoirSurfaceResultDefColl + GridCollection + OverlayInfoConfig + WellMeasurements + SurfaceInViewCollection + RangeFilters + GridCellResult + GridCellEdgeResult + ElementVectorResult + FaultResultSettings + StimPlanColors + VirtualPerforationResult + WellCollection + FaultCollection + AnnotationCollection + StreamlineCollection + PropertyFilters + ShowInactiveCells + ShowInvalidCells + +ResultDefinition - class RimEclipseResultDefinition + ResultType + PorosityModelType + ResultVariable + FlowDiagSolution + TimeLapseBaseTimeStep + DifferenceCase + DivideByCellFaceArea + SelectedInjectorTracers + SelectedProducerTracers + SelectedSouringTracers + FlowTracerSelectionMode + PhaseSelection + ShowOnlyVisibleCategoriesInLegend + MSyncSelectedInjProd + MSyncSelectedProdInj + +ResultSlot - class RimEclipseCellColors + ResultType + PorosityModelType + ResultVariable + FlowDiagSolution + TimeLapseBaseTimeStep + DifferenceCase + DivideByCellFaceArea + SelectedInjectorTracers + SelectedProducerTracers + SelectedSouringTracers + FlowTracerSelectionMode + PhaseSelection + ShowOnlyVisibleCategoriesInLegend + MSyncSelectedInjProd + MSyncSelectedProdInj + LegendDefinition + ResultVarLegendDefinitionList + TernaryLegendDefinition + LegendDefinitionPtrField + +ResultStorageEntryInfo - class RimReservoirCellResultsStorageEntryInfo + ResultType + ResultName + TimeSteps + DaysSinceSimulationStart + FilePositionDataStart + +RftAddress - class RimDataSourceForRftPlt + SourceType + EclipseCase + WellLogFile + Ensemble + ObservedFmuRftData + +RiaMemoryCleanup - class RiaMemoryCleanup + DataCase + ResultsToDelete + +RiaPreferences - class RiaPreferences + navigationPolicy + enableGrpcServer + defaultGrpcPort + scriptDirectory + scriptEditorExecutable + octaveExecutable + octaveShowHeaderInfoWhenExecutingScripts + pythonExecutable + pythonDebugInfo + ssihubAddress + defaultMeshModeType + defaultGridLineColors + defaultFaultGridLineColors + defaultWellLableColor + defaultViewerBackgroundColor + defaultScaleFactorZ + defaultSceneFontSizePt + defaultAnnotationFontSizePt + defaultWellLabelFontSizePt + defaultPlotFontSizePt + showLasCurveWithoutTvdWarning + useShaders + showHud + appendClassNameToUiText + appendFieldKeywordToToolTipText + showViewIdInTree + showTestToolbar + includeFractureDebugInfoFile + showLegendBackground + enableFaultsByDefault + showInfoBox + showGridBox + lastUsedProjectFileName + autocomputeDepth + loadAndShowSoil + holoLensExportFolder + holoLensDisableCertificateVerification + csvTextExportFieldSeparator + showProjectChangedDialog + readerSettings + dateFormat + timeFormat + showProgressBar + useUndoRedo + plotTemplateFolders + SearchPlotTemplateFoldersRecursively + defaultPlotTemplate + pageSize + pageOrientation + pageLeftMargin + pageTopMargin + pageRightMargin + pageBottomMargin + openExportedPdfInViewer + gtestFilter + SurfaceImportResamplingDistance + MultiLateralWellPattern + guiTheme + summaryPreferences + geoMechPreferences + +RiaPreferencesGeoMech - class RiaPreferencesGeoMech + geomechFRAPreprocCommand + geomechFRAPostprocCommand + geomechFRAMacrisCommand + geomechFRADefaultXML + geomechFRADefaultAdvXML + keepTemporaryFile + +RiaPreferencesSummary - class RiaPreferencesSummary + summaryRestartFilesShowImportDialog + summaryImportMode + gridImportMode + summaryEnsembleImportMode + defaultSummaryHistoryCurveStyle + defaultSummaryCurvesTextFilter + createOptimizedSummaryDataFile + useOptimizedSummaryDataFile + createH5SummaryDataFile + checkH5FileTimeStamp + createH5SummaryFileThreadCount + summaryReaderType + showSummaryTimeAsLongString + useMultipleThreadsWhenLoadingSummaryCases + +RiaRegressionTest - class RiaRegressionTest + workingFolder + folderContainingDiffTool + folderContainingGitTool + regressionTestFolder + showInteractiveDiffImages + useOpenMPForGeometryCreation + openReportInBrowser + testFilter + appendTestsAfterTestFilter + invalidateExternalFilePaths + +RicCaseAndFileExportSettingsUi - class RicCaseAndFileExportSettingsUi + Folder + CaseToApply + +RicCellRangeUi - class RicCellRangeUi + Case + GridIndex + StartIndexI + StartIndexJ + StartIndexK + CellCountI + CellCountJ + CellCountK + +RicDeleteItemExecData - class RicDeleteItemExecData + PathToField + Description + indexToObject + deletedObjectAsXml + +RicExportCarfinUi - class RicExportCarfinUi + CellRange + ExportFileName + CaseToApply + CellCountI + CellCountJ + CellCountK + MaxWellCount + +RicExportCompletionDataSettingsUi - class RicExportCompletionDataSettingsUi + Folder + CaseToApply + FileSplit + compdatExport + TimeStepIndex + IncludeMSW + UseLateralNTG + IncludePerforations + IncludeFishbones + IncludeFractures + TransScalingType + TransScalingTimeStep + TransScalingWBHPSource + TransScalingWBHP + ExcludeMainBoreForFishbones + ReportCompletionTypesSeparately + ExportDataSourceAsComment + ExportWelspec + CompletionWelspecAfterMainBore + UseCustomFileName + CustomFileName + +RicExportContourMapToTextUi - class RicExportContourMapToTextUi + ExportFileName + ExportLocalCoordinates + UndefinedValueLabel + ExcludeUndefinedValues + +RicExportEclipseInputGridUi - class RicExportEclipseSectorModelUi + ExportGrid + ExportGridFilename + ExportInLocalCoords + InvisibleCellActnum + GridBoxSelection + MinI + MinJ + MinK + MaxI + MaxJ + MaxK + ExportFaults + ExportFaultsFilename + RefinementCountI + RefinementCountJ + RefinementCountK + ExportParams + ExportParamsFilename + ExportMainKeywords + +RicExportLgrUi - class RicExportLgrUi + ExportFolder + CaseToApply + TimeStepIndex + IncludePerforations + IncludeFractures + IncludeFishbones + CellCountI + CellCountJ + CellCountK + SplitType + +RicExportToLasFileObj - class RicExportToLasFileObj + tvdrkbOffset + +RicExportToLasFileResampleUi - class RicExportToLasFileResampleUi + ExportFolder + FilePrefix + CapitalizeFileName + CurveUnitConversion + ActivateResample + ResampleInterval + ExportTvdrkb + tvdrkbOffsets + +RicExportWellPathsUi - class RicExportWellPathsUi + ExportFolder + MdStepSize + +RicHoloLensCreateSessionUi - class RicHoloLensCreateSessionUi + SessionName + SessionPinCode + ServerSettings + +RicHoloLensExportToFolderUi - class RicHoloLensExportToFolderUi + ViewForExport + ExportFolder + +RicHoloLensServerSettings - class RicHoloLensServerSettings + ServerAddress + +RicLinkVisibleViewsFeatureUi - class RicLinkVisibleViewsFeatureUi + MasterView + +RicPasteAsciiDataToSummaryPlotFeatureUi - class RicPasteAsciiDataToSummaryPlotFeatureUi + PlotTitle + CurvePrefix + DecimalSeparator + DateFormat + TimeFormat + UseCustomDateFormat + CustomDateTimeFormat + LineStyle + Symbol + SymbolSkipDinstance + CellSeparator + TimeColumnName + PreviewText + +RicSaturationPressureUi - class RicSaturationPressureUi + CaseToApply + TimeStep + +RicSaveEclipseInputVisibleCellsUi - class RicSaveEclipseInputVisibleCellsUi + ExportFilename + ExportKeyword + VisibleActiveCellsValue + HiddenActiveCellsValue + InactiveCellsValue + +RicSelectPlotTemplateUi - class RicSelectPlotTemplateUi + SelectedPlotTemplates + +RicSelectSummaryPlotUI - class RicSelectSummaryPlotUI + SelectedSummaryPlot + CreateNewPlot + NewViewName + +RicSelectViewUI - class RicSelectViewUI + MasterView + CreateNewView + NewViewName + +RicSummaryAddressSelection - class RiuSummaryVectorSelectionUi + SummaryCases + CurrentSummaryCategory + SelectedSummaryCategories + FieldVectors + Aquifers + AquiferVectors + NetworkVectors + MiscVectors + Regions + RegionsVectors + Region2RegionRegions + Region2RegionVectors + WellGroupWellGroupNames + WellGroupVectors + WellWellName + WellVectors + WellCompletionWellName + WellCompletionIjk + WellCompletionVectors + WellCompletionLgrLgrName + WellCompletionLgrWellName + WellCompletionLgrIjk + WellCompletionLgrVectors + WellLgrLgrName + WellLgrWellName + WellLgrVectors + WellSegmentWellName + WellSegmentNumber + WellSegmentVectors + BlockIjk + BlockVectors + BlockLgrLgrName + BlockLgrIjk + BlockLgrVectors + CalculatedVectors + ImportedVectors + +RicSummaryCurveCalculator - class RicSummaryCurveCalculatorUi + CurrentCalculation + NewCalculation + DeleteCalculation + +RicSummaryCurveCreator - class RicSummaryPlotEditorUi + TargetPlot + UseAutoAppearanceAssignment + AppearanceApplyButton + CaseAppearanceType + VariableAppearanceType + WellAppearanceType + GroupAppearanceType + RegionAppearanceType + UseAutoPlotTitle + ApplySelection + Close + OK + SummaryCurveNameConfig + +RicWellPathsUnitSystemSettingsUi - class RicWellPathsUnitSystemSettingsUi + UnitSystem + +RifReaderSettings - class RifReaderSettings + importFaults + importSimulationNNCs + includeInactiveCellsInFaultGeometry + importAdvancedMswData + useResultIndexFile + skipWellData + includeFileAbsolutePathPrefix + +Rim3dWellLogCurveCollection - class Rim3dWellLogCurveCollection + Show3dWellLogCurves + PlaneWidthScaling + Show3dWellLogGrid + Show3dWellLogBackground + ArrayOf3dWellLogCurves + +Rim3dWellLogExtractionCurve - class Rim3dWellLogExtractionCurve + Show3dWellLogCurve + MinCurveValue + MaxCurveValue + DrawPlane + CurveColor + CurveCase + CurveTimeStep + CurveEclipseResult + CurveGeomechResult + NameConfig + +Rim3dWellLogFileCurve - class Rim3dWellLogFileCurve + Show3dWellLogCurve + MinCurveValue + MaxCurveValue + DrawPlane + CurveColor + CurveWellLogChannel + WellLogFile + NameConfig + +Rim3dWellLogRftCurve - class Rim3dWellLogRftCurve + Show3dWellLogCurve + MinCurveValue + MaxCurveValue + DrawPlane + CurveColor + eclipseResultCase + timeStep + wellLogChannelName + NameConfig + +RimAnnotationCollection - class RimAnnotationCollection + IsActive + TextAnnotations + ReachCircleAnnotations + UserDefinedPolylineAnnotations + PolylineFromFileAnnotations + +RimAnnotationCollectionBase - class RimAnnotationCollectionBase + IsActive + TextAnnotations + +RimAnnotationGroupCollection - class RimAnnotationGroupCollection + IsActive + Annotations + +RimAnnotationLineAppearance - class RimAnnotationLineAppearance + LineFieldsHidden + Color + Thickness + +RimAnnotationTextAppearance - class RimAnnotationTextAppearance + FontSize + FontColor + BackgroundColor + AnchorLineColor + +RimBinaryExportSettings - class RimBinaryExportSettings + Filename + EclipseKeyword + UndefinedValue + +RimCaseCollection - class RimCaseCollection + Reservoirs + +RimCellFilterCollection - class RimCellFilterCollection + Active + CellFilters + RangeFilters + +RimCommandExecuteScript - class RimCommandExecuteScript + Name + ScriptText + IsEnabled + +RimCommandIssueFieldChanged - class RimCommandIssueFieldChanged + CommandName + ObjectName + FieldName + FieldValueToApply + +RimCommandObject - class RimCommandObject + +RimContourMapView - class RimEclipseContourMapView + WindowController + ShowWindow + WindowGeometry + Id + (A)ViewId + NameConfig + CameraPosition + CameraPointOfInterest + PerspectiveProjection + GridZScale + BackgroundColor + (A)ViewBackgroundColor + MaximumFrameRate + AnimationMode + CurrentTimeStep + MeshMode + SurfaceMode + ShowGridBox + DisableLighting + ShowZScale + ComparisonView + FontSize + CrossSections + IntersectionResultDefColl + ReservoirSurfaceResultDefColl + GridCollection + OverlayInfoConfig + WellMeasurements + SurfaceInViewCollection + RangeFilters + GridCellResult + GridCellEdgeResult + ElementVectorResult + FaultResultSettings + StimPlanColors + VirtualPerforationResult + WellCollection + FaultCollection + AnnotationCollection + StreamlineCollection + PropertyFilters + ShowInactiveCells + ShowInvalidCells + ContourMapProjection + ShowAxisLines + ShowScaleLegend + +RimCsvUserData - class RimCsvUserData + ShortName + NameSetting + AutoShortyName + SummaryHeaderFilename + Id + (A)CaseId + UseCustomIdentifier + SummaryType + IdentifierName + ParseOptions + +RimCustomObjectiveFunction - class RimCustomObjectiveFunction + FunctionTitle + CustomFunctionTitle + Weights + ObjectiveFunctions + +RimCustomObjectiveFunctionCollection - class RimCustomObjectiveFunctionCollection + ObjectiveFunctions + +RimCustomObjectiveFunctionWeight - class RimCustomObjectiveFunctionWeight + WeightTitle + ObjectiveSummaryAddress + WeightValue + ObjectiveFunction + +RimDerivedEnsembleCase - class RimDerivedSummaryCase + ShortName + NameSetting + AutoShortyName + SummaryHeaderFilename + Id + (A)CaseId + SummaryCase1 + Operator + SummaryCase2 + UseFixedTimeStep + FixedTimeStepIndex + InUse + +RimDerivedEnsembleCaseCollection - class RimDerivedEnsembleCaseCollection + SummaryCases + SummaryCollectionName + NameCount + IsEnsemble + Id + (A)EnsembleId + Ensemble1 + Ensemble2 + Operator + CaseCount + MatchOnParameters + UseFixedTimeStep + FixedTimeStepIndex + +RimDialogData - class RimDialogData + ExportCarfin + ExportCompletionData + MultipleFractionsData + HoloLenseExportToFolderData + ExportwellPathsData + ExportLgr + ExportSectorModel + MockModelSettings + +RimEclipseContourMapProjection - class RimEclipseContourMapProjection + Name + IsChecked + SampleSpacing + ResultAggregation + ContourLines + ContourLabels + SmoothContourLines + WeightByParameter + WeightingResult + +RimElementVectorResult - class RimElementVectorResult + LegendDefinition + ShowOil + ShowGas + ShowWater + ShowResult + VectorView + VectorSurfaceCrossingLocation + ShowVectorI + ShowVectorJ + ShowVectorK + ShowNncData + Threshold + VectorColor + UniformVectorColor + SizeScale + +RimEllipseFractureTemplate - class RimEllipseFractureTemplate + Id + UserDescription + UnitSystem + Orientation + AzimuthAngle + SkinFactor + PerforationLength + PerforationEfficiency + WellDiameter + ConductivityType + WellPathDepthAtFracture + FractureContainmentField + NonDarcyFlowType + UserDefinedDFactor + FractureWidthType + FractureWidth + BetaFactorType + InertialCoefficient + PermeabilityType + RelativePermeability + EffectivePermeability + RelativeGasDensity + GasViscosity + HeightScaleFactor + WidthScaleFactor + DFactorScaleFactor + ConductivityFactor + HalfLength + Height + Width + Permeability + +RimEnsembleCurveFilter - class RimEnsembleCurveFilter + FilterTitle + Active + FilterMode + EnsembleParameter + ObjectiveSummaryAddress + ObjectiveFunction + CustomObjectiveFunction + MinValue + MaxValue + Categories + +RimEnsembleCurveFilterCollection - class RimEnsembleCurveFilterCollection + Active + CurveFilters + NewEnsembleFilter + +RimEnsembleCurveSet - class RimEnsembleCurveSet + EnsembleCurveSet + IsActive + SummaryGroup + SummaryAddress + Resampling + ColorMode + Color + EnsembleParameter + ObjectiveSummaryAddress + CustomObjectiveFunction + ShowObjectiveFunctionFormula + MinDateRange + MinTimeStep + MaxDateRange + MaxTimeStep + TimeStepFilter + TimeSteps + PlotAxis + LegendConfig + CurveFilters + CustomObjectiveFunctions + ObjectiveFunction + Statistics + UserDefinedName + AutoName + SummaryAddressNameTools + VarListFilter + +RimEnsembleCurveSetCollection - class RimEnsembleCurveSetCollection + EnsembleCurveSets + IsActive + +RimEnsembleStatistics - class RimEnsembleStatistics + Active + HideEnsembleCurves + BasedOnFilteredCases + ShowP10Curve + ShowP50Curve + ShowP90Curve + ShowMeanCurve + ShowCurveLabels + IncludeIncompleteCurves + Color + +RimEquilibriumAxisAnnotation - class RimEquilibriumAxisAnnotation + Active + Name + Value + RangeStart + RangeEnd + AnnotationType + Associated3DCase + m_equilNum + +RimExportInputSettings - class RimExportInputSettings + Filename + Keyword + +RimFaultRAPreprocSettings - class RimFaultRAPreprocSettings + StartTimeStepEclipse + EndTimeStepEclipse + StartTimeStepGeoMech + EndTimeStepGeoMech + EclipseCase + GeomechCase + BaseDir + CleanBaseDir + SmoothEclipseData + ElasticTableFilename + +RimFaultRASettings - class RimFaultRASettings + EclipseCase + GeomechCase + EclipseFRACase + BaseDir + ElasticTableFilename + StartTimeStepEclipse + EndTimeStepEclipse + StartTimeStepGeoMech + EndTimeStepGeoMech + BasicParameters + AdvancedParameters + BasicParametersRI + AdvancedParametersRI + +RimFaultResultSlot - class RimEclipseFaultColors + ShowCustomFaultResult + CustomResultSlot + +RimFractureExportSettings - class RimFractureExportSettings + Filename + CaseToApply + +RimGeoMechContourMapProjection - class RimGeoMechContourMapProjection + Name + IsChecked + SampleSpacing + ResultAggregation + ContourLines + ContourLabels + SmoothContourLines + LimitToPorRegion + VerticalLimit + PaddingAroundPorRegion + +RimGeoMechContourMapView - class RimGeoMechContourMapView + WindowController + ShowWindow + WindowGeometry + Id + (A)ViewId + NameConfig + CameraPosition + CameraPointOfInterest + PerspectiveProjection + GridZScale + BackgroundColor + (A)ViewBackgroundColor + MaximumFrameRate + AnimationMode + CurrentTimeStep + MeshMode + SurfaceMode + ShowGridBox + DisableLighting + ShowZScale + ComparisonView + FontSize + CrossSections + IntersectionResultDefColl + ReservoirSurfaceResultDefColl + GridCollection + OverlayInfoConfig + WellMeasurements + SurfaceInViewCollection + RangeFilters + GridCellResult + TensorResults + PropertyFilters + ContourMapProjection + ShowAxisLines + ShowScaleLegend + +RimGridCrossPlot - class RimGridCrossPlot + WindowController + ShowWindow + WindowGeometry + Id + (A)ViewId + ShowPlotTitle + ShowTrackLegends + TrackLegendsHorizontal + TitleFontSize + LegendDeltaFontSize + RowSpan + ColSpan + ShowInfoBox + NameConfig + xAxisProperties + yAxisProperties + CrossPlotCurve + +RimGridCrossPlotCollection - class RimGridCrossPlotCollection + GridCrossPlots + +RimGridCrossPlotCurveSetNameConfig - class RimGridCrossPlotDataSetNameConfig + CustomCurveName + AddCaseName + AddAxisVariables + AddTimeStep + AddGrouping + +RimGridCrossPlotNameConfig - class RimGridCrossPlotNameConfig + CustomCurveName + AddDataSetNames + +RimIdenticalGridCaseGroup - class RimIdenticalGridCaseGroup + UserDescription + GroupId + StatisticsCaseCollection + CaseCollection + +RimInputProperty - class RimEclipseInputProperty + ResultName + EclipseKeyword + FileName + +RimInputPropertyCollection - class RimEclipseInputPropertyCollection + InputProperties + +RimInputReservoir - class RimEclipseInputCase + Name + (A)CaseUserDescription + NameSetting + Id + (A)CaseId + FilePath + (A)CaseFileName + (A)GridFileName + DefaultFormationNames + TimeStepFilter + IntersectionViewCollection + ReservoirViews + MatrixModelResults + FractureModelResults + FlipXAxis + FlipYAxis + ContourMaps + InputPropertyCollection + AdditionalFileNamesProxy + +RimIntersectionResultsDefinitionCollection - class RimIntersectionResultsDefinitionCollection + isActive + IntersectionResultDefinitions + +RimMeasurement - class RimMeasurement + +RimMswCompletionParameters - class RimMswCompletionParameters + RefMDType + RefMD + CustomValuesForLateral + LinerDiameter + RoughnessFactor + PressureDrop + LengthAndDepth + EnforceMaxSegmentLength + MaxSegmentLength + +RimMudWeightWindowParameters - class RimMudWeightWindowParameters + WellDeviationSourceType + WellDeviationFixed + WellDeviationAddress + WellAzimuthSourceType + WellAzimuthFixed + WellAzimuthAddress + UCSSourceType + UCSFixed + UCSAddress + PoissonsRatioSourceType + PoissonsRatioFixed + PoissonsRatioAddress + K0_FGSourceType + K0_FGFixed + K0_FGAddress + obg0SourceType + obg0Fixed + obg0Address + AirGap + SHMultiplier + UpperLimitType + LowerLimitType + FractureGradientCalculationType + PorePressureNonReservoirSource + UserPPNonReservoir + PPNonReservoirAddress + ReferenceLayer + +RimMultiPlotCollection - class RimMultiPlotCollection + MultiPlots + +RimMultipleValveLocations - class RimMultipleValveLocations + LocationMode + RangeStart + RangeEnd + ValveSpacing + RangeValveCount + LocationOfValves + +RimNonDarcyPerforationParameters - class RimNonDarcyPerforationParameters + NonDarcyFlowType + UserDefinedDFactor + GridPermeabilityScalingFactor + WellRadius + RelativeGasDensity + GasViscosity + InertialCoefficientBeta0 + PermeabilityScalingFactor + PorosityScalingFactor + +RimObjectiveFunction - class RimObjectiveFunction + FunctionType + NormalizeByNumberOfObservations + NormalizeByNumberOfVectors + ErrorEstimatePercentage + UseSquaredError + +RimObservedEclipseUserData - class RimObservedEclipseUserData + ShortName + NameSetting + AutoShortyName + SummaryHeaderFilename + Id + (A)CaseId + UseCustomIdentifier + SummaryType + IdentifierName + +RimOilFieldEntry - class RimOilFieldEntry + OilFieldName + EdmId + Selected + wellsFilePath + Wells + +RimOilRegionEntry - class RimOilRegionEntry + OilRegionEntry + Fields + Selected + +RimPlotAxisAnnotation - class RimPlotAxisAnnotation + Active + Name + Value + RangeStart + RangeEnd + +RimPlotCellFilterCollection - class RimPlotCellFilterCollection + Name + IsChecked + FilterMode + CellFilters + +RimPlotCellPropertyFilter - class RimPlotCellPropertyFilter + Name + IsChecked + FilterMode + ResultDefinition + LowerBound + UpperBound + +RimPolylineAppearance - class RimPolylineAppearance + LineFieldsHidden + Color + Thickness + SphereFieldsHidden + SphereColor + SphereRadiusFactor + +RimPolylinesAnnotationInView - class RimPolylinesAnnotationInView + IsActive + SourceAnnotation + +RimPolylinesFromFileAnnotationInView - class RimPolylinesFromFileAnnotationInView + IsActive + SourceAnnotation + +RimProcess - class RimProcess + Command + Description + ID + +RimReachCircleAnnotation - class RimReachCircleAnnotation + IsActive + CenterPointXyd + Radius + Name + Appearance + +RimReachCircleAnnotationInView - class RimReachCircleAnnotationInView + IsActive + SourceAnnotation + +RimSaturationPressurePlot - class RimSaturationPressurePlot + WindowController + ShowWindow + WindowGeometry + Id + (A)ViewId + ShowPlotTitle + ShowTrackLegends + TrackLegendsHorizontal + TitleFontSize + LegendDeltaFontSize + RowSpan + ColSpan + ShowInfoBox + NameConfig + xAxisProperties + yAxisProperties + CrossPlotCurve + +RimSaturationPressurePlotCollection - class RimSaturationPressurePlotCollection + SaturationPressurePlots + +RimStatisticalCalculation - class RimEclipseStatisticsCase + Name + (A)CaseUserDescription + NameSetting + Id + (A)CaseId + FilePath + (A)CaseFileName + (A)GridFileName + DefaultFormationNames + TimeStepFilter + IntersectionViewCollection + ReservoirViews + MatrixModelResults + FractureModelResults + FlipXAxis + FlipYAxis + ContourMaps + InputPropertyCollection + ResultType + PorosityModel + DynamicPropertiesToCalculate + StaticPropertiesToCalculate + GeneratedPropertiesToCalculate + InputPropertiesToCalculate + FractureDynamicPropertiesToCalculate + FractureStaticPropertiesToCalculate + FractureGeneratedPropertiesToCalculate + FractureInputPropertiesToCalculate + CalculatePercentiles + PercentileCalculationType + LowPercentile + MidPercentile + HighPercentile + WellDataSourceCase + UseZeroAsInactiveCellValue + +RimStatisticalCollection - class RimEclipseStatisticsCaseCollection + Reservoirs + +RimStimPlanColors - class RimStimPlanColors + IsChecked + ResultName + DefaultColor + LegendConfigurations + ShowStimPlanMesh + StimPlanCellVizMode + +RimStimPlanFractureTemplate - class RimStimPlanFractureTemplate + Id + UserDescription + UnitSystem + Orientation + AzimuthAngle + SkinFactor + PerforationLength + PerforationEfficiency + WellDiameter + ConductivityType + WellPathDepthAtFracture + FractureContainmentField + NonDarcyFlowType + UserDefinedDFactor + FractureWidthType + FractureWidth + BetaFactorType + InertialCoefficient + PermeabilityType + RelativePermeability + EffectivePermeability + RelativeGasDensity + GasViscosity + HeightScaleFactor + WidthScaleFactor + DFactorScaleFactor + ConductivityFactor + StimPlanFileName + UserDefinedWellPathDepthAtFracture + BorderPolygonResultName + ActiveTimeStepIndex + ConductivityResultName + ShowStimPlanMesh + +RimStimPlanLegendConfig - class RimStimPlanLegendConfig + Name + Legend + +RimSummaryCalculation - class RimSummaryCalculation + Description + Expression + Unit + Variables + CalculatedValues + TimeSteps + Id + +RimSummaryCalculationCollection - class RimSummaryCalculationCollection + Calculations + +RimSummaryCalculationVariable - class RimSummaryCalculationVariable + VariableName + SummaryCase + SummaryAddress + +RimSummaryCurveCollection - class RimSummaryCurveCollection + CollectionCurves + IsActive + +RimSummaryCurveCollectionModifier - class RimSummaryPlotSourceStepping + CurveCase + IncludeEnsembleCasesForCaseStepping + WellName + GroupName + Region + Quantities + CellBlock + Segment + Completion + Aquifer + Ensemble + Placeholder + +RimTensorResults - class RimTensorResults + LegendDefinition + ResultVariable + ShowTensors + Principal1 + Principal2 + Principal3 + Threshold + VectorColor + ScaleMethod + SizeScale + RangeType + +RimTernaryLegendConfig - class RimTernaryLegendConfig + ShowTernaryLegend + Precision + RangeType + ternaryRangeSummary + UserDefinedMaxSoil + UserDefinedMinSoil + UserDefinedMaxSgas + UserDefinedMinSgas + UserDefinedMaxSwat + UserDefinedMinSwat + +RimTextAnnotation - class RimTextAnnotation + AnchorPointXyd + LabelPointXyd + Text + IsActive + TextAppearance + +RimTextAnnotationInView - class RimTextAnnotationInView + IsActive + SourceAnnotation + +RimTimeAxisAnnotation - class RimTimeAxisAnnotation + Active + Name + Value + RangeStart + RangeEnd + +RimTimeStepFilter - class RimTimeStepFilter + FilterType + FirstTimeStep + LastTimeStep + Interval + DateFormat + TimeStepIndicesToImport + +RimUserDefinedPolylinesAnnotationInView - class RimUserDefinedPolylinesAnnotationInView + IsActive + SourceAnnotation + +RimVfpPlotCollection - class RimVfpPlotCollection + VfpPlots + +RimViewLinkerCollection - class RimViewLinkerCollection + Active + ViewLinkers + +RimViewNameConfig - class RimViewNameConfig + CustomCurveName + AddCaseName + AddAggregationType + AddProperty + AddSampleSpacing + +RimVirtualPerforationResults - class RimVirtualPerforationResults + ShowConnectionFactors + ShowClosedConnections + GeometryScaleFactor + LegendDefinition + +RimWellLogExtractionCurve - class RimWellLogExtractionCurve + Show + CurveName + CurveDescription + LegendDescription + AutoName + Color + FillColor + Thickness + CurveInterpolation + LineStyle + FillStyle + PointSymbol + SymbolEdgeColor + SymbolSkipPxDist + ShowLegend + SymbolLabel + SymbolSize + ShowErrorBars + SymbolLabelPosition + StackCurve + StackPhaseColors + TrajectoryType + CurveWellPath + SimulationWellName + BranchDetection + Branch + CurveCase + CurveEclipseResult + CurveGeomechResult + CurveTimeStep + AddCaseNameToCurveName + AddPropertyToCurveName + AddWellNameToCurveName + AddTimestepToCurveName + AddDateToCurveName + +RimWellLogExtractionCurveNameConfig - class RimWellLogExtractionCurveNameConfig + CustomCurveName + AddCaseName + AddProperty + AddWellName + AddTimeStep + AddDate + +RimWellLogFileCurveNameConfig - class RimWellLogFileCurveNameConfig + CustomCurveName + +RimWellLogPlotNameConfig - class RimWellLogPlotNameConfig + CustomCurveName + AddCaseName + AddWellName + AddTimeStep + AddAirGap + AddWaterDepth + +RimWellLogRftCurveNameConfig - class RimWellLogRftCurveNameConfig + CustomCurveName + +RimWellLogWbsCurve - class RimWellLogWbsCurve + Show + CurveName + CurveDescription + LegendDescription + AutoName + Color + FillColor + Thickness + CurveInterpolation + LineStyle + FillStyle + PointSymbol + SymbolEdgeColor + SymbolSkipPxDist + ShowLegend + SymbolLabel + SymbolSize + ShowErrorBars + SymbolLabelPosition + StackCurve + StackPhaseColors + TrajectoryType + CurveWellPath + SimulationWellName + BranchDetection + Branch + CurveCase + CurveEclipseResult + CurveGeomechResult + CurveTimeStep + AddCaseNameToCurveName + AddPropertyToCurveName + AddWellNameToCurveName + AddTimestepToCurveName + AddDateToCurveName + SmoothCurve + SmoothingThreshold + +RimWellPathEntry - class RimWellPathEntry + Name + Selected + WellPathType + surveyType + requestUrl + wellPathFilePath + +RimWellPathImport - class RimWellPathImport + WellTypeSurvey + WellTypePlans + UtmMode + UtmNorth + UtmSouth + UtmEast + UtmWest + Regions + +RimWellPathTieIn - class RimWellPathTieIn + ParentWellPath + ChildWellPath + TieInMeasuredDepth + AddValveAtConnection + Valve + +RiuCreateMultipleFractionsUi - class RiuCreateMultipleFractionsUi + SourceCase + MinDistanceFromWellTd + MaxFracturesPerWell + Options + FractureCreationSummary + +RiuMultipleFractionsOptions - class RicCreateMultipleFracturesOptionItemUi + TopKLayer + BaseKLayer + Template + MinSpacing + +ScriptLocation - class RimScriptCollection + ScriptDirectory + CalcScripts + SubDirectories + SearchSubFolders + +SimWellFracture - class RimSimWellFracture + Name + IsChecked + FractureDef + EditTemplate + CreateEllipseTemplate + CreateStimPlanTemplate + AutoUpdateWellPathDepthAtFractureFromTemplate + WellPathDepthAtFracture + Azimuth + PerforationLength + PerforationEfficiency + WellDiameter + Dip + Tilt + FractureUnit + TimeIndexToPlot + MeasuredDepth + Branch + +SimWellFractureCollection - class RimSimWellFractureCollection + Fractures + +StimPlanModel - class RimStimPlanModel + Name + IsChecked + StimPlanModelTemplate + EditModelTemplate + EclipseCase + TimeStep + InitialPressureEclipseCase + StaticEclipseCase + MeasuredDepth + ExtractionDepthTop + ExtractionDepthBottom + ExtractionType + AnchorPosition + ThicknessDirection + ThicknessDirectionWellPath + BoundingBoxHorizontal + BoundingBoxVertical + UseDetailedFluidLoss + RelativePermeabilityFactor + PoroElasticConstant + ThermalExpansionCoefficient + PerforationLength + FractureOrientation + AzimuthAngle + FormationDip + AutoComputeBarrier + Barrier + DistanceToBarrier + BarrierDip + WellPenetrationLayer + ShowOnlyBarrierFault + ShowAllFaults + BarrierFaultName + BarrierAnnotation + BarrierTextAnnotation + +StimPlanModelCollection - class RimStimPlanModelCollection + Name + IsChecked + StimPlanModels + +StimPlanModelCurve - class RimStimPlanModelCurve + Show + CurveName + CurveDescription + LegendDescription + AutoName + Color + FillColor + Thickness + CurveInterpolation + LineStyle + FillStyle + PointSymbol + SymbolEdgeColor + SymbolSkipPxDist + ShowLegend + SymbolLabel + SymbolSize + ShowErrorBars + SymbolLabelPosition + StackCurve + StackPhaseColors + TrajectoryType + CurveWellPath + SimulationWellName + BranchDetection + Branch + CurveCase + CurveEclipseResult + CurveGeomechResult + CurveTimeStep + AddCaseNameToCurveName + AddPropertyToCurveName + AddWellNameToCurveName + AddTimestepToCurveName + AddDateToCurveName + StimPlanModel + CurveProperty + +StimPlanModelPlot - class RimStimPlanModelPlot + WindowController + ShowWindow + WindowGeometry + Id + (A)ViewId + ShowPlotTitle + ShowTrackLegends + TrackLegendsHorizontal + TitleFontSize + LegendDeltaFontSize + PlotDescription + DepthType + DepthUnit + MinimumDepth + MaximumDepth + ShowDepthGridLines + AutoScaleDepthEnabled + SubTitleFontSize + AxisTitleFontSize + AxisValueFontSize + NameConfig + Tracks + StimPlanModel + EditModel + EclipseCase + TimeStep + +StimPlanModelPlotCollection - class RimStimPlanModelPlotCollection + StimPlanModelPlots + +StimPlanModelTemplate - class RimStimPlanModelTemplate + Name + Id + DynamicEclipseCase + TimeStep + InitialPressureEclipseCase + UseForInitialPressure + UseForPressure + EditPressureTable + StaticEclipseCase + DefaultPorosity + DefaultPermeability + VerticalStress + VerticalStressGradient + StressDepth + ReferenceTemperature + ReferenceTemperatureGradient + ReferenceTemperatureDepth + OverburdenHeight + OverburdenFormation + OverburdenFacies + OverburdenPorosity + OverburdenPermeability + OverburdenFluidDensity + UnderburdenHeight + UnderburdenFormation + UnderburdenFacies + UnderburdenPorosity + UnderburdenPermeability + UnderburdenFluidDensity + FaciesInitialPressureConfigs + PressureTable + ElasticProperties + FaciesProperties + NonNetLayers + +StimPlanModelTemplateCollection - class RimStimPlanModelTemplateCollection + StimPlanModelTemplates + NextValidId + +StreamlineInViewCollection - class RimStreamlineInViewCollection + LegendDefinition + Name + FlowThreshold + LengthThreshold + Resolution + MaxDays + UseProducers + UseInjectors + Phase + isActive + VisualizationMode + ColorMode + AnimationSpeed + AnimationIndex + ScaleFactor + TracerLength + +StringParameter - class RimStringParameter + Name + Label + Description + Advanced + Valid + Value + +SummaryAddress - class RimSummaryAddress + SummaryVarType + SummaryQuantityName + SummaryRegion + SummaryRegion2 + SummaryWellGroup + SummaryWell + SummaryWellSegment + SummaryLgr + SummaryCellI + SummaryCellJ + SummaryCellK + SummaryAquifer + IsErrorResult + CalculationId + +SummaryCaseCollection - class RimSummaryCaseMainCollection + SummaryCases + SummaryCaseCollections + +SummaryCaseSubCollection - class RimSummaryCaseCollection + SummaryCases + SummaryCollectionName + NameCount + IsEnsemble + Id + (A)EnsembleId + +SummaryCrossPlot - class RimSummaryCrossPlot + WindowController + ShowWindow + WindowGeometry + Id + (A)ViewId + ShowPlotTitle + ShowTrackLegends + TrackLegendsHorizontal + TitleFontSize + LegendDeltaFontSize + RowSpan + ColSpan + IsUsingAutoName + PlotDescription + normalizeCurveYValues + SummaryCurveCollection + EnsembleCurveSetCollection + GridTimeHistoryCurves + AsciiDataCurves + LeftYAxisProperties + RightYAxisProperties + BottomAxisProperties + TimeAxisProperties + SummaryPlotFilterTextCurveSetEditor + +SummaryCrossPlotCollection - class RimSummaryCrossPlotCollection + SummaryCrossPlots + +SummaryCurve - class RimSummaryCurve + Show + CurveName + CurveDescription + LegendDescription + AutoName + Color + FillColor + Thickness + CurveInterpolation + LineStyle + FillStyle + PointSymbol + SymbolEdgeColor + SymbolSkipPxDist + ShowLegend + SymbolLabel + SymbolSize + ShowErrorBars + SymbolLabelPosition + StackCurve + StackPhaseColors + SummaryCase + SummaryAddress + Resampling + SummaryCaseX + SummaryAddressX + IsEnsembleCurve + PlotAxis + SummaryCurveNameConfig + isTopZWithinCategory + VarListFilter + VarListFilterX + +SummaryCurveAutoName - class RimSummaryCurveAutoName + VectorName + Unit + RegionNumber + WellGroupName + WellName + WellSegmentNumber + LgrName + Completion + Aquifer + CaseName + +SummaryCurveFilter - class RimSummaryCurveFilter_OBSOLETE + VarListFilter + FilteredCurves + AutoApplyFilterChanges + IsActive + UseAutoAppearanceAssignment + CaseAppearanceType + VariableAppearanceType + WellAppearanceType + GroupAppearanceType + RegionAppearanceType + PlotAxis + ShowLegend + SummaryCurveNameConfig + +SummaryFilterSettings - class RimSummaryFilter_OBSOLETE + SummaryFilterType + SummaryCompleteVarStringFilter + SummaryVarQuantityFilter + SummaryRegionNumberFilter + SummaryRegionNumber2Filter + SummaryWellGroupNameFilter + SummaryWellNameFilter + SummaryWellSegmentNumberFilter + SummaryLgrNameFilter + SummaryCellIJKFilter + +SummaryObservedDataFile - class RimSummaryObservedDataFile + ShortName + NameSetting + AutoShortyName + SummaryHeaderFilename + Id + (A)CaseId + UseCustomIdentifier + SummaryType + IdentifierName + +SummaryPageDownloadEntity - class SummaryPageDownloadEntity + Name + RequestUrl + ResponseFilename + +SummaryPlot - class RimSummaryPlot + WindowController + ShowWindow + WindowGeometry + Id + (A)ViewId + ShowPlotTitle + ShowTrackLegends + TrackLegendsHorizontal + TitleFontSize + LegendDeltaFontSize + RowSpan + ColSpan + IsUsingAutoName + PlotDescription + normalizeCurveYValues + SummaryCurveCollection + EnsembleCurveSetCollection + GridTimeHistoryCurves + AsciiDataCurves + LeftYAxisProperties + RightYAxisProperties + BottomAxisProperties + TimeAxisProperties + SummaryPlotFilterTextCurveSetEditor + +SummaryPlotCollection - class RimSummaryPlotCollection + SummaryPlots + +SummaryPlotFilterTextCurveSetEditor - class RimSummaryPlotFilterTextCurveSetEditor + CurveFilterText + SummaryCases + +SummaryTimeAxisProperties - class RimSummaryTimeAxisProperties + Active + ShowTitle + Title + AutoZoom + TimeMode + TimeUnit + VisibleDateRangeMax + VisibleDateRangeMin + VisibleTimeRangeMax + VisibleTimeRangeMin + VisibleTimeModeRangeMax + VisibleTimeModeRangeMin + TitlePosition + FontSize + ValuesFontSize + AutoDate + DateComponents + TimeComponents + DateFormat + TimeFormat + MajorTickmarkCount + Annotations + +SummaryYAxisProperties - class RimPlotAxisProperties + Active + Name + AutoTitle + DisplayLongName + DisplayShortName + DisplayUnitText + CustomTitle + VisibleRangeMax + VisibleRangeMin + NumberFormat + Decimals + ScaleFactor + AutoZoom + LogarithmicScale + AxisInverted + TitlePosition + TitleDeltaFontSize + ValueDeltaFontSize + Annotations + +Surface - class RimFileSurface + SurfaceUserDecription + SurfaceColor + DepthOffset + SurfaceFilePath + +SurfaceCollection - class RimSurfaceCollection + SurfaceUserDecription + SubCollections + SurfacesField + +SurfaceInView - class RimSurfaceInView + Active + ShowInactiveCells + UseSeparateIntersectionDataSource + SeparateIntersectionDataSource + Name + SurfaceRef + ResultDefinition + +SurfaceInViewCollection - class RimSurfaceInViewCollection + Name + IsChecked + SurfacesInViewFieldCollections + SurfacesInViewField + SurfaceCollectionRef + +SurfaceResultDefinition - class RimSurfaceResultDefinition + Name + IsChecked + PropertyName + LegendConfig + SurfaceInView + +TofAccumulatedPhaseFractionsPlot - class RimTofAccumulatedPhaseFractionsPlot + WindowController + ShowWindow + WindowGeometry + PlotDescription + ShowPlotTitle + MaxTof + +TotalWellAllocationPlot - class RimTotalWellAllocationPlot + WindowController + ShowWindow + WindowGeometry + PlotDescription + ShowPlotTitle + +UserDefinedFilter - class RimUserDefinedFilter + UserDescription + Active + FilterType + GridIndex + PropagateToSubGrids + IndividualCellIndices + +UserDefinedPolylinesAnnotation - class RimUserDefinedPolylinesAnnotation + IsActive + ClosePolyline + ShowLines + ShowSpheres + Appearance + Name + Targets + +ValveTemplate - class RimValveTemplate + Name + UnitSystem + CompletionType + UserLabel + OrificeDiameter + FlowCoefficient + AICDParameters + +ValveTemplateCollection - class RimValveTemplateCollection + ValveDefinitions + ValveUnits + +VfpPlot - class RimVfpPlot + WindowController + ShowWindow + WindowGeometry + Id + (A)ViewId + ShowPlotTitle + ShowTrackLegends + TrackLegendsHorizontal + TitleFontSize + LegendDeltaFontSize + RowSpan + ColSpan + PlotTitle + FilePath + TableType + TableNumber + ReferenceDepth + FlowingPhase + FlowingWaterFraction + FlowingGasFraction + InterpolatedVariable + PrimaryVariable + FamilyVariable + LiquidFlowRateIdx + THPIdx + ArtificialLiftQuantityIdx + WaterCutIdx + GasLiquidRatioIdx + +View3dOverlayInfoConfig - class Rim3dOverlayInfoConfig + Active + ShowAnimProgress + ShowInfoText + ShowResultInfo + ShowHistogram + ShowVolumeWeightedMean + ShowVersionInfo + StatisticsTimeRange + StatisticsCellRange + +ViewController - class RimViewController + Active + Name + ManagedView + SyncCamera + ShowCursor + SyncTimeStep + SyncCellResult + SyncLegendDefinitions + SyncRangeFilters + SyncPropertyFilters + +ViewLinker - class RimViewLinker + Name + MainView + ManagedViews + +WbsParameters - class RimWbsParameters + PorePressureReservoirSource + PorePressureNonReservoirSource + UserPPNonReservoir + PoissionRatioSource + UcsSource + OBG0Source + DFSource + K0SHSource + FGShaleSource + K0FGSource + WaterDensitySource + UserPoissonRatio + UserUcs + UserDF + UserK0FG + UserK0SH + FGMultiplier + WaterDensity + GeoMechCase + WellPath + TimeStep + +Well - class RimSimWellInView + Name + (A)WellName + ShowWell + ShowWellLabel + ShowWellHead + ShowWellPipe + ShowWellSpheres + ShowWellDisks + WellHeadScaleFactor + WellPipeRadiusScale + WellPipeColor + WellDiskColor + ShowWellCells + ShowWellCellFence + FractureCollection + +WellAllocationPlot - class RimWellAllocationPlot + WindowController + ShowWindow + WindowGeometry + PlotDescription + ShowPlotTitle + BranchDetection + CurveCase + PlotTimeStep + WellName + FlowDiagSolution + FlowType + GroupSmallContributions + SmallContributionsThreshold + AccumulatedWellFlowPlot + TotalWellFlowPlot + WellAllocLegend + TofAccumulatedPhaseFractionsPlot + +WellAllocationPlotLegend - class RimWellAllocationPlotLegend + ShowPlotLegend + +WellBoreStabilityPlot - class RimWellBoreStabilityPlot + WindowController + ShowWindow + WindowGeometry + Id + (A)ViewId + ShowPlotTitle + ShowTrackLegends + TrackLegendsHorizontal + TitleFontSize + LegendDeltaFontSize + PlotDescription + DepthType + DepthUnit + MinimumDepth + MaximumDepth + ShowDepthGridLines + AutoScaleDepthEnabled + SubTitleFontSize + AxisTitleFontSize + AxisValueFontSize + NameConfig + Tracks + WbsParameters + +WellDistributionPlot - class RimWellDistributionPlot + WindowController + ShowWindow + WindowGeometry + Id + (A)ViewId + ShowPlotTitle + ShowTrackLegends + TrackLegendsHorizontal + TitleFontSize + LegendDeltaFontSize + RowSpan + ColSpan + Case + TimeStepIndex + WellName + Phase + GroupSmallContributions + SmallContributionsRelativeThreshold + MaximumTOF + +WellDistributionPlotCollection - class RimWellDistributionPlotCollection + WindowController + ShowWindow + WindowGeometry + Id + (A)ViewId + ShowPlotTitle + ShowTrackLegends + TrackLegendsHorizontal + TitleFontSize + LegendDeltaFontSize + Case + TimeStepIndex + WellName + GroupSmallContributions + SmallContributionsRelativeThreshold + MaximumTOF + Plots + ShowOil + ShowGas + ShowWater + PlotDescription + +WellFlowRateCurve - class RimWellFlowRateCurve + Show + CurveName + CurveDescription + LegendDescription + AutoName + Color + FillColor + Thickness + CurveInterpolation + LineStyle + FillStyle + PointSymbol + SymbolEdgeColor + SymbolSkipPxDist + ShowLegend + SymbolLabel + SymbolSize + ShowErrorBars + SymbolLabelPosition + StackCurve + StackPhaseColors + +WellLogFile - class RimWellLogFile + WellName + Date + FileName + Name + WellLogFileChannels + WellFlowCondition + +WellLogFileChannel - class RimWellLogFileChannel + Name + +WellLogFileCurve - class RimWellLogFileCurve + Show + CurveName + CurveDescription + LegendDescription + AutoName + Color + FillColor + Thickness + CurveInterpolation + LineStyle + FillStyle + PointSymbol + SymbolEdgeColor + SymbolSkipPxDist + ShowLegend + SymbolLabel + SymbolSize + ShowErrorBars + SymbolLabelPosition + StackCurve + StackPhaseColors + CurveWellPath + CurveWellLogChannel + WellLogFile + +WellLogPlot - class RimWellLogPlot + WindowController + ShowWindow + WindowGeometry + Id + (A)ViewId + ShowPlotTitle + ShowTrackLegends + TrackLegendsHorizontal + TitleFontSize + LegendDeltaFontSize + PlotDescription + DepthType + DepthUnit + MinimumDepth + MaximumDepth + ShowDepthGridLines + AutoScaleDepthEnabled + SubTitleFontSize + AxisTitleFontSize + AxisValueFontSize + NameConfig + Tracks + +WellLogPlotCollection - class RimWellLogPlotCollection + WellLogPlots + +WellLogPlotTrack - class RimWellLogTrack + WindowController + ShowWindow + WindowGeometry + Id + (A)ViewId + ShowPlotTitle + ShowTrackLegends + TrackLegendsHorizontal + TitleFontSize + LegendDeltaFontSize + RowSpan + ColSpan + TrackDescription + Curves + VisibleXRangeMin + VisibleXRangeMax + AutoScaleX + LogarithmicScaleX + ShowXGridLines + ExplicitTickIntervals + MajorTickIntervals + MinorTickIntervals + AxisFontSize + AnnotationType + RegionDisplay + ColorShadingLegend + ColorShadingTransparency + ShowFormationLabels + FormationSource + FormationTrajectoryType + FormationWellPath + FormationWellPathForSourceWellPath + FormationSimulationWellName + FormationBranchIndex + FormationBranchDetection + FormationCase + FormationLevel + ShowFormationFluids + ShowWellPathAttributes + WellPathAttributesInLegend + ShowWellPathCompletions + WellPathCompletionsInLegend + ShowWellPathAttrBothSides + ShowWellPathAttrLabels + AttributesWellPathSource + AttributesCollection + OverburdenHeight + UnderburdenHeight + ResultDefinition + +WellLogRftCurve - class RimWellLogRftCurve + Show + CurveName + CurveDescription + LegendDescription + AutoName + Color + FillColor + Thickness + CurveInterpolation + LineStyle + FillStyle + PointSymbol + SymbolEdgeColor + SymbolSkipPxDist + ShowLegend + SymbolLabel + SymbolSize + ShowErrorBars + SymbolLabelPosition + StackCurve + StackPhaseColors + CurveEclipseResultCase + CurveSummaryCase + CurveEnsemble + ObservedFmuRftData + TimeStep + WellName + BranchIndex + BranchDetection + WellLogChannelName + +WellMeasurement - class RimWellMeasurement + WellName + Depth + Date + Value + Kind + Quality + Remark + FilePath + +WellMeasurementCurve - class RimWellMeasurementCurve + Show + CurveName + CurveDescription + LegendDescription + AutoName + Color + FillColor + Thickness + CurveInterpolation + LineStyle + FillStyle + PointSymbol + SymbolEdgeColor + SymbolSkipPxDist + ShowLegend + SymbolLabel + SymbolSize + ShowErrorBars + SymbolLabelPosition + StackCurve + StackPhaseColors + CurveWellPath + CurveMeasurementKind + +WellMeasurementFilePath - class RimWellMeasurementFilePath + UserDecription + FilePath + +WellMeasurementInView - class RimWellMeasurementInView + Name + IsChecked + MeasurementKind + LegendDefinition + WellsSerialized + AvailableWellsSerialized + LowerBound + UpperBound + QualityFilter + RadiusScaleFactor + +WellMeasurements - class RimWellMeasurementCollection + Measurements + ImportedFiles + +WellMeasurementsInView - class RimWellMeasurementInViewCollection + Name + IsChecked + MeasurementKinds + +WellPath - class RimFileWellPath + AirGap + DatumElevation + UnitSystem + SimWellName + SimBranchIndex + ShowWellPathLabel + ShowWellPath + WellPathRadiusScale + WellPathColor + Completions + CompletionSettings + WellLogFiles + CollectionOf3dWellLogCurves + WellPathFormationKeyInFile + WellPathFormationFilePath + WellPathAttributes + WellPathTieIn + WellPathFilepath + WellPathFilePathInCache + WellPathNumberInFile + UseAutoGeneratedPointAtSeaLevel + +WellPathAicdParameters - class RimWellPathAicdParameters + DeviceOpen + StrengthAICD + DensityCalibrationFluid + ViscosityCalibrationFluid + VolumeFlowRateExponent + ViscosityFunctionExponent + CriticalWaterLiquidFractionEmul + ViscosityTransitionRegionEmul + MaxRatioOfEmulsionVisc + MaxFlowRate + ExponentOilDensity + ExponentWaterDensity + ExponentGasDensity + ExponentOilViscosity + ExponentWaterViscosity + ExponentGasViscosity + +WellPathAttribute - class RimWellPathAttribute + CompletionType + DepthStart + DepthEnd + DiameterInInches + +WellPathAttributes - class RimWellPathAttributeCollection + Name + IsChecked + Attributes + +WellPathBase - class RimWellPath + AirGap + DatumElevation + UnitSystem + SimWellName + SimBranchIndex + ShowWellPathLabel + ShowWellPath + WellPathRadiusScale + WellPathColor + Completions + CompletionSettings + WellLogFiles + CollectionOf3dWellLogCurves + WellPathFormationKeyInFile + WellPathFormationFilePath + WellPathAttributes + WellPathTieIn + +WellPathCompletionSettings - class RimWellPathCompletionSettings + WellNameForExport + WellGroupNameForExport + ReferenceDepthForExport + WellTypeForExport + DrainageRadiusForPI + GasInflowEq + AutoWellShutIn + AllowWellCrossFlow + WellBoreFluidPVTTable + HydrostaticDensity + FluidInPlaceRegion + MswParameters + +WellPathCompletions - class RimWellPathCompletions + Perforations + Fishbones + Fractures + StimPlanModels + WellNameForExport + WellGroupNameForExport + ReferenceDepthForExport + WellTypeForExport + DrainageRadiusForPI + GasInflowEq + AutoWellShutIn + AllowWellCrossFlow + WellBoreFluidPVTTable + HydrostaticDensity + FluidInPlaceRegion + +WellPathFracture - class RimWellPathFracture + Name + IsChecked + FractureDef + EditTemplate + CreateEllipseTemplate + CreateStimPlanTemplate + AutoUpdateWellPathDepthAtFractureFromTemplate + WellPathDepthAtFracture + Azimuth + PerforationLength + PerforationEfficiency + WellDiameter + Dip + Tilt + FractureUnit + TimeIndexToPlot + MeasuredDepth + +WellPathFractureCollection - class RimWellPathFractureCollection + Name + IsChecked + Fractures + +WellPathGeometry - class RimWellPathGeometryDef + ReferencePosUtmXyd + AirGap + MdAtFirstTarget + WellPathTargets + UseAutoGeneratedTargetAtSeaLevel + AutoGeneratedTarget + AttachedToParentWell + FixedWellPathPoints + FixedMeasuredDepths + ShowSpheres + SphereColor + SphereRadiusFactor + +WellPathGeometryDef - class RimWellPathGeometryDef + ReferencePosUtmXyd + AirGap + MdAtFirstTarget + WellPathTargets + UseAutoGeneratedTargetAtSeaLevel + AutoGeneratedTarget + AttachedToParentWell + FixedWellPathPoints + FixedMeasuredDepths + ShowSpheres + SphereColor + SphereRadiusFactor + +WellPathGroup - class RimWellPathGroup + AirGap + DatumElevation + UnitSystem + SimWellName + SimBranchIndex + ShowWellPathLabel + ShowWellPath + WellPathRadiusScale + WellPathColor + Completions + CompletionSettings + WellLogFiles + CollectionOf3dWellLogCurves + WellPathFormationKeyInFile + WellPathFormationFilePath + WellPathAttributes + WellPathTieIn + ChildWellPaths + GroupName + AddValveAtConnection + Valve + +WellPathTarget - class RimWellPathTarget + IsEnabled + IsLocked + TargetPoint + Dogleg1 + Dogleg2 + TargetType + Azimuth + Inclination + ParentWellPath + +WellPathValve - class RimWellPathValve + Name + IsChecked + ValveTemplate + StartMeasuredDepth + ValveLocations + EditTemplate + CreateTemplate + +WellPaths - class RimWellPathCollection + Active + ShowWellPathLabel + WellPathLabelColor + GlobalWellPathVisibility + WellPathRadiusScale + WellPathClip + WellPathClipZDistance + WellPaths + WellMeasurements + +WellPltPlot - class RimWellPltPlot + WindowController + ShowWindow + WindowGeometry + Id + (A)ViewId + ShowPlotTitle + ShowTrackLegends + TrackLegendsHorizontal + TitleFontSize + LegendDeltaFontSize + PlotDescription + DepthType + DepthUnit + MinimumDepth + MaximumDepth + ShowDepthGridLines + AutoScaleDepthEnabled + SubTitleFontSize + AxisTitleFontSize + AxisValueFontSize + NameConfig + Tracks + WellLog + WellName + Sources + TimeSteps + UseStandardConditionCurves + UseReservoirConditionCurves + Phases + +WellPltPlotCollection - class RimPltPlotCollection + PltPlots + +WellRftEnsembleCurveSet - class RimWellRftEnsembleCurveSet + Ensemble + ColorMode + EnsembleParameter + LegendConfig + +WellRftPlot - class RimWellRftPlot + WindowController + ShowWindow + WindowGeometry + Id + (A)ViewId + ShowPlotTitle + ShowTrackLegends + TrackLegendsHorizontal + TitleFontSize + LegendDeltaFontSize + PlotDescription + DepthType + DepthUnit + MinimumDepth + MaximumDepth + ShowDepthGridLines + AutoScaleDepthEnabled + SubTitleFontSize + AxisTitleFontSize + AxisValueFontSize + NameConfig + Tracks + ShowStatisticsCurves + ShowEnsembleCurves + ShowErrorObserved + WellLog + WellName + BranchIndex + BranchDetection + EnsembleCurveSets + +WellRftPlotCollection - class RimRftPlotCollection + RftPlots + +Wells - class RimSimWellInViewCollection + Active + ShowWellsIntersectingVisibleCells + WellHeadScale + WellPipeRadiusScale + CellCenterSphereScale + WellLabelColor + ShowConnectionStatusColors + WellColorForApply + WellPipeColors + WellPipeVertexCount + WellPipeCoordType + DefaultWellFenceDirection + WellCellTransparency + IsAutoDetectingBranches + WellHeadPosition + Wells + WellDiskSummaryCase + WellDiskQuantity + WellDiskPropertyType + WellDiskPropertyConfigType + WellDiskShowQuantityLabels + WellDiskShowLabelsBackground + WellDiskScaleFactor + WellDiskColor + ShowWellCommunicationLines + +cafNamedTreeNode - class cafNamedTreeNode + ChildNodes + Name + IsChecked + +cafObjectReferenceTreeNode - class cafObjectReferenceTreeNode + ChildNodes + ReferencedObject + +cafTreeNode - class cafTreeNode + ChildNodes + +cloneView - class RicfCloneView + viewId + +closeProject - class RicfCloseProject + +computeCaseGroupStatistics - class RicfComputeCaseGroupStatistics + caseGroupId + caseIds + +createGridCaseGroup - class RicfCreateGridCaseGroup + casePaths + +createGridCaseGroupResult - class RicfCreateGridCaseGroupResult + groupId + groupName + +createLgrForCompletions - class RicfCreateLgrForCompletions + caseId + timeStep + wellPathNames + refinementI + refinementJ + refinementK + splitType + +createMultiPlot - class RicNewMultiPlotFeature + plots + +createMultipleFractures - class RicfCreateMultipleFractures + caseId + wellPathNames + minDistFromWellTd + maxFracturesPerWell + templateId + topLayer + baseLayer + spacing + action + +createSaturationPressurePlots - class RicfCreateSaturationPressurePlots + caseIds + +createStatisticsCase - class RicfCreateStatisticsCase + caseGroupId + +createStatisticsCaseResult - class RicfCreateStatisticsCaseResult + caseId + +createView - class RicfCreateView + caseId + +createViewResult - class RicfCreateViewResult + viewId + +createWbsPlotResult - class RicfCreateWbsPlotResult + viewId + +createWellBoreStabilityPlot - class RicfCreateWellBoreStabilityPlotFeature + caseId + wellPath + timeStep + wbsParameters + +exportContourMapToText - class RicExportContourMapToTextFeature + exportFileName + exportLocalCoordinates + undefinedValueLabel + excludeUndefinedValues + viewId + +exportFlowCharacteristics - class RicfExportFlowCharacteristics + caseId + timeSteps + injectors + producers + fileName + minimumCommunication + aquiferCellThreshold + +exportLgrForCompletions - class RicfExportLgrForCompletions + caseId + timeStep + wellPathNames + refinementI + refinementJ + refinementK + splitType + +exportMsw - class RicfExportMsw + caseId + wellPath + includePerforations + includeFishbones + includeFractures + fileSplit + +exportMultiCaseSnapshots - class RicfExportMultiCaseSnapshots + gridListFile + +exportProperty - class RicfExportProperty + caseId + timeStep + property + eclipseKeyword + undefinedValue + exportFile + +exportPropertyInViews - class RicfExportPropertyInViews + caseId + viewIds + viewNames + undefinedValue + +exportSimWellFractureCompletions - class RicfExportSimWellFractureCompletions + caseId + viewId + viewName + timeStep + simulationWellNames + fileSplit + compdatExport + +exportSnapshots - class RicfExportSnapshots + type + prefix + caseId + viewId + exportFolder + plotOutputFormat + +exportVisibleCells - class RicfExportVisibleCells + caseId + viewId + viewName + exportKeyword + visibleActiveCellsValue + hiddenActiveCellsValue + inactiveCellsValue + +exportWellLogPlotData - class RicfExportWellLogPlotData + exportFormat + viewId + exportFolder + filePrefix + exportTvdRkb + capitalizeFileNames + resampleInterval + convertCurveUnits + +exportWellLogPlotDataResult - class RicfExportWellLogPlotDataResult + exportedFiles + +exportWellPathCompletions - class RicfExportWellPathCompletions + caseId + timeStep + wellPathNames + fileSplit + compdatExport + combinationMode + includeMsw + useNtgHorizontally + includePerforations + includeFishbones + includeFractures + excludeMainBoreForFishbones + performTransScaling + transScalingTimeStep + transScalingWBHPFromSummary + transScalingWBHP + exportComments + exportWelspec + customFileName + +exportWellPaths - class RicfExportWellPaths + wellPathNames + mdStepSize + +importFormationNames - class RicfImportFormationNames + formationFiles + applyToCaseId + +importWellLogFiles - class RicfImportWellLogFiles + wellLogFolder + wellLogFiles + +importWellLogFilesResult - class RicfImportWellLogFilesResult + wellPathNames + +importWellPaths - class RicImportWellPaths + wellPathFolder + wellPathFiles + importGrouped + +importWellPathsResult - class RicImportWellPathsResult + wellPathNames + +loadCase - class RicfLoadCase + path + +loadCaseResult - class RicfLoadCaseResult + id + +openProject - class RicfOpenProject + path + +replaceCase - class RicfSingleCaseReplace + caseId + newGridFile + +replaceMultipleCases - class RicfMultiCaseReplace + +replaceSourceCases - class RicfReplaceSourceCases + caseGroupId + gridListFile + +runOctaveScript - class RicfRunOctaveScript + path + caseIds + +saveProject - class RicSaveProjectFeature + filePath + +saveProjectAs - class RicSaveProjectAsFeature + filePath + +scaleFractureTemplate - class RicfScaleFractureTemplate + id + halfLength + height + dFactor + conductivity + width + +setExportFolder - class RicfSetExportFolder + type + path + createFolder + +setFractureContainment - class RicfSetFractureContainment + id + topLayer + baseLayer + +setMainWindowSize - class RicfSetMainWindowSize + height + width + +setPlotWindowSize - class RicfSetPlotWindowSize + height + width + +setStartDir - class RicfSetStartDir + path + +setTimeStep - class RicfSetTimeStep + caseId + viewId + timeStep + +stackCurves - class RicStackSelectedCurvesFeature + curves + +unstackCurves - class RicUnstackSelectedCurvesFeature + curves + diff --git a/ApplicationLibCode/Adm/projectfilekeywords/2021.06/ri-objectKeywords.txt b/ApplicationLibCode/Adm/projectfilekeywords/2021.06/ri-objectKeywords.txt new file mode 100644 index 0000000000..d938f3c83c --- /dev/null +++ b/ApplicationLibCode/Adm/projectfilekeywords/2021.06/ri-objectKeywords.txt @@ -0,0 +1,393 @@ +// ResInsight version string : 2021.06.0 +// Report generated : man. jun 14 11:41:04 2021 +// +// + +AnalysisPlot +AnalysisPlotCollection +AnalysisPlotDataEntry +Annotations +AsciiDataCurve +CalcScript +CalculatedSummaryCase +CellEdgeResultSlot +CellPropertyFilter +CellPropertyFilters +CellRangeFilter +CellRangeFilterCollection +ChangeDataSourceFeatureUi +CmdFieldChangeExecData +ColorLegend +ColorLegendCollection +ColorLegendItem +CompletionTemplateCollection +CorrelationMatrixPlot +CorrelationPlot +CorrelationPlotCollection +CorrelationReportPlot +CrossSection +CrossSectionCollection +DataContainerFloat +DataContainerString +DataContainerTime +DepthTrackPlot +DoubleParameter +Eclipse2dViewCollection +EclipseCase +EclipseGeometrySelectionItem +ElasticProperties +ElasticPropertyScaling +ElasticPropertyScalingCollection +EnsembleFractureStatistics +EnsembleFractureStatisticsPlot +EnsembleFractureStatisticsPlotCollection +FaciesInitialPressureConfig +FaciesProperties +Fault +Faults +FileSummaryCase +FishbonesCollection +FishbonesMultipleSubs +FishbonesPipeProperties +FlowCharacteristicsPlot +FlowDiagSolution +FlowPlotCollection +FormationNames +FormationNamesCollectionObject +FractureContainment +FractureDefinitionCollection +FractureGroupStatisticsCollection +GeoMech2dViewCollection +GeoMechGeometrySelectionItem +GeoMechPropertyFilter +GeoMechPropertyFilters +GeoMechResultDefinition +GeoMechResultSlot +GeoMechView +GridCaseSurface +GridCollection +GridCrossPlotCurve +GridCrossPlotCurveSet +GridInfo +GridInfoCollection +GridStatisticsPlot +GridStatisticsPlotCollection +GridSummaryCase +GridTimeHistoryCurve +IntegerParameter +Intersection2dView +Intersection2dViewCollection +IntersectionBox +IntersectionResultDefinition +Legend +MainPlotCollection +MdiWindowController +MockModelSettings +ModeledWellPath +MultiPlot +MultiSnapshotDefinition +NonNetLayers +ObservedDataCollection +ObservedFmuRftData +ParameterGroup +ParameterResultCrossPlot +PdmDocument +PdmObjectCollection +PdmObjectGroup +Perforation +PerforationCollection +PlotDataFilterCollection +PlotDataFilterItem +PlotTemplateCollection +PlotTemplateFileItem +PolyLineFilter +PolygonFilter +PolylineTarget +PolylinesFromFileAnnotation +PressureTable +PressureTableItem +PropertyFilter +ResInsightAnalysisModels +ResInsightGeoMechCase +ResInsightGeoMechModels +ResInsightOilField +ResInsightProject +ResampleData +ReservoirCellResultStorage +ReservoirView +ResultDefinition +ResultSlot +ResultStorageEntryInfo +RftAddress +RiaMemoryCleanup +RiaPreferences +RiaPreferencesGeoMech +RiaPreferencesSummary +RiaRegressionTest +RicCaseAndFileExportSettingsUi +RicCellRangeUi +RicDeleteItemExecData +RicExportCarfinUi +RicExportCompletionDataSettingsUi +RicExportContourMapToTextUi +RicExportEclipseInputGridUi +RicExportLgrUi +RicExportToLasFileObj +RicExportToLasFileResampleUi +RicExportWellPathsUi +RicHoloLensCreateSessionUi +RicHoloLensExportToFolderUi +RicHoloLensServerSettings +RicLinkVisibleViewsFeatureUi +RicPasteAsciiDataToSummaryPlotFeatureUi +RicSaturationPressureUi +RicSaveEclipseInputVisibleCellsUi +RicSelectPlotTemplateUi +RicSelectSummaryPlotUI +RicSelectViewUI +RicSummaryAddressSelection +RicSummaryCurveCalculator +RicSummaryCurveCreator +RicWellPathsUnitSystemSettingsUi +RifReaderSettings +Rim3dWellLogCurveCollection +Rim3dWellLogExtractionCurve +Rim3dWellLogFileCurve +Rim3dWellLogRftCurve +RimAnnotationCollection +RimAnnotationCollectionBase +RimAnnotationGroupCollection +RimAnnotationLineAppearance +RimAnnotationTextAppearance +RimBinaryExportSettings +RimCaseCollection +RimCellFilterCollection +RimCommandExecuteScript +RimCommandIssueFieldChanged +RimCommandObject +RimContourMapView +RimCsvUserData +RimCustomObjectiveFunction +RimCustomObjectiveFunctionCollection +RimCustomObjectiveFunctionWeight +RimDerivedEnsembleCase +RimDerivedEnsembleCaseCollection +RimDialogData +RimEclipseContourMapProjection +RimElementVectorResult +RimEllipseFractureTemplate +RimEnsembleCurveFilter +RimEnsembleCurveFilterCollection +RimEnsembleCurveSet +RimEnsembleCurveSetCollection +RimEnsembleStatistics +RimEquilibriumAxisAnnotation +RimExportInputSettings +RimFaultRAPreprocSettings +RimFaultRASettings +RimFaultResultSlot +RimFractureExportSettings +RimGeoMechContourMapProjection +RimGeoMechContourMapView +RimGridCrossPlot +RimGridCrossPlotCollection +RimGridCrossPlotCurveSetNameConfig +RimGridCrossPlotNameConfig +RimIdenticalGridCaseGroup +RimInputProperty +RimInputPropertyCollection +RimInputReservoir +RimIntersectionResultsDefinitionCollection +RimMeasurement +RimMswCompletionParameters +RimMudWeightWindowParameters +RimMultiPlotCollection +RimMultipleValveLocations +RimNonDarcyPerforationParameters +RimObjectiveFunction +RimObservedEclipseUserData +RimOilFieldEntry +RimOilRegionEntry +RimPlotAxisAnnotation +RimPlotCellFilterCollection +RimPlotCellPropertyFilter +RimPolylineAppearance +RimPolylinesAnnotationInView +RimPolylinesFromFileAnnotationInView +RimProcess +RimReachCircleAnnotation +RimReachCircleAnnotationInView +RimSaturationPressurePlot +RimSaturationPressurePlotCollection +RimStatisticalCalculation +RimStatisticalCollection +RimStimPlanColors +RimStimPlanFractureTemplate +RimStimPlanLegendConfig +RimSummaryCalculation +RimSummaryCalculationCollection +RimSummaryCalculationVariable +RimSummaryCurveCollection +RimSummaryCurveCollectionModifier +RimTensorResults +RimTernaryLegendConfig +RimTextAnnotation +RimTextAnnotationInView +RimTimeAxisAnnotation +RimTimeStepFilter +RimUserDefinedPolylinesAnnotationInView +RimVfpPlotCollection +RimViewLinkerCollection +RimViewNameConfig +RimVirtualPerforationResults +RimWellLogExtractionCurve +RimWellLogExtractionCurveNameConfig +RimWellLogFileCurveNameConfig +RimWellLogPlotNameConfig +RimWellLogRftCurveNameConfig +RimWellLogWbsCurve +RimWellPathEntry +RimWellPathImport +RimWellPathTieIn +RiuCreateMultipleFractionsUi +RiuMultipleFractionsOptions +ScriptLocation +SimWellFracture +SimWellFractureCollection +StimPlanModel +StimPlanModelCollection +StimPlanModelCurve +StimPlanModelPlot +StimPlanModelPlotCollection +StimPlanModelTemplate +StimPlanModelTemplateCollection +StreamlineInViewCollection +StringParameter +SummaryAddress +SummaryCaseCollection +SummaryCaseSubCollection +SummaryCrossPlot +SummaryCrossPlotCollection +SummaryCurve +SummaryCurveAutoName +SummaryCurveFilter +SummaryFilterSettings +SummaryObservedDataFile +SummaryPageDownloadEntity +SummaryPlot +SummaryPlotCollection +SummaryPlotFilterTextCurveSetEditor +SummaryTimeAxisProperties +SummaryYAxisProperties +Surface +SurfaceCollection +SurfaceInView +SurfaceInViewCollection +SurfaceResultDefinition +TofAccumulatedPhaseFractionsPlot +TotalWellAllocationPlot +UserDefinedFilter +UserDefinedPolylinesAnnotation +ValveTemplate +ValveTemplateCollection +VfpPlot +View3dOverlayInfoConfig +ViewController +ViewLinker +WbsParameters +Well +WellAllocationPlot +WellAllocationPlotLegend +WellBoreStabilityPlot +WellDistributionPlot +WellDistributionPlotCollection +WellFlowRateCurve +WellLogFile +WellLogFileChannel +WellLogFileCurve +WellLogPlot +WellLogPlotCollection +WellLogPlotTrack +WellLogRftCurve +WellMeasurement +WellMeasurementCurve +WellMeasurementFilePath +WellMeasurementInView +WellMeasurements +WellMeasurementsInView +WellPath +WellPathAicdParameters +WellPathAttribute +WellPathAttributes +WellPathBase +WellPathCompletionSettings +WellPathCompletions +WellPathFracture +WellPathFractureCollection +WellPathGeometry +WellPathGeometryDef +WellPathGroup +WellPathTarget +WellPathValve +WellPaths +WellPltPlot +WellPltPlotCollection +WellRftEnsembleCurveSet +WellRftPlot +WellRftPlotCollection +Wells +cafNamedTreeNode +cafObjectReferenceTreeNode +cafTreeNode +cloneView +closeProject +computeCaseGroupStatistics +createGridCaseGroup +createGridCaseGroupResult +createLgrForCompletions +createMultiPlot +createMultipleFractures +createSaturationPressurePlots +createStatisticsCase +createStatisticsCaseResult +createView +createViewResult +createWbsPlotResult +createWellBoreStabilityPlot +exportContourMapToText +exportFlowCharacteristics +exportLgrForCompletions +exportMsw +exportMultiCaseSnapshots +exportProperty +exportPropertyInViews +exportSimWellFractureCompletions +exportSnapshots +exportVisibleCells +exportWellLogPlotData +exportWellLogPlotDataResult +exportWellPathCompletions +exportWellPaths +importFormationNames +importWellLogFiles +importWellLogFilesResult +importWellPaths +importWellPathsResult +loadCase +loadCaseResult +openProject +replaceCase +replaceMultipleCases +replaceSourceCases +runOctaveScript +saveProject +saveProjectAs +scaleFractureTemplate +setExportFolder +setFractureContainment +setMainWindowSize +setPlotWindowSize +setStartDir +setTimeStep +stackCurves +unstackCurves From 7dfe35a9e04e51e4b1fc71242cb006ef51e0f013 Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Tue, 15 Jun 2021 12:17:50 +0200 Subject: [PATCH 006/308] #7780 Polyline Cell Filter : Make sure event handler is unregistered --- .../WellPathCommands/RicPolylineTargetsPickEventHandler.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/ApplicationLibCode/Commands/WellPathCommands/RicPolylineTargetsPickEventHandler.cpp b/ApplicationLibCode/Commands/WellPathCommands/RicPolylineTargetsPickEventHandler.cpp index ae08f98569..804620a0b6 100644 --- a/ApplicationLibCode/Commands/WellPathCommands/RicPolylineTargetsPickEventHandler.cpp +++ b/ApplicationLibCode/Commands/WellPathCommands/RicPolylineTargetsPickEventHandler.cpp @@ -52,6 +52,7 @@ RicPolylineTargetsPickEventHandler::RicPolylineTargetsPickEventHandler( RimPolyl //-------------------------------------------------------------------------------------------------- RicPolylineTargetsPickEventHandler::~RicPolylineTargetsPickEventHandler() { + Ric3dViewPickEventHandler::unregisterAsPickEventHandler(); } //-------------------------------------------------------------------------------------------------- From 216126033e8e96a3ed127cde6c741e4554f3948c Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Tue, 15 Jun 2021 16:00:47 +0200 Subject: [PATCH 007/308] Octave : Always execute command objects in queue before return --- ApplicationLibCode/Application/RiaGuiApplication.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ApplicationLibCode/Application/RiaGuiApplication.cpp b/ApplicationLibCode/Application/RiaGuiApplication.cpp index 74f13726c0..287f19f2a2 100644 --- a/ApplicationLibCode/Application/RiaGuiApplication.cpp +++ b/ApplicationLibCode/Application/RiaGuiApplication.cpp @@ -1582,6 +1582,9 @@ void RiaGuiApplication::slotWorkerProcessFinished( int exitCode, QProcess::ExitS } m_workerProcess = nullptr; + // Always make sure the command objects are executed before any return statement + executeCommandObjects(); + // Either the work process crashed or was aborted by the user if ( exitStatus == QProcess::CrashExit ) { @@ -1590,8 +1593,6 @@ void RiaGuiApplication::slotWorkerProcessFinished( int exitCode, QProcess::ExitS return; } - executeCommandObjects(); - // Exit code != 0 means we have an error if ( exitCode != 0 ) { From da166bd7b989b873a3d2c03956b07009081c29d0 Mon Sep 17 00:00:00 2001 From: Kristian Bendiksen Date: Wed, 16 Jun 2021 11:48:36 +0200 Subject: [PATCH 008/308] Revert "#7754 Hide experimental StimPlan Model features behind RESINSIGHT_DEVEL" This reverts commit 1322bae6b6bd22e368ad561e93254921ba56872e. --- .../RimCompletionTemplateCollection.cpp | 12 ++------ .../RimContextCommandBuilder.cpp | 29 +++++-------------- .../ProjectDataModel/RimProject.cpp | 12 ++------ 3 files changed, 11 insertions(+), 42 deletions(-) diff --git a/ApplicationLibCode/ProjectDataModel/Completions/RimCompletionTemplateCollection.cpp b/ApplicationLibCode/ProjectDataModel/Completions/RimCompletionTemplateCollection.cpp index 926924cff9..57a81ce0e6 100644 --- a/ApplicationLibCode/ProjectDataModel/Completions/RimCompletionTemplateCollection.cpp +++ b/ApplicationLibCode/ProjectDataModel/Completions/RimCompletionTemplateCollection.cpp @@ -18,8 +18,6 @@ #include "RimCompletionTemplateCollection.h" -#include "RiaApplication.h" - #include "RimEnsembleFractureStatisticsCollection.h" #include "RimFractureTemplateCollection.h" #include "RimStimPlanModelTemplateCollection.h" @@ -148,15 +146,9 @@ void RimCompletionTemplateCollection::defineUiTreeOrdering( caf::PdmUiTreeOrderi QString uiConfigName /*= ""*/ ) { uiTreeOrdering.add( m_fractureTemplates ); - if ( RiaApplication::enableDevelopmentFeatures() ) - { - uiTreeOrdering.add( m_stimPlanModelTemplates ); - } + uiTreeOrdering.add( m_stimPlanModelTemplates ); uiTreeOrdering.add( m_valveTemplates ); - if ( RiaApplication::enableDevelopmentFeatures() ) - { - uiTreeOrdering.add( m_fractureGroupStatisticsCollection ); - } + uiTreeOrdering.add( m_fractureGroupStatisticsCollection ); uiTreeOrdering.skipRemainingChildren( true ); } diff --git a/ApplicationLibCode/ProjectDataModel/RimContextCommandBuilder.cpp b/ApplicationLibCode/ProjectDataModel/RimContextCommandBuilder.cpp index 2f3d6d101a..72ea143343 100644 --- a/ApplicationLibCode/ProjectDataModel/RimContextCommandBuilder.cpp +++ b/ApplicationLibCode/ProjectDataModel/RimContextCommandBuilder.cpp @@ -413,10 +413,7 @@ caf::CmdFeatureMenuBuilder RimContextCommandBuilder::commandsFromSelection() menuBuilder << "RicNewWellPathFractureFeature"; menuBuilder.subMenuEnd(); menuBuilder << "RicCreateTemporaryLgrFeature"; - if ( RiaApplication::enableDevelopmentFeatures() ) - { - menuBuilder << "RicNewStimPlanModelFeature"; - } + menuBuilder << "RicNewStimPlanModelFeature"; menuBuilder.addSeparator(); appendExportCompletions( menuBuilder ); } @@ -447,12 +444,9 @@ caf::CmdFeatureMenuBuilder RimContextCommandBuilder::commandsFromSelection() } else if ( dynamic_cast( firstUiItem ) ) { - if ( RiaApplication::enableDevelopmentFeatures() ) - { - menuBuilder << "RicNewStimPlanModelFeature"; - menuBuilder << "RicNewStimPlanModelPlotFeature"; - menuBuilder << "RicExportStimPlanModelToFileFeature"; - } + menuBuilder << "RicNewStimPlanModelFeature"; + menuBuilder << "RicNewStimPlanModelPlotFeature"; + menuBuilder << "RicExportStimPlanModelToFileFeature"; } else if ( dynamic_cast( firstUiItem ) ) { @@ -460,10 +454,7 @@ caf::CmdFeatureMenuBuilder RimContextCommandBuilder::commandsFromSelection() } else if ( dynamic_cast( firstUiItem ) ) { - if ( RiaApplication::enableDevelopmentFeatures() ) - { - menuBuilder << "RicNewStimPlanModelFeature"; - } + menuBuilder << "RicNewStimPlanModelFeature"; } else if ( dynamic_cast( firstUiItem ) || dynamic_cast( firstUiItem ) || @@ -923,10 +914,7 @@ caf::CmdFeatureMenuBuilder RimContextCommandBuilder::commandsFromSelection() } else if ( dynamic_cast( firstUiItem ) ) { - if ( RiaApplication::enableDevelopmentFeatures() ) - { - menuBuilder << "RicNewStimPlanModelTemplateFeature"; - } + menuBuilder << "RicNewStimPlanModelTemplateFeature"; } else if ( dynamic_cast( firstUiItem ) ) { @@ -1379,10 +1367,7 @@ int RimContextCommandBuilder::appendCreateCompletions( caf::CmdFeatureMenuBuilde candidates << "RicNewWellPathAttributeFeature"; candidates << "Separator"; candidates << "RicCreateTemporaryLgrFeature"; - if ( RiaApplication::enableDevelopmentFeatures() ) - { - candidates << "RicNewStimPlanModelFeature"; - } + candidates << "RicNewStimPlanModelFeature"; return appendSubMenuWithCommands( menuBuilder, candidates, diff --git a/ApplicationLibCode/ProjectDataModel/RimProject.cpp b/ApplicationLibCode/ProjectDataModel/RimProject.cpp index 1643343d22..1f2f44ab5a 100644 --- a/ApplicationLibCode/ProjectDataModel/RimProject.cpp +++ b/ApplicationLibCode/ProjectDataModel/RimProject.cpp @@ -1474,10 +1474,7 @@ void RimProject::defineUiTreeOrdering( caf::PdmUiTreeOrdering& uiTreeOrdering, Q if ( mainPlotCollection->stimPlanModelPlotCollection() ) { - if ( RiaApplication::enableDevelopmentFeatures() ) - { - itemCollection->add( mainPlotCollection->stimPlanModelPlotCollection() ); - } + itemCollection->add( mainPlotCollection->stimPlanModelPlotCollection() ); } if ( mainPlotCollection->vfpPlotCollection() ) @@ -1493,12 +1490,7 @@ void RimProject::defineUiTreeOrdering( caf::PdmUiTreeOrdering& uiTreeOrdering, Q statisticsItemCollection->add( mainPlotCollection->gridStatisticsPlotCollection() ); if ( mainPlotCollection->ensembleFractureStatisticsPlotCollection() ) - { - if ( RiaApplication::enableDevelopmentFeatures() ) - { - statisticsItemCollection->add( mainPlotCollection->ensembleFractureStatisticsPlotCollection() ); - } - } + statisticsItemCollection->add( mainPlotCollection->ensembleFractureStatisticsPlotCollection() ); } #endif } From d7113a528cb56855ea53ce75f6a502ed5d0d3ce1 Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Wed, 16 Jun 2021 10:02:36 +0200 Subject: [PATCH 009/308] #7786 Get version from command line --- ApplicationExeCode/RiaMain.cpp | 2 +- .../Application/RiaConsoleApplication.cpp | 10 ++++++++++ .../Application/Tools/RiaArgumentParser.cpp | 1 + 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/ApplicationExeCode/RiaMain.cpp b/ApplicationExeCode/RiaMain.cpp index eb34dbea1b..2a05d22679 100644 --- a/ApplicationExeCode/RiaMain.cpp +++ b/ApplicationExeCode/RiaMain.cpp @@ -38,7 +38,7 @@ RiaApplication* createApplication( int& argc, char* argv[] ) { for ( int i = 1; i < argc; ++i ) { - if ( !qstrcmp( argv[i], "--console" ) || !qstrcmp( argv[i], "--unittest" ) ) + if ( !qstrcmp( argv[i], "--console" ) || !qstrcmp( argv[i], "--unittest" ) || !qstrcmp( argv[i], "--version" ) ) { #ifdef ENABLE_GRPC return new RiaGrpcConsoleApplication( argc, argv ); diff --git a/ApplicationLibCode/Application/RiaConsoleApplication.cpp b/ApplicationLibCode/Application/RiaConsoleApplication.cpp index 56758e0ff7..5ed24889e8 100644 --- a/ApplicationLibCode/Application/RiaConsoleApplication.cpp +++ b/ApplicationLibCode/Application/RiaConsoleApplication.cpp @@ -22,6 +22,7 @@ #include "RiaPreferences.h" #include "RiaProjectModifier.h" #include "RiaSocketServer.h" +#include "RiaVersionInfo.h" #include "RicImportGeneralDataFeature.h" @@ -127,6 +128,15 @@ RiaApplication::ApplicationStatus RiaConsoleApplication::handleArguments( gsl::n return RiaApplication::ApplicationStatus::EXIT_COMPLETED; } + if ( progOpt->option( "version" ) ) + { + QString text = QString( STRPRODUCTVER ) + "\n"; + + this->showFormattedTextInMessageBoxOrConsole( text ); + + return RiaApplication::ApplicationStatus::EXIT_COMPLETED; + } + // Code generation // ----------------- if ( cvf::Option o = progOpt->option( "generate" ) ) diff --git a/ApplicationLibCode/Application/Tools/RiaArgumentParser.cpp b/ApplicationLibCode/Application/Tools/RiaArgumentParser.cpp index 09d4453330..868fb49870 100644 --- a/ApplicationLibCode/Application/Tools/RiaArgumentParser.cpp +++ b/ApplicationLibCode/Application/Tools/RiaArgumentParser.cpp @@ -142,6 +142,7 @@ bool RiaArgumentParser::parseArguments( cvf::ProgramOptions* progOpt ) #endif progOpt->registerOption( "generate", "[]", "Generate code or documentation", cvf::ProgramOptions::SINGLE_VALUE ); progOpt->registerOption( "ignoreArgs", "", "System command. Ignore all arguments. Mostly for testing purposes" ); + progOpt->registerOption( "version", "", "Display the application version string" ); progOpt->setOptionPrefix( cvf::ProgramOptions::DOUBLE_DASH ); From 0825fa10aca07191099070aaab69b21a563bcda3 Mon Sep 17 00:00:00 2001 From: jonjenssen <69144954+jonjenssen@users.noreply.github.com> Date: Fri, 18 Jun 2021 11:28:47 +0200 Subject: [PATCH 010/308] delete existing database file before processing a new fault (#7793) --- .../RicRunAdvFaultReactAssessmentFeature.cpp | 3 +++ .../RicRunBasicFaultReactAssessmentFeature.cpp | 3 +++ .../RicRunFaultReactAssessmentFeature.cpp | 10 +++++++++- .../RicRunFaultReactAssessmentFeature.h | 2 ++ 4 files changed, 17 insertions(+), 1 deletion(-) diff --git a/ApplicationLibCode/Commands/GeoMechCommands/RicRunAdvFaultReactAssessmentFeature.cpp b/ApplicationLibCode/Commands/GeoMechCommands/RicRunAdvFaultReactAssessmentFeature.cpp index c47e669cd6..b380eba5a9 100644 --- a/ApplicationLibCode/Commands/GeoMechCommands/RicRunAdvFaultReactAssessmentFeature.cpp +++ b/ApplicationLibCode/Commands/GeoMechCommands/RicRunAdvFaultReactAssessmentFeature.cpp @@ -107,6 +107,9 @@ void RicRunAdvFaultReactAssessmentFeature::onActionTriggered( bool isChecked ) addParameterFileForCleanUp( paramfilename ); addParameterFileForCleanUp( paramfilename2 ); + // remove any existing database file + removeFile( fraSettings->advancedMacrisDatabase() ); + // run the java macris program in calibrate mode QString command = RiaPreferencesGeoMech::current()->geomechFRAMacrisCommand(); QStringList parameters = fraSettings->advancedMacrisParameters( faultID ); diff --git a/ApplicationLibCode/Commands/GeoMechCommands/RicRunBasicFaultReactAssessmentFeature.cpp b/ApplicationLibCode/Commands/GeoMechCommands/RicRunBasicFaultReactAssessmentFeature.cpp index 771db74ed2..36fd577962 100644 --- a/ApplicationLibCode/Commands/GeoMechCommands/RicRunBasicFaultReactAssessmentFeature.cpp +++ b/ApplicationLibCode/Commands/GeoMechCommands/RicRunBasicFaultReactAssessmentFeature.cpp @@ -97,6 +97,9 @@ void RicRunBasicFaultReactAssessmentFeature::onActionTriggered( bool isChecked ) addParameterFileForCleanUp( paramfilename ); + // remove any existing database file + removeFile( fraSettings->basicMacrisDatabase() ); + // run the java macris program in calculate mode QString command = RiaPreferencesGeoMech::current()->geomechFRAMacrisCommand(); QStringList parameters = fraSettings->basicMacrisParameters( faultID ); diff --git a/ApplicationLibCode/Commands/GeoMechCommands/RicRunFaultReactAssessmentFeature.cpp b/ApplicationLibCode/Commands/GeoMechCommands/RicRunFaultReactAssessmentFeature.cpp index 6ea7061899..ebcb03f6fb 100644 --- a/ApplicationLibCode/Commands/GeoMechCommands/RicRunFaultReactAssessmentFeature.cpp +++ b/ApplicationLibCode/Commands/GeoMechCommands/RicRunFaultReactAssessmentFeature.cpp @@ -162,12 +162,20 @@ void RicRunFaultReactAssessmentFeature::cleanUpParameterFiles() { for ( auto& filename : m_parameterFilesToCleanUp ) { - if ( QFile::exists( filename ) ) QFile::remove( filename ); + removeFile( filename ); } } m_parameterFilesToCleanUp.clear(); } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RicRunFaultReactAssessmentFeature::removeFile( QString filename ) +{ + if ( QFile::exists( filename ) ) QFile::remove( filename ); +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationLibCode/Commands/GeoMechCommands/RicRunFaultReactAssessmentFeature.h b/ApplicationLibCode/Commands/GeoMechCommands/RicRunFaultReactAssessmentFeature.h index bfa3567477..ba819c0eb7 100644 --- a/ApplicationLibCode/Commands/GeoMechCommands/RicRunFaultReactAssessmentFeature.h +++ b/ApplicationLibCode/Commands/GeoMechCommands/RicRunFaultReactAssessmentFeature.h @@ -45,6 +45,8 @@ class RicRunFaultReactAssessmentFeature : public caf::CmdFeature void addParameterFileForCleanUp( QString filename ); void cleanUpParameterFiles(); + void removeFile( QString filename ); + private: std::list m_parameterFilesToCleanUp; }; From 66b2b50a1debf610a341b6842decfac7113c40cb Mon Sep 17 00:00:00 2001 From: jonjenssen <69144954+jonjenssen@users.noreply.github.com> Date: Fri, 18 Jun 2021 16:51:05 +0200 Subject: [PATCH 011/308] Enable starting FaultRA processing from 3d view (#7801) --- .../GeoMechCommands/CMakeLists_files.cmake | 4 + ...RicRunAdvFaultReactAssessment3dFeature.cpp | 46 +++++ .../RicRunAdvFaultReactAssessment3dFeature.h | 33 ++++ .../RicRunAdvFaultReactAssessmentFeature.cpp | 100 +--------- ...cRunBasicFaultReactAssessment3dFeature.cpp | 75 ++++++++ ...RicRunBasicFaultReactAssessment3dFeature.h | 36 ++++ ...RicRunBasicFaultReactAssessmentFeature.cpp | 90 +-------- .../RicRunFaultReactAssessmentFeature.cpp | 175 +++++++++++++++++- .../RicRunFaultReactAssessmentFeature.h | 9 +- .../Faults/RimFaultInViewCollection.cpp | 8 + .../Faults/RimFaultInViewCollection.h | 1 + .../UserInterface/RiuViewerCommands.cpp | 21 ++- 12 files changed, 396 insertions(+), 202 deletions(-) create mode 100644 ApplicationLibCode/Commands/GeoMechCommands/RicRunAdvFaultReactAssessment3dFeature.cpp create mode 100644 ApplicationLibCode/Commands/GeoMechCommands/RicRunAdvFaultReactAssessment3dFeature.h create mode 100644 ApplicationLibCode/Commands/GeoMechCommands/RicRunBasicFaultReactAssessment3dFeature.cpp create mode 100644 ApplicationLibCode/Commands/GeoMechCommands/RicRunBasicFaultReactAssessment3dFeature.h diff --git a/ApplicationLibCode/Commands/GeoMechCommands/CMakeLists_files.cmake b/ApplicationLibCode/Commands/GeoMechCommands/CMakeLists_files.cmake index aa6fb5f2c6..700ab209dd 100644 --- a/ApplicationLibCode/Commands/GeoMechCommands/CMakeLists_files.cmake +++ b/ApplicationLibCode/Commands/GeoMechCommands/CMakeLists_files.cmake @@ -14,6 +14,8 @@ ${CMAKE_CURRENT_LIST_DIR}/RicImportGeoMechCaseTimeStepFilterFeature.h ${CMAKE_CURRENT_LIST_DIR}/RicNewFaultReactAssessmentFeature.h ${CMAKE_CURRENT_LIST_DIR}/RicRunBasicFaultReactAssessmentFeature.h ${CMAKE_CURRENT_LIST_DIR}/RicRunAdvFaultReactAssessmentFeature.h +${CMAKE_CURRENT_LIST_DIR}/RicRunBasicFaultReactAssessment3dFeature.h +${CMAKE_CURRENT_LIST_DIR}/RicRunAdvFaultReactAssessment3dFeature.h ${CMAKE_CURRENT_LIST_DIR}/RicRunFaultReactAssessmentFeature.h ) @@ -31,7 +33,9 @@ ${CMAKE_CURRENT_LIST_DIR}/RicImportGeoMechCaseTimeStepFilterFeature.cpp ${CMAKE_CURRENT_LIST_DIR}/RicNewFaultReactAssessmentFeature.cpp ${CMAKE_CURRENT_LIST_DIR}/RicRunAdvFaultReactAssessmentFeature.cpp +${CMAKE_CURRENT_LIST_DIR}/RicRunAdvFaultReactAssessment3dFeature.cpp ${CMAKE_CURRENT_LIST_DIR}/RicRunBasicFaultReactAssessmentFeature.cpp +${CMAKE_CURRENT_LIST_DIR}/RicRunBasicFaultReactAssessment3dFeature.cpp ${CMAKE_CURRENT_LIST_DIR}/RicRunFaultReactAssessmentFeature.cpp ) diff --git a/ApplicationLibCode/Commands/GeoMechCommands/RicRunAdvFaultReactAssessment3dFeature.cpp b/ApplicationLibCode/Commands/GeoMechCommands/RicRunAdvFaultReactAssessment3dFeature.cpp new file mode 100644 index 0000000000..910f4de502 --- /dev/null +++ b/ApplicationLibCode/Commands/GeoMechCommands/RicRunAdvFaultReactAssessment3dFeature.cpp @@ -0,0 +1,46 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2021 Equinor ASA +// +// ResInsight is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// + +#include "RicRunAdvFaultReactAssessment3dFeature.h" + +#include + +CAF_CMD_SOURCE_INIT( RicRunAdvFaultReactAssessment3dFeature, "RicRunAdvFaultReactAssessment3dFeature" ); + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RicRunAdvFaultReactAssessment3dFeature::onActionTriggered( bool isChecked ) +{ + QVariant userData = this->userData(); + if ( userData.isNull() || userData.type() != QVariant::String ) return; + + QString faultName = userData.toString(); + + int faultID = faultIDFromName( faultName ); + if ( faultID >= 0 ) runAdvancedProcessing( selectedFaultID() ); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RicRunAdvFaultReactAssessment3dFeature::setupActionLook( QAction* actionToSetup ) +{ + actionToSetup->setIcon( QIcon( ":/fault_react_24x24.png" ) ); + actionToSetup->setText( "Run Advanced Processing" ); +} diff --git a/ApplicationLibCode/Commands/GeoMechCommands/RicRunAdvFaultReactAssessment3dFeature.h b/ApplicationLibCode/Commands/GeoMechCommands/RicRunAdvFaultReactAssessment3dFeature.h new file mode 100644 index 0000000000..0004124fbd --- /dev/null +++ b/ApplicationLibCode/Commands/GeoMechCommands/RicRunAdvFaultReactAssessment3dFeature.h @@ -0,0 +1,33 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2021 Equinor ASA +// +// ResInsight is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// + +#pragma once + +#include "RicRunBasicFaultReactAssessment3dFeature.h" + +//================================================================================================== +/// +//================================================================================================== +class RicRunAdvFaultReactAssessment3dFeature : public RicRunBasicFaultReactAssessment3dFeature +{ + CAF_CMD_HEADER_INIT; + +protected: + void onActionTriggered( bool isChecked ) override; + void setupActionLook( QAction* actionToSetup ) override; +}; diff --git a/ApplicationLibCode/Commands/GeoMechCommands/RicRunAdvFaultReactAssessmentFeature.cpp b/ApplicationLibCode/Commands/GeoMechCommands/RicRunAdvFaultReactAssessmentFeature.cpp index b380eba5a9..444edf9da1 100644 --- a/ApplicationLibCode/Commands/GeoMechCommands/RicRunAdvFaultReactAssessmentFeature.cpp +++ b/ApplicationLibCode/Commands/GeoMechCommands/RicRunAdvFaultReactAssessmentFeature.cpp @@ -18,38 +18,10 @@ #include "RicRunAdvFaultReactAssessmentFeature.h" -#include "RiaApplication.h" -#include "RiaEclipseFileNameTools.h" -#include "RiaImportEclipseCaseTools.h" -#include "RiaPreferencesGeoMech.h" -#include "RiaResultNames.h" - -#include "RifFaultRAJsonWriter.h" -#include "RifFaultRAXmlWriter.h" - -#include "RimEclipseInputCase.h" -#include "RimEclipseResultCase.h" -#include "RimEclipseView.h" -#include "RimFaultInView.h" #include "RimFaultInViewCollection.h" -#include "RimFaultRAPreprocSettings.h" #include "RimFaultRASettings.h" -#include "RimGeoMechCase.h" -#include "RimProcess.h" -#include "RimProject.h" - -#include "Riu3DMainWindowTools.h" -#include "RiuFileDialogTools.h" - -#include "cafPdmUiPropertyViewDialog.h" -#include "cafProgressInfo.h" -#include "cafSelectionManagerTools.h" -#include "cafUtils.h" #include -#include -#include -#include CAF_CMD_SOURCE_INIT( RicRunAdvFaultReactAssessmentFeature, "RicRunAdvFaultReactAssessmentFeature" ); @@ -62,7 +34,7 @@ bool RicRunAdvFaultReactAssessmentFeature::isCommandEnabled() if ( faultColl ) { - return ( faultColl->faultRAEnabled() && faultColl->faultRASettings()->geomechCase() != nullptr ); + return faultColl->faultRAAdvancedEnabled(); } return false; @@ -73,75 +45,7 @@ bool RicRunAdvFaultReactAssessmentFeature::isCommandEnabled() //-------------------------------------------------------------------------------------------------- void RicRunAdvFaultReactAssessmentFeature::onActionTriggered( bool isChecked ) { - RimFaultInViewCollection* coll = faultCollection(); - if ( coll == nullptr ) return; - - RimFaultRASettings* fraSettings = coll->faultRASettings(); - if ( fraSettings == nullptr ) return; - - int faultID = selectedFaultID(); - caf::ProgressInfo runProgress( 3, "Running Advanced Fault RA processing, please wait..." ); - - runProgress.setProgressDescription( "Macris calibrate command." ); - QString paramfilename = fraSettings->basicParameterXMLFilename( faultID ); - - RifFaultRAXmlWriter xmlwriter( fraSettings ); - QString outErrorText; - if ( !xmlwriter.writeCalculateFile( paramfilename, faultID, outErrorText ) ) - { - QMessageBox::warning( nullptr, - "Fault Reactivation Assessment Processing", - "Unable to write parameter file! " + outErrorText ); - return; - } - - QString paramfilename2 = fraSettings->advancedParameterXMLFilename( faultID ); - if ( !xmlwriter.writeCalibrateFile( paramfilename2, faultID, outErrorText ) ) - { - QMessageBox::warning( nullptr, - "Fault Reactivation Assessment Processing", - "Unable to write calibrate parameter file! " + outErrorText ); - return; - } - - addParameterFileForCleanUp( paramfilename ); - addParameterFileForCleanUp( paramfilename2 ); - - // remove any existing database file - removeFile( fraSettings->advancedMacrisDatabase() ); - - // run the java macris program in calibrate mode - QString command = RiaPreferencesGeoMech::current()->geomechFRAMacrisCommand(); - QStringList parameters = fraSettings->advancedMacrisParameters( faultID ); - - RimProcess process; - process.setCommand( command ); - process.setParameters( parameters ); - if ( !process.execute() ) - { - QMessageBox::critical( nullptr, - "Advanced Fault Reactivation Assessment Processing", - "Failed to run Macris calibrate command. Check log window for additional information." ); - cleanUpParameterFiles(); - return; - } - - runProgress.incrementProgress(); - - runProgress.setProgressDescription( "Generating surface results." ); - - if ( runPostProcessing( faultID, fraSettings ) ) - { - runProgress.incrementProgress(); - - runProgress.setProgressDescription( "Importing surface results." ); - - // reload output surfaces - reloadSurfaces( fraSettings ); - } - - // delete parameter files - cleanUpParameterFiles(); + runAdvancedProcessing( selectedFaultID() ); } //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationLibCode/Commands/GeoMechCommands/RicRunBasicFaultReactAssessment3dFeature.cpp b/ApplicationLibCode/Commands/GeoMechCommands/RicRunBasicFaultReactAssessment3dFeature.cpp new file mode 100644 index 0000000000..a7e5dd3afd --- /dev/null +++ b/ApplicationLibCode/Commands/GeoMechCommands/RicRunBasicFaultReactAssessment3dFeature.cpp @@ -0,0 +1,75 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2021 Equinor ASA +// +// ResInsight is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// + +#include "RicRunBasicFaultReactAssessment3dFeature.h" + +#include "RimEclipseView.h" +#include "RimFaultInViewCollection.h" +#include "RimFaultRASettings.h" +#include "RimGridView.h" + +#include "RiaApplication.h" + +#include +#include + +CAF_CMD_SOURCE_INIT( RicRunBasicFaultReactAssessment3dFeature, "RicRunBasicFaultReactAssessment3dFeature" ); + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +bool RicRunBasicFaultReactAssessment3dFeature::isCommandEnabled() +{ + return true; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RicRunBasicFaultReactAssessment3dFeature::onActionTriggered( bool isChecked ) +{ + QVariant userData = this->userData(); + if ( userData.isNull() || userData.type() != QVariant::String ) return; + + QString faultName = userData.toString(); + + int faultID = faultIDFromName( faultName ); + if ( faultID >= 0 ) runBasicProcessing( faultID ); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RicRunBasicFaultReactAssessment3dFeature::setupActionLook( QAction* actionToSetup ) +{ + actionToSetup->setIcon( QIcon( ":/fault_react_24x24.png" ) ); + actionToSetup->setText( "Run Basic Processing" ); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RimFaultInViewCollection* RicRunBasicFaultReactAssessment3dFeature::faultCollection() +{ + RimGridView* viewOrComparisonView = RiaApplication::instance()->activeMainOrComparisonGridView(); + RimEclipseView* theView = dynamic_cast( viewOrComparisonView ); + + CAF_ASSERT( theView ); + + return theView->faultCollection(); +} diff --git a/ApplicationLibCode/Commands/GeoMechCommands/RicRunBasicFaultReactAssessment3dFeature.h b/ApplicationLibCode/Commands/GeoMechCommands/RicRunBasicFaultReactAssessment3dFeature.h new file mode 100644 index 0000000000..3fe062ec99 --- /dev/null +++ b/ApplicationLibCode/Commands/GeoMechCommands/RicRunBasicFaultReactAssessment3dFeature.h @@ -0,0 +1,36 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2021 Equinor ASA +// +// ResInsight is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// + +#pragma once + +#include "RicRunFaultReactAssessmentFeature.h" + +//================================================================================================== +/// +//================================================================================================== +class RicRunBasicFaultReactAssessment3dFeature : public RicRunFaultReactAssessmentFeature +{ + CAF_CMD_HEADER_INIT; + +protected: + RimFaultInViewCollection* faultCollection() override; + + bool isCommandEnabled() override; + void onActionTriggered( bool isChecked ) override; + void setupActionLook( QAction* actionToSetup ) override; +}; diff --git a/ApplicationLibCode/Commands/GeoMechCommands/RicRunBasicFaultReactAssessmentFeature.cpp b/ApplicationLibCode/Commands/GeoMechCommands/RicRunBasicFaultReactAssessmentFeature.cpp index 36fd577962..5fe424f637 100644 --- a/ApplicationLibCode/Commands/GeoMechCommands/RicRunBasicFaultReactAssessmentFeature.cpp +++ b/ApplicationLibCode/Commands/GeoMechCommands/RicRunBasicFaultReactAssessmentFeature.cpp @@ -18,38 +18,10 @@ #include "RicRunBasicFaultReactAssessmentFeature.h" -#include "RiaApplication.h" -#include "RiaEclipseFileNameTools.h" -#include "RiaImportEclipseCaseTools.h" -#include "RiaPreferencesGeoMech.h" -#include "RiaResultNames.h" - -#include "RifFaultRAJsonWriter.h" -#include "RifFaultRAXmlWriter.h" - -#include "RimEclipseInputCase.h" -#include "RimEclipseResultCase.h" -#include "RimEclipseView.h" -#include "RimFaultInView.h" #include "RimFaultInViewCollection.h" -#include "RimFaultRAPreprocSettings.h" #include "RimFaultRASettings.h" -#include "RimGeoMechCase.h" -#include "RimProcess.h" -#include "RimProject.h" - -#include "Riu3DMainWindowTools.h" -#include "RiuFileDialogTools.h" - -#include "cafPdmUiPropertyViewDialog.h" -#include "cafProgressInfo.h" -#include "cafSelectionManagerTools.h" -#include "cafUtils.h" #include -#include -#include -#include CAF_CMD_SOURCE_INIT( RicRunBasicFaultReactAssessmentFeature, "RicRunBasicFaultReactAssessmentFeature" ); @@ -72,67 +44,7 @@ bool RicRunBasicFaultReactAssessmentFeature::isCommandEnabled() //-------------------------------------------------------------------------------------------------- void RicRunBasicFaultReactAssessmentFeature::onActionTriggered( bool isChecked ) { - RimFaultInViewCollection* coll = faultCollection(); - if ( coll == nullptr ) return; - - RimFaultRASettings* fraSettings = coll->faultRASettings(); - if ( fraSettings == nullptr ) return; - - int faultID = selectedFaultID(); - caf::ProgressInfo runProgress( 3, "Running Basic Fault RA processing, please wait..." ); - - { - runProgress.setProgressDescription( "Macris calculate command." ); - QString paramfilename = fraSettings->basicParameterXMLFilename( faultID ); - - RifFaultRAXmlWriter xmlwriter( fraSettings ); - QString outErrorText; - if ( !xmlwriter.writeCalculateFile( paramfilename, faultID, outErrorText ) ) - { - QMessageBox::warning( nullptr, - "Fault Reactivation Assessment Processing", - "Unable to write parameter file! " + outErrorText ); - return; - } - - addParameterFileForCleanUp( paramfilename ); - - // remove any existing database file - removeFile( fraSettings->basicMacrisDatabase() ); - - // run the java macris program in calculate mode - QString command = RiaPreferencesGeoMech::current()->geomechFRAMacrisCommand(); - QStringList parameters = fraSettings->basicMacrisParameters( faultID ); - - RimProcess process; - process.setCommand( command ); - process.setParameters( parameters ); - if ( !process.execute() ) - { - QMessageBox::critical( nullptr, - "Basic Fault Reactivation Assessment Processing", - "Failed to run Macris calculate command. Check log window for additional " - "information." ); - cleanUpParameterFiles(); - return; - } - - runProgress.incrementProgress(); - } - - runProgress.setProgressDescription( "Generating surface results." ); - - if ( runPostProcessing( faultID, fraSettings ) ) - { - runProgress.incrementProgress(); - - runProgress.setProgressDescription( "Importing surface results." ); - - // reload output surfaces - reloadSurfaces( fraSettings ); - } - // delete parameter files - cleanUpParameterFiles(); + runBasicProcessing( selectedFaultID() ); } //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationLibCode/Commands/GeoMechCommands/RicRunFaultReactAssessmentFeature.cpp b/ApplicationLibCode/Commands/GeoMechCommands/RicRunFaultReactAssessmentFeature.cpp index ebcb03f6fb..916e1c7a51 100644 --- a/ApplicationLibCode/Commands/GeoMechCommands/RicRunFaultReactAssessmentFeature.cpp +++ b/ApplicationLibCode/Commands/GeoMechCommands/RicRunFaultReactAssessmentFeature.cpp @@ -25,6 +25,7 @@ #include "RiaResultNames.h" #include "RifFaultRAJsonWriter.h" +#include "RifFaultRAXmlWriter.h" #include "RimEclipseInputCase.h" #include "RimEclipseResultCase.h" @@ -83,6 +84,27 @@ RimFaultInViewCollection* RicRunFaultReactAssessmentFeature::faultCollection() return faultColl; } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +int RicRunFaultReactAssessmentFeature::faultIDFromName( QString faultName ) const +{ + int retval = -1; + + QString lookFor = RiaResultNames::faultReactAssessmentPrefix(); + QString name = faultName; + if ( !name.startsWith( lookFor ) ) return retval; + + name = name.mid( lookFor.length() ); + if ( name.size() == 0 ) return retval; + + bool bOK; + retval = name.toInt( &bOK ); + if ( !bOK ) retval = -1; + + return retval; +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- @@ -92,16 +114,7 @@ int RicRunFaultReactAssessmentFeature::selectedFaultID() RimFaultInView* selObj = dynamic_cast( caf::SelectionManager::instance()->selectedItem() ); if ( selObj ) { - QString lookFor = RiaResultNames::faultReactAssessmentPrefix(); - QString name = selObj->name(); - if ( !name.startsWith( lookFor ) ) return retval; - - name = name.mid( lookFor.length() ); - if ( name.size() == 0 ) return retval; - - bool bOK; - retval = name.toInt( &bOK ); - if ( !bOK ) retval = -1; + return faultIDFromName( selObj->name() ); } return retval; @@ -234,3 +247,145 @@ void RicRunFaultReactAssessmentFeature::reloadSurfaces( RimFaultRASettings* sett // import the new surfaces surfColl->importSurfacesFromFiles( newFiles, showLegendInView ); } + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RicRunFaultReactAssessmentFeature::runBasicProcessing( int faultID ) +{ + RimFaultInViewCollection* coll = faultCollection(); + if ( coll == nullptr ) return; + + RimFaultRASettings* fraSettings = coll->faultRASettings(); + if ( fraSettings == nullptr ) return; + + caf::ProgressInfo runProgress( 3, "Running Basic Fault RA processing, please wait..." ); + + { + runProgress.setProgressDescription( "Macris calculate command." ); + QString paramfilename = fraSettings->basicParameterXMLFilename( faultID ); + + RifFaultRAXmlWriter xmlwriter( fraSettings ); + QString outErrorText; + if ( !xmlwriter.writeCalculateFile( paramfilename, faultID, outErrorText ) ) + { + QMessageBox::warning( nullptr, + "Fault Reactivation Assessment Processing", + "Unable to write parameter file! " + outErrorText ); + return; + } + + addParameterFileForCleanUp( paramfilename ); + + // remove any existing database file + removeFile( fraSettings->basicMacrisDatabase() ); + + // run the java macris program in calculate mode + QString command = RiaPreferencesGeoMech::current()->geomechFRAMacrisCommand(); + QStringList parameters = fraSettings->basicMacrisParameters( faultID ); + + RimProcess process; + process.setCommand( command ); + process.setParameters( parameters ); + if ( !process.execute() ) + { + QMessageBox::critical( nullptr, + "Basic Fault Reactivation Assessment Processing", + "Failed to run Macris calculate command. Check log window for additional " + "information." ); + cleanUpParameterFiles(); + return; + } + + runProgress.incrementProgress(); + } + + runProgress.setProgressDescription( "Generating surface results." ); + + if ( runPostProcessing( faultID, fraSettings ) ) + { + runProgress.incrementProgress(); + + runProgress.setProgressDescription( "Importing surface results." ); + + // reload output surfaces + reloadSurfaces( fraSettings ); + } + // delete parameter files + cleanUpParameterFiles(); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RicRunFaultReactAssessmentFeature::runAdvancedProcessing( int faultID ) +{ + RimFaultInViewCollection* coll = faultCollection(); + if ( coll == nullptr ) return; + + RimFaultRASettings* fraSettings = coll->faultRASettings(); + if ( fraSettings == nullptr ) return; + + caf::ProgressInfo runProgress( 3, "Running Advanced Fault RA processing, please wait..." ); + + runProgress.setProgressDescription( "Macris calibrate command." ); + QString paramfilename = fraSettings->basicParameterXMLFilename( faultID ); + + RifFaultRAXmlWriter xmlwriter( fraSettings ); + QString outErrorText; + if ( !xmlwriter.writeCalculateFile( paramfilename, faultID, outErrorText ) ) + { + QMessageBox::warning( nullptr, + "Fault Reactivation Assessment Processing", + "Unable to write parameter file! " + outErrorText ); + return; + } + + QString paramfilename2 = fraSettings->advancedParameterXMLFilename( faultID ); + if ( !xmlwriter.writeCalibrateFile( paramfilename2, faultID, outErrorText ) ) + { + QMessageBox::warning( nullptr, + "Fault Reactivation Assessment Processing", + "Unable to write calibrate parameter file! " + outErrorText ); + return; + } + + addParameterFileForCleanUp( paramfilename ); + addParameterFileForCleanUp( paramfilename2 ); + + // remove any existing database file + removeFile( fraSettings->advancedMacrisDatabase() ); + + // run the java macris program in calibrate mode + QString command = RiaPreferencesGeoMech::current()->geomechFRAMacrisCommand(); + QStringList parameters = fraSettings->advancedMacrisParameters( faultID ); + + RimProcess process; + process.setCommand( command ); + process.setParameters( parameters ); + if ( !process.execute() ) + { + QMessageBox::critical( nullptr, + "Advanced Fault Reactivation Assessment Processing", + "Failed to run Macris calibrate command. Check log window for additional information." ); + cleanUpParameterFiles(); + return; + } + + runProgress.incrementProgress(); + + runProgress.setProgressDescription( "Generating surface results." ); + + if ( runPostProcessing( faultID, fraSettings ) ) + { + runProgress.incrementProgress(); + + runProgress.setProgressDescription( "Importing surface results." ); + + // reload output surfaces + reloadSurfaces( fraSettings ); + } + + // delete parameter files + cleanUpParameterFiles(); +} diff --git a/ApplicationLibCode/Commands/GeoMechCommands/RicRunFaultReactAssessmentFeature.h b/ApplicationLibCode/Commands/GeoMechCommands/RicRunFaultReactAssessmentFeature.h index ba819c0eb7..808928323c 100644 --- a/ApplicationLibCode/Commands/GeoMechCommands/RicRunFaultReactAssessmentFeature.h +++ b/ApplicationLibCode/Commands/GeoMechCommands/RicRunFaultReactAssessmentFeature.h @@ -34,8 +34,10 @@ class RicRunFaultReactAssessmentFeature : public caf::CmdFeature protected: RicRunFaultReactAssessmentFeature(); - RimFaultInViewCollection* faultCollection(); - int selectedFaultID(); + virtual RimFaultInViewCollection* faultCollection(); + + int selectedFaultID(); + int faultIDFromName( QString faultname ) const; RimSurfaceCollection* surfaceCollection(); @@ -47,6 +49,9 @@ class RicRunFaultReactAssessmentFeature : public caf::CmdFeature void removeFile( QString filename ); + void runBasicProcessing( int faultID ); + void runAdvancedProcessing( int faultID ); + private: std::list m_parameterFilesToCleanUp; }; diff --git a/ApplicationLibCode/ProjectDataModel/Faults/RimFaultInViewCollection.cpp b/ApplicationLibCode/ProjectDataModel/Faults/RimFaultInViewCollection.cpp index 7a5fad8f87..0afa5d92e9 100644 --- a/ApplicationLibCode/ProjectDataModel/Faults/RimFaultInViewCollection.cpp +++ b/ApplicationLibCode/ProjectDataModel/Faults/RimFaultInViewCollection.cpp @@ -364,6 +364,14 @@ bool RimFaultInViewCollection::faultRAEnabled() const return m_enableFaultRA(); } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +bool RimFaultInViewCollection::faultRAAdvancedEnabled() const +{ + return m_enableFaultRA() && ( m_faultRASettings->geomechCase() != nullptr ); +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationLibCode/ProjectDataModel/Faults/RimFaultInViewCollection.h b/ApplicationLibCode/ProjectDataModel/Faults/RimFaultInViewCollection.h index 6175573cb3..15c3aa0e31 100644 --- a/ApplicationLibCode/ProjectDataModel/Faults/RimFaultInViewCollection.h +++ b/ApplicationLibCode/ProjectDataModel/Faults/RimFaultInViewCollection.h @@ -64,6 +64,7 @@ class RimFaultInViewCollection : public caf::PdmObject RimFaultRASettings* faultRASettings() const; bool faultRAEnabled() const; + bool faultRAAdvancedEnabled() const; void enableFaultRA( bool enable ); caf::PdmField showFaultFaces; diff --git a/ApplicationLibCode/UserInterface/RiuViewerCommands.cpp b/ApplicationLibCode/UserInterface/RiuViewerCommands.cpp index f914875be8..294bca3f14 100644 --- a/ApplicationLibCode/UserInterface/RiuViewerCommands.cpp +++ b/ApplicationLibCode/UserInterface/RiuViewerCommands.cpp @@ -429,15 +429,14 @@ void RiuViewerCommands::displayContextMenu( QMouseEvent* event ) RimEclipseView* eclipseView = dynamic_cast( mainOrComparisonView ); if ( eclipseView ) { - // Hide faults command + // fault commands const RigFault* fault = eclipseView->mainGrid()->findFaultFromCellIndexAndCellFace( m_currentCellIndex, m_currentFaceIndex ); if ( fault ) { menuBuilder.addSeparator(); - QString faultName = fault->name(); - + QString faultName = fault->name(); QVariantList hideFaultList; qulonglong currentCellIndex = m_currentCellIndex; hideFaultList.push_back( currentCellIndex ); @@ -446,6 +445,22 @@ void RiuViewerCommands::displayContextMenu( QMouseEvent* event ) menuBuilder.addCmdFeatureWithUserData( "RicEclipseHideFaultFeature", QString( "Hide " ) + faultName, hideFaultList ); + + if ( eclipseView->faultCollection() && eclipseView->faultCollection()->faultRAEnabled() ) + { + menuBuilder.subMenuStart( "Reactivation Assessment" ); + menuBuilder.addCmdFeatureWithUserData( "RicRunBasicFaultReactAssessment3dFeature", + "Run Basic Processing", + QVariant( fault->name() ) ); + if ( eclipseView->faultCollection()->faultRAAdvancedEnabled() ) + { + menuBuilder.addCmdFeatureWithUserData( "RicRunAdvFaultReactAssessment3dFeature", + "Run Advanced Processing", + QVariant( fault->name() ) ); + } + menuBuilder.subMenuEnd(); + menuBuilder.addSeparator(); + } } } From 5dd7822b5f18f7051ad9a1deb37c114f27826dab Mon Sep 17 00:00:00 2001 From: jonjenssen Date: Mon, 21 Jun 2021 12:22:55 +0200 Subject: [PATCH 012/308] Fix typo in fault id parameter, send correct id to processing --- .../GeoMechCommands/RicRunAdvFaultReactAssessment3dFeature.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ApplicationLibCode/Commands/GeoMechCommands/RicRunAdvFaultReactAssessment3dFeature.cpp b/ApplicationLibCode/Commands/GeoMechCommands/RicRunAdvFaultReactAssessment3dFeature.cpp index 910f4de502..57746c8893 100644 --- a/ApplicationLibCode/Commands/GeoMechCommands/RicRunAdvFaultReactAssessment3dFeature.cpp +++ b/ApplicationLibCode/Commands/GeoMechCommands/RicRunAdvFaultReactAssessment3dFeature.cpp @@ -33,7 +33,7 @@ void RicRunAdvFaultReactAssessment3dFeature::onActionTriggered( bool isChecked ) QString faultName = userData.toString(); int faultID = faultIDFromName( faultName ); - if ( faultID >= 0 ) runAdvancedProcessing( selectedFaultID() ); + if ( faultID >= 0 ) runAdvancedProcessing( faultID ); } //-------------------------------------------------------------------------------------------------- From f498138f4e2ab18ee38f94679754e69b4ffdf1db Mon Sep 17 00:00:00 2001 From: Kristian Bendiksen Date: Fri, 18 Jun 2021 13:18:06 +0200 Subject: [PATCH 013/308] StimPlanModel: use data from input cases when available --- .../RimStimPlanModelPressureCalculator.cpp | 64 +++++++++++++------ .../RimStimPlanModelWellLogCalculator.cpp | 6 ++ 2 files changed, 49 insertions(+), 21 deletions(-) diff --git a/ApplicationLibCode/ProjectDataModel/StimPlanModel/RimStimPlanModelPressureCalculator.cpp b/ApplicationLibCode/ProjectDataModel/StimPlanModel/RimStimPlanModelPressureCalculator.cpp index ee344484d6..f03db74ea4 100644 --- a/ApplicationLibCode/ProjectDataModel/StimPlanModel/RimStimPlanModelPressureCalculator.cpp +++ b/ApplicationLibCode/ProjectDataModel/StimPlanModel/RimStimPlanModelPressureCalculator.cpp @@ -39,6 +39,7 @@ #include "RimStimPlanModelCalculator.h" #include "RimStimPlanModelTemplate.h" #include "RimStimPlanModelWellLogCalculator.h" +#include "cafAssert.h" #include @@ -448,49 +449,70 @@ bool RimStimPlanModelPressureCalculator::buildPressureTablesPerEqlNum( const Rim EqlNumToDepthValuePairMap& valuesPerEqlNum, const std::set& presentEqlNums ) { - RimEclipseCase* eclipseCase = stimPlanModel->eclipseCaseForProperty( RiaDefines::CurveProperty::EQLNUM ); + int gridIndex = 0; + RimEclipseCase* eqlNumEclipseCase = stimPlanModel->eclipseCaseForProperty( RiaDefines::CurveProperty::EQLNUM ); + CAF_ASSERT( eqlNumEclipseCase != nullptr ); - // TODO: too naive?? - int gridIndex = 0; - const RigGridBase* grid = eclipseCase->mainGrid()->gridByIndex( gridIndex ); + const RigGridBase* eqlNumGrid = eqlNumEclipseCase->mainGrid()->gridByIndex( gridIndex ); + CAF_ASSERT( eqlNumGrid != nullptr ); - RigEclipseCaseData* caseData = eclipseCase->eclipseCaseData(); + RigEclipseCaseData* eqlNumCaseData = eqlNumEclipseCase->eclipseCaseData(); + CAF_ASSERT( eqlNumCaseData != nullptr ); RiaDefines::PorosityModelType porosityModel = RiaDefines::PorosityModelType::MATRIX_MODEL; const std::vector& eqlNumValues = - RimStimPlanModelWellLogCalculator::loadResults( caseData, + RimStimPlanModelWellLogCalculator::loadResults( eqlNumCaseData, porosityModel, RiaDefines::ResultCatType::STATIC_NATIVE, "EQLNUM" ); + + RimEclipseCase* pressureEclipseCase = + stimPlanModel->eclipseCaseForProperty( RiaDefines::CurveProperty::INITIAL_PRESSURE ); + CAF_ASSERT( pressureEclipseCase != nullptr ); + + const RigGridBase* pressureGrid = pressureEclipseCase->mainGrid()->gridByIndex( gridIndex ); + CAF_ASSERT( pressureGrid ); + + RigEclipseCaseData* pressureCaseData = pressureEclipseCase->eclipseCaseData(); + CAF_ASSERT( pressureCaseData ); + const std::vector& pressureValues = - RimStimPlanModelWellLogCalculator::loadResults( caseData, + RimStimPlanModelWellLogCalculator::loadResults( pressureCaseData, porosityModel, RiaDefines::ResultCatType::DYNAMIC_NATIVE, "PRESSURE" ); - if ( eqlNumValues.size() != pressureValues.size() ) - { - RiaLogging::error( "Unexpected result size for EQLNUM and PRESSURE found for pressure calculation." ); - return false; - } + auto eqlNumActiveCellInfo = eqlNumCaseData->activeCellInfo( porosityModel ); + size_t eqlNumCellCount = eqlNumActiveCellInfo->reservoirCellCount(); - auto activeCellInfo = caseData->activeCellInfo( porosityModel ); - size_t cellCount = activeCellInfo->reservoirActiveCellCount(); + auto pressureActiveCellInfo = pressureCaseData->activeCellInfo( porosityModel ); - if ( cellCount != pressureValues.size() ) + if ( eqlNumGrid->cellCountI() != pressureGrid->cellCountI() || + eqlNumGrid->cellCountJ() != pressureGrid->cellCountJ() || eqlNumGrid->cellCountK() != pressureGrid->cellCountK() ) { - RiaLogging::error( "Unexpected number of active cells in pressure calculation." ); + RiaLogging::error( "Unexpected number of cells when building pressure per EQLNUM table. " ); + RiaLogging::error( "Grid needs to have identical geometry." ); + RiaLogging::error( QString( "EQLNUM grid dimensions: [ %1, %2, %3]" ) + .arg( eqlNumGrid->cellCountI() ) + .arg( eqlNumGrid->cellCountJ() ) + .arg( eqlNumGrid->cellCountK() ) ); + + RiaLogging::error( QString( "PRESSURE grid dimensions: [ %1, %2, %3]" ) + .arg( pressureGrid->cellCountI() ) + .arg( pressureGrid->cellCountJ() ) + .arg( pressureGrid->cellCountK() ) ); return false; } - for ( size_t cellIndex = 0; cellIndex < cellCount; cellIndex++ ) + for ( size_t cellIndex = 0; cellIndex < eqlNumCellCount; cellIndex++ ) { - size_t resultIdx = activeCellInfo->cellResultIndex( cellIndex ); - int eqlNum = static_cast( eqlNumValues[resultIdx] ); - double pressure = pressureValues[resultIdx]; + size_t resultIdx = eqlNumActiveCellInfo->cellResultIndex( cellIndex ); + int eqlNum = static_cast( eqlNumValues[resultIdx] ); + size_t pressureResultIdx = pressureActiveCellInfo->cellResultIndex( cellIndex ); + double pressure = pressureValues[pressureResultIdx]; if ( presentEqlNums.count( eqlNum ) > 0 && !std::isinf( pressure ) ) { - cvf::Vec3d center = grid->cell( cellIndex ).center(); + cvf::Vec3d center = eqlNumGrid->cell( cellIndex ).center(); valuesPerEqlNum[eqlNum].push_back( std::make_pair( -center.z(), pressure ) ); } } diff --git a/ApplicationLibCode/ProjectDataModel/StimPlanModel/RimStimPlanModelWellLogCalculator.cpp b/ApplicationLibCode/ProjectDataModel/StimPlanModel/RimStimPlanModelWellLogCalculator.cpp index a129ef5b84..8b88e1fb73 100644 --- a/ApplicationLibCode/ProjectDataModel/StimPlanModel/RimStimPlanModelWellLogCalculator.cpp +++ b/ApplicationLibCode/ProjectDataModel/StimPlanModel/RimStimPlanModelWellLogCalculator.cpp @@ -584,6 +584,12 @@ const std::vector& RimStimPlanModelWellLogCalculator::loadResults( RigEc int timeStepIndex = 0; RigEclipseResultAddress resultAddress( resultType, propertyName ); + if ( !resultData->hasResultEntry( resultAddress ) && resultType != RiaDefines::ResultCatType::INPUT_PROPERTY ) + { + return loadResults( caseData, porosityModel, RiaDefines::ResultCatType::INPUT_PROPERTY, propertyName ); + } + + CAF_ASSERT( resultData->hasResultEntry( resultAddress ) ); resultData->ensureKnownResultLoaded( resultAddress ); return caseData->results( porosityModel )->cellScalarResults( resultAddress, timeStepIndex ); } From dde4f021ab9b88cda8fb2f7ac8010e419cb288e1 Mon Sep 17 00:00:00 2001 From: Kristian Bendiksen Date: Fri, 18 Jun 2021 14:02:07 +0200 Subject: [PATCH 014/308] StimPlanModel: replace assert with error handling --- .../StimPlanModel/RimStimPlanModelPressureCalculator.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/ApplicationLibCode/ProjectDataModel/StimPlanModel/RimStimPlanModelPressureCalculator.cpp b/ApplicationLibCode/ProjectDataModel/StimPlanModel/RimStimPlanModelPressureCalculator.cpp index f03db74ea4..649e389d12 100644 --- a/ApplicationLibCode/ProjectDataModel/StimPlanModel/RimStimPlanModelPressureCalculator.cpp +++ b/ApplicationLibCode/ProjectDataModel/StimPlanModel/RimStimPlanModelPressureCalculator.cpp @@ -745,8 +745,12 @@ bool RimStimPlanModelPressureCalculator::handleFaciesWithInitialPressure( const return false; } - CAF_ASSERT( faciesValues.size() == initialPressureValues.size() ); - CAF_ASSERT( faciesValues.size() == values.size() ); + if ( faciesValues.size() != initialPressureValues.size() || faciesValues.size() != values.size() ) + { + RiaLogging::error( "Unable to handle facies with initial pressure: result length mismatch" ); + return false; + } + for ( size_t i = 0; i < faciesValues.size(); i++ ) { // Use the values from initial pressure curve From 56b80b8a0200a483d7c475549b9b55d969b2809a Mon Sep 17 00:00:00 2001 From: Kristian Bendiksen Date: Mon, 21 Jun 2021 20:24:02 +0200 Subject: [PATCH 015/308] #7804 Compute static result for IJK indexes. --- .../Application/RiaResultNames.cpp | 24 ++++ .../Application/RiaResultNames.h | 4 + .../RigCaseCellResultsData.cpp | 120 ++++++++++++++++++ .../RigCaseCellResultsData.h | 2 + 4 files changed, 150 insertions(+) diff --git a/ApplicationLibCode/Application/RiaResultNames.cpp b/ApplicationLibCode/Application/RiaResultNames.cpp index 6b7b85c4aa..19f326073f 100644 --- a/ApplicationLibCode/Application/RiaResultNames.cpp +++ b/ApplicationLibCode/Application/RiaResultNames.cpp @@ -313,6 +313,30 @@ QString RiaResultNames::formationAllanResultName() return "Formation Allan"; } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +QString RiaResultNames::indexIResultName() +{ + return "INDEX_I"; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +QString RiaResultNames::indexJResultName() +{ + return "INDEX_J"; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +QString RiaResultNames::indexKResultName() +{ + return "INDEX_K"; +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationLibCode/Application/RiaResultNames.h b/ApplicationLibCode/Application/RiaResultNames.h index 485f538c4f..eb3e3edbee 100644 --- a/ApplicationLibCode/Application/RiaResultNames.h +++ b/ApplicationLibCode/Application/RiaResultNames.h @@ -64,6 +64,10 @@ QString faultReactAssessmentPrefix(); QString completionTypeResultName(); +QString indexIResultName(); +QString indexJResultName(); +QString indexKResultName(); + // Well path derived results QString wbsAzimuthResult(); QString wbsInclinationResult(); diff --git a/ApplicationLibCode/ReservoirDataModel/RigCaseCellResultsData.cpp b/ApplicationLibCode/ReservoirDataModel/RigCaseCellResultsData.cpp index 853d4ad981..11e0488fdc 100644 --- a/ApplicationLibCode/ReservoirDataModel/RigCaseCellResultsData.cpp +++ b/ApplicationLibCode/ReservoirDataModel/RigCaseCellResultsData.cpp @@ -24,6 +24,7 @@ #include "RiaEclipseUnitTools.h" #include "RiaLogging.h" +#include "RiaResultNames.h" #include "RigAllanDiagramData.h" #include "RigCaseCellResultCalculator.h" #include "RigEclipseCaseData.h" @@ -1098,6 +1099,13 @@ void RigCaseCellResultsData::createPlaceholderResultEntries() addStaticScalarResult( RiaDefines::ResultCatType::STATIC_NATIVE, RiaResultNames::mobilePoreVolumeName(), false, 0 ); } } + + // I/J/K indexes + { + addStaticScalarResult( RiaDefines::ResultCatType::STATIC_NATIVE, RiaResultNames::indexIResultName(), false, 0 ); + addStaticScalarResult( RiaDefines::ResultCatType::STATIC_NATIVE, RiaResultNames::indexJResultName(), false, 0 ); + addStaticScalarResult( RiaDefines::ResultCatType::STATIC_NATIVE, RiaResultNames::indexKResultName(), false, 0 ); + } } //-------------------------------------------------------------------------------------------------- @@ -1308,6 +1316,11 @@ size_t RigCaseCellResultsData::findOrLoadKnownScalarResult( const RigEclipseResu } computeAllanResults( this, m_ownerMainGrid, includeInactiveCells ); } + else if ( resultName == RiaResultNames::indexIResultName() || + resultName == RiaResultNames::indexJResultName() || resultName == RiaResultNames::indexKResultName() ) + { + computeIndexResults(); + } } else if ( type == RiaDefines::ResultCatType::DYNAMIC_NATIVE ) { @@ -1987,6 +2000,113 @@ void RigCaseCellResultsData::computeDepthRelatedResults() } } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RigCaseCellResultsData::computeIndexResults() +{ + size_t reservoirCellCount = activeCellInfo()->reservoirCellCount(); + if ( reservoirCellCount == 0 ) return; + + size_t iResultIndex = findOrCreateScalarResultIndex( RigEclipseResultAddress( RiaDefines::ResultCatType::STATIC_NATIVE, + RiaResultNames::indexIResultName() ), + false ); + size_t jResultIndex = findOrCreateScalarResultIndex( RigEclipseResultAddress( RiaDefines::ResultCatType::STATIC_NATIVE, + RiaResultNames::indexJResultName() ), + false ); + size_t kResultIndex = findOrCreateScalarResultIndex( RigEclipseResultAddress( RiaDefines::ResultCatType::STATIC_NATIVE, + RiaResultNames::indexKResultName() ), + false ); + + bool computeIndexI = false; + bool computeIndexJ = false; + bool computeIndexK = false; + + if ( iResultIndex == cvf::UNDEFINED_SIZE_T ) + { + iResultIndex = this->addStaticScalarResult( RiaDefines::ResultCatType::STATIC_NATIVE, + RiaResultNames::indexIResultName(), + false, + reservoirCellCount ); + computeIndexI = true; + } + + if ( jResultIndex == cvf::UNDEFINED_SIZE_T ) + { + jResultIndex = this->addStaticScalarResult( RiaDefines::ResultCatType::STATIC_NATIVE, + RiaResultNames::indexJResultName(), + false, + reservoirCellCount ); + computeIndexJ = true; + } + + if ( kResultIndex == cvf::UNDEFINED_SIZE_T ) + { + kResultIndex = this->addStaticScalarResult( RiaDefines::ResultCatType::STATIC_NATIVE, + RiaResultNames::indexKResultName(), + false, + reservoirCellCount ); + computeIndexK = true; + } + + std::vector>& indexI = m_cellScalarResults[iResultIndex]; + std::vector>& indexJ = m_cellScalarResults[jResultIndex]; + std::vector>& indexK = m_cellScalarResults[kResultIndex]; + + { + if ( indexI[0].size() < reservoirCellCount ) + { + indexI[0].resize( reservoirCellCount, std::numeric_limits::infinity() ); + computeIndexI = true; + } + + if ( indexJ[0].size() < reservoirCellCount ) + { + indexJ[0].resize( reservoirCellCount, std::numeric_limits::infinity() ); + computeIndexJ = true; + } + + if ( indexK[0].size() < reservoirCellCount ) + { + indexK[0].resize( reservoirCellCount, std::numeric_limits::infinity() ); + computeIndexK = true; + } + } + + for ( size_t cellIdx = 0; cellIdx < m_ownerMainGrid->globalCellArray().size(); cellIdx++ ) + { + const RigCell& cell = m_ownerMainGrid->globalCellArray()[cellIdx]; + + size_t resultIndex = cellIdx; + if ( resultIndex == cvf::UNDEFINED_SIZE_T ) continue; + + bool isTemporaryGrid = cell.hostGrid()->isTempGrid(); + + size_t gridLocalNativeCellIndex = cell.gridLocalCellIndex(); + RigGridBase* grid = cell.hostGrid(); + + size_t i, j, k; + if ( grid->ijkFromCellIndex( gridLocalNativeCellIndex, &i, &j, &k ) ) + { + // I/J/K is 1-indexed when shown to user, thus "+ 1" + if ( computeIndexI || isTemporaryGrid ) + { + indexI[0][resultIndex] = i + 1; + } + + if ( computeIndexJ || isTemporaryGrid ) + { + indexJ[0][resultIndex] = j + 1; + } + + if ( computeIndexK || isTemporaryGrid ) + { + indexK[0][resultIndex] = k + 1; + } + } + } +} + namespace RigTransmissibilityCalcTools { void calculateConnectionGeometry( const RigCell& c1, diff --git a/ApplicationLibCode/ReservoirDataModel/RigCaseCellResultsData.h b/ApplicationLibCode/ReservoirDataModel/RigCaseCellResultsData.h index dc790c8c6d..4cb1a3efcb 100644 --- a/ApplicationLibCode/ReservoirDataModel/RigCaseCellResultsData.h +++ b/ApplicationLibCode/ReservoirDataModel/RigCaseCellResultsData.h @@ -188,6 +188,8 @@ class RigCaseCellResultsData : public cvf::Object void computeOilVolumes(); void computeMobilePV(); + void computeIndexResults(); + bool isDataPresent( size_t scalarResultIndex ) const; void assignValuesToTemporaryLgrs( const QString& resultName, std::vector& values ); From 6fd556454530e21261771c3c59bd16125c0b9f5b Mon Sep 17 00:00:00 2001 From: Kristian Bendiksen Date: Wed, 23 Jun 2021 12:54:50 +0200 Subject: [PATCH 016/308] #7718 Fix unnecessary error dialog for LAS import --- ApplicationLibCode/ProjectDataModel/RimWellLogFile.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ApplicationLibCode/ProjectDataModel/RimWellLogFile.cpp b/ApplicationLibCode/ProjectDataModel/RimWellLogFile.cpp index f36cd486cb..c2547c3aff 100644 --- a/ApplicationLibCode/ProjectDataModel/RimWellLogFile.cpp +++ b/ApplicationLibCode/ProjectDataModel/RimWellLogFile.cpp @@ -168,9 +168,9 @@ bool RimWellLogFile::readFile( QString* errorMessage ) } else if ( !isDateValid( m_date() ) ) { - *errorMessage = QString( "The LAS-file '%1' contains no recognizable date. Please assign a date in the " - "LAS-file property panel" ) - .arg( m_name() ); + RiaLogging::warning( QString( "The LAS-file '%1' contains no recognizable date. Please assign a date in the " + "LAS-file property panel." ) + .arg( m_name() ) ); m_date = DEFAULT_DATE_TIME; } From a652a2bfb95af4a5e30e939ebdbbd9f1077455cc Mon Sep 17 00:00:00 2001 From: Kristian Bendiksen Date: Wed, 23 Jun 2021 15:17:56 +0200 Subject: [PATCH 017/308] #7782 Grid Statistics Plot: Use current Cell Result property for making histogram --- .../RicCreateGridStatisticsPlotFeature.cpp | 6 ++++++ .../ProjectDataModel/RimGridStatisticsPlot.cpp | 17 +++++++++++++++++ .../ProjectDataModel/RimGridStatisticsPlot.h | 3 +++ 3 files changed, 26 insertions(+) diff --git a/ApplicationLibCode/Commands/RicCreateGridStatisticsPlotFeature.cpp b/ApplicationLibCode/Commands/RicCreateGridStatisticsPlotFeature.cpp index a1d0246488..4585c53686 100644 --- a/ApplicationLibCode/Commands/RicCreateGridStatisticsPlotFeature.cpp +++ b/ApplicationLibCode/Commands/RicCreateGridStatisticsPlotFeature.cpp @@ -20,6 +20,8 @@ #include "RiaGuiApplication.h" +#include "RimEclipseResultDefinition.h" +#include "RimEclipseView.h" #include "RimGridStatisticsPlot.h" #include "RimGridStatisticsPlotCollection.h" #include "RimMainPlotCollection.h" @@ -50,6 +52,10 @@ void RicCreateGridStatisticsPlotFeature::onActionTriggered( bool isChecked ) RimGridStatisticsPlotCollection* collection = project->mainPlotCollection()->gridStatisticsPlotCollection(); RimGridStatisticsPlot* plot = new RimGridStatisticsPlot(); + + RimEclipseView* activeView = dynamic_cast( RiaApplication::instance()->activeGridView() ); + if ( activeView ) plot->setPropertiesFromView( activeView ); + plot->zoomAll(); plot->updateConnectedEditors(); plot->setAsPlotMdiWindow(); diff --git a/ApplicationLibCode/ProjectDataModel/RimGridStatisticsPlot.cpp b/ApplicationLibCode/ProjectDataModel/RimGridStatisticsPlot.cpp index 036d79b246..f5cab1cd85 100644 --- a/ApplicationLibCode/ProjectDataModel/RimGridStatisticsPlot.cpp +++ b/ApplicationLibCode/ProjectDataModel/RimGridStatisticsPlot.cpp @@ -24,6 +24,7 @@ #include "RimCase.h" #include "RimEclipseCase.h" #include "RimEclipseCaseCollection.h" +#include "RimEclipseCellColors.h" #include "RimEclipseResultCase.h" #include "RimEclipseResultDefinition.h" #include "RimEclipseView.h" @@ -99,6 +100,22 @@ void RimGridStatisticsPlot::setDefaults() } } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimGridStatisticsPlot::setPropertiesFromView( RimEclipseView* view ) +{ + CAF_ASSERT( view ); + + m_case = view->ownerCase(); + + RimEclipseCase* eclipseCase = dynamic_cast( m_case.value() ); + if ( eclipseCase ) m_property->setEclipseCase( eclipseCase ); + + const RimEclipseResultDefinition* resDef = dynamic_cast( view->cellResult() ); + if ( resDef ) m_property->simpleCopy( resDef ); +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationLibCode/ProjectDataModel/RimGridStatisticsPlot.h b/ApplicationLibCode/ProjectDataModel/RimGridStatisticsPlot.h index f5105988be..3aa328fe3a 100644 --- a/ApplicationLibCode/ProjectDataModel/RimGridStatisticsPlot.h +++ b/ApplicationLibCode/ProjectDataModel/RimGridStatisticsPlot.h @@ -32,6 +32,7 @@ class RimCase; class RimPlot; class RimGridView; class RimEclipseResultDefinition; +class RimEclipseView; //================================================================================================== /// @@ -47,6 +48,8 @@ class RimGridStatisticsPlot : public RimStatisticsPlot void cellFilterViewUpdated(); + void setPropertiesFromView( RimEclipseView* view ); + protected: // Overridden PDM methods void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) override; From dd55762249c6439bc0bfaa9c22472b5ec103cce4 Mon Sep 17 00:00:00 2001 From: Kristian Bendiksen Date: Thu, 24 Jun 2021 10:05:37 +0200 Subject: [PATCH 018/308] Stim Plan Model: Use eqlnum from initial pressure case --- .../ProjectDataModel/StimPlanModel/RimStimPlanModel.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ApplicationLibCode/ProjectDataModel/StimPlanModel/RimStimPlanModel.cpp b/ApplicationLibCode/ProjectDataModel/StimPlanModel/RimStimPlanModel.cpp index 2430fbbf95..59500a6e01 100644 --- a/ApplicationLibCode/ProjectDataModel/StimPlanModel/RimStimPlanModel.cpp +++ b/ApplicationLibCode/ProjectDataModel/StimPlanModel/RimStimPlanModel.cpp @@ -1345,7 +1345,8 @@ bool RimStimPlanModel::useStaticEclipseCase( RiaDefines::CurveProperty curveProp //-------------------------------------------------------------------------------------------------- RimEclipseCase* RimStimPlanModel::eclipseCaseForProperty( RiaDefines::CurveProperty curveProperty ) const { - if ( m_initialPressureEclipseCase && curveProperty == RiaDefines::CurveProperty::INITIAL_PRESSURE ) + if ( m_initialPressureEclipseCase && ( curveProperty == RiaDefines::CurveProperty::INITIAL_PRESSURE || + curveProperty == RiaDefines::CurveProperty::EQLNUM ) ) { return m_initialPressureEclipseCase; } From 3b5eeb87fa9b8106005c83f5f3e9b85a2519a263 Mon Sep 17 00:00:00 2001 From: Kristian Bendiksen Date: Mon, 17 May 2021 15:24:43 +0200 Subject: [PATCH 019/308] #7715 Add python interface for creating well log plots --- .../RimWellLogExtractionCurve.cpp | 12 +- .../RimWellLogExtractionCurve.h | 1 + .../RimWellLogPlotCollection.cpp | 7 +- .../ProjectDataModel/RimWellLogTrack.cpp | 5 +- .../StimPlanModel/RimStimPlanModelCurve.cpp | 8 -- .../StimPlanModel/RimStimPlanModelCurve.h | 2 - .../CMakeLists_files.cmake | 6 + .../RimcWellLogPlot.cpp | 97 ++++++++++++++++ .../RimcWellLogPlot.h | 50 ++++++++ .../RimcWellLogPlotCollection.cpp | 95 +++++++++++++++ .../RimcWellLogPlotCollection.h | 51 ++++++++ .../RimcWellLogTrack.cpp | 109 ++++++++++++++++++ .../RimcWellLogTrack.h | 51 ++++++++ .../generate_ensemble_of_well_logs.py | 79 +++++++++++++ 14 files changed, 559 insertions(+), 14 deletions(-) create mode 100644 ApplicationLibCode/ProjectDataModelCommands/RimcWellLogPlot.cpp create mode 100644 ApplicationLibCode/ProjectDataModelCommands/RimcWellLogPlot.h create mode 100644 ApplicationLibCode/ProjectDataModelCommands/RimcWellLogPlotCollection.cpp create mode 100644 ApplicationLibCode/ProjectDataModelCommands/RimcWellLogPlotCollection.h create mode 100644 ApplicationLibCode/ProjectDataModelCommands/RimcWellLogTrack.cpp create mode 100644 ApplicationLibCode/ProjectDataModelCommands/RimcWellLogTrack.h create mode 100644 GrpcInterface/Python/rips/PythonExamples/generate_ensemble_of_well_logs.py diff --git a/ApplicationLibCode/ProjectDataModel/RimWellLogExtractionCurve.cpp b/ApplicationLibCode/ProjectDataModel/RimWellLogExtractionCurve.cpp index d25b234289..9642b75b33 100644 --- a/ApplicationLibCode/ProjectDataModel/RimWellLogExtractionCurve.cpp +++ b/ApplicationLibCode/ProjectDataModel/RimWellLogExtractionCurve.cpp @@ -63,6 +63,8 @@ #include "RiuQwtPlotCurve.h" #include "RiuQwtPlotWidget.h" +#include "cafPdmFieldScriptingCapability.h" +#include "cafPdmObjectScriptingCapability.h" #include "cafPdmUiTreeOrdering.h" #include "cafUtils.h" @@ -91,7 +93,7 @@ void AppEnum::setUp() //-------------------------------------------------------------------------------------------------- RimWellLogExtractionCurve::RimWellLogExtractionCurve() { - CAF_PDM_InitObject( "Well Log Curve", RimWellLogCurve::wellLogCurveIconName(), "", "" ); + CAF_PDM_InitScriptableObject( "Well Log Curve", RimWellLogCurve::wellLogCurveIconName(), "", "" ); CAF_PDM_InitFieldNoDefault( &m_trajectoryType, "TrajectoryType", "Trajectory Type", "", "", "" ); @@ -1071,6 +1073,14 @@ QString RimWellLogExtractionCurve::eclipseResultVariable() const return m_eclipseResultDefinition->resultVariable(); } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimWellLogExtractionCurve::setEclipseResultCategory( RiaDefines::ResultCatType catType ) +{ + m_eclipseResultDefinition->setResultType( catType ); +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationLibCode/ProjectDataModel/RimWellLogExtractionCurve.h b/ApplicationLibCode/ProjectDataModel/RimWellLogExtractionCurve.h index e94e225321..5fe6860d3e 100644 --- a/ApplicationLibCode/ProjectDataModel/RimWellLogExtractionCurve.h +++ b/ApplicationLibCode/ProjectDataModel/RimWellLogExtractionCurve.h @@ -79,6 +79,7 @@ class RimWellLogExtractionCurve : public RimWellLogCurve void setEclipseResultVariable( const QString& resVarname ); QString eclipseResultVariable() const; + void setEclipseResultCategory( RiaDefines::ResultCatType catType ); void setGeoMechResultAddress( const RigFemResultAddress& resAddr ); diff --git a/ApplicationLibCode/ProjectDataModel/RimWellLogPlotCollection.cpp b/ApplicationLibCode/ProjectDataModel/RimWellLogPlotCollection.cpp index ba71f18913..85663e4682 100644 --- a/ApplicationLibCode/ProjectDataModel/RimWellLogPlotCollection.cpp +++ b/ApplicationLibCode/ProjectDataModel/RimWellLogPlotCollection.cpp @@ -34,6 +34,9 @@ #include "RimWellPath.h" #include "RimWellPathCollection.h" +#include "cafPdmFieldScriptingCapability.h" +#include "cafPdmObjectScriptingCapability.h" + #include "cvfAssert.h" CAF_PDM_SOURCE_INIT( RimWellLogPlotCollection, "WellLogPlotCollection" ); @@ -43,9 +46,9 @@ CAF_PDM_SOURCE_INIT( RimWellLogPlotCollection, "WellLogPlotCollection" ); //-------------------------------------------------------------------------------------------------- RimWellLogPlotCollection::RimWellLogPlotCollection() { - CAF_PDM_InitObject( "Well Log Plots", ":/WellLogPlots16x16.png", "", "" ); + CAF_PDM_InitScriptableObject( "Well Log Plots", ":/WellLogPlots16x16.png", "", "" ); - CAF_PDM_InitFieldNoDefault( &m_wellLogPlots, "WellLogPlots", "", "", "", "" ); + CAF_PDM_InitScriptableFieldNoDefault( &m_wellLogPlots, "WellLogPlots", "", "", "", "" ); m_wellLogPlots.uiCapability()->setUiHidden( true ); } diff --git a/ApplicationLibCode/ProjectDataModel/RimWellLogTrack.cpp b/ApplicationLibCode/ProjectDataModel/RimWellLogTrack.cpp index 682e5c7fc9..c2f84d5807 100644 --- a/ApplicationLibCode/ProjectDataModel/RimWellLogTrack.cpp +++ b/ApplicationLibCode/ProjectDataModel/RimWellLogTrack.cpp @@ -83,8 +83,11 @@ #include "RiuWellPathComponentPlotItem.h" #include "cafPdmFieldReorderCapability.h" +#include "cafPdmFieldScriptingCapability.h" +#include "cafPdmObjectScriptingCapability.h" #include "cafPdmUiSliderEditor.h" #include "cafSelectionManager.h" + #include "cvfAssert.h" #include @@ -169,7 +172,7 @@ RimWellLogTrack::RimWellLogTrack() , m_availableDepthRangeMax( RI_LOGPLOTTRACK_MAXX_DEFAULT ) { - CAF_PDM_InitObject( "Track", ":/WellLogTrack16x16.png", "", "" ); + CAF_PDM_InitScriptableObject( "Track", ":/WellLogTrack16x16.png", "", "" ); CAF_PDM_InitFieldNoDefault( &m_description, "TrackDescription", "Name", "", "", "" ); diff --git a/ApplicationLibCode/ProjectDataModel/StimPlanModel/RimStimPlanModelCurve.cpp b/ApplicationLibCode/ProjectDataModel/StimPlanModel/RimStimPlanModelCurve.cpp index a2f539bab6..353e8e1911 100644 --- a/ApplicationLibCode/ProjectDataModel/StimPlanModel/RimStimPlanModelCurve.cpp +++ b/ApplicationLibCode/ProjectDataModel/StimPlanModel/RimStimPlanModelCurve.cpp @@ -76,14 +76,6 @@ void RimStimPlanModelCurve::setStimPlanModel( RimStimPlanModel* stimPlanModel ) m_wellPath = stimPlanModel->thicknessDirectionWellPath(); } -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -void RimStimPlanModelCurve::setEclipseResultCategory( RiaDefines::ResultCatType catType ) -{ - m_eclipseResultDefinition->setResultType( catType ); -} - //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationLibCode/ProjectDataModel/StimPlanModel/RimStimPlanModelCurve.h b/ApplicationLibCode/ProjectDataModel/StimPlanModel/RimStimPlanModelCurve.h index 5d07681e64..85eb4f0c24 100644 --- a/ApplicationLibCode/ProjectDataModel/StimPlanModel/RimStimPlanModelCurve.h +++ b/ApplicationLibCode/ProjectDataModel/StimPlanModel/RimStimPlanModelCurve.h @@ -41,8 +41,6 @@ class RimStimPlanModelCurve : public RimWellLogExtractionCurve, public RimStimPl void setStimPlanModel( RimStimPlanModel* stimPlanModel ); - void setEclipseResultCategory( RiaDefines::ResultCatType catType ); - void setCurveProperty( RiaDefines::CurveProperty ) override; RiaDefines::CurveProperty curveProperty() const override; diff --git a/ApplicationLibCode/ProjectDataModelCommands/CMakeLists_files.cmake b/ApplicationLibCode/ProjectDataModelCommands/CMakeLists_files.cmake index cebd9c8ccd..a8d59fb3d1 100644 --- a/ApplicationLibCode/ProjectDataModelCommands/CMakeLists_files.cmake +++ b/ApplicationLibCode/ProjectDataModelCommands/CMakeLists_files.cmake @@ -13,6 +13,9 @@ ${CMAKE_CURRENT_LIST_DIR}/RimcSurfaceCollection.h ${CMAKE_CURRENT_LIST_DIR}/RimcDataContainerDouble.h ${CMAKE_CURRENT_LIST_DIR}/RimcDataContainerString.h ${CMAKE_CURRENT_LIST_DIR}/RimcDataContainerTime.h +${CMAKE_CURRENT_LIST_DIR}/RimcWellLogPlotCollection.h +${CMAKE_CURRENT_LIST_DIR}/RimcWellLogPlot.cpp +${CMAKE_CURRENT_LIST_DIR}/RimcWellLogTrack.cpp ) set (SOURCE_GROUP_SOURCE_FILES @@ -29,6 +32,9 @@ ${CMAKE_CURRENT_LIST_DIR}/RimcSurfaceCollection.cpp ${CMAKE_CURRENT_LIST_DIR}/RimcDataContainerDouble.cpp ${CMAKE_CURRENT_LIST_DIR}/RimcDataContainerString.cpp ${CMAKE_CURRENT_LIST_DIR}/RimcDataContainerTime.cpp +${CMAKE_CURRENT_LIST_DIR}/RimcWellLogPlotCollection.cpp +${CMAKE_CURRENT_LIST_DIR}/RimcWellLogPlot.cpp +${CMAKE_CURRENT_LIST_DIR}/RimcWellLogTrack.cpp ) list(APPEND CODE_HEADER_FILES diff --git a/ApplicationLibCode/ProjectDataModelCommands/RimcWellLogPlot.cpp b/ApplicationLibCode/ProjectDataModelCommands/RimcWellLogPlot.cpp new file mode 100644 index 0000000000..a65c3ea1f5 --- /dev/null +++ b/ApplicationLibCode/ProjectDataModelCommands/RimcWellLogPlot.cpp @@ -0,0 +1,97 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2021- Equinor ASA +// +// ResInsight is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// +#include "RimcWellLogPlot.h" + +#include "RiaApplication.h" +#include "RiaGuiApplication.h" + +#include "WellLogCommands/RicNewWellLogPlotFeatureImpl.h" + +#include "RimEclipseCase.h" +#include "RimProject.h" +#include "RimWellLogCurveCommonDataSource.h" +#include "RimWellLogExtractionCurve.h" +#include "RimWellLogPlot.h" +#include "RimWellLogPlotCollection.h" +#include "RimWellLogTrack.h" +#include "RimWellPath.h" + +#include "cafPdmAbstractFieldScriptingCapability.h" +#include "cafPdmFieldScriptingCapability.h" + +CAF_PDM_OBJECT_METHOD_SOURCE_INIT( RimWellLogPlot, RimcWellLogPlot_newWellLogTrack, "NewWellLogTrack" ); + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RimcWellLogPlot_newWellLogTrack::RimcWellLogPlot_newWellLogTrack( caf::PdmObjectHandle* self ) + : caf::PdmObjectMethod( self ) +{ + CAF_PDM_InitObject( "Create Well Log Track", "", "", "Create a new well log track" ); + CAF_PDM_InitScriptableFieldNoDefault( &m_title, "Title", "", "", "", "Title" ); + CAF_PDM_InitScriptableFieldNoDefault( &m_case, "Case", "", "", "", "Case" ); + CAF_PDM_InitScriptableFieldNoDefault( &m_wellPath, "WellPath", "", "", "", "Well Path" ); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +caf::PdmObjectHandle* RimcWellLogPlot_newWellLogTrack::execute() +{ + RimWellLogPlot* wellLogPlot = self(); + + // Make sure the plot window is created + RiaGuiApplication::instance()->getOrCreateMainPlotWindow(); + + if ( !wellLogPlot ) return nullptr; + + RimWellLogTrack* plotTrack = RicNewWellLogPlotFeatureImpl::createWellLogPlotTrack( false, m_title, wellLogPlot ); + if ( m_case() ) plotTrack->setFormationCase( m_case ); + if ( m_wellPath() ) plotTrack->setFormationWellPath( m_wellPath ); + plotTrack->setColSpan( RimPlot::TWO ); + plotTrack->setLegendsVisible( true ); + plotTrack->setPlotTitleVisible( true ); + plotTrack->setShowWindow( true ); + plotTrack->setXAxisGridVisibility( RimWellLogPlot::AXIS_GRID_MAJOR ); + plotTrack->setShowRegionLabels( true ); + plotTrack->setAutoScaleXEnabled( true ); + plotTrack->updateConnectedEditors(); + wellLogPlot->setShowWindow( true ); + wellLogPlot->updateConnectedEditors(); + + RiaApplication::instance()->project()->updateConnectedEditors(); + + wellLogPlot->loadDataAndUpdate(); + return plotTrack; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +bool RimcWellLogPlot_newWellLogTrack::resultIsPersistent() const +{ + return true; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +std::unique_ptr RimcWellLogPlot_newWellLogTrack::defaultResult() const +{ + return std::unique_ptr( new RimWellLogTrack ); +} diff --git a/ApplicationLibCode/ProjectDataModelCommands/RimcWellLogPlot.h b/ApplicationLibCode/ProjectDataModelCommands/RimcWellLogPlot.h new file mode 100644 index 0000000000..b480a1c653 --- /dev/null +++ b/ApplicationLibCode/ProjectDataModelCommands/RimcWellLogPlot.h @@ -0,0 +1,50 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2021- Equinor ASA +// +// ResInsight is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// + +#pragma once + +#include "RimWellLogPlot.h" + +#include "cafPdmField.h" +#include "cafPdmObjectHandle.h" +#include "cafPdmObjectMethod.h" +#include "cafPdmPtrArrayField.h" +#include "cafPdmPtrField.h" + +class RimEclipseCase; +class RimWellPath; + +//================================================================================================== +/// +//================================================================================================== +class RimcWellLogPlot_newWellLogTrack : public caf::PdmObjectMethod +{ + CAF_PDM_HEADER_INIT; + +public: + RimcWellLogPlot_newWellLogTrack( caf::PdmObjectHandle* self ); + + caf::PdmObjectHandle* execute() override; + bool resultIsPersistent() const override; + std::unique_ptr defaultResult() const override; + +private: + caf::PdmField m_title; + caf::PdmPtrField m_case; + caf::PdmPtrField m_wellPath; +}; diff --git a/ApplicationLibCode/ProjectDataModelCommands/RimcWellLogPlotCollection.cpp b/ApplicationLibCode/ProjectDataModelCommands/RimcWellLogPlotCollection.cpp new file mode 100644 index 0000000000..58c9c6c96d --- /dev/null +++ b/ApplicationLibCode/ProjectDataModelCommands/RimcWellLogPlotCollection.cpp @@ -0,0 +1,95 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2021- Equinor ASA +// +// ResInsight is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// +#include "RimcWellLogPlotCollection.h" + +#include "RiaApplication.h" +#include "RiaGuiApplication.h" + +#include "WellLogCommands/RicNewWellLogPlotFeatureImpl.h" + +#include "RimEclipseCase.h" +#include "RimProject.h" +#include "RimWellLogCurveCommonDataSource.h" +#include "RimWellLogExtractionCurve.h" +#include "RimWellLogPlot.h" +#include "RimWellLogPlotCollection.h" +#include "RimWellLogTrack.h" +#include "RimWellPath.h" + +#include "cafPdmAbstractFieldScriptingCapability.h" +#include "cafPdmFieldScriptingCapability.h" + +CAF_PDM_OBJECT_METHOD_SOURCE_INIT( RimWellLogPlotCollection, RimcWellLogPlotCollection_newWellLogPlot, "NewWellLogPlot" ); + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RimcWellLogPlotCollection_newWellLogPlot::RimcWellLogPlotCollection_newWellLogPlot( caf::PdmObjectHandle* self ) + : caf::PdmObjectMethod( self ) +{ + CAF_PDM_InitObject( "Create Well Log Plot", "", "", "Create a new well log plot" ); + CAF_PDM_InitScriptableFieldNoDefault( &m_case, "Case", "", "", "", "Case" ); + CAF_PDM_InitScriptableFieldNoDefault( &m_wellPath, "WellPath", "", "", "", "Well Path" ); + + CAF_PDM_InitScriptableFieldNoDefault( &m_propertyType, "PropertyType", "", "", "", "Property Type" ); + CAF_PDM_InitScriptableFieldNoDefault( &m_propertyName, "PropertyName", "", "", "", "Property Name" ); + CAF_PDM_InitScriptableFieldNoDefault( &m_timeStep, "TimeStep", "", "", "", "Time Step" ); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +caf::PdmObjectHandle* RimcWellLogPlotCollection_newWellLogPlot::execute() +{ + RimWellLogPlot* newWellLogPlot = nullptr; + RimWellLogPlotCollection* wellLogPlotCollection = self(); + + // Make sure the plot window is created + RiaGuiApplication::instance()->getOrCreateMainPlotWindow(); + + if ( m_case && m_wellPath && wellLogPlotCollection ) + { + newWellLogPlot = new RimWellLogPlot; + newWellLogPlot->setAsPlotMdiWindow(); + + wellLogPlotCollection->addWellLogPlot( newWellLogPlot ); + + newWellLogPlot->commonDataSource()->setCaseToApply( m_case ); + newWellLogPlot->commonDataSource()->setWellPathToApply( m_wellPath ); + newWellLogPlot->loadDataAndUpdate(); + newWellLogPlot->updateConnectedEditors(); + } + + return newWellLogPlot; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +bool RimcWellLogPlotCollection_newWellLogPlot::resultIsPersistent() const +{ + return true; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +std::unique_ptr RimcWellLogPlotCollection_newWellLogPlot::defaultResult() const +{ + return std::unique_ptr( new RimWellLogPlot ); +} diff --git a/ApplicationLibCode/ProjectDataModelCommands/RimcWellLogPlotCollection.h b/ApplicationLibCode/ProjectDataModelCommands/RimcWellLogPlotCollection.h new file mode 100644 index 0000000000..0480c13300 --- /dev/null +++ b/ApplicationLibCode/ProjectDataModelCommands/RimcWellLogPlotCollection.h @@ -0,0 +1,51 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2021- Equinor ASA +// +// ResInsight is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// + +#pragma once + +#include "RimWellLogPlotCollection.h" + +#include "cafPdmField.h" +#include "cafPdmObjectHandle.h" +#include "cafPdmObjectMethod.h" +#include "cafPdmPtrArrayField.h" +#include "cafPdmPtrField.h" + +class RimStimPlanModel; + +//================================================================================================== +/// +//================================================================================================== +class RimcWellLogPlotCollection_newWellLogPlot : public caf::PdmObjectMethod +{ + CAF_PDM_HEADER_INIT; + +public: + RimcWellLogPlotCollection_newWellLogPlot( caf::PdmObjectHandle* self ); + + caf::PdmObjectHandle* execute() override; + bool resultIsPersistent() const override; + std::unique_ptr defaultResult() const override; + +private: + caf::PdmPtrField m_case; + caf::PdmPtrField m_wellPath; + caf::PdmField m_propertyType; + caf::PdmField m_propertyName; + caf::PdmField m_timeStep; +}; diff --git a/ApplicationLibCode/ProjectDataModelCommands/RimcWellLogTrack.cpp b/ApplicationLibCode/ProjectDataModelCommands/RimcWellLogTrack.cpp new file mode 100644 index 0000000000..21378e5ce3 --- /dev/null +++ b/ApplicationLibCode/ProjectDataModelCommands/RimcWellLogTrack.cpp @@ -0,0 +1,109 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2021- Equinor ASA +// +// ResInsight is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// +#include "RimcWellLogTrack.h" + +#include "RiaApplication.h" +#include "RiaGuiApplication.h" + +#include "WellLogCommands/RicNewWellLogPlotFeatureImpl.h" + +#include "RimEclipseCase.h" +#include "RimProject.h" +#include "RimWellLogCurveCommonDataSource.h" +#include "RimWellLogExtractionCurve.h" +#include "RimWellLogPlot.h" +#include "RimWellLogTrack.h" +#include "RimWellPath.h" + +#include "cafPdmAbstractFieldScriptingCapability.h" +#include "cafPdmFieldScriptingCapability.h" + +CAF_PDM_OBJECT_METHOD_SOURCE_INIT( RimWellLogTrack, RimcWellLogTrack_addExtractionCurve, "AddExtractionCurve" ); + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RimcWellLogTrack_addExtractionCurve::RimcWellLogTrack_addExtractionCurve( caf::PdmObjectHandle* self ) + : caf::PdmObjectMethod( self ) +{ + CAF_PDM_InitObject( "Create Well Log Extraction Curve", "", "", "Create a well log extraction curve" ); + CAF_PDM_InitScriptableFieldNoDefault( &m_case, "Case", "", "", "", "Case" ); + CAF_PDM_InitScriptableFieldNoDefault( &m_wellPath, "WellPath", "", "", "", "Well Path" ); + CAF_PDM_InitScriptableFieldNoDefault( &m_propertyType, "PropertyType", "", "", "", "Property Type" ); + CAF_PDM_InitScriptableFieldNoDefault( &m_propertyName, "PropertyName", "", "", "", "Property Name" ); + CAF_PDM_InitScriptableFieldNoDefault( &m_timeStep, "TimeStep", "", "", "", "Time Step" ); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +caf::PdmObjectHandle* RimcWellLogTrack_addExtractionCurve::execute() +{ + RimWellLogTrack* wellLogTrack = self(); + + // Make sure the plot window is created + RiaGuiApplication::instance()->getOrCreateMainPlotWindow(); + + if ( m_case && m_wellPath && wellLogTrack ) + { + RimWellLogExtractionCurve* curve = new RimWellLogExtractionCurve; + curve->setWellPath( m_wellPath ); + curve->setCase( m_case ); + curve->setCurrentTimeStep( m_timeStep ); + curve->setEclipseResultVariable( m_propertyName ); + + RiaDefines::ResultCatType resultCategoryType = caf::AppEnum::fromText( m_propertyType ); + curve->setEclipseResultCategory( resultCategoryType ); + + wellLogTrack->addCurve( curve ); + curve->loadDataAndUpdate( true ); + + curve->updateConnectedEditors(); + + wellLogTrack->setXAxisGridVisibility( RimWellLogPlot::AXIS_GRID_MAJOR ); + wellLogTrack->setShowRegionLabels( true ); + wellLogTrack->setAutoScaleXEnabled( true ); + wellLogTrack->updateConnectedEditors(); + wellLogTrack->setShowWindow( true ); + + RiaApplication::instance()->project()->updateConnectedEditors(); + + RimWellLogPlot* wellLogPlot = dynamic_cast( wellLogTrack->parentField() ); + if ( wellLogPlot ) wellLogPlot->loadDataAndUpdate(); + + return curve; + } + + return nullptr; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +bool RimcWellLogTrack_addExtractionCurve::resultIsPersistent() const +{ + return true; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +std::unique_ptr RimcWellLogTrack_addExtractionCurve::defaultResult() const +{ + return std::unique_ptr( new RimWellLogExtractionCurve ); +} diff --git a/ApplicationLibCode/ProjectDataModelCommands/RimcWellLogTrack.h b/ApplicationLibCode/ProjectDataModelCommands/RimcWellLogTrack.h new file mode 100644 index 0000000000..70dc049952 --- /dev/null +++ b/ApplicationLibCode/ProjectDataModelCommands/RimcWellLogTrack.h @@ -0,0 +1,51 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2021- Equinor ASA +// +// ResInsight is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// + +#pragma once + +#include "cafPdmField.h" +#include "cafPdmObjectHandle.h" +#include "cafPdmObjectMethod.h" +#include "cafPdmPtrArrayField.h" +#include "cafPdmPtrField.h" + +class RimEclipseCase; +class RimWellPath; +class RimWellLogTrack; + +//================================================================================================== +/// +//================================================================================================== +class RimcWellLogTrack_addExtractionCurve : public caf::PdmObjectMethod +{ + CAF_PDM_HEADER_INIT; + +public: + RimcWellLogTrack_addExtractionCurve( caf::PdmObjectHandle* self ); + + caf::PdmObjectHandle* execute() override; + bool resultIsPersistent() const override; + std::unique_ptr defaultResult() const override; + +private: + caf::PdmPtrField m_case; + caf::PdmPtrField m_wellPath; + caf::PdmField m_propertyType; + caf::PdmField m_propertyName; + caf::PdmField m_timeStep; +}; diff --git a/GrpcInterface/Python/rips/PythonExamples/generate_ensemble_of_well_logs.py b/GrpcInterface/Python/rips/PythonExamples/generate_ensemble_of_well_logs.py new file mode 100644 index 0000000000..c1c03b05e5 --- /dev/null +++ b/GrpcInterface/Python/rips/PythonExamples/generate_ensemble_of_well_logs.py @@ -0,0 +1,79 @@ +# Load ResInsight Processing Server Client Library +import rips +import tempfile +from os.path import expanduser +from pathlib import Path + +# Connect to ResInsight instance +resinsight = rips.Instance.find() + + +home_dir = expanduser("~") + + +properties = [("STATIC_NATIVE", "PORO", 0), ("DYNAMIC_NATIVE", "PRESSURE", 0)] + +export_folder = tempfile.mkdtemp() + +directory_path = "resprojects/webviz-subsurface-testdata/reek_history_match/" + + +case_file_paths = [] +num_realizations = 9 +num_iterations = 4 + + +for realization in range(0, num_realizations): + for iteration in range(0, num_iterations): + realization_dir = "realization-" + str(realization) + iteration_dir = "iter-" + str(iteration) + egrid_name = "eclipse/model/5_R001_REEK-" + str(realization) + ".EGRID" + path = Path( + home_dir, directory_path, realization_dir, iteration_dir, egrid_name + ) + case_file_paths.append(path) + +for path in case_file_paths: + # Load a case + path_name = path.as_posix() + case = resinsight.project.load_case(path_name) + + # Load some wells + well_paths = resinsight.project.import_well_paths( + well_path_files=[ + Path(home_dir, directory_path, "wellpaths", "Well-1.dev").as_posix(), + Path(home_dir, directory_path, "wellpaths", "Well-2.dev").as_posix(), + ] + ) + + if resinsight.project.has_warnings(): + for warning in resinsight.project.warnings(): + print(warning) + + well_log_plot_collection = resinsight.project.descendants( + rips.WellLogPlotCollection + )[0] + + for well_path in well_paths: + print( + "Generating las file for well: " + well_path.name + " in case: " + path_name + ) + + well_log_plot = well_log_plot_collection.new_well_log_plot(case, well_path) + + # Create a track for each property + for (prop_type, prop_name, time_step) in properties: + track = well_log_plot.new_well_log_track( + "Track: " + prop_name, case, well_path + ) + + c = track.add_extraction_curve( + case, well_path, prop_type, prop_name, time_step + ) + + parent_path = path.parent + export_folder_path = Path(parent_path, "lasexport") + export_folder_path.mkdir(parents=True, exist_ok=True) + + export_folder = export_folder_path.as_posix() + well_log_plot.export_data_as_las(export_folder=export_folder) From 7f99a9561b49bbad05d1c3b1746359fefc96e92d Mon Sep 17 00:00:00 2001 From: Kristian Bendiksen Date: Fri, 25 Jun 2021 10:42:14 +0200 Subject: [PATCH 020/308] Stim Plan Model: warn and handle error instead of assert. --- .../RimStimPlanModelPressureCalculator.cpp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/ApplicationLibCode/ProjectDataModel/StimPlanModel/RimStimPlanModelPressureCalculator.cpp b/ApplicationLibCode/ProjectDataModel/StimPlanModel/RimStimPlanModelPressureCalculator.cpp index 649e389d12..8eab611db3 100644 --- a/ApplicationLibCode/ProjectDataModel/StimPlanModel/RimStimPlanModelPressureCalculator.cpp +++ b/ApplicationLibCode/ProjectDataModel/StimPlanModel/RimStimPlanModelPressureCalculator.cpp @@ -612,7 +612,13 @@ bool RimStimPlanModelPressureCalculator::interpolateInitialPressureByEquilibrati } // EQLNUM data has values for over/underburden, but the pressure values does not. - CAF_ASSERT( eqlNumValues.size() == ( values.size() + 4 ) ); + if ( eqlNumValues.size() != ( values.size() + 4 ) ) + { + RiaLogging::error( QString( "Failed to build EQLNUM pressure data: result length mismatch." ) ); + RiaLogging::error( + QString( "EQLNUM length: %1 PRESSURE length: %2" ).arg( eqlNumValues.size() ).arg( values.size() ) ); + return false; + } size_t overburdenOffset = 2; for ( size_t i = 0; i < values.size(); i++ ) @@ -676,7 +682,13 @@ bool RimStimPlanModelPressureCalculator::interpolatePressureDifferenceByEquilibr values.resize( initialPressureValues.size(), std::numeric_limits::infinity() ); // EQLNUM data has values for over/underburden, but the pressure values does not. - CAF_ASSERT( eqlNumValues.size() == ( values.size() + 4 ) ); + if ( eqlNumValues.size() != ( values.size() + 4 ) ) + { + RiaLogging::error( QString( "Failed to build EQLNUM pressure data: result length mismatch." ) ); + RiaLogging::error( + QString( "EQLNUM length: %1 PRESSURE length: %2" ).arg( eqlNumValues.size() ).arg( values.size() ) ); + return false; + } size_t overburdenOffset = 2; for ( size_t i = 0; i < values.size(); i++ ) From aa2b4305de3c84d76a94bd30069b34803378adb7 Mon Sep 17 00:00:00 2001 From: jonjenssen <69144954+jonjenssen@users.noreply.github.com> Date: Wed, 16 Jun 2021 17:31:25 +0200 Subject: [PATCH 021/308] Improve handling of LGRs in cell filters (#7783) * Improve handling of LGRs in cell filters --- .../RicNewRangeFilterSlice3dviewFeature.cpp | 3 +- .../RicNewRangeFilterSliceFeature.cpp | 3 +- .../RicAdvancedSnapshotExportFeature.cpp | 3 +- .../CellFilters/RimCellFilter.cpp | 1 - .../CellFilters/RimCellFilter.h | 2 +- .../CellFilters/RimCellFilterCollection.cpp | 10 +- .../CellFilters/RimCellFilterCollection.h | 7 +- .../CellFilters/RimCellRangeFilter.cpp | 8 +- .../CellFilters/RimCellRangeFilter.h | 2 +- .../CellFilters/RimPolygonFilter.cpp | 177 ++++++++++++------ .../CellFilters/RimPolygonFilter.h | 14 +- .../CellFilters/RimPropertyFilter.h | 2 +- .../CellFilters/RimUserDefinedFilter.cpp | 6 +- .../CellFilters/RimUserDefinedFilter.h | 2 +- .../ReservoirDataModel/RigCell.cpp | 6 +- 15 files changed, 163 insertions(+), 83 deletions(-) diff --git a/ApplicationLibCode/Commands/CellFilterCommands/RicNewRangeFilterSlice3dviewFeature.cpp b/ApplicationLibCode/Commands/CellFilterCommands/RicNewRangeFilterSlice3dviewFeature.cpp index 65be153cb4..b9f79b1e0c 100644 --- a/ApplicationLibCode/Commands/CellFilterCommands/RicNewRangeFilterSlice3dviewFeature.cpp +++ b/ApplicationLibCode/Commands/CellFilterCommands/RicNewRangeFilterSlice3dviewFeature.cpp @@ -72,10 +72,9 @@ void RicNewRangeFilterSlice3dviewFeature::onActionTriggered( bool isChecked ) int sliceStart = list[1].toInt(); int gridIndex = list[2].toInt(); - RimCellFilter* newFilter = filtColl->addNewCellRangeFilter( sourceCase, direction, sliceStart ); + RimCellFilter* newFilter = filtColl->addNewCellRangeFilter( sourceCase, gridIndex, direction, sliceStart ); if ( newFilter ) { - newFilter->setGridIndex( gridIndex ); Riu3DMainWindowTools::selectAsCurrentItem( newFilter ); activeView->setSurfaceDrawstyle(); } diff --git a/ApplicationLibCode/Commands/CellFilterCommands/RicNewRangeFilterSliceFeature.cpp b/ApplicationLibCode/Commands/CellFilterCommands/RicNewRangeFilterSliceFeature.cpp index 97d5c61769..7995bf3360 100644 --- a/ApplicationLibCode/Commands/CellFilterCommands/RicNewRangeFilterSliceFeature.cpp +++ b/ApplicationLibCode/Commands/CellFilterCommands/RicNewRangeFilterSliceFeature.cpp @@ -56,7 +56,8 @@ void RicNewRangeFilterSliceFeature::onActionTriggered( bool isChecked ) RimCase* sourceCase = nullptr; filtColl->firstAncestorOrThisOfTypeAsserted( sourceCase ); - RimCellFilter* lastCreatedOrUpdated = filtColl->addNewCellRangeFilter( sourceCase, m_sliceDirection ); + int gridIndex = 0; + RimCellFilter* lastCreatedOrUpdated = filtColl->addNewCellRangeFilter( sourceCase, gridIndex, m_sliceDirection ); if ( lastCreatedOrUpdated ) { Riu3DMainWindowTools::selectAsCurrentItem( lastCreatedOrUpdated ); diff --git a/ApplicationLibCode/Commands/ExportCommands/RicAdvancedSnapshotExportFeature.cpp b/ApplicationLibCode/Commands/ExportCommands/RicAdvancedSnapshotExportFeature.cpp index ae5a63373c..2fc2cf3946 100644 --- a/ApplicationLibCode/Commands/ExportCommands/RicAdvancedSnapshotExportFeature.cpp +++ b/ApplicationLibCode/Commands/ExportCommands/RicAdvancedSnapshotExportFeature.cpp @@ -262,7 +262,8 @@ void RicAdvancedSnapshotExportFeature::exportViewVariationsToFolder( RimGridView } else { - RimCellRangeFilter* rangeFilter = rimView->cellFilterCollection()->addNewCellRangeFilter( rimCase ); + int gridIndex = 0; + RimCellRangeFilter* rangeFilter = rimView->cellFilterCollection()->addNewCellRangeFilter( rimCase, gridIndex ); bool rangeFilterInitState = rimView->cellFilterCollection()->isActive(); rimView->cellFilterCollection()->setActive( true ); diff --git a/ApplicationLibCode/ProjectDataModel/CellFilters/RimCellFilter.cpp b/ApplicationLibCode/ProjectDataModel/CellFilters/RimCellFilter.cpp index ea330c5e6b..d213bd93a7 100644 --- a/ApplicationLibCode/ProjectDataModel/CellFilters/RimCellFilter.cpp +++ b/ApplicationLibCode/ProjectDataModel/CellFilters/RimCellFilter.cpp @@ -210,7 +210,6 @@ void RimCellFilter::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& auto group = uiOrdering.addNewGroup( "General" ); group->add( &m_filterMode ); group->add( &m_gridIndex ); - group->add( &m_propagateToSubGrids ); bool readOnlyState = isFilterControlled(); diff --git a/ApplicationLibCode/ProjectDataModel/CellFilters/RimCellFilter.h b/ApplicationLibCode/ProjectDataModel/CellFilters/RimCellFilter.h index e90026aa61..3760c30ad0 100644 --- a/ApplicationLibCode/ProjectDataModel/CellFilters/RimCellFilter.h +++ b/ApplicationLibCode/ProjectDataModel/CellFilters/RimCellFilter.h @@ -69,7 +69,7 @@ class RimCellFilter : public caf::PdmObject void updateIconState(); void updateActiveState( bool isControlled ); - virtual void updateCompundFilter( cvf::CellRangeFilter* cellRangeFilter ) = 0; + virtual void updateCompundFilter( cvf::CellRangeFilter* cellRangeFilter, int gridIndex ) = 0; virtual QString fullName() const; protected: diff --git a/ApplicationLibCode/ProjectDataModel/CellFilters/RimCellFilterCollection.cpp b/ApplicationLibCode/ProjectDataModel/CellFilters/RimCellFilterCollection.cpp index 6dcf3068e9..40759a2580 100644 --- a/ApplicationLibCode/ProjectDataModel/CellFilters/RimCellFilterCollection.cpp +++ b/ApplicationLibCode/ProjectDataModel/CellFilters/RimCellFilterCollection.cpp @@ -263,10 +263,12 @@ RimUserDefinedFilter* RimCellFilterCollection::addNewUserDefinedFilter( RimCase* //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -RimCellRangeFilter* RimCellFilterCollection::addNewCellRangeFilter( RimCase* srcCase, int sliceDirection, int defaultSlice ) +RimCellRangeFilter* + RimCellFilterCollection::addNewCellRangeFilter( RimCase* srcCase, int gridIndex, int sliceDirection, int defaultSlice ) { RimCellRangeFilter* pFilter = new RimCellRangeFilter(); addFilter( pFilter ); + pFilter->setGridIndex( gridIndex ); pFilter->setDefaultValues( sliceDirection, defaultSlice ); onFilterUpdated( pFilter ); return pFilter; @@ -369,11 +371,13 @@ void RimCellFilterCollection::compoundCellRangeFilter( cvf::CellRangeFilter* cel { CVF_ASSERT( cellRangeFilter ); + int gIndx = static_cast( gridIndex ); + for ( RimCellFilter* filter : m_cellFilters ) { - if ( filter->isFilterEnabled() && static_cast( filter->gridIndex() ) == gridIndex ) + if ( filter->isFilterEnabled() ) { - filter->updateCompundFilter( cellRangeFilter ); + filter->updateCompundFilter( cellRangeFilter, gIndx ); } } } diff --git a/ApplicationLibCode/ProjectDataModel/CellFilters/RimCellFilterCollection.h b/ApplicationLibCode/ProjectDataModel/CellFilters/RimCellFilterCollection.h index 76d45ff75e..9cef295640 100644 --- a/ApplicationLibCode/ProjectDataModel/CellFilters/RimCellFilterCollection.h +++ b/ApplicationLibCode/ProjectDataModel/CellFilters/RimCellFilterCollection.h @@ -47,7 +47,8 @@ class RimCellFilterCollection : public caf::PdmObject RimPolygonFilter* addNewPolygonFilter( RimCase* srcCase ); RimUserDefinedFilter* addNewUserDefinedFilter( RimCase* srcCase ); - RimCellRangeFilter* addNewCellRangeFilter( RimCase* srcCase, int sliceDirection = -1, int defaultSlice = -1 ); + RimCellRangeFilter* + addNewCellRangeFilter( RimCase* srcCase, int gridIndex, int sliceDirection = -1, int defaultSlice = -1 ); void removeFilter( RimCellFilter* filter ); @@ -71,12 +72,12 @@ class RimCellFilterCollection : public caf::PdmObject void setCase( RimCase* theCase ); protected: - // Overridden methods void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) override; void defineUiTreeOrdering( caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName ) override; caf::PdmFieldHandle* objectToggleField() override; void initAfterRead() override; - void onFilterUpdated( const SignalEmitter* emitter ); + + void onFilterUpdated( const SignalEmitter* emitter ); private: void setAutoName( RimCellFilter* pFilter ); diff --git a/ApplicationLibCode/ProjectDataModel/CellFilters/RimCellRangeFilter.cpp b/ApplicationLibCode/ProjectDataModel/CellFilters/RimCellRangeFilter.cpp index 8144edca0a..daa3bbecb5 100644 --- a/ApplicationLibCode/ProjectDataModel/CellFilters/RimCellRangeFilter.cpp +++ b/ApplicationLibCode/ProjectDataModel/CellFilters/RimCellRangeFilter.cpp @@ -58,6 +58,8 @@ RimCellRangeFilter::RimCellRangeFilter() CAF_PDM_InitField( &cellCountK, "CellCountK", 1, "Cell Count K", "", "", "" ); cellCountK.uiCapability()->setUiEditorTypeName( caf::PdmUiSliderEditor::uiEditorTypeName() ); + m_propagateToSubGrids = true; + updateIconState(); setDeletable( true ); } @@ -265,6 +267,8 @@ void RimCellRangeFilter::defineUiOrdering( QString uiConfigName, caf::PdmUiOrder { RimCellFilter::defineUiOrdering( uiConfigName, uiOrdering ); + m_gridIndex.uiCapability()->setUiReadOnly( true ); + const cvf::StructGridInterface* grid = selectedGrid(); RimCase* rimCase = nullptr; @@ -332,10 +336,12 @@ void RimCellRangeFilter::defineUiTreeOrdering( caf::PdmUiTreeOrdering& uiTreeOrd //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -void RimCellRangeFilter::updateCompundFilter( cvf::CellRangeFilter* cellRangeFilter ) +void RimCellRangeFilter::updateCompundFilter( cvf::CellRangeFilter* cellRangeFilter, int gridIndex ) { CVF_ASSERT( cellRangeFilter ); + if ( gridIndex != m_gridIndex ) return; + if ( filterMode() == RimCellFilter::INCLUDE ) { cellRangeFilter->addCellIncludeRange( static_cast( startIndexI ) - 1, diff --git a/ApplicationLibCode/ProjectDataModel/CellFilters/RimCellRangeFilter.h b/ApplicationLibCode/ProjectDataModel/CellFilters/RimCellRangeFilter.h index 25028c478b..40d556c7d8 100644 --- a/ApplicationLibCode/ProjectDataModel/CellFilters/RimCellRangeFilter.h +++ b/ApplicationLibCode/ProjectDataModel/CellFilters/RimCellRangeFilter.h @@ -57,7 +57,7 @@ class RimCellRangeFilter : public RimCellFilter void setDefaultValues( int sliceDirection = -1, int defaultSlice = -1 ); - void updateCompundFilter( cvf::CellRangeFilter* cellRangeFilter ) override; + void updateCompundFilter( cvf::CellRangeFilter* cellRangeFilter, int gridIndex ) override; protected: void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) override; diff --git a/ApplicationLibCode/ProjectDataModel/CellFilters/RimPolygonFilter.cpp b/ApplicationLibCode/ProjectDataModel/CellFilters/RimPolygonFilter.cpp index efb04e63ca..67d97fe4f4 100644 --- a/ApplicationLibCode/ProjectDataModel/CellFilters/RimPolygonFilter.cpp +++ b/ApplicationLibCode/ProjectDataModel/CellFilters/RimPolygonFilter.cpp @@ -26,6 +26,7 @@ #include "RigGeoMechCaseData.h" #include "RigMainGrid.h" #include "RigPolyLinesData.h" +#include "RigReservoirGridTools.h" #include "Rim3dView.h" #include "RimCase.h" @@ -161,6 +162,8 @@ RimPolygonFilter::RimPolygonFilter() this->setUi3dEditorTypeName( RicPolyline3dEditor::uiEditorTypeName() ); this->uiCapability()->setUiTreeChildrenHidden( true ); + m_propagateToSubGrids = false; + updateIconState(); setDeletable( true ); } @@ -237,7 +240,12 @@ QString RimPolygonFilter::fullName() const { if ( m_enableFiltering ) { - return QString( "%1 [%2 cells]" ).arg( RimCellFilter::fullName(), QString::number( m_cells.size() ) ); + int cells = 0; + for ( const auto& item : m_cells ) + { + cells += (int)item.size(); + } + return QString( "%1 [%2 cells]" ).arg( RimCellFilter::fullName(), QString::number( cells ) ); } return QString( "%1 [off]" ).arg( RimCellFilter::fullName() ); } @@ -399,8 +407,6 @@ void RimPolygonFilter::defineUiOrdering( QString uiConfigName, caf::PdmUiOrderin auto group3 = uiOrdering.addNewGroup( "Advanced Filter Settings" ); group3->add( &m_enableKFilter ); group3->add( &m_kFilterStr ); - group3->add( &m_gridIndex ); - group3->add( &m_propagateToSubGrids ); group3->setCollapsedByDefault( true ); uiOrdering.skipRemainingFields( true ); @@ -468,18 +474,24 @@ caf::PickEventHandler* RimPolygonFilter::pickEventHandler() const //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -void RimPolygonFilter::updateCompundFilter( cvf::CellRangeFilter* cellRangeFilter ) +void RimPolygonFilter::updateCompundFilter( cvf::CellRangeFilter* cellRangeFilter, int gridIndex ) { CVF_ASSERT( cellRangeFilter ); if ( !m_enableFiltering ) return; - if ( m_cells.size() == 0 ) updateCells(); + const int noofgrids = static_cast( m_cells.size() ); + if ( ( noofgrids == 0 ) || ( gridIndex >= noofgrids ) ) + { + updateCells(); + } + + if ( gridIndex >= static_cast( m_cells.size() ) ) return; - const auto grid = selectedGrid(); + const auto grid = RigReservoirGridTools::gridByIndex( m_srcCase, gridIndex ); size_t i, j, k; - for ( size_t cellidx : m_cells ) + for ( size_t cellidx : m_cells[gridIndex] ) { grid->ijkFromCellIndex( cellidx, &i, &j, &k ); if ( this->filterMode() == RimCellFilter::INCLUDE ) @@ -531,14 +543,15 @@ bool RimPolygonFilter::cellInsidePolygon2D( cvf::Vec3d center, return bInside; } -void RimPolygonFilter::updateCellsDepthEclipse( const std::vector& points, const RigMainGrid* grid ) +void RimPolygonFilter::updateCellsDepthEclipse( const std::vector& points, const RigGridBase* grid ) { // we should look in depth using Z coordinate + const int gIdx = static_cast( grid->gridIndex() ); // loop over all cells for ( size_t n = 0; n < grid->cellCount(); n++ ) { // valid cell? - RigCell cell = grid->cellByGridAndGridLocalCellIdx( gridIndex(), n ); + RigCell cell = grid->cell( n ); if ( cell.isInvalid() ) continue; // get corner coordinates @@ -553,7 +566,7 @@ void RimPolygonFilter::updateCellsDepthEclipse( const std::vector& p // check if the polygon includes the cell if ( cellInsidePolygon2D( cell.center(), hexCorners, points ) ) { - m_cells.push_back( n ); + m_cells[gIdx].push_back( n ); } } } @@ -564,50 +577,19 @@ void RimPolygonFilter::updateCellsDepthEclipse( const std::vector& p // 2. find all cells in this K layer that matches the selection criteria // 3. extend those cells to all K layers //-------------------------------------------------------------------------------------------------- -void RimPolygonFilter::updateCellsKIndexEclipse( const std::vector& points, const RigMainGrid* grid ) +void RimPolygonFilter::updateCellsKIndexEclipse( const std::vector& points, const RigGridBase* grid, int K ) { - // we need to find the K layer we hit with the first point - size_t ni, nj, nk; - // move the point a bit downwards to make sure it is inside something - cvf::Vec3d point = points[0]; - point.z() += 0.2; - - bool cellFound = false; - - // loop over all points to find at least one point with a valid K layer - for ( size_t p = 0; p < points.size() - 1; p++ ) - { - // loop over all cells to find the correct one - for ( size_t i = 0; i < grid->cellCount(); i++ ) - { - // valid cell? - RigCell cell = grid->cellByGridAndGridLocalCellIdx( gridIndex(), i ); - if ( cell.isInvalid() ) continue; - - // is the point inside? - cvf::BoundingBox bb = cell.boundingBox(); - if ( !bb.contains( points[p] ) ) continue; - - // found the cell, get the IJK - grid->ijkFromCellIndexUnguarded( cell.mainGridCellIndex(), &ni, &nj, &nk ); - cellFound = true; - break; - } - if ( cellFound ) break; - } - - // should not really happen, but just to be sure - if ( !cellFound ) return; + const int gIdx = static_cast( grid->gridIndex() ); std::list foundCells; - // find all cells in this K layer that matches the polygon + // find all cells in the K layer that matches the polygon for ( size_t i = 0; i < grid->cellCountI(); i++ ) { for ( size_t j = 0; j < grid->cellCountJ(); j++ ) { - size_t cellIdx = grid->cellIndexFromIJK( i, j, nk ); - RigCell cell = grid->cellByGridAndGridLocalCellIdx( gridIndex(), cellIdx ); + size_t cellIdx = grid->cellIndexFromIJK( i, j, K ); + RigCell cell = grid->cell( cellIdx ); // valid cell? if ( cell.isInvalid() ) continue; @@ -636,10 +618,10 @@ void RimPolygonFilter::updateCellsKIndexEclipse( const std::vector& // get the cell index size_t newIdx = grid->cellIndexFromIJK( ci, cj, k ); // valid cell? - RigCell cell = grid->cellByGridAndGridLocalCellIdx( gridIndex(), newIdx ); + RigCell cell = grid->cell( newIdx ); if ( cell.isInvalid() ) continue; - m_cells.push_back( newIdx ); + m_cells[gIdx].push_back( newIdx ); } } } @@ -652,16 +634,24 @@ void RimPolygonFilter::updateCellsForEclipse( const std::vector& poi RigEclipseCaseData* data = eCase->eclipseCaseData(); if ( !data ) return; - RigMainGrid* grid = data->mainGrid(); - if ( !grid ) return; - if ( m_polyFilterMode == PolygonFilterModeType::DEPTH_Z ) { - updateCellsDepthEclipse( points, grid ); + for ( size_t gridIndex = 0; gridIndex < data->gridCount(); gridIndex++ ) + { + auto grid = data->grid( gridIndex ); + updateCellsDepthEclipse( points, grid ); + } } else if ( m_polyFilterMode == PolygonFilterModeType::INDEX_K ) { - updateCellsKIndexEclipse( points, grid ); + int K = findEclipseKLayer( points, data ); + if ( K < 0 ) return; + + for ( size_t gridIndex = 0; gridIndex < data->gridCount(); gridIndex++ ) + { + auto grid = data->grid( gridIndex ); + updateCellsKIndexEclipse( points, grid, K ); + } } } @@ -693,7 +683,7 @@ void RimPolygonFilter::updateCellsDepthGeoMech( const std::vector& p // check if the polygon includes the cell if ( cellInsidePolygon2D( center, corners, points ) ) { - m_cells.push_back( cellIdx ); + m_cells[0].push_back( cellIdx ); } } } @@ -787,7 +777,7 @@ void RimPolygonFilter::updateCellsKIndexGeoMech( const std::vector& // get the cell index size_t newIdx = grid->cellIndexFromIJK( ci, cj, k ); - m_cells.push_back( newIdx ); + m_cells[0].push_back( newIdx ); } } } @@ -813,12 +803,12 @@ void RimPolygonFilter::updateCellsForGeoMech( const std::vector& poi } //-------------------------------------------------------------------------------------------------- -/// Update the cell index list with the cells that are inside our polygon, if any +/// Update the cell index map with the cells that are inside our polygon, if any //-------------------------------------------------------------------------------------------------- void RimPolygonFilter::updateCells() { - // reset - m_cells.clear(); + // reset cell map for all grids + initializeCellList(); // get optional k-cell filter m_intervalTool.setInterval( m_enableKFilter, m_kFilterStr ); @@ -833,7 +823,7 @@ void RimPolygonFilter::updateCells() // We need at least three points to make a sensible polygon if ( points.size() < 3 ) return; - // make sure first and last point is the same (req. by polygon methods later) + // make sure first and last point is the same (req. by polygon methods used later) points.push_back( points.front() ); RimEclipseCase* eCase = dynamic_cast( m_srcCase() ); @@ -877,3 +867,72 @@ cvf::ref RimPolygonFilter::polyLinesData() const return pld; } + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimPolygonFilter::initializeCellList() +{ + m_cells.clear(); + + int gridCount = RigReservoirGridTools::gridCount( m_srcCase() ); + for ( int i = 0; i < gridCount; i++ ) + { + m_cells.push_back( std::vector() ); + } +} + +//-------------------------------------------------------------------------------------------------- +/// Find which K layer we hit, in any of the grids, for any of the selected points +//-------------------------------------------------------------------------------------------------- +int RimPolygonFilter::findEclipseKLayer( const std::vector& points, RigEclipseCaseData* data ) +{ + size_t ni, nj, nk; + + // look for a hit in the main grid frist + RigMainGrid* mainGrid = data->mainGrid(); + for ( size_t p = 0; p < points.size() - 1; p++ ) + { + size_t cIdx = mainGrid->findReservoirCellIndexFromPoint( points[p] ); + if ( cIdx != cvf::UNDEFINED_SIZE_T ) + { + mainGrid->ijkFromCellIndexUnguarded( cIdx, &ni, &nj, &nk ); + if ( mainGrid->isCellValid( ni, nj, nk ) ) return static_cast( nk ); + } + } + + // loop over all sub-grids to find one with a cell hit in case main grid search failed + for ( size_t gridIndex = 1; gridIndex < data->gridCount(); gridIndex++ ) + { + auto grid = data->grid( gridIndex ); + + // loop over all cells to find the correct one + for ( size_t i = 0; i < grid->cellCount(); i++ ) + { + // valid cell? + RigCell cell = grid->cell( i ); + if ( cell.isInvalid() ) continue; + + // is the point inside cell bb? + cvf::BoundingBox bb; + std::array hexCorners; + grid->cellCornerVertices( i, hexCorners.data() ); + for ( const auto& corner : hexCorners ) + { + bb.add( corner ); + } + + // loop over all points to find at least one point with a valid K layer + for ( size_t p = 0; p < points.size() - 1; p++ ) + { + if ( bb.contains( points[p] ) ) + { + // found the cell, get the IJK + grid->ijkFromCellIndexUnguarded( i, &ni, &nj, &nk ); + return static_cast( nk ); + } + } + } + } + return -1; +} diff --git a/ApplicationLibCode/ProjectDataModel/CellFilters/RimPolygonFilter.h b/ApplicationLibCode/ProjectDataModel/CellFilters/RimPolygonFilter.h index 7c7eb0f207..3fcd0df7b1 100644 --- a/ApplicationLibCode/ProjectDataModel/CellFilters/RimPolygonFilter.h +++ b/ApplicationLibCode/ProjectDataModel/CellFilters/RimPolygonFilter.h @@ -42,9 +42,11 @@ class RimPolylineTarget; class RimCase; class RimEclipseCase; class RimGeoMechCase; +class RigGridBase; class RigMainGrid; class RigFemPartGrid; class RigPolylinesData; +class RigEclipseCaseData; //================================================================================================== /// @@ -87,7 +89,7 @@ class RimPolygonFilter : public RimCellFilter, public RimPolylinePickerInterface bool pickingEnabled() const override; caf::PickEventHandler* pickEventHandler() const override; - void updateCompundFilter( cvf::CellRangeFilter* cellRangeFilter ) override; + void updateCompundFilter( cvf::CellRangeFilter* cellRangeFilter, int gridIndex ) override; cvf::ref polyLinesData() const override; @@ -108,13 +110,17 @@ class RimPolygonFilter : public RimCellFilter, public RimPolylinePickerInterface void updateCellsForEclipse( const std::vector& points, RimEclipseCase* eCase ); void updateCellsForGeoMech( const std::vector& points, RimGeoMechCase* gCase ); - void updateCellsDepthEclipse( const std::vector& points, const RigMainGrid* grid ); - void updateCellsKIndexEclipse( const std::vector& points, const RigMainGrid* grid ); + void updateCellsDepthEclipse( const std::vector& points, const RigGridBase* grid ); + void updateCellsKIndexEclipse( const std::vector& points, const RigGridBase* grid, int K ); + int findEclipseKLayer( const std::vector& points, RigEclipseCaseData* data ); + void updateCellsDepthGeoMech( const std::vector& points, const RigFemPartGrid* grid ); void updateCellsKIndexGeoMech( const std::vector& points, const RigFemPartGrid* grid ); bool cellInsidePolygon2D( cvf::Vec3d center, std::array& corners, std::vector polygon ); + void initializeCellList(); + caf::PdmField m_enablePicking; caf::PdmChildArrayField m_targets; caf::PdmField> m_polyFilterMode; @@ -134,7 +140,7 @@ class RimPolygonFilter : public RimCellFilter, public RimPolylinePickerInterface std::shared_ptr m_pickTargetsEventHandler; - std::list m_cells; + std::vector> m_cells; RimCellFilterIntervalTool m_intervalTool; }; diff --git a/ApplicationLibCode/ProjectDataModel/CellFilters/RimPropertyFilter.h b/ApplicationLibCode/ProjectDataModel/CellFilters/RimPropertyFilter.h index 55a081b9d0..4210a2eba0 100644 --- a/ApplicationLibCode/ProjectDataModel/CellFilters/RimPropertyFilter.h +++ b/ApplicationLibCode/ProjectDataModel/CellFilters/RimPropertyFilter.h @@ -34,7 +34,7 @@ class RimPropertyFilter : public RimCellFilter std::vector selectedCategoryValues() const; - void updateCompundFilter( cvf::CellRangeFilter* cellRangeFilter ) override{}; + void updateCompundFilter( cvf::CellRangeFilter* cellRangeFilter, int gridIndex ) override{}; protected: void setCategoryValues( const std::vector& categoryValues ); diff --git a/ApplicationLibCode/ProjectDataModel/CellFilters/RimUserDefinedFilter.cpp b/ApplicationLibCode/ProjectDataModel/CellFilters/RimUserDefinedFilter.cpp index 0dfa26e9d2..ee4c303716 100644 --- a/ApplicationLibCode/ProjectDataModel/CellFilters/RimUserDefinedFilter.cpp +++ b/ApplicationLibCode/ProjectDataModel/CellFilters/RimUserDefinedFilter.cpp @@ -35,6 +35,8 @@ RimUserDefinedFilter::RimUserDefinedFilter() "Use Ctrl-C for copy and Ctrl-V for paste", "" ); + m_propagateToSubGrids = true; + updateIconState(); setDeletable( true ); } @@ -85,10 +87,12 @@ void RimUserDefinedFilter::fieldChangedByUi( const caf::PdmFieldHandle* changedF //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -void RimUserDefinedFilter::updateCompundFilter( cvf::CellRangeFilter* cellRangeFilter ) +void RimUserDefinedFilter::updateCompundFilter( cvf::CellRangeFilter* cellRangeFilter, int gridIndex ) { CVF_ASSERT( cellRangeFilter ); + if ( gridIndex != m_gridIndex ) return; + if ( this->filterMode() == RimCellFilter::INCLUDE ) { for ( const auto& cellIndex : m_individualCellIndices() ) diff --git a/ApplicationLibCode/ProjectDataModel/CellFilters/RimUserDefinedFilter.h b/ApplicationLibCode/ProjectDataModel/CellFilters/RimUserDefinedFilter.h index cf7de5dbea..4747de5009 100644 --- a/ApplicationLibCode/ProjectDataModel/CellFilters/RimUserDefinedFilter.h +++ b/ApplicationLibCode/ProjectDataModel/CellFilters/RimUserDefinedFilter.h @@ -37,7 +37,7 @@ class RimUserDefinedFilter : public RimCellFilter RimUserDefinedFilter(); ~RimUserDefinedFilter() override; - void updateCompundFilter( cvf::CellRangeFilter* cellRangeFilter ) override; + void updateCompundFilter( cvf::CellRangeFilter* cellRangeFilter, int gridIndex ) override; protected: void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override; diff --git a/ApplicationLibCode/ReservoirDataModel/RigCell.cpp b/ApplicationLibCode/ReservoirDataModel/RigCell.cpp index 6982aa9e46..504d9cd18d 100644 --- a/ApplicationLibCode/ReservoirDataModel/RigCell.cpp +++ b/ApplicationLibCode/ReservoirDataModel/RigCell.cpp @@ -430,9 +430,9 @@ cvf::BoundingBox RigCell::boundingBox() const cvf::BoundingBox bb; std::array hexCorners; - if ( m_hostGrid && m_hostGrid->mainGrid() ) + if ( m_hostGrid ) { - m_hostGrid->mainGrid()->cellCornerVertices( mainGridCellIndex(), hexCorners.data() ); + m_hostGrid->cellCornerVertices( m_gridLocalCellIndex, hexCorners.data() ); for ( const auto& corner : hexCorners ) { bb.add( corner ); @@ -442,7 +442,7 @@ cvf::BoundingBox RigCell::boundingBox() const } //-------------------------------------------------------------------------------------------------- -/// Return the neighbor cell of the given face +/// Return the main grid neighbor cell of the given face //-------------------------------------------------------------------------------------------------- RigCell RigCell::neighborCell( cvf::StructGridInterface::FaceType face ) const { From eb3c52aeb12ba4e12a5b248e7580773e2eb852d0 Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Fri, 25 Jun 2021 14:18:36 +0200 Subject: [PATCH 022/308] Python adjustments (#7809) * #7797 Well Targets: Add scripting capability * #7794 Python : Do not update childField or childFieldArray * #7797: Python - Add scripting to well path collection - Extend the pdmobject.py with method add_object() - allow objects to be created from Python in well path collections - add well targets to modelled well path * #7795 Python : Make sure referenced generated classes are defined * #7810 StimPlanModel: clean-up python generation * Python : Always use empty string as default value for ptrFieldValue It can happen that a ptrField is assigned to a pointer on object construction. (FaciesProperties) Make sure that constructor always assigns an empty string. Co-authored-by: magnesj Co-authored-by: Kristian Bendiksen --- .../Application/RiaApplication.cpp | 21 ++++- .../Application/RiaGuiApplication.cpp | 2 +- .../RicImportFormationNamesFeature.cpp | 4 +- .../CellFilters/RimCellFilterCollection.cpp | 2 +- ...sembleFractureStatisticsPlotCollection.cpp | 4 +- .../RimGridStatisticsPlotCollection.cpp | 4 +- .../RimWellPathCollection.cpp | 22 ++++- .../ProjectDataModel/RimWellPathCollection.h | 2 + .../ProjectDataModel/RimWellPathGroup.cpp | 32 +++---- .../ProjectDataModel/RimWellPathTarget.cpp | 20 +++-- .../RimFaciesInitialPressureConfig.cpp | 10 ++- .../StimPlanModel/RimPressureTable.cpp | 8 +- .../StimPlanModel/RimPressureTableItem.cpp | 10 ++- .../cafPdmScripting/cafPdmCodeGenerator.h | 4 +- .../cafPdmMarkdownGenerator.cpp | 2 +- .../cafPdmScripting/cafPdmMarkdownGenerator.h | 2 +- .../cafPdmScripting/cafPdmPythonGenerator.cpp | 26 +++++- .../cafPdmScripting/cafPdmPythonGenerator.h | 4 +- .../cafPdmScriptingBasicTest.cpp | 3 +- .../cafPdmCore/cafPdmObjectHandle.h | 2 + GrpcInterface/GrpcProtos/PdmObject.proto | 1 + GrpcInterface/Python/rips/pdmobject.py | 35 ++++++++ .../Python/rips/tests/create_well_path.py | 35 ++++++++ GrpcInterface/RiaGrpcCommandService.cpp | 2 +- GrpcInterface/RiaGrpcPdmObjectService.cpp | 12 ++- GrpcInterface/RiaGrpcServiceInterface.cpp | 89 ++++++++++++++++--- GrpcInterface/RiaGrpcServiceInterface.h | 9 +- 27 files changed, 294 insertions(+), 73 deletions(-) create mode 100644 GrpcInterface/Python/rips/tests/create_well_path.py diff --git a/ApplicationLibCode/Application/RiaApplication.cpp b/ApplicationLibCode/Application/RiaApplication.cpp index 493572af43..53619538b0 100644 --- a/ApplicationLibCode/Application/RiaApplication.cpp +++ b/ApplicationLibCode/Application/RiaApplication.cpp @@ -1555,7 +1555,9 @@ bool RiaApplication::generateCode( const QString& fileName, gsl::not_nullgenerate( caf::PdmDefaultObjectFactory::instance() ); + std::vector logMessages; + + out << generator->generate( caf::PdmDefaultObjectFactory::instance(), logMessages ); } { @@ -1613,7 +1615,22 @@ bool RiaApplication::generateCode( const QString& fileName, gsl::not_nullgenerate( caf::PdmDefaultObjectFactory::instance() ); + std::vector logMessages; + + out << generator->generate( caf::PdmDefaultObjectFactory::instance(), logMessages ); + + QString errorText; + for ( const auto& msg : logMessages ) + { + errorText += msg; + errorText += "\n"; + } + + if ( !errorText.isEmpty() ) + { + *errMsg = errorText; + return false; + } } return true; diff --git a/ApplicationLibCode/Application/RiaGuiApplication.cpp b/ApplicationLibCode/Application/RiaGuiApplication.cpp index 287f19f2a2..2df91a9845 100644 --- a/ApplicationLibCode/Application/RiaGuiApplication.cpp +++ b/ApplicationLibCode/Application/RiaGuiApplication.cpp @@ -453,7 +453,7 @@ RiaApplication::ApplicationStatus RiaGuiApplication::handleArguments( gsl::not_n if ( !RiaApplication::generateCode( outputFile, &errMsg ) ) { RiaLogging::error( QString( "Error: %1" ).arg( errMsg ) ); - return RiaApplication::ApplicationStatus::EXIT_WITH_ERROR; + return RiaApplication::ApplicationStatus::KEEP_GOING; } return RiaApplication::ApplicationStatus::EXIT_COMPLETED; diff --git a/ApplicationLibCode/Commands/RicImportFormationNamesFeature.cpp b/ApplicationLibCode/Commands/RicImportFormationNamesFeature.cpp index 6ee33db26b..c4916cb28a 100644 --- a/ApplicationLibCode/Commands/RicImportFormationNamesFeature.cpp +++ b/ApplicationLibCode/Commands/RicImportFormationNamesFeature.cpp @@ -89,7 +89,9 @@ RimFormationNames* RicImportFormationNamesFeature::importFormationFiles( const Q } } - return formationNames.back(); + if ( !formationNames.empty() ) return formationNames.back(); + + return nullptr; } //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationLibCode/ProjectDataModel/CellFilters/RimCellFilterCollection.cpp b/ApplicationLibCode/ProjectDataModel/CellFilters/RimCellFilterCollection.cpp index 40759a2580..f4b1dd7fad 100644 --- a/ApplicationLibCode/ProjectDataModel/CellFilters/RimCellFilterCollection.cpp +++ b/ApplicationLibCode/ProjectDataModel/CellFilters/RimCellFilterCollection.cpp @@ -44,7 +44,7 @@ RimCellFilterCollection::RimCellFilterCollection() CAF_PDM_InitScriptableField( &m_isActive, "Active", true, "Active", "", "", "" ); m_isActive.uiCapability()->setUiHidden( true ); - CAF_PDM_InitScriptableFieldNoDefault( &m_cellFilters, "CellFilters", "Filters", "", "", "" ); + CAF_PDM_InitFieldNoDefault( &m_cellFilters, "CellFilters", "Filters", "", "", "" ); m_cellFilters.uiCapability()->setUiTreeHidden( true ); caf::PdmFieldReorderCapability::addToField( &m_cellFilters ); diff --git a/ApplicationLibCode/ProjectDataModel/RimEnsembleFractureStatisticsPlotCollection.cpp b/ApplicationLibCode/ProjectDataModel/RimEnsembleFractureStatisticsPlotCollection.cpp index df2823f6d3..949ec056f2 100644 --- a/ApplicationLibCode/ProjectDataModel/RimEnsembleFractureStatisticsPlotCollection.cpp +++ b/ApplicationLibCode/ProjectDataModel/RimEnsembleFractureStatisticsPlotCollection.cpp @@ -30,9 +30,9 @@ CAF_PDM_SOURCE_INIT( RimEnsembleFractureStatisticsPlotCollection, "EnsembleFract //-------------------------------------------------------------------------------------------------- RimEnsembleFractureStatisticsPlotCollection::RimEnsembleFractureStatisticsPlotCollection() { - CAF_PDM_InitScriptableObject( "Ensemble Fracture Statistics Plots", ":/WellLogPlots16x16.png", "", "" ); + CAF_PDM_InitObject( "Ensemble Fracture Statistics Plots", ":/WellLogPlots16x16.png", "", "" ); - CAF_PDM_InitScriptableFieldNoDefault( &m_ensembleFractureStatisticsPlots, "EnsembleFractureStatisticsPlots", "", "", "", "" ); + CAF_PDM_InitFieldNoDefault( &m_ensembleFractureStatisticsPlots, "EnsembleFractureStatisticsPlots", "", "", "", "" ); m_ensembleFractureStatisticsPlots.uiCapability()->setUiHidden( true ); } diff --git a/ApplicationLibCode/ProjectDataModel/RimGridStatisticsPlotCollection.cpp b/ApplicationLibCode/ProjectDataModel/RimGridStatisticsPlotCollection.cpp index b33f58261d..31e7422bc3 100644 --- a/ApplicationLibCode/ProjectDataModel/RimGridStatisticsPlotCollection.cpp +++ b/ApplicationLibCode/ProjectDataModel/RimGridStatisticsPlotCollection.cpp @@ -30,9 +30,9 @@ CAF_PDM_SOURCE_INIT( RimGridStatisticsPlotCollection, "GridStatisticsPlotCollect //-------------------------------------------------------------------------------------------------- RimGridStatisticsPlotCollection::RimGridStatisticsPlotCollection() { - CAF_PDM_InitScriptableObject( "Grid Statistics Plots", ":/WellLogPlots16x16.png", "", "" ); + CAF_PDM_InitObject( "Grid Statistics Plots", ":/WellLogPlots16x16.png", "", "" ); - CAF_PDM_InitScriptableFieldNoDefault( &m_gridStatisticsPlots, "GridStatisticsPlots", "", "", "", "" ); + CAF_PDM_InitFieldNoDefault( &m_gridStatisticsPlots, "GridStatisticsPlots", "", "", "", "" ); m_gridStatisticsPlots.uiCapability()->setUiHidden( true ); } diff --git a/ApplicationLibCode/ProjectDataModel/RimWellPathCollection.cpp b/ApplicationLibCode/ProjectDataModel/RimWellPathCollection.cpp index 8879113ba0..f31df93ae2 100644 --- a/ApplicationLibCode/ProjectDataModel/RimWellPathCollection.cpp +++ b/ApplicationLibCode/ProjectDataModel/RimWellPathCollection.cpp @@ -54,6 +54,8 @@ #include "Riu3DMainWindowTools.h" +#include "cafPdmFieldScriptingCapability.h" +#include "cafPdmObjectScriptingCapability.h" #include "cafPdmUiEditorHandle.h" #include "cafPdmUiTreeOrdering.h" #include "cafProgressInfo.h" @@ -83,7 +85,12 @@ CAF_PDM_SOURCE_INIT( RimWellPathCollection, "WellPaths" ); //-------------------------------------------------------------------------------------------------- RimWellPathCollection::RimWellPathCollection() { - CAF_PDM_InitObject( "Wells", ":/WellCollection.png", "", "" ); + CAF_PDM_InitScriptableObjectWithNameAndComment( "Wells", + ":/WellCollection.png", + "", + "", + "WellPathCollection", + "Collection of Well Paths" ); CAF_PDM_InitField( &isActive, "Active", true, "Active", "", "", "" ); isActive.uiCapability()->setUiHidden( true ); @@ -109,7 +116,7 @@ RimWellPathCollection::RimWellPathCollection() CAF_PDM_InitField( &wellPathClip, "WellPathClip", true, "Clip Well Paths", "", "", "" ); CAF_PDM_InitField( &wellPathClipZDistance, "WellPathClipZDistance", 100, "Well Path Clipping Depth Distance", "", "", "" ); - CAF_PDM_InitFieldNoDefault( &m_wellPaths, "WellPaths", "Well Paths", "", "", "" ); + CAF_PDM_InitScriptableFieldNoDefault( &m_wellPaths, "WellPaths", "Well Paths", "", "", "" ); m_wellPaths.uiCapability()->setUiHidden( true ); m_wellPaths.uiCapability()->setUiTreeHidden( true ); m_wellPaths.uiCapability()->setUiTreeChildrenHidden( true ); @@ -977,3 +984,14 @@ void RimWellPathCollection::onChildDeleted( caf::PdmChildArrayFieldHandle* scheduleRedrawAffectedViews(); uiCapability()->updateConnectedEditors(); } + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimWellPathCollection::onChildAdded( caf::PdmFieldHandle* containerForNewObject ) +{ + rebuildWellPathNodes(); + + scheduleRedrawAffectedViews(); + uiCapability()->updateConnectedEditors(); +} diff --git a/ApplicationLibCode/ProjectDataModel/RimWellPathCollection.h b/ApplicationLibCode/ProjectDataModel/RimWellPathCollection.h index 97964b3500..2f22495b2d 100644 --- a/ApplicationLibCode/ProjectDataModel/RimWellPathCollection.h +++ b/ApplicationLibCode/ProjectDataModel/RimWellPathCollection.h @@ -127,6 +127,8 @@ class RimWellPathCollection : public caf::PdmObject void onChildDeleted( caf::PdmChildArrayFieldHandle* childArray, std::vector& referringObjects ) override; + void onChildAdded( caf::PdmFieldHandle* containerForNewObject ) override; + protected: void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) override; diff --git a/ApplicationLibCode/ProjectDataModel/RimWellPathGroup.cpp b/ApplicationLibCode/ProjectDataModel/RimWellPathGroup.cpp index 081c47fb2a..f1afeb8997 100644 --- a/ApplicationLibCode/ProjectDataModel/RimWellPathGroup.cpp +++ b/ApplicationLibCode/ProjectDataModel/RimWellPathGroup.cpp @@ -25,8 +25,7 @@ #include "RimWellPathCompletions.h" #include "RimWellPathValve.h" -#include "cafPdmFieldScriptingCapability.h" -#include "cafPdmObjectScriptingCapability.h" +#include "cafPdmObject.h" #include "cafPdmUiTreeOrdering.h" #include @@ -38,23 +37,18 @@ CAF_PDM_SOURCE_INIT( RimWellPathGroup, "WellPathGroup" ); //-------------------------------------------------------------------------------------------------- RimWellPathGroup::RimWellPathGroup() { - CAF_PDM_InitScriptableObjectWithNameAndComment( "Well Path Group", - ":/WellPathGroup.svg", - "", - "", - "WellPathGroup", - "A Group of Well Paths" ); - CAF_PDM_InitScriptableFieldNoDefault( &m_childWellPaths, "ChildWellPaths", "Child Well Paths", "", "", "" ); - CAF_PDM_InitScriptableFieldNoDefault( &m_groupName, "GroupName", "Group Name", "", "", "" ); - - CAF_PDM_InitScriptableField( &m_addValveAtConnection, - "AddValveAtConnection", - false, - "Add Outlet Valve for Branches", - "", - "Should an outlet valve be added to branches for MSW export?", - "" ); - CAF_PDM_InitScriptableFieldNoDefault( &m_valve, "Valve", "Branch Outlet Valve", "", "", "" ); + CAF_PDM_InitObject( "Well Path Group", ":/WellPathGroup.svg", "", "" ); + CAF_PDM_InitFieldNoDefault( &m_childWellPaths, "ChildWellPaths", "Child Well Paths", "", "", "" ); + CAF_PDM_InitFieldNoDefault( &m_groupName, "GroupName", "Group Name", "", "", "" ); + + CAF_PDM_InitField( &m_addValveAtConnection, + "AddValveAtConnection", + false, + "Add Outlet Valve for Branches", + "", + "Should an outlet valve be added to branches for MSW export?", + "" ); + CAF_PDM_InitFieldNoDefault( &m_valve, "Valve", "Branch Outlet Valve", "", "", "" ); m_valve = new RimWellPathValve; m_groupName.registerGetMethod( this, &RimWellPathGroup::createGroupName ); diff --git a/ApplicationLibCode/ProjectDataModel/RimWellPathTarget.cpp b/ApplicationLibCode/ProjectDataModel/RimWellPathTarget.cpp index 652a76ff37..97dfb1c189 100644 --- a/ApplicationLibCode/ProjectDataModel/RimWellPathTarget.cpp +++ b/ApplicationLibCode/ProjectDataModel/RimWellPathTarget.cpp @@ -26,6 +26,9 @@ #include "RimWellPath.h" #include "RimWellPathGeometryDef.h" +#include "cafPdmFieldScriptingCapability.h" +#include "cafPdmFieldScriptingCapabilityCvfVec3d.h" +#include "cafPdmObjectScriptingCapability.h" #include "cafPdmUiCheckBoxEditor.h" #include "cafPdmUiLineEditor.h" @@ -54,19 +57,26 @@ RimWellPathTarget::RimWellPathTarget() , m_inclination( 0.0 ) , m_isFullUpdateEnabled( true ) { + CAF_PDM_InitScriptableObjectWithNameAndComment( "Well Target", + "", + "", + "", + "WellPathTarget", + "Class containing the Well Target definition" ); + CAF_PDM_InitField( &m_isEnabled, "IsEnabled", true, "", "", "", "" ); CAF_PDM_InitField( &m_isLocked, "IsLocked", false, "", "", "", "" ); m_isLocked.uiCapability()->setUiHidden( true ); // m_targetType.uiCapability()->setUiHidden(true); - CAF_PDM_InitFieldNoDefault( &m_targetPoint, "TargetPoint", "Point", "", "", "" ); - CAF_PDM_InitField( &m_dogleg1, "Dogleg1", 3.0, "DL in", "", "[deg/30m]", "" ); - CAF_PDM_InitField( &m_dogleg2, "Dogleg2", 3.0, "DL out", "", "[deg/30m]", "" ); + CAF_PDM_InitScriptableFieldNoDefault( &m_targetPoint, "TargetPoint", "Point", "", "", "" ); + CAF_PDM_InitScriptableField( &m_dogleg1, "Dogleg1", 3.0, "DL in", "", "[deg/30m]", "" ); + CAF_PDM_InitScriptableField( &m_dogleg2, "Dogleg2", 3.0, "DL out", "", "[deg/30m]", "" ); CAF_PDM_InitFieldNoDefault( &m_targetType, "TargetType", "Type", "", "", "" ); m_targetType.uiCapability()->setUiHidden( true ); CAF_PDM_InitField( &m_hasTangentConstraintUiField, "HasTangentConstraint", false, "Dir", "", "", "" ); m_hasTangentConstraintUiField.xmlCapability()->disableIO(); - CAF_PDM_InitField( &m_azimuth, "Azimuth", 0.0, "Azi(deg)", "", "", "" ); - CAF_PDM_InitField( &m_inclination, "Inclination", 0.0, "Inc(deg)", "", "", "" ); + CAF_PDM_InitScriptableField( &m_azimuth, "Azimuth", 0.0, "Azi(deg)", "", "", "" ); + CAF_PDM_InitScriptableField( &m_inclination, "Inclination", 0.0, "Inc(deg)", "", "", "" ); CAF_PDM_InitFieldNoDefault( &m_parentWellPath, "ParentWellPath", "Parent Well Path", "", "", "" ); diff --git a/ApplicationLibCode/ProjectDataModel/StimPlanModel/RimFaciesInitialPressureConfig.cpp b/ApplicationLibCode/ProjectDataModel/StimPlanModel/RimFaciesInitialPressureConfig.cpp index 60d48d28e2..b7e01ee320 100644 --- a/ApplicationLibCode/ProjectDataModel/StimPlanModel/RimFaciesInitialPressureConfig.cpp +++ b/ApplicationLibCode/ProjectDataModel/StimPlanModel/RimFaciesInitialPressureConfig.cpp @@ -18,6 +18,8 @@ #include "RimFaciesInitialPressureConfig.h" +#include "cafPdmFieldScriptingCapability.h" +#include "cafPdmObjectScriptingCapability.h" #include "cafPdmUiCheckBoxEditor.h" #include "cafPdmUiLineEditor.h" @@ -29,12 +31,14 @@ CAF_PDM_SOURCE_INIT( RimFaciesInitialPressureConfig, "FaciesInitialPressureConfi RimFaciesInitialPressureConfig::RimFaciesInitialPressureConfig() : changed( this ) { + CAF_PDM_InitScriptableObject( "Facies Initial Pressure Config", "", "", "" ); + m_isChecked.uiCapability()->setUiHidden( false ); - CAF_PDM_InitFieldNoDefault( &m_faciesName, "FaciesName", "Facies", "", "", "" ); + CAF_PDM_InitScriptableFieldNoDefault( &m_faciesName, "FaciesName", "Facies", "", "", "" ); m_faciesName.uiCapability()->setUiReadOnly( true ); - CAF_PDM_InitFieldNoDefault( &m_faciesValue, "FaciesValue", "Value", "", "", "" ); + CAF_PDM_InitScriptableFieldNoDefault( &m_faciesValue, "FaciesValue", "Value", "", "", "" ); m_faciesValue.uiCapability()->setUiHidden( true ); // Use unicode for delta letter @@ -44,7 +48,7 @@ RimFaciesInitialPressureConfig::RimFaciesInitialPressureConfig() QString deltaPressureFractionString = QString::fromUtf8( "\u0394 Pressure Fraction" ); #endif - CAF_PDM_InitField( &m_fraction, "Fraction", 0.0, deltaPressureFractionString, "", "", "" ); + CAF_PDM_InitScriptableField( &m_fraction, "Fraction", 0.0, deltaPressureFractionString, "", "", "" ); } //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationLibCode/ProjectDataModel/StimPlanModel/RimPressureTable.cpp b/ApplicationLibCode/ProjectDataModel/StimPlanModel/RimPressureTable.cpp index eebfc6a389..af8a836048 100644 --- a/ApplicationLibCode/ProjectDataModel/StimPlanModel/RimPressureTable.cpp +++ b/ApplicationLibCode/ProjectDataModel/StimPlanModel/RimPressureTable.cpp @@ -21,6 +21,8 @@ #include "RimPressureTableItem.h" #include "cafCmdFeatureMenuBuilder.h" +#include "cafPdmFieldScriptingCapability.h" +#include "cafPdmObjectScriptingCapability.h" #include "cafPdmUiTableViewEditor.h" #include "cafPdmUiTreeOrdering.h" @@ -32,14 +34,14 @@ CAF_PDM_SOURCE_INIT( RimPressureTable, "PressureTable" ); RimPressureTable::RimPressureTable() : changed( this ) { - CAF_PDM_InitObject( "Pressure Table", "", "", "" ); + CAF_PDM_InitScriptableObject( "Pressure Table", "", "", "" ); - CAF_PDM_InitFieldNoDefault( &m_pressureTableItems, "Items", "Pressure Table Items", "", "", "" ); + CAF_PDM_InitScriptableFieldNoDefault( &m_pressureTableItems, "Items", "Pressure Table Items", "", "", "" ); m_pressureTableItems.uiCapability()->setUiEditorTypeName( caf::PdmUiTableViewEditor::uiEditorTypeName() ); m_pressureTableItems.uiCapability()->setUiLabelPosition( caf::PdmUiItemInfo::HIDDEN ); m_pressureTableItems.uiCapability()->setCustomContextMenuEnabled( true ); - CAF_PDM_InitFieldNoDefault( &m_pressureDate, "PressureDate", "Pressure Date", "", "", "" ); + CAF_PDM_InitScriptableFieldNoDefault( &m_pressureDate, "PressureDate", "Pressure Date", "", "", "" ); } //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationLibCode/ProjectDataModel/StimPlanModel/RimPressureTableItem.cpp b/ApplicationLibCode/ProjectDataModel/StimPlanModel/RimPressureTableItem.cpp index 81ac53ee7c..7b7b3ca71b 100644 --- a/ApplicationLibCode/ProjectDataModel/StimPlanModel/RimPressureTableItem.cpp +++ b/ApplicationLibCode/ProjectDataModel/StimPlanModel/RimPressureTableItem.cpp @@ -18,6 +18,8 @@ #include "RimPressureTableItem.h" +#include "cafPdmFieldScriptingCapability.h" +#include "cafPdmObjectScriptingCapability.h" #include "cafPdmUiCheckBoxEditor.h" #include "cafPdmUiLineEditor.h" @@ -29,9 +31,11 @@ CAF_PDM_SOURCE_INIT( RimPressureTableItem, "PressureTableItem" ); RimPressureTableItem::RimPressureTableItem() : changed( this ) { - CAF_PDM_InitField( &m_depth, "Depth", 0.0, "Depth TVDMSL [m]", "", "", "" ); - CAF_PDM_InitField( &m_initialPressure, "InitialPressure", 0.0, "Initial Pressure [Bar]", "", "", "" ); - CAF_PDM_InitField( &m_pressure, "Pressure", 0.0, "Pressure [Bar]", "", "", "" ); + CAF_PDM_InitScriptableObject( "Pressure Table Item", "", "", "" ); + + CAF_PDM_InitScriptableField( &m_depth, "Depth", 0.0, "Depth TVDMSL [m]", "", "", "" ); + CAF_PDM_InitScriptableField( &m_initialPressure, "InitialPressure", 0.0, "Initial Pressure [Bar]", "", "", "" ); + CAF_PDM_InitScriptableField( &m_pressure, "Pressure", 0.0, "Pressure [Bar]", "", "", "" ); } //-------------------------------------------------------------------------------------------------- diff --git a/Fwk/AppFwk/cafPdmScripting/cafPdmCodeGenerator.h b/Fwk/AppFwk/cafPdmScripting/cafPdmCodeGenerator.h index b7fb3ccae4..88f01eec37 100644 --- a/Fwk/AppFwk/cafPdmScripting/cafPdmCodeGenerator.h +++ b/Fwk/AppFwk/cafPdmScripting/cafPdmCodeGenerator.h @@ -61,9 +61,9 @@ class PdmObjectFactory; class PdmCodeGenerator { public: - virtual QString generate( PdmObjectFactory* factory ) const = 0; + virtual QString generate( PdmObjectFactory* factory, std::vector& errorMessages ) const = 0; }; typedef Factory PdmCodeGeneratorFactory; -} // namespace caf \ No newline at end of file +} // namespace caf diff --git a/Fwk/AppFwk/cafPdmScripting/cafPdmMarkdownGenerator.cpp b/Fwk/AppFwk/cafPdmScripting/cafPdmMarkdownGenerator.cpp index fec56b0988..73fcbbbfc2 100644 --- a/Fwk/AppFwk/cafPdmScripting/cafPdmMarkdownGenerator.cpp +++ b/Fwk/AppFwk/cafPdmScripting/cafPdmMarkdownGenerator.cpp @@ -46,7 +46,7 @@ CAF_PDM_CODE_GENERATOR_SOURCE_INIT( PdmMarkdownGenerator, "md" ); //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -QString caf::PdmMarkdownGenerator::generate( PdmObjectFactory* factory ) const +QString caf::PdmMarkdownGenerator::generate( PdmObjectFactory* factory, std::vector& errorMessages ) const { QString generatedCode; QTextStream out( &generatedCode ); diff --git a/Fwk/AppFwk/cafPdmScripting/cafPdmMarkdownGenerator.h b/Fwk/AppFwk/cafPdmScripting/cafPdmMarkdownGenerator.h index 5a21651a26..ddffdb8e92 100644 --- a/Fwk/AppFwk/cafPdmScripting/cafPdmMarkdownGenerator.h +++ b/Fwk/AppFwk/cafPdmScripting/cafPdmMarkdownGenerator.h @@ -58,7 +58,7 @@ class PdmMarkdownGenerator : public PdmCodeGenerator }; public: - QString generate( PdmObjectFactory* factory ) const override; + QString generate( PdmObjectFactory* factory, std::vector& errorMessages ) const override; }; } // namespace caf diff --git a/Fwk/AppFwk/cafPdmScripting/cafPdmPythonGenerator.cpp b/Fwk/AppFwk/cafPdmScripting/cafPdmPythonGenerator.cpp index 9a5c848bb9..8c581ff8e9 100644 --- a/Fwk/AppFwk/cafPdmScripting/cafPdmPythonGenerator.cpp +++ b/Fwk/AppFwk/cafPdmScripting/cafPdmPythonGenerator.cpp @@ -59,7 +59,7 @@ CAF_PDM_CODE_GENERATOR_SOURCE_INIT( PdmPythonGenerator, "py" ); //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -QString PdmPythonGenerator::generate( PdmObjectFactory* factory ) const +QString caf::PdmPythonGenerator::generate( PdmObjectFactory* factory, std::vector& errorMessages ) const { QString generatedCode; QTextStream out( &generatedCode ); @@ -92,6 +92,7 @@ QString PdmPythonGenerator::generate( PdmObjectFactory* factory ) const std::map>> classAttributesGenerated; std::map> classMethodsGenerated; std::map classCommentsGenerated; + std::set dataTypesInChildFields; // First generate all attributes and comments to go into each object for ( std::shared_ptr object : dummyObjects ) @@ -181,9 +182,14 @@ QString PdmPythonGenerator::generate( PdmObjectFactory* factory ) const } else { - QString valueString; - QTextStream valueStream( &valueString ); - scriptability->readFromField( valueStream, true, true ); + QString valueString; + + // Always make sure the default value for a ptrField is empty string + if ( !field->hasPtrReferencedObjects() ) + { + QTextStream valueStream( &valueString ); + scriptability->readFromField( valueStream, true, true ); + } if ( valueString.isEmpty() ) valueString = QString( "\"\"" ); valueString = pythonifyDataValue( valueString ); @@ -203,6 +209,8 @@ QString PdmPythonGenerator::generate( PdmObjectFactory* factory ) const QString scriptDataType = PdmObjectScriptingCapabilityRegister::scriptClassNameFromClassKeyword( dataType ); + dataTypesInChildFields.insert( scriptDataType ); + QString commentDataType = field->xmlCapability()->isVectorField() ? QString( "List of %1" ).arg( scriptDataType ) : scriptDataType; @@ -385,6 +393,16 @@ QString PdmPythonGenerator::generate( PdmObjectFactory* factory ) const out << " return all_classes[class_keyword]\n"; out << " return None\n"; + // Check if all referenced data types are exported as classes + for ( const auto& scriptDataType : dataTypesInChildFields ) + { + if ( classesWritten.count( scriptDataType ) == 0 ) + { + QString errorText = "No export for data type " + scriptDataType; + errorMessages.push_back( errorText ); + } + } + return generatedCode; } diff --git a/Fwk/AppFwk/cafPdmScripting/cafPdmPythonGenerator.h b/Fwk/AppFwk/cafPdmScripting/cafPdmPythonGenerator.h index 4587178d66..f4068e84a8 100644 --- a/Fwk/AppFwk/cafPdmScripting/cafPdmPythonGenerator.h +++ b/Fwk/AppFwk/cafPdmScripting/cafPdmPythonGenerator.h @@ -49,11 +49,11 @@ class PdmPythonGenerator : public PdmCodeGenerator CAF_PDM_CODE_GENERATOR_HEADER_INIT; public: - QString generate( PdmObjectFactory* factory ) const override; + QString generate( PdmObjectFactory* factory, std::vector& errorMessages ) const override; static QString camelToSnakeCase( const QString& camelString ); static QString dataTypeString( const PdmFieldHandle* field, bool useStrForUnknownDataTypes ); static QString pythonifyDataValue( const QString& dataValue ); }; -} // namespace caf \ No newline at end of file +} // namespace caf diff --git a/Fwk/AppFwk/cafPdmScripting/cafPdmScripting_UnitTests/cafPdmScriptingBasicTest.cpp b/Fwk/AppFwk/cafPdmScripting/cafPdmScripting_UnitTests/cafPdmScriptingBasicTest.cpp index 042fe399da..372b533003 100644 --- a/Fwk/AppFwk/cafPdmScripting/cafPdmScripting_UnitTests/cafPdmScriptingBasicTest.cpp +++ b/Fwk/AppFwk/cafPdmScripting/cafPdmScripting_UnitTests/cafPdmScriptingBasicTest.cpp @@ -250,7 +250,8 @@ TEST( PdmScriptingTest, BasicUse ) std::string fileExt = "py"; std::unique_ptr generator( caf::PdmCodeGeneratorFactory::instance()->create( fileExt ) ); - auto generatedText = generator->generate( caf::PdmDefaultObjectFactory::instance() ); + std::vector logMessages; + auto generatedText = generator->generate( caf::PdmDefaultObjectFactory::instance(), logMessages ); auto string = generatedText.toStdString(); } diff --git a/Fwk/AppFwk/cafProjectDataModel/cafPdmCore/cafPdmObjectHandle.h b/Fwk/AppFwk/cafProjectDataModel/cafPdmCore/cafPdmObjectHandle.h index f94a78110c..3811191203 100644 --- a/Fwk/AppFwk/cafProjectDataModel/cafPdmCore/cafPdmObjectHandle.h +++ b/Fwk/AppFwk/cafProjectDataModel/cafPdmCore/cafPdmObjectHandle.h @@ -104,6 +104,8 @@ class PdmObjectHandle : public SignalObserver, public SignalEmitter virtual void onChildDeleted( PdmChildArrayFieldHandle* childArray, std::vector& referringObjects ); + virtual void onChildAdded( caf::PdmFieldHandle* containerForNewObject ){}; + protected: void addField( PdmFieldHandle* field, const QString& keyword ); diff --git a/GrpcInterface/GrpcProtos/PdmObject.proto b/GrpcInterface/GrpcProtos/PdmObject.proto index e64712c8c4..cff7e5db9b 100644 --- a/GrpcInterface/GrpcProtos/PdmObject.proto +++ b/GrpcInterface/GrpcProtos/PdmObject.proto @@ -32,6 +32,7 @@ message CreatePdmChildObjectRequest { PdmObject object = 1; string child_field = 2; + string class_keyword = 3; } message PdmParentObjectRequest diff --git a/GrpcInterface/Python/rips/pdmobject.py b/GrpcInterface/Python/rips/pdmobject.py index 400492d8e5..e919cd96c1 100644 --- a/GrpcInterface/Python/rips/pdmobject.py +++ b/GrpcInterface/Python/rips/pdmobject.py @@ -284,6 +284,41 @@ def children(self, child_field, class_definition): return [] raise e + def add_new_object(self, class_definition, child_field=""): + """Create and add an object to the specified child field + Arguments: + class_definition[class]: Class definition of the object to create + child_field[str]: The keyword for the field to create a new object in. If empty, the first child array field is used. + Returns: + The created PdmObject inside the child_field + """ + from .generated.generated_classes import class_from_keyword + + assert inspect.isclass(class_definition) + + class_keyword = class_definition.__name__ + + request = PdmObject_pb2.CreatePdmChildObjectRequest( + object=self._pb2_object, + child_field=child_field, + class_keyword=class_keyword, + ) + try: + pb2_object = self._pdm_object_stub.CreateChildPdmObject(request) + child_class_definition = class_from_keyword(pb2_object.class_keyword) + + if child_class_definition is None: + child_class_definition = class_keyword + + pdm_object = child_class_definition( + pb2_object=pb2_object, channel=self.channel() + ) + return pdm_object + except grpc.RpcError as e: + if e.code() == grpc.StatusCode.NOT_FOUND: + return None + raise e + def ancestor(self, class_definition): """Find the first ancestor that matches the provided class_keyword Arguments: diff --git a/GrpcInterface/Python/rips/tests/create_well_path.py b/GrpcInterface/Python/rips/tests/create_well_path.py new file mode 100644 index 0000000000..41206b7174 --- /dev/null +++ b/GrpcInterface/Python/rips/tests/create_well_path.py @@ -0,0 +1,35 @@ +from rips.generated.generated_classes import ( + ModeledWellPath, + StimPlanModel, + WellPathGeometry, + WellPathTarget, +) +import sys +import os + +sys.path.insert(1, os.path.join(sys.path[0], "../../")) +import rips + + +def test_well_path_target(rips_instance, initialize_test): + well_path_coll = rips_instance.project.descendants(rips.WellPathCollection)[0] + + my_well_path = well_path_coll.add_new_object(rips.ModeledWellPath) + my_well_path.name = "test" + my_well_path.update() + + geometry = my_well_path.well_path_geometry() + geometry.add_new_object(rips.WellPathTarget) + geometry.add_new_object(rips.WellPathTarget) + geometry.add_new_object(rips.WellPathTarget) + assert len(geometry.well_path_targets()) == 3 + + assert len(well_path_coll.well_paths()) == 1 + my_well_path_duplicate = well_path_coll.well_paths()[0] + assert my_well_path_duplicate.name == "test" + geometry_duplicate = my_well_path_duplicate.well_path_geometry() + assert len(geometry_duplicate.well_path_targets()) == 3 + + # Not allowed to add object of unrelated type + invalid_object = geometry.add_new_object(rips.WellPath) + assert invalid_object is None diff --git a/GrpcInterface/RiaGrpcCommandService.cpp b/GrpcInterface/RiaGrpcCommandService.cpp index 7ebad0af0a..a8073357cf 100644 --- a/GrpcInterface/RiaGrpcCommandService.cpp +++ b/GrpcInterface/RiaGrpcCommandService.cpp @@ -269,7 +269,7 @@ void RiaGrpcCommandService::assignPdmObjectValues( caf::PdmObjectHandle* } else if ( childObjects.empty() ) { - childObject = emplaceChildField( pdmChildFieldHandle ); + childObject = emplaceChildField( pdmChildFieldHandle, "" ); } CAF_ASSERT( childObject ); if ( childObject ) diff --git a/GrpcInterface/RiaGrpcPdmObjectService.cpp b/GrpcInterface/RiaGrpcPdmObjectService.cpp index 1847a6b301..c52af25c3d 100644 --- a/GrpcInterface/RiaGrpcPdmObjectService.cpp +++ b/GrpcInterface/RiaGrpcPdmObjectService.cpp @@ -473,11 +473,15 @@ grpc::Status RiaGrpcPdmObjectService::CreateChildPdmObject( grpc::ServerContext* { CAF_ASSERT( request ); - caf::PdmObjectHandle* pdmObject = - emplaceChildField( matchingObject, QString::fromStdString( request->child_field() ) ); - if ( pdmObject ) + QString keywordClassToCreate = QString::fromStdString( request->class_keyword() ); + QString fieldKeyword = QString::fromStdString( request->child_field() ); + + caf::PdmObjectHandle* pdmObjectHandle = emplaceChildField( matchingObject, fieldKeyword, keywordClassToCreate ); + if ( pdmObjectHandle ) { - copyPdmObjectFromCafToRips( pdmObject, reply ); + copyPdmObjectFromCafToRips( pdmObjectHandle, reply ); + matchingObject->uiCapability()->updateConnectedEditors(); + return grpc::Status::OK; } return grpc::Status( grpc::NOT_FOUND, "Could not create PdmObject" ); diff --git a/GrpcInterface/RiaGrpcServiceInterface.cpp b/GrpcInterface/RiaGrpcServiceInterface.cpp index 12107a9b13..a91366ee57 100644 --- a/GrpcInterface/RiaGrpcServiceInterface.cpp +++ b/GrpcInterface/RiaGrpcServiceInterface.cpp @@ -142,6 +142,12 @@ void RiaGrpcServiceInterface::copyPdmObjectFromRipsToCaf( const rips::PdmObject* auto scriptability = field->template capability(); if ( scriptability ) { + if ( !dynamic_cast( field ) ) + { + // Recursive object update is not supported + // https://github.com/OPM/ResInsight/issues/7794 + continue; + } QString keyword = scriptability->scriptFieldName(); QString value = QString::fromStdString( parametersMap[keyword.toStdString()] ); @@ -181,7 +187,9 @@ bool RiaGrpcServiceInterface::assignFieldValue( const QString& stringValue //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -caf::PdmObjectHandle* RiaGrpcServiceInterface::emplaceChildField( caf::PdmObject* parent, const QString& fieldLabel ) +caf::PdmObjectHandle* RiaGrpcServiceInterface::emplaceChildField( caf::PdmObject* parent, + const QString& fieldKeyword, + const QString& keywordForClassToCreate ) { std::vector fields; parent->fields( fields ); @@ -190,13 +198,32 @@ caf::PdmObjectHandle* RiaGrpcServiceInterface::emplaceChildField( caf::PdmObject { auto pdmChildArrayField = dynamic_cast( field ); auto pdmChildField = dynamic_cast( field ); - if ( pdmChildArrayField && pdmChildArrayField->keyword() == fieldLabel ) + if ( pdmChildArrayField ) { - return emplaceChildArrayField( pdmChildArrayField ); + bool isMatching = false; + if ( fieldKeyword.isEmpty() ) + { + // Use first child array field if no fieldKeyword is specified + isMatching = true; + } + else + { + isMatching = ( pdmChildArrayField->keyword() == fieldKeyword ); + } + + if ( isMatching ) + { + auto objectCreated = emplaceChildArrayField( pdmChildArrayField, keywordForClassToCreate ); + + // Notify parent object that a new object has been created + if ( objectCreated ) parent->onChildAdded( pdmChildArrayField ); + + return objectCreated; + } } - else if ( pdmChildField && pdmChildField->keyword() == fieldLabel ) + else if ( pdmChildField && pdmChildField->keyword() == fieldKeyword ) { - return emplaceChildField( pdmChildField ); + return emplaceChildField( pdmChildField, keywordForClassToCreate ); } } return nullptr; @@ -205,12 +232,33 @@ caf::PdmObjectHandle* RiaGrpcServiceInterface::emplaceChildField( caf::PdmObject //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -caf::PdmObjectHandle* RiaGrpcServiceInterface::emplaceChildField( caf::PdmChildFieldHandle* childField ) +caf::PdmObjectHandle* RiaGrpcServiceInterface::emplaceChildField( caf::PdmChildFieldHandle* childField, + const QString& keywordForClassToCreate ) { - QString childClassKeyword = childField->xmlCapability()->dataTypeName(); + QString childClassKeyword; + if ( keywordForClassToCreate.isEmpty() ) + { + childClassKeyword = childField->xmlCapability()->dataTypeName(); + } + else + { + childClassKeyword = keywordForClassToCreate; + } auto pdmObjectHandle = caf::PdmDefaultObjectFactory::instance()->create( childClassKeyword ); CAF_ASSERT( pdmObjectHandle ); + + { + auto childDataTypeName = childField->xmlCapability()->dataTypeName(); + + auto isInheritanceValid = pdmObjectHandle->xmlCapability()->inheritsClassWithKeyword( childDataTypeName ); + if ( !isInheritanceValid ) + { + delete pdmObjectHandle; + return nullptr; + } + } + childField->setChildObject( pdmObjectHandle ); return pdmObjectHandle; } @@ -218,13 +266,34 @@ caf::PdmObjectHandle* RiaGrpcServiceInterface::emplaceChildField( caf::PdmChildF //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -caf::PdmObjectHandle* RiaGrpcServiceInterface::emplaceChildArrayField( caf::PdmChildArrayFieldHandle* childArrayField ) +caf::PdmObjectHandle* RiaGrpcServiceInterface::emplaceChildArrayField( caf::PdmChildArrayFieldHandle* childArrayField, + const QString& keywordForClassToCreate ) { - QString childClassKeyword = childArrayField->xmlCapability()->dataTypeName(); + QString childClassKeyword; + if ( keywordForClassToCreate.isEmpty() ) + { + childClassKeyword = childArrayField->xmlCapability()->dataTypeName(); + } + else + { + childClassKeyword = keywordForClassToCreate; + } auto pdmObjectHandle = caf::PdmDefaultObjectFactory::instance()->create( childClassKeyword ); - CAF_ASSERT( pdmObjectHandle ); + if ( !pdmObjectHandle ) return nullptr; + + { + auto childDataTypeName = childArrayField->xmlCapability()->dataTypeName(); + + auto isInheritanceValid = pdmObjectHandle->xmlCapability()->inheritsClassWithKeyword( childDataTypeName ); + if ( !isInheritanceValid ) + { + delete pdmObjectHandle; + return nullptr; + } + } childArrayField->insertAt( -1, pdmObjectHandle ); + return pdmObjectHandle; } diff --git a/GrpcInterface/RiaGrpcServiceInterface.h b/GrpcInterface/RiaGrpcServiceInterface.h index 95c5870a87..997cb0f304 100644 --- a/GrpcInterface/RiaGrpcServiceInterface.h +++ b/GrpcInterface/RiaGrpcServiceInterface.h @@ -60,10 +60,13 @@ class RiaGrpcServiceInterface static bool assignFieldValue( const QString& stringValue, caf::PdmFieldHandle* field, QVariant* oldValue, QVariant* newValue ); - static caf::PdmObjectHandle* emplaceChildField( caf::PdmObject* parent, const QString& fieldLabel ); + static caf::PdmObjectHandle* + emplaceChildField( caf::PdmObject* parent, const QString& fieldKeyword, const QString& keywordForClassToCreate ); - static caf::PdmObjectHandle* emplaceChildField( caf::PdmChildFieldHandle* childField ); - static caf::PdmObjectHandle* emplaceChildArrayField( caf::PdmChildArrayFieldHandle* childArrayField ); + static caf::PdmObjectHandle* emplaceChildField( caf::PdmChildFieldHandle* childField, + const QString& keywordForClassToCreate ); + static caf::PdmObjectHandle* emplaceChildArrayField( caf::PdmChildArrayFieldHandle* childArrayField, + const QString& keywordForClassToCreate ); }; #include "cafFactory.h" From 62d67a52c7371f95d45f62f602a3bf26ff742d69 Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Mon, 28 Jun 2021 09:48:38 +0200 Subject: [PATCH 023/308] #7811 Modeled Well Path : Optionally show absolute coordinates --- .../RicWellTarget3dEditor.cpp | 76 +++++--- .../RicWellTarget3dEditor.h | 10 +- .../RicNewWellPathLateralAtDepthFeature.cpp | 1 + .../ProjectDataModel/RimModeledWellPath.cpp | 5 +- .../RimWellPathGeometryDef.cpp | 19 ++ .../ProjectDataModel/RimWellPathGeometryDef.h | 17 +- .../ProjectDataModel/RimWellPathTarget.cpp | 179 +++++++++++++----- .../ProjectDataModel/RimWellPathTarget.h | 21 +- .../ProjectDataModel/RimWellPathTieIn.cpp | 12 +- 9 files changed, 241 insertions(+), 99 deletions(-) diff --git a/ApplicationLibCode/Commands/WellPathCommands/PointTangentManipulator/RicWellTarget3dEditor.cpp b/ApplicationLibCode/Commands/WellPathCommands/PointTangentManipulator/RicWellTarget3dEditor.cpp index c0d8b6b2e3..45e0241a9a 100644 --- a/ApplicationLibCode/Commands/WellPathCommands/PointTangentManipulator/RicWellTarget3dEditor.cpp +++ b/ApplicationLibCode/Commands/WellPathCommands/PointTangentManipulator/RicWellTarget3dEditor.cpp @@ -57,14 +57,7 @@ RicWellTarget3dEditor::~RicWellTarget3dEditor() ownerRiuViewer->removeStaticModel( m_cvfModel.p() ); } - RimWellPathTarget* oldTarget = dynamic_cast( this->pdmObject() ); - if ( oldTarget ) - { - oldTarget->m_targetType.uiCapability()->removeFieldEditor( this ); - oldTarget->m_targetPoint.uiCapability()->removeFieldEditor( this ); - oldTarget->m_azimuth.uiCapability()->removeFieldEditor( this ); - oldTarget->m_inclination.uiCapability()->removeFieldEditor( this ); - } + removeAllFieldEditors(); delete m_manipulator; } @@ -88,10 +81,10 @@ void RicWellTarget3dEditor::configureAndUpdateUi( const QString& uiConfigName ) RimWellPathGeometryDef* geomDef; target->firstAncestorOrThisOfTypeAsserted( geomDef ); - target->m_targetType.uiCapability()->addFieldEditor( this ); - target->m_targetPoint.uiCapability()->addFieldEditor( this ); - target->m_azimuth.uiCapability()->addFieldEditor( this ); - target->m_inclination.uiCapability()->addFieldEditor( this ); + for ( auto field : target->fieldsFor3dManipulator() ) + { + field->uiCapability()->addFieldEditor( this ); + } if ( m_manipulator.isNull() ) { @@ -127,14 +120,7 @@ void RicWellTarget3dEditor::configureAndUpdateUi( const QString& uiConfigName ) //-------------------------------------------------------------------------------------------------- void RicWellTarget3dEditor::cleanupBeforeSettingPdmObject() { - RimWellPathTarget* oldTarget = dynamic_cast( this->pdmObject() ); - if ( oldTarget ) - { - oldTarget->m_targetType.uiCapability()->removeFieldEditor( this ); - oldTarget->m_targetPoint.uiCapability()->removeFieldEditor( this ); - oldTarget->m_azimuth.uiCapability()->removeFieldEditor( this ); - oldTarget->m_inclination.uiCapability()->removeFieldEditor( this ); - } + removeAllFieldEditors(); } //-------------------------------------------------------------------------------------------------- @@ -150,18 +136,38 @@ void RicWellTarget3dEditor::slotUpdated( const cvf::Vec3d& origin, const cvf::Ve return; } - cvf::ref dispXf = view->displayCoordTransform(); - RimWellPathGeometryDef* geomDef; target->firstAncestorOrThisOfTypeAsserted( geomDef ); + if ( !geomDef ) return; + + cvf::ref dispXf = view->displayCoordTransform(); - cvf::Vec3d domainOrigin = dispXf->transformToDomainCoord( origin ) - geomDef->anchorPointXyz(); - domainOrigin.z() = -domainOrigin.z(); - QVariant originVariant = caf::PdmValueFieldSpecialization::convert( domainOrigin ); + auto domainCoordXYZ = dispXf->transformToDomainCoord( origin ); - target->enableFullUpdate( false ); - caf::PdmUiCommandSystemProxy::instance()->setUiValueToField( target->m_targetPoint.uiCapability(), originVariant ); - target->enableFullUpdate( true ); + // If CTRL is pressed, modify the reference point instead of the well path target + bool modifyReferencePoint = ( QApplication::keyboardModifiers() & Qt::ControlModifier ); + if ( modifyReferencePoint ) + { + auto relativePositionXYZ = domainCoordXYZ - geomDef->anchorPointXyz(); + auto delta = target->targetPointXYZ() - relativePositionXYZ; + + auto currentRefPointXyz = geomDef->anchorPointXyz(); + auto newRefPointXyz = currentRefPointXyz - delta; + geomDef->setReferencePointXyz( newRefPointXyz ); + geomDef->changed.send( false ); + geomDef->updateWellPathVisualization( true ); + for ( auto wt : geomDef->activeWellTargets() ) + { + wt->updateConnectedEditors(); + } + } + else + { + cvf::Vec3d relativePositionXYD = domainCoordXYZ - geomDef->anchorPointXyz(); + relativePositionXYD.z() = -relativePositionXYD.z(); + + target->updateFrom3DManipulator( relativePositionXYD ); + } } //-------------------------------------------------------------------------------------------------- @@ -191,3 +197,17 @@ void RicWellTarget3dEditor::slotDragFinished() target->onMoved(); } + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RicWellTarget3dEditor::removeAllFieldEditors() +{ + if ( RimWellPathTarget* oldTarget = dynamic_cast( this->pdmObject() ) ) + { + for ( auto field : oldTarget->fieldsFor3dManipulator() ) + { + field->uiCapability()->removeFieldEditor( this ); + } + } +} diff --git a/ApplicationLibCode/Commands/WellPathCommands/PointTangentManipulator/RicWellTarget3dEditor.h b/ApplicationLibCode/Commands/WellPathCommands/PointTangentManipulator/RicWellTarget3dEditor.h index 4017843381..7f041829a9 100644 --- a/ApplicationLibCode/Commands/WellPathCommands/PointTangentManipulator/RicWellTarget3dEditor.h +++ b/ApplicationLibCode/Commands/WellPathCommands/PointTangentManipulator/RicWellTarget3dEditor.h @@ -20,18 +20,19 @@ #include "Ric3dObjectEditorHandle.h" -class RicPointTangentManipulator; - #include "cvfObject.h" #include "cvfVector3.h" +#include + +class RicPointTangentManipulator; + namespace cvf { class ModelBasicList; } class QString; -#include class RicWellTarget3dEditor : public Ric3dObjectEditorHandle { @@ -50,6 +51,9 @@ private slots: void slotSelectedIn3D(); void slotDragFinished(); +private: + void removeAllFieldEditors(); + private: QPointer m_manipulator; cvf::ref m_cvfModel; diff --git a/ApplicationLibCode/Commands/WellPathCommands/RicNewWellPathLateralAtDepthFeature.cpp b/ApplicationLibCode/Commands/WellPathCommands/RicNewWellPathLateralAtDepthFeature.cpp index adb9bff4fd..ad9b59019d 100644 --- a/ApplicationLibCode/Commands/WellPathCommands/RicNewWellPathLateralAtDepthFeature.cpp +++ b/ApplicationLibCode/Commands/WellPathCommands/RicNewWellPathLateralAtDepthFeature.cpp @@ -100,6 +100,7 @@ RimWellPath* RicNewWellPathLateralAtDepthFeature::createLateralAtMeasuredDepth( ->clippedPointSubset( parentWellPath->wellPathGeometry()->measuredDepths().front(), parentWellMD ); newModeledWellPath->geometryDefinition()->setMdAtFirstTarget( measuredDepths.back() ); + // newModeledWellPath->geometryDefinition()->setReferencePointXyz( pointVector.back() ); newModeledWellPath->geometryDefinition()->setFixedWellPathPoints( pointVector ); newModeledWellPath->geometryDefinition()->setFixedMeasuredDepths( measuredDepths ); } diff --git a/ApplicationLibCode/ProjectDataModel/RimModeledWellPath.cpp b/ApplicationLibCode/ProjectDataModel/RimModeledWellPath.cpp index e4124b4371..4456861c77 100644 --- a/ApplicationLibCode/ProjectDataModel/RimModeledWellPath.cpp +++ b/ApplicationLibCode/ProjectDataModel/RimModeledWellPath.cpp @@ -265,14 +265,15 @@ void RimModeledWellPath::updateTieInLocationFromParentWell() parentWellPath = tieIn->parentWell(); auto targets = m_geometryDefinition->activeWellTargets(); - if ( parentWellPath && !targets.empty() ) + if ( parentWellPath && !targets.empty() && parentWellPath->wellPathGeometry() && + !parentWellPath->wellPathGeometry()->measuredDepths().empty() ) { auto [pointVector, measuredDepths] = parentWellPath->wellPathGeometry() ->clippedPointSubset( parentWellPath->wellPathGeometry()->measuredDepths().front(), tieIn->tieInMeasuredDepth() ); - if ( pointVector.size() > 2u ) + if ( pointVector.size() >= 2u ) { auto firstTarget = targets.front(); firstTarget->setPointXYZ( pointVector.back() ); diff --git a/ApplicationLibCode/ProjectDataModel/RimWellPathGeometryDef.cpp b/ApplicationLibCode/ProjectDataModel/RimWellPathGeometryDef.cpp index 4abd9ccc9e..28f10e61b2 100644 --- a/ApplicationLibCode/ProjectDataModel/RimWellPathGeometryDef.cpp +++ b/ApplicationLibCode/ProjectDataModel/RimWellPathGeometryDef.cpp @@ -84,6 +84,8 @@ RimWellPathGeometryDef::RimWellPathGeometryDef() m_wellTargets.uiCapability()->setUiLabelPosition( caf::PdmUiItemInfo::TOP ); m_wellTargets.uiCapability()->setCustomContextMenuEnabled( true ); + CAF_PDM_InitField( &m_showAbsolutePosForWellTargets, "ShowAbsolutePosForWellTargets", false, "Show UTM Coords", "", "", "" ); + CAF_PDM_InitScriptableField( &m_useAutoGeneratedTargetAtSeaLevel, "UseAutoGeneratedTargetAtSeaLevel", true, @@ -125,6 +127,14 @@ cvf::Vec3d RimWellPathGeometryDef::anchorPointXyz() const return xyz; } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +cvf::Vec3d RimWellPathGeometryDef::anchorPointXyd() const +{ + return m_referencePointUtmXyd(); +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- @@ -284,6 +294,14 @@ double RimWellPathGeometryDef::sphereRadiusFactor() const return m_sphereRadiusFactor(); } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +bool RimWellPathGeometryDef::showAbsoluteCoordinates() const +{ + return m_showAbsolutePosForWellTargets; +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- @@ -459,6 +477,7 @@ void RimWellPathGeometryDef::defineUiOrdering( QString uiConfigName, caf::PdmUiO group->add( &m_sphereColor ); group->add( &m_sphereRadiusFactor ); + uiOrdering.add( &m_showAbsolutePosForWellTargets ); uiOrdering.add( &m_wellTargets ); uiOrdering.add( &m_pickPointsEnabled ); diff --git a/ApplicationLibCode/ProjectDataModel/RimWellPathGeometryDef.h b/ApplicationLibCode/ProjectDataModel/RimWellPathGeometryDef.h index 6cdb415696..c08340c347 100644 --- a/ApplicationLibCode/ProjectDataModel/RimWellPathGeometryDef.h +++ b/ApplicationLibCode/ProjectDataModel/RimWellPathGeometryDef.h @@ -50,6 +50,7 @@ class RimWellPathGeometryDef : public caf::PdmObject ~RimWellPathGeometryDef() override; cvf::Vec3d anchorPointXyz() const; + cvf::Vec3d anchorPointXyd() const; void setReferencePointXyz( const cvf::Vec3d& refPointXyz ); double airGap() const; @@ -87,6 +88,7 @@ class RimWellPathGeometryDef : public caf::PdmObject bool showSpheres() const; cvf::Color3f sphereColor() const; double sphereRadiusFactor() const; + bool showAbsoluteCoordinates() const; protected: void defineCustomContextMenu( const caf::PdmFieldHandle* fieldNeedingMenu, QMenu* menu, QWidget* fieldEditorWidget ) override; @@ -116,13 +118,16 @@ class RimWellPathGeometryDef : public caf::PdmObject caf::PdmField m_airGap; - caf::PdmField m_mdAtFirstTarget; + caf::PdmField m_mdAtFirstTarget; + caf::PdmChildArrayField m_wellTargets; - caf::PdmField m_useAutoGeneratedTargetAtSeaLevel; - caf::PdmChildField m_autoTargetAtSeaLevel; - caf::PdmField m_pickPointsEnabled; - caf::PdmField> m_fixedWellPathPoints; - caf::PdmField> m_fixedMeasuredDepths; + caf::PdmField m_showAbsolutePosForWellTargets; + + caf::PdmField m_useAutoGeneratedTargetAtSeaLevel; + caf::PdmChildField m_autoTargetAtSeaLevel; + caf::PdmField m_pickPointsEnabled; + caf::PdmField> m_fixedWellPathPoints; + caf::PdmField> m_fixedMeasuredDepths; caf::PdmField m_isAttachedToParentWell; diff --git a/ApplicationLibCode/ProjectDataModel/RimWellPathTarget.cpp b/ApplicationLibCode/ProjectDataModel/RimWellPathTarget.cpp index 97dfb1c189..6ce21c2580 100644 --- a/ApplicationLibCode/ProjectDataModel/RimWellPathTarget.cpp +++ b/ApplicationLibCode/ProjectDataModel/RimWellPathTarget.cpp @@ -32,6 +32,7 @@ #include "cafPdmUiCheckBoxEditor.h" #include "cafPdmUiLineEditor.h" +#include "cafPdmUiCommandSystemProxy.h" #include CAF_PDM_SOURCE_INIT( RimWellPathTarget, "WellPathTarget" ); @@ -41,9 +42,9 @@ namespace caf template <> void caf::AppEnum::setUp() { - addItem( RimWellPathTarget::POINT_AND_TANGENT, "POINT_AND_TANGENT", "Point and Tangent" ); - addItem( RimWellPathTarget::POINT, "POINT", "Point" ); - setDefault( RimWellPathTarget::POINT_AND_TANGENT ); + addItem( RimWellPathTarget::TargetTypeEnum::POINT_AND_TANGENT, "POINT_AND_TANGENT", "Point and Tangent" ); + addItem( RimWellPathTarget::TargetTypeEnum::POINT, "POINT", "Point" ); + setDefault( RimWellPathTarget::TargetTypeEnum::POINT_AND_TANGENT ); } } // namespace caf //-------------------------------------------------------------------------------------------------- @@ -51,8 +52,8 @@ void caf::AppEnum::setUp() //-------------------------------------------------------------------------------------------------- RimWellPathTarget::RimWellPathTarget() : moved( this ) - , m_targetType( POINT_AND_TANGENT ) - , m_targetPoint( cvf::Vec3d::ZERO ) + , m_targetType( TargetTypeEnum::POINT_AND_TANGENT ) + , m_targetPointXYD( cvf::Vec3d::ZERO ) , m_azimuth( 0.0 ) , m_inclination( 0.0 ) , m_isFullUpdateEnabled( true ) @@ -67,20 +68,22 @@ RimWellPathTarget::RimWellPathTarget() CAF_PDM_InitField( &m_isEnabled, "IsEnabled", true, "", "", "", "" ); CAF_PDM_InitField( &m_isLocked, "IsLocked", false, "", "", "", "" ); m_isLocked.uiCapability()->setUiHidden( true ); - // m_targetType.uiCapability()->setUiHidden(true); - CAF_PDM_InitScriptableFieldNoDefault( &m_targetPoint, "TargetPoint", "Point", "", "", "" ); + + CAF_PDM_InitScriptableFieldNoDefault( &m_targetPointXYD, "TargetPoint", "Relative Coord", "", "", "" ); + CAF_PDM_InitScriptableFieldNoDefault( &m_targetPointForDisplay, "TargetPointForDisplay", "UTM Coord", "", "", "" ); + m_targetPointForDisplay.registerGetMethod( this, &RimWellPathTarget::targetPointForDisplayXYD ); + m_targetPointForDisplay.registerSetMethod( this, &RimWellPathTarget::setTargetPointFromDisplayCoord ); + CAF_PDM_InitScriptableField( &m_dogleg1, "Dogleg1", 3.0, "DL in", "", "[deg/30m]", "" ); CAF_PDM_InitScriptableField( &m_dogleg2, "Dogleg2", 3.0, "DL out", "", "[deg/30m]", "" ); + CAF_PDM_InitFieldNoDefault( &m_targetType, "TargetType", "Type", "", "", "" ); m_targetType.uiCapability()->setUiHidden( true ); + CAF_PDM_InitField( &m_hasTangentConstraintUiField, "HasTangentConstraint", false, "Dir", "", "", "" ); m_hasTangentConstraintUiField.xmlCapability()->disableIO(); CAF_PDM_InitScriptableField( &m_azimuth, "Azimuth", 0.0, "Azi(deg)", "", "", "" ); CAF_PDM_InitScriptableField( &m_inclination, "Inclination", 0.0, "Inc(deg)", "", "", "" ); - - CAF_PDM_InitFieldNoDefault( &m_parentWellPath, "ParentWellPath", "Parent Well Path", "", "", "" ); - - m_parentWellPath.uiCapability()->setUiHidden( true ); } //-------------------------------------------------------------------------------------------------- @@ -111,7 +114,7 @@ bool RimWellPathTarget::isEnabled() const //-------------------------------------------------------------------------------------------------- void RimWellPathTarget::setPointXYZ( const cvf::Vec3d& point ) { - m_targetPoint = { point.x(), point.y(), -point.z() }; + m_targetPointXYD = { point.x(), point.y(), -point.z() }; } //-------------------------------------------------------------------------------------------------- @@ -119,10 +122,10 @@ void RimWellPathTarget::setPointXYZ( const cvf::Vec3d& point ) //-------------------------------------------------------------------------------------------------- void RimWellPathTarget::setAsPointTargetXYD( const cvf::Vec3d& point ) { - m_targetType = POINT; - m_targetPoint = point; - m_azimuth = 0.0; - m_inclination = 0.0; + m_targetType = TargetTypeEnum::POINT; + m_targetPointXYD = point; + m_azimuth = 0.0; + m_inclination = 0.0; } //-------------------------------------------------------------------------------------------------- @@ -130,10 +133,10 @@ void RimWellPathTarget::setAsPointTargetXYD( const cvf::Vec3d& point ) //-------------------------------------------------------------------------------------------------- void RimWellPathTarget::setAsPointTargetXYZ( const cvf::Vec3d& point ) { - m_targetType = POINT; - m_targetPoint = cvf::Vec3d( point.x(), point.y(), -point.z() ); - m_azimuth = 0.0; - m_inclination = 0.0; + m_targetType = TargetTypeEnum::POINT; + m_targetPointXYD = cvf::Vec3d( point.x(), point.y(), -point.z() ); + m_azimuth = 0.0; + m_inclination = 0.0; } //-------------------------------------------------------------------------------------------------- @@ -150,10 +153,10 @@ void RimWellPathTarget::setAsPointXYZAndTangentTarget( const cvf::Vec3d& point, //-------------------------------------------------------------------------------------------------- void RimWellPathTarget::setAsPointXYZAndTangentTarget( const cvf::Vec3d& point, double azimuth, double inclination ) { - m_targetType = POINT_AND_TANGENT; - m_targetPoint = cvf::Vec3d( point.x(), point.y(), -point.z() ); - m_azimuth = cvf::Math::toDegrees( azimuth ); - m_inclination = cvf::Math::toDegrees( inclination ); + m_targetType = TargetTypeEnum::POINT_AND_TANGENT; + m_targetPointXYD = cvf::Vec3d( point.x(), point.y(), -point.z() ); + m_azimuth = cvf::Math::toDegrees( azimuth ); + m_inclination = cvf::Math::toDegrees( inclination ); } //-------------------------------------------------------------------------------------------------- @@ -161,13 +164,23 @@ void RimWellPathTarget::setAsPointXYZAndTangentTarget( const cvf::Vec3d& point, //-------------------------------------------------------------------------------------------------- void RimWellPathTarget::setDerivedTangent( double azimuth, double inclination ) { - if ( m_targetType == POINT ) + if ( m_targetType == TargetTypeEnum::POINT ) { m_azimuth = cvf::Math::toDegrees( azimuth ); m_inclination = cvf::Math::toDegrees( inclination ); } } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimWellPathTarget::updateFrom3DManipulator( const cvf::Vec3d& pointXYD ) +{ + enableFullUpdate( false ); + m_targetPointXYD.setValueWithFieldChanged( pointXYD ); + enableFullUpdate( true ); +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- @@ -176,7 +189,7 @@ RiaLineArcWellPathCalculator::WellTarget RimWellPathTarget::wellTargetData() RiaLineArcWellPathCalculator::WellTarget targetData; targetData.targetPointXYZ = targetPointXYZ(); - targetData.isTangentConstrained = ( targetType() == POINT_AND_TANGENT ); + targetData.isTangentConstrained = ( targetType() == TargetTypeEnum::POINT_AND_TANGENT ); targetData.azimuth = azimuth(); targetData.inclination = inclination(); targetData.radius1 = radius1(); @@ -198,7 +211,7 @@ RimWellPathTarget::TargetTypeEnum RimWellPathTarget::targetType() const //-------------------------------------------------------------------------------------------------- cvf::Vec3d RimWellPathTarget::targetPointXYZ() const { - cvf::Vec3d xyzPoint( m_targetPoint() ); + cvf::Vec3d xyzPoint( m_targetPointXYD() ); xyzPoint.z() = -xyzPoint.z(); return xyzPoint; } @@ -208,7 +221,7 @@ cvf::Vec3d RimWellPathTarget::targetPointXYZ() const //-------------------------------------------------------------------------------------------------- double RimWellPathTarget::azimuth() const { - if ( m_targetType() == POINT_AND_TANGENT ) + if ( m_targetType() == TargetTypeEnum::POINT_AND_TANGENT ) { return cvf::Math::toRadians( m_azimuth ); } @@ -223,7 +236,7 @@ double RimWellPathTarget::azimuth() const //-------------------------------------------------------------------------------------------------- double RimWellPathTarget::inclination() const { - if ( m_targetType() == POINT_AND_TANGENT ) + if ( m_targetType() == TargetTypeEnum::POINT_AND_TANGENT ) { return cvf::Math::toRadians( m_inclination ); } @@ -338,6 +351,14 @@ void RimWellPathTarget::flagRadius2AsIncorrect( bool isEditable, bool isIncorrec m_dogleg2.uiCapability()->setUiReadOnly( !isEditable ); } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +std::vector RimWellPathTarget::fieldsFor3dManipulator() +{ + return { &m_targetType, &m_targetPointXYD, &m_azimuth, &m_inclination }; +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- @@ -361,17 +382,75 @@ void RimWellPathTarget::defineEditorAttribute( const caf::PdmFieldHandle* field, QString uiConfigName, caf::PdmUiEditorAttribute* attribute ) { - if ( field == &m_targetPoint ) + if ( field == &m_targetPointXYD ) { auto uiDisplayStringAttr = dynamic_cast( attribute ); if ( uiDisplayStringAttr ) { - uiDisplayStringAttr->m_displayString = QString::number( m_targetPoint()[0], 'f', 2 ) + " " + - QString::number( m_targetPoint()[1], 'f', 2 ) + " " + - QString::number( m_targetPoint()[2], 'f', 2 ); + uiDisplayStringAttr->m_displayString = QString::number( m_targetPointXYD()[0], 'f', 2 ) + " " + + QString::number( m_targetPointXYD()[1], 'f', 2 ) + " " + + QString::number( m_targetPointXYD()[2], 'f', 2 ); } } + else if ( field == &m_targetPointForDisplay ) + { + auto uiDisplayStringAttr = dynamic_cast( attribute ); + + if ( uiDisplayStringAttr ) + { + uiDisplayStringAttr->m_displayString = QString::number( m_targetPointForDisplay()[0], 'f', 2 ) + " " + + QString::number( m_targetPointForDisplay()[1], 'f', 2 ) + " " + + QString::number( m_targetPointForDisplay()[2], 'f', 2 ); + } + } +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +cvf::Vec3d RimWellPathTarget::targetPointForDisplayXYD() const +{ + auto geoDef = geometryDefinition(); + if ( geoDef && geoDef->showAbsoluteCoordinates() ) + { + auto offsetXYZ = geoDef->anchorPointXyz(); + + auto coordXYD = targetPointXYZ() + offsetXYZ; + coordXYD.z() = -coordXYD.z(); + + return coordXYD; + } + + return m_targetPointXYD(); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimWellPathTarget::setTargetPointFromDisplayCoord( const cvf::Vec3d& coordInXYD ) +{ + cvf::Vec3d offsetXYD = cvf::Vec3d::ZERO; + + auto geoDef = geometryDefinition(); + if ( geoDef && geoDef->showAbsoluteCoordinates() ) + { + offsetXYD = geoDef->anchorPointXyd(); + } + + auto newCoordInXYD = coordInXYD - offsetXYD; + m_targetPointXYD = newCoordInXYD; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RimWellPathGeometryDef* RimWellPathTarget::geometryDefinition() const +{ + RimWellPathGeometryDef* geoDef = nullptr; + this->firstAncestorOfType( geoDef ); + + return geoDef; } //-------------------------------------------------------------------------------------------------- @@ -385,11 +464,12 @@ QList RimWellPathTarget::calculateValueOptions( const ca { options.push_back( caf::PdmOptionItemInfo( "o->", - RimWellPathTarget::POINT_AND_TANGENT ) ); //, false, - // QIcon(":/WellTargetPointTangent16x16.png") - //)); - options.push_back( caf::PdmOptionItemInfo( "o", RimWellPathTarget::POINT ) ); //, false, - // QIcon(":/WellTargetPoint16x16.png"))); + RimWellPathTarget::TargetTypeEnum::POINT_AND_TANGENT ) ); //, false, + // QIcon(":/WellTargetPointTangent16x16.png") + //)); + options.push_back( + caf::PdmOptionItemInfo( "o", RimWellPathTarget::TargetTypeEnum::POINT ) ); //, false, + // QIcon(":/WellTargetPoint16x16.png"))); } return options; } @@ -404,9 +484,9 @@ void RimWellPathTarget::fieldChangedByUi( const caf::PdmFieldHandle* changedFiel if ( changedField == &m_hasTangentConstraintUiField ) { if ( m_hasTangentConstraintUiField ) - m_targetType = POINT_AND_TANGENT; + m_targetType = TargetTypeEnum::POINT_AND_TANGENT; else - m_targetType = POINT; + m_targetType = TargetTypeEnum::POINT; } moved.send( m_isFullUpdateEnabled ); @@ -417,15 +497,15 @@ void RimWellPathTarget::fieldChangedByUi( const caf::PdmFieldHandle* changedFiel //-------------------------------------------------------------------------------------------------- void RimWellPathTarget::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) { - m_hasTangentConstraintUiField = ( m_targetType == POINT_AND_TANGENT ); + m_hasTangentConstraintUiField = ( m_targetType == TargetTypeEnum::POINT_AND_TANGENT ); if ( m_isEnabled() && !m_isLocked() ) { m_hasTangentConstraintUiField.uiCapability()->setUiReadOnly( false ); m_targetType.uiCapability()->setUiReadOnly( false ); - m_targetPoint.uiCapability()->setUiReadOnly( false ); + m_targetPointXYD.uiCapability()->setUiReadOnly( false ); - if ( m_targetType == POINT ) + if ( m_targetType == TargetTypeEnum::POINT ) { m_azimuth.uiCapability()->setUiReadOnly( true ); m_inclination.uiCapability()->setUiReadOnly( true ); @@ -440,7 +520,7 @@ void RimWellPathTarget::defineUiOrdering( QString uiConfigName, caf::PdmUiOrderi { m_dogleg1.uiCapability()->setUiReadOnly( true ); m_targetType.uiCapability()->setUiReadOnly( true ); - m_targetPoint.uiCapability()->setUiReadOnly( true ); + m_targetPointXYD.uiCapability()->setUiReadOnly( true ); m_azimuth.uiCapability()->setUiReadOnly( true ); m_inclination.uiCapability()->setUiReadOnly( true ); m_dogleg2.uiCapability()->setUiReadOnly( true ); @@ -451,4 +531,15 @@ void RimWellPathTarget::defineUiOrdering( QString uiConfigName, caf::PdmUiOrderi { m_isEnabled.uiCapability()->setUiReadOnly( true ); } + + { + bool showAbsCoords = false; + auto geoDef = geometryDefinition(); + if ( geoDef && geoDef->showAbsoluteCoordinates() ) + { + showAbsCoords = true; + } + + m_targetPointForDisplay.uiCapability()->setUiHidden( !showAbsCoords ); + } } diff --git a/ApplicationLibCode/ProjectDataModel/RimWellPathTarget.h b/ApplicationLibCode/ProjectDataModel/RimWellPathTarget.h index 88780b709e..e21ea7e5a2 100644 --- a/ApplicationLibCode/ProjectDataModel/RimWellPathTarget.h +++ b/ApplicationLibCode/ProjectDataModel/RimWellPathTarget.h @@ -20,13 +20,15 @@ #include "cafPdmObject.h" #include "RiaLineArcWellPathCalculator.h" + #include "cafAppEnum.h" #include "cafPdmCoreVec3d.h" #include "cafPdmField.h" +#include "cafPdmProxyValueField.h" #include "cafPdmPtrField.h" #include "cvfVector3.h" -class RimWellPath; +class RimWellPathGeometryDef; class RimWellPathTarget : public caf::PdmObject { @@ -48,14 +50,16 @@ class RimWellPathTarget : public caf::PdmObject void setAsPointXYZAndTangentTarget( const cvf::Vec3d& point, const cvf::Vec3d& tangent ); void setAsPointXYZAndTangentTarget( const cvf::Vec3d& point, double azimuth, double inclination ); void setDerivedTangent( double azimuth, double inclination ); + void updateFrom3DManipulator( const cvf::Vec3d& pointXYD ); RiaLineArcWellPathCalculator::WellTarget wellTargetData(); - enum TargetTypeEnum + enum class TargetTypeEnum { POINT_AND_TANGENT, POINT }; + TargetTypeEnum targetType() const; cvf::Vec3d targetPointXYZ() const; double azimuth() const; @@ -66,6 +70,8 @@ class RimWellPathTarget : public caf::PdmObject void flagRadius1AsIncorrect( bool isEditable, bool isIncorrect, double actualRadius ); void flagRadius2AsIncorrect( bool isEditable, bool isIncorrect, double actualRadius ); + std::vector fieldsFor3dManipulator(); + void onMoved(); private: @@ -77,19 +83,22 @@ class RimWellPathTarget : public caf::PdmObject QString uiConfigName, caf::PdmUiEditorAttribute* attribute ) override; + cvf::Vec3d targetPointForDisplayXYD() const; + void setTargetPointFromDisplayCoord( const cvf::Vec3d& coordInXYZ ); + + RimWellPathGeometryDef* geometryDefinition() const; + private: - friend class RicWellTarget3dEditor; void enableFullUpdate( bool enable ); bool m_isFullUpdateEnabled; caf::PdmField m_isEnabled; caf::PdmField m_isLocked; caf::PdmField> m_targetType; - caf::PdmField m_targetPoint; + caf::PdmField m_targetPointXYD; + caf::PdmProxyValueField m_targetPointForDisplay; caf::PdmField m_azimuth; caf::PdmField m_inclination; caf::PdmField m_dogleg1; caf::PdmField m_dogleg2; caf::PdmField m_hasTangentConstraintUiField; - - caf::PdmPtrField m_parentWellPath; }; diff --git a/ApplicationLibCode/ProjectDataModel/RimWellPathTieIn.cpp b/ApplicationLibCode/ProjectDataModel/RimWellPathTieIn.cpp index 1158a25e86..8bf6b7ad07 100644 --- a/ApplicationLibCode/ProjectDataModel/RimWellPathTieIn.cpp +++ b/ApplicationLibCode/ProjectDataModel/RimWellPathTieIn.cpp @@ -30,8 +30,6 @@ #include "RiuMainWindow.h" -#include "cafPdmFieldScriptingCapability.h" -#include "cafPdmObjectScriptingCapability.h" #include "cafPdmUiDoubleValueEditor.h" CAF_PDM_SOURCE_INIT( RimWellPathTieIn, "RimWellPathTieIn" ); @@ -48,15 +46,9 @@ RimWellPathTieIn::RimWellPathTieIn() CAF_PDM_InitFieldNoDefault( &m_tieInMeasuredDepth, "TieInMeasuredDepth", "Tie In Measured Depth", "", "", "" ); m_tieInMeasuredDepth.uiCapability()->setUiEditorTypeName( caf::PdmUiDoubleValueEditor::uiEditorTypeName() ); - CAF_PDM_InitScriptableField( &m_addValveAtConnection, - "AddValveAtConnection", - false, - "Add Outlet Valve for Branches", - "", - "", - "" ); + CAF_PDM_InitField( &m_addValveAtConnection, "AddValveAtConnection", false, "Add Outlet Valve for Branches", "", "", "" ); - CAF_PDM_InitScriptableFieldNoDefault( &m_valve, "Valve", "Branch Outlet Valve", "", "", "" ); + CAF_PDM_InitFieldNoDefault( &m_valve, "Valve", "Branch Outlet Valve", "", "", "" ); m_valve = new RimWellPathValve; } From d818a01b79d7b9f1eedd88c04ce90b3857766a98 Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Mon, 28 Jun 2021 11:18:04 +0200 Subject: [PATCH 024/308] #7811 Modeled Well Path : Optionally use refpoint from top level well path --- .../RicWellTarget3dEditor.cpp | 15 ++++++++++ .../RicNewWellPathLateralAtDepthFeature.cpp | 2 +- .../ProjectDataModel/RimModeledWellPath.cpp | 30 +++++++++++++++++-- .../ProjectDataModel/RimModeledWellPath.h | 1 + .../RimWellPathGeometryDef.cpp | 28 ++++++++++++++++- .../ProjectDataModel/RimWellPathGeometryDef.h | 3 ++ .../ProjectDataModel/RimWellPathTarget.cpp | 1 - .../ProjectDataModel/RimWellPathTieIn.cpp | 12 ++++++-- 8 files changed, 83 insertions(+), 9 deletions(-) diff --git a/ApplicationLibCode/Commands/WellPathCommands/PointTangentManipulator/RicWellTarget3dEditor.cpp b/ApplicationLibCode/Commands/WellPathCommands/PointTangentManipulator/RicWellTarget3dEditor.cpp index 45e0241a9a..46cb304d21 100644 --- a/ApplicationLibCode/Commands/WellPathCommands/PointTangentManipulator/RicWellTarget3dEditor.cpp +++ b/ApplicationLibCode/Commands/WellPathCommands/PointTangentManipulator/RicWellTarget3dEditor.cpp @@ -140,6 +140,21 @@ void RicWellTarget3dEditor::slotUpdated( const cvf::Vec3d& origin, const cvf::Ve target->firstAncestorOrThisOfTypeAsserted( geomDef ); if ( !geomDef ) return; + if ( geomDef->useReferencePointFromTopLevelWell() ) + { + RimModeledWellPath* modeledWellPath = nullptr; + geomDef->firstAncestorOfType( modeledWellPath ); + if ( modeledWellPath ) + { + auto topLevelWellPath = dynamic_cast( modeledWellPath->topLevelWellPath() ); + if ( topLevelWellPath ) + { + // Manipulate the reference point of top level well path + geomDef = topLevelWellPath->geometryDefinition(); + } + } + } + cvf::ref dispXf = view->displayCoordTransform(); auto domainCoordXYZ = dispXf->transformToDomainCoord( origin ); diff --git a/ApplicationLibCode/Commands/WellPathCommands/RicNewWellPathLateralAtDepthFeature.cpp b/ApplicationLibCode/Commands/WellPathCommands/RicNewWellPathLateralAtDepthFeature.cpp index ad9b59019d..f1d2e85470 100644 --- a/ApplicationLibCode/Commands/WellPathCommands/RicNewWellPathLateralAtDepthFeature.cpp +++ b/ApplicationLibCode/Commands/WellPathCommands/RicNewWellPathLateralAtDepthFeature.cpp @@ -92,6 +92,7 @@ RimWellPath* RicNewWellPathLateralAtDepthFeature::createLateralAtMeasuredDepth( if ( project && wellPathColl ) { auto newModeledWellPath = new RimModeledWellPath(); + newModeledWellPath->geometryDefinition()->enableReferencePointFromTopLevelWell( true ); if ( parentWellPath->wellPathGeometry() && parentWellPath->wellPathGeometry()->measuredDepths().size() > 2 ) { @@ -100,7 +101,6 @@ RimWellPath* RicNewWellPathLateralAtDepthFeature::createLateralAtMeasuredDepth( ->clippedPointSubset( parentWellPath->wellPathGeometry()->measuredDepths().front(), parentWellMD ); newModeledWellPath->geometryDefinition()->setMdAtFirstTarget( measuredDepths.back() ); - // newModeledWellPath->geometryDefinition()->setReferencePointXyz( pointVector.back() ); newModeledWellPath->geometryDefinition()->setFixedWellPathPoints( pointVector ); newModeledWellPath->geometryDefinition()->setFixedMeasuredDepths( measuredDepths ); } diff --git a/ApplicationLibCode/ProjectDataModel/RimModeledWellPath.cpp b/ApplicationLibCode/ProjectDataModel/RimModeledWellPath.cpp index 4456861c77..3da249c091 100644 --- a/ApplicationLibCode/ProjectDataModel/RimModeledWellPath.cpp +++ b/ApplicationLibCode/ProjectDataModel/RimModeledWellPath.cpp @@ -275,14 +275,21 @@ void RimModeledWellPath::updateTieInLocationFromParentWell() if ( pointVector.size() >= 2u ) { - auto firstTarget = targets.front(); - firstTarget->setPointXYZ( pointVector.back() ); - m_geometryDefinition->setIsAttachedToParentWell( true ); m_geometryDefinition->setMdAtFirstTarget( measuredDepths.back() ); m_geometryDefinition->setFixedWellPathPoints( pointVector ); m_geometryDefinition->setFixedMeasuredDepths( measuredDepths ); + updateReferencePoint(); + + auto lastPointXYZ = pointVector.back(); + + cvf::Vec3d referencePointXYZ = m_geometryDefinition->anchorPointXyz(); + cvf::Vec3d relativePointXYZ = lastPointXYZ - referencePointXYZ; + + auto firstTarget = targets.front(); + firstTarget->setPointXYZ( relativePointXYZ ); + updateGeometry( true ); } } @@ -295,3 +302,20 @@ void RimModeledWellPath::updateTieInLocationFromParentWell() m_geometryDefinition->setFixedMeasuredDepths( {} ); } } + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimModeledWellPath::updateReferencePoint() +{ + if ( !m_geometryDefinition->useReferencePointFromTopLevelWell() ) return; + + RimWellPathTieIn* tieIn = wellPathTieIn(); + if ( !tieIn ) return; + + auto topLevelModelledWell = dynamic_cast( this->topLevelWellPath() ); + if ( !topLevelModelledWell ) return; + + auto refPoint = topLevelModelledWell->geometryDefinition()->anchorPointXyz(); + m_geometryDefinition->setReferencePointXyz( refPoint ); +} diff --git a/ApplicationLibCode/ProjectDataModel/RimModeledWellPath.h b/ApplicationLibCode/ProjectDataModel/RimModeledWellPath.h index 3f6f23c0e2..39ae1e880f 100644 --- a/ApplicationLibCode/ProjectDataModel/RimModeledWellPath.h +++ b/ApplicationLibCode/ProjectDataModel/RimModeledWellPath.h @@ -40,6 +40,7 @@ class RimModeledWellPath : public RimWellPath RimWellPathGeometryDef* geometryDefinition() const; QString wellPlanText(); void updateTieInLocationFromParentWell(); + void updateReferencePoint(); private: void defineUiTreeOrdering( caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName ) override; diff --git a/ApplicationLibCode/ProjectDataModel/RimWellPathGeometryDef.cpp b/ApplicationLibCode/ProjectDataModel/RimWellPathGeometryDef.cpp index 28f10e61b2..7c04009259 100644 --- a/ApplicationLibCode/ProjectDataModel/RimWellPathGeometryDef.cpp +++ b/ApplicationLibCode/ProjectDataModel/RimWellPathGeometryDef.cpp @@ -85,6 +85,13 @@ RimWellPathGeometryDef::RimWellPathGeometryDef() m_wellTargets.uiCapability()->setCustomContextMenuEnabled( true ); CAF_PDM_InitField( &m_showAbsolutePosForWellTargets, "ShowAbsolutePosForWellTargets", false, "Show UTM Coords", "", "", "" ); + CAF_PDM_InitField( &m_useTopLevelWellReferencePoint, + "UseTopLevelWellReferencePoint", + false, + "Use Top Level Well Reference Point", + "", + "", + "" ); CAF_PDM_InitScriptableField( &m_useAutoGeneratedTargetAtSeaLevel, "UseAutoGeneratedTargetAtSeaLevel", @@ -145,6 +152,22 @@ void RimWellPathGeometryDef::setReferencePointXyz( const cvf::Vec3d& refPointXyz m_referencePointUtmXyd = xyd; } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +bool RimWellPathGeometryDef::useReferencePointFromTopLevelWell() const +{ + return m_useTopLevelWellReferencePoint; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimWellPathGeometryDef::enableReferencePointFromTopLevelWell( bool enable ) +{ + m_useTopLevelWellReferencePoint = enable; +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- @@ -464,9 +487,12 @@ void RimWellPathGeometryDef::fieldChangedByUi( const caf::PdmFieldHandle* change //-------------------------------------------------------------------------------------------------- void RimWellPathGeometryDef::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) { + uiOrdering.add( &m_referencePointUtmXyd ); + uiOrdering.add( &m_useTopLevelWellReferencePoint ); + m_referencePointUtmXyd.uiCapability()->setUiReadOnly( m_useTopLevelWellReferencePoint ); + if ( !m_isAttachedToParentWell ) { - uiOrdering.add( &m_referencePointUtmXyd ); uiOrdering.add( &m_airGap ); uiOrdering.add( &m_mdAtFirstTarget ); uiOrdering.add( &m_useAutoGeneratedTargetAtSeaLevel ); diff --git a/ApplicationLibCode/ProjectDataModel/RimWellPathGeometryDef.h b/ApplicationLibCode/ProjectDataModel/RimWellPathGeometryDef.h index c08340c347..ec819387ef 100644 --- a/ApplicationLibCode/ProjectDataModel/RimWellPathGeometryDef.h +++ b/ApplicationLibCode/ProjectDataModel/RimWellPathGeometryDef.h @@ -52,6 +52,8 @@ class RimWellPathGeometryDef : public caf::PdmObject cvf::Vec3d anchorPointXyz() const; cvf::Vec3d anchorPointXyd() const; void setReferencePointXyz( const cvf::Vec3d& refPointXyz ); + bool useReferencePointFromTopLevelWell() const; + void enableReferencePointFromTopLevelWell( bool enable ); double airGap() const; void setAirGap( double airGap ); @@ -122,6 +124,7 @@ class RimWellPathGeometryDef : public caf::PdmObject caf::PdmChildArrayField m_wellTargets; caf::PdmField m_showAbsolutePosForWellTargets; + caf::PdmField m_useTopLevelWellReferencePoint; caf::PdmField m_useAutoGeneratedTargetAtSeaLevel; caf::PdmChildField m_autoTargetAtSeaLevel; diff --git a/ApplicationLibCode/ProjectDataModel/RimWellPathTarget.cpp b/ApplicationLibCode/ProjectDataModel/RimWellPathTarget.cpp index 6ce21c2580..b8f1a1f193 100644 --- a/ApplicationLibCode/ProjectDataModel/RimWellPathTarget.cpp +++ b/ApplicationLibCode/ProjectDataModel/RimWellPathTarget.cpp @@ -32,7 +32,6 @@ #include "cafPdmUiCheckBoxEditor.h" #include "cafPdmUiLineEditor.h" -#include "cafPdmUiCommandSystemProxy.h" #include CAF_PDM_SOURCE_INIT( RimWellPathTarget, "WellPathTarget" ); diff --git a/ApplicationLibCode/ProjectDataModel/RimWellPathTieIn.cpp b/ApplicationLibCode/ProjectDataModel/RimWellPathTieIn.cpp index 8bf6b7ad07..2c16124f7f 100644 --- a/ApplicationLibCode/ProjectDataModel/RimWellPathTieIn.cpp +++ b/ApplicationLibCode/ProjectDataModel/RimWellPathTieIn.cpp @@ -127,9 +127,15 @@ void RimWellPathTieIn::updateFirstTargetFromParentWell() newTarget = modeledWellPath->geometryDefinition()->activeWellTargets().front(); } - auto lastPoint = pointVector.back(); - auto tangent = lastPoint - pointVector[pointVector.size() - 2]; - newTarget->setAsPointXYZAndTangentTarget( { lastPoint[0], lastPoint[1], lastPoint[2] }, tangent ); + auto lastPointXYZ = pointVector.back(); + auto tangent = lastPointXYZ - pointVector[pointVector.size() - 2]; + + modeledWellPath->updateReferencePoint(); + cvf::Vec3d referencePointXYZ = modeledWellPath->geometryDefinition()->anchorPointXyz(); + cvf::Vec3d relativePointXYZ = lastPointXYZ - referencePointXYZ; + + newTarget->setAsPointXYZAndTangentTarget( { relativePointXYZ[0], relativePointXYZ[1], relativePointXYZ[2] }, + tangent ); } } From 5e5d5cb0a652d170c4ba79155d7000bcdc57ac88 Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Tue, 29 Jun 2021 11:25:50 +0200 Subject: [PATCH 025/308] Add dev-postfix to version text --- ResInsightVersion.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ResInsightVersion.cmake b/ResInsightVersion.cmake index 54256664b5..4f0b3b56bf 100644 --- a/ResInsightVersion.cmake +++ b/ResInsightVersion.cmake @@ -4,14 +4,14 @@ set(RESINSIGHT_MINOR_VERSION 06) set(RESINSIGHT_PATCH_VERSION 0) # Opional text with no restrictions -# set(RESINSIGHT_VERSION_TEXT "-dev") +set(RESINSIGHT_VERSION_TEXT "-dev") # set(RESINSIGHT_VERSION_TEXT "-RC_03") # Optional text # Must be unique and increasing within one combination of major/minor/patch version # The uniqueness of this text is independent of RESINSIGHT_VERSION_TEXT # Format of text must be ".xx" -# set(RESINSIGHT_DEV_VERSION ".11") +set(RESINSIGHT_DEV_VERSION ".01") # https://github.com/CRAVA/crava/tree/master/libs/nrlib set(NRLIB_GITHUB_SHA "ba35d4359882f1c6f5e9dc30eb95fe52af50fd6f") From 95463c65212d968fba3dc0ada3984a953da6be3f Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Thu, 24 Jun 2021 13:17:43 +0200 Subject: [PATCH 026/308] #7811 Modeled Well Path : Add copy/paste of a modeled well path --- .../RicCopyReferencesToClipboardFeature.cpp | 5 + .../WellPathCommands/CMakeLists_files.cmake | 2 + .../RicPasteModeledWellPathFeature.cpp | 114 ++++++++++++++++++ .../RicPasteModeledWellPathFeature.h | 38 ++++++ .../RimContextCommandBuilder.cpp | 1 + .../RimWellPathCollection.cpp | 7 +- 6 files changed, 163 insertions(+), 4 deletions(-) create mode 100644 ApplicationLibCode/Commands/WellPathCommands/RicPasteModeledWellPathFeature.cpp create mode 100644 ApplicationLibCode/Commands/WellPathCommands/RicPasteModeledWellPathFeature.h diff --git a/ApplicationLibCode/Commands/OperationsUsingObjReferences/RicCopyReferencesToClipboardFeature.cpp b/ApplicationLibCode/Commands/OperationsUsingObjReferences/RicCopyReferencesToClipboardFeature.cpp index 064862a03a..5354c46ef8 100644 --- a/ApplicationLibCode/Commands/OperationsUsingObjReferences/RicCopyReferencesToClipboardFeature.cpp +++ b/ApplicationLibCode/Commands/OperationsUsingObjReferences/RicCopyReferencesToClipboardFeature.cpp @@ -29,6 +29,7 @@ #include "RimGridCrossPlotCurve.h" #include "RimGridCrossPlotDataSet.h" #include "RimMimeData.h" +#include "RimModeledWellPath.h" #include "RimSummaryCurveFilter.h" #include "RimSummaryPlot.h" #include "RimWellAllocationPlot.h" @@ -177,6 +178,10 @@ bool RicCopyReferencesToClipboardFeature::isCopyOfObjectSupported( caf::PdmObjec { return true; } + else if ( dynamic_cast( pdmObject ) ) + { + return true; + } return false; } diff --git a/ApplicationLibCode/Commands/WellPathCommands/CMakeLists_files.cmake b/ApplicationLibCode/Commands/WellPathCommands/CMakeLists_files.cmake index 1eb7525036..169d79b8c3 100644 --- a/ApplicationLibCode/Commands/WellPathCommands/CMakeLists_files.cmake +++ b/ApplicationLibCode/Commands/WellPathCommands/CMakeLists_files.cmake @@ -19,6 +19,7 @@ ${CMAKE_CURRENT_LIST_DIR}/RicDeletePolylineTargetFeature.h ${CMAKE_CURRENT_LIST_DIR}/RicImportWellMeasurementsFeature.h ${CMAKE_CURRENT_LIST_DIR}/RicNewWellPathLateralAtDepthFeature.h ${CMAKE_CURRENT_LIST_DIR}/RicNewWellPathLateralFeature.h +${CMAKE_CURRENT_LIST_DIR}/RicPasteModeledWellPathFeature.h ${CMAKE_CURRENT_LIST_DIR}/PointTangentManipulator/Ric3dObjectEditorHandle.h ${CMAKE_CURRENT_LIST_DIR}/PointTangentManipulator/RicPointTangentManipulator.h ${CMAKE_CURRENT_LIST_DIR}/PointTangentManipulator/RicWellTarget3dEditor.h @@ -48,6 +49,7 @@ ${CMAKE_CURRENT_LIST_DIR}/RicDeletePolylineTargetFeature.cpp ${CMAKE_CURRENT_LIST_DIR}/RicImportWellMeasurementsFeature.cpp ${CMAKE_CURRENT_LIST_DIR}/RicNewWellPathLateralAtDepthFeature.cpp ${CMAKE_CURRENT_LIST_DIR}/RicNewWellPathLateralFeature.cpp +${CMAKE_CURRENT_LIST_DIR}/RicPasteModeledWellPathFeature.cpp ${CMAKE_CURRENT_LIST_DIR}/PointTangentManipulator/Ric3dObjectEditorHandle.cpp ${CMAKE_CURRENT_LIST_DIR}/PointTangentManipulator/RicPointTangentManipulator.cpp ${CMAKE_CURRENT_LIST_DIR}/PointTangentManipulator/RicWellTarget3dEditor.cpp diff --git a/ApplicationLibCode/Commands/WellPathCommands/RicPasteModeledWellPathFeature.cpp b/ApplicationLibCode/Commands/WellPathCommands/RicPasteModeledWellPathFeature.cpp new file mode 100644 index 0000000000..bda7fae355 --- /dev/null +++ b/ApplicationLibCode/Commands/WellPathCommands/RicPasteModeledWellPathFeature.cpp @@ -0,0 +1,114 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2021- Equinor ASA +// +// ResInsight is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// + +#include "RicPasteModeledWellPathFeature.h" + +CAF_CMD_SOURCE_INIT( RicPasteModeledWellPathFeature, "RicPasteModeledWellPathFeature" ); + +#include "OperationsUsingObjReferences/RicPasteFeatureImpl.h" + +#include "RimModeledWellPath.h" +#include "RimOilField.h" +#include "RimWellPathCollection.h" + +#include "cafPdmObjectGroup.h" +#include "cafSelectionManager.h" + +#include + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +bool RicPasteModeledWellPathFeature::isCommandEnabled() +{ + if ( !modeledWellPaths().empty() ) return true; + { + std::vector objects; + caf::SelectionManager::instance()->objectsByType( &objects ); + + if ( objects.size() > 0 ) + { + return true; + } + } + + return false; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RicPasteModeledWellPathFeature::onActionTriggered( bool isChecked ) +{ + if ( modeledWellPaths().empty() ) return; + + RimProject* proj = RimProject::current(); + + if ( proj && proj->activeOilField() ) + { + RimWellPathCollection* wellPathCollection = proj->activeOilField()->wellPathCollection(); + + if ( wellPathCollection ) + { + for ( auto souceWellPath : modeledWellPaths() ) + { + RimModeledWellPath* newModeledWellPath = dynamic_cast( + souceWellPath->xmlCapability()->copyByXmlSerialization( caf::PdmDefaultObjectFactory::instance() ) ); + + QString name = souceWellPath->name() + " (copy)"; + newModeledWellPath->setName( name ); + + wellPathCollection->addWellPath( newModeledWellPath, false ); + wellPathCollection->uiCapability()->updateConnectedEditors(); + + proj->scheduleCreateDisplayModelAndRedrawAllViews(); + + Riu3DMainWindowTools::selectAsCurrentItem( newModeledWellPath ); + } + } + } +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RicPasteModeledWellPathFeature::setupActionLook( QAction* actionToSetup ) +{ + actionToSetup->setText( "Paste Well Path" ); + actionToSetup->setIcon( QIcon( ":/Well.svg" ) ); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +std::vector RicPasteModeledWellPathFeature::modeledWellPaths() +{ + caf::PdmObjectGroup objectGroup; + RicPasteFeatureImpl::findObjectsFromClipboardRefs( &objectGroup ); + + std::vector> typedObjects; + objectGroup.objectsByType( &typedObjects ); + + std::vector wellPaths; + for ( auto obj : typedObjects ) + { + wellPaths.push_back( obj ); + } + + return wellPaths; +} diff --git a/ApplicationLibCode/Commands/WellPathCommands/RicPasteModeledWellPathFeature.h b/ApplicationLibCode/Commands/WellPathCommands/RicPasteModeledWellPathFeature.h new file mode 100644 index 0000000000..08504fd737 --- /dev/null +++ b/ApplicationLibCode/Commands/WellPathCommands/RicPasteModeledWellPathFeature.h @@ -0,0 +1,38 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2021- Equinor ASA +// +// ResInsight is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// + +#pragma once + +#include "cafCmdFeature.h" + +class RimModeledWellPath; +//================================================================================================== +/// +//================================================================================================== +class RicPasteModeledWellPathFeature : public caf::CmdFeature +{ + CAF_CMD_HEADER_INIT; + +protected: + bool isCommandEnabled() override; + void onActionTriggered( bool isChecked ) override; + void setupActionLook( QAction* actionToSetup ) override; + +private: + static std::vector modeledWellPaths(); +}; diff --git a/ApplicationLibCode/ProjectDataModel/RimContextCommandBuilder.cpp b/ApplicationLibCode/ProjectDataModel/RimContextCommandBuilder.cpp index 72ea143343..ad0900f045 100644 --- a/ApplicationLibCode/ProjectDataModel/RimContextCommandBuilder.cpp +++ b/ApplicationLibCode/ProjectDataModel/RimContextCommandBuilder.cpp @@ -339,6 +339,7 @@ caf::CmdFeatureMenuBuilder RimContextCommandBuilder::commandsFromSelection() else if ( dynamic_cast( firstUiItem ) ) { menuBuilder << "RicNewEditableWellPathFeature"; + menuBuilder << "RicPasteModeledWellPathFeature"; menuBuilder.addSeparator(); menuBuilder.subMenuStart( "Import" ); menuBuilder << "RicWellPathsImportFileFeature"; diff --git a/ApplicationLibCode/ProjectDataModel/RimWellPathCollection.cpp b/ApplicationLibCode/ProjectDataModel/RimWellPathCollection.cpp index f31df93ae2..52d2b8e329 100644 --- a/ApplicationLibCode/ProjectDataModel/RimWellPathCollection.cpp +++ b/ApplicationLibCode/ProjectDataModel/RimWellPathCollection.cpp @@ -899,12 +899,11 @@ std::map> QString rootWellName = wellPath->name().left( indexOfLateralStart ); rootWells[rootWellName].push_back( wellPath ); + continue; } } - else - { - rootWells[RimWellPathCollection::unGroupedText()].push_back( wellPath ); - } + + rootWells[RimWellPathCollection::unGroupedText()].push_back( wellPath ); } return rootWells; From 73f8046353270c548aa0fb4d526db3ee22897eea Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Mon, 28 Jun 2021 14:17:46 +0200 Subject: [PATCH 027/308] #7818 Modeled Well Path : Add support for creation of N laterals based on a template --- .../WellPathCommands/CMakeLists_files.cmake | 5 + .../RicCreateMultipleWellPathLaterals.cpp | 193 +++++++++ .../RicCreateMultipleWellPathLaterals.h | 52 +++ .../RicCreateMultipleWellPathLateralsUi.cpp | 124 ++++++ .../RicCreateMultipleWellPathLateralsUi.h | 65 +++ .../RicPasteModeledWellPathFeature.cpp | 63 ++- .../RicPasteModeledWellPathFeature.h | 4 +- .../ProjectDataModel/CMakeLists_files.cmake | 2 + .../RimContextCommandBuilder.cpp | 1 + .../ProjectDataModel/RimMultipleLocations.cpp | 369 ++++++++++++++++++ .../ProjectDataModel/RimMultipleLocations.h | 82 ++++ .../RimWellPathCollection.cpp | 14 +- .../ProjectDataModel/RimWellPathCollection.h | 3 +- .../ProjectDataModel/RimWellPathTieIn.cpp | 8 + .../ProjectDataModel/RimWellPathTieIn.h | 1 + 15 files changed, 970 insertions(+), 16 deletions(-) create mode 100644 ApplicationLibCode/Commands/WellPathCommands/RicCreateMultipleWellPathLaterals.cpp create mode 100644 ApplicationLibCode/Commands/WellPathCommands/RicCreateMultipleWellPathLaterals.h create mode 100644 ApplicationLibCode/Commands/WellPathCommands/RicCreateMultipleWellPathLateralsUi.cpp create mode 100644 ApplicationLibCode/Commands/WellPathCommands/RicCreateMultipleWellPathLateralsUi.h create mode 100644 ApplicationLibCode/ProjectDataModel/RimMultipleLocations.cpp create mode 100644 ApplicationLibCode/ProjectDataModel/RimMultipleLocations.h diff --git a/ApplicationLibCode/Commands/WellPathCommands/CMakeLists_files.cmake b/ApplicationLibCode/Commands/WellPathCommands/CMakeLists_files.cmake index 169d79b8c3..8eb2c80473 100644 --- a/ApplicationLibCode/Commands/WellPathCommands/CMakeLists_files.cmake +++ b/ApplicationLibCode/Commands/WellPathCommands/CMakeLists_files.cmake @@ -20,6 +20,8 @@ ${CMAKE_CURRENT_LIST_DIR}/RicImportWellMeasurementsFeature.h ${CMAKE_CURRENT_LIST_DIR}/RicNewWellPathLateralAtDepthFeature.h ${CMAKE_CURRENT_LIST_DIR}/RicNewWellPathLateralFeature.h ${CMAKE_CURRENT_LIST_DIR}/RicPasteModeledWellPathFeature.h +${CMAKE_CURRENT_LIST_DIR}/RicCreateMultipleWellPathLaterals.h +${CMAKE_CURRENT_LIST_DIR}/RicCreateMultipleWellPathLateralsUi.h ${CMAKE_CURRENT_LIST_DIR}/PointTangentManipulator/Ric3dObjectEditorHandle.h ${CMAKE_CURRENT_LIST_DIR}/PointTangentManipulator/RicPointTangentManipulator.h ${CMAKE_CURRENT_LIST_DIR}/PointTangentManipulator/RicWellTarget3dEditor.h @@ -50,6 +52,8 @@ ${CMAKE_CURRENT_LIST_DIR}/RicImportWellMeasurementsFeature.cpp ${CMAKE_CURRENT_LIST_DIR}/RicNewWellPathLateralAtDepthFeature.cpp ${CMAKE_CURRENT_LIST_DIR}/RicNewWellPathLateralFeature.cpp ${CMAKE_CURRENT_LIST_DIR}/RicPasteModeledWellPathFeature.cpp +${CMAKE_CURRENT_LIST_DIR}/RicCreateMultipleWellPathLaterals.cpp +${CMAKE_CURRENT_LIST_DIR}/RicCreateMultipleWellPathLateralsUi.cpp ${CMAKE_CURRENT_LIST_DIR}/PointTangentManipulator/Ric3dObjectEditorHandle.cpp ${CMAKE_CURRENT_LIST_DIR}/PointTangentManipulator/RicPointTangentManipulator.cpp ${CMAKE_CURRENT_LIST_DIR}/PointTangentManipulator/RicWellTarget3dEditor.cpp @@ -73,6 +77,7 @@ ${CMAKE_CURRENT_LIST_DIR}/PointTangentManipulator/RicWellTarget3dEditor.h ${CMAKE_CURRENT_LIST_DIR}/PointTangentManipulator/RicWellPathGeometry3dEditor.h ${CMAKE_CURRENT_LIST_DIR}/PointTangentManipulator/RicPolyline3dEditor.h ${CMAKE_CURRENT_LIST_DIR}/PointTangentManipulator/RicPolylineTarget3dEditor.h +${CMAKE_CURRENT_LIST_DIR}/RicCreateMultipleWellPathLaterals.h ) source_group( "CommandFeature\\WellPath" FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake ) diff --git a/ApplicationLibCode/Commands/WellPathCommands/RicCreateMultipleWellPathLaterals.cpp b/ApplicationLibCode/Commands/WellPathCommands/RicCreateMultipleWellPathLaterals.cpp new file mode 100644 index 0000000000..ffef2df698 --- /dev/null +++ b/ApplicationLibCode/Commands/WellPathCommands/RicCreateMultipleWellPathLaterals.cpp @@ -0,0 +1,193 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2021 Equinor ASA +// +// ResInsight is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// + +#include "RicCreateMultipleWellPathLaterals.h" + +#include "RigWellPath.h" + +#include "RimModeledWellPath.h" +#include "RimProject.h" +#include "RimTools.h" +#include "RimWellPathCollection.h" +#include "RimWellPathGeometryDef.h" +#include "RimWellPathTarget.h" +#include "RimWellPathTieIn.h" + +#include "Riu3DMainWindowTools.h" + +#include "cafPdmUiPropertyViewDialog.h" +#include "cafSelectionManager.h" +#include "cafSelectionManagerTools.h" + +#include +#include +#include + +#include + +CAF_CMD_SOURCE_INIT( RicCreateMultipleWellPathLaterals, "RicCreateMultipleWellPathLaterals" ); + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +bool RicCreateMultipleWellPathLaterals::isCommandEnabled() +{ + return true; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RicCreateMultipleWellPathLaterals::onActionTriggered( bool isChecked ) +{ + m_ui = std::make_unique(); + + if ( m_ui.get() == nullptr ) m_ui = std::make_unique(); + + auto selected = dynamic_cast( caf::SelectionManager::instance()->selectedItem() ); + + if ( selected ) + { + m_ui->setSourceLateral( selected ); + double startMD = 0.0; + double endMD = 0.0; + if ( auto tieIn = selected->wellPathTieIn() ) + { + startMD = selected->wellPathTieIn()->tieInMeasuredDepth() + 50.0; + endMD = startMD + 50.0; + + if ( auto parentWell = selected->wellPathTieIn()->parentWell() ) + { + if ( !parentWell->wellPathGeometry()->measuredDepths().empty() ) + { + double candidate = parentWell->wellPathGeometry()->measuredDepths().back() - 50.0; + + if ( candidate > startMD ) endMD = candidate; + } + } + } + + m_ui->setDefaultValues( startMD, endMD ); + } + + { + caf::PdmUiPropertyViewDialog propertyDialog( Riu3DMainWindowTools::mainWindowWidget(), + m_ui.get(), + "Create Multiple Well Path Laterals", + "" ); + + propertyDialog.resize( QSize( 700, 450 ) ); + + QDialogButtonBox* dialogButtonBox = propertyDialog.dialogButtonBox(); + + dialogButtonBox->clear(); + + { + QPushButton* pushButton = dialogButtonBox->addButton( "Create Laterals", QDialogButtonBox::ActionRole ); + connect( pushButton, SIGNAL( clicked() ), this, SLOT( slotAppendFractures() ) ); + pushButton->setDefault( false ); + pushButton->setAutoDefault( false ); + pushButton->setToolTip( "Add new fractures" ); + } + + { + QPushButton* pushButton = dialogButtonBox->addButton( "Close", QDialogButtonBox::ActionRole ); + connect( pushButton, SIGNAL( clicked() ), &propertyDialog, SLOT( close() ) ); + pushButton->setDefault( false ); + pushButton->setAutoDefault( false ); + } + + propertyDialog.exec(); + } +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RicCreateMultipleWellPathLaterals::setupActionLook( QAction* actionToSetup ) +{ + actionToSetup->setText( "Create Multiple Well Path Laterals" ); + actionToSetup->setIcon( QIcon( ":/Well.svg" ) ); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RicCreateMultipleWellPathLaterals::slotAppendFractures() +{ + RimModeledWellPath* sourceLateral = m_ui->sourceLateral(); + + if ( !sourceLateral ) return; + if ( !sourceLateral->wellPathTieIn()->parentWell() ) return; + + auto sourceLocationOfFirstWellTarget = sourceLateral->geometryDefinition()->firstActiveTarget()->targetPointXYZ(); + + RimWellPathCollection* wellPathCollection = RimTools::wellPathCollection(); + if ( wellPathCollection ) + { + int index = 0; + for ( auto measuredDepth : m_ui->locationConfig()->locations() ) + { + RimModeledWellPath* newModeledWellPath = dynamic_cast( + sourceLateral->xmlCapability()->copyByXmlSerialization( caf::PdmDefaultObjectFactory::instance() ) ); + + QString name = sourceLateral->name() + QString( " (# %1)" ).arg( index++ ); + newModeledWellPath->setName( name ); + newModeledWellPath->wellPathTieIn()->setTieInMeasuredDepth( measuredDepth ); + + wellPathCollection->addWellPath( newModeledWellPath, false ); + newModeledWellPath->resolveReferencesRecursively(); + + newModeledWellPath->updateReferencePoint(); + + updateLocationOfTargets( newModeledWellPath, sourceLocationOfFirstWellTarget ); + + newModeledWellPath->updateWellPathVisualization(); + } + + wellPathCollection->uiCapability()->updateConnectedEditors(); + + RimProject::current()->scheduleCreateDisplayModelAndRedrawAllViews(); + + m_ui->updateConnectedEditors(); + } +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RicCreateMultipleWellPathLaterals::updateLocationOfTargets( RimModeledWellPath* newModeledWellPath, + const cvf::Vec3d& sourceLocationOfFirstWellTarget ) +{ + newModeledWellPath->updateTieInLocationFromParentWell(); + newModeledWellPath->wellPathTieIn()->updateFirstTargetFromParentWell(); + + auto firstTarget = newModeledWellPath->geometryDefinition()->firstActiveTarget(); + auto locationOfFirstWellTarget = firstTarget->targetPointXYZ(); + auto offsetFirstTarget = locationOfFirstWellTarget - sourceLocationOfFirstWellTarget; + + auto targets = newModeledWellPath->geometryDefinition()->activeWellTargets(); + for ( auto wellTarget : targets ) + { + // Skip first target, as this is already updated by wellPathTieIn()->updateFirstTargetFromParentWell() + if ( wellTarget == firstTarget ) continue; + + auto newTargetLocationXYZ = wellTarget->targetPointXYZ() + offsetFirstTarget; + wellTarget->setPointXYZ( newTargetLocationXYZ ); + } +} diff --git a/ApplicationLibCode/Commands/WellPathCommands/RicCreateMultipleWellPathLaterals.h b/ApplicationLibCode/Commands/WellPathCommands/RicCreateMultipleWellPathLaterals.h new file mode 100644 index 0000000000..780a6551fe --- /dev/null +++ b/ApplicationLibCode/Commands/WellPathCommands/RicCreateMultipleWellPathLaterals.h @@ -0,0 +1,52 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2021 Equinor ASA +// +// ResInsight is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// + +#pragma once + +#include "cafCmdFeature.h" + +#include "RicCreateMultipleWellPathLateralsUi.h" + +#include "cvfVector3.h" + +#include + +class RimModeledWellPath; + +//================================================================================================== +/// +//================================================================================================== +class RicCreateMultipleWellPathLaterals : public caf::CmdFeature +{ + Q_OBJECT + CAF_CMD_HEADER_INIT; + +protected: + bool isCommandEnabled() override; + void onActionTriggered( bool isChecked ) override; + void setupActionLook( QAction* actionToSetup ) override; + +private slots: + void slotAppendFractures(); + + void updateLocationOfTargets( RimModeledWellPath* newModeledWellPath, + const cvf::Vec3d& sourceLocationOfFirstWellTarget ); + +private: + std::unique_ptr m_ui; +}; diff --git a/ApplicationLibCode/Commands/WellPathCommands/RicCreateMultipleWellPathLateralsUi.cpp b/ApplicationLibCode/Commands/WellPathCommands/RicCreateMultipleWellPathLateralsUi.cpp new file mode 100644 index 0000000000..cbcf78f434 --- /dev/null +++ b/ApplicationLibCode/Commands/WellPathCommands/RicCreateMultipleWellPathLateralsUi.cpp @@ -0,0 +1,124 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2021 Equinor ASA +// +// ResInsight is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// + +#include "RicCreateMultipleWellPathLateralsUi.h" + +#include "RifTextDataTableFormatter.h" + +#include "RigMainGrid.h" +#include "RigWellPath.h" + +#include "RimModeledWellPath.h" +#include "RimTools.h" +#include "RimWellPathCollection.h" +#include "RimWellPathTieIn.h" + +#include "cafCmdFeatureMenuBuilder.h" +#include "cafPdmUiPropertyViewDialog.h" +#include "cafPdmUiTableViewEditor.h" +#include "cafPdmUiTextEditor.h" +#include "cafSelectionManagerTools.h" + +#include "cvfBoundingBox.h" + +#include + +CAF_PDM_SOURCE_INIT( RicCreateMultipleWellPathLateralsUi, "RicCreateMultipleWellPathLateralsUi" ); + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RicCreateMultipleWellPathLateralsUi::RicCreateMultipleWellPathLateralsUi() +{ + CAF_PDM_InitFieldNoDefault( &m_sourceLateral, "SourceLaterals", "Source Well Path Lateral", "", "", "" ); + + CAF_PDM_InitFieldNoDefault( &m_locations, "Locations", "Locations", "", "", "" ); + m_locations = new RimMultipleLocations; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RicCreateMultipleWellPathLateralsUi::setSourceLateral( RimModeledWellPath* lateral ) +{ + m_sourceLateral = lateral; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RicCreateMultipleWellPathLateralsUi::setDefaultValues( double start, double end ) +{ + m_locations->setRange( start, end ); + m_locations->computeRangesAndLocations(); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RimModeledWellPath* RicCreateMultipleWellPathLateralsUi::sourceLateral() const +{ + return m_sourceLateral; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RimMultipleLocations* RicCreateMultipleWellPathLateralsUi::locationConfig() const +{ + return m_locations; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RicCreateMultipleWellPathLateralsUi::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) +{ + uiOrdering.add( &m_sourceLateral ); + + { + auto group = uiOrdering.addNewGroup( "Locations" ); + m_locations->uiOrdering( uiConfigName, *group ); + } +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +QList + RicCreateMultipleWellPathLateralsUi::calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions, + bool* useOptionsOnly ) +{ + QList options; + + if ( fieldNeedingOptions == &m_sourceLateral ) + { + if ( sourceLateral()->wellPathTieIn() && sourceLateral()->wellPathTieIn()->parentWell() ) + { + auto parentWell = sourceLateral()->wellPathTieIn()->parentWell(); + auto laterals = RimTools::wellPathCollection()->connectedWellPathLaterals( parentWell ); + + for ( auto lateral : laterals ) + { + options.push_back( caf::PdmOptionItemInfo( lateral->name(), lateral ) ); + } + } + } + + return options; +} diff --git a/ApplicationLibCode/Commands/WellPathCommands/RicCreateMultipleWellPathLateralsUi.h b/ApplicationLibCode/Commands/WellPathCommands/RicCreateMultipleWellPathLateralsUi.h new file mode 100644 index 0000000000..0c7af4671b --- /dev/null +++ b/ApplicationLibCode/Commands/WellPathCommands/RicCreateMultipleWellPathLateralsUi.h @@ -0,0 +1,65 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2021 Equinor ASA +// +// ResInsight is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// + +#pragma once + +#include "RimMultipleLocations.h" + +#include "cafPdmChildArrayField.h" +#include "cafPdmChildField.h" +#include "cafPdmField.h" +#include "cafPdmObject.h" +#include "cafPdmProxyValueField.h" +#include "cafPdmPtrField.h" + +#include + +class RimModeledWellPath; + +namespace caf +{ +class PdmUiPropertyViewDialog; +} + +//================================================================================================== +/// +//================================================================================================== +class RicCreateMultipleWellPathLateralsUi : public caf::PdmObject +{ + CAF_PDM_HEADER_INIT; + +public: + RicCreateMultipleWellPathLateralsUi(); + + void setSourceLateral( RimModeledWellPath* lateral ); + void setDefaultValues( double start, double end ); + + RimModeledWellPath* sourceLateral() const; + RimMultipleLocations* locationConfig() const; + +private: + void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override; + + QList calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions, + bool* useOptionsOnly ) override; + +private: + caf::PdmPtrField m_sourceLateral; + + caf::PdmChildField m_locations; +}; diff --git a/ApplicationLibCode/Commands/WellPathCommands/RicPasteModeledWellPathFeature.cpp b/ApplicationLibCode/Commands/WellPathCommands/RicPasteModeledWellPathFeature.cpp index bda7fae355..3642511c45 100644 --- a/ApplicationLibCode/Commands/WellPathCommands/RicPasteModeledWellPathFeature.cpp +++ b/ApplicationLibCode/Commands/WellPathCommands/RicPasteModeledWellPathFeature.cpp @@ -25,6 +25,7 @@ CAF_CMD_SOURCE_INIT( RicPasteModeledWellPathFeature, "RicPasteModeledWellPathFea #include "RimModeledWellPath.h" #include "RimOilField.h" #include "RimWellPathCollection.h" +#include "RimWellPathTieIn.h" #include "cafPdmObjectGroup.h" #include "cafSelectionManager.h" @@ -36,7 +37,7 @@ CAF_CMD_SOURCE_INIT( RicPasteModeledWellPathFeature, "RicPasteModeledWellPathFea //-------------------------------------------------------------------------------------------------- bool RicPasteModeledWellPathFeature::isCommandEnabled() { - if ( !modeledWellPaths().empty() ) return true; + if ( !modeledWellPathsFromClipboard().empty() ) return true; { std::vector objects; caf::SelectionManager::instance()->objectsByType( &objects ); @@ -55,7 +56,7 @@ bool RicPasteModeledWellPathFeature::isCommandEnabled() //-------------------------------------------------------------------------------------------------- void RicPasteModeledWellPathFeature::onActionTriggered( bool isChecked ) { - if ( modeledWellPaths().empty() ) return; + if ( modeledWellPathsFromClipboard().empty() ) return; RimProject* proj = RimProject::current(); @@ -65,21 +66,28 @@ void RicPasteModeledWellPathFeature::onActionTriggered( bool isChecked ) if ( wellPathCollection ) { - for ( auto souceWellPath : modeledWellPaths() ) + RimModeledWellPath* wellPathToSelect = nullptr; + for ( auto sourceWellPath : modeledWellPathsFromClipboard() ) { - RimModeledWellPath* newModeledWellPath = dynamic_cast( - souceWellPath->xmlCapability()->copyByXmlSerialization( caf::PdmDefaultObjectFactory::instance() ) ); + RimModeledWellPath* destinationWellPath = dynamic_cast( + sourceWellPath->xmlCapability()->copyByXmlSerialization( caf::PdmDefaultObjectFactory::instance() ) ); - QString name = souceWellPath->name() + " (copy)"; - newModeledWellPath->setName( name ); + QString name = sourceWellPath->name() + " (copy)"; + destinationWellPath->setName( name ); - wellPathCollection->addWellPath( newModeledWellPath, false ); - wellPathCollection->uiCapability()->updateConnectedEditors(); + wellPathCollection->addWellPath( destinationWellPath, false ); + wellPathToSelect = destinationWellPath; - proj->scheduleCreateDisplayModelAndRedrawAllViews(); - - Riu3DMainWindowTools::selectAsCurrentItem( newModeledWellPath ); + duplicateLaterals( sourceWellPath, destinationWellPath ); } + + RimTools::wellPathCollection()->rebuildWellPathNodes(); + + wellPathCollection->uiCapability()->updateConnectedEditors(); + + proj->scheduleCreateDisplayModelAndRedrawAllViews(); + + Riu3DMainWindowTools::selectAsCurrentItem( wellPathToSelect ); } } } @@ -96,7 +104,7 @@ void RicPasteModeledWellPathFeature::setupActionLook( QAction* actionToSetup ) //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -std::vector RicPasteModeledWellPathFeature::modeledWellPaths() +std::vector RicPasteModeledWellPathFeature::modeledWellPathsFromClipboard() { caf::PdmObjectGroup objectGroup; RicPasteFeatureImpl::findObjectsFromClipboardRefs( &objectGroup ); @@ -112,3 +120,32 @@ std::vector RicPasteModeledWellPathFeature::modeledWellPath return wellPaths; } + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RicPasteModeledWellPathFeature::duplicateLaterals( RimModeledWellPath* source, RimModeledWellPath* destination ) +{ + auto wpc = RimTools::wellPathCollection(); + + auto sourceLaterals = wpc->connectedWellPathLaterals( source ); + + destination->createWellPathGeometry(); + for ( auto lateral : sourceLaterals ) + { + auto sourceLateral = dynamic_cast( lateral ); + if ( !sourceLateral ) continue; + + auto* destinationLateral = dynamic_cast( + sourceLateral->xmlCapability()->copyByXmlSerialization( caf::PdmDefaultObjectFactory::instance() ) ); + + QString name = sourceLateral->name() + " (copy)"; + destinationLateral->setName( name ); + + wpc->addWellPath( destinationLateral, false ); + + destinationLateral->connectWellPaths( destination, sourceLateral->wellPathTieIn()->tieInMeasuredDepth() ); + + duplicateLaterals( sourceLateral, destinationLateral ); + } +} diff --git a/ApplicationLibCode/Commands/WellPathCommands/RicPasteModeledWellPathFeature.h b/ApplicationLibCode/Commands/WellPathCommands/RicPasteModeledWellPathFeature.h index 08504fd737..ce6e553365 100644 --- a/ApplicationLibCode/Commands/WellPathCommands/RicPasteModeledWellPathFeature.h +++ b/ApplicationLibCode/Commands/WellPathCommands/RicPasteModeledWellPathFeature.h @@ -34,5 +34,7 @@ class RicPasteModeledWellPathFeature : public caf::CmdFeature void setupActionLook( QAction* actionToSetup ) override; private: - static std::vector modeledWellPaths(); + static std::vector modeledWellPathsFromClipboard(); + + void duplicateLaterals( RimModeledWellPath* source, RimModeledWellPath* destination ); }; diff --git a/ApplicationLibCode/ProjectDataModel/CMakeLists_files.cmake b/ApplicationLibCode/ProjectDataModel/CMakeLists_files.cmake index 0a298bdc7c..567b8c996e 100644 --- a/ApplicationLibCode/ProjectDataModel/CMakeLists_files.cmake +++ b/ApplicationLibCode/ProjectDataModel/CMakeLists_files.cmake @@ -154,6 +154,7 @@ ${CMAKE_CURRENT_LIST_DIR}/RimTimeAxisAnnotation.h ${CMAKE_CURRENT_LIST_DIR}/RimPolylinesDataInterface.h ${CMAKE_CURRENT_LIST_DIR}/RimWellPathTieIn.h ${CMAKE_CURRENT_LIST_DIR}/cafTreeNode.h +${CMAKE_CURRENT_LIST_DIR}/RimMultipleLocations.h ) @@ -308,6 +309,7 @@ ${CMAKE_CURRENT_LIST_DIR}/RimEquilibriumAxisAnnotation.cpp ${CMAKE_CURRENT_LIST_DIR}/RimTimeAxisAnnotation.cpp ${CMAKE_CURRENT_LIST_DIR}/RimWellPathTieIn.cpp ${CMAKE_CURRENT_LIST_DIR}/cafTreeNode.cpp +${CMAKE_CURRENT_LIST_DIR}/RimMultipleLocations.cpp ) if(Qt5Charts_FOUND) diff --git a/ApplicationLibCode/ProjectDataModel/RimContextCommandBuilder.cpp b/ApplicationLibCode/ProjectDataModel/RimContextCommandBuilder.cpp index ad0900f045..972e0b60aa 100644 --- a/ApplicationLibCode/ProjectDataModel/RimContextCommandBuilder.cpp +++ b/ApplicationLibCode/ProjectDataModel/RimContextCommandBuilder.cpp @@ -404,6 +404,7 @@ caf::CmdFeatureMenuBuilder RimContextCommandBuilder::commandsFromSelection() if ( dynamic_cast( firstUiItem ) ) { menuBuilder << "RicShowWellPlanFeature"; + menuBuilder << "RicCreateMultipleWellPathLaterals"; } } else if ( dynamic_cast( firstUiItem ) ) diff --git a/ApplicationLibCode/ProjectDataModel/RimMultipleLocations.cpp b/ApplicationLibCode/ProjectDataModel/RimMultipleLocations.cpp new file mode 100644 index 0000000000..ab497bdc82 --- /dev/null +++ b/ApplicationLibCode/ProjectDataModel/RimMultipleLocations.cpp @@ -0,0 +1,369 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2021 Equinor ASA +// +// ResInsight is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// + +#include "RimMultipleLocations.h" + +#include "cafPdmUiDoubleValueEditor.h" +#include "cafPdmUiListEditor.h" + +#include + +CAF_PDM_SOURCE_INIT( RimMultipleLocations, "RimMultipleLocations" ); + +namespace caf +{ +template <> +void AppEnum::setUp() +{ + addItem( RimMultipleLocations::LocationType::COUNT, "COUNT", "Start/End/Number" ); + addItem( RimMultipleLocations::LocationType::SPACING, "SPACING", "Start/End/Spacing" ); + addItem( RimMultipleLocations::LocationType::CUSTOM, "CUSTOM", "User Specification" ); + setDefault( RimMultipleLocations::LocationType::COUNT ); +} +} // namespace caf + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RimMultipleLocations::RimMultipleLocations() +{ + CAF_PDM_InitObject( "RimMultipleLocations", ":/FishBoneGroup16x16.png", "", "" ); + + CAF_PDM_InitField( &m_locationType, + "LocationMode", + caf::AppEnum( LocationType::COUNT ), + "Location Defined By", + "", + "", + "" ); + CAF_PDM_InitField( &m_rangeStart, "RangeStart", 100.0, "Start MD", "", "", "" ); + m_rangeStart.uiCapability()->setUiEditorTypeName( caf::PdmUiDoubleValueEditor::uiEditorTypeName() ); + + CAF_PDM_InitField( &m_rangeEnd, "RangeEnd", 250.0, "End MD", "", "", "" ); + m_rangeEnd.uiCapability()->setUiEditorTypeName( caf::PdmUiDoubleValueEditor::uiEditorTypeName() ); + + CAF_PDM_InitFieldNoDefault( &m_rangeSpacing, "Spacing", "Spacing", "", "", "" ); + m_rangeSpacing.uiCapability()->setUiEditorTypeName( caf::PdmUiDoubleValueEditor::uiEditorTypeName() ); + + CAF_PDM_InitFieldNoDefault( &m_minimumMD, "MinimumMD", "Minimum MD", "", "", "" ); + m_minimumMD.uiCapability()->setUiEditorTypeName( caf::PdmUiDoubleValueEditor::uiEditorTypeName() ); + + CAF_PDM_InitFieldNoDefault( &m_maximumMD, "MaximumMD", "Maximum MD", "", "", "" ); + m_maximumMD.uiCapability()->setUiEditorTypeName( caf::PdmUiDoubleValueEditor::uiEditorTypeName() ); + + CAF_PDM_InitField( &m_rangeCount, "RangeValveCount", 10, "Number of Items", "", "", "" ); + + CAF_PDM_InitFieldNoDefault( &m_locations, "Locations", "Measured Depths", "", "", "" ); + m_locations.uiCapability()->setUiEditorTypeName( caf::PdmUiListEditor::uiEditorTypeName() ); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimMultipleLocations::setRange( double minimumMD, double maximumMD ) +{ + m_minimumMD = minimumMD; + m_maximumMD = maximumMD; + + m_rangeStart = minimumMD; + m_rangeEnd = maximumMD; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimMultipleLocations::updateRangesAndLocations() +{ + double existingRangeStart = m_rangeStart(); + double existingRangeEnd = m_rangeEnd(); + m_rangeStart = std::clamp( m_rangeStart(), minimumMD(), maximumMD() ); + m_rangeEnd = std::clamp( m_rangeEnd(), minimumMD(), maximumMD() ); + if ( existingRangeStart != m_rangeStart() || existingRangeEnd != m_rangeEnd() ) + { + computeRangesAndLocations(); + } +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +double RimMultipleLocations::measuredDepth( size_t valveIndex ) const +{ + return m_locations()[valveIndex]; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +double RimMultipleLocations::rangeStart() const +{ + return m_rangeStart; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +double RimMultipleLocations::rangeEnd() const +{ + return m_rangeEnd; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +const std::vector& RimMultipleLocations::locations() const +{ + return m_locations(); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimMultipleLocations::setLocationType( LocationType locationType ) +{ + m_locationType = locationType; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimMultipleLocations::computeRangesAndLocations() +{ + if ( m_locationType == LocationType::COUNT ) + { + int divisor = 1; + if ( m_rangeCount > 2 ) divisor = m_rangeCount - 1; + + m_rangeSpacing = std::abs( m_rangeStart - m_rangeEnd ) / divisor; + if ( m_rangeSpacing < minimumSpacingMeters() ) + { + m_rangeSpacing = minimumSpacingMeters(); + m_rangeCount = rangeCountFromSpacing(); + } + } + else if ( m_locationType == LocationType::SPACING ) + { + m_rangeCount = rangeCountFromSpacing(); + } + + if ( m_locationType == LocationType::COUNT || m_locationType == LocationType::SPACING ) + { + std::vector validMeasuredDepths; + for ( auto md : locationsFromStartSpacingAndCount( m_rangeStart(), m_rangeSpacing, m_rangeCount ) ) + { + validMeasuredDepths.push_back( md ); + } + + m_locations = validMeasuredDepths; + } +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimMultipleLocations::initFields( LocationType locationType, + double rangeStart, + double rangeEnd, + double valveSpacing, + int valveCount, + const std::vector& locationOfValves ) +{ + if ( locationType != LocationType::UNDEFINED ) + { + m_locationType = locationType; + } + if ( rangeStart != std::numeric_limits::infinity() ) + { + m_rangeStart = rangeStart; + } + if ( rangeEnd != std::numeric_limits::infinity() ) + { + m_rangeEnd = rangeEnd; + } + if ( valveSpacing != std::numeric_limits::infinity() ) + { + m_rangeSpacing = valveSpacing; + } + if ( valveCount != -1 ) + { + m_rangeCount = valveCount; + } + if ( !locationOfValves.empty() ) + { + m_locations = locationOfValves; + } +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimMultipleLocations::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) +{ + { + m_locations.uiCapability()->setUiName( "Measured Depths" ); + m_rangeStart.uiCapability()->setUiName( "Start MD" ); + m_rangeEnd.uiCapability()->setUiName( "End MD" ); + m_rangeSpacing.uiCapability()->setUiName( "Spacing" ); + } + + { + uiOrdering.add( &m_locationType ); + if ( m_locationType() != LocationType::CUSTOM ) + { + uiOrdering.add( &m_rangeStart ); + uiOrdering.add( &m_rangeEnd ); + + if ( m_locationType() == LocationType::COUNT ) + { + uiOrdering.add( &m_rangeCount ); + uiOrdering.add( &m_rangeSpacing ); + } + else if ( m_locationType() == LocationType::SPACING ) + { + uiOrdering.add( &m_rangeSpacing ); + uiOrdering.add( &m_rangeCount ); + } + } + + uiOrdering.add( &m_locations ); + } + + if ( m_locationType() == LocationType::CUSTOM ) + { + m_locations.uiCapability()->setUiReadOnly( false ); + + m_rangeSpacing.uiCapability()->setUiReadOnly( true ); + m_rangeCount.uiCapability()->setUiReadOnly( true ); + m_rangeStart.uiCapability()->setUiReadOnly( true ); + m_rangeEnd.uiCapability()->setUiReadOnly( true ); + } + else + { + m_locations.uiCapability()->setUiReadOnly( true ); + + m_rangeSpacing.uiCapability()->setUiReadOnly( false ); + m_rangeCount.uiCapability()->setUiReadOnly( false ); + m_rangeStart.uiCapability()->setUiReadOnly( false ); + m_rangeEnd.uiCapability()->setUiReadOnly( false ); + + if ( m_locationType() == LocationType::COUNT ) + { + m_rangeSpacing.uiCapability()->setUiReadOnly( true ); + m_rangeCount.uiCapability()->setUiReadOnly( false ); + } + else + { + m_rangeSpacing.uiCapability()->setUiReadOnly( false ); + m_rangeCount.uiCapability()->setUiReadOnly( true ); + } + } +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimMultipleLocations::fieldChangedByUi( const caf::PdmFieldHandle* changedField, + const QVariant& oldValue, + const QVariant& newValue ) +{ + bool recomputeLocations = false; + + if ( changedField == &m_locationType ) + { + if ( m_locationType == LocationType::COUNT || m_locationType == LocationType::SPACING ) + { + recomputeLocations = true; + } + } + + if ( changedField == &m_rangeStart || changedField == &m_rangeEnd || changedField == &m_rangeCount || + changedField == &m_rangeSpacing ) + { + recomputeLocations = true; + m_rangeStart = std::clamp( m_rangeStart(), minimumMD(), maximumMD() ); + m_rangeEnd = std::clamp( m_rangeEnd(), minimumMD(), maximumMD() ); + } + + if ( changedField == &m_rangeSpacing ) + { + double minimumDistanceMeter = minimumSpacingMeters(); + + m_rangeSpacing = + std::clamp( m_rangeSpacing(), minimumDistanceMeter, std::max( m_rangeSpacing(), minimumDistanceMeter ) ); + } + + if ( recomputeLocations ) + { + computeRangesAndLocations(); + } +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +int RimMultipleLocations::rangeCountFromSpacing() const +{ + int rangeCount = ( std::fabs( m_rangeStart - m_rangeEnd ) / m_rangeSpacing ) + 1; + + if ( rangeCount < 1 ) + { + rangeCount = 1; + } + return rangeCount; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +double RimMultipleLocations::minimumSpacingMeters() const +{ + // Minimum distance between fishbones is 13.0m + // Use 10.0m to allow for some flexibility + return 10.0; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +double RimMultipleLocations::minimumMD() const +{ + return m_rangeStart(); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +double RimMultipleLocations::maximumMD() const +{ + return m_rangeEnd(); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +std::vector RimMultipleLocations::locationsFromStartSpacingAndCount( double start, double spacing, size_t count ) +{ + std::vector measuredDepths; + + for ( size_t i = 0; i < count; i++ ) + { + measuredDepths.push_back( start + spacing * i ); + } + + return measuredDepths; +} diff --git a/ApplicationLibCode/ProjectDataModel/RimMultipleLocations.h b/ApplicationLibCode/ProjectDataModel/RimMultipleLocations.h new file mode 100644 index 0000000000..6b9b85810b --- /dev/null +++ b/ApplicationLibCode/ProjectDataModel/RimMultipleLocations.h @@ -0,0 +1,82 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2021 Equinor ASA +// +// ResInsight is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// + +#pragma once + +#include "cafAppEnum.h" +#include "cafPdmBase.h" +#include "cafPdmField.h" +#include "cafPdmObject.h" + +class RimMultipleLocations : public caf::PdmObject +{ + CAF_PDM_HEADER_INIT; + +public: + enum class LocationType + { + COUNT, + SPACING, + CUSTOM, + UNDEFINED + }; + +public: + RimMultipleLocations(); + + void setRange( double minimumMD, double maximumMD ); + + void updateRangesAndLocations(); + double measuredDepth( size_t valveIndex ) const; + double rangeStart() const; + double rangeEnd() const; + const std::vector& locations() const; + + void setLocationType( LocationType locationType ); + void computeRangesAndLocations(); + + void initFields( LocationType locationType, + double rangeStart, + double rangeEnd, + double valveSpacing, + int valveCount, + const std::vector& locationOfValves ); + +protected: + void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) override; + void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override; + +private: + int rangeCountFromSpacing() const; + double minimumSpacingMeters() const; + double minimumMD() const; + double maximumMD() const; + static std::vector locationsFromStartSpacingAndCount( double start, double spacing, size_t count ); + +private: + caf::PdmField> m_locationType; + caf::PdmField m_rangeStart; + caf::PdmField m_rangeEnd; + caf::PdmField m_rangeSpacing; + caf::PdmField m_rangeCount; + + caf::PdmField m_minimumMD; + caf::PdmField m_maximumMD; + + caf::PdmField> m_locations; // Given in measured depth +}; diff --git a/ApplicationLibCode/ProjectDataModel/RimWellPathCollection.cpp b/ApplicationLibCode/ProjectDataModel/RimWellPathCollection.cpp index 52d2b8e329..7cf65884cd 100644 --- a/ApplicationLibCode/ProjectDataModel/RimWellPathCollection.cpp +++ b/ApplicationLibCode/ProjectDataModel/RimWellPathCollection.cpp @@ -60,6 +60,7 @@ #include "cafPdmUiTreeOrdering.h" #include "cafProgressInfo.h" +#include #include #include #include @@ -729,7 +730,13 @@ void RimWellPathCollection::removeWellPath( gsl::not_null wellPath bool lessWellPath( const caf::PdmPointer& w1, const caf::PdmPointer& w2 ) { if ( w1.notNull() && w2.notNull() ) - return ( w1->name() < w2->name() ); + { + // Use QCollator to sort integer values in addition to text + + QCollator collator; + collator.setNumericMode( true ); + return collator.compare( w1->name(), w2->name() ) < 0; + } else if ( w1.notNull() ) return true; else @@ -906,6 +913,11 @@ std::map> rootWells[RimWellPathCollection::unGroupedText()].push_back( wellPath ); } + for ( auto [groupName, wellPaths] : rootWells ) + { + std::sort( wellPaths.begin(), wellPaths.end(), lessWellPath ); + } + return rootWells; } diff --git a/ApplicationLibCode/ProjectDataModel/RimWellPathCollection.h b/ApplicationLibCode/ProjectDataModel/RimWellPathCollection.h index 2f22495b2d..4c3d4b9294 100644 --- a/ApplicationLibCode/ProjectDataModel/RimWellPathCollection.h +++ b/ApplicationLibCode/ProjectDataModel/RimWellPathCollection.h @@ -102,6 +102,8 @@ class RimWellPathCollection : public caf::PdmObject void groupWellPaths( const std::vector& wellPaths ); void rebuildWellPathNodes(); + std::vector connectedWellPathLaterals( const RimWellPath* parentWellPath ) const; + RimWellPath* mostRecentlyUpdatedWellPath(); void readWellPathFormationFiles(); @@ -146,7 +148,6 @@ class RimWellPathCollection : public caf::PdmObject cafTreeNode* addWellToWellNode( cafTreeNode* parent, RimWellPath* wellPath ); std::vector wellPathsWithNoParent( const std::vector& sourceWellPaths ) const; - std::vector connectedWellPathLaterals( const RimWellPath* parentWellPath ) const; std::map> wellPathsForWellNameStem( const std::vector& sourceWellPaths ) const; diff --git a/ApplicationLibCode/ProjectDataModel/RimWellPathTieIn.cpp b/ApplicationLibCode/ProjectDataModel/RimWellPathTieIn.cpp index 2c16124f7f..b825359d27 100644 --- a/ApplicationLibCode/ProjectDataModel/RimWellPathTieIn.cpp +++ b/ApplicationLibCode/ProjectDataModel/RimWellPathTieIn.cpp @@ -79,6 +79,14 @@ double RimWellPathTieIn::tieInMeasuredDepth() const return m_tieInMeasuredDepth(); } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimWellPathTieIn::setTieInMeasuredDepth( double measuredDepth ) +{ + m_tieInMeasuredDepth = measuredDepth; +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationLibCode/ProjectDataModel/RimWellPathTieIn.h b/ApplicationLibCode/ProjectDataModel/RimWellPathTieIn.h index 0edc980799..3405e94aa2 100644 --- a/ApplicationLibCode/ProjectDataModel/RimWellPathTieIn.h +++ b/ApplicationLibCode/ProjectDataModel/RimWellPathTieIn.h @@ -36,6 +36,7 @@ class RimWellPathTieIn : public caf::PdmObject void connectWellPaths( RimWellPath* parentWell, RimWellPath* childWell, double tieInMeasuredDepth ); RimWellPath* parentWell() const; double tieInMeasuredDepth() const; + void setTieInMeasuredDepth( double measuredDepth ); RimWellPath* childWell() const; void updateChildWellGeometry(); From e06e0116d818025b16f004b1a1173e79766ec587 Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Mon, 28 Jun 2021 13:10:57 +0200 Subject: [PATCH 028/308] #7818 Modeled Well Path : Update location of completions --- .../RicCreateMultipleWellPathLaterals.cpp | 33 +++++++++++++++++-- .../RicCreateMultipleWellPathLaterals.h | 3 ++ .../RicNewWellPathLateralAtDepthFeature.cpp | 10 +++--- .../RicNewWellPathLateralAtDepthFeature.h | 2 +- .../Completions/RimFishbones.cpp | 8 +++++ .../Completions/RimFishbones.h | 1 + .../Completions/RimMultipleValveLocations.cpp | 11 +++++++ .../Completions/RimMultipleValveLocations.h | 2 ++ .../Completions/RimPerforationCollection.cpp | 15 +++++++++ .../Completions/RimPerforationCollection.h | 1 + .../Completions/RimPerforationInterval.cpp | 9 +++++ .../Completions/RimPerforationInterval.h | 1 + .../Completions/RimSimWellFracture.cpp | 8 +++++ .../Completions/RimSimWellFracture.h | 2 ++ .../Completions/RimWellPathCompletions.cpp | 29 ++++++++++++++++ .../Completions/RimWellPathCompletions.h | 1 + .../RimWellPathComponentInterface.h | 15 +++++---- .../Completions/RimWellPathFracture.cpp | 8 +++++ .../Completions/RimWellPathFracture.h | 2 ++ .../Completions/RimWellPathValve.cpp | 8 +++++ .../Completions/RimWellPathValve.h | 1 + .../ProjectDataModel/RimWellPath.cpp | 8 +++++ .../ProjectDataModel/RimWellPath.h | 1 + .../ProjectDataModel/RimWellPathAttribute.cpp | 9 +++++ .../ProjectDataModel/RimWellPathAttribute.h | 1 + .../StimPlanModel/RimStimPlanModel.cpp | 8 +++++ .../StimPlanModel/RimStimPlanModel.h | 4 ++- 27 files changed, 184 insertions(+), 17 deletions(-) diff --git a/ApplicationLibCode/Commands/WellPathCommands/RicCreateMultipleWellPathLaterals.cpp b/ApplicationLibCode/Commands/WellPathCommands/RicCreateMultipleWellPathLaterals.cpp index ffef2df698..a208c220b6 100644 --- a/ApplicationLibCode/Commands/WellPathCommands/RicCreateMultipleWellPathLaterals.cpp +++ b/ApplicationLibCode/Commands/WellPathCommands/RicCreateMultipleWellPathLaterals.cpp @@ -18,12 +18,15 @@ #include "RicCreateMultipleWellPathLaterals.h" +#include "RicNewWellPathLateralAtDepthFeature.h" + #include "RigWellPath.h" #include "RimModeledWellPath.h" #include "RimProject.h" #include "RimTools.h" #include "RimWellPathCollection.h" +#include "RimWellPathCompletions.h" #include "RimWellPathGeometryDef.h" #include "RimWellPathTarget.h" #include "RimWellPathTieIn.h" @@ -133,9 +136,12 @@ void RicCreateMultipleWellPathLaterals::slotAppendFractures() RimModeledWellPath* sourceLateral = m_ui->sourceLateral(); if ( !sourceLateral ) return; - if ( !sourceLateral->wellPathTieIn()->parentWell() ) return; + + auto parentWellPath = sourceLateral->wellPathTieIn()->parentWell(); + if ( !parentWellPath ) return; auto sourceLocationOfFirstWellTarget = sourceLateral->geometryDefinition()->firstActiveTarget()->targetPointXYZ(); + auto sourceTieInMeasuredDepth = sourceLateral->wellPathTieIn()->tieInMeasuredDepth(); RimWellPathCollection* wellPathCollection = RimTools::wellPathCollection(); if ( wellPathCollection ) @@ -146,8 +152,10 @@ void RicCreateMultipleWellPathLaterals::slotAppendFractures() RimModeledWellPath* newModeledWellPath = dynamic_cast( sourceLateral->xmlCapability()->copyByXmlSerialization( caf::PdmDefaultObjectFactory::instance() ) ); - QString name = sourceLateral->name() + QString( " (# %1)" ).arg( index++ ); - newModeledWellPath->setName( name ); + auto nameOfNewWell = + RicNewWellPathLateralAtDepthFeature::updateNameOfParentAndFindNameOfSideStep( parentWellPath ); + newModeledWellPath->setName( nameOfNewWell ); + newModeledWellPath->wellPathTieIn()->setTieInMeasuredDepth( measuredDepth ); wellPathCollection->addWellPath( newModeledWellPath, false ); @@ -156,12 +164,16 @@ void RicCreateMultipleWellPathLaterals::slotAppendFractures() newModeledWellPath->updateReferencePoint(); updateLocationOfTargets( newModeledWellPath, sourceLocationOfFirstWellTarget ); + updateLocationOfCompletions( newModeledWellPath, sourceTieInMeasuredDepth ); newModeledWellPath->updateWellPathVisualization(); } + wellPathCollection->rebuildWellPathNodes(); wellPathCollection->uiCapability()->updateConnectedEditors(); + Riu3DMainWindowTools::selectAsCurrentItem( sourceLateral ); + RimProject::current()->scheduleCreateDisplayModelAndRedrawAllViews(); m_ui->updateConnectedEditors(); @@ -191,3 +203,18 @@ void RicCreateMultipleWellPathLaterals::updateLocationOfTargets( RimModeledWellP wellTarget->setPointXYZ( newTargetLocationXYZ ); } } + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RicCreateMultipleWellPathLaterals::updateLocationOfCompletions( RimModeledWellPath* newModeledWellPath, + const double sourceTieInMeasuredDepth ) +{ + auto tieInMeasuredDepth = newModeledWellPath->wellPathTieIn()->tieInMeasuredDepth(); + auto diffMD = tieInMeasuredDepth - sourceTieInMeasuredDepth; + + for ( auto completion : newModeledWellPath->completions()->allCompletionsNoConst() ) + { + completion->applyOffset( diffMD ); + } +} diff --git a/ApplicationLibCode/Commands/WellPathCommands/RicCreateMultipleWellPathLaterals.h b/ApplicationLibCode/Commands/WellPathCommands/RicCreateMultipleWellPathLaterals.h index 780a6551fe..695a8203b6 100644 --- a/ApplicationLibCode/Commands/WellPathCommands/RicCreateMultipleWellPathLaterals.h +++ b/ApplicationLibCode/Commands/WellPathCommands/RicCreateMultipleWellPathLaterals.h @@ -44,9 +44,12 @@ class RicCreateMultipleWellPathLaterals : public caf::CmdFeature private slots: void slotAppendFractures(); +private: void updateLocationOfTargets( RimModeledWellPath* newModeledWellPath, const cvf::Vec3d& sourceLocationOfFirstWellTarget ); + void updateLocationOfCompletions( RimModeledWellPath* newModeledWellPath, const double sourceTieInMeasuredDepth ); + private: std::unique_ptr m_ui; }; diff --git a/ApplicationLibCode/Commands/WellPathCommands/RicNewWellPathLateralAtDepthFeature.cpp b/ApplicationLibCode/Commands/WellPathCommands/RicNewWellPathLateralAtDepthFeature.cpp index f1d2e85470..ae3f2b316d 100644 --- a/ApplicationLibCode/Commands/WellPathCommands/RicNewWellPathLateralAtDepthFeature.cpp +++ b/ApplicationLibCode/Commands/WellPathCommands/RicNewWellPathLateralAtDepthFeature.cpp @@ -147,13 +147,13 @@ RiuWellPathSelectionItem* RicNewWellPathLateralAtDepthFeature::wellPathSelection //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -QString RicNewWellPathLateralAtDepthFeature::updateNameOfParentAndFindNameOfSideStep( RimWellPath* parentwWellPath ) +QString RicNewWellPathLateralAtDepthFeature::updateNameOfParentAndFindNameOfSideStep( RimWellPath* parentWellPath ) { - if ( !parentwWellPath ) return ""; + if ( !parentWellPath ) return ""; QString nameOfNewWell; - auto topLevelWell = parentwWellPath->topLevelWellPath(); + auto topLevelWell = parentWellPath->topLevelWellPath(); QStringList allNames; { @@ -175,7 +175,7 @@ QString RicNewWellPathLateralAtDepthFeature::updateNameOfParentAndFindNameOfSide if ( allNames.size() == 1 ) { - QString name = parentwWellPath->name(); + QString name = parentWellPath->name(); if ( name.contains( "Y1" ) ) { @@ -183,7 +183,7 @@ QString RicNewWellPathLateralAtDepthFeature::updateNameOfParentAndFindNameOfSide } else { - parentwWellPath->setNameNoUpdateOfExportName( name + " Y1" ); + parentWellPath->setNameNoUpdateOfExportName( name + " Y1" ); nameOfNewWell = name + " Y2"; } diff --git a/ApplicationLibCode/Commands/WellPathCommands/RicNewWellPathLateralAtDepthFeature.h b/ApplicationLibCode/Commands/WellPathCommands/RicNewWellPathLateralAtDepthFeature.h index 5d456c9107..c2fe27e338 100644 --- a/ApplicationLibCode/Commands/WellPathCommands/RicNewWellPathLateralAtDepthFeature.h +++ b/ApplicationLibCode/Commands/WellPathCommands/RicNewWellPathLateralAtDepthFeature.h @@ -36,8 +36,8 @@ class RicNewWellPathLateralAtDepthFeature : public caf::CmdFeature void setupActionLook( QAction* actionToSetup ) override; static RimWellPath* createLateralAtMeasuredDepth( RimWellPath* parentWellPath, double parentWellMD ); + static QString updateNameOfParentAndFindNameOfSideStep( RimWellPath* parentWellPath ); private: static RiuWellPathSelectionItem* wellPathSelectionItem(); - static QString updateNameOfParentAndFindNameOfSideStep( RimWellPath* parentwWellPath ); }; diff --git a/ApplicationLibCode/ProjectDataModel/Completions/RimFishbones.cpp b/ApplicationLibCode/ProjectDataModel/Completions/RimFishbones.cpp index a1978e7837..b4f78c9d90 100644 --- a/ApplicationLibCode/ProjectDataModel/Completions/RimFishbones.cpp +++ b/ApplicationLibCode/ProjectDataModel/Completions/RimFishbones.cpp @@ -535,6 +535,14 @@ double RimFishbones::endMD() const return measuredDepth; } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimFishbones::applyOffset( double offsetMD ) +{ + m_valveLocations->applyOffset( offsetMD ); +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationLibCode/ProjectDataModel/Completions/RimFishbones.h b/ApplicationLibCode/ProjectDataModel/Completions/RimFishbones.h index 523e2c4c08..779ccd8e38 100644 --- a/ApplicationLibCode/ProjectDataModel/Completions/RimFishbones.h +++ b/ApplicationLibCode/ProjectDataModel/Completions/RimFishbones.h @@ -109,6 +109,7 @@ class RimFishbones : public caf::PdmObject, public Rim3dPropertiesInterface, pub cvf::Color3f defaultComponentColor() const override; double startMD() const override; double endMD() const override; + void applyOffset( double offsetMD ) override; public: caf::PdmField fishbonesColor; diff --git a/ApplicationLibCode/ProjectDataModel/Completions/RimMultipleValveLocations.cpp b/ApplicationLibCode/ProjectDataModel/Completions/RimMultipleValveLocations.cpp index e7774cfd2d..db382fd77c 100644 --- a/ApplicationLibCode/ProjectDataModel/Completions/RimMultipleValveLocations.cpp +++ b/ApplicationLibCode/ProjectDataModel/Completions/RimMultipleValveLocations.cpp @@ -217,6 +217,17 @@ void RimMultipleValveLocations::initFields( LocationType locationT } } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimMultipleValveLocations::applyOffset( double offset ) +{ + m_rangeStart = m_rangeStart + offset; + m_rangeEnd = m_rangeEnd + offset; + + computeRangesAndLocations(); +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationLibCode/ProjectDataModel/Completions/RimMultipleValveLocations.h b/ApplicationLibCode/ProjectDataModel/Completions/RimMultipleValveLocations.h index 862656239b..eba216e0dc 100644 --- a/ApplicationLibCode/ProjectDataModel/Completions/RimMultipleValveLocations.h +++ b/ApplicationLibCode/ProjectDataModel/Completions/RimMultipleValveLocations.h @@ -55,6 +55,8 @@ class RimMultipleValveLocations : public caf::PdmObject int valveCount, const std::vector& locationOfValves ); + void applyOffset( double offset ); + protected: void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) override; void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override; diff --git a/ApplicationLibCode/ProjectDataModel/Completions/RimPerforationCollection.cpp b/ApplicationLibCode/ProjectDataModel/Completions/RimPerforationCollection.cpp index dbfcd04122..81c61056c1 100644 --- a/ApplicationLibCode/ProjectDataModel/Completions/RimPerforationCollection.cpp +++ b/ApplicationLibCode/ProjectDataModel/Completions/RimPerforationCollection.cpp @@ -141,6 +141,21 @@ std::vector RimPerforationCollection::perforation return myPerforations; } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +std::vector RimPerforationCollection::perforationsNoConst() const +{ + std::vector myPerforations; + + for ( const auto& perforation : m_perforations ) + { + myPerforations.push_back( perforation ); + } + + return myPerforations; +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationLibCode/ProjectDataModel/Completions/RimPerforationCollection.h b/ApplicationLibCode/ProjectDataModel/Completions/RimPerforationCollection.h index 9f3fee0c08..b8db71201a 100644 --- a/ApplicationLibCode/ProjectDataModel/Completions/RimPerforationCollection.h +++ b/ApplicationLibCode/ProjectDataModel/Completions/RimPerforationCollection.h @@ -46,6 +46,7 @@ class RimPerforationCollection : public RimCheckableNamedObject const RimNonDarcyPerforationParameters* nonDarcyParameters() const; void appendPerforation( RimPerforationInterval* perforation ); std::vector perforations() const; + std::vector perforationsNoConst() const; std::vector activePerforations() const; private: diff --git a/ApplicationLibCode/ProjectDataModel/Completions/RimPerforationInterval.cpp b/ApplicationLibCode/ProjectDataModel/Completions/RimPerforationInterval.cpp index a417a8e49f..ad68bafa20 100644 --- a/ApplicationLibCode/ProjectDataModel/Completions/RimPerforationInterval.cpp +++ b/ApplicationLibCode/ProjectDataModel/Completions/RimPerforationInterval.cpp @@ -305,6 +305,15 @@ double RimPerforationInterval::endMD() const return m_endMD(); } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimPerforationInterval::applyOffset( double offsetMD ) +{ + m_startMD = m_startMD + offsetMD; + m_endMD = m_endMD + offsetMD; +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationLibCode/ProjectDataModel/Completions/RimPerforationInterval.h b/ApplicationLibCode/ProjectDataModel/Completions/RimPerforationInterval.h index 00eb4fce3e..519826f7a2 100644 --- a/ApplicationLibCode/ProjectDataModel/Completions/RimPerforationInterval.h +++ b/ApplicationLibCode/ProjectDataModel/Completions/RimPerforationInterval.h @@ -76,6 +76,7 @@ class RimPerforationInterval : public RimCheckableNamedObject, cvf::Color3f defaultComponentColor() const override; double startMD() const override; double endMD() const override; + void applyOffset( double offsetMD ) override; protected: void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override; diff --git a/ApplicationLibCode/ProjectDataModel/Completions/RimSimWellFracture.cpp b/ApplicationLibCode/ProjectDataModel/Completions/RimSimWellFracture.cpp index b106970670..23b92f0f4f 100644 --- a/ApplicationLibCode/ProjectDataModel/Completions/RimSimWellFracture.cpp +++ b/ApplicationLibCode/ProjectDataModel/Completions/RimSimWellFracture.cpp @@ -155,6 +155,14 @@ bool RimSimWellFracture::isEnabled() const return isChecked(); } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimSimWellFracture::applyOffset( double offsetMD ) +{ + m_location = m_location + offsetMD; +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationLibCode/ProjectDataModel/Completions/RimSimWellFracture.h b/ApplicationLibCode/ProjectDataModel/Completions/RimSimWellFracture.h index 5904b4ee6b..194cc07500 100644 --- a/ApplicationLibCode/ProjectDataModel/Completions/RimSimWellFracture.h +++ b/ApplicationLibCode/ProjectDataModel/Completions/RimSimWellFracture.h @@ -52,6 +52,8 @@ class RimSimWellFracture : public RimFracture bool isEnabled() const override; // RimWellPathCompletionsInterface override + void applyOffset( double offsetMD ) override; + protected: void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) override; void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override; diff --git a/ApplicationLibCode/ProjectDataModel/Completions/RimWellPathCompletions.cpp b/ApplicationLibCode/ProjectDataModel/Completions/RimWellPathCompletions.cpp index 80ca93b082..3e1c541184 100644 --- a/ApplicationLibCode/ProjectDataModel/Completions/RimWellPathCompletions.cpp +++ b/ApplicationLibCode/ProjectDataModel/Completions/RimWellPathCompletions.cpp @@ -171,6 +171,35 @@ std::vector RimWellPathCompletions::activeFractures() cons return {}; } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +std::vector RimWellPathCompletions::allCompletionsNoConst() const +{ + std::vector completions; + + for ( RimWellPathFracture* fracture : m_fractureCollection->allFractures() ) + { + completions.push_back( fracture ); + } + for ( RimFishbones* fishbones : m_fishbonesCollection->allFishbonesSubs() ) + { + completions.push_back( fishbones ); + } + for ( RimPerforationInterval* perforation : m_perforationCollection->perforationsNoConst() ) + { + completions.push_back( perforation ); + } + + std::vector allValves = valves(); + for ( RimWellPathValve* valve : allValves ) + { + completions.push_back( valve ); + } + + return completions; +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationLibCode/ProjectDataModel/Completions/RimWellPathCompletions.h b/ApplicationLibCode/ProjectDataModel/Completions/RimWellPathCompletions.h index 0c377d32d7..4dcf699966 100644 --- a/ApplicationLibCode/ProjectDataModel/Completions/RimWellPathCompletions.h +++ b/ApplicationLibCode/ProjectDataModel/Completions/RimWellPathCompletions.h @@ -50,6 +50,7 @@ class RimWellPathCompletions : public caf::PdmObject RimWellPathFractureCollection* fractureCollection() const; RimStimPlanModelCollection* stimPlanModelCollection() const; + std::vector allCompletionsNoConst() const; std::vector allCompletions() const; bool hasCompletions() const; void setUnitSystemSpecificDefaults(); diff --git a/ApplicationLibCode/ProjectDataModel/Completions/RimWellPathComponentInterface.h b/ApplicationLibCode/ProjectDataModel/Completions/RimWellPathComponentInterface.h index 7438ccdeea..b3757dc350 100644 --- a/ApplicationLibCode/ProjectDataModel/Completions/RimWellPathComponentInterface.h +++ b/ApplicationLibCode/ProjectDataModel/Completions/RimWellPathComponentInterface.h @@ -30,11 +30,12 @@ class RimWellPathComponentInterface { public: - virtual bool isEnabled() const = 0; - virtual RiaDefines::WellPathComponentType componentType() const = 0; - virtual QString componentLabel() const = 0; - virtual QString componentTypeLabel() const = 0; - virtual cvf::Color3f defaultComponentColor() const = 0; - virtual double startMD() const = 0; - virtual double endMD() const = 0; + virtual bool isEnabled() const = 0; + virtual RiaDefines::WellPathComponentType componentType() const = 0; + virtual QString componentLabel() const = 0; + virtual QString componentTypeLabel() const = 0; + virtual cvf::Color3f defaultComponentColor() const = 0; + virtual double startMD() const = 0; + virtual double endMD() const = 0; + virtual void applyOffset( double offsetMD ) = 0; }; diff --git a/ApplicationLibCode/ProjectDataModel/Completions/RimWellPathFracture.cpp b/ApplicationLibCode/ProjectDataModel/Completions/RimWellPathFracture.cpp index 38d5c1cd6e..8fe6f71d90 100644 --- a/ApplicationLibCode/ProjectDataModel/Completions/RimWellPathFracture.cpp +++ b/ApplicationLibCode/ProjectDataModel/Completions/RimWellPathFracture.cpp @@ -310,3 +310,11 @@ void RimWellPathFracture::triangleGeometry( std::vector* nodeCoords, { m_fractureTemplate->fractureTriangleGeometry( nodeCoords, triangleIndices, m_wellPathDepthAtFracture ); } + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimWellPathFracture::applyOffset( double offsetMD ) +{ + m_measuredDepth = m_measuredDepth + offsetMD; +} diff --git a/ApplicationLibCode/ProjectDataModel/Completions/RimWellPathFracture.h b/ApplicationLibCode/ProjectDataModel/Completions/RimWellPathFracture.h index 2cc20ae080..b90a1b8ca9 100644 --- a/ApplicationLibCode/ProjectDataModel/Completions/RimWellPathFracture.h +++ b/ApplicationLibCode/ProjectDataModel/Completions/RimWellPathFracture.h @@ -57,6 +57,8 @@ class RimWellPathFracture : public RimFracture void triangleGeometry( std::vector* nodeCoords, std::vector* triangleIndices ) const override; + void applyOffset( double offsetMD ) override; + protected: void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override; void defineEditorAttribute( const caf::PdmFieldHandle* field, diff --git a/ApplicationLibCode/ProjectDataModel/Completions/RimWellPathValve.cpp b/ApplicationLibCode/ProjectDataModel/Completions/RimWellPathValve.cpp index c6c0c2871d..4ec0e90752 100644 --- a/ApplicationLibCode/ProjectDataModel/Completions/RimWellPathValve.cpp +++ b/ApplicationLibCode/ProjectDataModel/Completions/RimWellPathValve.cpp @@ -434,6 +434,14 @@ double RimWellPathValve::endMD() const } } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimWellPathValve::applyOffset( double offsetMD ) +{ + m_measuredDepth = m_measuredDepth + offsetMD; +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationLibCode/ProjectDataModel/Completions/RimWellPathValve.h b/ApplicationLibCode/ProjectDataModel/Completions/RimWellPathValve.h index 27a19eea79..3b8dc9cc62 100644 --- a/ApplicationLibCode/ProjectDataModel/Completions/RimWellPathValve.h +++ b/ApplicationLibCode/ProjectDataModel/Completions/RimWellPathValve.h @@ -75,6 +75,7 @@ class RimWellPathValve : public RimCheckableNamedObject, public RimWellPathCompo cvf::Color3f defaultComponentColor() const override; double startMD() const override; double endMD() const override; + void applyOffset( double offsetMD ) override; void templateUpdated(); diff --git a/ApplicationLibCode/ProjectDataModel/RimWellPath.cpp b/ApplicationLibCode/ProjectDataModel/RimWellPath.cpp index 5d9bf44f40..cf1aa30291 100644 --- a/ApplicationLibCode/ProjectDataModel/RimWellPath.cpp +++ b/ApplicationLibCode/ProjectDataModel/RimWellPath.cpp @@ -239,6 +239,14 @@ cvf::Color3f RimWellPath::defaultComponentColor() const return RiaColorTables::wellPathComponentColors()[componentType()]; } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimWellPath::applyOffset( double offsetMD ) +{ + // Nothing to do here, as the offset is intended for well path completions +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationLibCode/ProjectDataModel/RimWellPath.h b/ApplicationLibCode/ProjectDataModel/RimWellPath.h index ebec75ccc7..3ba5b0b45f 100644 --- a/ApplicationLibCode/ProjectDataModel/RimWellPath.h +++ b/ApplicationLibCode/ProjectDataModel/RimWellPath.h @@ -153,6 +153,7 @@ class RimWellPath : public caf::PdmObject, public RimWellPathComponentInterface QString componentLabel() const override; QString componentTypeLabel() const override; cvf::Color3f defaultComponentColor() const override; + void applyOffset( double offsetMD ) override; void onChildDeleted( caf::PdmChildArrayFieldHandle* childArray, std::vector& referringObjects ) override; diff --git a/ApplicationLibCode/ProjectDataModel/RimWellPathAttribute.cpp b/ApplicationLibCode/ProjectDataModel/RimWellPathAttribute.cpp index f53db8a111..90bb5711d5 100644 --- a/ApplicationLibCode/ProjectDataModel/RimWellPathAttribute.cpp +++ b/ApplicationLibCode/ProjectDataModel/RimWellPathAttribute.cpp @@ -153,6 +153,15 @@ double RimWellPathAttribute::endMD() const return m_endMD(); } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimWellPathAttribute::applyOffset( double offsetMD ) +{ + m_startMD = m_startMD + offsetMD; + m_endMD = m_endMD + offsetMD; +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationLibCode/ProjectDataModel/RimWellPathAttribute.h b/ApplicationLibCode/ProjectDataModel/RimWellPathAttribute.h index 0e7049bece..31128a6bb5 100644 --- a/ApplicationLibCode/ProjectDataModel/RimWellPathAttribute.h +++ b/ApplicationLibCode/ProjectDataModel/RimWellPathAttribute.h @@ -54,6 +54,7 @@ class RimWellPathAttribute : public caf::PdmObject, public RimWellPathComponentI cvf::Color3f defaultComponentColor() const override; double startMD() const override; double endMD() const override; + void applyOffset( double offsetMD ) override; private: static std::set supportedDiameters( RiaDefines::WellPathComponentType type ); diff --git a/ApplicationLibCode/ProjectDataModel/StimPlanModel/RimStimPlanModel.cpp b/ApplicationLibCode/ProjectDataModel/StimPlanModel/RimStimPlanModel.cpp index 59500a6e01..efd841505b 100644 --- a/ApplicationLibCode/ProjectDataModel/StimPlanModel/RimStimPlanModel.cpp +++ b/ApplicationLibCode/ProjectDataModel/StimPlanModel/RimStimPlanModel.cpp @@ -475,6 +475,14 @@ double RimStimPlanModel::endMD() const return m_MD(); } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimStimPlanModel::applyOffset( double offsetMD ) +{ + // Nothing to do here, this operation is inteded for well path completions +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationLibCode/ProjectDataModel/StimPlanModel/RimStimPlanModel.h b/ApplicationLibCode/ProjectDataModel/StimPlanModel/RimStimPlanModel.h index 7dc7093f8c..cdc9e2e677 100644 --- a/ApplicationLibCode/ProjectDataModel/StimPlanModel/RimStimPlanModel.h +++ b/ApplicationLibCode/ProjectDataModel/StimPlanModel/RimStimPlanModel.h @@ -145,7 +145,9 @@ class RimStimPlanModel : public RimCheckableNamedObject, public RimWellPathCompo cvf::Color3f defaultComponentColor() const override; double startMD() const override; double endMD() const override; - bool isEnabled() const override; + void applyOffset( double offsetMD ) override; + + bool isEnabled() const override; RimWellPath* wellPath() const; From 96ac51c011739088c6c3d436ddd176bfd3bec082 Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Tue, 29 Jun 2021 19:04:00 +0200 Subject: [PATCH 029/308] Fix missing includes --- .../WellPathCommands/RicPasteModeledWellPathFeature.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ApplicationLibCode/Commands/WellPathCommands/RicPasteModeledWellPathFeature.cpp b/ApplicationLibCode/Commands/WellPathCommands/RicPasteModeledWellPathFeature.cpp index 3642511c45..0d1e758b53 100644 --- a/ApplicationLibCode/Commands/WellPathCommands/RicPasteModeledWellPathFeature.cpp +++ b/ApplicationLibCode/Commands/WellPathCommands/RicPasteModeledWellPathFeature.cpp @@ -24,9 +24,13 @@ CAF_CMD_SOURCE_INIT( RicPasteModeledWellPathFeature, "RicPasteModeledWellPathFea #include "RimModeledWellPath.h" #include "RimOilField.h" +#include "RimProject.h" +#include "RimTools.h" #include "RimWellPathCollection.h" #include "RimWellPathTieIn.h" +#include "Riu3DMainWindowTools.h" + #include "cafPdmObjectGroup.h" #include "cafSelectionManager.h" From 3a1f2c8a05e3ff6c1777ea837f66c1eebf9d719c Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Tue, 29 Jun 2021 09:59:45 +0200 Subject: [PATCH 030/308] Janitor : Encapsulate dynamic cast to selection item type --- ...cNewFishbonesSubsAtMeasuredDepthFeature.cpp | 17 ++--------------- ...RicNewFishbonesSubsAtMeasuredDepthFeature.h | 5 ----- ...rforationIntervalAtMeasuredDepthFeature.cpp | 17 ++--------------- ...PerforationIntervalAtMeasuredDepthFeature.h | 3 --- .../RicNewValveAtMeasuredDepthFeature.cpp | 18 +++--------------- .../RicNewValveAtMeasuredDepthFeature.h | 5 ----- .../RicNewWellPathFractureAtPosFeature.cpp | 5 +---- ...RicNewWellPathStimPlanModelAtPosFeature.cpp | 5 +---- .../RicNewWellPathLateralAtDepthFeature.cpp | 17 ++--------------- .../RicNewWellPathLateralAtDepthFeature.h | 4 ---- .../UserInterface/Riu3dSelectionManager.cpp | 8 ++++++++ .../UserInterface/Riu3dSelectionManager.h | 8 ++++++++ 12 files changed, 27 insertions(+), 85 deletions(-) diff --git a/ApplicationLibCode/Commands/CompletionCommands/RicNewFishbonesSubsAtMeasuredDepthFeature.cpp b/ApplicationLibCode/Commands/CompletionCommands/RicNewFishbonesSubsAtMeasuredDepthFeature.cpp index 9c10f5ccea..8da6856259 100644 --- a/ApplicationLibCode/Commands/CompletionCommands/RicNewFishbonesSubsAtMeasuredDepthFeature.cpp +++ b/ApplicationLibCode/Commands/CompletionCommands/RicNewFishbonesSubsAtMeasuredDepthFeature.cpp @@ -40,7 +40,7 @@ CAF_CMD_SOURCE_INIT( RicNewFishbonesSubsAtMeasuredDepthFeature, "RicNewFishbones //-------------------------------------------------------------------------------------------------- void RicNewFishbonesSubsAtMeasuredDepthFeature::onActionTriggered( bool isChecked ) { - RiuWellPathSelectionItem* wellPathSelItem = wellPathSelectionItem(); + RiuWellPathSelectionItem* wellPathSelItem = RiuWellPathSelectionItem::wellPathSelectionItem(); CVF_ASSERT( wellPathSelItem ); RimWellPath* wellPath = wellPathSelItem->m_wellpath; @@ -63,19 +63,6 @@ void RicNewFishbonesSubsAtMeasuredDepthFeature::onActionTriggered( bool isChecke proj->reloadCompletionTypeResultsInAllViews(); } -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -RiuWellPathSelectionItem* RicNewFishbonesSubsAtMeasuredDepthFeature::wellPathSelectionItem() -{ - Riu3dSelectionManager* riuSelManager = Riu3dSelectionManager::instance(); - RiuSelectionItem* selItem = riuSelManager->selectedItem( Riu3dSelectionManager::RUI_TEMPORARY ); - - RiuWellPathSelectionItem* wellPathItem = dynamic_cast( selItem ); - - return wellPathItem; -} - //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- @@ -90,7 +77,7 @@ void RicNewFishbonesSubsAtMeasuredDepthFeature::setupActionLook( QAction* action //-------------------------------------------------------------------------------------------------- bool RicNewFishbonesSubsAtMeasuredDepthFeature::isCommandEnabled() { - if ( wellPathSelectionItem() ) + if ( RiuWellPathSelectionItem::wellPathSelectionItem() ) { return true; } diff --git a/ApplicationLibCode/Commands/CompletionCommands/RicNewFishbonesSubsAtMeasuredDepthFeature.h b/ApplicationLibCode/Commands/CompletionCommands/RicNewFishbonesSubsAtMeasuredDepthFeature.h index 848ea0acb0..9d550c5ef2 100644 --- a/ApplicationLibCode/Commands/CompletionCommands/RicNewFishbonesSubsAtMeasuredDepthFeature.h +++ b/ApplicationLibCode/Commands/CompletionCommands/RicNewFishbonesSubsAtMeasuredDepthFeature.h @@ -20,8 +20,6 @@ #include "cafCmdFeature.h" -class RiuWellPathSelectionItem; - //================================================================================================== /// //================================================================================================== @@ -33,7 +31,4 @@ class RicNewFishbonesSubsAtMeasuredDepthFeature : public caf::CmdFeature void onActionTriggered( bool isChecked ) override; void setupActionLook( QAction* actionToSetup ) override; bool isCommandEnabled() override; - -private: - static RiuWellPathSelectionItem* wellPathSelectionItem(); }; diff --git a/ApplicationLibCode/Commands/CompletionCommands/RicNewPerforationIntervalAtMeasuredDepthFeature.cpp b/ApplicationLibCode/Commands/CompletionCommands/RicNewPerforationIntervalAtMeasuredDepthFeature.cpp index 309bd0e83d..7aab47c225 100644 --- a/ApplicationLibCode/Commands/CompletionCommands/RicNewPerforationIntervalAtMeasuredDepthFeature.cpp +++ b/ApplicationLibCode/Commands/CompletionCommands/RicNewPerforationIntervalAtMeasuredDepthFeature.cpp @@ -41,7 +41,7 @@ CAF_CMD_SOURCE_INIT( RicNewPerforationIntervalAtMeasuredDepthFeature, "RicNewPer //-------------------------------------------------------------------------------------------------- void RicNewPerforationIntervalAtMeasuredDepthFeature::onActionTriggered( bool isChecked ) { - RiuWellPathSelectionItem* wellPathSelItem = wellPathSelectionItem(); + RiuWellPathSelectionItem* wellPathSelItem = RiuWellPathSelectionItem::wellPathSelectionItem(); CVF_ASSERT( wellPathSelItem ); RimWellPath* wellPath = wellPathSelItem->m_wellpath; @@ -64,19 +64,6 @@ void RicNewPerforationIntervalAtMeasuredDepthFeature::onActionTriggered( bool is Riu3DMainWindowTools::selectAsCurrentItem( perforationInterval ); } -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -RiuWellPathSelectionItem* RicNewPerforationIntervalAtMeasuredDepthFeature::wellPathSelectionItem() -{ - Riu3dSelectionManager* riuSelManager = Riu3dSelectionManager::instance(); - RiuSelectionItem* selItem = riuSelManager->selectedItem( Riu3dSelectionManager::RUI_TEMPORARY ); - - RiuWellPathSelectionItem* wellPathItem = dynamic_cast( selItem ); - - return wellPathItem; -} - //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- @@ -91,7 +78,7 @@ void RicNewPerforationIntervalAtMeasuredDepthFeature::setupActionLook( QAction* //-------------------------------------------------------------------------------------------------- bool RicNewPerforationIntervalAtMeasuredDepthFeature::isCommandEnabled() { - if ( wellPathSelectionItem() ) + if ( RiuWellPathSelectionItem::wellPathSelectionItem() ) { return true; } diff --git a/ApplicationLibCode/Commands/CompletionCommands/RicNewPerforationIntervalAtMeasuredDepthFeature.h b/ApplicationLibCode/Commands/CompletionCommands/RicNewPerforationIntervalAtMeasuredDepthFeature.h index a208aa7e5f..e70afc4370 100644 --- a/ApplicationLibCode/Commands/CompletionCommands/RicNewPerforationIntervalAtMeasuredDepthFeature.h +++ b/ApplicationLibCode/Commands/CompletionCommands/RicNewPerforationIntervalAtMeasuredDepthFeature.h @@ -33,7 +33,4 @@ class RicNewPerforationIntervalAtMeasuredDepthFeature : public caf::CmdFeature void onActionTriggered( bool isChecked ) override; void setupActionLook( QAction* actionToSetup ) override; bool isCommandEnabled() override; - -private: - static RiuWellPathSelectionItem* wellPathSelectionItem(); }; diff --git a/ApplicationLibCode/Commands/CompletionCommands/RicNewValveAtMeasuredDepthFeature.cpp b/ApplicationLibCode/Commands/CompletionCommands/RicNewValveAtMeasuredDepthFeature.cpp index 47cc1162a3..37bde7663b 100644 --- a/ApplicationLibCode/Commands/CompletionCommands/RicNewValveAtMeasuredDepthFeature.cpp +++ b/ApplicationLibCode/Commands/CompletionCommands/RicNewValveAtMeasuredDepthFeature.cpp @@ -41,7 +41,7 @@ CAF_CMD_SOURCE_INIT( RicNewValveAtMeasuredDepthFeature, "RicNewValveAtMeasuredDe //-------------------------------------------------------------------------------------------------- void RicNewValveAtMeasuredDepthFeature::onActionTriggered( bool isChecked ) { - RiuWellPathSelectionItem* wellPathSelItem = wellPathSelectionItem(); + RiuWellPathSelectionItem* wellPathSelItem = RiuWellPathSelectionItem::wellPathSelectionItem(); CVF_ASSERT( wellPathSelItem ); RimWellPath* wellPath = wellPathSelItem->m_wellpath; @@ -91,23 +91,11 @@ void RicNewValveAtMeasuredDepthFeature::setupActionLook( QAction* actionToSetup //-------------------------------------------------------------------------------------------------- bool RicNewValveAtMeasuredDepthFeature::isCommandEnabled() { - if ( wellPathSelectionItem() && dynamic_cast( wellPathSelectionItem()->m_wellPathComponent ) ) + auto wellPathSelectionItem = RiuWellPathSelectionItem::wellPathSelectionItem(); + if ( wellPathSelectionItem && dynamic_cast( wellPathSelectionItem->m_wellPathComponent ) ) { return true; } return false; } - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -RiuWellPathSelectionItem* RicNewValveAtMeasuredDepthFeature::wellPathSelectionItem() -{ - Riu3dSelectionManager* riuSelManager = Riu3dSelectionManager::instance(); - RiuSelectionItem* selItem = riuSelManager->selectedItem( Riu3dSelectionManager::RUI_TEMPORARY ); - - RiuWellPathSelectionItem* wellPathItem = dynamic_cast( selItem ); - - return wellPathItem; -} diff --git a/ApplicationLibCode/Commands/CompletionCommands/RicNewValveAtMeasuredDepthFeature.h b/ApplicationLibCode/Commands/CompletionCommands/RicNewValveAtMeasuredDepthFeature.h index 8552baf9d7..ea65cfcc95 100644 --- a/ApplicationLibCode/Commands/CompletionCommands/RicNewValveAtMeasuredDepthFeature.h +++ b/ApplicationLibCode/Commands/CompletionCommands/RicNewValveAtMeasuredDepthFeature.h @@ -20,8 +20,6 @@ #include "cafCmdFeature.h" -class RiuWellPathSelectionItem; - //================================================================================================== /// //================================================================================================== @@ -33,7 +31,4 @@ class RicNewValveAtMeasuredDepthFeature : public caf::CmdFeature void onActionTriggered( bool isChecked ) override; void setupActionLook( QAction* actionToSetup ) override; bool isCommandEnabled() override; - -private: - static RiuWellPathSelectionItem* wellPathSelectionItem(); }; diff --git a/ApplicationLibCode/Commands/FractureCommands/RicNewWellPathFractureAtPosFeature.cpp b/ApplicationLibCode/Commands/FractureCommands/RicNewWellPathFractureAtPosFeature.cpp index 5363d12ef7..82ef26e64a 100644 --- a/ApplicationLibCode/Commands/FractureCommands/RicNewWellPathFractureAtPosFeature.cpp +++ b/ApplicationLibCode/Commands/FractureCommands/RicNewWellPathFractureAtPosFeature.cpp @@ -33,10 +33,7 @@ CAF_CMD_SOURCE_INIT( RicNewWellPathFractureAtPosFeature, "RicNewWellPathFracture //-------------------------------------------------------------------------------------------------- void RicNewWellPathFractureAtPosFeature::onActionTriggered( bool isChecked ) { - Riu3dSelectionManager* riuSelManager = Riu3dSelectionManager::instance(); - RiuSelectionItem* selItem = riuSelManager->selectedItem( Riu3dSelectionManager::RUI_TEMPORARY ); - - RiuWellPathSelectionItem* wellPathItem = dynamic_cast( selItem ); + RiuWellPathSelectionItem* wellPathItem = RiuWellPathSelectionItem::wellPathSelectionItem(); if ( !wellPathItem ) return; RimWellPath* wellPath = wellPathItem->m_wellpath; diff --git a/ApplicationLibCode/Commands/FractureCommands/RicNewWellPathStimPlanModelAtPosFeature.cpp b/ApplicationLibCode/Commands/FractureCommands/RicNewWellPathStimPlanModelAtPosFeature.cpp index d4ba94e411..ca6c545fb9 100644 --- a/ApplicationLibCode/Commands/FractureCommands/RicNewWellPathStimPlanModelAtPosFeature.cpp +++ b/ApplicationLibCode/Commands/FractureCommands/RicNewWellPathStimPlanModelAtPosFeature.cpp @@ -38,10 +38,7 @@ CAF_CMD_SOURCE_INIT( RicNewWellPathStimPlanModelAtPosFeature, "RicNewWellPathSti //-------------------------------------------------------------------------------------------------- void RicNewWellPathStimPlanModelAtPosFeature::onActionTriggered( bool isChecked ) { - Riu3dSelectionManager* riuSelManager = Riu3dSelectionManager::instance(); - RiuSelectionItem* selItem = riuSelManager->selectedItem( Riu3dSelectionManager::RUI_TEMPORARY ); - - RiuWellPathSelectionItem* wellPathItem = dynamic_cast( selItem ); + RiuWellPathSelectionItem* wellPathItem = RiuWellPathSelectionItem::wellPathSelectionItem(); if ( !wellPathItem ) return; RimWellPath* wellPath = wellPathItem->m_wellpath; diff --git a/ApplicationLibCode/Commands/WellPathCommands/RicNewWellPathLateralAtDepthFeature.cpp b/ApplicationLibCode/Commands/WellPathCommands/RicNewWellPathLateralAtDepthFeature.cpp index ae3f2b316d..41d8dfdb5c 100644 --- a/ApplicationLibCode/Commands/WellPathCommands/RicNewWellPathLateralAtDepthFeature.cpp +++ b/ApplicationLibCode/Commands/WellPathCommands/RicNewWellPathLateralAtDepthFeature.cpp @@ -48,7 +48,7 @@ CAF_CMD_SOURCE_INIT( RicNewWellPathLateralAtDepthFeature, "RicNewWellPathLateral //-------------------------------------------------------------------------------------------------- bool RicNewWellPathLateralAtDepthFeature::isCommandEnabled() { - if ( wellPathSelectionItem() ) + if ( RiuWellPathSelectionItem::wellPathSelectionItem() ) { return true; } @@ -61,7 +61,7 @@ bool RicNewWellPathLateralAtDepthFeature::isCommandEnabled() //-------------------------------------------------------------------------------------------------- void RicNewWellPathLateralAtDepthFeature::onActionTriggered( bool isChecked ) { - RiuWellPathSelectionItem* wellPathSelItem = wellPathSelectionItem(); + RiuWellPathSelectionItem* wellPathSelItem = RiuWellPathSelectionItem::wellPathSelectionItem(); CVF_ASSERT( wellPathSelItem ); RimWellPath* parentWellPath = wellPathSelItem->m_wellpath; @@ -131,19 +131,6 @@ RimWellPath* RicNewWellPathLateralAtDepthFeature::createLateralAtMeasuredDepth( return nullptr; } -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -RiuWellPathSelectionItem* RicNewWellPathLateralAtDepthFeature::wellPathSelectionItem() -{ - Riu3dSelectionManager* riuSelManager = Riu3dSelectionManager::instance(); - RiuSelectionItem* selItem = riuSelManager->selectedItem( Riu3dSelectionManager::RUI_TEMPORARY ); - - RiuWellPathSelectionItem* wellPathItem = dynamic_cast( selItem ); - - return wellPathItem; -} - //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationLibCode/Commands/WellPathCommands/RicNewWellPathLateralAtDepthFeature.h b/ApplicationLibCode/Commands/WellPathCommands/RicNewWellPathLateralAtDepthFeature.h index c2fe27e338..39709160ad 100644 --- a/ApplicationLibCode/Commands/WellPathCommands/RicNewWellPathLateralAtDepthFeature.h +++ b/ApplicationLibCode/Commands/WellPathCommands/RicNewWellPathLateralAtDepthFeature.h @@ -20,7 +20,6 @@ #include "cafCmdFeature.h" -class RiuWellPathSelectionItem; class RimWellPath; //================================================================================================== @@ -37,7 +36,4 @@ class RicNewWellPathLateralAtDepthFeature : public caf::CmdFeature static RimWellPath* createLateralAtMeasuredDepth( RimWellPath* parentWellPath, double parentWellMD ); static QString updateNameOfParentAndFindNameOfSideStep( RimWellPath* parentWellPath ); - -private: - static RiuWellPathSelectionItem* wellPathSelectionItem(); }; diff --git a/ApplicationLibCode/UserInterface/Riu3dSelectionManager.cpp b/ApplicationLibCode/UserInterface/Riu3dSelectionManager.cpp index 55789e50d7..6f19f93986 100644 --- a/ApplicationLibCode/UserInterface/Riu3dSelectionManager.cpp +++ b/ApplicationLibCode/UserInterface/Riu3dSelectionManager.cpp @@ -283,6 +283,14 @@ RiuWellPathSelectionItem::RiuWellPathSelectionItem( const RivWellPathSourceInfo* m_wellpath = wellPathSourceInfo->wellPath(); } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RiuWellPathSelectionItem* RiuWellPathSelectionItem::wellPathSelectionItem() +{ + return Riu3dSelectionManager::instance()->objectByType( Riu3dSelectionManager::RUI_TEMPORARY ); +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationLibCode/UserInterface/Riu3dSelectionManager.h b/ApplicationLibCode/UserInterface/Riu3dSelectionManager.h index ab3a0b0768..96dfc44fc9 100644 --- a/ApplicationLibCode/UserInterface/Riu3dSelectionManager.h +++ b/ApplicationLibCode/UserInterface/Riu3dSelectionManager.h @@ -84,6 +84,12 @@ class Riu3dSelectionManager bool isEmpty( int role = RUI_APPLICATION_GLOBAL ) const; + template + T* objectByType( int role ) const + { + return dynamic_cast( selectedItem( role ) ); + } + private: Riu3dSelectionManager(); ~Riu3dSelectionManager(); @@ -243,6 +249,8 @@ class RiuWellPathSelectionItem : public RiuSelectionItem RiuSelectionType type() const override { return WELLPATH_SELECTION_OBJECT; } + static RiuWellPathSelectionItem* wellPathSelectionItem(); + public: RimWellPath* m_wellpath; cvf::Vec3d m_pipeCenterlineIntersectionInDomainCoords; From a3d5847733821106d18eef09c6e2ef94c1786b36 Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Tue, 29 Jun 2021 14:17:35 +0200 Subject: [PATCH 031/308] #7824 Modeled Well Path : Optional support for linking of wells #7824 Modeled Well Path : Add to context menu in 3D view --- .../WellPathCommands/CMakeLists_files.cmake | 2 + .../RicWellTarget3dEditor.cpp | 19 ++-- .../RicLinkWellPathFeature.cpp | 87 +++++++++++++++++++ .../WellPathCommands/RicLinkWellPathFeature.h | 40 +++++++++ .../ProjectDataModel/CMakeLists_files.cmake | 2 + .../RimWellPathGeometryDef.cpp | 51 ++++++++++- .../ProjectDataModel/RimWellPathGeometryDef.h | 3 + .../RimWellPathGeometryDefTools.cpp | 68 +++++++++++++++ .../RimWellPathGeometryDefTools.h | 26 ++++++ .../UserInterface/RiuViewerCommands.cpp | 1 + 10 files changed, 291 insertions(+), 8 deletions(-) create mode 100644 ApplicationLibCode/Commands/WellPathCommands/RicLinkWellPathFeature.cpp create mode 100644 ApplicationLibCode/Commands/WellPathCommands/RicLinkWellPathFeature.h create mode 100644 ApplicationLibCode/ProjectDataModel/RimWellPathGeometryDefTools.cpp create mode 100644 ApplicationLibCode/ProjectDataModel/RimWellPathGeometryDefTools.h diff --git a/ApplicationLibCode/Commands/WellPathCommands/CMakeLists_files.cmake b/ApplicationLibCode/Commands/WellPathCommands/CMakeLists_files.cmake index 8eb2c80473..cb8c3b62c6 100644 --- a/ApplicationLibCode/Commands/WellPathCommands/CMakeLists_files.cmake +++ b/ApplicationLibCode/Commands/WellPathCommands/CMakeLists_files.cmake @@ -22,6 +22,7 @@ ${CMAKE_CURRENT_LIST_DIR}/RicNewWellPathLateralFeature.h ${CMAKE_CURRENT_LIST_DIR}/RicPasteModeledWellPathFeature.h ${CMAKE_CURRENT_LIST_DIR}/RicCreateMultipleWellPathLaterals.h ${CMAKE_CURRENT_LIST_DIR}/RicCreateMultipleWellPathLateralsUi.h +${CMAKE_CURRENT_LIST_DIR}/RicLinkWellPathFeature.h ${CMAKE_CURRENT_LIST_DIR}/PointTangentManipulator/Ric3dObjectEditorHandle.h ${CMAKE_CURRENT_LIST_DIR}/PointTangentManipulator/RicPointTangentManipulator.h ${CMAKE_CURRENT_LIST_DIR}/PointTangentManipulator/RicWellTarget3dEditor.h @@ -54,6 +55,7 @@ ${CMAKE_CURRENT_LIST_DIR}/RicNewWellPathLateralFeature.cpp ${CMAKE_CURRENT_LIST_DIR}/RicPasteModeledWellPathFeature.cpp ${CMAKE_CURRENT_LIST_DIR}/RicCreateMultipleWellPathLaterals.cpp ${CMAKE_CURRENT_LIST_DIR}/RicCreateMultipleWellPathLateralsUi.cpp +${CMAKE_CURRENT_LIST_DIR}/RicLinkWellPathFeature.cpp ${CMAKE_CURRENT_LIST_DIR}/PointTangentManipulator/Ric3dObjectEditorHandle.cpp ${CMAKE_CURRENT_LIST_DIR}/PointTangentManipulator/RicPointTangentManipulator.cpp ${CMAKE_CURRENT_LIST_DIR}/PointTangentManipulator/RicWellTarget3dEditor.cpp diff --git a/ApplicationLibCode/Commands/WellPathCommands/PointTangentManipulator/RicWellTarget3dEditor.cpp b/ApplicationLibCode/Commands/WellPathCommands/PointTangentManipulator/RicWellTarget3dEditor.cpp index 46cb304d21..972b9997aa 100644 --- a/ApplicationLibCode/Commands/WellPathCommands/PointTangentManipulator/RicWellTarget3dEditor.cpp +++ b/ApplicationLibCode/Commands/WellPathCommands/PointTangentManipulator/RicWellTarget3dEditor.cpp @@ -24,6 +24,7 @@ #include "RimCase.h" #include "RimModeledWellPath.h" #include "RimWellPathGeometryDef.h" +#include "RimWellPathGeometryDefTools.h" #include "RimWellPathTarget.h" #include "RiuViewer.h" @@ -166,15 +167,19 @@ void RicWellTarget3dEditor::slotUpdated( const cvf::Vec3d& origin, const cvf::Ve auto relativePositionXYZ = domainCoordXYZ - geomDef->anchorPointXyz(); auto delta = target->targetPointXYZ() - relativePositionXYZ; - auto currentRefPointXyz = geomDef->anchorPointXyz(); - auto newRefPointXyz = currentRefPointXyz - delta; - geomDef->setReferencePointXyz( newRefPointXyz ); - geomDef->changed.send( false ); - geomDef->updateWellPathVisualization( true ); - for ( auto wt : geomDef->activeWellTargets() ) + // Find all linked wells and update with delta change + + std::vector linkedWellPathGeoDefs; + if ( geomDef->isReferencePointUpdatesLinked() ) + { + linkedWellPathGeoDefs = RimWellPathGeometryDefTools::linkedDefinitions(); + } + else { - wt->updateConnectedEditors(); + linkedWellPathGeoDefs.push_back( geomDef ); } + + RimWellPathGeometryDefTools::updateLinkedGeometryDefinitions( linkedWellPathGeoDefs, delta ); } else { diff --git a/ApplicationLibCode/Commands/WellPathCommands/RicLinkWellPathFeature.cpp b/ApplicationLibCode/Commands/WellPathCommands/RicLinkWellPathFeature.cpp new file mode 100644 index 0000000000..4707eb8d5e --- /dev/null +++ b/ApplicationLibCode/Commands/WellPathCommands/RicLinkWellPathFeature.cpp @@ -0,0 +1,87 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2021- Equinor ASA +// +// ResInsight is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// + +#include "RicLinkWellPathFeature.h" + +#include "RimModeledWellPath.h" +#include "RimWellPathGeometryDef.h" + +#include "Riu3dSelectionManager.h" + +#include "cafSelectionManager.h" + +#include + +CAF_CMD_SOURCE_INIT( RicLinkWellPathFeature, "RicLinkWellPathFeature" ); + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +bool RicLinkWellPathFeature::isCommandEnabled() +{ + return ( wellPathGeometryDef() != nullptr ); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RicLinkWellPathFeature::onActionTriggered( bool isChecked ) +{ + if ( auto geoDef = wellPathGeometryDef() ) + { + geoDef->enableLinkOfReferencePointUpdates( isChecked ); + geoDef->updateConnectedEditors(); + } +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RicLinkWellPathFeature::setupActionLook( QAction* actionToSetup ) +{ + QString text = "Link Reference Point"; + actionToSetup->setText( text ); + actionToSetup->setCheckable( true ); + actionToSetup->setChecked( isCommandChecked() ); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +bool RicLinkWellPathFeature::isCommandChecked() +{ + if ( auto geoDef = wellPathGeometryDef() ) + { + return geoDef->isReferencePointUpdatesLinked(); + } + + return false; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RimWellPathGeometryDef* RicLinkWellPathFeature::wellPathGeometryDef() +{ + auto wellPathSelectionItem = RiuWellPathSelectionItem::wellPathSelectionItem(); + if ( wellPathSelectionItem && wellPathSelectionItem->m_wellpath ) + { + auto modeledWellPath = dynamic_cast( wellPathSelectionItem->m_wellpath ); + return modeledWellPath->geometryDefinition(); + } +} diff --git a/ApplicationLibCode/Commands/WellPathCommands/RicLinkWellPathFeature.h b/ApplicationLibCode/Commands/WellPathCommands/RicLinkWellPathFeature.h new file mode 100644 index 0000000000..006f942e84 --- /dev/null +++ b/ApplicationLibCode/Commands/WellPathCommands/RicLinkWellPathFeature.h @@ -0,0 +1,40 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2021- Equinor ASA +// +// ResInsight is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// + +#pragma once + +#include "cafCmdFeature.h" + +class RimWellPathGeometryDef; + +//================================================================================================== +/// +//================================================================================================== +class RicLinkWellPathFeature : public caf::CmdFeature +{ + CAF_CMD_HEADER_INIT; + +public: + bool isCommandEnabled() override; + void onActionTriggered( bool isChecked ) override; + void setupActionLook( QAction* actionToSetup ) override; + bool isCommandChecked() override; + +private: + static RimWellPathGeometryDef* wellPathGeometryDef(); +}; diff --git a/ApplicationLibCode/ProjectDataModel/CMakeLists_files.cmake b/ApplicationLibCode/ProjectDataModel/CMakeLists_files.cmake index 567b8c996e..d70bc6d209 100644 --- a/ApplicationLibCode/ProjectDataModel/CMakeLists_files.cmake +++ b/ApplicationLibCode/ProjectDataModel/CMakeLists_files.cmake @@ -27,6 +27,7 @@ ${CMAKE_CURRENT_LIST_DIR}/RimWellMeasurement.h ${CMAKE_CURRENT_LIST_DIR}/RimWellMeasurementCollection.h ${CMAKE_CURRENT_LIST_DIR}/RimWellMeasurementFilePath.h ${CMAKE_CURRENT_LIST_DIR}/RimWellPathGeometryDef.h +${CMAKE_CURRENT_LIST_DIR}/RimWellPathGeometryDefTools.h ${CMAKE_CURRENT_LIST_DIR}/RimWellPathAttribute.h ${CMAKE_CURRENT_LIST_DIR}/RimWellPathAttributeCollection.h ${CMAKE_CURRENT_LIST_DIR}/RimWellPathCollection.h @@ -185,6 +186,7 @@ ${CMAKE_CURRENT_LIST_DIR}/RimWellMeasurement.cpp ${CMAKE_CURRENT_LIST_DIR}/RimWellMeasurementCollection.cpp ${CMAKE_CURRENT_LIST_DIR}/RimWellMeasurementFilePath.cpp ${CMAKE_CURRENT_LIST_DIR}/RimWellPathGeometryDef.cpp +${CMAKE_CURRENT_LIST_DIR}/RimWellPathGeometryDefTools.cpp ${CMAKE_CURRENT_LIST_DIR}/RimWellPathAttribute.cpp ${CMAKE_CURRENT_LIST_DIR}/RimWellPathAttributeCollection.cpp ${CMAKE_CURRENT_LIST_DIR}/RimWellPathCollection.cpp diff --git a/ApplicationLibCode/ProjectDataModel/RimWellPathGeometryDef.cpp b/ApplicationLibCode/ProjectDataModel/RimWellPathGeometryDef.cpp index 7c04009259..6a800647ac 100644 --- a/ApplicationLibCode/ProjectDataModel/RimWellPathGeometryDef.cpp +++ b/ApplicationLibCode/ProjectDataModel/RimWellPathGeometryDef.cpp @@ -32,6 +32,7 @@ #include "RimModeledWellPath.h" #include "RimProject.h" +#include "RimWellPathGeometryDefTools.h" #include "RimWellPathTarget.h" #include "RiuViewerCommands.h" @@ -101,6 +102,14 @@ RimWellPathGeometryDef::RimWellPathGeometryDef() "", "" ); + CAF_PDM_InitScriptableField( &m_linkReferencePointUpdates, + "LinkReferencePointUpdates", + false, + "Link Reference Point Updates", + "", + "", + "" ); + CAF_PDM_InitScriptableFieldNoDefault( &m_autoTargetAtSeaLevel, "AutoGeneratedTarget", "Auto Generated Target", "", "", "" ); m_autoTargetAtSeaLevel = new RimWellPathTarget; m_autoTargetAtSeaLevel->setEnabled( false ); @@ -168,6 +177,22 @@ void RimWellPathGeometryDef::enableReferencePointFromTopLevelWell( bool enable ) m_useTopLevelWellReferencePoint = enable; } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimWellPathGeometryDef::enableLinkOfReferencePointUpdates( bool enable ) +{ + m_linkReferencePointUpdates = enable; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +bool RimWellPathGeometryDef::isReferencePointUpdatesLinked() const +{ + return m_linkReferencePointUpdates; +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- @@ -478,6 +503,26 @@ void RimWellPathGeometryDef::fieldChangedByUi( const caf::PdmFieldHandle* change { this->updateConnectedEditors(); } + else if ( changedField == &m_referencePointUtmXyd ) + { + if ( isReferencePointUpdatesLinked() ) + { + auto linkedDefs = RimWellPathGeometryDefTools::linkedDefinitions(); + + // Remove this to avoid duplicate updates + linkedDefs.erase( std::remove_if( linkedDefs.begin(), + linkedDefs.end(), + [this]( auto const& geoDef ) { return geoDef == this; } ), + linkedDefs.end() ); + + cvf::Vec3d oldPos; + caf::PdmValueFieldSpecialization::setFromVariant( oldValue, oldPos ); + + auto delta = m_referencePointUtmXyd() - oldPos; + + RimWellPathGeometryDefTools::updateLinkedGeometryDefinitions( linkedDefs, delta ); + } + } changed.send( false ); } @@ -488,15 +533,19 @@ void RimWellPathGeometryDef::fieldChangedByUi( const caf::PdmFieldHandle* change void RimWellPathGeometryDef::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) { uiOrdering.add( &m_referencePointUtmXyd ); - uiOrdering.add( &m_useTopLevelWellReferencePoint ); m_referencePointUtmXyd.uiCapability()->setUiReadOnly( m_useTopLevelWellReferencePoint ); if ( !m_isAttachedToParentWell ) { + uiOrdering.add( &m_linkReferencePointUpdates ); uiOrdering.add( &m_airGap ); uiOrdering.add( &m_mdAtFirstTarget ); uiOrdering.add( &m_useAutoGeneratedTargetAtSeaLevel ); } + else + { + uiOrdering.add( &m_useTopLevelWellReferencePoint ); + } auto group = uiOrdering.addNewGroup( "Well Target Appearance" ); group->add( &m_showSpheres ); diff --git a/ApplicationLibCode/ProjectDataModel/RimWellPathGeometryDef.h b/ApplicationLibCode/ProjectDataModel/RimWellPathGeometryDef.h index ec819387ef..573a843052 100644 --- a/ApplicationLibCode/ProjectDataModel/RimWellPathGeometryDef.h +++ b/ApplicationLibCode/ProjectDataModel/RimWellPathGeometryDef.h @@ -54,6 +54,8 @@ class RimWellPathGeometryDef : public caf::PdmObject void setReferencePointXyz( const cvf::Vec3d& refPointXyz ); bool useReferencePointFromTopLevelWell() const; void enableReferencePointFromTopLevelWell( bool enable ); + void enableLinkOfReferencePointUpdates( bool enable ); + bool isReferencePointUpdatesLinked() const; double airGap() const; void setAirGap( double airGap ); @@ -125,6 +127,7 @@ class RimWellPathGeometryDef : public caf::PdmObject caf::PdmChildArrayField m_wellTargets; caf::PdmField m_showAbsolutePosForWellTargets; caf::PdmField m_useTopLevelWellReferencePoint; + caf::PdmField m_linkReferencePointUpdates; caf::PdmField m_useAutoGeneratedTargetAtSeaLevel; caf::PdmChildField m_autoTargetAtSeaLevel; diff --git a/ApplicationLibCode/ProjectDataModel/RimWellPathGeometryDefTools.cpp b/ApplicationLibCode/ProjectDataModel/RimWellPathGeometryDefTools.cpp new file mode 100644 index 0000000000..7d21740ddf --- /dev/null +++ b/ApplicationLibCode/ProjectDataModel/RimWellPathGeometryDefTools.cpp @@ -0,0 +1,68 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2021 Equinor ASA +// +// ResInsight is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// + +#include "RimWellPathGeometryDefTools.h" + +#include "RimModeledWellPath.h" +#include "RimTools.h" +#include "RimWellPathCollection.h" +#include "RimWellPathGeometryDef.h" +#include "RimWellPathTarget.h" + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimWellPathGeometryDefTools::updateLinkedGeometryDefinitions( std::vector& definitions, + cvf::Vec3d delta ) +{ + for ( auto wellPathGeoDef : definitions ) + { + auto currentRefPointXyz = wellPathGeoDef->anchorPointXyz(); + auto newRefPointXyz = currentRefPointXyz - delta; + + wellPathGeoDef->setReferencePointXyz( newRefPointXyz ); + + wellPathGeoDef->changed.send( false ); + wellPathGeoDef->updateWellPathVisualization( true ); + for ( auto wt : wellPathGeoDef->activeWellTargets() ) + { + wt->updateConnectedEditors(); + } + } +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +std::vector RimWellPathGeometryDefTools::linkedDefinitions() +{ + std::vector linkedWellPathGeoDefs; + + for ( auto w : RimTools::wellPathCollection()->allWellPaths() ) + { + auto modeledWellPath = dynamic_cast( w ); + if ( !modeledWellPath ) continue; + + if ( modeledWellPath->geometryDefinition()->isReferencePointUpdatesLinked() ) + { + linkedWellPathGeoDefs.push_back( modeledWellPath->geometryDefinition() ); + } + } + + return linkedWellPathGeoDefs; +} diff --git a/ApplicationLibCode/ProjectDataModel/RimWellPathGeometryDefTools.h b/ApplicationLibCode/ProjectDataModel/RimWellPathGeometryDefTools.h new file mode 100644 index 0000000000..b93e32ef97 --- /dev/null +++ b/ApplicationLibCode/ProjectDataModel/RimWellPathGeometryDefTools.h @@ -0,0 +1,26 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2021 Equinor ASA +// +// ResInsight is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// +#pragma once + +class RimWellPathGeometryDefTools +{ +public: + static void updateLinkedGeometryDefinitions( std::vector& definitions, cvf::Vec3d delta ); + + static std::vector linkedDefinitions(); +}; diff --git a/ApplicationLibCode/UserInterface/RiuViewerCommands.cpp b/ApplicationLibCode/UserInterface/RiuViewerCommands.cpp index 294bca3f14..c8e8c7a797 100644 --- a/ApplicationLibCode/UserInterface/RiuViewerCommands.cpp +++ b/ApplicationLibCode/UserInterface/RiuViewerCommands.cpp @@ -553,6 +553,7 @@ void RiuViewerCommands::displayContextMenu( QMouseEvent* event ) menuBuilder.addSeparator(); menuBuilder << "RicNewWellPathLateralAtDepthFeature"; menuBuilder << "RicNewWellPathIntersectionFeature"; + menuBuilder << "RicLinkWellPathFeature"; } const RivSimWellPipeSourceInfo* eclipseWellSourceInfo = From 4e45f397e877999634e0bb12f82ab00725c192db Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Tue, 29 Jun 2021 19:09:12 +0200 Subject: [PATCH 032/308] Fix missing includes --- .../ProjectDataModel/RimWellPathGeometryDefTools.cpp | 2 +- .../ProjectDataModel/RimWellPathGeometryDefTools.h | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/ApplicationLibCode/ProjectDataModel/RimWellPathGeometryDefTools.cpp b/ApplicationLibCode/ProjectDataModel/RimWellPathGeometryDefTools.cpp index 7d21740ddf..bd90ad7828 100644 --- a/ApplicationLibCode/ProjectDataModel/RimWellPathGeometryDefTools.cpp +++ b/ApplicationLibCode/ProjectDataModel/RimWellPathGeometryDefTools.cpp @@ -28,7 +28,7 @@ /// //-------------------------------------------------------------------------------------------------- void RimWellPathGeometryDefTools::updateLinkedGeometryDefinitions( std::vector& definitions, - cvf::Vec3d delta ) + const cvf::Vec3d& delta ) { for ( auto wellPathGeoDef : definitions ) { diff --git a/ApplicationLibCode/ProjectDataModel/RimWellPathGeometryDefTools.h b/ApplicationLibCode/ProjectDataModel/RimWellPathGeometryDefTools.h index b93e32ef97..68e5cf1802 100644 --- a/ApplicationLibCode/ProjectDataModel/RimWellPathGeometryDefTools.h +++ b/ApplicationLibCode/ProjectDataModel/RimWellPathGeometryDefTools.h @@ -17,10 +17,17 @@ ///////////////////////////////////////////////////////////////////////////////// #pragma once +#include "cvfVector3.h" + +#include + +class RimWellPathGeometryDef; + class RimWellPathGeometryDefTools { public: - static void updateLinkedGeometryDefinitions( std::vector& definitions, cvf::Vec3d delta ); + static void updateLinkedGeometryDefinitions( std::vector& definitions, + const cvf::Vec3d& delta ); static std::vector linkedDefinitions(); }; From 3af8d3292822fbc9dc6dcf699235336d91d92398 Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Tue, 29 Jun 2021 20:41:50 +0200 Subject: [PATCH 033/308] #7829 AppEnum : Make sure text used in XML serialization is trimmed If the AppEnum text used to serialize the AppEnum contains whitespace at start or end, the serialization will fail and the AppEnum value will end up with a default value. This commit will make sure that this field is always trimmed ( text coming from the application, from xml parsing, text from scripting). --- .../cafProjectDataModel/cafPdmCore/cafAppEnum.h | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/Fwk/AppFwk/cafProjectDataModel/cafPdmCore/cafAppEnum.h b/Fwk/AppFwk/cafProjectDataModel/cafPdmCore/cafAppEnum.h index 5fe04028a0..af69fc4402 100644 --- a/Fwk/AppFwk/cafProjectDataModel/cafPdmCore/cafAppEnum.h +++ b/Fwk/AppFwk/cafProjectDataModel/cafPdmCore/cafAppEnum.h @@ -191,7 +191,10 @@ class AppEnum public: void addItem( T enumVal, const QString& text, QString uiText ) { - instance()->m_mapping.push_back( Triplet( enumVal, text, uiText ) ); + // Make sure the text is trimmed, as this text is streamed to XML and will be trimmed when read back from + // XML text + // https://github.com/OPM/ResInsight/issues/7829 + instance()->m_mapping.push_back( Triplet( enumVal, text.trimmed(), uiText ) ); } static EnumMapper* instance() @@ -244,7 +247,9 @@ class AppEnum size_t idx; for ( idx = 0; idx < m_mapping.size(); ++idx ) { - if ( text == m_mapping[idx].m_text ) + // Make sure the text parsed from a text stream is trimmed + // https://github.com/OPM/ResInsight/issues/7829 + if ( text.trimmed() == m_mapping[idx].m_text ) { value = m_mapping[idx].m_enumVal; return true; @@ -349,7 +354,10 @@ QTextStream& operator>>( QTextStream& str, caf::AppEnum& appEnum ) { QString text; str >> text; - appEnum.setFromText( text ); + + // Make sure the text parsed from a text stream is trimmed + // https://github.com/OPM/ResInsight/issues/7829 + appEnum.setFromText( text.trimmed() ); return str; } From fb301ef3ab6062a0d8f098e85afc3cf8d8ae8727 Mon Sep 17 00:00:00 2001 From: Kristian Bendiksen Date: Wed, 26 May 2021 12:10:45 +0200 Subject: [PATCH 034/308] #7716 Add pdm object for Ensemble Well Logs --- .../Commands/CMakeLists_files.cmake | 2 + .../RicImportEnsembleWellLogsFeature.cpp | 129 ++++++++++++++++++ .../RicImportEnsembleWellLogsFeature.h | 45 ++++++ .../ProjectDataModel/CMakeLists_files.cmake | 4 + .../ProjectDataModel/RimEnsembleWellLogs.cpp | 53 +++++++ .../ProjectDataModel/RimEnsembleWellLogs.h | 44 ++++++ .../RimEnsembleWellLogsCollection.cpp | 65 +++++++++ .../RimEnsembleWellLogsCollection.h | 42 ++++++ .../ProjectDataModel/RimOilField.cpp | 3 + .../ProjectDataModel/RimOilField.h | 2 + .../ProjectDataModel/RimProject.cpp | 5 + .../UserInterface/RiuPlotMainWindow.cpp | 1 + 12 files changed, 395 insertions(+) create mode 100644 ApplicationLibCode/Commands/RicImportEnsembleWellLogsFeature.cpp create mode 100644 ApplicationLibCode/Commands/RicImportEnsembleWellLogsFeature.h create mode 100644 ApplicationLibCode/ProjectDataModel/RimEnsembleWellLogs.cpp create mode 100644 ApplicationLibCode/ProjectDataModel/RimEnsembleWellLogs.h create mode 100644 ApplicationLibCode/ProjectDataModel/RimEnsembleWellLogsCollection.cpp create mode 100644 ApplicationLibCode/ProjectDataModel/RimEnsembleWellLogsCollection.h diff --git a/ApplicationLibCode/Commands/CMakeLists_files.cmake b/ApplicationLibCode/Commands/CMakeLists_files.cmake index 0a5e33508d..39b77c925c 100644 --- a/ApplicationLibCode/Commands/CMakeLists_files.cmake +++ b/ApplicationLibCode/Commands/CMakeLists_files.cmake @@ -63,6 +63,7 @@ ${CMAKE_CURRENT_LIST_DIR}/RicSummaryCaseRestartDialog.h ${CMAKE_CURRENT_LIST_DIR}/RicImportEnsembleFeature.h ${CMAKE_CURRENT_LIST_DIR}/RicImportSummaryGroupFeature.h ${CMAKE_CURRENT_LIST_DIR}/RicConvertGroupToEnsembleFeature.h +${CMAKE_CURRENT_LIST_DIR}/RicImportEnsembleWellLogsFeature.h ${CMAKE_CURRENT_LIST_DIR}/RicResampleDialog.h ${CMAKE_CURRENT_LIST_DIR}/RicCreateTemporaryLgrFeature.h ${CMAKE_CURRENT_LIST_DIR}/RicDeleteTemporaryLgrsFeature.h @@ -147,6 +148,7 @@ ${CMAKE_CURRENT_LIST_DIR}/RicSummaryCaseRestartDialog.cpp ${CMAKE_CURRENT_LIST_DIR}/RicImportEnsembleFeature.cpp ${CMAKE_CURRENT_LIST_DIR}/RicImportSummaryGroupFeature.cpp ${CMAKE_CURRENT_LIST_DIR}/RicConvertGroupToEnsembleFeature.cpp +${CMAKE_CURRENT_LIST_DIR}/RicImportEnsembleWellLogsFeature.cpp ${CMAKE_CURRENT_LIST_DIR}/RicResampleDialog.cpp ${CMAKE_CURRENT_LIST_DIR}/RicCreateTemporaryLgrFeature.cpp ${CMAKE_CURRENT_LIST_DIR}/RicDeleteTemporaryLgrsFeature.cpp diff --git a/ApplicationLibCode/Commands/RicImportEnsembleWellLogsFeature.cpp b/ApplicationLibCode/Commands/RicImportEnsembleWellLogsFeature.cpp new file mode 100644 index 0000000000..87a9af67e2 --- /dev/null +++ b/ApplicationLibCode/Commands/RicImportEnsembleWellLogsFeature.cpp @@ -0,0 +1,129 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2021- Equinor ASA +// +// ResInsight is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// + +#include "RicImportEnsembleWellLogsFeature.h" + +#include "RiaApplication.h" +#include "RiaLogging.h" + +#include "WellLogCommands/RicWellLogsImportFileFeature.h" + +#include "RimEnsembleWellLogs.h" +#include "RimEnsembleWellLogsCollection.h" +#include "RimOilField.h" +#include "RimProject.h" +#include "RimWellLogFile.h" + +#include "RicRecursiveFileSearchDialog.h" + +#include +#include + +CAF_CMD_SOURCE_INIT( RicImportEnsembleWellLogsFeature, "RicImportEnsembleWellLogsFeature" ); + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RicImportEnsembleWellLogsFeature::RicImportEnsembleWellLogsFeature() + : m_pathFilter( "*" ) + , m_fileNameFilter( "*" ) +{ +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +bool RicImportEnsembleWellLogsFeature::isCommandEnabled() +{ + return true; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RicImportEnsembleWellLogsFeature::onActionTriggered( bool isChecked ) +{ + RiaApplication* app = RiaApplication::instance(); + QString pathCacheName = "ENSEMBLE_WELL_LOGS_FILES"; + QStringList fileNames = runRecursiveFileSearchDialog( "Import Ensemble Well Logs", pathCacheName ); + if ( fileNames.isEmpty() ) return; + + QString ensembleName = "Ensemble Well Logs"; + if ( ensembleName.isEmpty() ) return; + + std::vector cases; + for ( QString fileNames : fileNames ) + { + QString errorMessage; + RimWellLogFile* logFileInfo = RimWellLogFile::readWellLogFile( fileNames, &errorMessage ); + cases.push_back( logFileInfo ); + if ( !errorMessage.isEmpty() ) + { + RiaLogging::warning( errorMessage ); + } + } + + if ( cases.empty() ) return; + + RimEnsembleWellLogs* ensemble = new RimEnsembleWellLogs; + ensemble->setName( ensembleName ); + for ( auto wellLogFile : cases ) + ensemble->addWellLogFile( wellLogFile ); + + RimProject::current()->activeOilField()->ensembleWellLogsCollection->addEnsembleWellLogs( ensemble ); + RimProject::current()->activeOilField()->ensembleWellLogsCollection->updateConnectedEditors(); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RicImportEnsembleWellLogsFeature::setupActionLook( QAction* actionToSetup ) +{ + actionToSetup->setIcon( QIcon( ":/LasFile16x16.png" ) ); + actionToSetup->setText( "Import Ensemble Well Logs" ); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +QStringList RicImportEnsembleWellLogsFeature::runRecursiveFileSearchDialog( const QString& dialogTitle, + const QString& pathCacheName ) +{ + RiaApplication* app = RiaApplication::instance(); + QString defaultDir = app->lastUsedDialogDirectory( pathCacheName ); + + RicRecursiveFileSearchDialogResult result = RicRecursiveFileSearchDialog::runRecursiveSearchDialog( nullptr, + dialogTitle, + defaultDir, + m_pathFilter, + m_fileNameFilter, + QStringList() + << ".LAS" + << ".las" ); + + // Remember filters + m_pathFilter = result.pathFilter; + m_fileNameFilter = result.fileNameFilter; + + if ( !result.ok ) return QStringList(); + + // Remember the path to next time + app->setLastUsedDialogDirectory( pathCacheName, QFileInfo( result.rootDir ).absoluteFilePath() ); + + return result.files; +} diff --git a/ApplicationLibCode/Commands/RicImportEnsembleWellLogsFeature.h b/ApplicationLibCode/Commands/RicImportEnsembleWellLogsFeature.h new file mode 100644 index 0000000000..e5d025c2cf --- /dev/null +++ b/ApplicationLibCode/Commands/RicImportEnsembleWellLogsFeature.h @@ -0,0 +1,45 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2021- Equinor ASA +// +// ResInsight is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// + +#pragma once + +#include "cafCmdFeature.h" + +#include + +//================================================================================================== +/// +//================================================================================================== +class RicImportEnsembleWellLogsFeature : public caf::CmdFeature +{ + CAF_CMD_HEADER_INIT; + + RicImportEnsembleWellLogsFeature(); + +protected: + // Overrides + bool isCommandEnabled() override; + void onActionTriggered( bool isChecked ) override; + void setupActionLook( QAction* actionToSetup ) override; + + QStringList runRecursiveFileSearchDialog( const QString& dialogTitle, const QString& pathCacheName ); + +private: + QString m_pathFilter; + QString m_fileNameFilter; +}; diff --git a/ApplicationLibCode/ProjectDataModel/CMakeLists_files.cmake b/ApplicationLibCode/ProjectDataModel/CMakeLists_files.cmake index d70bc6d209..0974858bf3 100644 --- a/ApplicationLibCode/ProjectDataModel/CMakeLists_files.cmake +++ b/ApplicationLibCode/ProjectDataModel/CMakeLists_files.cmake @@ -153,6 +153,8 @@ ${CMAKE_CURRENT_LIST_DIR}/RimCustomObjectiveFunctionWeight.h ${CMAKE_CURRENT_LIST_DIR}/RimEquilibriumAxisAnnotation.h ${CMAKE_CURRENT_LIST_DIR}/RimTimeAxisAnnotation.h ${CMAKE_CURRENT_LIST_DIR}/RimPolylinesDataInterface.h +${CMAKE_CURRENT_LIST_DIR}/RimEnsembleWellLogs.h +${CMAKE_CURRENT_LIST_DIR}/RimEnsembleWellLogsCollection.h ${CMAKE_CURRENT_LIST_DIR}/RimWellPathTieIn.h ${CMAKE_CURRENT_LIST_DIR}/cafTreeNode.h ${CMAKE_CURRENT_LIST_DIR}/RimMultipleLocations.h @@ -309,6 +311,8 @@ ${CMAKE_CURRENT_LIST_DIR}/RimCustomObjectiveFunction.cpp ${CMAKE_CURRENT_LIST_DIR}/RimCustomObjectiveFunctionWeight.cpp ${CMAKE_CURRENT_LIST_DIR}/RimEquilibriumAxisAnnotation.cpp ${CMAKE_CURRENT_LIST_DIR}/RimTimeAxisAnnotation.cpp +${CMAKE_CURRENT_LIST_DIR}/RimEnsembleWellLogs.cpp +${CMAKE_CURRENT_LIST_DIR}/RimEnsembleWellLogsCollection.cpp ${CMAKE_CURRENT_LIST_DIR}/RimWellPathTieIn.cpp ${CMAKE_CURRENT_LIST_DIR}/cafTreeNode.cpp ${CMAKE_CURRENT_LIST_DIR}/RimMultipleLocations.cpp diff --git a/ApplicationLibCode/ProjectDataModel/RimEnsembleWellLogs.cpp b/ApplicationLibCode/ProjectDataModel/RimEnsembleWellLogs.cpp new file mode 100644 index 0000000000..4c958fb480 --- /dev/null +++ b/ApplicationLibCode/ProjectDataModel/RimEnsembleWellLogs.cpp @@ -0,0 +1,53 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2021- Equinor ASA +// +// ResInsight is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// + +#include "RimEnsembleWellLogs.h" + +#include "RimWellLogFile.h" + +#include "cafPdmFieldScriptingCapability.h" +#include "cafPdmObjectScriptingCapability.h" + +CAF_PDM_SOURCE_INIT( RimEnsembleWellLogs, "EnsembleWellLogs" ); + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RimEnsembleWellLogs::RimEnsembleWellLogs() +{ + CAF_PDM_InitScriptableObject( "Ensemble Well Logs", "", "", "" ); + + CAF_PDM_InitFieldNoDefault( &m_wellLogFiles, "WellLogFiles", "", "", "", "" ); + m_wellLogFiles.uiCapability()->setUiHidden( true ); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimEnsembleWellLogs::removeWellLogFile( RimWellLogFile* summaryCase ) +{ + m_wellLogFiles.removeChildObject( summaryCase ); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimEnsembleWellLogs::addWellLogFile( RimWellLogFile* summaryCase ) +{ + m_wellLogFiles.push_back( summaryCase ); +} diff --git a/ApplicationLibCode/ProjectDataModel/RimEnsembleWellLogs.h b/ApplicationLibCode/ProjectDataModel/RimEnsembleWellLogs.h new file mode 100644 index 0000000000..38cb9485ca --- /dev/null +++ b/ApplicationLibCode/ProjectDataModel/RimEnsembleWellLogs.h @@ -0,0 +1,44 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2021- Equinor ASA +// +// ResInsight is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// + +#pragma once + +#include "RimNamedObject.h" + +#include "cafPdmChildArrayField.h" + +class RimWellLogFile; + +//================================================================================================== +/// +//================================================================================================== +class RimEnsembleWellLogs : public RimNamedObject +{ + CAF_PDM_HEADER_INIT; + +public: + RimEnsembleWellLogs(); + void removeWellLogFile( RimWellLogFile* wellLogFile ); + void addWellLogFile( RimWellLogFile* wellLogFile ); + +protected: + void updateReferringCurveSets(); + +private: + caf::PdmChildArrayField m_wellLogFiles; +}; diff --git a/ApplicationLibCode/ProjectDataModel/RimEnsembleWellLogsCollection.cpp b/ApplicationLibCode/ProjectDataModel/RimEnsembleWellLogsCollection.cpp new file mode 100644 index 0000000000..3f278fee7d --- /dev/null +++ b/ApplicationLibCode/ProjectDataModel/RimEnsembleWellLogsCollection.cpp @@ -0,0 +1,65 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2021- Equinor ASA +// +// ResInsight is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// + +#include "RimEnsembleWellLogsCollection.h" + +#include "RimEnsembleWellLogs.h" + +#include "cafProgressInfo.h" + +CAF_PDM_SOURCE_INIT( RimEnsembleWellLogsCollection, "EnsembleWellLogsCollection" ); + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RimEnsembleWellLogsCollection::RimEnsembleWellLogsCollection() +{ + CAF_PDM_InitObject( "Ensemble Well Logs", ":/LasFile16x16.png", "", "" ); + + CAF_PDM_InitFieldNoDefault( &m_ensembleWellLogs, "EnsembleWellLogsCollection", "", "", "", "" ); + m_ensembleWellLogs.uiCapability()->setUiHidden( true ); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RimEnsembleWellLogsCollection::~RimEnsembleWellLogsCollection() +{ + m_ensembleWellLogs.deleteAllChildObjects(); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimEnsembleWellLogsCollection::addEnsembleWellLogs( RimEnsembleWellLogs* ensembleWellLogs ) +{ + m_ensembleWellLogs.push_back( ensembleWellLogs ); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +std::vector RimEnsembleWellLogsCollection::ensembleWellLogs() const +{ + std::vector ensembleWellLogs; + for ( const auto& e : m_ensembleWellLogs ) + { + ensembleWellLogs.push_back( e ); + } + return ensembleWellLogs; +} diff --git a/ApplicationLibCode/ProjectDataModel/RimEnsembleWellLogsCollection.h b/ApplicationLibCode/ProjectDataModel/RimEnsembleWellLogsCollection.h new file mode 100644 index 0000000000..b235c5f240 --- /dev/null +++ b/ApplicationLibCode/ProjectDataModel/RimEnsembleWellLogsCollection.h @@ -0,0 +1,42 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2021- Equinor ASA +// +// ResInsight is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// +#pragma once + +#include "cafPdmChildArrayField.h" +#include "cafPdmObject.h" + +class RimEnsembleWellLogs; + +//================================================================================================== +/// +//================================================================================================== +class RimEnsembleWellLogsCollection : public caf::PdmObject +{ + CAF_PDM_HEADER_INIT; + +public: + RimEnsembleWellLogsCollection(); + ~RimEnsembleWellLogsCollection() override; + + std::vector ensembleWellLogs() const; + + void addEnsembleWellLogs( RimEnsembleWellLogs* ensembleWellLogs ); + +private: + caf::PdmChildArrayField m_ensembleWellLogs; +}; diff --git a/ApplicationLibCode/ProjectDataModel/RimOilField.cpp b/ApplicationLibCode/ProjectDataModel/RimOilField.cpp index b4c7da7431..73ac144baf 100644 --- a/ApplicationLibCode/ProjectDataModel/RimOilField.cpp +++ b/ApplicationLibCode/ProjectDataModel/RimOilField.cpp @@ -23,6 +23,7 @@ #include "RimAnnotationCollection.h" #include "RimCompletionTemplateCollection.h" #include "RimEclipseCaseCollection.h" +#include "RimEnsembleWellLogsCollection.h" #include "RimFormationNamesCollection.h" #include "RimFractureTemplateCollection.h" #include "RimGeoMechModels.h" @@ -51,6 +52,7 @@ RimOilField::RimOilField( void ) CAF_PDM_InitFieldNoDefault( &observedDataCollection, "ObservedDataCollection", "Observed Data", ":/Cases16x16.png", "", "" ); CAF_PDM_InitFieldNoDefault( &annotationCollection, "AnnotationCollection", "Annotations", "", "", "" ); + CAF_PDM_InitFieldNoDefault( &ensembleWellLogsCollection, "EnsembleWellLogsCollection", "Ensemble Well Logs", "", "", "" ); CAF_PDM_InitFieldNoDefault( &m_fractureTemplateCollection_OBSOLETE, "FractureDefinitionCollection", @@ -74,6 +76,7 @@ RimOilField::RimOilField( void ) observedDataCollection = new RimObservedDataCollection(); formationNamesCollection = new RimFormationNamesCollection(); annotationCollection = new RimAnnotationCollection(); + ensembleWellLogsCollection = new RimEnsembleWellLogsCollection(); m_fractureTemplateCollection_OBSOLETE = new RimFractureTemplateCollection; m_fractureTemplateCollection_OBSOLETE.xmlCapability()->setIOWritable( false ); diff --git a/ApplicationLibCode/ProjectDataModel/RimOilField.h b/ApplicationLibCode/ProjectDataModel/RimOilField.h index ac813a5d11..f62f3a6f67 100644 --- a/ApplicationLibCode/ProjectDataModel/RimOilField.h +++ b/ApplicationLibCode/ProjectDataModel/RimOilField.h @@ -38,6 +38,7 @@ class RimWellPathCollection; class RimAnnotationCollection; class RimMeasurement; class RimSurfaceCollection; +class RimEnsembleWellLogsCollection; //================================================================================================== /// @@ -67,6 +68,7 @@ class RimOilField : public caf::PdmObject caf::PdmChildField annotationCollection; caf::PdmChildField measurement; caf::PdmChildField surfaceCollection; + caf::PdmChildField ensembleWellLogsCollection; protected: void initAfterRead() override; diff --git a/ApplicationLibCode/ProjectDataModel/RimProject.cpp b/ApplicationLibCode/ProjectDataModel/RimProject.cpp index 1f2f44ab5a..f61128c869 100644 --- a/ApplicationLibCode/ProjectDataModel/RimProject.cpp +++ b/ApplicationLibCode/ProjectDataModel/RimProject.cpp @@ -47,6 +47,7 @@ #include "RimDialogData.h" #include "RimEclipseCase.h" #include "RimEclipseCaseCollection.h" +#include "RimEnsembleWellLogsCollection.h" #include "RimFlowPlotCollection.h" #include "RimFormationNamesCollection.h" #include "RimFractureTemplate.h" @@ -1410,6 +1411,10 @@ void RimProject::defineUiTreeOrdering( caf::PdmUiTreeOrdering& uiTreeOrdering, Q { itemCollection->add( oilField->observedDataCollection() ); } + if ( oilField->ensembleWellLogsCollection() ) + { + itemCollection->add( oilField->ensembleWellLogsCollection() ); + } } } diff --git a/ApplicationLibCode/UserInterface/RiuPlotMainWindow.cpp b/ApplicationLibCode/UserInterface/RiuPlotMainWindow.cpp index 5cac679f64..d36b69aa81 100644 --- a/ApplicationLibCode/UserInterface/RiuPlotMainWindow.cpp +++ b/ApplicationLibCode/UserInterface/RiuPlotMainWindow.cpp @@ -278,6 +278,7 @@ void RiuPlotMainWindow::createMenus() importWellMenu->addAction( cmdFeatureMgr->action( "RicWellPathsImportSsihubFeature" ) ); importWellMenu->addAction( cmdFeatureMgr->action( "RicWellLogsImportFileFeature" ) ); importWellMenu->addAction( cmdFeatureMgr->action( "RicWellPathFormationsImportFileFeature" ) ); + importWellMenu->addAction( cmdFeatureMgr->action( "RicImportEnsembleWellLogsFeature" ) ); importMenu->addSeparator(); importMenu->addAction( cmdFeatureMgr->action( "RicImportObservedDataInMenuFeature" ) ); From f31aecf50701d6797b0ac4e92e561c060044350b Mon Sep 17 00:00:00 2001 From: Kristian Bendiksen Date: Mon, 31 May 2021 11:00:23 +0200 Subject: [PATCH 035/308] Refactor: extract EnsembleParameter into separate file. --- .../AnalysisPlots/RimAnalysisPlot.cpp | 16 +- .../AnalysisPlots/RimAnalysisPlot.h | 6 +- .../AnalysisPlots/RimPlotDataFilterItem.cpp | 14 +- .../AnalysisPlots/RimPlotDataFilterItem.h | 4 +- .../RimAbstractCorrelationPlot.cpp | 20 +-- .../RimAbstractCorrelationPlot.h | 8 +- .../RimCorrelationMatrixPlot.cpp | 12 +- .../CorrelationPlots/RimCorrelationPlot.cpp | 10 +- .../RimParameterResultCrossPlot.cpp | 4 +- .../Flow/RimWellRftEnsembleCurveSet.cpp | 4 +- .../Flow/RimWellRftEnsembleCurveSet.h | 8 +- .../Summary/RimEnsembleCurveFilter.cpp | 6 +- .../Summary/RimEnsembleCurveFilter.h | 6 +- .../Summary/RimEnsembleCurveSet.cpp | 16 +- .../Summary/RimEnsembleCurveSet.h | 16 +- .../RimEnsembleCurveSetColorManager.cpp | 6 +- .../Summary/RimEnsembleCurveSetColorManager.h | 6 +- .../Summary/RimSummaryCaseCollection.cpp | 152 ++++-------------- .../Summary/RimSummaryCaseCollection.h | 73 ++------- .../ReservoirDataModel/CMakeLists_files.cmake | 2 + .../RigEnsembleParameter.cpp | 108 +++++++++++++ .../ReservoirDataModel/RigEnsembleParameter.h | 74 +++++++++ .../RimSummaryCaseCollection-Test.cpp | 19 +-- .../UserInterface/RiuSummaryQwtPlot.cpp | 6 +- 24 files changed, 331 insertions(+), 265 deletions(-) create mode 100644 ApplicationLibCode/ReservoirDataModel/RigEnsembleParameter.cpp create mode 100644 ApplicationLibCode/ReservoirDataModel/RigEnsembleParameter.h diff --git a/ApplicationLibCode/ProjectDataModel/AnalysisPlots/RimAnalysisPlot.cpp b/ApplicationLibCode/ProjectDataModel/AnalysisPlots/RimAnalysisPlot.cpp index 12b7521859..65048e9f08 100644 --- a/ApplicationLibCode/ProjectDataModel/AnalysisPlots/RimAnalysisPlot.cpp +++ b/ApplicationLibCode/ProjectDataModel/AnalysisPlots/RimAnalysisPlot.cpp @@ -250,9 +250,9 @@ std::set RimAnalysisPlot::unfilteredAddresses() //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -std::set RimAnalysisPlot::ensembleParameters() +std::set RimAnalysisPlot::ensembleParameters() { - std::set ensembleParms; + std::set ensembleParms; RiaSummaryCurveDefinitionAnalyser* analyserOfSelectedCurveDefs = getOrCreateSelectedCurveDefAnalyser(); @@ -268,7 +268,7 @@ std::set RimAnalysisPlot::ensembleParameters() for ( RimSummaryCaseCollection* ensemble : ensembles ) { - std::vector parameters = ensemble->variationSortedEnsembleParameters(); + std::vector parameters = ensemble->variationSortedEnsembleParameters(); ensembleParms.insert( parameters.begin(), parameters.end() ); } @@ -278,15 +278,15 @@ std::set RimAnalysisPlot::ensembleParameters() //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -EnsembleParameter RimAnalysisPlot::ensembleParameter( const QString& ensembleParameterName ) +RigEnsembleParameter RimAnalysisPlot::ensembleParameter( const QString& ensembleParameterName ) { - std::set ensembleParms = ensembleParameters(); - for ( const EnsembleParameter& eParam : ensembleParms ) + std::set ensembleParms = ensembleParameters(); + for ( const RigEnsembleParameter& eParam : ensembleParms ) { if ( eParam.name == ensembleParameterName ) return eParam; } - return EnsembleParameter(); + return RigEnsembleParameter(); } //-------------------------------------------------------------------------------------------------- @@ -1095,7 +1095,7 @@ void RimAnalysisPlot::applyFilter( const RimPlotDataFilterItem* filter, { sumItemsToKeep = ( *filteredSummaryItems ); // Not filtering items - EnsembleParameter eParam = this->ensembleParameter( filter->ensembleParameterName() ); + RigEnsembleParameter eParam = this->ensembleParameter( filter->ensembleParameterName() ); for ( auto sumCase : ( *filteredSumCases ) ) { diff --git a/ApplicationLibCode/ProjectDataModel/AnalysisPlots/RimAnalysisPlot.h b/ApplicationLibCode/ProjectDataModel/AnalysisPlots/RimAnalysisPlot.h index 0803d91d08..31cdff91d5 100644 --- a/ApplicationLibCode/ProjectDataModel/AnalysisPlots/RimAnalysisPlot.h +++ b/ApplicationLibCode/ProjectDataModel/AnalysisPlots/RimAnalysisPlot.h @@ -23,6 +23,8 @@ #include "RimSummaryCaseCollection.h" #include "RimTimeStepFilter.h" +#include "RigEnsembleParameter.h" + #include "cafPdmPtrField.h" #include @@ -81,8 +83,8 @@ class RimAnalysisPlot : public RimPlot void setTimeSteps( const std::vector& timeSteps ); std::set unfilteredAddresses(); - std::set ensembleParameters(); - EnsembleParameter ensembleParameter( const QString& ensembleParameterName ); + std::set ensembleParameters(); + RigEnsembleParameter ensembleParameter( const QString& ensembleParameterName ); void maxMinValueFromAddress( const RifEclipseSummaryAddress& address, RimPlotDataFilterItem::TimeStepSourceType timeStepSourceType, diff --git a/ApplicationLibCode/ProjectDataModel/AnalysisPlots/RimPlotDataFilterItem.cpp b/ApplicationLibCode/ProjectDataModel/AnalysisPlots/RimPlotDataFilterItem.cpp index 05c8babb82..2b7d382f7b 100644 --- a/ApplicationLibCode/ProjectDataModel/AnalysisPlots/RimPlotDataFilterItem.cpp +++ b/ApplicationLibCode/ProjectDataModel/AnalysisPlots/RimPlotDataFilterItem.cpp @@ -298,8 +298,8 @@ QList { if ( m_filterTarget() == ENSEMBLE_CASE ) { - std::set ensembleParams = parentPlot->ensembleParameters(); - for ( const EnsembleParameter& ensParam : ensembleParams ) + std::set ensembleParams = parentPlot->ensembleParameters(); + for ( const RigEnsembleParameter& ensParam : ensembleParams ) { options.push_back( caf::PdmOptionItemInfo( ensParam.uiName(), ensParam.name ) ); } @@ -307,7 +307,7 @@ QList } else if ( fieldNeedingOptions == &m_ensembleParameterValueCategories ) { - EnsembleParameter eParm = selectedEnsembleParameter(); + RigEnsembleParameter eParm = selectedEnsembleParameter(); if ( eParm.isText() ) { for ( const auto& val : eParm.values ) @@ -359,7 +359,7 @@ void RimPlotDataFilterItem::defineUiOrdering( QString uiConfigName, caf::PdmUiOr } } - EnsembleParameter eParm; + RigEnsembleParameter eParm; if ( m_filterTarget() == ENSEMBLE_CASE ) { eParm = selectedEnsembleParameter(); @@ -430,14 +430,14 @@ void RimPlotDataFilterItem::updateMaxMinAndDefaultValues( bool forceDefault ) { if ( !selectedEnsembleParameter().isValid() ) { - std::set ensembleParams = parentPlot->ensembleParameters(); + std::set ensembleParams = parentPlot->ensembleParameters(); if ( !ensembleParams.empty() ) { m_filterEnsembleParameter = ensembleParams.begin()->name; } } - EnsembleParameter eParam = selectedEnsembleParameter(); + RigEnsembleParameter eParam = selectedEnsembleParameter(); if ( eParam.isValid() && eParam.isNumeric() ) { if ( RiaCurveDataTools::isValidValue( eParam.minValue, false ) ) @@ -475,7 +475,7 @@ void RimPlotDataFilterItem::updateMaxMinAndDefaultValues( bool forceDefault ) //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -EnsembleParameter RimPlotDataFilterItem::selectedEnsembleParameter() const +RigEnsembleParameter RimPlotDataFilterItem::selectedEnsembleParameter() const { RimAnalysisPlot* parentPlot; this->firstAncestorOrThisOfTypeAsserted( parentPlot ); diff --git a/ApplicationLibCode/ProjectDataModel/AnalysisPlots/RimPlotDataFilterItem.h b/ApplicationLibCode/ProjectDataModel/AnalysisPlots/RimPlotDataFilterItem.h index ed4fecbeb9..a145ebf03a 100644 --- a/ApplicationLibCode/ProjectDataModel/AnalysisPlots/RimPlotDataFilterItem.h +++ b/ApplicationLibCode/ProjectDataModel/AnalysisPlots/RimPlotDataFilterItem.h @@ -26,7 +26,7 @@ #include "RifEclipseSummaryAddress.h" #include "RifEclipseSummaryAddressQMetaType.h" -#include "RimSummaryCaseCollection.h" +#include "RigEnsembleParameter.h" #include @@ -116,7 +116,7 @@ class RimPlotDataFilterItem : public caf::PdmObject QList calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions, bool* useOptionsOnly ) override; - EnsembleParameter selectedEnsembleParameter() const; + RigEnsembleParameter selectedEnsembleParameter() const; caf::PdmField m_isActive; diff --git a/ApplicationLibCode/ProjectDataModel/CorrelationPlots/RimAbstractCorrelationPlot.cpp b/ApplicationLibCode/ProjectDataModel/CorrelationPlots/RimAbstractCorrelationPlot.cpp index ed158996b7..fa23d13bbd 100644 --- a/ApplicationLibCode/ProjectDataModel/CorrelationPlots/RimAbstractCorrelationPlot.cpp +++ b/ApplicationLibCode/ProjectDataModel/CorrelationPlots/RimAbstractCorrelationPlot.cpp @@ -469,15 +469,15 @@ void RimAbstractCorrelationPlot::setCaseFilterDataSource( RimEnsembleCurveSet* e //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -std::set RimAbstractCorrelationPlot::ensembleParameters() +std::set RimAbstractCorrelationPlot::ensembleParameters() { - std::set ensembleParms; + std::set ensembleParms; RiaSummaryCurveDefinitionAnalyser* analyserOfSelectedCurveDefs = getOrCreateSelectedCurveDefAnalyser(); for ( RimSummaryCaseCollection* ensemble : analyserOfSelectedCurveDefs->m_ensembles ) { - std::vector parameters = ensemble->alphabeticEnsembleParameters(); + std::vector parameters = ensemble->alphabeticEnsembleParameters(); ensembleParms.insert( parameters.begin(), parameters.end() ); } return ensembleParms; @@ -486,15 +486,15 @@ std::set RimAbstractCorrelationPlot::ensembleParameters() //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -std::set RimAbstractCorrelationPlot::variationSortedEnsembleParameters() +std::set RimAbstractCorrelationPlot::variationSortedEnsembleParameters() { - std::set ensembleParms; + std::set ensembleParms; RiaSummaryCurveDefinitionAnalyser* analyserOfSelectedCurveDefs = getOrCreateSelectedCurveDefAnalyser(); for ( RimSummaryCaseCollection* ensemble : analyserOfSelectedCurveDefs->m_ensembles ) { - std::vector parameters = ensemble->variationSortedEnsembleParameters(); + std::vector parameters = ensemble->variationSortedEnsembleParameters(); ensembleParms.insert( parameters.begin(), parameters.end() ); } return ensembleParms; @@ -503,15 +503,15 @@ std::set RimAbstractCorrelationPlot::variationSortedEnsembleP //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -EnsembleParameter RimAbstractCorrelationPlot::ensembleParameter( const QString& ensembleParameterName ) +RigEnsembleParameter RimAbstractCorrelationPlot::ensembleParameter( const QString& ensembleParameterName ) { - std::set ensembleParms = ensembleParameters(); - for ( const EnsembleParameter& eParam : ensembleParms ) + std::set ensembleParms = ensembleParameters(); + for ( const RigEnsembleParameter& eParam : ensembleParms ) { if ( eParam.name == ensembleParameterName ) return eParam; } - return EnsembleParameter(); + return RigEnsembleParameter(); } //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationLibCode/ProjectDataModel/CorrelationPlots/RimAbstractCorrelationPlot.h b/ApplicationLibCode/ProjectDataModel/CorrelationPlots/RimAbstractCorrelationPlot.h index 374e0a203c..665ac9920e 100644 --- a/ApplicationLibCode/ProjectDataModel/CorrelationPlots/RimAbstractCorrelationPlot.h +++ b/ApplicationLibCode/ProjectDataModel/CorrelationPlots/RimAbstractCorrelationPlot.h @@ -34,7 +34,7 @@ class RimSummaryAddress; class RimEnsembleCurveSet; class RimSummaryCaseCollection; class RimSummaryCase; -class EnsembleParameter; +class RigEnsembleParameter; class RifEclipseSummaryAddress; class RimAbstractCorrelationPlot : public RimPlot @@ -88,9 +88,9 @@ class RimAbstractCorrelationPlot : public RimPlot bool* useOptionsOnly ) override; std::set addresses(); - std::set ensembleParameters(); - std::set variationSortedEnsembleParameters(); - EnsembleParameter ensembleParameter( const QString& ensembleParameterName ); + std::set ensembleParameters(); + std::set variationSortedEnsembleParameters(); + RigEnsembleParameter ensembleParameter( const QString& ensembleParameterName ); // RimViewWindow overrides QWidget* viewWidget() override; diff --git a/ApplicationLibCode/ProjectDataModel/CorrelationPlots/RimCorrelationMatrixPlot.cpp b/ApplicationLibCode/ProjectDataModel/CorrelationPlots/RimCorrelationMatrixPlot.cpp index 642e7fb418..54ced906b9 100644 --- a/ApplicationLibCode/ProjectDataModel/CorrelationPlots/RimCorrelationMatrixPlot.cpp +++ b/ApplicationLibCode/ProjectDataModel/CorrelationPlots/RimCorrelationMatrixPlot.cpp @@ -30,6 +30,8 @@ #include "RifSummaryReaderInterface.h" +#include "RigEnsembleParameter.h" + #include "RimDerivedSummaryCase.h" #include "RimEnsembleCurveSet.h" #include "RimPlotAxisProperties.h" @@ -221,10 +223,10 @@ RimRegularLegendConfig* RimCorrelationMatrixPlot::legendConfig() void RimCorrelationMatrixPlot::selectAllParameters() { m_selectedParametersList.v().clear(); - std::set params = variationSortedEnsembleParameters(); + std::set params = variationSortedEnsembleParameters(); for ( auto param : params ) { - if ( !m_excludeParametersWithoutVariation() || param.variationBin > EnsembleParameter::NO_VARIATION ) + if ( !m_excludeParametersWithoutVariation() || param.variationBin > RigEnsembleParameter::NO_VARIATION ) { m_selectedParametersList.v().push_back( param.name ); } @@ -347,10 +349,10 @@ QList if ( fieldNeedingOptions == &m_selectedParametersList ) { - std::set params = variationSortedEnsembleParameters(); + std::set params = variationSortedEnsembleParameters(); for ( auto param : params ) { - if ( !m_excludeParametersWithoutVariation() || param.variationBin > EnsembleParameter::NO_VARIATION ) + if ( !m_excludeParametersWithoutVariation() || param.variationBin > RigEnsembleParameter::NO_VARIATION ) { options.push_back( caf::PdmOptionItemInfo( param.uiName(), param.name ) ); } @@ -522,7 +524,7 @@ void RimCorrelationMatrixPlot::createMatrix() std::vector caseValuesAtTimestep; std::vector parameterValues; - EnsembleParameter parameter = ensemble->ensembleParameter( paramName ); + RigEnsembleParameter parameter = ensemble->ensembleParameter( paramName ); if ( parameter.isValid() ) { diff --git a/ApplicationLibCode/ProjectDataModel/CorrelationPlots/RimCorrelationPlot.cpp b/ApplicationLibCode/ProjectDataModel/CorrelationPlots/RimCorrelationPlot.cpp index 6191e0df83..bc7ab92030 100644 --- a/ApplicationLibCode/ProjectDataModel/CorrelationPlots/RimCorrelationPlot.cpp +++ b/ApplicationLibCode/ProjectDataModel/CorrelationPlots/RimCorrelationPlot.cpp @@ -156,10 +156,10 @@ QList RimCorrelationPlot::calculateValueOptions( const c if ( fieldNeedingOptions == &m_selectedParametersList ) { - std::set params = variationSortedEnsembleParameters(); + std::set params = variationSortedEnsembleParameters(); for ( auto param : params ) { - if ( !m_excludeParametersWithoutVariation() || param.variationBin > EnsembleParameter::NO_VARIATION ) + if ( !m_excludeParametersWithoutVariation() || param.variationBin > RigEnsembleParameter::NO_VARIATION ) { options.push_back( caf::PdmOptionItemInfo( param.uiName(), param.name ) ); } @@ -242,7 +242,7 @@ void RimCorrelationPlot::addDataToChartBuilder( RiuGroupedBarChartBuilder& chart std::set activeCases = filterEnsembleCases( ensemble ); - std::vector> correlations = + std::vector> correlations = ensemble->parameterCorrelations( address, selectedTimestep, m_selectedParametersList(), activeCases ); for ( auto parameterCorrPair : correlations ) @@ -332,10 +332,10 @@ void RimCorrelationPlot::setSortByAbsoluteValues( bool sortByAbsoluteValues ) void RimCorrelationPlot::selectAllParameters() { m_selectedParametersList.v().clear(); - std::set params = variationSortedEnsembleParameters(); + std::set params = variationSortedEnsembleParameters(); for ( auto param : params ) { - if ( !m_excludeParametersWithoutVariation() || param.variationBin > EnsembleParameter::NO_VARIATION ) + if ( !m_excludeParametersWithoutVariation() || param.variationBin > RigEnsembleParameter::NO_VARIATION ) { m_selectedParametersList.v().push_back( param.name ); } diff --git a/ApplicationLibCode/ProjectDataModel/CorrelationPlots/RimParameterResultCrossPlot.cpp b/ApplicationLibCode/ProjectDataModel/CorrelationPlots/RimParameterResultCrossPlot.cpp index be24609ae9..f557be7172 100644 --- a/ApplicationLibCode/ProjectDataModel/CorrelationPlots/RimParameterResultCrossPlot.cpp +++ b/ApplicationLibCode/ProjectDataModel/CorrelationPlots/RimParameterResultCrossPlot.cpp @@ -26,6 +26,8 @@ #include "RifSummaryReaderInterface.h" +#include "RigEnsembleParameter.h" + #include "RimDerivedSummaryCase.h" #include "RimEnsembleCurveSet.h" #include "RimMultiPlot.h" @@ -244,7 +246,7 @@ void RimParameterResultCrossPlot::createPoints() int addressIdx = 0; for ( auto address : addresses() ) { - EnsembleParameter parameter = ensembleParameter( m_ensembleParameter ); + RigEnsembleParameter parameter = ensembleParameter( m_ensembleParameter ); if ( !( parameter.isNumeric() && parameter.isValid() ) ) return; QStringList caseNames = caseNamesOfValidEnsembleCases( ensemble ); diff --git a/ApplicationLibCode/ProjectDataModel/Flow/RimWellRftEnsembleCurveSet.cpp b/ApplicationLibCode/ProjectDataModel/Flow/RimWellRftEnsembleCurveSet.cpp index 45c84bed98..6a66cdb702 100644 --- a/ApplicationLibCode/ProjectDataModel/Flow/RimWellRftEnsembleCurveSet.cpp +++ b/ApplicationLibCode/ProjectDataModel/Flow/RimWellRftEnsembleCurveSet.cpp @@ -159,7 +159,7 @@ RimRegularLegendConfig* RimWellRftEnsembleCurveSet::legendConfig() //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -EnsembleParameter::Type RimWellRftEnsembleCurveSet::currentEnsembleParameterType() const +RigEnsembleParameter::Type RimWellRftEnsembleCurveSet::currentEnsembleParameterType() const { if ( m_ensembleColorMode() == ColorMode::BY_ENSEMBLE_PARAM ) { @@ -172,7 +172,7 @@ EnsembleParameter::Type RimWellRftEnsembleCurveSet::currentEnsembleParameterType return eParam.type; } } - return EnsembleParameter::TYPE_NONE; + return RigEnsembleParameter::TYPE_NONE; } //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationLibCode/ProjectDataModel/Flow/RimWellRftEnsembleCurveSet.h b/ApplicationLibCode/ProjectDataModel/Flow/RimWellRftEnsembleCurveSet.h index 0ccf87b507..b50f2a7136 100644 --- a/ApplicationLibCode/ProjectDataModel/Flow/RimWellRftEnsembleCurveSet.h +++ b/ApplicationLibCode/ProjectDataModel/Flow/RimWellRftEnsembleCurveSet.h @@ -21,6 +21,8 @@ #include "RimEnsembleCurveSetColorManager.h" #include "RimSummaryCaseCollection.h" +#include "RigEnsembleParameter.h" + #include "cafPdmChildField.h" #include "cafPdmObject.h" #include "cafPdmProxyValueField.h" @@ -51,9 +53,9 @@ class RimWellRftEnsembleCurveSet : public caf::PdmObject cvf::Color3f caseColor( const RimSummaryCase* summaryCase ) const; QString currentEnsembleParameter() const; - void setEnsembleParameter( const QString& parameterName ); - RimRegularLegendConfig* legendConfig(); - EnsembleParameter::Type currentEnsembleParameterType() const; + void setEnsembleParameter( const QString& parameterName ); + RimRegularLegendConfig* legendConfig(); + RigEnsembleParameter::Type currentEnsembleParameterType() const; protected: void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) override; diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimEnsembleCurveFilter.cpp b/ApplicationLibCode/ProjectDataModel/Summary/RimEnsembleCurveFilter.cpp index 3b0ebed67b..6aa56b9618 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimEnsembleCurveFilter.cpp +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimEnsembleCurveFilter.cpp @@ -279,7 +279,7 @@ QList { auto curveSet = parentCurveSet(); auto ensemble = curveSet ? curveSet->summaryCaseCollection() : nullptr; - auto eParam = ensemble ? ensemble->ensembleParameter( m_ensembleParameterName ) : EnsembleParameter(); + auto eParam = ensemble ? ensemble->ensembleParameter( m_ensembleParameterName ) : RigEnsembleParameter(); if ( eParam.isText() ) { @@ -734,9 +734,9 @@ void RimEnsembleCurveFilter::updateMaxMinAndDefaultValues( bool forceDefault ) //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -EnsembleParameter RimEnsembleCurveFilter::selectedEnsembleParameter() const +RigEnsembleParameter RimEnsembleCurveFilter::selectedEnsembleParameter() const { auto curveSet = parentCurveSet(); auto ensemble = curveSet ? curveSet->summaryCaseCollection() : nullptr; - return ensemble ? ensemble->ensembleParameter( m_ensembleParameterName ) : EnsembleParameter(); + return ensemble ? ensemble->ensembleParameter( m_ensembleParameterName ) : RigEnsembleParameter(); } diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimEnsembleCurveFilter.h b/ApplicationLibCode/ProjectDataModel/Summary/RimEnsembleCurveFilter.h index 6547150e03..7ef9186092 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimEnsembleCurveFilter.h +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimEnsembleCurveFilter.h @@ -30,7 +30,7 @@ #include "cafPdmProxyValueField.h" #include "cafPdmPtrField.h" -class EnsembleParameter; +class RigEnsembleParameter; class RimEnsembleCurveSet; class RimSummaryCase; class RimSummaryAddress; @@ -80,8 +80,8 @@ class RimEnsembleCurveFilter : public caf::PdmObject std::vector applyFilter( const std::vector& allSumCases ); - void loadDataAndUpdate(); - EnsembleParameter selectedEnsembleParameter() const; + void loadDataAndUpdate(); + RigEnsembleParameter selectedEnsembleParameter() const; RimEnsembleCurveSet* parentCurveSet() const; diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimEnsembleCurveSet.cpp b/ApplicationLibCode/ProjectDataModel/Summary/RimEnsembleCurveSet.cpp index 921af0d5c0..9903030f5a 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimEnsembleCurveSet.cpp +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimEnsembleCurveSet.cpp @@ -549,7 +549,7 @@ void RimEnsembleCurveSet::setEnsembleParameter( const QString& parameterName ) //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -EnsembleParameter::Type RimEnsembleCurveSet::currentEnsembleParameterType() const +RigEnsembleParameter::Type RimEnsembleCurveSet::currentEnsembleParameterType() const { if ( m_colorMode() == ColorMode::BY_ENSEMBLE_PARAM ) { @@ -562,7 +562,7 @@ EnsembleParameter::Type RimEnsembleCurveSet::currentEnsembleParameterType() cons return eParam.type; } } - return EnsembleParameter::TYPE_NONE; + return RigEnsembleParameter::TYPE_NONE; } //-------------------------------------------------------------------------------------------------- @@ -1838,7 +1838,7 @@ void RimEnsembleCurveSet::updateAllTextInPlot() //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -std::vector RimEnsembleCurveSet::variationSortedEnsembleParameters() const +std::vector RimEnsembleCurveSet::variationSortedEnsembleParameters() const { RimSummaryCaseCollection* ensemble = m_yValuesSummaryCaseCollection; if ( ensemble ) @@ -1847,14 +1847,14 @@ std::vector RimEnsembleCurveSet::variationSortedEnsembleParam } else { - return std::vector(); + return std::vector(); } } //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -std::vector> RimEnsembleCurveSet::correlationSortedEnsembleParameters() const +std::vector> RimEnsembleCurveSet::correlationSortedEnsembleParameters() const { RimSummaryCaseCollection* ensemble = m_yValuesSummaryCaseCollection; if ( ensemble ) @@ -1863,7 +1863,7 @@ std::vector> RimEnsembleCurveSet::correlati } else { - return std::vector>(); + return std::vector>(); } } @@ -2014,12 +2014,12 @@ void RimEnsembleCurveSet::updateLegendMappingMode() { switch ( currentEnsembleParameterType() ) { - case EnsembleParameter::TYPE_TEXT: + case RigEnsembleParameter::TYPE_TEXT: if ( m_legendConfig->mappingMode() != RimRegularLegendConfig::MappingType::CATEGORY_INTEGER ) m_legendConfig->setMappingMode( RimRegularLegendConfig::MappingType::CATEGORY_INTEGER ); break; - case EnsembleParameter::TYPE_NUMERIC: + case RigEnsembleParameter::TYPE_NUMERIC: if ( m_legendConfig->mappingMode() == RimRegularLegendConfig::MappingType::CATEGORY_INTEGER ) m_legendConfig->setMappingMode( RimRegularLegendConfig::MappingType::LINEAR_CONTINUOUS ); break; diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimEnsembleCurveSet.h b/ApplicationLibCode/ProjectDataModel/Summary/RimEnsembleCurveSet.h index c61b89b3d7..471510f6f0 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimEnsembleCurveSet.h +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimEnsembleCurveSet.h @@ -32,6 +32,8 @@ #include "RimSummaryCaseCollection.h" #include "RimTimeStepFilter.h" +#include "RigEnsembleParameter.h" + #include "cafAppEnum.h" #include "cafPdmChildArrayField.h" #include "cafPdmChildField.h" @@ -114,10 +116,10 @@ class RimEnsembleCurveSet : public caf::PdmObject RimEnsembleCurveFilterCollection* filterCollection() const; - ColorMode colorMode() const; - void setColorMode( ColorMode mode ); - void setEnsembleParameter( const QString& parameterName ); - EnsembleParameter::Type currentEnsembleParameterType() const; + ColorMode colorMode() const; + void setColorMode( ColorMode mode ); + void setEnsembleParameter( const QString& parameterName ); + RigEnsembleParameter::Type currentEnsembleParameterType() const; RimRegularLegendConfig* legendConfig(); @@ -132,10 +134,10 @@ class RimEnsembleCurveSet : public caf::PdmObject RimEnsembleCurveSet* clone() const; void showCurves( bool show ); - void updateAllTextInPlot(); - std::vector variationSortedEnsembleParameters() const; + void updateAllTextInPlot(); + std::vector variationSortedEnsembleParameters() const; - std::vector> correlationSortedEnsembleParameters() const; + std::vector> correlationSortedEnsembleParameters() const; std::vector filterEnsembleCases( const std::vector& sumCases ); void disableStatisticCurves(); diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimEnsembleCurveSetColorManager.cpp b/ApplicationLibCode/ProjectDataModel/Summary/RimEnsembleCurveSetColorManager.cpp index 9dd25882e9..e53dffe9bc 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimEnsembleCurveSetColorManager.cpp +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimEnsembleCurveSetColorManager.cpp @@ -95,8 +95,8 @@ RimRegularLegendConfig::ColorRangesType RimEnsembleCurveSetColorManager::cycledE //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -void RimEnsembleCurveSetColorManager::initializeLegendConfig( RimRegularLegendConfig* legendConfig, - const EnsembleParameter& ensembleParam ) +void RimEnsembleCurveSetColorManager::initializeLegendConfig( RimRegularLegendConfig* legendConfig, + const RigEnsembleParameter& ensembleParam ) { if ( ensembleParam.isText() ) { @@ -170,7 +170,7 @@ void RimEnsembleCurveSetColorManager::initializeLegendConfig( RimRegularLegendCo //-------------------------------------------------------------------------------------------------- cvf::Color3f RimEnsembleCurveSetColorManager::caseColor( const RimRegularLegendConfig* legendConfig, const RimSummaryCase* summaryCase, - const EnsembleParameter& ensembleParam ) + const RigEnsembleParameter& ensembleParam ) { if ( ensembleParam.isText() ) { diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimEnsembleCurveSetColorManager.h b/ApplicationLibCode/ProjectDataModel/Summary/RimEnsembleCurveSetColorManager.h index 57f7bd07ac..72af9ff935 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimEnsembleCurveSetColorManager.h +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimEnsembleCurveSetColorManager.h @@ -23,6 +23,8 @@ #include "RimRegularLegendConfig.h" #include "RimSummaryCaseCollection.h" +#include "RigEnsembleParameter.h" + #include "cafPdmPointer.h" #include @@ -58,7 +60,7 @@ class RimEnsembleCurveSetColorManager return m_ensembleColorRanges.find( colorRange ) != m_ensembleColorRanges.end(); } - static void initializeLegendConfig( RimRegularLegendConfig* legendConfig, const EnsembleParameter& parameter ); + static void initializeLegendConfig( RimRegularLegendConfig* legendConfig, const RigEnsembleParameter& parameter ); static void initializeLegendConfig( RimRegularLegendConfig* legendConfig, RimObjectiveFunction* objectiveFunction, const std::vector& summaryCases, @@ -70,7 +72,7 @@ class RimEnsembleCurveSetColorManager static cvf::Color3f caseColor( const RimRegularLegendConfig* legendConfig, const RimSummaryCase* summaryCase, - const EnsembleParameter& parameter ); + const RigEnsembleParameter& parameter ); static cvf::Color3f caseColor( const RimRegularLegendConfig* legendConfig, RimSummaryCase* summaryCase, diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCaseCollection.cpp b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCaseCollection.cpp index 29f2622d93..74b414842d 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCaseCollection.cpp +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCaseCollection.cpp @@ -49,64 +49,7 @@ CAF_PDM_SOURCE_INIT( RimSummaryCaseCollection, "SummaryCaseSubCollection" ); //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -double EnsembleParameter::stdDeviation() const -{ - double N = static_cast( values.size() ); - if ( N > 1 && isNumeric() ) - { - double sumValues = 0.0; - double sumValuesSquared = 0.0; - for ( const QVariant& variant : values ) - { - double value = variant.toDouble(); - sumValues += value; - sumValuesSquared += value * value; - } - - return std::sqrt( ( N * sumValuesSquared - sumValues * sumValues ) / ( N * ( N - 1.0 ) ) ); - } - return 0.0; -} - -//-------------------------------------------------------------------------------------------------- -/// Standard deviation normalized by max absolute value of min/max values. -/// Produces values between 0.0 and sqrt(2.0). -//-------------------------------------------------------------------------------------------------- -double EnsembleParameter::normalizedStdDeviation() const -{ - const double eps = 1.0e-4; - - double maxAbs = std::max( std::fabs( maxValue ), std::fabs( minValue ) ); - if ( maxAbs < eps ) - { - return 0.0; - } - - double normalisedStdDev = stdDeviation() / maxAbs; - if ( normalisedStdDev < eps ) - { - return 0.0; - } - return normalisedStdDev; -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -bool EnsembleParameter::operator<( const EnsembleParameter& other ) const -{ - if ( this->variationBin != other.variationBin ) - { - return this->variationBin > other.variationBin; // Larger first - } - - return this->name < other.name; -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -void RimSummaryCaseCollection::sortByBinnedVariation( std::vector& parameterVector ) +void RimSummaryCaseCollection::sortByBinnedVariation( std::vector& parameterVector ) { double minStdDev = std::numeric_limits::infinity(); double maxStdDev = 0.0; @@ -124,16 +67,16 @@ void RimSummaryCaseCollection::sortByBinnedVariation( std::vector bins; bins.push_back( 0.0 ); - for ( int i = 0; i < EnsembleParameter::NR_OF_VARIATION_BINS - 1; ++i ) + for ( int i = 0; i < RigEnsembleParameter::NR_OF_VARIATION_BINS - 1; ++i ) { bins.push_back( minStdDev + ( i + 1 ) * delta ); } - for ( EnsembleParameter& nameParamPair : parameterVector ) + for ( RigEnsembleParameter& nameParamPair : parameterVector ) { int binNumber = -1; for ( double bin : bins ) @@ -150,40 +93,11 @@ void RimSummaryCaseCollection::sortByBinnedVariation( std::vector rhs.variationBin; } ); } -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -QString EnsembleParameter::uiName() const -{ - QString stem = name; - QString variationString; - if ( isNumeric() ) - { - switch ( variationBin ) - { - case NO_VARIATION: - variationString = QString( " (No variation)" ); - break; - case LOW_VARIATION: - variationString = QString( " (Low variation)" ); - break; - case MEDIUM_VARIATION: - variationString = QString( " (Medium variation)" ); - break; - case HIGH_VARIATION: - variationString = QString( " (High variation)" ); - break; - } - } - - return QString( "%1%2" ).arg( stem ).arg( variationString ); -} - //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- @@ -448,7 +362,7 @@ RifReaderRftInterface* RimSummaryCaseCollection::rftStatisticsReader() //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -std::vector RimSummaryCaseCollection::variationSortedEnsembleParameters( bool excludeNoVariation ) const +std::vector RimSummaryCaseCollection::variationSortedEnsembleParameters( bool excludeNoVariation ) const { if ( m_cachedSortedEnsembleParameters.empty() ) { @@ -480,8 +394,8 @@ std::vector RimSummaryCaseCollection::variationSortedEnsemble } else { - const double epsilon = 1e-9; - std::vector parametersWithVariation; + const double epsilon = 1e-9; + std::vector parametersWithVariation; for ( const auto& p : m_cachedSortedEnsembleParameters ) { if ( std::abs( p.normalizedStdDeviation() ) > epsilon ) @@ -496,13 +410,13 @@ std::vector RimSummaryCaseCollection::variationSortedEnsemble //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -std::vector> +std::vector> RimSummaryCaseCollection::correlationSortedEnsembleParameters( const RifEclipseSummaryAddress& address ) const { auto parameters = parameterCorrelationsAllTimeSteps( address ); std::sort( parameters.begin(), parameters.end(), - []( const std::pair& lhs, const std::pair& rhs ) { + []( const std::pair& lhs, const std::pair& rhs ) { return std::abs( lhs.second ) > std::abs( rhs.second ); } ); return parameters; @@ -511,14 +425,14 @@ std::vector> //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -std::vector> +std::vector> RimSummaryCaseCollection::correlationSortedEnsembleParameters( const RifEclipseSummaryAddress& address, time_t selectedTimeStep ) const { auto parameters = parameterCorrelations( address, selectedTimeStep ); std::sort( parameters.begin(), parameters.end(), - []( const std::pair& lhs, const std::pair& rhs ) { + []( const std::pair& lhs, const std::pair& rhs ) { return std::abs( lhs.second ) > std::abs( rhs.second ); } ); return parameters; @@ -536,7 +450,7 @@ time_t timeDiff( time_t lhs, time_t rhs ) //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -std::vector> +std::vector> RimSummaryCaseCollection::parameterCorrelations( const RifEclipseSummaryAddress& address, time_t timeStep, const std::vector& selectedParameters, @@ -548,7 +462,7 @@ std::vector> { parameters.erase( std::remove_if( parameters.begin(), parameters.end(), - [&selectedParameters]( const EnsembleParameter& parameter ) { + [&selectedParameters]( const RigEnsembleParameter& parameter ) { return std::find( selectedParameters.begin(), selectedParameters.end(), parameter.name ) == selectedParameters.end(); @@ -556,8 +470,8 @@ std::vector> parameters.end() ); } - std::vector caseValuesAtTimestep; - std::map> parameterValues; + std::vector caseValuesAtTimestep; + std::map> parameterValues; for ( size_t caseIdx = 0u; caseIdx < m_cases.size(); ++caseIdx ) { @@ -600,7 +514,7 @@ std::vector> } } - std::vector> correlationResults; + std::vector> correlationResults; for ( auto parameterValuesPair : parameterValues ) { double correlation = 0.0; @@ -614,7 +528,7 @@ std::vector> //-------------------------------------------------------------------------------------------------- /// Returns a vector of the parameters and the average absolute values of correlations per time step //-------------------------------------------------------------------------------------------------- -std::vector> +std::vector> RimSummaryCaseCollection::parameterCorrelationsAllTimeSteps( const RifEclipseSummaryAddress& address, const std::vector& selectedParameters ) const { @@ -625,11 +539,11 @@ std::vector> std::vector timeStepsVector( timeSteps.begin(), timeSteps.end() ); size_t stride = std::max( (size_t)1, timeStepsVector.size() / maxTimeStepCount ); - std::vector>> correlationsForChosenTimeSteps; + std::vector>> correlationsForChosenTimeSteps; for ( size_t i = stride; i < timeStepsVector.size(); i += stride ) { - std::vector> correlationsForTimeStep = + std::vector> correlationsForTimeStep = parameterCorrelations( address, timeStepsVector[i], selectedParameters ); correlationsForChosenTimeSteps.push_back( correlationsForTimeStep ); } @@ -652,7 +566,7 @@ std::vector> //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -std::vector RimSummaryCaseCollection::alphabeticEnsembleParameters() const +std::vector RimSummaryCaseCollection::alphabeticEnsembleParameters() const { std::set paramSet; for ( RimSummaryCase* rimCase : this->allSummaryCases() ) @@ -667,7 +581,7 @@ std::vector RimSummaryCaseCollection::alphabeticEnsembleParam } } - std::vector sortedEnsembleParameters; + std::vector sortedEnsembleParameters; sortedEnsembleParameters.reserve( paramSet.size() ); for ( const QString& parameterName : paramSet ) { @@ -679,23 +593,23 @@ std::vector RimSummaryCaseCollection::alphabeticEnsembleParam //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -EnsembleParameter RimSummaryCaseCollection::ensembleParameter( const QString& paramName ) const +RigEnsembleParameter RimSummaryCaseCollection::ensembleParameter( const QString& paramName ) const { - if ( !isEnsemble() || paramName.isEmpty() ) return EnsembleParameter(); + if ( !isEnsemble() || paramName.isEmpty() ) return RigEnsembleParameter(); - const std::vector& ensembleParams = variationSortedEnsembleParameters(); + const std::vector& ensembleParams = variationSortedEnsembleParameters(); - for ( const EnsembleParameter& ensParam : ensembleParams ) + for ( const RigEnsembleParameter& ensParam : ensembleParams ) { if ( ensParam.name == paramName ) return ensParam; } - return EnsembleParameter(); + return RigEnsembleParameter(); } -EnsembleParameter RimSummaryCaseCollection::createEnsembleParameter( const QString& paramName ) const +RigEnsembleParameter RimSummaryCaseCollection::createEnsembleParameter( const QString& paramName ) const { - EnsembleParameter eParam; + RigEnsembleParameter eParam; eParam.name = paramName; size_t numericValuesCount = 0; @@ -734,11 +648,11 @@ EnsembleParameter RimSummaryCaseCollection::createEnsembleParameter( const QStri if ( numericValuesCount && !textValuesCount ) { - eParam.type = EnsembleParameter::TYPE_NUMERIC; + eParam.type = RigEnsembleParameter::TYPE_NUMERIC; } else if ( textValuesCount && !numericValuesCount ) { - eParam.type = EnsembleParameter::TYPE_TEXT; + eParam.type = RigEnsembleParameter::TYPE_TEXT; } if ( numericValuesCount && textValuesCount ) { @@ -753,7 +667,7 @@ EnsembleParameter RimSummaryCaseCollection::createEnsembleParameter( const QStri val.setValue( std::numeric_limits::infinity() ); } } - eParam.type = EnsembleParameter::TYPE_NUMERIC; + eParam.type = RigEnsembleParameter::TYPE_NUMERIC; } else { @@ -765,7 +679,7 @@ EnsembleParameter RimSummaryCaseCollection::createEnsembleParameter( const QStri val.setValue( QString::number( val.value() ) ); } } - eParam.type = EnsembleParameter::TYPE_TEXT; + eParam.type = RigEnsembleParameter::TYPE_TEXT; eParam.minValue = std::numeric_limits::infinity(); eParam.maxValue = -std::numeric_limits::infinity(); } diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCaseCollection.h b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCaseCollection.h index 360e128eed..d5c389cfcc 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCaseCollection.h +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCaseCollection.h @@ -23,6 +23,8 @@ #include "RifEclipseSummaryAddress.h" #include "RifReaderEnsembleStatisticsRft.h" +#include "RigEnsembleParameter.h" + #include "RimObjectiveFunction.h" #include "cafPdmChildArrayField.h" @@ -39,53 +41,6 @@ class RifReaderRftInterface; class RifReaderEnsembleStatisticsRft; class RimSummaryCase; -//================================================================================================== -/// -//================================================================================================== -class EnsembleParameter -{ -public: - enum Type - { - TYPE_NONE, - TYPE_NUMERIC, - TYPE_TEXT - }; - enum Bins - { - NO_VARIATION = -1, - LOW_VARIATION = 0, - MEDIUM_VARIATION, - HIGH_VARIATION, - NR_OF_VARIATION_BINS - }; - QString uiName() const; - QString name; - Type type; - std::vector values; - double minValue; - double maxValue; - int variationBin; - - EnsembleParameter() - : type( TYPE_NONE ) - , minValue( std::numeric_limits::infinity() ) - , maxValue( -std::numeric_limits::infinity() ) - , variationBin( static_cast( MEDIUM_VARIATION ) ) - { - } - - bool isValid() const { return !name.isEmpty() && type != TYPE_NONE; } - bool isNumeric() const { return type == TYPE_NUMERIC; } - bool isText() const { return type == TYPE_TEXT; } - double normalizedStdDeviation() const; - - bool operator<( const EnsembleParameter& other ) const; - -private: - double stdDeviation() const; -}; - //================================================================================================== /// //================================================================================================== @@ -117,26 +72,26 @@ class RimSummaryCaseCollection : public caf::PdmObject int ensembleId() const; bool hasEnsembleParameters() const; - std::vector variationSortedEnsembleParameters( bool excludeNoVariation = false ) const; - std::vector> + std::vector variationSortedEnsembleParameters( bool excludeNoVariation = false ) const; + std::vector> correlationSortedEnsembleParameters( const RifEclipseSummaryAddress& address ) const; - std::vector> + std::vector> correlationSortedEnsembleParameters( const RifEclipseSummaryAddress& address, time_t selectedTimeStep ) const; - std::vector> + std::vector> parameterCorrelations( const RifEclipseSummaryAddress& address, time_t selectedTimeStep, const std::vector& selectedParameters = {}, const std::set& selectedCases = {} ) const; - std::vector> + std::vector> parameterCorrelationsAllTimeSteps( const RifEclipseSummaryAddress& address, const std::vector& selectedParameters = {} ) const; - std::vector alphabeticEnsembleParameters() const; + std::vector alphabeticEnsembleParameters() const; - EnsembleParameter ensembleParameter( const QString& paramName ) const; - void calculateEnsembleParametersIntersectionHash(); - void clearEnsembleParametersHashes(); + RigEnsembleParameter ensembleParameter( const QString& paramName ) const; + void calculateEnsembleParametersIntersectionHash(); + void clearEnsembleParametersHashes(); void loadDataAndUpdate(); @@ -146,8 +101,8 @@ class RimSummaryCaseCollection : public caf::PdmObject RiaDefines::EclipseUnitSystem unitSystem() const; private: - EnsembleParameter createEnsembleParameter( const QString& paramName ) const; - static void sortByBinnedVariation( std::vector& parameterVector ); + RigEnsembleParameter createEnsembleParameter( const QString& paramName ) const; + static void sortByBinnedVariation( std::vector& parameterVector ); friend class RimSummaryCaseCollection_TESTER; caf::PdmFieldHandle* userDescriptionField() override; @@ -177,5 +132,5 @@ class RimSummaryCaseCollection : public caf::PdmObject size_t m_commonAddressCount; // if different address count among cases, set to 0 - mutable std::vector m_cachedSortedEnsembleParameters; + mutable std::vector m_cachedSortedEnsembleParameters; }; diff --git a/ApplicationLibCode/ReservoirDataModel/CMakeLists_files.cmake b/ApplicationLibCode/ReservoirDataModel/CMakeLists_files.cmake index 1b23d6c9ca..f7b11636ff 100644 --- a/ApplicationLibCode/ReservoirDataModel/CMakeLists_files.cmake +++ b/ApplicationLibCode/ReservoirDataModel/CMakeLists_files.cmake @@ -88,6 +88,7 @@ ${CMAKE_CURRENT_LIST_DIR}/RigTracerPoint.h ${CMAKE_CURRENT_LIST_DIR}/RigTracer.h ${CMAKE_CURRENT_LIST_DIR}/RigStimPlanModelTools.h ${CMAKE_CURRENT_LIST_DIR}/RigSlice2D.h +${CMAKE_CURRENT_LIST_DIR}/RigEnsembleParameter.h ) @@ -173,6 +174,7 @@ ${CMAKE_CURRENT_LIST_DIR}/RigTracerPoint.cpp ${CMAKE_CURRENT_LIST_DIR}/RigTracer.cpp ${CMAKE_CURRENT_LIST_DIR}/RigStimPlanModelTools.cpp ${CMAKE_CURRENT_LIST_DIR}/RigSlice2D.cpp +${CMAKE_CURRENT_LIST_DIR}/RigEnsembleParameter.cpp ) list(APPEND CODE_HEADER_FILES diff --git a/ApplicationLibCode/ReservoirDataModel/RigEnsembleParameter.cpp b/ApplicationLibCode/ReservoirDataModel/RigEnsembleParameter.cpp new file mode 100644 index 0000000000..ade8d3bcfc --- /dev/null +++ b/ApplicationLibCode/ReservoirDataModel/RigEnsembleParameter.cpp @@ -0,0 +1,108 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2017- Statoil ASA +// +// ResInsight is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// + +#include "RigEnsembleParameter.h" + +#include +#include + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +double RigEnsembleParameter::stdDeviation() const +{ + double N = static_cast( values.size() ); + if ( N > 1 && isNumeric() ) + { + double sumValues = 0.0; + double sumValuesSquared = 0.0; + for ( const QVariant& variant : values ) + { + double value = variant.toDouble(); + sumValues += value; + sumValuesSquared += value * value; + } + + return std::sqrt( ( N * sumValuesSquared - sumValues * sumValues ) / ( N * ( N - 1.0 ) ) ); + } + return 0.0; +} + +//-------------------------------------------------------------------------------------------------- +/// Standard deviation normalized by max absolute value of min/max values. +/// Produces values between 0.0 and sqrt(2.0). +//-------------------------------------------------------------------------------------------------- +double RigEnsembleParameter::normalizedStdDeviation() const +{ + const double eps = 1.0e-4; + + double maxAbs = std::max( std::fabs( maxValue ), std::fabs( minValue ) ); + if ( maxAbs < eps ) + { + return 0.0; + } + + double normalisedStdDev = stdDeviation() / maxAbs; + if ( normalisedStdDev < eps ) + { + return 0.0; + } + return normalisedStdDev; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +bool RigEnsembleParameter::operator<( const RigEnsembleParameter& other ) const +{ + if ( this->variationBin != other.variationBin ) + { + return this->variationBin > other.variationBin; // Larger first + } + + return this->name < other.name; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +QString RigEnsembleParameter::uiName() const +{ + QString stem = name; + QString variationString; + if ( isNumeric() ) + { + switch ( variationBin ) + { + case NO_VARIATION: + variationString = QString( " (No variation)" ); + break; + case LOW_VARIATION: + variationString = QString( " (Low variation)" ); + break; + case MEDIUM_VARIATION: + variationString = QString( " (Medium variation)" ); + break; + case HIGH_VARIATION: + variationString = QString( " (High variation)" ); + break; + } + } + + return QString( "%1%2" ).arg( stem ).arg( variationString ); +} diff --git a/ApplicationLibCode/ReservoirDataModel/RigEnsembleParameter.h b/ApplicationLibCode/ReservoirDataModel/RigEnsembleParameter.h new file mode 100644 index 0000000000..ac847bb8b5 --- /dev/null +++ b/ApplicationLibCode/ReservoirDataModel/RigEnsembleParameter.h @@ -0,0 +1,74 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2016- Statoil ASA +// +// ResInsight is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// + +#pragma once + +#include "RiaDefines.h" + +#include +#include + +#include +#include + +//================================================================================================== +/// +//================================================================================================== +class RigEnsembleParameter +{ +public: + enum Type + { + TYPE_NONE, + TYPE_NUMERIC, + TYPE_TEXT + }; + enum Bins + { + NO_VARIATION = -1, + LOW_VARIATION = 0, + MEDIUM_VARIATION, + HIGH_VARIATION, + NR_OF_VARIATION_BINS + }; + QString uiName() const; + QString name; + Type type; + std::vector values; + double minValue; + double maxValue; + int variationBin; + + RigEnsembleParameter() + : type( TYPE_NONE ) + , minValue( std::numeric_limits::infinity() ) + , maxValue( -std::numeric_limits::infinity() ) + , variationBin( static_cast( MEDIUM_VARIATION ) ) + { + } + + bool isValid() const { return !name.isEmpty() && type != TYPE_NONE; } + bool isNumeric() const { return type == TYPE_NUMERIC; } + bool isText() const { return type == TYPE_TEXT; } + double normalizedStdDeviation() const; + + bool operator<( const RigEnsembleParameter& other ) const; + +private: + double stdDeviation() const; +}; diff --git a/ApplicationLibCode/UnitTests/RimSummaryCaseCollection-Test.cpp b/ApplicationLibCode/UnitTests/RimSummaryCaseCollection-Test.cpp index 500ae627eb..798c6f164a 100644 --- a/ApplicationLibCode/UnitTests/RimSummaryCaseCollection-Test.cpp +++ b/ApplicationLibCode/UnitTests/RimSummaryCaseCollection-Test.cpp @@ -1,5 +1,6 @@ #include "gtest/gtest.h" +#include "RigEnsembleParameter.h" #include "RimSummaryCaseCollection.h" #include @@ -12,7 +13,7 @@ class RimSummaryCaseCollection_TESTER static void test1(); }; -TEST( RimSummaryCaseCollection, EnsembleParameter ) +TEST( RimSummaryCaseCollection, RigEnsembleParameter ) { RimSummaryCaseCollection_TESTER::test1(); } @@ -26,11 +27,11 @@ void RimSummaryCaseCollection_TESTER::test1() std::uniform_int_distribution countDistribution( 1u, 1000u ); size_t N = 1000; - std::vector parameters; + std::vector parameters; for ( size_t i = 0; i < N; ++i ) { - EnsembleParameter param; - param.type = EnsembleParameter::TYPE_NUMERIC; + RigEnsembleParameter param; + param.type = RigEnsembleParameter::TYPE_NUMERIC; size_t valueCount = countDistribution( gen ); @@ -77,18 +78,18 @@ void RimSummaryCaseCollection_TESTER::test1() size_t currentSize = parameters.size(); EXPECT_EQ( previousSize, currentSize ); - int currentVariation = (int)EnsembleParameter::HIGH_VARIATION; - for ( const EnsembleParameter& nameParamPair : parameters ) + int currentVariation = (int)RigEnsembleParameter::HIGH_VARIATION; + for ( const RigEnsembleParameter& nameParamPair : parameters ) { if ( nameParamPair.normalizedStdDeviation() == 0.0 ) { - EXPECT_EQ( nameParamPair.variationBin, (int)EnsembleParameter::NO_VARIATION ); + EXPECT_EQ( nameParamPair.variationBin, (int)RigEnsembleParameter::NO_VARIATION ); } else { - EXPECT_GE( nameParamPair.variationBin, (int)EnsembleParameter::LOW_VARIATION ); + EXPECT_GE( nameParamPair.variationBin, (int)RigEnsembleParameter::LOW_VARIATION ); } - EXPECT_LE( nameParamPair.variationBin, (int)EnsembleParameter::HIGH_VARIATION ); + EXPECT_LE( nameParamPair.variationBin, (int)RigEnsembleParameter::HIGH_VARIATION ); EXPECT_LE( nameParamPair.variationBin, currentVariation ); currentVariation = nameParamPair.variationBin; } diff --git a/ApplicationLibCode/UserInterface/RiuSummaryQwtPlot.cpp b/ApplicationLibCode/UserInterface/RiuSummaryQwtPlot.cpp index 1736a39996..2036c1f7ac 100644 --- a/ApplicationLibCode/UserInterface/RiuSummaryQwtPlot.cpp +++ b/ApplicationLibCode/UserInterface/RiuSummaryQwtPlot.cpp @@ -318,12 +318,12 @@ void RiuSummaryQwtPlot::contextMenuEvent( QContextMenuEvent* event ) { menuBuilder.subMenuStart( "Cross Plots", *caf::IconProvider( ":/CorrelationCrossPlot16x16.png" ).icon() ); - std::vector> ensembleParameters = + std::vector> ensembleParameters = ensemble->parameterCorrelations( clickedEnsembleCurveSet->summaryAddress(), timeStep ); std::sort( ensembleParameters.begin(), ensembleParameters.end(), - []( const std::pair& lhs, - const std::pair& rhs ) { + []( const std::pair& lhs, + const std::pair& rhs ) { return std::fabs( lhs.second ) > std::fabs( rhs.second ); } ); From 6c11b6f33bdef94a8bb2738433269c21ce653e37 Mon Sep 17 00:00:00 2001 From: Kristian Bendiksen Date: Wed, 2 Jun 2021 13:11:47 +0200 Subject: [PATCH 036/308] Refactor: Make interface to enable reuse --- .../ProjectDataModel/CMakeLists_files.cmake | 1 + .../RimEnsembleCurveSetInterface.h | 35 +++++++++++++++++++ .../Summary/RimEnsembleCurveSet.cpp | 10 +++++- .../Summary/RimEnsembleCurveSet.h | 16 +++++---- .../Summary/RimEnsembleStatistics.cpp | 27 +++++--------- .../Summary/RimEnsembleStatistics.h | 12 +++---- 6 files changed, 66 insertions(+), 35 deletions(-) create mode 100644 ApplicationLibCode/ProjectDataModel/RimEnsembleCurveSetInterface.h diff --git a/ApplicationLibCode/ProjectDataModel/CMakeLists_files.cmake b/ApplicationLibCode/ProjectDataModel/CMakeLists_files.cmake index 0974858bf3..b474c1e4ac 100644 --- a/ApplicationLibCode/ProjectDataModel/CMakeLists_files.cmake +++ b/ApplicationLibCode/ProjectDataModel/CMakeLists_files.cmake @@ -155,6 +155,7 @@ ${CMAKE_CURRENT_LIST_DIR}/RimTimeAxisAnnotation.h ${CMAKE_CURRENT_LIST_DIR}/RimPolylinesDataInterface.h ${CMAKE_CURRENT_LIST_DIR}/RimEnsembleWellLogs.h ${CMAKE_CURRENT_LIST_DIR}/RimEnsembleWellLogsCollection.h +${CMAKE_CURRENT_LIST_DIR}/RimEnsembleCurveSetInterface.h ${CMAKE_CURRENT_LIST_DIR}/RimWellPathTieIn.h ${CMAKE_CURRENT_LIST_DIR}/cafTreeNode.h ${CMAKE_CURRENT_LIST_DIR}/RimMultipleLocations.h diff --git a/ApplicationLibCode/ProjectDataModel/RimEnsembleCurveSetInterface.h b/ApplicationLibCode/ProjectDataModel/RimEnsembleCurveSetInterface.h new file mode 100644 index 0000000000..9372990dc4 --- /dev/null +++ b/ApplicationLibCode/ProjectDataModel/RimEnsembleCurveSetInterface.h @@ -0,0 +1,35 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2021- Equinor ASA +// +// ResInsight is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// + +#pragma once + +//================================================================================================== +/// +//================================================================================================== +class RimEnsembleCurveSetInterface +{ +public: + virtual void updateEditors() = 0; + virtual void updateAllCurves() = 0; + virtual void updateStatisticsCurves() = 0; + + virtual bool hasP10Data() const = 0; + virtual bool hasP50Data() const = 0; + virtual bool hasP90Data() const = 0; + virtual bool hasMeanData() const = 0; +}; diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimEnsembleCurveSet.cpp b/ApplicationLibCode/ProjectDataModel/Summary/RimEnsembleCurveSet.cpp index 9903030f5a..a647822dba 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimEnsembleCurveSet.cpp +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimEnsembleCurveSet.cpp @@ -207,7 +207,7 @@ RimEnsembleCurveSet::RimEnsembleCurveSet() m_objectiveFunction->changed.connect( this, &RimEnsembleCurveSet::onObjectiveFunctionChanged ); CAF_PDM_InitFieldNoDefault( &m_statistics, "Statistics", "Statistics", "", "", "" ); - m_statistics = new RimEnsembleStatistics(); + m_statistics = new RimEnsembleStatistics( this ); m_statistics.uiCapability()->setUiTreeHidden( true ); CAF_PDM_InitField( &m_userDefinedName, "UserDefinedName", QString( "Ensemble Curve Set" ), "Curve Set Name", "", "", "" ); @@ -587,6 +587,14 @@ void RimEnsembleCurveSet::updateAllCurves() filterChanged.send(); } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimEnsembleCurveSet::updateEditors() +{ + updateConnectedEditors(); +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimEnsembleCurveSet.h b/ApplicationLibCode/ProjectDataModel/Summary/RimEnsembleCurveSet.h index 471510f6f0..2a9b7f42f0 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimEnsembleCurveSet.h +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimEnsembleCurveSet.h @@ -26,6 +26,7 @@ #include "RiaQDateTimeTools.h" #include "RimEnsembleCurveSetColorManager.h" +#include "RimEnsembleCurveSetInterface.h" #include "RimObjectiveFunction.h" #include "RimRegularLegendConfig.h" #include "RimSummaryCase.h" @@ -72,7 +73,7 @@ class QDate; //================================================================================================== /// //================================================================================================== -class RimEnsembleCurveSet : public caf::PdmObject +class RimEnsembleCurveSet : public caf::PdmObject, public RimEnsembleCurveSetInterface { CAF_PDM_HEADER_INIT; @@ -126,10 +127,8 @@ class RimEnsembleCurveSet : public caf::PdmObject void updateEnsembleLegendItem(); RiuDraggableOverlayFrame* legendFrame() const; - void updateAllCurves(); void setTimeSteps( const std::vector& timeStepIndices ); std::vector selectedTimeSteps() const; - void updateStatisticsCurves(); RimEnsembleCurveSet* clone() const; void showCurves( bool show ); @@ -143,10 +142,13 @@ class RimEnsembleCurveSet : public caf::PdmObject void disableStatisticCurves(); bool isFiltered() const; - bool hasP10Data() const; - bool hasP50Data() const; - bool hasP90Data() const; - bool hasMeanData() const; + void updateEditors() override; + void updateAllCurves() override; + void updateStatisticsCurves() override; + bool hasP10Data() const override; + bool hasP50Data() const override; + bool hasP90Data() const override; + bool hasMeanData() const override; void appendColorGroup( caf::PdmUiOrdering& uiOrdering ); diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimEnsembleStatistics.cpp b/ApplicationLibCode/ProjectDataModel/Summary/RimEnsembleStatistics.cpp index 96bbd55edd..906c9130f7 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimEnsembleStatistics.cpp +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimEnsembleStatistics.cpp @@ -17,24 +17,23 @@ ///////////////////////////////////////////////////////////////////////////////// #include "RimEnsembleStatistics.h" +#include "RimEnsembleCurveSetInterface.h" #include "RiaColorTools.h" -#include "RifSummaryReaderInterface.h" -#include "RigStatisticsMath.h" #include "RimEnsembleCurveSet.h" -#include "RimSummaryCase.h" -#include "RimSummaryCaseCollection.h" CAF_PDM_SOURCE_INIT( RimEnsembleStatistics, "RimEnsembleStatistics" ); //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -RimEnsembleStatistics::RimEnsembleStatistics() +RimEnsembleStatistics::RimEnsembleStatistics( RimEnsembleCurveSetInterface* parentCurveSet ) { CAF_PDM_InitObject( "Ensemble Curve Filter", ":/EnsembleCurveSet16x16.png", "", "" ); + m_parentCurveSet = parentCurveSet; + CAF_PDM_InitField( &m_active, "Active", true, "Show Statistics Curves", "", "", "" ); CAF_PDM_InitField( &m_hideEnsembleCurves, "HideEnsembleCurves", false, "Hide Ensemble Curves", "", "", "" ); CAF_PDM_InitField( &m_basedOnFilteredCases, "BasedOnFilteredCases", false, "Based on Filtered Cases", "", "", "" ); @@ -105,17 +104,17 @@ void RimEnsembleStatistics::fieldChangedByUi( const caf::PdmFieldHandle* changed changedField == &m_showP50Curve || changedField == &m_showP90Curve || changedField == &m_showMeanCurve || changedField == &m_showCurveLabels || changedField == &m_color || changedField == &m_includeIncompleteCurves ) { - auto curveSet = parentCurveSet(); + auto curveSet = m_parentCurveSet; if ( !curveSet ) return; curveSet->updateStatisticsCurves(); - if ( changedField == &m_active || changedField == &m_basedOnFilteredCases ) curveSet->updateConnectedEditors(); + if ( changedField == &m_active || changedField == &m_basedOnFilteredCases ) curveSet->updateEditors(); } if ( changedField == &m_hideEnsembleCurves ) { - auto curveSet = parentCurveSet(); + auto curveSet = m_parentCurveSet; if ( !curveSet ) return; curveSet->updateAllCurves(); @@ -127,7 +126,7 @@ void RimEnsembleStatistics::fieldChangedByUi( const caf::PdmFieldHandle* changed //-------------------------------------------------------------------------------------------------- void RimEnsembleStatistics::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) { - auto curveSet = parentCurveSet(); + auto curveSet = m_parentCurveSet; uiOrdering.add( &m_active ); uiOrdering.add( &m_hideEnsembleCurves ); @@ -155,13 +154,3 @@ void RimEnsembleStatistics::defineUiOrdering( QString uiConfigName, caf::PdmUiOr uiOrdering.skipRemainingFields( true ); } - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -RimEnsembleCurveSet* RimEnsembleStatistics::parentCurveSet() const -{ - RimEnsembleCurveSet* curveSet; - firstAncestorOrThisOfType( curveSet ); - return curveSet; -} diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimEnsembleStatistics.h b/ApplicationLibCode/ProjectDataModel/Summary/RimEnsembleStatistics.h index 3b836b65fc..b8ab31fae6 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimEnsembleStatistics.h +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimEnsembleStatistics.h @@ -18,15 +18,11 @@ #pragma once -#include "RimEnsembleCurveSet.h" -#include "RimSummaryCase.h" - #include "cafPdmField.h" +#include "cafPdmFieldCvfColor.h" #include "cafPdmObject.h" -class RifEclipseSummaryAddress; -class RimSummaryCaseCollection; -class RimEnsembleStatisticsCase; +class RimEnsembleCurveSetInterface; //================================================================================================== /// @@ -36,7 +32,7 @@ class RimEnsembleStatistics : public caf::PdmObject CAF_PDM_HEADER_INIT; public: - RimEnsembleStatistics(); + RimEnsembleStatistics( RimEnsembleCurveSetInterface* parentCurveSet = nullptr ); bool isActive() const; bool hideEnsembleCurves() const { return m_hideEnsembleCurves; } @@ -59,7 +55,7 @@ class RimEnsembleStatistics : public caf::PdmObject void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override; private: - RimEnsembleCurveSet* parentCurveSet() const; + RimEnsembleCurveSetInterface* m_parentCurveSet; caf::PdmField m_active; caf::PdmField m_hideEnsembleCurves; From 5a7b52abf6dd46a4a6a3dd374a49b9cf10c353e2 Mon Sep 17 00:00:00 2001 From: Kristian Bendiksen Date: Wed, 9 Jun 2021 16:04:24 +0200 Subject: [PATCH 037/308] Fix bug in error message format --- ApplicationLibCode/ProjectDataModel/RimWellLogFileCurve.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ApplicationLibCode/ProjectDataModel/RimWellLogFileCurve.cpp b/ApplicationLibCode/ProjectDataModel/RimWellLogFileCurve.cpp index 4d8e2044e6..ddaeb6d398 100644 --- a/ApplicationLibCode/ProjectDataModel/RimWellLogFileCurve.cpp +++ b/ApplicationLibCode/ProjectDataModel/RimWellLogFileCurve.cpp @@ -140,7 +140,7 @@ void RimWellLogFileCurve::onLoadDataAndUpdate( bool updateParentPlot ) if ( wellLogPlot && !this->curveData()->availableDepthTypes().count( wellLogPlot->depthType() ) ) { QString depthTitle = wellLogPlot->depthAxisTitle(); - errMsg = QString( "Display of %1 for LAS curves is not possible without %1 " + errMsg = QString( "Display of %1 for LAS curves is not possible without %2 " "values in the LAS-file or a well path to derive them from." ) .arg( depthTitle ) .arg( depthTitle ); From fed98a41832399c58c26768841218214a7be25bc Mon Sep 17 00:00:00 2001 From: Kristian Bendiksen Date: Fri, 28 May 2021 08:54:27 +0200 Subject: [PATCH 038/308] #7716 Added ensemble well log curve set --- .../ProjectDataModel/CMakeLists_files.cmake | 6 + .../RimEnsembleWellLogCurveSet.cpp | 1228 +++++++++++++++++ .../RimEnsembleWellLogCurveSet.h | 187 +++ .../RimEnsembleWellLogStatistics.cpp | 197 +++ .../RimEnsembleWellLogStatistics.h | 66 + .../RimEnsembleWellLogStatisticsCurve.cpp | 174 +++ .../RimEnsembleWellLogStatisticsCurve.h | 56 + .../ProjectDataModel/RimEnsembleWellLogs.cpp | 16 + .../ProjectDataModel/RimEnsembleWellLogs.h | 4 + .../ProjectDataModel/RimWellLogTrack.cpp | 14 + .../ProjectDataModel/RimWellLogTrack.h | 2 + 11 files changed, 1950 insertions(+) create mode 100644 ApplicationLibCode/ProjectDataModel/RimEnsembleWellLogCurveSet.cpp create mode 100644 ApplicationLibCode/ProjectDataModel/RimEnsembleWellLogCurveSet.h create mode 100644 ApplicationLibCode/ProjectDataModel/RimEnsembleWellLogStatistics.cpp create mode 100644 ApplicationLibCode/ProjectDataModel/RimEnsembleWellLogStatistics.h create mode 100644 ApplicationLibCode/ProjectDataModel/RimEnsembleWellLogStatisticsCurve.cpp create mode 100644 ApplicationLibCode/ProjectDataModel/RimEnsembleWellLogStatisticsCurve.h diff --git a/ApplicationLibCode/ProjectDataModel/CMakeLists_files.cmake b/ApplicationLibCode/ProjectDataModel/CMakeLists_files.cmake index b474c1e4ac..653f3dd8f6 100644 --- a/ApplicationLibCode/ProjectDataModel/CMakeLists_files.cmake +++ b/ApplicationLibCode/ProjectDataModel/CMakeLists_files.cmake @@ -156,6 +156,9 @@ ${CMAKE_CURRENT_LIST_DIR}/RimPolylinesDataInterface.h ${CMAKE_CURRENT_LIST_DIR}/RimEnsembleWellLogs.h ${CMAKE_CURRENT_LIST_DIR}/RimEnsembleWellLogsCollection.h ${CMAKE_CURRENT_LIST_DIR}/RimEnsembleCurveSetInterface.h +${CMAKE_CURRENT_LIST_DIR}/RimEnsembleWellLogCurveSet.h +${CMAKE_CURRENT_LIST_DIR}/RimEnsembleWellLogStatistics.h +${CMAKE_CURRENT_LIST_DIR}/RimEnsembleWellLogStatisticsCurve.h ${CMAKE_CURRENT_LIST_DIR}/RimWellPathTieIn.h ${CMAKE_CURRENT_LIST_DIR}/cafTreeNode.h ${CMAKE_CURRENT_LIST_DIR}/RimMultipleLocations.h @@ -314,6 +317,9 @@ ${CMAKE_CURRENT_LIST_DIR}/RimEquilibriumAxisAnnotation.cpp ${CMAKE_CURRENT_LIST_DIR}/RimTimeAxisAnnotation.cpp ${CMAKE_CURRENT_LIST_DIR}/RimEnsembleWellLogs.cpp ${CMAKE_CURRENT_LIST_DIR}/RimEnsembleWellLogsCollection.cpp +${CMAKE_CURRENT_LIST_DIR}/RimEnsembleWellLogCurveSet.cpp +${CMAKE_CURRENT_LIST_DIR}/RimEnsembleWellLogStatistics.cpp +${CMAKE_CURRENT_LIST_DIR}/RimEnsembleWellLogStatisticsCurve.cpp ${CMAKE_CURRENT_LIST_DIR}/RimWellPathTieIn.cpp ${CMAKE_CURRENT_LIST_DIR}/cafTreeNode.cpp ${CMAKE_CURRENT_LIST_DIR}/RimMultipleLocations.cpp diff --git a/ApplicationLibCode/ProjectDataModel/RimEnsembleWellLogCurveSet.cpp b/ApplicationLibCode/ProjectDataModel/RimEnsembleWellLogCurveSet.cpp new file mode 100644 index 0000000000..7b1453ebb4 --- /dev/null +++ b/ApplicationLibCode/ProjectDataModel/RimEnsembleWellLogCurveSet.cpp @@ -0,0 +1,1228 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2021- Equinor ASA +// +// ResInsight is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// + +#include "RimEnsembleWellLogCurveSet.h" + +#include "RiaColorTools.h" +#include "RiaGuiApplication.h" +#include "RiaLogging.h" +#include "RiaPreferences.h" +#include "RiaResultNames.h" +#include "RiaStatisticsTools.h" +#include "RiaSummaryCurveAnalyzer.h" +#include "RiaSummaryCurveDefinition.h" +#include "RiaTimeTTools.h" + +#include "RimEnsembleWellLogStatisticsCurve.h" +#include "RimOilField.h" +#include "RimProject.h" +#include "RimRegularLegendConfig.h" +#include "RimWellLogCurve.h" +#include "RimWellLogFile.h" +#include "RimWellLogFileChannel.h" +#include "RimWellLogFileCurve.h" +#include "RimWellLogPlot.h" +#include "RimWellLogTrack.h" + +#include "RimEnsembleCurveFilter.h" +#include "RimEnsembleCurveFilterCollection.h" +#include "RimEnsembleCurveSetCollection.h" +#include "RimEnsembleCurveSetColorManager.h" +#include "RimEnsembleStatistics.h" +#include "RimEnsembleStatisticsCase.h" +#include "RimEnsembleWellLogStatistics.h" +#include "RimEnsembleWellLogs.h" +#include "RimEnsembleWellLogsCollection.h" + +#include "RiuAbstractLegendFrame.h" +#include "RiuDraggableOverlayFrame.h" +#include "RiuPlotMainWindow.h" +#include "RiuQwtPlotCurve.h" +#include "RiuQwtPlotWidget.h" +#include "RiuTextContentFrame.h" + +#include "cafPdmObject.h" +#include "cafPdmUiDateEditor.h" +#include "cafPdmUiItem.h" +#include "cafPdmUiLineEditor.h" +#include "cafPdmUiListEditor.h" +#include "cafPdmUiPushButtonEditor.h" +#include "cafPdmUiSliderEditor.h" +#include "cafPdmUiTreeOrdering.h" +#include "cafPdmUiTreeSelectionEditor.h" +#include "cafTitledOverlayFrame.h" + +// TODO: remove? +#include "RifEnsembleStatisticsReader.h" + +// #include "cvfScalarMapper.h" + +#include "qwt_plot_curve.h" +#include "qwt_symbol.h" + +#include +#include + +//-------------------------------------------------------------------------------------------------- +/// Internal functions +//-------------------------------------------------------------------------------------------------- +int statisticsCurveSymbolSize( RiuQwtSymbol::PointSymbolEnum symbol ); + +CAF_PDM_SOURCE_INIT( RimEnsembleWellLogCurveSet, "RimEnsembleWellLogCurveSet" ); + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RimEnsembleWellLogCurveSet::RimEnsembleWellLogCurveSet() + : filterChanged( this ) + +{ + CAF_PDM_InitObject( "Ensemble Curve Set", ":/EnsembleCurveSet16x16.png", "", "" ); + + CAF_PDM_InitFieldNoDefault( &m_curves, "EnsembleCurveSet", "Ensemble Curve Set", "", "", "" ); + m_curves.uiCapability()->setUiHidden( true ); + m_curves.uiCapability()->setUiTreeChildrenHidden( false ); + + CAF_PDM_InitField( &m_showCurves, "IsActive", true, "Show Curves", "", "", "" ); + m_showCurves.uiCapability()->setUiHidden( true ); + + CAF_PDM_InitFieldNoDefault( &m_ensembleWellLogs, "EnsembleWellLogs", "Ensemble Well Logs", "", "", "" ); + m_ensembleWellLogs.uiCapability()->setUiTreeChildrenHidden( true ); + + CAF_PDM_InitFieldNoDefault( &m_wellLogChannelName, "WellLogChannelName", "Well Log Channel Name", "", "", "" ); + + CAF_PDM_InitField( &m_colorMode, "ColorMode", caf::AppEnum( ColorMode::SINGLE_COLOR ), "Coloring Mode", "", "", "" ); + + CAF_PDM_InitField( &m_color, "Color", RiaColorTools::textColor3f(), "Color", "", "", "" ); + + CAF_PDM_InitField( &m_ensembleParameter, "EnsembleParameter", QString( "" ), "Ensemble Parameter", "", "", "" ); + m_ensembleParameter.uiCapability()->setUiEditorTypeName( caf::PdmUiListEditor::uiEditorTypeName() ); + + CAF_PDM_InitFieldNoDefault( &m_legendConfig, "LegendConfig", "", "", "", "" ); + m_legendConfig = new RimRegularLegendConfig(); + m_legendConfig->setColorLegend( + RimRegularLegendConfig::mapToColorLegend( RimEnsembleCurveSetColorManager::DEFAULT_ENSEMBLE_COLOR_RANGE ) ); + + CAF_PDM_InitFieldNoDefault( &m_curveFilters, "CurveFilters", "Curve Filters", "", "", "" ); + m_curveFilters = new RimEnsembleCurveFilterCollection(); + m_curveFilters->setUiTreeHidden( true ); + m_curveFilters->uiCapability()->setUiTreeHidden( true ); + + CAF_PDM_InitFieldNoDefault( &m_statistics, "Statistics", "Statistics", "", "", "" ); + m_statistics = new RimEnsembleStatistics( this ); + m_statistics.uiCapability()->setUiTreeHidden( true ); + + CAF_PDM_InitField( &m_userDefinedName, "UserDefinedName", QString( "Ensemble Curve Set" ), "Curve Set Name", "", "", "" ); + + CAF_PDM_InitFieldNoDefault( &m_autoGeneratedName, "AutoGeneratedName", "Curve Set Name", "", "", "" ); + m_autoGeneratedName.registerGetMethod( this, &RimEnsembleWellLogCurveSet::createAutoName ); + m_autoGeneratedName.uiCapability()->setUiReadOnly( true ); + m_autoGeneratedName.xmlCapability()->disableIO(); + + CAF_PDM_InitField( &m_isUsingAutoName, "AutoName", true, "Auto Name", "", "", "" ); + + m_qwtPlotCurveForLegendText = new QwtPlotCurve; + m_qwtPlotCurveForLegendText->setLegendAttribute( QwtPlotCurve::LegendShowSymbol, true ); + + m_ensembleWellLogStatistics.reset( new RimEnsembleWellLogStatistics ); + + m_disableStatisticCurves = false; + m_isCurveSetFiltered = false; + + setDeletable( true ); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RimEnsembleWellLogCurveSet::~RimEnsembleWellLogCurveSet() +{ + // m_curves.deleteAllChildObjects(); + + RimWellLogPlot* parentPlot; + firstAncestorOrThisOfType( parentPlot ); + // if ( parentPlot && parentPlot->viewer() ) + // { + // m_qwtPlotCurveForLegendText->detach(); + // if ( m_legendOverlayFrame ) + // { + // parentPlot->viewer()->removeOverlayFrame( m_legendOverlayFrame ); + // } + // } + if ( m_legendOverlayFrame ) + { + m_legendOverlayFrame->setParent( nullptr ); + delete m_legendOverlayFrame; + } + if ( m_filterOverlayFrame ) + { + m_filterOverlayFrame->setParent( nullptr ); + delete m_filterOverlayFrame; + } + + delete m_qwtPlotCurveForLegendText; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +bool RimEnsembleWellLogCurveSet::isCurvesVisible() +{ + return m_showCurves(); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimEnsembleWellLogCurveSet::setColor( cvf::Color3f color ) +{ + m_color = color; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimEnsembleWellLogCurveSet::loadDataAndUpdate( bool updateParentPlot ) +{ + m_curveFilters->loadDataAndUpdate(); + + updateAllCurves(); + updateFilterLegend(); + + if ( updateParentPlot ) + { + RimWellLogTrack* parentPlot; + firstAncestorOrThisOfTypeAsserted( parentPlot ); + parentPlot->viewer()->scheduleReplot(); + } +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimEnsembleWellLogCurveSet::setParentQwtPlotNoReplot( QwtPlot* plot ) +{ + for ( RimWellLogCurve* curve : m_curves ) + { + curve->setParentQwtPlotNoReplot( plot ); + } +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimEnsembleWellLogCurveSet::detachQwtCurves() +{ + for ( RimWellLogCurve* curve : m_curves ) + { + curve->detachQwtCurve(); + } + + m_qwtPlotCurveForLegendText->detach(); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimEnsembleWellLogCurveSet::reattachQwtCurves() +{ + for ( RimWellLogCurve* curve : m_curves ) + { + curve->reattachQwtCurve(); + } + + m_qwtPlotCurveForLegendText->detach(); + + RimWellLogPlot* plot = nullptr; + firstAncestorOrThisOfType( plot ); + // if ( plot ) + // { + // m_qwtPlotCurveForLegendText->attach( plot->viewer() ); + // } +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimEnsembleWellLogCurveSet::addCurve( RimWellLogCurve* curve ) +{ + if ( curve ) + { + RimWellLogPlot* plot; + firstAncestorOrThisOfType( plot ); + // if ( plot ) curve->setParentQwtPlotNoReplot( plot->viewer() ); + + curve->setColor( m_color ); + m_curves.push_back( curve ); + } +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimEnsembleWellLogCurveSet::deleteCurve( RimWellLogCurve* curve ) +{ + // if ( curve ) + // { + // m_curves.removeChildObject( curve ); + // delete curve; + // } +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +std::vector RimEnsembleWellLogCurveSet::curves() const +{ + return m_curves.ptrReferencedObjects(); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimEnsembleWellLogCurveSet::deleteEnsembleCurves() +{ + RimWellLogTrack* plotTrack = nullptr; + firstAncestorOrThisOfType( plotTrack ); + CVF_ASSERT( plotTrack ); + + std::vector curvesIndexesToDelete; + for ( size_t c = 0; c < m_curves.size(); c++ ) + { + RimWellLogCurve* curve = m_curves[c]; + + if ( dynamic_cast( curve ) == nullptr ) + { + plotTrack->removeCurve( m_curves[c] ); + curvesIndexesToDelete.push_back( c ); + } + } + + while ( curvesIndexesToDelete.size() > 0 ) + { + size_t currIndex = curvesIndexesToDelete.back(); + m_curves.erase( currIndex ); + curvesIndexesToDelete.pop_back(); + } +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimEnsembleWellLogCurveSet::deleteStatisticsCurves() +{ + RimWellLogTrack* plotTrack = nullptr; + firstAncestorOrThisOfType( plotTrack ); + CVF_ASSERT( plotTrack ); + + std::vector curvesIndexesToDelete; + for ( size_t c = 0; c < m_curves.size(); c++ ) + { + RimWellLogCurve* curve = m_curves[c]; + + if ( dynamic_cast( curve ) != nullptr ) + { + plotTrack->removeCurve( m_curves[c] ); + curvesIndexesToDelete.push_back( c ); + } + } + + while ( curvesIndexesToDelete.size() > 0 ) + { + size_t currIndex = curvesIndexesToDelete.back(); + m_curves.erase( currIndex ); + curvesIndexesToDelete.pop_back(); + } +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RimRegularLegendConfig* RimEnsembleWellLogCurveSet::legendConfig() +{ + return m_legendConfig; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RiuDraggableOverlayFrame* RimEnsembleWellLogCurveSet::legendFrame() const +{ + return m_legendOverlayFrame; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimEnsembleWellLogCurveSet::onLegendDefinitionChanged() +{ + updateCurveColors(); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RimEnsembleCurveFilterCollection* RimEnsembleWellLogCurveSet::filterCollection() const +{ + return m_curveFilters; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RimEnsembleWellLogCurveSet::ColorMode RimEnsembleWellLogCurveSet::colorMode() const +{ + return m_colorMode(); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimEnsembleWellLogCurveSet::setColorMode( ColorMode mode ) +{ + m_colorMode = mode; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimEnsembleWellLogCurveSet::setEnsembleParameter( const QString& parameterName ) +{ + m_ensembleParameter = parameterName; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RigEnsembleParameter::Type RimEnsembleWellLogCurveSet::currentEnsembleParameterType() const +{ + if ( m_colorMode() == ColorMode::BY_ENSEMBLE_PARAM ) + { + // RimSummaryCaseCollection* group = m_yValuesSummaryCaseCollection(); + // QString parameterName = m_ensembleParameter(); + + // if ( group && !parameterName.isEmpty() ) + // { + // auto eParam = group->ensembleParameter( parameterName ); + // return eParam.type; + // } + } + return RigEnsembleParameter::TYPE_NONE; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimEnsembleWellLogCurveSet::updateAllCurves() +{ + RimEnsembleWellLogs* group = m_ensembleWellLogs; + + if ( group ) + { + std::vector allWellLogFiles = group->wellLogFiles(); + std::vector filteredCases = filterEnsembleCases( allWellLogFiles ); + + m_isCurveSetFiltered = filteredCases.size() < allWellLogFiles.size(); + + updateEnsembleCurves( allWellLogFiles ); + updateStatisticsCurves( m_statistics->basedOnFilteredCases() ? filteredCases : allWellLogFiles ); + } + + filterChanged.send(); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimEnsembleWellLogCurveSet::updateEditors() +{ + updateConnectedEditors(); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimEnsembleWellLogCurveSet::fieldChangedByUi( const caf::PdmFieldHandle* changedField, + const QVariant& oldValue, + const QVariant& newValue ) +{ + RimWellLogPlot* plot = nullptr; + firstAncestorOrThisOfType( plot ); + CVF_ASSERT( plot ); + + bool updateTextInPlot = false; + + if ( changedField == &m_showCurves ) + { + loadDataAndUpdate( true ); + + updateConnectedEditors(); + + RimWellLogPlot* summaryPlot = nullptr; + this->firstAncestorOrThisOfTypeAsserted( summaryPlot ); + summaryPlot->updateConnectedEditors(); + + updateTextInPlot = true; + } + else if ( changedField == &m_ensembleWellLogs ) + { + updateAllCurves(); + + updateTextInPlot = true; + } + else if ( changedField == &m_wellLogChannelName ) + { + updateAllCurves(); + updateTextInPlot = true; + } + else if ( changedField == &m_color ) + { + updateCurveColors(); + + updateTextInPlot = true; + } + else if ( changedField == &m_ensembleParameter ) + { + updateLegendMappingMode(); + updateCurveColors(); + } + else if ( changedField == &m_colorMode ) + { + m_ensembleParameter.uiCapability()->setUiHidden( m_colorMode() != ColorMode::BY_ENSEMBLE_PARAM ); + + if ( m_colorMode() == ColorMode::BY_ENSEMBLE_PARAM ) + { + if ( m_ensembleParameter().isEmpty() ) + { + auto params = variationSortedEnsembleParameters(); + m_ensembleParameter = !params.empty() ? params.front().name : ""; + } + } + + updateCurveColors(); + + updateTextInPlot = true; + } + else if ( changedField == &m_isUsingAutoName ) + { + if ( !m_isUsingAutoName ) + { + m_userDefinedName = createAutoName(); + } + + updateTextInPlot = true; + } + else if ( changedField == &m_userDefinedName ) + { + updateTextInPlot = true; + } + + if ( updateTextInPlot ) + { + updateAllTextInPlot(); + } +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimEnsembleWellLogCurveSet::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) +{ + uiOrdering.add( &m_ensembleWellLogs ); + uiOrdering.add( &m_wellLogChannelName ); + + appendColorGroup( uiOrdering ); + + { + caf::PdmUiGroup* nameGroup = uiOrdering.addNewGroup( "Curve Name" ); + nameGroup->setCollapsedByDefault( true ); + nameGroup->add( &m_isUsingAutoName ); + if ( m_isUsingAutoName ) + { + nameGroup->add( &m_autoGeneratedName ); + } + else + { + nameGroup->add( &m_userDefinedName ); + } + } + + caf::PdmUiGroup* statGroup = uiOrdering.addNewGroup( "Statistics" ); + m_statistics->defineUiOrdering( uiConfigName, *statGroup ); + + uiOrdering.skipRemainingFields( true ); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimEnsembleWellLogCurveSet::appendColorGroup( caf::PdmUiOrdering& uiOrdering ) +{ + caf::PdmUiGroup* colorsGroup = uiOrdering.addNewGroup( "Colors" ); + colorsGroup->add( &m_colorMode ); + + if ( m_colorMode == ColorMode::SINGLE_COLOR ) + { + colorsGroup->add( &m_color ); + } + else if ( m_colorMode == ColorMode::BY_ENSEMBLE_PARAM ) + { + colorsGroup->add( &m_ensembleParameter ); + } +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimEnsembleWellLogCurveSet::defineUiTreeOrdering( caf::PdmUiTreeOrdering& uiTreeOrdering, + QString uiConfigName /*= ""*/ ) +{ + if ( m_colorMode == ColorMode::BY_ENSEMBLE_PARAM ) + { + uiTreeOrdering.add( m_legendConfig() ); + } + + for ( auto filter : m_curveFilters->filters() ) + { + uiTreeOrdering.add( filter ); + } + + uiTreeOrdering.skipRemainingChildren( true ); + + caf::IconProvider iconProvider = this->uiIconProvider(); + if ( !iconProvider.valid() ) return; + + // RimEnsembleWellLogCurveSetCollection* coll = nullptr; + // this->firstAncestorOrThisOfType( coll ); + // if ( coll && coll->curveSetForSourceStepping() == this ) + // { + // iconProvider.setOverlayResourceString( ":/StepUpDownCorner16x16.png" ); + // } + + this->setUiIcon( iconProvider ); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +caf::PdmFieldHandle* RimEnsembleWellLogCurveSet::userDescriptionField() +{ + if ( m_isUsingAutoName ) + { + return &m_autoGeneratedName; + } + else + { + return &m_userDefinedName; + } +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +caf::PdmFieldHandle* RimEnsembleWellLogCurveSet::objectToggleField() +{ + return &m_showCurves; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +QList + RimEnsembleWellLogCurveSet::calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions, bool* useOptionsOnly ) +{ + QList options; + + if ( fieldNeedingOptions == &m_ensembleWellLogs ) + { + RimProject* proj = RimProject::current(); + std::vector groups = + proj->activeOilField()->ensembleWellLogsCollection()->ensembleWellLogs(); + + for ( RimEnsembleWellLogs* ensemble : groups ) + { + options.push_back( caf::PdmOptionItemInfo( ensemble->name(), ensemble ) ); + } + + options.push_front( caf::PdmOptionItemInfo( "None", nullptr ) ); + } + else if ( fieldNeedingOptions == &m_wellLogChannelName ) + { + if ( m_ensembleWellLogs ) + { + std::set wellLogChannelNames; + for ( auto wellLogFile : m_ensembleWellLogs->wellLogFiles() ) + { + std::vector fileLogs = wellLogFile->wellLogChannels(); + for ( size_t i = 0; i < fileLogs.size(); i++ ) + { + QString wellLogChannelName = fileLogs[i]->name(); + wellLogChannelNames.insert( wellLogChannelName ); + } + } + + for ( auto wellLogChannelName : wellLogChannelNames ) + { + options.push_back( caf::PdmOptionItemInfo( wellLogChannelName, wellLogChannelName ) ); + } + } + + if ( options.size() == 0 ) + { + options.push_back( caf::PdmOptionItemInfo( "None", "None" ) ); + } + } + else if ( fieldNeedingOptions == &m_colorMode ) + { + auto singleColorOption = ColorModeEnum( ColorMode::SINGLE_COLOR ); + auto byEnsParamOption = ColorModeEnum( ColorMode::BY_ENSEMBLE_PARAM ); + + options.push_back( caf::PdmOptionItemInfo( singleColorOption.uiText(), ColorMode::SINGLE_COLOR ) ); + + RimEnsembleWellLogs* ensembleWellLogs = m_ensembleWellLogs; + if ( ensembleWellLogs && ensembleWellLogs->hasEnsembleParameters() ) + { + options.push_back( caf::PdmOptionItemInfo( byEnsParamOption.uiText(), ColorMode::BY_ENSEMBLE_PARAM ) ); + } + } + else if ( fieldNeedingOptions == &m_ensembleParameter ) + { + auto params = correlationSortedEnsembleParameters(); + for ( const auto& paramCorrPair : params ) + { + QString name = paramCorrPair.first.name; + double corr = paramCorrPair.second; + options.push_back( + caf::PdmOptionItemInfo( QString( "%1 (Avg. correlation: %2)" ).arg( name ).arg( corr, 5, 'f', 2 ), name ) ); + } + } + + return options; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimEnsembleWellLogCurveSet::updateFilterLegend() +{ + RimWellLogPlot* plot; + firstAncestorOrThisOfType( plot ); + // if ( plot && plot->viewer() ) + // { + // if ( m_curveFilters()->isActive() && m_curveFilters()->countActiveFilters() > 0 ) + // { + // if ( !m_filterOverlayFrame ) + // { + // m_filterOverlayFrame = + // new RiuDraggableOverlayFrame( plot->viewer()->canvas(), plot->viewer()->overlayMargins() ); + // } + // m_filterOverlayFrame->setContentFrame( m_curveFilters()->makeFilterDescriptionFrame() ); + // plot->viewer()->addOverlayFrame( m_filterOverlayFrame ); + // } + // else + // { + // if ( m_filterOverlayFrame ) + // { + // plot->viewer()->removeOverlayFrame( m_filterOverlayFrame ); + // } + // } + // plot->viewer()->scheduleReplot(); + // } +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimEnsembleWellLogCurveSet::updateCurveColors() +{ + if ( m_colorMode == ColorMode::BY_ENSEMBLE_PARAM ) + { + QString parameterName = m_ensembleParameter(); + + { + QString legendTitle; + if ( m_isUsingAutoName ) + { + legendTitle = m_autoGeneratedName(); + } + else + { + legendTitle += m_userDefinedName(); + } + + legendTitle += "\n"; + legendTitle += parameterName; + + m_legendConfig->setTitle( legendTitle ); + } + + // if ( group && !parameterName.isEmpty() && !group->allSummaryCases().empty() ) + // { + // auto ensembleParam = group->ensembleParameter( parameterName ); + // if ( ensembleParam.isText() || ensembleParam.isNumeric() ) + // { + // RimEnsembleCurveSetColorManager::initializeLegendConfig( m_legendConfig, ensembleParam ); + // // for ( auto& curve : m_curves ) + // // { + // // // if ( curve->summaryAddressY().category() == + // // RifEclipseSummaryAddress::SUMMARY_ENSEMBLE_STATISTICS ) + // // // continue; + // // // RimSummaryCase* rimCase = curve->summaryCaseY(); + // // // cvf::Color3f curveColor = + // // // RimEnsembleWellLogCurveSetColorManager::caseColor( m_legendConfig, rimCase, + // ensembleParam + // // ); + // // // curve->setColor( curveColor ); + // // // curve->updateCurveAppearance(); + // // } + // } + // } + } + else if ( m_colorMode == ColorMode::SINGLE_COLOR ) + { + for ( auto& curve : m_curves ) + { + // Statistics curves have separate color settings + if ( dynamic_cast( curve.p() ) == nullptr ) + { + curve->setColor( m_color ); + curve->updateCurveAppearance(); + } + } + } + + RimWellLogTrack* plotTrack; + firstAncestorOrThisOfType( plotTrack ); + if ( plotTrack && plotTrack->viewer() ) + { + // if ( m_yValuesSummaryCaseCollection() && isCurvesVisible() && m_colorMode != ColorMode::SINGLE_COLOR && + // m_legendConfig->showLegend() ) + // { + // if ( !m_legendOverlayFrame ) + // { + // m_legendOverlayFrame = + // new RiuDraggableOverlayFrame( plot->viewer()->canvas(), plot->viewer()->overlayMargins() ); + // } + // m_legendOverlayFrame->setContentFrame( m_legendConfig->makeLegendFrame() ); + // plot->viewer()->addOverlayFrame( m_legendOverlayFrame ); + // } + // else + // { + // if ( m_legendOverlayFrame ) + // { + // plot->viewer()->removeOverlayFrame( m_legendOverlayFrame ); + // } + // } + plotTrack->viewer()->scheduleReplot(); + } +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +// void RimEnsembleWellLogCurveSet::updateQwtPlotAxis() +// { +// // for ( RimWellLogCurve* curve : curves() ) +// // { +// // curve->updateQwtPlotAxis(); +// // } +// } + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimEnsembleWellLogCurveSet::updateEnsembleCurves( const std::vector& sumCases ) +{ + RimWellLogTrack* plotTrack = nullptr; + firstAncestorOrThisOfType( plotTrack ); + CVF_ASSERT( plotTrack ); + + RimWellLogPlot* wellLogPlot = nullptr; + firstAncestorOrThisOfType( wellLogPlot ); + CVF_ASSERT( wellLogPlot ); + + deleteEnsembleCurves(); + // m_qwtPlotCurveForLegendText->detach(); + deleteStatisticsCurves(); + + if ( m_statistics->hideEnsembleCurves() ) return; + + QString wellLogChannelName = m_wellLogChannelName(); + if ( plotTrack && wellLogChannelName != "None" ) + { + if ( isCurvesVisible() ) + { + bool isFirst = true; + + for ( auto& wellLogFile : sumCases ) + { + RimWellLogFileCurve* curve = new RimWellLogFileCurve; + plotTrack->addCurve( curve ); + + QString errorMessage; + if ( wellLogFile->readFile( &errorMessage ) ) + { + RigWellLogFile* wellLogDataFile = wellLogFile->wellLogFileData(); + CVF_ASSERT( wellLogDataFile ); + + if ( isFirst ) + { + // Initialize plot with depth unit from the first log file + wellLogPlot->setDepthUnit( wellLogDataFile->depthUnit() ); + isFirst = false; + } + } + else + { + RiaLogging::warning( errorMessage ); + } + + RimWellPath* wellPath = RimProject::current()->wellPathByName( wellLogFile->wellName() ); + curve->setWellPath( wellPath ); + curve->setWellLogChannelName( wellLogChannelName ); + curve->setWellLogFile( wellLogFile ); + + curve->loadDataAndUpdate( true ); + + curve->updateCurveVisibility(); + + m_curves.push_back( curve ); + } + + updateCurveColors(); + } + } +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimEnsembleWellLogCurveSet::updateStatisticsCurves( const std::vector& sumCases ) +{ + RimEnsembleWellLogs* ensembleWellLogs = m_ensembleWellLogs; + QString wellLogChannelName = m_wellLogChannelName(); + + if ( !isCurvesVisible() || m_disableStatisticCurves || !ensembleWellLogs || wellLogChannelName == "None" ) return; + + // Calculate + { + std::vector wellLogFiles = sumCases; + if ( wellLogFiles.empty() ) + { + if ( m_statistics->basedOnFilteredCases() ) + wellLogFiles = filterEnsembleCases( ensembleWellLogs->wellLogFiles() ); + else + wellLogFiles = ensembleWellLogs->wellLogFiles(); + } + + m_ensembleWellLogStatistics->calculate( wellLogFiles, wellLogChannelName ); + } + + RimWellLogPlot* plot = nullptr; + firstAncestorOrThisOfType( plot ); + CVF_ASSERT( plot ); + + std::vector statisticsTypes; + if ( m_statistics->isActive() ) + { + if ( m_statistics->showP10Curve() && m_ensembleWellLogStatistics->hasP10Data() ) + statisticsTypes.push_back( RimEnsembleWellLogStatistics::StatisticsType::P10 ); + if ( m_statistics->showP50Curve() && m_ensembleWellLogStatistics->hasP50Data() ) + statisticsTypes.push_back( RimEnsembleWellLogStatistics::StatisticsType::P50 ); + if ( m_statistics->showP90Curve() && m_ensembleWellLogStatistics->hasP90Data() ) + statisticsTypes.push_back( RimEnsembleWellLogStatistics::StatisticsType::P90 ); + if ( m_statistics->showMeanCurve() && m_ensembleWellLogStatistics->hasMeanData() ) + statisticsTypes.push_back( RimEnsembleWellLogStatistics::StatisticsType::MEAN ); + } + + auto statisticsCurveSymbolFromStatistics = []( RimEnsembleWellLogStatistics::StatisticsType statisticsType ) { + if ( statisticsType == RimEnsembleWellLogStatistics::StatisticsType::P10 ) return RiuQwtSymbol::SYMBOL_TRIANGLE; + if ( statisticsType == RimEnsembleWellLogStatistics::StatisticsType::P90 ) + return RiuQwtSymbol::SYMBOL_DOWN_TRIANGLE; + if ( statisticsType == RimEnsembleWellLogStatistics::StatisticsType::P50 ) return RiuQwtSymbol::SYMBOL_DIAMOND; + return RiuQwtSymbol::SYMBOL_ELLIPSE; + }; + + RimWellLogTrack* plotTrack = nullptr; + firstAncestorOrThisOfType( plotTrack ); + CVF_ASSERT( plotTrack ); + + deleteStatisticsCurves(); + for ( auto statisticsType : statisticsTypes ) + { + auto curve = new RimEnsembleWellLogStatisticsCurve(); + curve->setEnsembleWellLogCurveSet( this ); + curve->setStatisticsType( statisticsType ); + + m_curves.push_back( curve ); + curve->setColor( m_statistics->color() ); + + auto symbol = statisticsCurveSymbolFromStatistics( statisticsType ); + curve->setSymbol( symbol ); + curve->setSymbolSize( statisticsCurveSymbolSize( symbol ) ); + curve->setSymbolSkipDistance( 150 ); + if ( m_statistics->showCurveLabels() ) + { + curve->setSymbolLabel( caf::AppEnum::uiText( statisticsType ) ); + } + curve->setLineStyle( RiuQwtPlotCurveDefines::LineStyleEnum::STYLE_SOLID ); + + plotTrack->addCurve( curve ); + + curve->updateCurveVisibility(); + curve->loadDataAndUpdate( false ); + } +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimEnsembleWellLogCurveSet::updateStatisticsCurves() +{ + updateStatisticsCurves( std::vector() ); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RimEnsembleWellLogCurveSet* RimEnsembleWellLogCurveSet::clone() const +{ + RimEnsembleWellLogCurveSet* copy = dynamic_cast( + this->xmlCapability()->copyByXmlSerialization( caf::PdmDefaultObjectFactory::instance() ) ); + return copy; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimEnsembleWellLogCurveSet::showCurves( bool show ) +{ + m_showCurves = show; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimEnsembleWellLogCurveSet::updateAllTextInPlot() +{ + updateEnsembleLegendItem(); + + // RimWellLogTrack* summaryPlot = nullptr; + // this->firstAncestorOrThisOfTypeAsserted( summaryPlot ); + // if ( summaryPlot->viewer() ) + // { + // summaryPlot->u + // } +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +std::vector RimEnsembleWellLogCurveSet::variationSortedEnsembleParameters() const +{ + // RimSummaryCaseCollection* ensemble = m_yValuesSummaryCaseCollection; + // if ( ensemble ) + // { + // return ensemble->variationSortedEnsembleParameters(); + // } + // else + // { + return std::vector(); + //} +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +std::vector> RimEnsembleWellLogCurveSet::correlationSortedEnsembleParameters() const +{ + // RimSummaryCaseCollection* ensemble = m_yValuesSummaryCaseCollection; + // if ( ensemble ) + // { + // return ensemble->correlationSortedEnsembleParameters( summaryAddress() ); + // } + // else + // { + return std::vector>(); + //} +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +std::vector + RimEnsembleWellLogCurveSet::filterEnsembleCases( const std::vector& wellLogFiles ) +{ + auto filteredCases = wellLogFiles; + + // TODO: implement filtering.. + // for ( auto& filter : m_curveFilters->filters() ) + // { + // filteredCases = filter->applyFilter( filteredCases ); + // } + return wellLogFiles; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimEnsembleWellLogCurveSet::disableStatisticCurves() +{ + m_disableStatisticCurves = true; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +bool RimEnsembleWellLogCurveSet::isFiltered() const +{ + return m_isCurveSetFiltered; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +bool RimEnsembleWellLogCurveSet::hasP10Data() const +{ + return m_ensembleWellLogStatistics->hasP10Data(); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +bool RimEnsembleWellLogCurveSet::hasP50Data() const +{ + return m_ensembleWellLogStatistics->hasP50Data(); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +bool RimEnsembleWellLogCurveSet::hasP90Data() const +{ + return m_ensembleWellLogStatistics->hasP90Data(); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +bool RimEnsembleWellLogCurveSet::hasMeanData() const +{ + return m_ensembleWellLogStatistics->hasMeanData(); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +const RimEnsembleWellLogStatistics* RimEnsembleWellLogCurveSet::ensembleWellLogStatistics() const +{ + return m_ensembleWellLogStatistics.get(); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimEnsembleWellLogCurveSet::updateEnsembleLegendItem() +{ + m_qwtPlotCurveForLegendText->setTitle( name() ); + + { + QwtSymbol* symbol = nullptr; + + if ( m_colorMode == ColorMode::SINGLE_COLOR ) + { + symbol = new QwtSymbol( QwtSymbol::HLine ); + + QColor curveColor( m_color.value().rByte(), m_color.value().gByte(), m_color.value().bByte() ); + QPen curvePen( curveColor ); + curvePen.setWidth( 2 ); + + symbol->setPen( curvePen ); + symbol->setSize( 6, 6 ); + } + else if ( m_colorMode == ColorMode::BY_ENSEMBLE_PARAM ) + { + QPixmap p = QPixmap( ":/Legend.png" ); + + symbol = new QwtSymbol; + symbol->setPixmap( p ); + symbol->setSize( 8, 8 ); + } + + m_qwtPlotCurveForLegendText->setSymbol( symbol ); + } + + bool showLegendItem = isCurvesVisible(); + m_qwtPlotCurveForLegendText->setItemAttribute( QwtPlotItem::Legend, showLegendItem ); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +QString RimEnsembleWellLogCurveSet::name() const +{ + QString curveSetName; + if ( m_isUsingAutoName ) + { + curveSetName = m_autoGeneratedName(); + } + else + { + curveSetName += m_userDefinedName(); + } + + return curveSetName; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +QString RimEnsembleWellLogCurveSet::createAutoName() const +{ + QStringList nameParts; + + if ( m_ensembleWellLogs() ) + { + nameParts.append( m_ensembleWellLogs->name() ); + nameParts.append( m_wellLogChannelName() ); + } + + if ( !nameParts.isEmpty() ) + return nameParts.join( " - " ); + else + return "Ensemble Well Log Curve Set"; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimEnsembleWellLogCurveSet::updateLegendMappingMode() +{ + switch ( currentEnsembleParameterType() ) + { + case RigEnsembleParameter::TYPE_TEXT: + if ( m_legendConfig->mappingMode() != RimRegularLegendConfig::MappingType::CATEGORY_INTEGER ) + m_legendConfig->setMappingMode( RimRegularLegendConfig::MappingType::CATEGORY_INTEGER ); + break; + + case RigEnsembleParameter::TYPE_NUMERIC: + if ( m_legendConfig->mappingMode() == RimRegularLegendConfig::MappingType::CATEGORY_INTEGER ) + m_legendConfig->setMappingMode( RimRegularLegendConfig::MappingType::LINEAR_CONTINUOUS ); + break; + } +} diff --git a/ApplicationLibCode/ProjectDataModel/RimEnsembleWellLogCurveSet.h b/ApplicationLibCode/ProjectDataModel/RimEnsembleWellLogCurveSet.h new file mode 100644 index 0000000000..a458b8c5c2 --- /dev/null +++ b/ApplicationLibCode/ProjectDataModel/RimEnsembleWellLogCurveSet.h @@ -0,0 +1,187 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2021- Equinor ASA +// +// ResInsight is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// + +#pragma once + +#include "RiaDefines.h" + +#include "RimEnsembleCurveSetColorManager.h" +#include "RimEnsembleCurveSetInterface.h" +#include "RimRegularLegendConfig.h" + +#include "RigEnsembleParameter.h" + +#include "cafAppEnum.h" +#include "cafPdmChildArrayField.h" +#include "cafPdmChildField.h" +#include "cafPdmField.h" +#include "cafPdmFieldCvfColor.h" +#include "cafPdmObject.h" +#include "cafPdmProxyValueField.h" +#include "cafPdmPtrArrayField.h" +#include "cafPdmPtrField.h" + +#include + +class RimEnsembleWellLogs; +class RimEnsembleWellLogsCollection; +class RimEnsembleCurveFilterCollection; +class RimEnsembleStatistics; +class RimEnsembleStatisticsCase; +class RimWellLogCurve; +class RimWellLogFile; +class RimEnsembleWellLogStatistics; + +class RiuDraggableOverlayFrame; + +class QwtPlot; +class QwtPlotCurve; +class QKeyEvent; +class QFrame; +class QDate; + +//================================================================================================== +/// +//================================================================================================== +class RimEnsembleWellLogCurveSet : public caf::PdmObject, public RimEnsembleCurveSetInterface +{ + CAF_PDM_HEADER_INIT; + +public: + using ColorMode = RimEnsembleCurveSetColorManager::ColorMode; + using ColorModeEnum = RimEnsembleCurveSetColorManager::ColorModeEnum; + +public: + RimEnsembleWellLogCurveSet(); + ~RimEnsembleWellLogCurveSet() override; + + caf::Signal<> filterChanged; + + QString name() const; + + bool isCurvesVisible(); + void setColor( cvf::Color3f color ); + + void loadDataAndUpdate( bool updateParentPlot ); + void setParentQwtPlotNoReplot( QwtPlot* plot ); + void detachQwtCurves(); + void reattachQwtCurves(); + + void addCurve( RimWellLogCurve* curve ); + void deleteCurve( RimWellLogCurve* curve ); + + std::vector curves() const; + + void deleteEnsembleCurves(); + void deleteStatisticsCurves(); + + void onLegendDefinitionChanged(); + + void setSummaryCaseCollection( RimSummaryCaseCollection* sumCaseCollection ); + RimSummaryCaseCollection* summaryCaseCollection() const; + + RimEnsembleCurveFilterCollection* filterCollection() const; + + ColorMode colorMode() const; + void setColorMode( ColorMode mode ); + void setEnsembleParameter( const QString& parameterName ); + RigEnsembleParameter::Type currentEnsembleParameterType() const; + + RimRegularLegendConfig* legendConfig(); + + void updateEnsembleLegendItem(); + RiuDraggableOverlayFrame* legendFrame() const; + + RimEnsembleWellLogCurveSet* clone() const; + void showCurves( bool show ); + + void updateAllTextInPlot(); + std::vector variationSortedEnsembleParameters() const; + + std::vector> correlationSortedEnsembleParameters() const; + + std::vector filterEnsembleCases( const std::vector& sumCases ); + void disableStatisticCurves(); + bool isFiltered() const; + + void updateEditors() override; + void updateAllCurves() override; + void updateStatisticsCurves() override; + bool hasP10Data() const override; + bool hasP50Data() const override; + bool hasP90Data() const override; + bool hasMeanData() const override; + + void appendColorGroup( caf::PdmUiOrdering& uiOrdering ); + + void updateFilterLegend(); + + const RimEnsembleWellLogStatistics* ensembleWellLogStatistics() const; + +private: + void updateEnsembleCurves( const std::vector& curves ); + void updateStatisticsCurves( const std::vector& curves ); + + caf::PdmFieldHandle* userDescriptionField() override; + caf::PdmFieldHandle* objectToggleField() override; + + QList calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions, + bool* useOptionsOnly ) override; + + void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override; + + void defineUiTreeOrdering( caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName = "" ) override; + + void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) override; + + QString createAutoName() const; + + void updateLegendMappingMode(); + void updateMaxMinAndDefaultValues(); + void updateCurveColors(); + +private: + caf::PdmField m_showCurves; + + caf::PdmPtrArrayField m_curves; + caf::PdmPointer m_currentWellLogCurve; + + caf::PdmField m_colorMode; + caf::PdmField m_color; + caf::PdmField m_ensembleParameter; + + caf::PdmChildField m_legendConfig; + caf::PdmChildField m_curveFilters; + caf::PdmChildField m_statistics; + + caf::PdmField m_isUsingAutoName; + caf::PdmField m_userDefinedName; + caf::PdmProxyValueField m_autoGeneratedName; + + caf::PdmPtrField m_ensembleWellLogs; + caf::PdmField m_wellLogChannelName; + + QwtPlotCurve* m_qwtPlotCurveForLegendText; + QPointer m_legendOverlayFrame; + QPointer m_filterOverlayFrame; + + std::unique_ptr m_ensembleWellLogStatistics; + + bool m_disableStatisticCurves; + bool m_isCurveSetFiltered; +}; diff --git a/ApplicationLibCode/ProjectDataModel/RimEnsembleWellLogStatistics.cpp b/ApplicationLibCode/ProjectDataModel/RimEnsembleWellLogStatistics.cpp new file mode 100644 index 0000000000..382a6e327c --- /dev/null +++ b/ApplicationLibCode/ProjectDataModel/RimEnsembleWellLogStatistics.cpp @@ -0,0 +1,197 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2017- Statoil ASA +// +// ResInsight is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// + +#include "RimEnsembleWellLogStatistics.h" + +#include "RiaCurveMerger.h" +#include "RiaWeightedMeanCalculator.h" + +#include "RigStatisticsMath.h" +#include "RigWellLogFile.h" + +#include "RimWellLogFile.h" + +#include "cafAppEnum.h" + +namespace caf +{ +template <> +void caf::AppEnum::setUp() +{ + addItem( RimEnsembleWellLogStatistics::StatisticsType::P10, "P10", "P10" ); + addItem( RimEnsembleWellLogStatistics::StatisticsType::P50, "P50", "P50" ); + addItem( RimEnsembleWellLogStatistics::StatisticsType::P90, "P90", "P90" ); + addItem( RimEnsembleWellLogStatistics::StatisticsType::MEAN, "MEAN", "Mean" ); + + setDefault( RimEnsembleWellLogStatistics::StatisticsType::MEAN ); +} +}; // namespace caf + +RimEnsembleWellLogStatistics::RimEnsembleWellLogStatistics() +{ +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimEnsembleWellLogStatistics::calculate( const std::vector& wellLogFiles, + const QString& wellLogChannelName ) +{ + RiaCurveMerger curveMerger; + + RiaWeightedMeanCalculator dataSetSizeCalc; + + for ( RimWellLogFile* wellLogFile : wellLogFiles ) + { + QString errorMessage; + if ( wellLogFile->readFile( &errorMessage ) ) + { + RigWellLogFile* fileData = wellLogFile->wellLogFileData(); + std::vector depths = fileData->depthValues(); + std::vector values = fileData->values( wellLogChannelName ); + if ( !depths.empty() && !values.empty() ) + { + dataSetSizeCalc.addValueAndWeight( depths.size(), 1.0 ); + curveMerger.addCurveData( depths, values ); + } + } + } + curveMerger.computeInterpolatedValues( false ); + + clearData(); + + const std::vector& allDepths = curveMerger.allXValues(); + if ( !allDepths.empty() ) + { + // Make sure we end up with approximately the same amount of points as originally + // Since allDepths contain *valid* values, it can potentially be smaller than the mean. + // Thus we need to ensure sizeMultiplier is at least 1. + size_t sizeMultiplier = std::max( (size_t)1, allDepths.size() / dataSetSizeCalc.weightedMean() ); + for ( size_t depthIdx = 0; depthIdx < allDepths.size(); depthIdx += sizeMultiplier ) + { + std::vector valuesAtDepth; + valuesAtDepth.reserve( curveMerger.curveCount() ); + for ( size_t curveIdx = 0; curveIdx < curveMerger.curveCount(); ++curveIdx ) + { + const std::vector& curveValues = curveMerger.interpolatedYValuesForAllXValues( curveIdx ); + valuesAtDepth.push_back( curveValues[depthIdx] ); + } + double p10, p50, p90, mean; + RigStatisticsMath::calculateStatisticsCurves( valuesAtDepth, &p10, &p50, &p90, &mean ); + + m_measuredDepths.push_back( allDepths[depthIdx] ); + m_p10Data.push_back( p10 ); + m_p50Data.push_back( p50 ); + m_p90Data.push_back( p90 ); + m_meanData.push_back( mean ); + } + } +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +const std::vector& RimEnsembleWellLogStatistics::measuredDepths() const +{ + return m_measuredDepths; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +const std::vector& RimEnsembleWellLogStatistics::tvDepths() const +{ + return m_tvDepths; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +const std::vector& RimEnsembleWellLogStatistics::p10() const +{ + return m_p10Data; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +const std::vector& RimEnsembleWellLogStatistics::p50() const +{ + return m_p50Data; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +const std::vector& RimEnsembleWellLogStatistics::p90() const +{ + return m_p90Data; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +const std::vector& RimEnsembleWellLogStatistics::mean() const +{ + return m_meanData; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +bool RimEnsembleWellLogStatistics::hasP10Data() const +{ + return !m_p10Data.empty(); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +bool RimEnsembleWellLogStatistics::hasP50Data() const +{ + return !m_p50Data.empty(); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +bool RimEnsembleWellLogStatistics::hasP90Data() const +{ + return !m_p90Data.empty(); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +bool RimEnsembleWellLogStatistics::hasMeanData() const +{ + return !m_meanData.empty(); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimEnsembleWellLogStatistics::clearData() +{ + m_measuredDepths.clear(); + m_tvDepths.clear(); + m_p10Data.clear(); + m_p50Data.clear(); + m_p90Data.clear(); + m_meanData.clear(); +} diff --git a/ApplicationLibCode/ProjectDataModel/RimEnsembleWellLogStatistics.h b/ApplicationLibCode/ProjectDataModel/RimEnsembleWellLogStatistics.h new file mode 100644 index 0000000000..65c73f147c --- /dev/null +++ b/ApplicationLibCode/ProjectDataModel/RimEnsembleWellLogStatistics.h @@ -0,0 +1,66 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2021- Equinor ASA +// +// ResInsight is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// + +#pragma once + +#include + +class QString; + +class RimWellLogFile; + +//================================================================================================== +/// +//================================================================================================== +class RimEnsembleWellLogStatistics +{ +public: + enum class StatisticsType + { + P10, + P50, + P90, + MEAN + }; + + RimEnsembleWellLogStatistics(); + + const std::vector& measuredDepths() const; + const std::vector& tvDepths() const; + const std::vector& p10() const; + const std::vector& p50() const; + const std::vector& p90() const; + const std::vector& mean() const; + + bool hasP10Data() const; + bool hasP50Data() const; + bool hasP90Data() const; + bool hasMeanData() const; + + void calculate( const std::vector& sumCases, const QString& wellLogChannelName ); + +private: + void clearData(); + + std::vector m_measuredDepths; + std::vector m_tvDepths; + std::vector m_p10Data; + std::vector m_p50Data; + std::vector m_p90Data; + std::vector m_meanData; +}; diff --git a/ApplicationLibCode/ProjectDataModel/RimEnsembleWellLogStatisticsCurve.cpp b/ApplicationLibCode/ProjectDataModel/RimEnsembleWellLogStatisticsCurve.cpp new file mode 100644 index 0000000000..8e095fa584 --- /dev/null +++ b/ApplicationLibCode/ProjectDataModel/RimEnsembleWellLogStatisticsCurve.cpp @@ -0,0 +1,174 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2021- Equinor ASA +// +// ResInsight is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// ResInsight is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// + +#include "RimEnsembleWellLogStatisticsCurve.h" + +#include "RiaApplication.h" +#include "RiaDefines.h" +#include "RiaInterpolationTools.h" +#include "RiaLogging.h" + +#include "RimEnsembleWellLogCurveSet.h" +#include "RimWellLogTrack.h" +#include "RimWellPath.h" + +#include "RiuQwtPlotCurve.h" +#include "RiuQwtPlotWidget.h" + +#include "cafPdmUiTreeOrdering.h" + +CAF_PDM_SOURCE_INIT( RimEnsembleWellLogStatisticsCurve, "EnsembleWellLogStatisticsCurve" ); + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RimEnsembleWellLogStatisticsCurve::RimEnsembleWellLogStatisticsCurve() +{ + CAF_PDM_InitObject( "Ensemble Well Log Statistics Curve", "", "", "" ); + + CAF_PDM_InitFieldNoDefault( &m_ensembleWellLogCurveSet, "EnsembleWellLogCurveSet", "Ensemble Well Log Curve Set", "", "", "" ); + m_ensembleWellLogCurveSet.uiCapability()->setUiTreeChildrenHidden( true ); + m_ensembleWellLogCurveSet.uiCapability()->setUiHidden( true ); + + CAF_PDM_InitFieldNoDefault( &m_statisticsType, "StatisticsType", "Statistics Type", "", "", "" ); + m_statisticsType.uiCapability()->setUiHidden( true ); + + m_wellPath = nullptr; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RimEnsembleWellLogStatisticsCurve::~RimEnsembleWellLogStatisticsCurve() +{ +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimEnsembleWellLogStatisticsCurve::setEnsembleWellLogCurveSet( RimEnsembleWellLogCurveSet* ensembleWellLogCurveSet ) +{ + m_ensembleWellLogCurveSet = ensembleWellLogCurveSet; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimEnsembleWellLogStatisticsCurve::setStatisticsType( RimEnsembleWellLogStatistics::StatisticsType statisticsType ) +{ + m_statisticsType = statisticsType; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RimEnsembleWellLogStatistics::StatisticsType RimEnsembleWellLogStatisticsCurve::statisticsType() const +{ + return m_statisticsType(); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimEnsembleWellLogStatisticsCurve::fieldChangedByUi( const caf::PdmFieldHandle* changedField, + const QVariant& oldValue, + const QVariant& newValue ) +{ + // RimWellLogExtractionCurve::fieldChangedByUi( changedField, oldValue, newValue ); + // RimStimPlanModelPlot* ensembleWellLogCurveSetPlot; + // firstAncestorOrThisOfTypeAsserted( ensembleWellLogCurveSetPlot ); + + // if ( ensembleWellLogCurveSetPlot ) + // { + // ensembleWellLogCurveSetPlot->loadDataAndUpdate(); + // } +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimEnsembleWellLogStatisticsCurve::performDataExtraction( bool* isUsingPseudoLength ) +{ + std::vector values; + std::vector measuredDepthValues; + std::vector tvDepthValues; + double rkbDiff = 0.0; + + // TODO: get if from the file??? + RiaDefines::DepthUnitType depthUnit = RiaDefines::DepthUnitType::UNIT_FEET; // METER; + QString xUnits = RiaWellLogUnitTools::noUnitString(); + + *isUsingPseudoLength = false; + + if ( m_ensembleWellLogCurveSet ) + { + const RimEnsembleWellLogStatistics* ensembleWellLogStatistics = + m_ensembleWellLogCurveSet->ensembleWellLogStatistics(); + + if ( m_statisticsType == RimEnsembleWellLogStatistics::StatisticsType::MEAN ) + { + values = ensembleWellLogStatistics->mean(); + measuredDepthValues = ensembleWellLogStatistics->measuredDepths(); + } + else if ( m_statisticsType == RimEnsembleWellLogStatistics::StatisticsType::P10 ) + { + values = ensembleWellLogStatistics->mean(); + measuredDepthValues = ensembleWellLogStatistics->measuredDepths(); + } + else if ( m_statisticsType == RimEnsembleWellLogStatistics::StatisticsType::P50 ) + { + values = ensembleWellLogStatistics->p50(); + measuredDepthValues = ensembleWellLogStatistics->measuredDepths(); + } + else if ( m_statisticsType == RimEnsembleWellLogStatistics::StatisticsType::P90 ) + { + values = ensembleWellLogStatistics->p90(); + measuredDepthValues = ensembleWellLogStatistics->measuredDepths(); + } + + // RiaDefines::EclipseUnitSystem eclipseUnitsType = eclipseCase->eclipseCaseData()->unitsType(); + // if ( eclipseUnitsType == RiaDefines::EclipseUnitSystem::UNITS_FIELD ) + // { + // // See https://github.com/OPM/ResInsight/issues/538 + + // depthUnit = RiaDefines::DepthUnitType::UNIT_FEET; + // } + } + + bool performDataSmoothing = false; + if ( !values.empty() && !measuredDepthValues.empty() && measuredDepthValues.size() == values.size() ) + { + this->setValuesAndDepths( values, + measuredDepthValues, + RiaDefines::DepthTypeEnum::MEASURED_DEPTH, + rkbDiff, + depthUnit, + !performDataSmoothing, + xUnits ); + // this->setValuesWithMdAndTVD( values, measuredDepthValues, tvDepthValues, rkbDiff, depthUnit, + // !performDataSmoothing, xUnits ); + } +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +QString RimEnsembleWellLogStatisticsCurve::createCurveAutoName() +{ + return caf::AppEnum::uiText( m_statisticsType() ); +} diff --git a/ApplicationLibCode/ProjectDataModel/RimEnsembleWellLogStatisticsCurve.h b/ApplicationLibCode/ProjectDataModel/RimEnsembleWellLogStatisticsCurve.h new file mode 100644 index 0000000000..463eaa1e4f --- /dev/null +++ b/ApplicationLibCode/ProjectDataModel/RimEnsembleWellLogStatisticsCurve.h @@ -0,0 +1,56 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2021- Equinor ASA +// +// ResInsight is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// ResInsight is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// + +#pragma once + +#include "RimEnsembleWellLogStatistics.h" +#include "RimWellLogExtractionCurve.h" + +#include "cafPdmField.h" +#include "cafPdmPtrField.h" + +#include + +class RimEnsembleWellLogCurveSet; + +//================================================================================================== +/// +//================================================================================================== +class RimEnsembleWellLogStatisticsCurve : public RimWellLogExtractionCurve +{ + CAF_PDM_HEADER_INIT; + +public: + RimEnsembleWellLogStatisticsCurve(); + ~RimEnsembleWellLogStatisticsCurve() override; + + void setEnsembleWellLogCurveSet( RimEnsembleWellLogCurveSet* ensembleWellLogCurveSet ); + + void setStatisticsType( RimEnsembleWellLogStatistics::StatisticsType ); + RimEnsembleWellLogStatistics::StatisticsType statisticsType() const; + +protected: + void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) override; + + void performDataExtraction( bool* isUsingPseudoLength ) override; + + QString createCurveAutoName() override; + + caf::PdmPtrField m_ensembleWellLogCurveSet; + caf::PdmField> m_statisticsType; +}; diff --git a/ApplicationLibCode/ProjectDataModel/RimEnsembleWellLogs.cpp b/ApplicationLibCode/ProjectDataModel/RimEnsembleWellLogs.cpp index 4c958fb480..1f19635588 100644 --- a/ApplicationLibCode/ProjectDataModel/RimEnsembleWellLogs.cpp +++ b/ApplicationLibCode/ProjectDataModel/RimEnsembleWellLogs.cpp @@ -51,3 +51,19 @@ void RimEnsembleWellLogs::addWellLogFile( RimWellLogFile* summaryCase ) { m_wellLogFiles.push_back( summaryCase ); } + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +std::vector RimEnsembleWellLogs::wellLogFiles() const +{ + return m_wellLogFiles().childObjects(); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +bool RimEnsembleWellLogs::hasEnsembleParameters() const +{ + return false; +} diff --git a/ApplicationLibCode/ProjectDataModel/RimEnsembleWellLogs.h b/ApplicationLibCode/ProjectDataModel/RimEnsembleWellLogs.h index 38cb9485ca..9dfcf08e7a 100644 --- a/ApplicationLibCode/ProjectDataModel/RimEnsembleWellLogs.h +++ b/ApplicationLibCode/ProjectDataModel/RimEnsembleWellLogs.h @@ -36,6 +36,10 @@ class RimEnsembleWellLogs : public RimNamedObject void removeWellLogFile( RimWellLogFile* wellLogFile ); void addWellLogFile( RimWellLogFile* wellLogFile ); + std::vector wellLogFiles() const; + + bool hasEnsembleParameters() const; + protected: void updateReferringCurveSets(); diff --git a/ApplicationLibCode/ProjectDataModel/RimWellLogTrack.cpp b/ApplicationLibCode/ProjectDataModel/RimWellLogTrack.cpp index c2f84d5807..b61d7f0bee 100644 --- a/ApplicationLibCode/ProjectDataModel/RimWellLogTrack.cpp +++ b/ApplicationLibCode/ProjectDataModel/RimWellLogTrack.cpp @@ -49,6 +49,7 @@ #include "RimColorLegendItem.h" #include "RimEclipseCase.h" #include "RimEclipseResultDefinition.h" +#include "RimEnsembleWellLogCurveSet.h" #include "RimFishbones.h" #include "RimFishbonesCollection.h" #include "RimGeoMechCase.h" @@ -269,6 +270,14 @@ RimWellLogTrack::RimWellLogTrack() m_resultDefinition.uiCapability()->setUiTreeChildrenHidden( true ); m_resultDefinition = new RimEclipseResultDefinition; + CAF_PDM_InitFieldNoDefault( &m_ensembleWellLogCurveSet, + "EnsembleWellLogCurveSet", + "Ensemble Well Logs Curve Set", + "", + "", + "" ); + m_ensembleWellLogCurveSet = new RimEnsembleWellLogCurveSet; + m_formationsForCaseWithSimWellOnly = false; } @@ -1034,6 +1043,9 @@ QList RimWellLogTrack::calculateValueOptions( const caf: { RimTools::colorLegendOptionItems( &options ); } + else if ( fieldNeedingOptions == &m_ensembleWellLogCurveSet ) + { + } return options; } @@ -1799,6 +1811,8 @@ void RimWellLogTrack::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering componentGroup->add( &m_wellPathComponentSource ); + uiOrdering.add( &m_ensembleWellLogCurveSet ); + uiOrderingForXAxisSettings( uiOrdering ); uiOrdering.skipRemainingFields( true ); diff --git a/ApplicationLibCode/ProjectDataModel/RimWellLogTrack.h b/ApplicationLibCode/ProjectDataModel/RimWellLogTrack.h index 4f70305ece..48c241ed16 100644 --- a/ApplicationLibCode/ProjectDataModel/RimWellLogTrack.h +++ b/ApplicationLibCode/ProjectDataModel/RimWellLogTrack.h @@ -57,6 +57,7 @@ class RigFemResultAddress; class RigWellLogExtractor; class RimEclipseResultDefinition; class RimColorLegend; +class RimEnsembleWellLogCurveSet; class QwtPlotCurve; @@ -345,6 +346,7 @@ class RimWellLogTrack : public RimPlot caf::PdmChildField m_resultDefinition; caf::PdmField m_overburdenHeight; caf::PdmField m_underburdenHeight; + caf::PdmChildField m_ensembleWellLogCurveSet; std::vector> m_wellPathAttributePlotObjects; From 5660f780b6bc1be0a6f5baec604757a88752cd75 Mon Sep 17 00:00:00 2001 From: Kristian Bendiksen Date: Wed, 9 Jun 2021 16:13:15 +0200 Subject: [PATCH 039/308] #7716 Use units from las files --- .../RimEnsembleWellLogStatistics.cpp | 42 +++++++++++++++++-- .../RimEnsembleWellLogStatistics.h | 18 +++++--- .../RimEnsembleWellLogStatisticsCurve.cpp | 39 +++++++---------- 3 files changed, 65 insertions(+), 34 deletions(-) diff --git a/ApplicationLibCode/ProjectDataModel/RimEnsembleWellLogStatistics.cpp b/ApplicationLibCode/ProjectDataModel/RimEnsembleWellLogStatistics.cpp index 382a6e327c..dd0a8eec51 100644 --- a/ApplicationLibCode/ProjectDataModel/RimEnsembleWellLogStatistics.cpp +++ b/ApplicationLibCode/ProjectDataModel/RimEnsembleWellLogStatistics.cpp @@ -19,7 +19,10 @@ #include "RimEnsembleWellLogStatistics.h" #include "RiaCurveMerger.h" +#include "RiaDefines.h" +#include "RiaLogging.h" #include "RiaWeightedMeanCalculator.h" +#include "RiaWellLogUnitTools.h" #include "RigStatisticsMath.h" #include "RigWellLogFile.h" @@ -44,6 +47,8 @@ void caf::AppEnum::setUp() RimEnsembleWellLogStatistics::RimEnsembleWellLogStatistics() { + m_depthUnit = RiaDefines::DepthUnitType::UNIT_NONE; + m_logChannelUnitString = RiaWellLogUnitTools::noUnitString(); } //-------------------------------------------------------------------------------------------------- @@ -61,9 +66,24 @@ void RimEnsembleWellLogStatistics::calculate( const std::vector QString errorMessage; if ( wellLogFile->readFile( &errorMessage ) ) { - RigWellLogFile* fileData = wellLogFile->wellLogFileData(); - std::vector depths = fileData->depthValues(); - std::vector values = fileData->values( wellLogChannelName ); + RigWellLogFile* fileData = wellLogFile->wellLogFileData(); + RiaDefines::DepthUnitType depthUnitInFile = fileData->depthUnit(); + if ( m_depthUnit != RiaDefines::DepthUnitType::UNIT_NONE && m_depthUnit != depthUnitInFile ) + { + RiaLogging::error( QString( "Unexpected depth unit in file %1." ).arg( wellLogFile->fileName() ) ); + } + m_depthUnit = depthUnitInFile; + + QString logChannelUnitString = fileData->wellLogChannelUnitString( wellLogChannelName ); + if ( m_logChannelUnitString != RiaWellLogUnitTools::noUnitString() && + m_logChannelUnitString != logChannelUnitString ) + { + RiaLogging::error( QString( "Unexpected unit in file %1." ).arg( wellLogFile->fileName() ) ); + } + m_logChannelUnitString = logChannelUnitString; + + std::vector depths = fileData->depthValues(); + std::vector values = fileData->values( wellLogChannelName ); if ( !depths.empty() && !values.empty() ) { dataSetSizeCalc.addValueAndWeight( depths.size(), 1.0 ); @@ -195,3 +215,19 @@ void RimEnsembleWellLogStatistics::clearData() m_p90Data.clear(); m_meanData.clear(); } + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RiaDefines::DepthUnitType RimEnsembleWellLogStatistics::depthUnitType() const +{ + return m_depthUnit; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +QString RimEnsembleWellLogStatistics::logChannelUnitString() const +{ + return m_logChannelUnitString; +} diff --git a/ApplicationLibCode/ProjectDataModel/RimEnsembleWellLogStatistics.h b/ApplicationLibCode/ProjectDataModel/RimEnsembleWellLogStatistics.h index 65c73f147c..01cd11817e 100644 --- a/ApplicationLibCode/ProjectDataModel/RimEnsembleWellLogStatistics.h +++ b/ApplicationLibCode/ProjectDataModel/RimEnsembleWellLogStatistics.h @@ -18,6 +18,8 @@ #pragma once +#include "RiaDefines.h" + #include class QString; @@ -46,6 +48,8 @@ class RimEnsembleWellLogStatistics const std::vector& p50() const; const std::vector& p90() const; const std::vector& mean() const; + QString logChannelUnitString() const; + RiaDefines::DepthUnitType depthUnitType() const; bool hasP10Data() const; bool hasP50Data() const; @@ -57,10 +61,12 @@ class RimEnsembleWellLogStatistics private: void clearData(); - std::vector m_measuredDepths; - std::vector m_tvDepths; - std::vector m_p10Data; - std::vector m_p50Data; - std::vector m_p90Data; - std::vector m_meanData; + QString m_logChannelUnitString; + RiaDefines::DepthUnitType m_depthUnit; + std::vector m_measuredDepths; + std::vector m_tvDepths; + std::vector m_p10Data; + std::vector m_p50Data; + std::vector m_p90Data; + std::vector m_meanData; }; diff --git a/ApplicationLibCode/ProjectDataModel/RimEnsembleWellLogStatisticsCurve.cpp b/ApplicationLibCode/ProjectDataModel/RimEnsembleWellLogStatisticsCurve.cpp index 8e095fa584..e69d2b89f2 100644 --- a/ApplicationLibCode/ProjectDataModel/RimEnsembleWellLogStatisticsCurve.cpp +++ b/ApplicationLibCode/ProjectDataModel/RimEnsembleWellLogStatisticsCurve.cpp @@ -109,10 +109,6 @@ void RimEnsembleWellLogStatisticsCurve::performDataExtraction( bool* isUsingPseu std::vector tvDepthValues; double rkbDiff = 0.0; - // TODO: get if from the file??? - RiaDefines::DepthUnitType depthUnit = RiaDefines::DepthUnitType::UNIT_FEET; // METER; - QString xUnits = RiaWellLogUnitTools::noUnitString(); - *isUsingPseudoLength = false; if ( m_ensembleWellLogCurveSet ) @@ -120,6 +116,9 @@ void RimEnsembleWellLogStatisticsCurve::performDataExtraction( bool* isUsingPseu const RimEnsembleWellLogStatistics* ensembleWellLogStatistics = m_ensembleWellLogCurveSet->ensembleWellLogStatistics(); + RiaDefines::DepthUnitType depthUnit = ensembleWellLogStatistics->depthUnitType(); + QString xUnits = ensembleWellLogStatistics->logChannelUnitString(); + if ( m_statisticsType == RimEnsembleWellLogStatistics::StatisticsType::MEAN ) { values = ensembleWellLogStatistics->mean(); @@ -141,27 +140,17 @@ void RimEnsembleWellLogStatisticsCurve::performDataExtraction( bool* isUsingPseu measuredDepthValues = ensembleWellLogStatistics->measuredDepths(); } - // RiaDefines::EclipseUnitSystem eclipseUnitsType = eclipseCase->eclipseCaseData()->unitsType(); - // if ( eclipseUnitsType == RiaDefines::EclipseUnitSystem::UNITS_FIELD ) - // { - // // See https://github.com/OPM/ResInsight/issues/538 - - // depthUnit = RiaDefines::DepthUnitType::UNIT_FEET; - // } - } - - bool performDataSmoothing = false; - if ( !values.empty() && !measuredDepthValues.empty() && measuredDepthValues.size() == values.size() ) - { - this->setValuesAndDepths( values, - measuredDepthValues, - RiaDefines::DepthTypeEnum::MEASURED_DEPTH, - rkbDiff, - depthUnit, - !performDataSmoothing, - xUnits ); - // this->setValuesWithMdAndTVD( values, measuredDepthValues, tvDepthValues, rkbDiff, depthUnit, - // !performDataSmoothing, xUnits ); + bool performDataSmoothing = false; + if ( !values.empty() && !measuredDepthValues.empty() && measuredDepthValues.size() == values.size() ) + { + this->setValuesAndDepths( values, + measuredDepthValues, + RiaDefines::DepthTypeEnum::MEASURED_DEPTH, + rkbDiff, + depthUnit, + !performDataSmoothing, + xUnits ); + } } } From a5bc8605261c7f41a22b8453ff51b657587606cb Mon Sep 17 00:00:00 2001 From: Kristian Bendiksen Date: Fri, 11 Jun 2021 16:04:18 +0200 Subject: [PATCH 040/308] #7716 Ensemble Well Logs: use filters from summary ensemble curve set. --- .../RimEnsembleWellLogCurveSet.cpp | 148 +++++++++++++----- .../RimEnsembleWellLogCurveSet.h | 3 + .../Summary/RimEnsembleCurveSet.cpp | 8 + .../Summary/RimEnsembleCurveSet.h | 2 + 4 files changed, 119 insertions(+), 42 deletions(-) diff --git a/ApplicationLibCode/ProjectDataModel/RimEnsembleWellLogCurveSet.cpp b/ApplicationLibCode/ProjectDataModel/RimEnsembleWellLogCurveSet.cpp index 7b1453ebb4..49d012d060 100644 --- a/ApplicationLibCode/ProjectDataModel/RimEnsembleWellLogCurveSet.cpp +++ b/ApplicationLibCode/ProjectDataModel/RimEnsembleWellLogCurveSet.cpp @@ -28,7 +28,9 @@ #include "RiaSummaryCurveDefinition.h" #include "RiaTimeTTools.h" +#include "RimEnsembleCurveSet.h" #include "RimEnsembleWellLogStatisticsCurve.h" +#include "RimMainPlotCollection.h" #include "RimOilField.h" #include "RimProject.h" #include "RimRegularLegendConfig.h" @@ -106,6 +108,8 @@ RimEnsembleWellLogCurveSet::RimEnsembleWellLogCurveSet() CAF_PDM_InitFieldNoDefault( &m_wellLogChannelName, "WellLogChannelName", "Well Log Channel Name", "", "", "" ); + CAF_PDM_InitFieldNoDefault( &m_ensembleCurveSet, "FilterEnsembleCurveSet", "Filter by Ensemble Curve Set", "", "", "" ); + CAF_PDM_InitField( &m_colorMode, "ColorMode", caf::AppEnum( ColorMode::SINGLE_COLOR ), "Coloring Mode", "", "", "" ); CAF_PDM_InitField( &m_color, "Color", RiaColorTools::textColor3f(), "Color", "", "", "" ); @@ -439,7 +443,7 @@ void RimEnsembleWellLogCurveSet::updateAllCurves() m_isCurveSetFiltered = filteredCases.size() < allWellLogFiles.size(); - updateEnsembleCurves( allWellLogFiles ); + updateEnsembleCurves( filteredCases ); updateStatisticsCurves( m_statistics->basedOnFilteredCases() ? filteredCases : allWellLogFiles ); } @@ -485,6 +489,13 @@ void RimEnsembleWellLogCurveSet::fieldChangedByUi( const caf::PdmFieldHandle* ch updateTextInPlot = true; } + else if ( changedField == &m_ensembleCurveSet ) + { + updateAllCurves(); + + loadDataAndUpdate( true ); + updateTextInPlot = true; + } else if ( changedField == &m_wellLogChannelName ) { updateAllCurves(); @@ -545,6 +556,7 @@ void RimEnsembleWellLogCurveSet::defineUiOrdering( QString uiConfigName, caf::Pd { uiOrdering.add( &m_ensembleWellLogs ); uiOrdering.add( &m_wellLogChannelName ); + uiOrdering.add( &m_ensembleCurveSet ); appendColorGroup( uiOrdering ); @@ -687,6 +699,18 @@ QList options.push_back( caf::PdmOptionItemInfo( "None", "None" ) ); } } + else if ( fieldNeedingOptions == &m_ensembleCurveSet ) + { + options.push_back( caf::PdmOptionItemInfo( "None", nullptr ) ); + + RimMainPlotCollection* mainPlotColl = RimProject::current()->mainPlotCollection(); + std::vector ensembleCurveSets; + mainPlotColl->descendantsOfType( ensembleCurveSets ); + for ( auto ensembleCurveSet : ensembleCurveSets ) + { + options.push_back( caf::PdmOptionItemInfo( ensembleCurveSet->name(), ensembleCurveSet ) ); + } + } else if ( fieldNeedingOptions == &m_colorMode ) { auto singleColorOption = ColorModeEnum( ColorMode::SINGLE_COLOR ); @@ -720,29 +744,30 @@ QList //-------------------------------------------------------------------------------------------------- void RimEnsembleWellLogCurveSet::updateFilterLegend() { - RimWellLogPlot* plot; - firstAncestorOrThisOfType( plot ); - // if ( plot && plot->viewer() ) - // { - // if ( m_curveFilters()->isActive() && m_curveFilters()->countActiveFilters() > 0 ) - // { - // if ( !m_filterOverlayFrame ) - // { - // m_filterOverlayFrame = - // new RiuDraggableOverlayFrame( plot->viewer()->canvas(), plot->viewer()->overlayMargins() ); - // } - // m_filterOverlayFrame->setContentFrame( m_curveFilters()->makeFilterDescriptionFrame() ); - // plot->viewer()->addOverlayFrame( m_filterOverlayFrame ); - // } - // else - // { - // if ( m_filterOverlayFrame ) - // { - // plot->viewer()->removeOverlayFrame( m_filterOverlayFrame ); - // } - // } - // plot->viewer()->scheduleReplot(); - // } + RimWellLogTrack* plotTrack; + firstAncestorOrThisOfType( plotTrack ); + + if ( plotTrack && plotTrack->viewer() ) + { + if ( m_ensembleCurveSet != nullptr && m_ensembleCurveSet->isFiltered() ) + { + if ( !m_filterOverlayFrame ) + { + m_filterOverlayFrame = + new RiuDraggableOverlayFrame( plotTrack->viewer()->canvas(), plotTrack->viewer()->overlayMargins() ); + } + m_filterOverlayFrame->setContentFrame( m_ensembleCurveSet->curveFilters()->makeFilterDescriptionFrame() ); + plotTrack->viewer()->addOverlayFrame( m_filterOverlayFrame ); + } + else + { + if ( m_filterOverlayFrame ) + { + plotTrack->viewer()->removeOverlayFrame( m_filterOverlayFrame ); + } + } + plotTrack->viewer()->scheduleReplot(); + } } //-------------------------------------------------------------------------------------------------- @@ -832,17 +857,6 @@ void RimEnsembleWellLogCurveSet::updateCurveColors() } } -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -// void RimEnsembleWellLogCurveSet::updateQwtPlotAxis() -// { -// // for ( RimWellLogCurve* curve : curves() ) -// // { -// // curve->updateQwtPlotAxis(); -// // } -// } - //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- @@ -1068,14 +1082,64 @@ std::vector> RimEnsembleWellLogCurveSet: std::vector RimEnsembleWellLogCurveSet::filterEnsembleCases( const std::vector& wellLogFiles ) { - auto filteredCases = wellLogFiles; + std::vector filteredCases; - // TODO: implement filtering.. - // for ( auto& filter : m_curveFilters->filters() ) - // { - // filteredCases = filter->applyFilter( filteredCases ); - // } - return wellLogFiles; + if ( m_ensembleCurveSet != nullptr && m_statistics->basedOnFilteredCases() ) + { // && m_ensembleCurveSet->isFiltered() ) + RiaLogging::debug( QString( "FILTERING ENSEMBLE CASES" ) ); + + // Get the summary cases from the related ensemble summary curve set. + RimSummaryCaseCollection* summaryCaseCollection = m_ensembleCurveSet->summaryCaseCollection(); + + // + std::vector sumCases = + m_ensembleCurveSet->filterEnsembleCases( summaryCaseCollection->allSummaryCases() ); + for ( auto sumCase : sumCases ) + { + for ( auto wellLogFile : wellLogFiles ) + { + if ( isSameRealization( sumCase, wellLogFile ) ) + { + filteredCases.push_back( wellLogFile ); + } + } + } + } + else + { + RiaLogging::debug( QString( "NOT FILTERING ENSEMBLE CASES" ) ); + + filteredCases = wellLogFiles; + } + + return filteredCases; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +bool RimEnsembleWellLogCurveSet::isSameRealization( RimSummaryCase* summaryCase, RimWellLogFile* wellLogFile ) const +{ + QString wellLogFileName = wellLogFile->fileName(); + + // + if ( summaryCase->hasCaseRealizationParameters() ) + { + // TODO: make less naive.. + int realizationNumber = summaryCase->caseRealizationParameters()->realizationNumber(); + QString summaryCaseFileName = summaryCase->summaryHeaderFilename(); + + if ( wellLogFileName.contains( QString( "realization-%1" ).arg( realizationNumber ) ) ) + { + RiaLogging::debug( + QString( "Matching summary case %1 with well log file %2" ).arg( summaryCaseFileName ).arg( wellLogFileName ) ); + + return true; + } + } + + RiaLogging::debug( QString( "No matching summary case found for well log file: %1." ).arg( wellLogFileName ) ); + return false; } //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationLibCode/ProjectDataModel/RimEnsembleWellLogCurveSet.h b/ApplicationLibCode/ProjectDataModel/RimEnsembleWellLogCurveSet.h index a458b8c5c2..9e77c09506 100644 --- a/ApplicationLibCode/ProjectDataModel/RimEnsembleWellLogCurveSet.h +++ b/ApplicationLibCode/ProjectDataModel/RimEnsembleWellLogCurveSet.h @@ -155,6 +155,8 @@ class RimEnsembleWellLogCurveSet : public caf::PdmObject, public RimEnsembleCurv void updateMaxMinAndDefaultValues(); void updateCurveColors(); + bool isSameRealization( RimSummaryCase* summaryCase, RimWellLogFile* wellLogFile ) const; + private: caf::PdmField m_showCurves; @@ -175,6 +177,7 @@ class RimEnsembleWellLogCurveSet : public caf::PdmObject, public RimEnsembleCurv caf::PdmPtrField m_ensembleWellLogs; caf::PdmField m_wellLogChannelName; + caf::PdmPtrField m_ensembleCurveSet; QwtPlotCurve* m_qwtPlotCurveForLegendText; QPointer m_legendOverlayFrame; diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimEnsembleCurveSet.cpp b/ApplicationLibCode/ProjectDataModel/Summary/RimEnsembleCurveSet.cpp index a647822dba..ccaa9ae0b7 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimEnsembleCurveSet.cpp +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimEnsembleCurveSet.cpp @@ -927,6 +927,14 @@ void RimEnsembleCurveSet::updateMaxMinAndDefaultValues() } } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +const RimEnsembleCurveFilterCollection* RimEnsembleCurveSet::curveFilters() const +{ + return m_curveFilters; +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimEnsembleCurveSet.h b/ApplicationLibCode/ProjectDataModel/Summary/RimEnsembleCurveSet.h index 2a9b7f42f0..393a61c3df 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimEnsembleCurveSet.h +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimEnsembleCurveSet.h @@ -155,6 +155,8 @@ class RimEnsembleCurveSet : public caf::PdmObject, public RimEnsembleCurveSetInt static void appendOptionItemsForSummaryAddresses( QList* options, RimSummaryCaseCollection* summaryCaseGroup ); + const RimEnsembleCurveFilterCollection* curveFilters() const; + void updateFilterLegend(); void updateObjectiveFunctionLegend(); From 3c784e9549c652d3f390796c55c86484ae979d37 Mon Sep 17 00:00:00 2001 From: Kristian Bendiksen Date: Mon, 21 Jun 2021 11:53:02 +0200 Subject: [PATCH 041/308] #7716 Ensemble Well Logs: Use colors from ensemble curve set --- .../RimEnsembleWellLogCurveSet.cpp | 348 ++++++------------ .../RimEnsembleWellLogCurveSet.h | 43 +-- .../Summary/RimEnsembleCurveSet.cpp | 181 +++++---- .../Summary/RimEnsembleCurveSet.h | 4 + 4 files changed, 230 insertions(+), 346 deletions(-) diff --git a/ApplicationLibCode/ProjectDataModel/RimEnsembleWellLogCurveSet.cpp b/ApplicationLibCode/ProjectDataModel/RimEnsembleWellLogCurveSet.cpp index 49d012d060..3a07e80696 100644 --- a/ApplicationLibCode/ProjectDataModel/RimEnsembleWellLogCurveSet.cpp +++ b/ApplicationLibCode/ProjectDataModel/RimEnsembleWellLogCurveSet.cpp @@ -19,21 +19,19 @@ #include "RimEnsembleWellLogCurveSet.h" #include "RiaColorTools.h" -#include "RiaGuiApplication.h" #include "RiaLogging.h" -#include "RiaPreferences.h" -#include "RiaResultNames.h" -#include "RiaStatisticsTools.h" -#include "RiaSummaryCurveAnalyzer.h" -#include "RiaSummaryCurveDefinition.h" -#include "RiaTimeTTools.h" +#include "RimEnsembleCurveFilter.h" +#include "RimEnsembleCurveFilterCollection.h" #include "RimEnsembleCurveSet.h" +#include "RimEnsembleStatistics.h" +#include "RimEnsembleWellLogStatistics.h" #include "RimEnsembleWellLogStatisticsCurve.h" +#include "RimEnsembleWellLogs.h" +#include "RimEnsembleWellLogsCollection.h" #include "RimMainPlotCollection.h" #include "RimOilField.h" #include "RimProject.h" -#include "RimRegularLegendConfig.h" #include "RimWellLogCurve.h" #include "RimWellLogFile.h" #include "RimWellLogFileChannel.h" @@ -41,16 +39,6 @@ #include "RimWellLogPlot.h" #include "RimWellLogTrack.h" -#include "RimEnsembleCurveFilter.h" -#include "RimEnsembleCurveFilterCollection.h" -#include "RimEnsembleCurveSetCollection.h" -#include "RimEnsembleCurveSetColorManager.h" -#include "RimEnsembleStatistics.h" -#include "RimEnsembleStatisticsCase.h" -#include "RimEnsembleWellLogStatistics.h" -#include "RimEnsembleWellLogs.h" -#include "RimEnsembleWellLogsCollection.h" - #include "RiuAbstractLegendFrame.h" #include "RiuDraggableOverlayFrame.h" #include "RiuPlotMainWindow.h" @@ -66,13 +54,6 @@ #include "cafPdmUiPushButtonEditor.h" #include "cafPdmUiSliderEditor.h" #include "cafPdmUiTreeOrdering.h" -#include "cafPdmUiTreeSelectionEditor.h" -#include "cafTitledOverlayFrame.h" - -// TODO: remove? -#include "RifEnsembleStatisticsReader.h" - -// #include "cvfScalarMapper.h" #include "qwt_plot_curve.h" #include "qwt_symbol.h" @@ -85,6 +66,19 @@ //-------------------------------------------------------------------------------------------------- int statisticsCurveSymbolSize( RiuQwtSymbol::PointSymbolEnum symbol ); +namespace caf +{ +template <> +void AppEnum::setUp() +{ + addItem( RimEnsembleWellLogCurveSet::ColorMode::SINGLE_COLOR, "SINGLE_COLOR", "Single Color" ); + addItem( RimEnsembleWellLogCurveSet::ColorMode::COLOR_BY_ENSEMBLE_CURVE_SET, + "BY_ENSEMBLE_CURVE_SET", + "Color by Ensemble Curve Set" ); + setDefault( RimEnsembleWellLogCurveSet::ColorMode::SINGLE_COLOR ); +} +}; // namespace caf + CAF_PDM_SOURCE_INIT( RimEnsembleWellLogCurveSet, "RimEnsembleWellLogCurveSet" ); //-------------------------------------------------------------------------------------------------- @@ -114,19 +108,6 @@ RimEnsembleWellLogCurveSet::RimEnsembleWellLogCurveSet() CAF_PDM_InitField( &m_color, "Color", RiaColorTools::textColor3f(), "Color", "", "", "" ); - CAF_PDM_InitField( &m_ensembleParameter, "EnsembleParameter", QString( "" ), "Ensemble Parameter", "", "", "" ); - m_ensembleParameter.uiCapability()->setUiEditorTypeName( caf::PdmUiListEditor::uiEditorTypeName() ); - - CAF_PDM_InitFieldNoDefault( &m_legendConfig, "LegendConfig", "", "", "", "" ); - m_legendConfig = new RimRegularLegendConfig(); - m_legendConfig->setColorLegend( - RimRegularLegendConfig::mapToColorLegend( RimEnsembleCurveSetColorManager::DEFAULT_ENSEMBLE_COLOR_RANGE ) ); - - CAF_PDM_InitFieldNoDefault( &m_curveFilters, "CurveFilters", "Curve Filters", "", "", "" ); - m_curveFilters = new RimEnsembleCurveFilterCollection(); - m_curveFilters->setUiTreeHidden( true ); - m_curveFilters->uiCapability()->setUiTreeHidden( true ); - CAF_PDM_InitFieldNoDefault( &m_statistics, "Statistics", "Statistics", "", "", "" ); m_statistics = new RimEnsembleStatistics( this ); m_statistics.uiCapability()->setUiTreeHidden( true ); @@ -203,8 +184,6 @@ void RimEnsembleWellLogCurveSet::setColor( cvf::Color3f color ) //-------------------------------------------------------------------------------------------------- void RimEnsembleWellLogCurveSet::loadDataAndUpdate( bool updateParentPlot ) { - m_curveFilters->loadDataAndUpdate(); - updateAllCurves(); updateFilterLegend(); @@ -354,14 +333,6 @@ void RimEnsembleWellLogCurveSet::deleteStatisticsCurves() } } -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -RimRegularLegendConfig* RimEnsembleWellLogCurveSet::legendConfig() -{ - return m_legendConfig; -} - //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- @@ -378,14 +349,6 @@ void RimEnsembleWellLogCurveSet::onLegendDefinitionChanged() updateCurveColors(); } -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -RimEnsembleCurveFilterCollection* RimEnsembleWellLogCurveSet::filterCollection() const -{ - return m_curveFilters; -} - //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- @@ -402,33 +365,6 @@ void RimEnsembleWellLogCurveSet::setColorMode( ColorMode mode ) m_colorMode = mode; } -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -void RimEnsembleWellLogCurveSet::setEnsembleParameter( const QString& parameterName ) -{ - m_ensembleParameter = parameterName; -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -RigEnsembleParameter::Type RimEnsembleWellLogCurveSet::currentEnsembleParameterType() const -{ - if ( m_colorMode() == ColorMode::BY_ENSEMBLE_PARAM ) - { - // RimSummaryCaseCollection* group = m_yValuesSummaryCaseCollection(); - // QString parameterName = m_ensembleParameter(); - - // if ( group && !parameterName.isEmpty() ) - // { - // auto eParam = group->ensembleParameter( parameterName ); - // return eParam.type; - // } - } - return RigEnsembleParameter::TYPE_NONE; -} - //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- @@ -491,8 +427,8 @@ void RimEnsembleWellLogCurveSet::fieldChangedByUi( const caf::PdmFieldHandle* ch } else if ( changedField == &m_ensembleCurveSet ) { + connectEnsembleCurveSetFilterSignals(); updateAllCurves(); - loadDataAndUpdate( true ); updateTextInPlot = true; } @@ -507,24 +443,8 @@ void RimEnsembleWellLogCurveSet::fieldChangedByUi( const caf::PdmFieldHandle* ch updateTextInPlot = true; } - else if ( changedField == &m_ensembleParameter ) - { - updateLegendMappingMode(); - updateCurveColors(); - } else if ( changedField == &m_colorMode ) { - m_ensembleParameter.uiCapability()->setUiHidden( m_colorMode() != ColorMode::BY_ENSEMBLE_PARAM ); - - if ( m_colorMode() == ColorMode::BY_ENSEMBLE_PARAM ) - { - if ( m_ensembleParameter().isEmpty() ) - { - auto params = variationSortedEnsembleParameters(); - m_ensembleParameter = !params.empty() ? params.front().name : ""; - } - } - updateCurveColors(); updateTextInPlot = true; @@ -592,10 +512,6 @@ void RimEnsembleWellLogCurveSet::appendColorGroup( caf::PdmUiOrdering& uiOrderin { colorsGroup->add( &m_color ); } - else if ( m_colorMode == ColorMode::BY_ENSEMBLE_PARAM ) - { - colorsGroup->add( &m_ensembleParameter ); - } } //-------------------------------------------------------------------------------------------------- @@ -604,16 +520,6 @@ void RimEnsembleWellLogCurveSet::appendColorGroup( caf::PdmUiOrdering& uiOrderin void RimEnsembleWellLogCurveSet::defineUiTreeOrdering( caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName /*= ""*/ ) { - if ( m_colorMode == ColorMode::BY_ENSEMBLE_PARAM ) - { - uiTreeOrdering.add( m_legendConfig() ); - } - - for ( auto filter : m_curveFilters->filters() ) - { - uiTreeOrdering.add( filter ); - } - uiTreeOrdering.skipRemainingChildren( true ); caf::IconProvider iconProvider = this->uiIconProvider(); @@ -713,26 +619,14 @@ QList } else if ( fieldNeedingOptions == &m_colorMode ) { - auto singleColorOption = ColorModeEnum( ColorMode::SINGLE_COLOR ); - auto byEnsParamOption = ColorModeEnum( ColorMode::BY_ENSEMBLE_PARAM ); + auto singleColorOption = caf::AppEnum( ColorMode::SINGLE_COLOR ); options.push_back( caf::PdmOptionItemInfo( singleColorOption.uiText(), ColorMode::SINGLE_COLOR ) ); - RimEnsembleWellLogs* ensembleWellLogs = m_ensembleWellLogs; - if ( ensembleWellLogs && ensembleWellLogs->hasEnsembleParameters() ) + if ( m_ensembleWellLogs && m_ensembleCurveSet ) { - options.push_back( caf::PdmOptionItemInfo( byEnsParamOption.uiText(), ColorMode::BY_ENSEMBLE_PARAM ) ); - } - } - else if ( fieldNeedingOptions == &m_ensembleParameter ) - { - auto params = correlationSortedEnsembleParameters(); - for ( const auto& paramCorrPair : params ) - { - QString name = paramCorrPair.first.name; - double corr = paramCorrPair.second; - options.push_back( - caf::PdmOptionItemInfo( QString( "%1 (Avg. correlation: %2)" ).arg( name ).arg( corr, 5, 'f', 2 ), name ) ); + auto byEnsembleOption = caf::AppEnum( ColorMode::COLOR_BY_ENSEMBLE_CURVE_SET ); + options.push_back( caf::PdmOptionItemInfo( byEnsembleOption.uiText(), ColorMode::COLOR_BY_ENSEMBLE_CURVE_SET ) ); } } @@ -773,50 +667,61 @@ void RimEnsembleWellLogCurveSet::updateFilterLegend() //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -void RimEnsembleWellLogCurveSet::updateCurveColors() +RimSummaryCase* RimEnsembleWellLogCurveSet::findMatchingSummaryCase( RimWellLogFileCurve* wellLogCurve ) const { - if ( m_colorMode == ColorMode::BY_ENSEMBLE_PARAM ) + RimSummaryCaseCollection* summaryCaseCollection = m_ensembleCurveSet->summaryCaseCollection(); + std::vector sumCases = summaryCaseCollection->allSummaryCases(); + for ( auto sumCase : sumCases ) { - QString parameterName = m_ensembleParameter(); + if ( isSameRealization( sumCase, wellLogCurve->wellLogFile() ) ) + { + return sumCase; + } + } + + return nullptr; +} +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimEnsembleWellLogCurveSet::updateCurveColors() +{ + if ( m_colorMode == ColorMode::COLOR_BY_ENSEMBLE_CURVE_SET ) + { + if ( m_ensembleCurveSet != nullptr ) { - QString legendTitle; - if ( m_isUsingAutoName ) - { - legendTitle = m_autoGeneratedName(); - } - else + // Fint the curves to color (skip the statistics) + std::vector curvesToColor; + std::vector summaryCases; + + for ( auto& curve : m_curves ) { - legendTitle += m_userDefinedName(); + // Statistics curves have separate color settings + if ( dynamic_cast( curve.p() ) == nullptr ) + { + // Look for a matching summary case + RimSummaryCase* summaryCase = + findMatchingSummaryCase( dynamic_cast( curve.p() ) ); + if ( summaryCase ) + { + summaryCases.push_back( summaryCase ); + curvesToColor.push_back( curve.p() ); + } + } } - legendTitle += "\n"; - legendTitle += parameterName; + // Get the colors + std::vector caseColors = m_ensembleCurveSet->generateColorsForCases( summaryCases ); - m_legendConfig->setTitle( legendTitle ); + // Apply the colors + if ( caseColors.size() != curvesToColor.size() ) return; + for ( size_t i = 0; i < curvesToColor.size(); i++ ) + { + curvesToColor[i]->setColor( caseColors[i] ); + curvesToColor[i]->updateCurveAppearance(); + } } - - // if ( group && !parameterName.isEmpty() && !group->allSummaryCases().empty() ) - // { - // auto ensembleParam = group->ensembleParameter( parameterName ); - // if ( ensembleParam.isText() || ensembleParam.isNumeric() ) - // { - // RimEnsembleCurveSetColorManager::initializeLegendConfig( m_legendConfig, ensembleParam ); - // // for ( auto& curve : m_curves ) - // // { - // // // if ( curve->summaryAddressY().category() == - // // RifEclipseSummaryAddress::SUMMARY_ENSEMBLE_STATISTICS ) - // // // continue; - // // // RimSummaryCase* rimCase = curve->summaryCaseY(); - // // // cvf::Color3f curveColor = - // // // RimEnsembleWellLogCurveSetColorManager::caseColor( m_legendConfig, rimCase, - // ensembleParam - // // ); - // // // curve->setColor( curveColor ); - // // // curve->updateCurveAppearance(); - // // } - // } - // } } else if ( m_colorMode == ColorMode::SINGLE_COLOR ) { @@ -835,24 +740,24 @@ void RimEnsembleWellLogCurveSet::updateCurveColors() firstAncestorOrThisOfType( plotTrack ); if ( plotTrack && plotTrack->viewer() ) { - // if ( m_yValuesSummaryCaseCollection() && isCurvesVisible() && m_colorMode != ColorMode::SINGLE_COLOR && - // m_legendConfig->showLegend() ) - // { - // if ( !m_legendOverlayFrame ) - // { - // m_legendOverlayFrame = - // new RiuDraggableOverlayFrame( plot->viewer()->canvas(), plot->viewer()->overlayMargins() ); - // } - // m_legendOverlayFrame->setContentFrame( m_legendConfig->makeLegendFrame() ); - // plot->viewer()->addOverlayFrame( m_legendOverlayFrame ); - // } - // else - // { - // if ( m_legendOverlayFrame ) - // { - // plot->viewer()->removeOverlayFrame( m_legendOverlayFrame ); - // } - // } + if ( m_colorMode != ColorMode::SINGLE_COLOR && m_ensembleCurveSet != nullptr && + m_ensembleCurveSet->colorMode() != RimEnsembleCurveSet::ColorMode::SINGLE_COLOR ) + { + if ( !m_legendOverlayFrame ) + { + m_legendOverlayFrame = + new RiuDraggableOverlayFrame( plotTrack->viewer()->canvas(), plotTrack->viewer()->overlayMargins() ); + } + m_legendOverlayFrame->setContentFrame( m_ensembleCurveSet->legendConfig()->makeLegendFrame() ); + plotTrack->viewer()->addOverlayFrame( m_legendOverlayFrame ); + } + else + { + if ( m_legendOverlayFrame ) + { + plotTrack->viewer()->removeOverlayFrame( m_legendOverlayFrame ); + } + } plotTrack->viewer()->scheduleReplot(); } } @@ -1001,6 +906,8 @@ void RimEnsembleWellLogCurveSet::updateStatisticsCurves( const std::vectorupdateCurveVisibility(); curve->loadDataAndUpdate( false ); } + + updateCurveColors(); } //-------------------------------------------------------------------------------------------------- @@ -1014,12 +921,12 @@ void RimEnsembleWellLogCurveSet::updateStatisticsCurves() //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -RimEnsembleWellLogCurveSet* RimEnsembleWellLogCurveSet::clone() const -{ - RimEnsembleWellLogCurveSet* copy = dynamic_cast( - this->xmlCapability()->copyByXmlSerialization( caf::PdmDefaultObjectFactory::instance() ) ); - return copy; -} +// RimEnsembleWellLogCurveSet* RimEnsembleWellLogCurveSet::clone() const +// { +// RimEnsembleWellLogCurveSet* copy = dynamic_cast( +// this->xmlCapability()->copyByXmlSerialization( caf::PdmDefaultObjectFactory::instance() ) ); +// return copy; +// } //-------------------------------------------------------------------------------------------------- /// @@ -1035,45 +942,6 @@ void RimEnsembleWellLogCurveSet::showCurves( bool show ) void RimEnsembleWellLogCurveSet::updateAllTextInPlot() { updateEnsembleLegendItem(); - - // RimWellLogTrack* summaryPlot = nullptr; - // this->firstAncestorOrThisOfTypeAsserted( summaryPlot ); - // if ( summaryPlot->viewer() ) - // { - // summaryPlot->u - // } -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -std::vector RimEnsembleWellLogCurveSet::variationSortedEnsembleParameters() const -{ - // RimSummaryCaseCollection* ensemble = m_yValuesSummaryCaseCollection; - // if ( ensemble ) - // { - // return ensemble->variationSortedEnsembleParameters(); - // } - // else - // { - return std::vector(); - //} -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -std::vector> RimEnsembleWellLogCurveSet::correlationSortedEnsembleParameters() const -{ - // RimSummaryCaseCollection* ensemble = m_yValuesSummaryCaseCollection; - // if ( ensemble ) - // { - // return ensemble->correlationSortedEnsembleParameters( summaryAddress() ); - // } - // else - // { - return std::vector>(); - //} } //-------------------------------------------------------------------------------------------------- @@ -1219,7 +1087,7 @@ void RimEnsembleWellLogCurveSet::updateEnsembleLegendItem() symbol->setPen( curvePen ); symbol->setSize( 6, 6 ); } - else if ( m_colorMode == ColorMode::BY_ENSEMBLE_PARAM ) + else if ( m_colorMode == ColorMode::COLOR_BY_ENSEMBLE_CURVE_SET ) { QPixmap p = QPixmap( ":/Legend.png" ); @@ -1275,18 +1143,18 @@ QString RimEnsembleWellLogCurveSet::createAutoName() const //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -void RimEnsembleWellLogCurveSet::updateLegendMappingMode() +void RimEnsembleWellLogCurveSet::connectEnsembleCurveSetFilterSignals() { - switch ( currentEnsembleParameterType() ) + if ( m_ensembleCurveSet() ) { - case RigEnsembleParameter::TYPE_TEXT: - if ( m_legendConfig->mappingMode() != RimRegularLegendConfig::MappingType::CATEGORY_INTEGER ) - m_legendConfig->setMappingMode( RimRegularLegendConfig::MappingType::CATEGORY_INTEGER ); - break; - - case RigEnsembleParameter::TYPE_NUMERIC: - if ( m_legendConfig->mappingMode() == RimRegularLegendConfig::MappingType::CATEGORY_INTEGER ) - m_legendConfig->setMappingMode( RimRegularLegendConfig::MappingType::LINEAR_CONTINUOUS ); - break; + m_ensembleCurveSet()->filterChanged.connect( this, &RimEnsembleWellLogCurveSet::onFilterSourceChanged ); } } + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimEnsembleWellLogCurveSet::onFilterSourceChanged( const caf::SignalEmitter* emitter ) +{ + if ( m_ensembleCurveSet() ) loadDataAndUpdate( true ); +} diff --git a/ApplicationLibCode/ProjectDataModel/RimEnsembleWellLogCurveSet.h b/ApplicationLibCode/ProjectDataModel/RimEnsembleWellLogCurveSet.h index 9e77c09506..7fd5110098 100644 --- a/ApplicationLibCode/ProjectDataModel/RimEnsembleWellLogCurveSet.h +++ b/ApplicationLibCode/ProjectDataModel/RimEnsembleWellLogCurveSet.h @@ -22,7 +22,6 @@ #include "RimEnsembleCurveSetColorManager.h" #include "RimEnsembleCurveSetInterface.h" -#include "RimRegularLegendConfig.h" #include "RigEnsembleParameter.h" @@ -44,6 +43,7 @@ class RimEnsembleCurveFilterCollection; class RimEnsembleStatistics; class RimEnsembleStatisticsCase; class RimWellLogCurve; +class RimWellLogFileCurve; class RimWellLogFile; class RimEnsembleWellLogStatistics; @@ -51,9 +51,6 @@ class RiuDraggableOverlayFrame; class QwtPlot; class QwtPlotCurve; -class QKeyEvent; -class QFrame; -class QDate; //================================================================================================== /// @@ -63,10 +60,12 @@ class RimEnsembleWellLogCurveSet : public caf::PdmObject, public RimEnsembleCurv CAF_PDM_HEADER_INIT; public: - using ColorMode = RimEnsembleCurveSetColorManager::ColorMode; - using ColorModeEnum = RimEnsembleCurveSetColorManager::ColorModeEnum; + enum class ColorMode + { + SINGLE_COLOR, + COLOR_BY_ENSEMBLE_CURVE_SET + }; -public: RimEnsembleWellLogCurveSet(); ~RimEnsembleWellLogCurveSet() override; @@ -95,14 +94,8 @@ class RimEnsembleWellLogCurveSet : public caf::PdmObject, public RimEnsembleCurv void setSummaryCaseCollection( RimSummaryCaseCollection* sumCaseCollection ); RimSummaryCaseCollection* summaryCaseCollection() const; - RimEnsembleCurveFilterCollection* filterCollection() const; - - ColorMode colorMode() const; - void setColorMode( ColorMode mode ); - void setEnsembleParameter( const QString& parameterName ); - RigEnsembleParameter::Type currentEnsembleParameterType() const; - - RimRegularLegendConfig* legendConfig(); + ColorMode colorMode() const; + void setColorMode( ColorMode mode ); void updateEnsembleLegendItem(); RiuDraggableOverlayFrame* legendFrame() const; @@ -110,10 +103,7 @@ class RimEnsembleWellLogCurveSet : public caf::PdmObject, public RimEnsembleCurv RimEnsembleWellLogCurveSet* clone() const; void showCurves( bool show ); - void updateAllTextInPlot(); - std::vector variationSortedEnsembleParameters() const; - - std::vector> correlationSortedEnsembleParameters() const; + void updateAllTextInPlot(); std::vector filterEnsembleCases( const std::vector& sumCases ); void disableStatisticCurves(); @@ -155,7 +145,11 @@ class RimEnsembleWellLogCurveSet : public caf::PdmObject, public RimEnsembleCurv void updateMaxMinAndDefaultValues(); void updateCurveColors(); - bool isSameRealization( RimSummaryCase* summaryCase, RimWellLogFile* wellLogFile ) const; + bool isSameRealization( RimSummaryCase* summaryCase, RimWellLogFile* wellLogFile ) const; + RimSummaryCase* findMatchingSummaryCase( RimWellLogFileCurve* wellLogCurve ) const; + + void connectEnsembleCurveSetFilterSignals(); + void onFilterSourceChanged( const caf::SignalEmitter* emitter ); private: caf::PdmField m_showCurves; @@ -163,13 +157,10 @@ class RimEnsembleWellLogCurveSet : public caf::PdmObject, public RimEnsembleCurv caf::PdmPtrArrayField m_curves; caf::PdmPointer m_currentWellLogCurve; - caf::PdmField m_colorMode; - caf::PdmField m_color; - caf::PdmField m_ensembleParameter; + caf::PdmField> m_colorMode; + caf::PdmField m_color; - caf::PdmChildField m_legendConfig; - caf::PdmChildField m_curveFilters; - caf::PdmChildField m_statistics; + caf::PdmChildField m_statistics; caf::PdmField m_isUsingAutoName; caf::PdmField m_userDefinedName; diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimEnsembleCurveSet.cpp b/ApplicationLibCode/ProjectDataModel/Summary/RimEnsembleCurveSet.cpp index ccaa9ae0b7..e2f3b82908 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimEnsembleCurveSet.cpp +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimEnsembleCurveSet.cpp @@ -1436,66 +1436,85 @@ ObjectiveFunctionTimeConfig RimEnsembleCurveSet::objectiveFunctionTimeConfig() c //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -void RimEnsembleCurveSet::updateCurveColors() +void RimEnsembleCurveSet::updateLegendTitle() { if ( m_colorMode == ColorMode::BY_ENSEMBLE_PARAM ) { - RimSummaryCaseCollection* group = m_yValuesSummaryCaseCollection(); - QString parameterName = m_ensembleParameter(); - { - QString legendTitle = "Ensemble Parameter"; - legendTitle += "\n"; - legendTitle += parameterName; + QString legendTitle = "Ensemble Parameter"; + legendTitle += "\n"; + legendTitle += parameterName; + + m_legendConfig->setTitle( legendTitle ); + } + else if ( m_colorMode == ColorMode::BY_OBJECTIVE_FUNCTION ) + { + QString legendTitle = "Objective Function"; + + legendTitle += "\n"; + legendTitle += caf::AppEnum( m_objectiveFunction()->functionType() ).uiText(); - m_legendConfig->setTitle( legendTitle ); + m_legendConfig->setTitle( legendTitle ); + } + else if ( m_colorMode == ColorMode::BY_CUSTOM_OBJECTIVE_FUNCTION ) + { + QString legendTitle = "Custom\nObjective Function"; + legendTitle += "\n"; + if ( m_customObjectiveFunction() && m_customObjectiveFunction()->isValid() ) + { + QString descriptions = m_customObjectiveFunction()->title(); + descriptions.truncate( 30 ); + legendTitle += descriptions; + if ( m_customObjectiveFunction()->title().length() > descriptions.length() ) + { + legendTitle += "..."; + } + } + else + { + legendTitle += "(Invalid Objective Function)"; } + m_legendConfig->setTitle( legendTitle ); + } +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +std::vector RimEnsembleCurveSet::generateColorsForCases( const std::vector& summaryCases ) const +{ + std::vector caseColors; + + if ( m_colorMode == ColorMode::BY_ENSEMBLE_PARAM ) + { + RimSummaryCaseCollection* group = m_yValuesSummaryCaseCollection(); + + QString parameterName = m_ensembleParameter(); + if ( group && !parameterName.isEmpty() && !group->allSummaryCases().empty() ) { auto ensembleParam = group->ensembleParameter( parameterName ); if ( ensembleParam.isText() || ensembleParam.isNumeric() ) { RimEnsembleCurveSetColorManager::initializeLegendConfig( m_legendConfig, ensembleParam ); - for ( auto& curve : m_curves ) + for ( auto& rimCase : summaryCases ) { - if ( curve->summaryAddressY().category() == RifEclipseSummaryAddress::SUMMARY_ENSEMBLE_STATISTICS ) - continue; - RimSummaryCase* rimCase = curve->summaryCaseY(); - cvf::Color3f curveColor = - RimEnsembleCurveSetColorManager::caseColor( m_legendConfig, rimCase, ensembleParam ); - curve->setColor( curveColor ); - curve->updateCurveAppearance(); + caseColors.push_back( + RimEnsembleCurveSetColorManager::caseColor( m_legendConfig, rimCase, ensembleParam ) ); } } } } else if ( m_colorMode == ColorMode::SINGLE_COLOR ) { - for ( auto& curve : m_curves ) - { - if ( curve->summaryAddressY().category() == RifEclipseSummaryAddress::SUMMARY_ENSEMBLE_STATISTICS ) - continue; - - curve->setColor( m_color ); - curve->updateCurveAppearance(); - } + caseColors.resize( summaryCases.size(), m_color ); } else if ( m_colorMode == ColorMode::BY_OBJECTIVE_FUNCTION ) { RimSummaryCaseCollection* group = m_yValuesSummaryCaseCollection(); - { - QString legendTitle = "Objective Function"; - - legendTitle += "\n"; - legendTitle += - caf::AppEnum( m_objectiveFunction()->functionType() ).uiText(); - - m_legendConfig->setTitle( legendTitle ); - } - if ( group && !group->allSummaryCases().empty() ) { auto objectiveFunction = m_objectiveFunction(); @@ -1504,25 +1523,20 @@ void RimEnsembleCurveSet::updateCurveColors() { summaryAddresses.push_back( address->address() ); } + + RimEnsembleCurveSetColorManager::initializeLegendConfig( m_legendConfig, + objectiveFunction, + group->allSummaryCases(), + summaryAddresses, + objectiveFunctionTimeConfig() ); + for ( auto& rimCase : summaryCases ) { - RimEnsembleCurveSetColorManager::initializeLegendConfig( m_legendConfig, - objectiveFunction, - group->allSummaryCases(), - summaryAddresses, - objectiveFunctionTimeConfig() ); - for ( auto& curve : m_curves ) - { - if ( curve->summaryAddressY().category() == RifEclipseSummaryAddress::SUMMARY_ENSEMBLE_STATISTICS ) - continue; - RimSummaryCase* rimCase = curve->summaryCaseY(); - cvf::Color3f curveColor = RimEnsembleCurveSetColorManager::caseColor( m_legendConfig, - rimCase, - objectiveFunction, - summaryAddresses, - objectiveFunctionTimeConfig() ); - curve->setColor( curveColor ); - curve->updateCurveAppearance(); - } + cvf::Color3f curveColor = RimEnsembleCurveSetColorManager::caseColor( m_legendConfig, + rimCase, + objectiveFunction, + summaryAddresses, + objectiveFunctionTimeConfig() ); + caseColors.push_back( curveColor ); } } } @@ -1530,44 +1544,51 @@ void RimEnsembleCurveSet::updateCurveColors() { RimSummaryCaseCollection* group = m_yValuesSummaryCaseCollection(); - { - QString legendTitle = "Custom\nObjective Function"; - legendTitle += "\n"; - if ( m_customObjectiveFunction() && m_customObjectiveFunction()->isValid() ) - { - QString descriptions = m_customObjectiveFunction()->title(); - descriptions.truncate( 30 ); - legendTitle += descriptions; - if ( m_customObjectiveFunction()->title().length() > descriptions.length() ) - { - legendTitle += "..."; - } - } - else - { - legendTitle += "(Invalid Objective Function)"; - } - - m_legendConfig->setTitle( legendTitle ); - } - if ( group && !group->allSummaryCases().empty() && m_customObjectiveFunction() && m_customObjectiveFunction->isValid() ) { RimEnsembleCurveSetColorManager::initializeLegendConfig( m_legendConfig, m_customObjectiveFunction() ); - for ( auto& curve : m_curves ) + for ( auto& rimCase : summaryCases ) { - if ( curve->summaryAddressY().category() == RifEclipseSummaryAddress::SUMMARY_ENSEMBLE_STATISTICS ) - continue; - RimSummaryCase* rimCase = curve->summaryCaseY(); - cvf::Color3f curveColor = + cvf::Color3f curveColor = RimEnsembleCurveSetColorManager::caseColor( m_legendConfig, rimCase, m_customObjectiveFunction() ); - curve->setColor( curveColor ); - curve->updateCurveAppearance(); + caseColors.push_back( curveColor ); } } } + return caseColors; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimEnsembleCurveSet::updateCurveColors() +{ + updateLegendTitle(); + + // Fint the curves to color (skip the statistics) + std::vector curvesToColor; + std::vector summaryCases; + for ( auto& curve : m_curves ) + { + if ( curve->summaryAddressY().category() == RifEclipseSummaryAddress::SUMMARY_ENSEMBLE_STATISTICS ) continue; + + curvesToColor.push_back( curve ); + summaryCases.push_back( curve->summaryCaseY() ); + } + + // Get the colors + std::vector caseColors = generateColorsForCases( summaryCases ); + + // Apply the colors + if ( caseColors.size() != curvesToColor.size() ) return; + for ( size_t i = 0; i < curvesToColor.size(); i++ ) + { + curvesToColor[i]->setColor( caseColors[i] ); + curvesToColor[i]->updateCurveAppearance(); + } + RimSummaryPlot* plot; firstAncestorOrThisOfType( plot ); if ( plot && plot->viewer() ) diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimEnsembleCurveSet.h b/ApplicationLibCode/ProjectDataModel/Summary/RimEnsembleCurveSet.h index 393a61c3df..ace38eb714 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimEnsembleCurveSet.h +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimEnsembleCurveSet.h @@ -162,6 +162,8 @@ class RimEnsembleCurveSet : public caf::PdmObject, public RimEnsembleCurveSetInt ObjectiveFunctionTimeConfig objectiveFunctionTimeConfig() const; + std::vector generateColorsForCases( const std::vector& summaryCases ) const; + private: void updateEnsembleCurves( const std::vector& sumCases ); void updateStatisticsCurves( const std::vector& sumCases ); @@ -189,6 +191,8 @@ class RimEnsembleCurveSet : public caf::PdmObject, public RimEnsembleCurveSetInt QString createAutoName() const; void updateLegendMappingMode(); + void updateLegendTitle(); + void updateMaxMinAndDefaultValues(); void updateCurveColors(); void updateTimeAnnotations(); From e6043fa329c697f02c98638dd348fac1f2a457b3 Mon Sep 17 00:00:00 2001 From: Kristian Bendiksen Date: Mon, 21 Jun 2021 15:22:56 +0200 Subject: [PATCH 042/308] #7716 Ensemble Well Logs: improve statistics curves --- .../RimEnsembleWellLogStatistics.cpp | 2 +- .../RimEnsembleWellLogStatisticsCurve.cpp | 52 ++++++++++++------- .../RimEnsembleWellLogStatisticsCurve.h | 4 +- 3 files changed, 37 insertions(+), 21 deletions(-) diff --git a/ApplicationLibCode/ProjectDataModel/RimEnsembleWellLogStatistics.cpp b/ApplicationLibCode/ProjectDataModel/RimEnsembleWellLogStatistics.cpp index dd0a8eec51..10ad5f9da7 100644 --- a/ApplicationLibCode/ProjectDataModel/RimEnsembleWellLogStatistics.cpp +++ b/ApplicationLibCode/ProjectDataModel/RimEnsembleWellLogStatistics.cpp @@ -91,7 +91,7 @@ void RimEnsembleWellLogStatistics::calculate( const std::vector } } } - curveMerger.computeInterpolatedValues( false ); + curveMerger.computeInterpolatedValues( true ); clearData(); diff --git a/ApplicationLibCode/ProjectDataModel/RimEnsembleWellLogStatisticsCurve.cpp b/ApplicationLibCode/ProjectDataModel/RimEnsembleWellLogStatisticsCurve.cpp index e69d2b89f2..9055ecb623 100644 --- a/ApplicationLibCode/ProjectDataModel/RimEnsembleWellLogStatisticsCurve.cpp +++ b/ApplicationLibCode/ProjectDataModel/RimEnsembleWellLogStatisticsCurve.cpp @@ -82,23 +82,6 @@ RimEnsembleWellLogStatistics::StatisticsType RimEnsembleWellLogStatisticsCurve:: return m_statisticsType(); } -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -void RimEnsembleWellLogStatisticsCurve::fieldChangedByUi( const caf::PdmFieldHandle* changedField, - const QVariant& oldValue, - const QVariant& newValue ) -{ - // RimWellLogExtractionCurve::fieldChangedByUi( changedField, oldValue, newValue ); - // RimStimPlanModelPlot* ensembleWellLogCurveSetPlot; - // firstAncestorOrThisOfTypeAsserted( ensembleWellLogCurveSetPlot ); - - // if ( ensembleWellLogCurveSetPlot ) - // { - // ensembleWellLogCurveSetPlot->loadDataAndUpdate(); - // } -} - //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- @@ -126,7 +109,7 @@ void RimEnsembleWellLogStatisticsCurve::performDataExtraction( bool* isUsingPseu } else if ( m_statisticsType == RimEnsembleWellLogStatistics::StatisticsType::P10 ) { - values = ensembleWellLogStatistics->mean(); + values = ensembleWellLogStatistics->p10(); measuredDepthValues = ensembleWellLogStatistics->measuredDepths(); } else if ( m_statisticsType == RimEnsembleWellLogStatistics::StatisticsType::P50 ) @@ -143,6 +126,8 @@ void RimEnsembleWellLogStatisticsCurve::performDataExtraction( bool* isUsingPseu bool performDataSmoothing = false; if ( !values.empty() && !measuredDepthValues.empty() && measuredDepthValues.size() == values.size() ) { + addDatapointsForBottomOfSegment( measuredDepthValues, values ); + this->setValuesAndDepths( values, measuredDepthValues, RiaDefines::DepthTypeEnum::MEASURED_DEPTH, @@ -161,3 +146,34 @@ QString RimEnsembleWellLogStatisticsCurve::createCurveAutoName() { return caf::AppEnum::uiText( m_statisticsType() ); } + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimEnsembleWellLogStatisticsCurve::addDatapointsForBottomOfSegment( std::vector& depthValues, + std::vector& values ) +{ + std::vector depthValuesWithBottomLayers; + std::vector valuesWithBottomLayers; + for ( size_t i = 0; i < values.size(); i++ ) + { + // Add the data point at top of the layer + double topLayerDepth = depthValues[i]; + double value = values[i]; + depthValuesWithBottomLayers.push_back( topLayerDepth ); + valuesWithBottomLayers.push_back( value ); + + // Add extra data points for bottom part of the layer + if ( i < values.size() - 1 ) + { + double bottomLayerDepth = depthValues[i + 1]; + double bottomValue = value; + + depthValuesWithBottomLayers.push_back( bottomLayerDepth ); + valuesWithBottomLayers.push_back( bottomValue ); + } + } + + values = valuesWithBottomLayers; + depthValues = depthValuesWithBottomLayers; +} diff --git a/ApplicationLibCode/ProjectDataModel/RimEnsembleWellLogStatisticsCurve.h b/ApplicationLibCode/ProjectDataModel/RimEnsembleWellLogStatisticsCurve.h index 463eaa1e4f..930bce3e0a 100644 --- a/ApplicationLibCode/ProjectDataModel/RimEnsembleWellLogStatisticsCurve.h +++ b/ApplicationLibCode/ProjectDataModel/RimEnsembleWellLogStatisticsCurve.h @@ -45,12 +45,12 @@ class RimEnsembleWellLogStatisticsCurve : public RimWellLogExtractionCurve RimEnsembleWellLogStatistics::StatisticsType statisticsType() const; protected: - void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) override; - void performDataExtraction( bool* isUsingPseudoLength ) override; QString createCurveAutoName() override; + static void addDatapointsForBottomOfSegment( std::vector& depthValues, std::vector& values ); + caf::PdmPtrField m_ensembleWellLogCurveSet; caf::PdmField> m_statisticsType; }; From 4bd2a7b6fd5559bd024d53e7cc22c3131d719f11 Mon Sep 17 00:00:00 2001 From: Kristian Bendiksen Date: Fri, 25 Jun 2021 15:36:15 +0200 Subject: [PATCH 043/308] #7716 Ensemble Well Logs: load data when project is opened. --- .../Application/RiaApplication.cpp | 2 ++ .../RimEnsembleWellLogCurveSet.cpp | 36 +++++++++++++------ .../RimEnsembleWellLogCurveSet.h | 3 ++ .../RimEnsembleWellLogStatistics.cpp | 4 +++ .../RimEnsembleWellLogStatisticsCurve.cpp | 2 ++ .../ProjectDataModel/RimEnsembleWellLogs.cpp | 13 +++++-- .../ProjectDataModel/RimEnsembleWellLogs.h | 5 +-- .../RimEnsembleWellLogsCollection.cpp | 11 ++++++ .../RimEnsembleWellLogsCollection.h | 1 + 9 files changed, 60 insertions(+), 17 deletions(-) diff --git a/ApplicationLibCode/Application/RiaApplication.cpp b/ApplicationLibCode/Application/RiaApplication.cpp index 53619538b0..a6d2e92be5 100644 --- a/ApplicationLibCode/Application/RiaApplication.cpp +++ b/ApplicationLibCode/Application/RiaApplication.cpp @@ -46,6 +46,7 @@ #include "RimCompletionTemplateCollection.h" #include "RimEclipseCaseCollection.h" #include "RimEclipseView.h" +#include "RimEnsembleWellLogsCollection.h" #include "RimFormationNamesCollection.h" #include "RimFractureTemplateCollection.h" #include "RimGeoMechCase.h" @@ -499,6 +500,7 @@ bool RiaApplication::loadProject( const QString& projectFileName, } oilField->wellPathCollection->loadDataAndUpdate(); + oilField->ensembleWellLogsCollection->loadDataAndUpdate(); } { diff --git a/ApplicationLibCode/ProjectDataModel/RimEnsembleWellLogCurveSet.cpp b/ApplicationLibCode/ProjectDataModel/RimEnsembleWellLogCurveSet.cpp index 3a07e80696..0fb5d80686 100644 --- a/ApplicationLibCode/ProjectDataModel/RimEnsembleWellLogCurveSet.cpp +++ b/ApplicationLibCode/ProjectDataModel/RimEnsembleWellLogCurveSet.cpp @@ -831,7 +831,15 @@ void RimEnsembleWellLogCurveSet::updateEnsembleCurves( const std::vector& sumCases ) +void RimEnsembleWellLogCurveSet::updateStatistics() +{ + updateStatistics( std::vector() ); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimEnsembleWellLogCurveSet::updateStatistics( const std::vector& sumCases ) { RimEnsembleWellLogs* ensembleWellLogs = m_ensembleWellLogs; QString wellLogChannelName = m_wellLogChannelName(); @@ -839,19 +847,25 @@ void RimEnsembleWellLogCurveSet::updateStatisticsCurves( const std::vector wellLogFiles = sumCases; + if ( wellLogFiles.empty() ) { - std::vector wellLogFiles = sumCases; - if ( wellLogFiles.empty() ) - { - if ( m_statistics->basedOnFilteredCases() ) - wellLogFiles = filterEnsembleCases( ensembleWellLogs->wellLogFiles() ); - else - wellLogFiles = ensembleWellLogs->wellLogFiles(); - } - - m_ensembleWellLogStatistics->calculate( wellLogFiles, wellLogChannelName ); + if ( m_statistics->basedOnFilteredCases() ) + wellLogFiles = filterEnsembleCases( ensembleWellLogs->wellLogFiles() ); + else + wellLogFiles = ensembleWellLogs->wellLogFiles(); } + m_ensembleWellLogStatistics->calculate( wellLogFiles, wellLogChannelName ); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimEnsembleWellLogCurveSet::updateStatisticsCurves( const std::vector& sumCases ) +{ + updateStatistics( sumCases ); + RimWellLogPlot* plot = nullptr; firstAncestorOrThisOfType( plot ); CVF_ASSERT( plot ); diff --git a/ApplicationLibCode/ProjectDataModel/RimEnsembleWellLogCurveSet.h b/ApplicationLibCode/ProjectDataModel/RimEnsembleWellLogCurveSet.h index 7fd5110098..f4a8758f96 100644 --- a/ApplicationLibCode/ProjectDataModel/RimEnsembleWellLogCurveSet.h +++ b/ApplicationLibCode/ProjectDataModel/RimEnsembleWellLogCurveSet.h @@ -123,9 +123,12 @@ class RimEnsembleWellLogCurveSet : public caf::PdmObject, public RimEnsembleCurv const RimEnsembleWellLogStatistics* ensembleWellLogStatistics() const; + void updateStatistics(); + private: void updateEnsembleCurves( const std::vector& curves ); void updateStatisticsCurves( const std::vector& curves ); + void updateStatistics( const std::vector& sumCases ); caf::PdmFieldHandle* userDescriptionField() override; caf::PdmFieldHandle* objectToggleField() override; diff --git a/ApplicationLibCode/ProjectDataModel/RimEnsembleWellLogStatistics.cpp b/ApplicationLibCode/ProjectDataModel/RimEnsembleWellLogStatistics.cpp index 10ad5f9da7..f6d8a32b03 100644 --- a/ApplicationLibCode/ProjectDataModel/RimEnsembleWellLogStatistics.cpp +++ b/ApplicationLibCode/ProjectDataModel/RimEnsembleWellLogStatistics.cpp @@ -90,6 +90,10 @@ void RimEnsembleWellLogStatistics::calculate( const std::vector curveMerger.addCurveData( depths, values ); } } + else + { + RiaLogging::error( errorMessage ); + } } curveMerger.computeInterpolatedValues( true ); diff --git a/ApplicationLibCode/ProjectDataModel/RimEnsembleWellLogStatisticsCurve.cpp b/ApplicationLibCode/ProjectDataModel/RimEnsembleWellLogStatisticsCurve.cpp index 9055ecb623..49c5dda597 100644 --- a/ApplicationLibCode/ProjectDataModel/RimEnsembleWellLogStatisticsCurve.cpp +++ b/ApplicationLibCode/ProjectDataModel/RimEnsembleWellLogStatisticsCurve.cpp @@ -99,6 +99,8 @@ void RimEnsembleWellLogStatisticsCurve::performDataExtraction( bool* isUsingPseu const RimEnsembleWellLogStatistics* ensembleWellLogStatistics = m_ensembleWellLogCurveSet->ensembleWellLogStatistics(); + m_ensembleWellLogCurveSet->updateStatistics(); + RiaDefines::DepthUnitType depthUnit = ensembleWellLogStatistics->depthUnitType(); QString xUnits = ensembleWellLogStatistics->logChannelUnitString(); diff --git a/ApplicationLibCode/ProjectDataModel/RimEnsembleWellLogs.cpp b/ApplicationLibCode/ProjectDataModel/RimEnsembleWellLogs.cpp index 1f19635588..903285eaee 100644 --- a/ApplicationLibCode/ProjectDataModel/RimEnsembleWellLogs.cpp +++ b/ApplicationLibCode/ProjectDataModel/RimEnsembleWellLogs.cpp @@ -18,6 +18,8 @@ #include "RimEnsembleWellLogs.h" +#include "RiaLogging.h" + #include "RimWellLogFile.h" #include "cafPdmFieldScriptingCapability.h" @@ -63,7 +65,14 @@ std::vector RimEnsembleWellLogs::wellLogFiles() const //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -bool RimEnsembleWellLogs::hasEnsembleParameters() const +void RimEnsembleWellLogs::loadDataAndUpdate() { - return false; + for ( auto& w : m_wellLogFiles ) + { + QString errorMessage; + if ( !w->readFile( &errorMessage ) ) + { + RiaLogging::warning( errorMessage ); + } + } } diff --git a/ApplicationLibCode/ProjectDataModel/RimEnsembleWellLogs.h b/ApplicationLibCode/ProjectDataModel/RimEnsembleWellLogs.h index 9dfcf08e7a..17287921a8 100644 --- a/ApplicationLibCode/ProjectDataModel/RimEnsembleWellLogs.h +++ b/ApplicationLibCode/ProjectDataModel/RimEnsembleWellLogs.h @@ -38,10 +38,7 @@ class RimEnsembleWellLogs : public RimNamedObject std::vector wellLogFiles() const; - bool hasEnsembleParameters() const; - -protected: - void updateReferringCurveSets(); + void loadDataAndUpdate(); private: caf::PdmChildArrayField m_wellLogFiles; diff --git a/ApplicationLibCode/ProjectDataModel/RimEnsembleWellLogsCollection.cpp b/ApplicationLibCode/ProjectDataModel/RimEnsembleWellLogsCollection.cpp index 3f278fee7d..cf3a1dd769 100644 --- a/ApplicationLibCode/ProjectDataModel/RimEnsembleWellLogsCollection.cpp +++ b/ApplicationLibCode/ProjectDataModel/RimEnsembleWellLogsCollection.cpp @@ -63,3 +63,14 @@ std::vector RimEnsembleWellLogsCollection::ensembleWellLog } return ensembleWellLogs; } + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimEnsembleWellLogsCollection::loadDataAndUpdate() +{ + for ( const auto& e : m_ensembleWellLogs ) + { + e->loadDataAndUpdate(); + } +} diff --git a/ApplicationLibCode/ProjectDataModel/RimEnsembleWellLogsCollection.h b/ApplicationLibCode/ProjectDataModel/RimEnsembleWellLogsCollection.h index b235c5f240..b53bca398d 100644 --- a/ApplicationLibCode/ProjectDataModel/RimEnsembleWellLogsCollection.h +++ b/ApplicationLibCode/ProjectDataModel/RimEnsembleWellLogsCollection.h @@ -36,6 +36,7 @@ class RimEnsembleWellLogsCollection : public caf::PdmObject std::vector ensembleWellLogs() const; void addEnsembleWellLogs( RimEnsembleWellLogs* ensembleWellLogs ); + void loadDataAndUpdate(); private: caf::PdmChildArrayField m_ensembleWellLogs; From cdec36a5827414f74509c233b487efab8d5eb215 Mon Sep 17 00:00:00 2001 From: Kristian Bendiksen Date: Mon, 28 Jun 2021 09:35:01 +0200 Subject: [PATCH 044/308] #7716 Ensemble Well Logs: reattach signals on project open. --- .../ProjectDataModel/RimEnsembleWellLogCurveSet.cpp | 8 ++++++++ .../ProjectDataModel/RimEnsembleWellLogCurveSet.h | 1 + 2 files changed, 9 insertions(+) diff --git a/ApplicationLibCode/ProjectDataModel/RimEnsembleWellLogCurveSet.cpp b/ApplicationLibCode/ProjectDataModel/RimEnsembleWellLogCurveSet.cpp index 0fb5d80686..fd544b0faa 100644 --- a/ApplicationLibCode/ProjectDataModel/RimEnsembleWellLogCurveSet.cpp +++ b/ApplicationLibCode/ProjectDataModel/RimEnsembleWellLogCurveSet.cpp @@ -1172,3 +1172,11 @@ void RimEnsembleWellLogCurveSet::onFilterSourceChanged( const caf::SignalEmitter { if ( m_ensembleCurveSet() ) loadDataAndUpdate( true ); } + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimEnsembleWellLogCurveSet::initAfterRead() +{ + connectEnsembleCurveSetFilterSignals(); +} diff --git a/ApplicationLibCode/ProjectDataModel/RimEnsembleWellLogCurveSet.h b/ApplicationLibCode/ProjectDataModel/RimEnsembleWellLogCurveSet.h index f4a8758f96..e9282f2cb2 100644 --- a/ApplicationLibCode/ProjectDataModel/RimEnsembleWellLogCurveSet.h +++ b/ApplicationLibCode/ProjectDataModel/RimEnsembleWellLogCurveSet.h @@ -132,6 +132,7 @@ class RimEnsembleWellLogCurveSet : public caf::PdmObject, public RimEnsembleCurv caf::PdmFieldHandle* userDescriptionField() override; caf::PdmFieldHandle* objectToggleField() override; + void initAfterRead() override; QList calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions, bool* useOptionsOnly ) override; From 6aa28bceb277aa7f507fa01cbe59a25a00fec765 Mon Sep 17 00:00:00 2001 From: Kristian Bendiksen Date: Mon, 28 Jun 2021 12:24:23 +0200 Subject: [PATCH 045/308] #7716 Ensemble Well Logs: improve legends appearance Also remove some unused code. --- .../RimEnsembleWellLogCurveSet.cpp | 113 +++++------------- .../RimEnsembleWellLogCurveSet.h | 13 +- 2 files changed, 30 insertions(+), 96 deletions(-) diff --git a/ApplicationLibCode/ProjectDataModel/RimEnsembleWellLogCurveSet.cpp b/ApplicationLibCode/ProjectDataModel/RimEnsembleWellLogCurveSet.cpp index fd544b0faa..b42362b691 100644 --- a/ApplicationLibCode/ProjectDataModel/RimEnsembleWellLogCurveSet.cpp +++ b/ApplicationLibCode/ProjectDataModel/RimEnsembleWellLogCurveSet.cpp @@ -42,17 +42,11 @@ #include "RiuAbstractLegendFrame.h" #include "RiuDraggableOverlayFrame.h" #include "RiuPlotMainWindow.h" -#include "RiuQwtPlotCurve.h" #include "RiuQwtPlotWidget.h" #include "RiuTextContentFrame.h" #include "cafPdmObject.h" -#include "cafPdmUiDateEditor.h" #include "cafPdmUiItem.h" -#include "cafPdmUiLineEditor.h" -#include "cafPdmUiListEditor.h" -#include "cafPdmUiPushButtonEditor.h" -#include "cafPdmUiSliderEditor.h" #include "cafPdmUiTreeOrdering.h" #include "qwt_plot_curve.h" @@ -137,23 +131,22 @@ RimEnsembleWellLogCurveSet::RimEnsembleWellLogCurveSet() //-------------------------------------------------------------------------------------------------- RimEnsembleWellLogCurveSet::~RimEnsembleWellLogCurveSet() { - // m_curves.deleteAllChildObjects(); - - RimWellLogPlot* parentPlot; - firstAncestorOrThisOfType( parentPlot ); - // if ( parentPlot && parentPlot->viewer() ) - // { - // m_qwtPlotCurveForLegendText->detach(); - // if ( m_legendOverlayFrame ) - // { - // parentPlot->viewer()->removeOverlayFrame( m_legendOverlayFrame ); - // } - // } + RimWellLogTrack* plotTrack = nullptr; + firstAncestorOrThisOfType( plotTrack ); + if ( plotTrack && plotTrack->viewer() ) + { + if ( m_legendOverlayFrame ) + { + plotTrack->viewer()->removeOverlayFrame( m_legendOverlayFrame ); + } + } + if ( m_legendOverlayFrame ) { m_legendOverlayFrame->setParent( nullptr ); delete m_legendOverlayFrame; } + if ( m_filterOverlayFrame ) { m_filterOverlayFrame->setParent( nullptr ); @@ -186,6 +179,7 @@ void RimEnsembleWellLogCurveSet::loadDataAndUpdate( bool updateParentPlot ) { updateAllCurves(); updateFilterLegend(); + updateAllTextInPlot(); if ( updateParentPlot ) { @@ -231,42 +225,14 @@ void RimEnsembleWellLogCurveSet::reattachQwtCurves() m_qwtPlotCurveForLegendText->detach(); - RimWellLogPlot* plot = nullptr; + RimWellLogTrack* plot = nullptr; firstAncestorOrThisOfType( plot ); - // if ( plot ) - // { - // m_qwtPlotCurveForLegendText->attach( plot->viewer() ); - // } -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -void RimEnsembleWellLogCurveSet::addCurve( RimWellLogCurve* curve ) -{ - if ( curve ) + if ( plot ) { - RimWellLogPlot* plot; - firstAncestorOrThisOfType( plot ); - // if ( plot ) curve->setParentQwtPlotNoReplot( plot->viewer() ); - - curve->setColor( m_color ); - m_curves.push_back( curve ); + m_qwtPlotCurveForLegendText->attach( plot->viewer() ); } } -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -void RimEnsembleWellLogCurveSet::deleteCurve( RimWellLogCurve* curve ) -{ - // if ( curve ) - // { - // m_curves.removeChildObject( curve ); - // delete curve; - // } -} - //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- @@ -341,14 +307,6 @@ RiuDraggableOverlayFrame* RimEnsembleWellLogCurveSet::legendFrame() const return m_legendOverlayFrame; } -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -void RimEnsembleWellLogCurveSet::onLegendDefinitionChanged() -{ - updateCurveColors(); -} - //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- @@ -525,13 +483,6 @@ void RimEnsembleWellLogCurveSet::defineUiTreeOrdering( caf::PdmUiTreeOrdering& u caf::IconProvider iconProvider = this->uiIconProvider(); if ( !iconProvider.valid() ) return; - // RimEnsembleWellLogCurveSetCollection* coll = nullptr; - // this->firstAncestorOrThisOfType( coll ); - // if ( coll && coll->curveSetForSourceStepping() == this ) - // { - // iconProvider.setOverlayResourceString( ":/StepUpDownCorner16x16.png" ); - // } - this->setUiIcon( iconProvider ); } @@ -776,11 +727,13 @@ void RimEnsembleWellLogCurveSet::updateEnsembleCurves( const std::vectordetach(); + m_qwtPlotCurveForLegendText->detach(); deleteStatisticsCurves(); if ( m_statistics->hideEnsembleCurves() ) return; + m_qwtPlotCurveForLegendText->attach( plotTrack->viewer() ); + QString wellLogChannelName = m_wellLogChannelName(); if ( plotTrack && wellLogChannelName != "None" ) { @@ -819,6 +772,7 @@ void RimEnsembleWellLogCurveSet::updateEnsembleCurves( const std::vectorloadDataAndUpdate( true ); curve->updateCurveVisibility(); + curve->setShowInLegend( false ); m_curves.push_back( curve ); } @@ -826,6 +780,8 @@ void RimEnsembleWellLogCurveSet::updateEnsembleCurves( const std::vectorupdateLegend(); } //-------------------------------------------------------------------------------------------------- @@ -932,16 +888,6 @@ void RimEnsembleWellLogCurveSet::updateStatisticsCurves() updateStatisticsCurves( std::vector() ); } -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -// RimEnsembleWellLogCurveSet* RimEnsembleWellLogCurveSet::clone() const -// { -// RimEnsembleWellLogCurveSet* copy = dynamic_cast( -// this->xmlCapability()->copyByXmlSerialization( caf::PdmDefaultObjectFactory::instance() ) ); -// return copy; -// } - //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- @@ -955,7 +901,14 @@ void RimEnsembleWellLogCurveSet::showCurves( bool show ) //-------------------------------------------------------------------------------------------------- void RimEnsembleWellLogCurveSet::updateAllTextInPlot() { + RimWellLogTrack* plotTrack = nullptr; + firstAncestorOrThisOfType( plotTrack ); + CVF_ASSERT( plotTrack ); + plotTrack->viewer()->setPlotTitle( name() ); + updateEnsembleLegendItem(); + + plotTrack->updateLegend(); } //-------------------------------------------------------------------------------------------------- @@ -967,9 +920,7 @@ std::vector std::vector filteredCases; if ( m_ensembleCurveSet != nullptr && m_statistics->basedOnFilteredCases() ) - { // && m_ensembleCurveSet->isFiltered() ) - RiaLogging::debug( QString( "FILTERING ENSEMBLE CASES" ) ); - + { // Get the summary cases from the related ensemble summary curve set. RimSummaryCaseCollection* summaryCaseCollection = m_ensembleCurveSet->summaryCaseCollection(); @@ -989,8 +940,6 @@ std::vector } else { - RiaLogging::debug( QString( "NOT FILTERING ENSEMBLE CASES" ) ); - filteredCases = wellLogFiles; } @@ -1013,14 +962,10 @@ bool RimEnsembleWellLogCurveSet::isSameRealization( RimSummaryCase* summaryCase, if ( wellLogFileName.contains( QString( "realization-%1" ).arg( realizationNumber ) ) ) { - RiaLogging::debug( - QString( "Matching summary case %1 with well log file %2" ).arg( summaryCaseFileName ).arg( wellLogFileName ) ); - return true; } } - RiaLogging::debug( QString( "No matching summary case found for well log file: %1." ).arg( wellLogFileName ) ); return false; } diff --git a/ApplicationLibCode/ProjectDataModel/RimEnsembleWellLogCurveSet.h b/ApplicationLibCode/ProjectDataModel/RimEnsembleWellLogCurveSet.h index e9282f2cb2..3b092abe9d 100644 --- a/ApplicationLibCode/ProjectDataModel/RimEnsembleWellLogCurveSet.h +++ b/ApplicationLibCode/ProjectDataModel/RimEnsembleWellLogCurveSet.h @@ -81,27 +81,18 @@ class RimEnsembleWellLogCurveSet : public caf::PdmObject, public RimEnsembleCurv void detachQwtCurves(); void reattachQwtCurves(); - void addCurve( RimWellLogCurve* curve ); - void deleteCurve( RimWellLogCurve* curve ); - std::vector curves() const; void deleteEnsembleCurves(); void deleteStatisticsCurves(); - void onLegendDefinitionChanged(); - - void setSummaryCaseCollection( RimSummaryCaseCollection* sumCaseCollection ); - RimSummaryCaseCollection* summaryCaseCollection() const; - ColorMode colorMode() const; void setColorMode( ColorMode mode ); void updateEnsembleLegendItem(); RiuDraggableOverlayFrame* legendFrame() const; - RimEnsembleWellLogCurveSet* clone() const; - void showCurves( bool show ); + void showCurves( bool show ); void updateAllTextInPlot(); @@ -145,8 +136,6 @@ class RimEnsembleWellLogCurveSet : public caf::PdmObject, public RimEnsembleCurv QString createAutoName() const; - void updateLegendMappingMode(); - void updateMaxMinAndDefaultValues(); void updateCurveColors(); bool isSameRealization( RimSummaryCase* summaryCase, RimWellLogFile* wellLogFile ) const; From 4d780b491522be3358a838c74d06a4f2680eb750 Mon Sep 17 00:00:00 2001 From: Kristian Bendiksen Date: Mon, 28 Jun 2021 13:04:29 +0200 Subject: [PATCH 046/308] #7716 Ensemble Well Logs: hide curves in project tree. --- .../ProjectDataModel/RimEnsembleWellLogCurveSet.cpp | 2 ++ ApplicationLibCode/ProjectDataModel/RimWellLogTrack.cpp | 8 ++++++++ ApplicationLibCode/ProjectDataModel/RimWellLogTrack.h | 2 ++ 3 files changed, 12 insertions(+) diff --git a/ApplicationLibCode/ProjectDataModel/RimEnsembleWellLogCurveSet.cpp b/ApplicationLibCode/ProjectDataModel/RimEnsembleWellLogCurveSet.cpp index b42362b691..df6f0aa01a 100644 --- a/ApplicationLibCode/ProjectDataModel/RimEnsembleWellLogCurveSet.cpp +++ b/ApplicationLibCode/ProjectDataModel/RimEnsembleWellLogCurveSet.cpp @@ -186,6 +186,8 @@ void RimEnsembleWellLogCurveSet::loadDataAndUpdate( bool updateParentPlot ) RimWellLogTrack* parentPlot; firstAncestorOrThisOfTypeAsserted( parentPlot ); parentPlot->viewer()->scheduleReplot(); + + parentPlot->setCurvesTreeVisibility( false ); } } diff --git a/ApplicationLibCode/ProjectDataModel/RimWellLogTrack.cpp b/ApplicationLibCode/ProjectDataModel/RimWellLogTrack.cpp index b61d7f0bee..2cead634bb 100644 --- a/ApplicationLibCode/ProjectDataModel/RimWellLogTrack.cpp +++ b/ApplicationLibCode/ProjectDataModel/RimWellLogTrack.cpp @@ -3091,3 +3091,11 @@ void RimWellLogTrack::addUnderburden( std::vector& namesVector, CurveSa curveData.data.push_back( namesVector.size() - 1 ); } } + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimWellLogTrack::setCurvesTreeVisibility( bool isVisible ) +{ + m_curves.uiCapability()->setUiTreeChildrenHidden( !isVisible ); +} diff --git a/ApplicationLibCode/ProjectDataModel/RimWellLogTrack.h b/ApplicationLibCode/ProjectDataModel/RimWellLogTrack.h index 48c241ed16..7a6b18e907 100644 --- a/ApplicationLibCode/ProjectDataModel/RimWellLogTrack.h +++ b/ApplicationLibCode/ProjectDataModel/RimWellLogTrack.h @@ -231,6 +231,8 @@ class RimWellLogTrack : public RimPlot static void addOverburden( std::vector& namesVector, CurveSamplingPointData& curveData, double height ); static void addUnderburden( std::vector& namesVector, CurveSamplingPointData& curveData, double height ); + void setCurvesTreeVisibility( bool isVisible ); + protected: // RimViewWindow overrides void deleteViewWidget() override; From d79dcafe5a5d535e0ad96874e148406188bcb378 Mon Sep 17 00:00:00 2001 From: Kristian Bendiksen Date: Mon, 28 Jun 2021 14:25:35 +0200 Subject: [PATCH 047/308] #7716 Ensemble Well Logs: Add context menu for curve set. --- .../WellLogCommands/CMakeLists_files.cmake | 2 + .../RicNewEnsembleWellLogCurveSetFeature.cpp | 67 +++++++++++++++++++ .../RicNewEnsembleWellLogCurveSetFeature.h | 34 ++++++++++ .../RimContextCommandBuilder.cpp | 1 + .../ProjectDataModel/RimWellLogTrack.cpp | 10 ++- .../ProjectDataModel/RimWellLogTrack.h | 2 + 6 files changed, 115 insertions(+), 1 deletion(-) create mode 100644 ApplicationLibCode/Commands/WellLogCommands/RicNewEnsembleWellLogCurveSetFeature.cpp create mode 100644 ApplicationLibCode/Commands/WellLogCommands/RicNewEnsembleWellLogCurveSetFeature.h diff --git a/ApplicationLibCode/Commands/WellLogCommands/CMakeLists_files.cmake b/ApplicationLibCode/Commands/WellLogCommands/CMakeLists_files.cmake index 237500ff06..a67a93710c 100644 --- a/ApplicationLibCode/Commands/WellLogCommands/CMakeLists_files.cmake +++ b/ApplicationLibCode/Commands/WellLogCommands/CMakeLists_files.cmake @@ -27,6 +27,7 @@ ${CMAKE_CURRENT_LIST_DIR}/Ric3dWellLogCurveDeleteFeature.h ${CMAKE_CURRENT_LIST_DIR}/Ric3dWellLogCurvePickEventHandler.h ${CMAKE_CURRENT_LIST_DIR}/RicNewWellBoreStabilityPlotFeature.h ${CMAKE_CURRENT_LIST_DIR}/RicNewWellMeasurementCurveFeature.h +${CMAKE_CURRENT_LIST_DIR}/RicNewEnsembleWellLogCurveSetFeature.h ) set (SOURCE_GROUP_SOURCE_FILES @@ -57,6 +58,7 @@ ${CMAKE_CURRENT_LIST_DIR}/Ric3dWellLogCurveDeleteFeature.cpp ${CMAKE_CURRENT_LIST_DIR}/Ric3dWellLogCurvePickEventHandler.cpp ${CMAKE_CURRENT_LIST_DIR}/RicNewWellBoreStabilityPlotFeature.cpp ${CMAKE_CURRENT_LIST_DIR}/RicNewWellMeasurementCurveFeature.cpp +${CMAKE_CURRENT_LIST_DIR}/RicNewEnsembleWellLogCurveSetFeature.cpp ) list(APPEND COMMAND_CODE_HEADER_FILES diff --git a/ApplicationLibCode/Commands/WellLogCommands/RicNewEnsembleWellLogCurveSetFeature.cpp b/ApplicationLibCode/Commands/WellLogCommands/RicNewEnsembleWellLogCurveSetFeature.cpp new file mode 100644 index 0000000000..ac990ccdcf --- /dev/null +++ b/ApplicationLibCode/Commands/WellLogCommands/RicNewEnsembleWellLogCurveSetFeature.cpp @@ -0,0 +1,67 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2015- Statoil ASA +// Copyright (C) 2015- Ceetron Solutions AS +// +// ResInsight is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// + +#include "RicNewEnsembleWellLogCurveSetFeature.h" + +#include "RimEnsembleWellLogCurveSet.h" +#include "RimWellLogTrack.h" + +#include "RiuPlotMainWindow.h" +#include "RiuPlotMainWindowTools.h" + +#include "cafSelectionManager.h" + +#include + +#include + +CAF_CMD_SOURCE_INIT( RicNewEnsembleWellLogCurveSetFeature, "RicNewEnsembleWellLogCurveSetFeature" ); + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +bool RicNewEnsembleWellLogCurveSetFeature::isCommandEnabled() +{ + return caf::SelectionManager::instance()->selectedItemOfType() != nullptr; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RicNewEnsembleWellLogCurveSetFeature::onActionTriggered( bool isChecked ) +{ + RimWellLogTrack* wellLogPlotTrack = caf::SelectionManager::instance()->selectedItemOfType(); + if ( wellLogPlotTrack ) + { + RimEnsembleWellLogCurveSet* curveSet = new RimEnsembleWellLogCurveSet(); + wellLogPlotTrack->setEnsembleWellLogCurveSet( curveSet ); + wellLogPlotTrack->updateEditors(); + RiuPlotMainWindowTools::selectAsCurrentItem( curveSet ); + } + RiuPlotMainWindowTools::refreshToolbars(); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RicNewEnsembleWellLogCurveSetFeature::setupActionLook( QAction* actionToSetup ) +{ + actionToSetup->setText( "New Ensemble Well Log Curve Set" ); + actionToSetup->setIcon( QIcon( ":/EnsembleCurveSet16x16.png" ) ); +} diff --git a/ApplicationLibCode/Commands/WellLogCommands/RicNewEnsembleWellLogCurveSetFeature.h b/ApplicationLibCode/Commands/WellLogCommands/RicNewEnsembleWellLogCurveSetFeature.h new file mode 100644 index 0000000000..c4b8148378 --- /dev/null +++ b/ApplicationLibCode/Commands/WellLogCommands/RicNewEnsembleWellLogCurveSetFeature.h @@ -0,0 +1,34 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2021- Eqinor ASA +// +// ResInsight is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// + +#pragma once + +#include "cafCmdFeature.h" + +//================================================================================================== +/// +//================================================================================================== +class RicNewEnsembleWellLogCurveSetFeature : public caf::CmdFeature +{ + CAF_CMD_HEADER_INIT; + +private: + bool isCommandEnabled() override; + void onActionTriggered( bool isChecked ) override; + void setupActionLook( QAction* actionToSetup ) override; +}; diff --git a/ApplicationLibCode/ProjectDataModel/RimContextCommandBuilder.cpp b/ApplicationLibCode/ProjectDataModel/RimContextCommandBuilder.cpp index 972e0b60aa..8a2fbd13b7 100644 --- a/ApplicationLibCode/ProjectDataModel/RimContextCommandBuilder.cpp +++ b/ApplicationLibCode/ProjectDataModel/RimContextCommandBuilder.cpp @@ -610,6 +610,7 @@ caf::CmdFeatureMenuBuilder RimContextCommandBuilder::commandsFromSelection() menuBuilder << "RicNewWellLogRftCurveFeature"; menuBuilder << "RicNewWellLogFileCurveFeature"; menuBuilder << "RicNewWellMeasurementCurveFeature"; + menuBuilder << "RicNewEnsembleWellLogCurveSetFeature"; menuBuilder << "Separator"; menuBuilder << "RicDeleteSubPlotFeature"; } diff --git a/ApplicationLibCode/ProjectDataModel/RimWellLogTrack.cpp b/ApplicationLibCode/ProjectDataModel/RimWellLogTrack.cpp index 2cead634bb..dec9480b5b 100644 --- a/ApplicationLibCode/ProjectDataModel/RimWellLogTrack.cpp +++ b/ApplicationLibCode/ProjectDataModel/RimWellLogTrack.cpp @@ -276,7 +276,7 @@ RimWellLogTrack::RimWellLogTrack() "", "", "" ); - m_ensembleWellLogCurveSet = new RimEnsembleWellLogCurveSet; + m_ensembleWellLogCurveSet.uiCapability()->setUiHidden( true ); m_formationsForCaseWithSimWellOnly = false; } @@ -3099,3 +3099,11 @@ void RimWellLogTrack::setCurvesTreeVisibility( bool isVisible ) { m_curves.uiCapability()->setUiTreeChildrenHidden( !isVisible ); } + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimWellLogTrack::setEnsembleWellLogCurveSet( RimEnsembleWellLogCurveSet* curveSet ) +{ + m_ensembleWellLogCurveSet = curveSet; +} diff --git a/ApplicationLibCode/ProjectDataModel/RimWellLogTrack.h b/ApplicationLibCode/ProjectDataModel/RimWellLogTrack.h index 7a6b18e907..8aa893f779 100644 --- a/ApplicationLibCode/ProjectDataModel/RimWellLogTrack.h +++ b/ApplicationLibCode/ProjectDataModel/RimWellLogTrack.h @@ -233,6 +233,8 @@ class RimWellLogTrack : public RimPlot void setCurvesTreeVisibility( bool isVisible ); + void setEnsembleWellLogCurveSet( RimEnsembleWellLogCurveSet* curveSet ); + protected: // RimViewWindow overrides void deleteViewWidget() override; From 93b5c39387977cc3d6430e507afa1542727fb29d Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Wed, 30 Jun 2021 12:37:57 +0200 Subject: [PATCH 048/308] Janitor : Guard nullpointer access --- .../Commands/WellPathCommands/RicLinkWellPathFeature.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/ApplicationLibCode/Commands/WellPathCommands/RicLinkWellPathFeature.cpp b/ApplicationLibCode/Commands/WellPathCommands/RicLinkWellPathFeature.cpp index 4707eb8d5e..587ea35eff 100644 --- a/ApplicationLibCode/Commands/WellPathCommands/RicLinkWellPathFeature.cpp +++ b/ApplicationLibCode/Commands/WellPathCommands/RicLinkWellPathFeature.cpp @@ -81,7 +81,11 @@ RimWellPathGeometryDef* RicLinkWellPathFeature::wellPathGeometryDef() auto wellPathSelectionItem = RiuWellPathSelectionItem::wellPathSelectionItem(); if ( wellPathSelectionItem && wellPathSelectionItem->m_wellpath ) { - auto modeledWellPath = dynamic_cast( wellPathSelectionItem->m_wellpath ); - return modeledWellPath->geometryDefinition(); + if ( auto modeledWellPath = dynamic_cast( wellPathSelectionItem->m_wellpath ) ) + { + return modeledWellPath->geometryDefinition(); + } } + + return nullptr; } From 54dee087982591b1f66a9a58bf065d58fe2ef608 Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Wed, 30 Jun 2021 14:19:15 +0200 Subject: [PATCH 049/308] #7831 Janitor: Do not create QtChart features if compiled without QtChart --- .../ProjectDataModel/RimContextCommandBuilder.cpp | 2 ++ ApplicationLibCode/UserInterface/RiuViewerCommands.cpp | 2 ++ 2 files changed, 4 insertions(+) diff --git a/ApplicationLibCode/ProjectDataModel/RimContextCommandBuilder.cpp b/ApplicationLibCode/ProjectDataModel/RimContextCommandBuilder.cpp index 8a2fbd13b7..7a74171814 100644 --- a/ApplicationLibCode/ProjectDataModel/RimContextCommandBuilder.cpp +++ b/ApplicationLibCode/ProjectDataModel/RimContextCommandBuilder.cpp @@ -891,7 +891,9 @@ caf::CmdFeatureMenuBuilder RimContextCommandBuilder::commandsFromSelection() } else if ( dynamic_cast( firstUiItem ) ) { +#ifdef USE_QTCHARTS menuBuilder << "RicCreateGridStatisticsPlotFeature"; +#endif menuBuilder << "RicShowGridStatisticsFeature"; } else if ( dynamic_cast( firstUiItem ) ) diff --git a/ApplicationLibCode/UserInterface/RiuViewerCommands.cpp b/ApplicationLibCode/UserInterface/RiuViewerCommands.cpp index c8e8c7a797..7d0a2a6a4c 100644 --- a/ApplicationLibCode/UserInterface/RiuViewerCommands.cpp +++ b/ApplicationLibCode/UserInterface/RiuViewerCommands.cpp @@ -634,7 +634,9 @@ void RiuViewerCommands::displayContextMenu( QMouseEvent* event ) menuBuilder.addSeparator(); menuBuilder << "RicExportEclipseInputGridFeature"; menuBuilder << "RicSaveEclipseInputActiveVisibleCellsFeature"; +#ifdef USE_QTCHARTS menuBuilder << "RicCreateGridStatisticsPlotFeature"; +#endif menuBuilder << "RicShowGridStatisticsFeature"; menuBuilder << "RicSelectColorResult"; } From e03bebf5fe732b4b7007692d8b11931bd4a11251 Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Thu, 1 Jul 2021 16:05:46 +0200 Subject: [PATCH 050/308] #7838 Summary: Include missing Node vector GPR in category Group --- ApplicationLibCode/FileInterface/RifOpmCommonSummary.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ApplicationLibCode/FileInterface/RifOpmCommonSummary.cpp b/ApplicationLibCode/FileInterface/RifOpmCommonSummary.cpp index f02ab4e6a9..7da8170bb3 100644 --- a/ApplicationLibCode/FileInterface/RifOpmCommonSummary.cpp +++ b/ApplicationLibCode/FileInterface/RifOpmCommonSummary.cpp @@ -274,6 +274,10 @@ RifEclipseSummaryAddress RifOpmCommonSummaryTools::createAddressFromSummaryNode( default: break; case Opm::EclIO::SummaryNode::Category::Node: + // The vector "GPR" is defined as Node + // The behavior in libecl is to use the category Group + // https://github.com/OPM/ResInsight/issues/7838 + return RifEclipseSummaryAddress::wellGroupAddress( summaryNode.keyword, summaryNode.wgname ); break; case Opm::EclIO::SummaryNode::Category::Network: return RifEclipseSummaryAddress::networkAddress( summaryNode.keyword ); From d1ecac012d3000b583c8d3b9a6bfefdf50ae73ee Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Fri, 2 Jul 2021 07:54:01 +0200 Subject: [PATCH 051/308] Janitor : Update vector count --- ApplicationLibCode/UnitTests/HDF5FileReader-Test.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ApplicationLibCode/UnitTests/HDF5FileReader-Test.cpp b/ApplicationLibCode/UnitTests/HDF5FileReader-Test.cpp index e66e74ebd1..62f54824b3 100644 --- a/ApplicationLibCode/UnitTests/HDF5FileReader-Test.cpp +++ b/ApplicationLibCode/UnitTests/HDF5FileReader-Test.cpp @@ -90,7 +90,7 @@ TEST( HDFTests, ReadOpmSummaryData ) hdf5SummaryReader.open( filePath, false, nullptr ); auto addresses = hdf5SummaryReader.allResultAddresses(); - EXPECT_EQ( size_t( 2770 ), addresses.size() ); + EXPECT_EQ( size_t( 2786 ), addresses.size() ); int itemCount = 0; size_t totalValueCount = 0; From 84bf5d5454c4fdd371bcf472ba54d7743b01fb76 Mon Sep 17 00:00:00 2001 From: Kristian Bendiksen Date: Wed, 30 Jun 2021 10:46:10 +0200 Subject: [PATCH 052/308] #7752 Statistics Plot: Add titles for x and y axis --- .../RimEnsembleFractureStatisticsPlot.cpp | 10 ++++++++++ .../RimEnsembleFractureStatisticsPlot.h | 1 + .../RimGridStatisticsPlot.cpp | 19 +++++++++++++++++++ .../ProjectDataModel/RimGridStatisticsPlot.h | 2 ++ .../ProjectDataModel/RimStatisticsPlot.cpp | 10 ++++++++++ .../ProjectDataModel/RimStatisticsPlot.h | 3 +++ 6 files changed, 45 insertions(+) diff --git a/ApplicationLibCode/ProjectDataModel/RimEnsembleFractureStatisticsPlot.cpp b/ApplicationLibCode/ProjectDataModel/RimEnsembleFractureStatisticsPlot.cpp index 18adffee19..9fa5af8421 100644 --- a/ApplicationLibCode/ProjectDataModel/RimEnsembleFractureStatisticsPlot.cpp +++ b/ApplicationLibCode/ProjectDataModel/RimEnsembleFractureStatisticsPlot.cpp @@ -164,3 +164,13 @@ QString RimEnsembleFractureStatisticsPlot::createAutoName() const return nameTags.join( ", " ); } + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +QString RimEnsembleFractureStatisticsPlot::createXAxisTitle() const +{ + if ( m_ensembleFractureStatistics() == nullptr ) return ""; + + return caf::AppEnum::uiText( m_property() ); +} diff --git a/ApplicationLibCode/ProjectDataModel/RimEnsembleFractureStatisticsPlot.h b/ApplicationLibCode/ProjectDataModel/RimEnsembleFractureStatisticsPlot.h index 8b63156f23..4a04d912fb 100644 --- a/ApplicationLibCode/ProjectDataModel/RimEnsembleFractureStatisticsPlot.h +++ b/ApplicationLibCode/ProjectDataModel/RimEnsembleFractureStatisticsPlot.h @@ -51,6 +51,7 @@ class RimEnsembleFractureStatisticsPlot : public RimStatisticsPlot bool* useOptionsOnly ) override; QString createAutoName() const override; + QString createXAxisTitle() const override; void setDefaults(); bool hasStatisticsData() const override; diff --git a/ApplicationLibCode/ProjectDataModel/RimGridStatisticsPlot.cpp b/ApplicationLibCode/ProjectDataModel/RimGridStatisticsPlot.cpp index f5cab1cd85..2c202c3abd 100644 --- a/ApplicationLibCode/ProjectDataModel/RimGridStatisticsPlot.cpp +++ b/ApplicationLibCode/ProjectDataModel/RimGridStatisticsPlot.cpp @@ -314,3 +314,22 @@ QString RimGridStatisticsPlot::timeStepString() const return ""; } + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +QString RimGridStatisticsPlot::createXAxisTitle() const +{ + if ( m_case() == nullptr ) return ""; + + QStringList nameTags; + nameTags += m_property()->resultVariable(); + + QString timeStepStr = timeStepString(); + if ( !timeStepStr.isEmpty() ) + { + nameTags += timeStepStr; + } + + return nameTags.join( ", " ); +} diff --git a/ApplicationLibCode/ProjectDataModel/RimGridStatisticsPlot.h b/ApplicationLibCode/ProjectDataModel/RimGridStatisticsPlot.h index 3aa328fe3a..0e60a92a32 100644 --- a/ApplicationLibCode/ProjectDataModel/RimGridStatisticsPlot.h +++ b/ApplicationLibCode/ProjectDataModel/RimGridStatisticsPlot.h @@ -62,6 +62,8 @@ class RimGridStatisticsPlot : public RimStatisticsPlot QString createAutoName() const override; QString timeStepString() const; + QString createXAxisTitle() const override; + void setDefaults(); bool hasStatisticsData() const override; RigHistogramData createStatisticsData() const override; diff --git a/ApplicationLibCode/ProjectDataModel/RimStatisticsPlot.cpp b/ApplicationLibCode/ProjectDataModel/RimStatisticsPlot.cpp index 2c0a26089d..8a80a77537 100644 --- a/ApplicationLibCode/ProjectDataModel/RimStatisticsPlot.cpp +++ b/ApplicationLibCode/ProjectDataModel/RimStatisticsPlot.cpp @@ -311,11 +311,13 @@ void RimStatisticsPlot::updatePlots() QValueAxis* axisX = new QValueAxis(); axisX->setRange( histogramData.min - xAxisExtension, histogramData.max + xAxisExtension ); axisX->setLabelFormat( RiaNumberFormat::sprintfFormat( m_tickNumberFormat(), m_precision ) ); + axisX->setTitleText( createXAxisTitle() ); chart->addAxis( axisX, Qt::AlignBottom ); QValueAxis* axisY = new QValueAxis(); axisY->setRange( minValue, maxValue ); axisY->setLabelFormat( RiaNumberFormat::sprintfFormat( m_tickNumberFormat(), m_precision ) ); + axisY->setTitleText( createYAxisTitle() ); chart->addAxis( axisY, Qt::AlignLeft ); if ( !std::isinf( histogramData.p10 ) ) @@ -382,3 +384,11 @@ void RimStatisticsPlot::performAutoNameUpdate() m_plotWindowTitle = name; setUiName( name ); } + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +QString RimStatisticsPlot::createYAxisTitle() const +{ + return caf::AppEnum::uiText( m_histogramFrequencyType() ); +} diff --git a/ApplicationLibCode/ProjectDataModel/RimStatisticsPlot.h b/ApplicationLibCode/ProjectDataModel/RimStatisticsPlot.h index 280af98901..e0a58f7491 100644 --- a/ApplicationLibCode/ProjectDataModel/RimStatisticsPlot.h +++ b/ApplicationLibCode/ProjectDataModel/RimStatisticsPlot.h @@ -79,6 +79,9 @@ class RimStatisticsPlot : public RimPlotWindow virtual RigHistogramData createStatisticsData() const = 0; virtual QString createAutoName() const = 0; + virtual QString createXAxisTitle() const = 0; + virtual QString createYAxisTitle() const; + void performAutoNameUpdate(); private: From 0cbfd11dc31a148cb4d2d3eec6ef65507c9904ee Mon Sep 17 00:00:00 2001 From: Kristian Bendiksen Date: Wed, 30 Jun 2021 10:53:36 +0200 Subject: [PATCH 053/308] #7751 Statistics Plot: add relative frequency percentage option --- .../ProjectDataModel/RimStatisticsPlot.cpp | 9 +++++++-- ApplicationLibCode/ProjectDataModel/RimStatisticsPlot.h | 3 ++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/ApplicationLibCode/ProjectDataModel/RimStatisticsPlot.cpp b/ApplicationLibCode/ProjectDataModel/RimStatisticsPlot.cpp index 8a80a77537..ca7ddd936f 100644 --- a/ApplicationLibCode/ProjectDataModel/RimStatisticsPlot.cpp +++ b/ApplicationLibCode/ProjectDataModel/RimStatisticsPlot.cpp @@ -55,8 +55,11 @@ namespace caf template <> void caf::AppEnum::setUp() { - addItem( RimStatisticsPlot::HistogramFrequencyType::ABSOLUTE_FREQUENCY, "ABSOLUTE_FREQUENCY", "Absolute" ); - addItem( RimStatisticsPlot::HistogramFrequencyType::RELATIVE_FREQUENCY, "RELATIVE_FREQUENCY", "Relative" ); + addItem( RimStatisticsPlot::HistogramFrequencyType::ABSOLUTE_FREQUENCY, "ABSOLUTE_FREQUENCY", "Absolute Frequency" ); + addItem( RimStatisticsPlot::HistogramFrequencyType::RELATIVE_FREQUENCY, "RELATIVE_FREQUENCY", "Relative Frequency" ); + addItem( RimStatisticsPlot::HistogramFrequencyType::RELATIVE_FREQUENCY_PERCENT, + "RELATIVE_FREQUENCY_PERCENT", + "Relative Frequency [%]" ); setDefault( RimStatisticsPlot::HistogramFrequencyType::ABSOLUTE_FREQUENCY ); } } // namespace caf @@ -290,6 +293,8 @@ void RimStatisticsPlot::updatePlots() for ( double value : histogramData.histogram ) { if ( m_histogramFrequencyType() == HistogramFrequencyType::RELATIVE_FREQUENCY ) value /= sumElements; + if ( m_histogramFrequencyType() == HistogramFrequencyType::RELATIVE_FREQUENCY_PERCENT ) + value = value / sumElements * 100.0; *set0 << value; minValue = std::min( minValue, value ); maxValue = std::max( maxValue, value ); diff --git a/ApplicationLibCode/ProjectDataModel/RimStatisticsPlot.h b/ApplicationLibCode/ProjectDataModel/RimStatisticsPlot.h index e0a58f7491..6de9a89081 100644 --- a/ApplicationLibCode/ProjectDataModel/RimStatisticsPlot.h +++ b/ApplicationLibCode/ProjectDataModel/RimStatisticsPlot.h @@ -47,7 +47,8 @@ class RimStatisticsPlot : public RimPlotWindow enum class HistogramFrequencyType { ABSOLUTE_FREQUENCY, - RELATIVE_FREQUENCY + RELATIVE_FREQUENCY, + RELATIVE_FREQUENCY_PERCENT }; RimStatisticsPlot(); From 6317489af8a55daafc6799faf02bd32e2952ced5 Mon Sep 17 00:00:00 2001 From: Kristian Bendiksen Date: Wed, 30 Jun 2021 14:01:20 +0200 Subject: [PATCH 054/308] #7666 Statistics Plot: Option to show histogram as curve --- .../ProjectDataModel/RimStatisticsPlot.cpp | 39 ++++++++++++++++--- .../ProjectDataModel/RimStatisticsPlot.h | 7 ++++ 2 files changed, 41 insertions(+), 5 deletions(-) diff --git a/ApplicationLibCode/ProjectDataModel/RimStatisticsPlot.cpp b/ApplicationLibCode/ProjectDataModel/RimStatisticsPlot.cpp index ca7ddd936f..b12d7d6715 100644 --- a/ApplicationLibCode/ProjectDataModel/RimStatisticsPlot.cpp +++ b/ApplicationLibCode/ProjectDataModel/RimStatisticsPlot.cpp @@ -62,6 +62,15 @@ void caf::AppEnum::setUp() "Relative Frequency [%]" ); setDefault( RimStatisticsPlot::HistogramFrequencyType::ABSOLUTE_FREQUENCY ); } +template <> +void caf::AppEnum::setUp() + +{ + addItem( RimStatisticsPlot::GraphType::BAR_GRAPH, "BAR_GRAPH", "Bar Graph" ); + addItem( RimStatisticsPlot::GraphType::LINE_GRAPH, "LINE_GRAPH", "Line Graph" ); + setDefault( RimStatisticsPlot::GraphType::BAR_GRAPH ); +} + } // namespace caf CAF_PDM_ABSTRACT_SOURCE_INIT( RimStatisticsPlot, "StatisticsPlot" ); @@ -77,7 +86,7 @@ RimStatisticsPlot::RimStatisticsPlot() CAF_PDM_InitField( &m_numHistogramBins, "NumHistogramBins", 50, "Number of Bins", "", "", "" ); m_numHistogramBins.uiCapability()->setUiEditorTypeName( caf::PdmUiLineEditor::uiEditorTypeName() ); - CAF_PDM_InitField( &m_histogramBarColor, "HistogramBarColor", cvf::Color3f( cvf::Color3f::SKY_BLUE ), "Bar Color", "", "", "" ); + CAF_PDM_InitField( &m_histogramBarColor, "HistogramBarColor", cvf::Color3f( cvf::Color3f::SKY_BLUE ), "Color", "", "", "" ); CAF_PDM_InitField( &m_histogramGapWidth, "HistogramGapWidth", 0.0, "Gap Width [%]", "", "", "" ); m_histogramGapWidth.uiCapability()->setUiEditorTypeName( caf::PdmUiDoubleSliderEditor::uiEditorTypeName() ); @@ -99,6 +108,8 @@ RimStatisticsPlot::RimStatisticsPlot() "", "" ); + CAF_PDM_InitFieldNoDefault( &m_graphType, "GraphType", "Graph Type", "", "", "" ); + m_plotLegendsHorizontal.uiCapability()->setUiHidden( true ); setDeletable( true ); @@ -166,6 +177,7 @@ QImage RimStatisticsPlot::snapshotWindowContent() QWidget* RimStatisticsPlot::createViewWidget( QWidget* mainWindowParent ) { m_viewer = new RiuQtChartView( this, mainWindowParent ); + m_viewer->setRenderHint( QPainter::Antialiasing ); return m_viewer; } @@ -248,7 +260,8 @@ void RimStatisticsPlot::uiOrderingForHistogram( QString uiConfigName, caf::PdmUi caf::PdmUiGroup* histogramGroup = uiOrdering.addNewGroup( "Histogram" ); if ( showHistogramBins ) histogramGroup->add( &m_numHistogramBins ); histogramGroup->add( &m_histogramBarColor ); - histogramGroup->add( &m_histogramGapWidth ); + histogramGroup->add( &m_graphType ); + if ( m_graphType == GraphType::BAR_GRAPH ) histogramGroup->add( &m_histogramGapWidth ); histogramGroup->add( &m_histogramFrequencyType ); histogramGroup->add( &m_precision ); histogramGroup->add( &m_tickNumberFormat ); @@ -280,33 +293,49 @@ void RimStatisticsPlot::updatePlots() double minValue = std::numeric_limits::max(); double maxValue = -std::numeric_limits::max(); + QColor color = RiaColorTools::toQColor( m_histogramBarColor ); + // Make border same color as bar when user wants max bar width if ( m_histogramGapWidth() == 0.0 ) { - set0->setBorderColor( RiaColorTools::toQColor( m_histogramBarColor ) ); + set0->setBorderColor( color ); } double sumElements = 0.0; for ( double value : histogramData.histogram ) sumElements += value; + QLineSeries* lineSeries = new QLineSeries(); + lineSeries->setName( m_plotWindowTitle ); + + QPen pen( color ); + pen.setWidth( 2 ); + lineSeries->setPen( pen ); + + double binSize = ( histogramData.max - histogramData.min ) / histogramData.histogram.size(); + double binCenter = histogramData.min; for ( double value : histogramData.histogram ) { if ( m_histogramFrequencyType() == HistogramFrequencyType::RELATIVE_FREQUENCY ) value /= sumElements; if ( m_histogramFrequencyType() == HistogramFrequencyType::RELATIVE_FREQUENCY_PERCENT ) value = value / sumElements * 100.0; *set0 << value; + *lineSeries << QPointF( binCenter, value ); + binCenter += binSize; + minValue = std::min( minValue, value ); maxValue = std::max( maxValue, value ); } - set0->setColor( RiaColorTools::toQColor( m_histogramBarColor ) ); + set0->setColor( color ); + lineSeries->setColor( color ); QBarSeries* series = new QBarSeries(); series->setBarWidth( ( 100.0 - m_histogramGapWidth() ) / 100.0 ); series->append( set0 ); QChart* chart = new QChart(); - chart->addSeries( series ); + if ( m_graphType == GraphType::BAR_GRAPH ) chart->addSeries( series ); + if ( m_graphType == GraphType::LINE_GRAPH ) chart->addSeries( lineSeries ); chart->setTitle( uiName() ); // Axis diff --git a/ApplicationLibCode/ProjectDataModel/RimStatisticsPlot.h b/ApplicationLibCode/ProjectDataModel/RimStatisticsPlot.h index 6de9a89081..5dc44b7a37 100644 --- a/ApplicationLibCode/ProjectDataModel/RimStatisticsPlot.h +++ b/ApplicationLibCode/ProjectDataModel/RimStatisticsPlot.h @@ -51,6 +51,12 @@ class RimStatisticsPlot : public RimPlotWindow RELATIVE_FREQUENCY_PERCENT }; + enum class GraphType + { + BAR_GRAPH, + LINE_GRAPH + }; + RimStatisticsPlot(); ~RimStatisticsPlot() override; @@ -101,4 +107,5 @@ class RimStatisticsPlot : public RimPlotWindow caf::PdmField> m_histogramFrequencyType; caf::PdmField m_precision; caf::PdmField> m_tickNumberFormat; + caf::PdmField> m_graphType; }; From ca0433ca3a1787a2cc6ca519ef144a7873afe748 Mon Sep 17 00:00:00 2001 From: jonjenssen Date: Tue, 13 Jul 2021 16:58:02 +0200 Subject: [PATCH 055/308] Move well related pdm files into subfolders to clean up a bit --- ApplicationLibCode/CMakeLists.txt | 6 ++ .../ProjectDataModel/CMakeLists_files.cmake | 84 ------------------- .../WellLog/CMakeLists_files.cmake | 64 ++++++++++++++ .../{ => WellLog}/Rim3dWellLogCurve.cpp | 0 .../{ => WellLog}/Rim3dWellLogCurve.h | 0 .../Rim3dWellLogExtractionCurve.cpp | 0 .../Rim3dWellLogExtractionCurve.h | 0 .../{ => WellLog}/Rim3dWellLogFileCurve.cpp | 0 .../{ => WellLog}/Rim3dWellLogFileCurve.h | 0 .../{ => WellLog}/Rim3dWellLogRftCurve.cpp | 0 .../{ => WellLog}/Rim3dWellLogRftCurve.h | 0 .../RimEnsembleWellLogCurveSet.cpp | 0 .../RimEnsembleWellLogCurveSet.h | 0 .../RimEnsembleWellLogStatistics.cpp | 0 .../RimEnsembleWellLogStatistics.h | 0 .../RimEnsembleWellLogStatisticsCurve.cpp | 0 .../RimEnsembleWellLogStatisticsCurve.h | 0 .../{ => WellLog}/RimEnsembleWellLogs.cpp | 0 .../{ => WellLog}/RimEnsembleWellLogs.h | 0 .../RimEnsembleWellLogsCollection.cpp | 0 .../RimEnsembleWellLogsCollection.h | 0 .../{ => WellLog}/RimWellLogCurve.cpp | 0 .../{ => WellLog}/RimWellLogCurve.h | 0 .../RimWellLogCurveCommonDataSource.cpp | 0 .../RimWellLogCurveCommonDataSource.h | 0 .../RimWellLogExtractionCurve.cpp | 0 .../{ => WellLog}/RimWellLogExtractionCurve.h | 0 .../RimWellLogExtractionCurveNameConfig.cpp | 0 .../RimWellLogExtractionCurveNameConfig.h | 0 .../{ => WellLog}/RimWellLogFile.cpp | 0 .../{ => WellLog}/RimWellLogFile.h | 0 .../{ => WellLog}/RimWellLogFileChannel.cpp | 0 .../{ => WellLog}/RimWellLogFileChannel.h | 0 .../{ => WellLog}/RimWellLogFileCurve.cpp | 0 .../{ => WellLog}/RimWellLogFileCurve.h | 0 .../RimWellLogFileCurveNameConfig.cpp | 0 .../RimWellLogFileCurveNameConfig.h | 0 .../{ => WellLog}/RimWellLogPlot.cpp | 0 .../{ => WellLog}/RimWellLogPlot.h | 0 .../RimWellLogPlotCollection.cpp | 0 .../{ => WellLog}/RimWellLogPlotCollection.h | 0 .../RimWellLogPlotNameConfig.cpp | 0 .../{ => WellLog}/RimWellLogPlotNameConfig.h | 0 .../{ => WellLog}/RimWellLogRftCurve.cpp | 0 .../{ => WellLog}/RimWellLogRftCurve.h | 0 .../RimWellLogRftCurveNameConfig.cpp | 0 .../RimWellLogRftCurveNameConfig.h | 0 .../{ => WellLog}/RimWellLogTrack.cpp | 0 .../{ => WellLog}/RimWellLogTrack.h | 0 .../{ => WellLog}/RimWellLogWbsCurve.cpp | 0 .../{ => WellLog}/RimWellLogWbsCurve.h | 0 .../WellMeasurement/CMakeLists_files.cmake | 30 +++++++ .../RimWellMeasurement.cpp | 0 .../RimWellMeasurement.h | 0 .../RimWellMeasurementCollection.cpp | 0 .../RimWellMeasurementCollection.h | 0 .../RimWellMeasurementCurve.cpp | 0 .../RimWellMeasurementCurve.h | 0 .../RimWellMeasurementFilePath.cpp | 0 .../RimWellMeasurementFilePath.h | 0 .../RimWellMeasurementFilter.cpp | 0 .../RimWellMeasurementFilter.h | 0 .../RimWellMeasurementInView.cpp | 0 .../RimWellMeasurementInView.h | 0 .../RimWellMeasurementInViewCollection.cpp | 0 .../RimWellMeasurementInViewCollection.h | 0 .../WellPath/CMakeLists_files.cmake | 38 +++++++++ .../{ => WellPath}/RimFileWellPath.cpp | 0 .../{ => WellPath}/RimFileWellPath.h | 0 .../{ => WellPath}/RimModeledWellPath.cpp | 0 .../{ => WellPath}/RimModeledWellPath.h | 0 .../{ => WellPath}/RimWellPath.cpp | 0 .../{ => WellPath}/RimWellPath.h | 0 .../{ => WellPath}/RimWellPathAttribute.cpp | 0 .../{ => WellPath}/RimWellPathAttribute.h | 0 .../RimWellPathAttributeCollection.cpp | 0 .../RimWellPathAttributeCollection.h | 0 .../{ => WellPath}/RimWellPathCollection.cpp | 0 .../{ => WellPath}/RimWellPathCollection.h | 0 .../{ => WellPath}/RimWellPathGeometryDef.cpp | 0 .../{ => WellPath}/RimWellPathGeometryDef.h | 0 .../RimWellPathGeometryDefTools.cpp | 0 .../RimWellPathGeometryDefTools.h | 0 .../{ => WellPath}/RimWellPathGroup.cpp | 0 .../{ => WellPath}/RimWellPathGroup.h | 0 .../{ => WellPath}/RimWellPathTarget.cpp | 0 .../{ => WellPath}/RimWellPathTarget.h | 0 .../{ => WellPath}/RimWellPathTieIn.cpp | 0 .../{ => WellPath}/RimWellPathTieIn.h | 0 89 files changed, 138 insertions(+), 84 deletions(-) create mode 100644 ApplicationLibCode/ProjectDataModel/WellLog/CMakeLists_files.cmake rename ApplicationLibCode/ProjectDataModel/{ => WellLog}/Rim3dWellLogCurve.cpp (100%) rename ApplicationLibCode/ProjectDataModel/{ => WellLog}/Rim3dWellLogCurve.h (100%) rename ApplicationLibCode/ProjectDataModel/{ => WellLog}/Rim3dWellLogExtractionCurve.cpp (100%) rename ApplicationLibCode/ProjectDataModel/{ => WellLog}/Rim3dWellLogExtractionCurve.h (100%) rename ApplicationLibCode/ProjectDataModel/{ => WellLog}/Rim3dWellLogFileCurve.cpp (100%) rename ApplicationLibCode/ProjectDataModel/{ => WellLog}/Rim3dWellLogFileCurve.h (100%) rename ApplicationLibCode/ProjectDataModel/{ => WellLog}/Rim3dWellLogRftCurve.cpp (100%) rename ApplicationLibCode/ProjectDataModel/{ => WellLog}/Rim3dWellLogRftCurve.h (100%) rename ApplicationLibCode/ProjectDataModel/{ => WellLog}/RimEnsembleWellLogCurveSet.cpp (100%) rename ApplicationLibCode/ProjectDataModel/{ => WellLog}/RimEnsembleWellLogCurveSet.h (100%) rename ApplicationLibCode/ProjectDataModel/{ => WellLog}/RimEnsembleWellLogStatistics.cpp (100%) rename ApplicationLibCode/ProjectDataModel/{ => WellLog}/RimEnsembleWellLogStatistics.h (100%) rename ApplicationLibCode/ProjectDataModel/{ => WellLog}/RimEnsembleWellLogStatisticsCurve.cpp (100%) rename ApplicationLibCode/ProjectDataModel/{ => WellLog}/RimEnsembleWellLogStatisticsCurve.h (100%) rename ApplicationLibCode/ProjectDataModel/{ => WellLog}/RimEnsembleWellLogs.cpp (100%) rename ApplicationLibCode/ProjectDataModel/{ => WellLog}/RimEnsembleWellLogs.h (100%) rename ApplicationLibCode/ProjectDataModel/{ => WellLog}/RimEnsembleWellLogsCollection.cpp (100%) rename ApplicationLibCode/ProjectDataModel/{ => WellLog}/RimEnsembleWellLogsCollection.h (100%) rename ApplicationLibCode/ProjectDataModel/{ => WellLog}/RimWellLogCurve.cpp (100%) rename ApplicationLibCode/ProjectDataModel/{ => WellLog}/RimWellLogCurve.h (100%) rename ApplicationLibCode/ProjectDataModel/{ => WellLog}/RimWellLogCurveCommonDataSource.cpp (100%) rename ApplicationLibCode/ProjectDataModel/{ => WellLog}/RimWellLogCurveCommonDataSource.h (100%) rename ApplicationLibCode/ProjectDataModel/{ => WellLog}/RimWellLogExtractionCurve.cpp (100%) rename ApplicationLibCode/ProjectDataModel/{ => WellLog}/RimWellLogExtractionCurve.h (100%) rename ApplicationLibCode/ProjectDataModel/{ => WellLog}/RimWellLogExtractionCurveNameConfig.cpp (100%) rename ApplicationLibCode/ProjectDataModel/{ => WellLog}/RimWellLogExtractionCurveNameConfig.h (100%) rename ApplicationLibCode/ProjectDataModel/{ => WellLog}/RimWellLogFile.cpp (100%) rename ApplicationLibCode/ProjectDataModel/{ => WellLog}/RimWellLogFile.h (100%) rename ApplicationLibCode/ProjectDataModel/{ => WellLog}/RimWellLogFileChannel.cpp (100%) rename ApplicationLibCode/ProjectDataModel/{ => WellLog}/RimWellLogFileChannel.h (100%) rename ApplicationLibCode/ProjectDataModel/{ => WellLog}/RimWellLogFileCurve.cpp (100%) rename ApplicationLibCode/ProjectDataModel/{ => WellLog}/RimWellLogFileCurve.h (100%) rename ApplicationLibCode/ProjectDataModel/{ => WellLog}/RimWellLogFileCurveNameConfig.cpp (100%) rename ApplicationLibCode/ProjectDataModel/{ => WellLog}/RimWellLogFileCurveNameConfig.h (100%) rename ApplicationLibCode/ProjectDataModel/{ => WellLog}/RimWellLogPlot.cpp (100%) rename ApplicationLibCode/ProjectDataModel/{ => WellLog}/RimWellLogPlot.h (100%) rename ApplicationLibCode/ProjectDataModel/{ => WellLog}/RimWellLogPlotCollection.cpp (100%) rename ApplicationLibCode/ProjectDataModel/{ => WellLog}/RimWellLogPlotCollection.h (100%) rename ApplicationLibCode/ProjectDataModel/{ => WellLog}/RimWellLogPlotNameConfig.cpp (100%) rename ApplicationLibCode/ProjectDataModel/{ => WellLog}/RimWellLogPlotNameConfig.h (100%) rename ApplicationLibCode/ProjectDataModel/{ => WellLog}/RimWellLogRftCurve.cpp (100%) rename ApplicationLibCode/ProjectDataModel/{ => WellLog}/RimWellLogRftCurve.h (100%) rename ApplicationLibCode/ProjectDataModel/{ => WellLog}/RimWellLogRftCurveNameConfig.cpp (100%) rename ApplicationLibCode/ProjectDataModel/{ => WellLog}/RimWellLogRftCurveNameConfig.h (100%) rename ApplicationLibCode/ProjectDataModel/{ => WellLog}/RimWellLogTrack.cpp (100%) rename ApplicationLibCode/ProjectDataModel/{ => WellLog}/RimWellLogTrack.h (100%) rename ApplicationLibCode/ProjectDataModel/{ => WellLog}/RimWellLogWbsCurve.cpp (100%) rename ApplicationLibCode/ProjectDataModel/{ => WellLog}/RimWellLogWbsCurve.h (100%) create mode 100644 ApplicationLibCode/ProjectDataModel/WellMeasurement/CMakeLists_files.cmake rename ApplicationLibCode/ProjectDataModel/{ => WellMeasurement}/RimWellMeasurement.cpp (100%) rename ApplicationLibCode/ProjectDataModel/{ => WellMeasurement}/RimWellMeasurement.h (100%) rename ApplicationLibCode/ProjectDataModel/{ => WellMeasurement}/RimWellMeasurementCollection.cpp (100%) rename ApplicationLibCode/ProjectDataModel/{ => WellMeasurement}/RimWellMeasurementCollection.h (100%) rename ApplicationLibCode/ProjectDataModel/{ => WellMeasurement}/RimWellMeasurementCurve.cpp (100%) rename ApplicationLibCode/ProjectDataModel/{ => WellMeasurement}/RimWellMeasurementCurve.h (100%) rename ApplicationLibCode/ProjectDataModel/{ => WellMeasurement}/RimWellMeasurementFilePath.cpp (100%) rename ApplicationLibCode/ProjectDataModel/{ => WellMeasurement}/RimWellMeasurementFilePath.h (100%) rename ApplicationLibCode/ProjectDataModel/{ => WellMeasurement}/RimWellMeasurementFilter.cpp (100%) rename ApplicationLibCode/ProjectDataModel/{ => WellMeasurement}/RimWellMeasurementFilter.h (100%) rename ApplicationLibCode/ProjectDataModel/{ => WellMeasurement}/RimWellMeasurementInView.cpp (100%) rename ApplicationLibCode/ProjectDataModel/{ => WellMeasurement}/RimWellMeasurementInView.h (100%) rename ApplicationLibCode/ProjectDataModel/{ => WellMeasurement}/RimWellMeasurementInViewCollection.cpp (100%) rename ApplicationLibCode/ProjectDataModel/{ => WellMeasurement}/RimWellMeasurementInViewCollection.h (100%) create mode 100644 ApplicationLibCode/ProjectDataModel/WellPath/CMakeLists_files.cmake rename ApplicationLibCode/ProjectDataModel/{ => WellPath}/RimFileWellPath.cpp (100%) rename ApplicationLibCode/ProjectDataModel/{ => WellPath}/RimFileWellPath.h (100%) rename ApplicationLibCode/ProjectDataModel/{ => WellPath}/RimModeledWellPath.cpp (100%) rename ApplicationLibCode/ProjectDataModel/{ => WellPath}/RimModeledWellPath.h (100%) rename ApplicationLibCode/ProjectDataModel/{ => WellPath}/RimWellPath.cpp (100%) rename ApplicationLibCode/ProjectDataModel/{ => WellPath}/RimWellPath.h (100%) rename ApplicationLibCode/ProjectDataModel/{ => WellPath}/RimWellPathAttribute.cpp (100%) rename ApplicationLibCode/ProjectDataModel/{ => WellPath}/RimWellPathAttribute.h (100%) rename ApplicationLibCode/ProjectDataModel/{ => WellPath}/RimWellPathAttributeCollection.cpp (100%) rename ApplicationLibCode/ProjectDataModel/{ => WellPath}/RimWellPathAttributeCollection.h (100%) rename ApplicationLibCode/ProjectDataModel/{ => WellPath}/RimWellPathCollection.cpp (100%) rename ApplicationLibCode/ProjectDataModel/{ => WellPath}/RimWellPathCollection.h (100%) rename ApplicationLibCode/ProjectDataModel/{ => WellPath}/RimWellPathGeometryDef.cpp (100%) rename ApplicationLibCode/ProjectDataModel/{ => WellPath}/RimWellPathGeometryDef.h (100%) rename ApplicationLibCode/ProjectDataModel/{ => WellPath}/RimWellPathGeometryDefTools.cpp (100%) rename ApplicationLibCode/ProjectDataModel/{ => WellPath}/RimWellPathGeometryDefTools.h (100%) rename ApplicationLibCode/ProjectDataModel/{ => WellPath}/RimWellPathGroup.cpp (100%) rename ApplicationLibCode/ProjectDataModel/{ => WellPath}/RimWellPathGroup.h (100%) rename ApplicationLibCode/ProjectDataModel/{ => WellPath}/RimWellPathTarget.cpp (100%) rename ApplicationLibCode/ProjectDataModel/{ => WellPath}/RimWellPathTarget.h (100%) rename ApplicationLibCode/ProjectDataModel/{ => WellPath}/RimWellPathTieIn.cpp (100%) rename ApplicationLibCode/ProjectDataModel/{ => WellPath}/RimWellPathTieIn.h (100%) diff --git a/ApplicationLibCode/CMakeLists.txt b/ApplicationLibCode/CMakeLists.txt index 61668112a2..9a1b94fd50 100644 --- a/ApplicationLibCode/CMakeLists.txt +++ b/ApplicationLibCode/CMakeLists.txt @@ -109,6 +109,9 @@ include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/ProjectDataModel/Streamlines ${CMAKE_CURRENT_SOURCE_DIR}/ProjectDataModel/CellFilters ${CMAKE_CURRENT_SOURCE_DIR}/ProjectDataModel/ProcessControl + ${CMAKE_CURRENT_SOURCE_DIR}/ProjectDataModel/WellLog + ${CMAKE_CURRENT_SOURCE_DIR}/ProjectDataModel/WellMeasurement + ${CMAKE_CURRENT_SOURCE_DIR}/ProjectDataModel/WellPath ${CMAKE_CURRENT_SOURCE_DIR}/ProjectDataModelCommands ${CMAKE_CURRENT_SOURCE_DIR}/ResultStatisticsCache ${CMAKE_CURRENT_SOURCE_DIR}/ReservoirDataModel @@ -177,6 +180,9 @@ list( ProjectDataModel/Surfaces/CMakeLists_files.cmake ProjectDataModel/CellFilters/CMakeLists_files.cmake ProjectDataModel/ProcessControl/CMakeLists_files.cmake + ProjectDataModel/WellLog/CMakeLists_files.cmake + ProjectDataModel/WellMeasurement/CMakeLists_files.cmake + ProjectDataModel/WellPath/CMakeLists_files.cmake ProjectDataModelCommands/CMakeLists_files.cmake GeoMech/GeoMechVisualization/CMakeLists_files.cmake ModelVisualization/CMakeLists_files.cmake diff --git a/ApplicationLibCode/ProjectDataModel/CMakeLists_files.cmake b/ApplicationLibCode/ProjectDataModel/CMakeLists_files.cmake index 653f3dd8f6..245d4fb7a5 100644 --- a/ApplicationLibCode/ProjectDataModel/CMakeLists_files.cmake +++ b/ApplicationLibCode/ProjectDataModel/CMakeLists_files.cmake @@ -19,19 +19,6 @@ ${CMAKE_CURRENT_LIST_DIR}/RimCellEdgeColors.h ${CMAKE_CURRENT_LIST_DIR}/RimSimWellInView.h ${CMAKE_CURRENT_LIST_DIR}/RimSimWellInViewCollection.h ${CMAKE_CURRENT_LIST_DIR}/RimSimWellInViewTools.h -${CMAKE_CURRENT_LIST_DIR}/RimWellPath.h -${CMAKE_CURRENT_LIST_DIR}/RimWellPathGroup.h -${CMAKE_CURRENT_LIST_DIR}/RimFileWellPath.h -${CMAKE_CURRENT_LIST_DIR}/RimModeledWellPath.h -${CMAKE_CURRENT_LIST_DIR}/RimWellMeasurement.h -${CMAKE_CURRENT_LIST_DIR}/RimWellMeasurementCollection.h -${CMAKE_CURRENT_LIST_DIR}/RimWellMeasurementFilePath.h -${CMAKE_CURRENT_LIST_DIR}/RimWellPathGeometryDef.h -${CMAKE_CURRENT_LIST_DIR}/RimWellPathGeometryDefTools.h -${CMAKE_CURRENT_LIST_DIR}/RimWellPathAttribute.h -${CMAKE_CURRENT_LIST_DIR}/RimWellPathAttributeCollection.h -${CMAKE_CURRENT_LIST_DIR}/RimWellPathCollection.h -${CMAKE_CURRENT_LIST_DIR}/RimWellPathTarget.h ${CMAKE_CURRENT_LIST_DIR}/RimScriptCollection.h ${CMAKE_CURRENT_LIST_DIR}/RimEclipseStatisticsCase.h ${CMAKE_CURRENT_LIST_DIR}/RimEclipseStatisticsCaseCollection.h @@ -60,7 +47,6 @@ ${CMAKE_CURRENT_LIST_DIR}/RimViewManipulator.h ${CMAKE_CURRENT_LIST_DIR}/RimCase.h ${CMAKE_CURRENT_LIST_DIR}/RimViewController.h ${CMAKE_CURRENT_LIST_DIR}/RimMainPlotCollection.h -${CMAKE_CURRENT_LIST_DIR}/RimWellLogPlotCollection.h ${CMAKE_CURRENT_LIST_DIR}/RimRftPlotCollection.h ${CMAKE_CURRENT_LIST_DIR}/RimPltPlotCollection.h ${CMAKE_CURRENT_LIST_DIR}/RimVfpPlotCollection.h @@ -69,20 +55,11 @@ ${CMAKE_CURRENT_LIST_DIR}/RimVfpDefines.h ${CMAKE_CURRENT_LIST_DIR}/RimPlot.h ${CMAKE_CURRENT_LIST_DIR}/RimPlotWindow.h ${CMAKE_CURRENT_LIST_DIR}/RimMultiPlot.h -${CMAKE_CURRENT_LIST_DIR}/RimWellLogPlot.h ${CMAKE_CURRENT_LIST_DIR}/RimDepthTrackPlot.h -${CMAKE_CURRENT_LIST_DIR}/RimWellLogTrack.h -${CMAKE_CURRENT_LIST_DIR}/RimWellLogCurve.h ${CMAKE_CURRENT_LIST_DIR}/RimWellBoreStabilityPlot.h ${CMAKE_CURRENT_LIST_DIR}/RimWbsParameters.h ${CMAKE_CURRENT_LIST_DIR}/RimViewLinker.h ${CMAKE_CURRENT_LIST_DIR}/RimViewLinkerCollection.h -${CMAKE_CURRENT_LIST_DIR}/RimWellLogExtractionCurve.h -${CMAKE_CURRENT_LIST_DIR}/RimWellLogFile.h -${CMAKE_CURRENT_LIST_DIR}/RimWellLogFileChannel.h -${CMAKE_CURRENT_LIST_DIR}/RimWellLogFileCurve.h -${CMAKE_CURRENT_LIST_DIR}/RimWellLogRftCurve.h -${CMAKE_CURRENT_LIST_DIR}/RimWellLogWbsCurve.h ${CMAKE_CURRENT_LIST_DIR}/RimIntersection.h ${CMAKE_CURRENT_LIST_DIR}/RimExtrudedCurveIntersection.h ${CMAKE_CURRENT_LIST_DIR}/RimIntersectionCollection.h @@ -108,19 +85,10 @@ ${CMAKE_CURRENT_LIST_DIR}/RimSummaryCalculationCollection.h ${CMAKE_CURRENT_LIST_DIR}/RimSummaryCalculationVariable.h ${CMAKE_CURRENT_LIST_DIR}/RimStimPlanLegendConfig.h ${CMAKE_CURRENT_LIST_DIR}/RimStimPlanColors.h -${CMAKE_CURRENT_LIST_DIR}/Rim3dWellLogCurve.h -${CMAKE_CURRENT_LIST_DIR}/Rim3dWellLogFileCurve.h -${CMAKE_CURRENT_LIST_DIR}/Rim3dWellLogExtractionCurve.h -${CMAKE_CURRENT_LIST_DIR}/Rim3dWellLogRftCurve.h ${CMAKE_CURRENT_LIST_DIR}/RimVirtualPerforationResults.h ${CMAKE_CURRENT_LIST_DIR}/RimLegendConfig.h ${CMAKE_CURRENT_LIST_DIR}/RimNameConfig.h -${CMAKE_CURRENT_LIST_DIR}/RimWellLogPlotNameConfig.h -${CMAKE_CURRENT_LIST_DIR}/RimWellLogExtractionCurveNameConfig.h -${CMAKE_CURRENT_LIST_DIR}/RimWellLogFileCurveNameConfig.h -${CMAKE_CURRENT_LIST_DIR}/RimWellLogRftCurveNameConfig.h ${CMAKE_CURRENT_LIST_DIR}/RimDataSourceSteppingTools.h -${CMAKE_CURRENT_LIST_DIR}/RimWellLogCurveCommonDataSource.h ${CMAKE_CURRENT_LIST_DIR}/RimContourMapProjection.h ${CMAKE_CURRENT_LIST_DIR}/RimEclipseContourMapProjection.h ${CMAKE_CURRENT_LIST_DIR}/RimEclipseContourMapView.h @@ -134,10 +102,6 @@ ${CMAKE_CURRENT_LIST_DIR}/RimPlotAxisAnnotation.h ${CMAKE_CURRENT_LIST_DIR}/RimObservedDataCollection.h ${CMAKE_CURRENT_LIST_DIR}/RimObservedFmuRftData.h ${CMAKE_CURRENT_LIST_DIR}/RimMultiPlotCollection.h -${CMAKE_CURRENT_LIST_DIR}/RimWellMeasurementCurve.h -${CMAKE_CURRENT_LIST_DIR}/RimWellMeasurementFilter.h -${CMAKE_CURRENT_LIST_DIR}/RimWellMeasurementInViewCollection.h -${CMAKE_CURRENT_LIST_DIR}/RimWellMeasurementInView.h ${CMAKE_CURRENT_LIST_DIR}/RimWellDiskConfig.h ${CMAKE_CURRENT_LIST_DIR}/RimElementVectorResult.h ${CMAKE_CURRENT_LIST_DIR}/RimColorLegendCollection.h @@ -153,13 +117,7 @@ ${CMAKE_CURRENT_LIST_DIR}/RimCustomObjectiveFunctionWeight.h ${CMAKE_CURRENT_LIST_DIR}/RimEquilibriumAxisAnnotation.h ${CMAKE_CURRENT_LIST_DIR}/RimTimeAxisAnnotation.h ${CMAKE_CURRENT_LIST_DIR}/RimPolylinesDataInterface.h -${CMAKE_CURRENT_LIST_DIR}/RimEnsembleWellLogs.h -${CMAKE_CURRENT_LIST_DIR}/RimEnsembleWellLogsCollection.h ${CMAKE_CURRENT_LIST_DIR}/RimEnsembleCurveSetInterface.h -${CMAKE_CURRENT_LIST_DIR}/RimEnsembleWellLogCurveSet.h -${CMAKE_CURRENT_LIST_DIR}/RimEnsembleWellLogStatistics.h -${CMAKE_CURRENT_LIST_DIR}/RimEnsembleWellLogStatisticsCurve.h -${CMAKE_CURRENT_LIST_DIR}/RimWellPathTieIn.h ${CMAKE_CURRENT_LIST_DIR}/cafTreeNode.h ${CMAKE_CURRENT_LIST_DIR}/RimMultipleLocations.h ) @@ -184,19 +142,6 @@ ${CMAKE_CURRENT_LIST_DIR}/RimCellEdgeColors.cpp ${CMAKE_CURRENT_LIST_DIR}/RimSimWellInView.cpp ${CMAKE_CURRENT_LIST_DIR}/RimSimWellInViewCollection.cpp ${CMAKE_CURRENT_LIST_DIR}/RimSimWellInViewTools.cpp -${CMAKE_CURRENT_LIST_DIR}/RimWellPath.cpp -${CMAKE_CURRENT_LIST_DIR}/RimWellPathGroup.cpp -${CMAKE_CURRENT_LIST_DIR}/RimFileWellPath.cpp -${CMAKE_CURRENT_LIST_DIR}/RimModeledWellPath.cpp -${CMAKE_CURRENT_LIST_DIR}/RimWellMeasurement.cpp -${CMAKE_CURRENT_LIST_DIR}/RimWellMeasurementCollection.cpp -${CMAKE_CURRENT_LIST_DIR}/RimWellMeasurementFilePath.cpp -${CMAKE_CURRENT_LIST_DIR}/RimWellPathGeometryDef.cpp -${CMAKE_CURRENT_LIST_DIR}/RimWellPathGeometryDefTools.cpp -${CMAKE_CURRENT_LIST_DIR}/RimWellPathAttribute.cpp -${CMAKE_CURRENT_LIST_DIR}/RimWellPathAttributeCollection.cpp -${CMAKE_CURRENT_LIST_DIR}/RimWellPathCollection.cpp -${CMAKE_CURRENT_LIST_DIR}/RimWellPathTarget.cpp ${CMAKE_CURRENT_LIST_DIR}/RimScriptCollection.cpp ${CMAKE_CURRENT_LIST_DIR}/RimEclipseStatisticsCase.cpp ${CMAKE_CURRENT_LIST_DIR}/RimEclipseStatisticsCaseCollection.cpp @@ -226,7 +171,6 @@ ${CMAKE_CURRENT_LIST_DIR}/RimViewManipulator.cpp ${CMAKE_CURRENT_LIST_DIR}/RimCase.cpp ${CMAKE_CURRENT_LIST_DIR}/RimViewController.cpp ${CMAKE_CURRENT_LIST_DIR}/RimMainPlotCollection.cpp -${CMAKE_CURRENT_LIST_DIR}/RimWellLogPlotCollection.cpp ${CMAKE_CURRENT_LIST_DIR}/RimRftPlotCollection.cpp ${CMAKE_CURRENT_LIST_DIR}/RimPltPlotCollection.cpp ${CMAKE_CURRENT_LIST_DIR}/RimVfpPlotCollection.cpp @@ -235,20 +179,11 @@ ${CMAKE_CURRENT_LIST_DIR}/RimVfpDefines.cpp ${CMAKE_CURRENT_LIST_DIR}/RimPlot.cpp ${CMAKE_CURRENT_LIST_DIR}/RimPlotWindow.cpp ${CMAKE_CURRENT_LIST_DIR}/RimMultiPlot.cpp -${CMAKE_CURRENT_LIST_DIR}/RimWellLogPlot.cpp ${CMAKE_CURRENT_LIST_DIR}/RimDepthTrackPlot.cpp ${CMAKE_CURRENT_LIST_DIR}/RimWellBoreStabilityPlot.cpp ${CMAKE_CURRENT_LIST_DIR}/RimWbsParameters.cpp -${CMAKE_CURRENT_LIST_DIR}/RimWellLogTrack.cpp -${CMAKE_CURRENT_LIST_DIR}/RimWellLogCurve.cpp ${CMAKE_CURRENT_LIST_DIR}/RimViewLinker.cpp ${CMAKE_CURRENT_LIST_DIR}/RimViewLinkerCollection.cpp -${CMAKE_CURRENT_LIST_DIR}/RimWellLogExtractionCurve.cpp -${CMAKE_CURRENT_LIST_DIR}/RimWellLogFile.cpp -${CMAKE_CURRENT_LIST_DIR}/RimWellLogFileChannel.cpp -${CMAKE_CURRENT_LIST_DIR}/RimWellLogFileCurve.cpp -${CMAKE_CURRENT_LIST_DIR}/RimWellLogRftCurve.cpp -${CMAKE_CURRENT_LIST_DIR}/RimWellLogWbsCurve.cpp ${CMAKE_CURRENT_LIST_DIR}/RimIntersection.cpp ${CMAKE_CURRENT_LIST_DIR}/RimExtrudedCurveIntersection.cpp ${CMAKE_CURRENT_LIST_DIR}/RimIntersectionCollection.cpp @@ -274,19 +209,10 @@ ${CMAKE_CURRENT_LIST_DIR}/RimSummaryCalculationCollection.cpp ${CMAKE_CURRENT_LIST_DIR}/RimSummaryCalculationVariable.cpp ${CMAKE_CURRENT_LIST_DIR}/RimStimPlanLegendConfig.cpp ${CMAKE_CURRENT_LIST_DIR}/RimStimPlanColors.cpp -${CMAKE_CURRENT_LIST_DIR}/Rim3dWellLogCurve.cpp -${CMAKE_CURRENT_LIST_DIR}/Rim3dWellLogFileCurve.cpp -${CMAKE_CURRENT_LIST_DIR}/Rim3dWellLogExtractionCurve.cpp -${CMAKE_CURRENT_LIST_DIR}/Rim3dWellLogRftCurve.cpp ${CMAKE_CURRENT_LIST_DIR}/RimVirtualPerforationResults.cpp ${CMAKE_CURRENT_LIST_DIR}/RimLegendConfig.cpp ${CMAKE_CURRENT_LIST_DIR}/RimNameConfig.cpp -${CMAKE_CURRENT_LIST_DIR}/RimWellLogPlotNameConfig.cpp -${CMAKE_CURRENT_LIST_DIR}/RimWellLogExtractionCurveNameConfig.cpp -${CMAKE_CURRENT_LIST_DIR}/RimWellLogFileCurveNameConfig.cpp -${CMAKE_CURRENT_LIST_DIR}/RimWellLogRftCurveNameConfig.cpp ${CMAKE_CURRENT_LIST_DIR}/RimDataSourceSteppingTools.cpp -${CMAKE_CURRENT_LIST_DIR}/RimWellLogCurveCommonDataSource.cpp ${CMAKE_CURRENT_LIST_DIR}/RimContourMapProjection.cpp ${CMAKE_CURRENT_LIST_DIR}/RimEclipseContourMapProjection.cpp ${CMAKE_CURRENT_LIST_DIR}/RimEclipseContourMapView.cpp @@ -299,10 +225,6 @@ ${CMAKE_CURRENT_LIST_DIR}/RimPlotAxisAnnotation.cpp ${CMAKE_CURRENT_LIST_DIR}/RimObservedDataCollection.cpp ${CMAKE_CURRENT_LIST_DIR}/RimObservedFmuRftData.cpp ${CMAKE_CURRENT_LIST_DIR}/RimMultiPlotCollection.cpp -${CMAKE_CURRENT_LIST_DIR}/RimWellMeasurementCurve.cpp -${CMAKE_CURRENT_LIST_DIR}/RimWellMeasurementFilter.cpp -${CMAKE_CURRENT_LIST_DIR}/RimWellMeasurementInViewCollection.cpp -${CMAKE_CURRENT_LIST_DIR}/RimWellMeasurementInView.cpp ${CMAKE_CURRENT_LIST_DIR}/RimWellDiskConfig.cpp ${CMAKE_CURRENT_LIST_DIR}/RimElementVectorResult.cpp ${CMAKE_CURRENT_LIST_DIR}/RimColorLegendCollection.cpp @@ -315,12 +237,6 @@ ${CMAKE_CURRENT_LIST_DIR}/RimCustomObjectiveFunction.cpp ${CMAKE_CURRENT_LIST_DIR}/RimCustomObjectiveFunctionWeight.cpp ${CMAKE_CURRENT_LIST_DIR}/RimEquilibriumAxisAnnotation.cpp ${CMAKE_CURRENT_LIST_DIR}/RimTimeAxisAnnotation.cpp -${CMAKE_CURRENT_LIST_DIR}/RimEnsembleWellLogs.cpp -${CMAKE_CURRENT_LIST_DIR}/RimEnsembleWellLogsCollection.cpp -${CMAKE_CURRENT_LIST_DIR}/RimEnsembleWellLogCurveSet.cpp -${CMAKE_CURRENT_LIST_DIR}/RimEnsembleWellLogStatistics.cpp -${CMAKE_CURRENT_LIST_DIR}/RimEnsembleWellLogStatisticsCurve.cpp -${CMAKE_CURRENT_LIST_DIR}/RimWellPathTieIn.cpp ${CMAKE_CURRENT_LIST_DIR}/cafTreeNode.cpp ${CMAKE_CURRENT_LIST_DIR}/RimMultipleLocations.cpp ) diff --git a/ApplicationLibCode/ProjectDataModel/WellLog/CMakeLists_files.cmake b/ApplicationLibCode/ProjectDataModel/WellLog/CMakeLists_files.cmake new file mode 100644 index 0000000000..fe9ee60f2b --- /dev/null +++ b/ApplicationLibCode/ProjectDataModel/WellLog/CMakeLists_files.cmake @@ -0,0 +1,64 @@ + +set (SOURCE_GROUP_HEADER_FILES +${CMAKE_CURRENT_LIST_DIR}/Rim3dWellLogCurve.h +${CMAKE_CURRENT_LIST_DIR}/Rim3dWellLogFileCurve.h +${CMAKE_CURRENT_LIST_DIR}/Rim3dWellLogExtractionCurve.h +${CMAKE_CURRENT_LIST_DIR}/Rim3dWellLogRftCurve.h +${CMAKE_CURRENT_LIST_DIR}/RimWellLogPlotNameConfig.h +${CMAKE_CURRENT_LIST_DIR}/RimWellLogExtractionCurveNameConfig.h +${CMAKE_CURRENT_LIST_DIR}/RimWellLogFileCurveNameConfig.h +${CMAKE_CURRENT_LIST_DIR}/RimWellLogRftCurveNameConfig.h +${CMAKE_CURRENT_LIST_DIR}/RimWellLogCurveCommonDataSource.h +${CMAKE_CURRENT_LIST_DIR}/RimEnsembleWellLogs.h +${CMAKE_CURRENT_LIST_DIR}/RimEnsembleWellLogsCollection.h +${CMAKE_CURRENT_LIST_DIR}/RimEnsembleWellLogCurveSet.h +${CMAKE_CURRENT_LIST_DIR}/RimEnsembleWellLogStatistics.h +${CMAKE_CURRENT_LIST_DIR}/RimEnsembleWellLogStatisticsCurve.h +${CMAKE_CURRENT_LIST_DIR}/RimWellLogPlotCollection.h +${CMAKE_CURRENT_LIST_DIR}/RimWellLogPlot.h +${CMAKE_CURRENT_LIST_DIR}/RimWellLogTrack.h +${CMAKE_CURRENT_LIST_DIR}/RimWellLogCurve.h +${CMAKE_CURRENT_LIST_DIR}/RimWellLogExtractionCurve.h +${CMAKE_CURRENT_LIST_DIR}/RimWellLogFile.h +${CMAKE_CURRENT_LIST_DIR}/RimWellLogFileChannel.h +${CMAKE_CURRENT_LIST_DIR}/RimWellLogFileCurve.h +${CMAKE_CURRENT_LIST_DIR}/RimWellLogRftCurve.h +${CMAKE_CURRENT_LIST_DIR}/RimWellLogWbsCurve.h +) + +set (SOURCE_GROUP_SOURCE_FILES +${CMAKE_CURRENT_LIST_DIR}/RimWellLogPlotCollection.cpp +${CMAKE_CURRENT_LIST_DIR}/RimWellLogPlot.cpp +${CMAKE_CURRENT_LIST_DIR}/RimWellLogTrack.cpp +${CMAKE_CURRENT_LIST_DIR}/RimWellLogCurve.cpp +${CMAKE_CURRENT_LIST_DIR}/RimWellLogExtractionCurve.cpp +${CMAKE_CURRENT_LIST_DIR}/RimWellLogFile.cpp +${CMAKE_CURRENT_LIST_DIR}/RimWellLogFileChannel.cpp +${CMAKE_CURRENT_LIST_DIR}/RimWellLogFileCurve.cpp +${CMAKE_CURRENT_LIST_DIR}/RimWellLogRftCurve.cpp +${CMAKE_CURRENT_LIST_DIR}/RimWellLogWbsCurve.cpp +${CMAKE_CURRENT_LIST_DIR}/RimWellLogPlotNameConfig.cpp +${CMAKE_CURRENT_LIST_DIR}/RimWellLogExtractionCurveNameConfig.cpp +${CMAKE_CURRENT_LIST_DIR}/RimWellLogFileCurveNameConfig.cpp +${CMAKE_CURRENT_LIST_DIR}/RimWellLogRftCurveNameConfig.cpp +${CMAKE_CURRENT_LIST_DIR}/Rim3dWellLogCurve.cpp +${CMAKE_CURRENT_LIST_DIR}/Rim3dWellLogFileCurve.cpp +${CMAKE_CURRENT_LIST_DIR}/Rim3dWellLogExtractionCurve.cpp +${CMAKE_CURRENT_LIST_DIR}/Rim3dWellLogRftCurve.cpp +${CMAKE_CURRENT_LIST_DIR}/RimWellLogCurveCommonDataSource.cpp +${CMAKE_CURRENT_LIST_DIR}/RimEnsembleWellLogs.cpp +${CMAKE_CURRENT_LIST_DIR}/RimEnsembleWellLogsCollection.cpp +${CMAKE_CURRENT_LIST_DIR}/RimEnsembleWellLogCurveSet.cpp +${CMAKE_CURRENT_LIST_DIR}/RimEnsembleWellLogStatistics.cpp +${CMAKE_CURRENT_LIST_DIR}/RimEnsembleWellLogStatisticsCurve.cpp +) + +list(APPEND CODE_HEADER_FILES +${SOURCE_GROUP_HEADER_FILES} +) + +list(APPEND CODE_SOURCE_FILES +${SOURCE_GROUP_SOURCE_FILES} +) + +source_group( "ProjectDataModel\\WellLog" FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake ) diff --git a/ApplicationLibCode/ProjectDataModel/Rim3dWellLogCurve.cpp b/ApplicationLibCode/ProjectDataModel/WellLog/Rim3dWellLogCurve.cpp similarity index 100% rename from ApplicationLibCode/ProjectDataModel/Rim3dWellLogCurve.cpp rename to ApplicationLibCode/ProjectDataModel/WellLog/Rim3dWellLogCurve.cpp diff --git a/ApplicationLibCode/ProjectDataModel/Rim3dWellLogCurve.h b/ApplicationLibCode/ProjectDataModel/WellLog/Rim3dWellLogCurve.h similarity index 100% rename from ApplicationLibCode/ProjectDataModel/Rim3dWellLogCurve.h rename to ApplicationLibCode/ProjectDataModel/WellLog/Rim3dWellLogCurve.h diff --git a/ApplicationLibCode/ProjectDataModel/Rim3dWellLogExtractionCurve.cpp b/ApplicationLibCode/ProjectDataModel/WellLog/Rim3dWellLogExtractionCurve.cpp similarity index 100% rename from ApplicationLibCode/ProjectDataModel/Rim3dWellLogExtractionCurve.cpp rename to ApplicationLibCode/ProjectDataModel/WellLog/Rim3dWellLogExtractionCurve.cpp diff --git a/ApplicationLibCode/ProjectDataModel/Rim3dWellLogExtractionCurve.h b/ApplicationLibCode/ProjectDataModel/WellLog/Rim3dWellLogExtractionCurve.h similarity index 100% rename from ApplicationLibCode/ProjectDataModel/Rim3dWellLogExtractionCurve.h rename to ApplicationLibCode/ProjectDataModel/WellLog/Rim3dWellLogExtractionCurve.h diff --git a/ApplicationLibCode/ProjectDataModel/Rim3dWellLogFileCurve.cpp b/ApplicationLibCode/ProjectDataModel/WellLog/Rim3dWellLogFileCurve.cpp similarity index 100% rename from ApplicationLibCode/ProjectDataModel/Rim3dWellLogFileCurve.cpp rename to ApplicationLibCode/ProjectDataModel/WellLog/Rim3dWellLogFileCurve.cpp diff --git a/ApplicationLibCode/ProjectDataModel/Rim3dWellLogFileCurve.h b/ApplicationLibCode/ProjectDataModel/WellLog/Rim3dWellLogFileCurve.h similarity index 100% rename from ApplicationLibCode/ProjectDataModel/Rim3dWellLogFileCurve.h rename to ApplicationLibCode/ProjectDataModel/WellLog/Rim3dWellLogFileCurve.h diff --git a/ApplicationLibCode/ProjectDataModel/Rim3dWellLogRftCurve.cpp b/ApplicationLibCode/ProjectDataModel/WellLog/Rim3dWellLogRftCurve.cpp similarity index 100% rename from ApplicationLibCode/ProjectDataModel/Rim3dWellLogRftCurve.cpp rename to ApplicationLibCode/ProjectDataModel/WellLog/Rim3dWellLogRftCurve.cpp diff --git a/ApplicationLibCode/ProjectDataModel/Rim3dWellLogRftCurve.h b/ApplicationLibCode/ProjectDataModel/WellLog/Rim3dWellLogRftCurve.h similarity index 100% rename from ApplicationLibCode/ProjectDataModel/Rim3dWellLogRftCurve.h rename to ApplicationLibCode/ProjectDataModel/WellLog/Rim3dWellLogRftCurve.h diff --git a/ApplicationLibCode/ProjectDataModel/RimEnsembleWellLogCurveSet.cpp b/ApplicationLibCode/ProjectDataModel/WellLog/RimEnsembleWellLogCurveSet.cpp similarity index 100% rename from ApplicationLibCode/ProjectDataModel/RimEnsembleWellLogCurveSet.cpp rename to ApplicationLibCode/ProjectDataModel/WellLog/RimEnsembleWellLogCurveSet.cpp diff --git a/ApplicationLibCode/ProjectDataModel/RimEnsembleWellLogCurveSet.h b/ApplicationLibCode/ProjectDataModel/WellLog/RimEnsembleWellLogCurveSet.h similarity index 100% rename from ApplicationLibCode/ProjectDataModel/RimEnsembleWellLogCurveSet.h rename to ApplicationLibCode/ProjectDataModel/WellLog/RimEnsembleWellLogCurveSet.h diff --git a/ApplicationLibCode/ProjectDataModel/RimEnsembleWellLogStatistics.cpp b/ApplicationLibCode/ProjectDataModel/WellLog/RimEnsembleWellLogStatistics.cpp similarity index 100% rename from ApplicationLibCode/ProjectDataModel/RimEnsembleWellLogStatistics.cpp rename to ApplicationLibCode/ProjectDataModel/WellLog/RimEnsembleWellLogStatistics.cpp diff --git a/ApplicationLibCode/ProjectDataModel/RimEnsembleWellLogStatistics.h b/ApplicationLibCode/ProjectDataModel/WellLog/RimEnsembleWellLogStatistics.h similarity index 100% rename from ApplicationLibCode/ProjectDataModel/RimEnsembleWellLogStatistics.h rename to ApplicationLibCode/ProjectDataModel/WellLog/RimEnsembleWellLogStatistics.h diff --git a/ApplicationLibCode/ProjectDataModel/RimEnsembleWellLogStatisticsCurve.cpp b/ApplicationLibCode/ProjectDataModel/WellLog/RimEnsembleWellLogStatisticsCurve.cpp similarity index 100% rename from ApplicationLibCode/ProjectDataModel/RimEnsembleWellLogStatisticsCurve.cpp rename to ApplicationLibCode/ProjectDataModel/WellLog/RimEnsembleWellLogStatisticsCurve.cpp diff --git a/ApplicationLibCode/ProjectDataModel/RimEnsembleWellLogStatisticsCurve.h b/ApplicationLibCode/ProjectDataModel/WellLog/RimEnsembleWellLogStatisticsCurve.h similarity index 100% rename from ApplicationLibCode/ProjectDataModel/RimEnsembleWellLogStatisticsCurve.h rename to ApplicationLibCode/ProjectDataModel/WellLog/RimEnsembleWellLogStatisticsCurve.h diff --git a/ApplicationLibCode/ProjectDataModel/RimEnsembleWellLogs.cpp b/ApplicationLibCode/ProjectDataModel/WellLog/RimEnsembleWellLogs.cpp similarity index 100% rename from ApplicationLibCode/ProjectDataModel/RimEnsembleWellLogs.cpp rename to ApplicationLibCode/ProjectDataModel/WellLog/RimEnsembleWellLogs.cpp diff --git a/ApplicationLibCode/ProjectDataModel/RimEnsembleWellLogs.h b/ApplicationLibCode/ProjectDataModel/WellLog/RimEnsembleWellLogs.h similarity index 100% rename from ApplicationLibCode/ProjectDataModel/RimEnsembleWellLogs.h rename to ApplicationLibCode/ProjectDataModel/WellLog/RimEnsembleWellLogs.h diff --git a/ApplicationLibCode/ProjectDataModel/RimEnsembleWellLogsCollection.cpp b/ApplicationLibCode/ProjectDataModel/WellLog/RimEnsembleWellLogsCollection.cpp similarity index 100% rename from ApplicationLibCode/ProjectDataModel/RimEnsembleWellLogsCollection.cpp rename to ApplicationLibCode/ProjectDataModel/WellLog/RimEnsembleWellLogsCollection.cpp diff --git a/ApplicationLibCode/ProjectDataModel/RimEnsembleWellLogsCollection.h b/ApplicationLibCode/ProjectDataModel/WellLog/RimEnsembleWellLogsCollection.h similarity index 100% rename from ApplicationLibCode/ProjectDataModel/RimEnsembleWellLogsCollection.h rename to ApplicationLibCode/ProjectDataModel/WellLog/RimEnsembleWellLogsCollection.h diff --git a/ApplicationLibCode/ProjectDataModel/RimWellLogCurve.cpp b/ApplicationLibCode/ProjectDataModel/WellLog/RimWellLogCurve.cpp similarity index 100% rename from ApplicationLibCode/ProjectDataModel/RimWellLogCurve.cpp rename to ApplicationLibCode/ProjectDataModel/WellLog/RimWellLogCurve.cpp diff --git a/ApplicationLibCode/ProjectDataModel/RimWellLogCurve.h b/ApplicationLibCode/ProjectDataModel/WellLog/RimWellLogCurve.h similarity index 100% rename from ApplicationLibCode/ProjectDataModel/RimWellLogCurve.h rename to ApplicationLibCode/ProjectDataModel/WellLog/RimWellLogCurve.h diff --git a/ApplicationLibCode/ProjectDataModel/RimWellLogCurveCommonDataSource.cpp b/ApplicationLibCode/ProjectDataModel/WellLog/RimWellLogCurveCommonDataSource.cpp similarity index 100% rename from ApplicationLibCode/ProjectDataModel/RimWellLogCurveCommonDataSource.cpp rename to ApplicationLibCode/ProjectDataModel/WellLog/RimWellLogCurveCommonDataSource.cpp diff --git a/ApplicationLibCode/ProjectDataModel/RimWellLogCurveCommonDataSource.h b/ApplicationLibCode/ProjectDataModel/WellLog/RimWellLogCurveCommonDataSource.h similarity index 100% rename from ApplicationLibCode/ProjectDataModel/RimWellLogCurveCommonDataSource.h rename to ApplicationLibCode/ProjectDataModel/WellLog/RimWellLogCurveCommonDataSource.h diff --git a/ApplicationLibCode/ProjectDataModel/RimWellLogExtractionCurve.cpp b/ApplicationLibCode/ProjectDataModel/WellLog/RimWellLogExtractionCurve.cpp similarity index 100% rename from ApplicationLibCode/ProjectDataModel/RimWellLogExtractionCurve.cpp rename to ApplicationLibCode/ProjectDataModel/WellLog/RimWellLogExtractionCurve.cpp diff --git a/ApplicationLibCode/ProjectDataModel/RimWellLogExtractionCurve.h b/ApplicationLibCode/ProjectDataModel/WellLog/RimWellLogExtractionCurve.h similarity index 100% rename from ApplicationLibCode/ProjectDataModel/RimWellLogExtractionCurve.h rename to ApplicationLibCode/ProjectDataModel/WellLog/RimWellLogExtractionCurve.h diff --git a/ApplicationLibCode/ProjectDataModel/RimWellLogExtractionCurveNameConfig.cpp b/ApplicationLibCode/ProjectDataModel/WellLog/RimWellLogExtractionCurveNameConfig.cpp similarity index 100% rename from ApplicationLibCode/ProjectDataModel/RimWellLogExtractionCurveNameConfig.cpp rename to ApplicationLibCode/ProjectDataModel/WellLog/RimWellLogExtractionCurveNameConfig.cpp diff --git a/ApplicationLibCode/ProjectDataModel/RimWellLogExtractionCurveNameConfig.h b/ApplicationLibCode/ProjectDataModel/WellLog/RimWellLogExtractionCurveNameConfig.h similarity index 100% rename from ApplicationLibCode/ProjectDataModel/RimWellLogExtractionCurveNameConfig.h rename to ApplicationLibCode/ProjectDataModel/WellLog/RimWellLogExtractionCurveNameConfig.h diff --git a/ApplicationLibCode/ProjectDataModel/RimWellLogFile.cpp b/ApplicationLibCode/ProjectDataModel/WellLog/RimWellLogFile.cpp similarity index 100% rename from ApplicationLibCode/ProjectDataModel/RimWellLogFile.cpp rename to ApplicationLibCode/ProjectDataModel/WellLog/RimWellLogFile.cpp diff --git a/ApplicationLibCode/ProjectDataModel/RimWellLogFile.h b/ApplicationLibCode/ProjectDataModel/WellLog/RimWellLogFile.h similarity index 100% rename from ApplicationLibCode/ProjectDataModel/RimWellLogFile.h rename to ApplicationLibCode/ProjectDataModel/WellLog/RimWellLogFile.h diff --git a/ApplicationLibCode/ProjectDataModel/RimWellLogFileChannel.cpp b/ApplicationLibCode/ProjectDataModel/WellLog/RimWellLogFileChannel.cpp similarity index 100% rename from ApplicationLibCode/ProjectDataModel/RimWellLogFileChannel.cpp rename to ApplicationLibCode/ProjectDataModel/WellLog/RimWellLogFileChannel.cpp diff --git a/ApplicationLibCode/ProjectDataModel/RimWellLogFileChannel.h b/ApplicationLibCode/ProjectDataModel/WellLog/RimWellLogFileChannel.h similarity index 100% rename from ApplicationLibCode/ProjectDataModel/RimWellLogFileChannel.h rename to ApplicationLibCode/ProjectDataModel/WellLog/RimWellLogFileChannel.h diff --git a/ApplicationLibCode/ProjectDataModel/RimWellLogFileCurve.cpp b/ApplicationLibCode/ProjectDataModel/WellLog/RimWellLogFileCurve.cpp similarity index 100% rename from ApplicationLibCode/ProjectDataModel/RimWellLogFileCurve.cpp rename to ApplicationLibCode/ProjectDataModel/WellLog/RimWellLogFileCurve.cpp diff --git a/ApplicationLibCode/ProjectDataModel/RimWellLogFileCurve.h b/ApplicationLibCode/ProjectDataModel/WellLog/RimWellLogFileCurve.h similarity index 100% rename from ApplicationLibCode/ProjectDataModel/RimWellLogFileCurve.h rename to ApplicationLibCode/ProjectDataModel/WellLog/RimWellLogFileCurve.h diff --git a/ApplicationLibCode/ProjectDataModel/RimWellLogFileCurveNameConfig.cpp b/ApplicationLibCode/ProjectDataModel/WellLog/RimWellLogFileCurveNameConfig.cpp similarity index 100% rename from ApplicationLibCode/ProjectDataModel/RimWellLogFileCurveNameConfig.cpp rename to ApplicationLibCode/ProjectDataModel/WellLog/RimWellLogFileCurveNameConfig.cpp diff --git a/ApplicationLibCode/ProjectDataModel/RimWellLogFileCurveNameConfig.h b/ApplicationLibCode/ProjectDataModel/WellLog/RimWellLogFileCurveNameConfig.h similarity index 100% rename from ApplicationLibCode/ProjectDataModel/RimWellLogFileCurveNameConfig.h rename to ApplicationLibCode/ProjectDataModel/WellLog/RimWellLogFileCurveNameConfig.h diff --git a/ApplicationLibCode/ProjectDataModel/RimWellLogPlot.cpp b/ApplicationLibCode/ProjectDataModel/WellLog/RimWellLogPlot.cpp similarity index 100% rename from ApplicationLibCode/ProjectDataModel/RimWellLogPlot.cpp rename to ApplicationLibCode/ProjectDataModel/WellLog/RimWellLogPlot.cpp diff --git a/ApplicationLibCode/ProjectDataModel/RimWellLogPlot.h b/ApplicationLibCode/ProjectDataModel/WellLog/RimWellLogPlot.h similarity index 100% rename from ApplicationLibCode/ProjectDataModel/RimWellLogPlot.h rename to ApplicationLibCode/ProjectDataModel/WellLog/RimWellLogPlot.h diff --git a/ApplicationLibCode/ProjectDataModel/RimWellLogPlotCollection.cpp b/ApplicationLibCode/ProjectDataModel/WellLog/RimWellLogPlotCollection.cpp similarity index 100% rename from ApplicationLibCode/ProjectDataModel/RimWellLogPlotCollection.cpp rename to ApplicationLibCode/ProjectDataModel/WellLog/RimWellLogPlotCollection.cpp diff --git a/ApplicationLibCode/ProjectDataModel/RimWellLogPlotCollection.h b/ApplicationLibCode/ProjectDataModel/WellLog/RimWellLogPlotCollection.h similarity index 100% rename from ApplicationLibCode/ProjectDataModel/RimWellLogPlotCollection.h rename to ApplicationLibCode/ProjectDataModel/WellLog/RimWellLogPlotCollection.h diff --git a/ApplicationLibCode/ProjectDataModel/RimWellLogPlotNameConfig.cpp b/ApplicationLibCode/ProjectDataModel/WellLog/RimWellLogPlotNameConfig.cpp similarity index 100% rename from ApplicationLibCode/ProjectDataModel/RimWellLogPlotNameConfig.cpp rename to ApplicationLibCode/ProjectDataModel/WellLog/RimWellLogPlotNameConfig.cpp diff --git a/ApplicationLibCode/ProjectDataModel/RimWellLogPlotNameConfig.h b/ApplicationLibCode/ProjectDataModel/WellLog/RimWellLogPlotNameConfig.h similarity index 100% rename from ApplicationLibCode/ProjectDataModel/RimWellLogPlotNameConfig.h rename to ApplicationLibCode/ProjectDataModel/WellLog/RimWellLogPlotNameConfig.h diff --git a/ApplicationLibCode/ProjectDataModel/RimWellLogRftCurve.cpp b/ApplicationLibCode/ProjectDataModel/WellLog/RimWellLogRftCurve.cpp similarity index 100% rename from ApplicationLibCode/ProjectDataModel/RimWellLogRftCurve.cpp rename to ApplicationLibCode/ProjectDataModel/WellLog/RimWellLogRftCurve.cpp diff --git a/ApplicationLibCode/ProjectDataModel/RimWellLogRftCurve.h b/ApplicationLibCode/ProjectDataModel/WellLog/RimWellLogRftCurve.h similarity index 100% rename from ApplicationLibCode/ProjectDataModel/RimWellLogRftCurve.h rename to ApplicationLibCode/ProjectDataModel/WellLog/RimWellLogRftCurve.h diff --git a/ApplicationLibCode/ProjectDataModel/RimWellLogRftCurveNameConfig.cpp b/ApplicationLibCode/ProjectDataModel/WellLog/RimWellLogRftCurveNameConfig.cpp similarity index 100% rename from ApplicationLibCode/ProjectDataModel/RimWellLogRftCurveNameConfig.cpp rename to ApplicationLibCode/ProjectDataModel/WellLog/RimWellLogRftCurveNameConfig.cpp diff --git a/ApplicationLibCode/ProjectDataModel/RimWellLogRftCurveNameConfig.h b/ApplicationLibCode/ProjectDataModel/WellLog/RimWellLogRftCurveNameConfig.h similarity index 100% rename from ApplicationLibCode/ProjectDataModel/RimWellLogRftCurveNameConfig.h rename to ApplicationLibCode/ProjectDataModel/WellLog/RimWellLogRftCurveNameConfig.h diff --git a/ApplicationLibCode/ProjectDataModel/RimWellLogTrack.cpp b/ApplicationLibCode/ProjectDataModel/WellLog/RimWellLogTrack.cpp similarity index 100% rename from ApplicationLibCode/ProjectDataModel/RimWellLogTrack.cpp rename to ApplicationLibCode/ProjectDataModel/WellLog/RimWellLogTrack.cpp diff --git a/ApplicationLibCode/ProjectDataModel/RimWellLogTrack.h b/ApplicationLibCode/ProjectDataModel/WellLog/RimWellLogTrack.h similarity index 100% rename from ApplicationLibCode/ProjectDataModel/RimWellLogTrack.h rename to ApplicationLibCode/ProjectDataModel/WellLog/RimWellLogTrack.h diff --git a/ApplicationLibCode/ProjectDataModel/RimWellLogWbsCurve.cpp b/ApplicationLibCode/ProjectDataModel/WellLog/RimWellLogWbsCurve.cpp similarity index 100% rename from ApplicationLibCode/ProjectDataModel/RimWellLogWbsCurve.cpp rename to ApplicationLibCode/ProjectDataModel/WellLog/RimWellLogWbsCurve.cpp diff --git a/ApplicationLibCode/ProjectDataModel/RimWellLogWbsCurve.h b/ApplicationLibCode/ProjectDataModel/WellLog/RimWellLogWbsCurve.h similarity index 100% rename from ApplicationLibCode/ProjectDataModel/RimWellLogWbsCurve.h rename to ApplicationLibCode/ProjectDataModel/WellLog/RimWellLogWbsCurve.h diff --git a/ApplicationLibCode/ProjectDataModel/WellMeasurement/CMakeLists_files.cmake b/ApplicationLibCode/ProjectDataModel/WellMeasurement/CMakeLists_files.cmake new file mode 100644 index 0000000000..d6e0f692a3 --- /dev/null +++ b/ApplicationLibCode/ProjectDataModel/WellMeasurement/CMakeLists_files.cmake @@ -0,0 +1,30 @@ + +set (SOURCE_GROUP_HEADER_FILES +${CMAKE_CURRENT_LIST_DIR}/RimWellMeasurement.h +${CMAKE_CURRENT_LIST_DIR}/RimWellMeasurementCollection.h +${CMAKE_CURRENT_LIST_DIR}/RimWellMeasurementFilePath.h +${CMAKE_CURRENT_LIST_DIR}/RimWellMeasurementCurve.h +${CMAKE_CURRENT_LIST_DIR}/RimWellMeasurementFilter.h +${CMAKE_CURRENT_LIST_DIR}/RimWellMeasurementInViewCollection.h +${CMAKE_CURRENT_LIST_DIR}/RimWellMeasurementInView.h +) + +set (SOURCE_GROUP_SOURCE_FILES +${CMAKE_CURRENT_LIST_DIR}/RimWellMeasurement.cpp +${CMAKE_CURRENT_LIST_DIR}/RimWellMeasurementCollection.cpp +${CMAKE_CURRENT_LIST_DIR}/RimWellMeasurementFilePath.cpp +${CMAKE_CURRENT_LIST_DIR}/RimWellMeasurementCurve.cpp +${CMAKE_CURRENT_LIST_DIR}/RimWellMeasurementFilter.cpp +${CMAKE_CURRENT_LIST_DIR}/RimWellMeasurementInViewCollection.cpp +${CMAKE_CURRENT_LIST_DIR}/RimWellMeasurementInView.cpp +) + +list(APPEND CODE_HEADER_FILES +${SOURCE_GROUP_HEADER_FILES} +) + +list(APPEND CODE_SOURCE_FILES +${SOURCE_GROUP_SOURCE_FILES} +) + +source_group( "ProjectDataModel\\WellMeasurement" FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake ) diff --git a/ApplicationLibCode/ProjectDataModel/RimWellMeasurement.cpp b/ApplicationLibCode/ProjectDataModel/WellMeasurement/RimWellMeasurement.cpp similarity index 100% rename from ApplicationLibCode/ProjectDataModel/RimWellMeasurement.cpp rename to ApplicationLibCode/ProjectDataModel/WellMeasurement/RimWellMeasurement.cpp diff --git a/ApplicationLibCode/ProjectDataModel/RimWellMeasurement.h b/ApplicationLibCode/ProjectDataModel/WellMeasurement/RimWellMeasurement.h similarity index 100% rename from ApplicationLibCode/ProjectDataModel/RimWellMeasurement.h rename to ApplicationLibCode/ProjectDataModel/WellMeasurement/RimWellMeasurement.h diff --git a/ApplicationLibCode/ProjectDataModel/RimWellMeasurementCollection.cpp b/ApplicationLibCode/ProjectDataModel/WellMeasurement/RimWellMeasurementCollection.cpp similarity index 100% rename from ApplicationLibCode/ProjectDataModel/RimWellMeasurementCollection.cpp rename to ApplicationLibCode/ProjectDataModel/WellMeasurement/RimWellMeasurementCollection.cpp diff --git a/ApplicationLibCode/ProjectDataModel/RimWellMeasurementCollection.h b/ApplicationLibCode/ProjectDataModel/WellMeasurement/RimWellMeasurementCollection.h similarity index 100% rename from ApplicationLibCode/ProjectDataModel/RimWellMeasurementCollection.h rename to ApplicationLibCode/ProjectDataModel/WellMeasurement/RimWellMeasurementCollection.h diff --git a/ApplicationLibCode/ProjectDataModel/RimWellMeasurementCurve.cpp b/ApplicationLibCode/ProjectDataModel/WellMeasurement/RimWellMeasurementCurve.cpp similarity index 100% rename from ApplicationLibCode/ProjectDataModel/RimWellMeasurementCurve.cpp rename to ApplicationLibCode/ProjectDataModel/WellMeasurement/RimWellMeasurementCurve.cpp diff --git a/ApplicationLibCode/ProjectDataModel/RimWellMeasurementCurve.h b/ApplicationLibCode/ProjectDataModel/WellMeasurement/RimWellMeasurementCurve.h similarity index 100% rename from ApplicationLibCode/ProjectDataModel/RimWellMeasurementCurve.h rename to ApplicationLibCode/ProjectDataModel/WellMeasurement/RimWellMeasurementCurve.h diff --git a/ApplicationLibCode/ProjectDataModel/RimWellMeasurementFilePath.cpp b/ApplicationLibCode/ProjectDataModel/WellMeasurement/RimWellMeasurementFilePath.cpp similarity index 100% rename from ApplicationLibCode/ProjectDataModel/RimWellMeasurementFilePath.cpp rename to ApplicationLibCode/ProjectDataModel/WellMeasurement/RimWellMeasurementFilePath.cpp diff --git a/ApplicationLibCode/ProjectDataModel/RimWellMeasurementFilePath.h b/ApplicationLibCode/ProjectDataModel/WellMeasurement/RimWellMeasurementFilePath.h similarity index 100% rename from ApplicationLibCode/ProjectDataModel/RimWellMeasurementFilePath.h rename to ApplicationLibCode/ProjectDataModel/WellMeasurement/RimWellMeasurementFilePath.h diff --git a/ApplicationLibCode/ProjectDataModel/RimWellMeasurementFilter.cpp b/ApplicationLibCode/ProjectDataModel/WellMeasurement/RimWellMeasurementFilter.cpp similarity index 100% rename from ApplicationLibCode/ProjectDataModel/RimWellMeasurementFilter.cpp rename to ApplicationLibCode/ProjectDataModel/WellMeasurement/RimWellMeasurementFilter.cpp diff --git a/ApplicationLibCode/ProjectDataModel/RimWellMeasurementFilter.h b/ApplicationLibCode/ProjectDataModel/WellMeasurement/RimWellMeasurementFilter.h similarity index 100% rename from ApplicationLibCode/ProjectDataModel/RimWellMeasurementFilter.h rename to ApplicationLibCode/ProjectDataModel/WellMeasurement/RimWellMeasurementFilter.h diff --git a/ApplicationLibCode/ProjectDataModel/RimWellMeasurementInView.cpp b/ApplicationLibCode/ProjectDataModel/WellMeasurement/RimWellMeasurementInView.cpp similarity index 100% rename from ApplicationLibCode/ProjectDataModel/RimWellMeasurementInView.cpp rename to ApplicationLibCode/ProjectDataModel/WellMeasurement/RimWellMeasurementInView.cpp diff --git a/ApplicationLibCode/ProjectDataModel/RimWellMeasurementInView.h b/ApplicationLibCode/ProjectDataModel/WellMeasurement/RimWellMeasurementInView.h similarity index 100% rename from ApplicationLibCode/ProjectDataModel/RimWellMeasurementInView.h rename to ApplicationLibCode/ProjectDataModel/WellMeasurement/RimWellMeasurementInView.h diff --git a/ApplicationLibCode/ProjectDataModel/RimWellMeasurementInViewCollection.cpp b/ApplicationLibCode/ProjectDataModel/WellMeasurement/RimWellMeasurementInViewCollection.cpp similarity index 100% rename from ApplicationLibCode/ProjectDataModel/RimWellMeasurementInViewCollection.cpp rename to ApplicationLibCode/ProjectDataModel/WellMeasurement/RimWellMeasurementInViewCollection.cpp diff --git a/ApplicationLibCode/ProjectDataModel/RimWellMeasurementInViewCollection.h b/ApplicationLibCode/ProjectDataModel/WellMeasurement/RimWellMeasurementInViewCollection.h similarity index 100% rename from ApplicationLibCode/ProjectDataModel/RimWellMeasurementInViewCollection.h rename to ApplicationLibCode/ProjectDataModel/WellMeasurement/RimWellMeasurementInViewCollection.h diff --git a/ApplicationLibCode/ProjectDataModel/WellPath/CMakeLists_files.cmake b/ApplicationLibCode/ProjectDataModel/WellPath/CMakeLists_files.cmake new file mode 100644 index 0000000000..16360e5e0c --- /dev/null +++ b/ApplicationLibCode/ProjectDataModel/WellPath/CMakeLists_files.cmake @@ -0,0 +1,38 @@ + +set (SOURCE_GROUP_HEADER_FILES +${CMAKE_CURRENT_LIST_DIR}/RimWellPath.h +${CMAKE_CURRENT_LIST_DIR}/RimWellPathGroup.h +${CMAKE_CURRENT_LIST_DIR}/RimFileWellPath.h +${CMAKE_CURRENT_LIST_DIR}/RimModeledWellPath.h +${CMAKE_CURRENT_LIST_DIR}/RimWellPathGeometryDef.h +${CMAKE_CURRENT_LIST_DIR}/RimWellPathGeometryDefTools.h +${CMAKE_CURRENT_LIST_DIR}/RimWellPathAttribute.h +${CMAKE_CURRENT_LIST_DIR}/RimWellPathAttributeCollection.h +${CMAKE_CURRENT_LIST_DIR}/RimWellPathCollection.h +${CMAKE_CURRENT_LIST_DIR}/RimWellPathTarget.h +${CMAKE_CURRENT_LIST_DIR}/RimWellPathTieIn.h +) + +set (SOURCE_GROUP_SOURCE_FILES +${CMAKE_CURRENT_LIST_DIR}/RimFileWellPath.cpp +${CMAKE_CURRENT_LIST_DIR}/RimModeledWellPath.cpp +${CMAKE_CURRENT_LIST_DIR}/RimWellPath.cpp +${CMAKE_CURRENT_LIST_DIR}/RimWellPathAttribute.cpp +${CMAKE_CURRENT_LIST_DIR}/RimWellPathAttributeCollection.cpp +${CMAKE_CURRENT_LIST_DIR}/RimWellPathCollection.cpp +${CMAKE_CURRENT_LIST_DIR}/RimWellPathGeometryDef.cpp +${CMAKE_CURRENT_LIST_DIR}/RimWellPathGeometryDefTools.cpp +${CMAKE_CURRENT_LIST_DIR}/RimWellPathGroup.cpp +${CMAKE_CURRENT_LIST_DIR}/RimWellPathTarget.cpp +${CMAKE_CURRENT_LIST_DIR}/RimWellPathTieIn.cpp +) + +list(APPEND CODE_HEADER_FILES +${SOURCE_GROUP_HEADER_FILES} +) + +list(APPEND CODE_SOURCE_FILES +${SOURCE_GROUP_SOURCE_FILES} +) + +source_group( "ProjectDataModel\\WellPath" FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake ) diff --git a/ApplicationLibCode/ProjectDataModel/RimFileWellPath.cpp b/ApplicationLibCode/ProjectDataModel/WellPath/RimFileWellPath.cpp similarity index 100% rename from ApplicationLibCode/ProjectDataModel/RimFileWellPath.cpp rename to ApplicationLibCode/ProjectDataModel/WellPath/RimFileWellPath.cpp diff --git a/ApplicationLibCode/ProjectDataModel/RimFileWellPath.h b/ApplicationLibCode/ProjectDataModel/WellPath/RimFileWellPath.h similarity index 100% rename from ApplicationLibCode/ProjectDataModel/RimFileWellPath.h rename to ApplicationLibCode/ProjectDataModel/WellPath/RimFileWellPath.h diff --git a/ApplicationLibCode/ProjectDataModel/RimModeledWellPath.cpp b/ApplicationLibCode/ProjectDataModel/WellPath/RimModeledWellPath.cpp similarity index 100% rename from ApplicationLibCode/ProjectDataModel/RimModeledWellPath.cpp rename to ApplicationLibCode/ProjectDataModel/WellPath/RimModeledWellPath.cpp diff --git a/ApplicationLibCode/ProjectDataModel/RimModeledWellPath.h b/ApplicationLibCode/ProjectDataModel/WellPath/RimModeledWellPath.h similarity index 100% rename from ApplicationLibCode/ProjectDataModel/RimModeledWellPath.h rename to ApplicationLibCode/ProjectDataModel/WellPath/RimModeledWellPath.h diff --git a/ApplicationLibCode/ProjectDataModel/RimWellPath.cpp b/ApplicationLibCode/ProjectDataModel/WellPath/RimWellPath.cpp similarity index 100% rename from ApplicationLibCode/ProjectDataModel/RimWellPath.cpp rename to ApplicationLibCode/ProjectDataModel/WellPath/RimWellPath.cpp diff --git a/ApplicationLibCode/ProjectDataModel/RimWellPath.h b/ApplicationLibCode/ProjectDataModel/WellPath/RimWellPath.h similarity index 100% rename from ApplicationLibCode/ProjectDataModel/RimWellPath.h rename to ApplicationLibCode/ProjectDataModel/WellPath/RimWellPath.h diff --git a/ApplicationLibCode/ProjectDataModel/RimWellPathAttribute.cpp b/ApplicationLibCode/ProjectDataModel/WellPath/RimWellPathAttribute.cpp similarity index 100% rename from ApplicationLibCode/ProjectDataModel/RimWellPathAttribute.cpp rename to ApplicationLibCode/ProjectDataModel/WellPath/RimWellPathAttribute.cpp diff --git a/ApplicationLibCode/ProjectDataModel/RimWellPathAttribute.h b/ApplicationLibCode/ProjectDataModel/WellPath/RimWellPathAttribute.h similarity index 100% rename from ApplicationLibCode/ProjectDataModel/RimWellPathAttribute.h rename to ApplicationLibCode/ProjectDataModel/WellPath/RimWellPathAttribute.h diff --git a/ApplicationLibCode/ProjectDataModel/RimWellPathAttributeCollection.cpp b/ApplicationLibCode/ProjectDataModel/WellPath/RimWellPathAttributeCollection.cpp similarity index 100% rename from ApplicationLibCode/ProjectDataModel/RimWellPathAttributeCollection.cpp rename to ApplicationLibCode/ProjectDataModel/WellPath/RimWellPathAttributeCollection.cpp diff --git a/ApplicationLibCode/ProjectDataModel/RimWellPathAttributeCollection.h b/ApplicationLibCode/ProjectDataModel/WellPath/RimWellPathAttributeCollection.h similarity index 100% rename from ApplicationLibCode/ProjectDataModel/RimWellPathAttributeCollection.h rename to ApplicationLibCode/ProjectDataModel/WellPath/RimWellPathAttributeCollection.h diff --git a/ApplicationLibCode/ProjectDataModel/RimWellPathCollection.cpp b/ApplicationLibCode/ProjectDataModel/WellPath/RimWellPathCollection.cpp similarity index 100% rename from ApplicationLibCode/ProjectDataModel/RimWellPathCollection.cpp rename to ApplicationLibCode/ProjectDataModel/WellPath/RimWellPathCollection.cpp diff --git a/ApplicationLibCode/ProjectDataModel/RimWellPathCollection.h b/ApplicationLibCode/ProjectDataModel/WellPath/RimWellPathCollection.h similarity index 100% rename from ApplicationLibCode/ProjectDataModel/RimWellPathCollection.h rename to ApplicationLibCode/ProjectDataModel/WellPath/RimWellPathCollection.h diff --git a/ApplicationLibCode/ProjectDataModel/RimWellPathGeometryDef.cpp b/ApplicationLibCode/ProjectDataModel/WellPath/RimWellPathGeometryDef.cpp similarity index 100% rename from ApplicationLibCode/ProjectDataModel/RimWellPathGeometryDef.cpp rename to ApplicationLibCode/ProjectDataModel/WellPath/RimWellPathGeometryDef.cpp diff --git a/ApplicationLibCode/ProjectDataModel/RimWellPathGeometryDef.h b/ApplicationLibCode/ProjectDataModel/WellPath/RimWellPathGeometryDef.h similarity index 100% rename from ApplicationLibCode/ProjectDataModel/RimWellPathGeometryDef.h rename to ApplicationLibCode/ProjectDataModel/WellPath/RimWellPathGeometryDef.h diff --git a/ApplicationLibCode/ProjectDataModel/RimWellPathGeometryDefTools.cpp b/ApplicationLibCode/ProjectDataModel/WellPath/RimWellPathGeometryDefTools.cpp similarity index 100% rename from ApplicationLibCode/ProjectDataModel/RimWellPathGeometryDefTools.cpp rename to ApplicationLibCode/ProjectDataModel/WellPath/RimWellPathGeometryDefTools.cpp diff --git a/ApplicationLibCode/ProjectDataModel/RimWellPathGeometryDefTools.h b/ApplicationLibCode/ProjectDataModel/WellPath/RimWellPathGeometryDefTools.h similarity index 100% rename from ApplicationLibCode/ProjectDataModel/RimWellPathGeometryDefTools.h rename to ApplicationLibCode/ProjectDataModel/WellPath/RimWellPathGeometryDefTools.h diff --git a/ApplicationLibCode/ProjectDataModel/RimWellPathGroup.cpp b/ApplicationLibCode/ProjectDataModel/WellPath/RimWellPathGroup.cpp similarity index 100% rename from ApplicationLibCode/ProjectDataModel/RimWellPathGroup.cpp rename to ApplicationLibCode/ProjectDataModel/WellPath/RimWellPathGroup.cpp diff --git a/ApplicationLibCode/ProjectDataModel/RimWellPathGroup.h b/ApplicationLibCode/ProjectDataModel/WellPath/RimWellPathGroup.h similarity index 100% rename from ApplicationLibCode/ProjectDataModel/RimWellPathGroup.h rename to ApplicationLibCode/ProjectDataModel/WellPath/RimWellPathGroup.h diff --git a/ApplicationLibCode/ProjectDataModel/RimWellPathTarget.cpp b/ApplicationLibCode/ProjectDataModel/WellPath/RimWellPathTarget.cpp similarity index 100% rename from ApplicationLibCode/ProjectDataModel/RimWellPathTarget.cpp rename to ApplicationLibCode/ProjectDataModel/WellPath/RimWellPathTarget.cpp diff --git a/ApplicationLibCode/ProjectDataModel/RimWellPathTarget.h b/ApplicationLibCode/ProjectDataModel/WellPath/RimWellPathTarget.h similarity index 100% rename from ApplicationLibCode/ProjectDataModel/RimWellPathTarget.h rename to ApplicationLibCode/ProjectDataModel/WellPath/RimWellPathTarget.h diff --git a/ApplicationLibCode/ProjectDataModel/RimWellPathTieIn.cpp b/ApplicationLibCode/ProjectDataModel/WellPath/RimWellPathTieIn.cpp similarity index 100% rename from ApplicationLibCode/ProjectDataModel/RimWellPathTieIn.cpp rename to ApplicationLibCode/ProjectDataModel/WellPath/RimWellPathTieIn.cpp diff --git a/ApplicationLibCode/ProjectDataModel/RimWellPathTieIn.h b/ApplicationLibCode/ProjectDataModel/WellPath/RimWellPathTieIn.h similarity index 100% rename from ApplicationLibCode/ProjectDataModel/RimWellPathTieIn.h rename to ApplicationLibCode/ProjectDataModel/WellPath/RimWellPathTieIn.h From aa5bfc1d67f12f6be260bd2c31fbaa265961d659 Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Mon, 2 Aug 2021 07:35:35 +0200 Subject: [PATCH 056/308] Update ResInsightWithCache.yml --- .github/workflows/ResInsightWithCache.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ResInsightWithCache.yml b/.github/workflows/ResInsightWithCache.yml index e91656e9c4..a42d2881ec 100644 --- a/.github/workflows/ResInsightWithCache.yml +++ b/.github/workflows/ResInsightWithCache.yml @@ -152,7 +152,7 @@ jobs: vcpkgArguments: '@${{ github.workspace }}/${{ matrix.config.vcpkg-response-file }}' vcpkgDirectory: '${{ github.workspace }}/ThirdParty/vcpkg' # Ensure the cache key changes any time the content of the response file changes. - appendedCacheKey: ${{ hashFiles(env.VCPKGRESPONSEFILE) }}-v01 + appendedCacheKey: ${{ hashFiles(env.VCPKGRESPONSEFILE) }}-cache-v2 - name: Cache dynamic version of OpenSSL (Linux) if: "contains( matrix.config.os, 'ubuntu_disabled')" From b03b23aba2e76c9c89c74540498fd83a86bc6d0e Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Mon, 2 Aug 2021 07:45:32 +0200 Subject: [PATCH 057/308] Update ResInsightWithCache.yml --- .github/workflows/ResInsightWithCache.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ResInsightWithCache.yml b/.github/workflows/ResInsightWithCache.yml index a42d2881ec..fbac6e3503 100644 --- a/.github/workflows/ResInsightWithCache.yml +++ b/.github/workflows/ResInsightWithCache.yml @@ -152,7 +152,7 @@ jobs: vcpkgArguments: '@${{ github.workspace }}/${{ matrix.config.vcpkg-response-file }}' vcpkgDirectory: '${{ github.workspace }}/ThirdParty/vcpkg' # Ensure the cache key changes any time the content of the response file changes. - appendedCacheKey: ${{ hashFiles(env.VCPKGRESPONSEFILE) }}-cache-v2 + appendedCacheKey: cache-key-v2 - name: Cache dynamic version of OpenSSL (Linux) if: "contains( matrix.config.os, 'ubuntu_disabled')" From 9a8ffe403e745d914ac121bfd3a4346745932b7f Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Mon, 2 Aug 2021 16:06:56 +0200 Subject: [PATCH 058/308] Set a fixed version of cmake to fix issues with GitHub actions --- .github/workflows/ResInsightWithCache.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ResInsightWithCache.yml b/.github/workflows/ResInsightWithCache.yml index fbac6e3503..814c545985 100644 --- a/.github/workflows/ResInsightWithCache.yml +++ b/.github/workflows/ResInsightWithCache.yml @@ -8,7 +8,6 @@ on: # build cache is - cron: '0 1 * * * ' env: - NINJA_VERSION: 1.9.0 BUILD_TYPE: Release BUILDCACHE_VERSION: 0.24.4 BUILDCACHE_DIR: ${{ github.workspace }}/buildcache_dir @@ -73,10 +72,11 @@ jobs: python-version: '3.8' - name: Display Python version run: python -c "import sys; print(sys.version)" - - name: Download Ninja - uses: seanmiddleditch/gha-setup-ninja@master - with: - version: ${{ env.NINJA_VERSION }} + + # workaround a poor interaction between github actions/cmake/vcpkg, see https://github.com/lukka/run-vcpkg/issues/88#issuecomment-885758902 + - name: Use CMake 3.20.1 + uses: lukka/get-cmake@v3.20.1 + - name: Download buildcache id: buildcache-download shell: cmake -P {0} From aebafd47fdbc470795fc6362ea2331b8ada6f703 Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Mon, 2 Aug 2021 19:42:39 +0200 Subject: [PATCH 059/308] Update ResInsightWithCache.yml --- .github/workflows/ResInsightWithCache.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ResInsightWithCache.yml b/.github/workflows/ResInsightWithCache.yml index 814c545985..170bd91eac 100644 --- a/.github/workflows/ResInsightWithCache.yml +++ b/.github/workflows/ResInsightWithCache.yml @@ -152,7 +152,7 @@ jobs: vcpkgArguments: '@${{ github.workspace }}/${{ matrix.config.vcpkg-response-file }}' vcpkgDirectory: '${{ github.workspace }}/ThirdParty/vcpkg' # Ensure the cache key changes any time the content of the response file changes. - appendedCacheKey: cache-key-v2 + appendedCacheKey: ${{ hashFiles(env.VCPKGRESPONSEFILE) }}-cache-key-v2 - name: Cache dynamic version of OpenSSL (Linux) if: "contains( matrix.config.os, 'ubuntu_disabled')" From f799ee2f3de23b5d4b21806ed6629417119a96b8 Mon Sep 17 00:00:00 2001 From: Kristian Bendiksen Date: Thu, 8 Jul 2021 09:13:16 +0200 Subject: [PATCH 060/308] #7842 Python: fix undefined variable on version mismatch. The location variable was not defined when creating the error message for version mismatch between rips and application. --- GrpcInterface/Python/rips/instance.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/GrpcInterface/Python/rips/instance.py b/GrpcInterface/Python/rips/instance.py index b541d7e112..cc6fe76e18 100644 --- a/GrpcInterface/Python/rips/instance.py +++ b/GrpcInterface/Python/rips/instance.py @@ -188,7 +188,7 @@ def __init__(self, port=50051, launched=False): # Main version check package self.app = App_pb2_grpc.AppStub(self.channel) - self._check_connection_and_version(self.channel, launched) + self._check_connection_and_version(self.channel, launched, location) # Intercept UNAVAILABLE errors and retry on failures interceptors = ( @@ -211,7 +211,7 @@ def __init__(self, port=50051, launched=False): path = os.getcwd() self.set_start_dir(path=path) - def _check_connection_and_version(self, channel, launched): + def _check_connection_and_version(self, channel, launched, location): connection_ok = False version_ok = False From fc947558d5b672eb5c8e92d3dde444bd5ac69b2b Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Tue, 3 Aug 2021 14:34:51 +0200 Subject: [PATCH 061/308] #7852 Crash on dual porosity grid model load and clicking on cell in 3D view --- .../opm-flowdiagnostics-applications/opm/utility/ECLGraph.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ThirdParty/custom-opm-flowdiag-app/opm-flowdiagnostics-applications/opm/utility/ECLGraph.cpp b/ThirdParty/custom-opm-flowdiag-app/opm-flowdiagnostics-applications/opm/utility/ECLGraph.cpp index f83a13eb24..663893a0f6 100644 --- a/ThirdParty/custom-opm-flowdiag-app/opm-flowdiagnostics-applications/opm/utility/ECLGraph.cpp +++ b/ThirdParty/custom-opm-flowdiag-app/opm-flowdiagnostics-applications/opm/utility/ECLGraph.cpp @@ -1233,7 +1233,9 @@ deriveNeighbours(const std::vector& gcells, continue; } - if (T[globID] > 0.0) { + // Guard access to transmissibility vector. Crash seen in some dual porosity models + // https://github.com/OPM/ResInsight/issues/7852 + if (globID < T.size() && T[globID] > 0.0) { const auto other = this->cells_.getNeighbour(globID, d); if ((other >= 0) && ! this->cells_.isSubdivided(other)) { From 92bd783a108765bbd9cb5008815f53739b895a34 Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Wed, 4 Aug 2021 18:57:45 +0200 Subject: [PATCH 062/308] Allow two different counts for summary vector reader --- GrpcInterface/Python/rips/tests/test_summary_cases.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/GrpcInterface/Python/rips/tests/test_summary_cases.py b/GrpcInterface/Python/rips/tests/test_summary_cases.py index 5cb753ca42..b80bf7d641 100644 --- a/GrpcInterface/Python/rips/tests/test_summary_cases.py +++ b/GrpcInterface/Python/rips/tests/test_summary_cases.py @@ -37,7 +37,9 @@ def test_summary_data(rips_instance, initialize_test): assert summary_case.id == 1 addresses = summary_case.available_addresses() - assert len(addresses.values) == 343 + # Summary reader type is controlled from Preferences. libecl reports 343 vectors, opm_common reports 361. + # As this configuration can be different, allow both variants + assert len(addresses.values) == 343 or len(addresses.values) == 361 summary_data = summary_case.summary_vector_values("FOPT") assert len(summary_data.values) == 60 From 7db9efe387fc77769c1983798ffadda3f5b3c631 Mon Sep 17 00:00:00 2001 From: Kristian Bendiksen Date: Wed, 11 Aug 2021 11:12:48 +0200 Subject: [PATCH 063/308] StimPlan Model: Improve error handling on missing pressure and porosity data. --- ...StimPlanModelElasticPropertyCalculator.cpp | 10 +++++++--- .../RimStimPlanModelPressureCalculator.cpp | 19 ++++++++++++------- 2 files changed, 19 insertions(+), 10 deletions(-) diff --git a/ApplicationLibCode/ProjectDataModel/StimPlanModel/RimStimPlanModelElasticPropertyCalculator.cpp b/ApplicationLibCode/ProjectDataModel/StimPlanModel/RimStimPlanModelElasticPropertyCalculator.cpp index 146cabb969..1d20513675 100644 --- a/ApplicationLibCode/ProjectDataModel/StimPlanModel/RimStimPlanModelElasticPropertyCalculator.cpp +++ b/ApplicationLibCode/ProjectDataModel/StimPlanModel/RimStimPlanModelElasticPropertyCalculator.cpp @@ -164,21 +164,25 @@ bool RimStimPlanModelElasticPropertyCalculator::calculate( RiaDefines::CurveProp RimElasticProperties* elasticProperties = stimPlanModelTemplate->elasticProperties(); if ( !elasticProperties ) { - RiaLogging::error( QString( "No elastic properties found" ) ); + RiaLogging::error( QString( "No elastic properties found weh extracting elastic properties." ) ); return false; } std::vector faciesValues = m_stimPlanModelCalculator->extractValues( RiaDefines::CurveProperty::FACIES, timeStep ); - if ( faciesValues.empty() ) { - RiaLogging::error( QString( "No facies values found." ) ); + RiaLogging::error( QString( "No facies values found when extracting elastic properties." ) ); return false; } std::vector poroValues = m_stimPlanModelCalculator->extractValues( RiaDefines::CurveProperty::POROSITY_UNSCALED, timeStep ); + if ( poroValues.empty() ) + { + RiaLogging::error( QString( "No porosity values found when extracting elastic properties." ) ); + return false; + } double overburdenHeight = stimPlanModel->overburdenHeight(); if ( overburdenHeight > 0.0 ) diff --git a/ApplicationLibCode/ProjectDataModel/StimPlanModel/RimStimPlanModelPressureCalculator.cpp b/ApplicationLibCode/ProjectDataModel/StimPlanModel/RimStimPlanModelPressureCalculator.cpp index 8eab611db3..a456a1cc91 100644 --- a/ApplicationLibCode/ProjectDataModel/StimPlanModel/RimStimPlanModelPressureCalculator.cpp +++ b/ApplicationLibCode/ProjectDataModel/StimPlanModel/RimStimPlanModelPressureCalculator.cpp @@ -161,13 +161,18 @@ bool RimStimPlanModelPressureCalculator::extractValuesForProperty( RiaDefines::C else { // Extract the property we care about - RimStimPlanModelWellLogCalculator::extractValuesForProperty( pressureCurveProperty, - stimPlanModel, - timeStep, - values, - measuredDepthValues, - tvDepthValues, - rkbDiff ); + if ( !RimStimPlanModelWellLogCalculator::extractValuesForProperty( pressureCurveProperty, + stimPlanModel, + timeStep, + values, + measuredDepthValues, + tvDepthValues, + rkbDiff ) ) + { + RiaLogging::error( QString( "Unable to extract pressure values for property: %1" ) + .arg( caf::AppEnum( curveProperty ).uiText() ) ); + return false; + } } if ( targetTvds.size() != tvDepthValues.size() ) From 40bd4c285a57510d071323fba4f4c7c1d08fa57c Mon Sep 17 00:00:00 2001 From: Kristian Bendiksen Date: Thu, 12 Aug 2021 06:40:31 +0200 Subject: [PATCH 064/308] Improve logging when extracting StimPlan well logs. --- .../RimStimPlanModelPressureCalculator.cpp | 3 ++- .../RimStimPlanModelWellLogCalculator.cpp | 23 ++++++++++++++++++- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/ApplicationLibCode/ProjectDataModel/StimPlanModel/RimStimPlanModelPressureCalculator.cpp b/ApplicationLibCode/ProjectDataModel/StimPlanModel/RimStimPlanModelPressureCalculator.cpp index a456a1cc91..f9e58f695b 100644 --- a/ApplicationLibCode/ProjectDataModel/StimPlanModel/RimStimPlanModelPressureCalculator.cpp +++ b/ApplicationLibCode/ProjectDataModel/StimPlanModel/RimStimPlanModelPressureCalculator.cpp @@ -619,7 +619,8 @@ bool RimStimPlanModelPressureCalculator::interpolateInitialPressureByEquilibrati // EQLNUM data has values for over/underburden, but the pressure values does not. if ( eqlNumValues.size() != ( values.size() + 4 ) ) { - RiaLogging::error( QString( "Failed to build EQLNUM pressure data: result length mismatch." ) ); + RiaLogging::error( + QString( "Failed to build EQLNUM pressure data for initial pressure: result length mismatch." ) ); RiaLogging::error( QString( "EQLNUM length: %1 PRESSURE length: %2" ).arg( eqlNumValues.size() ).arg( values.size() ) ); return false; diff --git a/ApplicationLibCode/ProjectDataModel/StimPlanModel/RimStimPlanModelWellLogCalculator.cpp b/ApplicationLibCode/ProjectDataModel/StimPlanModel/RimStimPlanModelWellLogCalculator.cpp index 8b88e1fb73..e27ea48911 100644 --- a/ApplicationLibCode/ProjectDataModel/StimPlanModel/RimStimPlanModelWellLogCalculator.cpp +++ b/ApplicationLibCode/ProjectDataModel/StimPlanModel/RimStimPlanModelWellLogCalculator.cpp @@ -24,6 +24,7 @@ #include "RigActiveCellInfo.h" #include "RigEclipseCaseData.h" +#include "RigEclipseResultAddress.h" #include "RigEclipseWellLogExtractor.h" #include "RigMainGrid.h" #include "RigResultAccessor.h" @@ -80,6 +81,8 @@ bool RimStimPlanModelWellLogCalculator::calculate( RiaDefines::CurveProperty cur std::vector& tvDepthValues, double& rkbDiff ) const { + RiaLogging::debug( + QString( "Calculating well log for '%1'." ).arg( caf::AppEnum( curveProperty ).uiText() ) ); std::deque missingValueStratgies = stimPlanModel->missingValueStrategies( curveProperty ); @@ -173,6 +176,9 @@ bool RimStimPlanModelWellLogCalculator::calculate( RiaDefines::CurveProperty cur scaleByNetToGross( stimPlanModel, netToGross, values ); } + RiaLogging::debug( QString( "Well log for '%1' done. Size: %2." ) + .arg( caf::AppEnum( curveProperty ).uiText() ) + .arg( values.size() ) ); return true; } @@ -357,7 +363,9 @@ void RimStimPlanModelWellLogCalculator::scaleByNetToGross( const RimStimPlanMode { if ( netToGross.size() != values.size() ) { - RiaLogging::error( QString( "Different sizes for net to gross calculation." ) ); + RiaLogging::error( QString( "Different sizes for net to gross calculation. NTG length: %1. Values length: %2" ) + .arg( netToGross.size() ) + .arg( values.size() ) ); return; } @@ -409,6 +417,9 @@ bool RimStimPlanModelWellLogCalculator::extractValuesForProperty( RiaDefines::Cu return false; } + RiaLogging::info( QString( "Extracting values for '%1' from grid '%2'." ) + .arg( caf::AppEnum( curveProperty ).uiText() ) + .arg( eclipseCase->caseUserDescription() ) ); RigEclipseWellLogExtractor eclExtractor( eclipseCase->eclipseCaseData(), wellPathGeometry, "fracture model" ); measuredDepthValues = eclExtractor.cellIntersectionMDs(); @@ -438,6 +449,10 @@ bool RimStimPlanModelWellLogCalculator::extractValuesForProperty( RiaDefines::Cu if ( resAcc.notNull() ) { eclExtractor.curveData( resAcc.p(), &values ); + RiaLogging::info( QString( "Extracted values %1 from grid '%2' for '%3'." ) + .arg( values.size() ) + .arg( eclipseCase->caseUserDescription() ) + .arg( caf::AppEnum( curveProperty ).uiText() ) ); } else { @@ -492,6 +507,8 @@ bool RimStimPlanModelWellLogCalculator::replaceMissingValuesWithDefault( RiaDefi RigEclipseWellLogExtractor eclExtractor( eclipseCase->eclipseCaseData(), wellPathGeometry, "fracture model" ); eclExtractor.curveData( backupResAcc.p(), &replacementValues ); + RiaLogging::debug( QString( "Read %1 values for '%2'" ).arg( replacementValues.size() ).arg( resultVariable ) ); + if ( values.empty() ) { values = replacementValues; @@ -530,6 +547,10 @@ bool RimStimPlanModelWellLogCalculator::replaceMissingValuesWithDefault( RiaDefi replaceMissingValues( values, replacementValues ); } } + else + { + RiaLogging::debug( "No backup result accessor found." ); + } // If the backup accessor is not found, or does not provide all the missing values: // use default value from the fracture model From 8dbb1d5ccd8c008fbee7a3b7d5e94fd890ccbe8d Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Fri, 13 Aug 2021 16:48:33 +0200 Subject: [PATCH 065/308] Improve well path modeling * Improve handling of MD at first target * When sea level well target is disabled, update MD of first target * Show well target spheres by default, allow toggling of spheres * Activate well target modifiers when clicking on well targets * Remove selection update causing an unstable 3D view * Improve display and handling of multiple locations * Add special 3D target for tie in well target * Add slider to tie in MD input field * Show MD in well path target table * Delete all well path laterals when deleting a well path * Python : Add lateral to parent well * Python : Add perforation interval --- .../RiaCompletionTypeCalculationScheduler.cpp | 11 - .../WellPathCommands/CMakeLists_files.cmake | 2 + .../RicPointTangentManipulator.cpp | 12 +- .../RicPointTangentManipulator.h | 1 + .../RicPointTangentManipulatorPartMgr.cpp | 115 ++++++++-- .../RicPointTangentManipulatorPartMgr.h | 13 +- .../RicWellTarget3dEditor.cpp | 213 +++++++++++++++--- .../RicWellTarget3dEditor.h | 3 + .../RicCreateMultipleWellPathLaterals.cpp | 24 +- .../RicCreateMultipleWellPathLateralsUi.cpp | 20 +- .../RicCreateMultipleWellPathLateralsUi.h | 4 +- .../RicCreateWellTargetsPickEventHandler.cpp | 65 +----- .../RicCreateWellTargetsPickEventHandler.h | 5 - .../RicDeleteWellPathFeature.cpp | 75 ++++++ .../RicDeleteWellPathFeature.h | 34 +++ .../RicLinkWellPathFeature.cpp | 41 +++- .../WellPathCommands/RicLinkWellPathFeature.h | 4 +- .../RicNewWellPathLateralAtDepthFeature.cpp | 4 +- .../RicNewWellPathLateralAtDepthFeature.h | 5 +- .../RicWellPathPickEventHandler.cpp | 7 +- .../ModelVisualization/CMakeLists_files.cmake | 2 + .../ModelVisualization/RivDrawableSpheres.cpp | 84 +++++++ .../ModelVisualization/RivDrawableSpheres.h | 39 ++++ .../ModelVisualization/RivWellPathPartMgr.cpp | 15 +- .../RimContextCommandBuilder.cpp | 17 +- .../ProjectDataModel/RimMultipleLocations.cpp | 29 --- .../ProjectDataModel/RimMultipleLocations.h | 5 - .../WellPath/RimModeledWellPath.cpp | 8 +- .../ProjectDataModel/WellPath/RimWellPath.cpp | 27 ++- .../ProjectDataModel/WellPath/RimWellPath.h | 1 + .../WellPath/RimWellPathCollection.cpp | 9 + .../WellPath/RimWellPathCollection.h | 1 + .../WellPath/RimWellPathGeometryDef.cpp | 41 +++- .../WellPath/RimWellPathGeometryDef.h | 1 + .../WellPath/RimWellPathTarget.cpp | 43 +++- .../WellPath/RimWellPathTarget.h | 13 +- .../WellPath/RimWellPathTieIn.cpp | 34 ++- .../WellPath/RimWellPathTieIn.h | 4 + .../CMakeLists_files.cmake | 8 +- .../RimcModeledWellPath.cpp | 133 +++++++++++ .../RimcModeledWellPath.h | 67 ++++++ .../RimcWellPathGeometryDef.cpp | 85 +++++++ .../RimcWellPathGeometryDef.h | 46 ++++ .../ReservoirDataModel/RigWellPath.cpp | 130 ++++++----- .../ReservoirDataModel/RigWellPath.h | 4 + .../RigWellPathGeometryExporter.cpp | 4 - .../RigWellPathGeometryTools.cpp | 56 +++++ .../RigWellPathGeometryTools.h | 5 + .../rips/PythonExamples/modeled_well_path.py | 41 +++- .../modeled_well_path_lateral.py | 59 +++++ 50 files changed, 1368 insertions(+), 301 deletions(-) create mode 100644 ApplicationLibCode/Commands/WellPathCommands/RicDeleteWellPathFeature.cpp create mode 100644 ApplicationLibCode/Commands/WellPathCommands/RicDeleteWellPathFeature.h create mode 100644 ApplicationLibCode/ModelVisualization/RivDrawableSpheres.cpp create mode 100644 ApplicationLibCode/ModelVisualization/RivDrawableSpheres.h create mode 100644 ApplicationLibCode/ProjectDataModelCommands/RimcModeledWellPath.cpp create mode 100644 ApplicationLibCode/ProjectDataModelCommands/RimcModeledWellPath.h create mode 100644 ApplicationLibCode/ProjectDataModelCommands/RimcWellPathGeometryDef.cpp create mode 100644 ApplicationLibCode/ProjectDataModelCommands/RimcWellPathGeometryDef.h create mode 100644 GrpcInterface/Python/rips/PythonExamples/modeled_well_path_lateral.py diff --git a/ApplicationLibCode/Application/RiaCompletionTypeCalculationScheduler.cpp b/ApplicationLibCode/Application/RiaCompletionTypeCalculationScheduler.cpp index 1cc4c0b9ed..3730f07273 100644 --- a/ApplicationLibCode/Application/RiaCompletionTypeCalculationScheduler.cpp +++ b/ApplicationLibCode/Application/RiaCompletionTypeCalculationScheduler.cpp @@ -114,12 +114,6 @@ void RiaCompletionTypeCalculationScheduler::slotRecalculateCompletionType() Rim3dView* activeView = RiaApplication::instance()->activeReservoirView(); - QModelIndex mi; - if ( RiuMainWindow::instance() ) - { - mi = RiuMainWindow::instance()->projectTreeView()->treeView()->currentIndex(); - } - for ( RimEclipseCase* eclipseCase : uniqueCases ) { if ( eclipseCase ) @@ -148,11 +142,6 @@ void RiaCompletionTypeCalculationScheduler::slotRecalculateCompletionType() RiuMainWindow::instance()->setActiveViewer( activeView->viewer()->layoutWidget() ); } } - - if ( mi.isValid() && RiuMainWindow::instance() ) - { - RiuMainWindow::instance()->projectTreeView()->treeView()->setCurrentIndex( mi ); - } } //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationLibCode/Commands/WellPathCommands/CMakeLists_files.cmake b/ApplicationLibCode/Commands/WellPathCommands/CMakeLists_files.cmake index cb8c3b62c6..c79c3c167f 100644 --- a/ApplicationLibCode/Commands/WellPathCommands/CMakeLists_files.cmake +++ b/ApplicationLibCode/Commands/WellPathCommands/CMakeLists_files.cmake @@ -7,6 +7,7 @@ ${CMAKE_CURRENT_LIST_DIR}/RicNewWellPathListTargetFeature.h ${CMAKE_CURRENT_LIST_DIR}/RicNewWellPathAttributeFeature.h ${CMAKE_CURRENT_LIST_DIR}/RicDeleteWellPathTargetFeature.h ${CMAKE_CURRENT_LIST_DIR}/RicDeleteWellPathAttributeFeature.h +${CMAKE_CURRENT_LIST_DIR}/RicDeleteWellPathFeature.h ${CMAKE_CURRENT_LIST_DIR}/RicWellPathsUnitSystemSettingsImpl.h ${CMAKE_CURRENT_LIST_DIR}/RicWellPathsUnitSystemSettingsUi.h ${CMAKE_CURRENT_LIST_DIR}/RicWellPathPickEventHandler.h @@ -40,6 +41,7 @@ ${CMAKE_CURRENT_LIST_DIR}/RicNewWellPathListTargetFeature.cpp ${CMAKE_CURRENT_LIST_DIR}/RicNewWellPathAttributeFeature.cpp ${CMAKE_CURRENT_LIST_DIR}/RicDeleteWellPathTargetFeature.cpp ${CMAKE_CURRENT_LIST_DIR}/RicDeleteWellPathAttributeFeature.cpp +${CMAKE_CURRENT_LIST_DIR}/RicDeleteWellPathFeature.cpp ${CMAKE_CURRENT_LIST_DIR}/RicWellPathsUnitSystemSettingsImpl.cpp ${CMAKE_CURRENT_LIST_DIR}/RicWellPathsUnitSystemSettingsUi.cpp ${CMAKE_CURRENT_LIST_DIR}/RicWellPathPickEventHandler.cpp diff --git a/ApplicationLibCode/Commands/WellPathCommands/PointTangentManipulator/RicPointTangentManipulator.cpp b/ApplicationLibCode/Commands/WellPathCommands/PointTangentManipulator/RicPointTangentManipulator.cpp index a3a667a18e..e7f9325ba8 100644 --- a/ApplicationLibCode/Commands/WellPathCommands/PointTangentManipulator/RicPointTangentManipulator.cpp +++ b/ApplicationLibCode/Commands/WellPathCommands/PointTangentManipulator/RicPointTangentManipulator.cpp @@ -79,6 +79,14 @@ void RicPointTangentManipulator::setHandleSize( double handleSize ) m_partManager->setHandleSize( handleSize ); } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RicPointTangentManipulator::setPolyline( const std::vector& polyline ) +{ + m_partManager->setPolyline( polyline ); +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- @@ -94,7 +102,7 @@ bool RicPointTangentManipulator::eventFilter( QObject* obj, QEvent* inputEvent ) { if ( inputEvent->type() == QEvent::MouseButtonPress ) { - QMouseEvent* mouseEvent = static_cast( inputEvent ); + auto* mouseEvent = static_cast( inputEvent ); if ( mouseEvent->button() == Qt::LeftButton ) { @@ -119,7 +127,7 @@ bool RicPointTangentManipulator::eventFilter( QObject* obj, QEvent* inputEvent ) { if ( m_partManager->isManipulatorActive() ) { - QMouseEvent* mouseEvent = static_cast( inputEvent ); + auto* mouseEvent = static_cast( inputEvent ); cvf::ref rayIs = m_viewer->rayIntersectSpecFromWindowCoordinates( mouseEvent->pos().x(), diff --git a/ApplicationLibCode/Commands/WellPathCommands/PointTangentManipulator/RicPointTangentManipulator.h b/ApplicationLibCode/Commands/WellPathCommands/PointTangentManipulator/RicPointTangentManipulator.h index 4a23514af2..e7b2dd60b6 100644 --- a/ApplicationLibCode/Commands/WellPathCommands/PointTangentManipulator/RicPointTangentManipulator.h +++ b/ApplicationLibCode/Commands/WellPathCommands/PointTangentManipulator/RicPointTangentManipulator.h @@ -55,6 +55,7 @@ class RicPointTangentManipulator : public QObject void setOrigin( const cvf::Vec3d& origin ); void setTangent( const cvf::Vec3d& tangent ); void setHandleSize( double handleSize ); + void setPolyline( const std::vector& polyline ); void appendPartsToModel( cvf::ModelBasicList* model ); diff --git a/ApplicationLibCode/Commands/WellPathCommands/PointTangentManipulator/RicPointTangentManipulatorPartMgr.cpp b/ApplicationLibCode/Commands/WellPathCommands/PointTangentManipulator/RicPointTangentManipulatorPartMgr.cpp index 732d30d8b3..a9fdaf08d4 100644 --- a/ApplicationLibCode/Commands/WellPathCommands/PointTangentManipulator/RicPointTangentManipulatorPartMgr.cpp +++ b/ApplicationLibCode/Commands/WellPathCommands/PointTangentManipulator/RicPointTangentManipulatorPartMgr.cpp @@ -15,6 +15,7 @@ // for more details. // ///////////////////////////////////////////////////////////////////////////////// + #include "RicPointTangentManipulatorPartMgr.h" #include "RivPartPriority.h" @@ -36,17 +37,16 @@ #include "cvfPrimitiveSetIndexedUInt.h" #include "cvfRay.h" +#include "cvfGeometryTools.h" #include "cvfMath.h" -#include - //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- RicPointTangentManipulatorPartMgr::RicPointTangentManipulatorPartMgr() : m_tangentOnStartManipulation( cvf::Vec3d::UNDEFINED ) , m_originOnStartManipulation( cvf::Vec3d::UNDEFINED ) - , m_activeHandle( NONE ) + , m_activeHandle( HandleType::NONE ) , m_handleSize( 1.0 ) , m_isGeometryUpdateNeeded( true ) { @@ -104,12 +104,20 @@ void RicPointTangentManipulatorPartMgr::originAndTangent( cvf::Vec3d* origin, cv *tangent = m_tangent; } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RicPointTangentManipulatorPartMgr::setPolyline( const std::vector& polyline ) +{ + m_polyline = polyline; +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- bool RicPointTangentManipulatorPartMgr::isManipulatorActive() const { - return m_activeHandle != NONE; + return m_activeHandle != HandleType::NONE; } //-------------------------------------------------------------------------------------------------- @@ -172,7 +180,37 @@ void RicPointTangentManipulatorPartMgr::updateManipulatorFromRay( const cvf::Ray { if ( !isManipulatorActive() ) return; - if ( m_activeHandle == HORIZONTAL_PLANE ) + if ( m_activeHandle == HandleType::PRESCRIBED_POLYLINE ) + { + cvf::Plane plane; + plane.setFromPointAndNormal( m_origin, newMouseRay->direction() ); + cvf::Vec3d newIntersection; + newMouseRay->planeIntersect( plane, &newIntersection ); + + const cvf::Vec3d newOrigin = m_originOnStartManipulation + ( newIntersection - m_initialPickPoint ); + + double closestDistance = std::numeric_limits::max(); + cvf::Vec3d closestPoint; + + for ( size_t i = 1; i < m_polyline.size(); i++ ) + { + const auto& p1 = m_polyline[i]; + const auto& p2 = m_polyline[i - 1]; + + double normalizedIntersection; + const auto pointOnLine = cvf::GeometryTools::projectPointOnLine( p1, p2, newOrigin, &normalizedIntersection ); + + const double candidateDistance = pointOnLine.pointDistanceSquared( newOrigin ); + if ( candidateDistance < closestDistance ) + { + closestDistance = candidateDistance; + closestPoint = pointOnLine; + } + } + + m_origin = closestPoint; + } + else if ( m_activeHandle == HandleType::HORIZONTAL_PLANE ) { cvf::Plane plane; plane.setFromPointAndNormal( m_origin, cvf::Vec3d::Z_AXIS ); @@ -183,7 +221,7 @@ void RicPointTangentManipulatorPartMgr::updateManipulatorFromRay( const cvf::Ray m_origin = newOrigin; } - else if ( m_activeHandle == VERTICAL_AXIS ) + else if ( m_activeHandle == HandleType::VERTICAL_AXIS ) { cvf::Plane plane; cvf::Vec3d planeNormal = ( newMouseRay->direction() ^ cvf::Vec3d::Z_AXIS ) ^ cvf::Vec3d::Z_AXIS; @@ -201,7 +239,6 @@ void RicPointTangentManipulatorPartMgr::updateManipulatorFromRay( const cvf::Ray m_origin = newOrigin; } - // m_tangent = newTangent; m_isGeometryUpdateNeeded = true; } @@ -211,7 +248,7 @@ void RicPointTangentManipulatorPartMgr::updateManipulatorFromRay( const cvf::Ray //-------------------------------------------------------------------------------------------------- void RicPointTangentManipulatorPartMgr::endManipulator() { - m_activeHandle = NONE; + m_activeHandle = HandleType::NONE; } //-------------------------------------------------------------------------------------------------- @@ -219,8 +256,15 @@ void RicPointTangentManipulatorPartMgr::endManipulator() //-------------------------------------------------------------------------------------------------- void RicPointTangentManipulatorPartMgr::recreateAllGeometryAndParts() { - createHorizontalPlaneHandle(); - createVerticalAxisHandle(); + if ( m_polyline.empty() ) + { + createHorizontalPlaneHandle(); + createVerticalAxisHandle(); + } + else + { + createPolylineHandle(); + } } //-------------------------------------------------------------------------------------------------- @@ -228,8 +272,15 @@ void RicPointTangentManipulatorPartMgr::recreateAllGeometryAndParts() //-------------------------------------------------------------------------------------------------- void RicPointTangentManipulatorPartMgr::createGeometryOnly() { - m_handleParts[HORIZONTAL_PLANE]->setDrawable( createHorizontalPlaneGeo().p() ); - m_handleParts[VERTICAL_AXIS]->setDrawable( createVerticalAxisGeo().p() ); + if ( m_polyline.empty() ) + { + m_handleParts[HandleType::HORIZONTAL_PLANE]->setDrawable( createHorizontalPlaneGeo().p() ); + m_handleParts[HandleType::VERTICAL_AXIS]->setDrawable( createVerticalAxisGeo().p() ); + } + else + { + m_handleParts[HandleType::PRESCRIBED_POLYLINE]->setDrawable( createPolylineGeo().p() ); + } } //-------------------------------------------------------------------------------------------------- @@ -241,7 +292,7 @@ void RicPointTangentManipulatorPartMgr::createHorizontalPlaneHandle() ref geo = createHorizontalPlaneGeo(); - HandleType handleId = HORIZONTAL_PLANE; + HandleType handleId = HandleType::HORIZONTAL_PLANE; cvf::Color4f color = cvf::Color4f( 1.0f, 0.0f, 1.0f, 0.7f ); cvf::String partName( "PointTangentManipulator Horizontal Plane Handle" ); @@ -318,7 +369,7 @@ void RicPointTangentManipulatorPartMgr::createVerticalAxisHandle() using namespace cvf; cvf::ref geo = createVerticalAxisGeo(); - HandleType handleId = VERTICAL_AXIS; + HandleType handleId = HandleType::VERTICAL_AXIS; cvf::Color4f color = cvf::Color4f( 0.0f, 0.7f, 0.8f, 0.7f ); cvf::String partName( "PointTangentManipulator Vertical Axis Handle" ); @@ -362,6 +413,42 @@ cvf::ref RicPointTangentManipulatorPartMgr::createVerticalAxis return createIndexedTriangelDrawableGeo( vertexArray.p(), indexArray.p() ); } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RicPointTangentManipulatorPartMgr::createPolylineHandle() +{ + cvf::ref geo = createPolylineGeo(); + + HandleType handleId = HandleType::PRESCRIBED_POLYLINE; + cvf::Color4f color = cvf::Color4f( 0.8f, 0.7f, 0.8f, 0.7f ); + cvf::String partName( "PointTangentManipulator Polyline Handle" ); + + addHandlePart( geo.p(), color, handleId, partName ); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +cvf::ref RicPointTangentManipulatorPartMgr::createPolylineGeo() +{ + using namespace cvf; + + cvf::ref geomBuilder = new cvf::GeometryBuilderTriangles; + + double radius = m_handleSize * 0.3; + cvf::GeometryUtils::createSphere( radius, 10, 10, geomBuilder.p() ); + + Vec3f origin( m_origin ); + + geomBuilder->transformVertexRange( 0, geomBuilder->vertexCount() - 1, cvf::Mat4f::fromTranslation( origin ) ); + + cvf::ref vertexArray = geomBuilder->vertices(); + cvf::ref indexArray = geomBuilder->triangles(); + + return createIndexedTriangelDrawableGeo( vertexArray.p(), indexArray.p() ); +} + #if 0 //-------------------------------------------------------------------------------------------------- /// diff --git a/ApplicationLibCode/Commands/WellPathCommands/PointTangentManipulator/RicPointTangentManipulatorPartMgr.h b/ApplicationLibCode/Commands/WellPathCommands/PointTangentManipulator/RicPointTangentManipulatorPartMgr.h index d339749496..96379d9ddb 100644 --- a/ApplicationLibCode/Commands/WellPathCommands/PointTangentManipulator/RicPointTangentManipulatorPartMgr.h +++ b/ApplicationLibCode/Commands/WellPathCommands/PointTangentManipulator/RicPointTangentManipulatorPartMgr.h @@ -38,18 +38,19 @@ class String; template class Array; -typedef Array Vec3fArray; -typedef Array UIntArray; +using Vec3fArray = Array; +using UIntArray = Array; } // namespace cvf class RicPointTangentManipulatorPartMgr : public cvf::Object { public: - enum HandleType + enum class HandleType { HORIZONTAL_PLANE, VERTICAL_AXIS, + PRESCRIBED_POLYLINE, AZIMUTH, INCLINATION, NONE @@ -63,6 +64,7 @@ class RicPointTangentManipulatorPartMgr : public cvf::Object void setTangent( const cvf::Vec3d& tangent ); void setHandleSize( double handleSize ); void originAndTangent( cvf::Vec3d* origin, cvf::Vec3d* tangent ); + void setPolyline( const std::vector& polyline ); bool isManipulatorActive() const; void tryToActivateManipulator( const cvf::HitItem* hitItem ); @@ -81,6 +83,9 @@ class RicPointTangentManipulatorPartMgr : public cvf::Object void createVerticalAxisHandle(); cvf::ref createVerticalAxisGeo(); + void createPolylineHandle(); + cvf::ref createPolylineGeo(); + void addHandlePart( cvf::DrawableGeo* geo, const cvf::Color4f& color, HandleType handleId, const cvf::String& partName ); void addActiveModePart( cvf::DrawableGeo* geo, const cvf::Color4f& color, HandleType handleId, const cvf::String& partName ); @@ -99,6 +104,8 @@ class RicPointTangentManipulatorPartMgr : public cvf::Object double m_handleSize; bool m_isGeometryUpdateNeeded; + std::vector m_polyline; + HandleType m_activeHandle; cvf::Vec3d m_initialPickPoint; cvf::Vec3d m_tangentOnStartManipulation; diff --git a/ApplicationLibCode/Commands/WellPathCommands/PointTangentManipulator/RicWellTarget3dEditor.cpp b/ApplicationLibCode/Commands/WellPathCommands/PointTangentManipulator/RicWellTarget3dEditor.cpp index 972b9997aa..3580a1e1c0 100644 --- a/ApplicationLibCode/Commands/WellPathCommands/PointTangentManipulator/RicWellTarget3dEditor.cpp +++ b/ApplicationLibCode/Commands/WellPathCommands/PointTangentManipulator/RicWellTarget3dEditor.cpp @@ -20,12 +20,15 @@ #include "RicPointTangentManipulator.h" +#include "RigWellPath.h" + #include "Rim3dView.h" #include "RimCase.h" #include "RimModeledWellPath.h" #include "RimWellPathGeometryDef.h" #include "RimWellPathGeometryDefTools.h" #include "RimWellPathTarget.h" +#include "RimWellPathTieIn.h" #include "RiuViewer.h" @@ -50,7 +53,7 @@ RicWellTarget3dEditor::RicWellTarget3dEditor() //-------------------------------------------------------------------------------------------------- RicWellTarget3dEditor::~RicWellTarget3dEditor() { - RiuViewer* ownerRiuViewer = dynamic_cast( ownerViewer() ); + auto* ownerRiuViewer = dynamic_cast( ownerViewer() ); if ( m_cvfModel.notNull() && ownerRiuViewer ) { @@ -68,9 +71,9 @@ RicWellTarget3dEditor::~RicWellTarget3dEditor() //-------------------------------------------------------------------------------------------------- void RicWellTarget3dEditor::configureAndUpdateUi( const QString& uiConfigName ) { - RimWellPathTarget* target = dynamic_cast( this->pdmObject() ); - RiuViewer* ownerRiuViewer = dynamic_cast( ownerViewer() ); - Rim3dView* view = mainOrComparisonView(); + auto* target = dynamic_cast( this->pdmObject() ); + auto* ownerRiuViewer = dynamic_cast( ownerViewer() ); + Rim3dView* view = mainOrComparisonView(); if ( !target || !target->isEnabled() || !view ) { @@ -110,6 +113,29 @@ void RicWellTarget3dEditor::configureAndUpdateUi( const QString& uiConfigName ) m_manipulator->setTangent( target->tangent() ); m_manipulator->setHandleSize( handleSize ); + { + RimWellPath* wellPath = nullptr; + target->firstAncestorOrThisOfType( wellPath ); + + if ( wellPath && !wellPath->isTopLevelWellPath() && geomDef->firstActiveTarget() == target ) + { + if ( auto parentWellPath = wellPath->wellPathTieIn()->parentWell() ) + { + auto geo = parentWellPath->wellPathGeometry(); + auto points = geo->wellPathPoints(); + + for ( auto& p : points ) + { + p = dispXf->transformToDisplayCoord( p ); + } + + // For the first target of a lateral, use the coordinates from the parent well as snap-to locations for + // the 3D manipulator sphere + m_manipulator->setPolyline( points ); + } + } + } + m_cvfModel->removeAllParts(); m_manipulator->appendPartsToModel( m_cvfModel.p() ); @@ -129,64 +155,167 @@ void RicWellTarget3dEditor::cleanupBeforeSettingPdmObject() //-------------------------------------------------------------------------------------------------- void RicWellTarget3dEditor::slotUpdated( const cvf::Vec3d& origin, const cvf::Vec3d& tangent ) { - RimWellPathTarget* target = dynamic_cast( this->pdmObject() ); - Rim3dView* view = mainOrComparisonView(); + auto* manipulatedTarget = dynamic_cast( this->pdmObject() ); + Rim3dView* view = mainOrComparisonView(); - if ( !target || !view ) + if ( !manipulatedTarget || !view ) { return; } RimWellPathGeometryDef* geomDef; - target->firstAncestorOrThisOfTypeAsserted( geomDef ); + manipulatedTarget->firstAncestorOrThisOfTypeAsserted( geomDef ); if ( !geomDef ) return; - if ( geomDef->useReferencePointFromTopLevelWell() ) + RimModeledWellPath* modeledWellPath = nullptr; + geomDef->firstAncestorOfType( modeledWellPath ); + + cvf::Vec3d domainCoordXYZ; // domain coordinate of the new location + cvf::Vec3d deltaManipulatorMovement; // delta change relative current location of target + cvf::Vec3d relativePositionXYZ; // position of well target relative to anchor point + { + cvf::ref dispXf = view->displayCoordTransform(); + domainCoordXYZ = dispXf->transformToDomainCoord( origin ); + + relativePositionXYZ = domainCoordXYZ - geomDef->anchorPointXyz(); + deltaManipulatorMovement = manipulatedTarget->targetPointXYZ() - relativePositionXYZ; + } + + if ( geomDef->activeWellTargets().front() == manipulatedTarget ) { - RimModeledWellPath* modeledWellPath = nullptr; - geomDef->firstAncestorOfType( modeledWellPath ); - if ( modeledWellPath ) + // The first well target of a lateral is the tie-in well target + + if ( modeledWellPath && modeledWellPath->wellPathTieIn() && modeledWellPath->wellPathTieIn()->parentWell() ) + { + auto parentWell = modeledWellPath->wellPathTieIn()->parentWell(); + auto wellPathGeo = parentWell->wellPathGeometry(); + auto closestMD = wellPathGeo->closestMeasuredDepth( domainCoordXYZ ); + + modeledWellPath->wellPathTieIn()->setTieInMeasuredDepth( closestMD ); + modeledWellPath->wellPathTieIn()->updateChildWellGeometry(); + } + + bool modifyAllTargetsOnAllWells = ( ( QApplication::keyboardModifiers() & Qt::ControlModifier ) && + ( QApplication::keyboardModifiers() & Qt::SHIFT ) ); + + if ( modifyAllTargetsOnAllWells ) { - auto topLevelWellPath = dynamic_cast( modeledWellPath->topLevelWellPath() ); - if ( topLevelWellPath ) + for ( auto wellLateral : modeledWellPath->wellPathLaterals() ) { - // Manipulate the reference point of top level well path - geomDef = topLevelWellPath->geometryDefinition(); + if ( auto modeledLateral = dynamic_cast( wellLateral ) ) + { + auto activeTargets = modeledLateral->geometryDefinition()->activeWellTargets(); + for ( auto t : activeTargets ) + { + if ( t == activeTargets.front() ) continue; + if ( t == manipulatedTarget ) continue; + + // Does not work very well + // Must update the tie-in MD also + updateTargetWithDeltaChange( t, deltaManipulatorMovement ); + } + } } } - } - cvf::ref dispXf = view->displayCoordTransform(); + if ( QApplication::keyboardModifiers() & Qt::ControlModifier ) + { + for ( auto target : geomDef->activeWellTargets() ) + { + if ( target == geomDef->activeWellTargets().front() ) continue; + + updateTargetWithDeltaChange( target, deltaManipulatorMovement ); + } + } + + cvf::Vec3d relativePositionXYD = relativePositionXYZ; + relativePositionXYD.z() = -relativePositionXYD.z(); - auto domainCoordXYZ = dispXf->transformToDomainCoord( origin ); + manipulatedTarget->updateFrom3DManipulator( relativePositionXYD ); - // If CTRL is pressed, modify the reference point instead of the well path target - bool modifyReferencePoint = ( QApplication::keyboardModifiers() & Qt::ControlModifier ); - if ( modifyReferencePoint ) + return; + } + + if ( modeledWellPath && modeledWellPath->isTopLevelWellPath() ) { - auto relativePositionXYZ = domainCoordXYZ - geomDef->anchorPointXyz(); - auto delta = target->targetPointXYZ() - relativePositionXYZ; + // Modification of top level well path + + bool modifyReferencePoint = ( ( QApplication::keyboardModifiers() & Qt::ControlModifier ) && + ( QApplication::keyboardModifiers() & Qt::SHIFT ) ); + if ( modifyReferencePoint ) + { + // Find all linked wells and update reference point with delta change + std::vector linkedWellPathGeoDefs; + if ( geomDef->isReferencePointUpdatesLinked() ) + { + linkedWellPathGeoDefs = RimWellPathGeometryDefTools::linkedDefinitions(); + } + else + { + linkedWellPathGeoDefs.push_back( geomDef ); + } - // Find all linked wells and update with delta change + RimWellPathGeometryDefTools::updateLinkedGeometryDefinitions( linkedWellPathGeoDefs, deltaManipulatorMovement ); - std::vector linkedWellPathGeoDefs; - if ( geomDef->isReferencePointUpdatesLinked() ) + return; + } + + bool modifyAllTargetOnWell = ( QApplication::keyboardModifiers() & Qt::ControlModifier ); + if ( modifyAllTargetOnWell ) { - linkedWellPathGeoDefs = RimWellPathGeometryDefTools::linkedDefinitions(); + for ( auto t : geomDef->activeWellTargets() ) + { + if ( t == manipulatedTarget ) continue; + + updateTargetWithDeltaChange( t, deltaManipulatorMovement ); + } } - else + } + else if ( modeledWellPath && !modeledWellPath->isTopLevelWellPath() ) + { + bool modifyAllTargetsOnAllWells = ( ( QApplication::keyboardModifiers() & Qt::ControlModifier ) && + ( QApplication::keyboardModifiers() & Qt::SHIFT ) ); + if ( modifyAllTargetsOnAllWells ) { - linkedWellPathGeoDefs.push_back( geomDef ); + // Update all well targets on all connected laterals + + for ( auto wellLateral : modeledWellPath->wellPathLaterals() ) + { + if ( auto modeledLateral = dynamic_cast( wellLateral ) ) + { + auto activeTargets = modeledLateral->geometryDefinition()->activeWellTargets(); + for ( auto t : activeTargets ) + { + if ( t == activeTargets.front() ) continue; + if ( t == manipulatedTarget ) continue; + + updateTargetWithDeltaChange( t, deltaManipulatorMovement ); + } + } + } } - RimWellPathGeometryDefTools::updateLinkedGeometryDefinitions( linkedWellPathGeoDefs, delta ); + bool modifyAllTargets = ( QApplication::keyboardModifiers() & Qt::ControlModifier ); + if ( modifyAllTargets ) + { + // Update all well targets on current well path + + for ( auto t : geomDef->activeWellTargets() ) + { + if ( t == geomDef->activeWellTargets().front() ) continue; + if ( t == manipulatedTarget ) continue; + + updateTargetWithDeltaChange( t, deltaManipulatorMovement ); + } + } } - else + + // Modify a single well target { - cvf::Vec3d relativePositionXYD = domainCoordXYZ - geomDef->anchorPointXyz(); + cvf::Vec3d relativePositionXYD = relativePositionXYZ; relativePositionXYD.z() = -relativePositionXYD.z(); - target->updateFrom3DManipulator( relativePositionXYD ); + manipulatedTarget->updateFrom3DManipulator( relativePositionXYD ); } } @@ -195,7 +324,7 @@ void RicWellTarget3dEditor::slotUpdated( const cvf::Vec3d& origin, const cvf::Ve //-------------------------------------------------------------------------------------------------- void RicWellTarget3dEditor::slotSelectedIn3D() { - RimWellPathTarget* target = dynamic_cast( this->pdmObject() ); + auto* target = dynamic_cast( this->pdmObject() ); if ( !target ) { return; @@ -209,7 +338,7 @@ void RicWellTarget3dEditor::slotSelectedIn3D() //-------------------------------------------------------------------------------------------------- void RicWellTarget3dEditor::slotDragFinished() { - RimWellPathTarget* target = dynamic_cast( this->pdmObject() ); + auto* target = dynamic_cast( this->pdmObject() ); if ( !target ) { return; @@ -223,7 +352,7 @@ void RicWellTarget3dEditor::slotDragFinished() //-------------------------------------------------------------------------------------------------- void RicWellTarget3dEditor::removeAllFieldEditors() { - if ( RimWellPathTarget* oldTarget = dynamic_cast( this->pdmObject() ) ) + if ( auto* oldTarget = dynamic_cast( this->pdmObject() ) ) { for ( auto field : oldTarget->fieldsFor3dManipulator() ) { @@ -231,3 +360,13 @@ void RicWellTarget3dEditor::removeAllFieldEditors() } } } + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RicWellTarget3dEditor::updateTargetWithDeltaChange( RimWellPathTarget* target, const cvf::Vec3d& delta ) +{ + auto coordXYZ = target->targetPointXYZ() - delta; + target->setPointXYZ( coordXYZ ); + target->updateConnectedEditors(); +} diff --git a/ApplicationLibCode/Commands/WellPathCommands/PointTangentManipulator/RicWellTarget3dEditor.h b/ApplicationLibCode/Commands/WellPathCommands/PointTangentManipulator/RicWellTarget3dEditor.h index 7f041829a9..3b46859cd3 100644 --- a/ApplicationLibCode/Commands/WellPathCommands/PointTangentManipulator/RicWellTarget3dEditor.h +++ b/ApplicationLibCode/Commands/WellPathCommands/PointTangentManipulator/RicWellTarget3dEditor.h @@ -26,6 +26,7 @@ #include class RicPointTangentManipulator; +class RimWellPathTarget; namespace cvf { @@ -54,6 +55,8 @@ private slots: private: void removeAllFieldEditors(); + static void updateTargetWithDeltaChange( RimWellPathTarget* target, const cvf::Vec3d& delta ); + private: QPointer m_manipulator; cvf::ref m_cvfModel; diff --git a/ApplicationLibCode/Commands/WellPathCommands/RicCreateMultipleWellPathLaterals.cpp b/ApplicationLibCode/Commands/WellPathCommands/RicCreateMultipleWellPathLaterals.cpp index a208c220b6..2f95de8917 100644 --- a/ApplicationLibCode/Commands/WellPathCommands/RicCreateMultipleWellPathLaterals.cpp +++ b/ApplicationLibCode/Commands/WellPathCommands/RicCreateMultipleWellPathLaterals.cpp @@ -66,21 +66,27 @@ void RicCreateMultipleWellPathLaterals::onActionTriggered( bool isChecked ) if ( selected ) { - m_ui->setSourceLateral( selected ); + m_ui->setTopLevelWellPath( selected->topLevelWellPath() ); + double startMD = 0.0; double endMD = 0.0; - if ( auto tieIn = selected->wellPathTieIn() ) - { - startMD = selected->wellPathTieIn()->tieInMeasuredDepth() + 50.0; - endMD = startMD + 50.0; - if ( auto parentWell = selected->wellPathTieIn()->parentWell() ) + auto sourceLateral = m_ui->sourceLateral(); + if ( sourceLateral ) + { + if ( auto tieIn = sourceLateral->wellPathTieIn() ) { - if ( !parentWell->wellPathGeometry()->measuredDepths().empty() ) + startMD = sourceLateral->wellPathTieIn()->tieInMeasuredDepth() + 50.0; + endMD = startMD + 50.0; + + if ( auto parentWell = sourceLateral->wellPathTieIn()->parentWell() ) { - double candidate = parentWell->wellPathGeometry()->measuredDepths().back() - 50.0; + if ( !parentWell->wellPathGeometry()->measuredDepths().empty() ) + { + double candidate = parentWell->wellPathGeometry()->measuredDepths().back() - 50.0; - if ( candidate > startMD ) endMD = candidate; + if ( candidate > startMD ) endMD = candidate; + } } } } diff --git a/ApplicationLibCode/Commands/WellPathCommands/RicCreateMultipleWellPathLateralsUi.cpp b/ApplicationLibCode/Commands/WellPathCommands/RicCreateMultipleWellPathLateralsUi.cpp index cbcf78f434..3e216b7d0b 100644 --- a/ApplicationLibCode/Commands/WellPathCommands/RicCreateMultipleWellPathLateralsUi.cpp +++ b/ApplicationLibCode/Commands/WellPathCommands/RicCreateMultipleWellPathLateralsUi.cpp @@ -47,6 +47,9 @@ RicCreateMultipleWellPathLateralsUi::RicCreateMultipleWellPathLateralsUi() { CAF_PDM_InitFieldNoDefault( &m_sourceLateral, "SourceLaterals", "Source Well Path Lateral", "", "", "" ); + CAF_PDM_InitFieldNoDefault( &m_topLevelWellPath, "TopLevelWellPath", "Top Level Well Path", "", "", "" ); + m_topLevelWellPath.uiCapability()->setUiHidden( true ); + CAF_PDM_InitFieldNoDefault( &m_locations, "Locations", "Locations", "", "", "" ); m_locations = new RimMultipleLocations; } @@ -54,9 +57,13 @@ RicCreateMultipleWellPathLateralsUi::RicCreateMultipleWellPathLateralsUi() //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -void RicCreateMultipleWellPathLateralsUi::setSourceLateral( RimModeledWellPath* lateral ) +void RicCreateMultipleWellPathLateralsUi::setTopLevelWellPath( RimWellPath* wellPath ) { - m_sourceLateral = lateral; + m_topLevelWellPath = wellPath; + + auto laterals = RimTools::wellPathCollection()->connectedWellPathLaterals( m_topLevelWellPath ); + + if ( !laterals.empty() ) m_sourceLateral = dynamic_cast( laterals.front() ); } //-------------------------------------------------------------------------------------------------- @@ -108,14 +115,15 @@ QList if ( fieldNeedingOptions == &m_sourceLateral ) { - if ( sourceLateral()->wellPathTieIn() && sourceLateral()->wellPathTieIn()->parentWell() ) + if ( m_topLevelWellPath ) { - auto parentWell = sourceLateral()->wellPathTieIn()->parentWell(); - auto laterals = RimTools::wellPathCollection()->connectedWellPathLaterals( parentWell ); + auto laterals = RimTools::wellPathCollection()->connectedWellPathLaterals( m_topLevelWellPath ); for ( auto lateral : laterals ) { - options.push_back( caf::PdmOptionItemInfo( lateral->name(), lateral ) ); + caf::IconProvider iconProvider = lateral->uiIconProvider(); + + options.push_back( caf::PdmOptionItemInfo( lateral->name(), lateral, false, iconProvider ) ); } } } diff --git a/ApplicationLibCode/Commands/WellPathCommands/RicCreateMultipleWellPathLateralsUi.h b/ApplicationLibCode/Commands/WellPathCommands/RicCreateMultipleWellPathLateralsUi.h index 0c7af4671b..9378a756ca 100644 --- a/ApplicationLibCode/Commands/WellPathCommands/RicCreateMultipleWellPathLateralsUi.h +++ b/ApplicationLibCode/Commands/WellPathCommands/RicCreateMultipleWellPathLateralsUi.h @@ -30,6 +30,7 @@ #include class RimModeledWellPath; +class RimWellPath; namespace caf { @@ -46,7 +47,7 @@ class RicCreateMultipleWellPathLateralsUi : public caf::PdmObject public: RicCreateMultipleWellPathLateralsUi(); - void setSourceLateral( RimModeledWellPath* lateral ); + void setTopLevelWellPath( RimWellPath* wellPath ); void setDefaultValues( double start, double end ); RimModeledWellPath* sourceLateral() const; @@ -60,6 +61,7 @@ class RicCreateMultipleWellPathLateralsUi : public caf::PdmObject private: caf::PdmPtrField m_sourceLateral; + caf::PdmPtrField m_topLevelWellPath; caf::PdmChildField m_locations; }; diff --git a/ApplicationLibCode/Commands/WellPathCommands/RicCreateWellTargetsPickEventHandler.cpp b/ApplicationLibCode/Commands/WellPathCommands/RicCreateWellTargetsPickEventHandler.cpp index 558eb41e23..24a383985f 100644 --- a/ApplicationLibCode/Commands/WellPathCommands/RicCreateWellTargetsPickEventHandler.cpp +++ b/ApplicationLibCode/Commands/WellPathCommands/RicCreateWellTargetsPickEventHandler.cpp @@ -27,6 +27,7 @@ #include "RigHexIntersectionTools.h" #include "RigMainGrid.h" #include "RigWellPath.h" +#include "RigWellPathGeometryTools.h" #include "Rim3dView.h" #include "RimEclipseView.h" @@ -111,8 +112,15 @@ bool RicCreateWellTargetsPickEventHandler::handle3dPickEvent( const Ric3dPickEve targetPointInDomain = wellPathSourceInfo->closestPointOnCenterLine( firstPickItem.faceIdx(), intersectionPointInDomain ); double md = wellPathSourceInfo->measuredDepth( firstPickItem.faceIdx(), intersectionPointInDomain ); - doSetAzimuthAndInclination = calculateAzimuthAndInclinationAtMd( md, wellPathGeometry, &azimuth, &inclination ); - double rkbDiff = wellPathGeometry->rkbDiff(); + + { + const auto [az, inc] = RigWellPathGeometryTools::calculateAzimuthAndInclinationAtMd( md, wellPathGeometry ); + azimuth = az; + inclination = inc; + doSetAzimuthAndInclination = true; + } + + double rkbDiff = wellPathGeometry->rkbDiff(); if ( m_geometryToAddTargetsTo->airGap() == 0.0 && rkbDiff != std::numeric_limits::infinity() ) { m_geometryToAddTargetsTo->setAirGap( rkbDiff ); @@ -190,59 +198,6 @@ bool RicCreateWellTargetsPickEventHandler::handle3dPickEvent( const Ric3dPickEve return false; } -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -bool RicCreateWellTargetsPickEventHandler::calculateAzimuthAndInclinationAtMd( double measuredDepth, - gsl::not_null wellPathGeometry, - double* azimuth, - double* inclination ) const -{ - int mdIndex = -1; - auto mdList = wellPathGeometry->measuredDepths(); - - for ( int i = 0; i < (int)mdList.size(); i++ ) - { - if ( mdList[i] > measuredDepth ) - { - mdIndex = i - 1; - break; - } - } - - auto ptList = wellPathGeometry->wellPathPoints(); - if ( mdIndex > 0 && mdIndex < (int)ptList.size() - 2 ) - { - auto v1 = cvf::Vec3d( ptList[mdIndex - 1] ); - auto v2 = cvf::Vec3d( ptList[mdIndex] ); - auto v3 = cvf::Vec3d( ptList[mdIndex + 1] ); - auto v4 = cvf::Vec3d( ptList[mdIndex + 2] ); - - auto v21 = v2 - v1; - auto v32 = v3 - v2; - auto v43 = v4 - v3; - - v21.normalize(); - v32.normalize(); - v43.normalize(); - - auto v13mean = ( v21 + v32 ) / 2; - auto v24mean = ( v32 + v43 ) / 2; - - double weight = ( measuredDepth - mdList[mdIndex] ) / ( mdList[mdIndex + 1] - mdList[mdIndex] ); - auto vTan = v13mean * weight + v24mean * ( 1 - weight ); - - RiaOffshoreSphericalCoords coords( vTan ); - *azimuth = coords.azi(); - *inclination = coords.inc(); - return true; - } - - *azimuth = 0.0; - *inclination = 0.0; - return false; -} - //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationLibCode/Commands/WellPathCommands/RicCreateWellTargetsPickEventHandler.h b/ApplicationLibCode/Commands/WellPathCommands/RicCreateWellTargetsPickEventHandler.h index 1f81abd7ce..be0c8acd69 100644 --- a/ApplicationLibCode/Commands/WellPathCommands/RicCreateWellTargetsPickEventHandler.h +++ b/ApplicationLibCode/Commands/WellPathCommands/RicCreateWellTargetsPickEventHandler.h @@ -43,11 +43,6 @@ class RicCreateWellTargetsPickEventHandler : public Ric3dViewPickEventHandler void notifyUnregistered() override; private: - bool calculateAzimuthAndInclinationAtMd( double measuredDepth, - gsl::not_null wellPathGeometry, - double* azimuth, - double* inclination ) const; - static bool isGridSourceObject( const cvf::Object* object ); static cvf::Vec3d findHexElementIntersection( gsl::not_null view, const RiuPickItemInfo& pickItem, diff --git a/ApplicationLibCode/Commands/WellPathCommands/RicDeleteWellPathFeature.cpp b/ApplicationLibCode/Commands/WellPathCommands/RicDeleteWellPathFeature.cpp new file mode 100644 index 0000000000..8adc133bd0 --- /dev/null +++ b/ApplicationLibCode/Commands/WellPathCommands/RicDeleteWellPathFeature.cpp @@ -0,0 +1,75 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2021- Equinor ASA +// +// ResInsight is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// + +#include "RicDeleteWellPathFeature.h" + +#include "RimTools.h" +#include "RimWellPath.h" +#include "RimWellPathCollection.h" + +#include "cafSelectionManager.h" + +#include + +CAF_CMD_SOURCE_INIT( RicDeleteWellPathFeature, "RicDeleteWellPathFeature" ); + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +bool RicDeleteWellPathFeature::isCommandEnabled() +{ + std::vector objects; + caf::SelectionManager::instance()->objectsByType( &objects ); + + return !objects.empty(); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RicDeleteWellPathFeature::onActionTriggered( bool isChecked ) +{ + std::vector wellPaths; + caf::SelectionManager::instance()->objectsByType( &wellPaths ); + + if ( !wellPaths.empty() ) + { + auto wpc = RimTools::wellPathCollection(); + + for ( auto w : wellPaths ) + { + for ( auto wl : w->allWellPathLaterals() ) + { + wpc->deleteWell( wl ); + } + } + + wpc->rebuildWellPathNodes(); + wpc->scheduleRedrawAffectedViews(); + wpc->updateAllRequiredEditors(); + } +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RicDeleteWellPathFeature::setupActionLook( QAction* actionToSetup ) +{ + actionToSetup->setText( "Delete Well Path" ); + actionToSetup->setIcon( QIcon( ":/Erase.svg" ) ); +} diff --git a/ApplicationLibCode/Commands/WellPathCommands/RicDeleteWellPathFeature.h b/ApplicationLibCode/Commands/WellPathCommands/RicDeleteWellPathFeature.h new file mode 100644 index 0000000000..77eb96346b --- /dev/null +++ b/ApplicationLibCode/Commands/WellPathCommands/RicDeleteWellPathFeature.h @@ -0,0 +1,34 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2021- Equinor ASA +// +// ResInsight is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// + +#pragma once + +#include "cafCmdFeature.h" + +//================================================================================================== +/// +//================================================================================================== +class RicDeleteWellPathFeature : public caf::CmdFeature +{ + CAF_CMD_HEADER_INIT; + +protected: + bool isCommandEnabled() override; + void onActionTriggered( bool isChecked ) override; + void setupActionLook( QAction* actionToSetup ) override; +}; diff --git a/ApplicationLibCode/Commands/WellPathCommands/RicLinkWellPathFeature.cpp b/ApplicationLibCode/Commands/WellPathCommands/RicLinkWellPathFeature.cpp index 587ea35eff..d956777868 100644 --- a/ApplicationLibCode/Commands/WellPathCommands/RicLinkWellPathFeature.cpp +++ b/ApplicationLibCode/Commands/WellPathCommands/RicLinkWellPathFeature.cpp @@ -24,6 +24,7 @@ #include "Riu3dSelectionManager.h" #include "cafSelectionManager.h" +#include "cafSelectionManagerTools.h" #include @@ -34,7 +35,7 @@ CAF_CMD_SOURCE_INIT( RicLinkWellPathFeature, "RicLinkWellPathFeature" ); //-------------------------------------------------------------------------------------------------- bool RicLinkWellPathFeature::isCommandEnabled() { - return ( wellPathGeometryDef() != nullptr ); + return ( !wellPaths().empty() ); } //-------------------------------------------------------------------------------------------------- @@ -42,10 +43,14 @@ bool RicLinkWellPathFeature::isCommandEnabled() //-------------------------------------------------------------------------------------------------- void RicLinkWellPathFeature::onActionTriggered( bool isChecked ) { - if ( auto geoDef = wellPathGeometryDef() ) + for ( auto w : wellPaths() ) { - geoDef->enableLinkOfReferencePointUpdates( isChecked ); - geoDef->updateConnectedEditors(); + if ( auto modeledWell = dynamic_cast( w ) ) + { + auto geoDef = modeledWell->geometryDefinition(); + geoDef->enableLinkOfReferencePointUpdates( isChecked ); + geoDef->updateConnectedEditors(); + } } } @@ -58,6 +63,8 @@ void RicLinkWellPathFeature::setupActionLook( QAction* actionToSetup ) actionToSetup->setText( text ); actionToSetup->setCheckable( true ); actionToSetup->setChecked( isCommandChecked() ); + + actionToSetup->setIcon( QIcon( ":/chain.png" ) ); } //-------------------------------------------------------------------------------------------------- @@ -65,27 +72,39 @@ void RicLinkWellPathFeature::setupActionLook( QAction* actionToSetup ) //-------------------------------------------------------------------------------------------------- bool RicLinkWellPathFeature::isCommandChecked() { - if ( auto geoDef = wellPathGeometryDef() ) + if ( !wellPaths().empty() ) { - return geoDef->isReferencePointUpdatesLinked(); + auto firstWell = dynamic_cast( wellPaths().front() ); + if ( auto geoDef = firstWell->geometryDefinition() ) + { + return geoDef->isReferencePointUpdatesLinked(); + } } - return false; } //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -RimWellPathGeometryDef* RicLinkWellPathFeature::wellPathGeometryDef() +std::vector RicLinkWellPathFeature::wellPaths() { + std::vector wellPaths; + auto wellPathSelectionItem = RiuWellPathSelectionItem::wellPathSelectionItem(); if ( wellPathSelectionItem && wellPathSelectionItem->m_wellpath ) { - if ( auto modeledWellPath = dynamic_cast( wellPathSelectionItem->m_wellpath ) ) + if ( auto modeledWellPath = + dynamic_cast( wellPathSelectionItem->m_wellpath->topLevelWellPath() ) ) { - return modeledWellPath->geometryDefinition(); + wellPaths.push_back( modeledWellPath ); } } - return nullptr; + auto selectedWells = caf::selectedObjectsByTypeStrict(); + for ( auto w : selectedWells ) + { + wellPaths.push_back( w->topLevelWellPath() ); + } + + return wellPaths; } diff --git a/ApplicationLibCode/Commands/WellPathCommands/RicLinkWellPathFeature.h b/ApplicationLibCode/Commands/WellPathCommands/RicLinkWellPathFeature.h index 006f942e84..5f5320aebd 100644 --- a/ApplicationLibCode/Commands/WellPathCommands/RicLinkWellPathFeature.h +++ b/ApplicationLibCode/Commands/WellPathCommands/RicLinkWellPathFeature.h @@ -20,7 +20,7 @@ #include "cafCmdFeature.h" -class RimWellPathGeometryDef; +class RimWellPath; //================================================================================================== /// @@ -36,5 +36,5 @@ class RicLinkWellPathFeature : public caf::CmdFeature bool isCommandChecked() override; private: - static RimWellPathGeometryDef* wellPathGeometryDef(); + static std::vector wellPaths(); }; diff --git a/ApplicationLibCode/Commands/WellPathCommands/RicNewWellPathLateralAtDepthFeature.cpp b/ApplicationLibCode/Commands/WellPathCommands/RicNewWellPathLateralAtDepthFeature.cpp index 41d8dfdb5c..47f270c79c 100644 --- a/ApplicationLibCode/Commands/WellPathCommands/RicNewWellPathLateralAtDepthFeature.cpp +++ b/ApplicationLibCode/Commands/WellPathCommands/RicNewWellPathLateralAtDepthFeature.cpp @@ -84,8 +84,8 @@ void RicNewWellPathLateralAtDepthFeature::setupActionLook( QAction* actionToSetu //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -RimWellPath* RicNewWellPathLateralAtDepthFeature::createLateralAtMeasuredDepth( RimWellPath* parentWellPath, - double parentWellMD ) +RimModeledWellPath* RicNewWellPathLateralAtDepthFeature::createLateralAtMeasuredDepth( RimWellPath* parentWellPath, + double parentWellMD ) { RimProject* project = RimProject::current(); RimWellPathCollection* wellPathColl = RimTools::wellPathCollection(); diff --git a/ApplicationLibCode/Commands/WellPathCommands/RicNewWellPathLateralAtDepthFeature.h b/ApplicationLibCode/Commands/WellPathCommands/RicNewWellPathLateralAtDepthFeature.h index 39709160ad..372ab372f1 100644 --- a/ApplicationLibCode/Commands/WellPathCommands/RicNewWellPathLateralAtDepthFeature.h +++ b/ApplicationLibCode/Commands/WellPathCommands/RicNewWellPathLateralAtDepthFeature.h @@ -20,6 +20,7 @@ #include "cafCmdFeature.h" +class RimModeledWellPath; class RimWellPath; //================================================================================================== @@ -34,6 +35,6 @@ class RicNewWellPathLateralAtDepthFeature : public caf::CmdFeature void onActionTriggered( bool isChecked ) override; void setupActionLook( QAction* actionToSetup ) override; - static RimWellPath* createLateralAtMeasuredDepth( RimWellPath* parentWellPath, double parentWellMD ); - static QString updateNameOfParentAndFindNameOfSideStep( RimWellPath* parentWellPath ); + static RimModeledWellPath* createLateralAtMeasuredDepth( RimWellPath* parentWellPath, double parentWellMD ); + static QString updateNameOfParentAndFindNameOfSideStep( RimWellPath* parentWellPath ); }; diff --git a/ApplicationLibCode/Commands/WellPathCommands/RicWellPathPickEventHandler.cpp b/ApplicationLibCode/Commands/WellPathCommands/RicWellPathPickEventHandler.cpp index fdb5c9c551..e14e5b59fe 100644 --- a/ApplicationLibCode/Commands/WellPathCommands/RicWellPathPickEventHandler.cpp +++ b/ApplicationLibCode/Commands/WellPathCommands/RicWellPathPickEventHandler.cpp @@ -31,14 +31,15 @@ #include "RimWellPath.h" #include "RimWellPathAttribute.h" #include "RimWellPathAttributeCollection.h" +#include "RimWellPathGeometryDef.h" #include "RimWellPathValve.h" #include "RiuMainWindow.h" +#include "RivExtrudedCurveIntersectionPartMgr.h" #include "RivObjectSourceInfo.h" #include "RivWellPathSourceInfo.h" -#include "RivExtrudedCurveIntersectionPartMgr.h" #include "cafDisplayCoordTransform.h" #include "cafSelectionManager.h" #include "cvfPart.h" @@ -179,6 +180,10 @@ bool RicWellPathPickEventHandler::handle3dPickEvent( const Ric3dPickEvent& event } } } + else if ( auto geoDef = dynamic_cast( sourceInfo->object() ) ) + { + RiuMainWindow::instance()->selectAsCurrentItem( geoDef ); + } } if ( dynamic_cast( firstPickedPart->sourceInfo() ) ) diff --git a/ApplicationLibCode/ModelVisualization/CMakeLists_files.cmake b/ApplicationLibCode/ModelVisualization/CMakeLists_files.cmake index 17d1b814a1..f1dc43549b 100644 --- a/ApplicationLibCode/ModelVisualization/CMakeLists_files.cmake +++ b/ApplicationLibCode/ModelVisualization/CMakeLists_files.cmake @@ -59,6 +59,7 @@ ${CMAKE_CURRENT_LIST_DIR}/RivWellDiskPartMgr.h ${CMAKE_CURRENT_LIST_DIR}/RivElementVectorResultPartMgr.h ${CMAKE_CURRENT_LIST_DIR}/RivPolylinePartMgr.h ${CMAKE_CURRENT_LIST_DIR}/RivCellFilterPartMgr.h +${CMAKE_CURRENT_LIST_DIR}/RivDrawableSpheres.h ) set (SOURCE_GROUP_SOURCE_FILES @@ -116,6 +117,7 @@ ${CMAKE_CURRENT_LIST_DIR}/RivWellDiskPartMgr.cpp ${CMAKE_CURRENT_LIST_DIR}/RivElementVectorResultPartMgr.cpp ${CMAKE_CURRENT_LIST_DIR}/RivPolylinePartMgr.cpp ${CMAKE_CURRENT_LIST_DIR}/RivCellFilterPartMgr.cpp +${CMAKE_CURRENT_LIST_DIR}/RivDrawableSpheres.cpp ) list(APPEND CODE_HEADER_FILES diff --git a/ApplicationLibCode/ModelVisualization/RivDrawableSpheres.cpp b/ApplicationLibCode/ModelVisualization/RivDrawableSpheres.cpp new file mode 100644 index 0000000000..d6f9ee31dd --- /dev/null +++ b/ApplicationLibCode/ModelVisualization/RivDrawableSpheres.cpp @@ -0,0 +1,84 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2021 - Equinor ASA +// +// ResInsight is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// + +#include "RivDrawableSpheres.h" + +#include "cvfRay.h" + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RivDrawableSpheres::RivDrawableSpheres() + : cvf::DrawableVectors() + , m_radius( 1.0 ) +{ +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RivDrawableSpheres::RivDrawableSpheres( cvf::String vectorMatrixUniformName, cvf::String colorUniformName ) + : cvf::DrawableVectors( vectorMatrixUniformName, colorUniformName ) + , m_radius( 1.0 ) +{ +} + +//-------------------------------------------------------------------------------------------------- +/// Estimate the intersection of a sphere by the sphere inscribed in a bounding box +//-------------------------------------------------------------------------------------------------- +bool RivDrawableSpheres::rayIntersectCreateDetail( const cvf::Ray& ray, + cvf::Vec3d* intersectionPoint, + cvf::ref* hitDetail ) const +{ + if ( m_centerCoordArray.isNull() ) return false; + + for ( size_t i = 0; i < m_centerCoordArray->size(); i++ ) + { + cvf::BoundingBox bb; + + cvf::Vec3f center = m_centerCoordArray->get( i ); + cvf::Vec3f corner1 = cvf::Vec3f( center.x() + m_radius, center.y() + m_radius, center.z() + m_radius ); + cvf::Vec3f corner2 = cvf::Vec3f( center.x() - m_radius, center.y() - m_radius, center.z() - m_radius ); + + bb.add( corner1 ); + bb.add( corner2 ); + + if ( ray.boxIntersect( bb, intersectionPoint ) ) + { + return true; + } + } + + return false; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RivDrawableSpheres::setRadius( float radius ) +{ + m_radius = radius; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RivDrawableSpheres::setCenterCoords( cvf::Vec3fArray* vertexArray ) +{ + m_centerCoordArray = vertexArray; +} diff --git a/ApplicationLibCode/ModelVisualization/RivDrawableSpheres.h b/ApplicationLibCode/ModelVisualization/RivDrawableSpheres.h new file mode 100644 index 0000000000..6b4651d517 --- /dev/null +++ b/ApplicationLibCode/ModelVisualization/RivDrawableSpheres.h @@ -0,0 +1,39 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2021 - Equinor ASA +// +// ResInsight is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// + +#pragma once + +#include "cvfDrawableVectors.h" + +class RivDrawableSpheres : public cvf::DrawableVectors +{ +public: + RivDrawableSpheres(); + RivDrawableSpheres( cvf::String vectorMatrixUniformName, cvf::String colorUniformName ); + + bool rayIntersectCreateDetail( const cvf::Ray& ray, + cvf::Vec3d* intersectionPoint, + cvf::ref* hitDetail ) const override; + + void setRadius( float radius ); + void setCenterCoords( cvf::Vec3fArray* vertexArray ); + +private: + cvf::ref m_centerCoordArray; // Coordinates for sphere center + float m_radius; // Sphere radius +}; diff --git a/ApplicationLibCode/ModelVisualization/RivWellPathPartMgr.cpp b/ApplicationLibCode/ModelVisualization/RivWellPathPartMgr.cpp index 0655793a95..166f2d2a64 100644 --- a/ApplicationLibCode/ModelVisualization/RivWellPathPartMgr.cpp +++ b/ApplicationLibCode/ModelVisualization/RivWellPathPartMgr.cpp @@ -53,6 +53,7 @@ #include "RimWellPathValve.h" #include "Riv3dWellLogPlanePartMgr.h" +#include "RivDrawableSpheres.h" #include "RivFishbonesSubsPartMgr.h" #include "RivObjectSourceInfo.h" #include "RivPartPriority.h" @@ -789,14 +790,14 @@ void RivWellPathPartMgr::buildWellPathParts( const caf::DisplayCoordTransform* d colors->add( sphereColor ); } - cvf::ref vectorDrawable; + cvf::ref vectorDrawable; if ( RiaGuiApplication::instance()->useShaders() ) { - vectorDrawable = new cvf::DrawableVectors( "u_transformationMatrix", "u_color" ); + vectorDrawable = new RivDrawableSpheres( "u_transformationMatrix", "u_color" ); } else { - vectorDrawable = new cvf::DrawableVectors(); + vectorDrawable = new RivDrawableSpheres(); } vectorDrawable->setVectors( vertices.p(), vecRes.p() ); @@ -814,12 +815,20 @@ void RivWellPathPartMgr::buildWellPathParts( const caf::DisplayCoordTransform* d cvf::GeometryUtils::createSphere( cellRadius, 15, 15, &builder ); vectorDrawable->setGlyph( builder.trianglesUShort().p(), builder.vertices().p() ); + { + vectorDrawable->setRadius( cellRadius ); + vectorDrawable->setCenterCoords( vertices.p() ); + } + cvf::ref part = new cvf::Part; part->setName( "RivWellPathPartMgr_WellTargetSpheres" ); part->setDrawable( vectorDrawable.p() ); part->setEffect( new cvf::Effect() ); + auto sourceInfo = new RivObjectSourceInfo( geoDef ); + part->setSourceInfo( sourceInfo ); + m_spherePart = part; } } diff --git a/ApplicationLibCode/ProjectDataModel/RimContextCommandBuilder.cpp b/ApplicationLibCode/ProjectDataModel/RimContextCommandBuilder.cpp index 7a74171814..111a584a95 100644 --- a/ApplicationLibCode/ProjectDataModel/RimContextCommandBuilder.cpp +++ b/ApplicationLibCode/ProjectDataModel/RimContextCommandBuilder.cpp @@ -372,6 +372,9 @@ caf::CmdFeatureMenuBuilder RimContextCommandBuilder::commandsFromSelection() { menuBuilder << "RicNewEditableWellPathFeature"; menuBuilder << "RicNewWellPathLateralFeature"; + menuBuilder << "RicLinkWellPathFeature"; + + menuBuilder.addSeparator(); menuBuilder << "RicNewWellPathIntersectionFeature"; appendCreateCompletions( menuBuilder ); @@ -399,12 +402,18 @@ caf::CmdFeatureMenuBuilder RimContextCommandBuilder::commandsFromSelection() menuBuilder.subMenuEnd(); menuBuilder.addSeparator(); + menuBuilder << "RicDeleteWellPathFeature"; + menuBuilder.addSeparator(); - if ( dynamic_cast( firstUiItem ) ) + if ( auto modeledWellPath = dynamic_cast( firstUiItem ) ) { menuBuilder << "RicShowWellPlanFeature"; - menuBuilder << "RicCreateMultipleWellPathLaterals"; + + if ( modeledWellPath->isTopLevelWellPath() ) + { + menuBuilder << "RicCreateMultipleWellPathLaterals"; + } } } else if ( dynamic_cast( firstUiItem ) ) @@ -1068,6 +1077,10 @@ caf::CmdFeatureMenuBuilder RimContextCommandBuilder::commandsFromSelection() menuBuilder << "RicCutReferencesToClipboardFeature"; menuBuilder << "Separator"; + + menuBuilder << "RicDeleteWellPathFeature"; + menuBuilder << "RicLinkWellPathFeature"; + if ( dynamic_cast( firstUiItem ) || dynamic_cast( firstUiItem ) ) { menuBuilder << "RicCreatePlotFromSelectionFeature"; diff --git a/ApplicationLibCode/ProjectDataModel/RimMultipleLocations.cpp b/ApplicationLibCode/ProjectDataModel/RimMultipleLocations.cpp index ab497bdc82..add52a678a 100644 --- a/ApplicationLibCode/ProjectDataModel/RimMultipleLocations.cpp +++ b/ApplicationLibCode/ProjectDataModel/RimMultipleLocations.cpp @@ -60,12 +60,6 @@ RimMultipleLocations::RimMultipleLocations() CAF_PDM_InitFieldNoDefault( &m_rangeSpacing, "Spacing", "Spacing", "", "", "" ); m_rangeSpacing.uiCapability()->setUiEditorTypeName( caf::PdmUiDoubleValueEditor::uiEditorTypeName() ); - CAF_PDM_InitFieldNoDefault( &m_minimumMD, "MinimumMD", "Minimum MD", "", "", "" ); - m_minimumMD.uiCapability()->setUiEditorTypeName( caf::PdmUiDoubleValueEditor::uiEditorTypeName() ); - - CAF_PDM_InitFieldNoDefault( &m_maximumMD, "MaximumMD", "Maximum MD", "", "", "" ); - m_maximumMD.uiCapability()->setUiEditorTypeName( caf::PdmUiDoubleValueEditor::uiEditorTypeName() ); - CAF_PDM_InitField( &m_rangeCount, "RangeValveCount", 10, "Number of Items", "", "", "" ); CAF_PDM_InitFieldNoDefault( &m_locations, "Locations", "Measured Depths", "", "", "" ); @@ -77,9 +71,6 @@ RimMultipleLocations::RimMultipleLocations() //-------------------------------------------------------------------------------------------------- void RimMultipleLocations::setRange( double minimumMD, double maximumMD ) { - m_minimumMD = minimumMD; - m_maximumMD = maximumMD; - m_rangeStart = minimumMD; m_rangeEnd = maximumMD; } @@ -91,8 +82,6 @@ void RimMultipleLocations::updateRangesAndLocations() { double existingRangeStart = m_rangeStart(); double existingRangeEnd = m_rangeEnd(); - m_rangeStart = std::clamp( m_rangeStart(), minimumMD(), maximumMD() ); - m_rangeEnd = std::clamp( m_rangeEnd(), minimumMD(), maximumMD() ); if ( existingRangeStart != m_rangeStart() || existingRangeEnd != m_rangeEnd() ) { computeRangesAndLocations(); @@ -295,8 +284,6 @@ void RimMultipleLocations::fieldChangedByUi( const caf::PdmFieldHandle* changedF changedField == &m_rangeSpacing ) { recomputeLocations = true; - m_rangeStart = std::clamp( m_rangeStart(), minimumMD(), maximumMD() ); - m_rangeEnd = std::clamp( m_rangeEnd(), minimumMD(), maximumMD() ); } if ( changedField == &m_rangeSpacing ) @@ -337,22 +324,6 @@ double RimMultipleLocations::minimumSpacingMeters() const return 10.0; } -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -double RimMultipleLocations::minimumMD() const -{ - return m_rangeStart(); -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -double RimMultipleLocations::maximumMD() const -{ - return m_rangeEnd(); -} - //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationLibCode/ProjectDataModel/RimMultipleLocations.h b/ApplicationLibCode/ProjectDataModel/RimMultipleLocations.h index 6b9b85810b..ad2b7bff91 100644 --- a/ApplicationLibCode/ProjectDataModel/RimMultipleLocations.h +++ b/ApplicationLibCode/ProjectDataModel/RimMultipleLocations.h @@ -64,8 +64,6 @@ class RimMultipleLocations : public caf::PdmObject private: int rangeCountFromSpacing() const; double minimumSpacingMeters() const; - double minimumMD() const; - double maximumMD() const; static std::vector locationsFromStartSpacingAndCount( double start, double spacing, size_t count ); private: @@ -75,8 +73,5 @@ class RimMultipleLocations : public caf::PdmObject caf::PdmField m_rangeSpacing; caf::PdmField m_rangeCount; - caf::PdmField m_minimumMD; - caf::PdmField m_maximumMD; - caf::PdmField> m_locations; // Given in measured depth }; diff --git a/ApplicationLibCode/ProjectDataModel/WellPath/RimModeledWellPath.cpp b/ApplicationLibCode/ProjectDataModel/WellPath/RimModeledWellPath.cpp index 3da249c091..a86ad9dbed 100644 --- a/ApplicationLibCode/ProjectDataModel/WellPath/RimModeledWellPath.cpp +++ b/ApplicationLibCode/ProjectDataModel/WellPath/RimModeledWellPath.cpp @@ -34,6 +34,7 @@ #include "RimWellPathTarget.h" #include "RimWellPathTieIn.h" +#include "RigWellPathGeometryTools.h" #include "cafPdmFieldScriptingCapability.h" #include "cafPdmUiDoubleValueEditor.h" #include "cafPdmUiTreeOrdering.h" @@ -87,7 +88,7 @@ void RimModeledWellPath::createWellPathGeometry() //-------------------------------------------------------------------------------------------------- void RimModeledWellPath::updateWellPathVisualization() { - this->setWellPathGeometry( m_geometryDefinition->createWellPathGeometry().p() ); + createWellPathGeometry(); std::vector refferingCurves; this->objectsWithReferringPtrFieldsOfType( refferingCurves ); @@ -288,7 +289,10 @@ void RimModeledWellPath::updateTieInLocationFromParentWell() cvf::Vec3d relativePointXYZ = lastPointXYZ - referencePointXYZ; auto firstTarget = targets.front(); - firstTarget->setPointXYZ( relativePointXYZ ); + const auto [azimuth, inclination] = + RigWellPathGeometryTools::calculateAzimuthAndInclinationAtMd( tieIn->tieInMeasuredDepth(), + parentWellPath->wellPathGeometry() ); + firstTarget->setAsPointXYZAndTangentTarget( relativePointXYZ, azimuth, inclination ); updateGeometry( true ); } diff --git a/ApplicationLibCode/ProjectDataModel/WellPath/RimWellPath.cpp b/ApplicationLibCode/ProjectDataModel/WellPath/RimWellPath.cpp index cf1aa30291..7ee7c3bcda 100644 --- a/ApplicationLibCode/ProjectDataModel/WellPath/RimWellPath.cpp +++ b/ApplicationLibCode/ProjectDataModel/WellPath/RimWellPath.cpp @@ -137,8 +137,6 @@ RimWellPath::RimWellPath() CAF_PDM_InitFieldNoDefault( &m_wellPathTieIn, "WellPathTieIn", "well Path Tie-In", "", "", "" ); m_wellPathTieIn = new RimWellPathTieIn; m_wellPathTieIn->connectWellPaths( nullptr, this, 0.0 ); - - this->setDeletable( true ); } //-------------------------------------------------------------------------------------------------- @@ -1170,6 +1168,31 @@ std::vector RimWellPath::allWellPathLaterals() const return laterals; } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +std::vector RimWellPath::wellPathLaterals() const +{ + std::vector laterals; + + std::vector referringObjects; + this->objectsWithReferringPtrFields( referringObjects ); + for ( auto obj : referringObjects ) + { + if ( auto tieIn = dynamic_cast( obj ) ) + { + auto tieInWellPath = tieIn->childWell(); + if ( tieInWellPath == this ) continue; + if ( tieInWellPath ) + { + laterals.push_back( tieInWellPath ); + } + } + } + + return laterals; +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationLibCode/ProjectDataModel/WellPath/RimWellPath.h b/ApplicationLibCode/ProjectDataModel/WellPath/RimWellPath.h index 3ba5b0b45f..7c94e3d6cc 100644 --- a/ApplicationLibCode/ProjectDataModel/WellPath/RimWellPath.h +++ b/ApplicationLibCode/ProjectDataModel/WellPath/RimWellPath.h @@ -163,6 +163,7 @@ class RimWellPath : public caf::PdmObject, public RimWellPathComponentInterface RimWellPath* topLevelWellPath(); const RimWellPath* topLevelWellPath() const; std::vector allWellPathLaterals() const; + std::vector wellPathLaterals() const; RimWellPathTieIn* wellPathTieIn() const; void connectWellPaths( RimWellPath* childWell, double tieInMeasuredDepth ); diff --git a/ApplicationLibCode/ProjectDataModel/WellPath/RimWellPathCollection.cpp b/ApplicationLibCode/ProjectDataModel/WellPath/RimWellPathCollection.cpp index 7cf65884cd..cd1157be7d 100644 --- a/ApplicationLibCode/ProjectDataModel/WellPath/RimWellPathCollection.cpp +++ b/ApplicationLibCode/ProjectDataModel/WellPath/RimWellPathCollection.cpp @@ -583,6 +583,15 @@ void RimWellPathCollection::deleteAllWellPaths() updateAllRequiredEditors(); } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimWellPathCollection::deleteWell( RimWellPath* wellPath ) +{ + m_wellPaths.removeChildObject( wellPath ); + delete wellPath; +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationLibCode/ProjectDataModel/WellPath/RimWellPathCollection.h b/ApplicationLibCode/ProjectDataModel/WellPath/RimWellPathCollection.h index 4c3d4b9294..6e4a429594 100644 --- a/ApplicationLibCode/ProjectDataModel/WellPath/RimWellPathCollection.h +++ b/ApplicationLibCode/ProjectDataModel/WellPath/RimWellPathCollection.h @@ -98,6 +98,7 @@ class RimWellPathCollection : public caf::PdmObject void removeWellPath( gsl::not_null wellPath ); void deleteAllWellPaths(); + void deleteWell( RimWellPath* wellPath ); void groupWellPaths( const std::vector& wellPaths ); void rebuildWellPathNodes(); diff --git a/ApplicationLibCode/ProjectDataModel/WellPath/RimWellPathGeometryDef.cpp b/ApplicationLibCode/ProjectDataModel/WellPath/RimWellPathGeometryDef.cpp index 6a800647ac..1ea4923911 100644 --- a/ApplicationLibCode/ProjectDataModel/WellPath/RimWellPathGeometryDef.cpp +++ b/ApplicationLibCode/ProjectDataModel/WellPath/RimWellPathGeometryDef.cpp @@ -105,7 +105,7 @@ RimWellPathGeometryDef::RimWellPathGeometryDef() CAF_PDM_InitScriptableField( &m_linkReferencePointUpdates, "LinkReferencePointUpdates", false, - "Link Reference Point Updates", + "Link Reference Point", "", "", "" ); @@ -121,7 +121,7 @@ RimWellPathGeometryDef::RimWellPathGeometryDef() CAF_PDM_InitField( &m_pickPointsEnabled, "m_pickPointsEnabled", false, "", "", "", "" ); caf::PdmUiPushButtonEditor::configureEditorForField( &m_pickPointsEnabled ); - CAF_PDM_InitScriptableField( &m_showSpheres, "ShowSpheres", false, "Spheres", "", "", "" ); + CAF_PDM_InitScriptableField( &m_showSpheres, "ShowSpheres", true, "Spheres", "", "", "" ); CAF_PDM_InitField( &m_sphereColor, "SphereColor", cvf::Color3f( cvf::Color3f::CEETRON ), "Sphere Color", "", "", "" ); CAF_PDM_InitField( &m_sphereRadiusFactor, "SphereRadiusFactor", 0.15, "Sphere Radius Factor", "", "", "" ); } @@ -289,7 +289,17 @@ cvf::ref RimWellPathGeometryDef::createWellPathGeometry() RiaPolyArcLineSampler arcLineSampler( wellPathCalculator.startTangent(), wellPathCalculator.lineArcEndpoints() ); auto [sampledWellPathPoints, sampledMeasuredDepths] = arcLineSampler.sampledPointsAndMDs( 30, false ); wellPathPoints.insert( wellPathPoints.end(), sampledWellPathPoints.begin(), sampledWellPathPoints.end() ); - double startMD = measuredDepths.empty() ? 0.0 : measuredDepths.back(); + + double startMD = 0.0; + if ( !measuredDepths.empty() ) + { + startMD = measuredDepths.back(); + } + else if ( !m_useAutoGeneratedTargetAtSeaLevel ) + { + startMD = m_mdAtFirstTarget; + } + for ( auto md : sampledMeasuredDepths ) { measuredDepths.push_back( md + startMD ); @@ -523,6 +533,23 @@ void RimWellPathGeometryDef::fieldChangedByUi( const caf::PdmFieldHandle* change RimWellPathGeometryDefTools::updateLinkedGeometryDefinitions( linkedDefs, delta ); } } + else if ( changedField == &m_useAutoGeneratedTargetAtSeaLevel && !m_useAutoGeneratedTargetAtSeaLevel ) + { + auto firstTarget = firstActiveTarget(); + if ( firstTarget != nullptr ) + { + auto firstLocationXYZ = firstTarget->targetPointXYZ() + anchorPointXyz(); + + // Temporarily enable target at sea level to be able to create a complete geometry to find MD of first + // target of the complete geometry + m_useAutoGeneratedTargetAtSeaLevel = true; + auto wellPathGeo = createWellPathGeometry(); + m_useAutoGeneratedTargetAtSeaLevel = false; + + double mdAtFirstTarget = wellPathGeo->closestMeasuredDepth( firstLocationXYZ ); + m_mdAtFirstTarget = mdAtFirstTarget; + } + } changed.send( false ); } @@ -759,6 +786,14 @@ void RimWellPathGeometryDef::defineObjectEditorAttribute( QString uiConfigName, } } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +caf::PdmFieldHandle* RimWellPathGeometryDef::objectToggleField() +{ + return &m_showSpheres; +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationLibCode/ProjectDataModel/WellPath/RimWellPathGeometryDef.h b/ApplicationLibCode/ProjectDataModel/WellPath/RimWellPathGeometryDef.h index 573a843052..50b2a66802 100644 --- a/ApplicationLibCode/ProjectDataModel/WellPath/RimWellPathGeometryDef.h +++ b/ApplicationLibCode/ProjectDataModel/WellPath/RimWellPathGeometryDef.h @@ -102,6 +102,7 @@ class RimWellPathGeometryDef : public caf::PdmObject caf::PdmUiEditorAttribute* attribute ) override; void defineObjectEditorAttribute( QString uiConfigName, caf::PdmUiEditorAttribute* attribute ) override; + caf::PdmFieldHandle* objectToggleField() override; void onTargetMoved( const caf::SignalEmitter* emitter, bool fullUpdate ); diff --git a/ApplicationLibCode/ProjectDataModel/WellPath/RimWellPathTarget.cpp b/ApplicationLibCode/ProjectDataModel/WellPath/RimWellPathTarget.cpp index b8f1a1f193..9087b479a4 100644 --- a/ApplicationLibCode/ProjectDataModel/WellPath/RimWellPathTarget.cpp +++ b/ApplicationLibCode/ProjectDataModel/WellPath/RimWellPathTarget.cpp @@ -43,7 +43,7 @@ void caf::AppEnum::setUp() { addItem( RimWellPathTarget::TargetTypeEnum::POINT_AND_TANGENT, "POINT_AND_TANGENT", "Point and Tangent" ); addItem( RimWellPathTarget::TargetTypeEnum::POINT, "POINT", "Point" ); - setDefault( RimWellPathTarget::TargetTypeEnum::POINT_AND_TANGENT ); + setDefault( RimWellPathTarget::TargetTypeEnum::POINT ); } } // namespace caf //-------------------------------------------------------------------------------------------------- @@ -51,7 +51,7 @@ void caf::AppEnum::setUp() //-------------------------------------------------------------------------------------------------- RimWellPathTarget::RimWellPathTarget() : moved( this ) - , m_targetType( TargetTypeEnum::POINT_AND_TANGENT ) + , m_targetType( TargetTypeEnum::POINT ) , m_targetPointXYD( cvf::Vec3d::ZERO ) , m_azimuth( 0.0 ) , m_inclination( 0.0 ) @@ -69,10 +69,13 @@ RimWellPathTarget::RimWellPathTarget() m_isLocked.uiCapability()->setUiHidden( true ); CAF_PDM_InitScriptableFieldNoDefault( &m_targetPointXYD, "TargetPoint", "Relative Coord", "", "", "" ); - CAF_PDM_InitScriptableFieldNoDefault( &m_targetPointForDisplay, "TargetPointForDisplay", "UTM Coord", "", "", "" ); + CAF_PDM_InitFieldNoDefault( &m_targetPointForDisplay, "TargetPointForDisplay", "UTM Coord", "", "", "" ); m_targetPointForDisplay.registerGetMethod( this, &RimWellPathTarget::targetPointForDisplayXYD ); m_targetPointForDisplay.registerSetMethod( this, &RimWellPathTarget::setTargetPointFromDisplayCoord ); + CAF_PDM_InitScriptableFieldNoDefault( &m_targetMeasuredDepth, "TargetMeasuredDepth", "MD", "", "", "" ); + m_targetMeasuredDepth.registerGetMethod( this, &RimWellPathTarget::measuredDepth ); + CAF_PDM_InitScriptableField( &m_dogleg1, "Dogleg1", 3.0, "DL in", "", "[deg/30m]", "" ); CAF_PDM_InitScriptableField( &m_dogleg2, "Dogleg2", 3.0, "DL out", "", "[deg/30m]", "" ); @@ -224,10 +227,8 @@ double RimWellPathTarget::azimuth() const { return cvf::Math::toRadians( m_azimuth ); } - else - { - return std::numeric_limits::infinity(); - } + + return std::numeric_limits::infinity(); } //-------------------------------------------------------------------------------------------------- @@ -239,10 +240,8 @@ double RimWellPathTarget::inclination() const { return cvf::Math::toRadians( m_inclination ); } - else - { - return std::numeric_limits::infinity(); - } + + return std::numeric_limits::infinity(); } //-------------------------------------------------------------------------------------------------- @@ -441,6 +440,28 @@ void RimWellPathTarget::setTargetPointFromDisplayCoord( const cvf::Vec3d& coordI m_targetPointXYD = newCoordInXYD; } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +double RimWellPathTarget::measuredDepth() const +{ + RimWellPath* wellPath = nullptr; + this->firstAncestorOfType( wellPath ); + + auto geoDef = geometryDefinition(); + + if ( geoDef && wellPath && wellPath->wellPathGeometry() ) + { + auto offsetXYZ = geoDef->anchorPointXyz(); + auto coordXYZ = targetPointXYZ() + offsetXYZ; + + auto wellPathGeo = wellPath->wellPathGeometry(); + return wellPathGeo->closestMeasuredDepth( coordXYZ ); + } + + return 0.0; +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationLibCode/ProjectDataModel/WellPath/RimWellPathTarget.h b/ApplicationLibCode/ProjectDataModel/WellPath/RimWellPathTarget.h index e21ea7e5a2..f383e91e73 100644 --- a/ApplicationLibCode/ProjectDataModel/WellPath/RimWellPathTarget.h +++ b/ApplicationLibCode/ProjectDataModel/WellPath/RimWellPathTarget.h @@ -85,6 +85,7 @@ class RimWellPathTarget : public caf::PdmObject cvf::Vec3d targetPointForDisplayXYD() const; void setTargetPointFromDisplayCoord( const cvf::Vec3d& coordInXYZ ); + double measuredDepth() const; RimWellPathGeometryDef* geometryDefinition() const; @@ -96,9 +97,11 @@ class RimWellPathTarget : public caf::PdmObject caf::PdmField> m_targetType; caf::PdmField m_targetPointXYD; caf::PdmProxyValueField m_targetPointForDisplay; - caf::PdmField m_azimuth; - caf::PdmField m_inclination; - caf::PdmField m_dogleg1; - caf::PdmField m_dogleg2; - caf::PdmField m_hasTangentConstraintUiField; + caf::PdmProxyValueField m_targetMeasuredDepth; + + caf::PdmField m_azimuth; + caf::PdmField m_inclination; + caf::PdmField m_dogleg1; + caf::PdmField m_dogleg2; + caf::PdmField m_hasTangentConstraintUiField; }; diff --git a/ApplicationLibCode/ProjectDataModel/WellPath/RimWellPathTieIn.cpp b/ApplicationLibCode/ProjectDataModel/WellPath/RimWellPathTieIn.cpp index b825359d27..cd9352efd3 100644 --- a/ApplicationLibCode/ProjectDataModel/WellPath/RimWellPathTieIn.cpp +++ b/ApplicationLibCode/ProjectDataModel/WellPath/RimWellPathTieIn.cpp @@ -30,7 +30,8 @@ #include "RiuMainWindow.h" -#include "cafPdmUiDoubleValueEditor.h" +#include "RigWellPathGeometryTools.h" +#include "cafPdmUiDoubleSliderEditor.h" CAF_PDM_SOURCE_INIT( RimWellPathTieIn, "RimWellPathTieIn" ); @@ -44,7 +45,7 @@ RimWellPathTieIn::RimWellPathTieIn() CAF_PDM_InitFieldNoDefault( &m_parentWell, "ParentWellPath", "Parent Well Path", "", "", "" ); CAF_PDM_InitFieldNoDefault( &m_childWell, "ChildWellPath", "ChildWellPath", "", "", "" ); CAF_PDM_InitFieldNoDefault( &m_tieInMeasuredDepth, "TieInMeasuredDepth", "Tie In Measured Depth", "", "", "" ); - m_tieInMeasuredDepth.uiCapability()->setUiEditorTypeName( caf::PdmUiDoubleValueEditor::uiEditorTypeName() ); + m_tieInMeasuredDepth.uiCapability()->setUiEditorTypeName( caf::PdmUiDoubleSliderEditor::uiEditorTypeName() ); CAF_PDM_InitField( &m_addValveAtConnection, "AddValveAtConnection", false, "Add Outlet Valve for Branches", "", "", "" ); @@ -227,3 +228,32 @@ QList RimWellPathTieIn::calculateValueOptions( const caf return options; } + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimWellPathTieIn::defineEditorAttribute( const caf::PdmFieldHandle* field, + QString uiConfigName, + caf::PdmUiEditorAttribute* attribute ) +{ + if ( field == &m_tieInMeasuredDepth ) + { + caf::PdmUiDoubleSliderEditorAttribute* myAttr = dynamic_cast( attribute ); + + if ( myAttr && parentWell() ) + { + double minimumValue = 0.0, maximumValue = 0.0; + + auto wellPathGeo = parentWell()->wellPathGeometry(); + + if ( wellPathGeo ) + { + minimumValue = wellPathGeo->measuredDepths().front(); + maximumValue = wellPathGeo->measuredDepths().back(); + + myAttr->m_minimum = minimumValue; + myAttr->m_maximum = maximumValue; + } + } + } +} diff --git a/ApplicationLibCode/ProjectDataModel/WellPath/RimWellPathTieIn.h b/ApplicationLibCode/ProjectDataModel/WellPath/RimWellPathTieIn.h index 3405e94aa2..77ddbf05f1 100644 --- a/ApplicationLibCode/ProjectDataModel/WellPath/RimWellPathTieIn.h +++ b/ApplicationLibCode/ProjectDataModel/WellPath/RimWellPathTieIn.h @@ -53,6 +53,10 @@ class RimWellPathTieIn : public caf::PdmObject QList calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions, bool* useOptionsOnly ) override; + void defineEditorAttribute( const caf::PdmFieldHandle* field, + QString uiConfigName, + caf::PdmUiEditorAttribute* attribute ) override; + private: caf::PdmPtrField m_parentWell; caf::PdmPtrField m_childWell; diff --git a/ApplicationLibCode/ProjectDataModelCommands/CMakeLists_files.cmake b/ApplicationLibCode/ProjectDataModelCommands/CMakeLists_files.cmake index a8d59fb3d1..546396ba21 100644 --- a/ApplicationLibCode/ProjectDataModelCommands/CMakeLists_files.cmake +++ b/ApplicationLibCode/ProjectDataModelCommands/CMakeLists_files.cmake @@ -14,8 +14,10 @@ ${CMAKE_CURRENT_LIST_DIR}/RimcDataContainerDouble.h ${CMAKE_CURRENT_LIST_DIR}/RimcDataContainerString.h ${CMAKE_CURRENT_LIST_DIR}/RimcDataContainerTime.h ${CMAKE_CURRENT_LIST_DIR}/RimcWellLogPlotCollection.h -${CMAKE_CURRENT_LIST_DIR}/RimcWellLogPlot.cpp -${CMAKE_CURRENT_LIST_DIR}/RimcWellLogTrack.cpp +${CMAKE_CURRENT_LIST_DIR}/RimcWellLogPlot.h +${CMAKE_CURRENT_LIST_DIR}/RimcWellLogTrack.h +${CMAKE_CURRENT_LIST_DIR}/RimcWellPathGeometryDef.h +${CMAKE_CURRENT_LIST_DIR}/RimcModeledWellPath.h ) set (SOURCE_GROUP_SOURCE_FILES @@ -35,6 +37,8 @@ ${CMAKE_CURRENT_LIST_DIR}/RimcDataContainerTime.cpp ${CMAKE_CURRENT_LIST_DIR}/RimcWellLogPlotCollection.cpp ${CMAKE_CURRENT_LIST_DIR}/RimcWellLogPlot.cpp ${CMAKE_CURRENT_LIST_DIR}/RimcWellLogTrack.cpp +${CMAKE_CURRENT_LIST_DIR}/RimcWellPathGeometryDef.cpp +${CMAKE_CURRENT_LIST_DIR}/RimcModeledWellPath.cpp ) list(APPEND CODE_HEADER_FILES diff --git a/ApplicationLibCode/ProjectDataModelCommands/RimcModeledWellPath.cpp b/ApplicationLibCode/ProjectDataModelCommands/RimcModeledWellPath.cpp new file mode 100644 index 0000000000..ab73cf2d9b --- /dev/null +++ b/ApplicationLibCode/ProjectDataModelCommands/RimcModeledWellPath.cpp @@ -0,0 +1,133 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2021- Equinor ASA +// +// ResInsight is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// + +#include "RimcModeledWellPath.h" + +#include "RimModeledWellPath.h" +#include "RimPerforationCollection.h" +#include "RimPerforationInterval.h" +#include "RimTools.h" +#include "RimWellPathCollection.h" +#include "RimWellPathGeometryDef.h" +#include "RimWellPathTarget.h" + +#include "WellPathCommands/RicNewWellPathLateralAtDepthFeature.h" + +#include "cafPdmAbstractFieldScriptingCapability.h" +#include "cafPdmFieldScriptingCapability.h" + +CAF_PDM_OBJECT_METHOD_SOURCE_INIT( RimModeledWellPath, RimcModeledWellPath_appendLateral, "AppendLateral" ); + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RimcModeledWellPath_appendLateral::RimcModeledWellPath_appendLateral( caf::PdmObjectHandle* self ) + : caf::PdmObjectMethod( self ) +{ + CAF_PDM_InitObject( "Append Well Path Lateral", "", "", "Append Well Path Lateral" ); + CAF_PDM_InitScriptableField( &m_tieInDepth, "TieInDepth", 0.0, "", "", "", "Measured Depth on the Parent Well Path" ); + CAF_PDM_InitScriptableFieldNoDefault( &m_lateralName, "LateralName", "", "", "", "Lateral Name" ); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +caf::PdmObjectHandle* RimcModeledWellPath_appendLateral::execute() +{ + auto parentWellPath = self(); + + auto lateral = RicNewWellPathLateralAtDepthFeature::createLateralAtMeasuredDepth( parentWellPath, m_tieInDepth ); + if ( !m_lateralName().isEmpty() ) + { + lateral->setName( m_lateralName ); + } + lateral->geometryDefinition()->enableTargetPointPicking( false ); + + return lateral; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +bool RimcModeledWellPath_appendLateral::resultIsPersistent() const +{ + return true; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +std::unique_ptr RimcModeledWellPath_appendLateral::defaultResult() const +{ + return std::unique_ptr( new RimModeledWellPath ); +} + +CAF_PDM_OBJECT_METHOD_SOURCE_INIT( RimModeledWellPath, + RimcModeledWellPath_appendPerforationInterval, + "AppendPerforationInterval" ); + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RimcModeledWellPath_appendPerforationInterval::RimcModeledWellPath_appendPerforationInterval( caf::PdmObjectHandle* self ) + : caf::PdmObjectMethod( self ) +{ + CAF_PDM_InitObject( "Append Perforation Interval", "", "", "Append Perforation Interval" ); + CAF_PDM_InitScriptableField( &m_startMD, "StartMd", 0.0, "", "", "", "Start Measured Depth" ); + CAF_PDM_InitScriptableField( &m_endMD, "EndMd", 0.0, "", "", "", "End Measured Depth" ); + CAF_PDM_InitScriptableField( &m_diameter, "Diameter", 0.0, "", "", "", "Diameter" ); + CAF_PDM_InitScriptableField( &m_skinFactor, "SkinFactor", 0.0, "", "", "", "Skin Factor" ); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +caf::PdmObjectHandle* RimcModeledWellPath_appendPerforationInterval::execute() +{ + auto wellPath = self(); + + auto perforationInterval = new RimPerforationInterval; + perforationInterval->setStartAndEndMD( m_startMD, m_endMD ); + perforationInterval->setSkinFactor( m_skinFactor ); + perforationInterval->setDiameter( m_diameter ); + + wellPath->perforationIntervalCollection()->appendPerforation( perforationInterval ); + + auto* wellPathCollection = RimTools::wellPathCollection(); + + wellPathCollection->uiCapability()->updateConnectedEditors(); + wellPathCollection->scheduleRedrawAffectedViews(); + + return perforationInterval; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +bool RimcModeledWellPath_appendPerforationInterval::resultIsPersistent() const +{ + return true; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +std::unique_ptr RimcModeledWellPath_appendPerforationInterval::defaultResult() const +{ + return std::unique_ptr( new RimPerforationInterval ); +} diff --git a/ApplicationLibCode/ProjectDataModelCommands/RimcModeledWellPath.h b/ApplicationLibCode/ProjectDataModelCommands/RimcModeledWellPath.h new file mode 100644 index 0000000000..a6725c69dc --- /dev/null +++ b/ApplicationLibCode/ProjectDataModelCommands/RimcModeledWellPath.h @@ -0,0 +1,67 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2021- Equinor ASA +// +// ResInsight is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// + +#pragma once + +#include "cafPdmField.h" +#include "cafPdmObjectHandle.h" +#include "cafPdmObjectMethod.h" + +#include "cvfVector3.h" + +#include + +//================================================================================================== +/// +//================================================================================================== +class RimcModeledWellPath_appendLateral : public caf::PdmObjectMethod +{ + CAF_PDM_HEADER_INIT; + +public: + RimcModeledWellPath_appendLateral( caf::PdmObjectHandle* self ); + + caf::PdmObjectHandle* execute() override; + bool resultIsPersistent() const override; + std::unique_ptr defaultResult() const override; + +private: + caf::PdmField m_tieInDepth; + caf::PdmField m_lateralName; +}; + +//================================================================================================== +/// +//================================================================================================== +class RimcModeledWellPath_appendPerforationInterval : public caf::PdmObjectMethod +{ + CAF_PDM_HEADER_INIT; + +public: + RimcModeledWellPath_appendPerforationInterval( caf::PdmObjectHandle* self ); + + caf::PdmObjectHandle* execute() override; + bool resultIsPersistent() const override; + std::unique_ptr defaultResult() const override; + +private: + caf::PdmField m_startMD; + caf::PdmField m_endMD; + caf::PdmField m_diameter; + caf::PdmField m_skinFactor; +}; diff --git a/ApplicationLibCode/ProjectDataModelCommands/RimcWellPathGeometryDef.cpp b/ApplicationLibCode/ProjectDataModelCommands/RimcWellPathGeometryDef.cpp new file mode 100644 index 0000000000..98db4c9822 --- /dev/null +++ b/ApplicationLibCode/ProjectDataModelCommands/RimcWellPathGeometryDef.cpp @@ -0,0 +1,85 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2021- Equinor ASA +// +// ResInsight is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// + +#include "RimcWellPathGeometryDef.h" + +#include "RimModeledWellPath.h" +#include "RimWellPathCollection.h" +#include "RimWellPathGeometryDef.h" +#include "RimWellPathTarget.h" + +#include "cafPdmAbstractFieldScriptingCapability.h" +#include "cafPdmFieldScriptingCapability.h" +#include "cafPdmFieldScriptingCapabilityCvfVec3d.h" + +CAF_PDM_OBJECT_METHOD_SOURCE_INIT( RimWellPathGeometryDef, + RimcRimWellPathGeometryDef_appendNewWellTarget, + "AppendWellTarget" ); + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RimcRimWellPathGeometryDef_appendNewWellTarget::RimcRimWellPathGeometryDef_appendNewWellTarget( caf::PdmObjectHandle* self ) + : caf::PdmObjectMethod( self ) +{ + CAF_PDM_InitObject( "Create and Add New Well Target", "", "", "Create and Add New Well Target" ); + CAF_PDM_InitScriptableFieldNoDefault( &m_coordinate, "Coordinate", "", "", "", "Coordinate" ); + CAF_PDM_InitScriptableField( &m_isAbsolute, "Absolute", false, "", "", "", "Relative or Absolute Coordinate" ); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +caf::PdmObjectHandle* RimcRimWellPathGeometryDef_appendNewWellTarget::execute() +{ + auto geoDef = self(); + + cvf::Vec3d relativeTargetPoint = m_coordinate(); + relativeTargetPoint.z() = -relativeTargetPoint.z(); + if ( m_isAbsolute ) + { + cvf::Vec3d referencePoint = geoDef->anchorPointXyz(); + relativeTargetPoint -= referencePoint; + } + + auto newTarget = new RimWellPathTarget; + newTarget->setAsPointTargetXYD( + cvf::Vec3d( relativeTargetPoint.x(), relativeTargetPoint.y(), -relativeTargetPoint.z() ) ); + geoDef->insertTarget( nullptr, newTarget ); + + geoDef->updateConnectedEditors(); + geoDef->updateWellPathVisualization( false ); + + return newTarget; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +bool RimcRimWellPathGeometryDef_appendNewWellTarget::resultIsPersistent() const +{ + return true; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +std::unique_ptr RimcRimWellPathGeometryDef_appendNewWellTarget::defaultResult() const +{ + return std::unique_ptr( new RimWellPathTarget ); +} diff --git a/ApplicationLibCode/ProjectDataModelCommands/RimcWellPathGeometryDef.h b/ApplicationLibCode/ProjectDataModelCommands/RimcWellPathGeometryDef.h new file mode 100644 index 0000000000..b22ad820e0 --- /dev/null +++ b/ApplicationLibCode/ProjectDataModelCommands/RimcWellPathGeometryDef.h @@ -0,0 +1,46 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2021- Equinor ASA +// +// ResInsight is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// + +#pragma once + +#include "cafPdmField.h" +#include "cafPdmObjectHandle.h" +#include "cafPdmObjectMethod.h" + +#include "cvfVector3.h" + +#include + +//================================================================================================== +/// +//================================================================================================== +class RimcRimWellPathGeometryDef_appendNewWellTarget : public caf::PdmObjectMethod +{ + CAF_PDM_HEADER_INIT; + +public: + RimcRimWellPathGeometryDef_appendNewWellTarget( caf::PdmObjectHandle* self ); + + caf::PdmObjectHandle* execute() override; + bool resultIsPersistent() const override; + std::unique_ptr defaultResult() const override; + +private: + caf::PdmField m_coordinate; + caf::PdmField m_isAbsolute; +}; diff --git a/ApplicationLibCode/ReservoirDataModel/RigWellPath.cpp b/ApplicationLibCode/ReservoirDataModel/RigWellPath.cpp index 783ac6c09e..3819f47366 100644 --- a/ApplicationLibCode/ReservoirDataModel/RigWellPath.cpp +++ b/ApplicationLibCode/ReservoirDataModel/RigWellPath.cpp @@ -315,41 +315,15 @@ cvf::Vec3d RigWellPath::tangentAlongWellPath( double measuredDepth ) const //-------------------------------------------------------------------------------------------------- double RigWellPath::wellPathAzimuthAngle( const cvf::Vec3d& position ) const { - size_t closestIndex = cvf::UNDEFINED_SIZE_T; - double closestDistance = cvf::UNDEFINED_DOUBLE; - - for ( size_t i = 1; i < m_wellPathPoints.size(); i++ ) - { - cvf::Vec3d p1 = m_wellPathPoints[i - 1]; - cvf::Vec3d p2 = m_wellPathPoints[i - 0]; - - double candidateDistance = cvf::GeometryTools::linePointSquareDist( p1, p2, position ); - if ( candidateDistance < closestDistance ) - { - closestDistance = candidateDistance; - closestIndex = i; - } - } - // For vertical well (x-component of direction = 0) returned angle will be 90. double azimuthAngleDegrees = 90.0; - if ( closestIndex != cvf::UNDEFINED_DOUBLE ) - { - cvf::Vec3d p1; - cvf::Vec3d p2; - - if ( closestIndex > 0 ) - { - p1 = m_wellPathPoints[closestIndex - 1]; - p2 = m_wellPathPoints[closestIndex - 0]; - } - else - { - p1 = m_wellPathPoints[closestIndex + 1]; - p2 = m_wellPathPoints[closestIndex + 0]; - } + cvf::Vec3d p1 = cvf::Vec3d::UNDEFINED; + cvf::Vec3d p2 = cvf::Vec3d::UNDEFINED; + twoClosestPoints( position, &p1, &p2 ); + if ( !p1.isUndefined() ) + { cvf::Vec3d direction = p2 - p1; if ( fabs( direction.y() ) > 1e-5 ) @@ -370,34 +344,11 @@ void RigWellPath::twoClosestPoints( const cvf::Vec3d& position, cvf::Vec3d* p1, { CVF_ASSERT( p1 && p2 ); - size_t closestIndex = cvf::UNDEFINED_SIZE_T; - double closestDistance = cvf::UNDEFINED_DOUBLE; - - for ( size_t i = 1; i < m_wellPathPoints.size(); i++ ) - { - cvf::Vec3d point1 = m_wellPathPoints[i - 1]; - cvf::Vec3d point2 = m_wellPathPoints[i - 0]; - - double candidateDistance = cvf::GeometryTools::linePointSquareDist( point1, point2, position ); - if ( candidateDistance < closestDistance ) - { - closestDistance = candidateDistance; - closestIndex = i; - } - } - - if ( closestIndex != cvf::UNDEFINED_SIZE_T ) + auto closeIndices = closestIndices( position ); + if ( closeIndices.first != cvf::UNDEFINED_SIZE_T ) { - if ( closestIndex > 0 ) - { - *p1 = m_wellPathPoints[closestIndex - 1]; - *p2 = m_wellPathPoints[closestIndex - 0]; - } - else - { - *p1 = m_wellPathPoints[closestIndex + 1]; - *p2 = m_wellPathPoints[closestIndex + 0]; - } + *p1 = m_wellPathPoints[closeIndices.first]; + *p2 = m_wellPathPoints[closeIndices.second]; } } @@ -429,6 +380,32 @@ double RigWellPath::identicalTubeLength( const RigWellPath& other ) const return identicalLength; } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +double RigWellPath::closestMeasuredDepth( const cvf::Vec3d& position ) const +{ + auto [firstIndex, secondIndex] = closestIndices( position ); + if ( firstIndex != cvf::UNDEFINED_SIZE_T ) + { + cvf::Vec3d p1 = m_wellPathPoints[firstIndex]; + cvf::Vec3d p2 = m_wellPathPoints[secondIndex]; + + double diffP1 = ( p1 - position ).lengthSquared(); + double diffP2 = ( p2 - position ).lengthSquared(); + + double weigth1 = diffP2 / ( diffP1 + diffP2 ); + + double measureDepth1 = m_measuredDepths[firstIndex]; + double measureDepth2 = m_measuredDepths[secondIndex]; + + double interpolatedValue = measureDepth1 * weigth1 + measureDepth2 * ( 1.0 - weigth1 ); + return interpolatedValue; + } + + return -1.0; +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- @@ -681,3 +658,40 @@ std::vector RigWellPath::clipPolylineStartAboveZ( const std::vector< return clippedPolyLine; } + +//-------------------------------------------------------------------------------------------------- +// Returns the closes indices with smallest index first +// If not found, cvf::UNDEFINED_SIZE_T is returned for both +//-------------------------------------------------------------------------------------------------- +std::pair RigWellPath::closestIndices( const cvf::Vec3d& position ) const +{ + size_t closestIndex = cvf::UNDEFINED_SIZE_T; + double closestDistance = cvf::UNDEFINED_DOUBLE; + + for ( size_t i = 1; i < m_wellPathPoints.size(); i++ ) + { + cvf::Vec3d point1 = m_wellPathPoints[i - 1]; + cvf::Vec3d point2 = m_wellPathPoints[i - 0]; + + double candidateDistance = cvf::GeometryTools::linePointSquareDist( point1, point2, position ); + if ( candidateDistance < closestDistance ) + { + closestDistance = candidateDistance; + closestIndex = i; + } + } + + if ( closestIndex != cvf::UNDEFINED_SIZE_T ) + { + if ( closestIndex > 0 ) + { + return { closestIndex - 1, closestIndex }; + } + else + { + return { closestIndex, closestIndex + 1 }; + } + } + + return { cvf::UNDEFINED_SIZE_T, cvf::UNDEFINED_SIZE_T }; +} diff --git a/ApplicationLibCode/ReservoirDataModel/RigWellPath.h b/ApplicationLibCode/ReservoirDataModel/RigWellPath.h index 86d7df76d1..754e1e0599 100644 --- a/ApplicationLibCode/ReservoirDataModel/RigWellPath.h +++ b/ApplicationLibCode/ReservoirDataModel/RigWellPath.h @@ -70,6 +70,7 @@ class RigWellPath : public cvf::Object, public caf::SignalEmitter double wellPathAzimuthAngle( const cvf::Vec3d& position ) const; void twoClosestPoints( const cvf::Vec3d& position, cvf::Vec3d* p1, cvf::Vec3d* p2 ) const; double identicalTubeLength( const RigWellPath& otherWellPathGeometry ) const; + double closestMeasuredDepth( const cvf::Vec3d& position ) const; static cvf::ref commonGeometry( const std::vector& allGeometries ); void setUniqueStartAndEndIndex( size_t uniqueStartIndex, size_t uniqueEndIndex ); @@ -90,6 +91,9 @@ class RigWellPath : public cvf::Object, public caf::SignalEmitter double* horizontalLengthAlongWellToClipPoint, size_t* indexToFirstVisibleSegment ); +private: + std::pair closestIndices( const cvf::Vec3d& position ) const; + private: std::vector m_wellPathPoints; std::vector m_measuredDepths; diff --git a/ApplicationLibCode/ReservoirDataModel/RigWellPathGeometryExporter.cpp b/ApplicationLibCode/ReservoirDataModel/RigWellPathGeometryExporter.cpp index e9788c64ca..83f0edfe3e 100644 --- a/ApplicationLibCode/ReservoirDataModel/RigWellPathGeometryExporter.cpp +++ b/ApplicationLibCode/ReservoirDataModel/RigWellPathGeometryExporter.cpp @@ -53,10 +53,6 @@ void RigWellPathGeometryExporter::exportWellPathGeometry( gsl::not_nullgeometryDefinition()->airGap(); } - else - { - rkbOffset = modeledWellPath->geometryDefinition()->mdAtFirstTarget(); - } } } exportWellPathGeometry( *wellPathGeom, mdStepSize, rkbOffset, xValues, yValues, tvdValues, mdValues ); diff --git a/ApplicationLibCode/ReservoirDataModel/RigWellPathGeometryTools.cpp b/ApplicationLibCode/ReservoirDataModel/RigWellPathGeometryTools.cpp index 141c614b84..e849e2b0c4 100644 --- a/ApplicationLibCode/ReservoirDataModel/RigWellPathGeometryTools.cpp +++ b/ApplicationLibCode/ReservoirDataModel/RigWellPathGeometryTools.cpp @@ -23,6 +23,7 @@ #include "cvfMath.h" #include "cvfMatrix3.h" +#include "RiaOffshoreSphericalCoords.h" #include #include @@ -133,6 +134,61 @@ std::vector RigWellPathGeometryTools::interpolateMdFromTvd( const std::v return interpolatedMdValues; } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +std::pair + RigWellPathGeometryTools::calculateAzimuthAndInclinationAtMd( double measuredDepth, + gsl::not_null wellPathGeometry ) +{ + int mdIndex = -1; + auto mdList = wellPathGeometry->measuredDepths(); + + for ( int i = 0; i < (int)mdList.size(); i++ ) + { + if ( mdList[i] > measuredDepth ) + { + mdIndex = i - 1; + break; + } + } + + auto ptList = wellPathGeometry->wellPathPoints(); + if ( mdIndex >= 0 && mdIndex < (int)ptList.size() - 1 ) + { + const auto& v2 = cvf::Vec3d( ptList[mdIndex] ); + const auto& v3 = cvf::Vec3d( ptList[mdIndex + 1] ); + + auto v32 = ( v3 - v2 ).getNormalized(); + + auto v13mean = v32; + + if ( mdIndex > 0 ) + { + const auto& v1 = cvf::Vec3d( ptList[mdIndex - 1] ); + auto v21 = ( v2 - v1 ).getNormalized(); + v13mean = ( v21 + v32 ) / 2; + } + + auto v24mean = v32; + if ( mdIndex < (int)ptList.size() - 2 ) + { + const auto& v4 = cvf::Vec3d( ptList[mdIndex + 2] ); + auto v43 = ( v4 - v3 ).getNormalized(); + v24mean = ( v32 + v43 ) / 2; + } + + double weight = ( measuredDepth - mdList[mdIndex] ) / ( mdList[mdIndex + 1] - mdList[mdIndex] ); + auto vTan = v13mean * ( 1.0 - weight ) + v24mean * ( weight ); + + RiaOffshoreSphericalCoords coords( vTan ); + + return { coords.azi(), coords.inc() }; + } + + return { 0.0, 0.0 }; +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationLibCode/ReservoirDataModel/RigWellPathGeometryTools.h b/ApplicationLibCode/ReservoirDataModel/RigWellPathGeometryTools.h index 56874d5c08..94fbfef20e 100644 --- a/ApplicationLibCode/ReservoirDataModel/RigWellPathGeometryTools.h +++ b/ApplicationLibCode/ReservoirDataModel/RigWellPathGeometryTools.h @@ -25,6 +25,8 @@ #include +#include + class RigWellPath; //================================================================================================== @@ -45,6 +47,9 @@ class RigWellPathGeometryTools const std::vector& originalTvdValues, const std::vector& tvdValuesToInterpolateFrom ); + static std::pair + calculateAzimuthAndInclinationAtMd( double measuredDepth, gsl::not_null wellPathGeometry ); + private: static std::vector interpolateUndefinedNormals( const cvf::Vec3d& planeNormal, const std::vector& normals, diff --git a/GrpcInterface/Python/rips/PythonExamples/modeled_well_path.py b/GrpcInterface/Python/rips/PythonExamples/modeled_well_path.py index 757bf34001..134a34f81c 100644 --- a/GrpcInterface/Python/rips/PythonExamples/modeled_well_path.py +++ b/GrpcInterface/Python/rips/PythonExamples/modeled_well_path.py @@ -3,15 +3,32 @@ # Connect to ResInsight instance resinsight = rips.Instance.find() -# Example code -print("ResInsight version: " + resinsight.version_string()) - -modeled_well_paths = resinsight.project.descendants(rips.ModeledWellPath) - -for wellpath in modeled_well_paths: - geometry = wellpath.well_path_geometry() - geometry.print_object_info() - reference_point = geometry.reference_point - reference_point[0] += 100 - geometry.update() - geometry.print_object_info() + +# Create a modeled well path and add well path targets +# The coordinates are based on the Norne case + +well_path_coll = resinsight.project.descendants(rips.WellPathCollection)[0] +well_path = well_path_coll.add_new_object(rips.ModeledWellPath) +well_path.name = "Test Well-1" +well_path.update() + +geometry = well_path.well_path_geometry() + +reference_point = geometry.reference_point +reference_point[0] = 457196 +reference_point[1] = 7322270 +reference_point[2] = 2742 +geometry.update() # Commit updates back to ResInsight + +# Create the first well target at the reference point +coord = [0, 0, 0] +geometry.append_well_target(coord) + +# Append new well targets relative the the reference point +coord = [454.28, 250, -10] +target = geometry.append_well_target(coord) + +coord = [1054.28, 250, -50] +target = geometry.append_well_target(coord) + +well_path.append_perforation_interval(3300, 3350, 0.2, 0.76) diff --git a/GrpcInterface/Python/rips/PythonExamples/modeled_well_path_lateral.py b/GrpcInterface/Python/rips/PythonExamples/modeled_well_path_lateral.py new file mode 100644 index 0000000000..3200a2156c --- /dev/null +++ b/GrpcInterface/Python/rips/PythonExamples/modeled_well_path_lateral.py @@ -0,0 +1,59 @@ +# Load ResInsight Processing Server Client Library +import rips +import time + +# Connect to ResInsight instance +resinsight = rips.Instance.find() + +# Create a modeled well path and add well path targets +# The coordinates are based on the Norne case +# Add a lateral to the main well path + +well_path_coll = resinsight.project.descendants(rips.WellPathCollection)[0] +well_path = well_path_coll.add_new_object(rips.ModeledWellPath) +well_path.name = "Test Well-1" +well_path.update() + +geometry = well_path.well_path_geometry() + +reference_point = geometry.reference_point +reference_point[0] = 457196 +reference_point[1] = 7322270 +reference_point[2] = 2742 +geometry.update() # Commit updates back to ResInsight + +# Create the first well target at the reference point +coord = [0, 0, 0] +geometry.append_well_target(coord) + +# Append new well targets relative the the reference point +coord = [454.28, 250, -10] +target = geometry.append_well_target(coord) + +coord = [1054.28, 250, -50] +target = geometry.append_well_target(coord) + +# Create a lateral at specified location on parent well +measured_depth = 3600 +lateral = well_path.append_lateral(measured_depth) +geometry = lateral.well_path_geometry() + +coord = [770, 280, 50] +target = geometry.append_well_target(coord) + +coord = [1054.28, -100, 50] +target = geometry.append_well_target(coord) + +coord = [2054.28, -100, 45] +target = geometry.append_well_target(coord) + + +# Wait 2 second +print("Wait 2 seconds ...") +time.sleep(2) +print("Move reference point of parent well") + +geometry = well_path.well_path_geometry() +reference_point = geometry.reference_point +reference_point[2] += 50 +geometry.update() # Commit updates back to ResInsight From 605af789c6c2b2c4d8da6c542465c14d4b77e9bd Mon Sep 17 00:00:00 2001 From: jonjenssen <69144954+jonjenssen@users.noreply.github.com> Date: Sat, 14 Aug 2021 14:23:55 +0200 Subject: [PATCH 066/308] Protect against crash in 3d view due to nullptr in linkwellpathfeature command check (#7876) * Protected against crash in 3d view due to nullptr * Code cleanup --- .../Commands/WellPathCommands/RicLinkWellPathFeature.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/ApplicationLibCode/Commands/WellPathCommands/RicLinkWellPathFeature.cpp b/ApplicationLibCode/Commands/WellPathCommands/RicLinkWellPathFeature.cpp index d956777868..ee89e4545c 100644 --- a/ApplicationLibCode/Commands/WellPathCommands/RicLinkWellPathFeature.cpp +++ b/ApplicationLibCode/Commands/WellPathCommands/RicLinkWellPathFeature.cpp @@ -74,10 +74,12 @@ bool RicLinkWellPathFeature::isCommandChecked() { if ( !wellPaths().empty() ) { - auto firstWell = dynamic_cast( wellPaths().front() ); - if ( auto geoDef = firstWell->geometryDefinition() ) + if ( auto firstWell = dynamic_cast( wellPaths().front() ) ) { - return geoDef->isReferencePointUpdatesLinked(); + if ( auto geoDef = firstWell->geometryDefinition() ) + { + return geoDef->isReferencePointUpdatesLinked(); + } } } return false; From 5fccd143bade2fb6c85d608798dd5b9be85c1e77 Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Sat, 14 Aug 2021 17:15:58 +0200 Subject: [PATCH 067/308] Remove obsolete doc files --- .../Python/doc/README_DOCUMENTATION.txt | 8 +- GrpcInterface/Python/doc/make.bat | 35 ----- GrpcInterface/Python/doc/make_and_copy.bat | 39 ----- .../Python/doc/source/PythonExamples.rst | 134 ------------------ .../Python/doc/source/PythonRips.rst | 9 -- GrpcInterface/Python/doc/source/conf.py | 64 --------- GrpcInterface/Python/doc/source/rips.rst | 113 --------------- 7 files changed, 2 insertions(+), 400 deletions(-) delete mode 100644 GrpcInterface/Python/doc/make.bat delete mode 100644 GrpcInterface/Python/doc/make_and_copy.bat delete mode 100644 GrpcInterface/Python/doc/source/PythonExamples.rst delete mode 100644 GrpcInterface/Python/doc/source/PythonRips.rst delete mode 100644 GrpcInterface/Python/doc/source/conf.py delete mode 100644 GrpcInterface/Python/doc/source/rips.rst diff --git a/GrpcInterface/Python/doc/README_DOCUMENTATION.txt b/GrpcInterface/Python/doc/README_DOCUMENTATION.txt index 85832119f1..e6bde98b7a 100644 --- a/GrpcInterface/Python/doc/README_DOCUMENTATION.txt +++ b/GrpcInterface/Python/doc/README_DOCUMENTATION.txt @@ -1,7 +1,3 @@ -You need sphinx to update the documentation. - -pip install sphinx sphinx-markdown-builder - -To update run "make markdown" to update to reflect changes to the python code. -The generated files are located in build/markdown +The documentation is moved to +https://github.com/OPM/ResInsight-UserDocumentation/tree/master/docs \ No newline at end of file diff --git a/GrpcInterface/Python/doc/make.bat b/GrpcInterface/Python/doc/make.bat deleted file mode 100644 index 9534b01813..0000000000 --- a/GrpcInterface/Python/doc/make.bat +++ /dev/null @@ -1,35 +0,0 @@ -@ECHO OFF - -pushd %~dp0 - -REM Command file for Sphinx documentation - -if "%SPHINXBUILD%" == "" ( - set SPHINXBUILD=sphinx-build -) -set SOURCEDIR=source -set BUILDDIR=build - -if "%1" == "" goto help - -%SPHINXBUILD% >NUL 2>NUL -if errorlevel 9009 ( - echo. - echo.The 'sphinx-build' command was not found. Make sure you have Sphinx - echo.installed, then set the SPHINXBUILD environment variable to point - echo.to the full path of the 'sphinx-build' executable. Alternatively you - echo.may add the Sphinx directory to PATH. - echo. - echo.If you don't have Sphinx installed, grab it from - echo.http://sphinx-doc.org/ - exit /b 1 -) - -%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% -goto end - -:help -%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% - -:end -popd diff --git a/GrpcInterface/Python/doc/make_and_copy.bat b/GrpcInterface/Python/doc/make_and_copy.bat deleted file mode 100644 index 665d65bedc..0000000000 --- a/GrpcInterface/Python/doc/make_and_copy.bat +++ /dev/null @@ -1,39 +0,0 @@ -@ECHO OFF - -pushd %~dp0 - -REM Command file for Sphinx documentation - -if "%SPHINXBUILD%" == "" ( - set SPHINXBUILD=sphinx-build -) -set SOURCEDIR=source -set BUILDDIR=build - -if "%1" == "" goto help - -%SPHINXBUILD% >NUL 2>NUL -if errorlevel 9009 ( - echo. - echo.The 'sphinx-build' command was not found. Make sure you have Sphinx - echo.installed, then set the SPHINXBUILD environment variable to point - echo.to the full path of the 'sphinx-build' executable. Alternatively you - echo.may add the Sphinx directory to PATH. - echo. - echo.If you don't have Sphinx installed, grab it from - echo.http://sphinx-doc.org/ - exit /b 1 -) - -%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% -goto end - -:help -%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% - -:end -popd - -REM Copy files to deployment folder using second parameter -REM Example "d:\gitroot\ResInsight-UserDocumentation\content\scripting" -xcopy /Y build\markdown %2 \ No newline at end of file diff --git a/GrpcInterface/Python/doc/source/PythonExamples.rst b/GrpcInterface/Python/doc/source/PythonExamples.rst deleted file mode 100644 index b23e5735df..0000000000 --- a/GrpcInterface/Python/doc/source/PythonExamples.rst +++ /dev/null @@ -1,134 +0,0 @@ -+++ -title = "Python Examples" -published = true -weight = 40 -+++ - -![]({{< relref "" >}}images/scripting/python-logo-master-v3-TM.png) - -This pages is created based on the content in the **PythonExamples** folder located inside the **rips** module, made available online for convenience. - - -AllCases --------- -.. literalinclude:: ../../rips/PythonExamples/all_cases.py - -AllSimulationWells ------------------- -.. literalinclude:: ../../rips/PythonExamples/all_simulation_wells.py - -AllWells --------- -.. literalinclude:: ../../rips/PythonExamples/all_wells.py - -AlterWbsPlot ------------- -.. literalinclude:: ../../rips/PythonExamples/alter_wbs_plot.py - -CaseGridGroup -------------- -.. literalinclude:: ../../rips/PythonExamples/case_grid_group.py - -CaseInfoStreamingExample ------------------------- -.. literalinclude:: ../../rips/PythonExamples/case_info_streaming_example.py - -CellResultData --------------- -.. literalinclude:: ../../rips/PythonExamples/cell_result_data.py - -CommandExample --------------- -.. literalinclude:: ../../rips/PythonExamples/command_example.py - -Create WBS Plot ---------------- -.. literalinclude:: ../../rips/PythonExamples/create_wbs_plot.py - -ErrorHandling -------------- -.. literalinclude:: ../../rips/PythonExamples/error_handling.py - -ExportContourMaps ------------------ -.. literalinclude:: ../../rips/PythonExamples/export_contour_maps.py - -ExportPlots ------------ -.. literalinclude:: ../../rips/PythonExamples/export_plots.py - -ExportSnapshots ---------------- -.. literalinclude:: ../../rips/PythonExamples/export_snapshots.py - -GridInformation ---------------- -.. literalinclude:: ../../rips/PythonExamples/grid_information.py - -Import Well Paths ------------------ -.. literalinclude:: ../../rips/PythonExamples/import_well_paths_and_logs.py - -InputPropTestAsync ------------------- -.. literalinclude:: ../../rips/PythonExamples/input_prop_test_async.py - -InputPropTestSync ------------------ -.. literalinclude:: ../../rips/PythonExamples/input_prop_test_sync.py - -InstanceExample ---------------- -.. literalinclude:: ../../rips/PythonExamples/instance_example.py - -LaunchWithCommandLineOptions ----------------------------- -.. literalinclude:: ../../rips/PythonExamples/launch_with_commandline_options.py - -Launch Using Command Line Options ---------------------------------- -.. literalinclude:: ../../rips/PythonExamples/launch_with_commandline_options.py - -NewSummaryPlot --------------- -.. literalinclude:: ../../rips/PythonExamples/new_summary_plot.py - -SelectedCases -------------- -.. literalinclude:: ../../rips/PythonExamples/selected_cases.py - -SelectedCells -------------- -.. literalinclude:: ../../rips/PythonExamples/selected_cells.py - -SetCellResult -------------- -.. literalinclude:: ../../rips/PythonExamples/set_cell_result.py - -SetFlowDiagnosticsResult ------------------------- -.. literalinclude:: ../../rips/PythonExamples/set_flow_diagnostics_result.py - -SetGridProperties ------------------ -.. literalinclude:: ../../rips/PythonExamples/set_grid_properties.py - -SoilAverageAsync ----------------- -.. literalinclude:: ../../rips/PythonExamples/soil_average_async.py - -SoilAverageSync ---------------- -.. literalinclude:: ../../rips/PythonExamples/soil_average_sync.py - -SoilPorvAsync -------------- -.. literalinclude:: ../../rips/PythonExamples/soil_porv_async.py - -SoilPorvSync ------------- -.. literalinclude:: ../../rips/PythonExamples/soil_porv_sync.py - -ViewExample ------------ -.. literalinclude:: ../../rips/PythonExamples/view_example.py diff --git a/GrpcInterface/Python/doc/source/PythonRips.rst b/GrpcInterface/Python/doc/source/PythonRips.rst deleted file mode 100644 index 9dda44cfd8..0000000000 --- a/GrpcInterface/Python/doc/source/PythonRips.rst +++ /dev/null @@ -1,9 +0,0 @@ -+++ -title = "Python API - rips" -published = true -weight = 42 -+++ - -![]({{< relref "" >}}images/scripting/python-logo-master-v3-TM.png) - -.. include:: rips.rst \ No newline at end of file diff --git a/GrpcInterface/Python/doc/source/conf.py b/GrpcInterface/Python/doc/source/conf.py deleted file mode 100644 index f819fda314..0000000000 --- a/GrpcInterface/Python/doc/source/conf.py +++ /dev/null @@ -1,64 +0,0 @@ -# Configuration file for the Sphinx documentation builder. -# -# This file only contains a selection of the most common options. For a full -# list see the documentation: -# http://www.sphinx-doc.org/en/master/config - -# -- Path setup -------------------------------------------------------------- - -# If extensions (or modules to document with autodoc) are in another directory, -# add these directories to sys.path here. If the directory is relative to the -# documentation root, use os.path.abspath to make it absolute, like shown here. -# -import os -import sys - -sys.path.insert(0, os.path.abspath("../../")) - - -# -- Project information ----------------------------------------------------- - -project = "rips" -copyright = "2019, Ceetron Solutions AS" -author = "Ceetron Solutions AS" - -# The full version, including alpha/beta/rc tags -release = "2019.04.01" - - -# -- General configuration --------------------------------------------------- - -# Add any Sphinx extension module names here, as strings. They can be -# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom -# ones. -extensions = ["sphinx.ext.autodoc", "sphinx.ext.napoleon", "sphinx_markdown_builder"] - -master_doc = "PythonRips" - -napoleon_google_docstring = True - -# Add any paths that contain templates here, relative to this directory. -templates_path = ["_templates"] - -# List of patterns, relative to source directory, that match files and -# directories to ignore when looking for source files. -# This pattern also affects html_static_path and html_extra_path. -exclude_patterns = ["build/*", "rips.rst"] - - -# -- Options for HTML output ------------------------------------------------- - -# The theme to use for HTML and HTML Help pages. See the documentation for -# a list of builtin themes. -# -html_theme = "alabaster" - -smartquotes = False - -# Add any paths that contain custom static files (such as style sheets) here, -# relative to this directory. They are copied after the builtin static files, -# so a file named "default.css" will overwrite the builtin "default.css". -html_static_path = ["_static"] - - -# -- Extension configuration ------------------------------------------------- diff --git a/GrpcInterface/Python/doc/source/rips.rst b/GrpcInterface/Python/doc/source/rips.rst deleted file mode 100644 index ea068c7c53..0000000000 --- a/GrpcInterface/Python/doc/source/rips.rst +++ /dev/null @@ -1,113 +0,0 @@ -Instance Module -=============== - -.. autoclass:: rips.instance.Instance - :members: - -Example -------- - -.. literalinclude:: ../../rips/PythonExamples/instance_example.py - :language: python - :lines: 5- - :emphasize-lines: 3 - -Case Module -=========== -.. autoclass:: rips.case.Case - :members: - -Example -------- - -.. literalinclude:: ../../rips/PythonExamples/all_cases.py - :language: python - :lines: 5- - :emphasize-lines: 5 - -Contour Map Module -================== - -.. autoclass:: rips.contour_map.EclipseContourMap - :members: - -.. autoclass:: rips.contour_map.GeoMechContourMap - :members: - -Grid Module -=========== - -.. autoclass:: rips.grid.Grid - :members: - -Example -------- -.. code-block:: python - - case = rips_instance.project.loadCase(path=casePath) - print (case.gridCount()) - if case.gridCount() > 0: - grid = case.grid(index=0) - dimensions = grid.dimensions() - print(dimensions.i) - print(dimensions.j) - print(dimensions.k) - -GridCaseGroup Module -==================== - -.. autoclass:: rips.gridcasegroup.GridCaseGroup - :members: - - -Plot Module -============== - -.. autoclass:: rips.project.Plot - :members: - -Project Module -============== - -.. autoclass:: rips.project.Project - :members: - - -Simulation Well Module -====================== - -.. autoclass:: rips.simulation_well.SimulationWell - :members: - -View Module -=========== - -.. autoclass:: rips.view.View - :members: - -Well Log Plot Module -==================== - -.. autoclass:: rips.well_log_plot.WellLogPlot - :members: - -Synchronous Example -------------------- -Read two properties, multiply them together and push the results back to ResInsight in a naïve way, by reading PORO into a list, then reading PERMX into a list, then multiplying them both in a resulting list and finally transferring back the list. - -This is slow and inefficient, but works. - -.. literalinclude:: ../../rips/PythonExamples/input_prop_test_async.py - :language: python - :lines: 5- - -Asynchronous Example --------------------- -Read two properties at the same time chunk by chunk, multiply each chunk together and start transferring the result back to ResInsight as soon as the chunk is finished. - -This is far more efficient. - -.. literalinclude:: ../../rips/PythonExamples/input_prop_test_sync.py - :language: python - :lines: 5- - From d1e81f3c1e66083328e588d39aa49792912202b5 Mon Sep 17 00:00:00 2001 From: jonjenssen Date: Wed, 7 Jul 2021 18:59:20 +0200 Subject: [PATCH 068/308] Update ODB libraried needed for linking --- .../GeoMech/OdbReader/CMakeLists.txt | 24 ++++++++----------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/ApplicationLibCode/GeoMech/OdbReader/CMakeLists.txt b/ApplicationLibCode/GeoMech/OdbReader/CMakeLists.txt index 3cadd9706a..10a414cb57 100644 --- a/ApplicationLibCode/GeoMech/OdbReader/CMakeLists.txt +++ b/ApplicationLibCode/GeoMech/OdbReader/CMakeLists.txt @@ -50,21 +50,19 @@ if(MSVC) list( APPEND RI_ODB_LIBS - ${RESINSIGHT_ODB_API_DIR}/lib/ABQSMAOdbDdbOdb.lib + ${RESINSIGHT_ODB_API_DIR}/lib/ABQSMAAbuBasicUtils.lib + ${RESINSIGHT_ODB_API_DIR}/lib/ABQSMAAbuGeom.lib + ${RESINSIGHT_ODB_API_DIR}/lib/ABQSMABasAlloc.lib + ${RESINSIGHT_ODB_API_DIR}/lib/ABQSMABasCoreUtils.lib + ${RESINSIGHT_ODB_API_DIR}/lib/ABQSMABasShared.lib ${RESINSIGHT_ODB_API_DIR}/lib/ABQSMAOdbApi.lib + ${RESINSIGHT_ODB_API_DIR}/lib/ABQSMAOdbAttrEO.lib ${RESINSIGHT_ODB_API_DIR}/lib/ABQSMAOdbCore.lib ${RESINSIGHT_ODB_API_DIR}/lib/ABQSMAOdbCoreGeom.lib - ${RESINSIGHT_ODB_API_DIR}/lib/ABQSMAOdbAttrEO.lib - ${RESINSIGHT_ODB_API_DIR}/lib/ABQSMAAbuBasicUtils.lib - ${RESINSIGHT_ODB_API_DIR}/lib/ABQSMABasShared.lib - ${RESINSIGHT_ODB_API_DIR}/lib/ABQSMABasCoreUtils.lib - ${RESINSIGHT_ODB_API_DIR}/lib/ABQSMAStiCAE_StableTime.lib - ${RESINSIGHT_ODB_API_DIR}/lib/ABQSMABasMem.lib - ${RESINSIGHT_ODB_API_DIR}/lib/ABQSMAAbuGeom.lib + ${RESINSIGHT_ODB_API_DIR}/lib/ABQSMAOdbDdbOdb.lib ${RESINSIGHT_ODB_API_DIR}/lib/ABQSMARomDiagEx.lib - ${RESINSIGHT_ODB_API_DIR}/lib/ABQSMASspUmaCore.lib ${RESINSIGHT_ODB_API_DIR}/lib/ABQSMASimInterface.lib - ${RESINSIGHT_ODB_API_DIR}/lib/ABQSMAMtxCoreModule.lib) + ) else() list( APPEND @@ -77,13 +75,11 @@ else() ${RESINSIGHT_ODB_API_DIR}/lib/libABQSMAAbuBasicUtils.so ${RESINSIGHT_ODB_API_DIR}/lib/libABQSMABasShared.so ${RESINSIGHT_ODB_API_DIR}/lib/libABQSMABasCoreUtils.so - ${RESINSIGHT_ODB_API_DIR}/lib/libABQSMAStiCAE_StableTime.so - ${RESINSIGHT_ODB_API_DIR}/lib/libABQSMABasMem.so + ${RESINSIGHT_ODB_API_DIR}/lib/libABQSMABasAlloc.so ${RESINSIGHT_ODB_API_DIR}/lib/libABQSMAAbuGeom.so ${RESINSIGHT_ODB_API_DIR}/lib/libABQSMARomDiagEx.so - ${RESINSIGHT_ODB_API_DIR}/lib/libABQSMASspUmaCore.so ${RESINSIGHT_ODB_API_DIR}/lib/libABQSMASimInterface.so - ${RESINSIGHT_ODB_API_DIR}/lib/libABQSMAMtxCoreModule.so) + ) endif(MSVC) target_include_directories(${PROJECT_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) From 966bcd1e77385c2db2c2ec016f1cafca8a648255 Mon Sep 17 00:00:00 2001 From: Kristian Bendiksen Date: Tue, 17 Aug 2021 13:38:12 +0200 Subject: [PATCH 069/308] Ensemble surface import and statistics --- .../Commands/CMakeLists_files.cmake | 2 + .../RicImportEnsembleSurfaceFeature.cpp | 127 +++++++ .../RicImportEnsembleSurfaceFeature.h | 45 +++ .../GeoMech/OdbReader/CMakeLists.txt | 6 +- .../RimContextCommandBuilder.cpp | 1 + .../Surfaces/CMakeLists_files.cmake | 6 + .../Surfaces/RimEnsembleStatisticsSurface.cpp | 139 +++++++ .../Surfaces/RimEnsembleStatisticsSurface.h | 52 +++ .../Surfaces/RimEnsembleSurface.cpp | 279 ++++++++++++++ .../Surfaces/RimEnsembleSurface.h | 75 ++++ .../Surfaces/RimEnsembleSurfaceInView.cpp | 342 ++++++++++++++++++ .../Surfaces/RimEnsembleSurfaceInView.h | 86 +++++ .../Surfaces/RimGridCaseSurface.cpp | 12 +- .../ProjectDataModel/Surfaces/RimSurface.h | 5 +- .../Surfaces/RimSurfaceCollection.cpp | 35 +- .../Surfaces/RimSurfaceCollection.h | 7 +- .../Surfaces/RimSurfaceInViewCollection.cpp | 90 +++++ .../Surfaces/RimSurfaceInViewCollection.h | 8 +- .../CMakeLists_files.cmake | 2 + .../ProjectDataModelCommands/RimcSurface.cpp | 91 +++++ .../ProjectDataModelCommands/RimcSurface.h | 48 +++ .../RimcSurfaceCollection.cpp | 52 +++ .../RimcSurfaceCollection.h | 21 ++ .../ReservoirDataModel/CMakeLists_files.cmake | 4 + .../ReservoirDataModel/RigSurface.cpp | 4 +- .../ReservoirDataModel/RigSurface.h | 4 +- .../RigSurfaceResampler.cpp | 119 ++++++ .../ReservoirDataModel/RigSurfaceResampler.h | 43 +++ .../RigSurfaceStatisticsCalculator.cpp | 129 +++++++ .../RigSurfaceStatisticsCalculator.h | 46 +++ .../ReservoirDataModel/cvfGeometryTools.cpp | 14 +- .../ReservoirDataModel/cvfGeometryTools.h | 14 +- .../UnitTests/CMakeLists_files.cmake | 2 + .../UnitTests/RigSurfaceResampler-Test.cpp | 85 +++++ .../RigSurfaceStatisticsCalculator-Test.cpp | 81 +++++ .../generate_ensemble_surface.py | 62 ++++ .../Python/rips/tests/test_surfaces.py | 34 ++ 37 files changed, 2138 insertions(+), 34 deletions(-) create mode 100644 ApplicationLibCode/Commands/RicImportEnsembleSurfaceFeature.cpp create mode 100644 ApplicationLibCode/Commands/RicImportEnsembleSurfaceFeature.h create mode 100644 ApplicationLibCode/ProjectDataModel/Surfaces/RimEnsembleStatisticsSurface.cpp create mode 100644 ApplicationLibCode/ProjectDataModel/Surfaces/RimEnsembleStatisticsSurface.h create mode 100644 ApplicationLibCode/ProjectDataModel/Surfaces/RimEnsembleSurface.cpp create mode 100644 ApplicationLibCode/ProjectDataModel/Surfaces/RimEnsembleSurface.h create mode 100644 ApplicationLibCode/ProjectDataModel/Surfaces/RimEnsembleSurfaceInView.cpp create mode 100644 ApplicationLibCode/ProjectDataModel/Surfaces/RimEnsembleSurfaceInView.h create mode 100644 ApplicationLibCode/ProjectDataModelCommands/RimcSurface.cpp create mode 100644 ApplicationLibCode/ProjectDataModelCommands/RimcSurface.h create mode 100644 ApplicationLibCode/ReservoirDataModel/RigSurfaceResampler.cpp create mode 100644 ApplicationLibCode/ReservoirDataModel/RigSurfaceResampler.h create mode 100644 ApplicationLibCode/ReservoirDataModel/RigSurfaceStatisticsCalculator.cpp create mode 100644 ApplicationLibCode/ReservoirDataModel/RigSurfaceStatisticsCalculator.h create mode 100644 ApplicationLibCode/UnitTests/RigSurfaceResampler-Test.cpp create mode 100644 ApplicationLibCode/UnitTests/RigSurfaceStatisticsCalculator-Test.cpp create mode 100644 GrpcInterface/Python/rips/PythonExamples/generate_ensemble_surface.py create mode 100644 GrpcInterface/Python/rips/tests/test_surfaces.py diff --git a/ApplicationLibCode/Commands/CMakeLists_files.cmake b/ApplicationLibCode/Commands/CMakeLists_files.cmake index 39b77c925c..4d431fc271 100644 --- a/ApplicationLibCode/Commands/CMakeLists_files.cmake +++ b/ApplicationLibCode/Commands/CMakeLists_files.cmake @@ -62,6 +62,7 @@ ${CMAKE_CURRENT_LIST_DIR}/RicRecursiveFileSearchDialog.h ${CMAKE_CURRENT_LIST_DIR}/RicSummaryCaseRestartDialog.h ${CMAKE_CURRENT_LIST_DIR}/RicImportEnsembleFeature.h ${CMAKE_CURRENT_LIST_DIR}/RicImportSummaryGroupFeature.h +${CMAKE_CURRENT_LIST_DIR}/RicImportEnsembleSurfaceFeature.h ${CMAKE_CURRENT_LIST_DIR}/RicConvertGroupToEnsembleFeature.h ${CMAKE_CURRENT_LIST_DIR}/RicImportEnsembleWellLogsFeature.h ${CMAKE_CURRENT_LIST_DIR}/RicResampleDialog.h @@ -147,6 +148,7 @@ ${CMAKE_CURRENT_LIST_DIR}/RicRecursiveFileSearchDialog.cpp ${CMAKE_CURRENT_LIST_DIR}/RicSummaryCaseRestartDialog.cpp ${CMAKE_CURRENT_LIST_DIR}/RicImportEnsembleFeature.cpp ${CMAKE_CURRENT_LIST_DIR}/RicImportSummaryGroupFeature.cpp +${CMAKE_CURRENT_LIST_DIR}/RicImportEnsembleSurfaceFeature.cpp ${CMAKE_CURRENT_LIST_DIR}/RicConvertGroupToEnsembleFeature.cpp ${CMAKE_CURRENT_LIST_DIR}/RicImportEnsembleWellLogsFeature.cpp ${CMAKE_CURRENT_LIST_DIR}/RicResampleDialog.cpp diff --git a/ApplicationLibCode/Commands/RicImportEnsembleSurfaceFeature.cpp b/ApplicationLibCode/Commands/RicImportEnsembleSurfaceFeature.cpp new file mode 100644 index 0000000000..d23eba267c --- /dev/null +++ b/ApplicationLibCode/Commands/RicImportEnsembleSurfaceFeature.cpp @@ -0,0 +1,127 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2021- Equinor ASA +// +// ResInsight is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// + +#include "RicImportEnsembleSurfaceFeature.h" + +#include "RiaApplication.h" +#include "RiaLogging.h" + +#include "RimEnsembleSurface.h" +#include "RimFileSurface.h" +#include "RimOilField.h" +#include "RimProject.h" +#include "RimSurfaceCollection.h" + +#include "RicRecursiveFileSearchDialog.h" + +#include +#include + +CAF_CMD_SOURCE_INIT( RicImportEnsembleSurfaceFeature, "RicImportEnsembleSurfaceFeature" ); + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RicImportEnsembleSurfaceFeature::RicImportEnsembleSurfaceFeature() + : m_pathFilter( "*" ) + , m_fileNameFilter( "*" ) +{ +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +bool RicImportEnsembleSurfaceFeature::isCommandEnabled() +{ + return true; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RicImportEnsembleSurfaceFeature::onActionTriggered( bool isChecked ) +{ + RiaApplication* app = RiaApplication::instance(); + QString pathCacheName = "ENSEMBLE_SURFACE_FILES"; + QStringList fileNames = runRecursiveFileSearchDialog( "Import Ensemble Surface", pathCacheName ); + if ( fileNames.isEmpty() ) return; + + QString ensembleName = "Ensemble Surface"; + if ( ensembleName.isEmpty() ) return; + + std::vector surfaces; + for ( QString fileName : fileNames ) + { + RimFileSurface* fileSurface = new RimFileSurface; + fileSurface->setSurfaceFilePath( fileName ); + + if ( fileSurface->onLoadData() ) + { + surfaces.push_back( fileSurface ); + } + } + + if ( surfaces.empty() ) return; + + RimEnsembleSurface* ensemble = new RimEnsembleSurface; + ensemble->setName( ensembleName ); + for ( auto surface : surfaces ) + ensemble->addFileSurface( surface ); + + RimProject::current()->activeOilField()->surfaceCollection->addEnsembleSurface( ensemble ); + RimProject::current()->activeOilField()->surfaceCollection->updateConnectedEditors(); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RicImportEnsembleSurfaceFeature::setupActionLook( QAction* actionToSetup ) +{ + actionToSetup->setIcon( QIcon( ":/ReservoirSurfaces16x16.png" ) ); + actionToSetup->setText( "Import Ensemble Surface" ); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +QStringList RicImportEnsembleSurfaceFeature::runRecursiveFileSearchDialog( const QString& dialogTitle, + const QString& pathCacheName ) +{ + RiaApplication* app = RiaApplication::instance(); + QString defaultDir = app->lastUsedDialogDirectory( pathCacheName ); + + RicRecursiveFileSearchDialogResult result = RicRecursiveFileSearchDialog::runRecursiveSearchDialog( nullptr, + dialogTitle, + defaultDir, + m_pathFilter, + m_fileNameFilter, + QStringList() + << ".TS" + << ".ts" ); + + // Remember filters + m_pathFilter = result.pathFilter; + m_fileNameFilter = result.fileNameFilter; + + if ( !result.ok ) return QStringList(); + + // Remember the path to next time + app->setLastUsedDialogDirectory( pathCacheName, QFileInfo( result.rootDir ).absoluteFilePath() ); + + return result.files; +} diff --git a/ApplicationLibCode/Commands/RicImportEnsembleSurfaceFeature.h b/ApplicationLibCode/Commands/RicImportEnsembleSurfaceFeature.h new file mode 100644 index 0000000000..197f7bacc1 --- /dev/null +++ b/ApplicationLibCode/Commands/RicImportEnsembleSurfaceFeature.h @@ -0,0 +1,45 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2021- Equinor ASA +// +// ResInsight is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// + +#pragma once + +#include "cafCmdFeature.h" + +#include + +//================================================================================================== +/// +//================================================================================================== +class RicImportEnsembleSurfaceFeature : public caf::CmdFeature +{ + CAF_CMD_HEADER_INIT; + + RicImportEnsembleSurfaceFeature(); + +protected: + // Overrides + bool isCommandEnabled() override; + void onActionTriggered( bool isChecked ) override; + void setupActionLook( QAction* actionToSetup ) override; + + QStringList runRecursiveFileSearchDialog( const QString& dialogTitle, const QString& pathCacheName ); + +private: + QString m_pathFilter; + QString m_fileNameFilter; +}; diff --git a/ApplicationLibCode/GeoMech/OdbReader/CMakeLists.txt b/ApplicationLibCode/GeoMech/OdbReader/CMakeLists.txt index 10a414cb57..4ba39a8142 100644 --- a/ApplicationLibCode/GeoMech/OdbReader/CMakeLists.txt +++ b/ApplicationLibCode/GeoMech/OdbReader/CMakeLists.txt @@ -61,8 +61,7 @@ if(MSVC) ${RESINSIGHT_ODB_API_DIR}/lib/ABQSMAOdbCoreGeom.lib ${RESINSIGHT_ODB_API_DIR}/lib/ABQSMAOdbDdbOdb.lib ${RESINSIGHT_ODB_API_DIR}/lib/ABQSMARomDiagEx.lib - ${RESINSIGHT_ODB_API_DIR}/lib/ABQSMASimInterface.lib - ) + ${RESINSIGHT_ODB_API_DIR}/lib/ABQSMASimInterface.lib) else() list( APPEND @@ -78,8 +77,7 @@ else() ${RESINSIGHT_ODB_API_DIR}/lib/libABQSMABasAlloc.so ${RESINSIGHT_ODB_API_DIR}/lib/libABQSMAAbuGeom.so ${RESINSIGHT_ODB_API_DIR}/lib/libABQSMARomDiagEx.so - ${RESINSIGHT_ODB_API_DIR}/lib/libABQSMASimInterface.so - ) + ${RESINSIGHT_ODB_API_DIR}/lib/libABQSMASimInterface.so) endif(MSVC) target_include_directories(${PROJECT_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) diff --git a/ApplicationLibCode/ProjectDataModel/RimContextCommandBuilder.cpp b/ApplicationLibCode/ProjectDataModel/RimContextCommandBuilder.cpp index 111a584a95..f3c1142f9a 100644 --- a/ApplicationLibCode/ProjectDataModel/RimContextCommandBuilder.cpp +++ b/ApplicationLibCode/ProjectDataModel/RimContextCommandBuilder.cpp @@ -969,6 +969,7 @@ caf::CmdFeatureMenuBuilder RimContextCommandBuilder::commandsFromSelection() { menuBuilder << "RicImportSurfacesFeature"; menuBuilder << "RicNewGridSurfaceFeature"; + menuBuilder << "RicImportEnsembleSurfaceFeature"; menuBuilder.addSeparator(); menuBuilder << "RicNewSurfaceCollectionFeature"; } diff --git a/ApplicationLibCode/ProjectDataModel/Surfaces/CMakeLists_files.cmake b/ApplicationLibCode/ProjectDataModel/Surfaces/CMakeLists_files.cmake index ed70f6f4d3..eedeafa11e 100644 --- a/ApplicationLibCode/ProjectDataModel/Surfaces/CMakeLists_files.cmake +++ b/ApplicationLibCode/ProjectDataModel/Surfaces/CMakeLists_files.cmake @@ -7,6 +7,9 @@ ${CMAKE_CURRENT_LIST_DIR}/RimSurfaceCollection.h ${CMAKE_CURRENT_LIST_DIR}/RimSurfaceInView.h ${CMAKE_CURRENT_LIST_DIR}/RimSurfaceInViewCollection.h ${CMAKE_CURRENT_LIST_DIR}/RimSurfaceResultDefinition.h +${CMAKE_CURRENT_LIST_DIR}/RimEnsembleSurface.h +${CMAKE_CURRENT_LIST_DIR}/RimEnsembleSurfaceInView.h +${CMAKE_CURRENT_LIST_DIR}/RimEnsembleStatisticsSurface.h ) set (SOURCE_GROUP_SOURCE_FILES @@ -17,6 +20,9 @@ ${CMAKE_CURRENT_LIST_DIR}/RimSurfaceCollection.cpp ${CMAKE_CURRENT_LIST_DIR}/RimSurfaceInView.cpp ${CMAKE_CURRENT_LIST_DIR}/RimSurfaceInViewCollection.cpp ${CMAKE_CURRENT_LIST_DIR}/RimSurfaceResultDefinition.cpp +${CMAKE_CURRENT_LIST_DIR}/RimEnsembleSurface.cpp +${CMAKE_CURRENT_LIST_DIR}/RimEnsembleSurfaceInView.cpp +${CMAKE_CURRENT_LIST_DIR}/RimEnsembleStatisticsSurface.cpp ) list(APPEND CODE_HEADER_FILES diff --git a/ApplicationLibCode/ProjectDataModel/Surfaces/RimEnsembleStatisticsSurface.cpp b/ApplicationLibCode/ProjectDataModel/Surfaces/RimEnsembleStatisticsSurface.cpp new file mode 100644 index 0000000000..e6efab3bec --- /dev/null +++ b/ApplicationLibCode/ProjectDataModel/Surfaces/RimEnsembleStatisticsSurface.cpp @@ -0,0 +1,139 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2020- Equinor ASA +// +// ResInsight is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// + +#include "RimEnsembleStatisticsSurface.h" + +#include "RigSurface.h" +#include "RigSurfaceStatisticsCalculator.h" +#include "RimEnsembleSurface.h" +#include "RimSurfaceCollection.h" + +#include "cafPdmFieldScriptingCapability.h" +#include "cafPdmObjectScriptingCapability.h" + +#include + +// TODO: Use the alias concept prototyped below when the alias concept for class is ready +// CAF_PDM_SOURCE_INIT( RimEnsembleStatisticsSurface, "EnsembleStatisticsSurface", "Surface" ); +// CAF_PDM_SOURCE_INIT( , , ); +CAF_PDM_SOURCE_INIT( RimEnsembleStatisticsSurface, "EnsembleStatisticsSurface" ); + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RimEnsembleStatisticsSurface::RimEnsembleStatisticsSurface() +{ + CAF_PDM_InitScriptableObject( "Surface", ":/ReservoirSurface16x16.png", "", "" ); + + CAF_PDM_InitFieldNoDefault( &m_statisticsType, "StatisticsType", "StatisticsType", "", "", "" ); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RimEnsembleStatisticsSurface::~RimEnsembleStatisticsSurface() +{ +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimEnsembleStatisticsSurface::setStatisticsType( RigSurfaceStatisticsCalculator::StatisticsType statisticsType ) +{ + m_statisticsType = statisticsType; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +QString RimEnsembleStatisticsSurface::fullName() const +{ + return caf::AppEnum::uiText( m_statisticsType.v() ); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +bool RimEnsembleStatisticsSurface::onLoadData() +{ + return updateSurfaceData(); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RimSurface* RimEnsembleStatisticsSurface::createCopy() +{ + RimEnsembleStatisticsSurface* newSurface = dynamic_cast( + xmlCapability()->copyByXmlSerialization( caf::PdmDefaultObjectFactory::instance() ) ); + + if ( !newSurface->onLoadData() ) + { + delete newSurface; + return nullptr; + } + + return newSurface; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +bool RimEnsembleStatisticsSurface ::updateSurfaceData() +{ + RimEnsembleSurface* ensembleSurface; + firstAncestorOrThisOfType( ensembleSurface ); + + if ( ensembleSurface ) + { + const RigSurface* surface = ensembleSurface->statisticsSurface(); + + if ( surface ) + { + const std::vector& indices = surface->triangleIndices(); + const std::vector& vertices = surface->vertices(); + + const std::vector& meanValues = surface->propertyValues( + caf::AppEnum::text( m_statisticsType.v() ) ); + + std::vector verts; + for ( size_t i = 0; i < vertices.size(); i++ ) + { + verts.push_back( cvf::Vec3d( vertices[i].x(), vertices[i].y(), meanValues[i] ) ); + } + + m_tringleIndices = indices; + m_vertices = verts; + + m_surfaceData = new RigSurface; + + m_surfaceData->setTriangleData( m_tringleIndices, m_vertices ); + + return true; + } + } + + return false; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimEnsembleStatisticsSurface ::clearCachedNativeData() +{ +} diff --git a/ApplicationLibCode/ProjectDataModel/Surfaces/RimEnsembleStatisticsSurface.h b/ApplicationLibCode/ProjectDataModel/Surfaces/RimEnsembleStatisticsSurface.h new file mode 100644 index 0000000000..0c03c13c1b --- /dev/null +++ b/ApplicationLibCode/ProjectDataModel/Surfaces/RimEnsembleStatisticsSurface.h @@ -0,0 +1,52 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2021- Equinor ASA +// +// ResInsight is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// + +#pragma once + +#include "RigSurface.h" + +#include "RigSurfaceStatisticsCalculator.h" + +#include "RimSurface.h" +#include "cafAppEnum.h" + +class RimEnsembleStatisticsSurface : public RimSurface +{ + CAF_PDM_HEADER_INIT; + +public: + RimEnsembleStatisticsSurface(); + ~RimEnsembleStatisticsSurface() override; + + bool onLoadData() override; + RimSurface* createCopy() override; + + void setStatisticsType( RigSurfaceStatisticsCalculator::StatisticsType statisticsType ); + + QString fullName() const override; + +protected: + bool updateSurfaceData() override; + void clearCachedNativeData() override; + +private: + std::vector m_tringleIndices; + std::vector m_vertices; + + caf::PdmField> m_statisticsType; +}; diff --git a/ApplicationLibCode/ProjectDataModel/Surfaces/RimEnsembleSurface.cpp b/ApplicationLibCode/ProjectDataModel/Surfaces/RimEnsembleSurface.cpp new file mode 100644 index 0000000000..22590938ce --- /dev/null +++ b/ApplicationLibCode/ProjectDataModel/Surfaces/RimEnsembleSurface.cpp @@ -0,0 +1,279 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2021- Equinor ASA +// +// ResInsight is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// + +#include "RimEnsembleSurface.h" + +#include "RiaLogging.h" + +#include "RigSurfaceResampler.h" +#include "RigSurfaceStatisticsCalculator.h" + +#include "RimEnsembleCurveSet.h" +#include "RimEnsembleStatisticsSurface.h" +#include "RimFileSurface.h" +#include "RimMainPlotCollection.h" +#include "RimProject.h" +#include "RimSurfaceCollection.h" + +#include "cafPdmFieldScriptingCapability.h" +#include "cafPdmObjectScriptingCapability.h" + +CAF_PDM_SOURCE_INIT( RimEnsembleSurface, "EnsembleSurface" ); + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RimEnsembleSurface::RimEnsembleSurface() +{ + CAF_PDM_InitScriptableObject( "Ensemble Surface", ":/ReservoirSurfaces16x16.png", "", "" ); + + CAF_PDM_InitFieldNoDefault( &m_fileSurfaces, "FileSurfaces", "", "", "", "" ); + m_fileSurfaces.uiCapability()->setUiHidden( true ); + + CAF_PDM_InitFieldNoDefault( &m_statisticsSurfaces, "StatisticsSurfaces", "", "", "", "" ); + m_statisticsSurfaces.uiCapability()->setUiHidden( true ); + + CAF_PDM_InitFieldNoDefault( &m_ensembleCurveSet, "FilterEnsembleCurveSet", "Filter by Ensemble Curve Set", "", "", "" ); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimEnsembleSurface::removeFileSurface( RimFileSurface* fileSurface ) +{ + m_fileSurfaces.removeChildObject( fileSurface ); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimEnsembleSurface::addFileSurface( RimFileSurface* fileSurface ) +{ + m_fileSurfaces.push_back( fileSurface ); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +std::vector RimEnsembleSurface::fileSurfaces() const +{ + return m_fileSurfaces().childObjects(); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +std::vector RimEnsembleSurface::surfaces() const +{ + std::vector surfaces; + for ( auto fs : m_fileSurfaces.childObjects() ) + surfaces.push_back( fs ); + + for ( auto s : m_statisticsSurfaces.childObjects() ) + surfaces.push_back( s ); + + return surfaces; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimEnsembleSurface::loadDataAndUpdate() +{ + for ( auto& w : m_fileSurfaces ) + { + if ( !w->onLoadData() ) + { + RiaLogging::warning( QString( "Failed to load surface: %1" ).arg( w->surfaceFilePath() ) ); + } + } + + std::vector fileSurfaces = m_fileSurfaces.childObjects(); + if ( m_ensembleCurveSet != nullptr ) + { + fileSurfaces = filterByEnsembleCurveSet( fileSurfaces ); + } + + m_statisticsSurfaces.deleteAllChildObjects(); + m_statisticsSurfaces.clear(); + + if ( !fileSurfaces.empty() ) + { + cvf::ref firstSurface = fileSurfaces[0]->surfaceData(); + + std::vector> surfaces; + for ( auto& w : fileSurfaces ) + surfaces.push_back( RigSurfaceResampler::resampleSurface( firstSurface, w->surfaceData() ) ); + + m_statisticsSurface = RigSurfaceStatisticsCalculator::computeStatistics( surfaces ); + if ( !m_statisticsSurface.isNull() ) + { + std::vector statisticsTypes = + { RigSurfaceStatisticsCalculator::StatisticsType::MIN, + RigSurfaceStatisticsCalculator::StatisticsType::MAX, + RigSurfaceStatisticsCalculator::StatisticsType::MEAN, + RigSurfaceStatisticsCalculator::StatisticsType::P10, + RigSurfaceStatisticsCalculator::StatisticsType::P50, + RigSurfaceStatisticsCalculator::StatisticsType::P90 }; + for ( auto s : statisticsTypes ) + { + auto statSurface = new RimEnsembleStatisticsSurface; + statSurface->setStatisticsType( s ); + m_statisticsSurfaces.push_back( statSurface ); + statSurface->onLoadData(); + } + } + } + + RimSurfaceCollection* surfColl; + this->firstAncestorOrThisOfTypeAsserted( surfColl ); + + std::vector surfacesToUpdate; + surfColl->updateViews( surfaces(), false ); + updateConnectedEditors(); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +std::vector + RimEnsembleSurface::filterByEnsembleCurveSet( const std::vector& fileSurfaces ) const +{ + std::vector filteredCases; + + if ( m_ensembleCurveSet != nullptr ) + { + // Get the summary cases from the related ensemble summary curve set. + RimSummaryCaseCollection* summaryCaseCollection = m_ensembleCurveSet->summaryCaseCollection(); + + // + std::vector sumCases = + m_ensembleCurveSet->filterEnsembleCases( summaryCaseCollection->allSummaryCases() ); + for ( auto sumCase : sumCases ) + { + for ( auto fileSurface : fileSurfaces ) + { + if ( isSameRealization( sumCase, fileSurface ) ) + { + filteredCases.push_back( fileSurface ); + } + } + } + } + else + { + filteredCases = fileSurfaces; + } + + return filteredCases; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +bool RimEnsembleSurface::isSameRealization( RimSummaryCase* summaryCase, RimFileSurface* fileSurface ) const +{ + // TODO: duplication with RimEnsembleWellLogCurveSet::isSameRealization + QString fileSurfaceName = fileSurface->surfaceFilePath(); + if ( summaryCase->hasCaseRealizationParameters() ) + { + // TODO: make less naive.. + int realizationNumber = summaryCase->caseRealizationParameters()->realizationNumber(); + QString summaryCaseFileName = summaryCase->summaryHeaderFilename(); + + if ( fileSurfaceName.contains( QString( "realization-%1" ).arg( realizationNumber ) ) ) + { + return true; + } + } + + return false; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +const RigSurface* RimEnsembleSurface::statisticsSurface() const +{ + return m_statisticsSurface.p(); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +QList RimEnsembleSurface::calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions, + bool* useOptionsOnly ) +{ + QList options; + + if ( fieldNeedingOptions == &m_ensembleCurveSet ) + { + options.push_back( caf::PdmOptionItemInfo( "None", nullptr ) ); + + RimMainPlotCollection* mainPlotColl = RimProject::current()->mainPlotCollection(); + std::vector ensembleCurveSets; + mainPlotColl->descendantsOfType( ensembleCurveSets ); + for ( auto ensembleCurveSet : ensembleCurveSets ) + { + options.push_back( caf::PdmOptionItemInfo( ensembleCurveSet->name(), ensembleCurveSet ) ); + } + } + + return options; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimEnsembleSurface::connectEnsembleCurveSetFilterSignals() +{ + if ( m_ensembleCurveSet() ) + { + m_ensembleCurveSet()->filterChanged.connect( this, &RimEnsembleSurface::onFilterSourceChanged ); + } +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimEnsembleSurface::onFilterSourceChanged( const caf::SignalEmitter* emitter ) +{ + if ( m_ensembleCurveSet() ) loadDataAndUpdate(); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimEnsembleSurface::initAfterRead() +{ + connectEnsembleCurveSetFilterSignals(); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimEnsembleSurface::fieldChangedByUi( const caf::PdmFieldHandle* changedField, + const QVariant& oldValue, + const QVariant& newValue ) +{ + if ( changedField == &m_ensembleCurveSet ) + { + connectEnsembleCurveSetFilterSignals(); + loadDataAndUpdate(); + } +} diff --git a/ApplicationLibCode/ProjectDataModel/Surfaces/RimEnsembleSurface.h b/ApplicationLibCode/ProjectDataModel/Surfaces/RimEnsembleSurface.h new file mode 100644 index 0000000000..2718bdd0ac --- /dev/null +++ b/ApplicationLibCode/ProjectDataModel/Surfaces/RimEnsembleSurface.h @@ -0,0 +1,75 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2021- Equinor ASA +// +// ResInsight is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// + +#pragma once + +#include "RimNamedObject.h" + +#include "cafPdmChildArrayField.h" +#include "cafPdmPtrField.h" + +#include "cvfObject.h" + +class RimFileSurface; +class RimSurface; +class RigSurface; +class RimEnsembleStatisticsSurface; +class RimEnsembleCurveSet; +class RimSummaryCase; + +//================================================================================================== +/// +//================================================================================================== +class RimEnsembleSurface : public RimNamedObject +{ + CAF_PDM_HEADER_INIT; + +public: + RimEnsembleSurface(); + void removeFileSurface( RimFileSurface* fileSurface ); + void addFileSurface( RimFileSurface* fileSurface ); + + std::vector fileSurfaces() const; + + std::vector surfaces() const; + + void loadDataAndUpdate(); + + const RigSurface* statisticsSurface() const; + +protected: + QList calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions, + bool* useOptionsOnly ) override; + + void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) override; + void initAfterRead() override; + + std::vector filterByEnsembleCurveSet( const std::vector& fileSurfaces ) const; + + bool isSameRealization( RimSummaryCase* summaryCase, RimFileSurface* fileSurface ) const; + +private: + void connectEnsembleCurveSetFilterSignals(); + void onFilterSourceChanged( const caf::SignalEmitter* emitter ); + + caf::PdmChildArrayField m_fileSurfaces; + caf::PdmChildArrayField m_statisticsSurfaces; + caf::PdmPtrField m_ensembleCurveSet; + + cvf::ref m_statisticsSurface; +}; diff --git a/ApplicationLibCode/ProjectDataModel/Surfaces/RimEnsembleSurfaceInView.cpp b/ApplicationLibCode/ProjectDataModel/Surfaces/RimEnsembleSurfaceInView.cpp new file mode 100644 index 0000000000..16abd774b7 --- /dev/null +++ b/ApplicationLibCode/ProjectDataModel/Surfaces/RimEnsembleSurfaceInView.cpp @@ -0,0 +1,342 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2021- Equinor ASA +// +// ResInsight is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// + +#include "RimEnsembleSurfaceInView.h" + +#include "RimEnsembleSurface.h" +#include "RimGridView.h" +#include "RimIntersectionResultDefinition.h" +#include "RimSurface.h" +#include "RimSurfaceCollection.h" +#include "RimSurfaceInView.h" +#include "RimSurfaceResultDefinition.h" + +#include "RivSurfacePartMgr.h" + +#include "cvfModelBasicList.h" + +CAF_PDM_SOURCE_INIT( RimEnsembleSurfaceInView, "EnsembleSurfaceInView" ); + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RimEnsembleSurfaceInView::RimEnsembleSurfaceInView() +{ + CAF_PDM_InitObject( "Ensemble Surface", ":/ReservoirSurfaces16x16.png", "", "" ); + + CAF_PDM_InitFieldNoDefault( &m_ensembleSurfaceName, "EnsembleSurfaceName", "EnsembleSurfaceName", "", "", "" ); + m_ensembleSurfaceName.registerGetMethod( this, &RimEnsembleSurfaceInView::name ); + m_ensembleSurfaceName.uiCapability()->setUiReadOnly( true ); + m_ensembleSurfaceName.xmlCapability()->disableIO(); + + CAF_PDM_InitFieldNoDefault( &m_surfacesInView, "SurfacesInViewField", "SurfacesInViewField", "", "", "" ); + m_surfacesInView.uiCapability()->setUiTreeHidden( true ); + + CAF_PDM_InitFieldNoDefault( &m_ensembleSurface, "EnsembleSurface", "EnsembleSurface", "", "", "" ); + m_ensembleSurface.uiCapability()->setUiTreeHidden( true ); + + nameField()->uiCapability()->setUiHidden( true ); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RimEnsembleSurfaceInView::~RimEnsembleSurfaceInView() +{ +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +caf::PdmFieldHandle* RimEnsembleSurfaceInView::userDescriptionField() +{ + return &m_ensembleSurfaceName; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +QString RimEnsembleSurfaceInView::name() const +{ + if ( m_ensembleSurface ) return m_ensembleSurface->uiName(); + + return ""; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RimEnsembleSurface* RimEnsembleSurfaceInView::ensembleSurface() const +{ + return m_ensembleSurface; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimEnsembleSurfaceInView::setEnsembleSurface( RimEnsembleSurface* surfcoll ) +{ + m_ensembleSurface = surfcoll; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimEnsembleSurfaceInView::updateAllViewItems() +{ + syncSurfacesWithView(); + updateConnectedEditors(); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimEnsembleSurfaceInView::syncSurfacesWithView() +{ + // Delete surfaceInView without any real Surface connection + + std::vector surfsInView = m_surfacesInView.childObjects(); + + for ( auto surf : surfsInView ) + { + if ( !surf->surface() ) + { + m_surfacesInView.removeChildObject( surf ); + delete surf; + } + } + + // Create new surfade entries and reorder + std::vector orderedSurfs; + + if ( m_ensembleSurface ) + { + // pick up the surfaces and the order from the surface collection + std::vector surfs = m_ensembleSurface->surfaces(); + for ( auto surf : surfs ) + { + // check if this is a surface we need to create + RimSurfaceInView* viewSurf = this->getSurfaceInViewForSurface( surf ); + if ( viewSurf == nullptr ) + { + RimSurfaceInView* newSurfInView = new RimSurfaceInView(); + newSurfInView->setSurface( surf ); + orderedSurfs.push_back( newSurfInView ); + } + else + { + orderedSurfs.push_back( viewSurf ); + } + } + + // make sure our view surfaces have the same order as the source surface collection + m_surfacesInView.clear(); + for ( auto viewSurf : orderedSurfs ) + { + m_surfacesInView.push_back( viewSurf ); + } + } +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimEnsembleSurfaceInView::loadData() +{ + for ( RimSurfaceInView* surf : m_surfacesInView ) + { + if ( surf->isActive() ) + { + surf->loadDataAndUpdate(); + } + } +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimEnsembleSurfaceInView::clearGeometry() +{ + for ( RimSurfaceInView* surf : m_surfacesInView ) + { + surf->clearGeometry(); + } +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimEnsembleSurfaceInView::appendPartsToModel( cvf::ModelBasicList* model, cvf::Transform* scaleTransform ) +{ + if ( !isChecked() ) return; + + for ( RimSurfaceInView* surf : m_surfacesInView ) + { + if ( surf->isActive() ) + { + surf->surfacePartMgr()->appendIntersectionGeometryPartsToModel( model, scaleTransform ); + } + } + + model->updateBoundingBoxesRecursive(); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimEnsembleSurfaceInView::fieldChangedByUi( const caf::PdmFieldHandle* changedField, + const QVariant& oldValue, + const QVariant& newValue ) +{ + this->updateUiIconFromToggleField(); + + if ( changedField == &m_isChecked ) + { + RimGridView* ownerView; + this->firstAncestorOrThisOfTypeAsserted( ownerView ); + ownerView->scheduleCreateDisplayModelAndRedraw(); + } +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimEnsembleSurfaceInView::initAfterRead() +{ + this->updateUiIconFromToggleField(); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RimSurfaceInView* RimEnsembleSurfaceInView::getSurfaceInViewForSurface( const RimSurface* surf ) const +{ + for ( auto surfInView : m_surfacesInView ) + { + if ( surfInView->surface() == surf ) + { + return surfInView; + } + } + + return nullptr; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimEnsembleSurfaceInView::updateCellResultColor( bool hasGeneralCellResult, size_t timeStepIndex ) +{ + if ( !this->isChecked() ) return; + + for ( RimSurfaceInView* surf : m_surfacesInView ) + { + if ( surf->isActive() ) + { + bool useNativeSurfaceColors = false; + + if ( surf->isNativeSurfaceResultsActive() ) useNativeSurfaceColors = true; + + if ( !useNativeSurfaceColors ) + { + bool showResults = surf->activeSeparateResultDefinition() + ? surf->activeSeparateResultDefinition()->hasResult() + : hasGeneralCellResult; + + if ( showResults ) + { + surf->surfacePartMgr()->updateCellResultColor( timeStepIndex ); + } + else + { + useNativeSurfaceColors = true; + } + } + + if ( useNativeSurfaceColors ) + { + surf->surfacePartMgr()->updateNativeSurfaceColors(); + } + } + } +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimEnsembleSurfaceInView::applySingleColorEffect() +{ + if ( !this->isChecked() ) return; + + for ( RimSurfaceInView* surf : m_surfacesInView ) + { + if ( surf->isActive() ) + { + surf->surfacePartMgr()->updateNativeSurfaceColors(); + } + } +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +bool RimEnsembleSurfaceInView::hasAnyActiveSeparateResults() +{ + if ( !this->isChecked() ) return false; + + for ( RimSurfaceInView* surf : m_surfacesInView ) + { + if ( surf->isActive() && surf->activeSeparateResultDefinition() && + surf->activeSeparateResultDefinition()->hasResult() ) + { + return true; + } + } + + return false; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimEnsembleSurfaceInView::updateLegendRangesTextAndVisibility( RiuViewer* nativeOrOverrideViewer, + bool isUsingOverrideViewer ) +{ + for ( RimSurfaceInView* surf : m_surfacesInView ) + { + surf->updateLegendRangesTextAndVisibility( nativeOrOverrideViewer, isUsingOverrideViewer ); + } +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +std::vector RimEnsembleSurfaceInView::legendConfigs() +{ + std::vector configs; + + for ( RimSurfaceInView* surf : m_surfacesInView ) + { + if ( surf->isActive() && surf->surfaceResultDefinition() ) + { + configs.push_back( surf->surfaceResultDefinition()->legendConfig() ); + } + } + + return configs; +} diff --git a/ApplicationLibCode/ProjectDataModel/Surfaces/RimEnsembleSurfaceInView.h b/ApplicationLibCode/ProjectDataModel/Surfaces/RimEnsembleSurfaceInView.h new file mode 100644 index 0000000000..575d42295b --- /dev/null +++ b/ApplicationLibCode/ProjectDataModel/Surfaces/RimEnsembleSurfaceInView.h @@ -0,0 +1,86 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2021- Equinor ASA +// +// ResInsight is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// +#pragma once + +#include "RimCheckableNamedObject.h" + +#include "cafPdmChildArrayField.h" +#include "cafPdmField.h" +#include "cafPdmObject.h" +#include "cafPdmProxyValueField.h" +#include "cafPdmPtrField.h" + +namespace cvf +{ +class ModelBasicList; +class Transform; +class ScalarMapper; +} // namespace cvf + +class RimSurfaceInView; +class RimSurface; +class RimSurfaceCollection; +class RimEnsembleSurfaceInView; +class RimEnsembleSurface; +class RimRegularLegendConfig; +class RiuViewer; +class RivIntersectionGeometryGeneratorIF; + +class RimEnsembleSurfaceInView : public RimCheckableNamedObject +{ + CAF_PDM_HEADER_INIT; + +public: + RimEnsembleSurfaceInView(); + ~RimEnsembleSurfaceInView() override; + + QString name() const override; + + RimEnsembleSurface* ensembleSurface() const; + void setEnsembleSurface( RimEnsembleSurface* surfcoll ); + + void updateFromSurfaceCollection(); + void loadData(); + void clearGeometry(); + + void appendPartsToModel( cvf::ModelBasicList* surfaceVizModel, cvf::Transform* scaleTransform ); + void updateCellResultColor( bool hasGeneralCellResult, size_t timeStepIndex ); + void applySingleColorEffect(); + + bool hasAnyActiveSeparateResults(); + void updateLegendRangesTextAndVisibility( RiuViewer* nativeOrOverrideViewer, bool isUsingOverrideViewer ); + + std::vector legendConfigs(); + + void updateAllViewItems(); + +protected: + void initAfterRead() override; + caf::PdmFieldHandle* userDescriptionField() override; + +private: + void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) override; + + RimSurfaceInView* getSurfaceInViewForSurface( const RimSurface* surf ) const; + + void syncSurfacesWithView(); + + caf::PdmProxyValueField m_ensembleSurfaceName; + caf::PdmChildArrayField m_surfacesInView; + caf::PdmPtrField m_ensembleSurface; +}; diff --git a/ApplicationLibCode/ProjectDataModel/Surfaces/RimGridCaseSurface.cpp b/ApplicationLibCode/ProjectDataModel/Surfaces/RimGridCaseSurface.cpp index 4fb06c4875..690b5a52dd 100644 --- a/ApplicationLibCode/ProjectDataModel/Surfaces/RimGridCaseSurface.cpp +++ b/ApplicationLibCode/ProjectDataModel/Surfaces/RimGridCaseSurface.cpp @@ -18,17 +18,19 @@ #include "RimGridCaseSurface.h" +#include "RigMainGrid.h" +#include "RigReservoirGridTools.h" #include "RigSurface.h" -#include "RigMainGrid.h" #include "RimCase.h" #include "RimEclipseCase.h" #include "RimSurfaceCollection.h" #include "RimTools.h" +#include "cafPdmFieldScriptingCapability.h" +#include "cafPdmObjectScriptingCapability.h" #include "cafPdmUiSliderEditor.h" -#include "RigReservoirGridTools.h" #include "cvfVector3.h" CAF_PDM_SOURCE_INIT( RimGridCaseSurface, "GridCaseSurface" ); @@ -38,11 +40,11 @@ CAF_PDM_SOURCE_INIT( RimGridCaseSurface, "GridCaseSurface" ); //-------------------------------------------------------------------------------------------------- RimGridCaseSurface::RimGridCaseSurface() { - CAF_PDM_InitObject( "Surface", ":/ReservoirSurface16x16.png", "", "" ); + CAF_PDM_InitScriptableObject( "Surface", ":/ReservoirSurface16x16.png", "", "" ); - CAF_PDM_InitFieldNoDefault( &m_case, "SourceCase", "Source Case", "", "", "" ); + CAF_PDM_InitScriptableFieldNoDefault( &m_case, "SourceCase", "Source Case", "", "", "" ); - CAF_PDM_InitField( &m_oneBasedSliceIndex, "SliceIndex", 1, "Slice Index (K)", "", "", "" ); + CAF_PDM_InitScriptableField( &m_oneBasedSliceIndex, "SliceIndex", 1, "Slice Index (K)", "", "", "" ); m_oneBasedSliceIndex.uiCapability()->setUiEditorTypeName( caf::PdmUiSliderEditor::uiEditorTypeName() ); } diff --git a/ApplicationLibCode/ProjectDataModel/Surfaces/RimSurface.h b/ApplicationLibCode/ProjectDataModel/Surfaces/RimSurface.h index a1a8c801e1..6f48941bad 100644 --- a/ApplicationLibCode/ProjectDataModel/Surfaces/RimSurface.h +++ b/ApplicationLibCode/ProjectDataModel/Surfaces/RimSurface.h @@ -71,11 +71,12 @@ class RimSurface : public caf::PdmObject virtual bool updateSurfaceData() = 0; virtual void clearCachedNativeData() = 0; +protected: + cvf::ref m_surfaceData; + private: caf::PdmField m_userDescription; caf::PdmField m_color; caf::PdmField m_depthOffset; caf::PdmProxyValueField m_nameProxy; - - cvf::ref m_surfaceData; }; diff --git a/ApplicationLibCode/ProjectDataModel/Surfaces/RimSurfaceCollection.cpp b/ApplicationLibCode/ProjectDataModel/Surfaces/RimSurfaceCollection.cpp index aa50132ff3..82368fba9d 100644 --- a/ApplicationLibCode/ProjectDataModel/Surfaces/RimSurfaceCollection.cpp +++ b/ApplicationLibCode/ProjectDataModel/Surfaces/RimSurfaceCollection.cpp @@ -21,6 +21,7 @@ #include "RiaColorTables.h" #include "RiaLogging.h" +#include "RimEnsembleSurface.h" #include "RimFileSurface.h" #include "RimGridCaseSurface.h" #include "RimGridView.h" @@ -57,6 +58,9 @@ RimSurfaceCollection::RimSurfaceCollection() CAF_PDM_InitScriptableFieldNoDefault( &m_surfaces, "SurfacesField", "Surfaces", "", "", "" ); m_surfaces.uiCapability()->setUiTreeHidden( true ); + CAF_PDM_InitScriptableFieldNoDefault( &m_ensembleSurfaces, "EnsembleSurfaces", "Ensemble Surfaces", "", "", "" ); + m_ensembleSurfaces.uiCapability()->setUiTreeHidden( true ); + setDeletable( true ); } @@ -108,6 +112,14 @@ void RimSurfaceCollection::addSurface( RimSurface* surface ) m_surfaces.push_back( surface ); } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimSurfaceCollection::addEnsembleSurface( RimEnsembleSurface* ensembleSurface ) +{ + m_ensembleSurfaces.push_back( ensembleSurface ); +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- @@ -212,13 +224,11 @@ RimSurface* RimSurfaceCollection::copySurfaces( std::vector surface //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -RimSurface* RimSurfaceCollection::addGridCaseSurface( RimCase* sourceCase ) +RimSurface* RimSurfaceCollection::addGridCaseSurface( RimCase* sourceCase, int oneBasedSliceIndex ) { auto s = new RimGridCaseSurface; s->setCase( sourceCase ); - int oneBasedSliceIndex = 1; - s->setOneBasedIndex( oneBasedSliceIndex ); s->setUserDescription( "Surface" ); @@ -255,6 +265,14 @@ std::vector RimSurfaceCollection::subCollections() const return m_subCollections.childObjects(); } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +std::vector RimSurfaceCollection::ensembleSurfaces() const +{ + return m_ensembleSurfaces.childObjects(); +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- @@ -264,6 +282,11 @@ void RimSurfaceCollection::loadData() { surf->loadDataIfRequired(); } + + for ( auto ensSurf : m_ensembleSurfaces ) + { + ensSurf->loadDataAndUpdate(); + } } //-------------------------------------------------------------------------------------------------- @@ -477,6 +500,12 @@ bool RimSurfaceCollection::containsSurface() { containsSurface |= coll->containsSurface(); } + + for ( auto ensSurf : m_ensembleSurfaces ) + { + containsSurface |= ( ensSurf->surfaces().size() > 0 ); + } + return containsSurface; } diff --git a/ApplicationLibCode/ProjectDataModel/Surfaces/RimSurfaceCollection.h b/ApplicationLibCode/ProjectDataModel/Surfaces/RimSurfaceCollection.h index 214a59020d..c365e2d45d 100644 --- a/ApplicationLibCode/ProjectDataModel/Surfaces/RimSurfaceCollection.h +++ b/ApplicationLibCode/ProjectDataModel/Surfaces/RimSurfaceCollection.h @@ -23,6 +23,7 @@ #include "cafPdmObject.h" class RimSurface; +class RimEnsembleSurface; class RimCase; class RimSurfaceCollection : public caf::PdmObject @@ -36,8 +37,10 @@ class RimSurfaceCollection : public caf::PdmObject void addSurface( RimSurface* surface ); void setAsTopmostFolder(); + void addEnsembleSurface( RimEnsembleSurface* ensembleSurface ); + RimSurface* importSurfacesFromFiles( const QStringList& fileNames, bool showLegend = true ); - RimSurface* addGridCaseSurface( RimCase* sourceCase ); + RimSurface* addGridCaseSurface( RimCase* sourceCase, int oneBasedSliceIndex = 1 ); RimSurface* copySurfaces( std::vector surfaces ); RimSurface* addSurfacesAtIndex( int index, std::vector surfaces ); @@ -64,6 +67,7 @@ class RimSurfaceCollection : public caf::PdmObject std::vector surfaces() const; std::vector subCollections() const; + std::vector ensembleSurfaces() const; protected: caf::PdmFieldHandle* userDescriptionField() override; @@ -74,4 +78,5 @@ class RimSurfaceCollection : public caf::PdmObject caf::PdmField m_collectionName; caf::PdmChildArrayField m_surfaces; caf::PdmChildArrayField m_subCollections; + caf::PdmChildArrayField m_ensembleSurfaces; }; diff --git a/ApplicationLibCode/ProjectDataModel/Surfaces/RimSurfaceInViewCollection.cpp b/ApplicationLibCode/ProjectDataModel/Surfaces/RimSurfaceInViewCollection.cpp index 7ffd524164..efbe90aa38 100644 --- a/ApplicationLibCode/ProjectDataModel/Surfaces/RimSurfaceInViewCollection.cpp +++ b/ApplicationLibCode/ProjectDataModel/Surfaces/RimSurfaceInViewCollection.cpp @@ -18,6 +18,7 @@ #include "RimSurfaceInViewCollection.h" +#include "RimEnsembleSurfaceInView.h" #include "RimGridView.h" #include "RimIntersectionResultDefinition.h" #include "RimOilField.h" @@ -56,6 +57,9 @@ RimSurfaceInViewCollection::RimSurfaceInViewCollection() CAF_PDM_InitFieldNoDefault( &m_surfacesInView, "SurfacesInViewField", "SurfacesInViewField", "", "", "" ); m_surfacesInView.uiCapability()->setUiTreeHidden( true ); + CAF_PDM_InitFieldNoDefault( &m_ensembleSurfacesInView, "EnsemblesSurfacesInView", "EnsembleSurfacesInView", "", "", "" ); + m_ensembleSurfacesInView.uiCapability()->setUiTreeHidden( true ); + CAF_PDM_InitFieldNoDefault( &m_surfaceCollection, "SurfaceCollectionRef", "SurfaceCollection", "", "", "" ); m_surfaceCollection.uiCapability()->setUiHidden( true ); @@ -109,6 +113,7 @@ void RimSurfaceInViewCollection::setSurfaceCollection( RimSurfaceCollection* sur void RimSurfaceInViewCollection::updateAllViewItems() { syncCollectionsWithView(); + syncEnsembleSurfacesWithView(); syncSurfacesWithView(); updateConnectedEditors(); } @@ -163,6 +168,56 @@ void RimSurfaceInViewCollection::syncCollectionsWithView() } } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimSurfaceInViewCollection::syncEnsembleSurfacesWithView() +{ + // check that we have ensemble in view collectinons + std::vector ensembleSurfaces = m_ensembleSurfacesInView.childObjects(); + + for ( auto ensembleSurface : ensembleSurfaces ) + { + if ( !ensembleSurface->ensembleSurface() ) + { + m_ensembleSurfacesInView.removeChildObject( ensembleSurface ); + delete ensembleSurface; + } + } + + // Create new collection entries and reorder + std::vector orderedEnsembleSurfaces; + if ( m_surfaceCollection ) + { + // pick up the collections and the order from the surface collection + std::vector ensSurfs = m_surfaceCollection->ensembleSurfaces(); + for ( auto ensSurf : ensSurfs ) + { + // check if this is a collection we need to create + + RimEnsembleSurfaceInView* ensembleSurfaceInView = this->getEnsembleSurfaceInViewForEnsembleSurface( ensSurf ); + if ( ensembleSurfaceInView == nullptr ) + { + RimEnsembleSurfaceInView* newColl = new RimEnsembleSurfaceInView(); + newColl->setEnsembleSurface( ensSurf ); + orderedEnsembleSurfaces.push_back( newColl ); + } + else + { + orderedEnsembleSurfaces.push_back( ensembleSurfaceInView ); + } + } + + // make sure our view surfaces have the same order as the source surface collection + m_ensembleSurfacesInView.clear(); + for ( auto ensSurf : orderedEnsembleSurfaces ) + { + m_ensembleSurfacesInView.push_back( ensSurf ); + ensSurf->updateAllViewItems(); + } + } +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- @@ -231,6 +286,11 @@ void RimSurfaceInViewCollection::loadData() coll->loadData(); } + for ( RimEnsembleSurfaceInView* ensSurf : m_ensembleSurfacesInView ) + { + ensSurf->loadData(); + } + for ( RimSurfaceInView* surf : m_surfacesInView ) { if ( surf->isActive() ) @@ -250,6 +310,11 @@ void RimSurfaceInViewCollection::clearGeometry() coll->clearGeometry(); } + for ( RimEnsembleSurfaceInView* ensSurf : m_ensembleSurfacesInView ) + { + ensSurf->clearGeometry(); + } + for ( RimSurfaceInView* surf : m_surfacesInView ) { surf->clearGeometry(); @@ -271,6 +336,14 @@ void RimSurfaceInViewCollection::appendPartsToModel( cvf::ModelBasicList* model, } } + for ( RimEnsembleSurfaceInView* ensSurf : m_ensembleSurfacesInView ) + { + if ( ensSurf->isChecked() ) + { + ensSurf->appendPartsToModel( model, scaleTransform ); + } + } + for ( RimSurfaceInView* surf : m_surfacesInView ) { if ( surf->isActive() ) @@ -340,6 +413,23 @@ RimSurfaceInViewCollection* return nullptr; } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RimEnsembleSurfaceInView* + RimSurfaceInViewCollection::getEnsembleSurfaceInViewForEnsembleSurface( const RimEnsembleSurface* coll ) const +{ + for ( auto collInView : m_ensembleSurfacesInView ) + { + if ( collInView->ensembleSurface() == coll ) + { + return collInView; + } + } + + return nullptr; +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationLibCode/ProjectDataModel/Surfaces/RimSurfaceInViewCollection.h b/ApplicationLibCode/ProjectDataModel/Surfaces/RimSurfaceInViewCollection.h index c793a183ce..213ebb73e5 100644 --- a/ApplicationLibCode/ProjectDataModel/Surfaces/RimSurfaceInViewCollection.h +++ b/ApplicationLibCode/ProjectDataModel/Surfaces/RimSurfaceInViewCollection.h @@ -35,6 +35,8 @@ class ScalarMapper; class RimSurfaceInView; class RimSurface; class RimSurfaceCollection; +class RimEnsembleSurfaceInView; +class RimEnsembleSurface; class RimRegularLegendConfig; class RiuViewer; class RivIntersectionGeometryGeneratorIF; @@ -76,13 +78,17 @@ class RimSurfaceInViewCollection : public RimCheckableNamedObject RimSurfaceInView* getSurfaceInViewForSurface( const RimSurface* surf ) const; RimSurfaceInViewCollection* getCollectionInViewForCollection( const RimSurfaceCollection* coll ) const; + RimEnsembleSurfaceInView* getEnsembleSurfaceInViewForEnsembleSurface( const RimEnsembleSurface* coll ) const; void updateAllViewItems(); void syncCollectionsWithView(); void syncSurfacesWithView(); + void syncEnsembleSurfacesWithView(); caf::PdmProxyValueField m_collectionName; caf::PdmChildArrayField m_collectionsInView; caf::PdmChildArrayField m_surfacesInView; - caf::PdmPtrField m_surfaceCollection; + caf::PdmChildArrayField m_ensembleSurfacesInView; + + caf::PdmPtrField m_surfaceCollection; }; diff --git a/ApplicationLibCode/ProjectDataModelCommands/CMakeLists_files.cmake b/ApplicationLibCode/ProjectDataModelCommands/CMakeLists_files.cmake index 546396ba21..d340eae577 100644 --- a/ApplicationLibCode/ProjectDataModelCommands/CMakeLists_files.cmake +++ b/ApplicationLibCode/ProjectDataModelCommands/CMakeLists_files.cmake @@ -10,6 +10,7 @@ ${CMAKE_CURRENT_LIST_DIR}/RimcStimPlanModelTemplateCollection.h ${CMAKE_CURRENT_LIST_DIR}/RimcStimPlanModelPlotCollection.h ${CMAKE_CURRENT_LIST_DIR}/RimcStimPlanModel.h ${CMAKE_CURRENT_LIST_DIR}/RimcSurfaceCollection.h +${CMAKE_CURRENT_LIST_DIR}/RimcSurface.h ${CMAKE_CURRENT_LIST_DIR}/RimcDataContainerDouble.h ${CMAKE_CURRENT_LIST_DIR}/RimcDataContainerString.h ${CMAKE_CURRENT_LIST_DIR}/RimcDataContainerTime.h @@ -31,6 +32,7 @@ ${CMAKE_CURRENT_LIST_DIR}/RimcStimPlanModelTemplateCollection.cpp ${CMAKE_CURRENT_LIST_DIR}/RimcStimPlanModelPlotCollection.cpp ${CMAKE_CURRENT_LIST_DIR}/RimcStimPlanModel.cpp ${CMAKE_CURRENT_LIST_DIR}/RimcSurfaceCollection.cpp +${CMAKE_CURRENT_LIST_DIR}/RimcSurface.cpp ${CMAKE_CURRENT_LIST_DIR}/RimcDataContainerDouble.cpp ${CMAKE_CURRENT_LIST_DIR}/RimcDataContainerString.cpp ${CMAKE_CURRENT_LIST_DIR}/RimcDataContainerTime.cpp diff --git a/ApplicationLibCode/ProjectDataModelCommands/RimcSurface.cpp b/ApplicationLibCode/ProjectDataModelCommands/RimcSurface.cpp new file mode 100644 index 0000000000..32e3b17ed0 --- /dev/null +++ b/ApplicationLibCode/ProjectDataModelCommands/RimcSurface.cpp @@ -0,0 +1,91 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2021- Equinor ASA +// +// ResInsight is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// +#include "RimcSurface.h" + +#include "RimCase.h" +#include "RimSurface.h" +#include "RimcDataContainerString.h" + +#include "RigSurface.h" + +#include "RifSurfaceExporter.h" + +#include "cafPdmFieldScriptingCapability.h" +#include "cafPdmObjectScriptingCapability.h" + +#include + +CAF_PDM_OBJECT_METHOD_SOURCE_INIT( RimSurface, RimcSurface_exportToFile, "ExportToFile" ); + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RimcSurface_exportToFile::RimcSurface_exportToFile( caf::PdmObjectHandle* self ) + : caf::PdmObjectMethod( self ) +{ + CAF_PDM_InitObject( "Export Surface To fiole", "", "", "Export a surface to file" ); + CAF_PDM_InitScriptableFieldNoDefault( &m_fileName, "FileName", "", "", "", "Filename to export surface to" ); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +caf::PdmObjectHandle* RimcSurface_exportToFile::execute() +{ + RimSurface* surface = self(); + + auto dataObject = new RimcDataContainerString(); + + if ( surface ) + { + RigSurface* surfaceData = surface->surfaceData(); + + RifSurfaceExporter::writeGocadTSurfFile( m_fileName(), + surface->userDescription(), + surfaceData->vertices(), + surfaceData->triangleIndices() ); + + dataObject->m_stringValues = { m_fileName() }; + } + + return dataObject; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +bool RimcSurface_exportToFile::resultIsPersistent() const +{ + return false; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +std::unique_ptr RimcSurface_exportToFile::defaultResult() const +{ + return std::unique_ptr( new RimcDataContainerString() ); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +bool RimcSurface_exportToFile::isNullptrValidResult() const +{ + return true; +} diff --git a/ApplicationLibCode/ProjectDataModelCommands/RimcSurface.h b/ApplicationLibCode/ProjectDataModelCommands/RimcSurface.h new file mode 100644 index 0000000000..a8c9fbff6c --- /dev/null +++ b/ApplicationLibCode/ProjectDataModelCommands/RimcSurface.h @@ -0,0 +1,48 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2021- Equinor ASA +// +// ResInsight is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// + +#pragma once + +#include "RimSurface.h" + +#include "cafPdmField.h" +#include "cafPdmObjectHandle.h" +#include "cafPdmObjectMethod.h" + +#include + +#include + +//================================================================================================== +/// +//================================================================================================== +class RimcSurface_exportToFile : public caf::PdmObjectMethod +{ + CAF_PDM_HEADER_INIT; + +public: + RimcSurface_exportToFile( caf::PdmObjectHandle* self ); + + caf::PdmObjectHandle* execute() override; + bool resultIsPersistent() const override; + std::unique_ptr defaultResult() const override; + bool isNullptrValidResult() const override; + +private: + caf::PdmField m_fileName; +}; diff --git a/ApplicationLibCode/ProjectDataModelCommands/RimcSurfaceCollection.cpp b/ApplicationLibCode/ProjectDataModelCommands/RimcSurfaceCollection.cpp index 1913e4a010..16985c5482 100644 --- a/ApplicationLibCode/ProjectDataModelCommands/RimcSurfaceCollection.cpp +++ b/ApplicationLibCode/ProjectDataModelCommands/RimcSurfaceCollection.cpp @@ -19,7 +19,9 @@ #include "SurfaceCommands/RicImportSurfacesFeature.h" +#include "RimCase.h" #include "RimFileSurface.h" +#include "RimGridCaseSurface.h" #include "RimSurface.h" #include "RimSurfaceCollection.h" @@ -30,6 +32,7 @@ CAF_PDM_OBJECT_METHOD_SOURCE_INIT( RimSurfaceCollection, RimcSurfaceCollection_importSurface, "ImportSurface" ); CAF_PDM_OBJECT_METHOD_SOURCE_INIT( RimSurfaceCollection, RimcSurfaceCollection_addFolder, "AddFolder" ); +CAF_PDM_OBJECT_METHOD_SOURCE_INIT( RimSurfaceCollection, RimcSurfaceCollection_newSurface, "NewSurface" ); //-------------------------------------------------------------------------------------------------- /// @@ -130,3 +133,52 @@ bool RimcSurfaceCollection_addFolder::isNullptrValidResult() const { return true; } + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RimcSurfaceCollection_newSurface::RimcSurfaceCollection_newSurface( caf::PdmObjectHandle* self ) + : caf::PdmObjectMethod( self ) +{ + CAF_PDM_InitObject( "New Surface", "", "", "Create a new surface" ); + CAF_PDM_InitScriptableFieldNoDefault( &m_case, "Case", "", "", "", "" ); + CAF_PDM_InitScriptableFieldNoDefault( &m_kIndex, "KIndex", "", "", "", "" ); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +caf::PdmObjectHandle* RimcSurfaceCollection_newSurface::execute() +{ + RimSurfaceCollection* coll = self(); + if ( coll && m_case ) + { + RimSurface* surface = coll->addGridCaseSurface( m_case(), m_kIndex ); + return surface; + } + return nullptr; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +bool RimcSurfaceCollection_newSurface::resultIsPersistent() const +{ + return true; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +std::unique_ptr RimcSurfaceCollection_newSurface::defaultResult() const +{ + return std::unique_ptr( new RimGridCaseSurface ); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +bool RimcSurfaceCollection_newSurface::isNullptrValidResult() const +{ + return true; +} diff --git a/ApplicationLibCode/ProjectDataModelCommands/RimcSurfaceCollection.h b/ApplicationLibCode/ProjectDataModelCommands/RimcSurfaceCollection.h index beb46bbe4c..40e4b5f0ff 100644 --- a/ApplicationLibCode/ProjectDataModelCommands/RimcSurfaceCollection.h +++ b/ApplicationLibCode/ProjectDataModelCommands/RimcSurfaceCollection.h @@ -32,6 +32,7 @@ class RimSurface; class RimSurfaceCollection; +class RimCase; //================================================================================================== /// @@ -70,3 +71,23 @@ class RimcSurfaceCollection_addFolder : public caf::PdmObjectMethod private: caf::PdmField m_folderName; }; + +//================================================================================================== +/// +//================================================================================================== +class RimcSurfaceCollection_newSurface : public caf::PdmObjectMethod +{ + CAF_PDM_HEADER_INIT; + +public: + RimcSurfaceCollection_newSurface( caf::PdmObjectHandle* self ); + + caf::PdmObjectHandle* execute() override; + bool resultIsPersistent() const override; + std::unique_ptr defaultResult() const override; + bool isNullptrValidResult() const override; + +private: + caf::PdmPtrField m_case; + caf::PdmField m_kIndex; +}; diff --git a/ApplicationLibCode/ReservoirDataModel/CMakeLists_files.cmake b/ApplicationLibCode/ReservoirDataModel/CMakeLists_files.cmake index f7b11636ff..52ee882db0 100644 --- a/ApplicationLibCode/ReservoirDataModel/CMakeLists_files.cmake +++ b/ApplicationLibCode/ReservoirDataModel/CMakeLists_files.cmake @@ -89,6 +89,8 @@ ${CMAKE_CURRENT_LIST_DIR}/RigTracer.h ${CMAKE_CURRENT_LIST_DIR}/RigStimPlanModelTools.h ${CMAKE_CURRENT_LIST_DIR}/RigSlice2D.h ${CMAKE_CURRENT_LIST_DIR}/RigEnsembleParameter.h +${CMAKE_CURRENT_LIST_DIR}/RigSurfaceResampler.h +${CMAKE_CURRENT_LIST_DIR}/RigSurfaceStatisticsCalculator.h ) @@ -175,6 +177,8 @@ ${CMAKE_CURRENT_LIST_DIR}/RigTracer.cpp ${CMAKE_CURRENT_LIST_DIR}/RigStimPlanModelTools.cpp ${CMAKE_CURRENT_LIST_DIR}/RigSlice2D.cpp ${CMAKE_CURRENT_LIST_DIR}/RigEnsembleParameter.cpp +${CMAKE_CURRENT_LIST_DIR}/RigSurfaceResampler.cpp +${CMAKE_CURRENT_LIST_DIR}/RigSurfaceStatisticsCalculator.cpp ) list(APPEND CODE_HEADER_FILES diff --git a/ApplicationLibCode/ReservoirDataModel/RigSurface.cpp b/ApplicationLibCode/ReservoirDataModel/RigSurface.cpp index fcce78b08f..a9208aafce 100644 --- a/ApplicationLibCode/ReservoirDataModel/RigSurface.cpp +++ b/ApplicationLibCode/ReservoirDataModel/RigSurface.cpp @@ -34,7 +34,7 @@ RigSurface::~RigSurface() //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -const std::vector& RigSurface::triangleIndices() +const std::vector& RigSurface::triangleIndices() const { return m_triangleIndices; } @@ -42,7 +42,7 @@ const std::vector& RigSurface::triangleIndices() //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -const std::vector& RigSurface::vertices() +const std::vector& RigSurface::vertices() const { return m_vertices; } diff --git a/ApplicationLibCode/ReservoirDataModel/RigSurface.h b/ApplicationLibCode/ReservoirDataModel/RigSurface.h index 72a4a3225a..c41963c717 100644 --- a/ApplicationLibCode/ReservoirDataModel/RigSurface.h +++ b/ApplicationLibCode/ReservoirDataModel/RigSurface.h @@ -31,8 +31,8 @@ class RigSurface : public cvf::Object RigSurface(); ~RigSurface() override; - const std::vector& triangleIndices(); - const std::vector& vertices(); + const std::vector& triangleIndices() const; + const std::vector& vertices() const; void setTriangleData( const std::vector& tringleIndices, const std::vector& vertices ); void addVerticeResult( const QString resultName, const std::vector& resultValues ); diff --git a/ApplicationLibCode/ReservoirDataModel/RigSurfaceResampler.cpp b/ApplicationLibCode/ReservoirDataModel/RigSurfaceResampler.cpp new file mode 100644 index 0000000000..377f98e6d9 --- /dev/null +++ b/ApplicationLibCode/ReservoirDataModel/RigSurfaceResampler.cpp @@ -0,0 +1,119 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2021- Equinor ASA +// +// ResInsight is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// +#include "RigSurfaceResampler.h" + +#include "cvfGeometryTools.h" + +#include "cvfObject.h" +#include + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +cvf::ref RigSurfaceResampler::resampleSurface( cvf::ref targetSurface, cvf::ref surface ) +{ + cvf::ref resampledSurface = cvf::make_ref(); + + const std::vector& targetVerts = targetSurface->vertices(); + const std::vector& targetIndices = targetSurface->triangleIndices(); + + std::vector resampledVerts; + + for ( auto targetVert : targetVerts ) + { + cvf::Vec3d pointAbove = cvf::Vec3d( targetVert.x(), targetVert.y(), 10000.0 ); + cvf::Vec3d pointBelow = cvf::Vec3d( targetVert.x(), targetVert.y(), -10000.0 ); + + cvf::Vec3d intersectionPoint; + bool foundMatch = + resamplePoint( pointAbove, pointBelow, surface->triangleIndices(), surface->vertices(), intersectionPoint ); + if ( !foundMatch ) + intersectionPoint = cvf::Vec3d( targetVert.x(), targetVert.y(), std::numeric_limits::infinity() ); + + resampledVerts.push_back( intersectionPoint ); + } + + resampledSurface->setTriangleData( targetIndices, resampledVerts ); + + return resampledSurface; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +bool RigSurfaceResampler::resamplePoint( const cvf::Vec3d& pointAbove, + const cvf::Vec3d& pointBelow, + const std::vector& indices, + const std::vector& vertices, + cvf::Vec3d& intersectionPoint ) +{ + for ( size_t i = 0; i < indices.size(); i += 3 ) + { + bool isLineDirDotNormalNegative = false; + if ( cvf::GeometryTools::intersectLineSegmentTriangle( pointAbove, + pointBelow, + vertices[indices[i]], + vertices[indices[i + 1]], + vertices[indices[i + 2]], + &intersectionPoint, + &isLineDirDotNormalNegative ) == 1 ) + return true; + } + + // Handle cases where no match is found due to floating point imprecision, + // or when falling off resulting grid slightly. + double maxDistance = 10.0; + return findClosestPointXY( pointAbove, vertices, maxDistance, intersectionPoint ); +} + +//-------------------------------------------------------------------------------------------------- +/// Find the closest vertex to targetPoint (must be closer than maxDistance) in XY plane. +/// Unit maxDistance: meter. +//-------------------------------------------------------------------------------------------------- +bool RigSurfaceResampler::findClosestPointXY( const cvf::Vec3d& targetPoint, + const std::vector& vertices, + double maxDistance, + cvf::Vec3d& intersectionPoint ) +{ + // Find closest vertices + double shortestDistance = std::numeric_limits::max(); + double closestZ = std::numeric_limits::infinity(); + for ( auto v : vertices ) + { + // Ignore height (z) component when finding closest by + // moving point to same height as target point above + cvf::Vec3d p( v.x(), v.y(), targetPoint.z() ); + double distance = p.pointDistance( targetPoint ); + if ( distance < shortestDistance ) + { + shortestDistance = distance; + closestZ = v.z(); + } + } + + // Check if the closest point is not to far away to be valid + if ( shortestDistance < maxDistance ) + { + intersectionPoint = cvf::Vec3d( targetPoint.x(), targetPoint.y(), closestZ ); + return true; + } + else + { + return false; + } +} diff --git a/ApplicationLibCode/ReservoirDataModel/RigSurfaceResampler.h b/ApplicationLibCode/ReservoirDataModel/RigSurfaceResampler.h new file mode 100644 index 0000000000..19b8df641f --- /dev/null +++ b/ApplicationLibCode/ReservoirDataModel/RigSurfaceResampler.h @@ -0,0 +1,43 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2021- Equinor ASA +// +// ResInsight is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// +#pragma once + +#include "RigSurface.h" + +#include "cvfObject.h" + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +class RigSurfaceResampler +{ +public: + static cvf::ref resampleSurface( cvf::ref targetSurface, cvf::ref surface ); + + static bool resamplePoint( const cvf::Vec3d& pointAbove, + const cvf::Vec3d& pointBelow, + const std::vector& indices, + const std::vector& vertices, + cvf::Vec3d& intersectionPoint ); + +private: + static bool findClosestPointXY( const cvf::Vec3d& targetPoint, + const std::vector& vertices, + double maxDistance, + cvf::Vec3d& intersectionPoint ); +}; diff --git a/ApplicationLibCode/ReservoirDataModel/RigSurfaceStatisticsCalculator.cpp b/ApplicationLibCode/ReservoirDataModel/RigSurfaceStatisticsCalculator.cpp new file mode 100644 index 0000000000..479086b0c7 --- /dev/null +++ b/ApplicationLibCode/ReservoirDataModel/RigSurfaceStatisticsCalculator.cpp @@ -0,0 +1,129 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2021 Equinor ASA +// +// ResInsight is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// + +#include "RigSurfaceStatisticsCalculator.h" + +#include "RigStatisticsMath.h" + +#include "cafAppEnum.h" +#include "cafAssert.h" + +#include "cvfObject.h" + +#include + +namespace caf +{ +template <> +void caf::AppEnum::setUp() +{ + addItem( RigSurfaceStatisticsCalculator::StatisticsType::MEAN, "MEAN", "Mean" ); + addItem( RigSurfaceStatisticsCalculator::StatisticsType::MIN, "MIN", "Minimum" ); + addItem( RigSurfaceStatisticsCalculator::StatisticsType::MAX, "MAX", "Maximum" ); + addItem( RigSurfaceStatisticsCalculator::StatisticsType::P10, "P10", "P10" ); + addItem( RigSurfaceStatisticsCalculator::StatisticsType::P50, "P50", "P50" ); + addItem( RigSurfaceStatisticsCalculator::StatisticsType::P90, "P90", "P90" ); + setDefault( RigSurfaceStatisticsCalculator::StatisticsType::MEAN ); +} +}; // namespace caf + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +cvf::ref RigSurfaceStatisticsCalculator::computeStatistics( const std::vector>& surfaces ) +{ + // Need at least one surface to generate statistics + if ( surfaces.empty() ) return nullptr; + + // Check that the size of all the surfaces are the same + if ( !areSurfacesSameSize( surfaces ) ) return nullptr; + + size_t vecSize = surfaces[0]->vertices().size(); + + std::vector meanValues( vecSize, std::numeric_limits::infinity() ); + std::vector minValues( vecSize, std::numeric_limits::infinity() ); + std::vector maxValues( vecSize, std::numeric_limits::infinity() ); + std::vector p10Values( vecSize, std::numeric_limits::infinity() ); + std::vector p50Values( vecSize, std::numeric_limits::infinity() ); + std::vector p90Values( vecSize, std::numeric_limits::infinity() ); + + for ( size_t i = 0; i < vecSize; i++ ) + { + std::vector samples; + for ( auto surface : surfaces ) + { + double z = surface->vertices()[i].z(); + samples.push_back( z ); + } + + double min; + double max; + double sum; + double range; + double mean; + double dev; + RigStatisticsMath::calculateBasicStatistics( samples, &min, &max, &sum, &range, &mean, &dev ); + + double p10; + double p50; + double p90; + RigStatisticsMath::calculateStatisticsCurves( samples, &p10, &p50, &p90, &mean ); + + // TODO: improve handling of these cases + auto makeValid = []( double val ) { + if ( std::isinf( val ) || std::isnan( val ) ) return 0.0; + return val; + }; + + meanValues[i] = makeValid( mean ); + minValues[i] = makeValid( min ); + maxValues[i] = makeValid( max ); + p10Values[i] = makeValid( p10 ); + p50Values[i] = makeValid( p50 ); + p90Values[i] = makeValid( p90 ); + } + + cvf::ref statSurface = cvf::make_ref(); + statSurface->setTriangleData( surfaces[0]->triangleIndices(), surfaces[0]->vertices() ); + + auto enumToText = []( auto statisticsType ) { return caf::AppEnum::text( statisticsType ); }; + + statSurface->addVerticeResult( enumToText( StatisticsType::MEAN ), meanValues ); + statSurface->addVerticeResult( enumToText( StatisticsType::MIN ), minValues ); + statSurface->addVerticeResult( enumToText( StatisticsType::MAX ), maxValues ); + statSurface->addVerticeResult( enumToText( StatisticsType::P10 ), p10Values ); + statSurface->addVerticeResult( enumToText( StatisticsType::P50 ), p50Values ); + statSurface->addVerticeResult( enumToText( StatisticsType::P90 ), p90Values ); + + return statSurface; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +bool RigSurfaceStatisticsCalculator::areSurfacesSameSize( const std::vector>& surfaces ) +{ + CAF_ASSERT( !surfaces.empty() ); + + size_t vecSize = surfaces[0]->vertices().size(); + for ( auto surface : surfaces ) + { + if ( vecSize != surface->vertices().size() ) return false; + } + return true; +} diff --git a/ApplicationLibCode/ReservoirDataModel/RigSurfaceStatisticsCalculator.h b/ApplicationLibCode/ReservoirDataModel/RigSurfaceStatisticsCalculator.h new file mode 100644 index 0000000000..2cc3f8da62 --- /dev/null +++ b/ApplicationLibCode/ReservoirDataModel/RigSurfaceStatisticsCalculator.h @@ -0,0 +1,46 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2021 Equinor ASA +// +// ResInsight is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// + +#pragma once + +#include "RigSurface.h" + +#include "cvfObject.h" + +#include + +//================================================================================================== +/// +/// +//================================================================================================== +class RigSurfaceStatisticsCalculator +{ +public: + enum class StatisticsType + { + MIN, + MAX, + P10, + P50, + P90, + MEAN + }; + + static cvf::ref computeStatistics( const std::vector>& surfaces ); + static bool areSurfacesSameSize( const std::vector>& surfaces ); +}; diff --git a/ApplicationLibCode/ReservoirDataModel/cvfGeometryTools.cpp b/ApplicationLibCode/ReservoirDataModel/cvfGeometryTools.cpp index 1d61abf91f..16c77cff30 100644 --- a/ApplicationLibCode/ReservoirDataModel/cvfGeometryTools.cpp +++ b/ApplicationLibCode/ReservoirDataModel/cvfGeometryTools.cpp @@ -515,13 +515,13 @@ double GeometryTools::linePointSquareDist( const cvf::Vec3d& p1, const cvf::Vec3 // dot product (3D) which allows vector operations in arguments #define dot( u, v ) ( ( u ).x() * ( v ).x() + ( u ).y() * ( v ).y() + ( u ).z() * ( v ).z() ) -int GeometryTools::intersectLineSegmentTriangle( const cvf::Vec3d p0, - const cvf::Vec3d p1, - const cvf::Vec3d t0, - const cvf::Vec3d t1, - const cvf::Vec3d t2, - cvf::Vec3d* intersectionPoint, - bool* isLineDirDotNormalNegative ) +int GeometryTools::intersectLineSegmentTriangle( const cvf::Vec3d& p0, + const cvf::Vec3d& p1, + const cvf::Vec3d& t0, + const cvf::Vec3d& t1, + const cvf::Vec3d& t2, + cvf::Vec3d* intersectionPoint, + bool* isLineDirDotNormalNegative ) { CVF_TIGHT_ASSERT( intersectionPoint != nullptr ); CVF_TIGHT_ASSERT( isLineDirDotNormalNegative != nullptr ); diff --git a/ApplicationLibCode/ReservoirDataModel/cvfGeometryTools.h b/ApplicationLibCode/ReservoirDataModel/cvfGeometryTools.h index 80b1a8ff2a..87a641c2a8 100644 --- a/ApplicationLibCode/ReservoirDataModel/cvfGeometryTools.h +++ b/ApplicationLibCode/ReservoirDataModel/cvfGeometryTools.h @@ -47,13 +47,13 @@ class GeometryTools double* normalizedIntersection ); static double linePointSquareDist( const cvf::Vec3d& p1, const cvf::Vec3d& p2, const cvf::Vec3d& p3 ); - static int intersectLineSegmentTriangle( const cvf::Vec3d p0, - const cvf::Vec3d p1, - const cvf::Vec3d t0, - const cvf::Vec3d t1, - const cvf::Vec3d t2, - cvf::Vec3d* intersectionPoint, - bool* isLineDirDotNormalNegative ); + static int intersectLineSegmentTriangle( const cvf::Vec3d& p0, + const cvf::Vec3d& p1, + const cvf::Vec3d& t0, + const cvf::Vec3d& t1, + const cvf::Vec3d& t2, + cvf::Vec3d* intersectionPoint, + bool* isLineDirDotNormalNegative ); static cvf::Vec3d barycentricCoords( const cvf::Vec3d& t0, const cvf::Vec3d& t1, const cvf::Vec3d& t2, const cvf::Vec3d& p ); static cvf::Vec4d barycentricCoords( const cvf::Vec3d& v0, diff --git a/ApplicationLibCode/UnitTests/CMakeLists_files.cmake b/ApplicationLibCode/UnitTests/CMakeLists_files.cmake index b9ba75dac0..57bb5a6c76 100644 --- a/ApplicationLibCode/UnitTests/CMakeLists_files.cmake +++ b/ApplicationLibCode/UnitTests/CMakeLists_files.cmake @@ -77,6 +77,8 @@ ${CMAKE_CURRENT_LIST_DIR}/RigWellPathGeometryExporter-Test.cpp ${CMAKE_CURRENT_LIST_DIR}/RifStimPlanModelDeviationFrkExporter-Test.cpp ${CMAKE_CURRENT_LIST_DIR}/RifSummaryDataReader-Test.cpp ${CMAKE_CURRENT_LIST_DIR}/RigSlice2D-Test.cpp +${CMAKE_CURRENT_LIST_DIR}/RigSurfaceResampler-Test.cpp +${CMAKE_CURRENT_LIST_DIR}/RigSurfaceStatisticsCalculator-Test.cpp ) if (RESINSIGHT_ENABLE_GRPC) diff --git a/ApplicationLibCode/UnitTests/RigSurfaceResampler-Test.cpp b/ApplicationLibCode/UnitTests/RigSurfaceResampler-Test.cpp new file mode 100644 index 0000000000..5828ab9686 --- /dev/null +++ b/ApplicationLibCode/UnitTests/RigSurfaceResampler-Test.cpp @@ -0,0 +1,85 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2021 Equinor ASA +// +// ResInsight is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// + +#include "gtest/gtest.h" + +#include "RigSurfaceResampler.h" +#include "cvfObject.h" + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +TEST( RigSurfaceResamplerTests, sameFlatGeometry ) +{ + cvf::ref targetSurface = cvf::make_ref(); + cvf::ref surface = cvf::make_ref(); + + // Make single triangle, and assign to both surfaces + double z = 2.0; + std::vector vertices = { cvf::Vec3d( -1.0, -1.0, z ), cvf::Vec3d( 1.0, -1.0, z ), cvf::Vec3d( -1.0, 1.0, z ) }; + std::vector indices = { 2, 1, 0 }; + + targetSurface->setTriangleData( indices, vertices ); + surface->setTriangleData( indices, vertices ); + + cvf::ref resampledSurface = RigSurfaceResampler::resampleSurface( targetSurface, surface ); + + ASSERT_EQ( resampledSurface->triangleIndices().size(), targetSurface->triangleIndices().size() ); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +TEST( RigSurfaceResamplerTests, flatGeometryLargerSource ) +{ + cvf::ref targetSurface = cvf::make_ref(); + cvf::ref surface = cvf::make_ref(); + + // Make two triangle: target smaller than the surface + std::vector indices = { 2, 1, 0 }; + + std::vector targetVertices = { cvf::Vec3d( -1.0, -1.0, 1.0 ), + cvf::Vec3d( 1.0, -1.0, 1.0 ), + cvf::Vec3d( -1.0, 1.0, 1.0 ) }; + + targetSurface->setTriangleData( indices, targetVertices ); + + std::vector surfaceVertices = { cvf::Vec3d( -2.0, -2.0, 2.0 ), + cvf::Vec3d( 2.0, -2.0, 2.0 ), + cvf::Vec3d( -2.0, 2.0, 2.0 ) }; + + surface->setTriangleData( indices, surfaceVertices ); + + cvf::ref resampledSurface = RigSurfaceResampler::resampleSurface( targetSurface, surface ); + + ASSERT_EQ( resampledSurface->triangleIndices().size(), targetSurface->triangleIndices().size() ); + cvf::Vec3d r1 = resampledSurface->vertices()[0]; + ASSERT_EQ( r1.x(), -1.0 ); + ASSERT_EQ( r1.y(), -1.0 ); + ASSERT_EQ( r1.z(), 2.0 ); + + cvf::Vec3d r2 = resampledSurface->vertices()[1]; + ASSERT_EQ( r2.x(), 1.0 ); + ASSERT_EQ( r2.y(), -1.0 ); + ASSERT_EQ( r2.z(), 2.0 ); + + cvf::Vec3d r3 = resampledSurface->vertices()[2]; + ASSERT_EQ( r3.x(), -1.0 ); + ASSERT_EQ( r3.y(), 1.0 ); + ASSERT_EQ( r3.z(), 2.0 ); +} diff --git a/ApplicationLibCode/UnitTests/RigSurfaceStatisticsCalculator-Test.cpp b/ApplicationLibCode/UnitTests/RigSurfaceStatisticsCalculator-Test.cpp new file mode 100644 index 0000000000..1e9aa1d1e7 --- /dev/null +++ b/ApplicationLibCode/UnitTests/RigSurfaceStatisticsCalculator-Test.cpp @@ -0,0 +1,81 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2021 Equinor ASA +// +// ResInsight is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// + +#include "gtest/gtest.h" + +#include "RigSurface.h" +#include "RigSurfaceStatisticsCalculator.h" + +#include "cvfObject.h" + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +TEST( RigSurfaceStatisticsTests, computeStatistics ) +{ + std::vector> surfaces; + for ( size_t i = 0; i < 100; i++ ) + { + cvf::ref surface = cvf::make_ref(); + std::vector indices = { 2, 1, 0 }; + std::vector vertices = { cvf::Vec3d( -1.0, -1.0, i ), + cvf::Vec3d( 1.0, -1.0, i ), + cvf::Vec3d( -1.0, 1.0, i ) }; + + surface->setTriangleData( indices, vertices ); + surfaces.push_back( surface ); + } + + cvf::ref statSurface = RigSurfaceStatisticsCalculator::computeStatistics( surfaces ); + ASSERT_TRUE( statSurface.notNull() ); + + ASSERT_EQ( statSurface->triangleIndices().size(), surfaces[0]->triangleIndices().size() ); + + const std::vector& propertyNames = statSurface->propertyNames(); + ASSERT_TRUE( std::find( propertyNames.begin(), propertyNames.end(), "MEAN" ) != propertyNames.end() ); + ASSERT_TRUE( std::find( propertyNames.begin(), propertyNames.end(), "MIN" ) != propertyNames.end() ); + ASSERT_TRUE( std::find( propertyNames.begin(), propertyNames.end(), "MAX" ) != propertyNames.end() ); + ASSERT_TRUE( std::find( propertyNames.begin(), propertyNames.end(), "P10" ) != propertyNames.end() ); + ASSERT_TRUE( std::find( propertyNames.begin(), propertyNames.end(), "P50" ) != propertyNames.end() ); + ASSERT_TRUE( std::find( propertyNames.begin(), propertyNames.end(), "P90" ) != propertyNames.end() ); + + const std::vector& meanValues = statSurface->propertyValues( "MEAN" ); + const std::vector& minValues = statSurface->propertyValues( "MIN" ); + const std::vector& maxValues = statSurface->propertyValues( "MAX" ); + const std::vector& p10Values = statSurface->propertyValues( "P10" ); + const std::vector& p50Values = statSurface->propertyValues( "P50" ); + const std::vector& p90Values = statSurface->propertyValues( "P90" ); + + // One value per vertex + ASSERT_EQ( 3u, meanValues.size() ); + ASSERT_EQ( 3u, minValues.size() ); + ASSERT_EQ( 3u, maxValues.size() ); + ASSERT_EQ( 3u, p10Values.size() ); + ASSERT_EQ( 3u, p50Values.size() ); + ASSERT_EQ( 3u, p90Values.size() ); + + for ( size_t i = 0; i < 3u; i++ ) + { + ASSERT_EQ( 49.5, meanValues[i] ); + ASSERT_EQ( 0, minValues[i] ); + ASSERT_EQ( 99, maxValues[i] ); + ASSERT_NEAR( 9.1, p10Values[i], 0.0001 ); + ASSERT_NEAR( 49.5, p50Values[i], 0.0001 ); + ASSERT_NEAR( 89.9, p90Values[i], 0.0001 ); + } +} diff --git a/GrpcInterface/Python/rips/PythonExamples/generate_ensemble_surface.py b/GrpcInterface/Python/rips/PythonExamples/generate_ensemble_surface.py new file mode 100644 index 0000000000..18277cca1a --- /dev/null +++ b/GrpcInterface/Python/rips/PythonExamples/generate_ensemble_surface.py @@ -0,0 +1,62 @@ +# Load ResInsight Processing Server Client Library +import rips +import tempfile +from os.path import expanduser +from pathlib import Path + +# Connect to ResInsight instance +resinsight = rips.Instance.find() + + +home_dir = expanduser("~") + +export_folder = tempfile.mkdtemp() + +directory_path = "resprojects/webviz-subsurface-testdata/reek_history_match/" + + +case_file_paths = [] +num_realizations = 9 +num_iterations = 4 + + +for realization in range(0, num_realizations): + for iteration in range(0, num_iterations): + realization_dir = "realization-" + str(realization) + iteration_dir = "iter-" + str(iteration) + egrid_name = "eclipse/model/5_R001_REEK-" + str(realization) + ".EGRID" + path = Path( + home_dir, directory_path, realization_dir, iteration_dir, egrid_name + ) + case_file_paths.append(path) + +k_indexes = [4, 10] + +for path in case_file_paths: + # Load a case + path_name = path.as_posix() + case = resinsight.project.load_case(path_name) + + if resinsight.project.has_warnings(): + for warning in resinsight.project.warnings(): + print(warning) + + surface_collection = resinsight.project.descendants(rips.SurfaceCollection)[0] + + for k_index in k_indexes: + print("Generating surface K layer " + str(k_index) + " for case " + path_name) + + surface = surface_collection.new_surface(case, k_index) + print("Surface: ", surface) + + parent_path = path.parent + export_folder_path = Path(parent_path, "surfaceexport") + export_folder_path.mkdir(parents=True, exist_ok=True) + + export_file = Path(export_folder_path, "surf_" + str(k_index) + ".ts") + print("Exporting to " + export_file.as_posix()) + surface.export_to_file(export_file.as_posix()) + + # Close project to avoid aggregated memory usage + # Can be replaced when case.close() is implemented + resinsight.project.close() diff --git a/GrpcInterface/Python/rips/tests/test_surfaces.py b/GrpcInterface/Python/rips/tests/test_surfaces.py new file mode 100644 index 0000000000..96930cd599 --- /dev/null +++ b/GrpcInterface/Python/rips/tests/test_surfaces.py @@ -0,0 +1,34 @@ +import sys +import os +import tempfile +from pathlib import Path +import pytest + +sys.path.insert(1, os.path.join(sys.path[0], "../../")) +import rips + +import dataroot + + +@pytest.mark.skipif( + sys.platform.startswith("linux"), + reason="Brugge is currently exceptionally slow on Linux", +) +def test_create_and_export_surface(rips_instance, initialize_test): + case_path = dataroot.PATH + "/Case_with_10_timesteps/Real0/BRUGGE_0000.EGRID" + case = rips_instance.project.load_case(path=case_path) + assert len(case.grids()) == 1 + + surface_collection = rips_instance.project.descendants(rips.SurfaceCollection)[0] + + surface = surface_collection.new_surface(case, 5) + assert surface + + with tempfile.TemporaryDirectory(prefix="rips") as tmpdirname: + path = Path(tmpdirname, "mysurface.ts") + print("Temporary folder: ", path.as_posix()) + + fname = surface.export_to_file(path.as_posix()) + assert len(fname.values) == 1 + + assert path.exists() From b69665ce238178dae4ea453456d69778647b3961 Mon Sep 17 00:00:00 2001 From: Kristian Bendiksen Date: Mon, 16 Aug 2021 14:52:09 +0200 Subject: [PATCH 070/308] #7871 StimPlan Model: Add data source ordering for EQLNUM extraction --- .../StimPlanModel/CMakeLists_files.cmake | 2 + .../RimExtractionConfiguration.cpp | 48 ++++++ .../RimExtractionConfiguration.h | 38 +++++ .../StimPlanModel/RimStimPlanModel.cpp | 54 +++++++ .../StimPlanModel/RimStimPlanModel.h | 4 + .../RimStimPlanModelWellLogCalculator.cpp | 142 ++++++++++++++++-- .../RimStimPlanModelWellLogCalculator.h | 22 ++- 7 files changed, 294 insertions(+), 16 deletions(-) create mode 100644 ApplicationLibCode/ProjectDataModel/StimPlanModel/RimExtractionConfiguration.cpp create mode 100644 ApplicationLibCode/ProjectDataModel/StimPlanModel/RimExtractionConfiguration.h diff --git a/ApplicationLibCode/ProjectDataModel/StimPlanModel/CMakeLists_files.cmake b/ApplicationLibCode/ProjectDataModel/StimPlanModel/CMakeLists_files.cmake index 215e8ad39c..f9c826737f 100644 --- a/ApplicationLibCode/ProjectDataModel/StimPlanModel/CMakeLists_files.cmake +++ b/ApplicationLibCode/ProjectDataModel/StimPlanModel/CMakeLists_files.cmake @@ -23,6 +23,7 @@ ${CMAKE_CURRENT_LIST_DIR}/RimNonNetLayers.h ${CMAKE_CURRENT_LIST_DIR}/RimFaciesInitialPressureConfig.h ${CMAKE_CURRENT_LIST_DIR}/RimPressureTableItem.h ${CMAKE_CURRENT_LIST_DIR}/RimPressureTable.h +${CMAKE_CURRENT_LIST_DIR}/RimExtractionConfiguration.h ) set (SOURCE_GROUP_SOURCE_FILES @@ -47,6 +48,7 @@ ${CMAKE_CURRENT_LIST_DIR}/RimNonNetLayers.cpp ${CMAKE_CURRENT_LIST_DIR}/RimFaciesInitialPressureConfig.cpp ${CMAKE_CURRENT_LIST_DIR}/RimPressureTableItem.cpp ${CMAKE_CURRENT_LIST_DIR}/RimPressureTable.cpp +${CMAKE_CURRENT_LIST_DIR}/RimExtractionConfiguration.cpp ) list(APPEND CODE_HEADER_FILES diff --git a/ApplicationLibCode/ProjectDataModel/StimPlanModel/RimExtractionConfiguration.cpp b/ApplicationLibCode/ProjectDataModel/StimPlanModel/RimExtractionConfiguration.cpp new file mode 100644 index 0000000000..548548e33c --- /dev/null +++ b/ApplicationLibCode/ProjectDataModel/StimPlanModel/RimExtractionConfiguration.cpp @@ -0,0 +1,48 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2021- Equinor ASA +// +// ResInsight is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// + +#include "RimExtractionConfiguration.h" + +#include "cafAppEnum.h" + +namespace caf +{ +template <> +void caf::AppEnum::setUp() +{ + addItem( RimExtractionConfiguration::EclipseCaseType::STATIC_CASE, "STATIC_CASE", "Static Case" ); + addItem( RimExtractionConfiguration::EclipseCaseType::DYNAMIC_CASE, "DYNAMIC_CASE", "Dynamic Case" ); + addItem( RimExtractionConfiguration::EclipseCaseType::INITIAL_PRESSURE_CASE, + "INITIAL_PRESSURE_CASE", + "Initial Pressure Case" ); + + setDefault( RimExtractionConfiguration::EclipseCaseType::STATIC_CASE ); +} +}; // namespace caf + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RimExtractionConfiguration::RimExtractionConfiguration( const QString& resultVar, + RiaDefines::ResultCatType resultCat, + EclipseCaseType eclipseCase ) +{ + resultVariable = resultVar; + resultCategory = resultCat; + eclipseCaseType = eclipseCase; +} diff --git a/ApplicationLibCode/ProjectDataModel/StimPlanModel/RimExtractionConfiguration.h b/ApplicationLibCode/ProjectDataModel/StimPlanModel/RimExtractionConfiguration.h new file mode 100644 index 0000000000..79f1bf6685 --- /dev/null +++ b/ApplicationLibCode/ProjectDataModel/StimPlanModel/RimExtractionConfiguration.h @@ -0,0 +1,38 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2021- Equinor ASA +// +// ResInsight is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// + +#pragma once + +#include "RiaDefines.h" + +class RimExtractionConfiguration +{ +public: + enum class EclipseCaseType + { + STATIC_CASE, + DYNAMIC_CASE, + INITIAL_PRESSURE_CASE + }; + + RimExtractionConfiguration( const QString& resultVar, RiaDefines::ResultCatType resultCat, EclipseCaseType eclipseCase ); + + RiaDefines::ResultCatType resultCategory; + QString resultVariable; + EclipseCaseType eclipseCaseType; +}; diff --git a/ApplicationLibCode/ProjectDataModel/StimPlanModel/RimStimPlanModel.cpp b/ApplicationLibCode/ProjectDataModel/StimPlanModel/RimStimPlanModel.cpp index efd841505b..0894928f96 100644 --- a/ApplicationLibCode/ProjectDataModel/StimPlanModel/RimStimPlanModel.cpp +++ b/ApplicationLibCode/ProjectDataModel/StimPlanModel/RimStimPlanModel.cpp @@ -40,6 +40,7 @@ #include "RimEclipseCase.h" #include "RimEclipseResultDefinition.h" #include "RimEclipseView.h" +#include "RimExtractionConfiguration.h" #include "RimFaciesProperties.h" #include "RimFaultInView.h" #include "RimFaultInViewCollection.h" @@ -1710,3 +1711,56 @@ QString RimStimPlanModel::pressureDate() const else return QString(); } + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +std::deque + RimStimPlanModel::extractionConfigurations( RiaDefines::CurveProperty curveProperty ) const +{ + if ( curveProperty == RiaDefines::CurveProperty::EQLNUM ) + { + return { + RimExtractionConfiguration( "EQLNUM_1", + RiaDefines::ResultCatType::INPUT_PROPERTY, + RimExtractionConfiguration::EclipseCaseType::INITIAL_PRESSURE_CASE ), + RimExtractionConfiguration( "EQLNUM", + RiaDefines::ResultCatType::INPUT_PROPERTY, + RimExtractionConfiguration::EclipseCaseType::INITIAL_PRESSURE_CASE ), + RimExtractionConfiguration( "EQLNUM_1", + RiaDefines::ResultCatType::INPUT_PROPERTY, + RimExtractionConfiguration::EclipseCaseType::DYNAMIC_CASE ), + RimExtractionConfiguration( "EQLNUM", + RiaDefines::ResultCatType::INPUT_PROPERTY, + RimExtractionConfiguration::EclipseCaseType::DYNAMIC_CASE ), + RimExtractionConfiguration( "EQLNUM_1", + RiaDefines::ResultCatType::INPUT_PROPERTY, + RimExtractionConfiguration::EclipseCaseType::STATIC_CASE ), + RimExtractionConfiguration( "EQLNUM", + RiaDefines::ResultCatType::INPUT_PROPERTY, + RimExtractionConfiguration::EclipseCaseType::STATIC_CASE ), + RimExtractionConfiguration( "EQLNUM", + RiaDefines::ResultCatType::STATIC_NATIVE, + RimExtractionConfiguration::EclipseCaseType::STATIC_CASE ), + RimExtractionConfiguration( "EQLNUM", + RiaDefines::ResultCatType::STATIC_NATIVE, + RimExtractionConfiguration::EclipseCaseType::INITIAL_PRESSURE_CASE ), + RimExtractionConfiguration( "EQLNUM", + RiaDefines::ResultCatType::STATIC_NATIVE, + RimExtractionConfiguration::EclipseCaseType::DYNAMIC_CASE ), + + }; + } + + return std::deque(); +} + +RimEclipseCase* RimStimPlanModel::eclipseCaseForType( RimExtractionConfiguration::EclipseCaseType caseType ) const +{ + if ( caseType == RimExtractionConfiguration::EclipseCaseType::STATIC_CASE ) return m_staticEclipseCase; + if ( caseType == RimExtractionConfiguration::EclipseCaseType::DYNAMIC_CASE ) return m_eclipseCase; + if ( caseType == RimExtractionConfiguration::EclipseCaseType::INITIAL_PRESSURE_CASE ) + return m_initialPressureEclipseCase; + + return nullptr; +} diff --git a/ApplicationLibCode/ProjectDataModel/StimPlanModel/RimStimPlanModel.h b/ApplicationLibCode/ProjectDataModel/StimPlanModel/RimStimPlanModel.h index cdc9e2e677..47bc34b1f0 100644 --- a/ApplicationLibCode/ProjectDataModel/StimPlanModel/RimStimPlanModel.h +++ b/ApplicationLibCode/ProjectDataModel/StimPlanModel/RimStimPlanModel.h @@ -21,6 +21,7 @@ #include "RiaStimPlanModelDefines.h" #include "RimCheckableNamedObject.h" +#include "RimExtractionConfiguration.h" #include "RimWellPathComponentInterface.h" #include "RigWellLogExtractor.h" @@ -178,6 +179,9 @@ class RimStimPlanModel : public RimCheckableNamedObject, public RimWellPathCompo RiaDefines::ResultCatType eclipseResultCategory( RiaDefines::CurveProperty curveProperty ) const; QString eclipseResultVariable( RiaDefines::CurveProperty curveProperty ) const; + std::deque extractionConfigurations( RiaDefines::CurveProperty curveProperty ) const; + RimEclipseCase* eclipseCaseForType( RimExtractionConfiguration::EclipseCaseType ) const; + static double findFaciesValue( const RimColorLegend& colorLegend, const QString& name ); bool isScaledByNetToGross( RiaDefines::CurveProperty curveProperty ) const; diff --git a/ApplicationLibCode/ProjectDataModel/StimPlanModel/RimStimPlanModelWellLogCalculator.cpp b/ApplicationLibCode/ProjectDataModel/StimPlanModel/RimStimPlanModelWellLogCalculator.cpp index e27ea48911..1e879cec20 100644 --- a/ApplicationLibCode/ProjectDataModel/StimPlanModel/RimStimPlanModelWellLogCalculator.cpp +++ b/ApplicationLibCode/ProjectDataModel/StimPlanModel/RimStimPlanModelWellLogCalculator.cpp @@ -37,6 +37,7 @@ #include "RimEclipseInputProperty.h" #include "RimEclipseInputPropertyCollection.h" #include "RimEclipseResultDefinition.h" +#include "RimExtractionConfiguration.h" #include "RimModeledWellPath.h" #include "RimNonNetLayers.h" #include "RimStimPlanModel.h" @@ -83,23 +84,49 @@ bool RimStimPlanModelWellLogCalculator::calculate( RiaDefines::CurveProperty cur { RiaLogging::debug( QString( "Calculating well log for '%1'." ).arg( caf::AppEnum( curveProperty ).uiText() ) ); + + std::deque extractionConfigurations = + stimPlanModel->extractionConfigurations( curveProperty ); + std::deque missingValueStratgies = stimPlanModel->missingValueStrategies( curveProperty ); - if ( !extractValuesForProperty( curveProperty, stimPlanModel, timeStep, values, measuredDepthValues, tvDepthValues, rkbDiff ) ) + if ( extractionConfigurations.empty() ) { - if ( std::find( missingValueStratgies.begin(), - missingValueStratgies.end(), - RimStimPlanModel::MissingValueStrategy::DEFAULT_VALUE ) != missingValueStratgies.end() ) + if ( !extractValuesForProperty( curveProperty, stimPlanModel, timeStep, values, measuredDepthValues, tvDepthValues, rkbDiff ) ) { - RiaLogging::warning( QString( "Extraction failed. Trying fallback" ) ); - if ( !replaceMissingValuesWithDefault( curveProperty, stimPlanModel, values, measuredDepthValues, tvDepthValues, rkbDiff ) ) + if ( std::find( missingValueStratgies.begin(), + missingValueStratgies.end(), + RimStimPlanModel::MissingValueStrategy::DEFAULT_VALUE ) != missingValueStratgies.end() ) { - RiaLogging::error( "Fallback failed too." ); - return false; + RiaLogging::warning( QString( "Extraction failed. Trying fallback" ) ); + if ( !replaceMissingValuesWithDefault( curveProperty, + stimPlanModel, + values, + measuredDepthValues, + tvDepthValues, + rkbDiff ) ) + { + RiaLogging::error( "Fallback failed too." ); + return false; + } } } } + else + { + if ( !extractValuesForPropertyWithConfigurations( curveProperty, + stimPlanModel, + timeStep, + values, + measuredDepthValues, + tvDepthValues, + rkbDiff ) ) + + { + return false; + } + } double overburdenHeight = stimPlanModel->overburdenHeight(); if ( overburdenHeight > 0.0 ) @@ -388,6 +415,65 @@ void RimStimPlanModelWellLogCalculator::scaleByNetToGross( const RimStimPlanMode } } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +bool RimStimPlanModelWellLogCalculator::extractValuesForPropertyWithConfigurations( RiaDefines::CurveProperty curveProperty, + const RimStimPlanModel* stimPlanModel, + int timeStep, + std::vector& values, + std::vector& measuredDepthValues, + std::vector& tvDepthValues, + double& rkbDiff ) const +{ + std::deque extractionConfigurations = + stimPlanModel->extractionConfigurations( curveProperty ); + + QString curvePropertyName = caf::AppEnum( curveProperty ).uiText(); + + for ( auto extractionConfig : extractionConfigurations ) + { + RiaDefines::ResultCatType resultType = extractionConfig.resultCategory; + QString resultVariable = extractionConfig.resultVariable; + RimExtractionConfiguration::EclipseCaseType eclipseCaseType = extractionConfig.eclipseCaseType; + + RiaLogging::info( + QString( "Trying extraction option for '%1': %2 %3 %4" ) + .arg( curvePropertyName ) + .arg( resultVariable ) + .arg( caf::AppEnum( resultType ).uiText() ) + .arg( caf::AppEnum( eclipseCaseType ).uiText() ) ); + + RimEclipseCase* eclipseCase = stimPlanModel->eclipseCaseForType( eclipseCaseType ); + + if ( !eclipseCase ) + { + RiaLogging::info( "Skipping extraction config due to missing model." ); + } + else + { + bool isOk = extractValuesForProperty( curveProperty, + stimPlanModel, + eclipseCase, + resultType, + resultVariable, + timeStep, + values, + measuredDepthValues, + tvDepthValues, + rkbDiff ); + if ( isOk ) + { + RiaLogging::info( "Extraction succeeded" ); + return true; + } + } + } + + RiaLogging::info( QString( "Extraction failed. Tried %1 configurations." ).arg( extractionConfigurations.size() ) ); + return false; +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- @@ -400,11 +486,37 @@ bool RimStimPlanModelWellLogCalculator::extractValuesForProperty( RiaDefines::Cu double& rkbDiff ) const { RimEclipseCase* eclipseCase = stimPlanModel->eclipseCaseForProperty( curveProperty ); - if ( !eclipseCase ) - { - return false; - } + if ( !eclipseCase ) return false; + RiaDefines::ResultCatType resultType = stimPlanModel->eclipseResultCategory( curveProperty ); + QString resultVariable = stimPlanModel->eclipseResultVariable( curveProperty ); + + return extractValuesForProperty( curveProperty, + stimPlanModel, + eclipseCase, + resultType, + resultVariable, + timeStep, + values, + measuredDepthValues, + tvDepthValues, + rkbDiff ); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +bool RimStimPlanModelWellLogCalculator::extractValuesForProperty( RiaDefines::CurveProperty curveProperty, + const RimStimPlanModel* stimPlanModel, + RimEclipseCase* eclipseCase, + RiaDefines::ResultCatType resultCategory, + const QString resultVariable, + int timeStep, + std::vector& values, + std::vector& measuredDepthValues, + std::vector& tvDepthValues, + double& rkbDiff ) const +{ if ( !stimPlanModel->thicknessDirectionWellPath() ) { return false; @@ -428,13 +540,13 @@ bool RimStimPlanModelWellLogCalculator::extractValuesForProperty( RiaDefines::Cu RimEclipseResultDefinition eclipseResultDefinition; eclipseResultDefinition.setEclipseCase( eclipseCase ); - eclipseResultDefinition.setResultType( stimPlanModel->eclipseResultCategory( curveProperty ) ); + eclipseResultDefinition.setResultType( resultCategory ); eclipseResultDefinition.setPorosityModel( RiaDefines::PorosityModelType::MATRIX_MODEL ); - eclipseResultDefinition.setResultVariable( stimPlanModel->eclipseResultVariable( curveProperty ) ); + eclipseResultDefinition.setResultVariable( resultVariable ); eclipseResultDefinition.loadResult(); - if ( stimPlanModel->eclipseResultCategory( curveProperty ) != RiaDefines::ResultCatType::DYNAMIC_NATIVE || + if ( resultCategory != RiaDefines::ResultCatType::DYNAMIC_NATIVE || curveProperty == RiaDefines::CurveProperty::INITIAL_PRESSURE ) { timeStep = 0; diff --git a/ApplicationLibCode/ProjectDataModel/StimPlanModel/RimStimPlanModelWellLogCalculator.h b/ApplicationLibCode/ProjectDataModel/StimPlanModel/RimStimPlanModelWellLogCalculator.h index a4377227d7..71f557ad0e 100644 --- a/ApplicationLibCode/ProjectDataModel/StimPlanModel/RimStimPlanModelWellLogCalculator.h +++ b/ApplicationLibCode/ProjectDataModel/StimPlanModel/RimStimPlanModelWellLogCalculator.h @@ -29,9 +29,10 @@ #include class RigEclipseCaseData; +class RigResultAccessor; class RimEclipseInputPropertyCollection; class RimEclipseResultDefinition; -class RigResultAccessor; +class RimEclipseCase; class RimStimPlanModelWellLogCalculator : public RimStimPlanModelPropertyCalculator { @@ -87,6 +88,25 @@ class RimStimPlanModelWellLogCalculator : public RimStimPlanModelPropertyCalcula std::vector& tvDepthValues, double& rkbDiff ) const; + bool extractValuesForProperty( RiaDefines::CurveProperty curveProperty, + const RimStimPlanModel* stimPlanModel, + RimEclipseCase* eclipseCase, + RiaDefines::ResultCatType resultCategory, + const QString resultVariable, + int timeStep, + std::vector& values, + std::vector& measuredDepthValues, + std::vector& tvDepthValues, + double& rkbDiff ) const; + + bool extractValuesForPropertyWithConfigurations( RiaDefines::CurveProperty curveProperty, + const RimStimPlanModel* stimPlanModel, + int timeStep, + std::vector& values, + std::vector& measuredDepthValues, + std::vector& tvDepthValues, + double& rkbDiff ) const; + bool replaceMissingValuesWithDefault( RiaDefines::CurveProperty curveProperty, const RimStimPlanModel* stimPlanModel, std::vector& values, From 56a86eee5f9df3a5cc4442599d93564cdc3a187e Mon Sep 17 00:00:00 2001 From: Kristian Bendiksen Date: Mon, 16 Aug 2021 19:50:52 +0200 Subject: [PATCH 071/308] #7871 StimPlan Model: resample well log data when not from static case --- .../RimStimPlanModelPressureCalculator.h | 12 +++---- .../RimStimPlanModelWellLogCalculator.cpp | 31 +++++++++++++++++++ 2 files changed, 37 insertions(+), 6 deletions(-) diff --git a/ApplicationLibCode/ProjectDataModel/StimPlanModel/RimStimPlanModelPressureCalculator.h b/ApplicationLibCode/ProjectDataModel/StimPlanModel/RimStimPlanModelPressureCalculator.h index b18a79ee39..25f71d3d25 100644 --- a/ApplicationLibCode/ProjectDataModel/StimPlanModel/RimStimPlanModelPressureCalculator.h +++ b/ApplicationLibCode/ProjectDataModel/StimPlanModel/RimStimPlanModelPressureCalculator.h @@ -45,6 +45,12 @@ class RimStimPlanModelPressureCalculator : public RimStimPlanModelWellLogCalcula static double pressureDifferenceInterpolationOffset(); + static std::tuple, std::vector, std::vector> + interpolateMissingValues( const std::vector& staticTvDepthValues, + const std::vector& staticMeasuredDepthValues, + const std::vector& measuredDepthValues, + const std::vector& values ); + protected: bool extractValuesForProperty( RiaDefines::CurveProperty curveProperty, const RimStimPlanModel* stimPlanModel, @@ -78,12 +84,6 @@ class RimStimPlanModelPressureCalculator : public RimStimPlanModelWellLogCalcula const std::vector& faciesValues, std::vector& values ) const; - static std::tuple, std::vector, std::vector> - interpolateMissingValues( const std::vector& staticTvDepthValues, - const std::vector& staticMeasuredDepthValues, - const std::vector& measuredDepthValues, - const std::vector& values ); - typedef std::pair DepthValuePair; typedef std::vector DepthValuePairVector; typedef std::map EqlNumToDepthValuePairMap; diff --git a/ApplicationLibCode/ProjectDataModel/StimPlanModel/RimStimPlanModelWellLogCalculator.cpp b/ApplicationLibCode/ProjectDataModel/StimPlanModel/RimStimPlanModelWellLogCalculator.cpp index 1e879cec20..3014a44d31 100644 --- a/ApplicationLibCode/ProjectDataModel/StimPlanModel/RimStimPlanModelWellLogCalculator.cpp +++ b/ApplicationLibCode/ProjectDataModel/StimPlanModel/RimStimPlanModelWellLogCalculator.cpp @@ -42,6 +42,7 @@ #include "RimNonNetLayers.h" #include "RimStimPlanModel.h" #include "RimStimPlanModelCalculator.h" +#include "RimStimPlanModelPressureCalculator.h" #include "RimStimPlanModelTemplate.h" #include "RimWellPath.h" @@ -203,6 +204,36 @@ bool RimStimPlanModelWellLogCalculator::calculate( RiaDefines::CurveProperty cur scaleByNetToGross( stimPlanModel, netToGross, values ); } + // Extracted well log needs to be sampled at same depths as well logs from static grid. + // If the well log is extracted from a different model it needs to be resampled. + if ( curveProperty != RiaDefines::CurveProperty::FACIES ) + { + std::vector targetMds; + std::vector targetTvds; + std::vector faciesValues; + if ( !stimPlanModel->calculator()->extractCurveData( RiaDefines::CurveProperty::FACIES, + timeStep, + faciesValues, + targetMds, + targetTvds, + rkbDiff ) ) + { + return false; + } + + if ( targetMds.size() != measuredDepthValues.size() ) + { + RiaLogging::info( "Resampling data to fit static case." ); + auto [tvds, mds, results] = RimStimPlanModelPressureCalculator::interpolateMissingValues( targetTvds, + targetMds, + measuredDepthValues, + values ); + tvDepthValues = tvds; + measuredDepthValues = mds; + values = results; + } + } + RiaLogging::debug( QString( "Well log for '%1' done. Size: %2." ) .arg( caf::AppEnum( curveProperty ).uiText() ) .arg( values.size() ) ); From 511439277a1f8649d6d4fb6dbc48dceec96e5de9 Mon Sep 17 00:00:00 2001 From: Kristian Bendiksen Date: Wed, 18 Aug 2021 13:00:06 +0200 Subject: [PATCH 072/308] #7871 StimPlan Model: Add check-box for EQLNUM pressure interpolation --- .../RimStimPlanModelPressureCalculator.cpp | 16 +++++++++------- .../StimPlanModel/RimStimPlanModelTemplate.cpp | 17 +++++++++++++++++ .../StimPlanModel/RimStimPlanModelTemplate.h | 3 +++ 3 files changed, 29 insertions(+), 7 deletions(-) diff --git a/ApplicationLibCode/ProjectDataModel/StimPlanModel/RimStimPlanModelPressureCalculator.cpp b/ApplicationLibCode/ProjectDataModel/StimPlanModel/RimStimPlanModelPressureCalculator.cpp index f9e58f695b..5fc217dd4f 100644 --- a/ApplicationLibCode/ProjectDataModel/StimPlanModel/RimStimPlanModelPressureCalculator.cpp +++ b/ApplicationLibCode/ProjectDataModel/StimPlanModel/RimStimPlanModelPressureCalculator.cpp @@ -183,6 +183,7 @@ bool RimStimPlanModelPressureCalculator::extractValuesForProperty( RiaDefines::C values = results; } + bool useEqlnumForPressureInterpolation = stimPlanModel->stimPlanModelTemplate()->useEqlnumForPressureInterpolation(); if ( curveProperty == RiaDefines::CurveProperty::INITIAL_PRESSURE ) { auto hasMissingValues = []( const std::vector& vec ) { @@ -191,12 +192,12 @@ bool RimStimPlanModelPressureCalculator::extractValuesForProperty( RiaDefines::C if ( hasMissingValues( values ) ) { - if ( !interpolateInitialPressureByEquilibrationRegion( curveProperty, - stimPlanModel, - timeStep, - measuredDepthValues, - tvDepthValues, - values ) ) + if ( useEqlnumForPressureInterpolation && !interpolateInitialPressureByEquilibrationRegion( curveProperty, + stimPlanModel, + timeStep, + measuredDepthValues, + tvDepthValues, + values ) ) { RiaLogging::error( "Pressure interpolation by equilibration region failed." ); } @@ -210,7 +211,8 @@ bool RimStimPlanModelPressureCalculator::extractValuesForProperty( RiaDefines::C { std::vector initialPressureValues = values; values.clear(); - if ( !interpolatePressureDifferenceByEquilibrationRegion( curveProperty, + if ( useEqlnumForPressureInterpolation && + !interpolatePressureDifferenceByEquilibrationRegion( curveProperty, stimPlanModel, timeStep, measuredDepthValues, diff --git a/ApplicationLibCode/ProjectDataModel/StimPlanModel/RimStimPlanModelTemplate.cpp b/ApplicationLibCode/ProjectDataModel/StimPlanModel/RimStimPlanModelTemplate.cpp index db77d61e6d..93036f9efa 100644 --- a/ApplicationLibCode/ProjectDataModel/StimPlanModel/RimStimPlanModelTemplate.cpp +++ b/ApplicationLibCode/ProjectDataModel/StimPlanModel/RimStimPlanModelTemplate.cpp @@ -95,6 +95,14 @@ RimStimPlanModelTemplate::RimStimPlanModelTemplate() CAF_PDM_InitScriptableFieldNoDefault( &m_staticEclipseCase, "StaticEclipseCase", "Static Case", "", "", "" ); + CAF_PDM_InitField( &m_useEqlnumForPressureInterpolation, + "UseEqlNumForPressureInterpolation", + true, + "Use EQLNUM For Pressure Interpolation", + "", + "", + "" ); + CAF_PDM_InitScriptableField( &m_defaultPorosity, "DefaultPorosity", RiaDefines::defaultPorosity(), @@ -312,6 +320,7 @@ void RimStimPlanModelTemplate::defineUiOrdering( QString uiConfigName, caf::PdmU pressureDataSourceGroup->add( &m_useTableForInitialPressure, { true, 2, 1 } ); pressureDataSourceGroup->add( &m_editPressureTable, { false, 1, 0 } ); pressureDataSourceGroup->add( &m_useTableForPressure ); + pressureDataSourceGroup->add( &m_useEqlnumForPressureInterpolation ); m_initialPressureEclipseCase.uiCapability()->setUiReadOnly( m_useTableForInitialPressure() ); caf::PdmUiOrdering* defaultsGroup = uiOrdering.addNewGroup( "Defaults" ); @@ -912,3 +921,11 @@ bool RimStimPlanModelTemplate::usePressureTableForProperty( RiaDefines::CurvePro else return false; } + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +bool RimStimPlanModelTemplate::useEqlnumForPressureInterpolation() const +{ + return m_useEqlnumForPressureInterpolation; +} diff --git a/ApplicationLibCode/ProjectDataModel/StimPlanModel/RimStimPlanModelTemplate.h b/ApplicationLibCode/ProjectDataModel/StimPlanModel/RimStimPlanModelTemplate.h index 6190efb451..250947215a 100644 --- a/ApplicationLibCode/ProjectDataModel/StimPlanModel/RimStimPlanModelTemplate.h +++ b/ApplicationLibCode/ProjectDataModel/StimPlanModel/RimStimPlanModelTemplate.h @@ -118,6 +118,8 @@ class RimStimPlanModelTemplate : public RimNamedObject bool usePressureTableForProperty( RiaDefines::CurveProperty curveProperty ) const; + bool useEqlnumForPressureInterpolation() const; + protected: void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override; @@ -148,6 +150,7 @@ class RimStimPlanModelTemplate : public RimNamedObject caf::PdmPtrField m_initialPressureEclipseCase; caf::PdmField m_useTableForInitialPressure; caf::PdmField m_useTableForPressure; + caf::PdmField m_useEqlnumForPressureInterpolation; caf::PdmField m_editPressureTable; caf::PdmPtrField m_staticEclipseCase; caf::PdmField m_defaultPorosity; From fbd1412853181b3dc5600430c6f78bf0e96e4da5 Mon Sep 17 00:00:00 2001 From: Kristian Bendiksen Date: Wed, 18 Aug 2021 15:38:40 +0200 Subject: [PATCH 073/308] StimPlan Model: Improve logging format for extration options. --- .../StimPlanModel/RimStimPlanModelWellLogCalculator.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ApplicationLibCode/ProjectDataModel/StimPlanModel/RimStimPlanModelWellLogCalculator.cpp b/ApplicationLibCode/ProjectDataModel/StimPlanModel/RimStimPlanModelWellLogCalculator.cpp index 3014a44d31..d7171dcf95 100644 --- a/ApplicationLibCode/ProjectDataModel/StimPlanModel/RimStimPlanModelWellLogCalculator.cpp +++ b/ApplicationLibCode/ProjectDataModel/StimPlanModel/RimStimPlanModelWellLogCalculator.cpp @@ -469,7 +469,7 @@ bool RimStimPlanModelWellLogCalculator::extractValuesForPropertyWithConfiguratio RimExtractionConfiguration::EclipseCaseType eclipseCaseType = extractionConfig.eclipseCaseType; RiaLogging::info( - QString( "Trying extraction option for '%1': %2 %3 %4" ) + QString( "Trying extraction option for '%1': result property: '%2' result type: '%3' case type: '%4'" ) .arg( curvePropertyName ) .arg( resultVariable ) .arg( caf::AppEnum( resultType ).uiText() ) From 2ef22f518cb9e8e1ee43f210b375226c78f1ce3c Mon Sep 17 00:00:00 2001 From: Kristian Bendiksen Date: Wed, 18 Aug 2021 15:39:10 +0200 Subject: [PATCH 074/308] #7872 StimPlan Model: Add data source options for PORO/PERMX/PERMZ --- .../StimPlanModel/RimStimPlanModel.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/ApplicationLibCode/ProjectDataModel/StimPlanModel/RimStimPlanModel.cpp b/ApplicationLibCode/ProjectDataModel/StimPlanModel/RimStimPlanModel.cpp index 0894928f96..71f38f36c7 100644 --- a/ApplicationLibCode/ProjectDataModel/StimPlanModel/RimStimPlanModel.cpp +++ b/ApplicationLibCode/ProjectDataModel/StimPlanModel/RimStimPlanModel.cpp @@ -1751,6 +1751,24 @@ std::deque }; } + else if ( curveProperty == RiaDefines::CurveProperty::POROSITY || + curveProperty == RiaDefines::CurveProperty::POROSITY_UNSCALED || + curveProperty == RiaDefines::CurveProperty::PERMEABILITY_X || + curveProperty == RiaDefines::CurveProperty::PERMEABILITY_Z ) + { + QString resultName = eclipseResultVariable( curveProperty ); + return { + RimExtractionConfiguration( QString( "%1_1" ).arg( resultName ), + RiaDefines::ResultCatType::INPUT_PROPERTY, + RimExtractionConfiguration::EclipseCaseType::STATIC_CASE ), + RimExtractionConfiguration( resultName, + RiaDefines::ResultCatType::INPUT_PROPERTY, + RimExtractionConfiguration::EclipseCaseType::STATIC_CASE ), + RimExtractionConfiguration( resultName, + RiaDefines::ResultCatType::STATIC_NATIVE, + RimExtractionConfiguration::EclipseCaseType::DYNAMIC_CASE ), + }; + } return std::deque(); } From 3a9407886749ca7163197136ab80c884b131a06c Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Mon, 23 Aug 2021 11:58:32 +0200 Subject: [PATCH 075/308] Support optimized surface export from grid model layers * #7885 Update opm-common with optimized coordinate import * #7885 Allow null as default result from a script method * #7885 Propagate default parameter values to generated Python code * #7885 Add CommandRouter as hub for worker methods * #7885 Add support for use of CommadRouter from Python --- .../Application/RiaApplication.cpp | 11 + .../Application/RiaApplication.h | 6 +- ApplicationLibCode/CMakeLists.txt | 4 +- .../CommandRouter/CMakeLists_files.cmake | 20 + .../CommandRouter/RimCommandRouter.cpp | 74 ++ .../CommandRouter/RimCommandRouter.h | 62 ++ .../CommandRouter/RimcExtractSurfaces.cpp | 134 +++ .../CommandRouter/RimcExtractSurfaces.h | 50 + .../cafPdmScripting/cafPdmPythonGenerator.cpp | 60 +- .../cafPdmScripting/cafPdmPythonGenerator.h | 3 + GrpcInterface/GrpcProtos/App.proto | 2 + .../generate_ensemble_surface.py | 1 + .../generate_ensemble_surface_optimized.py | 41 + GrpcInterface/Python/rips/instance.py | 8 +- GrpcInterface/RiaGrpcAppService.cpp | 23 +- GrpcInterface/RiaGrpcAppService.h | 1 + GrpcInterface/RiaGrpcPdmObjectService.cpp | 9 +- GrpcInterface/RiaGrpcServiceInterface.cpp | 12 + .../opm-common/opm/io/eclipse/EGrid.hpp | 15 + .../opm-common/opm/io/eclipse/EInit.hpp | 30 +- .../opm-common/opm/io/eclipse/ERst.hpp | 15 +- .../opm-common/opm/io/eclipse/EclFile.hpp | 17 +- .../opm-common/src/opm/io/eclipse/EGrid.cpp | 698 +++++++++----- .../opm-common/src/opm/io/eclipse/EInit.cpp | 35 + .../opm-common/src/opm/io/eclipse/ERst.cpp | 19 + .../opm-common/src/opm/io/eclipse/ESmry.cpp | 1 + .../opm-common/src/opm/io/eclipse/EclFile.cpp | 904 +++++++++--------- .../eclipse/EclipseState/Grid/EclipseGrid.cpp | 1 + 28 files changed, 1490 insertions(+), 766 deletions(-) create mode 100644 ApplicationLibCode/ProjectDataModelCommands/CommandRouter/CMakeLists_files.cmake create mode 100644 ApplicationLibCode/ProjectDataModelCommands/CommandRouter/RimCommandRouter.cpp create mode 100644 ApplicationLibCode/ProjectDataModelCommands/CommandRouter/RimCommandRouter.h create mode 100644 ApplicationLibCode/ProjectDataModelCommands/CommandRouter/RimcExtractSurfaces.cpp create mode 100644 ApplicationLibCode/ProjectDataModelCommands/CommandRouter/RimcExtractSurfaces.h create mode 100644 GrpcInterface/Python/rips/PythonExamples/generate_ensemble_surface_optimized.py diff --git a/ApplicationLibCode/Application/RiaApplication.cpp b/ApplicationLibCode/Application/RiaApplication.cpp index a6d2e92be5..8bc937469f 100644 --- a/ApplicationLibCode/Application/RiaApplication.cpp +++ b/ApplicationLibCode/Application/RiaApplication.cpp @@ -37,6 +37,7 @@ #include "RicfCommandFileExecutor.h" #include "RicfCommandObject.h" +#include "CommandRouter/RimCommandRouter.h" #include "Rim2dIntersectionViewCollection.h" #include "RimAnnotationCollection.h" #include "RimAnnotationInViewCollection.h" @@ -149,6 +150,8 @@ RiaApplication::RiaApplication() #endif setLastUsedDialogDirectory( "MULTICASEIMPORT", "/" ); + + m_commandRouter = std::make_unique(); } //-------------------------------------------------------------------------------------------------- @@ -301,6 +304,14 @@ RimProject* RiaApplication::project() return m_project.get(); } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RimCommandRouter* RiaApplication::commandRouter() +{ + return m_commandRouter.get(); +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationLibCode/Application/RiaApplication.h b/ApplicationLibCode/Application/RiaApplication.h index b3d3313224..e26112b88d 100644 --- a/ApplicationLibCode/Application/RiaApplication.h +++ b/ApplicationLibCode/Application/RiaApplication.h @@ -52,6 +52,7 @@ class RiaSocketServer; class RigEclipseCaseData; class RimCommandObject; +class RimCommandRouter; class RimEclipseCase; class RimEclipseView; class RimWellPath; @@ -115,7 +116,8 @@ class RiaApplication RimGridView* activeMainOrComparisonGridView(); int currentScriptCaseId() const; - RimProject* project(); + RimProject* project(); + RimCommandRouter* commandRouter(); void createMockModel(); void createResultsMockModel(); @@ -234,6 +236,8 @@ class RiaApplication caf::PdmPointer m_activeReservoirView; std::unique_ptr m_project; + std::unique_ptr m_commandRouter; + QPointer m_socketServer; std::unique_ptr m_workerProcess; diff --git a/ApplicationLibCode/CMakeLists.txt b/ApplicationLibCode/CMakeLists.txt index 9a1b94fd50..0d63f10df4 100644 --- a/ApplicationLibCode/CMakeLists.txt +++ b/ApplicationLibCode/CMakeLists.txt @@ -184,6 +184,7 @@ list( ProjectDataModel/WellMeasurement/CMakeLists_files.cmake ProjectDataModel/WellPath/CMakeLists_files.cmake ProjectDataModelCommands/CMakeLists_files.cmake + ProjectDataModelCommands/CommandRouter/CMakeLists_files.cmake GeoMech/GeoMechVisualization/CMakeLists_files.cmake ModelVisualization/CMakeLists_files.cmake ModelVisualization/GridBox/CMakeLists_files.cmake @@ -400,7 +401,8 @@ target_link_libraries(${PROJECT_NAME} ${LINK_LIBRARIES} target_include_directories( ${PROJECT_NAME} PRIVATE ${CMAKE_BINARY_DIR}/Generated - PUBLIC ${CMAKE_SOURCE_DIR}/ApplicationLibCode/Application + PUBLIC ${CMAKE_SOURCE_DIR}/ApplicationLibCode + ${CMAKE_SOURCE_DIR}/ApplicationLibCode/Application ${CMAKE_SOURCE_DIR}/ApplicationLibCode/Application/Tools ${CMAKE_SOURCE_DIR}/ApplicationLibCode/CommandFileInterface ${CMAKE_SOURCE_DIR}/ApplicationLibCode/CommandFileInterface/Core diff --git a/ApplicationLibCode/ProjectDataModelCommands/CommandRouter/CMakeLists_files.cmake b/ApplicationLibCode/ProjectDataModelCommands/CommandRouter/CMakeLists_files.cmake new file mode 100644 index 0000000000..a086f2fcf7 --- /dev/null +++ b/ApplicationLibCode/ProjectDataModelCommands/CommandRouter/CMakeLists_files.cmake @@ -0,0 +1,20 @@ + +set (SOURCE_GROUP_HEADER_FILES +${CMAKE_CURRENT_LIST_DIR}/RimCommandRouter.h +${CMAKE_CURRENT_LIST_DIR}/RimcExtractSurfaces.h +) + +set (SOURCE_GROUP_SOURCE_FILES +${CMAKE_CURRENT_LIST_DIR}/RimCommandRouter.cpp +${CMAKE_CURRENT_LIST_DIR}/RimcExtractSurfaces.cpp +) + +list(APPEND CODE_HEADER_FILES +${SOURCE_GROUP_HEADER_FILES} +) + +list(APPEND CODE_SOURCE_FILES +${SOURCE_GROUP_SOURCE_FILES} +) + +source_group( "ProjectDataModelCommands\\CommandRouter" FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake ) diff --git a/ApplicationLibCode/ProjectDataModelCommands/CommandRouter/RimCommandRouter.cpp b/ApplicationLibCode/ProjectDataModelCommands/CommandRouter/RimCommandRouter.cpp new file mode 100644 index 0000000000..9e888b4778 --- /dev/null +++ b/ApplicationLibCode/ProjectDataModelCommands/CommandRouter/RimCommandRouter.cpp @@ -0,0 +1,74 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2021 Equinor ASA +// +// ResInsight is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// + +#include "RimCommandRouter.h" + +#include "cafPdmObjectScriptingCapability.h" + +CAF_PDM_SOURCE_INIT( RimCommandRouter, "RimCommandRouter" ); + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RimCommandRouter::RimCommandRouter() +{ + CAF_PDM_InitScriptableObjectWithNameAndComment( "CommandRouter", + "", + "", + "", + "CommandRouter", + "The CommandRouter is used to call code independent to the " + "project" ); +} + +//-------------------------------------------------------------------------------------------------- +/// +/// RimCommandRouterMethod +/// +/// +/// +/// +//-------------------------------------------------------------------------------------------------- +RimCommandRouterMethod::RimCommandRouterMethod( PdmObjectHandle* self ) + : caf::PdmObjectMethod( self ) +{ +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +bool RimCommandRouterMethod::isNullptrValidResult() const +{ + return true; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +bool RimCommandRouterMethod::resultIsPersistent() const +{ + return false; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +std::unique_ptr RimCommandRouterMethod::defaultResult() const +{ + return nullptr; +} diff --git a/ApplicationLibCode/ProjectDataModelCommands/CommandRouter/RimCommandRouter.h b/ApplicationLibCode/ProjectDataModelCommands/CommandRouter/RimCommandRouter.h new file mode 100644 index 0000000000..f1dc3a1f46 --- /dev/null +++ b/ApplicationLibCode/ProjectDataModelCommands/CommandRouter/RimCommandRouter.h @@ -0,0 +1,62 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2021 Equinor ASA +// +// ResInsight is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// + +#pragma once + +#include "cafPdmObject.h" +#include "cafPdmObjectMethod.h" + +//-------------------------------------------------------------------------------------------------- +/// Usually, command router classes will require only the execute() method. Derive from RimCommandRouterMethod to get +/// default values for the other required virtual functions +//-------------------------------------------------------------------------------------------------- +class RimCommandRouterMethod : public caf::PdmObjectMethod +{ +public: + RimCommandRouterMethod( PdmObjectHandle* self ); + + bool isNullptrValidResult() const override; + bool resultIsPersistent() const override; + std::unique_ptr defaultResult() const override; +}; + +//================================================================================================== +/// The command router object is used as a hub for data processing commands independent to a ResInsight project +/// (RimProject). The intention for this object is to have a hub to connect to when using ResInsight as a data +/// processing server. Avoid dependency on a GUI, and make sure the execute() commands works in headless mode. +/// +/// The router object is made available from Python using +/// +/// resinsight = rips.Instance.find() +/// command_router = resinsight.command_router +/// +/// Steps to add a new processing function +/// 1) Create a new class deriving from RimCommandRouterMethod +/// 2) Add Pdm fields to this class. These fields will be made available as parameters from Python +/// 2) Implement data processing in execute() method using the input values specified in the Pdm fields +/// +/// Example : RimcCommandRouter_extractSurfaces +/// +//================================================================================================== +class RimCommandRouter : public caf::PdmObject +{ + CAF_PDM_HEADER_INIT; + +public: + RimCommandRouter(); +}; diff --git a/ApplicationLibCode/ProjectDataModelCommands/CommandRouter/RimcExtractSurfaces.cpp b/ApplicationLibCode/ProjectDataModelCommands/CommandRouter/RimcExtractSurfaces.cpp new file mode 100644 index 0000000000..d05d954fb3 --- /dev/null +++ b/ApplicationLibCode/ProjectDataModelCommands/CommandRouter/RimcExtractSurfaces.cpp @@ -0,0 +1,134 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2021- Equinor ASA +// +// ResInsight is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// + +#include "RimcExtractSurfaces.h" + +#include "RiaLogging.h" +#include "RifSurfaceExporter.h" +#include "RimCommandRouter.h" + +#include "opm/io/eclipse/EGrid.hpp" + +#include "cafPdmAbstractFieldScriptingCapability.h" +#include "cafPdmFieldScriptingCapability.h" +#include "cafPdmObjectHandle.h" + +#include +#include + +#include + +CAF_PDM_OBJECT_METHOD_SOURCE_INIT( RimCommandRouter, RimcCommandRouter_extractSurfaces, "ExtractSurfaces" ); + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RimcCommandRouter_extractSurfaces::RimcCommandRouter_extractSurfaces( caf::PdmObjectHandle* self ) + : RimCommandRouterMethod( self ) +{ + CAF_PDM_InitObject( "Extract Layer Surface", "", "", "Extract Layer Surface" ); + + CAF_PDM_InitScriptableField( &m_gridModelFilename, "GridModelFilename", QString(), "Grid Model Case Filename", "", "", "" ); + CAF_PDM_InitScriptableField( &m_layers, "Layers", std::vector(), "Layers", "", "", "" ); + CAF_PDM_InitScriptableField( &m_minimumI, "MinimumI", -1, "Minimum I", "", "", "" ); + CAF_PDM_InitScriptableField( &m_maximumI, "MaximumI", -1, "Maximum I", "", "", "" ); + CAF_PDM_InitScriptableField( &m_minimumJ, "MinimumJ", -1, "Minimum J", "", "", "" ); + CAF_PDM_InitScriptableField( &m_maximumJ, "MaximumJ", -1, "Maximum J", "", "", "" ); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +caf::PdmObjectHandle* RimcCommandRouter_extractSurfaces::execute() +{ + try + { + std::string filename = m_gridModelFilename().toStdString(); + Opm::EclIO::EGrid grid1( filename ); + + auto dims = grid1.dimension(); + int minI = m_minimumI() == -1 ? 0 : m_minimumI(); + int maxI = m_maximumJ() == -1 ? dims[0] - 1 : m_maximumI(); + int minJ = m_minimumI() == -1 ? 0 : m_minimumJ(); + int maxJ = m_minimumI() == -1 ? dims[1] - 1 : m_maximumJ(); + + std::array range = { minI, maxI, minJ, maxJ }; + + for ( auto layer : m_layers() ) + { + bool bottom = false; + auto xyz_data = grid1.getXYZ_layer( layer, range, bottom ); + auto mapAxis = grid1.get_mapaxes(); + + // Create surface from coords + + std::vector triangleIndices; + std::vector vertices; + + unsigned startOfCellCoordIndex = 0; + while ( startOfCellCoordIndex + 4 < xyz_data.size() ) + { + for ( size_t cornerIdx = 0; cornerIdx < 4; cornerIdx++ ) + { + auto coord1 = xyz_data[startOfCellCoordIndex + cornerIdx]; + auto cvfCoord = cvf::Vec3d( coord1[0], coord1[1], -coord1[2] ); + + if ( !mapAxis.empty() ) + { + cvfCoord[0] += mapAxis[2]; + cvfCoord[1] += mapAxis[3]; + } + vertices.push_back( cvfCoord ); + } + + triangleIndices.push_back( startOfCellCoordIndex ); + triangleIndices.push_back( startOfCellCoordIndex + 3 ); + triangleIndices.push_back( startOfCellCoordIndex + 2 ); + + triangleIndices.push_back( startOfCellCoordIndex ); + triangleIndices.push_back( startOfCellCoordIndex + 1 ); + triangleIndices.push_back( startOfCellCoordIndex + 3 ); + + // Coordinates are given for each four corners for each cell of the surface + startOfCellCoordIndex += 4; + } + + // Write to TS file on disk + + QFileInfo fi( m_gridModelFilename ); + QString surfaceFilename = fi.absoluteDir().absolutePath() + + QString( "/surfaceexport/layer-%1.ts" ).arg( layer ); + + // TODO: Add more info in surface comment + if ( !RifSurfaceExporter::writeGocadTSurfFile( surfaceFilename, "Surface comment", vertices, triangleIndices ) ) + { + RiaLogging::error( "Failed to export surface data to " + surfaceFilename ); + } + else + { + RiaLogging::error( "Successfully exported surface data to " + surfaceFilename ); + } + } + } + catch ( ... ) + { + RiaLogging::error( "Error during creation of surface data for model " + m_gridModelFilename() ); + } + + return nullptr; +} diff --git a/ApplicationLibCode/ProjectDataModelCommands/CommandRouter/RimcExtractSurfaces.h b/ApplicationLibCode/ProjectDataModelCommands/CommandRouter/RimcExtractSurfaces.h new file mode 100644 index 0000000000..0c295ffad9 --- /dev/null +++ b/ApplicationLibCode/ProjectDataModelCommands/CommandRouter/RimcExtractSurfaces.h @@ -0,0 +1,50 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2021- Equinor ASA +// +// ResInsight is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// + +#pragma once + +#include "RimCommandRouter.h" + +#include "cafPdmField.h" + +#include "cvfVector3.h" + +#include + +#include + +//================================================================================================== +/// +//================================================================================================== +class RimcCommandRouter_extractSurfaces : public RimCommandRouterMethod +{ + CAF_PDM_HEADER_INIT; + +public: + RimcCommandRouter_extractSurfaces( caf::PdmObjectHandle* self ); + + caf::PdmObjectHandle* execute() override; + +private: + caf::PdmField m_gridModelFilename; + caf::PdmField> m_layers; + caf::PdmField m_minimumI; + caf::PdmField m_maximumI; + caf::PdmField m_minimumJ; + caf::PdmField m_maximumJ; +}; diff --git a/Fwk/AppFwk/cafPdmScripting/cafPdmPythonGenerator.cpp b/Fwk/AppFwk/cafPdmScripting/cafPdmPythonGenerator.cpp index 8c581ff8e9..336d9dcfe9 100644 --- a/Fwk/AppFwk/cafPdmScripting/cafPdmPythonGenerator.cpp +++ b/Fwk/AppFwk/cafPdmScripting/cafPdmPythonGenerator.cpp @@ -182,16 +182,7 @@ QString caf::PdmPythonGenerator::generate( PdmObjectFactory* factory, std::vecto } else { - QString valueString; - - // Always make sure the default value for a ptrField is empty string - if ( !field->hasPtrReferencedObjects() ) - { - QTextStream valueStream( &valueString ); - scriptability->readFromField( valueStream, true, true ); - } - if ( valueString.isEmpty() ) valueString = QString( "\"\"" ); - valueString = pythonifyDataValue( valueString ); + QString valueString = getDefaultValue( field ); QString fieldCode = QString( " self.%1 = %2\n" ).arg( snake_field_name ).arg( valueString ); @@ -264,16 +255,20 @@ QString caf::PdmPythonGenerator::generate( PdmObjectFactory* factory, std::vecto QStringList argumentComments; outputArgumentStrings.push_back( QString( "\"%1\"" ).arg( methodName ) ); - QString returnComment = method->defaultResult()->xmlCapability()->classKeyword(); + QString returnComment; + if ( method->defaultResult() ) returnComment = method->defaultResult()->xmlCapability()->classKeyword(); for ( auto field : arguments ) { - bool isList = field->xmlCapability()->isVectorField(); - QString defaultValue = isList ? "[]" : "None"; - auto scriptability = field->capability(); - auto argumentName = camelToSnakeCase( scriptability->scriptFieldName() ); - auto dataType = dataTypeString( field, false ); + auto scriptability = field->capability(); + auto argumentName = camelToSnakeCase( scriptability->scriptFieldName() ); + auto dataType = dataTypeString( field, false ); + + bool isList = field->xmlCapability()->isVectorField(); if ( isList ) dataType = "List of " + dataType; + + QString defaultValue = getDefaultValue( field ); + inputArgumentStrings.push_back( QString( "%1=%2" ).arg( argumentName ).arg( defaultValue ) ); outputArgumentStrings.push_back( QString( "%1=%1" ).arg( argumentName ) ); argumentComments.push_back( @@ -406,6 +401,39 @@ QString caf::PdmPythonGenerator::generate( PdmObjectFactory* factory, std::vecto return generatedCode; } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +QString PdmPythonGenerator::getDefaultValue( PdmFieldHandle* field ) +{ + QString defaultValue = "None"; + + bool isList = field->xmlCapability()->isVectorField(); + if ( isList ) + { + defaultValue = "[]"; + } + else + { + QString valueString; + + // Always make sure the default value for a ptrField is empty string + if ( !field->hasPtrReferencedObjects() ) + { + auto scriptability = field->template capability(); + + QTextStream valueStream( &valueString ); + scriptability->readFromField( valueStream, true, true ); + } + if ( valueString.isEmpty() ) valueString = QString( "\"\"" ); + valueString = pythonifyDataValue( valueString ); + + defaultValue = valueString; + } + + return defaultValue; +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- diff --git a/Fwk/AppFwk/cafPdmScripting/cafPdmPythonGenerator.h b/Fwk/AppFwk/cafPdmScripting/cafPdmPythonGenerator.h index f4068e84a8..640057c0bb 100644 --- a/Fwk/AppFwk/cafPdmScripting/cafPdmPythonGenerator.h +++ b/Fwk/AppFwk/cafPdmScripting/cafPdmPythonGenerator.h @@ -54,6 +54,9 @@ class PdmPythonGenerator : public PdmCodeGenerator static QString dataTypeString( const PdmFieldHandle* field, bool useStrForUnknownDataTypes ); static QString pythonifyDataValue( const QString& dataValue ); + +private: + static QString getDefaultValue( PdmFieldHandle* field ); }; } // namespace caf diff --git a/GrpcInterface/GrpcProtos/App.proto b/GrpcInterface/GrpcProtos/App.proto index 2778ec5550..8bf88cbc5b 100644 --- a/GrpcInterface/GrpcProtos/App.proto +++ b/GrpcInterface/GrpcProtos/App.proto @@ -3,11 +3,13 @@ syntax = "proto3"; package rips; import "Definitions.proto"; +import "PdmObject.proto"; service App { rpc GetVersion(Empty) returns (Version) {} rpc Exit(Empty) returns (Empty) {} rpc GetRuntimeInfo(Empty) returns (RuntimeInfo) {} + rpc GetPdmObject(Empty) returns (PdmObject) {} } message Version { diff --git a/GrpcInterface/Python/rips/PythonExamples/generate_ensemble_surface.py b/GrpcInterface/Python/rips/PythonExamples/generate_ensemble_surface.py index 18277cca1a..e301aca8df 100644 --- a/GrpcInterface/Python/rips/PythonExamples/generate_ensemble_surface.py +++ b/GrpcInterface/Python/rips/PythonExamples/generate_ensemble_surface.py @@ -13,6 +13,7 @@ export_folder = tempfile.mkdtemp() directory_path = "resprojects/webviz-subsurface-testdata/reek_history_match/" +# directory_path = "e:/gitroot/webviz-subsurface-testdata/reek_history_match" case_file_paths = [] diff --git a/GrpcInterface/Python/rips/PythonExamples/generate_ensemble_surface_optimized.py b/GrpcInterface/Python/rips/PythonExamples/generate_ensemble_surface_optimized.py new file mode 100644 index 0000000000..388221786d --- /dev/null +++ b/GrpcInterface/Python/rips/PythonExamples/generate_ensemble_surface_optimized.py @@ -0,0 +1,41 @@ +# Load ResInsight Processing Server Client Library +import rips +import tempfile +from os.path import expanduser +from pathlib import Path + +# Connect to ResInsight instance +resinsight = rips.Instance.find() + + +home_dir = expanduser("~") + +export_folder = tempfile.mkdtemp() + +directory_path = "resprojects/webviz-subsurface-testdata/reek_history_match/" +# directory_path = "e:/gitroot/webviz-subsurface-testdata/reek_history_match" + + +case_file_paths = [] +num_realizations = 9 +num_iterations = 4 + + +for realization in range(0, num_realizations): + for iteration in range(0, num_iterations): + realization_dir = "realization-" + str(realization) + iteration_dir = "iter-" + str(iteration) + egrid_name = "eclipse/model/5_R001_REEK-" + str(realization) + ".EGRID" + path = Path( + home_dir, directory_path, realization_dir, iteration_dir, egrid_name + ) + case_file_paths.append(path) + +k_indexes = [4, 10] + +command_router = resinsight.command_router + +for path in case_file_paths: + path_name = path.as_posix() + + command_router.extract_surfaces(path_name, k_indexes) diff --git a/GrpcInterface/Python/rips/instance.py b/GrpcInterface/Python/rips/instance.py index cc6fe76e18..c598530213 100644 --- a/GrpcInterface/Python/rips/instance.py +++ b/GrpcInterface/Python/rips/instance.py @@ -23,6 +23,7 @@ from .project import Project from .retry_policy import ExponentialBackoffRetryPolicy from .grpc_retry_interceptor import RetryOnRpcErrorClientInterceptor +from .generated.generated_classes import CommandRouter class Instance: @@ -202,12 +203,17 @@ def __init__(self, port=50051, launched=False): intercepted_channel = grpc.intercept_channel(self.channel, *interceptors) - # Recreate ommand stubs with the retry policy + # Recreate command stubs with the retry policy self.commands = Commands_pb2_grpc.CommandsStub(intercepted_channel) # Service packages self.project = Project.create(intercepted_channel) + # Command Router object used as entry point for independent processing functions + self.command_router = CommandRouter( + self.app.GetPdmObject(Empty()), intercepted_channel + ) + path = os.getcwd() self.set_start_dir(path=path) diff --git a/GrpcInterface/RiaGrpcAppService.cpp b/GrpcInterface/RiaGrpcAppService.cpp index 17556b510e..5774e52e8e 100644 --- a/GrpcInterface/RiaGrpcAppService.cpp +++ b/GrpcInterface/RiaGrpcAppService.cpp @@ -22,6 +22,8 @@ #include "RiaGrpcServer.h" #include "RiaVersionInfo.h" +#include "ProjectDataModelCommands/CommandRouter/RimCommandRouter.h" + #include //-------------------------------------------------------------------------------------------------- @@ -51,7 +53,7 @@ grpc::Status RiaGrpcAppService::GetRuntimeInfo( grpc::ServerContext* context, const rips::Empty* request, rips::RuntimeInfo* reply ) { rips::ApplicationTypeEnum appType = rips::CONSOLE_APPLICATION; - if ( dynamic_cast(RiaApplication::instance())) + if ( dynamic_cast( RiaApplication::instance() ) ) { appType = rips::GUI_APPLICATION; } @@ -70,7 +72,24 @@ std::vector RiaGrpcAppService::createCallbacks() new RiaGrpcUnaryCallback( this, &Self::Exit, &Self::RequestExit ), new RiaGrpcUnaryCallback( this, &Self::GetRuntimeInfo, - &Self::RequestGetRuntimeInfo ) }; + &Self::RequestGetRuntimeInfo ), + new RiaGrpcUnaryCallback( this, + &Self::GetPdmObject, + &Self::RequestGetPdmObject ) }; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +grpc::Status + RiaGrpcAppService::GetPdmObject( grpc::ServerContext* context, const rips::Empty* request, rips::PdmObject* reply ) +{ + auto* commandRouter = RiaApplication::instance()->commandRouter(); + if ( commandRouter ) + { + copyPdmObjectFromCafToRips( commandRouter, reply ); + } + return grpc::Status::OK; } static bool RiaGrpcAppInfoService_init = diff --git a/GrpcInterface/RiaGrpcAppService.h b/GrpcInterface/RiaGrpcAppService.h index 286064fd07..54e5cefce3 100644 --- a/GrpcInterface/RiaGrpcAppService.h +++ b/GrpcInterface/RiaGrpcAppService.h @@ -46,4 +46,5 @@ class RiaGrpcAppService : public rips::App::AsyncService, public RiaGrpcServiceI grpc::Status Exit( grpc::ServerContext* context, const rips::Empty* request, rips::Empty* reply ) override; grpc::Status GetRuntimeInfo( grpc::ServerContext* context, const rips::Empty* request, rips::RuntimeInfo* reply ) override; std::vector createCallbacks() override; + grpc::Status GetPdmObject( grpc::ServerContext* context, const rips::Empty* request, rips::PdmObject* reply ) override; }; diff --git a/GrpcInterface/RiaGrpcPdmObjectService.cpp b/GrpcInterface/RiaGrpcPdmObjectService.cpp index c52af25c3d..2be5c99584 100644 --- a/GrpcInterface/RiaGrpcPdmObjectService.cpp +++ b/GrpcInterface/RiaGrpcPdmObjectService.cpp @@ -17,7 +17,10 @@ ////////////////////////////////////////////////////////////////////////////////// #include "RiaGrpcPdmObjectService.h" +#include "RiaApplication.h" #include "RiaGrpcCallbacks.h" + +#include "ProjectDataModelCommands/CommandRouter/RimCommandRouter.h" #include "Rim3dView.h" #include "RimEclipseResultDefinition.h" #include "RimProject.h" @@ -613,11 +616,13 @@ caf::PdmObject* RiaGrpcPdmObjectService::findCafObjectFromRipsObject( const rips caf::PdmObject* RiaGrpcPdmObjectService::findCafObjectFromScriptNameAndAddress( const QString& scriptClassName, uint64_t address ) { + QString classKeyword = caf::PdmObjectScriptingCapabilityRegister::classKeywordFromScriptClassName( scriptClassName ); + + if ( classKeyword == RimCommandRouter::classKeywordStatic() ) return RiaApplication::instance()->commandRouter(); + RimProject* project = RimProject::current(); std::vector objectsOfCurrentClass; - QString classKeyword = caf::PdmObjectScriptingCapabilityRegister::classKeywordFromScriptClassName( scriptClassName ); - project->descendantsIncludingThisFromClassKeyword( classKeyword, objectsOfCurrentClass ); caf::PdmObject* matchingObject = nullptr; diff --git a/GrpcInterface/RiaGrpcServiceInterface.cpp b/GrpcInterface/RiaGrpcServiceInterface.cpp index a91366ee57..a7e26290f4 100644 --- a/GrpcInterface/RiaGrpcServiceInterface.cpp +++ b/GrpcInterface/RiaGrpcServiceInterface.cpp @@ -34,7 +34,9 @@ #include #include +#include #include + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- @@ -137,6 +139,16 @@ void RiaGrpcServiceInterface::copyPdmObjectFromRipsToCaf( const rips::PdmObject* destination->fields( fields ); auto parametersMap = source->parameters(); + + bool printContent = false; // Flag to control debug output to debugger + if ( printContent ) + { + for ( const auto& p : parametersMap ) + { + qDebug() << QString::fromStdString( p.first ) << " : " << QString::fromStdString( p.second ); + } + } + for ( auto field : fields ) { auto scriptability = field->template capability(); diff --git a/ThirdParty/custom-opm-common/opm-common/opm/io/eclipse/EGrid.hpp b/ThirdParty/custom-opm-common/opm-common/opm/io/eclipse/EGrid.hpp index 856cd4baa1..2748d9c213 100644 --- a/ThirdParty/custom-opm-common/opm-common/opm/io/eclipse/EGrid.hpp +++ b/ThirdParty/custom-opm-common/opm-common/opm/io/eclipse/EGrid.hpp @@ -48,6 +48,9 @@ class EGrid : public EclFile void getCellCorners(int globindex, std::array& X, std::array& Y, std::array& Z); void getCellCorners(const std::array& ijk, std::array& X, std::array& Y, std::array& Z); + std::vector> getXYZ_layer(int layer, bool bottom=false); + std::vector> getXYZ_layer(int layer, std::array& box, bool bottom=false); + int activeCells() const { return nactive; } int totalNumberOfCells() const { return nijk[0] * nijk[1] * nijk[2]; } @@ -64,11 +67,17 @@ class EGrid : public EclFile const std::vector& list_of_lgrs() const { return lgr_names; } + std::vector get_mapaxes() const { return m_mapaxes; } + std::string get_mapunits() const { return m_mapunits; } + private: Opm::filesystem::path inputFileName, initFileName; std::string m_grid_name; bool m_radial; + std::vector m_mapaxes; + std::string m_mapunits; + std::array nijk; std::array host_nijk; @@ -93,6 +102,12 @@ class EGrid : public EclFile int actnum_array_index; int nnc1_array_index; int nnc2_array_index; + + std::vector get_zcorn_from_disk(int layer, bool bottom); + + void getCellCorners(const std::array& ijk, const std::vector& zcorn_layer, + std::array& X, std::array& Y, std::array& Z); + }; }} // namespace Opm::EclIO diff --git a/ThirdParty/custom-opm-common/opm-common/opm/io/eclipse/EInit.hpp b/ThirdParty/custom-opm-common/opm-common/opm/io/eclipse/EInit.hpp index 82b4afddcc..67fc2b04d3 100644 --- a/ThirdParty/custom-opm-common/opm-common/opm/io/eclipse/EInit.hpp +++ b/ThirdParty/custom-opm-common/opm-common/opm/io/eclipse/EInit.hpp @@ -51,35 +51,7 @@ class EInit : public EclFile protected: template - const std::vector& ImplgetInitData(const std::string& name, const std::string& grid_name = "global") - { - int arr_ind = get_array_index(name, grid_name); - - if constexpr (std::is_same_v) - return getImpl(arr_ind, INTE, inte_array, "integer"); - - if constexpr (std::is_same_v) - return getImpl(arr_ind, REAL, real_array, "float"); - - if constexpr (std::is_same_v) - return getImpl(arr_ind, DOUB, doub_array, "double"); - - if constexpr (std::is_same_v) - return getImpl(arr_ind, LOGI, logi_array, "bool"); - - if constexpr (std::is_same_v) - { - if (array_type[arr_ind] == Opm::EclIO::CHAR) - return getImpl(arr_ind, array_type[arr_ind], char_array, "char"); - - if (array_type[arr_ind] == Opm::EclIO::C0NN) - return getImpl(arr_ind, array_type[arr_ind], char_array, "c0nn"); - - OPM_THROW(std::runtime_error, "Array not of type CHAR or C0nn"); - } - - OPM_THROW(std::runtime_error, "type not supported"); - } + const std::vector& ImplgetInitData(const std::string& name, const std::string& grid_name = "global"); private: std::array global_nijk; diff --git a/ThirdParty/custom-opm-common/opm-common/opm/io/eclipse/ERst.hpp b/ThirdParty/custom-opm-common/opm-common/opm/io/eclipse/ERst.hpp index cd29598843..c66d63b01c 100644 --- a/ThirdParty/custom-opm-common/opm-common/opm/io/eclipse/ERst.hpp +++ b/ThirdParty/custom-opm-common/opm-common/opm/io/eclipse/ERst.hpp @@ -53,9 +53,6 @@ class ERst : public EclFile template const std::vector& getRestartData(const std::string& name, int reportStepNumber, int occurrence); - template - const std::vector& getRestartData(const std::string& name, int reportStepNumber, const std::string& lgr_name); - template const std::vector& getRestartData(int index, int reportStepNumber) { @@ -64,16 +61,10 @@ class ERst : public EclFile } template - const std::vector& getRestartData(int index, int reportStepNumber, const std::string& lgr_name) - { - auto indRange = this->getIndexRange(reportStepNumber); - - if ((std::get<0>(indRange) + index) > std::get<1>(indRange)) - OPM_THROW(std::invalid_argument, "getRestartData, index out of range"); + const std::vector& getRestartData(const std::string& name, int reportStepNumber, const std::string& lgr_name); - int start_ind = get_start_index_lgrname(reportStepNumber, lgr_name); - return this->get(index + start_ind); - } + template + const std::vector& getRestartData(int index, int reportStepNumber, const std::string& lgr_name); int occurrence_count(const std::string& name, int reportStepNumber) const; size_t numberOfReportSteps() const { return seqnum.size(); }; diff --git a/ThirdParty/custom-opm-common/opm-common/opm/io/eclipse/EclFile.hpp b/ThirdParty/custom-opm-common/opm-common/opm/io/eclipse/EclFile.hpp index 18eb6bb0c5..38af36a3e0 100644 --- a/ThirdParty/custom-opm-common/opm-common/opm/io/eclipse/EclFile.hpp +++ b/ThirdParty/custom-opm-common/opm-common/opm/io/eclipse/EclFile.hpp @@ -19,11 +19,10 @@ #ifndef OPM_IO_ECLFILE_HPP #define OPM_IO_ECLFILE_HPP -#include - #include #include +#include #include #include #include @@ -97,19 +96,7 @@ class EclFile template const std::vector& getImpl(int arrIndex, eclArrType type, const std::unordered_map>& array, - const std::string& typeStr) - { - if (array_type[arrIndex] != type) { - std::string message = "Array with index " + std::to_string(arrIndex) + " is not of type " + typeStr; - OPM_THROW(std::runtime_error, message); - } - - if (!arrayLoaded[arrIndex]) { - loadData(arrIndex); - } - - return array.at(arrIndex); - } + const std::string& typeStr); std::streampos seekPosition(const std::vector::size_type arrIndex) const; diff --git a/ThirdParty/custom-opm-common/opm-common/src/opm/io/eclipse/EGrid.cpp b/ThirdParty/custom-opm-common/opm-common/src/opm/io/eclipse/EGrid.cpp index 44d4b5c1ed..ca5c283a42 100644 --- a/ThirdParty/custom-opm-common/opm-common/src/opm/io/eclipse/EGrid.cpp +++ b/ThirdParty/custom-opm-common/opm-common/src/opm/io/eclipse/EGrid.cpp @@ -3,9 +3,8 @@ This file is part of the Open Porous Media project (OPM). - OPM 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. + OPM 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. OPM is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -24,336 +23,549 @@ #include #include -#include #include +#include #include -#include #include +#include +#include #define _USE_MATH_DEFINES #include -namespace Opm { namespace EclIO { +namespace Opm +{ +namespace EclIO +{ -using NNCentry = std::tuple; + using NNCentry = std::tuple; -EGrid::EGrid(const std::string &filename, std::string grid_name) : - EclFile(filename), inputFileName { filename }, m_grid_name {grid_name} -{ - initFileName = inputFileName.parent_path() / inputFileName.stem(); + EGrid::EGrid(const std::string& filename, std::string grid_name) + : EclFile(filename) + , inputFileName {filename} + , m_grid_name {grid_name} + { + initFileName = inputFileName.parent_path() / inputFileName.stem(); - if (this->formattedInput()) - initFileName += ".FINIT"; - else - initFileName += ".INIT"; + if (this->formattedInput()) + initFileName += ".FINIT"; + else + initFileName += ".INIT"; - std::string lgrname = "global"; + std::string lgrname = "global"; - m_nncs_loaded = false; - actnum_array_index = -1; - nnc1_array_index = -1; - nnc2_array_index = -1; - m_radial = false; + m_nncs_loaded = false; + actnum_array_index = -1; + nnc1_array_index = -1; + nnc2_array_index = -1; + m_radial = false; + m_mapunits = ""; - int hostnum_index = -1; + int hostnum_index = -1; - for (size_t n = 0; n < array_name.size(); n++) { + for (size_t n = 0; n < array_name.size(); n++) { - if (array_name[n] == "ENDLGR") - lgrname = "global"; + if (array_name[n] == "ENDLGR") + lgrname = "global"; - if (array_name[n] == "LGR") { - auto lgr = this->get(n); - lgrname = lgr[0]; - lgr_names.push_back(lgr[0]); - } + if (array_name[n] == "LGR") { + auto lgr = this->get(n); + lgrname = lgr[0]; + lgr_names.push_back(lgr[0]); + } - if (array_name[n] == "NNCHEAD"){ - auto nnchead = this->get(n); + if (array_name[n] == "NNCHEAD") { + auto nnchead = this->get(n); - if (nnchead[1] == 0) - lgrname = "global"; - else - lgrname = lgr_names[nnchead[1] - 1]; - } + if (nnchead[1] == 0) + lgrname = "global"; + else + lgrname = lgr_names[nnchead[1] - 1]; + } - if (lgrname == grid_name) { - if (array_name[n] == "GRIDHEAD") { + if (array_name[n] == "MAPUNITS") { + auto mapunits = this->get(n); + m_mapunits = mapunits[0]; + } + + if (array_name[n] == "MAPAXES") + m_mapaxes = this->get(n); + + if (lgrname == grid_name) { + if (array_name[n] == "GRIDHEAD") { + auto gridhead = get(n); + nijk[0] = gridhead[1]; + nijk[1] = gridhead[2]; + nijk[2] = gridhead[3]; + + if (gridhead.size() > 26) + m_radial = gridhead[26] > 0 ? true : false; + } + + if (array_name[n] == "COORD") + coord_array_index = n; + else if (array_name[n] == "ZCORN") + zcorn_array_index = n; + else if (array_name[n] == "ACTNUM") + actnum_array_index = n; + else if (array_name[n] == "NNC1") + nnc1_array_index = n; + else if (array_name[n] == "NNC2") + nnc2_array_index = n; + else if (array_name[n] == "HOSTNUM") + hostnum_index = n; + } + + if ((lgrname == "global") && (array_name[n] == "GRIDHEAD")) { auto gridhead = get(n); - nijk[0] = gridhead[1]; - nijk[1] = gridhead[2]; - nijk[2] = gridhead[3]; + host_nijk[0] = gridhead[1]; + host_nijk[1] = gridhead[2]; + host_nijk[2] = gridhead[3]; + } + } - if (gridhead.size() > 26) - m_radial = gridhead[26] > 0 ? true: false; + if (actnum_array_index != -1) { + auto actnum = this->get(actnum_array_index); + nactive = 0; + for (size_t i = 0; i < actnum.size(); i++) { + if (actnum[i] > 0) { + act_index.push_back(nactive); + glob_index.push_back(i); + nactive++; + } else { + act_index.push_back(-1); + } } + } else { + int nCells = nijk[0] * nijk[1] * nijk[2]; + act_index.resize(nCells); + glob_index.resize(nCells); + std::iota(act_index.begin(), act_index.end(), 0); + std::iota(glob_index.begin(), glob_index.end(), 0); + } - if (array_name[n] == "COORD") - coord_array_index= n; - else if (array_name[n] == "ZCORN") - zcorn_array_index= n; - else if (array_name[n] == "ACTNUM") - actnum_array_index= n; - else if (array_name[n] == "NNC1") - nnc1_array_index= n; - else if (array_name[n] == "NNC2") - nnc2_array_index= n; - else if (array_name[n] == "HOSTNUM") - hostnum_index= n; + if (hostnum_index > -1) { + auto hostnum = getImpl(hostnum_index, INTE, inte_array, "integer"); + host_cells.reserve(hostnum.size()); + + for (auto val : hostnum) + host_cells.push_back(val - 1); } + } + + std::vector> EGrid::hostCellsIJK() + { + std::vector> res_vect; + res_vect.reserve(host_cells.size()); - if ((lgrname == "global") && (array_name[n] == "GRIDHEAD")) { - auto gridhead = get(n); - host_nijk[0] = gridhead[1]; - host_nijk[1] = gridhead[2]; - host_nijk[2] = gridhead[3]; + for (auto val : host_cells) { + std::array tmp; + tmp[2] = val / (host_nijk[0] * host_nijk[1]); + int rest = val % (host_nijk[0] * host_nijk[1]); + + tmp[1] = rest / host_nijk[0]; + tmp[0] = rest % host_nijk[0]; + + res_vect.push_back(tmp); } + return res_vect; } - if (actnum_array_index != -1) { - auto actnum = this->get(actnum_array_index); - nactive = 0; - for (size_t i = 0; i < actnum.size(); i++) { - if (actnum[i] > 0) { - act_index.push_back(nactive); - glob_index.push_back(i); - nactive++; - } else { - act_index.push_back(-1); + std::vector EGrid::get_nnc_ijk() + { + if (!m_nncs_loaded) + load_nnc_data(); + + std::vector res_vect; + res_vect.reserve(nnc1_array.size()); + + for (size_t n = 0; n < nnc1_array.size(); n++) { + auto ijk1 = ijk_from_global_index(nnc1_array[n] - 1); + auto ijk2 = ijk_from_global_index(nnc2_array[n] - 1); + + if (transnnc_array.size() > 0) + res_vect.push_back({ijk1[0], ijk1[1], ijk1[2], ijk2[0], ijk2[1], ijk2[2], transnnc_array[n]}); + else + res_vect.push_back({ijk1[0], ijk1[1], ijk1[2], ijk2[0], ijk2[1], ijk2[2], -1.0}); + } + + return res_vect; + } + + + void EGrid::load_grid_data() + { + coord_array = getImpl(coord_array_index, REAL, real_array, "float"); + zcorn_array = getImpl(zcorn_array_index, REAL, real_array, "float"); + } + + void EGrid::load_nnc_data() + { + if ((nnc1_array_index > -1) && (nnc2_array_index > -1)) { + + nnc1_array = getImpl(nnc1_array_index, Opm::EclIO::INTE, inte_array, "inte"); + nnc2_array = getImpl(nnc2_array_index, Opm::EclIO::INTE, inte_array, "inte"); + + if ((Opm::filesystem::exists(initFileName)) && (nnc1_array.size() > 0)) { + Opm::EclIO::EInit init(initFileName.string()); + + auto init_dims = init.grid_dimension(m_grid_name); + int init_nactive = init.activeCells(m_grid_name); + + if (init_dims != nijk) { + std::string message = "Dimensions of Egrid differ from dimensions found in init file. "; + std::string grid_str + = std::to_string(nijk[0]) + "x" + std::to_string(nijk[1]) + "x" + std::to_string(nijk[2]); + std::string init_str = std::to_string(init_dims[0]) + "x" + std::to_string(init_dims[1]) + "x" + + std::to_string(init_dims[2]); + message = message + "Egrid: " + grid_str + ". INIT file: " + init_str; + OPM_THROW(std::invalid_argument, message); + } + + if (init_nactive != nactive) { + std::string message = "Number of active cells are different in Egrid and Init file."; + message = message + " Egrid: " + std::to_string(nactive) + + ". INIT file: " + std::to_string(init_nactive); + OPM_THROW(std::invalid_argument, message); + } + + auto trans_data = init.getInitData("TRANNNC", m_grid_name); + + if (trans_data.size() != nnc1_array.size()) { + std::string message = "inconsistent size of array TRANNNC in init file. "; + message = message + " Size of NNC1 and NNC2: " + std::to_string(nnc1_array.size()); + message = message + " Size of TRANNNC: " + std::to_string(trans_data.size()); + OPM_THROW(std::invalid_argument, message); + } + + transnnc_array = trans_data; } + + m_nncs_loaded = true; } - } else { - int nCells = nijk[0] * nijk[1] * nijk[2]; - act_index.resize(nCells); - glob_index.resize(nCells); - std::iota(act_index.begin(), act_index.end(), 0); - std::iota(glob_index.begin(), glob_index.end(), 0); } - if (hostnum_index > -1){ - auto hostnum = getImpl(hostnum_index, INTE, inte_array, "integer"); - host_cells.reserve(hostnum.size()); + int EGrid::global_index(int i, int j, int k) const + { + if (i < 0 || i >= nijk[0] || j < 0 || j >= nijk[1] || k < 0 || k >= nijk[2]) { + OPM_THROW(std::invalid_argument, "i, j or/and k out of range"); + } - for (auto val : hostnum) - host_cells.push_back(val -1); + return i + j * nijk[0] + k * nijk[0] * nijk[1]; } -} -std::vector> EGrid::hostCellsIJK() -{ - std::vector> res_vect; - res_vect.reserve(host_cells.size()); - for (auto val : host_cells){ - std::array tmp; - tmp[2] = val / (host_nijk[0] * host_nijk[1]); - int rest = val % (host_nijk[0] * host_nijk[1]); + int EGrid::active_index(int i, int j, int k) const + { + int n = i + j * nijk[0] + k * nijk[0] * nijk[1]; - tmp[1] = rest / host_nijk[0]; - tmp[0] = rest % host_nijk[0]; + if (i < 0 || i >= nijk[0] || j < 0 || j >= nijk[1] || k < 0 || k >= nijk[2]) { + OPM_THROW(std::invalid_argument, "i, j or/and k out of range"); + } - res_vect.push_back(tmp); + return act_index[n]; } - return res_vect; -} -std::vector EGrid::get_nnc_ijk() -{ - if (!m_nncs_loaded) - load_nnc_data(); + std::array EGrid::ijk_from_active_index(int actInd) const + { + if (actInd < 0 || actInd >= nactive) { + OPM_THROW(std::invalid_argument, "active index out of range"); + } - std::vector res_vect; - res_vect.reserve(nnc1_array.size()); + int _glob = glob_index[actInd]; - for (size_t n=0; n< nnc1_array.size(); n++){ - auto ijk1 = ijk_from_global_index(nnc1_array[n] - 1); - auto ijk2 = ijk_from_global_index(nnc2_array[n] - 1); + std::array result; + result[2] = _glob / (nijk[0] * nijk[1]); - if (transnnc_array.size() > 0) - res_vect.push_back({ijk1[0], ijk1[1], ijk1[2], ijk2[0], ijk2[1], ijk2[2], transnnc_array[n]}); - else - res_vect.push_back({ijk1[0], ijk1[1], ijk1[2], ijk2[0], ijk2[1], ijk2[2], -1.0 }); + int rest = _glob % (nijk[0] * nijk[1]); + + result[1] = rest / nijk[0]; + result[0] = rest % nijk[0]; + + return result; } - return res_vect; -} + std::array EGrid::ijk_from_global_index(int globInd) const + { + if (globInd < 0 || globInd >= nijk[0] * nijk[1] * nijk[2]) { + OPM_THROW(std::invalid_argument, "global index out of range"); + } -void EGrid::load_grid_data() -{ - coord_array = getImpl(coord_array_index, REAL, real_array, "float"); - zcorn_array = getImpl(zcorn_array_index, REAL, real_array, "float"); -} + std::array result; + result[2] = globInd / (nijk[0] * nijk[1]); -void EGrid::load_nnc_data() -{ - if ((nnc1_array_index > -1) && (nnc2_array_index > -1)) { + int rest = globInd % (nijk[0] * nijk[1]); - nnc1_array = getImpl(nnc1_array_index, Opm::EclIO::INTE, inte_array, "inte"); - nnc2_array = getImpl(nnc2_array_index, Opm::EclIO::INTE, inte_array, "inte"); + result[1] = rest / nijk[0]; + result[0] = rest % nijk[0]; - if ((Opm::filesystem::exists(initFileName)) && (nnc1_array.size() > 0)){ - Opm::EclIO::EInit init(initFileName.string()); + return result; + } - auto init_dims = init.grid_dimension(m_grid_name); - int init_nactive = init.activeCells(m_grid_name); - if (init_dims != nijk){ - std::string message = "Dimensions of Egrid differ from dimensions found in init file. "; - std::string grid_str = std::to_string(nijk[0]) + "x" + std::to_string(nijk[1]) + "x" + std::to_string(nijk[2]); - std::string init_str = std::to_string(init_dims[0]) + "x" + std::to_string(init_dims[1]) + "x" + std::to_string(init_dims[2]); - message = message + "Egrid: " + grid_str + ". INIT file: " + init_str; - OPM_THROW(std::invalid_argument, message); + void EGrid::getCellCorners(const std::array& ijk, + std::array& X, + std::array& Y, + std::array& Z) + { + if (coord_array.empty()) + load_grid_data(); + + std::vector zind; + std::vector pind; + + // calculate indices for grid pillars in COORD arrray + pind.push_back(ijk[1] * (nijk[0] + 1) * 6 + ijk[0] * 6); + pind.push_back(pind[0] + 6); + pind.push_back(pind[0] + (nijk[0] + 1) * 6); + pind.push_back(pind[2] + 6); + + // get depths from zcorn array in ZCORN array + zind.push_back(ijk[2] * nijk[0] * nijk[1] * 8 + ijk[1] * nijk[0] * 4 + ijk[0] * 2); + zind.push_back(zind[0] + 1); + zind.push_back(zind[0] + nijk[0] * 2); + zind.push_back(zind[2] + 1); + + for (int n = 0; n < 4; n++) + zind.push_back(zind[n] + nijk[0] * nijk[1] * 4); + + for (int n = 0; n < 8; n++) + Z[n] = zcorn_array[zind[n]]; + + for (int n = 0; n < 4; n++) { + double xt; + double yt; + double xb; + double yb; + + double zt = coord_array[pind[n] + 2]; + double zb = coord_array[pind[n] + 5]; + + if (m_radial) { + xt = coord_array[pind[n]] * cos(coord_array[pind[n] + 1] / 180.0 * M_PI); + yt = coord_array[pind[n]] * sin(coord_array[pind[n] + 1] / 180.0 * M_PI); + xb = coord_array[pind[n] + 3] * cos(coord_array[pind[n] + 4] / 180.0 * M_PI); + yb = coord_array[pind[n] + 3] * sin(coord_array[pind[n] + 4] / 180.0 * M_PI); + } else { + xt = coord_array[pind[n]]; + yt = coord_array[pind[n] + 1]; + xb = coord_array[pind[n] + 3]; + yb = coord_array[pind[n] + 4]; } - if (init_nactive != nactive){ - std::string message = "Number of active cells are different in Egrid and Init file."; - message = message + " Egrid: " + std::to_string(nactive) + ". INIT file: " + std::to_string(init_nactive); - OPM_THROW(std::invalid_argument, message); - } + X[n] = xt + (xb - xt) / (zt - zb) * (zt - Z[n]); + X[n + 4] = xt + (xb - xt) / (zt - zb) * (zt - Z[n + 4]); + + Y[n] = yt + (yb - yt) / (zt - zb) * (zt - Z[n]); + Y[n + 4] = yt + (yb - yt) / (zt - zb) * (zt - Z[n + 4]); + } + } - auto trans_data = init.getInitData("TRANNNC", m_grid_name); - if (trans_data.size() != nnc1_array.size()){ - std::string message = "inconsistent size of array TRANNNC in init file. "; - message = message + " Size of NNC1 and NNC2: " + std::to_string(nnc1_array.size()); - message = message + " Size of TRANNNC: " + std::to_string(trans_data.size()); - OPM_THROW(std::invalid_argument, message); - } - transnnc_array = trans_data; + void + EGrid::getCellCorners(int globindex, std::array& X, std::array& Y, std::array& Z) + { + return getCellCorners(ijk_from_global_index(globindex), X, Y, Z); + } + + + std::vector> EGrid::getXYZ_layer(int layer, std::array& box, bool bottom) + { + // layer is layer index, zero based. The box array is i and j range (i1,i2,j1,j2), also zero based + + if ((layer < 0) || (layer > (nijk[2] - 1))) { + std::string message = "invalid layer index " + std::to_string(layer) + ". Valied range [0, "; + message = message + std::to_string(nijk[2] - 1) + "]"; + throw std::invalid_argument(message); + } + + if ((box[0] < 0) || (box[0] + 1 > nijk[0]) || (box[1] < 0) || (box[1] + 1 > nijk[0]) || (box[2] < 0) + || (box[2] + 1 > nijk[1]) || (box[3] < 0) || (box[3] + 1 > nijk[1]) || (box[0] > box[1]) + || (box[2] > box[3])) { + + throw std::invalid_argument("invalid box input, i1,i2,j1 or j2 out of valied range "); + } + + int nodes_pr_surf = nijk[0] * nijk[1] * 4; + int zcorn_offset = nodes_pr_surf * layer * 2; + + if (bottom) + zcorn_offset += nodes_pr_surf; + + std::vector layer_zcorn; + layer_zcorn.reserve(nodes_pr_surf); + + std::vector> xyz_vector; + + if (coord_array.size() == 0) + coord_array = getImpl(coord_array_index, REAL, real_array, "float"); + + if (zcorn_array.size() > 0) { + for (size_t n = 0; n < static_cast(nodes_pr_surf); n++) + layer_zcorn.push_back(zcorn_array[zcorn_offset + n]); + + } else { + layer_zcorn = get_zcorn_from_disk(layer, bottom); + } + + std::array X; + std::array Y; + std::array Z; + + std::array ijk; + ijk[2] = 0; + + for (int j = box[2]; j < (box[3] + 1); j++) { + for (int i = box[0]; i < (box[1] + 1); i++) { + + ijk[0] = i; + ijk[1] = j; + + this->getCellCorners(ijk, layer_zcorn, X, Y, Z); + + for (size_t n = 0; n < 4; n++) { + std::array xyz; + xyz[0] = X[n]; + xyz[1] = Y[n]; + xyz[2] = Z[n]; + + xyz_vector.push_back(xyz); + } + } } - m_nncs_loaded = true; + return xyz_vector; } -} -int EGrid::global_index(int i, int j, int k) const -{ - if (i < 0 || i >= nijk[0] || j < 0 || j >= nijk[1] || k < 0 || k >= nijk[2]) { - OPM_THROW(std::invalid_argument, "i, j or/and k out of range"); + + std::vector> EGrid::getXYZ_layer(int layer, bool bottom) + { + std::array box = {0, nijk[0] - 1, 0, nijk[1] - 1}; + return this->getXYZ_layer(layer, box, bottom); } - return i + j * nijk[0] + k * nijk[0] * nijk[1]; -} + std::vector EGrid::get_zcorn_from_disk(int layer, bool bottom) + { + if (formatted) + throw std::invalid_argument("partial loading of zcorn arrays not possible when using formatted input"); + std::vector zcorn_layer; + std::fstream fileH; -int EGrid::active_index(int i, int j, int k) const -{ - int n = i + j * nijk[0] + k * nijk[0] * nijk[1]; + int nodes_pr_surf = nijk[0] * nijk[1] * 4; + int zcorn_offset = nodes_pr_surf * layer * 2; - if (i < 0 || i >= nijk[0] || j < 0 || j >= nijk[1] || k < 0 || k >= nijk[2]) { - OPM_THROW(std::invalid_argument, "i, j or/and k out of range"); - } + if (bottom) + zcorn_offset += nodes_pr_surf; - return act_index[n]; -} + fileH.open(inputFileName, std::ios::in | std::ios::binary); + if (!fileH) + throw std::runtime_error("Can not open EGrid file" + this->inputFilename); -std::array EGrid::ijk_from_active_index(int actInd) const -{ - if (actInd < 0 || actInd >= nactive) { - OPM_THROW(std::invalid_argument, "active index out of range"); - } + std::string arrName(8, ' '); + eclArrType arrType; + int64_t num; + int sizeOfElement; - int _glob = glob_index[actInd]; + uint64_t zcorn_pos = 0; - std::array result; - result[2] = _glob / (nijk[0] * nijk[1]); + while (!isEOF(&fileH)) { - int rest = _glob % (nijk[0] * nijk[1]); + readBinaryHeader(fileH, arrName, num, arrType, sizeOfElement); - result[1] = rest / nijk[0]; - result[0] = rest % nijk[0]; + if (arrName == "ZCORN ") { + zcorn_pos = fileH.tellg(); + break; + } - return result; -} + uint64_t sizeOfNextArray = sizeOnDiskBinary(num, arrType, sizeOfElement); + fileH.seekg(static_cast(sizeOfNextArray), std::ios_base::cur); + } + int elements_pr_block = Opm::EclIO::MaxBlockSizeReal / Opm::EclIO::sizeOfReal; + int num_blocks_start = zcorn_offset / elements_pr_block; -std::array EGrid::ijk_from_global_index(int globInd) const -{ - if (globInd < 0 || globInd >= nijk[0] * nijk[1] * nijk[2]) { - OPM_THROW(std::invalid_argument, "global index out of range"); - } + // adding size of zcorn real data before to ignored + uint64_t start_pos = zcorn_pos + Opm::EclIO::sizeOfReal * zcorn_offset; - std::array result; - result[2] = globInd / (nijk[0] * nijk[1]); + // adding size of blocks (head and tail flags) + start_pos = start_pos + (1 + num_blocks_start * 2) * Opm::EclIO::sizeOfInte; - int rest = globInd % (nijk[0] * nijk[1]); + fileH.seekg(start_pos, std::ios_base::beg); - result[1] = rest / nijk[0]; - result[0] = rest % nijk[0]; + float value; + int zcorn_to = zcorn_offset + nodes_pr_surf; - return result; -} + for (int ind = zcorn_offset; ind < zcorn_to; ind++) { + if ((ind > 0) && ((ind % elements_pr_block) == 0)) + fileH.seekg(static_cast(2 * Opm::EclIO::sizeOfInte), std::ios_base::cur); + + fileH.read(reinterpret_cast(&value), Opm::EclIO::sizeOfReal); + value = Opm::EclIO::flipEndianFloat(value); + + zcorn_layer.push_back(value); + } + + fileH.close(); + + return zcorn_layer; + } + + void EGrid::getCellCorners(const std::array& ijk, + const std::vector& zcorn_layer, + std::array& X, + std::array& Y, + std::array& Z) + { + std::vector zind; + std::vector pind; + + // calculate indices for grid pillars in COORD arrray + pind.push_back(ijk[1] * (nijk[0] + 1) * 6 + ijk[0] * 6); + pind.push_back(pind[0] + 6); + pind.push_back(pind[0] + (nijk[0] + 1) * 6); + pind.push_back(pind[2] + 6); + + // get depths from zcorn array in ZCORN array + zind.push_back(ijk[2] * nijk[0] * nijk[1] * 8 + ijk[1] * nijk[0] * 4 + ijk[0] * 2); + zind.push_back(zind[0] + 1); + zind.push_back(zind[0] + nijk[0] * 2); + zind.push_back(zind[2] + 1); + + for (int n = 0; n < 4; n++) + Z[n] = zcorn_layer[zind[n]]; + + for (int n = 0; n < 4; n++) { + double xt; + double yt; + double xb; + double yb; + + double zt = coord_array[pind[n] + 2]; + double zb = coord_array[pind[n] + 5]; -void EGrid::getCellCorners(const std::array& ijk, - std::array& X, - std::array& Y, - std::array& Z) -{ - if (coord_array.empty()) - load_grid_data(); - - std::vector zind; - std::vector pind; - - // calculate indices for grid pillars in COORD arrray - pind.push_back(ijk[1]*(nijk[0]+1)*6 + ijk[0]*6); - pind.push_back(pind[0] + 6); - pind.push_back(pind[0] + (nijk[0]+1)*6); - pind.push_back(pind[2] + 6); - - // get depths from zcorn array in ZCORN array - zind.push_back(ijk[2]*nijk[0]*nijk[1]*8 + ijk[1]*nijk[0]*4 + ijk[0]*2); - zind.push_back(zind[0] + 1); - zind.push_back(zind[0] + nijk[0]*2); - zind.push_back(zind[2] + 1); - - for (int n = 0; n < 4; n++) - zind.push_back(zind[n] + nijk[0]*nijk[1]*4); - - for (int n = 0; n< 8; n++) - Z[n] = zcorn_array[zind[n]]; - - for (int n = 0; n < 4; n++) { - double xt; - double yt; - double xb; - double yb; - - double zt = coord_array[pind[n] + 2]; - double zb = coord_array[pind[n] + 5]; - - if (m_radial) { - xt = coord_array[pind[n]] * cos(coord_array[pind[n] + 1] / 180.0 * M_PI); - yt = coord_array[pind[n]] * sin(coord_array[pind[n] + 1] / 180.0 * M_PI); - xb = coord_array[pind[n]+3] * cos(coord_array[pind[n] + 4] / 180.0 * M_PI); - yb = coord_array[pind[n]+3] * sin(coord_array[pind[n] + 4] / 180.0 * M_PI); - } else { xt = coord_array[pind[n]]; yt = coord_array[pind[n] + 1]; xb = coord_array[pind[n] + 3]; yb = coord_array[pind[n] + 4]; - } - X[n] = xt + (xb-xt) / (zt-zb) * (zt - Z[n]); - X[n+4] = xt + (xb-xt) / (zt-zb) * (zt-Z[n+4]); - - Y[n] = yt+(yb-yt)/(zt-zb)*(zt-Z[n]); - Y[n+4] = yt+(yb-yt)/(zt-zb)*(zt-Z[n+4]); + if (zt == zb) { + X[n] = xt; + Y[n] = yt; + } else { + X[n] = xt + (xb - xt) / (zt - zb) * (zt - Z[n]); + Y[n] = yt + (yb - yt) / (zt - zb) * (zt - Z[n]); + } + } } -} - -void EGrid::getCellCorners(int globindex, std::array& X, - std::array& Y, std::array& Z) -{ - return getCellCorners(ijk_from_global_index(globindex),X,Y,Z); -} -}} // namespace Opm::ecl +} // namespace EclIO +} // namespace Opm diff --git a/ThirdParty/custom-opm-common/opm-common/src/opm/io/eclipse/EInit.cpp b/ThirdParty/custom-opm-common/opm-common/src/opm/io/eclipse/EInit.cpp index 5754109454..d2af9f3868 100644 --- a/ThirdParty/custom-opm-common/opm-common/src/opm/io/eclipse/EInit.cpp +++ b/ThirdParty/custom-opm-common/opm-common/src/opm/io/eclipse/EInit.cpp @@ -157,5 +157,40 @@ std::vector EInit::list_arrays() const return array_list; } +template +const std::vector& EInit::ImplgetInitData(const std::string& name, const std::string& grid_name) +{ + int arr_ind = get_array_index(name, grid_name); + + if constexpr (std::is_same_v) + return getImpl(arr_ind, INTE, inte_array, "integer"); + + if constexpr (std::is_same_v) + return getImpl(arr_ind, REAL, real_array, "float"); + + if constexpr (std::is_same_v) + return getImpl(arr_ind, DOUB, doub_array, "double"); + + if constexpr (std::is_same_v) + return getImpl(arr_ind, LOGI, logi_array, "bool"); + + if constexpr (std::is_same_v) + { + if (array_type[arr_ind] == Opm::EclIO::CHAR) + return getImpl(arr_ind, array_type[arr_ind], char_array, "char"); + + if (array_type[arr_ind] == Opm::EclIO::C0NN) + return getImpl(arr_ind, array_type[arr_ind], char_array, "c0nn"); + + OPM_THROW(std::runtime_error, "Array not of type CHAR or C0nn"); + } + + OPM_THROW(std::runtime_error, "type not supported"); +} + +template const std::vector& EInit::ImplgetInitData(const std::string& name, const std::string& grid_name); +template const std::vector& EInit::ImplgetInitData(const std::string& name, const std::string& grid_name); +template const std::vector& EInit::ImplgetInitData(const std::string& name, const std::string& grid_name); +template const std::vector& EInit::ImplgetInitData(const std::string& name, const std::string& grid_name); }} // namespace Opm::EclIO diff --git a/ThirdParty/custom-opm-common/opm-common/src/opm/io/eclipse/ERst.cpp b/ThirdParty/custom-opm-common/opm-common/src/opm/io/eclipse/ERst.cpp index b4964bb920..268a3f7a45 100644 --- a/ThirdParty/custom-opm-common/opm-common/src/opm/io/eclipse/ERst.cpp +++ b/ThirdParty/custom-opm-common/opm-common/src/opm/io/eclipse/ERst.cpp @@ -18,6 +18,8 @@ #include +#include + #include #include #include @@ -407,5 +409,22 @@ const std::vector& ERst::getRestartData(const std::str return getImpl(ind, CHAR, char_array, "char"); } +template +const std::vector& ERst::getRestartData(int index, int reportStepNumber, const std::string& lgr_name) +{ + auto indRange = this->getIndexRange(reportStepNumber); + + if ((std::get<0>(indRange) + index) > std::get<1>(indRange)) + OPM_THROW(std::invalid_argument, "getRestartData, index out of range"); + + int start_ind = get_start_index_lgrname(reportStepNumber, lgr_name); + return this->get(index + start_ind); +} + +template const std::vector& ERst::getRestartData(int index, int reportStepNumber, const std::string& lgr_name); +template const std::vector& ERst::getRestartData(int index, int reportStepNumber, const std::string& lgr_name); +template const std::vector& ERst::getRestartData(int index, int reportStepNumber, const std::string& lgr_name); +template const std::vector& ERst::getRestartData(int index, int reportStepNumber, const std::string& lgr_name); +template const std::vector& ERst::getRestartData(int index, int reportStepNumber, const std::string& lgr_name); }} // namespace Opm::ecl diff --git a/ThirdParty/custom-opm-common/opm-common/src/opm/io/eclipse/ESmry.cpp b/ThirdParty/custom-opm-common/opm-common/src/opm/io/eclipse/ESmry.cpp index 64322fb207..ded812d033 100644 --- a/ThirdParty/custom-opm-common/opm-common/src/opm/io/eclipse/ESmry.cpp +++ b/ThirdParty/custom-opm-common/opm-common/src/opm/io/eclipse/ESmry.cpp @@ -23,6 +23,7 @@ #include #include #include +#include #include #include diff --git a/ThirdParty/custom-opm-common/opm-common/src/opm/io/eclipse/EclFile.cpp b/ThirdParty/custom-opm-common/opm-common/src/opm/io/eclipse/EclFile.cpp index f1280e2bb6..deff447ac5 100644 --- a/ThirdParty/custom-opm-common/opm-common/src/opm/io/eclipse/EclFile.cpp +++ b/ThirdParty/custom-opm-common/opm-common/src/opm/io/eclipse/EclFile.cpp @@ -3,9 +3,8 @@ This file is part of the Open Porous Media project (OPM). - OPM 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. + OPM 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. OPM is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -16,625 +15,642 @@ along with OPM. If not, see . */ +#include #include #include -#include //#include #include #include +#include #include -#include #include +#include #include #include +#include #include #include -#include -#include #include -namespace Opm { namespace EclIO { - -void EclFile::load(bool preload) { - std::fstream fileH; - - if (formatted) { - fileH.open(this->inputFilename, std::ios::in); - } else { - fileH.open(this->inputFilename, std::ios::in | std::ios::binary); - } - - if (!fileH) - //throw std::runtime_error(fmt::format("Can not open EclFile: {}", this->inputFilename)); - throw std::runtime_error("Can not open EclFile: {}"); +namespace Opm +{ +namespace EclIO +{ - int n = 0; - while (!isEOF(&fileH)) { - std::string arrName(8,' '); - eclArrType arrType; - int64_t num; - int sizeOfElement; + void EclFile::load(bool preload) + { + std::fstream fileH; if (formatted) { - readFormattedHeader(fileH,arrName,num,arrType, sizeOfElement); + fileH.open(this->inputFilename, std::ios::in); } else { - readBinaryHeader(fileH,arrName,num, arrType, sizeOfElement); + fileH.open(this->inputFilename, std::ios::in | std::ios::binary); } - array_size.push_back(num); - array_type.push_back(arrType); - array_name.push_back(trimr(arrName)); - array_element_size.push_back(sizeOfElement); + if (!fileH) + // throw std::runtime_error(fmt::format("Can not open EclFile: {}", this->inputFilename)); + throw std::runtime_error("Can not open EclFile: {}"); - array_index[array_name[n]] = n; + int n = 0; + while (!isEOF(&fileH)) { + std::string arrName(8, ' '); + eclArrType arrType; + int64_t num; + int sizeOfElement; - uint64_t pos = fileH.tellg(); - ifStreamPos.push_back(pos); - - arrayLoaded.push_back(false); - - if (num > 0){ if (formatted) { - uint64_t sizeOfNextArray = sizeOnDiskFormatted(num, arrType, sizeOfElement); - fileH.seekg(static_cast(sizeOfNextArray), std::ios_base::cur); + readFormattedHeader(fileH, arrName, num, arrType, sizeOfElement); } else { - uint64_t sizeOfNextArray = sizeOnDiskBinary(num, arrType, sizeOfElement); - fileH.seekg(static_cast(sizeOfNextArray), std::ios_base::cur); + readBinaryHeader(fileH, arrName, num, arrType, sizeOfElement); } - } - n++; - }; + array_size.push_back(num); + array_type.push_back(arrType); + array_name.push_back(trimr(arrName)); + array_element_size.push_back(sizeOfElement); - fileH.seekg(0, std::ios_base::end); - this->ifStreamPos.push_back(static_cast(fileH.tellg())); - fileH.close(); + array_index[array_name[n]] = n; - if (preload) - this->loadData(); -} + uint64_t pos = fileH.tellg(); + ifStreamPos.push_back(pos); + arrayLoaded.push_back(false); -EclFile::EclFile(const std::string& filename, EclFile::Formatted fmt, bool preload) : - formatted(fmt.value), - inputFilename(filename) -{ - this->load(preload); -} + if (num > 0) { + if (formatted) { + uint64_t sizeOfNextArray = sizeOnDiskFormatted(num, arrType, sizeOfElement); + fileH.seekg(static_cast(sizeOfNextArray), std::ios_base::cur); + } else { + uint64_t sizeOfNextArray = sizeOnDiskBinary(num, arrType, sizeOfElement); + fileH.seekg(static_cast(sizeOfNextArray), std::ios_base::cur); + } + } + n++; + }; -EclFile::EclFile(const std::string& filename, bool preload) : - inputFilename(filename) -{ - if (!fileExists(filename)) - throw std::runtime_error("Can not open EclFile: {}"); + fileH.seekg(0, std::ios_base::end); + this->ifStreamPos.push_back(static_cast(fileH.tellg())); + fileH.close(); - formatted = isFormatted(filename); - this->load(preload); -} + if (preload) + this->loadData(); + } -void EclFile::loadBinaryArray(std::fstream& fileH, std::size_t arrIndex) -{ - fileH.seekg (ifStreamPos[arrIndex], fileH.beg); - - switch (array_type[arrIndex]) { - case INTE: - inte_array[arrIndex] = readBinaryInteArray(fileH, array_size[arrIndex]); - break; - case REAL: - real_array[arrIndex] = readBinaryRealArray(fileH, array_size[arrIndex]); - break; - case DOUB: - doub_array[arrIndex] = readBinaryDoubArray(fileH, array_size[arrIndex]); - break; - case LOGI: - logi_array[arrIndex] = readBinaryLogiArray(fileH, array_size[arrIndex]); - break; - case CHAR: - char_array[arrIndex] = readBinaryCharArray(fileH, array_size[arrIndex]); - break; - case C0NN: - char_array[arrIndex] = readBinaryC0nnArray(fileH, array_size[arrIndex], array_element_size[arrIndex]); - break; - case MESS: - break; - default: - OPM_THROW(std::runtime_error, "Asked to read unexpected array type"); - break; + EclFile::EclFile(const std::string& filename, EclFile::Formatted fmt, bool preload) + : formatted(fmt.value) + , inputFilename(filename) + { + this->load(preload); } - arrayLoaded[arrIndex] = true; -} -void EclFile::loadFormattedArray(const std::string& fileStr, std::size_t arrIndex, int64_t fromPos) -{ + EclFile::EclFile(const std::string& filename, bool preload) + : inputFilename(filename) + { + if (!fileExists(filename)) + // throw std::runtime_error(fmt::format("Can not open EclFile: {}", filename)); + throw std::runtime_error("Can not open EclFile: {}"); - switch (array_type[arrIndex]) { - case INTE: - inte_array[arrIndex] = readFormattedInteArray(fileStr, array_size[arrIndex], fromPos); - break; - case REAL: - real_array[arrIndex] = readFormattedRealArray(fileStr, array_size[arrIndex], fromPos); - break; - case DOUB: - doub_array[arrIndex] = readFormattedDoubArray(fileStr, array_size[arrIndex], fromPos); - break; - case LOGI: - logi_array[arrIndex] = readFormattedLogiArray(fileStr, array_size[arrIndex], fromPos); - break; - case CHAR: - char_array[arrIndex] = readFormattedCharArray(fileStr, array_size[arrIndex], fromPos, sizeOfChar); - break; - case C0NN: - char_array[arrIndex] = readFormattedCharArray(fileStr, array_size[arrIndex], fromPos, array_element_size[arrIndex]); - break; - case MESS: - break; - default: - OPM_THROW(std::runtime_error, "Asked to read unexpected array type"); - break; + formatted = isFormatted(filename); + this->load(preload); } - arrayLoaded[arrIndex] = true; -} + void EclFile::loadBinaryArray(std::fstream& fileH, std::size_t arrIndex) + { + fileH.seekg(ifStreamPos[arrIndex], fileH.beg); + + switch (array_type[arrIndex]) { + case INTE: + inte_array[arrIndex] = readBinaryInteArray(fileH, array_size[arrIndex]); + break; + case REAL: + real_array[arrIndex] = readBinaryRealArray(fileH, array_size[arrIndex]); + break; + case DOUB: + doub_array[arrIndex] = readBinaryDoubArray(fileH, array_size[arrIndex]); + break; + case LOGI: + logi_array[arrIndex] = readBinaryLogiArray(fileH, array_size[arrIndex]); + break; + case CHAR: + char_array[arrIndex] = readBinaryCharArray(fileH, array_size[arrIndex]); + break; + case C0NN: + char_array[arrIndex] = readBinaryC0nnArray(fileH, array_size[arrIndex], array_element_size[arrIndex]); + break; + case MESS: + break; + default: + OPM_THROW(std::runtime_error, "Asked to read unexpected array type"); + break; + } -void EclFile::loadData() -{ + arrayLoaded[arrIndex] = true; + } - if (formatted) { + void EclFile::loadFormattedArray(const std::string& fileStr, std::size_t arrIndex, int64_t fromPos) + { + + switch (array_type[arrIndex]) { + case INTE: + inte_array[arrIndex] = readFormattedInteArray(fileStr, array_size[arrIndex], fromPos); + break; + case REAL: + real_array[arrIndex] = readFormattedRealArray(fileStr, array_size[arrIndex], fromPos); + break; + case DOUB: + doub_array[arrIndex] = readFormattedDoubArray(fileStr, array_size[arrIndex], fromPos); + break; + case LOGI: + logi_array[arrIndex] = readFormattedLogiArray(fileStr, array_size[arrIndex], fromPos); + break; + case CHAR: + char_array[arrIndex] = readFormattedCharArray(fileStr, array_size[arrIndex], fromPos, sizeOfChar); + break; + case C0NN: + char_array[arrIndex] + = readFormattedCharArray(fileStr, array_size[arrIndex], fromPos, array_element_size[arrIndex]); + break; + case MESS: + break; + default: + OPM_THROW(std::runtime_error, "Asked to read unexpected array type"); + break; + } - std::vector arrIndices(array_name.size()); - std::iota(arrIndices.begin(), arrIndices.end(), 0); + arrayLoaded[arrIndex] = true; + } - this->loadData(arrIndices); - } else { + void EclFile::loadData() + { - std::fstream fileH; - fileH.open(inputFilename, std::ios::in | std::ios::binary); + if (formatted) { - if (!fileH) { - std::string message="Could not open file: '" + inputFilename +"'"; - OPM_THROW(std::runtime_error, message); - } + std::vector arrIndices(array_name.size()); + std::iota(arrIndices.begin(), arrIndices.end(), 0); - for (size_t i = 0; i < array_name.size(); i++) { - loadBinaryArray(fileH, i); - } + this->loadData(arrIndices); - fileH.close(); - } -} + } else { + std::fstream fileH; + fileH.open(inputFilename, std::ios::in | std::ios::binary); -void EclFile::loadData(const std::string& name) -{ + if (!fileH) { + std::string message = "Could not open file: '" + inputFilename + "'"; + OPM_THROW(std::runtime_error, message); + } + + for (size_t i = 0; i < array_name.size(); i++) { + loadBinaryArray(fileH, i); + } - if (formatted) { + fileH.close(); + } + } - std::ifstream inFile(inputFilename); - for (unsigned int arrIndex = 0; arrIndex < array_name.size(); arrIndex++) { + void EclFile::loadData(const std::string& name) + { + + if (formatted) { + + std::ifstream inFile(inputFilename); - if (array_name[arrIndex] == name) { + for (unsigned int arrIndex = 0; arrIndex < array_name.size(); arrIndex++) { - inFile.seekg(ifStreamPos[arrIndex]); + if (array_name[arrIndex] == name) { - char* buffer; - size_t size = sizeOnDiskFormatted(array_size[arrIndex], array_type[arrIndex], array_element_size[arrIndex])+1; - buffer = new char [size]; - inFile.read (buffer, size); + inFile.seekg(ifStreamPos[arrIndex]); - std::string fileStr = std::string(buffer, size); + size_t size + = sizeOnDiskFormatted(array_size[arrIndex], array_type[arrIndex], array_element_size[arrIndex]) + + 1; + std::vector buffer(size); + inFile.read(buffer.data(), size); - loadFormattedArray(fileStr, arrIndex, 0); + std::string fileStr = std::string(buffer.data(), size); - delete[] buffer; + loadFormattedArray(fileStr, arrIndex, 0); + } } - } - } else { + } else { - std::fstream fileH; - fileH.open(inputFilename, std::ios::in | std::ios::binary); + std::fstream fileH; + fileH.open(inputFilename, std::ios::in | std::ios::binary); - if (!fileH) { - std::string message="Could not open file: '" + inputFilename +"'"; - OPM_THROW(std::runtime_error, message); - } + if (!fileH) { + std::string message = "Could not open file: '" + inputFilename + "'"; + OPM_THROW(std::runtime_error, message); + } - for (size_t i = 0; i < array_name.size(); i++) { - if (array_name[i] == name) { - loadBinaryArray(fileH, i); + for (size_t i = 0; i < array_name.size(); i++) { + if (array_name[i] == name) { + loadBinaryArray(fileH, i); + } } - } - fileH.close(); + fileH.close(); + } } -} -void EclFile::loadData(const std::vector& arrIndex) -{ + void EclFile::loadData(const std::vector& arrIndex) + { - if (formatted) { + if (formatted) { - std::ifstream inFile(inputFilename); + std::ifstream inFile(inputFilename); - for (int ind : arrIndex) { + for (int ind : arrIndex) { - inFile.seekg(ifStreamPos[ind]); + inFile.seekg(ifStreamPos[ind]); - char* buffer; - size_t size = sizeOnDiskFormatted(array_size[ind], array_type[ind], array_element_size[ind])+1; - buffer = new char [size]; - inFile.read (buffer, size); + size_t size = sizeOnDiskFormatted(array_size[ind], array_type[ind], array_element_size[ind]) + 1; + std::vector buffer(size); + inFile.read(buffer.data(), size); - std::string fileStr = std::string(buffer, size); + std::string fileStr = std::string(buffer.data(), size); - loadFormattedArray(fileStr, ind, 0); + loadFormattedArray(fileStr, ind, 0); + } - delete[] buffer; - } + } else { + std::fstream fileH; + fileH.open(inputFilename, std::ios::in | std::ios::binary); - } else { - std::fstream fileH; - fileH.open(inputFilename, std::ios::in | std::ios::binary); + if (!fileH) { + std::string message = "Could not open file: '" + inputFilename + "'"; + OPM_THROW(std::runtime_error, message); + } - if (!fileH) { - std::string message="Could not open file: '" + inputFilename +"'"; - OPM_THROW(std::runtime_error, message); - } + for (int ind : arrIndex) { + loadBinaryArray(fileH, ind); + } - for (int ind : arrIndex) { - loadBinaryArray(fileH, ind); + fileH.close(); } - - fileH.close(); } -} -void EclFile::loadData(int arrIndex) -{ - if (formatted) { + void EclFile::loadData(int arrIndex) + { + if (formatted) { - std::ifstream inFile(inputFilename); + std::ifstream inFile(inputFilename); inFile.seekg(ifStreamPos[arrIndex]); - char* buffer; - size_t size = sizeOnDiskFormatted(array_size[arrIndex], array_type[arrIndex], array_element_size[arrIndex])+1; - buffer = new char [size]; - inFile.read (buffer, size); + size_t size + = sizeOnDiskFormatted(array_size[arrIndex], array_type[arrIndex], array_element_size[arrIndex]) + 1; + std::vector buffer(size); + inFile.read(buffer.data(), size); - std::string fileStr = std::string(buffer, size); + std::string fileStr = std::string(buffer.data(), size); loadFormattedArray(fileStr, arrIndex, 0); - delete[] buffer; - - } else { - std::fstream fileH; - fileH.open(inputFilename, std::ios::in | std::ios::binary); + } else { + std::fstream fileH; + fileH.open(inputFilename, std::ios::in | std::ios::binary); - if (!fileH) { - std::string message="Could not open file: '" + inputFilename +"'"; - OPM_THROW(std::runtime_error, message); - } + if (!fileH) { + std::string message = "Could not open file: '" + inputFilename + "'"; + OPM_THROW(std::runtime_error, message); + } - loadBinaryArray(fileH, arrIndex); + loadBinaryArray(fileH, arrIndex); - fileH.close(); + fileH.close(); + } } -} - -bool EclFile::is_ix() const -{ - // assuming that array data type C0nn only are used in IX. This may change in future. - // Formatted files, - // >> use real arrays. Example Ecl = '0.70000000E-01', IX = '7.0000000E-02' - // Binary files, - // >> if logi array exists in file, look for IX spes binary representation of true value + bool EclFile::is_ix() const + { + // assuming that array data type C0nn only are used in IX. This may change in future. - if (formatted) { - for (size_t n=0; n < array_type.size(); n++) { - if (array_type[n] == Opm::EclIO::C0NN) { - return true; - } else if (array_type[n] == Opm::EclIO::REAL) { - auto realStr = get_fmt_real_raw_str_values(n); - int p, first; + // Formatted files, + // >> use real arrays. Example Ecl = '0.70000000E-01', IX = '7.0000000E-02' + // Binary files, + // >> if logi array exists in file, look for IX spes binary representation of true value - for (auto val : realStr) { - double dtmpv = fabs(std::stod(val)); - - if (dtmpv > 0.0) { - p = val.find_first_of("."); - first = abs(std::stoi(val.substr(0, p))); - - if (first > 0) - return true; - else - return false; + if (formatted) { + for (size_t n = 0; n < array_type.size(); n++) { + if (array_type[n] == Opm::EclIO::C0NN) { + return true; + } else if (array_type[n] == Opm::EclIO::REAL) { + auto realStr = get_fmt_real_raw_str_values(n); + int p, first; + + for (auto val : realStr) { + double dtmpv = fabs(std::stod(val)); + + if (dtmpv > 0.0) { + p = val.find_first_of("."); + first = abs(std::stoi(val.substr(0, p))); + + if (first > 0) + return true; + else + return false; + } } } } - } - } else { - for (size_t n=0; n < array_type.size(); n++) { - if (array_type[n] == Opm::EclIO::C0NN) { - return true; - } else if (array_type[n] == Opm::EclIO::LOGI) { - auto raw_logi_values = get_bin_logi_raw_values(n); - for (unsigned int val : raw_logi_values) { - if (val == Opm::EclIO::true_value_ix) - return true; + } else { + for (size_t n = 0; n < array_type.size(); n++) { + if (array_type[n] == Opm::EclIO::C0NN) { + return true; + } else if (array_type[n] == Opm::EclIO::LOGI) { + auto raw_logi_values = get_bin_logi_raw_values(n); + for (unsigned int val : raw_logi_values) { + if (val == Opm::EclIO::true_value_ix) + return true; + } } } + + return false; } return false; } - return false; -} + std::vector EclFile::get_bin_logi_raw_values(int arrIndex) const + { + if (array_type[arrIndex] != Opm::EclIO::LOGI) + OPM_THROW(std::runtime_error, "Error, selected array is not of type LOGI"); -std::vector EclFile::get_bin_logi_raw_values(int arrIndex) const -{ - if (array_type[arrIndex] != Opm::EclIO::LOGI) - OPM_THROW(std::runtime_error, "Error, selected array is not of type LOGI"); + std::fstream fileH; + fileH.open(inputFilename, std::ios::in | std::ios::binary); - std::fstream fileH; - fileH.open(inputFilename, std::ios::in | std::ios::binary); + if (!fileH) { + std::string message = "Could not open file: '" + inputFilename + "'"; + OPM_THROW(std::runtime_error, message); + } - if (!fileH) { - std::string message="Could not open file: '" + inputFilename +"'"; - OPM_THROW(std::runtime_error, message); - } + fileH.seekg(ifStreamPos[arrIndex], fileH.beg); - fileH.seekg (ifStreamPos[arrIndex], fileH.beg); + std::vector raw_logi = readBinaryRawLogiArray(fileH, array_size[arrIndex]); - std::vector raw_logi = readBinaryRawLogiArray(fileH, array_size[arrIndex]); + return raw_logi; + } - return raw_logi; -} + std::vector EclFile::get_fmt_real_raw_str_values(int arrIndex) const + { + std::vector real_vect; -std::vector EclFile::get_fmt_real_raw_str_values(int arrIndex) const -{ - std::vector real_vect; + if (array_type[arrIndex] != Opm::EclIO::REAL) + OPM_THROW(std::runtime_error, "Error, selected array is not of type REAL"); - if (array_type[arrIndex] != Opm::EclIO::REAL) - OPM_THROW(std::runtime_error, "Error, selected array is not of type REAL"); + std::ifstream inFile(inputFilename); - std::ifstream inFile(inputFilename); + if (!inFile) { + std::string message = "Could not open file: '" + inputFilename + "'"; + OPM_THROW(std::runtime_error, message); + } - if (!inFile) { - std::string message="Could not open file: '" + inputFilename +"'"; - OPM_THROW(std::runtime_error, message); - } + inFile.seekg(ifStreamPos[arrIndex]); - inFile.seekg(ifStreamPos[arrIndex]); + size_t size = sizeOnDiskFormatted(array_size[arrIndex], array_type[arrIndex], array_element_size[arrIndex]) + 1; - char* buffer; - size_t size = sizeOnDiskFormatted(array_size[arrIndex], array_type[arrIndex], array_element_size[arrIndex])+1; + std::vector buffer(size); + inFile.read(buffer.data(), size); - buffer = new char [size]; - inFile.read (buffer, size); + std::string fileStr = std::string(buffer.data(), size); - std::string fileStr = std::string(buffer, size); + std::vector real_vect_str; + real_vect_str = readFormattedRealRawStrings(fileStr, array_size[arrIndex], 0); - std::vector real_vect_str; - real_vect_str = readFormattedRealRawStrings(fileStr, array_size[arrIndex], 0); - delete buffer; + return real_vect_str; + } - return real_vect_str; -} + std::vector EclFile::getList() const + { + std::vector list; + list.reserve(this->array_name.size()); -std::vector EclFile::getList() const -{ - std::vector list; - list.reserve(this->array_name.size()); + for (size_t i = 0; i < array_name.size(); i++) { + list.emplace_back(array_name[i], array_type[i], array_size[i]); + } - for (size_t i = 0; i < array_name.size(); i++) { - list.emplace_back(array_name[i], array_type[i], array_size[i]); + return list; } - return list; -} + template <> + const std::vector& EclFile::get(int arrIndex) + { + return getImpl(arrIndex, INTE, inte_array, "integer"); + } -template<> -const std::vector& EclFile::get(int arrIndex) -{ - return getImpl(arrIndex, INTE, inte_array, "integer"); -} + template <> + const std::vector& EclFile::get(int arrIndex) + { + return getImpl(arrIndex, REAL, real_array, "float"); + } -template<> -const std::vector& -EclFile::get(int arrIndex) -{ - return getImpl(arrIndex, REAL, real_array, "float"); -} + template <> + const std::vector& EclFile::get(int arrIndex) + { + return getImpl(arrIndex, DOUB, doub_array, "double"); + } -template<> -const std::vector &EclFile::get(int arrIndex) -{ - return getImpl(arrIndex, DOUB, doub_array, "double"); -} + template <> + const std::vector& EclFile::get(int arrIndex) + { + return getImpl(arrIndex, LOGI, logi_array, "bool"); + } -template<> -const std::vector& EclFile::get(int arrIndex) -{ - return getImpl(arrIndex, LOGI, logi_array, "bool"); -} + template <> + const std::vector& EclFile::get(int arrIndex) + { + if ((array_type[arrIndex] != Opm::EclIO::C0NN) && (array_type[arrIndex] != Opm::EclIO::CHAR)) { + std::string message = "Array with index " + std::to_string(arrIndex) + " is not of type " + "std::string"; + OPM_THROW(std::runtime_error, message); + } -template<> -const std::vector& EclFile::get(int arrIndex) -{ - if ((array_type[arrIndex] != Opm::EclIO::C0NN) && (array_type[arrIndex] != Opm::EclIO::CHAR)){ - std::string message = "Array with index " + std::to_string(arrIndex) + " is not of type " + "std::string"; - OPM_THROW(std::runtime_error, message); + return getImpl(arrIndex, array_type[arrIndex], char_array, "string"); } - return getImpl(arrIndex, array_type[arrIndex], char_array, "string"); -} + bool EclFile::hasKey(const std::string& name) const + { + auto search = array_index.find(name); + return search != array_index.end(); + } -bool EclFile::hasKey(const std::string &name) const -{ - auto search = array_index.find(name); - return search != array_index.end(); -} + size_t EclFile::count(const std::string& name) const + { + return std::count(array_name.begin(), array_name.end(), name); + } -size_t EclFile::count(const std::string &name) const -{ - return std::count (array_name.begin(), array_name.end(), name); -} + std::streampos EclFile::seekPosition(const std::vector::size_type arrIndex) const + { + if (arrIndex >= this->array_name.size()) { + return {static_cast(this->ifStreamPos.back())}; + } -std::streampos -EclFile::seekPosition(const std::vector::size_type arrIndex) const -{ - if (arrIndex >= this->array_name.size()) { - return { static_cast(this->ifStreamPos.back()) }; + // StreamPos is file position of start of data vector's control + // character (unformatted) or data items (formatted). We need + // file position of start of header, because that's where we're + // supposed to start writing new data. Subtract header size. + // + // (*) formatted header size = 30 characters = + // 1 space character + // + 1 quote character + // + 8 character header/vector name + // + 1 quote character + // + 1 space character + // + 11 characters for number of elments + // + 1 space character + // + 1 quote character + // + 4 characters for element type + // + 1 quote character + // + // + // (*) unformatted header size = 24 bytes = + // 4 byte => size of header in byte + // + 8 byte header/vector name + // + 4 byte for number of elements + // + 4 byte for element type + // + 4 byte size of header in byte + // + // 16 byte header (8+4+4) + // + // +------+------------+------+------+------+ + // | Ctrl | Keyword | #elm | type | Ctrl | (item) + // | 4 | 8 | 4 | 4 | 4 | (#bytes) + // +------+------------+------+------+------+ + // + // 20 byte header (8+8+4) + // + // +------+------------+------+------+------+ + // | Ctrl | Keyword | #elm | type | Ctrl | (item) + // | 4 | 8 | 8 | 4 | 4 | (#bytes) + // +------+------------+------+------+------+ + // + + const auto headerSize = this->formatted ? 30ul : 24ul; + const auto datapos = this->ifStreamPos[arrIndex]; + const auto seekpos = (datapos <= headerSize) ? 0ul : datapos - headerSize; + + return {static_cast(seekpos)}; } - // StreamPos is file position of start of data vector's control - // character (unformatted) or data items (formatted). We need - // file position of start of header, because that's where we're - // supposed to start writing new data. Subtract header size. - // - // (*) formatted header size = 30 characters = - // 1 space character - // + 1 quote character - // + 8 character header/vector name - // + 1 quote character - // + 1 space character - // + 11 characters for number of elments - // + 1 space character - // + 1 quote character - // + 4 characters for element type - // + 1 quote character - // - // - // (*) unformatted header size = 24 bytes = - // 4 byte => size of header in byte - // + 8 byte header/vector name - // + 4 byte for number of elements - // + 4 byte for element type - // + 4 byte size of header in byte - // - // 16 byte header (8+4+4) - // - // +------+------------+------+------+------+ - // | Ctrl | Keyword | #elm | type | Ctrl | (item) - // | 4 | 8 | 4 | 4 | 4 | (#bytes) - // +------+------------+------+------+------+ - // - // 20 byte header (8+8+4) - // - // +------+------------+------+------+------+ - // | Ctrl | Keyword | #elm | type | Ctrl | (item) - // | 4 | 8 | 8 | 4 | 4 | (#bytes) - // +------+------------+------+------+------+ - // - - const auto headerSize = this->formatted ? 30ul : 24ul; - const auto datapos = this->ifStreamPos[arrIndex]; - const auto seekpos = (datapos <= headerSize) - ? 0ul : datapos - headerSize; - - return { static_cast(seekpos) }; -} - -template<> -const std::vector& EclFile::get(const std::string& name) -{ - auto search = array_index.find(name); + template <> + const std::vector& EclFile::get(const std::string& name) + { + auto search = array_index.find(name); + + if (search == array_index.end()) { + std::string message = "key '" + name + "' not found"; + OPM_THROW(std::invalid_argument, message); + } - if (search == array_index.end()) { - std::string message="key '"+name + "' not found"; - OPM_THROW(std::invalid_argument, message); + return getImpl(search->second, INTE, inte_array, "integer"); } - return getImpl(search->second, INTE, inte_array, "integer"); -} + template <> + const std::vector& EclFile::get(const std::string& name) + { + auto search = array_index.find(name); -template<> -const std::vector& EclFile::get(const std::string& name) -{ - auto search = array_index.find(name); + if (search == array_index.end()) { + std::string message = "key '" + name + "' not found"; + OPM_THROW(std::invalid_argument, message); + } - if (search == array_index.end()) { - std::string message="key '"+name + "' not found"; - OPM_THROW(std::invalid_argument, message); + return getImpl(search->second, REAL, real_array, "float"); } - return getImpl(search->second, REAL, real_array, "float"); -} + template <> + const std::vector& EclFile::get(const std::string& name) + { + auto search = array_index.find(name); -template<> -const std::vector& EclFile::get(const std::string &name) -{ - auto search = array_index.find(name); + if (search == array_index.end()) { + std::string message = "key '" + name + "' not found"; + OPM_THROW(std::invalid_argument, message); + } - if (search == array_index.end()) { - std::string message="key '"+name + "' not found"; - OPM_THROW(std::invalid_argument, message); + return getImpl(search->second, DOUB, doub_array, "double"); } - return getImpl(search->second, DOUB, doub_array, "double"); -} + template <> + const std::vector& EclFile::get(const std::string& name) + { + auto search = array_index.find(name); -template<> -const std::vector& EclFile::get(const std::string &name) -{ - auto search = array_index.find(name); + if (search == array_index.end()) { + std::string message = "key '" + name + "' not found"; + OPM_THROW(std::invalid_argument, message); + } - if (search == array_index.end()) { - std::string message="key '"+name + "' not found"; - OPM_THROW(std::invalid_argument, message); + return getImpl(search->second, LOGI, logi_array, "bool"); } - return getImpl(search->second, LOGI, logi_array, "bool"); -} + template <> + const std::vector& EclFile::get(const std::string& name) + { + auto search = array_index.find(name); -template<> -const std::vector& EclFile::get(const std::string &name) -{ - auto search = array_index.find(name); + if (search == array_index.end()) { + std::string message = "key '" + name + "' not found"; + OPM_THROW(std::invalid_argument, message); + } - if (search == array_index.end()) { - std::string message="key '"+name + "' not found"; - OPM_THROW(std::invalid_argument, message); - } + if ((array_type[search->second] != Opm::EclIO::C0NN) && (array_type[search->second] != Opm::EclIO::CHAR)) { + std::string message + = "Array with index " + std::to_string(search->second) + " is not of type " + "std::string"; + OPM_THROW(std::runtime_error, message); + } - if ((array_type[search->second] != Opm::EclIO::C0NN) && (array_type[search->second] != Opm::EclIO::CHAR)){ - std::string message = "Array with index " + std::to_string(search->second) + " is not of type " + "std::string"; - OPM_THROW(std::runtime_error, message); + return getImpl(search->second, array_type[search->second], char_array, "string"); } - return getImpl(search->second, array_type[search->second], char_array, "string"); -} + template + const std::vector& EclFile::getImpl(int arrIndex, + eclArrType type, + const std::unordered_map>& array, + const std::string& typeStr) + { + if (array_type[arrIndex] != type) { + std::string message = "Array with index " + std::to_string(arrIndex) + " is not of type " + typeStr; + OPM_THROW(std::runtime_error, message); + } + + if (!arrayLoaded[arrIndex]) { + loadData(arrIndex); + } -std::size_t EclFile::size() const { - return this->array_name.size(); -} + return array.at(arrIndex); + } + + + std::size_t EclFile::size() const + { + return this->array_name.size(); + } -}} // namespace Opm::ecl +} // namespace EclIO +} // namespace Opm diff --git a/ThirdParty/custom-opm-common/opm-common/src/opm/parser/eclipse/EclipseState/Grid/EclipseGrid.cpp b/ThirdParty/custom-opm-common/opm-common/src/opm/parser/eclipse/EclipseState/Grid/EclipseGrid.cpp index d1053e5f52..17f6d8a8d1 100644 --- a/ThirdParty/custom-opm-common/opm-common/src/opm/parser/eclipse/EclipseState/Grid/EclipseGrid.cpp +++ b/ThirdParty/custom-opm-common/opm-common/src/opm/parser/eclipse/EclipseState/Grid/EclipseGrid.cpp @@ -28,6 +28,7 @@ #include #include +#include #include #include From 61ea1909203b98d60f964c15569f4cf4b9ad10a8 Mon Sep 17 00:00:00 2001 From: Kristian Bendiksen Date: Mon, 23 Aug 2021 14:28:00 +0200 Subject: [PATCH 076/308] StimPlan Export: Workaround precision issue in Deviation.frk export --- .../FileInterface/RifStimPlanModelDeviationFrkExporter.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ApplicationLibCode/FileInterface/RifStimPlanModelDeviationFrkExporter.cpp b/ApplicationLibCode/FileInterface/RifStimPlanModelDeviationFrkExporter.cpp index 8736b9dcac..a1120f8f8e 100644 --- a/ApplicationLibCode/FileInterface/RifStimPlanModelDeviationFrkExporter.cpp +++ b/ApplicationLibCode/FileInterface/RifStimPlanModelDeviationFrkExporter.cpp @@ -147,7 +147,9 @@ void RifStimPlanModelDeviationFrkExporter::fixupDepthValuesForExport( const std: // Move the MD value to produce a file which can be imported. if ( changeMd < changeTvd ) { - exportMdValues.push_back( exportMdValues[i - 1] + changeTvd ); + // Add small amount in addition to delta TVD to work around floating point imprecision. + double wiggle = 0.001; + exportMdValues.push_back( exportMdValues[i - 1] + changeTvd + wiggle ); } else { From 2fc65a3b622bfe6eea6b7c1e51c5c90da09633f2 Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Thu, 26 Aug 2021 08:13:03 +0200 Subject: [PATCH 077/308] #7892 Basic support for display of surface lines and bands on intersections Guard divide by zero issues 2D Intersection View: Do not add parts with wrong coordinates Add bounding box search tree Add support display of intersection lines for selected surfaces Show band between two first intersection lines --- .../RicNewAzimuthDipIntersectionFeature.cpp | 3 +- .../RicNewPolylineIntersectionFeature.cpp | 3 +- .../RicNewSimWellIntersectionFeature.cpp | 3 +- .../RicNewWellPathIntersectionFeature.cpp | 3 +- .../RicNewIntersectionViewFeature.cpp | 2 +- .../RicWellTarget3dEditor.cpp | 5 + .../Intersections/CMakeLists_files.cmake | 4 +- ...udedCurveIntersectionGeometryGenerator.cpp | 254 ++++++++++--- ...trudedCurveIntersectionGeometryGenerator.h | 36 +- .../RivExtrudedCurveIntersectionPartMgr.cpp | 140 ++++++- .../RivExtrudedCurveIntersectionPartMgr.h | 7 +- ...RivExtrudedCurveIntersectionSourceInfo.cpp | 7 +- .../RivExtrudedCurveIntersectionSourceInfo.h | 7 +- ...onFlattner.cpp => RivSectionFlattener.cpp} | 22 +- ...ectionFlattner.h => RivSectionFlattener.h} | 2 +- .../RivSimWellPipesPartMgr.cpp | 10 +- .../ModelVisualization/RivWellDiskPartMgr.cpp | 2 +- .../ModelVisualization/RivWellHeadPartMgr.cpp | 2 +- .../ModelVisualization/RivWellPathPartMgr.cpp | 47 +-- ...ivSurfaceIntersectionGeometryGenerator.cpp | 23 +- .../RivWindowEdgeAxesOverlayItem.cpp | 3 + .../Rim2dIntersectionView.cpp | 6 +- .../RimExtrudedCurveIntersection.cpp | 350 ++++++++++++------ .../RimExtrudedCurveIntersection.h | 74 ++-- .../ProjectDataModel/RimIntersection.cpp | 6 +- .../RimIntersectionCollection.cpp | 2 +- .../ReservoirDataModel/RigSurface.cpp | 60 ++- .../ReservoirDataModel/RigSurface.h | 14 + .../RigSurfaceResampler.cpp | 50 ++- .../ReservoirDataModel/RigSurfaceResampler.h | 9 +- .../UserInterface/RiuPvtPlotUpdater.cpp | 15 +- .../cafOverlayScaleLegend.cpp | 3 + 32 files changed, 821 insertions(+), 353 deletions(-) rename ApplicationLibCode/ModelVisualization/Intersections/{RivSectionFlattner.cpp => RivSectionFlattener.cpp} (87%) rename ApplicationLibCode/ModelVisualization/Intersections/{RivSectionFlattner.h => RivSectionFlattener.h} (98%) diff --git a/ApplicationLibCode/Commands/CrossSectionCommands/RicNewAzimuthDipIntersectionFeature.cpp b/ApplicationLibCode/Commands/CrossSectionCommands/RicNewAzimuthDipIntersectionFeature.cpp index f783eee274..1dc5a1987f 100644 --- a/ApplicationLibCode/Commands/CrossSectionCommands/RicNewAzimuthDipIntersectionFeature.cpp +++ b/ApplicationLibCode/Commands/CrossSectionCommands/RicNewAzimuthDipIntersectionFeature.cpp @@ -110,8 +110,7 @@ void RicNewAzimuthDipIntersectionFeatureCmd::redo() RimExtrudedCurveIntersection* intersection = new RimExtrudedCurveIntersection(); intersection->setName( "Azimuth and Dip" ); - intersection->type = RimExtrudedCurveIntersection::CS_AZIMUTHLINE; - intersection->inputTwoAzimuthPointsFromViewerEnabled = true; + intersection->configureForAzimuthLine(); RimCase* rimCase; m_intersectionCollection->firstAncestorOrThisOfTypeAsserted( rimCase ); diff --git a/ApplicationLibCode/Commands/CrossSectionCommands/RicNewPolylineIntersectionFeature.cpp b/ApplicationLibCode/Commands/CrossSectionCommands/RicNewPolylineIntersectionFeature.cpp index 2b0b22880a..c8e79ea4ab 100644 --- a/ApplicationLibCode/Commands/CrossSectionCommands/RicNewPolylineIntersectionFeature.cpp +++ b/ApplicationLibCode/Commands/CrossSectionCommands/RicNewPolylineIntersectionFeature.cpp @@ -109,8 +109,7 @@ void RicNewPolylineIntersectionFeatureCmd::redo() RimExtrudedCurveIntersection* intersection = new RimExtrudedCurveIntersection(); intersection->setName( "Polyline" ); - intersection->type = RimExtrudedCurveIntersection::CS_POLYLINE; - intersection->inputPolyLineFromViewerEnabled = true; + intersection->configureForPolyLine(); m_intersectionCollection->appendIntersectionAndUpdate( intersection, false ); diff --git a/ApplicationLibCode/Commands/CrossSectionCommands/RicNewSimWellIntersectionFeature.cpp b/ApplicationLibCode/Commands/CrossSectionCommands/RicNewSimWellIntersectionFeature.cpp index 1e70331e72..9a54a35d3e 100644 --- a/ApplicationLibCode/Commands/CrossSectionCommands/RicNewSimWellIntersectionFeature.cpp +++ b/ApplicationLibCode/Commands/CrossSectionCommands/RicNewSimWellIntersectionFeature.cpp @@ -105,8 +105,7 @@ void RicNewSimWellIntersectionCmd::redo() RimExtrudedCurveIntersection* intersection = new RimExtrudedCurveIntersection(); intersection->setName( m_simWell->name ); - intersection->type = RimExtrudedCurveIntersection::CS_SIMULATION_WELL; - intersection->simulationWell = m_simWell; + intersection->configureForSimulationWell( m_simWell ); m_intersectionCollection->appendIntersectionAndUpdate( intersection, false ); } diff --git a/ApplicationLibCode/Commands/CrossSectionCommands/RicNewWellPathIntersectionFeature.cpp b/ApplicationLibCode/Commands/CrossSectionCommands/RicNewWellPathIntersectionFeature.cpp index 9384b371d2..8ae8343c94 100644 --- a/ApplicationLibCode/Commands/CrossSectionCommands/RicNewWellPathIntersectionFeature.cpp +++ b/ApplicationLibCode/Commands/CrossSectionCommands/RicNewWellPathIntersectionFeature.cpp @@ -114,8 +114,7 @@ void RicNewWellPathIntersectionFeatureCmd::redo() RimExtrudedCurveIntersection* intersection = new RimExtrudedCurveIntersection(); intersection->setName( m_wellPath->name() ); - intersection->type = RimExtrudedCurveIntersection::CS_WELL_PATH; - intersection->wellPath = m_wellPath; + intersection->configureForWellPath( m_wellPath ); m_intersectionCollection->appendIntersectionAndUpdate( intersection, false ); } diff --git a/ApplicationLibCode/Commands/IntersectionViewCommands/RicNewIntersectionViewFeature.cpp b/ApplicationLibCode/Commands/IntersectionViewCommands/RicNewIntersectionViewFeature.cpp index ef7b1d844b..cb211c5cbf 100644 --- a/ApplicationLibCode/Commands/IntersectionViewCommands/RicNewIntersectionViewFeature.cpp +++ b/ApplicationLibCode/Commands/IntersectionViewCommands/RicNewIntersectionViewFeature.cpp @@ -62,7 +62,7 @@ void RicNewIntersectionViewFeature::onActionTriggered( bool isChecked ) intersection->firstAncestorOrThisOfType( rimCase ); if ( rimCase ) { - if ( intersection->direction() != RimExtrudedCurveIntersection::CS_VERTICAL ) + if ( intersection->direction() != RimExtrudedCurveIntersection::CrossSectionDirEnum::CS_VERTICAL ) { QString text = QString( "The intersection view only supports vertical intersections.\n" "The intersection '%1' is not vertical but a converted version will be shown " diff --git a/ApplicationLibCode/Commands/WellPathCommands/PointTangentManipulator/RicWellTarget3dEditor.cpp b/ApplicationLibCode/Commands/WellPathCommands/PointTangentManipulator/RicWellTarget3dEditor.cpp index 3580a1e1c0..e283bbd8e4 100644 --- a/ApplicationLibCode/Commands/WellPathCommands/PointTangentManipulator/RicWellTarget3dEditor.cpp +++ b/ApplicationLibCode/Commands/WellPathCommands/PointTangentManipulator/RicWellTarget3dEditor.cpp @@ -22,6 +22,7 @@ #include "RigWellPath.h" +#include "Rim2dIntersectionView.h" #include "Rim3dView.h" #include "RimCase.h" #include "RimModeledWellPath.h" @@ -75,6 +76,10 @@ void RicWellTarget3dEditor::configureAndUpdateUi( const QString& uiConfigName ) auto* ownerRiuViewer = dynamic_cast( ownerViewer() ); Rim3dView* view = mainOrComparisonView(); + // TODO: The location of the well target must be updated before displayed in the 2D intersection view. Currently + // disabled. + if ( dynamic_cast( view ) ) return; + if ( !target || !target->isEnabled() || !view ) { if ( m_cvfModel.notNull() ) m_cvfModel->removeAllParts(); diff --git a/ApplicationLibCode/ModelVisualization/Intersections/CMakeLists_files.cmake b/ApplicationLibCode/ModelVisualization/Intersections/CMakeLists_files.cmake index d897137b40..bd0327f6d6 100644 --- a/ApplicationLibCode/ModelVisualization/Intersections/CMakeLists_files.cmake +++ b/ApplicationLibCode/ModelVisualization/Intersections/CMakeLists_files.cmake @@ -8,7 +8,7 @@ ${CMAKE_CURRENT_LIST_DIR}/RivHexGridIntersectionTools.h ${CMAKE_CURRENT_LIST_DIR}/RivBoxIntersectionGeometryGenerator.h ${CMAKE_CURRENT_LIST_DIR}/RivBoxIntersectionPartMgr.h ${CMAKE_CURRENT_LIST_DIR}/RivBoxIntersectionSourceInfo.h -${CMAKE_CURRENT_LIST_DIR}/RivSectionFlattner.h +${CMAKE_CURRENT_LIST_DIR}/RivSectionFlattener.h ) set (SOURCE_GROUP_SOURCE_FILES @@ -20,7 +20,7 @@ ${CMAKE_CURRENT_LIST_DIR}/RivHexGridIntersectionTools.cpp ${CMAKE_CURRENT_LIST_DIR}/RivBoxIntersectionGeometryGenerator.cpp ${CMAKE_CURRENT_LIST_DIR}/RivBoxIntersectionPartMgr.cpp ${CMAKE_CURRENT_LIST_DIR}/RivBoxIntersectionSourceInfo.cpp -${CMAKE_CURRENT_LIST_DIR}/RivSectionFlattner.cpp +${CMAKE_CURRENT_LIST_DIR}/RivSectionFlattener.cpp ) list(APPEND CODE_HEADER_FILES diff --git a/ApplicationLibCode/ModelVisualization/Intersections/RivExtrudedCurveIntersectionGeometryGenerator.cpp b/ApplicationLibCode/ModelVisualization/Intersections/RivExtrudedCurveIntersectionGeometryGenerator.cpp index 9cb1b03433..5ac885e074 100644 --- a/ApplicationLibCode/ModelVisualization/Intersections/RivExtrudedCurveIntersectionGeometryGenerator.cpp +++ b/ApplicationLibCode/ModelVisualization/Intersections/RivExtrudedCurveIntersectionGeometryGenerator.cpp @@ -21,15 +21,20 @@ #include "RigMainGrid.h" #include "RigResultAccessor.h" +#include "RigSurface.h" +#include "RigSurfaceResampler.h" +#include "RigWellPath.h" #include "Rim3dView.h" #include "RimCase.h" #include "RimExtrudedCurveIntersection.h" #include "RimGridView.h" +#include "RimSurface.h" #include "RivExtrudedCurveIntersectionPartMgr.h" #include "RivHexGridIntersectionTools.h" #include "RivPolylineGenerator.h" +#include "RivSectionFlattener.h" #include "cafDisplayCoordTransform.h" #include "cafHexGridIntersectionTools/cafHexGridIntersectionTools.h" @@ -42,8 +47,6 @@ #include "cvfRay.h" #include "cvfScalarMapper.h" -#include "RivSectionFlattner.h" - cvf::ref displayCoordTransform( const RimExtrudedCurveIntersection* intersection ) { Rim3dView* rimView = nullptr; @@ -66,7 +69,7 @@ RivExtrudedCurveIntersectionGeometryGenerator::RivExtrudedCurveIntersectionGeome bool isFlattened, const cvf::Vec3d& flattenedPolylineStartPoint ) : m_intersection( crossSection ) - , m_polyLines( polylines ) + , m_polylines( polylines ) , m_extrusionDirection( extrusionDirection ) , m_hexGrid( grid ) , m_isFlattened( isFlattened ) @@ -89,28 +92,27 @@ RivExtrudedCurveIntersectionGeometryGenerator::~RivExtrudedCurveIntersectionGeom //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -void RivExtrudedCurveIntersectionGeometryGenerator::calculateSegementTransformPrLinePoint() +void RivExtrudedCurveIntersectionGeometryGenerator::calculateLineSegementTransforms() { if ( m_isFlattened ) { - if ( !( m_polyLines.size() && m_polyLines.back().size() ) ) return; + if ( m_polylines.empty() || m_polylines.back().empty() ) return; cvf::Vec3d startOffset = m_flattenedPolylineStartPoint; - for ( size_t pLineIdx = 0; pLineIdx < m_polyLines.size(); ++pLineIdx ) + for ( const std::vector& polyLine : m_polylines ) { - const std::vector& polyLine = m_polyLines[pLineIdx]; - startOffset.z() = polyLine[0].z(); - m_segementTransformPrLinePoint.emplace_back( - RivSectionFlattner::calculateFlatteningCSsForPolyline( polyLine, - m_extrusionDirection, - startOffset, - &startOffset ) ); + startOffset.z() = polyLine[0].z(); + m_lineSegmentTransforms.emplace_back( + RivSectionFlattener::calculateFlatteningCSsForPolyline( polyLine, + m_extrusionDirection, + startOffset, + &startOffset ) ); } } else { - m_segementTransformPrLinePoint.clear(); + m_lineSegmentTransforms.clear(); cvf::Vec3d displayOffset( 0, 0, 0 ); { @@ -124,10 +126,10 @@ void RivExtrudedCurveIntersectionGeometryGenerator::calculateSegementTransformPr cvf::Mat4d invSectionCS = cvf::Mat4d::fromTranslation( -displayOffset ); - for ( const auto& polyLine : m_polyLines ) + for ( const auto& polyLine : m_polylines ) { - m_segementTransformPrLinePoint.emplace_back(); - std::vector& segmentTransforms = m_segementTransformPrLinePoint.back(); + m_lineSegmentTransforms.emplace_back(); + std::vector& segmentTransforms = m_lineSegmentTransforms.back(); for ( size_t lIdx = 0; lIdx < polyLine.size(); ++lIdx ) { segmentTransforms.push_back( invSectionCS ); @@ -139,21 +141,60 @@ void RivExtrudedCurveIntersectionGeometryGenerator::calculateSegementTransformPr //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -void RivExtrudedCurveIntersectionGeometryGenerator::calculateFlattenedOrOffsetedPolyline() +void RivExtrudedCurveIntersectionGeometryGenerator::calculateTransformedPolyline() { - CVF_ASSERT( m_segementTransformPrLinePoint.size() == m_polyLines.size() ); + CVF_ASSERT( m_lineSegmentTransforms.size() == m_polylines.size() ); - for ( size_t pLineIdx = 0; pLineIdx < m_polyLines.size(); ++pLineIdx ) + for ( size_t lineIdx = 0; lineIdx < m_polylines.size(); ++lineIdx ) { - m_flattenedOrOffsettedPolyLines.emplace_back(); - const std::vector& polyLine = m_polyLines[pLineIdx]; + auto flatPolyline = m_transformedPolyLines.emplace_back(); + const auto& polyline = m_polylines[lineIdx]; + + for ( size_t index = 0; index < polyline.size(); ++index ) + { + flatPolyline.push_back( transformPointByPolylineSegmentIndex( polyline[index], lineIdx, index ) ); + } + } +} - CVF_ASSERT( polyLine.size() == m_polyLines[pLineIdx].size() ); +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RivExtrudedCurveIntersectionGeometryGenerator::calculateSurfaceIntersectionPoints() +{ + m_transformedSurfaceIntersectionPolylines.clear(); - for ( size_t pIdx = 0; pIdx < polyLine.size(); ++pIdx ) + if ( !m_polylines.empty() ) + { + auto firstPolyLine = m_polylines.front(); + for ( auto rimSurface : m_intersection->annotatedSurfaces() ) { - m_flattenedOrOffsettedPolyLines.back().push_back( - polyLine[pIdx].getTransformedPoint( m_segementTransformPrLinePoint[pLineIdx][pIdx] ) ); + if ( !rimSurface ) return; + + rimSurface->loadDataIfRequired(); + auto surface = rimSurface->surfaceData(); + + std::vector transformedSurfacePolyline; + + // Resample polyline to required resolution + const double maxLineSegmentLength = 1.0; + auto resampledPolyline = computeResampledPolyline( firstPolyLine, maxLineSegmentLength ); + + for ( auto [point, segmentIndex] : resampledPolyline ) + { + cvf::Vec3d pointAbove = cvf::Vec3d( point.x(), point.y(), 10000.0 ); + cvf::Vec3d pointBelow = cvf::Vec3d( point.x(), point.y(), -10000.0 ); + + cvf::Vec3d intersectionPoint; + bool foundMatch = RigSurfaceResampler::resamplePoint( surface, pointAbove, pointBelow, intersectionPoint ); + if ( !foundMatch ) + intersectionPoint = cvf::Vec3d( point.x(), point.y(), std::numeric_limits::infinity() ); + + const size_t lineIndex = 0; + transformedSurfacePolyline.push_back( + transformPointByPolylineSegmentIndex( intersectionPoint, lineIndex, segmentIndex ) ); + } + m_transformedSurfaceIntersectionPolylines[rimSurface] = transformedSurfacePolyline; } } } @@ -228,12 +269,12 @@ void RivExtrudedCurveIntersectionGeometryGenerator::calculateArrays() cvf::BoundingBox gridBBox = m_hexGrid->boundingBox(); - calculateSegementTransformPrLinePoint(); - calculateFlattenedOrOffsetedPolyline(); + calculateLineSegementTransforms(); + calculateTransformedPolyline(); - for ( size_t pLineIdx = 0; pLineIdx < m_polyLines.size(); ++pLineIdx ) + for ( size_t pLineIdx = 0; pLineIdx < m_polylines.size(); ++pLineIdx ) { - const std::vector& polyLine = m_polyLines[pLineIdx]; + const std::vector& polyLine = m_polylines[pLineIdx]; if ( polyLine.size() < 2 ) continue; @@ -241,7 +282,7 @@ void RivExtrudedCurveIntersectionGeometryGenerator::calculateArrays() size_t lIdx = 0; while ( lIdx < lineCount - 1 ) { - size_t idxToNextP = RivSectionFlattner::indexToNextValidPoint( polyLine, m_extrusionDirection, lIdx ); + size_t idxToNextP = RivSectionFlattener::indexToNextValidPoint( polyLine, m_extrusionDirection, lIdx ); if ( idxToNextP == size_t( -1 ) ) break; @@ -257,7 +298,7 @@ void RivExtrudedCurveIntersectionGeometryGenerator::calculateArrays() double maxSectionHeightUp = 0; double maxSectionHeightDown = 0; - if ( m_intersection->type == RimExtrudedCurveIntersection::CS_AZIMUTHLINE ) + if ( m_intersection->type() == RimExtrudedCurveIntersection::CrossSectionEnum::CS_AZIMUTHLINE ) { maxSectionHeightUp = m_intersection->lengthUp(); maxSectionHeightDown = m_intersection->lengthDown(); @@ -305,12 +346,10 @@ void RivExtrudedCurveIntersectionGeometryGenerator::calculateArrays() cvf::Vec3d cellCorners[8]; size_t cornerIndices[8]; - cvf::Mat4d invSectionCS = m_segementTransformPrLinePoint[pLineIdx][lIdx]; + cvf::Mat4d invSectionCS = m_lineSegmentTransforms[pLineIdx][lIdx]; - for ( size_t cccIdx = 0; cccIdx < columnCellCandidates.size(); ++cccIdx ) + for ( auto globalCellIdx : columnCellCandidates ) { - size_t globalCellIdx = columnCellCandidates[cccIdx]; - if ( !m_hexGrid->useCell( globalCellIdx ) ) continue; hexPlaneCutTriangleVxes.clear(); @@ -323,10 +362,10 @@ void RivExtrudedCurveIntersectionGeometryGenerator::calculateArrays() &hexPlaneCutTriangleVxes, &cellFaceForEachTriangleEdge ); - if ( m_intersection->type == RimExtrudedCurveIntersection::CS_AZIMUTHLINE ) + if ( m_intersection->type() == RimExtrudedCurveIntersection::CrossSectionEnum::CS_AZIMUTHLINE ) { bool hasAnyPointsOnSurface = false; - for ( caf::HexGridIntersectionTools::ClipVx vertex : hexPlaneCutTriangleVxes ) + for ( const caf::HexGridIntersectionTools::ClipVx& vertex : hexPlaneCutTriangleVxes ) { cvf::Vec3d temp = vertex.vx - p1; double dot = temp.dot( m_extrusionDirection ); @@ -400,22 +439,22 @@ void RivExtrudedCurveIntersectionGeometryGenerator::calculateArrays() caf::HexGridIntersectionTools::ClipVx cvx = clippedTriangleVxes[triVxIdx + i]; if ( cvx.isVxIdsNative ) { - m_triVxToCellCornerWeights.push_back( RivIntersectionVertexWeights( cvx.clippedEdgeVx1Id, - cvx.clippedEdgeVx2Id, - cvx.normDistFromEdgeVx1 ) ); + m_triVxToCellCornerWeights.emplace_back( cvx.clippedEdgeVx1Id, + cvx.clippedEdgeVx2Id, + cvx.normDistFromEdgeVx1 ); } else { caf::HexGridIntersectionTools::ClipVx cvx1 = hexPlaneCutTriangleVxes[cvx.clippedEdgeVx1Id]; caf::HexGridIntersectionTools::ClipVx cvx2 = hexPlaneCutTriangleVxes[cvx.clippedEdgeVx2Id]; - m_triVxToCellCornerWeights.push_back( RivIntersectionVertexWeights( cvx1.clippedEdgeVx1Id, - cvx1.clippedEdgeVx2Id, - cvx1.normDistFromEdgeVx1, - cvx2.clippedEdgeVx1Id, - cvx2.clippedEdgeVx2Id, - cvx2.normDistFromEdgeVx1, - cvx.normDistFromEdgeVx1 ) ); + m_triVxToCellCornerWeights.emplace_back( cvx1.clippedEdgeVx1Id, + cvx1.clippedEdgeVx2Id, + cvx1.normDistFromEdgeVx1, + cvx2.clippedEdgeVx1Id, + cvx2.clippedEdgeVx2Id, + cvx2.normDistFromEdgeVx1, + cvx.normDistFromEdgeVx1 ); } } } @@ -430,8 +469,10 @@ void RivExtrudedCurveIntersectionGeometryGenerator::calculateArrays() for ( const auto& it : meshAcc.faultToHighestFaultMeshVxMap ) { - m_faultMeshLabelAndAnchorPositions.push_back( { it.first->name(), it.second } ); + m_faultMeshLabelAndAnchorPositions.emplace_back( it.first->name(), it.second ); } + + calculateSurfaceIntersectionPoints(); } //-------------------------------------------------------------------------------------------------- @@ -491,7 +532,7 @@ cvf::ref RivExtrudedCurveIntersectionGeometryGenerator::create //-------------------------------------------------------------------------------------------------- cvf::ref RivExtrudedCurveIntersectionGeometryGenerator::createLineAlongPolylineDrawable() { - return RivPolylineGenerator::createLineAlongPolylineDrawable( m_flattenedOrOffsettedPolyLines ); + return RivPolylineGenerator::createLineAlongPolylineDrawable( m_transformedPolyLines ); } //-------------------------------------------------------------------------------------------------- @@ -517,7 +558,7 @@ cvf::ref RivExtrudedCurveIntersectionGeometryGenerator::create //-------------------------------------------------------------------------------------------------- cvf::ref RivExtrudedCurveIntersectionGeometryGenerator::createPointsFromPolylineDrawable() { - return RivPolylineGenerator::createPointsFromPolylineDrawable( m_flattenedOrOffsettedPolyLines ); + return RivPolylineGenerator::createPointsFromPolylineDrawable( m_transformedPolyLines ); } //-------------------------------------------------------------------------------------------------- @@ -538,6 +579,23 @@ cvf::ref RivExtrudedCurveIntersectionGeometryGenerator::create std::vector>( { displayCoords } ) ); } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +const std::vector>& RivExtrudedCurveIntersectionGeometryGenerator::flattenedOrOffsettedPolyLines() +{ + return m_transformedPolyLines; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +const std::vector>& + RivExtrudedCurveIntersectionGeometryGenerator::faultMeshLabelAndAnchorPositions() +{ + return m_faultMeshLabelAndAnchorPositions; +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- @@ -574,6 +632,75 @@ RimExtrudedCurveIntersection* RivExtrudedCurveIntersectionGeometryGenerator::int return m_intersection; } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +cvf::Vec3d RivExtrudedCurveIntersectionGeometryGenerator::transformPointByPolylineSegmentIndex( const cvf::Vec3d& domainCoord, + size_t lineIndex, + size_t segmentIndex ) +{ + CVF_ASSERT( lineIndex < m_lineSegmentTransforms.size() ); + CVF_ASSERT( segmentIndex < m_lineSegmentTransforms[lineIndex].size() ); + + // Each line segment along the polyline has a transformation matrix representing the transformation from 3D into + // flat 2D. Return the transformed domain coord using the required transformation matrix + + return domainCoord.getTransformedPoint( m_lineSegmentTransforms[lineIndex][segmentIndex] ); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +std::vector> + RivExtrudedCurveIntersectionGeometryGenerator::computeResampledPolyline( const std::vector& polyline, + double resamplingDistance ) +{ + // Segments along the original polyline must be provided to be able to find the associated transform matrix + std::vector> resampledPolyline; + + if ( polyline.size() > 1 ) + { + std::vector measuredDepth; + { + double aggregatedLength = 0.0; + + cvf::Vec3d previousPoint = polyline.front(); + measuredDepth.push_back( aggregatedLength ); + + for ( size_t i = 1; i < polyline.size(); i++ ) + { + aggregatedLength += ( previousPoint - polyline[i] ).length(); + previousPoint = polyline[i]; + measuredDepth.push_back( aggregatedLength ); + } + } + + // Use RigWellPath to perform the interpolation along a line based on measured depth + RigWellPath dummyWellPath( polyline, measuredDepth ); + + for ( size_t i = 1; i < polyline.size(); i++ ) + { + const auto& lineSegmentStart = polyline[i - 1]; + const auto& lineSegmentEnd = polyline[i]; + + auto startMD = measuredDepth[i - 1]; + auto endMD = measuredDepth[i]; + + const size_t segmentIndex = i - 1; + resampledPolyline.emplace_back( lineSegmentStart, segmentIndex ); + + for ( auto md = startMD + resamplingDistance; md < endMD; md += resamplingDistance ) + { + resampledPolyline.emplace_back( dummyWellPath.interpolatedPointAlongWellPath( md ), segmentIndex ); + } + + resampledPolyline.emplace_back( lineSegmentEnd, segmentIndex ); + } + } + + return resampledPolyline; +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- @@ -582,20 +709,20 @@ cvf::Mat4d { cvf::Mat4d flattenMx = cvf::Mat4d::IDENTITY; - for ( size_t pLineIdx = 0; pLineIdx < m_flattenedOrOffsettedPolyLines.size(); pLineIdx++ ) + for ( size_t pLineIdx = 0; pLineIdx < m_transformedPolyLines.size(); pLineIdx++ ) { - const std::vector& polyLine = m_flattenedOrOffsettedPolyLines[pLineIdx]; + const std::vector& polyLine = m_transformedPolyLines[pLineIdx]; for ( size_t pIdx = 0; pIdx < polyLine.size(); pIdx++ ) { if ( polyLine[pIdx].x() >= intersectionPointFlat.x() ) { size_t csIdx = pIdx > 0 ? pIdx - 1 : 0; - flattenMx = m_segementTransformPrLinePoint[pLineIdx][csIdx]; + flattenMx = m_lineSegmentTransforms[pLineIdx][csIdx]; break; } - else if ( pIdx == polyLine.size() - 1 ) + if ( pIdx == polyLine.size() - 1 ) { - flattenMx = m_segementTransformPrLinePoint[pLineIdx][pIdx]; + flattenMx = m_lineSegmentTransforms[pLineIdx][pIdx]; } } } @@ -612,8 +739,15 @@ bool RivExtrudedCurveIntersectionGeometryGenerator::isAnyGeometryPresent() const { return false; } - else - { - return true; - } + + return true; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +std::map> + RivExtrudedCurveIntersectionGeometryGenerator::transformedSurfaceIntersectionPolylines() const +{ + return m_transformedSurfaceIntersectionPolylines; } diff --git a/ApplicationLibCode/ModelVisualization/Intersections/RivExtrudedCurveIntersectionGeometryGenerator.h b/ApplicationLibCode/ModelVisualization/Intersections/RivExtrudedCurveIntersectionGeometryGenerator.h index 226e6129dc..00a216eca1 100644 --- a/ApplicationLibCode/ModelVisualization/Intersections/RivExtrudedCurveIntersectionGeometryGenerator.h +++ b/ApplicationLibCode/ModelVisualization/Intersections/RivExtrudedCurveIntersectionGeometryGenerator.h @@ -39,6 +39,7 @@ class RigResultAccessor; class RimExtrudedCurveIntersection; class RivIntersectionHexGridInterface; class RivIntersectionVertexWeights; +class RimSurface; namespace cvf { @@ -68,34 +69,37 @@ class RivExtrudedCurveIntersectionGeometryGenerator : public cvf::Object, public cvf::ref createPointsFromPolylineDrawable(); cvf::ref createPointsFromExtrusionLineDrawable( const std::vector& extrusionLine ); - const std::vector>& flattenedOrOffsettedPolyLines() - { - return m_flattenedOrOffsettedPolyLines; - } - const std::vector>& faultMeshLabelAndAnchorPositions() - { - return m_faultMeshLabelAndAnchorPositions; - } - - RimExtrudedCurveIntersection* intersection() const; + const std::vector>& faultMeshLabelAndAnchorPositions(); cvf::Mat4d unflattenTransformMatrix( const cvf::Vec3d& intersectionPointFlat ) const; // GeomGen Interface bool isAnyGeometryPresent() const override; + std::map> transformedSurfaceIntersectionPolylines() const; + const std::vector& triangleToCellIndex() const override; const std::vector& triangleVxToCellCornerInterpolationWeights() const override; const cvf::Vec3fArray* triangleVxes() const override; private: void calculateArrays(); - void calculateSegementTransformPrLinePoint(); - void calculateFlattenedOrOffsetedPolyline(); + void calculateLineSegementTransforms(); + void calculateTransformedPolyline(); + void calculateSurfaceIntersectionPoints(); + + RimExtrudedCurveIntersection* intersection() const; + const std::vector>& flattenedOrOffsettedPolyLines(); + cvf::Vec3d transformPointByPolylineSegmentIndex( const cvf::Vec3d& domainCoord, size_t lineIndex, size_t segmentIndex ); + + static std::vector> computeResampledPolyline( const std::vector& polyline, + double resamplingDistance ); + +private: RimExtrudedCurveIntersection* m_intersection; cvf::cref m_hexGrid; - const std::vector> m_polyLines; + const std::vector> m_polylines; cvf::Vec3d m_extrusionDirection; bool m_isFlattened; cvf::Vec3d m_flattenedPolylineStartPoint; @@ -106,8 +110,10 @@ class RivExtrudedCurveIntersectionGeometryGenerator : public cvf::Object, public cvf::ref m_faultCellBorderLineVxes; std::vector m_triangleToCellIdxMap; std::vector m_triVxToCellCornerWeights; - std::vector> m_flattenedOrOffsettedPolyLines; - std::vector> m_segementTransformPrLinePoint; + std::vector> m_transformedPolyLines; + std::vector> m_lineSegmentTransforms; std::vector> m_faultMeshLabelAndAnchorPositions; + + std::map> m_transformedSurfaceIntersectionPolylines; }; diff --git a/ApplicationLibCode/ModelVisualization/Intersections/RivExtrudedCurveIntersectionPartMgr.cpp b/ApplicationLibCode/ModelVisualization/Intersections/RivExtrudedCurveIntersectionPartMgr.cpp index 313b43f057..f846ffc619 100644 --- a/ApplicationLibCode/ModelVisualization/Intersections/RivExtrudedCurveIntersectionPartMgr.cpp +++ b/ApplicationLibCode/ModelVisualization/Intersections/RivExtrudedCurveIntersectionPartMgr.cpp @@ -42,6 +42,7 @@ #include "RimGeoMechView.h" #include "RimSimWellInView.h" #include "RimSimWellInViewCollection.h" +#include "RimSurface.h" #include "RimWellPath.h" #include "RimWellPathCollection.h" @@ -55,6 +56,7 @@ #include "RivObjectSourceInfo.h" #include "RivPartPriority.h" #include "RivPipeGeometryGenerator.h" +#include "RivPolylineGenerator.h" #include "RivResultToTextureMapper.h" #include "RivScalarMapperUtils.h" #include "RivSimWellPipeSourceInfo.h" @@ -66,6 +68,7 @@ #include "cvfDrawableGeo.h" #include "cvfDrawableText.h" +#include "cvfGeometryBuilderDrawableGeo.h" #include "cvfGeometryTools.h" #include "cvfModelBasicList.h" #include "cvfPart.h" @@ -94,7 +97,7 @@ RivExtrudedCurveIntersectionPartMgr::RivExtrudedCurveIntersectionPartMgr( RimExt cvf::Vec3d flattenedPolylineStartPoint; std::vector> polyLines = m_rimIntersection->polyLines( &flattenedPolylineStartPoint ); - if ( polyLines.size() > 0 ) + if ( !polyLines.empty() ) { cvf::Vec3d direction = m_rimIntersection->extrusionDirection(); cvf::ref hexGrid = m_rimIntersection->createHexGridInterface(); @@ -175,7 +178,7 @@ void RivIntersectionResultsColoringTools::calculateNodeOrElementNodeBasedGeoMech { textureCoords->resize( vertexWeights.size() ); - if ( resultValues.size() == 0 ) + if ( resultValues.empty() ) { textureCoords->setAll( cvf::Vec2f( 0.0, 1.0f ) ); } @@ -249,7 +252,7 @@ void RivExtrudedCurveIntersectionPartMgr::generatePartGeometry() // Set mapping from triangle face index to cell index cvf::ref si = - new RivExtrudedCurveIntersectionSourceInfo( m_intersectionGenerator.p() ); + new RivExtrudedCurveIntersectionSourceInfo( m_intersectionGenerator.p(), m_rimIntersection ); part->setSourceInfo( si.p() ); part->updateBoundingBox(); @@ -314,6 +317,8 @@ void RivExtrudedCurveIntersectionPartMgr::generatePartGeometry() if ( m_isFlattened ) createFaultLabelParts( m_intersectionGenerator->faultMeshLabelAndAnchorPositions() ); applySingleColorEffect(); + + createAnnotationSurfaceParts( useBufferObjects ); } //-------------------------------------------------------------------------------------------------- @@ -324,7 +329,7 @@ void RivExtrudedCurveIntersectionPartMgr::createFaultLabelParts( const std::vect m_faultMeshLabels = nullptr; m_faultMeshLabelLines = nullptr; - if ( !labelAndAnchors.size() ) return; + if ( labelAndAnchors.empty() ) return; RimFaultInViewCollection* faultInViewColl = nullptr; @@ -375,7 +380,7 @@ void RivExtrudedCurveIntersectionPartMgr::createFaultLabelParts( const std::vect textCoord.z() += labelZOffset; drawableText->addText( cvfString, textCoord ); - lineVertices.push_back( cvf::Vec3f( labelAndAnchorPair.second ) ); + lineVertices.emplace_back( labelAndAnchorPair.second ); lineVertices.push_back( textCoord ); visibleFaultNameCount++; } @@ -433,8 +438,8 @@ void RivExtrudedCurveIntersectionPartMgr::createPolyLineParts( bool useBufferObj m_highlightLineAlongPolyline = nullptr; m_highlightPointsForPolyline = nullptr; - if ( m_rimIntersection->type == RimExtrudedCurveIntersection::CS_POLYLINE || - m_rimIntersection->type == RimExtrudedCurveIntersection::CS_AZIMUTHLINE ) + if ( m_rimIntersection->type() == RimExtrudedCurveIntersection::CrossSectionEnum::CS_POLYLINE || + m_rimIntersection->type() == RimExtrudedCurveIntersection::CrossSectionEnum::CS_AZIMUTHLINE ) { { cvf::ref polylineGeo = m_intersectionGenerator->createLineAlongPolylineDrawable(); @@ -514,7 +519,7 @@ void RivExtrudedCurveIntersectionPartMgr::createExtrusionDirParts( bool useBuffe m_highlightLineAlongExtrusionDir = nullptr; m_highlightPointsForExtrusionDir = nullptr; - if ( m_rimIntersection->direction() == RimExtrudedCurveIntersection::CS_TWO_POINTS ) + if ( m_rimIntersection->direction() == RimExtrudedCurveIntersection::CrossSectionDirEnum::CS_TWO_POINTS ) { { cvf::ref polylineGeo = m_intersectionGenerator->createLineAlongExtrusionLineDrawable( @@ -588,6 +593,99 @@ void RivExtrudedCurveIntersectionPartMgr::createExtrusionDirParts( bool useBuffe } } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RivExtrudedCurveIntersectionPartMgr::createAnnotationSurfaceParts( bool useBufferObjects ) +{ + m_annotationParts.clear(); + + auto surfPolys = m_intersectionGenerator->transformedSurfaceIntersectionPolylines(); + for ( auto [surface, polylines] : surfPolys ) + { + if ( !surface ) continue; + + auto polylineGeo = RivPolylineGenerator::createLineAlongPolylineDrawable( polylines ); + if ( polylineGeo.notNull() ) + { + if ( useBufferObjects ) + { + polylineGeo->setRenderMode( cvf::DrawableGeo::BUFFER_OBJECT ); + } + + cvf::ref part = new cvf::Part; + part->setName( "Intersection " + surface->userDescription().toStdString() ); + part->setDrawable( polylineGeo.p() ); + + part->updateBoundingBox(); + part->setPriority( RivPartPriority::PartType::Highlight ); + + cvf::ref eff; + caf::MeshEffectGenerator lineEffGen( surface->color() ); + + lineEffGen.setLineWidth( 5.0f ); + + eff = lineEffGen.generateUnCachedEffect(); + part->setEffect( eff.p() ); + + m_annotationParts.push_back( part.p() ); + } + } + + if ( surfPolys.size() > 1 ) + { + // Create a quad strip between the two first polylines + + auto firstSurfaceItem = surfPolys.begin(); + auto secondSurfaceItem = firstSurfaceItem++; + + auto polylineA = firstSurfaceItem->second; + auto polylineB = secondSurfaceItem->second; + + size_t pointCount = std::min( polylineA.size(), polylineB.size() ); + if ( pointCount > 1 ) + { + cvf::GeometryBuilderDrawableGeo geoBuilder; + + for ( size_t i = 1; i < pointCount; i++ ) + { + const auto& pA0 = polylineA[i - 1]; + const auto& pA1 = polylineA[i]; + const auto& pB0 = polylineB[i - 1]; + const auto& pB1 = polylineB[i]; + + geoBuilder.addQuadByVertices( cvf::Vec3f( pA0 ), cvf::Vec3f( pA1 ), cvf::Vec3f( pB1 ), cvf::Vec3f( pB0 ) ); + } + + cvf::ref geo = geoBuilder.drawableGeo(); + if ( geo.notNull() ) + { + geo->computeNormals(); + + if ( useBufferObjects ) + { + geo->setRenderMode( cvf::DrawableGeo::BUFFER_OBJECT ); + } + + cvf::ref part = new cvf::Part; + part->setName( "Surface Intersection Band" ); + part->setDrawable( geo.p() ); + part->updateBoundingBox(); + part->setEnableMask( intersectionCellFaceBit ); + part->setPriority( RivPartPriority::PartType::Transparent ); + + auto color = cvf::Color4f( cvf::Color3f::OLIVE, 0.5f ); + caf::SurfaceEffectGenerator geometryEffgen( color, caf::PO_NEG_LARGE ); + + cvf::ref geometryOnlyEffect = geometryEffgen.generateCachedEffect(); + part->setEffect( geometryOnlyEffect.p() ); + + m_annotationParts.push_back( part.p() ); + } + } + } +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- @@ -649,9 +747,9 @@ void RivExtrudedCurveIntersectionPartMgr::appendPolylinePartsToModel( Rim3dView& cvf::ModelBasicList* model, cvf::Transform* scaleTransform ) { - Rim2dIntersectionView* curr2dView = dynamic_cast( &view ); + auto* curr2dView = dynamic_cast( &view ); - if ( m_rimIntersection->inputPolyLineFromViewerEnabled || ( curr2dView && curr2dView->showDefiningPoints() ) ) + if ( m_rimIntersection->inputPolyLineFromViewerEnabled() || ( curr2dView && curr2dView->showDefiningPoints() ) ) { if ( m_highlightLineAlongPolyline.notNull() ) { @@ -666,7 +764,7 @@ void RivExtrudedCurveIntersectionPartMgr::appendPolylinePartsToModel( Rim3dView& } } - if ( m_rimIntersection->inputExtrusionPointsFromViewerEnabled ) + if ( m_rimIntersection->inputExtrusionPointsFromViewerEnabled() ) { if ( m_highlightLineAlongExtrusionDir.notNull() ) { @@ -681,7 +779,7 @@ void RivExtrudedCurveIntersectionPartMgr::appendPolylinePartsToModel( Rim3dView& } } - if ( m_rimIntersection->inputTwoAzimuthPointsFromViewerEnabled || ( curr2dView && curr2dView->showDefiningPoints() ) ) + if ( m_rimIntersection->inputTwoAzimuthPointsFromViewerEnabled() || ( curr2dView && curr2dView->showDefiningPoints() ) ) { if ( m_highlightLineAlongPolyline.notNull() ) { @@ -695,14 +793,16 @@ void RivExtrudedCurveIntersectionPartMgr::appendPolylinePartsToModel( Rim3dView& model->addPart( m_highlightPointsForPolyline.p() ); } } -} -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -const RimExtrudedCurveIntersection* RivExtrudedCurveIntersectionPartMgr::intersection() const -{ - return m_rimIntersection.p(); + for ( size_t i = 0; i < m_annotationParts.size(); i++ ) + { + auto part = m_annotationParts[i]; + if ( part.notNull() ) + { + part->setTransform( scaleTransform ); + model->addPart( part.p() ); + } + } } //-------------------------------------------------------------------------------------------------- @@ -720,5 +820,5 @@ const RivIntersectionGeometryGeneratorIF* RivExtrudedCurveIntersectionPartMgr::i { if ( m_intersectionGenerator.notNull() ) return m_intersectionGenerator.p(); - return NULL; + return nullptr; } diff --git a/ApplicationLibCode/ModelVisualization/Intersections/RivExtrudedCurveIntersectionPartMgr.h b/ApplicationLibCode/ModelVisualization/Intersections/RivExtrudedCurveIntersectionPartMgr.h index 4612801ac9..6995b6629b 100644 --- a/ApplicationLibCode/ModelVisualization/Intersections/RivExtrudedCurveIntersectionPartMgr.h +++ b/ApplicationLibCode/ModelVisualization/Intersections/RivExtrudedCurveIntersectionPartMgr.h @@ -26,6 +26,7 @@ #include "cvfVector3.h" #include "cafPdmPointer.h" +#include "cvfCollection.h" #include @@ -76,18 +77,16 @@ class RivExtrudedCurveIntersectionPartMgr : public cvf::Object void appendMeshLinePartsToModel( cvf::ModelBasicList* model, cvf::Transform* scaleTransform ); void appendPolylinePartsToModel( Rim3dView& view, cvf::ModelBasicList* model, cvf::Transform* scaleTransform ); - const RimExtrudedCurveIntersection* intersection() const; - cvf::Mat4d unflattenTransformMatrix( const cvf::Vec3d& intersectionPointFlat ) const; const RivIntersectionGeometryGeneratorIF* intersectionGeometryGenerator() const; -public: private: void generatePartGeometry(); void createFaultLabelParts( const std::vector>& labelAndAnchors ); void createPolyLineParts( bool useBufferObjects ); void createExtrusionDirParts( bool useBufferObjects ); + void createAnnotationSurfaceParts( bool useBufferObjects ); private: caf::PdmPointer m_rimIntersection; @@ -104,6 +103,8 @@ class RivExtrudedCurveIntersectionPartMgr : public cvf::Object cvf::ref m_highlightLineAlongExtrusionDir; cvf::ref m_highlightPointsForExtrusionDir; + cvf::Collection m_annotationParts; + cvf::ref m_intersectionFacesTextureCoords; struct RivPipeBranchData diff --git a/ApplicationLibCode/ModelVisualization/Intersections/RivExtrudedCurveIntersectionSourceInfo.cpp b/ApplicationLibCode/ModelVisualization/Intersections/RivExtrudedCurveIntersectionSourceInfo.cpp index b510e211c4..938a0e951b 100644 --- a/ApplicationLibCode/ModelVisualization/Intersections/RivExtrudedCurveIntersectionSourceInfo.cpp +++ b/ApplicationLibCode/ModelVisualization/Intersections/RivExtrudedCurveIntersectionSourceInfo.cpp @@ -19,14 +19,17 @@ #include "RivExtrudedCurveIntersectionSourceInfo.h" +#include "RimExtrudedCurveIntersection.h" #include "RivExtrudedCurveIntersectionGeometryGenerator.h" //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- RivExtrudedCurveIntersectionSourceInfo::RivExtrudedCurveIntersectionSourceInfo( - RivExtrudedCurveIntersectionGeometryGenerator* geometryGenerator ) + RivExtrudedCurveIntersectionGeometryGenerator* geometryGenerator, + RimExtrudedCurveIntersection* intersection ) : m_intersectionGeometryGenerator( geometryGenerator ) + , m_intersection( intersection ) { CVF_ASSERT( m_intersectionGeometryGenerator.notNull() ); } @@ -59,5 +62,5 @@ std::array RivExtrudedCurveIntersectionSourceInfo::triangle( int //-------------------------------------------------------------------------------------------------- RimExtrudedCurveIntersection* RivExtrudedCurveIntersectionSourceInfo::intersection() const { - return m_intersectionGeometryGenerator->intersection(); + return m_intersection; } diff --git a/ApplicationLibCode/ModelVisualization/Intersections/RivExtrudedCurveIntersectionSourceInfo.h b/ApplicationLibCode/ModelVisualization/Intersections/RivExtrudedCurveIntersectionSourceInfo.h index 849742f292..ac13397fbf 100644 --- a/ApplicationLibCode/ModelVisualization/Intersections/RivExtrudedCurveIntersectionSourceInfo.h +++ b/ApplicationLibCode/ModelVisualization/Intersections/RivExtrudedCurveIntersectionSourceInfo.h @@ -19,8 +19,11 @@ #pragma once +#include "cafPdmPointer.h" + #include "cvfArray.h" #include "cvfObject.h" + #include class RivExtrudedCurveIntersectionGeometryGenerator; @@ -29,7 +32,8 @@ class RimExtrudedCurveIntersection; class RivExtrudedCurveIntersectionSourceInfo : public cvf::Object { public: - explicit RivExtrudedCurveIntersectionSourceInfo( RivExtrudedCurveIntersectionGeometryGenerator* geometryGenerator ); + explicit RivExtrudedCurveIntersectionSourceInfo( RivExtrudedCurveIntersectionGeometryGenerator* geometryGenerator, + RimExtrudedCurveIntersection* intersection ); const std::vector& triangleToCellIndex() const; std::array triangle( int triangleIdx ) const; @@ -37,4 +41,5 @@ class RivExtrudedCurveIntersectionSourceInfo : public cvf::Object private: cvf::cref m_intersectionGeometryGenerator; + caf::PdmPointer m_intersection; }; diff --git a/ApplicationLibCode/ModelVisualization/Intersections/RivSectionFlattner.cpp b/ApplicationLibCode/ModelVisualization/Intersections/RivSectionFlattener.cpp similarity index 87% rename from ApplicationLibCode/ModelVisualization/Intersections/RivSectionFlattner.cpp rename to ApplicationLibCode/ModelVisualization/Intersections/RivSectionFlattener.cpp index 884ab835f3..d8d6f6c533 100644 --- a/ApplicationLibCode/ModelVisualization/Intersections/RivSectionFlattner.cpp +++ b/ApplicationLibCode/ModelVisualization/Intersections/RivSectionFlattener.cpp @@ -16,7 +16,7 @@ // ///////////////////////////////////////////////////////////////////////////////// -#include "RivSectionFlattner.h" +#include "RivSectionFlattener.h" #include "cvfGeometryTools.h" //-------------------------------------------------------------------------------------------------- @@ -25,9 +25,9 @@ /// /// Returns size_t(-1) if no point is found //-------------------------------------------------------------------------------------------------- -size_t RivSectionFlattner::indexToNextValidPoint( const std::vector& polyLine, - const cvf::Vec3d extrDir, - size_t idxToStartOfLineSegment ) +size_t RivSectionFlattener::indexToNextValidPoint( const std::vector& polyLine, + const cvf::Vec3d extrDir, + size_t idxToStartOfLineSegment ) { size_t lineCount = polyLine.size(); if ( !( idxToStartOfLineSegment + 1 < lineCount ) ) return -1; @@ -51,10 +51,10 @@ size_t RivSectionFlattner::indexToNextValidPoint( const std::vector& //-------------------------------------------------------------------------------------------------- /// Returns one CS pr point, valid for the next segment //-------------------------------------------------------------------------------------------------- -std::vector RivSectionFlattner::calculateFlatteningCSsForPolyline( const std::vector& polyLine, - const cvf::Vec3d& extrusionDir, - const cvf::Vec3d& startOffset, - cvf::Vec3d* endOffset ) +std::vector RivSectionFlattener::calculateFlatteningCSsForPolyline( const std::vector& polyLine, + const cvf::Vec3d& extrusionDir, + const cvf::Vec3d& startOffset, + cvf::Vec3d* endOffset ) { CVF_ASSERT( endOffset ); size_t pointCount = polyLine.size(); @@ -128,9 +128,9 @@ std::vector RivSectionFlattner::calculateFlatteningCSsForPolyline( c /// Ey normal to the section plane /// Ex in plane along p1-p2 //-------------------------------------------------------------------------------------------------- -cvf::Mat4d RivSectionFlattner::calculateSectionLocalFlatteningCS( const cvf::Vec3d& p1, - const cvf::Vec3d& p2, - const cvf::Vec3d& extrusionDir ) +cvf::Mat4d RivSectionFlattener::calculateSectionLocalFlatteningCS( const cvf::Vec3d& p1, + const cvf::Vec3d& p2, + const cvf::Vec3d& extrusionDir ) { using namespace cvf; diff --git a/ApplicationLibCode/ModelVisualization/Intersections/RivSectionFlattner.h b/ApplicationLibCode/ModelVisualization/Intersections/RivSectionFlattener.h similarity index 98% rename from ApplicationLibCode/ModelVisualization/Intersections/RivSectionFlattner.h rename to ApplicationLibCode/ModelVisualization/Intersections/RivSectionFlattener.h index e8ec46d7f8..9b1bf50043 100644 --- a/ApplicationLibCode/ModelVisualization/Intersections/RivSectionFlattner.h +++ b/ApplicationLibCode/ModelVisualization/Intersections/RivSectionFlattener.h @@ -22,7 +22,7 @@ #include -class RivSectionFlattner +class RivSectionFlattener { public: static size_t indexToNextValidPoint( const std::vector& polyLine, diff --git a/ApplicationLibCode/ModelVisualization/RivSimWellPipesPartMgr.cpp b/ApplicationLibCode/ModelVisualization/RivSimWellPipesPartMgr.cpp index 815f182e03..63966091c5 100644 --- a/ApplicationLibCode/ModelVisualization/RivSimWellPipesPartMgr.cpp +++ b/ApplicationLibCode/ModelVisualization/RivSimWellPipesPartMgr.cpp @@ -37,7 +37,7 @@ #include "RimVirtualPerforationResults.h" #include "RivPipeGeometryGenerator.h" -#include "RivSectionFlattner.h" +#include "RivSectionFlattener.h" #include "RivSimWellConnectionSourceInfo.h" #include "RivSimWellPipeSourceInfo.h" #include "RivWellConnectionFactorGeometryGenerator.h" @@ -203,10 +203,10 @@ void RivSimWellPipesPartMgr::buildWellPipeParts( const caf::DisplayCoordTransfor if ( doFlatten ) { std::vector flatningCSs = - RivSectionFlattner::calculateFlatteningCSsForPolyline( m_pipeBranchesCLCoords[brIdx], - cvf::Vec3d::Z_AXIS, - flattenedStartOffset, - &flattenedStartOffset ); + RivSectionFlattener::calculateFlatteningCSsForPolyline( m_pipeBranchesCLCoords[brIdx], + cvf::Vec3d::Z_AXIS, + flattenedStartOffset, + &flattenedStartOffset ); for ( size_t cIdx = 0; cIdx < cvfCoords->size(); ++cIdx ) { ( *cvfCoords )[cIdx] = ( ( *cvfCoords )[cIdx] ).getTransformedPoint( flatningCSs[cIdx] ); diff --git a/ApplicationLibCode/ModelVisualization/RivWellDiskPartMgr.cpp b/ApplicationLibCode/ModelVisualization/RivWellDiskPartMgr.cpp index 2d986385e6..c7403321f9 100644 --- a/ApplicationLibCode/ModelVisualization/RivWellDiskPartMgr.cpp +++ b/ApplicationLibCode/ModelVisualization/RivWellDiskPartMgr.cpp @@ -33,7 +33,7 @@ #include "RivDiskGeometryGenerator.h" #include "RivPartPriority.h" -#include "RivSectionFlattner.h" +#include "RivSectionFlattener.h" #include "RivSimWellPipeSourceInfo.h" #include "RivTextLabelSourceInfo.h" diff --git a/ApplicationLibCode/ModelVisualization/RivWellHeadPartMgr.cpp b/ApplicationLibCode/ModelVisualization/RivWellHeadPartMgr.cpp index 4b9b49801d..50a0fdde92 100644 --- a/ApplicationLibCode/ModelVisualization/RivWellHeadPartMgr.cpp +++ b/ApplicationLibCode/ModelVisualization/RivWellHeadPartMgr.cpp @@ -36,7 +36,7 @@ #include "RivPartPriority.h" #include "RivPipeGeometryGenerator.h" -#include "RivSectionFlattner.h" +#include "RivSectionFlattener.h" #include "RivSimWellPipeSourceInfo.h" #include "RivTextLabelSourceInfo.h" diff --git a/ApplicationLibCode/ModelVisualization/RivWellPathPartMgr.cpp b/ApplicationLibCode/ModelVisualization/RivWellPathPartMgr.cpp index 166f2d2a64..a055f67ec4 100644 --- a/ApplicationLibCode/ModelVisualization/RivWellPathPartMgr.cpp +++ b/ApplicationLibCode/ModelVisualization/RivWellPathPartMgr.cpp @@ -58,7 +58,7 @@ #include "RivObjectSourceInfo.h" #include "RivPartPriority.h" #include "RivPipeGeometryGenerator.h" -#include "RivSectionFlattner.h" +#include "RivSectionFlattener.h" #include "RivTextLabelSourceInfo.h" #include "RivWellConnectionFactorPartMgr.h" #include "RivWellFracturePartMgr.h" @@ -438,12 +438,12 @@ void RivWellPathPartMgr::appendPerforationsToModel( cvf::ModelBasicList* { cvf::Vec3d dummy; vector flatningCSs = - RivSectionFlattner::calculateFlatteningCSsForPolyline( perfIntervalCL, - cvf::Vec3d::Z_AXIS, - { horizontalLengthAlongWellPath, - 0.0, - perfIntervalCL[0].z() }, - &dummy ); + RivSectionFlattener::calculateFlatteningCSsForPolyline( perfIntervalCL, + cvf::Vec3d::Z_AXIS, + { horizontalLengthAlongWellPath, + 0.0, + perfIntervalCL[0].z() }, + &dummy ); for ( size_t cIdx = 0; cIdx < perfIntervalCL.size(); ++cIdx ) { @@ -668,12 +668,12 @@ void RivWellPathPartMgr::buildWellPathParts( const caf::DisplayCoordTransform* d { cvf::Vec3d dummy; std::vector flatningCSs = - RivSectionFlattner::calculateFlatteningCSsForPolyline( clippedWellPathCenterLine, - cvf::Vec3d::Z_AXIS, - { horizontalLengthAlongWellToClipPoint, - 0.0, - clippedWellPathCenterLine[0].z() }, - &dummy ); + RivSectionFlattener::calculateFlatteningCSsForPolyline( clippedWellPathCenterLine, + cvf::Vec3d::Z_AXIS, + { horizontalLengthAlongWellToClipPoint, + 0.0, + clippedWellPathCenterLine[0].z() }, + &dummy ); for ( size_t cIdx = 0; cIdx < cvfCoords->size(); ++cIdx ) { @@ -814,11 +814,8 @@ void RivWellPathPartMgr::buildWellPathParts( const caf::DisplayCoordTransform* d cvf::GeometryBuilderTriangles builder; cvf::GeometryUtils::createSphere( cellRadius, 15, 15, &builder ); vectorDrawable->setGlyph( builder.trianglesUShort().p(), builder.vertices().p() ); - - { - vectorDrawable->setRadius( cellRadius ); - vectorDrawable->setCenterCoords( vertices.p() ); - } + vectorDrawable->setRadius( cellRadius ); + vectorDrawable->setCenterCoords( vertices.p() ); cvf::ref part = new cvf::Part; part->setName( "RivWellPathPartMgr_WellTargetSpheres" ); @@ -906,10 +903,16 @@ void RivWellPathPartMgr::appendFlattenedStaticGeometryPartsToModel( cvf::ModelBa model->addPart( m_wellLabelPart.p() ); } - if ( m_spherePart.notNull() ) - { - model->addPart( m_spherePart.p() ); - } + /* + // TODO: Currently not supported. + // Require coordinate transformations of the spheres similar to RivWellPathPartMgr::buildWellPathParts + // https://github.com/OPM/ResInsight/issues/7891 + // + if ( m_spherePart.notNull() ) + { + model->addPart( m_spherePart.p() ); + } + */ } //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationLibCode/ModelVisualization/Surfaces/RivSurfaceIntersectionGeometryGenerator.cpp b/ApplicationLibCode/ModelVisualization/Surfaces/RivSurfaceIntersectionGeometryGenerator.cpp index ce2f7e710d..179c4fb99a 100644 --- a/ApplicationLibCode/ModelVisualization/Surfaces/RivSurfaceIntersectionGeometryGenerator.cpp +++ b/ApplicationLibCode/ModelVisualization/Surfaces/RivSurfaceIntersectionGeometryGenerator.cpp @@ -19,6 +19,8 @@ #include "RivSurfaceIntersectionGeometryGenerator.h" +#include "RiaLogging.h" + #include "RigMainGrid.h" #include "RigResultAccessor.h" @@ -32,10 +34,13 @@ #include "RivExtrudedCurveIntersectionPartMgr.h" #include "RivHexGridIntersectionTools.h" #include "RivPolylineGenerator.h" +#include "RivSectionFlattener.h" #include "cafDisplayCoordTransform.h" #include "cafHexGridIntersectionTools/cafHexGridIntersectionTools.h" +#include "../cafHexInterpolator/cafHexInterpolator.h" // Use relative path, as this is a header only file not part of a library + #include "cvfDrawableGeo.h" #include "cvfGeometryTools.h" #include "cvfPlane.h" @@ -44,12 +49,6 @@ #include "cvfRay.h" #include "cvfScalarMapper.h" -#include "../cafHexInterpolator/cafHexInterpolator.h" -#include "RivSectionFlattner.h" - -#include "RiaLogging.h" -#include "clipper.hpp" - cvf::ref displayCoordTransform( const RimIntersection* intersection ) { Rim3dView* rimView = nullptr; @@ -206,10 +205,8 @@ void RivSurfaceIntersectionGeometryGenerator::calculateArrays() std::array cellCorners; std::array cornerIndices; - for ( size_t ticIdx = 0; ticIdx < triIntersectedCellCandidates.size(); ++ticIdx ) + for ( size_t globalCellIdx : triIntersectedCellCandidates ) { - size_t globalCellIdx = triIntersectedCellCandidates[ticIdx]; - if ( !m_hexGrid->useCell( globalCellIdx ) ) continue; hexPlaneCutTriangleVxes.clear(); @@ -309,7 +306,7 @@ void RivSurfaceIntersectionGeometryGenerator::calculateArrays() for ( const auto& it : meshAcc.faultToHighestFaultMeshVxMap ) { - m_faultMeshLabelAndAnchorPositions.push_back( { it.first->name(), it.second } ); + m_faultMeshLabelAndAnchorPositions.emplace_back( it.first->name(), it.second ); } } @@ -417,8 +414,6 @@ bool RivSurfaceIntersectionGeometryGenerator::isAnyGeometryPresent() const { return false; } - else - { - return true; - } + + return true; } diff --git a/ApplicationLibCode/ModelVisualization/WindowEdgeAxesOverlayItem/RivWindowEdgeAxesOverlayItem.cpp b/ApplicationLibCode/ModelVisualization/WindowEdgeAxesOverlayItem/RivWindowEdgeAxesOverlayItem.cpp index f1a9725adc..c585c8f269 100644 --- a/ApplicationLibCode/ModelVisualization/WindowEdgeAxesOverlayItem/RivWindowEdgeAxesOverlayItem.cpp +++ b/ApplicationLibCode/ModelVisualization/WindowEdgeAxesOverlayItem/RivWindowEdgeAxesOverlayItem.cpp @@ -132,6 +132,9 @@ void RivWindowEdgeAxesOverlayItem::updateFromCamera( const Camera* camera ) windowMaxInDomain = m_dispalyCoordsTransform->transformToDomainCoord( windowMaxInDomain ); } + // For extreme zoom factors we might end up with both variables as zero. Return to avoid divide by zero. + if ( windowOrigoInDomain == windowMaxInDomain ) return; + double domainMinX = windowOrigoInDomain.x(); double domainMaxX = windowMaxInDomain.x(); diff --git a/ApplicationLibCode/ProjectDataModel/Rim2dIntersectionView.cpp b/ApplicationLibCode/ProjectDataModel/Rim2dIntersectionView.cpp index 36ff2b0e58..e06867118e 100644 --- a/ApplicationLibCode/ProjectDataModel/Rim2dIntersectionView.cpp +++ b/ApplicationLibCode/ProjectDataModel/Rim2dIntersectionView.cpp @@ -562,7 +562,8 @@ void Rim2dIntersectionView::onCreateDisplayModel() m_flatSimWellPipePartMgr = nullptr; m_flatWellHeadPartMgr = nullptr; - if ( m_intersection->type() == RimExtrudedCurveIntersection::CS_SIMULATION_WELL && m_intersection->simulationWell() ) + if ( m_intersection->type() == RimExtrudedCurveIntersection::CrossSectionEnum::CS_SIMULATION_WELL && + m_intersection->simulationWell() ) { RimEclipseView* eclipseView = nullptr; m_intersection->firstAncestorOrThisOfType( eclipseView ); @@ -575,7 +576,8 @@ void Rim2dIntersectionView::onCreateDisplayModel() } m_flatWellpathPartMgr = nullptr; - if ( m_intersection->type() == RimExtrudedCurveIntersection::CS_WELL_PATH && m_intersection->wellPath() ) + if ( m_intersection->type() == RimExtrudedCurveIntersection::CrossSectionEnum::CS_WELL_PATH && + m_intersection->wellPath() ) { Rim3dView* settingsView = nullptr; m_intersection->firstAncestorOrThisOfType( settingsView ); diff --git a/ApplicationLibCode/ProjectDataModel/RimExtrudedCurveIntersection.cpp b/ApplicationLibCode/ProjectDataModel/RimExtrudedCurveIntersection.cpp index f679373ba0..51bc8177ea 100644 --- a/ApplicationLibCode/ProjectDataModel/RimExtrudedCurveIntersection.cpp +++ b/ApplicationLibCode/ProjectDataModel/RimExtrudedCurveIntersection.cpp @@ -22,14 +22,21 @@ #include "RigEclipseCaseData.h" #include "RigWellPath.h" +#include "Rim2dIntersectionView.h" #include "Rim3dView.h" #include "RimCase.h" #include "RimEclipseCase.h" #include "RimEclipseView.h" +#include "RimEnsembleSurface.h" +#include "RimGridView.h" +#include "RimIntersectionResultDefinition.h" +#include "RimIntersectionResultsDefinitionCollection.h" #include "RimOilField.h" #include "RimProject.h" #include "RimSimWellInView.h" #include "RimSimWellInViewCollection.h" +#include "RimSurface.h" +#include "RimSurfaceCollection.h" #include "RimTools.h" #include "RimWellPath.h" @@ -42,10 +49,7 @@ #include "cafPdmUiListEditor.h" #include "cafPdmUiPushButtonEditor.h" -#include "Rim2dIntersectionView.h" -#include "RimGridView.h" -#include "RimIntersectionResultDefinition.h" -#include "RimIntersectionResultsDefinitionCollection.h" +#include "cafPdmUiTreeSelectionEditor.h" #include "cvfBoundingBox.h" #include "cvfGeometryTools.h" #include "cvfPlane.h" @@ -55,20 +59,20 @@ namespace caf template <> void caf::AppEnum::setUp() { - addItem( RimExtrudedCurveIntersection::CS_WELL_PATH, "CS_WELL_PATH", "Well Path" ); - addItem( RimExtrudedCurveIntersection::CS_SIMULATION_WELL, "CS_SIMULATION_WELL", "Simulation Well" ); - addItem( RimExtrudedCurveIntersection::CS_POLYLINE, "CS_POLYLINE", "Polyline" ); - addItem( RimExtrudedCurveIntersection::CS_AZIMUTHLINE, "CS_AZIMUTHLINE", "Azimuth and Dip" ); - setDefault( RimExtrudedCurveIntersection::CS_WELL_PATH ); + addItem( RimExtrudedCurveIntersection::CrossSectionEnum::CS_WELL_PATH, "CS_WELL_PATH", "Well Path" ); + addItem( RimExtrudedCurveIntersection::CrossSectionEnum::CS_SIMULATION_WELL, "CS_SIMULATION_WELL", "Simulation Well" ); + addItem( RimExtrudedCurveIntersection::CrossSectionEnum::CS_POLYLINE, "CS_POLYLINE", "Polyline" ); + addItem( RimExtrudedCurveIntersection::CrossSectionEnum::CS_AZIMUTHLINE, "CS_AZIMUTHLINE", "Azimuth and Dip" ); + setDefault( RimExtrudedCurveIntersection::CrossSectionEnum::CS_WELL_PATH ); } template <> void caf::AppEnum::setUp() { - addItem( RimExtrudedCurveIntersection::CS_VERTICAL, "CS_VERTICAL", "Vertical" ); - addItem( RimExtrudedCurveIntersection::CS_HORIZONTAL, "CS_HORIZONTAL", "Horizontal" ); - addItem( RimExtrudedCurveIntersection::CS_TWO_POINTS, "CS_TWO_POINTS", "Defined by Two Points" ); - setDefault( RimExtrudedCurveIntersection::CS_VERTICAL ); + addItem( RimExtrudedCurveIntersection::CrossSectionDirEnum::CS_VERTICAL, "CS_VERTICAL", "Vertical" ); + addItem( RimExtrudedCurveIntersection::CrossSectionDirEnum::CS_HORIZONTAL, "CS_HORIZONTAL", "Horizontal" ); + addItem( RimExtrudedCurveIntersection::CrossSectionDirEnum::CS_TWO_POINTS, "CS_TWO_POINTS", "Defined by Two Points" ); + setDefault( RimExtrudedCurveIntersection::CrossSectionDirEnum::CS_VERTICAL ); } } // namespace caf @@ -85,6 +89,98 @@ const RivIntersectionGeometryGeneratorIF* RimExtrudedCurveIntersection::intersec return nullptr; } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RimExtrudedCurveIntersection::CrossSectionEnum RimExtrudedCurveIntersection::type() const +{ + return m_type(); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RimExtrudedCurveIntersection::CrossSectionDirEnum RimExtrudedCurveIntersection::direction() const +{ + return m_direction(); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RimWellPath* RimExtrudedCurveIntersection::wellPath() const +{ + return m_wellPath; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RimSimWellInView* RimExtrudedCurveIntersection::simulationWell() const +{ + return m_simulationWell; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +bool RimExtrudedCurveIntersection::inputPolyLineFromViewerEnabled() const +{ + return m_inputPolylineFromViewerEnabled; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +bool RimExtrudedCurveIntersection::inputExtrusionPointsFromViewerEnabled() const +{ + return m_inputExtrusionPointsFromViewerEnabled; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +bool RimExtrudedCurveIntersection::inputTwoAzimuthPointsFromViewerEnabled() const +{ + return m_inputTwoAzimuthPointsFromViewerEnabled; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimExtrudedCurveIntersection::configureForSimulationWell( RimSimWellInView* simWell ) +{ + m_type = CrossSectionEnum::CS_SIMULATION_WELL; + m_simulationWell = simWell; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimExtrudedCurveIntersection::configureForWellPath( RimWellPath* wellPath ) +{ + m_type = CrossSectionEnum::CS_WELL_PATH; + m_wellPath = wellPath; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimExtrudedCurveIntersection::configureForPolyLine() +{ + m_type = CrossSectionEnum::CS_POLYLINE; + m_inputPolylineFromViewerEnabled = true; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimExtrudedCurveIntersection::configureForAzimuthLine() +{ + m_type = CrossSectionEnum::CS_AZIMUTHLINE; + m_inputTwoAzimuthPointsFromViewerEnabled = true; +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- @@ -93,10 +189,10 @@ RimExtrudedCurveIntersection::RimExtrudedCurveIntersection() CAF_PDM_InitObject( "Intersection", ":/CrossSection16x16.png", "", "" ); CAF_PDM_InitField( &m_name, "UserDescription", QString( "Intersection Name" ), "Name", "", "", "" ); - CAF_PDM_InitFieldNoDefault( &type, "Type", "Type", "", "", "" ); - CAF_PDM_InitFieldNoDefault( &direction, "Direction", "Direction", "", "", "" ); - CAF_PDM_InitFieldNoDefault( &wellPath, "WellPath", "Well Path ", "", "", "" ); - CAF_PDM_InitFieldNoDefault( &simulationWell, "SimulationWell", "Simulation Well", "", "", "" ); + CAF_PDM_InitFieldNoDefault( &m_type, "Type", "Type", "", "", "" ); + CAF_PDM_InitFieldNoDefault( &m_direction, "Direction", "Direction", "", "", "" ); + CAF_PDM_InitFieldNoDefault( &m_wellPath, "WellPath", "Well Path ", "", "", "" ); + CAF_PDM_InitFieldNoDefault( &m_simulationWell, "SimulationWell", "Simulation Well", "", "", "" ); CAF_PDM_InitFieldNoDefault( &m_userPolyline, "Points", "Points", "", "Use Ctrl-C for copy and Ctrl-V for paste", "" ); CAF_PDM_InitField( &m_azimuthAngle, "AzimuthAngle", 0.0, "Azimuth", "", "", "" ); @@ -118,22 +214,30 @@ RimExtrudedCurveIntersection::RimExtrudedCurveIntersection() CAF_PDM_InitField( &m_lengthUp, "lengthUp", 1000.0, "Length Up", "", "", "" ); CAF_PDM_InitField( &m_lengthDown, "lengthDown", 1000.0, "Length Down", "", "", "" ); - CAF_PDM_InitFieldNoDefault( &inputPolyLineFromViewerEnabled, "m_activateUiAppendPointsCommand", "", "", "", "" ); - caf::PdmUiPushButtonEditor::configureEditorForField( &inputPolyLineFromViewerEnabled ); - inputPolyLineFromViewerEnabled = false; + CAF_PDM_InitFieldNoDefault( &m_inputPolylineFromViewerEnabled, "m_activateUiAppendPointsCommand", "", "", "", "" ); + caf::PdmUiPushButtonEditor::configureEditorForField( &m_inputPolylineFromViewerEnabled ); + m_inputPolylineFromViewerEnabled = false; - CAF_PDM_InitFieldNoDefault( &inputExtrusionPointsFromViewerEnabled, "inputExtrusionPointsFromViewerEnabled", "", "", "", "" ); - caf::PdmUiPushButtonEditor::configureEditorForField( &inputExtrusionPointsFromViewerEnabled ); - inputExtrusionPointsFromViewerEnabled = false; + CAF_PDM_InitFieldNoDefault( &m_inputExtrusionPointsFromViewerEnabled, + "inputExtrusionPointsFromViewerEnabled", + "", + "", + "", + "" ); + caf::PdmUiPushButtonEditor::configureEditorForField( &m_inputExtrusionPointsFromViewerEnabled ); + m_inputExtrusionPointsFromViewerEnabled = false; - CAF_PDM_InitFieldNoDefault( &inputTwoAzimuthPointsFromViewerEnabled, + CAF_PDM_InitFieldNoDefault( &m_inputTwoAzimuthPointsFromViewerEnabled, "inputTwoAzimuthPointsFromViewerEnabled", "", "", "", "" ); - caf::PdmUiPushButtonEditor::configureEditorForField( &inputTwoAzimuthPointsFromViewerEnabled ); - inputTwoAzimuthPointsFromViewerEnabled = false; + caf::PdmUiPushButtonEditor::configureEditorForField( &m_inputTwoAzimuthPointsFromViewerEnabled ); + m_inputTwoAzimuthPointsFromViewerEnabled = false; + + CAF_PDM_InitFieldNoDefault( &m_annotationSurfaces, "annotationSurfaces", "", "", "", "" ); + m_annotationSurfaces.uiCapability()->setUiEditorTypeName( caf::PdmUiTreeSelectionEditor::uiEditorTypeName() ); uiCapability()->setUiTreeChildrenHidden( true ); @@ -178,30 +282,21 @@ void RimExtrudedCurveIntersection::fieldChangedByUi( const caf::PdmFieldHandle* const QVariant& oldValue, const QVariant& newValue ) { - // clang-format off - if ( changedField == &m_isActive || - changedField == &type || - changedField == &direction || - changedField == &wellPath || - changedField == &simulationWell || - changedField == &m_branchIndex || - changedField == &m_extentLength || - changedField == &m_lengthUp || - changedField == &m_lengthDown || - changedField == &m_showInactiveCells || - changedField == &m_useSeparateDataSource || + if ( changedField == &m_isActive || changedField == &m_type || changedField == &m_direction || + changedField == &m_wellPath || changedField == &m_simulationWell || changedField == &m_branchIndex || + changedField == &m_extentLength || changedField == &m_lengthUp || changedField == &m_lengthDown || + changedField == &m_showInactiveCells || changedField == &m_useSeparateDataSource || changedField == &m_separateDataSource ) { rebuildGeometryAndScheduleCreateDisplayModel(); } - // clang-format on - if ( changedField == &simulationWell || changedField == &m_isActive || changedField == &type ) + if ( changedField == &m_simulationWell || changedField == &m_isActive || changedField == &m_type ) { recomputeSimulationWellBranchData(); } - if ( changedField == &simulationWell || changedField == &wellPath || changedField == &m_branchIndex ) + if ( changedField == &m_simulationWell || changedField == &m_wellPath || changedField == &m_branchIndex ) { updateName(); } @@ -216,34 +311,34 @@ void RimExtrudedCurveIntersection::fieldChangedByUi( const caf::PdmFieldHandle* } } - if ( changedField == &inputPolyLineFromViewerEnabled || changedField == &m_userPolyline ) + if ( changedField == &m_inputPolylineFromViewerEnabled || changedField == &m_userPolyline ) { - if ( inputPolyLineFromViewerEnabled ) + if ( m_inputPolylineFromViewerEnabled ) { - inputExtrusionPointsFromViewerEnabled = false; - inputTwoAzimuthPointsFromViewerEnabled = false; + m_inputExtrusionPointsFromViewerEnabled = false; + m_inputTwoAzimuthPointsFromViewerEnabled = false; } rebuildGeometryAndScheduleCreateDisplayModel(); } - if ( changedField == &inputExtrusionPointsFromViewerEnabled || changedField == &m_customExtrusionPoints ) + if ( changedField == &m_inputExtrusionPointsFromViewerEnabled || changedField == &m_customExtrusionPoints ) { - if ( inputExtrusionPointsFromViewerEnabled ) + if ( m_inputExtrusionPointsFromViewerEnabled ) { - inputPolyLineFromViewerEnabled = false; - inputTwoAzimuthPointsFromViewerEnabled = false; + m_inputPolylineFromViewerEnabled = false; + m_inputTwoAzimuthPointsFromViewerEnabled = false; } rebuildGeometryAndScheduleCreateDisplayModel(); } - if ( changedField == &inputTwoAzimuthPointsFromViewerEnabled || changedField == &m_twoAzimuthPoints ) + if ( changedField == &m_inputTwoAzimuthPointsFromViewerEnabled || changedField == &m_twoAzimuthPoints ) { - if ( inputTwoAzimuthPointsFromViewerEnabled ) + if ( m_inputTwoAzimuthPointsFromViewerEnabled ) { - inputPolyLineFromViewerEnabled = false; - inputExtrusionPointsFromViewerEnabled = false; + m_inputPolylineFromViewerEnabled = false; + m_inputExtrusionPointsFromViewerEnabled = false; } rebuildGeometryAndScheduleCreateDisplayModel(); @@ -259,6 +354,12 @@ void RimExtrudedCurveIntersection::fieldChangedByUi( const caf::PdmFieldHandle* { rebuildGeometryAndScheduleCreateDisplayModel(); } + + if ( changedField == &m_annotationSurfaces ) + + { + rebuildGeometryAndScheduleCreateDisplayModel(); + } } //-------------------------------------------------------------------------------------------------- @@ -268,56 +369,56 @@ void RimExtrudedCurveIntersection::defineUiOrdering( QString uiConfigName, caf:: { uiOrdering.add( &m_name ); caf::PdmUiGroup* geometryGroup = uiOrdering.addNewGroup( "Intersecting Geometry" ); - geometryGroup->add( &type ); + geometryGroup->add( &m_type ); - if ( type == CS_WELL_PATH ) + if ( m_type() == CrossSectionEnum::CS_WELL_PATH ) { - geometryGroup->add( &wellPath ); + geometryGroup->add( &m_wellPath ); } - else if ( type == CS_SIMULATION_WELL ) + else if ( type() == CrossSectionEnum::CS_SIMULATION_WELL ) { - geometryGroup->add( &simulationWell ); + geometryGroup->add( &m_simulationWell ); updateSimulationWellCenterline(); - if ( simulationWell() && m_simulationWellBranchCenterlines.size() > 1 ) + if ( m_simulationWell() && m_simulationWellBranchCenterlines.size() > 1 ) { geometryGroup->add( &m_branchIndex ); } } - else if ( type == CS_POLYLINE ) + else if ( type() == CrossSectionEnum::CS_POLYLINE ) { geometryGroup->add( &m_userPolyline ); - geometryGroup->add( &inputPolyLineFromViewerEnabled ); + geometryGroup->add( &m_inputPolylineFromViewerEnabled ); } - else if ( type == CS_AZIMUTHLINE ) + else if ( type() == CrossSectionEnum::CS_AZIMUTHLINE ) { geometryGroup->add( &m_twoAzimuthPoints ); - geometryGroup->add( &inputTwoAzimuthPointsFromViewerEnabled ); + geometryGroup->add( &m_inputTwoAzimuthPointsFromViewerEnabled ); geometryGroup->add( &m_azimuthAngle ); geometryGroup->add( &m_dipAngle ); } caf::PdmUiGroup* optionsGroup = uiOrdering.addNewGroup( "Options" ); - if ( type == CS_AZIMUTHLINE ) + if ( type() == CrossSectionEnum::CS_AZIMUTHLINE ) { optionsGroup->add( &m_lengthUp ); optionsGroup->add( &m_lengthDown ); } else { - optionsGroup->add( &direction ); + optionsGroup->add( &m_direction ); optionsGroup->add( &m_extentLength ); } - if ( direction == CS_TWO_POINTS ) + if ( direction() == CrossSectionDirEnum::CS_TWO_POINTS ) { optionsGroup->add( &m_customExtrusionPoints ); - optionsGroup->add( &inputExtrusionPointsFromViewerEnabled ); + optionsGroup->add( &m_inputExtrusionPointsFromViewerEnabled ); } optionsGroup->add( &m_showInactiveCells ); - if ( type == CS_POLYLINE ) + if ( type() == CrossSectionEnum::CS_POLYLINE ) { m_extentLength.uiCapability()->setUiReadOnly( true ); } @@ -326,6 +427,9 @@ void RimExtrudedCurveIntersection::defineUiOrdering( QString uiConfigName, caf:: m_extentLength.uiCapability()->setUiReadOnly( false ); } + caf::PdmUiGroup* surfaceGroup = uiOrdering.addNewGroup( "Surfaces" ); + surfaceGroup->add( &m_annotationSurfaces ); + this->defineSeparateDataSourceUi( uiConfigName, uiOrdering ); uiOrdering.skipRemainingFields( true ); @@ -340,16 +444,16 @@ QList { QList options; - if ( fieldNeedingOptions == &wellPath ) + if ( fieldNeedingOptions == &m_wellPath ) { RimTools::wellPathOptionItems( &options ); - if ( options.size() > 0 ) + if ( !options.empty() ) { options.push_front( caf::PdmOptionItemInfo( "None", nullptr ) ); } } - else if ( fieldNeedingOptions == &simulationWell ) + else if ( fieldNeedingOptions == &m_simulationWell ) { RimSimWellInViewCollection* coll = simulationWellCollection(); if ( coll ) @@ -363,7 +467,7 @@ QList } } - if ( options.size() == 0 ) + if ( options.empty() ) { options.push_front( caf::PdmOptionItemInfo( "None", nullptr ) ); } @@ -381,6 +485,23 @@ QList options.push_back( caf::PdmOptionItemInfo( QString::number( bIdx + 1 ), QVariant::fromValue( bIdx ) ) ); } } + else if ( fieldNeedingOptions == &m_annotationSurfaces ) + { + RimSurfaceCollection* surfColl = RimProject::current()->activeOilField()->surfaceCollection(); + + caf::IconProvider surfaceIcon( ":/ReservoirSurface16x16.png" ); + for ( auto surf : surfColl->surfaces() ) + { + options.push_back( caf::PdmOptionItemInfo( surf->userDescription(), surf, false, surfaceIcon ) ); + } + for ( auto ensambleSurf : surfColl->ensembleSurfaces() ) + { + for ( auto surf : ensambleSurf->surfaces() ) + { + options.push_back( caf::PdmOptionItemInfo( surf->userDescription(), surf, false, surfaceIcon ) ); + } + } + } else { options = RimIntersection::calculateValueOptions( fieldNeedingOptions, useOptionsOnly ); @@ -438,11 +559,11 @@ std::vector> RimExtrudedCurveIntersection::polyLines( cv double horizontalProjectedLengthAlongWellPathToClipPoint = 0.0; - if ( type == CS_WELL_PATH ) + if ( type() == CrossSectionEnum::CS_WELL_PATH ) { - if ( wellPath() && wellPath->wellPathGeometry() ) + if ( m_wellPath() && wellPath()->wellPathGeometry() ) { - lines.push_back( wellPath->wellPathGeometry()->wellPathPoints() ); + lines.push_back( wellPath()->wellPathGeometry()->wellPathPoints() ); RimCase* ownerCase = nullptr; this->firstAncestorOrThisOfType( ownerCase ); if ( ownerCase ) @@ -455,9 +576,9 @@ std::vector> RimExtrudedCurveIntersection::polyLines( cv } } } - else if ( type == CS_SIMULATION_WELL ) + else if ( type() == CrossSectionEnum::CS_SIMULATION_WELL ) { - if ( simulationWell() ) + if ( m_simulationWell() ) { updateSimulationWellCenterline(); @@ -474,37 +595,35 @@ std::vector> RimExtrudedCurveIntersection::polyLines( cv } } } - else if ( type == CS_POLYLINE ) + else if ( type() == CrossSectionEnum::CS_POLYLINE ) { lines.push_back( m_userPolyline ); } - else if ( type == CS_AZIMUTHLINE ) + else if ( type() == CrossSectionEnum::CS_AZIMUTHLINE ) { lines.push_back( m_twoAzimuthPoints ); } - if ( type == CS_WELL_PATH || type == CS_SIMULATION_WELL ) + if ( type() == CrossSectionEnum::CS_WELL_PATH || type() == CrossSectionEnum::CS_SIMULATION_WELL ) { - if ( type == CS_SIMULATION_WELL && simulationWell() ) + if ( type() == CrossSectionEnum::CS_SIMULATION_WELL && m_simulationWell() ) { cvf::Vec3d top, bottom; - simulationWell->wellHeadTopBottomPosition( -1, &top, &bottom ); + m_simulationWell->wellHeadTopBottomPosition( -1, &top, &bottom ); - for ( size_t lIdx = 0; lIdx < lines.size(); ++lIdx ) + for ( std::vector& polyLine : lines ) { - std::vector& polyLine = lines[lIdx]; polyLine.insert( polyLine.begin(), top ); } } - for ( size_t lIdx = 0; lIdx < lines.size(); ++lIdx ) + for ( std::vector& polyLine : lines ) { - std::vector& polyLine = lines[lIdx]; addExtents( polyLine ); } - if ( flattenedPolylineStartPoint && lines.size() && lines[0].size() > 1 ) + if ( flattenedPolylineStartPoint && !lines.empty() && lines[0].size() > 1 ) { ( *flattenedPolylineStartPoint )[0] = horizontalProjectedLengthAlongWellPathToClipPoint - m_extentLength; ( *flattenedPolylineStartPoint )[2] = lines[0][1].z(); // Depth of first point in first polyline @@ -512,7 +631,7 @@ std::vector> RimExtrudedCurveIntersection::polyLines( cv } else { - if ( flattenedPolylineStartPoint && lines.size() && lines[0].size() ) + if ( flattenedPolylineStartPoint && !lines.empty() && !( lines[0] ).empty() ) { ( *flattenedPolylineStartPoint )[2] = lines[0][0].z(); // Depth of first point in first polyline } @@ -551,11 +670,11 @@ std::vector RimExtrudedCurveIntersection::polyLinesForExtrusionDirec //-------------------------------------------------------------------------------------------------- void RimExtrudedCurveIntersection::updateSimulationWellCenterline() const { - if ( m_isActive() && type == CS_SIMULATION_WELL && simulationWell() ) + if ( m_isActive() && type() == CrossSectionEnum::CS_SIMULATION_WELL && m_simulationWell() ) { if ( m_simulationWellBranchCenterlines.empty() ) { - auto branches = simulationWell->wellPipeBranches(); + auto branches = m_simulationWell->wellPipeBranches(); for ( const auto& branch : branches ) { m_simulationWellBranchCenterlines.push_back( branch->wellPathPoints() ); @@ -629,17 +748,17 @@ void RimExtrudedCurveIntersection::addExtents( std::vector& polyLine //-------------------------------------------------------------------------------------------------- void RimExtrudedCurveIntersection::updateName() { - if ( type == CS_SIMULATION_WELL && simulationWell() ) + if ( type() == CrossSectionEnum::CS_SIMULATION_WELL && m_simulationWell() ) { - m_name = simulationWell()->name(); + m_name = m_simulationWell()->name(); if ( branchIndex() != -1 ) { m_name = m_name() + " Branch " + QString::number( branchIndex() + 1 ); } } - else if ( type() == CS_WELL_PATH && wellPath() ) + else if ( m_type() == CrossSectionEnum::CS_WELL_PATH && m_wellPath() ) { - m_name = wellPath()->name(); + m_name = m_wellPath()->name(); } Rim2dIntersectionView* iView = correspondingIntersectionView(); @@ -708,8 +827,7 @@ void RimExtrudedCurveIntersection::defineEditorAttribute( const caf::PdmFieldHan QString uiConfigName, caf::PdmUiEditorAttribute* attribute ) { - caf::PdmUiDoubleSliderEditorAttribute* doubleSliderAttrib = - dynamic_cast( attribute ); + auto* doubleSliderAttrib = dynamic_cast( attribute ); if ( doubleSliderAttrib ) { if ( field == &m_azimuthAngle ) @@ -725,31 +843,32 @@ void RimExtrudedCurveIntersection::defineEditorAttribute( const caf::PdmFieldHan doubleSliderAttrib->m_sliderTickCount = 180; } } - else if ( field == &inputPolyLineFromViewerEnabled ) + else if ( field == &m_inputPolylineFromViewerEnabled ) { - setPushButtonText( inputPolyLineFromViewerEnabled, dynamic_cast( attribute ) ); + setPushButtonText( m_inputPolylineFromViewerEnabled, + dynamic_cast( attribute ) ); } else if ( field == &m_userPolyline ) { - setBaseColor( inputPolyLineFromViewerEnabled, dynamic_cast( attribute ) ); + setBaseColor( m_inputPolylineFromViewerEnabled, dynamic_cast( attribute ) ); } - else if ( field == &inputTwoAzimuthPointsFromViewerEnabled ) + else if ( field == &m_inputTwoAzimuthPointsFromViewerEnabled ) { - setPushButtonText( inputTwoAzimuthPointsFromViewerEnabled, + setPushButtonText( m_inputTwoAzimuthPointsFromViewerEnabled, dynamic_cast( attribute ) ); } else if ( field == &m_twoAzimuthPoints ) { - setBaseColor( inputTwoAzimuthPointsFromViewerEnabled, dynamic_cast( attribute ) ); + setBaseColor( m_inputTwoAzimuthPointsFromViewerEnabled, dynamic_cast( attribute ) ); } - else if ( field == &inputExtrusionPointsFromViewerEnabled ) + else if ( field == &m_inputExtrusionPointsFromViewerEnabled ) { - setPushButtonText( inputExtrusionPointsFromViewerEnabled, + setPushButtonText( m_inputExtrusionPointsFromViewerEnabled, dynamic_cast( attribute ) ); } else if ( field == &m_customExtrusionPoints ) { - setBaseColor( inputExtrusionPointsFromViewerEnabled, dynamic_cast( attribute ) ); + setBaseColor( m_inputExtrusionPointsFromViewerEnabled, dynamic_cast( attribute ) ); } } @@ -768,7 +887,7 @@ void RimExtrudedCurveIntersection::appendPointToPolyLine( const cvf::Vec3d& poin //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -Rim2dIntersectionView* RimExtrudedCurveIntersection::correspondingIntersectionView() +Rim2dIntersectionView* RimExtrudedCurveIntersection::correspondingIntersectionView() const { std::vector objects; this->objectsWithReferringPtrFieldsOfType( objects ); @@ -831,10 +950,10 @@ cvf::Vec3d RimExtrudedCurveIntersection::extrusionDirection() const { cvf::Vec3d dir = cvf::Vec3d::Z_AXIS; - if ( direction() == RimExtrudedCurveIntersection::CS_HORIZONTAL ) + if ( m_direction() == RimExtrudedCurveIntersection::CrossSectionDirEnum::CS_HORIZONTAL ) { std::vector> lines = this->polyLines(); - if ( lines.size() > 0 && lines[0].size() > 1 ) + if ( !lines.empty() && lines[0].size() > 1 ) { std::vector firstLine = lines[0]; @@ -846,7 +965,8 @@ cvf::Vec3d RimExtrudedCurveIntersection::extrusionDirection() const dir = polyLineDir ^ up; } } - else if ( direction() == RimExtrudedCurveIntersection::CS_TWO_POINTS && m_customExtrusionPoints().size() > 1 ) + else if ( m_direction() == RimExtrudedCurveIntersection::CrossSectionDirEnum::CS_TWO_POINTS && + m_customExtrusionPoints().size() > 1 ) { dir = m_customExtrusionPoints()[m_customExtrusionPoints().size() - 1] - m_customExtrusionPoints()[0]; } @@ -902,7 +1022,7 @@ double RimExtrudedCurveIntersection::extentLength() //-------------------------------------------------------------------------------------------------- void RimExtrudedCurveIntersection::recomputeSimulationWellBranchData() { - if ( type() == CS_SIMULATION_WELL ) + if ( m_type() == CrossSectionEnum::CS_SIMULATION_WELL ) { m_simulationWellBranchCenterlines.clear(); updateSimulationWellCenterline(); @@ -916,7 +1036,15 @@ void RimExtrudedCurveIntersection::recomputeSimulationWellBranchData() //-------------------------------------------------------------------------------------------------- bool RimExtrudedCurveIntersection::hasDefiningPoints() const { - return type == CS_POLYLINE || type == CS_AZIMUTHLINE; + return m_type() == CrossSectionEnum::CS_POLYLINE || m_type() == CrossSectionEnum::CS_AZIMUTHLINE; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +std::vector RimExtrudedCurveIntersection::annotatedSurfaces() const +{ + return m_annotationSurfaces.ptrReferencedObjects(); } //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationLibCode/ProjectDataModel/RimExtrudedCurveIntersection.h b/ApplicationLibCode/ProjectDataModel/RimExtrudedCurveIntersection.h index 24f637794c..e981d9b743 100644 --- a/ApplicationLibCode/ProjectDataModel/RimExtrudedCurveIntersection.h +++ b/ApplicationLibCode/ProjectDataModel/RimExtrudedCurveIntersection.h @@ -19,15 +19,9 @@ #pragma once -#include "cafAppEnum.h" -#include "cafPdmField.h" -#include "cafPdmFieldCvfVec3d.h" -#include "cafPdmObject.h" -#include "cafPdmPtrField.h" - #include "RimIntersection.h" -#include "cvfObject.h" -#include "cvfVector3.h" + +#include "cafPdmPtrArrayField.h" class RimWellPath; class RivExtrudedCurveIntersectionPartMgr; @@ -35,6 +29,7 @@ class RimIntersectionResultDefinition; class RimSimWellInView; class RimSimWellInViewCollection; class Rim2dIntersectionView; +class RimSurface; namespace caf { @@ -52,7 +47,7 @@ class RimExtrudedCurveIntersection : public RimIntersection CAF_PDM_HEADER_INIT; public: - enum CrossSectionEnum + enum class CrossSectionEnum { CS_WELL_PATH, CS_SIMULATION_WELL, @@ -60,7 +55,7 @@ class RimExtrudedCurveIntersection : public RimIntersection CS_AZIMUTHLINE }; - enum CrossSectionDirEnum + enum class CrossSectionDirEnum { CS_VERTICAL, CS_HORIZONTAL, @@ -71,23 +66,27 @@ class RimExtrudedCurveIntersection : public RimIntersection RimExtrudedCurveIntersection(); ~RimExtrudedCurveIntersection() override; - caf::PdmField> type; - caf::PdmField> direction; + QString name() const override; + void setName( const QString& newName ); - caf::PdmPtrField wellPath; - caf::PdmPtrField simulationWell; + RimExtrudedCurveIntersection::CrossSectionEnum type() const; + RimExtrudedCurveIntersection::CrossSectionDirEnum direction() const; - caf::PdmField inputPolyLineFromViewerEnabled; - caf::PdmField inputExtrusionPointsFromViewerEnabled; - caf::PdmField inputTwoAzimuthPointsFromViewerEnabled; + RimWellPath* wellPath() const; + RimSimWellInView* simulationWell() const; + bool inputPolyLineFromViewerEnabled() const; + bool inputExtrusionPointsFromViewerEnabled() const; + bool inputTwoAzimuthPointsFromViewerEnabled() const; - QString name() const override; - void setName( const QString& newName ); + void configureForSimulationWell( RimSimWellInView* simWell ); + void configureForWellPath( RimWellPath* wellPath ); + void configureForPolyLine(); + void configureForAzimuthLine(); std::vector> polyLines( cvf::Vec3d* flattenedPolylineStartPoint = nullptr ) const; void appendPointToPolyLine( const cvf::Vec3d& point ); - Rim2dIntersectionView* correspondingIntersectionView(); + Rim2dIntersectionView* correspondingIntersectionView() const; RivExtrudedCurveIntersectionPartMgr* intersectionPartMgr(); void rebuildGeometry(); const RivIntersectionGeometryGeneratorIF* intersectionGeometryGenerator() const override; @@ -106,6 +105,8 @@ class RimExtrudedCurveIntersection : public RimIntersection void recomputeSimulationWellBranchData(); bool hasDefiningPoints() const; + std::vector annotatedSurfaces() const; + int branchIndex() const; void rebuildGeometryAndScheduleCreateDisplayModel(); @@ -119,9 +120,30 @@ class RimExtrudedCurveIntersection : public RimIntersection QList calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions, bool* useOptionsOnly ) override; +private: + static void setPushButtonText( bool buttonEnable, caf::PdmUiPushButtonEditorAttribute* attribute ); + static void setBaseColor( bool enable, caf::PdmUiListEditorAttribute* attribute ); + + RimSimWellInViewCollection* simulationWellCollection() const; + void updateAzimuthLine(); + void updateSimulationWellCenterline() const; + void addExtents( std::vector& polyLine ) const; + void updateName(); + static double azimuthInRadians( cvf::Vec3d vec ); + private: caf::PdmField m_name; + caf::PdmField> m_type; + caf::PdmField> m_direction; + + caf::PdmPtrField m_wellPath; + caf::PdmPtrField m_simulationWell; + + caf::PdmField m_inputPolylineFromViewerEnabled; + caf::PdmField m_inputExtrusionPointsFromViewerEnabled; + caf::PdmField m_inputTwoAzimuthPointsFromViewerEnabled; + caf::PdmField m_branchIndex; caf::PdmField m_extentLength; caf::PdmField m_azimuthAngle; @@ -133,17 +155,9 @@ class RimExtrudedCurveIntersection : public RimIntersection caf::PdmField> m_customExtrusionPoints; caf::PdmField> m_twoAzimuthPoints; - static void setPushButtonText( bool buttonEnable, caf::PdmUiPushButtonEditorAttribute* attribute ); - static void setBaseColor( bool enable, caf::PdmUiListEditorAttribute* attribute ); + // Surface intersection annotations + caf::PdmPtrArrayField m_annotationSurfaces; - RimSimWellInViewCollection* simulationWellCollection() const; - void updateAzimuthLine(); - void updateSimulationWellCenterline() const; - void addExtents( std::vector& polyLine ) const; - void updateName(); - static double azimuthInRadians( cvf::Vec3d vec ); - -private: cvf::ref m_crossSectionPartMgr; mutable std::vector> m_simulationWellBranchCenterlines; diff --git a/ApplicationLibCode/ProjectDataModel/RimIntersection.cpp b/ApplicationLibCode/ProjectDataModel/RimIntersection.cpp index dad04dd5d9..8ea36b2f01 100644 --- a/ApplicationLibCode/ProjectDataModel/RimIntersection.cpp +++ b/ApplicationLibCode/ProjectDataModel/RimIntersection.cpp @@ -170,7 +170,7 @@ void RimIntersection::updateDefaultSeparateDataSource() { std::vector iResDefs = defcoll->intersectionResultsDefinitions(); - if ( iResDefs.size() ) + if ( !iResDefs.empty() ) { m_separateDataSource = iResDefs[0]; } @@ -188,7 +188,7 @@ cvf::ref RimIntersection::createHexGridInterfac { // Eclipse case - RimEclipseCase* eclipseCase = dynamic_cast( resDef->activeCase() ); + auto* eclipseCase = dynamic_cast( resDef->activeCase() ); if ( eclipseCase && eclipseCase->eclipseCaseData() ) { return new RivEclipseIntersectionGrid( eclipseCase->eclipseCaseData()->mainGrid(), @@ -199,7 +199,7 @@ cvf::ref RimIntersection::createHexGridInterfac // Geomech case - RimGeoMechCase* geomCase = dynamic_cast( resDef->activeCase() ); + auto* geomCase = dynamic_cast( resDef->activeCase() ); if ( geomCase && geomCase->geoMechData() && geomCase->geoMechData()->femParts() ) { diff --git a/ApplicationLibCode/ProjectDataModel/RimIntersectionCollection.cpp b/ApplicationLibCode/ProjectDataModel/RimIntersectionCollection.cpp index 837fe6e5f3..6188eeab79 100644 --- a/ApplicationLibCode/ProjectDataModel/RimIntersectionCollection.cpp +++ b/ApplicationLibCode/ProjectDataModel/RimIntersectionCollection.cpp @@ -364,7 +364,7 @@ bool RimIntersectionCollection::hasActiveIntersectionForSimulationWell( const Ri for ( RimExtrudedCurveIntersection* cs : m_intersections ) { - if ( cs->isActive() && cs->type() == RimExtrudedCurveIntersection::CS_SIMULATION_WELL && + if ( cs->isActive() && cs->type() == RimExtrudedCurveIntersection::CrossSectionEnum::CS_SIMULATION_WELL && cs->simulationWell() == simWell ) { return true; diff --git a/ApplicationLibCode/ReservoirDataModel/RigSurface.cpp b/ApplicationLibCode/ReservoirDataModel/RigSurface.cpp index a9208aafce..790765ccd9 100644 --- a/ApplicationLibCode/ReservoirDataModel/RigSurface.cpp +++ b/ApplicationLibCode/ReservoirDataModel/RigSurface.cpp @@ -15,21 +15,22 @@ // for more details. // ///////////////////////////////////////////////////////////////////////////////// + #include "RigSurface.h" +#include "cafAssert.h" +#include "cvfBoundingBox.h" +#include "cvfBoundingBoxTree.h" + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -RigSurface::RigSurface() -{ -} +RigSurface::RigSurface() = default; //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -RigSurface::~RigSurface() -{ -} +RigSurface::~RigSurface() = default; //-------------------------------------------------------------------------------------------------- /// @@ -92,3 +93,50 @@ std::vector RigSurface::propertyNames() const return names; } + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RigSurface::findIntersectingTriangles( const cvf::BoundingBox& inputBB, std::vector* triangleStartIndices ) const +{ + CAF_ASSERT( m_surfaceBoundingBoxTree.notNull() ); + + m_surfaceBoundingBoxTree->findIntersections( inputBB, triangleStartIndices ); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RigSurface::ensureIntersectionSearchTreeIsBuilt() +{ + if ( m_surfaceBoundingBoxTree.isNull() ) + { + size_t itemCount = triangleCount(); + + std::vector cellBoundingBoxes; + std::vector boundingBoxIds; + cellBoundingBoxes.resize( itemCount ); + boundingBoxIds.resize( itemCount ); + + for ( size_t triangleIdx = 0; triangleIdx < itemCount; ++triangleIdx ) + { + cvf::BoundingBox& cellBB = cellBoundingBoxes[triangleIdx]; + cellBB.add( m_vertices[m_triangleIndices[triangleIdx * 3 + 0]] ); + cellBB.add( m_vertices[m_triangleIndices[triangleIdx * 3 + 1]] ); + cellBB.add( m_vertices[m_triangleIndices[triangleIdx * 3 + 2]] ); + + boundingBoxIds[triangleIdx] = triangleIdx * 3; + } + + m_surfaceBoundingBoxTree = new cvf::BoundingBoxTree; + m_surfaceBoundingBoxTree->buildTreeFromBoundingBoxes( cellBoundingBoxes, &boundingBoxIds ); + } +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +size_t RigSurface::triangleCount() const +{ + return m_triangleIndices.size() / 3; +} diff --git a/ApplicationLibCode/ReservoirDataModel/RigSurface.h b/ApplicationLibCode/ReservoirDataModel/RigSurface.h index c41963c717..e9d0b0d44b 100644 --- a/ApplicationLibCode/ReservoirDataModel/RigSurface.h +++ b/ApplicationLibCode/ReservoirDataModel/RigSurface.h @@ -25,6 +25,12 @@ #include #include +namespace cvf +{ +class BoundingBox; +class BoundingBoxTree; +} // namespace cvf + class RigSurface : public cvf::Object { public: @@ -40,8 +46,16 @@ class RigSurface : public cvf::Object std::vector propertyValues( const QString& propertyName ) const; std::vector propertyNames() const; + void ensureIntersectionSearchTreeIsBuilt(); + void findIntersectingTriangles( const cvf::BoundingBox& inputBB, std::vector* triangleStartIndices ) const; + +private: + size_t triangleCount() const; + private: std::vector m_triangleIndices; std::vector m_vertices; std::map> m_verticeResults; + + cvf::ref m_surfaceBoundingBoxTree; }; diff --git a/ApplicationLibCode/ReservoirDataModel/RigSurfaceResampler.cpp b/ApplicationLibCode/ReservoirDataModel/RigSurfaceResampler.cpp index 377f98e6d9..7f3e3c79ac 100644 --- a/ApplicationLibCode/ReservoirDataModel/RigSurfaceResampler.cpp +++ b/ApplicationLibCode/ReservoirDataModel/RigSurfaceResampler.cpp @@ -15,11 +15,14 @@ // for more details. // ///////////////////////////////////////////////////////////////////////////////// + #include "RigSurfaceResampler.h" #include "cvfGeometryTools.h" +#include "cvfBoundingBox.h" #include "cvfObject.h" + #include //-------------------------------------------------------------------------------------------------- @@ -40,8 +43,7 @@ cvf::ref RigSurfaceResampler::resampleSurface( cvf::ref cvf::Vec3d pointBelow = cvf::Vec3d( targetVert.x(), targetVert.y(), -10000.0 ); cvf::Vec3d intersectionPoint; - bool foundMatch = - resamplePoint( pointAbove, pointBelow, surface->triangleIndices(), surface->vertices(), intersectionPoint ); + bool foundMatch = resamplePoint( surface.p(), pointAbove, pointBelow, intersectionPoint ); if ( !foundMatch ) intersectionPoint = cvf::Vec3d( targetVert.x(), targetVert.y(), std::numeric_limits::infinity() ); @@ -56,23 +58,37 @@ cvf::ref RigSurfaceResampler::resampleSurface( cvf::ref //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -bool RigSurfaceResampler::resamplePoint( const cvf::Vec3d& pointAbove, - const cvf::Vec3d& pointBelow, - const std::vector& indices, - const std::vector& vertices, - cvf::Vec3d& intersectionPoint ) +bool RigSurfaceResampler::resamplePoint( RigSurface* surface, + const cvf::Vec3d& pointAbove, + const cvf::Vec3d& pointBelow, + cvf::Vec3d& intersectionPoint ) { - for ( size_t i = 0; i < indices.size(); i += 3 ) + surface->ensureIntersectionSearchTreeIsBuilt(); + + cvf::BoundingBox bb; + bb.add( pointAbove ); + bb.add( pointBelow ); + + std::vector triangleStartIndices; + surface->findIntersectingTriangles( bb, &triangleStartIndices ); + + const std::vector& indices = surface->triangleIndices(); + const std::vector& vertices = surface->vertices(); + + if ( !triangleStartIndices.empty() ) { - bool isLineDirDotNormalNegative = false; - if ( cvf::GeometryTools::intersectLineSegmentTriangle( pointAbove, - pointBelow, - vertices[indices[i]], - vertices[indices[i + 1]], - vertices[indices[i + 2]], - &intersectionPoint, - &isLineDirDotNormalNegative ) == 1 ) - return true; + for ( auto triangleStartIndex : triangleStartIndices ) + { + bool isLineDirDotNormalNegative = false; + if ( cvf::GeometryTools::intersectLineSegmentTriangle( pointAbove, + pointBelow, + vertices[indices[triangleStartIndex + 0]], + vertices[indices[triangleStartIndex + 1]], + vertices[indices[triangleStartIndex + 2]], + &intersectionPoint, + &isLineDirDotNormalNegative ) == 1 ) + return true; + } } // Handle cases where no match is found due to floating point imprecision, diff --git a/ApplicationLibCode/ReservoirDataModel/RigSurfaceResampler.h b/ApplicationLibCode/ReservoirDataModel/RigSurfaceResampler.h index 19b8df641f..afe5391229 100644 --- a/ApplicationLibCode/ReservoirDataModel/RigSurfaceResampler.h +++ b/ApplicationLibCode/ReservoirDataModel/RigSurfaceResampler.h @@ -29,11 +29,10 @@ class RigSurfaceResampler public: static cvf::ref resampleSurface( cvf::ref targetSurface, cvf::ref surface ); - static bool resamplePoint( const cvf::Vec3d& pointAbove, - const cvf::Vec3d& pointBelow, - const std::vector& indices, - const std::vector& vertices, - cvf::Vec3d& intersectionPoint ); + static bool resamplePoint( RigSurface* surface, + const cvf::Vec3d& pointAbove, + const cvf::Vec3d& pointBelow, + cvf::Vec3d& intersectionPoint ); private: static bool findClosestPointXY( const cvf::Vec3d& targetPoint, diff --git a/ApplicationLibCode/UserInterface/RiuPvtPlotUpdater.cpp b/ApplicationLibCode/UserInterface/RiuPvtPlotUpdater.cpp index 1557b86399..d9e459e484 100644 --- a/ApplicationLibCode/UserInterface/RiuPvtPlotUpdater.cpp +++ b/ApplicationLibCode/UserInterface/RiuPvtPlotUpdater.cpp @@ -17,25 +17,18 @@ ///////////////////////////////////////////////////////////////////////////////// #include "RiuPvtPlotUpdater.h" -#include "Riu3dSelectionManager.h" -#include "RiuPvtPlotPanel.h" -#include "RiuRelativePermeabilityPlotUpdater.h" -#include "RigActiveCellInfo.h" -#include "RigCaseCellResultsData.h" #include "RigEclipseCaseData.h" -#include "RigGridBase.h" #include "RigResultAccessor.h" #include "RigResultAccessorFactory.h" -#include "Rim2dIntersectionView.h" #include "Rim3dView.h" -#include "RimEclipseCellColors.h" #include "RimEclipseResultCase.h" -#include "RimEclipseView.h" -#include "RimExtrudedCurveIntersection.h" +#include "RimEclipseResultDefinition.h" -//#include "cvfTrace.h" +#include "Riu3dSelectionManager.h" +#include "RiuPvtPlotPanel.h" +#include "RiuRelativePermeabilityPlotUpdater.h" #include diff --git a/Fwk/AppFwk/cafVizExtensions/cafOverlayScaleLegend.cpp b/Fwk/AppFwk/cafVizExtensions/cafOverlayScaleLegend.cpp index ad75624d39..0aa86b39c6 100644 --- a/Fwk/AppFwk/cafVizExtensions/cafOverlayScaleLegend.cpp +++ b/Fwk/AppFwk/cafVizExtensions/cafOverlayScaleLegend.cpp @@ -731,6 +731,9 @@ void OverlayScaleLegend::updateFromCamera( const Camera* camera ) windowMaxInDomain = m_dispalyCoordsTransform->transformToDomainCoord( windowMaxInDomain ); } + // For extreme zoom factors we might end up with both variables as zero. Return to avoid divide by zero. + if ( windowMaxInDomain == windowOrigoInDomain ) return; + Vec3d windowOrigoPoint; Vec3d windowMaxPoint; camera->project( windowOrigoInDomain, &windowOrigoPoint ); From 795d9eecca9028ffa044407dce4f8b126fc536b0 Mon Sep 17 00:00:00 2001 From: Kristian Bendiksen Date: Thu, 26 Aug 2021 08:54:29 +0200 Subject: [PATCH 078/308] #7899 Python: generate properties for 'name' and 'is_checked' for NamedObject --- .../ProjectDataModel/RimCheckableNamedObject.cpp | 7 +++++-- ApplicationLibCode/ProjectDataModel/RimNamedObject.cpp | 6 +++++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/ApplicationLibCode/ProjectDataModel/RimCheckableNamedObject.cpp b/ApplicationLibCode/ProjectDataModel/RimCheckableNamedObject.cpp index b3be03f8e2..f1afe25100 100644 --- a/ApplicationLibCode/ProjectDataModel/RimCheckableNamedObject.cpp +++ b/ApplicationLibCode/ProjectDataModel/RimCheckableNamedObject.cpp @@ -18,6 +18,9 @@ #include "RimCheckableNamedObject.h" +#include "cafPdmFieldScriptingCapability.h" +#include "cafPdmObjectScriptingCapability.h" + CAF_PDM_XML_ABSTRACT_SOURCE_INIT( RimCheckableNamedObject, "CheckableNamedObject" ); // Do not use. Abstract class //-------------------------------------------------------------------------------------------------- @@ -25,8 +28,8 @@ CAF_PDM_XML_ABSTRACT_SOURCE_INIT( RimCheckableNamedObject, "CheckableNamedObject //-------------------------------------------------------------------------------------------------- RimCheckableNamedObject::RimCheckableNamedObject( void ) { - CAF_PDM_InitObject( "Checkable object", "", "", "" ); - CAF_PDM_InitField( &m_isChecked, "IsChecked", true, "Active", "", "", "" ); + CAF_PDM_InitScriptableObject( "Checkable object", "", "", "" ); + CAF_PDM_InitScriptableField( &m_isChecked, "IsChecked", true, "Active", "", "", "" ); m_isChecked.uiCapability()->setUiHidden( true ); } diff --git a/ApplicationLibCode/ProjectDataModel/RimNamedObject.cpp b/ApplicationLibCode/ProjectDataModel/RimNamedObject.cpp index fee2318cdf..e3d06db636 100644 --- a/ApplicationLibCode/ProjectDataModel/RimNamedObject.cpp +++ b/ApplicationLibCode/ProjectDataModel/RimNamedObject.cpp @@ -18,6 +18,9 @@ #include "RimNamedObject.h" +#include "cafPdmFieldScriptingCapability.h" +#include "cafPdmObjectScriptingCapability.h" + CAF_PDM_XML_ABSTRACT_SOURCE_INIT( RimNamedObject, "NamedObject" ); // Do not use. Abstract class //-------------------------------------------------------------------------------------------------- @@ -25,7 +28,8 @@ CAF_PDM_XML_ABSTRACT_SOURCE_INIT( RimNamedObject, "NamedObject" ); // Do not use //-------------------------------------------------------------------------------------------------- RimNamedObject::RimNamedObject( void ) { - CAF_PDM_InitField( &m_name, "Name", QString(), "Name", "", "", "" ); + CAF_PDM_InitScriptableObject( "Named object", "", "", "" ); + CAF_PDM_InitScriptableField( &m_name, "Name", QString(), "Name", "", "", "" ); } //-------------------------------------------------------------------------------------------------- From 49fa169db80e5c3d06b9aee4613a27be2beded93 Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Thu, 26 Aug 2021 15:12:27 +0200 Subject: [PATCH 079/308] ##7903: Improve ensemble surface names Update the name of statistics surface when created Regenerate surface geo only when required Create statistics surfaces when importing surface ensemble --- .../Application/Tools/CMakeLists_files.cmake | 2 + .../Tools/RiaEnsembleNameTools.cpp | 161 ++++++++++++++++++ .../Application/Tools/RiaEnsembleNameTools.h | 35 ++++ .../Application/Tools/RiaSummaryTools.cpp | 53 ------ .../Application/Tools/RiaSummaryTools.h | 2 - .../Commands/RicImportEnsembleFeature.cpp | 3 +- .../RicImportEnsembleSurfaceFeature.cpp | 25 ++- .../ProjectDataModel/RimEclipseView.cpp | 1 - .../Summary/RimSummaryCase.cpp | 38 +---- .../Surfaces/RimEnsembleStatisticsSurface.cpp | 2 + .../Surfaces/RimEnsembleSurfaceInView.cpp | 2 +- 11 files changed, 226 insertions(+), 98 deletions(-) create mode 100644 ApplicationLibCode/Application/Tools/RiaEnsembleNameTools.cpp create mode 100644 ApplicationLibCode/Application/Tools/RiaEnsembleNameTools.h diff --git a/ApplicationLibCode/Application/Tools/CMakeLists_files.cmake b/ApplicationLibCode/Application/Tools/CMakeLists_files.cmake index 3da3bd9b09..a97a7fae3d 100644 --- a/ApplicationLibCode/Application/Tools/CMakeLists_files.cmake +++ b/ApplicationLibCode/Application/Tools/CMakeLists_files.cmake @@ -46,6 +46,7 @@ ${CMAKE_CURRENT_LIST_DIR}/RiaWellLogUnitTools.h ${CMAKE_CURRENT_LIST_DIR}/RiaWellLogUnitTools.inl ${CMAKE_CURRENT_LIST_DIR}/RiaTimeTTools.h ${CMAKE_CURRENT_LIST_DIR}/RiaValidRegExpValidator.h +${CMAKE_CURRENT_LIST_DIR}/RiaEnsembleNameTools.h ) set (SOURCE_GROUP_SOURCE_FILES @@ -88,6 +89,7 @@ ${CMAKE_CURRENT_LIST_DIR}/RiaFieldHandleTools.cpp ${CMAKE_CURRENT_LIST_DIR}/RiaBoundingBoxTools.cpp ${CMAKE_CURRENT_LIST_DIR}/RiaTimeTTools.cpp ${CMAKE_CURRENT_LIST_DIR}/RiaValidRegExpValidator.cpp +${CMAKE_CURRENT_LIST_DIR}/RiaEnsembleNameTools.cpp ) list(APPEND CODE_HEADER_FILES diff --git a/ApplicationLibCode/Application/Tools/RiaEnsembleNameTools.cpp b/ApplicationLibCode/Application/Tools/RiaEnsembleNameTools.cpp new file mode 100644 index 0000000000..b8b8fa1390 --- /dev/null +++ b/ApplicationLibCode/Application/Tools/RiaEnsembleNameTools.cpp @@ -0,0 +1,161 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2021 Equinor ASA +// +// ResInsight is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// + +#include "RiaEnsembleNameTools.h" + +#include "RiaFilePathTools.h" + +#include "RimCaseDisplayNameTools.h" +#include +#include + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +QString RiaEnsembleNameTools::findSuitableEnsembleName( const QStringList& fileNames ) +{ + std::vector componentsForAllFilePaths; + + for ( const auto& filePath : fileNames ) + { + QStringList components = RiaFilePathTools::splitPathIntoComponents( filePath ); + componentsForAllFilePaths.push_back( components ); + } + + // Find list of all folders inside a folder matching realization-* + QRegularExpression realizationRe( "realization\\-\\d+" ); + + QStringList iterations; + for ( const auto& fileComponents : componentsForAllFilePaths ) + { + QString lastComponent = ""; + for ( auto it = fileComponents.rbegin(); it != fileComponents.rend(); ++it ) + { + if ( realizationRe.match( *it ).hasMatch() ) + { + iterations.push_back( lastComponent ); + } + lastComponent = *it; + } + } + + iterations.removeDuplicates(); + + if ( iterations.size() == 1u ) + { + return iterations.front(); + } + + if ( !iterations.empty() ) + { + return QString( "Multiple iterations: %1" ).arg( iterations.join( ", " ) ); + } + + QString root = RiaFilePathTools::commonRootOfFileNames( fileNames ); + + QRegularExpression trimRe( "[^a-zA-Z0-9]+$" ); + QString trimmedRoot = root.replace( trimRe, "" ); + if ( trimmedRoot.length() >= 4 ) + { + return trimmedRoot; + } + + return "Ensemble"; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +QString RiaEnsembleNameTools::findCommonBaseName( const QStringList& fileNames ) +{ + QStringList baseNames; + for ( const auto& f : fileNames ) + { + QFileInfo fi( f ); + baseNames.push_back( fi.baseName() ); + } + + if ( baseNames.isEmpty() ) return "Empty"; + + auto firstName = baseNames.front(); + for ( int i = 0; i < firstName.size(); i++ ) + { + auto candidate = firstName.left( firstName.size() - i ); + bool identicalNames = true; + + for ( const auto& baseName : baseNames ) + { + auto str = baseName.left( firstName.size() - i ); + if ( candidate != str ) identicalNames = false; + } + + if ( identicalNames ) + { + return candidate; + } + } + + return "Mixed Items"; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +QString RiaEnsembleNameTools::uniqueShortName( const QString& sourceFileName, + const QStringList& allFileNames, + const QString& ensembleCaseName ) +{ + QRegularExpression trimRe( "^[^a-zA-Z0-9]+" ); + + std::map keyFileComponentsForAllFiles = + RiaFilePathTools::keyPathComponentsForEachFilePath( allFileNames ); + + QStringList keyFileComponents = keyFileComponentsForAllFiles[sourceFileName]; + if ( keyFileComponents.empty() ) return "Unnamed"; + + if ( !ensembleCaseName.isEmpty() ) + { + for ( auto& component : keyFileComponents ) + { + component = component.replace( ensembleCaseName, "" ); + component = component.replace( trimRe, "" ); + } + } + + QStringList shortNameComponents; + QRegularExpression numberRe( "[0-9]+" ); + for ( auto keyComponent : keyFileComponents ) + { + QStringList subComponents; + QString numberGroup = numberRe.match( keyComponent ).captured(); + if ( !numberGroup.isEmpty() ) + { + keyComponent = keyComponent.replace( numberGroup, "" ); + QString stem = keyComponent.left( RimCaseDisplayNameTools::CASE_SHORT_NAME_LENGTH ); + if ( !stem.isEmpty() ) subComponents.push_back( stem ); + subComponents.push_back( numberGroup ); + } + else + { + subComponents.push_back( keyComponent.left( RimCaseDisplayNameTools::CASE_SHORT_NAME_LENGTH ) ); + } + + shortNameComponents.push_back( subComponents.join( "-" ) ); + } + return shortNameComponents.join( "," ); +} diff --git a/ApplicationLibCode/Application/Tools/RiaEnsembleNameTools.h b/ApplicationLibCode/Application/Tools/RiaEnsembleNameTools.h new file mode 100644 index 0000000000..93b288a517 --- /dev/null +++ b/ApplicationLibCode/Application/Tools/RiaEnsembleNameTools.h @@ -0,0 +1,35 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2021 Equinor ASA +// +// ResInsight is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// + +#pragma once + +#include + +//================================================================================================== +// +//================================================================================================== +class RiaEnsembleNameTools +{ +public: + static QString findSuitableEnsembleName( const QStringList& fileNames ); + static QString findCommonBaseName( const QStringList& fileNames ); + + static QString uniqueShortName( const QString& sourceFileName, + const QStringList& allFileNames, + const QString& ensembleCaseName = QString() ); +}; diff --git a/ApplicationLibCode/Application/Tools/RiaSummaryTools.cpp b/ApplicationLibCode/Application/Tools/RiaSummaryTools.cpp index 236e1bb0f9..f5a6c83acb 100644 --- a/ApplicationLibCode/Application/Tools/RiaSummaryTools.cpp +++ b/ApplicationLibCode/Application/Tools/RiaSummaryTools.cpp @@ -215,59 +215,6 @@ void RiaSummaryTools::getSummaryCasesAndAddressesForCalculation( int } } -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -QString RiaSummaryTools::findSuitableEnsembleName( const QStringList& summaryCaseFileNames ) -{ - std::vector componentsForAllFilePaths; - - for ( auto filePath : summaryCaseFileNames ) - { - QStringList components = RiaFilePathTools::splitPathIntoComponents( filePath ); - componentsForAllFilePaths.push_back( components ); - } - - // Find list of all folders inside a folder matching realization-* - QRegularExpression realizationRe( "realization\\-\\d+" ); - - QStringList iterations; - for ( const auto& fileComponents : componentsForAllFilePaths ) - { - QString lastComponent = ""; - for ( auto it = fileComponents.rbegin(); it != fileComponents.rend(); ++it ) - { - if ( realizationRe.match( *it ).hasMatch() ) - { - iterations.push_back( lastComponent ); - } - lastComponent = *it; - } - } - - iterations.removeDuplicates(); - - if ( iterations.size() == 1u ) - { - return iterations.front(); - } - else if ( !iterations.empty() ) - { - return QString( "Multiple iterations: %1" ).arg( iterations.join( ", " ) ); - } - - QString root = RiaFilePathTools::commonRootOfFileNames( summaryCaseFileNames ); - - QRegularExpression trimRe( "[^a-zA-Z0-9]+$" ); - QString trimmedRoot = root.replace( trimRe, "" ); - if ( trimmedRoot.length() >= 4 ) - { - return trimmedRoot; - } - - return "Ensemble"; -} - //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationLibCode/Application/Tools/RiaSummaryTools.h b/ApplicationLibCode/Application/Tools/RiaSummaryTools.h index 19e9f3f65f..91072498b7 100644 --- a/ApplicationLibCode/Application/Tools/RiaSummaryTools.h +++ b/ApplicationLibCode/Application/Tools/RiaSummaryTools.h @@ -64,8 +64,6 @@ class RiaSummaryTools std::vector& cases, std::vector& addresses ); - static QString findSuitableEnsembleName( const QStringList& summaryCaseFileNames ); - static std::pair, std::vector> resampledValuesForPeriod( const RifEclipseSummaryAddress& address, const std::vector& timeSteps, diff --git a/ApplicationLibCode/Commands/RicImportEnsembleFeature.cpp b/ApplicationLibCode/Commands/RicImportEnsembleFeature.cpp index cd220942cf..d3ed3b4eb8 100644 --- a/ApplicationLibCode/Commands/RicImportEnsembleFeature.cpp +++ b/ApplicationLibCode/Commands/RicImportEnsembleFeature.cpp @@ -19,6 +19,7 @@ #include "RicImportEnsembleFeature.h" #include "RiaApplication.h" +#include "RiaEnsembleNameTools.h" #include "RiaFilePathTools.h" #include "RiaPreferences.h" #include "RiaSummaryTools.h" @@ -76,7 +77,7 @@ void RicImportEnsembleFeature::onActionTriggered( bool isChecked ) if ( fileNames.isEmpty() ) return; - QString ensembleNameSuggestion = RiaSummaryTools::findSuitableEnsembleName( fileNames ); + QString ensembleNameSuggestion = RiaEnsembleNameTools::findSuitableEnsembleName( fileNames ); QString ensembleName = askForEnsembleName( ensembleNameSuggestion ); if ( ensembleName.isEmpty() ) return; diff --git a/ApplicationLibCode/Commands/RicImportEnsembleSurfaceFeature.cpp b/ApplicationLibCode/Commands/RicImportEnsembleSurfaceFeature.cpp index d23eba267c..b1a8d105f9 100644 --- a/ApplicationLibCode/Commands/RicImportEnsembleSurfaceFeature.cpp +++ b/ApplicationLibCode/Commands/RicImportEnsembleSurfaceFeature.cpp @@ -19,7 +19,11 @@ #include "RicImportEnsembleSurfaceFeature.h" #include "RiaApplication.h" +#include "RiaEnsembleNameTools.h" #include "RiaLogging.h" +#include "RiaSummaryTools.h" + +#include "RicRecursiveFileSearchDialog.h" #include "RimEnsembleSurface.h" #include "RimFileSurface.h" @@ -27,7 +31,7 @@ #include "RimProject.h" #include "RimSurfaceCollection.h" -#include "RicRecursiveFileSearchDialog.h" +#include "Riu3DMainWindowTools.h" #include #include @@ -61,15 +65,24 @@ void RicImportEnsembleSurfaceFeature::onActionTriggered( bool isChecked ) QStringList fileNames = runRecursiveFileSearchDialog( "Import Ensemble Surface", pathCacheName ); if ( fileNames.isEmpty() ) return; - QString ensembleName = "Ensemble Surface"; - if ( ensembleName.isEmpty() ) return; + QString ensembleName = RiaEnsembleNameTools::findSuitableEnsembleName( fileNames ); + QString layerName = RiaEnsembleNameTools::findCommonBaseName( fileNames ); + if ( !layerName.isEmpty() ) + { + ensembleName += QString( " : %1" ).arg( layerName ); + } + + if ( ensembleName.isEmpty() ) ensembleName = "Ensemble Surface"; std::vector surfaces; - for ( QString fileName : fileNames ) + for ( const auto& fileName : fileNames ) { RimFileSurface* fileSurface = new RimFileSurface; fileSurface->setSurfaceFilePath( fileName ); + auto shortName = RiaEnsembleNameTools::uniqueShortName( fileName, fileNames ); + fileSurface->setUserDescription( shortName ); + if ( fileSurface->onLoadData() ) { surfaces.push_back( fileSurface ); @@ -84,7 +97,11 @@ void RicImportEnsembleSurfaceFeature::onActionTriggered( bool isChecked ) ensemble->addFileSurface( surface ); RimProject::current()->activeOilField()->surfaceCollection->addEnsembleSurface( ensemble ); + + ensemble->loadDataAndUpdate(); + RimProject::current()->activeOilField()->surfaceCollection->updateConnectedEditors(); + Riu3DMainWindowTools::selectAsCurrentItem( ensemble ); } //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationLibCode/ProjectDataModel/RimEclipseView.cpp b/ApplicationLibCode/ProjectDataModel/RimEclipseView.cpp index a7b60719e9..6e184e5e4e 100644 --- a/ApplicationLibCode/ProjectDataModel/RimEclipseView.cpp +++ b/ApplicationLibCode/ProjectDataModel/RimEclipseView.cpp @@ -597,7 +597,6 @@ void RimEclipseView::onCreateDisplayModel() m_surfaceVizModel->removeAllParts(); if ( m_surfaceCollection ) { - m_surfaceCollection->clearGeometry(); m_surfaceCollection->appendPartsToModel( m_surfaceVizModel.p(), m_reservoirGridPartManager->scaleTransform() ); nativeOrOverrideViewer()->addStaticModelOnce( m_surfaceVizModel.p(), isUsingOverrideViewer() ); } diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCase.cpp b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCase.cpp index ba1de2153b..7a544f8564 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCase.cpp +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCase.cpp @@ -33,6 +33,7 @@ #include "cvfAssert.h" +#include "RiaEnsembleNameTools.h" #include #include @@ -296,42 +297,7 @@ QString RimSummaryCase::uniqueShortNameForEnsembleCase( RimSummaryCase* summaryC } } - std::map keyFileComponentsForAllFiles = - RiaFilePathTools::keyPathComponentsForEachFilePath( summaryFilePaths ); - - QStringList keyFileComponents = keyFileComponentsForAllFiles[summaryCase->summaryHeaderFilename()]; - if ( keyFileComponents.empty() ) return ensembleCaseName; - - if ( !ensembleCaseName.isEmpty() ) - { - for ( auto& component : keyFileComponents ) - { - component = component.replace( ensembleCaseName, "" ); - component = component.replace( trimRe, "" ); - } - } - - QStringList shortNameComponents; - QRegularExpression numberRe( "[0-9]+" ); - for ( auto keyComponent : keyFileComponents ) - { - QStringList subComponents; - QString numberGroup = numberRe.match( keyComponent ).captured(); - if ( !numberGroup.isEmpty() ) - { - keyComponent = keyComponent.replace( numberGroup, "" ); - QString stem = keyComponent.left( RimCaseDisplayNameTools::CASE_SHORT_NAME_LENGTH ); - if ( !stem.isEmpty() ) subComponents.push_back( stem ); - subComponents.push_back( numberGroup ); - } - else - { - subComponents.push_back( keyComponent.left( RimCaseDisplayNameTools::CASE_SHORT_NAME_LENGTH ) ); - } - - shortNameComponents.push_back( subComponents.join( "-" ) ); - } - return shortNameComponents.join( "," ); + return RiaEnsembleNameTools::uniqueShortName( summaryCase->summaryHeaderFilename(), summaryFilePaths, ensembleCaseName ); } //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationLibCode/ProjectDataModel/Surfaces/RimEnsembleStatisticsSurface.cpp b/ApplicationLibCode/ProjectDataModel/Surfaces/RimEnsembleStatisticsSurface.cpp index e6efab3bec..bc7026bb1c 100644 --- a/ApplicationLibCode/ProjectDataModel/Surfaces/RimEnsembleStatisticsSurface.cpp +++ b/ApplicationLibCode/ProjectDataModel/Surfaces/RimEnsembleStatisticsSurface.cpp @@ -56,6 +56,8 @@ RimEnsembleStatisticsSurface::~RimEnsembleStatisticsSurface() void RimEnsembleStatisticsSurface::setStatisticsType( RigSurfaceStatisticsCalculator::StatisticsType statisticsType ) { m_statisticsType = statisticsType; + + setUserDescription( fullName() ); } //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationLibCode/ProjectDataModel/Surfaces/RimEnsembleSurfaceInView.cpp b/ApplicationLibCode/ProjectDataModel/Surfaces/RimEnsembleSurfaceInView.cpp index 16abd774b7..73909804aa 100644 --- a/ApplicationLibCode/ProjectDataModel/Surfaces/RimEnsembleSurfaceInView.cpp +++ b/ApplicationLibCode/ProjectDataModel/Surfaces/RimEnsembleSurfaceInView.cpp @@ -73,7 +73,7 @@ caf::PdmFieldHandle* RimEnsembleSurfaceInView::userDescriptionField() //-------------------------------------------------------------------------------------------------- QString RimEnsembleSurfaceInView::name() const { - if ( m_ensembleSurface ) return m_ensembleSurface->uiName(); + if ( m_ensembleSurface ) return m_ensembleSurface->name(); return ""; } From b78cf3a4bbeb31d31efa6541751b40c32d8f8371 Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Thu, 26 Aug 2021 19:46:38 +0200 Subject: [PATCH 080/308] Use cmake-format on all cmake files --- .github/workflows/cmake-format.yml | 3 +- .../Application/CMakeLists_files.cmake | 131 +++-- .../Application/Tools/CMakeLists_files.cmake | 245 ++++---- .../WellPathTools/CMakeLists_files.cmake | 60 +- .../CMakeLists_files.cmake | 172 +++--- .../Core/CMakeLists_files.cmake | 27 +- .../CMakeLists_files.cmake | 28 +- .../AnnotationCommands/CMakeLists_files.cmake | 52 +- .../CMakeLists_files.cmake | 105 ++-- .../Commands/CMakeLists_files.cmake | 362 ++++++------ .../CellFilterCommands/CMakeLists_files.cmake | 57 +- .../CMakeLists_files.cmake | 37 +- .../CompletionCommands/CMakeLists_files.cmake | 73 ++- .../CMakeLists_files.cmake | 109 ++-- .../CMakeLists_files.cmake | 36 +- .../CMakeLists_files.cmake | 48 +- .../EclipseCommands/CMakeLists_files.cmake | 92 ++- .../EclipseWell/CMakeLists_files.cmake | 29 +- .../ExportCommands/CMakeLists_files.cmake | 125 ++--- .../FlowCommands/CMakeLists_files.cmake | 64 +-- .../FractureCommands/CMakeLists_files.cmake | 115 ++-- .../GeoMechCommands/CMakeLists_files.cmake | 101 ++-- .../CMakeLists_files.cmake | 44 +- .../HoloLensCommands/CMakeLists_files.cmake | 125 ++--- .../CMakeLists_files.cmake | 56 +- .../CMakeLists_files.cmake | 24 +- .../CMakeLists_files.cmake | 31 +- .../CMakeLists_files.cmake | 67 ++- .../CMakeLists_files.cmake | 50 +- .../CMakeLists_files.cmake | 52 +- .../CMakeLists_files.cmake | 47 +- .../StreamlineCommands/CMakeLists_files.cmake | 24 +- .../CMakeLists_files.cmake | 209 ++++--- .../SurfaceCommands/CMakeLists_files.cmake | 55 +- .../ToggleCommands/CMakeLists_files.cmake | 48 +- .../Commands/ViewLink/CMakeLists_files.cmake | 60 +- .../WellLogCommands/CMakeLists_files.cmake | 132 +++-- .../WellPathCommands/CMakeLists_files.cmake | 159 +++--- .../FileInterface/CMakeLists_files.cmake | 292 +++++----- .../CMakeLists_files.cmake | 49 +- .../ModelVisualization/CMakeLists_files.cmake | 250 ++++----- .../GridBox/CMakeLists_files.cmake | 27 +- .../Intersections/CMakeLists_files.cmake | 56 +- .../Streamlines/CMakeLists_files.cmake | 23 +- .../Surfaces/CMakeLists_files.cmake | 33 +- .../CMakeLists_files.cmake | 25 +- .../AnalysisPlots/CMakeLists_files.cmake | 43 +- .../Annotations/CMakeLists_files.cmake | 93 ++-- .../ProjectDataModel/CMakeLists_files.cmake | 525 +++++++++--------- .../CellFilters/CMakeLists_files.cmake | 68 ++- .../Completions/CMakeLists_files.cmake | 151 +++-- .../CorrelationPlots/CMakeLists_files.cmake | 44 +- .../Faults/CMakeLists_files.cmake | 40 +- .../Flow/CMakeLists_files.cmake | 80 ++- .../GeoMech/CMakeLists_files.cmake | 52 +- .../GridCrossPlots/CMakeLists_files.cmake | 48 +- .../CellFilters/CMakeLists_files.cmake | 32 +- .../Measurement/CMakeLists_files.cmake | 35 +- .../Parameters/CMakeLists_files.cmake | 40 +- .../PlotTemplates/CMakeLists_files.cmake | 28 +- .../ProcessControl/CMakeLists_files.cmake | 29 +- .../StimPlanModel/CMakeLists_files.cmake | 115 ++-- .../Streamlines/CMakeLists_files.cmake | 40 +- .../Summary/CMakeLists_files.cmake | 180 +++--- .../Surfaces/CMakeLists_files.cmake | 60 +- .../WellLog/CMakeLists_files.cmake | 116 ++-- .../WellMeasurement/CMakeLists_files.cmake | 48 +- .../WellPath/CMakeLists_files.cmake | 64 +-- .../CMakeLists_files.cmake | 96 ++-- .../CommandRouter/CMakeLists_files.cmake | 26 +- .../ReservoirDataModel/CMakeLists_files.cmake | 371 ++++++------- .../CMakeLists_filesNotToUnitTest.cmake | 24 +- .../Completions/CMakeLists_files.cmake | 57 +- .../UnitTests/CMakeLists_files.cmake | 179 +++--- .../AnalysisPlots/CMakeLists_files.cmake | 32 +- .../UserInterface/CMakeLists_files.cmake | 505 ++++++++--------- 76 files changed, 3433 insertions(+), 3797 deletions(-) diff --git a/.github/workflows/cmake-format.yml b/.github/workflows/cmake-format.yml index 0607179e22..9b137d1700 100644 --- a/.github/workflows/cmake-format.yml +++ b/.github/workflows/cmake-format.yml @@ -6,7 +6,7 @@ jobs: cmake-format-job: runs-on: ubuntu-latest steps: - - name: Install cmakelang for cmake-format + - name: Install cmakelang for cmake-format run: | python3 -m pip install --user cmakelang - uses: actions/checkout@v2 @@ -16,6 +16,7 @@ jobs: cd ApplicationLibCode find -name CMake*.txt | xargs ~/.local/bin/cmake-format -c ${{ github.workspace }}/cmake/cmake-format.py -i + find -name CMake*.cmake | xargs ~/.local/bin/cmake-format -c ${{ github.workspace }}/cmake/cmake-format.py -i cd .. cd ApplicationExeCode diff --git a/ApplicationLibCode/Application/CMakeLists_files.cmake b/ApplicationLibCode/Application/CMakeLists_files.cmake index c578402d06..1d8912866b 100644 --- a/ApplicationLibCode/Application/CMakeLists_files.cmake +++ b/ApplicationLibCode/Application/CMakeLists_files.cmake @@ -1,74 +1,67 @@ +set(SOURCE_GROUP_HEADER_FILES + ${CMAKE_CURRENT_LIST_DIR}/RiaApplication.h + ${CMAKE_CURRENT_LIST_DIR}/RiaConsoleApplication.h + ${CMAKE_CURRENT_LIST_DIR}/RiaGuiApplication.h + ${CMAKE_CURRENT_LIST_DIR}/RiaCompletionTypeCalculationScheduler.h + ${CMAKE_CURRENT_LIST_DIR}/RiaDefines.h + ${CMAKE_CURRENT_LIST_DIR}/RiaFractureDefines.h + ${CMAKE_CURRENT_LIST_DIR}/RiaPreferences.h + ${CMAKE_CURRENT_LIST_DIR}/RiaPreferencesSummary.h + ${CMAKE_CURRENT_LIST_DIR}/RiaPreferencesGeoMech.h + ${CMAKE_CURRENT_LIST_DIR}/RiaPorosityModel.h + ${CMAKE_CURRENT_LIST_DIR}/RiaSummaryCurveDefinition.h + ${CMAKE_CURRENT_LIST_DIR}/RiaCurveSetDefinition.h + ${CMAKE_CURRENT_LIST_DIR}/RiaRftPltCurveDefinition.h + ${CMAKE_CURRENT_LIST_DIR}/RiaViewRedrawScheduler.h + ${CMAKE_CURRENT_LIST_DIR}/RiaPlotWindowRedrawScheduler.h + ${CMAKE_CURRENT_LIST_DIR}/RiaMemoryCleanup.h + ${CMAKE_CURRENT_LIST_DIR}/RiaFontCache.h + ${CMAKE_CURRENT_LIST_DIR}/RiaEclipseFileNameTools.h + ${CMAKE_CURRENT_LIST_DIR}/RiaFeatureCommandContext.h + ${CMAKE_CURRENT_LIST_DIR}/RiaStringListSerializer.h + ${CMAKE_CURRENT_LIST_DIR}/RiaNncDefines.h + ${CMAKE_CURRENT_LIST_DIR}/RiaStimPlanModelDefines.h + ${CMAKE_CURRENT_LIST_DIR}/RiaResultNames.h + ${CMAKE_CURRENT_LIST_DIR}/RiaNumberFormat.h) -set (SOURCE_GROUP_HEADER_FILES -${CMAKE_CURRENT_LIST_DIR}/RiaApplication.h -${CMAKE_CURRENT_LIST_DIR}/RiaConsoleApplication.h -${CMAKE_CURRENT_LIST_DIR}/RiaGuiApplication.h -${CMAKE_CURRENT_LIST_DIR}/RiaCompletionTypeCalculationScheduler.h -${CMAKE_CURRENT_LIST_DIR}/RiaDefines.h -${CMAKE_CURRENT_LIST_DIR}/RiaFractureDefines.h -${CMAKE_CURRENT_LIST_DIR}/RiaPreferences.h -${CMAKE_CURRENT_LIST_DIR}/RiaPreferencesSummary.h -${CMAKE_CURRENT_LIST_DIR}/RiaPreferencesGeoMech.h -${CMAKE_CURRENT_LIST_DIR}/RiaPorosityModel.h -${CMAKE_CURRENT_LIST_DIR}/RiaSummaryCurveDefinition.h -${CMAKE_CURRENT_LIST_DIR}/RiaCurveSetDefinition.h -${CMAKE_CURRENT_LIST_DIR}/RiaRftPltCurveDefinition.h -${CMAKE_CURRENT_LIST_DIR}/RiaViewRedrawScheduler.h -${CMAKE_CURRENT_LIST_DIR}/RiaPlotWindowRedrawScheduler.h -${CMAKE_CURRENT_LIST_DIR}/RiaMemoryCleanup.h -${CMAKE_CURRENT_LIST_DIR}/RiaFontCache.h -${CMAKE_CURRENT_LIST_DIR}/RiaEclipseFileNameTools.h -${CMAKE_CURRENT_LIST_DIR}/RiaFeatureCommandContext.h -${CMAKE_CURRENT_LIST_DIR}/RiaStringListSerializer.h -${CMAKE_CURRENT_LIST_DIR}/RiaNncDefines.h -${CMAKE_CURRENT_LIST_DIR}/RiaStimPlanModelDefines.h -${CMAKE_CURRENT_LIST_DIR}/RiaResultNames.h -${CMAKE_CURRENT_LIST_DIR}/RiaNumberFormat.h -) +set(SOURCE_GROUP_SOURCE_FILES + ${CMAKE_CURRENT_LIST_DIR}/RiaApplication.cpp + ${CMAKE_CURRENT_LIST_DIR}/RiaConsoleApplication.cpp + ${CMAKE_CURRENT_LIST_DIR}/RiaGuiApplication.cpp + ${CMAKE_CURRENT_LIST_DIR}/RiaCompletionTypeCalculationScheduler.cpp + ${CMAKE_CURRENT_LIST_DIR}/RiaDefines.cpp + ${CMAKE_CURRENT_LIST_DIR}/RiaFractureDefines.cpp + ${CMAKE_CURRENT_LIST_DIR}/RiaPreferences.cpp + ${CMAKE_CURRENT_LIST_DIR}/RiaPreferencesSummary.cpp + ${CMAKE_CURRENT_LIST_DIR}/RiaPreferencesGeoMech.cpp + ${CMAKE_CURRENT_LIST_DIR}/RiaPorosityModel.cpp + ${CMAKE_CURRENT_LIST_DIR}/RiaSummaryCurveDefinition.cpp + ${CMAKE_CURRENT_LIST_DIR}/RiaCurveSetDefinition.cpp + ${CMAKE_CURRENT_LIST_DIR}/RiaRftPltCurveDefinition.cpp + ${CMAKE_CURRENT_LIST_DIR}/RiaViewRedrawScheduler.cpp + ${CMAKE_CURRENT_LIST_DIR}/RiaPlotWindowRedrawScheduler.cpp + ${CMAKE_CURRENT_LIST_DIR}/RiaMemoryCleanup.cpp + ${CMAKE_CURRENT_LIST_DIR}/RiaFontCache.cpp + ${CMAKE_CURRENT_LIST_DIR}/RiaEclipseFileNameTools.cpp + ${CMAKE_CURRENT_LIST_DIR}/RiaFeatureCommandContext.cpp + ${CMAKE_CURRENT_LIST_DIR}/RiaStringListSerializer.cpp + ${CMAKE_CURRENT_LIST_DIR}/RiaNncDefines.cpp + ${CMAKE_CURRENT_LIST_DIR}/RiaStimPlanModelDefines.cpp + ${CMAKE_CURRENT_LIST_DIR}/RiaResultNames.cpp + ${CMAKE_CURRENT_LIST_DIR}/RiaNumberFormat.cpp) -set (SOURCE_GROUP_SOURCE_FILES -${CMAKE_CURRENT_LIST_DIR}/RiaApplication.cpp -${CMAKE_CURRENT_LIST_DIR}/RiaConsoleApplication.cpp -${CMAKE_CURRENT_LIST_DIR}/RiaGuiApplication.cpp -${CMAKE_CURRENT_LIST_DIR}/RiaCompletionTypeCalculationScheduler.cpp -${CMAKE_CURRENT_LIST_DIR}/RiaDefines.cpp -${CMAKE_CURRENT_LIST_DIR}/RiaFractureDefines.cpp -${CMAKE_CURRENT_LIST_DIR}/RiaPreferences.cpp -${CMAKE_CURRENT_LIST_DIR}/RiaPreferencesSummary.cpp -${CMAKE_CURRENT_LIST_DIR}/RiaPreferencesGeoMech.cpp -${CMAKE_CURRENT_LIST_DIR}/RiaPorosityModel.cpp -${CMAKE_CURRENT_LIST_DIR}/RiaSummaryCurveDefinition.cpp -${CMAKE_CURRENT_LIST_DIR}/RiaCurveSetDefinition.cpp -${CMAKE_CURRENT_LIST_DIR}/RiaRftPltCurveDefinition.cpp -${CMAKE_CURRENT_LIST_DIR}/RiaViewRedrawScheduler.cpp -${CMAKE_CURRENT_LIST_DIR}/RiaPlotWindowRedrawScheduler.cpp -${CMAKE_CURRENT_LIST_DIR}/RiaMemoryCleanup.cpp -${CMAKE_CURRENT_LIST_DIR}/RiaFontCache.cpp -${CMAKE_CURRENT_LIST_DIR}/RiaEclipseFileNameTools.cpp -${CMAKE_CURRENT_LIST_DIR}/RiaFeatureCommandContext.cpp -${CMAKE_CURRENT_LIST_DIR}/RiaStringListSerializer.cpp -${CMAKE_CURRENT_LIST_DIR}/RiaNncDefines.cpp -${CMAKE_CURRENT_LIST_DIR}/RiaStimPlanModelDefines.cpp -${CMAKE_CURRENT_LIST_DIR}/RiaResultNames.cpp -${CMAKE_CURRENT_LIST_DIR}/RiaNumberFormat.cpp -) +list(APPEND CODE_HEADER_FILES ${SOURCE_GROUP_HEADER_FILES}) -list(APPEND CODE_HEADER_FILES -${SOURCE_GROUP_HEADER_FILES} -) +list(APPEND CODE_SOURCE_FILES ${SOURCE_GROUP_SOURCE_FILES}) -list(APPEND CODE_SOURCE_FILES -${SOURCE_GROUP_SOURCE_FILES} -) +set(QT_MOC_HEADERS + ${QT_MOC_HEADERS} + ${CMAKE_CURRENT_LIST_DIR}/RiaConsoleApplication.h + ${CMAKE_CURRENT_LIST_DIR}/RiaGuiApplication.h + ${CMAKE_CURRENT_LIST_DIR}/RiaCompletionTypeCalculationScheduler.h + ${CMAKE_CURRENT_LIST_DIR}/RiaViewRedrawScheduler.h + ${CMAKE_CURRENT_LIST_DIR}/RiaPlotWindowRedrawScheduler.h) -set (QT_MOC_HEADERS -${QT_MOC_HEADERS} -${CMAKE_CURRENT_LIST_DIR}/RiaConsoleApplication.h -${CMAKE_CURRENT_LIST_DIR}/RiaGuiApplication.h -${CMAKE_CURRENT_LIST_DIR}/RiaCompletionTypeCalculationScheduler.h -${CMAKE_CURRENT_LIST_DIR}/RiaViewRedrawScheduler.h -${CMAKE_CURRENT_LIST_DIR}/RiaPlotWindowRedrawScheduler.h -) - - -source_group( "Application" FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake ) +source_group( + "Application" FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} + ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake) diff --git a/ApplicationLibCode/Application/Tools/CMakeLists_files.cmake b/ApplicationLibCode/Application/Tools/CMakeLists_files.cmake index a97a7fae3d..859eaa1bf9 100644 --- a/ApplicationLibCode/Application/Tools/CMakeLists_files.cmake +++ b/ApplicationLibCode/Application/Tools/CMakeLists_files.cmake @@ -1,108 +1,147 @@ +set(SOURCE_GROUP_HEADER_FILES + ${CMAKE_CURRENT_LIST_DIR}/RiaArgumentParser.h + ${CMAKE_CURRENT_LIST_DIR}/RiaDateStringParser.h + ${CMAKE_CURRENT_LIST_DIR}/RiaColorTables.h + ${CMAKE_CURRENT_LIST_DIR}/RiaColorTools.h + ${CMAKE_CURRENT_LIST_DIR}/RiaEclipseUnitTools.h + ${CMAKE_CURRENT_LIST_DIR}/RiaImageCompareReporter.h + ${CMAKE_CURRENT_LIST_DIR}/RiaImageFileCompare.h + ${CMAKE_CURRENT_LIST_DIR}/RiaImageTools.h + ${CMAKE_CURRENT_LIST_DIR}/RiaLogging.h + ${CMAKE_CURRENT_LIST_DIR}/RiaProjectModifier.h + ${CMAKE_CURRENT_LIST_DIR}/RiaRegressionTest.h + ${CMAKE_CURRENT_LIST_DIR}/RiaImportEclipseCaseTools.h + ${CMAKE_CURRENT_LIST_DIR}/RiaQDateTimeTools.h + ${CMAKE_CURRENT_LIST_DIR}/RiaSummaryTools.h + ${CMAKE_CURRENT_LIST_DIR}/RiaWellNameComparer.h + ${CMAKE_CURRENT_LIST_DIR}/RiaStdStringTools.h + ${CMAKE_CURRENT_LIST_DIR}/RiaInterpolationTools.h + ${CMAKE_CURRENT_LIST_DIR}/RiaSummaryCurveAnalyzer.h + ${CMAKE_CURRENT_LIST_DIR}/RiaSimWellBranchTools.h + ${CMAKE_CURRENT_LIST_DIR}/RiaProjectFileVersionTools.h + ${CMAKE_CURRENT_LIST_DIR}/RiaStringEncodingTools.h + ${CMAKE_CURRENT_LIST_DIR}/RiaTextStringTools.h + ${CMAKE_CURRENT_LIST_DIR}/RiaTextFileCompare.h + ${CMAKE_CURRENT_LIST_DIR}/RiaRegressionTestRunner.h + ${CMAKE_CURRENT_LIST_DIR}/RiaExtractionTools.h + ${CMAKE_CURRENT_LIST_DIR}/RiaFilePathTools.h + ${CMAKE_CURRENT_LIST_DIR}/RiaCurveMerger.h + ${CMAKE_CURRENT_LIST_DIR}/RiaCurveMerger.inl + ${CMAKE_CURRENT_LIST_DIR}/RiaCurveDataTools.h + ${CMAKE_CURRENT_LIST_DIR}/RiaTimeHistoryCurveResampler.h + ${CMAKE_CURRENT_LIST_DIR}/RiaStatisticsTools.h + ${CMAKE_CURRENT_LIST_DIR}/RiaOffshoreSphericalCoords.h + ${CMAKE_CURRENT_LIST_DIR}/RiaWeightedMeanCalculator.h + ${CMAKE_CURRENT_LIST_DIR}/RiaMedianCalculator.h + ${CMAKE_CURRENT_LIST_DIR}/RiaWeightedMeanCalculator.inl + ${CMAKE_CURRENT_LIST_DIR}/RiaWeightedGeometricMeanCalculator.h + ${CMAKE_CURRENT_LIST_DIR}/RiaWeightedHarmonicMeanCalculator.h + ${CMAKE_CURRENT_LIST_DIR}/RiaOptionItemFactory.h + ${CMAKE_CURRENT_LIST_DIR}/RiaGitDiff.h + ${CMAKE_CURRENT_LIST_DIR}/RiaCellDividingTools.h + ${CMAKE_CURRENT_LIST_DIR}/RiaFieldHandleTools.h + ${CMAKE_CURRENT_LIST_DIR}/RiaBoundingBoxTools.h + ${CMAKE_CURRENT_LIST_DIR}/RiaWellLogUnitTools.h + ${CMAKE_CURRENT_LIST_DIR}/RiaWellLogUnitTools.inl + ${CMAKE_CURRENT_LIST_DIR}/RiaTimeTTools.h + ${CMAKE_CURRENT_LIST_DIR}/RiaValidRegExpValidator.h) -set (SOURCE_GROUP_HEADER_FILES -${CMAKE_CURRENT_LIST_DIR}/RiaArgumentParser.h -${CMAKE_CURRENT_LIST_DIR}/RiaDateStringParser.h -${CMAKE_CURRENT_LIST_DIR}/RiaColorTables.h -${CMAKE_CURRENT_LIST_DIR}/RiaColorTools.h -${CMAKE_CURRENT_LIST_DIR}/RiaEclipseUnitTools.h -${CMAKE_CURRENT_LIST_DIR}/RiaImageCompareReporter.h -${CMAKE_CURRENT_LIST_DIR}/RiaImageFileCompare.h -${CMAKE_CURRENT_LIST_DIR}/RiaImageTools.h -${CMAKE_CURRENT_LIST_DIR}/RiaLogging.h -${CMAKE_CURRENT_LIST_DIR}/RiaProjectModifier.h -${CMAKE_CURRENT_LIST_DIR}/RiaRegressionTest.h -${CMAKE_CURRENT_LIST_DIR}/RiaImportEclipseCaseTools.h -${CMAKE_CURRENT_LIST_DIR}/RiaQDateTimeTools.h -${CMAKE_CURRENT_LIST_DIR}/RiaSummaryTools.h -${CMAKE_CURRENT_LIST_DIR}/RiaWellNameComparer.h -${CMAKE_CURRENT_LIST_DIR}/RiaStdStringTools.h -${CMAKE_CURRENT_LIST_DIR}/RiaInterpolationTools.h -${CMAKE_CURRENT_LIST_DIR}/RiaSummaryCurveAnalyzer.h -${CMAKE_CURRENT_LIST_DIR}/RiaSimWellBranchTools.h -${CMAKE_CURRENT_LIST_DIR}/RiaProjectFileVersionTools.h -${CMAKE_CURRENT_LIST_DIR}/RiaStringEncodingTools.h -${CMAKE_CURRENT_LIST_DIR}/RiaTextStringTools.h -${CMAKE_CURRENT_LIST_DIR}/RiaTextFileCompare.h -${CMAKE_CURRENT_LIST_DIR}/RiaRegressionTestRunner.h -${CMAKE_CURRENT_LIST_DIR}/RiaExtractionTools.h -${CMAKE_CURRENT_LIST_DIR}/RiaFilePathTools.h -${CMAKE_CURRENT_LIST_DIR}/RiaCurveMerger.h -${CMAKE_CURRENT_LIST_DIR}/RiaCurveMerger.inl -${CMAKE_CURRENT_LIST_DIR}/RiaCurveDataTools.h -${CMAKE_CURRENT_LIST_DIR}/RiaTimeHistoryCurveResampler.h -${CMAKE_CURRENT_LIST_DIR}/RiaStatisticsTools.h -${CMAKE_CURRENT_LIST_DIR}/RiaOffshoreSphericalCoords.h -${CMAKE_CURRENT_LIST_DIR}/RiaWeightedMeanCalculator.h -${CMAKE_CURRENT_LIST_DIR}/RiaMedianCalculator.h -${CMAKE_CURRENT_LIST_DIR}/RiaWeightedMeanCalculator.inl -${CMAKE_CURRENT_LIST_DIR}/RiaWeightedGeometricMeanCalculator.h -${CMAKE_CURRENT_LIST_DIR}/RiaWeightedHarmonicMeanCalculator.h -${CMAKE_CURRENT_LIST_DIR}/RiaOptionItemFactory.h -${CMAKE_CURRENT_LIST_DIR}/RiaGitDiff.h -${CMAKE_CURRENT_LIST_DIR}/RiaCellDividingTools.h -${CMAKE_CURRENT_LIST_DIR}/RiaFieldHandleTools.h -${CMAKE_CURRENT_LIST_DIR}/RiaBoundingBoxTools.h -${CMAKE_CURRENT_LIST_DIR}/RiaWellLogUnitTools.h -${CMAKE_CURRENT_LIST_DIR}/RiaWellLogUnitTools.inl -${CMAKE_CURRENT_LIST_DIR}/RiaTimeTTools.h -${CMAKE_CURRENT_LIST_DIR}/RiaValidRegExpValidator.h -${CMAKE_CURRENT_LIST_DIR}/RiaEnsembleNameTools.h -) +set(SOURCE_GROUP_HEADER_FILES + ${CMAKE_CURRENT_LIST_DIR}/RiaArgumentParser.h + ${CMAKE_CURRENT_LIST_DIR}/RiaDateStringParser.h + ${CMAKE_CURRENT_LIST_DIR}/RiaColorTables.h + ${CMAKE_CURRENT_LIST_DIR}/RiaColorTools.h + ${CMAKE_CURRENT_LIST_DIR}/RiaEclipseUnitTools.h + ${CMAKE_CURRENT_LIST_DIR}/RiaImageCompareReporter.h + ${CMAKE_CURRENT_LIST_DIR}/RiaImageFileCompare.h + ${CMAKE_CURRENT_LIST_DIR}/RiaImageTools.h + ${CMAKE_CURRENT_LIST_DIR}/RiaLogging.h + ${CMAKE_CURRENT_LIST_DIR}/RiaProjectModifier.h + ${CMAKE_CURRENT_LIST_DIR}/RiaRegressionTest.h + ${CMAKE_CURRENT_LIST_DIR}/RiaImportEclipseCaseTools.h + ${CMAKE_CURRENT_LIST_DIR}/RiaQDateTimeTools.h + ${CMAKE_CURRENT_LIST_DIR}/RiaSummaryTools.h + ${CMAKE_CURRENT_LIST_DIR}/RiaWellNameComparer.h + ${CMAKE_CURRENT_LIST_DIR}/RiaStdStringTools.h + ${CMAKE_CURRENT_LIST_DIR}/RiaInterpolationTools.h + ${CMAKE_CURRENT_LIST_DIR}/RiaSummaryCurveAnalyzer.h + ${CMAKE_CURRENT_LIST_DIR}/RiaSimWellBranchTools.h + ${CMAKE_CURRENT_LIST_DIR}/RiaProjectFileVersionTools.h + ${CMAKE_CURRENT_LIST_DIR}/RiaStringEncodingTools.h + ${CMAKE_CURRENT_LIST_DIR}/RiaTextStringTools.h + ${CMAKE_CURRENT_LIST_DIR}/RiaTextFileCompare.h + ${CMAKE_CURRENT_LIST_DIR}/RiaRegressionTestRunner.h + ${CMAKE_CURRENT_LIST_DIR}/RiaExtractionTools.h + ${CMAKE_CURRENT_LIST_DIR}/RiaFilePathTools.h + ${CMAKE_CURRENT_LIST_DIR}/RiaCurveMerger.h + ${CMAKE_CURRENT_LIST_DIR}/RiaCurveMerger.inl + ${CMAKE_CURRENT_LIST_DIR}/RiaCurveDataTools.h + ${CMAKE_CURRENT_LIST_DIR}/RiaTimeHistoryCurveResampler.h + ${CMAKE_CURRENT_LIST_DIR}/RiaStatisticsTools.h + ${CMAKE_CURRENT_LIST_DIR}/RiaOffshoreSphericalCoords.h + ${CMAKE_CURRENT_LIST_DIR}/RiaWeightedMeanCalculator.h + ${CMAKE_CURRENT_LIST_DIR}/RiaMedianCalculator.h + ${CMAKE_CURRENT_LIST_DIR}/RiaWeightedMeanCalculator.inl + ${CMAKE_CURRENT_LIST_DIR}/RiaWeightedGeometricMeanCalculator.h + ${CMAKE_CURRENT_LIST_DIR}/RiaWeightedHarmonicMeanCalculator.h + ${CMAKE_CURRENT_LIST_DIR}/RiaOptionItemFactory.h + ${CMAKE_CURRENT_LIST_DIR}/RiaGitDiff.h + ${CMAKE_CURRENT_LIST_DIR}/RiaCellDividingTools.h + ${CMAKE_CURRENT_LIST_DIR}/RiaFieldHandleTools.h + ${CMAKE_CURRENT_LIST_DIR}/RiaBoundingBoxTools.h + ${CMAKE_CURRENT_LIST_DIR}/RiaWellLogUnitTools.h + ${CMAKE_CURRENT_LIST_DIR}/RiaWellLogUnitTools.inl + ${CMAKE_CURRENT_LIST_DIR}/RiaTimeTTools.h + ${CMAKE_CURRENT_LIST_DIR}/RiaValidRegExpValidator.h + ${CMAKE_CURRENT_LIST_DIR}/RiaEnsembleNameTools.h) -set (SOURCE_GROUP_SOURCE_FILES -${CMAKE_CURRENT_LIST_DIR}/RiaArgumentParser.cpp -${CMAKE_CURRENT_LIST_DIR}/RiaDateStringParser.cpp -${CMAKE_CURRENT_LIST_DIR}/RiaColorTables.cpp -${CMAKE_CURRENT_LIST_DIR}/RiaColorTools.cpp -${CMAKE_CURRENT_LIST_DIR}/RiaEclipseUnitTools.cpp -${CMAKE_CURRENT_LIST_DIR}/RiaImageCompareReporter.cpp -${CMAKE_CURRENT_LIST_DIR}/RiaImageFileCompare.cpp -${CMAKE_CURRENT_LIST_DIR}/RiaImageTools.cpp -${CMAKE_CURRENT_LIST_DIR}/RiaLogging.cpp -${CMAKE_CURRENT_LIST_DIR}/RiaProjectModifier.cpp -${CMAKE_CURRENT_LIST_DIR}/RiaRegressionTest.cpp -${CMAKE_CURRENT_LIST_DIR}/RiaImportEclipseCaseTools.cpp -${CMAKE_CURRENT_LIST_DIR}/RiaQDateTimeTools.cpp -${CMAKE_CURRENT_LIST_DIR}/RiaSummaryTools.cpp -${CMAKE_CURRENT_LIST_DIR}/RiaWellNameComparer.cpp -${CMAKE_CURRENT_LIST_DIR}/RiaStdStringTools.cpp -${CMAKE_CURRENT_LIST_DIR}/RiaInterpolationTools.cpp -${CMAKE_CURRENT_LIST_DIR}/RiaSummaryCurveAnalyzer.cpp -${CMAKE_CURRENT_LIST_DIR}/RiaSimWellBranchTools.cpp -${CMAKE_CURRENT_LIST_DIR}/RiaProjectFileVersionTools.cpp -${CMAKE_CURRENT_LIST_DIR}/RiaStringEncodingTools.cpp -${CMAKE_CURRENT_LIST_DIR}/RiaTextStringTools.cpp -${CMAKE_CURRENT_LIST_DIR}/RiaTextFileCompare.cpp -${CMAKE_CURRENT_LIST_DIR}/RiaRegressionTestRunner.cpp -${CMAKE_CURRENT_LIST_DIR}/RiaExtractionTools.cpp -${CMAKE_CURRENT_LIST_DIR}/RiaFilePathTools.cpp -${CMAKE_CURRENT_LIST_DIR}/RiaCurveMerger.cpp -${CMAKE_CURRENT_LIST_DIR}/RiaCurveDataTools.cpp -${CMAKE_CURRENT_LIST_DIR}/RiaTimeHistoryCurveResampler.cpp -${CMAKE_CURRENT_LIST_DIR}/RiaStatisticsTools.cpp -${CMAKE_CURRENT_LIST_DIR}/RiaWeightedGeometricMeanCalculator.cpp -${CMAKE_CURRENT_LIST_DIR}/RiaWeightedHarmonicMeanCalculator.cpp -${CMAKE_CURRENT_LIST_DIR}/RiaOptionItemFactory.cpp -${CMAKE_CURRENT_LIST_DIR}/RiaGitDiff.cpp -${CMAKE_CURRENT_LIST_DIR}/RiaCellDividingTools.cpp -${CMAKE_CURRENT_LIST_DIR}/RiaFieldHandleTools.cpp -${CMAKE_CURRENT_LIST_DIR}/RiaBoundingBoxTools.cpp -${CMAKE_CURRENT_LIST_DIR}/RiaTimeTTools.cpp -${CMAKE_CURRENT_LIST_DIR}/RiaValidRegExpValidator.cpp -${CMAKE_CURRENT_LIST_DIR}/RiaEnsembleNameTools.cpp -) +set(SOURCE_GROUP_SOURCE_FILES + ${CMAKE_CURRENT_LIST_DIR}/RiaArgumentParser.cpp + ${CMAKE_CURRENT_LIST_DIR}/RiaDateStringParser.cpp + ${CMAKE_CURRENT_LIST_DIR}/RiaColorTables.cpp + ${CMAKE_CURRENT_LIST_DIR}/RiaColorTools.cpp + ${CMAKE_CURRENT_LIST_DIR}/RiaEclipseUnitTools.cpp + ${CMAKE_CURRENT_LIST_DIR}/RiaImageCompareReporter.cpp + ${CMAKE_CURRENT_LIST_DIR}/RiaImageFileCompare.cpp + ${CMAKE_CURRENT_LIST_DIR}/RiaImageTools.cpp + ${CMAKE_CURRENT_LIST_DIR}/RiaLogging.cpp + ${CMAKE_CURRENT_LIST_DIR}/RiaProjectModifier.cpp + ${CMAKE_CURRENT_LIST_DIR}/RiaRegressionTest.cpp + ${CMAKE_CURRENT_LIST_DIR}/RiaImportEclipseCaseTools.cpp + ${CMAKE_CURRENT_LIST_DIR}/RiaQDateTimeTools.cpp + ${CMAKE_CURRENT_LIST_DIR}/RiaSummaryTools.cpp + ${CMAKE_CURRENT_LIST_DIR}/RiaWellNameComparer.cpp + ${CMAKE_CURRENT_LIST_DIR}/RiaStdStringTools.cpp + ${CMAKE_CURRENT_LIST_DIR}/RiaInterpolationTools.cpp + ${CMAKE_CURRENT_LIST_DIR}/RiaSummaryCurveAnalyzer.cpp + ${CMAKE_CURRENT_LIST_DIR}/RiaSimWellBranchTools.cpp + ${CMAKE_CURRENT_LIST_DIR}/RiaProjectFileVersionTools.cpp + ${CMAKE_CURRENT_LIST_DIR}/RiaStringEncodingTools.cpp + ${CMAKE_CURRENT_LIST_DIR}/RiaTextStringTools.cpp + ${CMAKE_CURRENT_LIST_DIR}/RiaTextFileCompare.cpp + ${CMAKE_CURRENT_LIST_DIR}/RiaRegressionTestRunner.cpp + ${CMAKE_CURRENT_LIST_DIR}/RiaExtractionTools.cpp + ${CMAKE_CURRENT_LIST_DIR}/RiaFilePathTools.cpp + ${CMAKE_CURRENT_LIST_DIR}/RiaCurveMerger.cpp + ${CMAKE_CURRENT_LIST_DIR}/RiaCurveDataTools.cpp + ${CMAKE_CURRENT_LIST_DIR}/RiaTimeHistoryCurveResampler.cpp + ${CMAKE_CURRENT_LIST_DIR}/RiaStatisticsTools.cpp + ${CMAKE_CURRENT_LIST_DIR}/RiaWeightedGeometricMeanCalculator.cpp + ${CMAKE_CURRENT_LIST_DIR}/RiaWeightedHarmonicMeanCalculator.cpp + ${CMAKE_CURRENT_LIST_DIR}/RiaOptionItemFactory.cpp + ${CMAKE_CURRENT_LIST_DIR}/RiaGitDiff.cpp + ${CMAKE_CURRENT_LIST_DIR}/RiaCellDividingTools.cpp + ${CMAKE_CURRENT_LIST_DIR}/RiaFieldHandleTools.cpp + ${CMAKE_CURRENT_LIST_DIR}/RiaBoundingBoxTools.cpp + ${CMAKE_CURRENT_LIST_DIR}/RiaTimeTTools.cpp + ${CMAKE_CURRENT_LIST_DIR}/RiaValidRegExpValidator.cpp + ${CMAKE_CURRENT_LIST_DIR}/RiaEnsembleNameTools.cpp) -list(APPEND CODE_HEADER_FILES -${SOURCE_GROUP_HEADER_FILES} -) +list(APPEND CODE_SOURCE_FILES ${SOURCE_GROUP_SOURCE_FILES}) -list(APPEND CODE_SOURCE_FILES -${SOURCE_GROUP_SOURCE_FILES} -) +set(QT_MOC_HEADERS ${QT_MOC_HEADERS}) -set (QT_MOC_HEADERS -${QT_MOC_HEADERS} -) - - -source_group( "Application\\Tools" FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake ) +source_group( + "Application\\Tools" + FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} + ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake) diff --git a/ApplicationLibCode/Application/Tools/WellPathTools/CMakeLists_files.cmake b/ApplicationLibCode/Application/Tools/WellPathTools/CMakeLists_files.cmake index 0153169841..7667b75edc 100644 --- a/ApplicationLibCode/Application/Tools/WellPathTools/CMakeLists_files.cmake +++ b/ApplicationLibCode/Application/Tools/WellPathTools/CMakeLists_files.cmake @@ -1,34 +1,26 @@ - -set (SOURCE_GROUP_HEADER_FILES - -${CMAKE_CURRENT_LIST_DIR}/RiaPolyArcLineSampler.h -${CMAKE_CURRENT_LIST_DIR}/RiaWellPlanCalculator.h -${CMAKE_CURRENT_LIST_DIR}/RiaSCurveCalculator.h -${CMAKE_CURRENT_LIST_DIR}/RiaArcCurveCalculator.h -${CMAKE_CURRENT_LIST_DIR}/RiaJCurveCalculator.h -${CMAKE_CURRENT_LIST_DIR}/RiaLineArcWellPathCalculator.h -) - -set (SOURCE_GROUP_SOURCE_FILES -${CMAKE_CURRENT_LIST_DIR}/RiaPolyArcLineSampler.cpp -${CMAKE_CURRENT_LIST_DIR}/RiaWellPlanCalculator.cpp -${CMAKE_CURRENT_LIST_DIR}/RiaSCurveCalculator.cpp -${CMAKE_CURRENT_LIST_DIR}/RiaArcCurveCalculator.cpp -${CMAKE_CURRENT_LIST_DIR}/RiaJCurveCalculator.cpp -${CMAKE_CURRENT_LIST_DIR}/RiaLineArcWellPathCalculator.cpp -) - -list(APPEND CODE_HEADER_FILES -${SOURCE_GROUP_HEADER_FILES} -) - -list(APPEND CODE_SOURCE_FILES -${SOURCE_GROUP_SOURCE_FILES} -) - -set (QT_MOC_HEADERS -${QT_MOC_HEADERS} -) - - -source_group( "Application\\Tools\\WellPathTools" FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake ) +set(SOURCE_GROUP_HEADER_FILES + ${CMAKE_CURRENT_LIST_DIR}/RiaPolyArcLineSampler.h + ${CMAKE_CURRENT_LIST_DIR}/RiaWellPlanCalculator.h + ${CMAKE_CURRENT_LIST_DIR}/RiaSCurveCalculator.h + ${CMAKE_CURRENT_LIST_DIR}/RiaArcCurveCalculator.h + ${CMAKE_CURRENT_LIST_DIR}/RiaJCurveCalculator.h + ${CMAKE_CURRENT_LIST_DIR}/RiaLineArcWellPathCalculator.h) + +set(SOURCE_GROUP_SOURCE_FILES + ${CMAKE_CURRENT_LIST_DIR}/RiaPolyArcLineSampler.cpp + ${CMAKE_CURRENT_LIST_DIR}/RiaWellPlanCalculator.cpp + ${CMAKE_CURRENT_LIST_DIR}/RiaSCurveCalculator.cpp + ${CMAKE_CURRENT_LIST_DIR}/RiaArcCurveCalculator.cpp + ${CMAKE_CURRENT_LIST_DIR}/RiaJCurveCalculator.cpp + ${CMAKE_CURRENT_LIST_DIR}/RiaLineArcWellPathCalculator.cpp) + +list(APPEND CODE_HEADER_FILES ${SOURCE_GROUP_HEADER_FILES}) + +list(APPEND CODE_SOURCE_FILES ${SOURCE_GROUP_SOURCE_FILES}) + +set(QT_MOC_HEADERS ${QT_MOC_HEADERS}) + +source_group( + "Application\\Tools\\WellPathTools" + FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} + ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake) diff --git a/ApplicationLibCode/CommandFileInterface/CMakeLists_files.cmake b/ApplicationLibCode/CommandFileInterface/CMakeLists_files.cmake index 7056c2e57f..c4fd0ec0fb 100644 --- a/ApplicationLibCode/CommandFileInterface/CMakeLists_files.cmake +++ b/ApplicationLibCode/CommandFileInterface/CMakeLists_files.cmake @@ -1,92 +1,88 @@ +set(SOURCE_GROUP_HEADER_FILES + ${CMAKE_CURRENT_LIST_DIR}/RicfCloseProject.h + ${CMAKE_CURRENT_LIST_DIR}/RicfCommandFileExecutor.h + ${CMAKE_CURRENT_LIST_DIR}/RicfComputeCaseGroupStatistics.h + ${CMAKE_CURRENT_LIST_DIR}/RicfExportMsw.h + ${CMAKE_CURRENT_LIST_DIR}/RicfExportMultiCaseSnapshots.h + ${CMAKE_CURRENT_LIST_DIR}/RicfExportProperty.h + ${CMAKE_CURRENT_LIST_DIR}/RicfExportSimWellFractureCompletions.h + ${CMAKE_CURRENT_LIST_DIR}/RicfExportSnapshots.h + ${CMAKE_CURRENT_LIST_DIR}/RicfExportWellPathCompletions.h + ${CMAKE_CURRENT_LIST_DIR}/RicfLoadCase.h + ${CMAKE_CURRENT_LIST_DIR}/RicfOpenProject.h + ${CMAKE_CURRENT_LIST_DIR}/RicfReplaceCase.h + ${CMAKE_CURRENT_LIST_DIR}/RicfReplaceSourceCases.h + ${CMAKE_CURRENT_LIST_DIR}/RicfRunOctaveScript.h + ${CMAKE_CURRENT_LIST_DIR}/RicfSetExportFolder.h + ${CMAKE_CURRENT_LIST_DIR}/RicfSetMainWindowSize.h + ${CMAKE_CURRENT_LIST_DIR}/RicfSetPlotWindowSize.h + ${CMAKE_CURRENT_LIST_DIR}/RicfSetStartDir.h + ${CMAKE_CURRENT_LIST_DIR}/RicfSetTimeStep.h + ${CMAKE_CURRENT_LIST_DIR}/RicfScaleFractureTemplate.h + ${CMAKE_CURRENT_LIST_DIR}/RicfSetFractureContainment.h + ${CMAKE_CURRENT_LIST_DIR}/RicfCreateMultipleFractures.h + ${CMAKE_CURRENT_LIST_DIR}/RicfExportWellPaths.h + ${CMAKE_CURRENT_LIST_DIR}/RicfExportVisibleCells.h + ${CMAKE_CURRENT_LIST_DIR}/RicfExportPropertyInViews.h + ${CMAKE_CURRENT_LIST_DIR}/RicfExportLgrForCompletions.h + ${CMAKE_CURRENT_LIST_DIR}/RicfCreateLgrForCompletions.h + ${CMAKE_CURRENT_LIST_DIR}/RicfApplicationTools.h + ${CMAKE_CURRENT_LIST_DIR}/RicfCreateSaturationPressurePlots.h + ${CMAKE_CURRENT_LIST_DIR}/RicfExportFlowCharacteristics.h + ${CMAKE_CURRENT_LIST_DIR}/RicfCreateGridCaseGroup.h + ${CMAKE_CURRENT_LIST_DIR}/RicfCreateStatisticsCase.h + ${CMAKE_CURRENT_LIST_DIR}/RicfCreateView.h + ${CMAKE_CURRENT_LIST_DIR}/RicfCloneView.h + ${CMAKE_CURRENT_LIST_DIR}/RicfNewWellBoreStabilityPlotFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicfImportWellLogFiles.h + ${CMAKE_CURRENT_LIST_DIR}/RicfImportFormationNames.h + ${CMAKE_CURRENT_LIST_DIR}/RicfExportWellLogPlotData.h) -set (SOURCE_GROUP_HEADER_FILES -${CMAKE_CURRENT_LIST_DIR}/RicfCloseProject.h -${CMAKE_CURRENT_LIST_DIR}/RicfCommandFileExecutor.h -${CMAKE_CURRENT_LIST_DIR}/RicfComputeCaseGroupStatistics.h -${CMAKE_CURRENT_LIST_DIR}/RicfExportMsw.h -${CMAKE_CURRENT_LIST_DIR}/RicfExportMultiCaseSnapshots.h -${CMAKE_CURRENT_LIST_DIR}/RicfExportProperty.h -${CMAKE_CURRENT_LIST_DIR}/RicfExportSimWellFractureCompletions.h -${CMAKE_CURRENT_LIST_DIR}/RicfExportSnapshots.h -${CMAKE_CURRENT_LIST_DIR}/RicfExportWellPathCompletions.h -${CMAKE_CURRENT_LIST_DIR}/RicfLoadCase.h -${CMAKE_CURRENT_LIST_DIR}/RicfOpenProject.h -${CMAKE_CURRENT_LIST_DIR}/RicfReplaceCase.h -${CMAKE_CURRENT_LIST_DIR}/RicfReplaceSourceCases.h -${CMAKE_CURRENT_LIST_DIR}/RicfRunOctaveScript.h -${CMAKE_CURRENT_LIST_DIR}/RicfSetExportFolder.h -${CMAKE_CURRENT_LIST_DIR}/RicfSetMainWindowSize.h -${CMAKE_CURRENT_LIST_DIR}/RicfSetPlotWindowSize.h -${CMAKE_CURRENT_LIST_DIR}/RicfSetStartDir.h -${CMAKE_CURRENT_LIST_DIR}/RicfSetTimeStep.h -${CMAKE_CURRENT_LIST_DIR}/RicfScaleFractureTemplate.h -${CMAKE_CURRENT_LIST_DIR}/RicfSetFractureContainment.h -${CMAKE_CURRENT_LIST_DIR}/RicfCreateMultipleFractures.h -${CMAKE_CURRENT_LIST_DIR}/RicfExportWellPaths.h -${CMAKE_CURRENT_LIST_DIR}/RicfExportVisibleCells.h -${CMAKE_CURRENT_LIST_DIR}/RicfExportPropertyInViews.h -${CMAKE_CURRENT_LIST_DIR}/RicfExportLgrForCompletions.h -${CMAKE_CURRENT_LIST_DIR}/RicfCreateLgrForCompletions.h -${CMAKE_CURRENT_LIST_DIR}/RicfApplicationTools.h -${CMAKE_CURRENT_LIST_DIR}/RicfCreateSaturationPressurePlots.h -${CMAKE_CURRENT_LIST_DIR}/RicfExportFlowCharacteristics.h -${CMAKE_CURRENT_LIST_DIR}/RicfCreateGridCaseGroup.h -${CMAKE_CURRENT_LIST_DIR}/RicfCreateStatisticsCase.h -${CMAKE_CURRENT_LIST_DIR}/RicfCreateView.h -${CMAKE_CURRENT_LIST_DIR}/RicfCloneView.h -${CMAKE_CURRENT_LIST_DIR}/RicfNewWellBoreStabilityPlotFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicfImportWellLogFiles.h -${CMAKE_CURRENT_LIST_DIR}/RicfImportFormationNames.h -${CMAKE_CURRENT_LIST_DIR}/RicfExportWellLogPlotData.h -) +set(SOURCE_GROUP_SOURCE_FILES + ${CMAKE_CURRENT_LIST_DIR}/RicfCloseProject.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicfCommandFileExecutor.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicfComputeCaseGroupStatistics.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicfExportMsw.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicfExportMultiCaseSnapshots.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicfExportProperty.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicfExportSimWellFractureCompletions.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicfExportSnapshots.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicfExportWellPathCompletions.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicfLoadCase.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicfOpenProject.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicfReplaceCase.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicfReplaceSourceCases.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicfRunOctaveScript.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicfSetExportFolder.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicfSetMainWindowSize.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicfSetPlotWindowSize.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicfSetStartDir.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicfSetTimeStep.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicfScaleFractureTemplate.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicfSetFractureContainment.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicfCreateMultipleFractures.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicfExportWellPaths.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicfExportVisibleCells.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicfExportPropertyInViews.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicfExportLgrForCompletions.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicfCreateLgrForCompletions.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicfApplicationTools.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicfCreateSaturationPressurePlots.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicfExportFlowCharacteristics.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicfCreateGridCaseGroup.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicfCreateStatisticsCase.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicfCreateView.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicfCloneView.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicfCreateWellBoreStabilityPlotFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicfImportWellLogFiles.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicfImportFormationNames.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicfExportWellLogPlotData.cpp) -set (SOURCE_GROUP_SOURCE_FILES -${CMAKE_CURRENT_LIST_DIR}/RicfCloseProject.cpp -${CMAKE_CURRENT_LIST_DIR}/RicfCommandFileExecutor.cpp -${CMAKE_CURRENT_LIST_DIR}/RicfComputeCaseGroupStatistics.cpp -${CMAKE_CURRENT_LIST_DIR}/RicfExportMsw.cpp -${CMAKE_CURRENT_LIST_DIR}/RicfExportMultiCaseSnapshots.cpp -${CMAKE_CURRENT_LIST_DIR}/RicfExportProperty.cpp -${CMAKE_CURRENT_LIST_DIR}/RicfExportSimWellFractureCompletions.cpp -${CMAKE_CURRENT_LIST_DIR}/RicfExportSnapshots.cpp -${CMAKE_CURRENT_LIST_DIR}/RicfExportWellPathCompletions.cpp -${CMAKE_CURRENT_LIST_DIR}/RicfLoadCase.cpp -${CMAKE_CURRENT_LIST_DIR}/RicfOpenProject.cpp -${CMAKE_CURRENT_LIST_DIR}/RicfReplaceCase.cpp -${CMAKE_CURRENT_LIST_DIR}/RicfReplaceSourceCases.cpp -${CMAKE_CURRENT_LIST_DIR}/RicfRunOctaveScript.cpp -${CMAKE_CURRENT_LIST_DIR}/RicfSetExportFolder.cpp -${CMAKE_CURRENT_LIST_DIR}/RicfSetMainWindowSize.cpp -${CMAKE_CURRENT_LIST_DIR}/RicfSetPlotWindowSize.cpp -${CMAKE_CURRENT_LIST_DIR}/RicfSetStartDir.cpp -${CMAKE_CURRENT_LIST_DIR}/RicfSetTimeStep.cpp -${CMAKE_CURRENT_LIST_DIR}/RicfScaleFractureTemplate.cpp -${CMAKE_CURRENT_LIST_DIR}/RicfSetFractureContainment.cpp -${CMAKE_CURRENT_LIST_DIR}/RicfCreateMultipleFractures.cpp -${CMAKE_CURRENT_LIST_DIR}/RicfExportWellPaths.cpp -${CMAKE_CURRENT_LIST_DIR}/RicfExportVisibleCells.cpp -${CMAKE_CURRENT_LIST_DIR}/RicfExportPropertyInViews.cpp -${CMAKE_CURRENT_LIST_DIR}/RicfExportLgrForCompletions.cpp -${CMAKE_CURRENT_LIST_DIR}/RicfCreateLgrForCompletions.cpp -${CMAKE_CURRENT_LIST_DIR}/RicfApplicationTools.cpp -${CMAKE_CURRENT_LIST_DIR}/RicfCreateSaturationPressurePlots.cpp -${CMAKE_CURRENT_LIST_DIR}/RicfExportFlowCharacteristics.cpp -${CMAKE_CURRENT_LIST_DIR}/RicfCreateGridCaseGroup.cpp -${CMAKE_CURRENT_LIST_DIR}/RicfCreateStatisticsCase.cpp -${CMAKE_CURRENT_LIST_DIR}/RicfCreateView.cpp -${CMAKE_CURRENT_LIST_DIR}/RicfCloneView.cpp -${CMAKE_CURRENT_LIST_DIR}/RicfCreateWellBoreStabilityPlotFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicfImportWellLogFiles.cpp -${CMAKE_CURRENT_LIST_DIR}/RicfImportFormationNames.cpp -${CMAKE_CURRENT_LIST_DIR}/RicfExportWellLogPlotData.cpp -) +list(APPEND CODE_HEADER_FILES ${SOURCE_GROUP_HEADER_FILES}) -list(APPEND CODE_HEADER_FILES -${SOURCE_GROUP_HEADER_FILES} -) +list(APPEND CODE_SOURCE_FILES ${SOURCE_GROUP_SOURCE_FILES}) -list(APPEND CODE_SOURCE_FILES -${SOURCE_GROUP_SOURCE_FILES} -) - -source_group( "CommandFileInterface" FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake ) +source_group( + "CommandFileInterface" + FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} + ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake) diff --git a/ApplicationLibCode/CommandFileInterface/Core/CMakeLists_files.cmake b/ApplicationLibCode/CommandFileInterface/Core/CMakeLists_files.cmake index 89b16d4d82..d0896cd12d 100644 --- a/ApplicationLibCode/CommandFileInterface/Core/CMakeLists_files.cmake +++ b/ApplicationLibCode/CommandFileInterface/Core/CMakeLists_files.cmake @@ -1,20 +1,15 @@ +set(SOURCE_GROUP_HEADER_FILES ${CMAKE_CURRENT_LIST_DIR}/RicfCommandObject.h + ${CMAKE_CURRENT_LIST_DIR}/RifcCommandFileReader.h) -set (SOURCE_GROUP_HEADER_FILES -${CMAKE_CURRENT_LIST_DIR}/RicfCommandObject.h -${CMAKE_CURRENT_LIST_DIR}/RifcCommandFileReader.h -) +set(SOURCE_GROUP_SOURCE_FILES + ${CMAKE_CURRENT_LIST_DIR}/RicfCommandObject.cpp + ${CMAKE_CURRENT_LIST_DIR}/RifcCommandFileReader.cpp) -set (SOURCE_GROUP_SOURCE_FILES -${CMAKE_CURRENT_LIST_DIR}/RicfCommandObject.cpp -${CMAKE_CURRENT_LIST_DIR}/RifcCommandFileReader.cpp -) +list(APPEND CODE_HEADER_FILES ${SOURCE_GROUP_HEADER_FILES}) -list(APPEND CODE_HEADER_FILES -${SOURCE_GROUP_HEADER_FILES} -) +list(APPEND CODE_SOURCE_FILES ${SOURCE_GROUP_SOURCE_FILES}) -list(APPEND CODE_SOURCE_FILES -${SOURCE_GROUP_SOURCE_FILES} -) - -source_group( "CommandFileInterface\\Core" FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake ) +source_group( + "CommandFileInterface\\Core" + FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} + ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake) diff --git a/ApplicationLibCode/Commands/AnalysisPlotCommands/CMakeLists_files.cmake b/ApplicationLibCode/Commands/AnalysisPlotCommands/CMakeLists_files.cmake index 63187ab401..83ea2c1d7d 100644 --- a/ApplicationLibCode/Commands/AnalysisPlotCommands/CMakeLists_files.cmake +++ b/ApplicationLibCode/Commands/AnalysisPlotCommands/CMakeLists_files.cmake @@ -1,20 +1,16 @@ +set(SOURCE_GROUP_HEADER_FILES + ${CMAKE_CURRENT_LIST_DIR}/RicNewAnalysisPlotFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicNewPlotDataFilterFeature.h) -set (SOURCE_GROUP_HEADER_FILES -${CMAKE_CURRENT_LIST_DIR}/RicNewAnalysisPlotFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicNewPlotDataFilterFeature.h -) +set(SOURCE_GROUP_SOURCE_FILES + ${CMAKE_CURRENT_LIST_DIR}/RicNewAnalysisPlotFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicNewPlotDataFilterFeature.cpp) -set (SOURCE_GROUP_SOURCE_FILES -${CMAKE_CURRENT_LIST_DIR}/RicNewAnalysisPlotFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicNewPlotDataFilterFeature.cpp -) +list(APPEND COMMAND_COMMAND_CODE_HEADER_FILES ${SOURCE_GROUP_HEADER_FILES}) -list(APPEND COMMAND_COMMAND_CODE_HEADER_FILES -${SOURCE_GROUP_HEADER_FILES} -) +list(APPEND COMMAND_CODE_SOURCE_FILES ${SOURCE_GROUP_SOURCE_FILES}) -list(APPEND COMMAND_CODE_SOURCE_FILES -${SOURCE_GROUP_SOURCE_FILES} -) - -source_group( "CommandFeature\\AnalysisPlotCommands" FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake ) +source_group( + "CommandFeature\\AnalysisPlotCommands" + FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} + ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake) diff --git a/ApplicationLibCode/Commands/AnnotationCommands/CMakeLists_files.cmake b/ApplicationLibCode/Commands/AnnotationCommands/CMakeLists_files.cmake index b41f769daa..4e68f1e271 100644 --- a/ApplicationLibCode/Commands/AnnotationCommands/CMakeLists_files.cmake +++ b/ApplicationLibCode/Commands/AnnotationCommands/CMakeLists_files.cmake @@ -1,34 +1,28 @@ +set(SOURCE_GROUP_HEADER_FILES + ${CMAKE_CURRENT_LIST_DIR}/RicImportPolylinesAnnotationFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicCreateTextAnnotationFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicCreateTextAnnotationIn3dViewFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicCreateReachCircleAnnotationFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicCreateUserDefinedPolylinesAnnotationFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicTextAnnotation3dEditor.h) -set (SOURCE_GROUP_HEADER_FILES -${CMAKE_CURRENT_LIST_DIR}/RicImportPolylinesAnnotationFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicCreateTextAnnotationFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicCreateTextAnnotationIn3dViewFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicCreateReachCircleAnnotationFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicCreateUserDefinedPolylinesAnnotationFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicTextAnnotation3dEditor.h -) +set(SOURCE_GROUP_SOURCE_FILES + ${CMAKE_CURRENT_LIST_DIR}/RicImportPolylinesAnnotationFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicCreateTextAnnotationFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicCreateTextAnnotationIn3dViewFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicCreateReachCircleAnnotationFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicCreateUserDefinedPolylinesAnnotationFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicTextAnnotation3dEditor.cpp) -set (SOURCE_GROUP_SOURCE_FILES -${CMAKE_CURRENT_LIST_DIR}/RicImportPolylinesAnnotationFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicCreateTextAnnotationFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicCreateTextAnnotationIn3dViewFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicCreateReachCircleAnnotationFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicCreateUserDefinedPolylinesAnnotationFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicTextAnnotation3dEditor.cpp -) +list(APPEND COMMAND_CODE_HEADER_FILES ${SOURCE_GROUP_HEADER_FILES}) -list(APPEND COMMAND_CODE_HEADER_FILES -${SOURCE_GROUP_HEADER_FILES} -) +list(APPEND COMMAND_CODE_SOURCE_FILES ${SOURCE_GROUP_SOURCE_FILES}) -list(APPEND COMMAND_CODE_SOURCE_FILES -${SOURCE_GROUP_SOURCE_FILES} -) +set(COMMAND_QT_MOC_HEADERS + ${COMMAND_QT_MOC_HEADERS} + ${CMAKE_CURRENT_LIST_DIR}/RicTextAnnotation3dEditor.h) -set (COMMAND_QT_MOC_HEADERS -${COMMAND_QT_MOC_HEADERS} -${CMAKE_CURRENT_LIST_DIR}/RicTextAnnotation3dEditor.h -) - - -source_group( "CommandFeature\\AnnotationCommands" FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake ) +source_group( + "CommandFeature\\AnnotationCommands" + FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} + ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake) diff --git a/ApplicationLibCode/Commands/ApplicationCommands/CMakeLists_files.cmake b/ApplicationLibCode/Commands/ApplicationCommands/CMakeLists_files.cmake index 9773c8b899..5c46f26c48 100644 --- a/ApplicationLibCode/Commands/ApplicationCommands/CMakeLists_files.cmake +++ b/ApplicationLibCode/Commands/ApplicationCommands/CMakeLists_files.cmake @@ -1,61 +1,54 @@ +set(SOURCE_GROUP_HEADER_FILES + ${CMAKE_CURRENT_LIST_DIR}/RicLaunchUnitTestsFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicShowPlotWindowFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicShowMainWindowFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicTileWindowsFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicOpenProjectFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicOpenLastUsedFileFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicSaveProjectFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicSaveProjectAsFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicExitApplicationFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicCloseProjectFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicHelpFeatures.h + ${CMAKE_CURRENT_LIST_DIR}/RicEditPreferencesFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicShowPlotDataFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicLaunchRegressionTestsFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicRunCommandFileFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicShowMemoryCleanupDialogFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicDefaultDockConfigEclipseFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicDefaultDockConfigGeoMechFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicExportObjectAndFieldKeywordsFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicSaveProjectNoGlobalPathsFeature.h) -set (SOURCE_GROUP_HEADER_FILES -${CMAKE_CURRENT_LIST_DIR}/RicLaunchUnitTestsFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicShowPlotWindowFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicShowMainWindowFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicTileWindowsFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicOpenProjectFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicOpenLastUsedFileFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicSaveProjectFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicSaveProjectAsFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicExitApplicationFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicCloseProjectFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicHelpFeatures.h -${CMAKE_CURRENT_LIST_DIR}/RicEditPreferencesFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicShowPlotDataFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicLaunchRegressionTestsFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicRunCommandFileFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicShowMemoryCleanupDialogFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicDefaultDockConfigEclipseFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicDefaultDockConfigGeoMechFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicExportObjectAndFieldKeywordsFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicSaveProjectNoGlobalPathsFeature.h -) +set(SOURCE_GROUP_SOURCE_FILES + ${CMAKE_CURRENT_LIST_DIR}/RicLaunchUnitTestsFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicShowPlotWindowFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicShowMainWindowFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicTileWindowsFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicOpenProjectFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicOpenLastUsedFileFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicSaveProjectFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicSaveProjectAsFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicExitApplicationFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicCloseProjectFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicHelpFeatures.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicEditPreferencesFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicShowPlotDataFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicLaunchRegressionTestsFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicRunCommandFileFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicShowMemoryCleanupDialogFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicDefaultDockConfigEclipseFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicDefaultDockConfigGeoMechFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicExportObjectAndFieldKeywordsFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicSaveProjectNoGlobalPathsFeature.cpp) -set (SOURCE_GROUP_SOURCE_FILES -${CMAKE_CURRENT_LIST_DIR}/RicLaunchUnitTestsFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicShowPlotWindowFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicShowMainWindowFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicTileWindowsFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicOpenProjectFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicOpenLastUsedFileFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicSaveProjectFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicSaveProjectAsFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicExitApplicationFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicCloseProjectFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicHelpFeatures.cpp -${CMAKE_CURRENT_LIST_DIR}/RicEditPreferencesFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicShowPlotDataFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicLaunchRegressionTestsFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicRunCommandFileFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicShowMemoryCleanupDialogFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicDefaultDockConfigEclipseFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicDefaultDockConfigGeoMechFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicExportObjectAndFieldKeywordsFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicSaveProjectNoGlobalPathsFeature.cpp -) +list(APPEND COMMAND_CODE_HEADER_FILES ${SOURCE_GROUP_HEADER_FILES}) -list(APPEND COMMAND_CODE_HEADER_FILES -${SOURCE_GROUP_HEADER_FILES} -) +list(APPEND COMMAND_CODE_SOURCE_FILES ${SOURCE_GROUP_SOURCE_FILES}) -list(APPEND COMMAND_CODE_SOURCE_FILES -${SOURCE_GROUP_SOURCE_FILES} -) +set(COMMAND_QT_MOC_HEADERS ${COMMAND_QT_MOC_HEADERS}) -set (COMMAND_QT_MOC_HEADERS -${COMMAND_QT_MOC_HEADERS} -) - - -source_group( "CommandFeature\\Application" FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake ) +source_group( + "CommandFeature\\Application" + FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} + ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake) diff --git a/ApplicationLibCode/Commands/CMakeLists_files.cmake b/ApplicationLibCode/Commands/CMakeLists_files.cmake index 4d431fc271..246d230d08 100644 --- a/ApplicationLibCode/Commands/CMakeLists_files.cmake +++ b/ApplicationLibCode/Commands/CMakeLists_files.cmake @@ -1,198 +1,178 @@ - -set (SOURCE_GROUP_HEADER_FILES -${CMAKE_CURRENT_LIST_DIR}/RicWellLogTools.h -${CMAKE_CURRENT_LIST_DIR}/RicCloseCaseFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicCloseSummaryCaseFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicCloseSummaryCaseInCollectionFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicCloseObservedDataFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicCreateSummaryCaseCollectionFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicNewViewFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicNewContourMapViewFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicImportFaciesFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicImportFormationNamesFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicReloadFormationNamesFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicReloadWellPathFormationNamesFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicHideIntersectionFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicHideIntersectionBoxFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicImportElementPropertyFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicSelectColorResult.h - -${CMAKE_CURRENT_LIST_DIR}/RicTogglePerspectiveViewFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicImportSummaryCaseFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicImportSummaryCasesFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicImportObservedDataFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicImportObservedDataInMenuFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicImportObservedFmuDataFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicImportObservedFmuDataInMenuFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicImportGeneralDataFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicExportFeatureImpl.h - -${CMAKE_CURRENT_LIST_DIR}/RicSelectOrCreateViewFeatureImpl.h - -${CMAKE_CURRENT_LIST_DIR}/RicPickEventHandler.h -${CMAKE_CURRENT_LIST_DIR}/Ric3dViewPickEventHandler.h -${CMAKE_CURRENT_LIST_DIR}/RicContourMapPickEventHandler.h -${CMAKE_CURRENT_LIST_DIR}/RicVec3dPickEventHandler.h - -# General delete of any object in a child array field -${CMAKE_CURRENT_LIST_DIR}/RicDeleteItemExec.h -${CMAKE_CURRENT_LIST_DIR}/RicDeleteItemExecData.h -${CMAKE_CURRENT_LIST_DIR}/RicDeleteItemFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicDeleteSubItemsFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicDeleteSummaryCaseCollectionFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicDeleteWellMeasurementFilePathFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicReloadWellMeasurementsFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicWellMeasurementImportTools.h -${CMAKE_CURRENT_LIST_DIR}/RicImportElasticPropertiesFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicElasticPropertiesImportTools.h -${CMAKE_CURRENT_LIST_DIR}/RicFaciesPropertiesImportTools.h - -${CMAKE_CURRENT_LIST_DIR}/RicCloseSourSimDataFeature.h - -${CMAKE_CURRENT_LIST_DIR}/RicReloadCaseFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicReplaceCaseFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicReloadSummaryCaseFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicReplaceSummaryCaseFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicFlyToObjectFeature.h - -${CMAKE_CURRENT_LIST_DIR}/RicGridStatisticsDialog.h -${CMAKE_CURRENT_LIST_DIR}/RicShowGridStatisticsFeature.h - -${CMAKE_CURRENT_LIST_DIR}/RicRecursiveFileSearchDialog.h -${CMAKE_CURRENT_LIST_DIR}/RicSummaryCaseRestartDialog.h -${CMAKE_CURRENT_LIST_DIR}/RicImportEnsembleFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicImportSummaryGroupFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicImportEnsembleSurfaceFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicConvertGroupToEnsembleFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicImportEnsembleWellLogsFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicResampleDialog.h -${CMAKE_CURRENT_LIST_DIR}/RicCreateTemporaryLgrFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicDeleteTemporaryLgrsFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicExportContourMapToTextFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicExportContourMapToTextUi.h -${CMAKE_CURRENT_LIST_DIR}/RicNewMultiPlotFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicExportStimPlanModelToFileFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicStackSelectedCurvesFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicUnstackSelectedCurvesFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicThemeColorEditorFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicNewVfpPlotFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicNewCustomObjectiveFunctionFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicNewCustomObjectiveFunctionWeightFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicNewPressureTableItemFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicDeletePressureTableItemFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicImportGridModelFromSummaryCaseFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicImportGridModelFromSummaryCurveFeature.h -) - - -set (SOURCE_GROUP_SOURCE_FILES -${CMAKE_CURRENT_LIST_DIR}/RicWellLogTools.cpp -${CMAKE_CURRENT_LIST_DIR}/RicCloseCaseFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicCloseSummaryCaseFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicCloseSummaryCaseInCollectionFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicCloseObservedDataFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicCreateSummaryCaseCollectionFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicNewViewFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicNewContourMapViewFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicImportFaciesFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicImportFormationNamesFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicReloadFormationNamesFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicReloadWellPathFormationNamesFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicHideIntersectionFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicHideIntersectionBoxFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicImportElementPropertyFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicSelectColorResult.cpp - -${CMAKE_CURRENT_LIST_DIR}/RicTogglePerspectiveViewFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicImportSummaryCaseFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicImportSummaryCasesFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicImportObservedDataFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicImportObservedDataInMenuFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicImportObservedFmuDataFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicImportObservedFmuDataInMenuFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicImportGeneralDataFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicExportFeatureImpl.cpp - -${CMAKE_CURRENT_LIST_DIR}/RicSelectOrCreateViewFeatureImpl.cpp - -${CMAKE_CURRENT_LIST_DIR}/Ric3dViewPickEventHandler.cpp -${CMAKE_CURRENT_LIST_DIR}/RicContourMapPickEventHandler.cpp -${CMAKE_CURRENT_LIST_DIR}/RicVec3dPickEventHandler.cpp - -# General delete of any object in a child array field -${CMAKE_CURRENT_LIST_DIR}/RicDeleteItemExec.cpp -${CMAKE_CURRENT_LIST_DIR}/RicDeleteItemExecData.cpp -${CMAKE_CURRENT_LIST_DIR}/RicDeleteItemFeature.cpp - -${CMAKE_CURRENT_LIST_DIR}/RicDeleteSubItemsFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicDeleteSummaryCaseCollectionFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicDeleteWellMeasurementFilePathFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicReloadWellMeasurementsFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicWellMeasurementImportTools.cpp -${CMAKE_CURRENT_LIST_DIR}/RicImportElasticPropertiesFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicElasticPropertiesImportTools.cpp -${CMAKE_CURRENT_LIST_DIR}/RicFaciesPropertiesImportTools.cpp - -${CMAKE_CURRENT_LIST_DIR}/RicCloseSourSimDataFeature.cpp - -${CMAKE_CURRENT_LIST_DIR}/RicReloadCaseFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicReplaceCaseFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicReloadSummaryCaseFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicReplaceSummaryCaseFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicFlyToObjectFeature.cpp - -${CMAKE_CURRENT_LIST_DIR}/RicGridStatisticsDialog.cpp -${CMAKE_CURRENT_LIST_DIR}/RicShowGridStatisticsFeature.cpp - -${CMAKE_CURRENT_LIST_DIR}/RicRecursiveFileSearchDialog.cpp -${CMAKE_CURRENT_LIST_DIR}/RicSummaryCaseRestartDialog.cpp -${CMAKE_CURRENT_LIST_DIR}/RicImportEnsembleFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicImportSummaryGroupFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicImportEnsembleSurfaceFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicConvertGroupToEnsembleFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicImportEnsembleWellLogsFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicResampleDialog.cpp -${CMAKE_CURRENT_LIST_DIR}/RicCreateTemporaryLgrFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicDeleteTemporaryLgrsFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicExportContourMapToTextFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicExportContourMapToTextUi.cpp -${CMAKE_CURRENT_LIST_DIR}/RicNewMultiPlotFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicExportStimPlanModelToFileFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicStackSelectedCurvesFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicUnstackSelectedCurvesFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicThemeColorEditorFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicNewVfpPlotFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicNewCustomObjectiveFunctionFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicNewCustomObjectiveFunctionWeightFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicNewPressureTableItemFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicDeletePressureTableItemFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicImportGridModelFromSummaryCaseFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicImportGridModelFromSummaryCurveFeature.cpp -) +set(SOURCE_GROUP_HEADER_FILES + ${CMAKE_CURRENT_LIST_DIR}/RicWellLogTools.h + ${CMAKE_CURRENT_LIST_DIR}/RicCloseCaseFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicCloseSummaryCaseFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicCloseSummaryCaseInCollectionFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicCloseObservedDataFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicCreateSummaryCaseCollectionFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicNewViewFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicNewContourMapViewFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicImportFaciesFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicImportFormationNamesFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicReloadFormationNamesFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicReloadWellPathFormationNamesFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicHideIntersectionFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicHideIntersectionBoxFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicImportElementPropertyFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicSelectColorResult.h + ${CMAKE_CURRENT_LIST_DIR}/RicTogglePerspectiveViewFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicImportSummaryCaseFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicImportSummaryCasesFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicImportObservedDataFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicImportObservedDataInMenuFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicImportObservedFmuDataFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicImportObservedFmuDataInMenuFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicImportGeneralDataFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicExportFeatureImpl.h + ${CMAKE_CURRENT_LIST_DIR}/RicSelectOrCreateViewFeatureImpl.h + ${CMAKE_CURRENT_LIST_DIR}/RicPickEventHandler.h + ${CMAKE_CURRENT_LIST_DIR}/Ric3dViewPickEventHandler.h + ${CMAKE_CURRENT_LIST_DIR}/RicContourMapPickEventHandler.h + ${CMAKE_CURRENT_LIST_DIR}/RicVec3dPickEventHandler.h + # General delete of any object in a child array field + ${CMAKE_CURRENT_LIST_DIR}/RicDeleteItemExec.h + ${CMAKE_CURRENT_LIST_DIR}/RicDeleteItemExecData.h + ${CMAKE_CURRENT_LIST_DIR}/RicDeleteItemFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicDeleteSubItemsFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicDeleteSummaryCaseCollectionFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicDeleteWellMeasurementFilePathFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicReloadWellMeasurementsFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicWellMeasurementImportTools.h + ${CMAKE_CURRENT_LIST_DIR}/RicImportElasticPropertiesFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicElasticPropertiesImportTools.h + ${CMAKE_CURRENT_LIST_DIR}/RicFaciesPropertiesImportTools.h + ${CMAKE_CURRENT_LIST_DIR}/RicCloseSourSimDataFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicReloadCaseFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicReplaceCaseFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicReloadSummaryCaseFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicReplaceSummaryCaseFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicFlyToObjectFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicGridStatisticsDialog.h + ${CMAKE_CURRENT_LIST_DIR}/RicShowGridStatisticsFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicRecursiveFileSearchDialog.h + ${CMAKE_CURRENT_LIST_DIR}/RicSummaryCaseRestartDialog.h + ${CMAKE_CURRENT_LIST_DIR}/RicImportEnsembleFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicImportSummaryGroupFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicImportEnsembleSurfaceFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicConvertGroupToEnsembleFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicImportEnsembleWellLogsFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicResampleDialog.h + ${CMAKE_CURRENT_LIST_DIR}/RicCreateTemporaryLgrFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicDeleteTemporaryLgrsFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicExportContourMapToTextFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicExportContourMapToTextUi.h + ${CMAKE_CURRENT_LIST_DIR}/RicNewMultiPlotFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicExportStimPlanModelToFileFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicStackSelectedCurvesFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicUnstackSelectedCurvesFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicThemeColorEditorFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicNewVfpPlotFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicNewCustomObjectiveFunctionFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicNewCustomObjectiveFunctionWeightFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicNewPressureTableItemFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicDeletePressureTableItemFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicImportGridModelFromSummaryCaseFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicImportGridModelFromSummaryCurveFeature.h) + +set(SOURCE_GROUP_SOURCE_FILES + ${CMAKE_CURRENT_LIST_DIR}/RicWellLogTools.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicCloseCaseFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicCloseSummaryCaseFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicCloseSummaryCaseInCollectionFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicCloseObservedDataFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicCreateSummaryCaseCollectionFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicNewViewFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicNewContourMapViewFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicImportFaciesFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicImportFormationNamesFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicReloadFormationNamesFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicReloadWellPathFormationNamesFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicHideIntersectionFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicHideIntersectionBoxFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicImportElementPropertyFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicSelectColorResult.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicTogglePerspectiveViewFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicImportSummaryCaseFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicImportSummaryCasesFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicImportObservedDataFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicImportObservedDataInMenuFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicImportObservedFmuDataFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicImportObservedFmuDataInMenuFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicImportGeneralDataFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicExportFeatureImpl.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicSelectOrCreateViewFeatureImpl.cpp + ${CMAKE_CURRENT_LIST_DIR}/Ric3dViewPickEventHandler.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicContourMapPickEventHandler.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicVec3dPickEventHandler.cpp + # General delete of any object in a child array field + ${CMAKE_CURRENT_LIST_DIR}/RicDeleteItemExec.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicDeleteItemExecData.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicDeleteItemFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicDeleteSubItemsFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicDeleteSummaryCaseCollectionFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicDeleteWellMeasurementFilePathFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicReloadWellMeasurementsFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicWellMeasurementImportTools.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicImportElasticPropertiesFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicElasticPropertiesImportTools.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicFaciesPropertiesImportTools.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicCloseSourSimDataFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicReloadCaseFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicReplaceCaseFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicReloadSummaryCaseFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicReplaceSummaryCaseFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicFlyToObjectFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicGridStatisticsDialog.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicShowGridStatisticsFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicRecursiveFileSearchDialog.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicSummaryCaseRestartDialog.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicImportEnsembleFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicImportSummaryGroupFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicImportEnsembleSurfaceFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicConvertGroupToEnsembleFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicImportEnsembleWellLogsFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicResampleDialog.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicCreateTemporaryLgrFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicDeleteTemporaryLgrsFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicExportContourMapToTextFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicExportContourMapToTextUi.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicNewMultiPlotFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicExportStimPlanModelToFileFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicStackSelectedCurvesFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicUnstackSelectedCurvesFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicThemeColorEditorFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicNewVfpPlotFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicNewCustomObjectiveFunctionFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicNewCustomObjectiveFunctionWeightFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicNewPressureTableItemFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicDeletePressureTableItemFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicImportGridModelFromSummaryCaseFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicImportGridModelFromSummaryCurveFeature.cpp) if(Qt5Charts_FOUND) - list(APPEND SOURCE_GROUP_HEADER_FILES - ${CMAKE_CURRENT_LIST_DIR}/RicCreateEnsembleFractureStatisticsPlotFeature.h - ${CMAKE_CURRENT_LIST_DIR}/RicCreateGridStatisticsPlotFeature.h) - list(APPEND SOURCE_GROUP_SOURCE_FILES - ${CMAKE_CURRENT_LIST_DIR}/RicCreateEnsembleFractureStatisticsPlotFeature.cpp - ${CMAKE_CURRENT_LIST_DIR}/RicCreateGridStatisticsPlotFeature.cpp) + list( + APPEND SOURCE_GROUP_HEADER_FILES + ${CMAKE_CURRENT_LIST_DIR}/RicCreateEnsembleFractureStatisticsPlotFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicCreateGridStatisticsPlotFeature.h) + list( + APPEND SOURCE_GROUP_SOURCE_FILES + ${CMAKE_CURRENT_LIST_DIR}/RicCreateEnsembleFractureStatisticsPlotFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicCreateGridStatisticsPlotFeature.cpp) endif() +list(APPEND COMMAND_CODE_HEADER_FILES ${SOURCE_GROUP_HEADER_FILES}) -list(APPEND COMMAND_CODE_HEADER_FILES -${SOURCE_GROUP_HEADER_FILES} -) - -list(APPEND COMMAND_CODE_SOURCE_FILES -${SOURCE_GROUP_SOURCE_FILES} -) +list(APPEND COMMAND_CODE_SOURCE_FILES ${SOURCE_GROUP_SOURCE_FILES}) -list(APPEND COMMAND_QT_MOC_HEADERS -${CMAKE_CURRENT_LIST_DIR}/RicGridStatisticsDialog.h -${CMAKE_CURRENT_LIST_DIR}/RicRecursiveFileSearchDialog.h -${CMAKE_CURRENT_LIST_DIR}/RicSummaryCaseRestartDialog.h -${CMAKE_CURRENT_LIST_DIR}/RicResampleDialog.h -) +list( + APPEND + COMMAND_QT_MOC_HEADERS + ${CMAKE_CURRENT_LIST_DIR}/RicGridStatisticsDialog.h + ${CMAKE_CURRENT_LIST_DIR}/RicRecursiveFileSearchDialog.h + ${CMAKE_CURRENT_LIST_DIR}/RicSummaryCaseRestartDialog.h + ${CMAKE_CURRENT_LIST_DIR}/RicResampleDialog.h) -source_group( "CommandFeature" FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake ) +source_group( + "CommandFeature" + FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} + ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake) diff --git a/ApplicationLibCode/Commands/CellFilterCommands/CMakeLists_files.cmake b/ApplicationLibCode/Commands/CellFilterCommands/CMakeLists_files.cmake index 554962f314..5df3d96aac 100644 --- a/ApplicationLibCode/Commands/CellFilterCommands/CMakeLists_files.cmake +++ b/ApplicationLibCode/Commands/CellFilterCommands/CMakeLists_files.cmake @@ -1,35 +1,30 @@ +set(SOURCE_GROUP_HEADER_FILES + ${CMAKE_CURRENT_LIST_DIR}/RicNewPolygonFilterFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicNewUserDefinedFilterFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicNewCellRangeFilterFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicNewRangeFilterSliceFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicNewRangeFilterSliceIFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicNewRangeFilterSliceJFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicNewRangeFilterSliceKFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicNewRangeFilterSlice3dviewFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicNewPolygonFilter3dviewFeature.h) -set (SOURCE_GROUP_HEADER_FILES -${CMAKE_CURRENT_LIST_DIR}/RicNewPolygonFilterFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicNewUserDefinedFilterFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicNewCellRangeFilterFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicNewRangeFilterSliceFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicNewRangeFilterSliceIFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicNewRangeFilterSliceJFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicNewRangeFilterSliceKFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicNewRangeFilterSlice3dviewFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicNewPolygonFilter3dviewFeature.h -) +set(SOURCE_GROUP_SOURCE_FILES + ${CMAKE_CURRENT_LIST_DIR}/RicNewPolygonFilterFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicNewUserDefinedFilterFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicNewCellRangeFilterFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicNewRangeFilterSliceFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicNewRangeFilterSliceIFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicNewRangeFilterSliceJFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicNewRangeFilterSliceKFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicNewRangeFilterSlice3dviewFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicNewPolygonFilter3dviewFeature.cpp) -set (SOURCE_GROUP_SOURCE_FILES -${CMAKE_CURRENT_LIST_DIR}/RicNewPolygonFilterFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicNewUserDefinedFilterFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicNewCellRangeFilterFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicNewRangeFilterSliceFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicNewRangeFilterSliceIFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicNewRangeFilterSliceJFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicNewRangeFilterSliceKFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicNewRangeFilterSlice3dviewFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicNewPolygonFilter3dviewFeature.cpp -) +list(APPEND COMMAND_CODE_HEADER_FILES ${SOURCE_GROUP_HEADER_FILES}) -list(APPEND COMMAND_CODE_HEADER_FILES -${SOURCE_GROUP_HEADER_FILES} -) +list(APPEND COMMAND_CODE_SOURCE_FILES ${SOURCE_GROUP_SOURCE_FILES}) -list(APPEND COMMAND_CODE_SOURCE_FILES -${SOURCE_GROUP_SOURCE_FILES} -) - - -source_group( "CommandFeature\\CellFilterCommands" FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake ) +source_group( + "CommandFeature\\CellFilterCommands" + FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} + ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake) diff --git a/ApplicationLibCode/Commands/ColorLegendCommands/CMakeLists_files.cmake b/ApplicationLibCode/Commands/ColorLegendCommands/CMakeLists_files.cmake index 52591faa88..31f5cec93b 100644 --- a/ApplicationLibCode/Commands/ColorLegendCommands/CMakeLists_files.cmake +++ b/ApplicationLibCode/Commands/ColorLegendCommands/CMakeLists_files.cmake @@ -1,25 +1,20 @@ +set(SOURCE_GROUP_HEADER_FILES + ${CMAKE_CURRENT_LIST_DIR}/RicImportColorCategoriesFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicCopyStandardLegendFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicInsertColorLegendFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicInsertColorLegendItemFeature.h) -set (SOURCE_GROUP_HEADER_FILES -${CMAKE_CURRENT_LIST_DIR}/RicImportColorCategoriesFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicCopyStandardLegendFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicInsertColorLegendFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicInsertColorLegendItemFeature.h -) +set(SOURCE_GROUP_SOURCE_FILES + ${CMAKE_CURRENT_LIST_DIR}/RicImportColorCategoriesFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicCopyStandardLegendFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicInsertColorLegendFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicInsertColorLegendItemFeature.cpp) -set (SOURCE_GROUP_SOURCE_FILES -${CMAKE_CURRENT_LIST_DIR}/RicImportColorCategoriesFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicCopyStandardLegendFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicInsertColorLegendFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicInsertColorLegendItemFeature.cpp -) +list(APPEND COMMAND_CODE_HEADER_FILES ${SOURCE_GROUP_HEADER_FILES}) +list(APPEND COMMAND_CODE_SOURCE_FILES ${SOURCE_GROUP_SOURCE_FILES}) -list(APPEND COMMAND_CODE_HEADER_FILES -${SOURCE_GROUP_HEADER_FILES} -) - -list(APPEND COMMAND_CODE_SOURCE_FILES -${SOURCE_GROUP_SOURCE_FILES} -) - -source_group( "CommandFeature\\ColorLegend" FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake ) +source_group( + "CommandFeature\\ColorLegend" + FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} + ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake) diff --git a/ApplicationLibCode/Commands/CompletionCommands/CMakeLists_files.cmake b/ApplicationLibCode/Commands/CompletionCommands/CMakeLists_files.cmake index e1fdfbe6ff..3df3504ed2 100644 --- a/ApplicationLibCode/Commands/CompletionCommands/CMakeLists_files.cmake +++ b/ApplicationLibCode/Commands/CompletionCommands/CMakeLists_files.cmake @@ -1,43 +1,38 @@ +set(SOURCE_GROUP_HEADER_FILES + ${CMAKE_CURRENT_LIST_DIR}/RicEditPerforationCollectionFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicExportFishbonesLateralsFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicNewFishbonesSubsAtMeasuredDepthFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicNewFishbonesSubsFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicNewPerforationIntervalFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicNewPerforationIntervalAtMeasuredDepthFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicNewValveFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicNewValveTemplateFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicNewValveAtMeasuredDepthFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicDeleteValveTemplateFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicWellPathImportPerforationIntervalsFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicNewStimPlanModelPlotFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicImportEnsembleFractureStatisticsFeature.h) -set (SOURCE_GROUP_HEADER_FILES -${CMAKE_CURRENT_LIST_DIR}/RicEditPerforationCollectionFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicExportFishbonesLateralsFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicNewFishbonesSubsAtMeasuredDepthFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicNewFishbonesSubsFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicNewPerforationIntervalFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicNewPerforationIntervalAtMeasuredDepthFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicNewValveFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicNewValveTemplateFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicNewValveAtMeasuredDepthFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicDeleteValveTemplateFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicWellPathImportPerforationIntervalsFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicNewStimPlanModelPlotFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicImportEnsembleFractureStatisticsFeature.h -) +set(SOURCE_GROUP_SOURCE_FILES + ${CMAKE_CURRENT_LIST_DIR}/RicEditPerforationCollectionFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicExportFishbonesLateralsFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicNewFishbonesSubsAtMeasuredDepthFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicNewFishbonesSubsFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicNewPerforationIntervalFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicNewPerforationIntervalAtMeasuredDepthFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicNewValveFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicNewValveTemplateFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicNewValveAtMeasuredDepthFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicDeleteValveTemplateFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicWellPathImportPerforationIntervalsFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicNewStimPlanModelPlotFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicImportEnsembleFractureStatisticsFeature.cpp) -set (SOURCE_GROUP_SOURCE_FILES -${CMAKE_CURRENT_LIST_DIR}/RicEditPerforationCollectionFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicExportFishbonesLateralsFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicNewFishbonesSubsAtMeasuredDepthFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicNewFishbonesSubsFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicNewPerforationIntervalFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicNewPerforationIntervalAtMeasuredDepthFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicNewValveFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicNewValveTemplateFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicNewValveAtMeasuredDepthFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicDeleteValveTemplateFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicWellPathImportPerforationIntervalsFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicNewStimPlanModelPlotFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicImportEnsembleFractureStatisticsFeature.cpp -) +list(APPEND COMMAND_CODE_HEADER_FILES ${SOURCE_GROUP_HEADER_FILES}) +list(APPEND COMMAND_CODE_SOURCE_FILES ${SOURCE_GROUP_SOURCE_FILES}) -list(APPEND COMMAND_CODE_HEADER_FILES -${SOURCE_GROUP_HEADER_FILES} -) - -list(APPEND COMMAND_CODE_SOURCE_FILES -${SOURCE_GROUP_SOURCE_FILES} -) - -source_group( "CommandFeature\\Completion" FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake ) +source_group( + "CommandFeature\\Completion" + FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} + ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake) diff --git a/ApplicationLibCode/Commands/CompletionExportCommands/CMakeLists_files.cmake b/ApplicationLibCode/Commands/CompletionExportCommands/CMakeLists_files.cmake index 0ca9d8905a..5b1fc485c3 100644 --- a/ApplicationLibCode/Commands/CompletionExportCommands/CMakeLists_files.cmake +++ b/ApplicationLibCode/Commands/CompletionExportCommands/CMakeLists_files.cmake @@ -1,61 +1,56 @@ +set(SOURCE_GROUP_HEADER_FILES + ${CMAKE_CURRENT_LIST_DIR}/RicExportCompletionDataSettingsUi.h + ${CMAKE_CURRENT_LIST_DIR}/RicWellPathExportCompletionDataFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicWellPathExportCompletionDataFeatureImpl.h + ${CMAKE_CURRENT_LIST_DIR}/RicWellPathExportMswCompletionsImpl.h + ${CMAKE_CURRENT_LIST_DIR}/RicWellPathExportCompletionsFileTools.h + ${CMAKE_CURRENT_LIST_DIR}/RicFishbonesTransmissibilityCalculationFeatureImp.h + ${CMAKE_CURRENT_LIST_DIR}/RicExportCompletionsWellSegmentsFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicCaseAndFileExportSettingsUi.h + ${CMAKE_CURRENT_LIST_DIR}/RicExportFractureCompletionsImpl.h + ${CMAKE_CURRENT_LIST_DIR}/RicExportCompletionsForVisibleWellPathsFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicExportCompletionsForVisibleSimWellsFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicMswBranch.h + ${CMAKE_CURRENT_LIST_DIR}/RicMswCompletions.h + ${CMAKE_CURRENT_LIST_DIR}/RicMswExportInfo.h + ${CMAKE_CURRENT_LIST_DIR}/RicMswItem.h + ${CMAKE_CURRENT_LIST_DIR}/RicMswSegment.h + ${CMAKE_CURRENT_LIST_DIR}/RicMswSegmentCellIntersection.h + ${CMAKE_CURRENT_LIST_DIR}/RicMswValveAccumulators.h + ${CMAKE_CURRENT_LIST_DIR}/RicWellPathFractureTextReportFeatureImpl.h + ${CMAKE_CURRENT_LIST_DIR}/RicWellPathFractureReportItem.h + ${CMAKE_CURRENT_LIST_DIR}/RicExportCompletionsForTemporaryLgrsFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicMswTableFormatterTools.h) -set (SOURCE_GROUP_HEADER_FILES -${CMAKE_CURRENT_LIST_DIR}/RicExportCompletionDataSettingsUi.h -${CMAKE_CURRENT_LIST_DIR}/RicWellPathExportCompletionDataFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicWellPathExportCompletionDataFeatureImpl.h -${CMAKE_CURRENT_LIST_DIR}/RicWellPathExportMswCompletionsImpl.h -${CMAKE_CURRENT_LIST_DIR}/RicWellPathExportCompletionsFileTools.h -${CMAKE_CURRENT_LIST_DIR}/RicFishbonesTransmissibilityCalculationFeatureImp.h -${CMAKE_CURRENT_LIST_DIR}/RicExportCompletionsWellSegmentsFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicCaseAndFileExportSettingsUi.h -${CMAKE_CURRENT_LIST_DIR}/RicExportFractureCompletionsImpl.h -${CMAKE_CURRENT_LIST_DIR}/RicExportCompletionsForVisibleWellPathsFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicExportCompletionsForVisibleSimWellsFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicMswBranch.h -${CMAKE_CURRENT_LIST_DIR}/RicMswCompletions.h -${CMAKE_CURRENT_LIST_DIR}/RicMswExportInfo.h -${CMAKE_CURRENT_LIST_DIR}/RicMswItem.h -${CMAKE_CURRENT_LIST_DIR}/RicMswSegment.h -${CMAKE_CURRENT_LIST_DIR}/RicMswSegmentCellIntersection.h -${CMAKE_CURRENT_LIST_DIR}/RicMswValveAccumulators.h -${CMAKE_CURRENT_LIST_DIR}/RicWellPathFractureTextReportFeatureImpl.h -${CMAKE_CURRENT_LIST_DIR}/RicWellPathFractureReportItem.h -${CMAKE_CURRENT_LIST_DIR}/RicExportCompletionsForTemporaryLgrsFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicMswTableFormatterTools.h -) +set(SOURCE_GROUP_SOURCE_FILES + ${CMAKE_CURRENT_LIST_DIR}/RicExportCompletionDataSettingsUi.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicWellPathExportCompletionDataFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicWellPathExportCompletionDataFeatureImpl.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicWellPathExportMswCompletionsImpl.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicWellPathExportCompletionsFileTools.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicFishbonesTransmissibilityCalculationFeatureImp.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicExportCompletionsWellSegmentsFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicCaseAndFileExportSettingsUi.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicExportFractureCompletionsImpl.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicExportCompletionsForVisibleWellPathsFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicExportCompletionsForVisibleSimWellsFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicMswBranch.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicMswCompletions.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicMswExportInfo.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicMswItem.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicMswSegment.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicMswSegmentCellIntersection.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicMswValveAccumulators.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicWellPathFractureTextReportFeatureImpl.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicWellPathFractureReportItem.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicExportCompletionsForTemporaryLgrsFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicMswTableFormatterTools.cpp) +list(APPEND COMMAND_CODE_HEADER_FILES ${SOURCE_GROUP_HEADER_FILES}) -set (SOURCE_GROUP_SOURCE_FILES -${CMAKE_CURRENT_LIST_DIR}/RicExportCompletionDataSettingsUi.cpp -${CMAKE_CURRENT_LIST_DIR}/RicWellPathExportCompletionDataFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicWellPathExportCompletionDataFeatureImpl.cpp -${CMAKE_CURRENT_LIST_DIR}/RicWellPathExportMswCompletionsImpl.cpp -${CMAKE_CURRENT_LIST_DIR}/RicWellPathExportCompletionsFileTools.cpp -${CMAKE_CURRENT_LIST_DIR}/RicFishbonesTransmissibilityCalculationFeatureImp.cpp -${CMAKE_CURRENT_LIST_DIR}/RicExportCompletionsWellSegmentsFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicCaseAndFileExportSettingsUi.cpp -${CMAKE_CURRENT_LIST_DIR}/RicExportFractureCompletionsImpl.cpp -${CMAKE_CURRENT_LIST_DIR}/RicExportCompletionsForVisibleWellPathsFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicExportCompletionsForVisibleSimWellsFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicMswBranch.cpp -${CMAKE_CURRENT_LIST_DIR}/RicMswCompletions.cpp -${CMAKE_CURRENT_LIST_DIR}/RicMswExportInfo.cpp -${CMAKE_CURRENT_LIST_DIR}/RicMswItem.cpp -${CMAKE_CURRENT_LIST_DIR}/RicMswSegment.cpp -${CMAKE_CURRENT_LIST_DIR}/RicMswSegmentCellIntersection.cpp -${CMAKE_CURRENT_LIST_DIR}/RicMswValveAccumulators.cpp -${CMAKE_CURRENT_LIST_DIR}/RicWellPathFractureTextReportFeatureImpl.cpp -${CMAKE_CURRENT_LIST_DIR}/RicWellPathFractureReportItem.cpp -${CMAKE_CURRENT_LIST_DIR}/RicExportCompletionsForTemporaryLgrsFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicMswTableFormatterTools.cpp -) +list(APPEND COMMAND_CODE_SOURCE_FILES ${SOURCE_GROUP_SOURCE_FILES}) -list(APPEND COMMAND_CODE_HEADER_FILES -${SOURCE_GROUP_HEADER_FILES} -) - -list(APPEND COMMAND_CODE_SOURCE_FILES -${SOURCE_GROUP_SOURCE_FILES} -) - -source_group( "CommandFeature\\CompletionExport" FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake ) +source_group( + "CommandFeature\\CompletionExport" + FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} + ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake) diff --git a/ApplicationLibCode/Commands/CorrelationPlotCommands/CMakeLists_files.cmake b/ApplicationLibCode/Commands/CorrelationPlotCommands/CMakeLists_files.cmake index b84ad775c0..6e4c75da24 100644 --- a/ApplicationLibCode/Commands/CorrelationPlotCommands/CMakeLists_files.cmake +++ b/ApplicationLibCode/Commands/CorrelationPlotCommands/CMakeLists_files.cmake @@ -1,24 +1,20 @@ +set(SOURCE_GROUP_HEADER_FILES + ${CMAKE_CURRENT_LIST_DIR}/RicNewCorrelationPlotFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicNewCorrelationReportPlotFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicNewCorrelationMatrixPlotFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicNewParameterResultCrossPlotFeature.h) -set (SOURCE_GROUP_HEADER_FILES -${CMAKE_CURRENT_LIST_DIR}/RicNewCorrelationPlotFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicNewCorrelationReportPlotFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicNewCorrelationMatrixPlotFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicNewParameterResultCrossPlotFeature.h -) +set(SOURCE_GROUP_SOURCE_FILES + ${CMAKE_CURRENT_LIST_DIR}/RicNewCorrelationPlotFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicNewCorrelationMatrixPlotFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicNewParameterResultCrossPlotFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicNewCorrelationReportPlotFeature.cpp) -set (SOURCE_GROUP_SOURCE_FILES -${CMAKE_CURRENT_LIST_DIR}/RicNewCorrelationPlotFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicNewCorrelationMatrixPlotFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicNewParameterResultCrossPlotFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicNewCorrelationReportPlotFeature.cpp -) +list(APPEND COMMAND_CODE_HEADER_FILES ${SOURCE_GROUP_HEADER_FILES}) -list(APPEND COMMAND_CODE_HEADER_FILES -${SOURCE_GROUP_HEADER_FILES} -) +list(APPEND COMMAND_CODE_SOURCE_FILES ${SOURCE_GROUP_SOURCE_FILES}) -list(APPEND COMMAND_CODE_SOURCE_FILES -${SOURCE_GROUP_SOURCE_FILES} -) - -source_group( "CommandFeature\\CorrelationPlotCommands" FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake ) +source_group( + "CommandFeature\\CorrelationPlotCommands" + FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} + ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake) diff --git a/ApplicationLibCode/Commands/CrossSectionCommands/CMakeLists_files.cmake b/ApplicationLibCode/Commands/CrossSectionCommands/CMakeLists_files.cmake index 58e57e7d67..113d6910de 100644 --- a/ApplicationLibCode/Commands/CrossSectionCommands/CMakeLists_files.cmake +++ b/ApplicationLibCode/Commands/CrossSectionCommands/CMakeLists_files.cmake @@ -1,30 +1,26 @@ +set(SOURCE_GROUP_HEADER_FILES + ${CMAKE_CURRENT_LIST_DIR}/RicAppendIntersectionFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicAppendSeparateIntersectionResultFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicNewSimWellIntersectionFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicNewWellPathIntersectionFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicNewPolylineIntersectionFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicNewAzimuthDipIntersectionFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicCopyIntersectionsToAllViewsInCaseFeature.h) -set (SOURCE_GROUP_HEADER_FILES -${CMAKE_CURRENT_LIST_DIR}/RicAppendIntersectionFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicAppendSeparateIntersectionResultFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicNewSimWellIntersectionFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicNewWellPathIntersectionFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicNewPolylineIntersectionFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicNewAzimuthDipIntersectionFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicCopyIntersectionsToAllViewsInCaseFeature.h -) +set(SOURCE_GROUP_SOURCE_FILES + ${CMAKE_CURRENT_LIST_DIR}/RicAppendIntersectionFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicAppendSeparateIntersectionResultFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicNewSimWellIntersectionFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicNewWellPathIntersectionFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicNewPolylineIntersectionFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicNewAzimuthDipIntersectionFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicCopyIntersectionsToAllViewsInCaseFeature.cpp) -set (SOURCE_GROUP_SOURCE_FILES -${CMAKE_CURRENT_LIST_DIR}/RicAppendIntersectionFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicAppendSeparateIntersectionResultFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicNewSimWellIntersectionFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicNewWellPathIntersectionFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicNewPolylineIntersectionFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicNewAzimuthDipIntersectionFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicCopyIntersectionsToAllViewsInCaseFeature.cpp -) +list(APPEND COMMAND_CODE_HEADER_FILES ${SOURCE_GROUP_HEADER_FILES}) -list(APPEND COMMAND_CODE_HEADER_FILES -${SOURCE_GROUP_HEADER_FILES} -) +list(APPEND COMMAND_CODE_SOURCE_FILES ${SOURCE_GROUP_SOURCE_FILES}) -list(APPEND COMMAND_CODE_SOURCE_FILES -${SOURCE_GROUP_SOURCE_FILES} -) - -source_group( "CommandFeature\\CrossSection" FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake ) +source_group( + "CommandFeature\\CrossSection" + FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} + ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake) diff --git a/ApplicationLibCode/Commands/EclipseCommands/CMakeLists_files.cmake b/ApplicationLibCode/Commands/EclipseCommands/CMakeLists_files.cmake index 24644f0566..57fb7fe4ff 100644 --- a/ApplicationLibCode/Commands/EclipseCommands/CMakeLists_files.cmake +++ b/ApplicationLibCode/Commands/EclipseCommands/CMakeLists_files.cmake @@ -1,52 +1,48 @@ +set(SOURCE_GROUP_HEADER_FILES + ${CMAKE_CURRENT_LIST_DIR}/RicAddEclipseInputPropertyFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicComputeStatisticsFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicCreateGridCaseGroupFromFilesFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicEclipseCaseNewGroupExec.h + ${CMAKE_CURRENT_LIST_DIR}/RicEclipseCaseNewGroupFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicEclipsePropertyFilterFeatureImpl.h + ${CMAKE_CURRENT_LIST_DIR}/RicEclipsePropertyFilterInsertExec.h + ${CMAKE_CURRENT_LIST_DIR}/RicEclipsePropertyFilterInsertFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicEclipsePropertyFilterNewExec.h + ${CMAKE_CURRENT_LIST_DIR}/RicEclipsePropertyFilterNewFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicImportEclipseCaseFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicImportEclipseCasesFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicImportInputEclipseCaseFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicNewStatisticsCaseFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicApplyPropertyFilterAsCellResultFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicImportEclipseCaseTimeStepFilterFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicEclipsePropertyFilterNewInViewFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicEclipseHideFaultFeature.h) -set (SOURCE_GROUP_HEADER_FILES -${CMAKE_CURRENT_LIST_DIR}/RicAddEclipseInputPropertyFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicComputeStatisticsFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicCreateGridCaseGroupFromFilesFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicEclipseCaseNewGroupExec.h -${CMAKE_CURRENT_LIST_DIR}/RicEclipseCaseNewGroupFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicEclipsePropertyFilterFeatureImpl.h -${CMAKE_CURRENT_LIST_DIR}/RicEclipsePropertyFilterInsertExec.h -${CMAKE_CURRENT_LIST_DIR}/RicEclipsePropertyFilterInsertFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicEclipsePropertyFilterNewExec.h -${CMAKE_CURRENT_LIST_DIR}/RicEclipsePropertyFilterNewFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicImportEclipseCaseFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicImportEclipseCasesFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicImportInputEclipseCaseFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicNewStatisticsCaseFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicApplyPropertyFilterAsCellResultFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicImportEclipseCaseTimeStepFilterFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicEclipsePropertyFilterNewInViewFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicEclipseHideFaultFeature.h -) +set(SOURCE_GROUP_SOURCE_FILES + ${CMAKE_CURRENT_LIST_DIR}/RicAddEclipseInputPropertyFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicComputeStatisticsFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicCreateGridCaseGroupFromFilesFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicEclipseCaseNewGroupExec.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicEclipseCaseNewGroupFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicEclipsePropertyFilterFeatureImpl.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicEclipsePropertyFilterInsertExec.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicEclipsePropertyFilterInsertFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicEclipsePropertyFilterNewExec.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicEclipsePropertyFilterNewFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicImportEclipseCaseFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicImportEclipseCasesFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicImportInputEclipseCaseFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicNewStatisticsCaseFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicApplyPropertyFilterAsCellResultFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicImportEclipseCaseTimeStepFilterFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicEclipsePropertyFilterNewInViewFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicEclipseHideFaultFeature.cpp) -set (SOURCE_GROUP_SOURCE_FILES -${CMAKE_CURRENT_LIST_DIR}/RicAddEclipseInputPropertyFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicComputeStatisticsFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicCreateGridCaseGroupFromFilesFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicEclipseCaseNewGroupExec.cpp -${CMAKE_CURRENT_LIST_DIR}/RicEclipseCaseNewGroupFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicEclipsePropertyFilterFeatureImpl.cpp -${CMAKE_CURRENT_LIST_DIR}/RicEclipsePropertyFilterInsertExec.cpp -${CMAKE_CURRENT_LIST_DIR}/RicEclipsePropertyFilterInsertFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicEclipsePropertyFilterNewExec.cpp -${CMAKE_CURRENT_LIST_DIR}/RicEclipsePropertyFilterNewFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicImportEclipseCaseFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicImportEclipseCasesFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicImportInputEclipseCaseFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicNewStatisticsCaseFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicApplyPropertyFilterAsCellResultFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicImportEclipseCaseTimeStepFilterFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicEclipsePropertyFilterNewInViewFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicEclipseHideFaultFeature.cpp -) +list(APPEND COMMAND_CODE_HEADER_FILES ${SOURCE_GROUP_HEADER_FILES}) -list(APPEND COMMAND_CODE_HEADER_FILES -${SOURCE_GROUP_HEADER_FILES} -) +list(APPEND COMMAND_CODE_SOURCE_FILES ${SOURCE_GROUP_SOURCE_FILES}) -list(APPEND COMMAND_CODE_SOURCE_FILES -${SOURCE_GROUP_SOURCE_FILES} -) - -source_group( "CommandFeature\\Eclipse" FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake ) +source_group( + "CommandFeature\\Eclipse" + FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} + ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake) diff --git a/ApplicationLibCode/Commands/EclipseCommands/EclipseWell/CMakeLists_files.cmake b/ApplicationLibCode/Commands/EclipseCommands/EclipseWell/CMakeLists_files.cmake index f644800fb9..03448e6858 100644 --- a/ApplicationLibCode/Commands/EclipseCommands/EclipseWell/CMakeLists_files.cmake +++ b/ApplicationLibCode/Commands/EclipseCommands/EclipseWell/CMakeLists_files.cmake @@ -1,21 +1,16 @@ +set(SOURCE_GROUP_HEADER_FILES + ${CMAKE_CURRENT_LIST_DIR}/RicEclipseWellFeatureImpl.h + ${CMAKE_CURRENT_LIST_DIR}/RicEclipseWellShowFeatures.h) +set(SOURCE_GROUP_SOURCE_FILES + ${CMAKE_CURRENT_LIST_DIR}/RicEclipseWellFeatureImpl.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicEclipseWellShowFeatures.cpp) -set (SOURCE_GROUP_HEADER_FILES -${CMAKE_CURRENT_LIST_DIR}/RicEclipseWellFeatureImpl.h -${CMAKE_CURRENT_LIST_DIR}/RicEclipseWellShowFeatures.h -) +list(APPEND COMMAND_CODE_HEADER_FILES ${SOURCE_GROUP_HEADER_FILES}) -set (SOURCE_GROUP_SOURCE_FILES -${CMAKE_CURRENT_LIST_DIR}/RicEclipseWellFeatureImpl.cpp -${CMAKE_CURRENT_LIST_DIR}/RicEclipseWellShowFeatures.cpp -) +list(APPEND COMMAND_CODE_SOURCE_FILES ${SOURCE_GROUP_SOURCE_FILES}) -list(APPEND COMMAND_CODE_HEADER_FILES -${SOURCE_GROUP_HEADER_FILES} -) - -list(APPEND COMMAND_CODE_SOURCE_FILES -${SOURCE_GROUP_SOURCE_FILES} -) - -source_group( "CommandFeature\\Eclipse\\Well" FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake ) +source_group( + "CommandFeature\\Eclipse\\Well" + FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} + ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake) diff --git a/ApplicationLibCode/Commands/ExportCommands/CMakeLists_files.cmake b/ApplicationLibCode/Commands/ExportCommands/CMakeLists_files.cmake index 68519661f5..b1773fabf3 100644 --- a/ApplicationLibCode/Commands/ExportCommands/CMakeLists_files.cmake +++ b/ApplicationLibCode/Commands/ExportCommands/CMakeLists_files.cmake @@ -1,68 +1,65 @@ -set (SOURCE_GROUP_HEADER_FILES -${CMAKE_CURRENT_LIST_DIR}/RicCellRangeUi.h -${CMAKE_CURRENT_LIST_DIR}/RicExportCarfin.h -${CMAKE_CURRENT_LIST_DIR}/RicExportCarfinUi.h -${CMAKE_CURRENT_LIST_DIR}/RicExportFaultsFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicAdvancedSnapshotExportFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicExportToLasFileFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicExportToLasFileResampleUi.h -${CMAKE_CURRENT_LIST_DIR}/RicSaveEclipseInputPropertyFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicSaveEclipseInputVisibleCellsFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicSaveEclipseInputVisibleCellsUi.h -${CMAKE_CURRENT_LIST_DIR}/RicSaveEclipseResultAsInputPropertyExec.h -${CMAKE_CURRENT_LIST_DIR}/RicSaveEclipseResultAsInputPropertyFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicExportEclipseSectorModelFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicExportEclipseSectorModelUi.h -${CMAKE_CURRENT_LIST_DIR}/RicSnapshotAllPlotsToFileFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicSnapshotAllViewsToFileFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicSnapshotFilenameGenerator.h -${CMAKE_CURRENT_LIST_DIR}/RicSnapshotViewToClipboardFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicSnapshotViewToFileFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicSnapshotViewToPdfFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicExportSelectedWellPathsFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicExportVisibleWellPathsFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicExportWellPathsUi.h -${CMAKE_CURRENT_LIST_DIR}/RicExportLgrFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicExportLgrUi.h -${CMAKE_CURRENT_LIST_DIR}/RicEclipseCellResultToFileImpl.h -${CMAKE_CURRENT_LIST_DIR}/RicLgrSplitType.h -) +set(SOURCE_GROUP_HEADER_FILES + ${CMAKE_CURRENT_LIST_DIR}/RicCellRangeUi.h + ${CMAKE_CURRENT_LIST_DIR}/RicExportCarfin.h + ${CMAKE_CURRENT_LIST_DIR}/RicExportCarfinUi.h + ${CMAKE_CURRENT_LIST_DIR}/RicExportFaultsFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicAdvancedSnapshotExportFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicExportToLasFileFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicExportToLasFileResampleUi.h + ${CMAKE_CURRENT_LIST_DIR}/RicSaveEclipseInputPropertyFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicSaveEclipseInputVisibleCellsFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicSaveEclipseInputVisibleCellsUi.h + ${CMAKE_CURRENT_LIST_DIR}/RicSaveEclipseResultAsInputPropertyExec.h + ${CMAKE_CURRENT_LIST_DIR}/RicSaveEclipseResultAsInputPropertyFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicExportEclipseSectorModelFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicExportEclipseSectorModelUi.h + ${CMAKE_CURRENT_LIST_DIR}/RicSnapshotAllPlotsToFileFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicSnapshotAllViewsToFileFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicSnapshotFilenameGenerator.h + ${CMAKE_CURRENT_LIST_DIR}/RicSnapshotViewToClipboardFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicSnapshotViewToFileFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicSnapshotViewToPdfFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicExportSelectedWellPathsFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicExportVisibleWellPathsFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicExportWellPathsUi.h + ${CMAKE_CURRENT_LIST_DIR}/RicExportLgrFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicExportLgrUi.h + ${CMAKE_CURRENT_LIST_DIR}/RicEclipseCellResultToFileImpl.h + ${CMAKE_CURRENT_LIST_DIR}/RicLgrSplitType.h) -set (SOURCE_GROUP_SOURCE_FILES -${CMAKE_CURRENT_LIST_DIR}/RicCellRangeUi.cpp -${CMAKE_CURRENT_LIST_DIR}/RicExportCarfin.cpp -${CMAKE_CURRENT_LIST_DIR}/RicExportCarfinUi.cpp -${CMAKE_CURRENT_LIST_DIR}/RicExportFaultsFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicAdvancedSnapshotExportFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicExportToLasFileFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicExportToLasFileResampleUi.cpp -${CMAKE_CURRENT_LIST_DIR}/RicSaveEclipseInputPropertyFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicSaveEclipseInputVisibleCellsFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicSaveEclipseInputVisibleCellsUi.cpp -${CMAKE_CURRENT_LIST_DIR}/RicExportEclipseSectorModelFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicExportEclipseSectorModelUi.cpp -${CMAKE_CURRENT_LIST_DIR}/RicSaveEclipseResultAsInputPropertyExec.cpp -${CMAKE_CURRENT_LIST_DIR}/RicSaveEclipseResultAsInputPropertyFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicSnapshotAllPlotsToFileFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicSnapshotAllViewsToFileFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicSnapshotFilenameGenerator.cpp -${CMAKE_CURRENT_LIST_DIR}/RicSnapshotViewToClipboardFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicSnapshotViewToFileFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicSnapshotViewToPdfFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicExportSelectedWellPathsFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicExportVisibleWellPathsFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicExportWellPathsUi.cpp -${CMAKE_CURRENT_LIST_DIR}/RicExportLgrFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicExportLgrUi.cpp -${CMAKE_CURRENT_LIST_DIR}/RicEclipseCellResultToFileImpl.cpp -) +set(SOURCE_GROUP_SOURCE_FILES + ${CMAKE_CURRENT_LIST_DIR}/RicCellRangeUi.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicExportCarfin.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicExportCarfinUi.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicExportFaultsFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicAdvancedSnapshotExportFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicExportToLasFileFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicExportToLasFileResampleUi.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicSaveEclipseInputPropertyFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicSaveEclipseInputVisibleCellsFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicSaveEclipseInputVisibleCellsUi.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicExportEclipseSectorModelFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicExportEclipseSectorModelUi.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicSaveEclipseResultAsInputPropertyExec.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicSaveEclipseResultAsInputPropertyFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicSnapshotAllPlotsToFileFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicSnapshotAllViewsToFileFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicSnapshotFilenameGenerator.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicSnapshotViewToClipboardFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicSnapshotViewToFileFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicSnapshotViewToPdfFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicExportSelectedWellPathsFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicExportVisibleWellPathsFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicExportWellPathsUi.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicExportLgrFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicExportLgrUi.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicEclipseCellResultToFileImpl.cpp) -list(APPEND COMMAND_CODE_HEADER_FILES -${SOURCE_GROUP_HEADER_FILES} -) +list(APPEND COMMAND_CODE_HEADER_FILES ${SOURCE_GROUP_HEADER_FILES}) -list(APPEND COMMAND_CODE_SOURCE_FILES -${SOURCE_GROUP_SOURCE_FILES} -) +list(APPEND COMMAND_CODE_SOURCE_FILES ${SOURCE_GROUP_SOURCE_FILES}) -source_group( "CommandFeature\\Export" FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake ) +source_group( + "CommandFeature\\Export" + FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} + ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake) diff --git a/ApplicationLibCode/Commands/FlowCommands/CMakeLists_files.cmake b/ApplicationLibCode/Commands/FlowCommands/CMakeLists_files.cmake index 89f050c8da..0eda1910a6 100644 --- a/ApplicationLibCode/Commands/FlowCommands/CMakeLists_files.cmake +++ b/ApplicationLibCode/Commands/FlowCommands/CMakeLists_files.cmake @@ -1,38 +1,34 @@ +set(SOURCE_GROUP_HEADER_FILES + ${CMAKE_CURRENT_LIST_DIR}/RicAddStoredFlowCharacteristicsPlotFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicShowWellAllocationPlotFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicShowFlowCharacteristicsPlotFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicAddStoredWellAllocationPlotFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicShowContributingWellsFromPlotFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicShowContributingWellsFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicShowContributingWellsFeatureImpl.h + ${CMAKE_CURRENT_LIST_DIR}/RicPlotProductionRateFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicSelectViewUI.h + ${CMAKE_CURRENT_LIST_DIR}/RicShowTotalAllocationDataFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicShowCumulativePhasePlotFeature.h) -set (SOURCE_GROUP_HEADER_FILES -${CMAKE_CURRENT_LIST_DIR}/RicAddStoredFlowCharacteristicsPlotFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicShowWellAllocationPlotFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicShowFlowCharacteristicsPlotFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicAddStoredWellAllocationPlotFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicShowContributingWellsFromPlotFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicShowContributingWellsFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicShowContributingWellsFeatureImpl.h -${CMAKE_CURRENT_LIST_DIR}/RicPlotProductionRateFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicSelectViewUI.h -${CMAKE_CURRENT_LIST_DIR}/RicShowTotalAllocationDataFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicShowCumulativePhasePlotFeature.h -) +set(SOURCE_GROUP_SOURCE_FILES + ${CMAKE_CURRENT_LIST_DIR}/RicAddStoredFlowCharacteristicsPlotFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicShowWellAllocationPlotFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicShowFlowCharacteristicsPlotFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicAddStoredWellAllocationPlotFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicShowContributingWellsFromPlotFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicShowContributingWellsFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicShowContributingWellsFeatureImpl.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicPlotProductionRateFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicSelectViewUI.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicShowTotalAllocationDataFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicShowCumulativePhasePlotFeature.cpp) -set (SOURCE_GROUP_SOURCE_FILES -${CMAKE_CURRENT_LIST_DIR}/RicAddStoredFlowCharacteristicsPlotFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicShowWellAllocationPlotFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicShowFlowCharacteristicsPlotFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicAddStoredWellAllocationPlotFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicShowContributingWellsFromPlotFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicShowContributingWellsFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicShowContributingWellsFeatureImpl.cpp -${CMAKE_CURRENT_LIST_DIR}/RicPlotProductionRateFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicSelectViewUI.cpp -${CMAKE_CURRENT_LIST_DIR}/RicShowTotalAllocationDataFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicShowCumulativePhasePlotFeature.cpp -) +list(APPEND COMMAND_CODE_HEADER_FILES ${SOURCE_GROUP_HEADER_FILES}) -list(APPEND COMMAND_CODE_HEADER_FILES -${SOURCE_GROUP_HEADER_FILES} -) +list(APPEND COMMAND_CODE_SOURCE_FILES ${SOURCE_GROUP_SOURCE_FILES}) -list(APPEND COMMAND_CODE_SOURCE_FILES -${SOURCE_GROUP_SOURCE_FILES} -) - -source_group( "CommandFeature\\FlowDiagnostics" FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake ) +source_group( + "CommandFeature\\FlowDiagnostics" + FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} + ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake) diff --git a/ApplicationLibCode/Commands/FractureCommands/CMakeLists_files.cmake b/ApplicationLibCode/Commands/FractureCommands/CMakeLists_files.cmake index 31b150c205..93c9860b4a 100644 --- a/ApplicationLibCode/Commands/FractureCommands/CMakeLists_files.cmake +++ b/ApplicationLibCode/Commands/FractureCommands/CMakeLists_files.cmake @@ -1,64 +1,57 @@ - -set (SOURCE_GROUP_HEADER_FILES -${CMAKE_CURRENT_LIST_DIR}/RicPasteEllipseFractureFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicPasteStimPlanFractureFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicConvertAllFractureTemplatesToFieldFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicConvertAllFractureTemplatesToMetricFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicCreateDuplicateTemplateInOtherUnitSystemFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicFractureNameGenerator.h -${CMAKE_CURRENT_LIST_DIR}/RicNewEllipseFractureTemplateFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicNewSimWellFractureAtPosFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicNewSimWellFractureFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicNewStimPlanFractureTemplateFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicNewWellPathFractureAtPosFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicNewWellPathFractureFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicNewStimPlanModelFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicNewWellPathStimPlanModelAtPosFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicNewStimPlanModelTemplateFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicNewElasticPropertyScalingFeature.h - -${CMAKE_CURRENT_LIST_DIR}/RicCreateMultipleFracturesFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicCreateMultipleFracturesOptionItemUi.h -${CMAKE_CURRENT_LIST_DIR}/RicCreateMultipleFracturesUi.h -${CMAKE_CURRENT_LIST_DIR}/RicNewOptionItemFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicDeleteOptionItemFeature.h -) - -set (SOURCE_GROUP_SOURCE_FILES -${CMAKE_CURRENT_LIST_DIR}/RicPasteEllipseFractureFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicPasteStimPlanFractureFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicConvertAllFractureTemplatesToFieldFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicConvertAllFractureTemplatesToMetricFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicCreateDuplicateTemplateInOtherUnitSystemFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicFractureNameGenerator.cpp -${CMAKE_CURRENT_LIST_DIR}/RicNewEllipseFractureTemplateFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicNewSimWellFractureAtPosFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicNewSimWellFractureFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicNewStimPlanFractureTemplateFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicNewWellPathFractureAtPosFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicNewWellPathFractureFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicNewStimPlanModelFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicNewWellPathStimPlanModelAtPosFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicNewStimPlanModelTemplateFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicNewElasticPropertyScalingFeature.cpp - -${CMAKE_CURRENT_LIST_DIR}/RicCreateMultipleFracturesFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicCreateMultipleFracturesOptionItemUi.cpp -${CMAKE_CURRENT_LIST_DIR}/RicCreateMultipleFracturesUi.cpp -${CMAKE_CURRENT_LIST_DIR}/RicNewOptionItemFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicDeleteOptionItemFeature.cpp -) - -list(APPEND COMMAND_CODE_HEADER_FILES -${SOURCE_GROUP_HEADER_FILES} -) - -list(APPEND COMMAND_CODE_SOURCE_FILES -${SOURCE_GROUP_SOURCE_FILES} -) +set(SOURCE_GROUP_HEADER_FILES + ${CMAKE_CURRENT_LIST_DIR}/RicPasteEllipseFractureFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicPasteStimPlanFractureFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicConvertAllFractureTemplatesToFieldFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicConvertAllFractureTemplatesToMetricFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicCreateDuplicateTemplateInOtherUnitSystemFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicFractureNameGenerator.h + ${CMAKE_CURRENT_LIST_DIR}/RicNewEllipseFractureTemplateFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicNewSimWellFractureAtPosFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicNewSimWellFractureFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicNewStimPlanFractureTemplateFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicNewWellPathFractureAtPosFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicNewWellPathFractureFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicNewStimPlanModelFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicNewWellPathStimPlanModelAtPosFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicNewStimPlanModelTemplateFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicNewElasticPropertyScalingFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicCreateMultipleFracturesFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicCreateMultipleFracturesOptionItemUi.h + ${CMAKE_CURRENT_LIST_DIR}/RicCreateMultipleFracturesUi.h + ${CMAKE_CURRENT_LIST_DIR}/RicNewOptionItemFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicDeleteOptionItemFeature.h) + +set(SOURCE_GROUP_SOURCE_FILES + ${CMAKE_CURRENT_LIST_DIR}/RicPasteEllipseFractureFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicPasteStimPlanFractureFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicConvertAllFractureTemplatesToFieldFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicConvertAllFractureTemplatesToMetricFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicCreateDuplicateTemplateInOtherUnitSystemFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicFractureNameGenerator.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicNewEllipseFractureTemplateFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicNewSimWellFractureAtPosFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicNewSimWellFractureFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicNewStimPlanFractureTemplateFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicNewWellPathFractureAtPosFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicNewWellPathFractureFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicNewStimPlanModelFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicNewWellPathStimPlanModelAtPosFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicNewStimPlanModelTemplateFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicNewElasticPropertyScalingFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicCreateMultipleFracturesFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicCreateMultipleFracturesOptionItemUi.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicCreateMultipleFracturesUi.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicNewOptionItemFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicDeleteOptionItemFeature.cpp) + +list(APPEND COMMAND_CODE_HEADER_FILES ${SOURCE_GROUP_HEADER_FILES}) + +list(APPEND COMMAND_CODE_SOURCE_FILES ${SOURCE_GROUP_SOURCE_FILES}) list(APPEND COMMAND_QT_MOC_HEADERS -${CMAKE_CURRENT_LIST_DIR}/RicCreateMultipleFracturesFeature.h -) + ${CMAKE_CURRENT_LIST_DIR}/RicCreateMultipleFracturesFeature.h) -source_group( "CommandFeature\\Fracture" FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake ) +source_group( + "CommandFeature\\Fracture" + FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} + ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake) diff --git a/ApplicationLibCode/Commands/GeoMechCommands/CMakeLists_files.cmake b/ApplicationLibCode/Commands/GeoMechCommands/CMakeLists_files.cmake index 700ab209dd..c0b3b9cc17 100644 --- a/ApplicationLibCode/Commands/GeoMechCommands/CMakeLists_files.cmake +++ b/ApplicationLibCode/Commands/GeoMechCommands/CMakeLists_files.cmake @@ -1,56 +1,45 @@ - -set (SOURCE_GROUP_HEADER_FILES -${CMAKE_CURRENT_LIST_DIR}/RicGeoMechCopyCaseFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicGeoMechPropertyFilterFeatureImpl.h -${CMAKE_CURRENT_LIST_DIR}/RicGeoMechPropertyFilterInsertFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicGeoMechPropertyFilterInsertExec.h -${CMAKE_CURRENT_LIST_DIR}/RicGeoMechPropertyFilterNewFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicGeoMechPropertyFilterNewInViewFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicGeoMechPropertyFilterNewExec.h - -${CMAKE_CURRENT_LIST_DIR}/RicImportGeoMechCaseFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicImportGeoMechCaseTimeStepFilterFeature.h - -${CMAKE_CURRENT_LIST_DIR}/RicNewFaultReactAssessmentFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicRunBasicFaultReactAssessmentFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicRunAdvFaultReactAssessmentFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicRunBasicFaultReactAssessment3dFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicRunAdvFaultReactAssessment3dFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicRunFaultReactAssessmentFeature.h -) - -set (SOURCE_GROUP_SOURCE_FILES -${CMAKE_CURRENT_LIST_DIR}/RicGeoMechCopyCaseFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicGeoMechPropertyFilterFeatureImpl.cpp -${CMAKE_CURRENT_LIST_DIR}/RicGeoMechPropertyFilterInsertFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicGeoMechPropertyFilterInsertExec.cpp -${CMAKE_CURRENT_LIST_DIR}/RicGeoMechPropertyFilterNewFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicGeoMechPropertyFilterNewInViewFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicGeoMechPropertyFilterNewExec.cpp - -${CMAKE_CURRENT_LIST_DIR}/RicImportGeoMechCaseFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicImportGeoMechCaseTimeStepFilterFeature.cpp - -${CMAKE_CURRENT_LIST_DIR}/RicNewFaultReactAssessmentFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicRunAdvFaultReactAssessmentFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicRunAdvFaultReactAssessment3dFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicRunBasicFaultReactAssessmentFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicRunBasicFaultReactAssessment3dFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicRunFaultReactAssessmentFeature.cpp -) - -list(APPEND COMMAND_CODE_HEADER_FILES -${SOURCE_GROUP_HEADER_FILES} -) - -list(APPEND COMMAND_CODE_SOURCE_FILES -${SOURCE_GROUP_SOURCE_FILES} -) - -#set (COMMAND_QT_MOC_HEADERS -#${COMMAND_QT_MOC_HEADERS} -#${CMAKE_CURRENT_LIST_DIR}/RicTextAnnotation3dEditor.h -#) - - -source_group( "CommandFeature\\GeoMechCommands" FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake ) +set(SOURCE_GROUP_HEADER_FILES + ${CMAKE_CURRENT_LIST_DIR}/RicGeoMechCopyCaseFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicGeoMechPropertyFilterFeatureImpl.h + ${CMAKE_CURRENT_LIST_DIR}/RicGeoMechPropertyFilterInsertFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicGeoMechPropertyFilterInsertExec.h + ${CMAKE_CURRENT_LIST_DIR}/RicGeoMechPropertyFilterNewFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicGeoMechPropertyFilterNewInViewFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicGeoMechPropertyFilterNewExec.h + ${CMAKE_CURRENT_LIST_DIR}/RicImportGeoMechCaseFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicImportGeoMechCaseTimeStepFilterFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicNewFaultReactAssessmentFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicRunBasicFaultReactAssessmentFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicRunAdvFaultReactAssessmentFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicRunBasicFaultReactAssessment3dFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicRunAdvFaultReactAssessment3dFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicRunFaultReactAssessmentFeature.h) + +set(SOURCE_GROUP_SOURCE_FILES + ${CMAKE_CURRENT_LIST_DIR}/RicGeoMechCopyCaseFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicGeoMechPropertyFilterFeatureImpl.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicGeoMechPropertyFilterInsertFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicGeoMechPropertyFilterInsertExec.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicGeoMechPropertyFilterNewFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicGeoMechPropertyFilterNewInViewFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicGeoMechPropertyFilterNewExec.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicImportGeoMechCaseFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicImportGeoMechCaseTimeStepFilterFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicNewFaultReactAssessmentFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicRunAdvFaultReactAssessmentFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicRunAdvFaultReactAssessment3dFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicRunBasicFaultReactAssessmentFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicRunBasicFaultReactAssessment3dFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicRunFaultReactAssessmentFeature.cpp) + +list(APPEND COMMAND_CODE_HEADER_FILES ${SOURCE_GROUP_HEADER_FILES}) + +list(APPEND COMMAND_CODE_SOURCE_FILES ${SOURCE_GROUP_SOURCE_FILES}) + +# set (COMMAND_QT_MOC_HEADERS ${COMMAND_QT_MOC_HEADERS} +# ${CMAKE_CURRENT_LIST_DIR}/RicTextAnnotation3dEditor.h ) + +source_group( + "CommandFeature\\GeoMechCommands" + FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} + ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake) diff --git a/ApplicationLibCode/Commands/GridCrossPlotCommands/CMakeLists_files.cmake b/ApplicationLibCode/Commands/GridCrossPlotCommands/CMakeLists_files.cmake index 528eca2504..8796507509 100644 --- a/ApplicationLibCode/Commands/GridCrossPlotCommands/CMakeLists_files.cmake +++ b/ApplicationLibCode/Commands/GridCrossPlotCommands/CMakeLists_files.cmake @@ -1,28 +1,24 @@ +set(SOURCE_GROUP_HEADER_FILES + ${CMAKE_CURRENT_LIST_DIR}/RicCreateGridCrossPlotFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicCreateGridCrossPlotDataSetFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicSwapGridCrossPlotDataSetAxesFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicPasteGridCrossPlotDataSetFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicCreateSaturationPressurePlotsFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicSaturationPressureUi.h) -set (SOURCE_GROUP_HEADER_FILES -${CMAKE_CURRENT_LIST_DIR}/RicCreateGridCrossPlotFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicCreateGridCrossPlotDataSetFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicSwapGridCrossPlotDataSetAxesFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicPasteGridCrossPlotDataSetFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicCreateSaturationPressurePlotsFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicSaturationPressureUi.h -) +set(SOURCE_GROUP_SOURCE_FILES + ${CMAKE_CURRENT_LIST_DIR}/RicCreateGridCrossPlotFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicCreateGridCrossPlotDataSetFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicSwapGridCrossPlotDataSetAxesFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicPasteGridCrossPlotDataSetFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicCreateSaturationPressurePlotsFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicSaturationPressureUi.cpp) -set (SOURCE_GROUP_SOURCE_FILES -${CMAKE_CURRENT_LIST_DIR}/RicCreateGridCrossPlotFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicCreateGridCrossPlotDataSetFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicSwapGridCrossPlotDataSetAxesFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicPasteGridCrossPlotDataSetFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicCreateSaturationPressurePlotsFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicSaturationPressureUi.cpp -) +list(APPEND COMMAND_CODE_HEADER_FILES ${SOURCE_GROUP_HEADER_FILES}) -list(APPEND COMMAND_CODE_HEADER_FILES -${SOURCE_GROUP_HEADER_FILES} -) +list(APPEND COMMAND_CODE_SOURCE_FILES ${SOURCE_GROUP_SOURCE_FILES}) -list(APPEND COMMAND_CODE_SOURCE_FILES -${SOURCE_GROUP_SOURCE_FILES} -) - -source_group( "CommandFeature\\GridCrossPlot" FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake ) +source_group( + "CommandFeature\\GridCrossPlot" + FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} + ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake) diff --git a/ApplicationLibCode/Commands/HoloLensCommands/CMakeLists_files.cmake b/ApplicationLibCode/Commands/HoloLensCommands/CMakeLists_files.cmake index 3c8c1d3336..9a9377ce5f 100644 --- a/ApplicationLibCode/Commands/HoloLensCommands/CMakeLists_files.cmake +++ b/ApplicationLibCode/Commands/HoloLensCommands/CMakeLists_files.cmake @@ -1,68 +1,57 @@ - -set (SOURCE_GROUP_HEADER_FILES -${CMAKE_CURRENT_LIST_DIR}/RicHoloLensExportToFolderFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicHoloLensExportToFolderUi.h -${CMAKE_CURRENT_LIST_DIR}/RicHoloLensExportImpl.h -${CMAKE_CURRENT_LIST_DIR}/RicHoloLensExportToSharingServerFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicHoloLensCreateSessionFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicHoloLensTerminateSessionFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicHoloLensRestClient.h -${CMAKE_CURRENT_LIST_DIR}/RicHoloLensServerSettings.h -${CMAKE_CURRENT_LIST_DIR}/RicHoloLensCreateSessionUi.h -${CMAKE_CURRENT_LIST_DIR}/RicHoloLensSession.h -${CMAKE_CURRENT_LIST_DIR}/RicHoloLensSessionObserver.h -${CMAKE_CURRENT_LIST_DIR}/RicHoloLensSessionManager.h -${CMAKE_CURRENT_LIST_DIR}/RicHoloLensCreateDummyFileBackedSessionFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicHoloLensAutoExportToSharingServerFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicExportToSharingServerScheduler.h - -${CMAKE_CURRENT_LIST_DIR}/VdeArrayDataPacket.h -${CMAKE_CURRENT_LIST_DIR}/VdeCachingHashedIdFactory.h -${CMAKE_CURRENT_LIST_DIR}/VdeExportPart.h -${CMAKE_CURRENT_LIST_DIR}/VdeFileExporter.h -${CMAKE_CURRENT_LIST_DIR}/VdePacketDirectory.h -${CMAKE_CURRENT_LIST_DIR}/VdeVizDataExtractor.h -) - -set (SOURCE_GROUP_SOURCE_FILES -${CMAKE_CURRENT_LIST_DIR}/RicHoloLensExportToFolderFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicHoloLensExportImpl.cpp -${CMAKE_CURRENT_LIST_DIR}/RicHoloLensExportToFolderUi.cpp -${CMAKE_CURRENT_LIST_DIR}/RicHoloLensExportToSharingServerFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicHoloLensCreateSessionFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicHoloLensTerminateSessionFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicHoloLensRestClient.cpp -${CMAKE_CURRENT_LIST_DIR}/RicHoloLensServerSettings.cpp -${CMAKE_CURRENT_LIST_DIR}/RicHoloLensCreateSessionUi.cpp -${CMAKE_CURRENT_LIST_DIR}/RicHoloLensSession.cpp -${CMAKE_CURRENT_LIST_DIR}/RicHoloLensSessionManager.cpp -${CMAKE_CURRENT_LIST_DIR}/RicHoloLensCreateDummyFileBackedSessionFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicHoloLensAutoExportToSharingServerFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicExportToSharingServerScheduler.cpp - -${CMAKE_CURRENT_LIST_DIR}/VdeArrayDataPacket.cpp -${CMAKE_CURRENT_LIST_DIR}/VdeCachingHashedIdFactory.cpp -${CMAKE_CURRENT_LIST_DIR}/VdeExportPart.cpp -${CMAKE_CURRENT_LIST_DIR}/VdeFileExporter.cpp -${CMAKE_CURRENT_LIST_DIR}/VdePacketDirectory.cpp -${CMAKE_CURRENT_LIST_DIR}/VdeVizDataExtractor.cpp -) - - -list(APPEND COMMAND_CODE_HEADER_FILES -${SOURCE_GROUP_HEADER_FILES} -) - -list(APPEND COMMAND_CODE_SOURCE_FILES -${SOURCE_GROUP_SOURCE_FILES} -) - -set (COMMAND_QT_MOC_HEADERS -${COMMAND_QT_MOC_HEADERS} -${CMAKE_CURRENT_LIST_DIR}/RicHoloLensRestClient.h -${CMAKE_CURRENT_LIST_DIR}/RicExportToSharingServerScheduler.h -) - - - -source_group( "CommandFeature\\HoloLens" FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake ) +set(SOURCE_GROUP_HEADER_FILES + ${CMAKE_CURRENT_LIST_DIR}/RicHoloLensExportToFolderFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicHoloLensExportToFolderUi.h + ${CMAKE_CURRENT_LIST_DIR}/RicHoloLensExportImpl.h + ${CMAKE_CURRENT_LIST_DIR}/RicHoloLensExportToSharingServerFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicHoloLensCreateSessionFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicHoloLensTerminateSessionFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicHoloLensRestClient.h + ${CMAKE_CURRENT_LIST_DIR}/RicHoloLensServerSettings.h + ${CMAKE_CURRENT_LIST_DIR}/RicHoloLensCreateSessionUi.h + ${CMAKE_CURRENT_LIST_DIR}/RicHoloLensSession.h + ${CMAKE_CURRENT_LIST_DIR}/RicHoloLensSessionObserver.h + ${CMAKE_CURRENT_LIST_DIR}/RicHoloLensSessionManager.h + ${CMAKE_CURRENT_LIST_DIR}/RicHoloLensCreateDummyFileBackedSessionFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicHoloLensAutoExportToSharingServerFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicExportToSharingServerScheduler.h + ${CMAKE_CURRENT_LIST_DIR}/VdeArrayDataPacket.h + ${CMAKE_CURRENT_LIST_DIR}/VdeCachingHashedIdFactory.h + ${CMAKE_CURRENT_LIST_DIR}/VdeExportPart.h + ${CMAKE_CURRENT_LIST_DIR}/VdeFileExporter.h + ${CMAKE_CURRENT_LIST_DIR}/VdePacketDirectory.h + ${CMAKE_CURRENT_LIST_DIR}/VdeVizDataExtractor.h) + +set(SOURCE_GROUP_SOURCE_FILES + ${CMAKE_CURRENT_LIST_DIR}/RicHoloLensExportToFolderFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicHoloLensExportImpl.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicHoloLensExportToFolderUi.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicHoloLensExportToSharingServerFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicHoloLensCreateSessionFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicHoloLensTerminateSessionFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicHoloLensRestClient.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicHoloLensServerSettings.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicHoloLensCreateSessionUi.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicHoloLensSession.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicHoloLensSessionManager.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicHoloLensCreateDummyFileBackedSessionFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicHoloLensAutoExportToSharingServerFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicExportToSharingServerScheduler.cpp + ${CMAKE_CURRENT_LIST_DIR}/VdeArrayDataPacket.cpp + ${CMAKE_CURRENT_LIST_DIR}/VdeCachingHashedIdFactory.cpp + ${CMAKE_CURRENT_LIST_DIR}/VdeExportPart.cpp + ${CMAKE_CURRENT_LIST_DIR}/VdeFileExporter.cpp + ${CMAKE_CURRENT_LIST_DIR}/VdePacketDirectory.cpp + ${CMAKE_CURRENT_LIST_DIR}/VdeVizDataExtractor.cpp) + +list(APPEND COMMAND_CODE_HEADER_FILES ${SOURCE_GROUP_HEADER_FILES}) + +list(APPEND COMMAND_CODE_SOURCE_FILES ${SOURCE_GROUP_SOURCE_FILES}) + +set(COMMAND_QT_MOC_HEADERS + ${COMMAND_QT_MOC_HEADERS} ${CMAKE_CURRENT_LIST_DIR}/RicHoloLensRestClient.h + ${CMAKE_CURRENT_LIST_DIR}/RicExportToSharingServerScheduler.h) + +source_group( + "CommandFeature\\HoloLens" + FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} + ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake) diff --git a/ApplicationLibCode/Commands/IntersectionBoxCommands/CMakeLists_files.cmake b/ApplicationLibCode/Commands/IntersectionBoxCommands/CMakeLists_files.cmake index 56b6383bd2..28946772cd 100644 --- a/ApplicationLibCode/Commands/IntersectionBoxCommands/CMakeLists_files.cmake +++ b/ApplicationLibCode/Commands/IntersectionBoxCommands/CMakeLists_files.cmake @@ -1,36 +1,30 @@ +set(SOURCE_GROUP_HEADER_FILES + ${CMAKE_CURRENT_LIST_DIR}/RicIntersectionFeatureImpl.h + ${CMAKE_CURRENT_LIST_DIR}/RicBoxManipulatorEventHandler.h + ${CMAKE_CURRENT_LIST_DIR}/RicAppendIntersectionBoxFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicIntersectionBoxXSliceFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicIntersectionBoxYSliceFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicIntersectionBoxZSliceFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicIntersectionBoxAtPosFeature.h) -set (SOURCE_GROUP_HEADER_FILES -${CMAKE_CURRENT_LIST_DIR}/RicIntersectionFeatureImpl.h -${CMAKE_CURRENT_LIST_DIR}/RicBoxManipulatorEventHandler.h -${CMAKE_CURRENT_LIST_DIR}/RicAppendIntersectionBoxFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicIntersectionBoxXSliceFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicIntersectionBoxYSliceFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicIntersectionBoxZSliceFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicIntersectionBoxAtPosFeature.h -) +set(SOURCE_GROUP_SOURCE_FILES + ${CMAKE_CURRENT_LIST_DIR}/RicIntersectionFeatureImpl.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicBoxManipulatorEventHandler.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicAppendIntersectionBoxFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicIntersectionBoxXSliceFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicIntersectionBoxYSliceFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicIntersectionBoxZSliceFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicIntersectionBoxAtPosFeature.cpp) -set (SOURCE_GROUP_SOURCE_FILES -${CMAKE_CURRENT_LIST_DIR}/RicIntersectionFeatureImpl.cpp -${CMAKE_CURRENT_LIST_DIR}/RicBoxManipulatorEventHandler.cpp -${CMAKE_CURRENT_LIST_DIR}/RicAppendIntersectionBoxFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicIntersectionBoxXSliceFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicIntersectionBoxYSliceFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicIntersectionBoxZSliceFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicIntersectionBoxAtPosFeature.cpp -) +list(APPEND COMMAND_CODE_HEADER_FILES ${SOURCE_GROUP_HEADER_FILES}) -list(APPEND COMMAND_CODE_HEADER_FILES -${SOURCE_GROUP_HEADER_FILES} -) +list(APPEND COMMAND_CODE_SOURCE_FILES ${SOURCE_GROUP_SOURCE_FILES}) -list(APPEND COMMAND_CODE_SOURCE_FILES -${SOURCE_GROUP_SOURCE_FILES} -) +set(COMMAND_QT_MOC_HEADERS + ${COMMAND_QT_MOC_HEADERS} + ${CMAKE_CURRENT_LIST_DIR}/RicBoxManipulatorEventHandler.h) -set (COMMAND_QT_MOC_HEADERS -${COMMAND_QT_MOC_HEADERS} -${CMAKE_CURRENT_LIST_DIR}/RicBoxManipulatorEventHandler.h -) - - -source_group( "CommandFeature\\IntersectionBox" FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake ) +source_group( + "CommandFeature\\IntersectionBox" + FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} + ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake) diff --git a/ApplicationLibCode/Commands/IntersectionViewCommands/CMakeLists_files.cmake b/ApplicationLibCode/Commands/IntersectionViewCommands/CMakeLists_files.cmake index 389be0fefe..495cbc03e2 100644 --- a/ApplicationLibCode/Commands/IntersectionViewCommands/CMakeLists_files.cmake +++ b/ApplicationLibCode/Commands/IntersectionViewCommands/CMakeLists_files.cmake @@ -1,18 +1,14 @@ +set(SOURCE_GROUP_HEADER_FILES + ${CMAKE_CURRENT_LIST_DIR}/RicNewIntersectionViewFeature.h) -set (SOURCE_GROUP_HEADER_FILES -${CMAKE_CURRENT_LIST_DIR}/RicNewIntersectionViewFeature.h -) +set(SOURCE_GROUP_SOURCE_FILES + ${CMAKE_CURRENT_LIST_DIR}/RicNewIntersectionViewFeature.cpp) -set (SOURCE_GROUP_SOURCE_FILES -${CMAKE_CURRENT_LIST_DIR}/RicNewIntersectionViewFeature.cpp -) +list(APPEND COMMAND_CODE_HEADER_FILES ${SOURCE_GROUP_HEADER_FILES}) -list(APPEND COMMAND_CODE_HEADER_FILES -${SOURCE_GROUP_HEADER_FILES} -) +list(APPEND COMMAND_CODE_SOURCE_FILES ${SOURCE_GROUP_SOURCE_FILES}) -list(APPEND COMMAND_CODE_SOURCE_FILES -${SOURCE_GROUP_SOURCE_FILES} -) - -source_group( "CommandFeature\\IntersectionView" FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake ) +source_group( + "CommandFeature\\IntersectionView" + FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} + ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake) diff --git a/ApplicationLibCode/Commands/MeasurementCommands/CMakeLists_files.cmake b/ApplicationLibCode/Commands/MeasurementCommands/CMakeLists_files.cmake index 3d69470b24..b480476f7a 100644 --- a/ApplicationLibCode/Commands/MeasurementCommands/CMakeLists_files.cmake +++ b/ApplicationLibCode/Commands/MeasurementCommands/CMakeLists_files.cmake @@ -1,23 +1,18 @@ +set(SOURCE_GROUP_HEADER_FILES + ${CMAKE_CURRENT_LIST_DIR}/RicToggleMeasurementModeFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicMeasurementPickEventHandler.h) -set (SOURCE_GROUP_HEADER_FILES -${CMAKE_CURRENT_LIST_DIR}/RicToggleMeasurementModeFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicMeasurementPickEventHandler.h -) +set(SOURCE_GROUP_SOURCE_FILES + ${CMAKE_CURRENT_LIST_DIR}/RicToggleMeasurementModeFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicMeasurementPickEventHandler.cpp) -set (SOURCE_GROUP_SOURCE_FILES -${CMAKE_CURRENT_LIST_DIR}/RicToggleMeasurementModeFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicMeasurementPickEventHandler.cpp -) +list(APPEND COMMAND_CODE_HEADER_FILES ${SOURCE_GROUP_HEADER_FILES}) -list(APPEND COMMAND_CODE_HEADER_FILES -${SOURCE_GROUP_HEADER_FILES} -) +list(APPEND COMMAND_CODE_SOURCE_FILES ${SOURCE_GROUP_SOURCE_FILES}) -list(APPEND COMMAND_CODE_SOURCE_FILES -${SOURCE_GROUP_SOURCE_FILES} -) +list(APPEND COMMAND_QT_MOC_HEADERS) -list(APPEND COMMAND_QT_MOC_HEADERS -) - -source_group( "CommandFeature\\Measurement" FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake ) +source_group( + "CommandFeature\\Measurement" + FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} + ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake) diff --git a/ApplicationLibCode/Commands/OctaveScriptCommands/CMakeLists_files.cmake b/ApplicationLibCode/Commands/OctaveScriptCommands/CMakeLists_files.cmake index 510d51190c..1632ed4d46 100644 --- a/ApplicationLibCode/Commands/OctaveScriptCommands/CMakeLists_files.cmake +++ b/ApplicationLibCode/Commands/OctaveScriptCommands/CMakeLists_files.cmake @@ -1,41 +1,36 @@ +set(SOURCE_GROUP_HEADER_FILES + ${CMAKE_CURRENT_LIST_DIR}/RicAddScriptPathFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicDeleteScriptPathFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicEditScriptFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicExecuteScriptFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicExecuteLastUsedScriptFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicExecuteScriptForCasesFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicNewOctaveScriptFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicNewPythonScriptFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicScriptFeatureImpl.h + ${CMAKE_CURRENT_LIST_DIR}/RicRefreshScriptsFeature.h) -set (SOURCE_GROUP_HEADER_FILES -${CMAKE_CURRENT_LIST_DIR}/RicAddScriptPathFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicDeleteScriptPathFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicEditScriptFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicExecuteScriptFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicExecuteLastUsedScriptFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicExecuteScriptForCasesFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicNewOctaveScriptFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicNewPythonScriptFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicScriptFeatureImpl.h -${CMAKE_CURRENT_LIST_DIR}/RicRefreshScriptsFeature.h -) +set(SOURCE_GROUP_SOURCE_FILES + ${CMAKE_CURRENT_LIST_DIR}/RicAddScriptPathFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicDeleteScriptPathFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicEditScriptFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicExecuteLastUsedScriptFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicExecuteScriptFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicExecuteScriptForCasesFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicNewOctaveScriptFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicNewPythonScriptFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicScriptFeatureImpl.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicRefreshScriptsFeature.cpp) -set (SOURCE_GROUP_SOURCE_FILES -${CMAKE_CURRENT_LIST_DIR}/RicAddScriptPathFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicDeleteScriptPathFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicEditScriptFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicExecuteLastUsedScriptFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicExecuteScriptFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicExecuteScriptForCasesFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicNewOctaveScriptFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicNewPythonScriptFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicScriptFeatureImpl.cpp -${CMAKE_CURRENT_LIST_DIR}/RicRefreshScriptsFeature.cpp -) +set(COMMAND_QT_MOC_HEADERS + ${COMMAND_QT_MOC_HEADERS} + ${CMAKE_CURRENT_LIST_DIR}/RicExecuteScriptForCasesFeature.h) -set (COMMAND_QT_MOC_HEADERS -${COMMAND_QT_MOC_HEADERS} -${CMAKE_CURRENT_LIST_DIR}/RicExecuteScriptForCasesFeature.h -) +list(APPEND COMMAND_CODE_HEADER_FILES ${SOURCE_GROUP_HEADER_FILES}) -list(APPEND COMMAND_CODE_HEADER_FILES -${SOURCE_GROUP_HEADER_FILES} -) +list(APPEND COMMAND_CODE_SOURCE_FILES ${SOURCE_GROUP_SOURCE_FILES}) -list(APPEND COMMAND_CODE_SOURCE_FILES -${SOURCE_GROUP_SOURCE_FILES} -) - -source_group( "CommandFeature\\Script" FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake ) +source_group( + "CommandFeature\\Script" + FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} + ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake) diff --git a/ApplicationLibCode/Commands/OperationsUsingObjReferences/CMakeLists_files.cmake b/ApplicationLibCode/Commands/OperationsUsingObjReferences/CMakeLists_files.cmake index 35106e62b9..17cc4b61ba 100644 --- a/ApplicationLibCode/Commands/OperationsUsingObjReferences/CMakeLists_files.cmake +++ b/ApplicationLibCode/Commands/OperationsUsingObjReferences/CMakeLists_files.cmake @@ -1,32 +1,26 @@ +set(SOURCE_GROUP_HEADER_FILES + ${CMAKE_CURRENT_LIST_DIR}/RicCopyReferencesToClipboardFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicCutReferencesToClipboardFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicPasteFeatureImpl.h + ${CMAKE_CURRENT_LIST_DIR}/RicPasteEclipseCasesFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicPasteEclipseViewsFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicPasteGeoMechViewsFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicPasteIntersectionsFeature.h) -set (SOURCE_GROUP_HEADER_FILES -${CMAKE_CURRENT_LIST_DIR}/RicCopyReferencesToClipboardFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicCutReferencesToClipboardFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicPasteFeatureImpl.h +set(SOURCE_GROUP_SOURCE_FILES + ${CMAKE_CURRENT_LIST_DIR}/RicCopyReferencesToClipboardFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicCutReferencesToClipboardFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicPasteFeatureImpl.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicPasteEclipseCasesFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicPasteEclipseViewsFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicPasteGeoMechViewsFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicPasteIntersectionsFeature.cpp) -${CMAKE_CURRENT_LIST_DIR}/RicPasteEclipseCasesFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicPasteEclipseViewsFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicPasteGeoMechViewsFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicPasteIntersectionsFeature.h -) +list(APPEND COMMAND_CODE_HEADER_FILES ${SOURCE_GROUP_HEADER_FILES}) -set (SOURCE_GROUP_SOURCE_FILES -${CMAKE_CURRENT_LIST_DIR}/RicCopyReferencesToClipboardFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicCutReferencesToClipboardFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicPasteFeatureImpl.cpp +list(APPEND COMMAND_CODE_SOURCE_FILES ${SOURCE_GROUP_SOURCE_FILES}) -${CMAKE_CURRENT_LIST_DIR}/RicPasteEclipseCasesFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicPasteEclipseViewsFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicPasteGeoMechViewsFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicPasteIntersectionsFeature.cpp -) - -list(APPEND COMMAND_CODE_HEADER_FILES -${SOURCE_GROUP_HEADER_FILES} -) - -list(APPEND COMMAND_CODE_SOURCE_FILES -${SOURCE_GROUP_SOURCE_FILES} -) - -source_group( "CommandFeature\\ObjReferences" FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake ) +source_group( + "CommandFeature\\ObjReferences" + FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} + ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake) diff --git a/ApplicationLibCode/Commands/PlotTemplateCommands/CMakeLists_files.cmake b/ApplicationLibCode/Commands/PlotTemplateCommands/CMakeLists_files.cmake index c0d8a635a9..237993ca65 100644 --- a/ApplicationLibCode/Commands/PlotTemplateCommands/CMakeLists_files.cmake +++ b/ApplicationLibCode/Commands/PlotTemplateCommands/CMakeLists_files.cmake @@ -1,34 +1,28 @@ +set(SOURCE_GROUP_HEADER_FILES + ${CMAKE_CURRENT_LIST_DIR}/RicSavePlotTemplateFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicCreatePlotFromSelectionFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicSelectPlotTemplateUi.h + ${CMAKE_CURRENT_LIST_DIR}/RicSummaryPlotTemplateTools.h + ${CMAKE_CURRENT_LIST_DIR}/RicReloadPlotTemplatesFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicCreatePlotFromTemplateFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicCreatePlotFromTemplateByShortcutFeature.h) -set (SOURCE_GROUP_HEADER_FILES -${CMAKE_CURRENT_LIST_DIR}/RicSavePlotTemplateFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicCreatePlotFromSelectionFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicSelectPlotTemplateUi.h -${CMAKE_CURRENT_LIST_DIR}/RicSummaryPlotTemplateTools.h -${CMAKE_CURRENT_LIST_DIR}/RicReloadPlotTemplatesFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicCreatePlotFromTemplateFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicCreatePlotFromTemplateByShortcutFeature.h -) +set(SOURCE_GROUP_SOURCE_FILES + ${CMAKE_CURRENT_LIST_DIR}/RicSavePlotTemplateFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicCreatePlotFromSelectionFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicSelectPlotTemplateUi.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicSummaryPlotTemplateTools.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicReloadPlotTemplatesFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicCreatePlotFromTemplateFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicCreatePlotFromTemplateByShortcutFeature.cpp) -set (SOURCE_GROUP_SOURCE_FILES -${CMAKE_CURRENT_LIST_DIR}/RicSavePlotTemplateFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicCreatePlotFromSelectionFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicSelectPlotTemplateUi.cpp -${CMAKE_CURRENT_LIST_DIR}/RicSummaryPlotTemplateTools.cpp -${CMAKE_CURRENT_LIST_DIR}/RicReloadPlotTemplatesFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicCreatePlotFromTemplateFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicCreatePlotFromTemplateByShortcutFeature.cpp -) +list(APPEND COMMAND_CODE_HEADER_FILES ${SOURCE_GROUP_HEADER_FILES}) -list(APPEND COMMAND_CODE_HEADER_FILES -${SOURCE_GROUP_HEADER_FILES} -) +list(APPEND COMMAND_CODE_SOURCE_FILES ${SOURCE_GROUP_SOURCE_FILES}) -list(APPEND COMMAND_CODE_SOURCE_FILES -${SOURCE_GROUP_SOURCE_FILES} -) - -list(APPEND COMMAND_QT_MOC_HEADERS -) - -source_group( "CommandFeature\\PlotTemplate" FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake ) +list(APPEND COMMAND_QT_MOC_HEADERS) +source_group( + "CommandFeature\\PlotTemplate" + FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} + ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake) diff --git a/ApplicationLibCode/Commands/SsiHubImportCommands/CMakeLists_files.cmake b/ApplicationLibCode/Commands/SsiHubImportCommands/CMakeLists_files.cmake index 3de66c1113..2e95491929 100644 --- a/ApplicationLibCode/Commands/SsiHubImportCommands/CMakeLists_files.cmake +++ b/ApplicationLibCode/Commands/SsiHubImportCommands/CMakeLists_files.cmake @@ -1,32 +1,27 @@ +set(SOURCE_GROUP_HEADER_FILES + ${CMAKE_CURRENT_LIST_DIR}/RicWellPathsImportSsihubFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RimOilFieldEntry.h + ${CMAKE_CURRENT_LIST_DIR}/RimOilRegionEntry.h + ${CMAKE_CURRENT_LIST_DIR}/RimWellPathImport.h + ${CMAKE_CURRENT_LIST_DIR}/RimWellsEntry.h + ${CMAKE_CURRENT_LIST_DIR}/RiuWellImportWizard.h) -set (SOURCE_GROUP_HEADER_FILES -${CMAKE_CURRENT_LIST_DIR}/RicWellPathsImportSsihubFeature.h -${CMAKE_CURRENT_LIST_DIR}/RimOilFieldEntry.h -${CMAKE_CURRENT_LIST_DIR}/RimOilRegionEntry.h -${CMAKE_CURRENT_LIST_DIR}/RimWellPathImport.h -${CMAKE_CURRENT_LIST_DIR}/RimWellsEntry.h -${CMAKE_CURRENT_LIST_DIR}/RiuWellImportWizard.h -) +set(SOURCE_GROUP_SOURCE_FILES + ${CMAKE_CURRENT_LIST_DIR}/RicWellPathsImportSsihubFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimOilFieldEntry.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimOilRegionEntry.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimWellPathImport.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimWellsEntry.cpp + ${CMAKE_CURRENT_LIST_DIR}/RiuWellImportWizard.cpp) -set (SOURCE_GROUP_SOURCE_FILES -${CMAKE_CURRENT_LIST_DIR}/RicWellPathsImportSsihubFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RimOilFieldEntry.cpp -${CMAKE_CURRENT_LIST_DIR}/RimOilRegionEntry.cpp -${CMAKE_CURRENT_LIST_DIR}/RimWellPathImport.cpp -${CMAKE_CURRENT_LIST_DIR}/RimWellsEntry.cpp -${CMAKE_CURRENT_LIST_DIR}/RiuWellImportWizard.cpp -) +list(APPEND COMMAND_CODE_HEADER_FILES ${SOURCE_GROUP_HEADER_FILES}) -list(APPEND COMMAND_CODE_HEADER_FILES -${SOURCE_GROUP_HEADER_FILES} -) - -list(APPEND COMMAND_CODE_SOURCE_FILES -${SOURCE_GROUP_SOURCE_FILES} -) +list(APPEND COMMAND_CODE_SOURCE_FILES ${SOURCE_GROUP_SOURCE_FILES}) list(APPEND COMMAND_QT_MOC_HEADERS -${CMAKE_CURRENT_LIST_DIR}/RiuWellImportWizard.h -) + ${CMAKE_CURRENT_LIST_DIR}/RiuWellImportWizard.h) -source_group( "CommandFeature\\SsiHub" FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake ) +source_group( + "CommandFeature\\SsiHub" + FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} + ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake) diff --git a/ApplicationLibCode/Commands/StreamlineCommands/CMakeLists_files.cmake b/ApplicationLibCode/Commands/StreamlineCommands/CMakeLists_files.cmake index e1388bbc5a..9de871fe94 100644 --- a/ApplicationLibCode/Commands/StreamlineCommands/CMakeLists_files.cmake +++ b/ApplicationLibCode/Commands/StreamlineCommands/CMakeLists_files.cmake @@ -1,18 +1,14 @@ +set(SOURCE_GROUP_HEADER_FILES + ${CMAKE_CURRENT_LIST_DIR}/RicNewStreamlineFeature.h) -set (SOURCE_GROUP_HEADER_FILES -${CMAKE_CURRENT_LIST_DIR}/RicNewStreamlineFeature.h -) +set(SOURCE_GROUP_SOURCE_FILES + ${CMAKE_CURRENT_LIST_DIR}/RicNewStreamlineFeature.cpp) -set (SOURCE_GROUP_SOURCE_FILES -${CMAKE_CURRENT_LIST_DIR}/RicNewStreamlineFeature.cpp -) +list(APPEND COMMAND_CODE_HEADER_FILES ${SOURCE_GROUP_HEADER_FILES}) -list(APPEND COMMAND_CODE_HEADER_FILES -${SOURCE_GROUP_HEADER_FILES} -) +list(APPEND COMMAND_CODE_SOURCE_FILES ${SOURCE_GROUP_SOURCE_FILES}) -list(APPEND COMMAND_CODE_SOURCE_FILES -${SOURCE_GROUP_SOURCE_FILES} -) - -source_group( "CommandFeature\\StreamlineCommands" FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake ) +source_group( + "CommandFeature\\StreamlineCommands" + FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} + ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake) diff --git a/ApplicationLibCode/Commands/SummaryPlotCommands/CMakeLists_files.cmake b/ApplicationLibCode/Commands/SummaryPlotCommands/CMakeLists_files.cmake index d7571f18dd..5e93b248a9 100644 --- a/ApplicationLibCode/Commands/SummaryPlotCommands/CMakeLists_files.cmake +++ b/ApplicationLibCode/Commands/SummaryPlotCommands/CMakeLists_files.cmake @@ -1,111 +1,108 @@ +set(SOURCE_GROUP_HEADER_FILES + ${CMAKE_CURRENT_LIST_DIR}/RicNewSummaryPlotFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicNewDefaultSummaryPlotFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicNewSummaryCrossPlotFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicNewSummaryCurveFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicSummaryPlotFeatureImpl.h + ${CMAKE_CURRENT_LIST_DIR}/RicDuplicateSummaryPlotFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicDuplicateSummaryCurveFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicDuplicateSummaryCrossPlotFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicDuplicateSummaryCrossPlotCurveFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicPasteAsciiDataToSummaryPlotFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicPasteAsciiDataToSummaryPlotFeatureUi.h + ${CMAKE_CURRENT_LIST_DIR}/RicViewZoomAllFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicSummaryCurveSwitchAxisFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicPasteSummaryPlotFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicPasteSummaryCrossPlotFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicPasteSummaryCurveFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicPasteSummaryCrossPlotCurveFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicPasteSummaryCaseFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicAsciiExportSummaryPlotFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicNewGridTimeHistoryCurveFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicSelectSummaryPlotUI.h + ${CMAKE_CURRENT_LIST_DIR}/RicPasteTimeHistoryCurveFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicPasteAsciiDataCurveFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicEditSummaryPlotFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicEditSummaryCrossPlotFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicSummaryPlotEditorUi.h + ${CMAKE_CURRENT_LIST_DIR}/RicSummaryPlotEditorWidgetCreator.h + ${CMAKE_CURRENT_LIST_DIR}/RicSummaryPlotEditorDialog.h + ${CMAKE_CURRENT_LIST_DIR}/RicShowSummaryCurveCalculatorFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicEditSummaryCurveCalculationFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicSummaryCurveCalculatorDialog.h + ${CMAKE_CURRENT_LIST_DIR}/RicSummaryCurveCalculatorWidgetCreator.h + ${CMAKE_CURRENT_LIST_DIR}/RicSummaryCurveCalculatorUi.h + ${CMAKE_CURRENT_LIST_DIR}/RicNewSummaryCrossPlotCurveFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicNewSummaryEnsembleCurveSetFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicPasteEnsembleCurveSetFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicNewEnsembleCurveFilterFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicNewDerivedEnsembleFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicClearSourceSteppingSummaryCurveFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicSetSourceSteppingSummaryCurveFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicClearSourceSteppingEnsembleCurveSetFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicSetSourceSteppingEnsembleCurveSetFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicActivateCurveFilterInToolbarFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicNewDerivedSummaryFeature.h) -set (SOURCE_GROUP_HEADER_FILES -${CMAKE_CURRENT_LIST_DIR}/RicNewSummaryPlotFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicNewDefaultSummaryPlotFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicNewSummaryCrossPlotFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicNewSummaryCurveFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicSummaryPlotFeatureImpl.h -${CMAKE_CURRENT_LIST_DIR}/RicDuplicateSummaryPlotFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicDuplicateSummaryCurveFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicDuplicateSummaryCrossPlotFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicDuplicateSummaryCrossPlotCurveFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicPasteAsciiDataToSummaryPlotFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicPasteAsciiDataToSummaryPlotFeatureUi.h -${CMAKE_CURRENT_LIST_DIR}/RicViewZoomAllFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicSummaryCurveSwitchAxisFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicPasteSummaryPlotFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicPasteSummaryCrossPlotFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicPasteSummaryCurveFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicPasteSummaryCrossPlotCurveFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicPasteSummaryCaseFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicAsciiExportSummaryPlotFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicNewGridTimeHistoryCurveFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicSelectSummaryPlotUI.h -${CMAKE_CURRENT_LIST_DIR}/RicPasteTimeHistoryCurveFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicPasteAsciiDataCurveFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicEditSummaryPlotFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicEditSummaryCrossPlotFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicSummaryPlotEditorUi.h -${CMAKE_CURRENT_LIST_DIR}/RicSummaryPlotEditorWidgetCreator.h -${CMAKE_CURRENT_LIST_DIR}/RicSummaryPlotEditorDialog.h -${CMAKE_CURRENT_LIST_DIR}/RicShowSummaryCurveCalculatorFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicEditSummaryCurveCalculationFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicSummaryCurveCalculatorDialog.h -${CMAKE_CURRENT_LIST_DIR}/RicSummaryCurveCalculatorWidgetCreator.h -${CMAKE_CURRENT_LIST_DIR}/RicSummaryCurveCalculatorUi.h -${CMAKE_CURRENT_LIST_DIR}/RicNewSummaryCrossPlotCurveFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicNewSummaryEnsembleCurveSetFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicPasteEnsembleCurveSetFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicNewEnsembleCurveFilterFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicNewDerivedEnsembleFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicClearSourceSteppingSummaryCurveFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicSetSourceSteppingSummaryCurveFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicClearSourceSteppingEnsembleCurveSetFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicSetSourceSteppingEnsembleCurveSetFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicActivateCurveFilterInToolbarFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicNewDerivedSummaryFeature.h -) +set(SOURCE_GROUP_SOURCE_FILES + ${CMAKE_CURRENT_LIST_DIR}/RicNewSummaryPlotFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicNewDefaultSummaryPlotFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicNewSummaryCrossPlotFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicNewSummaryCurveFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicSummaryPlotFeatureImpl.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicDuplicateSummaryPlotFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicDuplicateSummaryCurveFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicDuplicateSummaryCrossPlotFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicDuplicateSummaryCrossPlotCurveFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicPasteAsciiDataToSummaryPlotFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicPasteAsciiDataToSummaryPlotFeatureUi.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicViewZoomAllFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicSummaryCurveSwitchAxisFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicPasteSummaryPlotFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicPasteSummaryCrossPlotFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicPasteSummaryCurveFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicPasteSummaryCrossPlotCurveFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicPasteSummaryCaseFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicAsciiExportSummaryPlotFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicNewGridTimeHistoryCurveFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicSelectSummaryPlotUI.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicPasteTimeHistoryCurveFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicPasteAsciiDataCurveFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicEditSummaryPlotFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicEditSummaryCrossPlotFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicSummaryPlotEditorUi.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicSummaryPlotEditorWidgetCreator.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicSummaryPlotEditorDialog.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicShowSummaryCurveCalculatorFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicEditSummaryCurveCalculationFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicSummaryCurveCalculatorDialog.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicSummaryCurveCalculatorWidgetCreator.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicSummaryCurveCalculatorUi.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicNewSummaryCrossPlotCurveFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicNewSummaryEnsembleCurveSetFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicPasteEnsembleCurveSetFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicNewEnsembleCurveFilterFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicNewDerivedEnsembleFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicClearSourceSteppingSummaryCurveFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicSetSourceSteppingSummaryCurveFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicClearSourceSteppingEnsembleCurveSetFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicSetSourceSteppingEnsembleCurveSetFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicActivateCurveFilterInToolbarFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicNewDerivedSummaryFeature.cpp) -set (SOURCE_GROUP_SOURCE_FILES -${CMAKE_CURRENT_LIST_DIR}/RicNewSummaryPlotFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicNewDefaultSummaryPlotFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicNewSummaryCrossPlotFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicNewSummaryCurveFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicSummaryPlotFeatureImpl.cpp -${CMAKE_CURRENT_LIST_DIR}/RicDuplicateSummaryPlotFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicDuplicateSummaryCurveFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicDuplicateSummaryCrossPlotFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicDuplicateSummaryCrossPlotCurveFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicPasteAsciiDataToSummaryPlotFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicPasteAsciiDataToSummaryPlotFeatureUi.cpp -${CMAKE_CURRENT_LIST_DIR}/RicViewZoomAllFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicSummaryCurveSwitchAxisFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicPasteSummaryPlotFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicPasteSummaryCrossPlotFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicPasteSummaryCurveFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicPasteSummaryCrossPlotCurveFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicPasteSummaryCaseFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicAsciiExportSummaryPlotFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicNewGridTimeHistoryCurveFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicSelectSummaryPlotUI.cpp -${CMAKE_CURRENT_LIST_DIR}/RicPasteTimeHistoryCurveFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicPasteAsciiDataCurveFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicEditSummaryPlotFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicEditSummaryCrossPlotFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicSummaryPlotEditorUi.cpp -${CMAKE_CURRENT_LIST_DIR}/RicSummaryPlotEditorWidgetCreator.cpp -${CMAKE_CURRENT_LIST_DIR}/RicSummaryPlotEditorDialog.cpp -${CMAKE_CURRENT_LIST_DIR}/RicShowSummaryCurveCalculatorFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicEditSummaryCurveCalculationFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicSummaryCurveCalculatorDialog.cpp -${CMAKE_CURRENT_LIST_DIR}/RicSummaryCurveCalculatorWidgetCreator.cpp -${CMAKE_CURRENT_LIST_DIR}/RicSummaryCurveCalculatorUi.cpp -${CMAKE_CURRENT_LIST_DIR}/RicNewSummaryCrossPlotCurveFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicNewSummaryEnsembleCurveSetFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicPasteEnsembleCurveSetFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicNewEnsembleCurveFilterFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicNewDerivedEnsembleFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicClearSourceSteppingSummaryCurveFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicSetSourceSteppingSummaryCurveFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicClearSourceSteppingEnsembleCurveSetFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicSetSourceSteppingEnsembleCurveSetFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicActivateCurveFilterInToolbarFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicNewDerivedSummaryFeature.cpp -) +list(APPEND COMMAND_CODE_HEADER_FILES ${SOURCE_GROUP_HEADER_FILES}) -list(APPEND COMMAND_CODE_HEADER_FILES -${SOURCE_GROUP_HEADER_FILES} -) +list(APPEND COMMAND_CODE_SOURCE_FILES ${SOURCE_GROUP_SOURCE_FILES}) -list(APPEND COMMAND_CODE_SOURCE_FILES -${SOURCE_GROUP_SOURCE_FILES} -) +list( + APPEND + COMMAND_QT_MOC_HEADERS + ${CMAKE_CURRENT_LIST_DIR}/RicSummaryPlotEditorWidgetCreator.h + ${CMAKE_CURRENT_LIST_DIR}/RicSummaryPlotEditorDialog.h + ${CMAKE_CURRENT_LIST_DIR}/RicSummaryCurveCalculatorWidgetCreator.h + ${CMAKE_CURRENT_LIST_DIR}/RicSummaryCurveCalculatorDialog.h) -list(APPEND COMMAND_QT_MOC_HEADERS -${CMAKE_CURRENT_LIST_DIR}/RicSummaryPlotEditorWidgetCreator.h -${CMAKE_CURRENT_LIST_DIR}/RicSummaryPlotEditorDialog.h -${CMAKE_CURRENT_LIST_DIR}/RicSummaryCurveCalculatorWidgetCreator.h -${CMAKE_CURRENT_LIST_DIR}/RicSummaryCurveCalculatorDialog.h -) - -source_group( "CommandFeature\\SummaryPlot" FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake ) +source_group( + "CommandFeature\\SummaryPlot" + FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} + ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake) diff --git a/ApplicationLibCode/Commands/SurfaceCommands/CMakeLists_files.cmake b/ApplicationLibCode/Commands/SurfaceCommands/CMakeLists_files.cmake index 3377f29986..0ccb294650 100644 --- a/ApplicationLibCode/Commands/SurfaceCommands/CMakeLists_files.cmake +++ b/ApplicationLibCode/Commands/SurfaceCommands/CMakeLists_files.cmake @@ -1,36 +1,29 @@ +set(SOURCE_GROUP_HEADER_FILES + ${CMAKE_CURRENT_LIST_DIR}/RicImportSurfacesFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicReloadSurfaceFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicCopySurfaceFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicNewGridCaseSurfaceFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicExportKLayerToPtlFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicExportSurfaceToTsurfFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicNewSurfaceCollectionFeature.h) -set (SOURCE_GROUP_HEADER_FILES -${CMAKE_CURRENT_LIST_DIR}/RicImportSurfacesFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicReloadSurfaceFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicCopySurfaceFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicNewGridCaseSurfaceFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicExportKLayerToPtlFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicExportSurfaceToTsurfFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicNewSurfaceCollectionFeature.h -) +set(SOURCE_GROUP_SOURCE_FILES + ${CMAKE_CURRENT_LIST_DIR}/RicImportSurfacesFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicReloadSurfaceFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicCopySurfaceFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicNewGridCaseSurfaceFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicExportKLayerToPtlFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicExportSurfaceToTsurfFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicNewSurfaceCollectionFeature.cpp) -set (SOURCE_GROUP_SOURCE_FILES -${CMAKE_CURRENT_LIST_DIR}/RicImportSurfacesFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicReloadSurfaceFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicCopySurfaceFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicNewGridCaseSurfaceFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicExportKLayerToPtlFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicExportSurfaceToTsurfFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicNewSurfaceCollectionFeature.cpp -) +list(APPEND COMMAND_CODE_HEADER_FILES ${SOURCE_GROUP_HEADER_FILES}) -list(APPEND COMMAND_CODE_HEADER_FILES -${SOURCE_GROUP_HEADER_FILES} -) +list(APPEND COMMAND_CODE_SOURCE_FILES ${SOURCE_GROUP_SOURCE_FILES}) -list(APPEND COMMAND_CODE_SOURCE_FILES -${SOURCE_GROUP_SOURCE_FILES} -) +# set (COMMAND_QT_MOC_HEADERS ${COMMAND_QT_MOC_HEADERS} +# ${CMAKE_CURRENT_LIST_DIR}/RicTextAnnotation3dEditor.h ) -#set (COMMAND_QT_MOC_HEADERS -#${COMMAND_QT_MOC_HEADERS} -#${CMAKE_CURRENT_LIST_DIR}/RicTextAnnotation3dEditor.h -#) - - -source_group( "CommandFeature\\SurfaceCommands" FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake ) +source_group( + "CommandFeature\\SurfaceCommands" + FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} + ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake) diff --git a/ApplicationLibCode/Commands/ToggleCommands/CMakeLists_files.cmake b/ApplicationLibCode/Commands/ToggleCommands/CMakeLists_files.cmake index 05a4eddcec..7bf1c71b13 100644 --- a/ApplicationLibCode/Commands/ToggleCommands/CMakeLists_files.cmake +++ b/ApplicationLibCode/Commands/ToggleCommands/CMakeLists_files.cmake @@ -1,30 +1,26 @@ +set(SOURCE_GROUP_HEADER_FILES + ${CMAKE_CURRENT_LIST_DIR}/RicToggleItemsFeatureImpl.h + ${CMAKE_CURRENT_LIST_DIR}/RicToggleItemsOnFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicToggleItemsOffFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicToggleItemsFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicToggleItemsOnOthersOffFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicCollapseSiblingsFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicMoveItemsToTopFeature.h) -set (SOURCE_GROUP_HEADER_FILES -${CMAKE_CURRENT_LIST_DIR}/RicToggleItemsFeatureImpl.h -${CMAKE_CURRENT_LIST_DIR}/RicToggleItemsOnFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicToggleItemsOffFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicToggleItemsFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicToggleItemsOnOthersOffFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicCollapseSiblingsFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicMoveItemsToTopFeature.h -) +set(SOURCE_GROUP_SOURCE_FILES + ${CMAKE_CURRENT_LIST_DIR}/RicToggleItemsFeatureImpl.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicToggleItemsOnFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicToggleItemsOffFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicToggleItemsFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicToggleItemsOnOthersOffFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicCollapseSiblingsFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicMoveItemsToTopFeature.cpp) -set (SOURCE_GROUP_SOURCE_FILES -${CMAKE_CURRENT_LIST_DIR}/RicToggleItemsFeatureImpl.cpp -${CMAKE_CURRENT_LIST_DIR}/RicToggleItemsOnFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicToggleItemsOffFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicToggleItemsFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicToggleItemsOnOthersOffFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicCollapseSiblingsFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicMoveItemsToTopFeature.cpp -) +list(APPEND COMMAND_CODE_HEADER_FILES ${SOURCE_GROUP_HEADER_FILES}) -list(APPEND COMMAND_CODE_HEADER_FILES -${SOURCE_GROUP_HEADER_FILES} -) +list(APPEND COMMAND_CODE_SOURCE_FILES ${SOURCE_GROUP_SOURCE_FILES}) -list(APPEND COMMAND_CODE_SOURCE_FILES -${SOURCE_GROUP_SOURCE_FILES} -) - -source_group( "CommandFeature\\ToggleItems" FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake ) +source_group( + "CommandFeature\\ToggleItems" + FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} + ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake) diff --git a/ApplicationLibCode/Commands/ViewLink/CMakeLists_files.cmake b/ApplicationLibCode/Commands/ViewLink/CMakeLists_files.cmake index c8c5d91265..ab41db106c 100644 --- a/ApplicationLibCode/Commands/ViewLink/CMakeLists_files.cmake +++ b/ApplicationLibCode/Commands/ViewLink/CMakeLists_files.cmake @@ -1,36 +1,32 @@ +set(SOURCE_GROUP_HEADER_FILES + ${CMAKE_CURRENT_LIST_DIR}/RicLinkVisibleViewsFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicLinkVisibleViewsFeatureUi.h + ${CMAKE_CURRENT_LIST_DIR}/RicShowAllLinkedViewsFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicLinkViewFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicUnLinkViewFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicShowLinkOptionsFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicDeleteAllLinkedViewsFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicSetMasterViewFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicRemoveComparison3dViewFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicCompareTo3dViewFeature.h) -set (SOURCE_GROUP_HEADER_FILES -${CMAKE_CURRENT_LIST_DIR}/RicLinkVisibleViewsFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicLinkVisibleViewsFeatureUi.h -${CMAKE_CURRENT_LIST_DIR}/RicShowAllLinkedViewsFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicLinkViewFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicUnLinkViewFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicShowLinkOptionsFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicDeleteAllLinkedViewsFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicSetMasterViewFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicRemoveComparison3dViewFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicCompareTo3dViewFeature.h -) +set(SOURCE_GROUP_SOURCE_FILES + ${CMAKE_CURRENT_LIST_DIR}/RicLinkVisibleViewsFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicLinkVisibleViewsFeatureUi.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicShowAllLinkedViewsFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicLinkViewFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicUnLinkViewFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicShowLinkOptionsFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicDeleteAllLinkedViewsFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicSetMasterViewFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicRemoveComparison3dViewFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicCompareTo3dViewFeature.cpp) -set (SOURCE_GROUP_SOURCE_FILES -${CMAKE_CURRENT_LIST_DIR}/RicLinkVisibleViewsFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicLinkVisibleViewsFeatureUi.cpp -${CMAKE_CURRENT_LIST_DIR}/RicShowAllLinkedViewsFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicLinkViewFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicUnLinkViewFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicShowLinkOptionsFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicDeleteAllLinkedViewsFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicSetMasterViewFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicRemoveComparison3dViewFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicCompareTo3dViewFeature.cpp -) +list(APPEND COMMAND_CODE_HEADER_FILES ${SOURCE_GROUP_HEADER_FILES}) -list(APPEND COMMAND_CODE_HEADER_FILES -${SOURCE_GROUP_HEADER_FILES} -) +list(APPEND COMMAND_CODE_SOURCE_FILES ${SOURCE_GROUP_SOURCE_FILES}) -list(APPEND COMMAND_CODE_SOURCE_FILES -${SOURCE_GROUP_SOURCE_FILES} -) - -source_group( "CommandFeature\\ViewLink" FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake ) +source_group( + "CommandFeature\\ViewLink" + FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} + ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake) diff --git a/ApplicationLibCode/Commands/WellLogCommands/CMakeLists_files.cmake b/ApplicationLibCode/Commands/WellLogCommands/CMakeLists_files.cmake index a67a93710c..e7460e12e6 100644 --- a/ApplicationLibCode/Commands/WellLogCommands/CMakeLists_files.cmake +++ b/ApplicationLibCode/Commands/WellLogCommands/CMakeLists_files.cmake @@ -1,72 +1,68 @@ +set(SOURCE_GROUP_HEADER_FILES + ${CMAKE_CURRENT_LIST_DIR}/RicAddWellLogToPlotFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicNewWellLogCurveExtractionFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicNewWellLogRftCurveFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicNewRftPlotFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicNewPltPlotFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicNewWellLogFileCurveFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicNewWellLogPlotFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicNewWellLogPlotFeatureImpl.h + ${CMAKE_CURRENT_LIST_DIR}/RicNewWellLogPlotTrackFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicWellLogPlotCurveFeatureImpl.h + ${CMAKE_CURRENT_LIST_DIR}/RicWellLogsImportFileFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicDeleteSubPlotFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicWellLogPlotTrackFeatureImpl.h + ${CMAKE_CURRENT_LIST_DIR}/RicPasteWellLogCurveFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicPasteWellLogTrackFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicPasteWellLogPlotFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicChangeDataSourceFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicAsciiExportWellLogPlotFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicWellLogFileCloseFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicMoveWellLogFilesFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicAdd3dWellLogCurveFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicAdd3dWellLogFileCurveFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicAdd3dWellLogRftCurveFeature.h + ${CMAKE_CURRENT_LIST_DIR}/Ric3dWellLogCurveDeleteFeature.h + ${CMAKE_CURRENT_LIST_DIR}/Ric3dWellLogCurvePickEventHandler.h + ${CMAKE_CURRENT_LIST_DIR}/RicNewWellBoreStabilityPlotFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicNewWellMeasurementCurveFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicNewEnsembleWellLogCurveSetFeature.h) -set (SOURCE_GROUP_HEADER_FILES -${CMAKE_CURRENT_LIST_DIR}/RicAddWellLogToPlotFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicNewWellLogCurveExtractionFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicNewWellLogRftCurveFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicNewRftPlotFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicNewPltPlotFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicNewWellLogFileCurveFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicNewWellLogPlotFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicNewWellLogPlotFeatureImpl.h -${CMAKE_CURRENT_LIST_DIR}/RicNewWellLogPlotTrackFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicWellLogPlotCurveFeatureImpl.h -${CMAKE_CURRENT_LIST_DIR}/RicWellLogsImportFileFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicDeleteSubPlotFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicWellLogPlotTrackFeatureImpl.h -${CMAKE_CURRENT_LIST_DIR}/RicPasteWellLogCurveFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicPasteWellLogTrackFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicPasteWellLogPlotFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicChangeDataSourceFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicAsciiExportWellLogPlotFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicWellLogFileCloseFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicMoveWellLogFilesFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicAdd3dWellLogCurveFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicAdd3dWellLogFileCurveFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicAdd3dWellLogRftCurveFeature.h -${CMAKE_CURRENT_LIST_DIR}/Ric3dWellLogCurveDeleteFeature.h -${CMAKE_CURRENT_LIST_DIR}/Ric3dWellLogCurvePickEventHandler.h -${CMAKE_CURRENT_LIST_DIR}/RicNewWellBoreStabilityPlotFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicNewWellMeasurementCurveFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicNewEnsembleWellLogCurveSetFeature.h -) +set(SOURCE_GROUP_SOURCE_FILES + ${CMAKE_CURRENT_LIST_DIR}/RicAddWellLogToPlotFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicNewWellLogCurveExtractionFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicNewWellLogRftCurveFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicNewRftPlotFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicNewPltPlotFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicNewWellLogFileCurveFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicNewWellLogPlotFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicNewWellLogPlotFeatureImpl.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicNewWellLogPlotTrackFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicWellLogPlotCurveFeatureImpl.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicWellLogsImportFileFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicDeleteSubPlotFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicWellLogPlotTrackFeatureImpl.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicPasteWellLogCurveFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicPasteWellLogTrackFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicPasteWellLogPlotFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicChangeDataSourceFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicAsciiExportWellLogPlotFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicWellLogFileCloseFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicMoveWellLogFilesFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicAdd3dWellLogCurveFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicAdd3dWellLogFileCurveFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicAdd3dWellLogRftCurveFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/Ric3dWellLogCurveDeleteFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/Ric3dWellLogCurvePickEventHandler.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicNewWellBoreStabilityPlotFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicNewWellMeasurementCurveFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicNewEnsembleWellLogCurveSetFeature.cpp) -set (SOURCE_GROUP_SOURCE_FILES -${CMAKE_CURRENT_LIST_DIR}/RicAddWellLogToPlotFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicNewWellLogCurveExtractionFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicNewWellLogRftCurveFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicNewRftPlotFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicNewPltPlotFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicNewWellLogFileCurveFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicNewWellLogPlotFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicNewWellLogPlotFeatureImpl.cpp -${CMAKE_CURRENT_LIST_DIR}/RicNewWellLogPlotTrackFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicWellLogPlotCurveFeatureImpl.cpp -${CMAKE_CURRENT_LIST_DIR}/RicWellLogsImportFileFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicDeleteSubPlotFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicWellLogPlotTrackFeatureImpl.cpp -${CMAKE_CURRENT_LIST_DIR}/RicPasteWellLogCurveFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicPasteWellLogTrackFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicPasteWellLogPlotFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicChangeDataSourceFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicAsciiExportWellLogPlotFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicWellLogFileCloseFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicMoveWellLogFilesFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicAdd3dWellLogCurveFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicAdd3dWellLogFileCurveFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicAdd3dWellLogRftCurveFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/Ric3dWellLogCurveDeleteFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/Ric3dWellLogCurvePickEventHandler.cpp -${CMAKE_CURRENT_LIST_DIR}/RicNewWellBoreStabilityPlotFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicNewWellMeasurementCurveFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicNewEnsembleWellLogCurveSetFeature.cpp -) +list(APPEND COMMAND_CODE_HEADER_FILES ${SOURCE_GROUP_HEADER_FILES}) -list(APPEND COMMAND_CODE_HEADER_FILES -${SOURCE_GROUP_HEADER_FILES} -) +list(APPEND COMMAND_CODE_SOURCE_FILES ${SOURCE_GROUP_SOURCE_FILES}) -list(APPEND COMMAND_CODE_SOURCE_FILES -${SOURCE_GROUP_SOURCE_FILES} -) - -source_group( "CommandFeature\\WellLog" FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake ) +source_group( + "CommandFeature\\WellLog" + FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} + ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake) diff --git a/ApplicationLibCode/Commands/WellPathCommands/CMakeLists_files.cmake b/ApplicationLibCode/Commands/WellPathCommands/CMakeLists_files.cmake index c79c3c167f..8b01b186fc 100644 --- a/ApplicationLibCode/Commands/WellPathCommands/CMakeLists_files.cmake +++ b/ApplicationLibCode/Commands/WellPathCommands/CMakeLists_files.cmake @@ -1,87 +1,86 @@ - -set (SOURCE_GROUP_HEADER_FILES -${CMAKE_CURRENT_LIST_DIR}/RicImportWellPaths.h -${CMAKE_CURRENT_LIST_DIR}/RicNewEditableWellPathFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicShowWellPlanFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicNewWellPathListTargetFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicNewWellPathAttributeFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicDeleteWellPathTargetFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicDeleteWellPathAttributeFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicDeleteWellPathFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicWellPathsUnitSystemSettingsImpl.h -${CMAKE_CURRENT_LIST_DIR}/RicWellPathsUnitSystemSettingsUi.h -${CMAKE_CURRENT_LIST_DIR}/RicWellPathPickEventHandler.h -${CMAKE_CURRENT_LIST_DIR}/RicCreateWellTargetsPickEventHandler.h -${CMAKE_CURRENT_LIST_DIR}/RicIntersectionPickEventHandler.h -${CMAKE_CURRENT_LIST_DIR}/RicWellPathFormationsImportFileFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicPolylineTargetsPickEventHandler.h -${CMAKE_CURRENT_LIST_DIR}/RicNewPolylineTargetFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicDeletePolylineTargetFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicImportWellMeasurementsFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicNewWellPathLateralAtDepthFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicNewWellPathLateralFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicPasteModeledWellPathFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicCreateMultipleWellPathLaterals.h -${CMAKE_CURRENT_LIST_DIR}/RicCreateMultipleWellPathLateralsUi.h -${CMAKE_CURRENT_LIST_DIR}/RicLinkWellPathFeature.h -${CMAKE_CURRENT_LIST_DIR}/PointTangentManipulator/Ric3dObjectEditorHandle.h -${CMAKE_CURRENT_LIST_DIR}/PointTangentManipulator/RicPointTangentManipulator.h -${CMAKE_CURRENT_LIST_DIR}/PointTangentManipulator/RicWellTarget3dEditor.h -${CMAKE_CURRENT_LIST_DIR}/PointTangentManipulator/RicWellPathGeometry3dEditor.h -${CMAKE_CURRENT_LIST_DIR}/PointTangentManipulator/RicPointTangentManipulatorPartMgr.h -${CMAKE_CURRENT_LIST_DIR}/PointTangentManipulator/RicPolyline3dEditor.h -${CMAKE_CURRENT_LIST_DIR}/PointTangentManipulator/RicPolylineTarget3dEditor.h +set(SOURCE_GROUP_HEADER_FILES + ${CMAKE_CURRENT_LIST_DIR}/RicImportWellPaths.h + ${CMAKE_CURRENT_LIST_DIR}/RicNewEditableWellPathFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicShowWellPlanFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicNewWellPathListTargetFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicNewWellPathAttributeFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicDeleteWellPathTargetFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicDeleteWellPathAttributeFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicDeleteWellPathFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicWellPathsUnitSystemSettingsImpl.h + ${CMAKE_CURRENT_LIST_DIR}/RicWellPathsUnitSystemSettingsUi.h + ${CMAKE_CURRENT_LIST_DIR}/RicWellPathPickEventHandler.h + ${CMAKE_CURRENT_LIST_DIR}/RicCreateWellTargetsPickEventHandler.h + ${CMAKE_CURRENT_LIST_DIR}/RicIntersectionPickEventHandler.h + ${CMAKE_CURRENT_LIST_DIR}/RicWellPathFormationsImportFileFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicPolylineTargetsPickEventHandler.h + ${CMAKE_CURRENT_LIST_DIR}/RicNewPolylineTargetFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicDeletePolylineTargetFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicImportWellMeasurementsFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicNewWellPathLateralAtDepthFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicNewWellPathLateralFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicPasteModeledWellPathFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicCreateMultipleWellPathLaterals.h + ${CMAKE_CURRENT_LIST_DIR}/RicCreateMultipleWellPathLateralsUi.h + ${CMAKE_CURRENT_LIST_DIR}/RicLinkWellPathFeature.h + ${CMAKE_CURRENT_LIST_DIR}/PointTangentManipulator/Ric3dObjectEditorHandle.h + ${CMAKE_CURRENT_LIST_DIR}/PointTangentManipulator/RicPointTangentManipulator.h + ${CMAKE_CURRENT_LIST_DIR}/PointTangentManipulator/RicWellTarget3dEditor.h + ${CMAKE_CURRENT_LIST_DIR}/PointTangentManipulator/RicWellPathGeometry3dEditor.h + ${CMAKE_CURRENT_LIST_DIR}/PointTangentManipulator/RicPointTangentManipulatorPartMgr.h + ${CMAKE_CURRENT_LIST_DIR}/PointTangentManipulator/RicPolyline3dEditor.h + ${CMAKE_CURRENT_LIST_DIR}/PointTangentManipulator/RicPolylineTarget3dEditor.h ) -set (SOURCE_GROUP_SOURCE_FILES -${CMAKE_CURRENT_LIST_DIR}/RicImportWellPaths.cpp -${CMAKE_CURRENT_LIST_DIR}/RicNewEditableWellPathFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicShowWellPlanFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicNewWellPathListTargetFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicNewWellPathAttributeFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicDeleteWellPathTargetFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicDeleteWellPathAttributeFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicDeleteWellPathFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicWellPathsUnitSystemSettingsImpl.cpp -${CMAKE_CURRENT_LIST_DIR}/RicWellPathsUnitSystemSettingsUi.cpp -${CMAKE_CURRENT_LIST_DIR}/RicWellPathPickEventHandler.cpp -${CMAKE_CURRENT_LIST_DIR}/RicCreateWellTargetsPickEventHandler.cpp -${CMAKE_CURRENT_LIST_DIR}/RicIntersectionPickEventHandler.cpp -${CMAKE_CURRENT_LIST_DIR}/RicWellPathFormationsImportFileFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicPolylineTargetsPickEventHandler.cpp -${CMAKE_CURRENT_LIST_DIR}/RicNewPolylineTargetFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicDeletePolylineTargetFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicImportWellMeasurementsFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicNewWellPathLateralAtDepthFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicNewWellPathLateralFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicPasteModeledWellPathFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicCreateMultipleWellPathLaterals.cpp -${CMAKE_CURRENT_LIST_DIR}/RicCreateMultipleWellPathLateralsUi.cpp -${CMAKE_CURRENT_LIST_DIR}/RicLinkWellPathFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/PointTangentManipulator/Ric3dObjectEditorHandle.cpp -${CMAKE_CURRENT_LIST_DIR}/PointTangentManipulator/RicPointTangentManipulator.cpp -${CMAKE_CURRENT_LIST_DIR}/PointTangentManipulator/RicWellTarget3dEditor.cpp -${CMAKE_CURRENT_LIST_DIR}/PointTangentManipulator/RicWellPathGeometry3dEditor.cpp -${CMAKE_CURRENT_LIST_DIR}/PointTangentManipulator/RicPointTangentManipulatorPartMgr.cpp -${CMAKE_CURRENT_LIST_DIR}/PointTangentManipulator/RicPolyline3dEditor.cpp -${CMAKE_CURRENT_LIST_DIR}/PointTangentManipulator/RicPolylineTarget3dEditor.cpp +set(SOURCE_GROUP_SOURCE_FILES + ${CMAKE_CURRENT_LIST_DIR}/RicImportWellPaths.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicNewEditableWellPathFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicShowWellPlanFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicNewWellPathListTargetFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicNewWellPathAttributeFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicDeleteWellPathTargetFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicDeleteWellPathAttributeFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicDeleteWellPathFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicWellPathsUnitSystemSettingsImpl.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicWellPathsUnitSystemSettingsUi.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicWellPathPickEventHandler.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicCreateWellTargetsPickEventHandler.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicIntersectionPickEventHandler.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicWellPathFormationsImportFileFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicPolylineTargetsPickEventHandler.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicNewPolylineTargetFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicDeletePolylineTargetFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicImportWellMeasurementsFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicNewWellPathLateralAtDepthFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicNewWellPathLateralFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicPasteModeledWellPathFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicCreateMultipleWellPathLaterals.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicCreateMultipleWellPathLateralsUi.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicLinkWellPathFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/PointTangentManipulator/Ric3dObjectEditorHandle.cpp + ${CMAKE_CURRENT_LIST_DIR}/PointTangentManipulator/RicPointTangentManipulator.cpp + ${CMAKE_CURRENT_LIST_DIR}/PointTangentManipulator/RicWellTarget3dEditor.cpp + ${CMAKE_CURRENT_LIST_DIR}/PointTangentManipulator/RicWellPathGeometry3dEditor.cpp + ${CMAKE_CURRENT_LIST_DIR}/PointTangentManipulator/RicPointTangentManipulatorPartMgr.cpp + ${CMAKE_CURRENT_LIST_DIR}/PointTangentManipulator/RicPolyline3dEditor.cpp + ${CMAKE_CURRENT_LIST_DIR}/PointTangentManipulator/RicPolylineTarget3dEditor.cpp ) -list(APPEND COMMAND_CODE_HEADER_FILES -${SOURCE_GROUP_HEADER_FILES} -) +list(APPEND COMMAND_CODE_HEADER_FILES ${SOURCE_GROUP_HEADER_FILES}) -list(APPEND COMMAND_CODE_SOURCE_FILES -${SOURCE_GROUP_SOURCE_FILES} -) +list(APPEND COMMAND_CODE_SOURCE_FILES ${SOURCE_GROUP_SOURCE_FILES}) -list(APPEND COMMAND_QT_MOC_HEADERS -${CMAKE_CURRENT_LIST_DIR}/PointTangentManipulator/RicPointTangentManipulator.h -${CMAKE_CURRENT_LIST_DIR}/PointTangentManipulator/RicWellTarget3dEditor.h -${CMAKE_CURRENT_LIST_DIR}/PointTangentManipulator/RicWellPathGeometry3dEditor.h -${CMAKE_CURRENT_LIST_DIR}/PointTangentManipulator/RicPolyline3dEditor.h -${CMAKE_CURRENT_LIST_DIR}/PointTangentManipulator/RicPolylineTarget3dEditor.h -${CMAKE_CURRENT_LIST_DIR}/RicCreateMultipleWellPathLaterals.h -) +list( + APPEND + COMMAND_QT_MOC_HEADERS + ${CMAKE_CURRENT_LIST_DIR}/PointTangentManipulator/RicPointTangentManipulator.h + ${CMAKE_CURRENT_LIST_DIR}/PointTangentManipulator/RicWellTarget3dEditor.h + ${CMAKE_CURRENT_LIST_DIR}/PointTangentManipulator/RicWellPathGeometry3dEditor.h + ${CMAKE_CURRENT_LIST_DIR}/PointTangentManipulator/RicPolyline3dEditor.h + ${CMAKE_CURRENT_LIST_DIR}/PointTangentManipulator/RicPolylineTarget3dEditor.h + ${CMAKE_CURRENT_LIST_DIR}/RicCreateMultipleWellPathLaterals.h) -source_group( "CommandFeature\\WellPath" FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake ) +source_group( + "CommandFeature\\WellPath" + FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} + ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake) diff --git a/ApplicationLibCode/FileInterface/CMakeLists_files.cmake b/ApplicationLibCode/FileInterface/CMakeLists_files.cmake index 0f8a314edd..bf6057c54c 100644 --- a/ApplicationLibCode/FileInterface/CMakeLists_files.cmake +++ b/ApplicationLibCode/FileInterface/CMakeLists_files.cmake @@ -1,154 +1,150 @@ - -set (SOURCE_GROUP_HEADER_FILES -${CMAKE_CURRENT_LIST_DIR}/RifTextDataTableFormatter.h -${CMAKE_CURRENT_LIST_DIR}/RifEclipseInputFileTools.h -${CMAKE_CURRENT_LIST_DIR}/RifEclipseOutputFileTools.h -${CMAKE_CURRENT_LIST_DIR}/RifEclipseRestartDataAccess.h -${CMAKE_CURRENT_LIST_DIR}/RifEclipseRestartFilesetAccess.h -${CMAKE_CURRENT_LIST_DIR}/RifEclipseSummaryTools.h -${CMAKE_CURRENT_LIST_DIR}/RifEclipseUnifiedRestartFileAccess.h -${CMAKE_CURRENT_LIST_DIR}/RifPerforationIntervalReader.h -${CMAKE_CURRENT_LIST_DIR}/RifReaderEclipseInput.h -${CMAKE_CURRENT_LIST_DIR}/RifReaderEclipseOutput.h -${CMAKE_CURRENT_LIST_DIR}/RifSummaryReaderInterface.h -${CMAKE_CURRENT_LIST_DIR}/RifEclipseUserDataParserTools.h -${CMAKE_CURRENT_LIST_DIR}/RifColumnBasedUserDataParser.h -${CMAKE_CURRENT_LIST_DIR}/RifKeywordVectorParser.h -${CMAKE_CURRENT_LIST_DIR}/RifReaderObservedData.h -${CMAKE_CURRENT_LIST_DIR}/RifReaderEclipseSummary.h -${CMAKE_CURRENT_LIST_DIR}/RifReaderRftInterface.h -${CMAKE_CURRENT_LIST_DIR}/RifReaderEclipseRft.h -${CMAKE_CURRENT_LIST_DIR}/RifReaderFmuRft.h -${CMAKE_CURRENT_LIST_DIR}/RifJsonEncodeDecode.h -${CMAKE_CURRENT_LIST_DIR}/RifReaderInterface.h -${CMAKE_CURRENT_LIST_DIR}/RifReaderMockModel.h -${CMAKE_CURRENT_LIST_DIR}/RifReaderSettings.h -${CMAKE_CURRENT_LIST_DIR}/RifEclipseSummaryAddress.h -${CMAKE_CURRENT_LIST_DIR}/RifEclipseSummaryAddressQMetaType.h -${CMAKE_CURRENT_LIST_DIR}/RifEclipseRftAddress.h -${CMAKE_CURRENT_LIST_DIR}/RifWellPathImporter.h -${CMAKE_CURRENT_LIST_DIR}/RifHdf5ReaderInterface.h -${CMAKE_CURRENT_LIST_DIR}/RifColumnBasedUserData.h -${CMAKE_CURRENT_LIST_DIR}/RifKeywordVectorUserData.h -${CMAKE_CURRENT_LIST_DIR}/RifDataSourceForRftPlt.h -${CMAKE_CURRENT_LIST_DIR}/RifDataSourceForRftPltQMetaType.h -${CMAKE_CURRENT_LIST_DIR}/RifEclipseUserDataKeywordTools.h -${CMAKE_CURRENT_LIST_DIR}/RifCsvUserData.h -${CMAKE_CURRENT_LIST_DIR}/RifCsvUserDataParser.h -${CMAKE_CURRENT_LIST_DIR}/RifWellMeasurementReader.h -${CMAKE_CURRENT_LIST_DIR}/RifWellPathFormationReader.h -${CMAKE_CURRENT_LIST_DIR}/RifWellPathFormationsImporter.h -${CMAKE_CURRENT_LIST_DIR}/RifElementPropertyTableReader.h -${CMAKE_CURRENT_LIST_DIR}/RifElementPropertyReader.h -${CMAKE_CURRENT_LIST_DIR}/RifStimPlanXmlReader.h -${CMAKE_CURRENT_LIST_DIR}/RifSummaryCaseRestartSelector.h -${CMAKE_CURRENT_LIST_DIR}/RifCaseRealizationParametersReader.h -${CMAKE_CURRENT_LIST_DIR}/RifFileParseTools.h -${CMAKE_CURRENT_LIST_DIR}/RifEnsembleStatisticsReader.h -${CMAKE_CURRENT_LIST_DIR}/RifReaderEnsembleStatisticsRft.h -${CMAKE_CURRENT_LIST_DIR}/RifDerivedEnsembleReader.h -${CMAKE_CURRENT_LIST_DIR}/RifActiveCellsReader.h -${CMAKE_CURRENT_LIST_DIR}/RifCsvDataTableFormatter.h -${CMAKE_CURRENT_LIST_DIR}/RifEclipseInputPropertyLoader.h -${CMAKE_CURRENT_LIST_DIR}/RifSurfaceImporter.h -${CMAKE_CURRENT_LIST_DIR}/RifRoffReader.h -${CMAKE_CURRENT_LIST_DIR}/RifColorLegendData.h -${CMAKE_CURRENT_LIST_DIR}/RifElasticPropertiesReader.h -${CMAKE_CURRENT_LIST_DIR}/RifStimPlanModelExporter.h -${CMAKE_CURRENT_LIST_DIR}/RifStimPlanModelGeologicalFrkExporter.h -${CMAKE_CURRENT_LIST_DIR}/RifStimPlanModelDeviationFrkExporter.h -${CMAKE_CURRENT_LIST_DIR}/RifStimPlanModelPerfsFrkExporter.h -${CMAKE_CURRENT_LIST_DIR}/RifStimPlanModelAsymmetricFrkExporter.h -${CMAKE_CURRENT_LIST_DIR}/RifSurfaceExporter.h -${CMAKE_CURRENT_LIST_DIR}/RifFaultRAXmlWriter.h -${CMAKE_CURRENT_LIST_DIR}/RifFaultRAJsonWriter.h -${CMAKE_CURRENT_LIST_DIR}/RifParameterXmlReader.h -${CMAKE_CURRENT_LIST_DIR}/RifOpmCommonSummary.h -${CMAKE_CURRENT_LIST_DIR}/RifEnsembleFractureStatisticsExporter.h -${CMAKE_CURRENT_LIST_DIR}/RifSummaryReaderMultipleFiles.h -${CMAKE_CURRENT_LIST_DIR}/RifEclEclipseSummary.h - -# HDF5 file reader is directly included in ResInsight main CmakeList.txt -#${CMAKE_CURRENT_LIST_DIR}/RifHdf5Reader.h +set(SOURCE_GROUP_HEADER_FILES + ${CMAKE_CURRENT_LIST_DIR}/RifTextDataTableFormatter.h + ${CMAKE_CURRENT_LIST_DIR}/RifEclipseInputFileTools.h + ${CMAKE_CURRENT_LIST_DIR}/RifEclipseOutputFileTools.h + ${CMAKE_CURRENT_LIST_DIR}/RifEclipseRestartDataAccess.h + ${CMAKE_CURRENT_LIST_DIR}/RifEclipseRestartFilesetAccess.h + ${CMAKE_CURRENT_LIST_DIR}/RifEclipseSummaryTools.h + ${CMAKE_CURRENT_LIST_DIR}/RifEclipseUnifiedRestartFileAccess.h + ${CMAKE_CURRENT_LIST_DIR}/RifPerforationIntervalReader.h + ${CMAKE_CURRENT_LIST_DIR}/RifReaderEclipseInput.h + ${CMAKE_CURRENT_LIST_DIR}/RifReaderEclipseOutput.h + ${CMAKE_CURRENT_LIST_DIR}/RifSummaryReaderInterface.h + ${CMAKE_CURRENT_LIST_DIR}/RifEclipseUserDataParserTools.h + ${CMAKE_CURRENT_LIST_DIR}/RifColumnBasedUserDataParser.h + ${CMAKE_CURRENT_LIST_DIR}/RifKeywordVectorParser.h + ${CMAKE_CURRENT_LIST_DIR}/RifReaderObservedData.h + ${CMAKE_CURRENT_LIST_DIR}/RifReaderEclipseSummary.h + ${CMAKE_CURRENT_LIST_DIR}/RifReaderRftInterface.h + ${CMAKE_CURRENT_LIST_DIR}/RifReaderEclipseRft.h + ${CMAKE_CURRENT_LIST_DIR}/RifReaderFmuRft.h + ${CMAKE_CURRENT_LIST_DIR}/RifJsonEncodeDecode.h + ${CMAKE_CURRENT_LIST_DIR}/RifReaderInterface.h + ${CMAKE_CURRENT_LIST_DIR}/RifReaderMockModel.h + ${CMAKE_CURRENT_LIST_DIR}/RifReaderSettings.h + ${CMAKE_CURRENT_LIST_DIR}/RifEclipseSummaryAddress.h + ${CMAKE_CURRENT_LIST_DIR}/RifEclipseSummaryAddressQMetaType.h + ${CMAKE_CURRENT_LIST_DIR}/RifEclipseRftAddress.h + ${CMAKE_CURRENT_LIST_DIR}/RifWellPathImporter.h + ${CMAKE_CURRENT_LIST_DIR}/RifHdf5ReaderInterface.h + ${CMAKE_CURRENT_LIST_DIR}/RifColumnBasedUserData.h + ${CMAKE_CURRENT_LIST_DIR}/RifKeywordVectorUserData.h + ${CMAKE_CURRENT_LIST_DIR}/RifDataSourceForRftPlt.h + ${CMAKE_CURRENT_LIST_DIR}/RifDataSourceForRftPltQMetaType.h + ${CMAKE_CURRENT_LIST_DIR}/RifEclipseUserDataKeywordTools.h + ${CMAKE_CURRENT_LIST_DIR}/RifCsvUserData.h + ${CMAKE_CURRENT_LIST_DIR}/RifCsvUserDataParser.h + ${CMAKE_CURRENT_LIST_DIR}/RifWellMeasurementReader.h + ${CMAKE_CURRENT_LIST_DIR}/RifWellPathFormationReader.h + ${CMAKE_CURRENT_LIST_DIR}/RifWellPathFormationsImporter.h + ${CMAKE_CURRENT_LIST_DIR}/RifElementPropertyTableReader.h + ${CMAKE_CURRENT_LIST_DIR}/RifElementPropertyReader.h + ${CMAKE_CURRENT_LIST_DIR}/RifStimPlanXmlReader.h + ${CMAKE_CURRENT_LIST_DIR}/RifSummaryCaseRestartSelector.h + ${CMAKE_CURRENT_LIST_DIR}/RifCaseRealizationParametersReader.h + ${CMAKE_CURRENT_LIST_DIR}/RifFileParseTools.h + ${CMAKE_CURRENT_LIST_DIR}/RifEnsembleStatisticsReader.h + ${CMAKE_CURRENT_LIST_DIR}/RifReaderEnsembleStatisticsRft.h + ${CMAKE_CURRENT_LIST_DIR}/RifDerivedEnsembleReader.h + ${CMAKE_CURRENT_LIST_DIR}/RifActiveCellsReader.h + ${CMAKE_CURRENT_LIST_DIR}/RifCsvDataTableFormatter.h + ${CMAKE_CURRENT_LIST_DIR}/RifEclipseInputPropertyLoader.h + ${CMAKE_CURRENT_LIST_DIR}/RifSurfaceImporter.h + ${CMAKE_CURRENT_LIST_DIR}/RifRoffReader.h + ${CMAKE_CURRENT_LIST_DIR}/RifColorLegendData.h + ${CMAKE_CURRENT_LIST_DIR}/RifElasticPropertiesReader.h + ${CMAKE_CURRENT_LIST_DIR}/RifStimPlanModelExporter.h + ${CMAKE_CURRENT_LIST_DIR}/RifStimPlanModelGeologicalFrkExporter.h + ${CMAKE_CURRENT_LIST_DIR}/RifStimPlanModelDeviationFrkExporter.h + ${CMAKE_CURRENT_LIST_DIR}/RifStimPlanModelPerfsFrkExporter.h + ${CMAKE_CURRENT_LIST_DIR}/RifStimPlanModelAsymmetricFrkExporter.h + ${CMAKE_CURRENT_LIST_DIR}/RifSurfaceExporter.h + ${CMAKE_CURRENT_LIST_DIR}/RifFaultRAXmlWriter.h + ${CMAKE_CURRENT_LIST_DIR}/RifFaultRAJsonWriter.h + ${CMAKE_CURRENT_LIST_DIR}/RifParameterXmlReader.h + ${CMAKE_CURRENT_LIST_DIR}/RifOpmCommonSummary.h + ${CMAKE_CURRENT_LIST_DIR}/RifEnsembleFractureStatisticsExporter.h + ${CMAKE_CURRENT_LIST_DIR}/RifSummaryReaderMultipleFiles.h + ${CMAKE_CURRENT_LIST_DIR}/RifEclEclipseSummary.h + # HDF5 file reader is directly included in ResInsight main CmakeList.txt + # ${CMAKE_CURRENT_LIST_DIR}/RifHdf5Reader.h ) -set (SOURCE_GROUP_SOURCE_FILES -${CMAKE_CURRENT_LIST_DIR}/RifTextDataTableFormatter.cpp -${CMAKE_CURRENT_LIST_DIR}/RifEclipseInputFileTools.cpp -${CMAKE_CURRENT_LIST_DIR}/RifEclipseOutputFileTools.cpp -${CMAKE_CURRENT_LIST_DIR}/RifEclipseRestartDataAccess.cpp -${CMAKE_CURRENT_LIST_DIR}/RifEclipseRestartFilesetAccess.cpp -${CMAKE_CURRENT_LIST_DIR}/RifEclipseUnifiedRestartFileAccess.cpp -${CMAKE_CURRENT_LIST_DIR}/RifEclipseSummaryTools.cpp -${CMAKE_CURRENT_LIST_DIR}/RifPerforationIntervalReader.cpp -${CMAKE_CURRENT_LIST_DIR}/RifReaderEclipseInput.cpp -${CMAKE_CURRENT_LIST_DIR}/RifReaderEclipseOutput.cpp -${CMAKE_CURRENT_LIST_DIR}/RifSummaryReaderInterface.cpp -${CMAKE_CURRENT_LIST_DIR}/RifEclipseUserDataParserTools.cpp -${CMAKE_CURRENT_LIST_DIR}/RifColumnBasedUserDataParser.cpp -${CMAKE_CURRENT_LIST_DIR}/RifKeywordVectorParser.cpp -${CMAKE_CURRENT_LIST_DIR}/RifReaderObservedData.cpp -${CMAKE_CURRENT_LIST_DIR}/RifReaderEclipseSummary.cpp -${CMAKE_CURRENT_LIST_DIR}/RifReaderRftInterface.cpp -${CMAKE_CURRENT_LIST_DIR}/RifReaderEclipseRft.cpp -${CMAKE_CURRENT_LIST_DIR}/RifReaderFmuRft.cpp -${CMAKE_CURRENT_LIST_DIR}/RifJsonEncodeDecode.cpp -${CMAKE_CURRENT_LIST_DIR}/RifReaderInterface.cpp -${CMAKE_CURRENT_LIST_DIR}/RifReaderMockModel.cpp -${CMAKE_CURRENT_LIST_DIR}/RifReaderSettings.cpp -${CMAKE_CURRENT_LIST_DIR}/RifEclipseSummaryAddress.cpp -${CMAKE_CURRENT_LIST_DIR}/RifEclipseRftAddress.cpp -${CMAKE_CURRENT_LIST_DIR}/RifWellPathImporter.cpp -${CMAKE_CURRENT_LIST_DIR}/RifHdf5ReaderInterface.cpp -${CMAKE_CURRENT_LIST_DIR}/RifColumnBasedUserData.cpp -${CMAKE_CURRENT_LIST_DIR}/RifKeywordVectorUserData.cpp -${CMAKE_CURRENT_LIST_DIR}/RifDataSourceForRftPlt.cpp -${CMAKE_CURRENT_LIST_DIR}/RifEclipseUserDataKeywordTools.cpp -${CMAKE_CURRENT_LIST_DIR}/RifCsvUserData.cpp -${CMAKE_CURRENT_LIST_DIR}/RifCsvUserDataParser.cpp -${CMAKE_CURRENT_LIST_DIR}/RifWellMeasurementReader.cpp -${CMAKE_CURRENT_LIST_DIR}/RifWellPathFormationReader.cpp -${CMAKE_CURRENT_LIST_DIR}/RifWellPathFormationsImporter.cpp -${CMAKE_CURRENT_LIST_DIR}/RifElementPropertyTableReader.cpp -${CMAKE_CURRENT_LIST_DIR}/RifElementPropertyReader.cpp -${CMAKE_CURRENT_LIST_DIR}/RifStimPlanXmlReader.cpp -${CMAKE_CURRENT_LIST_DIR}/RifSummaryCaseRestartSelector.cpp -${CMAKE_CURRENT_LIST_DIR}/RifCaseRealizationParametersReader.cpp -${CMAKE_CURRENT_LIST_DIR}/RifFileParseTools.cpp -${CMAKE_CURRENT_LIST_DIR}/RifEnsembleStatisticsReader.cpp -${CMAKE_CURRENT_LIST_DIR}/RifDerivedEnsembleReader.cpp -${CMAKE_CURRENT_LIST_DIR}/RifActiveCellsReader.cpp -${CMAKE_CURRENT_LIST_DIR}/RifCsvDataTableFormatter.cpp -${CMAKE_CURRENT_LIST_DIR}/RifReaderEnsembleStatisticsRft.cpp -${CMAKE_CURRENT_LIST_DIR}/RifEclipseInputPropertyLoader.cpp -${CMAKE_CURRENT_LIST_DIR}/RifSurfaceImporter.cpp -${CMAKE_CURRENT_LIST_DIR}/RifRoffReader.cpp -${CMAKE_CURRENT_LIST_DIR}/RifColorLegendData.cpp -${CMAKE_CURRENT_LIST_DIR}/RifElasticPropertiesReader.cpp -${CMAKE_CURRENT_LIST_DIR}/RifStimPlanModelExporter.cpp -${CMAKE_CURRENT_LIST_DIR}/RifStimPlanModelGeologicalFrkExporter.cpp -${CMAKE_CURRENT_LIST_DIR}/RifStimPlanModelDeviationFrkExporter.cpp -${CMAKE_CURRENT_LIST_DIR}/RifStimPlanModelPerfsFrkExporter.cpp -${CMAKE_CURRENT_LIST_DIR}/RifStimPlanModelAsymmetricFrkExporter.cpp -${CMAKE_CURRENT_LIST_DIR}/RifSurfaceExporter.cpp -${CMAKE_CURRENT_LIST_DIR}/RifFaultRAXmlWriter.cpp -${CMAKE_CURRENT_LIST_DIR}/RifFaultRAJsonWriter.cpp -${CMAKE_CURRENT_LIST_DIR}/RifParameterXmlReader.cpp -${CMAKE_CURRENT_LIST_DIR}/RifOpmCommonSummary.cpp -${CMAKE_CURRENT_LIST_DIR}/RifEnsembleFractureStatisticsExporter.cpp -${CMAKE_CURRENT_LIST_DIR}/RifSummaryReaderMultipleFiles.cpp -${CMAKE_CURRENT_LIST_DIR}/RifEclEclipseSummary.cpp - -# HDF5 file reader is directly included in ResInsight main CmakeList.txt -#${CMAKE_CURRENT_LIST_DIR}/RifHdf5Reader.cpp +set(SOURCE_GROUP_SOURCE_FILES + ${CMAKE_CURRENT_LIST_DIR}/RifTextDataTableFormatter.cpp + ${CMAKE_CURRENT_LIST_DIR}/RifEclipseInputFileTools.cpp + ${CMAKE_CURRENT_LIST_DIR}/RifEclipseOutputFileTools.cpp + ${CMAKE_CURRENT_LIST_DIR}/RifEclipseRestartDataAccess.cpp + ${CMAKE_CURRENT_LIST_DIR}/RifEclipseRestartFilesetAccess.cpp + ${CMAKE_CURRENT_LIST_DIR}/RifEclipseUnifiedRestartFileAccess.cpp + ${CMAKE_CURRENT_LIST_DIR}/RifEclipseSummaryTools.cpp + ${CMAKE_CURRENT_LIST_DIR}/RifPerforationIntervalReader.cpp + ${CMAKE_CURRENT_LIST_DIR}/RifReaderEclipseInput.cpp + ${CMAKE_CURRENT_LIST_DIR}/RifReaderEclipseOutput.cpp + ${CMAKE_CURRENT_LIST_DIR}/RifSummaryReaderInterface.cpp + ${CMAKE_CURRENT_LIST_DIR}/RifEclipseUserDataParserTools.cpp + ${CMAKE_CURRENT_LIST_DIR}/RifColumnBasedUserDataParser.cpp + ${CMAKE_CURRENT_LIST_DIR}/RifKeywordVectorParser.cpp + ${CMAKE_CURRENT_LIST_DIR}/RifReaderObservedData.cpp + ${CMAKE_CURRENT_LIST_DIR}/RifReaderEclipseSummary.cpp + ${CMAKE_CURRENT_LIST_DIR}/RifReaderRftInterface.cpp + ${CMAKE_CURRENT_LIST_DIR}/RifReaderEclipseRft.cpp + ${CMAKE_CURRENT_LIST_DIR}/RifReaderFmuRft.cpp + ${CMAKE_CURRENT_LIST_DIR}/RifJsonEncodeDecode.cpp + ${CMAKE_CURRENT_LIST_DIR}/RifReaderInterface.cpp + ${CMAKE_CURRENT_LIST_DIR}/RifReaderMockModel.cpp + ${CMAKE_CURRENT_LIST_DIR}/RifReaderSettings.cpp + ${CMAKE_CURRENT_LIST_DIR}/RifEclipseSummaryAddress.cpp + ${CMAKE_CURRENT_LIST_DIR}/RifEclipseRftAddress.cpp + ${CMAKE_CURRENT_LIST_DIR}/RifWellPathImporter.cpp + ${CMAKE_CURRENT_LIST_DIR}/RifHdf5ReaderInterface.cpp + ${CMAKE_CURRENT_LIST_DIR}/RifColumnBasedUserData.cpp + ${CMAKE_CURRENT_LIST_DIR}/RifKeywordVectorUserData.cpp + ${CMAKE_CURRENT_LIST_DIR}/RifDataSourceForRftPlt.cpp + ${CMAKE_CURRENT_LIST_DIR}/RifEclipseUserDataKeywordTools.cpp + ${CMAKE_CURRENT_LIST_DIR}/RifCsvUserData.cpp + ${CMAKE_CURRENT_LIST_DIR}/RifCsvUserDataParser.cpp + ${CMAKE_CURRENT_LIST_DIR}/RifWellMeasurementReader.cpp + ${CMAKE_CURRENT_LIST_DIR}/RifWellPathFormationReader.cpp + ${CMAKE_CURRENT_LIST_DIR}/RifWellPathFormationsImporter.cpp + ${CMAKE_CURRENT_LIST_DIR}/RifElementPropertyTableReader.cpp + ${CMAKE_CURRENT_LIST_DIR}/RifElementPropertyReader.cpp + ${CMAKE_CURRENT_LIST_DIR}/RifStimPlanXmlReader.cpp + ${CMAKE_CURRENT_LIST_DIR}/RifSummaryCaseRestartSelector.cpp + ${CMAKE_CURRENT_LIST_DIR}/RifCaseRealizationParametersReader.cpp + ${CMAKE_CURRENT_LIST_DIR}/RifFileParseTools.cpp + ${CMAKE_CURRENT_LIST_DIR}/RifEnsembleStatisticsReader.cpp + ${CMAKE_CURRENT_LIST_DIR}/RifDerivedEnsembleReader.cpp + ${CMAKE_CURRENT_LIST_DIR}/RifActiveCellsReader.cpp + ${CMAKE_CURRENT_LIST_DIR}/RifCsvDataTableFormatter.cpp + ${CMAKE_CURRENT_LIST_DIR}/RifReaderEnsembleStatisticsRft.cpp + ${CMAKE_CURRENT_LIST_DIR}/RifEclipseInputPropertyLoader.cpp + ${CMAKE_CURRENT_LIST_DIR}/RifSurfaceImporter.cpp + ${CMAKE_CURRENT_LIST_DIR}/RifRoffReader.cpp + ${CMAKE_CURRENT_LIST_DIR}/RifColorLegendData.cpp + ${CMAKE_CURRENT_LIST_DIR}/RifElasticPropertiesReader.cpp + ${CMAKE_CURRENT_LIST_DIR}/RifStimPlanModelExporter.cpp + ${CMAKE_CURRENT_LIST_DIR}/RifStimPlanModelGeologicalFrkExporter.cpp + ${CMAKE_CURRENT_LIST_DIR}/RifStimPlanModelDeviationFrkExporter.cpp + ${CMAKE_CURRENT_LIST_DIR}/RifStimPlanModelPerfsFrkExporter.cpp + ${CMAKE_CURRENT_LIST_DIR}/RifStimPlanModelAsymmetricFrkExporter.cpp + ${CMAKE_CURRENT_LIST_DIR}/RifSurfaceExporter.cpp + ${CMAKE_CURRENT_LIST_DIR}/RifFaultRAXmlWriter.cpp + ${CMAKE_CURRENT_LIST_DIR}/RifFaultRAJsonWriter.cpp + ${CMAKE_CURRENT_LIST_DIR}/RifParameterXmlReader.cpp + ${CMAKE_CURRENT_LIST_DIR}/RifOpmCommonSummary.cpp + ${CMAKE_CURRENT_LIST_DIR}/RifEnsembleFractureStatisticsExporter.cpp + ${CMAKE_CURRENT_LIST_DIR}/RifSummaryReaderMultipleFiles.cpp + ${CMAKE_CURRENT_LIST_DIR}/RifEclEclipseSummary.cpp + # HDF5 file reader is directly included in ResInsight main CmakeList.txt + # ${CMAKE_CURRENT_LIST_DIR}/RifHdf5Reader.cpp ) -list(APPEND CODE_HEADER_FILES -${SOURCE_GROUP_HEADER_FILES} -) +list(APPEND CODE_HEADER_FILES ${SOURCE_GROUP_HEADER_FILES}) -list(APPEND CODE_SOURCE_FILES -${SOURCE_GROUP_SOURCE_FILES} -) +list(APPEND CODE_SOURCE_FILES ${SOURCE_GROUP_SOURCE_FILES}) -source_group( "FileInterface" FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake ) +source_group( + "FileInterface" + FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} + ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake) diff --git a/ApplicationLibCode/GeoMech/GeoMechVisualization/CMakeLists_files.cmake b/ApplicationLibCode/GeoMech/GeoMechVisualization/CMakeLists_files.cmake index 8db4eb3e1a..05d250283a 100644 --- a/ApplicationLibCode/GeoMech/GeoMechVisualization/CMakeLists_files.cmake +++ b/ApplicationLibCode/GeoMech/GeoMechVisualization/CMakeLists_files.cmake @@ -1,32 +1,25 @@ +set(SOURCE_GROUP_HEADER_FILES + ${CMAKE_CURRENT_LIST_DIR}/RivFemPartGeometryGenerator.h + ${CMAKE_CURRENT_LIST_DIR}/RivFemPartPartMgr.h + ${CMAKE_CURRENT_LIST_DIR}/RivGeoMechPartMgr.h + ${CMAKE_CURRENT_LIST_DIR}/RivGeoMechPartMgrCache.h + ${CMAKE_CURRENT_LIST_DIR}/RivGeoMechVizLogic.h + ${CMAKE_CURRENT_LIST_DIR}/RivFemPickSourceInfo.h + ${CMAKE_CURRENT_LIST_DIR}/RivFemElmVisibilityCalculator.h) -set (SOURCE_GROUP_HEADER_FILES -${CMAKE_CURRENT_LIST_DIR}/RivFemPartGeometryGenerator.h -${CMAKE_CURRENT_LIST_DIR}/RivFemPartPartMgr.h -${CMAKE_CURRENT_LIST_DIR}/RivGeoMechPartMgr.h -${CMAKE_CURRENT_LIST_DIR}/RivGeoMechPartMgrCache.h -${CMAKE_CURRENT_LIST_DIR}/RivGeoMechVizLogic.h -${CMAKE_CURRENT_LIST_DIR}/RivFemPickSourceInfo.h -${CMAKE_CURRENT_LIST_DIR}/RivFemElmVisibilityCalculator.h +set(SOURCE_GROUP_SOURCE_FILES + ${CMAKE_CURRENT_LIST_DIR}/RivFemPartGeometryGenerator.cpp + ${CMAKE_CURRENT_LIST_DIR}/RivFemPartPartMgr.cpp + ${CMAKE_CURRENT_LIST_DIR}/RivGeoMechPartMgr.cpp + ${CMAKE_CURRENT_LIST_DIR}/RivGeoMechPartMgrCache.cpp + ${CMAKE_CURRENT_LIST_DIR}/RivGeoMechVizLogic.cpp + ${CMAKE_CURRENT_LIST_DIR}/RivFemPickSourceInfo.cpp + ${CMAKE_CURRENT_LIST_DIR}/RivFemElmVisibilityCalculator.cpp) -) +list(APPEND CODE_HEADER_FILES ${SOURCE_GROUP_HEADER_FILES}) -set (SOURCE_GROUP_SOURCE_FILES -${CMAKE_CURRENT_LIST_DIR}/RivFemPartGeometryGenerator.cpp -${CMAKE_CURRENT_LIST_DIR}/RivFemPartPartMgr.cpp -${CMAKE_CURRENT_LIST_DIR}/RivGeoMechPartMgr.cpp -${CMAKE_CURRENT_LIST_DIR}/RivGeoMechPartMgrCache.cpp -${CMAKE_CURRENT_LIST_DIR}/RivGeoMechVizLogic.cpp -${CMAKE_CURRENT_LIST_DIR}/RivFemPickSourceInfo.cpp -${CMAKE_CURRENT_LIST_DIR}/RivFemElmVisibilityCalculator.cpp +list(APPEND CODE_SOURCE_FILES ${SOURCE_GROUP_SOURCE_FILES}) -) - -list(APPEND CODE_HEADER_FILES -${SOURCE_GROUP_HEADER_FILES} -) - -list(APPEND CODE_SOURCE_FILES -${SOURCE_GROUP_SOURCE_FILES} -) - -source_group( "GeoMechViz" FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake ) +source_group( + "GeoMechViz" FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} + ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake) diff --git a/ApplicationLibCode/ModelVisualization/CMakeLists_files.cmake b/ApplicationLibCode/ModelVisualization/CMakeLists_files.cmake index f1dc43549b..cb231e1ef3 100644 --- a/ApplicationLibCode/ModelVisualization/CMakeLists_files.cmake +++ b/ApplicationLibCode/ModelVisualization/CMakeLists_files.cmake @@ -1,131 +1,127 @@ +set(SOURCE_GROUP_HEADER_FILES + ${CMAKE_CURRENT_LIST_DIR}/RivCellEdgeEffectGenerator.h + ${CMAKE_CURRENT_LIST_DIR}/RivFaultPartMgr.h + ${CMAKE_CURRENT_LIST_DIR}/RivFaultGeometryGenerator.h + ${CMAKE_CURRENT_LIST_DIR}/RivNNCGeometryGenerator.h + ${CMAKE_CURRENT_LIST_DIR}/RivGridPartMgr.h + ${CMAKE_CURRENT_LIST_DIR}/RivTernarySaturationOverlayItem.h + ${CMAKE_CURRENT_LIST_DIR}/RivReservoirPartMgr.h + ${CMAKE_CURRENT_LIST_DIR}/RivReservoirViewPartMgr.h + ${CMAKE_CURRENT_LIST_DIR}/RivPipeGeometryGenerator.h + ${CMAKE_CURRENT_LIST_DIR}/RivReservoirFaultsPartMgr.h + ${CMAKE_CURRENT_LIST_DIR}/RivReservoirSimWellsPartMgr.h + ${CMAKE_CURRENT_LIST_DIR}/RivSourceInfo.h + ${CMAKE_CURRENT_LIST_DIR}/RivWellPathSourceInfo.h + ${CMAKE_CURRENT_LIST_DIR}/RivWellPathPartMgr.h + ${CMAKE_CURRENT_LIST_DIR}/RivWellPathsPartMgr.h + ${CMAKE_CURRENT_LIST_DIR}/RivSimWellPipesPartMgr.h + ${CMAKE_CURRENT_LIST_DIR}/RivWellHeadPartMgr.h + ${CMAKE_CURRENT_LIST_DIR}/RivResultToTextureMapper.h + ${CMAKE_CURRENT_LIST_DIR}/RivCompletionTypeResultToTextureMapper.h + ${CMAKE_CURRENT_LIST_DIR}/RivDefaultResultToTextureMapper.h + ${CMAKE_CURRENT_LIST_DIR}/RivTernaryResultToTextureMapper.h + ${CMAKE_CURRENT_LIST_DIR}/RivTextureCoordsCreator.h + ${CMAKE_CURRENT_LIST_DIR}/RivTernaryScalarMapper.h + ${CMAKE_CURRENT_LIST_DIR}/RivTernaryTextureCoordsCreator.h + ${CMAKE_CURRENT_LIST_DIR}/RivTernaryScalarMapperEffectGenerator.h + ${CMAKE_CURRENT_LIST_DIR}/RivScalarMapperUtils.h + ${CMAKE_CURRENT_LIST_DIR}/RivCellEdgeGeometryUtils.h + ${CMAKE_CURRENT_LIST_DIR}/RivPipeQuadToSegmentMapper.h + ${CMAKE_CURRENT_LIST_DIR}/RivSingleCellPartGenerator.h + ${CMAKE_CURRENT_LIST_DIR}/RivSimWellPipeSourceInfo.h + ${CMAKE_CURRENT_LIST_DIR}/RivWellSpheresPartMgr.h + ${CMAKE_CURRENT_LIST_DIR}/RivPartPriority.h + ${CMAKE_CURRENT_LIST_DIR}/RivObjectSourceInfo.h + ${CMAKE_CURRENT_LIST_DIR}/RivWellConnectionsPartMgr.h + ${CMAKE_CURRENT_LIST_DIR}/RivFishbonesSubsPartMgr.h + ${CMAKE_CURRENT_LIST_DIR}/RivTensorResultPartMgr.h + ${CMAKE_CURRENT_LIST_DIR}/RivWellFracturePartMgr.h + ${CMAKE_CURRENT_LIST_DIR}/Riv3dWellLogPlanePartMgr.h + ${CMAKE_CURRENT_LIST_DIR}/Riv3dWellLogCurveGeometryGenerator.h + ${CMAKE_CURRENT_LIST_DIR}/RivWellConnectionFactorPartMgr.h + ${CMAKE_CURRENT_LIST_DIR}/RivWellConnectionFactorGeometryGenerator.h + ${CMAKE_CURRENT_LIST_DIR}/RivWellConnectionSourceInfo.h + ${CMAKE_CURRENT_LIST_DIR}/RivSimWellConnectionSourceInfo.h + ${CMAKE_CURRENT_LIST_DIR}/Riv3dWellLogDrawSurfaceGenerator.h + ${CMAKE_CURRENT_LIST_DIR}/RivMeshLinesSourceInfo.h + ${CMAKE_CURRENT_LIST_DIR}/RivContourMapProjectionPartMgr.h + ${CMAKE_CURRENT_LIST_DIR}/RivAnnotationsPartMgr.h + ${CMAKE_CURRENT_LIST_DIR}/RivTextAnnotationPartMgr.h + ${CMAKE_CURRENT_LIST_DIR}/RivReachCircleAnnotationPartMgr.h + ${CMAKE_CURRENT_LIST_DIR}/RivReachCircleAnnotationSourceInfo.h + ${CMAKE_CURRENT_LIST_DIR}/RivPolylinesAnnotationSourceInfo.h + ${CMAKE_CURRENT_LIST_DIR}/RivPolylineGenerator.h + ${CMAKE_CURRENT_LIST_DIR}/RivMeasurementPartMgr.h + ${CMAKE_CURRENT_LIST_DIR}/RivTextLabelSourceInfo.h + ${CMAKE_CURRENT_LIST_DIR}/RivDiskGeometryGenerator.h + ${CMAKE_CURRENT_LIST_DIR}/RivWellDiskPartMgr.h + ${CMAKE_CURRENT_LIST_DIR}/RivElementVectorResultPartMgr.h + ${CMAKE_CURRENT_LIST_DIR}/RivPolylinePartMgr.h + ${CMAKE_CURRENT_LIST_DIR}/RivCellFilterPartMgr.h + ${CMAKE_CURRENT_LIST_DIR}/RivDrawableSpheres.h) -set (SOURCE_GROUP_HEADER_FILES -${CMAKE_CURRENT_LIST_DIR}/RivCellEdgeEffectGenerator.h -${CMAKE_CURRENT_LIST_DIR}/RivFaultPartMgr.h -${CMAKE_CURRENT_LIST_DIR}/RivFaultGeometryGenerator.h -${CMAKE_CURRENT_LIST_DIR}/RivNNCGeometryGenerator.h -${CMAKE_CURRENT_LIST_DIR}/RivGridPartMgr.h -${CMAKE_CURRENT_LIST_DIR}/RivTernarySaturationOverlayItem.h -${CMAKE_CURRENT_LIST_DIR}/RivReservoirPartMgr.h -${CMAKE_CURRENT_LIST_DIR}/RivReservoirViewPartMgr.h -${CMAKE_CURRENT_LIST_DIR}/RivPipeGeometryGenerator.h -${CMAKE_CURRENT_LIST_DIR}/RivReservoirFaultsPartMgr.h -${CMAKE_CURRENT_LIST_DIR}/RivReservoirSimWellsPartMgr.h -${CMAKE_CURRENT_LIST_DIR}/RivSourceInfo.h -${CMAKE_CURRENT_LIST_DIR}/RivWellPathSourceInfo.h -${CMAKE_CURRENT_LIST_DIR}/RivWellPathPartMgr.h -${CMAKE_CURRENT_LIST_DIR}/RivWellPathsPartMgr.h -${CMAKE_CURRENT_LIST_DIR}/RivSimWellPipesPartMgr.h -${CMAKE_CURRENT_LIST_DIR}/RivWellHeadPartMgr.h -${CMAKE_CURRENT_LIST_DIR}/RivResultToTextureMapper.h -${CMAKE_CURRENT_LIST_DIR}/RivCompletionTypeResultToTextureMapper.h -${CMAKE_CURRENT_LIST_DIR}/RivDefaultResultToTextureMapper.h -${CMAKE_CURRENT_LIST_DIR}/RivTernaryResultToTextureMapper.h -${CMAKE_CURRENT_LIST_DIR}/RivTextureCoordsCreator.h -${CMAKE_CURRENT_LIST_DIR}/RivTernaryScalarMapper.h -${CMAKE_CURRENT_LIST_DIR}/RivTernaryTextureCoordsCreator.h -${CMAKE_CURRENT_LIST_DIR}/RivTernaryScalarMapperEffectGenerator.h -${CMAKE_CURRENT_LIST_DIR}/RivScalarMapperUtils.h -${CMAKE_CURRENT_LIST_DIR}/RivCellEdgeGeometryUtils.h -${CMAKE_CURRENT_LIST_DIR}/RivPipeQuadToSegmentMapper.h -${CMAKE_CURRENT_LIST_DIR}/RivSingleCellPartGenerator.h -${CMAKE_CURRENT_LIST_DIR}/RivSimWellPipeSourceInfo.h -${CMAKE_CURRENT_LIST_DIR}/RivWellSpheresPartMgr.h -${CMAKE_CURRENT_LIST_DIR}/RivPartPriority.h -${CMAKE_CURRENT_LIST_DIR}/RivObjectSourceInfo.h -${CMAKE_CURRENT_LIST_DIR}/RivWellConnectionsPartMgr.h -${CMAKE_CURRENT_LIST_DIR}/RivFishbonesSubsPartMgr.h -${CMAKE_CURRENT_LIST_DIR}/RivTensorResultPartMgr.h -${CMAKE_CURRENT_LIST_DIR}/RivWellFracturePartMgr.h -${CMAKE_CURRENT_LIST_DIR}/Riv3dWellLogPlanePartMgr.h -${CMAKE_CURRENT_LIST_DIR}/Riv3dWellLogCurveGeometryGenerator.h -${CMAKE_CURRENT_LIST_DIR}/RivWellConnectionFactorPartMgr.h -${CMAKE_CURRENT_LIST_DIR}/RivWellConnectionFactorGeometryGenerator.h -${CMAKE_CURRENT_LIST_DIR}/RivWellConnectionSourceInfo.h -${CMAKE_CURRENT_LIST_DIR}/RivSimWellConnectionSourceInfo.h -${CMAKE_CURRENT_LIST_DIR}/Riv3dWellLogDrawSurfaceGenerator.h -${CMAKE_CURRENT_LIST_DIR}/RivMeshLinesSourceInfo.h -${CMAKE_CURRENT_LIST_DIR}/RivContourMapProjectionPartMgr.h -${CMAKE_CURRENT_LIST_DIR}/RivAnnotationsPartMgr.h -${CMAKE_CURRENT_LIST_DIR}/RivTextAnnotationPartMgr.h -${CMAKE_CURRENT_LIST_DIR}/RivReachCircleAnnotationPartMgr.h -${CMAKE_CURRENT_LIST_DIR}/RivReachCircleAnnotationSourceInfo.h -${CMAKE_CURRENT_LIST_DIR}/RivPolylinesAnnotationSourceInfo.h -${CMAKE_CURRENT_LIST_DIR}/RivPolylineGenerator.h -${CMAKE_CURRENT_LIST_DIR}/RivMeasurementPartMgr.h -${CMAKE_CURRENT_LIST_DIR}/RivTextLabelSourceInfo.h -${CMAKE_CURRENT_LIST_DIR}/RivDiskGeometryGenerator.h -${CMAKE_CURRENT_LIST_DIR}/RivWellDiskPartMgr.h -${CMAKE_CURRENT_LIST_DIR}/RivElementVectorResultPartMgr.h -${CMAKE_CURRENT_LIST_DIR}/RivPolylinePartMgr.h -${CMAKE_CURRENT_LIST_DIR}/RivCellFilterPartMgr.h -${CMAKE_CURRENT_LIST_DIR}/RivDrawableSpheres.h -) +set(SOURCE_GROUP_SOURCE_FILES + ${CMAKE_CURRENT_LIST_DIR}/RivCellEdgeEffectGenerator.cpp + ${CMAKE_CURRENT_LIST_DIR}/RivFaultPartMgr.cpp + ${CMAKE_CURRENT_LIST_DIR}/RivNNCGeometryGenerator.cpp + ${CMAKE_CURRENT_LIST_DIR}/RivFaultGeometryGenerator.cpp + ${CMAKE_CURRENT_LIST_DIR}/RivGridPartMgr.cpp + ${CMAKE_CURRENT_LIST_DIR}/RivTernarySaturationOverlayItem.cpp + ${CMAKE_CURRENT_LIST_DIR}/RivReservoirFaultsPartMgr.cpp + ${CMAKE_CURRENT_LIST_DIR}/RivReservoirPartMgr.cpp + ${CMAKE_CURRENT_LIST_DIR}/RivReservoirViewPartMgr.cpp + ${CMAKE_CURRENT_LIST_DIR}/RivPipeGeometryGenerator.cpp + ${CMAKE_CURRENT_LIST_DIR}/RivReservoirSimWellsPartMgr.cpp + ${CMAKE_CURRENT_LIST_DIR}/RivSourceInfo.cpp + ${CMAKE_CURRENT_LIST_DIR}/RivWellPathSourceInfo.cpp + ${CMAKE_CURRENT_LIST_DIR}/RivWellPathPartMgr.cpp + ${CMAKE_CURRENT_LIST_DIR}/RivWellPathsPartMgr.cpp + ${CMAKE_CURRENT_LIST_DIR}/RivSimWellPipesPartMgr.cpp + ${CMAKE_CURRENT_LIST_DIR}/RivWellHeadPartMgr.cpp + ${CMAKE_CURRENT_LIST_DIR}/RivTextureCoordsCreator.cpp + ${CMAKE_CURRENT_LIST_DIR}/RivTernaryScalarMapper.cpp + ${CMAKE_CURRENT_LIST_DIR}/RivTernaryTextureCoordsCreator.cpp + ${CMAKE_CURRENT_LIST_DIR}/RivTernaryScalarMapperEffectGenerator.cpp + ${CMAKE_CURRENT_LIST_DIR}/RivScalarMapperUtils.cpp + ${CMAKE_CURRENT_LIST_DIR}/RivCellEdgeGeometryUtils.cpp + ${CMAKE_CURRENT_LIST_DIR}/RivPipeQuadToSegmentMapper.cpp + ${CMAKE_CURRENT_LIST_DIR}/RivSingleCellPartGenerator.cpp + ${CMAKE_CURRENT_LIST_DIR}/RivSimWellPipeSourceInfo.cpp + ${CMAKE_CURRENT_LIST_DIR}/RivWellSpheresPartMgr.cpp + ${CMAKE_CURRENT_LIST_DIR}/RivObjectSourceInfo.cpp + ${CMAKE_CURRENT_LIST_DIR}/RivWellConnectionsPartMgr.cpp + ${CMAKE_CURRENT_LIST_DIR}/RivFishbonesSubsPartMgr.cpp + ${CMAKE_CURRENT_LIST_DIR}/RivTensorResultPartMgr.cpp + ${CMAKE_CURRENT_LIST_DIR}/RivWellFracturePartMgr.cpp + ${CMAKE_CURRENT_LIST_DIR}/Riv3dWellLogPlanePartMgr.cpp + ${CMAKE_CURRENT_LIST_DIR}/Riv3dWellLogCurveGeometryGenerator.cpp + ${CMAKE_CURRENT_LIST_DIR}/RivWellConnectionFactorPartMgr.cpp + ${CMAKE_CURRENT_LIST_DIR}/RivWellConnectionFactorGeometryGenerator.cpp + ${CMAKE_CURRENT_LIST_DIR}/RivWellConnectionSourceInfo.cpp + ${CMAKE_CURRENT_LIST_DIR}/RivSimWellConnectionSourceInfo.cpp + ${CMAKE_CURRENT_LIST_DIR}/Riv3dWellLogDrawSurfaceGenerator.cpp + ${CMAKE_CURRENT_LIST_DIR}/RivMeshLinesSourceInfo.cpp + ${CMAKE_CURRENT_LIST_DIR}/RivContourMapProjectionPartMgr.cpp + ${CMAKE_CURRENT_LIST_DIR}/RivAnnotationsPartMgr.cpp + ${CMAKE_CURRENT_LIST_DIR}/RivTextAnnotationPartMgr.cpp + ${CMAKE_CURRENT_LIST_DIR}/RivReachCircleAnnotationPartMgr.cpp + ${CMAKE_CURRENT_LIST_DIR}/RivReachCircleAnnotationSourceInfo.cpp + ${CMAKE_CURRENT_LIST_DIR}/RivPolylinesAnnotationSourceInfo.cpp + ${CMAKE_CURRENT_LIST_DIR}/RivPolylineGenerator.cpp + ${CMAKE_CURRENT_LIST_DIR}/RivMeasurementPartMgr.cpp + ${CMAKE_CURRENT_LIST_DIR}/RivTextLabelSourceInfo.cpp + ${CMAKE_CURRENT_LIST_DIR}/RivDiskGeometryGenerator.cpp + ${CMAKE_CURRENT_LIST_DIR}/RivWellDiskPartMgr.cpp + ${CMAKE_CURRENT_LIST_DIR}/RivElementVectorResultPartMgr.cpp + ${CMAKE_CURRENT_LIST_DIR}/RivPolylinePartMgr.cpp + ${CMAKE_CURRENT_LIST_DIR}/RivCellFilterPartMgr.cpp + ${CMAKE_CURRENT_LIST_DIR}/RivDrawableSpheres.cpp) -set (SOURCE_GROUP_SOURCE_FILES -${CMAKE_CURRENT_LIST_DIR}/RivCellEdgeEffectGenerator.cpp -${CMAKE_CURRENT_LIST_DIR}/RivFaultPartMgr.cpp -${CMAKE_CURRENT_LIST_DIR}/RivNNCGeometryGenerator.cpp -${CMAKE_CURRENT_LIST_DIR}/RivFaultGeometryGenerator.cpp -${CMAKE_CURRENT_LIST_DIR}/RivGridPartMgr.cpp -${CMAKE_CURRENT_LIST_DIR}/RivTernarySaturationOverlayItem.cpp -${CMAKE_CURRENT_LIST_DIR}/RivReservoirFaultsPartMgr.cpp -${CMAKE_CURRENT_LIST_DIR}/RivReservoirPartMgr.cpp -${CMAKE_CURRENT_LIST_DIR}/RivReservoirViewPartMgr.cpp -${CMAKE_CURRENT_LIST_DIR}/RivPipeGeometryGenerator.cpp -${CMAKE_CURRENT_LIST_DIR}/RivReservoirSimWellsPartMgr.cpp -${CMAKE_CURRENT_LIST_DIR}/RivSourceInfo.cpp -${CMAKE_CURRENT_LIST_DIR}/RivWellPathSourceInfo.cpp -${CMAKE_CURRENT_LIST_DIR}/RivWellPathPartMgr.cpp -${CMAKE_CURRENT_LIST_DIR}/RivWellPathsPartMgr.cpp -${CMAKE_CURRENT_LIST_DIR}/RivSimWellPipesPartMgr.cpp -${CMAKE_CURRENT_LIST_DIR}/RivWellHeadPartMgr.cpp -${CMAKE_CURRENT_LIST_DIR}/RivTextureCoordsCreator.cpp -${CMAKE_CURRENT_LIST_DIR}/RivTernaryScalarMapper.cpp -${CMAKE_CURRENT_LIST_DIR}/RivTernaryTextureCoordsCreator.cpp -${CMAKE_CURRENT_LIST_DIR}/RivTernaryScalarMapperEffectGenerator.cpp -${CMAKE_CURRENT_LIST_DIR}/RivScalarMapperUtils.cpp -${CMAKE_CURRENT_LIST_DIR}/RivCellEdgeGeometryUtils.cpp -${CMAKE_CURRENT_LIST_DIR}/RivPipeQuadToSegmentMapper.cpp -${CMAKE_CURRENT_LIST_DIR}/RivSingleCellPartGenerator.cpp -${CMAKE_CURRENT_LIST_DIR}/RivSimWellPipeSourceInfo.cpp -${CMAKE_CURRENT_LIST_DIR}/RivWellSpheresPartMgr.cpp -${CMAKE_CURRENT_LIST_DIR}/RivObjectSourceInfo.cpp -${CMAKE_CURRENT_LIST_DIR}/RivWellConnectionsPartMgr.cpp -${CMAKE_CURRENT_LIST_DIR}/RivFishbonesSubsPartMgr.cpp -${CMAKE_CURRENT_LIST_DIR}/RivTensorResultPartMgr.cpp -${CMAKE_CURRENT_LIST_DIR}/RivWellFracturePartMgr.cpp -${CMAKE_CURRENT_LIST_DIR}/Riv3dWellLogPlanePartMgr.cpp -${CMAKE_CURRENT_LIST_DIR}/Riv3dWellLogCurveGeometryGenerator.cpp -${CMAKE_CURRENT_LIST_DIR}/RivWellConnectionFactorPartMgr.cpp -${CMAKE_CURRENT_LIST_DIR}/RivWellConnectionFactorGeometryGenerator.cpp -${CMAKE_CURRENT_LIST_DIR}/RivWellConnectionSourceInfo.cpp -${CMAKE_CURRENT_LIST_DIR}/RivSimWellConnectionSourceInfo.cpp -${CMAKE_CURRENT_LIST_DIR}/Riv3dWellLogDrawSurfaceGenerator.cpp -${CMAKE_CURRENT_LIST_DIR}/RivMeshLinesSourceInfo.cpp -${CMAKE_CURRENT_LIST_DIR}/RivContourMapProjectionPartMgr.cpp -${CMAKE_CURRENT_LIST_DIR}/RivAnnotationsPartMgr.cpp -${CMAKE_CURRENT_LIST_DIR}/RivTextAnnotationPartMgr.cpp -${CMAKE_CURRENT_LIST_DIR}/RivReachCircleAnnotationPartMgr.cpp -${CMAKE_CURRENT_LIST_DIR}/RivReachCircleAnnotationSourceInfo.cpp -${CMAKE_CURRENT_LIST_DIR}/RivPolylinesAnnotationSourceInfo.cpp -${CMAKE_CURRENT_LIST_DIR}/RivPolylineGenerator.cpp -${CMAKE_CURRENT_LIST_DIR}/RivMeasurementPartMgr.cpp -${CMAKE_CURRENT_LIST_DIR}/RivTextLabelSourceInfo.cpp -${CMAKE_CURRENT_LIST_DIR}/RivDiskGeometryGenerator.cpp -${CMAKE_CURRENT_LIST_DIR}/RivWellDiskPartMgr.cpp -${CMAKE_CURRENT_LIST_DIR}/RivElementVectorResultPartMgr.cpp -${CMAKE_CURRENT_LIST_DIR}/RivPolylinePartMgr.cpp -${CMAKE_CURRENT_LIST_DIR}/RivCellFilterPartMgr.cpp -${CMAKE_CURRENT_LIST_DIR}/RivDrawableSpheres.cpp -) +list(APPEND CODE_HEADER_FILES ${SOURCE_GROUP_HEADER_FILES}) -list(APPEND CODE_HEADER_FILES -${SOURCE_GROUP_HEADER_FILES} -) +list(APPEND CODE_SOURCE_FILES ${SOURCE_GROUP_SOURCE_FILES}) -list(APPEND CODE_SOURCE_FILES -${SOURCE_GROUP_SOURCE_FILES} -) - -source_group( "ModelVisualization" FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake ) +source_group( + "ModelVisualization" + FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} + ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake) diff --git a/ApplicationLibCode/ModelVisualization/GridBox/CMakeLists_files.cmake b/ApplicationLibCode/ModelVisualization/GridBox/CMakeLists_files.cmake index 3406423cc9..bb854d9872 100644 --- a/ApplicationLibCode/ModelVisualization/GridBox/CMakeLists_files.cmake +++ b/ApplicationLibCode/ModelVisualization/GridBox/CMakeLists_files.cmake @@ -1,21 +1,14 @@ +set(SOURCE_GROUP_HEADER_FILES ${CMAKE_CURRENT_LIST_DIR}/RivPatchGenerator.h + ${CMAKE_CURRENT_LIST_DIR}/RivGridBoxGenerator.h) -set (SOURCE_GROUP_HEADER_FILES -${CMAKE_CURRENT_LIST_DIR}/RivPatchGenerator.h -${CMAKE_CURRENT_LIST_DIR}/RivGridBoxGenerator.h -) +set(SOURCE_GROUP_SOURCE_FILES ${CMAKE_CURRENT_LIST_DIR}/RivPatchGenerator.cpp + ${CMAKE_CURRENT_LIST_DIR}/RivGridBoxGenerator.cpp) -set (SOURCE_GROUP_SOURCE_FILES -${CMAKE_CURRENT_LIST_DIR}/RivPatchGenerator.cpp -${CMAKE_CURRENT_LIST_DIR}/RivGridBoxGenerator.cpp +list(APPEND CODE_HEADER_FILES ${SOURCE_GROUP_HEADER_FILES}) -) +list(APPEND CODE_SOURCE_FILES ${SOURCE_GROUP_SOURCE_FILES}) -list(APPEND CODE_HEADER_FILES -${SOURCE_GROUP_HEADER_FILES} -) - -list(APPEND CODE_SOURCE_FILES -${SOURCE_GROUP_SOURCE_FILES} -) - -source_group( "ModelVisualization\\GridBox" FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake ) +source_group( + "ModelVisualization\\GridBox" + FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} + ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake) diff --git a/ApplicationLibCode/ModelVisualization/Intersections/CMakeLists_files.cmake b/ApplicationLibCode/ModelVisualization/Intersections/CMakeLists_files.cmake index bd0327f6d6..9bf55fb091 100644 --- a/ApplicationLibCode/ModelVisualization/Intersections/CMakeLists_files.cmake +++ b/ApplicationLibCode/ModelVisualization/Intersections/CMakeLists_files.cmake @@ -1,34 +1,30 @@ +set(SOURCE_GROUP_HEADER_FILES + ${CMAKE_CURRENT_LIST_DIR}/RivExtrudedCurveIntersectionGeometryGenerator.h + ${CMAKE_CURRENT_LIST_DIR}/RivExtrudedCurveIntersectionPartMgr.h + ${CMAKE_CURRENT_LIST_DIR}/RivExtrudedCurveIntersectionSourceInfo.h + ${CMAKE_CURRENT_LIST_DIR}/RivIntersectionResultsColoringTools.h + ${CMAKE_CURRENT_LIST_DIR}/RivHexGridIntersectionTools.h + ${CMAKE_CURRENT_LIST_DIR}/RivBoxIntersectionGeometryGenerator.h + ${CMAKE_CURRENT_LIST_DIR}/RivBoxIntersectionPartMgr.h + ${CMAKE_CURRENT_LIST_DIR}/RivBoxIntersectionSourceInfo.h + ${CMAKE_CURRENT_LIST_DIR}/RivSectionFlattener.h) -set (SOURCE_GROUP_HEADER_FILES -${CMAKE_CURRENT_LIST_DIR}/RivExtrudedCurveIntersectionGeometryGenerator.h -${CMAKE_CURRENT_LIST_DIR}/RivExtrudedCurveIntersectionPartMgr.h -${CMAKE_CURRENT_LIST_DIR}/RivExtrudedCurveIntersectionSourceInfo.h -${CMAKE_CURRENT_LIST_DIR}/RivIntersectionResultsColoringTools.h -${CMAKE_CURRENT_LIST_DIR}/RivHexGridIntersectionTools.h -${CMAKE_CURRENT_LIST_DIR}/RivBoxIntersectionGeometryGenerator.h -${CMAKE_CURRENT_LIST_DIR}/RivBoxIntersectionPartMgr.h -${CMAKE_CURRENT_LIST_DIR}/RivBoxIntersectionSourceInfo.h -${CMAKE_CURRENT_LIST_DIR}/RivSectionFlattener.h -) +set(SOURCE_GROUP_SOURCE_FILES + ${CMAKE_CURRENT_LIST_DIR}/RivExtrudedCurveIntersectionGeometryGenerator.cpp + ${CMAKE_CURRENT_LIST_DIR}/RivExtrudedCurveIntersectionPartMgr.cpp + ${CMAKE_CURRENT_LIST_DIR}/RivExtrudedCurveIntersectionSourceInfo.cpp + ${CMAKE_CURRENT_LIST_DIR}/RivIntersectionResultsColoringTools.cpp + ${CMAKE_CURRENT_LIST_DIR}/RivHexGridIntersectionTools.cpp + ${CMAKE_CURRENT_LIST_DIR}/RivBoxIntersectionGeometryGenerator.cpp + ${CMAKE_CURRENT_LIST_DIR}/RivBoxIntersectionPartMgr.cpp + ${CMAKE_CURRENT_LIST_DIR}/RivBoxIntersectionSourceInfo.cpp + ${CMAKE_CURRENT_LIST_DIR}/RivSectionFlattener.cpp) -set (SOURCE_GROUP_SOURCE_FILES -${CMAKE_CURRENT_LIST_DIR}/RivExtrudedCurveIntersectionGeometryGenerator.cpp -${CMAKE_CURRENT_LIST_DIR}/RivExtrudedCurveIntersectionPartMgr.cpp -${CMAKE_CURRENT_LIST_DIR}/RivExtrudedCurveIntersectionSourceInfo.cpp -${CMAKE_CURRENT_LIST_DIR}/RivIntersectionResultsColoringTools.cpp -${CMAKE_CURRENT_LIST_DIR}/RivHexGridIntersectionTools.cpp -${CMAKE_CURRENT_LIST_DIR}/RivBoxIntersectionGeometryGenerator.cpp -${CMAKE_CURRENT_LIST_DIR}/RivBoxIntersectionPartMgr.cpp -${CMAKE_CURRENT_LIST_DIR}/RivBoxIntersectionSourceInfo.cpp -${CMAKE_CURRENT_LIST_DIR}/RivSectionFlattener.cpp -) +list(APPEND CODE_HEADER_FILES ${SOURCE_GROUP_HEADER_FILES}) -list(APPEND CODE_HEADER_FILES -${SOURCE_GROUP_HEADER_FILES} -) +list(APPEND CODE_SOURCE_FILES ${SOURCE_GROUP_SOURCE_FILES}) -list(APPEND CODE_SOURCE_FILES -${SOURCE_GROUP_SOURCE_FILES} -) - -source_group( "ModelVisualization\\Intersections" FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake ) +source_group( + "ModelVisualization\\Intersections" + FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} + ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake) diff --git a/ApplicationLibCode/ModelVisualization/Streamlines/CMakeLists_files.cmake b/ApplicationLibCode/ModelVisualization/Streamlines/CMakeLists_files.cmake index b08a593964..b9ff5c3fb1 100644 --- a/ApplicationLibCode/ModelVisualization/Streamlines/CMakeLists_files.cmake +++ b/ApplicationLibCode/ModelVisualization/Streamlines/CMakeLists_files.cmake @@ -1,18 +1,13 @@ +set(SOURCE_GROUP_HEADER_FILES ${CMAKE_CURRENT_LIST_DIR}/RivStreamlinesPartMgr.h) -set (SOURCE_GROUP_HEADER_FILES -${CMAKE_CURRENT_LIST_DIR}/RivStreamlinesPartMgr.h -) +set(SOURCE_GROUP_SOURCE_FILES + ${CMAKE_CURRENT_LIST_DIR}/RivStreamlinesPartMgr.cpp) -set (SOURCE_GROUP_SOURCE_FILES -${CMAKE_CURRENT_LIST_DIR}/RivStreamlinesPartMgr.cpp -) +list(APPEND CODE_HEADER_FILES ${SOURCE_GROUP_HEADER_FILES}) -list(APPEND CODE_HEADER_FILES -${SOURCE_GROUP_HEADER_FILES} -) +list(APPEND CODE_SOURCE_FILES ${SOURCE_GROUP_SOURCE_FILES}) -list(APPEND CODE_SOURCE_FILES -${SOURCE_GROUP_SOURCE_FILES} -) - -source_group( "ModelVisualization\\Streamlines" FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake ) +source_group( + "ModelVisualization\\Streamlines" + FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} + ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake) diff --git a/ApplicationLibCode/ModelVisualization/Surfaces/CMakeLists_files.cmake b/ApplicationLibCode/ModelVisualization/Surfaces/CMakeLists_files.cmake index 42ac0d3b3c..dff7750c8e 100644 --- a/ApplicationLibCode/ModelVisualization/Surfaces/CMakeLists_files.cmake +++ b/ApplicationLibCode/ModelVisualization/Surfaces/CMakeLists_files.cmake @@ -1,23 +1,18 @@ +set(SOURCE_GROUP_HEADER_FILES + ${CMAKE_CURRENT_LIST_DIR}/RivSurfacePartMgr.h + ${CMAKE_CURRENT_LIST_DIR}/RivSurfaceIntersectionGeometryGenerator.h + ${CMAKE_CURRENT_LIST_DIR}/RivReservoirSurfaceIntersectionSourceInfo.h) -set (SOURCE_GROUP_HEADER_FILES -${CMAKE_CURRENT_LIST_DIR}/RivSurfacePartMgr.h -${CMAKE_CURRENT_LIST_DIR}/RivSurfaceIntersectionGeometryGenerator.h -${CMAKE_CURRENT_LIST_DIR}/RivReservoirSurfaceIntersectionSourceInfo.h -) +set(SOURCE_GROUP_SOURCE_FILES + ${CMAKE_CURRENT_LIST_DIR}/RivSurfacePartMgr.cpp + ${CMAKE_CURRENT_LIST_DIR}/RivSurfaceIntersectionGeometryGenerator.cpp + ${CMAKE_CURRENT_LIST_DIR}/RivReservoirSurfaceIntersectionSourceInfo.cpp) -set (SOURCE_GROUP_SOURCE_FILES -${CMAKE_CURRENT_LIST_DIR}/RivSurfacePartMgr.cpp -${CMAKE_CURRENT_LIST_DIR}/RivSurfaceIntersectionGeometryGenerator.cpp -${CMAKE_CURRENT_LIST_DIR}/RivReservoirSurfaceIntersectionSourceInfo.cpp -) +list(APPEND CODE_HEADER_FILES ${SOURCE_GROUP_HEADER_FILES}) -list(APPEND CODE_HEADER_FILES -${SOURCE_GROUP_HEADER_FILES} -) - -list(APPEND CODE_SOURCE_FILES -${SOURCE_GROUP_SOURCE_FILES} -) - -source_group( "ModelVisualization\\Surfaces" FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake ) +list(APPEND CODE_SOURCE_FILES ${SOURCE_GROUP_SOURCE_FILES}) +source_group( + "ModelVisualization\\Surfaces" + FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} + ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake) diff --git a/ApplicationLibCode/ModelVisualization/WindowEdgeAxesOverlayItem/CMakeLists_files.cmake b/ApplicationLibCode/ModelVisualization/WindowEdgeAxesOverlayItem/CMakeLists_files.cmake index 37eb426653..ff49abed8f 100644 --- a/ApplicationLibCode/ModelVisualization/WindowEdgeAxesOverlayItem/CMakeLists_files.cmake +++ b/ApplicationLibCode/ModelVisualization/WindowEdgeAxesOverlayItem/CMakeLists_files.cmake @@ -1,19 +1,14 @@ +set(SOURCE_GROUP_HEADER_FILES + ${CMAKE_CURRENT_LIST_DIR}/RivWindowEdgeAxesOverlayItem.h) -set (SOURCE_GROUP_HEADER_FILES -${CMAKE_CURRENT_LIST_DIR}/RivWindowEdgeAxesOverlayItem.h -) +set(SOURCE_GROUP_SOURCE_FILES + ${CMAKE_CURRENT_LIST_DIR}/RivWindowEdgeAxesOverlayItem.cpp) -set (SOURCE_GROUP_SOURCE_FILES -${CMAKE_CURRENT_LIST_DIR}/RivWindowEdgeAxesOverlayItem.cpp +list(APPEND CODE_HEADER_FILES ${SOURCE_GROUP_HEADER_FILES}) -) +list(APPEND CODE_SOURCE_FILES ${SOURCE_GROUP_SOURCE_FILES}) -list(APPEND CODE_HEADER_FILES -${SOURCE_GROUP_HEADER_FILES} -) - -list(APPEND CODE_SOURCE_FILES -${SOURCE_GROUP_SOURCE_FILES} -) - -source_group( "ModelVisualization\\WindowEdgeAxesOverlayItem" FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake ) +source_group( + "ModelVisualization\\WindowEdgeAxesOverlayItem" + FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} + ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake) diff --git a/ApplicationLibCode/ProjectDataModel/AnalysisPlots/CMakeLists_files.cmake b/ApplicationLibCode/ProjectDataModel/AnalysisPlots/CMakeLists_files.cmake index be9ce0b379..b95599493f 100644 --- a/ApplicationLibCode/ProjectDataModel/AnalysisPlots/CMakeLists_files.cmake +++ b/ApplicationLibCode/ProjectDataModel/AnalysisPlots/CMakeLists_files.cmake @@ -1,29 +1,24 @@ +set(SOURCE_GROUP_HEADER_FILES + ${CMAKE_CURRENT_LIST_DIR}/RimAnalysisPlot.h + ${CMAKE_CURRENT_LIST_DIR}/RimAnalysisPlotDataEntry.h + ${CMAKE_CURRENT_LIST_DIR}/RimAnalysisPlotCollection.h + ${CMAKE_CURRENT_LIST_DIR}/RimPlotDataFilterCollection.h + ${CMAKE_CURRENT_LIST_DIR}/RimPlotDataFilterItem.h) -set (SOURCE_GROUP_HEADER_FILES -${CMAKE_CURRENT_LIST_DIR}/RimAnalysisPlot.h -${CMAKE_CURRENT_LIST_DIR}/RimAnalysisPlotDataEntry.h -${CMAKE_CURRENT_LIST_DIR}/RimAnalysisPlotCollection.h -${CMAKE_CURRENT_LIST_DIR}/RimPlotDataFilterCollection.h -${CMAKE_CURRENT_LIST_DIR}/RimPlotDataFilterItem.h -) +set(SOURCE_GROUP_SOURCE_FILES + ${CMAKE_CURRENT_LIST_DIR}/RimAnalysisPlot.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimAnalysisPlotDataEntry.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimAnalysisPlotCollection.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimPlotDataFilterCollection.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimPlotDataFilterItem.cpp) -set (SOURCE_GROUP_SOURCE_FILES -${CMAKE_CURRENT_LIST_DIR}/RimAnalysisPlot.cpp -${CMAKE_CURRENT_LIST_DIR}/RimAnalysisPlotDataEntry.cpp -${CMAKE_CURRENT_LIST_DIR}/RimAnalysisPlotCollection.cpp -${CMAKE_CURRENT_LIST_DIR}/RimPlotDataFilterCollection.cpp -${CMAKE_CURRENT_LIST_DIR}/RimPlotDataFilterItem.cpp -) +list(APPEND CODE_HEADER_FILES ${SOURCE_GROUP_HEADER_FILES}) -list(APPEND CODE_HEADER_FILES -${SOURCE_GROUP_HEADER_FILES} -) +list(APPEND CODE_SOURCE_FILES ${SOURCE_GROUP_SOURCE_FILES}) -list(APPEND CODE_SOURCE_FILES -${SOURCE_GROUP_SOURCE_FILES} -) +list(APPEND QT_MOC_HEADERS) -list(APPEND QT_MOC_HEADERS -) - -source_group( "ProjectDataModel\\AnalysisPlots" FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake ) +source_group( + "ProjectDataModel\\AnalysisPlots" + FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} + ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake) diff --git a/ApplicationLibCode/ProjectDataModel/Annotations/CMakeLists_files.cmake b/ApplicationLibCode/ProjectDataModel/Annotations/CMakeLists_files.cmake index b32f471b2d..d8fc54c87c 100644 --- a/ApplicationLibCode/ProjectDataModel/Annotations/CMakeLists_files.cmake +++ b/ApplicationLibCode/ProjectDataModel/Annotations/CMakeLists_files.cmake @@ -1,55 +1,48 @@ +set(SOURCE_GROUP_HEADER_FILES + ${CMAKE_CURRENT_LIST_DIR}/RimAnnotationCollectionBase.h + ${CMAKE_CURRENT_LIST_DIR}/RimAnnotationCollection.h + ${CMAKE_CURRENT_LIST_DIR}/RimPolylinesAnnotation.h + ${CMAKE_CURRENT_LIST_DIR}/RimPolylinesFromFileAnnotation.h + ${CMAKE_CURRENT_LIST_DIR}/RimUserDefinedPolylinesAnnotation.h + ${CMAKE_CURRENT_LIST_DIR}/RimReachCircleAnnotation.h + ${CMAKE_CURRENT_LIST_DIR}/RimTextAnnotation.h + ${CMAKE_CURRENT_LIST_DIR}/RimAnnotationInViewCollection.h + ${CMAKE_CURRENT_LIST_DIR}/RimAnnotationLineAppearance.h + ${CMAKE_CURRENT_LIST_DIR}/RimAnnotationTextAppearance.h + ${CMAKE_CURRENT_LIST_DIR}/RimPolylinesFromFileAnnotationInView.h + ${CMAKE_CURRENT_LIST_DIR}/RimUserDefinedPolylinesAnnotationInView.h + ${CMAKE_CURRENT_LIST_DIR}/RimPolylinesAnnotationInView.h + ${CMAKE_CURRENT_LIST_DIR}/RimReachCircleAnnotationInView.h + ${CMAKE_CURRENT_LIST_DIR}/RimTextAnnotationInView.h + ${CMAKE_CURRENT_LIST_DIR}/RimAnnotationGroupCollection.h + ${CMAKE_CURRENT_LIST_DIR}/RimPolylineTarget.h) -set (SOURCE_GROUP_HEADER_FILES -${CMAKE_CURRENT_LIST_DIR}/RimAnnotationCollectionBase.h -${CMAKE_CURRENT_LIST_DIR}/RimAnnotationCollection.h -${CMAKE_CURRENT_LIST_DIR}/RimPolylinesAnnotation.h -${CMAKE_CURRENT_LIST_DIR}/RimPolylinesFromFileAnnotation.h -${CMAKE_CURRENT_LIST_DIR}/RimUserDefinedPolylinesAnnotation.h -${CMAKE_CURRENT_LIST_DIR}/RimReachCircleAnnotation.h -${CMAKE_CURRENT_LIST_DIR}/RimTextAnnotation.h -${CMAKE_CURRENT_LIST_DIR}/RimAnnotationInViewCollection.h -${CMAKE_CURRENT_LIST_DIR}/RimAnnotationLineAppearance.h -${CMAKE_CURRENT_LIST_DIR}/RimAnnotationTextAppearance.h -${CMAKE_CURRENT_LIST_DIR}/RimPolylinesFromFileAnnotationInView.h -${CMAKE_CURRENT_LIST_DIR}/RimUserDefinedPolylinesAnnotationInView.h -${CMAKE_CURRENT_LIST_DIR}/RimPolylinesAnnotationInView.h -${CMAKE_CURRENT_LIST_DIR}/RimReachCircleAnnotationInView.h -${CMAKE_CURRENT_LIST_DIR}/RimTextAnnotationInView.h -${CMAKE_CURRENT_LIST_DIR}/RimAnnotationGroupCollection.h -${CMAKE_CURRENT_LIST_DIR}/RimPolylineTarget.h -) +set(SOURCE_GROUP_SOURCE_FILES + ${CMAKE_CURRENT_LIST_DIR}/RimAnnotationCollectionBase.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimAnnotationCollection.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimPolylinesAnnotation.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimPolylinesFromFileAnnotation.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimUserDefinedPolylinesAnnotation.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimReachCircleAnnotation.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimTextAnnotation.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimAnnotationInViewCollection.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimAnnotationLineAppearance.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimAnnotationTextAppearance.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimPolylinesFromFileAnnotationInView.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimUserDefinedPolylinesAnnotationInView.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimPolylinesAnnotationInView.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimReachCircleAnnotationInView.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimTextAnnotationInView.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimAnnotationGroupCollection.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimPolylineTarget.cpp) -set (SOURCE_GROUP_SOURCE_FILES -${CMAKE_CURRENT_LIST_DIR}/RimAnnotationCollectionBase.cpp -${CMAKE_CURRENT_LIST_DIR}/RimAnnotationCollection.cpp -${CMAKE_CURRENT_LIST_DIR}/RimPolylinesAnnotation.cpp -${CMAKE_CURRENT_LIST_DIR}/RimPolylinesFromFileAnnotation.cpp -${CMAKE_CURRENT_LIST_DIR}/RimUserDefinedPolylinesAnnotation.cpp -${CMAKE_CURRENT_LIST_DIR}/RimReachCircleAnnotation.cpp -${CMAKE_CURRENT_LIST_DIR}/RimTextAnnotation.cpp -${CMAKE_CURRENT_LIST_DIR}/RimAnnotationInViewCollection.cpp -${CMAKE_CURRENT_LIST_DIR}/RimAnnotationLineAppearance.cpp -${CMAKE_CURRENT_LIST_DIR}/RimAnnotationTextAppearance.cpp -${CMAKE_CURRENT_LIST_DIR}/RimPolylinesFromFileAnnotationInView.cpp -${CMAKE_CURRENT_LIST_DIR}/RimUserDefinedPolylinesAnnotationInView.cpp -${CMAKE_CURRENT_LIST_DIR}/RimPolylinesAnnotationInView.cpp -${CMAKE_CURRENT_LIST_DIR}/RimReachCircleAnnotationInView.cpp -${CMAKE_CURRENT_LIST_DIR}/RimTextAnnotationInView.cpp -${CMAKE_CURRENT_LIST_DIR}/RimAnnotationGroupCollection.cpp -${CMAKE_CURRENT_LIST_DIR}/RimPolylineTarget.cpp -) +list(APPEND CODE_HEADER_FILES ${SOURCE_GROUP_HEADER_FILES}) -list(APPEND CODE_HEADER_FILES -${SOURCE_GROUP_HEADER_FILES} -) +list(APPEND CODE_SOURCE_FILES ${SOURCE_GROUP_SOURCE_FILES}) -list(APPEND CODE_SOURCE_FILES -${SOURCE_GROUP_SOURCE_FILES} -) +set(QT_MOC_HEADERS ${QT_MOC_HEADERS}) -set (QT_MOC_HEADERS -${QT_MOC_HEADERS} -) - - -source_group( "ProjectDataModel\\Annotations" FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake ) +source_group( + "ProjectDataModel\\Annotations" + FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} + ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake) diff --git a/ApplicationLibCode/ProjectDataModel/CMakeLists_files.cmake b/ApplicationLibCode/ProjectDataModel/CMakeLists_files.cmake index 245d4fb7a5..2703dff253 100644 --- a/ApplicationLibCode/ProjectDataModel/CMakeLists_files.cmake +++ b/ApplicationLibCode/ProjectDataModel/CMakeLists_files.cmake @@ -1,274 +1,269 @@ +set(SOURCE_GROUP_HEADER_FILES + ${CMAKE_CURRENT_LIST_DIR}/RimEclipseCaseCollection.h + ${CMAKE_CURRENT_LIST_DIR}/RimCaseCollection.h + ${CMAKE_CURRENT_LIST_DIR}/RimLegendConfigChangeType.h + ${CMAKE_CURRENT_LIST_DIR}/RimRegularLegendConfig.h + ${CMAKE_CURRENT_LIST_DIR}/RimOilField.h + ${CMAKE_CURRENT_LIST_DIR}/RimProject.h + ${CMAKE_CURRENT_LIST_DIR}/RimEclipseCase.h + ${CMAKE_CURRENT_LIST_DIR}/RimIdenticalGridCaseGroup.h + ${CMAKE_CURRENT_LIST_DIR}/RimEclipseInputProperty.h + ${CMAKE_CURRENT_LIST_DIR}/RimEclipseInputPropertyCollection.h + ${CMAKE_CURRENT_LIST_DIR}/RimEclipseInputCase.h + ${CMAKE_CURRENT_LIST_DIR}/RimEclipseResultCase.h + ${CMAKE_CURRENT_LIST_DIR}/RimEclipseView.h + ${CMAKE_CURRENT_LIST_DIR}/RimEclipseResultDefinition.h + ${CMAKE_CURRENT_LIST_DIR}/RimEclipseCellColors.h + ${CMAKE_CURRENT_LIST_DIR}/RimCellEdgeColors.h + ${CMAKE_CURRENT_LIST_DIR}/RimSimWellInView.h + ${CMAKE_CURRENT_LIST_DIR}/RimSimWellInViewCollection.h + ${CMAKE_CURRENT_LIST_DIR}/RimSimWellInViewTools.h + ${CMAKE_CURRENT_LIST_DIR}/RimScriptCollection.h + ${CMAKE_CURRENT_LIST_DIR}/RimEclipseStatisticsCase.h + ${CMAKE_CURRENT_LIST_DIR}/RimEclipseStatisticsCaseCollection.h + ${CMAKE_CURRENT_LIST_DIR}/RimCalcScript.h + ${CMAKE_CURRENT_LIST_DIR}/RimExportInputPropertySettings.h + ${CMAKE_CURRENT_LIST_DIR}/RimBinaryExportSettings.h + ${CMAKE_CURRENT_LIST_DIR}/Rim3dOverlayInfoConfig.h + ${CMAKE_CURRENT_LIST_DIR}/RimHistogramCalculator.h + ${CMAKE_CURRENT_LIST_DIR}/RimTensorResults.h + ${CMAKE_CURRENT_LIST_DIR}/RimReservoirCellResultsStorage.h + ${CMAKE_CURRENT_LIST_DIR}/RimEclipseStatisticsCaseEvaluator.h + ${CMAKE_CURRENT_LIST_DIR}/RimMimeData.h + ${CMAKE_CURRENT_LIST_DIR}/RimCommandObject.h + ${CMAKE_CURRENT_LIST_DIR}/RimTools.h + ${CMAKE_CURRENT_LIST_DIR}/RimFormationNames.h + ${CMAKE_CURRENT_LIST_DIR}/RimFormationNamesCollection.h + ${CMAKE_CURRENT_LIST_DIR}/RimMockModelSettings.h + ${CMAKE_CURRENT_LIST_DIR}/RimTernaryLegendConfig.h + ${CMAKE_CURRENT_LIST_DIR}/RimEclipseFaultColors.h + ${CMAKE_CURRENT_LIST_DIR}/RimViewWindow.h + ${CMAKE_CURRENT_LIST_DIR}/Rim3dView.h + ${CMAKE_CURRENT_LIST_DIR}/RimGridView.h + ${CMAKE_CURRENT_LIST_DIR}/Rim2dIntersectionView.h + ${CMAKE_CURRENT_LIST_DIR}/Rim2dIntersectionViewCollection.h + ${CMAKE_CURRENT_LIST_DIR}/RimViewManipulator.h + ${CMAKE_CURRENT_LIST_DIR}/RimCase.h + ${CMAKE_CURRENT_LIST_DIR}/RimViewController.h + ${CMAKE_CURRENT_LIST_DIR}/RimMainPlotCollection.h + ${CMAKE_CURRENT_LIST_DIR}/RimRftPlotCollection.h + ${CMAKE_CURRENT_LIST_DIR}/RimPltPlotCollection.h + ${CMAKE_CURRENT_LIST_DIR}/RimVfpPlotCollection.h + ${CMAKE_CURRENT_LIST_DIR}/RimVfpPlot.h + ${CMAKE_CURRENT_LIST_DIR}/RimVfpDefines.h + ${CMAKE_CURRENT_LIST_DIR}/RimPlot.h + ${CMAKE_CURRENT_LIST_DIR}/RimPlotWindow.h + ${CMAKE_CURRENT_LIST_DIR}/RimMultiPlot.h + ${CMAKE_CURRENT_LIST_DIR}/RimDepthTrackPlot.h + ${CMAKE_CURRENT_LIST_DIR}/RimWellBoreStabilityPlot.h + ${CMAKE_CURRENT_LIST_DIR}/RimWbsParameters.h + ${CMAKE_CURRENT_LIST_DIR}/RimViewLinker.h + ${CMAKE_CURRENT_LIST_DIR}/RimViewLinkerCollection.h + ${CMAKE_CURRENT_LIST_DIR}/RimIntersection.h + ${CMAKE_CURRENT_LIST_DIR}/RimExtrudedCurveIntersection.h + ${CMAKE_CURRENT_LIST_DIR}/RimIntersectionCollection.h + ${CMAKE_CURRENT_LIST_DIR}/RimIntersectionResultDefinition.h + ${CMAKE_CURRENT_LIST_DIR}/RimIntersectionResultsDefinitionCollection.h + ${CMAKE_CURRENT_LIST_DIR}/RimContextCommandBuilder.h + ${CMAKE_CURRENT_LIST_DIR}/RimGridCollection.h + ${CMAKE_CURRENT_LIST_DIR}/RimPlotCurve.h + ${CMAKE_CURRENT_LIST_DIR}/RimStackablePlotCurve.h + ${CMAKE_CURRENT_LIST_DIR}/RimBoxIntersection.h + ${CMAKE_CURRENT_LIST_DIR}/RimAdvancedSnapshotExportDefinition.h + ${CMAKE_CURRENT_LIST_DIR}/RimMdiWindowController.h + ${CMAKE_CURRENT_LIST_DIR}/RimNamedObject.h + ${CMAKE_CURRENT_LIST_DIR}/RimCheckableNamedObject.h + ${CMAKE_CURRENT_LIST_DIR}/RimCheckableObject.h + ${CMAKE_CURRENT_LIST_DIR}/RimGridTimeHistoryCurve.h + ${CMAKE_CURRENT_LIST_DIR}/RimGeometrySelectionItem.h + ${CMAKE_CURRENT_LIST_DIR}/RimEclipseGeometrySelectionItem.h + ${CMAKE_CURRENT_LIST_DIR}/RimDialogData.h + ${CMAKE_CURRENT_LIST_DIR}/RimTimeStepFilter.h + ${CMAKE_CURRENT_LIST_DIR}/RimSummaryCalculation.h + ${CMAKE_CURRENT_LIST_DIR}/RimSummaryCalculationCollection.h + ${CMAKE_CURRENT_LIST_DIR}/RimSummaryCalculationVariable.h + ${CMAKE_CURRENT_LIST_DIR}/RimStimPlanLegendConfig.h + ${CMAKE_CURRENT_LIST_DIR}/RimStimPlanColors.h + ${CMAKE_CURRENT_LIST_DIR}/RimVirtualPerforationResults.h + ${CMAKE_CURRENT_LIST_DIR}/RimLegendConfig.h + ${CMAKE_CURRENT_LIST_DIR}/RimNameConfig.h + ${CMAKE_CURRENT_LIST_DIR}/RimDataSourceSteppingTools.h + ${CMAKE_CURRENT_LIST_DIR}/RimContourMapProjection.h + ${CMAKE_CURRENT_LIST_DIR}/RimEclipseContourMapProjection.h + ${CMAKE_CURRENT_LIST_DIR}/RimEclipseContourMapView.h + ${CMAKE_CURRENT_LIST_DIR}/RimEclipseContourMapViewCollection.h + ${CMAKE_CURRENT_LIST_DIR}/RimMudWeightWindowParameters.h + ${CMAKE_CURRENT_LIST_DIR}/RimViewNameConfig.h + ${CMAKE_CURRENT_LIST_DIR}/RimReloadCaseTools.h + ${CMAKE_CURRENT_LIST_DIR}/RimPlotAxisPropertiesInterface.h + ${CMAKE_CURRENT_LIST_DIR}/RimPlotAxisProperties.h + ${CMAKE_CURRENT_LIST_DIR}/RimPlotAxisAnnotation.h + ${CMAKE_CURRENT_LIST_DIR}/RimObservedDataCollection.h + ${CMAKE_CURRENT_LIST_DIR}/RimObservedFmuRftData.h + ${CMAKE_CURRENT_LIST_DIR}/RimMultiPlotCollection.h + ${CMAKE_CURRENT_LIST_DIR}/RimWellDiskConfig.h + ${CMAKE_CURRENT_LIST_DIR}/RimElementVectorResult.h + ${CMAKE_CURRENT_LIST_DIR}/RimColorLegendCollection.h + ${CMAKE_CURRENT_LIST_DIR}/RimColorLegend.h + ${CMAKE_CURRENT_LIST_DIR}/RimColorLegendItem.h + ${CMAKE_CURRENT_LIST_DIR}/RimAbstractPlotCollection.h + ${CMAKE_CURRENT_LIST_DIR}/RimPolylinePickerInterface.h + ${CMAKE_CURRENT_LIST_DIR}/RimVfpTableExtractor.h + ${CMAKE_CURRENT_LIST_DIR}/RimCaseDisplayNameTools.h + ${CMAKE_CURRENT_LIST_DIR}/RimCustomObjectiveFunctionCollection.h + ${CMAKE_CURRENT_LIST_DIR}/RimCustomObjectiveFunction.h + ${CMAKE_CURRENT_LIST_DIR}/RimCustomObjectiveFunctionWeight.h + ${CMAKE_CURRENT_LIST_DIR}/RimEquilibriumAxisAnnotation.h + ${CMAKE_CURRENT_LIST_DIR}/RimTimeAxisAnnotation.h + ${CMAKE_CURRENT_LIST_DIR}/RimPolylinesDataInterface.h + ${CMAKE_CURRENT_LIST_DIR}/RimEnsembleCurveSetInterface.h + ${CMAKE_CURRENT_LIST_DIR}/cafTreeNode.h + ${CMAKE_CURRENT_LIST_DIR}/RimMultipleLocations.h) -set (SOURCE_GROUP_HEADER_FILES -${CMAKE_CURRENT_LIST_DIR}/RimEclipseCaseCollection.h -${CMAKE_CURRENT_LIST_DIR}/RimCaseCollection.h -${CMAKE_CURRENT_LIST_DIR}/RimLegendConfigChangeType.h -${CMAKE_CURRENT_LIST_DIR}/RimRegularLegendConfig.h -${CMAKE_CURRENT_LIST_DIR}/RimOilField.h -${CMAKE_CURRENT_LIST_DIR}/RimProject.h -${CMAKE_CURRENT_LIST_DIR}/RimEclipseCase.h -${CMAKE_CURRENT_LIST_DIR}/RimIdenticalGridCaseGroup.h -${CMAKE_CURRENT_LIST_DIR}/RimEclipseInputProperty.h -${CMAKE_CURRENT_LIST_DIR}/RimEclipseInputPropertyCollection.h -${CMAKE_CURRENT_LIST_DIR}/RimEclipseInputCase.h -${CMAKE_CURRENT_LIST_DIR}/RimEclipseResultCase.h -${CMAKE_CURRENT_LIST_DIR}/RimEclipseView.h -${CMAKE_CURRENT_LIST_DIR}/RimEclipseResultDefinition.h -${CMAKE_CURRENT_LIST_DIR}/RimEclipseCellColors.h -${CMAKE_CURRENT_LIST_DIR}/RimCellEdgeColors.h -${CMAKE_CURRENT_LIST_DIR}/RimSimWellInView.h -${CMAKE_CURRENT_LIST_DIR}/RimSimWellInViewCollection.h -${CMAKE_CURRENT_LIST_DIR}/RimSimWellInViewTools.h -${CMAKE_CURRENT_LIST_DIR}/RimScriptCollection.h -${CMAKE_CURRENT_LIST_DIR}/RimEclipseStatisticsCase.h -${CMAKE_CURRENT_LIST_DIR}/RimEclipseStatisticsCaseCollection.h -${CMAKE_CURRENT_LIST_DIR}/RimCalcScript.h -${CMAKE_CURRENT_LIST_DIR}/RimExportInputPropertySettings.h -${CMAKE_CURRENT_LIST_DIR}/RimBinaryExportSettings.h -${CMAKE_CURRENT_LIST_DIR}/Rim3dOverlayInfoConfig.h -${CMAKE_CURRENT_LIST_DIR}/RimHistogramCalculator.h -${CMAKE_CURRENT_LIST_DIR}/RimTensorResults.h -${CMAKE_CURRENT_LIST_DIR}/RimReservoirCellResultsStorage.h -${CMAKE_CURRENT_LIST_DIR}/RimEclipseStatisticsCaseEvaluator.h -${CMAKE_CURRENT_LIST_DIR}/RimMimeData.h -${CMAKE_CURRENT_LIST_DIR}/RimCommandObject.h -${CMAKE_CURRENT_LIST_DIR}/RimTools.h -${CMAKE_CURRENT_LIST_DIR}/RimFormationNames.h -${CMAKE_CURRENT_LIST_DIR}/RimFormationNamesCollection.h -${CMAKE_CURRENT_LIST_DIR}/RimMockModelSettings.h -${CMAKE_CURRENT_LIST_DIR}/RimTernaryLegendConfig.h -${CMAKE_CURRENT_LIST_DIR}/RimEclipseFaultColors.h -${CMAKE_CURRENT_LIST_DIR}/RimViewWindow.h -${CMAKE_CURRENT_LIST_DIR}/Rim3dView.h -${CMAKE_CURRENT_LIST_DIR}/RimGridView.h -${CMAKE_CURRENT_LIST_DIR}/Rim2dIntersectionView.h -${CMAKE_CURRENT_LIST_DIR}/Rim2dIntersectionViewCollection.h -${CMAKE_CURRENT_LIST_DIR}/RimViewManipulator.h -${CMAKE_CURRENT_LIST_DIR}/RimCase.h -${CMAKE_CURRENT_LIST_DIR}/RimViewController.h -${CMAKE_CURRENT_LIST_DIR}/RimMainPlotCollection.h -${CMAKE_CURRENT_LIST_DIR}/RimRftPlotCollection.h -${CMAKE_CURRENT_LIST_DIR}/RimPltPlotCollection.h -${CMAKE_CURRENT_LIST_DIR}/RimVfpPlotCollection.h -${CMAKE_CURRENT_LIST_DIR}/RimVfpPlot.h -${CMAKE_CURRENT_LIST_DIR}/RimVfpDefines.h -${CMAKE_CURRENT_LIST_DIR}/RimPlot.h -${CMAKE_CURRENT_LIST_DIR}/RimPlotWindow.h -${CMAKE_CURRENT_LIST_DIR}/RimMultiPlot.h -${CMAKE_CURRENT_LIST_DIR}/RimDepthTrackPlot.h -${CMAKE_CURRENT_LIST_DIR}/RimWellBoreStabilityPlot.h -${CMAKE_CURRENT_LIST_DIR}/RimWbsParameters.h -${CMAKE_CURRENT_LIST_DIR}/RimViewLinker.h -${CMAKE_CURRENT_LIST_DIR}/RimViewLinkerCollection.h -${CMAKE_CURRENT_LIST_DIR}/RimIntersection.h -${CMAKE_CURRENT_LIST_DIR}/RimExtrudedCurveIntersection.h -${CMAKE_CURRENT_LIST_DIR}/RimIntersectionCollection.h -${CMAKE_CURRENT_LIST_DIR}/RimIntersectionResultDefinition.h -${CMAKE_CURRENT_LIST_DIR}/RimIntersectionResultsDefinitionCollection.h -${CMAKE_CURRENT_LIST_DIR}/RimContextCommandBuilder.h -${CMAKE_CURRENT_LIST_DIR}/RimGridCollection.h -${CMAKE_CURRENT_LIST_DIR}/RimPlotCurve.h -${CMAKE_CURRENT_LIST_DIR}/RimStackablePlotCurve.h -${CMAKE_CURRENT_LIST_DIR}/RimBoxIntersection.h -${CMAKE_CURRENT_LIST_DIR}/RimAdvancedSnapshotExportDefinition.h -${CMAKE_CURRENT_LIST_DIR}/RimMdiWindowController.h -${CMAKE_CURRENT_LIST_DIR}/RimNamedObject.h -${CMAKE_CURRENT_LIST_DIR}/RimCheckableNamedObject.h -${CMAKE_CURRENT_LIST_DIR}/RimCheckableObject.h -${CMAKE_CURRENT_LIST_DIR}/RimGridTimeHistoryCurve.h -${CMAKE_CURRENT_LIST_DIR}/RimGeometrySelectionItem.h -${CMAKE_CURRENT_LIST_DIR}/RimEclipseGeometrySelectionItem.h -${CMAKE_CURRENT_LIST_DIR}/RimDialogData.h -${CMAKE_CURRENT_LIST_DIR}/RimTimeStepFilter.h -${CMAKE_CURRENT_LIST_DIR}/RimSummaryCalculation.h -${CMAKE_CURRENT_LIST_DIR}/RimSummaryCalculationCollection.h -${CMAKE_CURRENT_LIST_DIR}/RimSummaryCalculationVariable.h -${CMAKE_CURRENT_LIST_DIR}/RimStimPlanLegendConfig.h -${CMAKE_CURRENT_LIST_DIR}/RimStimPlanColors.h -${CMAKE_CURRENT_LIST_DIR}/RimVirtualPerforationResults.h -${CMAKE_CURRENT_LIST_DIR}/RimLegendConfig.h -${CMAKE_CURRENT_LIST_DIR}/RimNameConfig.h -${CMAKE_CURRENT_LIST_DIR}/RimDataSourceSteppingTools.h -${CMAKE_CURRENT_LIST_DIR}/RimContourMapProjection.h -${CMAKE_CURRENT_LIST_DIR}/RimEclipseContourMapProjection.h -${CMAKE_CURRENT_LIST_DIR}/RimEclipseContourMapView.h -${CMAKE_CURRENT_LIST_DIR}/RimEclipseContourMapViewCollection.h -${CMAKE_CURRENT_LIST_DIR}/RimMudWeightWindowParameters.h -${CMAKE_CURRENT_LIST_DIR}/RimViewNameConfig.h -${CMAKE_CURRENT_LIST_DIR}/RimReloadCaseTools.h -${CMAKE_CURRENT_LIST_DIR}/RimPlotAxisPropertiesInterface.h -${CMAKE_CURRENT_LIST_DIR}/RimPlotAxisProperties.h -${CMAKE_CURRENT_LIST_DIR}/RimPlotAxisAnnotation.h -${CMAKE_CURRENT_LIST_DIR}/RimObservedDataCollection.h -${CMAKE_CURRENT_LIST_DIR}/RimObservedFmuRftData.h -${CMAKE_CURRENT_LIST_DIR}/RimMultiPlotCollection.h -${CMAKE_CURRENT_LIST_DIR}/RimWellDiskConfig.h -${CMAKE_CURRENT_LIST_DIR}/RimElementVectorResult.h -${CMAKE_CURRENT_LIST_DIR}/RimColorLegendCollection.h -${CMAKE_CURRENT_LIST_DIR}/RimColorLegend.h -${CMAKE_CURRENT_LIST_DIR}/RimColorLegendItem.h -${CMAKE_CURRENT_LIST_DIR}/RimAbstractPlotCollection.h -${CMAKE_CURRENT_LIST_DIR}/RimPolylinePickerInterface.h -${CMAKE_CURRENT_LIST_DIR}/RimVfpTableExtractor.h -${CMAKE_CURRENT_LIST_DIR}/RimCaseDisplayNameTools.h -${CMAKE_CURRENT_LIST_DIR}/RimCustomObjectiveFunctionCollection.h -${CMAKE_CURRENT_LIST_DIR}/RimCustomObjectiveFunction.h -${CMAKE_CURRENT_LIST_DIR}/RimCustomObjectiveFunctionWeight.h -${CMAKE_CURRENT_LIST_DIR}/RimEquilibriumAxisAnnotation.h -${CMAKE_CURRENT_LIST_DIR}/RimTimeAxisAnnotation.h -${CMAKE_CURRENT_LIST_DIR}/RimPolylinesDataInterface.h -${CMAKE_CURRENT_LIST_DIR}/RimEnsembleCurveSetInterface.h -${CMAKE_CURRENT_LIST_DIR}/cafTreeNode.h -${CMAKE_CURRENT_LIST_DIR}/RimMultipleLocations.h -) - - -set (SOURCE_GROUP_SOURCE_FILES -${CMAKE_CURRENT_LIST_DIR}/RimEclipseCaseCollection.cpp -${CMAKE_CURRENT_LIST_DIR}/RimCaseCollection.cpp -${CMAKE_CURRENT_LIST_DIR}/RimRegularLegendConfig.cpp -${CMAKE_CURRENT_LIST_DIR}/RimOilField.cpp -${CMAKE_CURRENT_LIST_DIR}/RimProject.cpp -${CMAKE_CURRENT_LIST_DIR}/RimEclipseCase.cpp -${CMAKE_CURRENT_LIST_DIR}/RimIdenticalGridCaseGroup.cpp -${CMAKE_CURRENT_LIST_DIR}/RimEclipseInputProperty.cpp -${CMAKE_CURRENT_LIST_DIR}/RimEclipseInputPropertyCollection.cpp -${CMAKE_CURRENT_LIST_DIR}/RimEclipseInputCase.cpp -${CMAKE_CURRENT_LIST_DIR}/RimEclipseResultCase.cpp -${CMAKE_CURRENT_LIST_DIR}/RimEclipseView.cpp -${CMAKE_CURRENT_LIST_DIR}/RimEclipseResultDefinition.cpp -${CMAKE_CURRENT_LIST_DIR}/RimEclipseCellColors.cpp -${CMAKE_CURRENT_LIST_DIR}/RimCellEdgeColors.cpp -${CMAKE_CURRENT_LIST_DIR}/RimSimWellInView.cpp -${CMAKE_CURRENT_LIST_DIR}/RimSimWellInViewCollection.cpp -${CMAKE_CURRENT_LIST_DIR}/RimSimWellInViewTools.cpp -${CMAKE_CURRENT_LIST_DIR}/RimScriptCollection.cpp -${CMAKE_CURRENT_LIST_DIR}/RimEclipseStatisticsCase.cpp -${CMAKE_CURRENT_LIST_DIR}/RimEclipseStatisticsCaseCollection.cpp -${CMAKE_CURRENT_LIST_DIR}/RimCalcScript.cpp -${CMAKE_CURRENT_LIST_DIR}/RimExportInputPropertySettings.cpp -${CMAKE_CURRENT_LIST_DIR}/RimBinaryExportSettings.cpp -${CMAKE_CURRENT_LIST_DIR}/Rim3dOverlayInfoConfig.cpp -${CMAKE_CURRENT_LIST_DIR}/RimHistogramCalculator.cpp -${CMAKE_CURRENT_LIST_DIR}/RimTensorResults.cpp -${CMAKE_CURRENT_LIST_DIR}/RimReservoirCellResultsStorage.cpp -${CMAKE_CURRENT_LIST_DIR}/RimEclipseStatisticsCaseEvaluator.cpp -${CMAKE_CURRENT_LIST_DIR}/RimMimeData.cpp -${CMAKE_CURRENT_LIST_DIR}/RimCommandObject.cpp -${CMAKE_CURRENT_LIST_DIR}/RimTools.cpp -${CMAKE_CURRENT_LIST_DIR}/RimFormationNames.cpp -${CMAKE_CURRENT_LIST_DIR}/RimFormationNamesCollection.cpp -${CMAKE_CURRENT_LIST_DIR}/RimMockModelSettings.cpp -${CMAKE_CURRENT_LIST_DIR}/RimTernaryLegendConfig.cpp -${CMAKE_CURRENT_LIST_DIR}/RimEclipseFaultColors.cpp -${CMAKE_CURRENT_LIST_DIR}/RimMudWeightWindowParameters.cpp -${CMAKE_CURRENT_LIST_DIR}/RimViewWindow.cpp -${CMAKE_CURRENT_LIST_DIR}/Rim3dView.cpp -${CMAKE_CURRENT_LIST_DIR}/RimGridView.cpp -${CMAKE_CURRENT_LIST_DIR}/Rim2dIntersectionView.cpp -${CMAKE_CURRENT_LIST_DIR}/Rim2dIntersectionViewCollection.cpp -${CMAKE_CURRENT_LIST_DIR}/RimViewManipulator.cpp -${CMAKE_CURRENT_LIST_DIR}/RimCase.cpp -${CMAKE_CURRENT_LIST_DIR}/RimViewController.cpp -${CMAKE_CURRENT_LIST_DIR}/RimMainPlotCollection.cpp -${CMAKE_CURRENT_LIST_DIR}/RimRftPlotCollection.cpp -${CMAKE_CURRENT_LIST_DIR}/RimPltPlotCollection.cpp -${CMAKE_CURRENT_LIST_DIR}/RimVfpPlotCollection.cpp -${CMAKE_CURRENT_LIST_DIR}/RimVfpPlot.cpp -${CMAKE_CURRENT_LIST_DIR}/RimVfpDefines.cpp -${CMAKE_CURRENT_LIST_DIR}/RimPlot.cpp -${CMAKE_CURRENT_LIST_DIR}/RimPlotWindow.cpp -${CMAKE_CURRENT_LIST_DIR}/RimMultiPlot.cpp -${CMAKE_CURRENT_LIST_DIR}/RimDepthTrackPlot.cpp -${CMAKE_CURRENT_LIST_DIR}/RimWellBoreStabilityPlot.cpp -${CMAKE_CURRENT_LIST_DIR}/RimWbsParameters.cpp -${CMAKE_CURRENT_LIST_DIR}/RimViewLinker.cpp -${CMAKE_CURRENT_LIST_DIR}/RimViewLinkerCollection.cpp -${CMAKE_CURRENT_LIST_DIR}/RimIntersection.cpp -${CMAKE_CURRENT_LIST_DIR}/RimExtrudedCurveIntersection.cpp -${CMAKE_CURRENT_LIST_DIR}/RimIntersectionCollection.cpp -${CMAKE_CURRENT_LIST_DIR}/RimIntersectionResultDefinition.cpp -${CMAKE_CURRENT_LIST_DIR}/RimIntersectionResultsDefinitionCollection.cpp -${CMAKE_CURRENT_LIST_DIR}/RimContextCommandBuilder.cpp -${CMAKE_CURRENT_LIST_DIR}/RimGridCollection.cpp -${CMAKE_CURRENT_LIST_DIR}/RimPlotCurve.cpp -${CMAKE_CURRENT_LIST_DIR}/RimStackablePlotCurve.cpp -${CMAKE_CURRENT_LIST_DIR}/RimBoxIntersection.cpp -${CMAKE_CURRENT_LIST_DIR}/RimAdvancedSnapshotExportDefinition.cpp -${CMAKE_CURRENT_LIST_DIR}/RimMdiWindowController.cpp -${CMAKE_CURRENT_LIST_DIR}/RimNamedObject.cpp -${CMAKE_CURRENT_LIST_DIR}/RimCheckableNamedObject.cpp -${CMAKE_CURRENT_LIST_DIR}/RimCheckableObject.cpp -${CMAKE_CURRENT_LIST_DIR}/RimGridTimeHistoryCurve.cpp -${CMAKE_CURRENT_LIST_DIR}/RimGeometrySelectionItem.cpp -${CMAKE_CURRENT_LIST_DIR}/RimEclipseGeometrySelectionItem.cpp -${CMAKE_CURRENT_LIST_DIR}/RimDialogData.cpp -${CMAKE_CURRENT_LIST_DIR}/RimTimeStepFilter.cpp -${CMAKE_CURRENT_LIST_DIR}/RimSummaryCalculation.cpp -${CMAKE_CURRENT_LIST_DIR}/RimSummaryCalculationCollection.cpp -${CMAKE_CURRENT_LIST_DIR}/RimSummaryCalculationVariable.cpp -${CMAKE_CURRENT_LIST_DIR}/RimStimPlanLegendConfig.cpp -${CMAKE_CURRENT_LIST_DIR}/RimStimPlanColors.cpp -${CMAKE_CURRENT_LIST_DIR}/RimVirtualPerforationResults.cpp -${CMAKE_CURRENT_LIST_DIR}/RimLegendConfig.cpp -${CMAKE_CURRENT_LIST_DIR}/RimNameConfig.cpp -${CMAKE_CURRENT_LIST_DIR}/RimDataSourceSteppingTools.cpp -${CMAKE_CURRENT_LIST_DIR}/RimContourMapProjection.cpp -${CMAKE_CURRENT_LIST_DIR}/RimEclipseContourMapProjection.cpp -${CMAKE_CURRENT_LIST_DIR}/RimEclipseContourMapView.cpp -${CMAKE_CURRENT_LIST_DIR}/RimEclipseContourMapViewCollection.cpp -${CMAKE_CURRENT_LIST_DIR}/RimViewNameConfig.cpp -${CMAKE_CURRENT_LIST_DIR}/RimReloadCaseTools.cpp -${CMAKE_CURRENT_LIST_DIR}/RimPlotAxisPropertiesInterface.cpp -${CMAKE_CURRENT_LIST_DIR}/RimPlotAxisProperties.cpp -${CMAKE_CURRENT_LIST_DIR}/RimPlotAxisAnnotation.cpp -${CMAKE_CURRENT_LIST_DIR}/RimObservedDataCollection.cpp -${CMAKE_CURRENT_LIST_DIR}/RimObservedFmuRftData.cpp -${CMAKE_CURRENT_LIST_DIR}/RimMultiPlotCollection.cpp -${CMAKE_CURRENT_LIST_DIR}/RimWellDiskConfig.cpp -${CMAKE_CURRENT_LIST_DIR}/RimElementVectorResult.cpp -${CMAKE_CURRENT_LIST_DIR}/RimColorLegendCollection.cpp -${CMAKE_CURRENT_LIST_DIR}/RimColorLegend.cpp -${CMAKE_CURRENT_LIST_DIR}/RimColorLegendItem.cpp -${CMAKE_CURRENT_LIST_DIR}/RimVfpTableExtractor.cpp -${CMAKE_CURRENT_LIST_DIR}/RimCaseDisplayNameTools.cpp -${CMAKE_CURRENT_LIST_DIR}/RimCustomObjectiveFunctionCollection.cpp -${CMAKE_CURRENT_LIST_DIR}/RimCustomObjectiveFunction.cpp -${CMAKE_CURRENT_LIST_DIR}/RimCustomObjectiveFunctionWeight.cpp -${CMAKE_CURRENT_LIST_DIR}/RimEquilibriumAxisAnnotation.cpp -${CMAKE_CURRENT_LIST_DIR}/RimTimeAxisAnnotation.cpp -${CMAKE_CURRENT_LIST_DIR}/cafTreeNode.cpp -${CMAKE_CURRENT_LIST_DIR}/RimMultipleLocations.cpp -) +set(SOURCE_GROUP_SOURCE_FILES + ${CMAKE_CURRENT_LIST_DIR}/RimEclipseCaseCollection.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimCaseCollection.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimRegularLegendConfig.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimOilField.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimProject.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimEclipseCase.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimIdenticalGridCaseGroup.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimEclipseInputProperty.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimEclipseInputPropertyCollection.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimEclipseInputCase.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimEclipseResultCase.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimEclipseView.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimEclipseResultDefinition.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimEclipseCellColors.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimCellEdgeColors.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimSimWellInView.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimSimWellInViewCollection.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimSimWellInViewTools.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimScriptCollection.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimEclipseStatisticsCase.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimEclipseStatisticsCaseCollection.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimCalcScript.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimExportInputPropertySettings.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimBinaryExportSettings.cpp + ${CMAKE_CURRENT_LIST_DIR}/Rim3dOverlayInfoConfig.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimHistogramCalculator.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimTensorResults.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimReservoirCellResultsStorage.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimEclipseStatisticsCaseEvaluator.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimMimeData.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimCommandObject.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimTools.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimFormationNames.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimFormationNamesCollection.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimMockModelSettings.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimTernaryLegendConfig.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimEclipseFaultColors.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimMudWeightWindowParameters.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimViewWindow.cpp + ${CMAKE_CURRENT_LIST_DIR}/Rim3dView.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimGridView.cpp + ${CMAKE_CURRENT_LIST_DIR}/Rim2dIntersectionView.cpp + ${CMAKE_CURRENT_LIST_DIR}/Rim2dIntersectionViewCollection.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimViewManipulator.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimCase.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimViewController.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimMainPlotCollection.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimRftPlotCollection.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimPltPlotCollection.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimVfpPlotCollection.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimVfpPlot.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimVfpDefines.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimPlot.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimPlotWindow.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimMultiPlot.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimDepthTrackPlot.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimWellBoreStabilityPlot.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimWbsParameters.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimViewLinker.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimViewLinkerCollection.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimIntersection.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimExtrudedCurveIntersection.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimIntersectionCollection.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimIntersectionResultDefinition.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimIntersectionResultsDefinitionCollection.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimContextCommandBuilder.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimGridCollection.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimPlotCurve.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimStackablePlotCurve.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimBoxIntersection.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimAdvancedSnapshotExportDefinition.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimMdiWindowController.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimNamedObject.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimCheckableNamedObject.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimCheckableObject.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimGridTimeHistoryCurve.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimGeometrySelectionItem.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimEclipseGeometrySelectionItem.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimDialogData.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimTimeStepFilter.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimSummaryCalculation.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimSummaryCalculationCollection.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimSummaryCalculationVariable.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimStimPlanLegendConfig.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimStimPlanColors.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimVirtualPerforationResults.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimLegendConfig.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimNameConfig.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimDataSourceSteppingTools.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimContourMapProjection.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimEclipseContourMapProjection.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimEclipseContourMapView.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimEclipseContourMapViewCollection.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimViewNameConfig.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimReloadCaseTools.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimPlotAxisPropertiesInterface.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimPlotAxisProperties.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimPlotAxisAnnotation.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimObservedDataCollection.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimObservedFmuRftData.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimMultiPlotCollection.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimWellDiskConfig.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimElementVectorResult.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimColorLegendCollection.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimColorLegend.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimColorLegendItem.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimVfpTableExtractor.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimCaseDisplayNameTools.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimCustomObjectiveFunctionCollection.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimCustomObjectiveFunction.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimCustomObjectiveFunctionWeight.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimEquilibriumAxisAnnotation.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimTimeAxisAnnotation.cpp + ${CMAKE_CURRENT_LIST_DIR}/cafTreeNode.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimMultipleLocations.cpp) if(Qt5Charts_FOUND) - list(APPEND SOURCE_GROUP_HEADER_FILES - ${CMAKE_CURRENT_LIST_DIR}/RimStatisticsPlot.h - ${CMAKE_CURRENT_LIST_DIR}/RimEnsembleFractureStatisticsPlot.h - ${CMAKE_CURRENT_LIST_DIR}/RimEnsembleFractureStatisticsPlotCollection.h - ${CMAKE_CURRENT_LIST_DIR}/RimGridStatisticsPlotCollection.h - ${CMAKE_CURRENT_LIST_DIR}/RimGridStatisticsPlot.h) + list( + APPEND + SOURCE_GROUP_HEADER_FILES + ${CMAKE_CURRENT_LIST_DIR}/RimStatisticsPlot.h + ${CMAKE_CURRENT_LIST_DIR}/RimEnsembleFractureStatisticsPlot.h + ${CMAKE_CURRENT_LIST_DIR}/RimEnsembleFractureStatisticsPlotCollection.h + ${CMAKE_CURRENT_LIST_DIR}/RimGridStatisticsPlotCollection.h + ${CMAKE_CURRENT_LIST_DIR}/RimGridStatisticsPlot.h) - - list(APPEND SOURCE_GROUP_SOURCE_FILES - ${CMAKE_CURRENT_LIST_DIR}/RimStatisticsPlot.cpp - ${CMAKE_CURRENT_LIST_DIR}/RimEnsembleFractureStatisticsPlot.cpp - ${CMAKE_CURRENT_LIST_DIR}/RimEnsembleFractureStatisticsPlotCollection.cpp - ${CMAKE_CURRENT_LIST_DIR}/RimGridStatisticsPlotCollection.cpp - ${CMAKE_CURRENT_LIST_DIR}/RimGridStatisticsPlot.cpp) + list( + APPEND + SOURCE_GROUP_SOURCE_FILES + ${CMAKE_CURRENT_LIST_DIR}/RimStatisticsPlot.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimEnsembleFractureStatisticsPlot.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimEnsembleFractureStatisticsPlotCollection.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimGridStatisticsPlotCollection.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimGridStatisticsPlot.cpp) endif() +list(APPEND CODE_HEADER_FILES ${SOURCE_GROUP_HEADER_FILES}) -list(APPEND CODE_HEADER_FILES -${SOURCE_GROUP_HEADER_FILES} -) - -list(APPEND CODE_SOURCE_FILES -${SOURCE_GROUP_SOURCE_FILES} -) +list(APPEND CODE_SOURCE_FILES ${SOURCE_GROUP_SOURCE_FILES}) -list(APPEND QT_MOC_HEADERS -${CMAKE_CURRENT_LIST_DIR}/RimPlot.h -) +list(APPEND QT_MOC_HEADERS ${CMAKE_CURRENT_LIST_DIR}/RimPlot.h) -source_group( "ProjectDataModel" FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake ) +source_group( + "ProjectDataModel" + FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} + ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake) diff --git a/ApplicationLibCode/ProjectDataModel/CellFilters/CMakeLists_files.cmake b/ApplicationLibCode/ProjectDataModel/CellFilters/CMakeLists_files.cmake index 981011eb8c..f2a51a0823 100644 --- a/ApplicationLibCode/ProjectDataModel/CellFilters/CMakeLists_files.cmake +++ b/ApplicationLibCode/ProjectDataModel/CellFilters/CMakeLists_files.cmake @@ -1,40 +1,36 @@ +set(SOURCE_GROUP_HEADER_FILES + ${CMAKE_CURRENT_LIST_DIR}/RimCellFilter.h + ${CMAKE_CURRENT_LIST_DIR}/RimCellFilterCollection.h + ${CMAKE_CURRENT_LIST_DIR}/RimCellRangeFilter.h + ${CMAKE_CURRENT_LIST_DIR}/RimPropertyFilter.h + ${CMAKE_CURRENT_LIST_DIR}/RimPropertyFilterCollection.h + ${CMAKE_CURRENT_LIST_DIR}/RimEclipsePropertyFilter.h + ${CMAKE_CURRENT_LIST_DIR}/RimEclipsePropertyFilterCollection.h + ${CMAKE_CURRENT_LIST_DIR}/RimGeoMechPropertyFilter.h + ${CMAKE_CURRENT_LIST_DIR}/RimGeoMechPropertyFilterCollection.h + ${CMAKE_CURRENT_LIST_DIR}/RimPolygonFilter.h + ${CMAKE_CURRENT_LIST_DIR}/RimUserDefinedFilter.h + ${CMAKE_CURRENT_LIST_DIR}/RimCellFilterIntervalTool.h) -set (SOURCE_GROUP_HEADER_FILES -${CMAKE_CURRENT_LIST_DIR}/RimCellFilter.h -${CMAKE_CURRENT_LIST_DIR}/RimCellFilterCollection.h -${CMAKE_CURRENT_LIST_DIR}/RimCellRangeFilter.h -${CMAKE_CURRENT_LIST_DIR}/RimPropertyFilter.h -${CMAKE_CURRENT_LIST_DIR}/RimPropertyFilterCollection.h -${CMAKE_CURRENT_LIST_DIR}/RimEclipsePropertyFilter.h -${CMAKE_CURRENT_LIST_DIR}/RimEclipsePropertyFilterCollection.h -${CMAKE_CURRENT_LIST_DIR}/RimGeoMechPropertyFilter.h -${CMAKE_CURRENT_LIST_DIR}/RimGeoMechPropertyFilterCollection.h -${CMAKE_CURRENT_LIST_DIR}/RimPolygonFilter.h -${CMAKE_CURRENT_LIST_DIR}/RimUserDefinedFilter.h -${CMAKE_CURRENT_LIST_DIR}/RimCellFilterIntervalTool.h -) +set(SOURCE_GROUP_SOURCE_FILES + ${CMAKE_CURRENT_LIST_DIR}/RimCellFilter.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimCellFilterCollection.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimCellRangeFilter.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimPropertyFilter.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimPropertyFilterCollection.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimEclipsePropertyFilter.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimEclipsePropertyFilterCollection.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimGeoMechPropertyFilter.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimGeoMechPropertyFilterCollection.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimPolygonFilter.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimUserDefinedFilter.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimCellFilterIntervalTool.cpp) -set (SOURCE_GROUP_SOURCE_FILES -${CMAKE_CURRENT_LIST_DIR}/RimCellFilter.cpp -${CMAKE_CURRENT_LIST_DIR}/RimCellFilterCollection.cpp -${CMAKE_CURRENT_LIST_DIR}/RimCellRangeFilter.cpp -${CMAKE_CURRENT_LIST_DIR}/RimPropertyFilter.cpp -${CMAKE_CURRENT_LIST_DIR}/RimPropertyFilterCollection.cpp -${CMAKE_CURRENT_LIST_DIR}/RimEclipsePropertyFilter.cpp -${CMAKE_CURRENT_LIST_DIR}/RimEclipsePropertyFilterCollection.cpp -${CMAKE_CURRENT_LIST_DIR}/RimGeoMechPropertyFilter.cpp -${CMAKE_CURRENT_LIST_DIR}/RimGeoMechPropertyFilterCollection.cpp -${CMAKE_CURRENT_LIST_DIR}/RimPolygonFilter.cpp -${CMAKE_CURRENT_LIST_DIR}/RimUserDefinedFilter.cpp -${CMAKE_CURRENT_LIST_DIR}/RimCellFilterIntervalTool.cpp -) +list(APPEND CODE_HEADER_FILES ${SOURCE_GROUP_HEADER_FILES}) -list(APPEND CODE_HEADER_FILES -${SOURCE_GROUP_HEADER_FILES} -) +list(APPEND CODE_SOURCE_FILES ${SOURCE_GROUP_SOURCE_FILES}) -list(APPEND CODE_SOURCE_FILES -${SOURCE_GROUP_SOURCE_FILES} -) - -source_group( "ProjectDataModel\\CellFilters" FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake ) +source_group( + "ProjectDataModel\\CellFilters" + FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} + ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake) diff --git a/ApplicationLibCode/ProjectDataModel/Completions/CMakeLists_files.cmake b/ApplicationLibCode/ProjectDataModel/Completions/CMakeLists_files.cmake index 1b4895bb55..bc04c91a0e 100644 --- a/ApplicationLibCode/ProjectDataModel/Completions/CMakeLists_files.cmake +++ b/ApplicationLibCode/ProjectDataModel/Completions/CMakeLists_files.cmake @@ -1,82 +1,77 @@ +set(SOURCE_GROUP_HEADER_FILES + ${CMAKE_CURRENT_LIST_DIR}/RimCompletionCellIntersectionCalc.h + ${CMAKE_CURRENT_LIST_DIR}/RimFishbonesCollection.h + ${CMAKE_CURRENT_LIST_DIR}/RimFishbones.h + ${CMAKE_CURRENT_LIST_DIR}/RimFishbonesPipeProperties.h + ${CMAKE_CURRENT_LIST_DIR}/RimFishboneWellPath.h + ${CMAKE_CURRENT_LIST_DIR}/RimFishboneWellPathCollection.h + ${CMAKE_CURRENT_LIST_DIR}/RimPerforationCollection.h + ${CMAKE_CURRENT_LIST_DIR}/RimPerforationInterval.h + ${CMAKE_CURRENT_LIST_DIR}/RimWellPathCompletions.h + ${CMAKE_CURRENT_LIST_DIR}/RimWellPathCompletionSettings.h + ${CMAKE_CURRENT_LIST_DIR}/RimEllipseFractureTemplate.h + ${CMAKE_CURRENT_LIST_DIR}/RimFracture.h + ${CMAKE_CURRENT_LIST_DIR}/RimFractureContainment.h + ${CMAKE_CURRENT_LIST_DIR}/RimFractureContainmentTools.h + ${CMAKE_CURRENT_LIST_DIR}/RimFractureExportSettings.h + ${CMAKE_CURRENT_LIST_DIR}/RimFractureTemplate.h + ${CMAKE_CURRENT_LIST_DIR}/RimCompletionTemplateCollection.h + ${CMAKE_CURRENT_LIST_DIR}/RimFractureTemplateCollection.h + ${CMAKE_CURRENT_LIST_DIR}/RimValveTemplateCollection.h + ${CMAKE_CURRENT_LIST_DIR}/RimValveTemplate.h + ${CMAKE_CURRENT_LIST_DIR}/RimSimWellFracture.h + ${CMAKE_CURRENT_LIST_DIR}/RimSimWellFractureCollection.h + ${CMAKE_CURRENT_LIST_DIR}/RimStimPlanFractureTemplate.h + ${CMAKE_CURRENT_LIST_DIR}/RimWellPathFracture.h + ${CMAKE_CURRENT_LIST_DIR}/RimWellPathFractureCollection.h + ${CMAKE_CURRENT_LIST_DIR}/Rim3dWellLogCurveCollection.h + ${CMAKE_CURRENT_LIST_DIR}/RimMswCompletionParameters.h + ${CMAKE_CURRENT_LIST_DIR}/RimNonDarcyPerforationParameters.h + ${CMAKE_CURRENT_LIST_DIR}/RimWellPathComponentInterface.h + ${CMAKE_CURRENT_LIST_DIR}/RimWellPathValve.h + ${CMAKE_CURRENT_LIST_DIR}/RimMultipleValveLocations.h + ${CMAKE_CURRENT_LIST_DIR}/RimWellPathAicdParameters.h + ${CMAKE_CURRENT_LIST_DIR}/RimEnsembleFractureStatistics.h + ${CMAKE_CURRENT_LIST_DIR}/RimEnsembleFractureStatisticsCollection.h) -set (SOURCE_GROUP_HEADER_FILES -${CMAKE_CURRENT_LIST_DIR}/RimCompletionCellIntersectionCalc.h -${CMAKE_CURRENT_LIST_DIR}/RimFishbonesCollection.h -${CMAKE_CURRENT_LIST_DIR}/RimFishbones.h -${CMAKE_CURRENT_LIST_DIR}/RimFishbonesPipeProperties.h -${CMAKE_CURRENT_LIST_DIR}/RimFishboneWellPath.h -${CMAKE_CURRENT_LIST_DIR}/RimFishboneWellPathCollection.h -${CMAKE_CURRENT_LIST_DIR}/RimPerforationCollection.h -${CMAKE_CURRENT_LIST_DIR}/RimPerforationInterval.h -${CMAKE_CURRENT_LIST_DIR}/RimWellPathCompletions.h -${CMAKE_CURRENT_LIST_DIR}/RimWellPathCompletionSettings.h -${CMAKE_CURRENT_LIST_DIR}/RimEllipseFractureTemplate.h -${CMAKE_CURRENT_LIST_DIR}/RimFracture.h -${CMAKE_CURRENT_LIST_DIR}/RimFractureContainment.h -${CMAKE_CURRENT_LIST_DIR}/RimFractureContainmentTools.h -${CMAKE_CURRENT_LIST_DIR}/RimFractureExportSettings.h -${CMAKE_CURRENT_LIST_DIR}/RimFractureTemplate.h -${CMAKE_CURRENT_LIST_DIR}/RimCompletionTemplateCollection.h -${CMAKE_CURRENT_LIST_DIR}/RimFractureTemplateCollection.h -${CMAKE_CURRENT_LIST_DIR}/RimValveTemplateCollection.h -${CMAKE_CURRENT_LIST_DIR}/RimValveTemplate.h -${CMAKE_CURRENT_LIST_DIR}/RimSimWellFracture.h -${CMAKE_CURRENT_LIST_DIR}/RimSimWellFractureCollection.h -${CMAKE_CURRENT_LIST_DIR}/RimStimPlanFractureTemplate.h -${CMAKE_CURRENT_LIST_DIR}/RimWellPathFracture.h -${CMAKE_CURRENT_LIST_DIR}/RimWellPathFractureCollection.h -${CMAKE_CURRENT_LIST_DIR}/Rim3dWellLogCurveCollection.h -${CMAKE_CURRENT_LIST_DIR}/RimMswCompletionParameters.h -${CMAKE_CURRENT_LIST_DIR}/RimNonDarcyPerforationParameters.h -${CMAKE_CURRENT_LIST_DIR}/RimWellPathComponentInterface.h -${CMAKE_CURRENT_LIST_DIR}/RimWellPathValve.h -${CMAKE_CURRENT_LIST_DIR}/RimMultipleValveLocations.h -${CMAKE_CURRENT_LIST_DIR}/RimWellPathAicdParameters.h -${CMAKE_CURRENT_LIST_DIR}/RimEnsembleFractureStatistics.h -${CMAKE_CURRENT_LIST_DIR}/RimEnsembleFractureStatisticsCollection.h -) +set(SOURCE_GROUP_SOURCE_FILES + ${CMAKE_CURRENT_LIST_DIR}/RimCompletionCellIntersectionCalc.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimFishbonesCollection.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimFishbones.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimFishbonesPipeProperties.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimPerforationCollection.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimPerforationInterval.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimWellPathCompletions.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimWellPathCompletionSettings.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimEllipseFractureTemplate.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimFracture.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimFractureContainment.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimFractureContainmentTools.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimFractureExportSettings.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimFractureTemplate.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimCompletionTemplateCollection.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimFractureTemplateCollection.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimValveTemplateCollection.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimValveTemplate.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimSimWellFracture.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimSimWellFractureCollection.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimStimPlanFractureTemplate.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimWellPathFracture.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimWellPathFractureCollection.cpp + ${CMAKE_CURRENT_LIST_DIR}/Rim3dWellLogCurveCollection.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimMswCompletionParameters.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimNonDarcyPerforationParameters.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimWellPathValve.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimMultipleValveLocations.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimWellPathAicdParameters.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimEnsembleFractureStatistics.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimEnsembleFractureStatisticsCollection.cpp) +list(APPEND CODE_HEADER_FILES ${SOURCE_GROUP_HEADER_FILES}) -set (SOURCE_GROUP_SOURCE_FILES -${CMAKE_CURRENT_LIST_DIR}/RimCompletionCellIntersectionCalc.cpp -${CMAKE_CURRENT_LIST_DIR}/RimFishbonesCollection.cpp -${CMAKE_CURRENT_LIST_DIR}/RimFishbones.cpp -${CMAKE_CURRENT_LIST_DIR}/RimFishbonesPipeProperties.cpp -${CMAKE_CURRENT_LIST_DIR}/RimPerforationCollection.cpp -${CMAKE_CURRENT_LIST_DIR}/RimPerforationInterval.cpp -${CMAKE_CURRENT_LIST_DIR}/RimWellPathCompletions.cpp -${CMAKE_CURRENT_LIST_DIR}/RimWellPathCompletionSettings.cpp -${CMAKE_CURRENT_LIST_DIR}/RimEllipseFractureTemplate.cpp -${CMAKE_CURRENT_LIST_DIR}/RimFracture.cpp -${CMAKE_CURRENT_LIST_DIR}/RimFractureContainment.cpp -${CMAKE_CURRENT_LIST_DIR}/RimFractureContainmentTools.cpp -${CMAKE_CURRENT_LIST_DIR}/RimFractureExportSettings.cpp -${CMAKE_CURRENT_LIST_DIR}/RimFractureTemplate.cpp -${CMAKE_CURRENT_LIST_DIR}/RimCompletionTemplateCollection.cpp -${CMAKE_CURRENT_LIST_DIR}/RimFractureTemplateCollection.cpp -${CMAKE_CURRENT_LIST_DIR}/RimValveTemplateCollection.cpp -${CMAKE_CURRENT_LIST_DIR}/RimValveTemplate.cpp -${CMAKE_CURRENT_LIST_DIR}/RimSimWellFracture.cpp -${CMAKE_CURRENT_LIST_DIR}/RimSimWellFractureCollection.cpp -${CMAKE_CURRENT_LIST_DIR}/RimStimPlanFractureTemplate.cpp -${CMAKE_CURRENT_LIST_DIR}/RimWellPathFracture.cpp -${CMAKE_CURRENT_LIST_DIR}/RimWellPathFractureCollection.cpp -${CMAKE_CURRENT_LIST_DIR}/Rim3dWellLogCurveCollection.cpp -${CMAKE_CURRENT_LIST_DIR}/RimMswCompletionParameters.cpp -${CMAKE_CURRENT_LIST_DIR}/RimNonDarcyPerforationParameters.cpp -${CMAKE_CURRENT_LIST_DIR}/RimWellPathValve.cpp -${CMAKE_CURRENT_LIST_DIR}/RimMultipleValveLocations.cpp -${CMAKE_CURRENT_LIST_DIR}/RimWellPathAicdParameters.cpp -${CMAKE_CURRENT_LIST_DIR}/RimEnsembleFractureStatistics.cpp -${CMAKE_CURRENT_LIST_DIR}/RimEnsembleFractureStatisticsCollection.cpp -) +list(APPEND CODE_SOURCE_FILES ${SOURCE_GROUP_SOURCE_FILES}) -list(APPEND CODE_HEADER_FILES -${SOURCE_GROUP_HEADER_FILES} -) - -list(APPEND CODE_SOURCE_FILES -${SOURCE_GROUP_SOURCE_FILES} -) - -source_group( "ProjectDataModel\\Completions" FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake ) +source_group( + "ProjectDataModel\\Completions" + FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} + ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake) diff --git a/ApplicationLibCode/ProjectDataModel/CorrelationPlots/CMakeLists_files.cmake b/ApplicationLibCode/ProjectDataModel/CorrelationPlots/CMakeLists_files.cmake index 92143d1593..e2c4f64876 100644 --- a/ApplicationLibCode/ProjectDataModel/CorrelationPlots/CMakeLists_files.cmake +++ b/ApplicationLibCode/ProjectDataModel/CorrelationPlots/CMakeLists_files.cmake @@ -1,28 +1,24 @@ +set(SOURCE_GROUP_HEADER_FILES + ${CMAKE_CURRENT_LIST_DIR}/RimAbstractCorrelationPlot.h + ${CMAKE_CURRENT_LIST_DIR}/RimCorrelationPlot.h + ${CMAKE_CURRENT_LIST_DIR}/RimCorrelationMatrixPlot.h + ${CMAKE_CURRENT_LIST_DIR}/RimParameterResultCrossPlot.h + ${CMAKE_CURRENT_LIST_DIR}/RimCorrelationPlotCollection.h + ${CMAKE_CURRENT_LIST_DIR}/RimCorrelationReportPlot.h) -set (SOURCE_GROUP_HEADER_FILES -${CMAKE_CURRENT_LIST_DIR}/RimAbstractCorrelationPlot.h -${CMAKE_CURRENT_LIST_DIR}/RimCorrelationPlot.h -${CMAKE_CURRENT_LIST_DIR}/RimCorrelationMatrixPlot.h -${CMAKE_CURRENT_LIST_DIR}/RimParameterResultCrossPlot.h -${CMAKE_CURRENT_LIST_DIR}/RimCorrelationPlotCollection.h -${CMAKE_CURRENT_LIST_DIR}/RimCorrelationReportPlot.h -) +set(SOURCE_GROUP_SOURCE_FILES + ${CMAKE_CURRENT_LIST_DIR}/RimAbstractCorrelationPlot.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimCorrelationPlot.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimCorrelationMatrixPlot.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimParameterResultCrossPlot.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimCorrelationPlotCollection.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimCorrelationReportPlot.cpp) -set (SOURCE_GROUP_SOURCE_FILES -${CMAKE_CURRENT_LIST_DIR}/RimAbstractCorrelationPlot.cpp -${CMAKE_CURRENT_LIST_DIR}/RimCorrelationPlot.cpp -${CMAKE_CURRENT_LIST_DIR}/RimCorrelationMatrixPlot.cpp -${CMAKE_CURRENT_LIST_DIR}/RimParameterResultCrossPlot.cpp -${CMAKE_CURRENT_LIST_DIR}/RimCorrelationPlotCollection.cpp -${CMAKE_CURRENT_LIST_DIR}/RimCorrelationReportPlot.cpp -) +list(APPEND CODE_HEADER_FILES ${SOURCE_GROUP_HEADER_FILES}) -list(APPEND CODE_HEADER_FILES -${SOURCE_GROUP_HEADER_FILES} -) +list(APPEND CODE_SOURCE_FILES ${SOURCE_GROUP_SOURCE_FILES}) -list(APPEND CODE_SOURCE_FILES -${SOURCE_GROUP_SOURCE_FILES} -) - -source_group( "ProjectDataModel\\CorrelationPlots" FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake ) +source_group( + "ProjectDataModel\\CorrelationPlots" + FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} + ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake) diff --git a/ApplicationLibCode/ProjectDataModel/Faults/CMakeLists_files.cmake b/ApplicationLibCode/ProjectDataModel/Faults/CMakeLists_files.cmake index 9ef6fc1e25..d9ba0dc8b4 100644 --- a/ApplicationLibCode/ProjectDataModel/Faults/CMakeLists_files.cmake +++ b/ApplicationLibCode/ProjectDataModel/Faults/CMakeLists_files.cmake @@ -1,26 +1,22 @@ +set(SOURCE_GROUP_HEADER_FILES + ${CMAKE_CURRENT_LIST_DIR}/RimFaultInView.h + ${CMAKE_CURRENT_LIST_DIR}/RimFaultInViewCollection.h + ${CMAKE_CURRENT_LIST_DIR}/RimFaultRASettings.h + ${CMAKE_CURRENT_LIST_DIR}/RimFaultRAPreprocSettings.h + ${CMAKE_CURRENT_LIST_DIR}/RimFaultRAPostprocSettings.h) -set (SOURCE_GROUP_HEADER_FILES -${CMAKE_CURRENT_LIST_DIR}/RimFaultInView.h -${CMAKE_CURRENT_LIST_DIR}/RimFaultInViewCollection.h -${CMAKE_CURRENT_LIST_DIR}/RimFaultRASettings.h -${CMAKE_CURRENT_LIST_DIR}/RimFaultRAPreprocSettings.h -${CMAKE_CURRENT_LIST_DIR}/RimFaultRAPostprocSettings.h -) +set(SOURCE_GROUP_SOURCE_FILES + ${CMAKE_CURRENT_LIST_DIR}/RimFaultInView.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimFaultInViewCollection.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimFaultRASettings.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimFaultRAPreprocSettings.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimFaultRAPostprocSettings.cpp) -set (SOURCE_GROUP_SOURCE_FILES -${CMAKE_CURRENT_LIST_DIR}/RimFaultInView.cpp -${CMAKE_CURRENT_LIST_DIR}/RimFaultInViewCollection.cpp -${CMAKE_CURRENT_LIST_DIR}/RimFaultRASettings.cpp -${CMAKE_CURRENT_LIST_DIR}/RimFaultRAPreprocSettings.cpp -${CMAKE_CURRENT_LIST_DIR}/RimFaultRAPostprocSettings.cpp -) +list(APPEND CODE_HEADER_FILES ${SOURCE_GROUP_HEADER_FILES}) -list(APPEND CODE_HEADER_FILES -${SOURCE_GROUP_HEADER_FILES} -) +list(APPEND CODE_SOURCE_FILES ${SOURCE_GROUP_SOURCE_FILES}) -list(APPEND CODE_SOURCE_FILES -${SOURCE_GROUP_SOURCE_FILES} -) - -source_group( "ProjectDataModel\\Faults" FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake ) +source_group( + "ProjectDataModel\\Faults" + FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} + ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake) diff --git a/ApplicationLibCode/ProjectDataModel/Flow/CMakeLists_files.cmake b/ApplicationLibCode/ProjectDataModel/Flow/CMakeLists_files.cmake index 3aba3f9396..cb857a350e 100644 --- a/ApplicationLibCode/ProjectDataModel/Flow/CMakeLists_files.cmake +++ b/ApplicationLibCode/ProjectDataModel/Flow/CMakeLists_files.cmake @@ -1,46 +1,42 @@ +set(SOURCE_GROUP_HEADER_FILES + ${CMAKE_CURRENT_LIST_DIR}/RimFlowDiagSolution.h + ${CMAKE_CURRENT_LIST_DIR}/RimFlowPlotCollection.h + ${CMAKE_CURRENT_LIST_DIR}/RimWellAllocationPlot.h + ${CMAKE_CURRENT_LIST_DIR}/RimTotalWellAllocationPlot.h + ${CMAKE_CURRENT_LIST_DIR}/RimTofAccumulatedPhaseFractionsPlot.h + ${CMAKE_CURRENT_LIST_DIR}/RimWellFlowRateCurve.h + ${CMAKE_CURRENT_LIST_DIR}/RimWellAllocationPlotLegend.h + ${CMAKE_CURRENT_LIST_DIR}/RimFlowCharacteristicsPlot.h + ${CMAKE_CURRENT_LIST_DIR}/RimWellRftPlot.h + ${CMAKE_CURRENT_LIST_DIR}/RimWellPltPlot.h + ${CMAKE_CURRENT_LIST_DIR}/RimDataSourceForRftPlt.h + ${CMAKE_CURRENT_LIST_DIR}/RimWellPlotTools.h + ${CMAKE_CURRENT_LIST_DIR}/RimWellRftEnsembleCurveSet.h + ${CMAKE_CURRENT_LIST_DIR}/RimWellDistributionPlot.h + ${CMAKE_CURRENT_LIST_DIR}/RimWellDistributionPlotCollection.h) -set (SOURCE_GROUP_HEADER_FILES -${CMAKE_CURRENT_LIST_DIR}/RimFlowDiagSolution.h -${CMAKE_CURRENT_LIST_DIR}/RimFlowPlotCollection.h -${CMAKE_CURRENT_LIST_DIR}/RimWellAllocationPlot.h -${CMAKE_CURRENT_LIST_DIR}/RimTotalWellAllocationPlot.h -${CMAKE_CURRENT_LIST_DIR}/RimTofAccumulatedPhaseFractionsPlot.h -${CMAKE_CURRENT_LIST_DIR}/RimWellFlowRateCurve.h -${CMAKE_CURRENT_LIST_DIR}/RimWellAllocationPlotLegend.h -${CMAKE_CURRENT_LIST_DIR}/RimFlowCharacteristicsPlot.h -${CMAKE_CURRENT_LIST_DIR}/RimWellRftPlot.h -${CMAKE_CURRENT_LIST_DIR}/RimWellPltPlot.h -${CMAKE_CURRENT_LIST_DIR}/RimDataSourceForRftPlt.h -${CMAKE_CURRENT_LIST_DIR}/RimWellPlotTools.h -${CMAKE_CURRENT_LIST_DIR}/RimWellRftEnsembleCurveSet.h -${CMAKE_CURRENT_LIST_DIR}/RimWellDistributionPlot.h -${CMAKE_CURRENT_LIST_DIR}/RimWellDistributionPlotCollection.h -) +set(SOURCE_GROUP_SOURCE_FILES + ${CMAKE_CURRENT_LIST_DIR}/RimFlowDiagSolution.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimFlowPlotCollection.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimWellAllocationPlot.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimTotalWellAllocationPlot.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimTofAccumulatedPhaseFractionsPlot.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimWellFlowRateCurve.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimWellAllocationPlotLegend.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimFlowCharacteristicsPlot.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimWellRftPlot.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimWellPltPlot.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimDataSourceForRftPlt.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimWellPlotTools.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimWellRftEnsembleCurveSet.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimWellDistributionPlot.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimWellDistributionPlotCollection.cpp) -set (SOURCE_GROUP_SOURCE_FILES -${CMAKE_CURRENT_LIST_DIR}/RimFlowDiagSolution.cpp -${CMAKE_CURRENT_LIST_DIR}/RimFlowPlotCollection.cpp -${CMAKE_CURRENT_LIST_DIR}/RimWellAllocationPlot.cpp -${CMAKE_CURRENT_LIST_DIR}/RimTotalWellAllocationPlot.cpp -${CMAKE_CURRENT_LIST_DIR}/RimTofAccumulatedPhaseFractionsPlot.cpp -${CMAKE_CURRENT_LIST_DIR}/RimWellFlowRateCurve.cpp -${CMAKE_CURRENT_LIST_DIR}/RimWellAllocationPlotLegend.cpp -${CMAKE_CURRENT_LIST_DIR}/RimFlowCharacteristicsPlot.cpp -${CMAKE_CURRENT_LIST_DIR}/RimWellRftPlot.cpp -${CMAKE_CURRENT_LIST_DIR}/RimWellPltPlot.cpp -${CMAKE_CURRENT_LIST_DIR}/RimDataSourceForRftPlt.cpp -${CMAKE_CURRENT_LIST_DIR}/RimWellPlotTools.cpp -${CMAKE_CURRENT_LIST_DIR}/RimWellRftEnsembleCurveSet.cpp -${CMAKE_CURRENT_LIST_DIR}/RimWellDistributionPlot.cpp -${CMAKE_CURRENT_LIST_DIR}/RimWellDistributionPlotCollection.cpp -) +list(APPEND CODE_HEADER_FILES ${SOURCE_GROUP_HEADER_FILES}) -list(APPEND CODE_HEADER_FILES -${SOURCE_GROUP_HEADER_FILES} -) +list(APPEND CODE_SOURCE_FILES ${SOURCE_GROUP_SOURCE_FILES}) -list(APPEND CODE_SOURCE_FILES -${SOURCE_GROUP_SOURCE_FILES} -) - -source_group( "ProjectDataModel\\Flow" FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake ) +source_group( + "ProjectDataModel\\Flow" + FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} + ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake) diff --git a/ApplicationLibCode/ProjectDataModel/GeoMech/CMakeLists_files.cmake b/ApplicationLibCode/ProjectDataModel/GeoMech/CMakeLists_files.cmake index 4b4a05231d..7d0d9655c7 100644 --- a/ApplicationLibCode/ProjectDataModel/GeoMech/CMakeLists_files.cmake +++ b/ApplicationLibCode/ProjectDataModel/GeoMech/CMakeLists_files.cmake @@ -1,32 +1,28 @@ +set(SOURCE_GROUP_HEADER_FILES + ${CMAKE_CURRENT_LIST_DIR}/RimGeoMechModels.h + ${CMAKE_CURRENT_LIST_DIR}/RimGeoMechCase.h + ${CMAKE_CURRENT_LIST_DIR}/RimGeoMechView.h + ${CMAKE_CURRENT_LIST_DIR}/RimGeoMechResultDefinition.h + ${CMAKE_CURRENT_LIST_DIR}/RimGeoMechCellColors.h + ${CMAKE_CURRENT_LIST_DIR}/RimGeoMechContourMapProjection.h + ${CMAKE_CURRENT_LIST_DIR}/RimGeoMechContourMapView.h + ${CMAKE_CURRENT_LIST_DIR}/RimGeoMechContourMapViewCollection.h) -set (SOURCE_GROUP_HEADER_FILES -${CMAKE_CURRENT_LIST_DIR}/RimGeoMechModels.h -${CMAKE_CURRENT_LIST_DIR}/RimGeoMechCase.h -${CMAKE_CURRENT_LIST_DIR}/RimGeoMechView.h -${CMAKE_CURRENT_LIST_DIR}/RimGeoMechResultDefinition.h -${CMAKE_CURRENT_LIST_DIR}/RimGeoMechCellColors.h -${CMAKE_CURRENT_LIST_DIR}/RimGeoMechContourMapProjection.h -${CMAKE_CURRENT_LIST_DIR}/RimGeoMechContourMapView.h -${CMAKE_CURRENT_LIST_DIR}/RimGeoMechContourMapViewCollection.h -) +set(SOURCE_GROUP_SOURCE_FILES + ${CMAKE_CURRENT_LIST_DIR}/RimGeoMechModels.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimGeoMechCase.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimGeoMechView.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimGeoMechResultDefinition.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimGeoMechCellColors.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimGeoMechContourMapProjection.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimGeoMechContourMapView.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimGeoMechContourMapViewCollection.cpp) -set (SOURCE_GROUP_SOURCE_FILES -${CMAKE_CURRENT_LIST_DIR}/RimGeoMechModels.cpp -${CMAKE_CURRENT_LIST_DIR}/RimGeoMechCase.cpp -${CMAKE_CURRENT_LIST_DIR}/RimGeoMechView.cpp -${CMAKE_CURRENT_LIST_DIR}/RimGeoMechResultDefinition.cpp -${CMAKE_CURRENT_LIST_DIR}/RimGeoMechCellColors.cpp -${CMAKE_CURRENT_LIST_DIR}/RimGeoMechContourMapProjection.cpp -${CMAKE_CURRENT_LIST_DIR}/RimGeoMechContourMapView.cpp -${CMAKE_CURRENT_LIST_DIR}/RimGeoMechContourMapViewCollection.cpp -) +list(APPEND CODE_HEADER_FILES ${SOURCE_GROUP_HEADER_FILES}) -list(APPEND CODE_HEADER_FILES -${SOURCE_GROUP_HEADER_FILES} -) +list(APPEND CODE_SOURCE_FILES ${SOURCE_GROUP_SOURCE_FILES}) -list(APPEND CODE_SOURCE_FILES -${SOURCE_GROUP_SOURCE_FILES} -) - -source_group( "ProjectDataModel\\GeoMech" FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake ) +source_group( + "ProjectDataModel\\GeoMech" + FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} + ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake) diff --git a/ApplicationLibCode/ProjectDataModel/GridCrossPlots/CMakeLists_files.cmake b/ApplicationLibCode/ProjectDataModel/GridCrossPlots/CMakeLists_files.cmake index 7945d82f5e..183e80fb17 100644 --- a/ApplicationLibCode/ProjectDataModel/GridCrossPlots/CMakeLists_files.cmake +++ b/ApplicationLibCode/ProjectDataModel/GridCrossPlots/CMakeLists_files.cmake @@ -1,32 +1,26 @@ +set(SOURCE_GROUP_HEADER_FILES + ${CMAKE_CURRENT_LIST_DIR}/RimGridCrossPlot.h + ${CMAKE_CURRENT_LIST_DIR}/RimGridCrossPlotCollection.h + ${CMAKE_CURRENT_LIST_DIR}/RimGridCrossPlotCurve.h + ${CMAKE_CURRENT_LIST_DIR}/RimGridCrossPlotDataSet.h + ${CMAKE_CURRENT_LIST_DIR}/RimSaturationPressurePlot.h + ${CMAKE_CURRENT_LIST_DIR}/RimSaturationPressurePlotCollection.h) -set (SOURCE_GROUP_HEADER_FILES -${CMAKE_CURRENT_LIST_DIR}/RimGridCrossPlot.h -${CMAKE_CURRENT_LIST_DIR}/RimGridCrossPlotCollection.h -${CMAKE_CURRENT_LIST_DIR}/RimGridCrossPlotCurve.h -${CMAKE_CURRENT_LIST_DIR}/RimGridCrossPlotDataSet.h -${CMAKE_CURRENT_LIST_DIR}/RimSaturationPressurePlot.h -${CMAKE_CURRENT_LIST_DIR}/RimSaturationPressurePlotCollection.h -) +set(SOURCE_GROUP_SOURCE_FILES + ${CMAKE_CURRENT_LIST_DIR}/RimGridCrossPlot.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimGridCrossPlotCollection.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimGridCrossPlotCurve.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimGridCrossPlotDataSet.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimSaturationPressurePlot.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimSaturationPressurePlotCollection.cpp) -set (SOURCE_GROUP_SOURCE_FILES -${CMAKE_CURRENT_LIST_DIR}/RimGridCrossPlot.cpp -${CMAKE_CURRENT_LIST_DIR}/RimGridCrossPlotCollection.cpp -${CMAKE_CURRENT_LIST_DIR}/RimGridCrossPlotCurve.cpp -${CMAKE_CURRENT_LIST_DIR}/RimGridCrossPlotDataSet.cpp -${CMAKE_CURRENT_LIST_DIR}/RimSaturationPressurePlot.cpp -${CMAKE_CURRENT_LIST_DIR}/RimSaturationPressurePlotCollection.cpp -) +list(APPEND CODE_HEADER_FILES ${SOURCE_GROUP_HEADER_FILES}) -list(APPEND CODE_HEADER_FILES -${SOURCE_GROUP_HEADER_FILES} -) +list(APPEND CODE_SOURCE_FILES ${SOURCE_GROUP_SOURCE_FILES}) -list(APPEND CODE_SOURCE_FILES -${SOURCE_GROUP_SOURCE_FILES} -) +list(APPEND QT_MOC_HEADERS ${CMAKE_CURRENT_LIST_DIR}/RimGridCrossPlot.h) -list(APPEND QT_MOC_HEADERS -${CMAKE_CURRENT_LIST_DIR}/RimGridCrossPlot.h -) - -source_group( "ProjectDataModel\\GridCrossPlots" FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake ) +source_group( + "ProjectDataModel\\GridCrossPlots" + FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} + ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake) diff --git a/ApplicationLibCode/ProjectDataModel/GridCrossPlots/CellFilters/CMakeLists_files.cmake b/ApplicationLibCode/ProjectDataModel/GridCrossPlots/CellFilters/CMakeLists_files.cmake index 46fc736a04..8fb9453e7b 100644 --- a/ApplicationLibCode/ProjectDataModel/GridCrossPlots/CellFilters/CMakeLists_files.cmake +++ b/ApplicationLibCode/ProjectDataModel/GridCrossPlots/CellFilters/CMakeLists_files.cmake @@ -1,22 +1,18 @@ +set(SOURCE_GROUP_HEADER_FILES + ${CMAKE_CURRENT_LIST_DIR}/RimPlotCellFilter.h + ${CMAKE_CURRENT_LIST_DIR}/RimPlotCellFilterCollection.h + ${CMAKE_CURRENT_LIST_DIR}/RimPlotCellPropertyFilter.h) -set (SOURCE_GROUP_HEADER_FILES -${CMAKE_CURRENT_LIST_DIR}/RimPlotCellFilter.h -${CMAKE_CURRENT_LIST_DIR}/RimPlotCellFilterCollection.h -${CMAKE_CURRENT_LIST_DIR}/RimPlotCellPropertyFilter.h -) +set(SOURCE_GROUP_SOURCE_FILES + ${CMAKE_CURRENT_LIST_DIR}/RimPlotCellFilter.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimPlotCellFilterCollection.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimPlotCellPropertyFilter.cpp) -set (SOURCE_GROUP_SOURCE_FILES -${CMAKE_CURRENT_LIST_DIR}/RimPlotCellFilter.cpp -${CMAKE_CURRENT_LIST_DIR}/RimPlotCellFilterCollection.cpp -${CMAKE_CURRENT_LIST_DIR}/RimPlotCellPropertyFilter.cpp -) +list(APPEND CODE_HEADER_FILES ${SOURCE_GROUP_HEADER_FILES}) -list(APPEND CODE_HEADER_FILES -${SOURCE_GROUP_HEADER_FILES} -) +list(APPEND CODE_SOURCE_FILES ${SOURCE_GROUP_SOURCE_FILES}) -list(APPEND CODE_SOURCE_FILES -${SOURCE_GROUP_SOURCE_FILES} -) - -source_group( "ProjectDataModel\\GridCrossPlots\\CellFilters" FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake ) +source_group( + "ProjectDataModel\\GridCrossPlots\\CellFilters" + FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} + ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake) diff --git a/ApplicationLibCode/ProjectDataModel/Measurement/CMakeLists_files.cmake b/ApplicationLibCode/ProjectDataModel/Measurement/CMakeLists_files.cmake index 5f9c9c78dc..60e00c38a2 100644 --- a/ApplicationLibCode/ProjectDataModel/Measurement/CMakeLists_files.cmake +++ b/ApplicationLibCode/ProjectDataModel/Measurement/CMakeLists_files.cmake @@ -1,26 +1,19 @@ +set(SOURCE_GROUP_HEADER_FILES + ${CMAKE_CURRENT_LIST_DIR}/RimMeasurement.h + ${CMAKE_CURRENT_LIST_DIR}/RiuMeasurementEventFilter.h) -set (SOURCE_GROUP_HEADER_FILES -${CMAKE_CURRENT_LIST_DIR}/RimMeasurement.h -${CMAKE_CURRENT_LIST_DIR}/RiuMeasurementEventFilter.h -) +set(SOURCE_GROUP_SOURCE_FILES + ${CMAKE_CURRENT_LIST_DIR}/RimMeasurement.cpp + ${CMAKE_CURRENT_LIST_DIR}/RiuMeasurementEventFilter.cpp) -set (SOURCE_GROUP_SOURCE_FILES -${CMAKE_CURRENT_LIST_DIR}/RimMeasurement.cpp -${CMAKE_CURRENT_LIST_DIR}/RiuMeasurementEventFilter.cpp -) +list(APPEND CODE_HEADER_FILES ${SOURCE_GROUP_HEADER_FILES}) -list(APPEND CODE_HEADER_FILES -${SOURCE_GROUP_HEADER_FILES} -) +list(APPEND CODE_SOURCE_FILES ${SOURCE_GROUP_SOURCE_FILES}) -list(APPEND CODE_SOURCE_FILES -${SOURCE_GROUP_SOURCE_FILES} -) +set(QT_MOC_HEADERS ${CMAKE_CURRENT_LIST_DIR}/RiuMeasurementEventFilter.h + ${QT_MOC_HEADERS}) -set (QT_MOC_HEADERS -${CMAKE_CURRENT_LIST_DIR}/RiuMeasurementEventFilter.h -${QT_MOC_HEADERS} -) - - -source_group( "ProjectDataModel\\Measurement" FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake ) +source_group( + "ProjectDataModel\\Measurement" + FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} + ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake) diff --git a/ApplicationLibCode/ProjectDataModel/Parameters/CMakeLists_files.cmake b/ApplicationLibCode/ProjectDataModel/Parameters/CMakeLists_files.cmake index 406c4bad86..754f207cf6 100644 --- a/ApplicationLibCode/ProjectDataModel/Parameters/CMakeLists_files.cmake +++ b/ApplicationLibCode/ProjectDataModel/Parameters/CMakeLists_files.cmake @@ -1,26 +1,22 @@ +set(SOURCE_GROUP_HEADER_FILES + ${CMAKE_CURRENT_LIST_DIR}/RimGenericParameter.h + ${CMAKE_CURRENT_LIST_DIR}/RimDoubleParameter.h + ${CMAKE_CURRENT_LIST_DIR}/RimIntegerParameter.h + ${CMAKE_CURRENT_LIST_DIR}/RimStringParameter.h + ${CMAKE_CURRENT_LIST_DIR}/RimParameterGroup.h) -set (SOURCE_GROUP_HEADER_FILES -${CMAKE_CURRENT_LIST_DIR}/RimGenericParameter.h -${CMAKE_CURRENT_LIST_DIR}/RimDoubleParameter.h -${CMAKE_CURRENT_LIST_DIR}/RimIntegerParameter.h -${CMAKE_CURRENT_LIST_DIR}/RimStringParameter.h -${CMAKE_CURRENT_LIST_DIR}/RimParameterGroup.h -) +set(SOURCE_GROUP_SOURCE_FILES + ${CMAKE_CURRENT_LIST_DIR}/RimGenericParameter.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimDoubleParameter.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimIntegerParameter.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimStringParameter.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimParameterGroup.cpp) -set (SOURCE_GROUP_SOURCE_FILES -${CMAKE_CURRENT_LIST_DIR}/RimGenericParameter.cpp -${CMAKE_CURRENT_LIST_DIR}/RimDoubleParameter.cpp -${CMAKE_CURRENT_LIST_DIR}/RimIntegerParameter.cpp -${CMAKE_CURRENT_LIST_DIR}/RimStringParameter.cpp -${CMAKE_CURRENT_LIST_DIR}/RimParameterGroup.cpp -) +list(APPEND CODE_HEADER_FILES ${SOURCE_GROUP_HEADER_FILES}) -list(APPEND CODE_HEADER_FILES -${SOURCE_GROUP_HEADER_FILES} -) +list(APPEND CODE_SOURCE_FILES ${SOURCE_GROUP_SOURCE_FILES}) -list(APPEND CODE_SOURCE_FILES -${SOURCE_GROUP_SOURCE_FILES} -) - -source_group( "ProjectDataModel\\Parameters" FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake ) +source_group( + "ProjectDataModel\\Parameters" + FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} + ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake) diff --git a/ApplicationLibCode/ProjectDataModel/PlotTemplates/CMakeLists_files.cmake b/ApplicationLibCode/ProjectDataModel/PlotTemplates/CMakeLists_files.cmake index 4fe667bdbb..715ee167c8 100644 --- a/ApplicationLibCode/ProjectDataModel/PlotTemplates/CMakeLists_files.cmake +++ b/ApplicationLibCode/ProjectDataModel/PlotTemplates/CMakeLists_files.cmake @@ -1,20 +1,16 @@ +set(SOURCE_GROUP_HEADER_FILES + ${CMAKE_CURRENT_LIST_DIR}/RimPlotTemplateFolderItem.h + ${CMAKE_CURRENT_LIST_DIR}/RimPlotTemplateFileItem.h) -set (SOURCE_GROUP_HEADER_FILES -${CMAKE_CURRENT_LIST_DIR}/RimPlotTemplateFolderItem.h -${CMAKE_CURRENT_LIST_DIR}/RimPlotTemplateFileItem.h -) +set(SOURCE_GROUP_SOURCE_FILES + ${CMAKE_CURRENT_LIST_DIR}/RimPlotTemplateFolderItem.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimPlotTemplateFileItem.cpp) -set (SOURCE_GROUP_SOURCE_FILES -${CMAKE_CURRENT_LIST_DIR}/RimPlotTemplateFolderItem.cpp -${CMAKE_CURRENT_LIST_DIR}/RimPlotTemplateFileItem.cpp -) +list(APPEND CODE_HEADER_FILES ${SOURCE_GROUP_HEADER_FILES}) -list(APPEND CODE_HEADER_FILES -${SOURCE_GROUP_HEADER_FILES} -) +list(APPEND CODE_SOURCE_FILES ${SOURCE_GROUP_SOURCE_FILES}) -list(APPEND CODE_SOURCE_FILES -${SOURCE_GROUP_SOURCE_FILES} -) - -source_group( "ProjectDataModel\\PlotTemplates" FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake ) +source_group( + "ProjectDataModel\\PlotTemplates" + FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} + ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake) diff --git a/ApplicationLibCode/ProjectDataModel/ProcessControl/CMakeLists_files.cmake b/ApplicationLibCode/ProjectDataModel/ProcessControl/CMakeLists_files.cmake index c35d4e717e..d57d70f196 100644 --- a/ApplicationLibCode/ProjectDataModel/ProcessControl/CMakeLists_files.cmake +++ b/ApplicationLibCode/ProjectDataModel/ProcessControl/CMakeLists_files.cmake @@ -1,24 +1,17 @@ +set(SOURCE_GROUP_HEADER_FILES ${CMAKE_CURRENT_LIST_DIR}/RimProcess.h + ${CMAKE_CURRENT_LIST_DIR}/RimProcessMonitor.h) -set (SOURCE_GROUP_HEADER_FILES -${CMAKE_CURRENT_LIST_DIR}/RimProcess.h -${CMAKE_CURRENT_LIST_DIR}/RimProcessMonitor.h -) +set(SOURCE_GROUP_SOURCE_FILES ${CMAKE_CURRENT_LIST_DIR}/RimProcess.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimProcessMonitor.cpp) -set (SOURCE_GROUP_SOURCE_FILES -${CMAKE_CURRENT_LIST_DIR}/RimProcess.cpp -${CMAKE_CURRENT_LIST_DIR}/RimProcessMonitor.cpp -) +list(APPEND CODE_HEADER_FILES ${SOURCE_GROUP_HEADER_FILES}) -list(APPEND CODE_HEADER_FILES -${SOURCE_GROUP_HEADER_FILES} -) - -list(APPEND CODE_SOURCE_FILES -${SOURCE_GROUP_SOURCE_FILES} -) +list(APPEND CODE_SOURCE_FILES ${SOURCE_GROUP_SOURCE_FILES}) list(APPEND COMMAND_QT_MOC_HEADERS -${CMAKE_CURRENT_LIST_DIR}/RimProcessMonitor.h -) + ${CMAKE_CURRENT_LIST_DIR}/RimProcessMonitor.h) -source_group( "ProjectDataModel\\ProcessControl" FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake ) +source_group( + "ProjectDataModel\\ProcessControl" + FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} + ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake) diff --git a/ApplicationLibCode/ProjectDataModel/StimPlanModel/CMakeLists_files.cmake b/ApplicationLibCode/ProjectDataModel/StimPlanModel/CMakeLists_files.cmake index f9c826737f..ed59f7aacc 100644 --- a/ApplicationLibCode/ProjectDataModel/StimPlanModel/CMakeLists_files.cmake +++ b/ApplicationLibCode/ProjectDataModel/StimPlanModel/CMakeLists_files.cmake @@ -1,65 +1,60 @@ +set(SOURCE_GROUP_HEADER_FILES + ${CMAKE_CURRENT_LIST_DIR}/RimStimPlanModelCollection.h + ${CMAKE_CURRENT_LIST_DIR}/RimStimPlanModelTemplate.h + ${CMAKE_CURRENT_LIST_DIR}/RimStimPlanModel.h + ${CMAKE_CURRENT_LIST_DIR}/RimStimPlanModelTemplateCollection.h + ${CMAKE_CURRENT_LIST_DIR}/RimStimPlanModelCalculator.h + ${CMAKE_CURRENT_LIST_DIR}/RimStimPlanModelCurve.h + ${CMAKE_CURRENT_LIST_DIR}/RimStimPlanModelElasticPropertyCalculator.h + ${CMAKE_CURRENT_LIST_DIR}/RimStimPlanModelLayerCalculator.h + ${CMAKE_CURRENT_LIST_DIR}/RimStimPlanModelPlotCollection.h + ${CMAKE_CURRENT_LIST_DIR}/RimStimPlanModelPlot.h + ${CMAKE_CURRENT_LIST_DIR}/RimStimPlanModelPropertyCalculator.h + ${CMAKE_CURRENT_LIST_DIR}/RimStimPlanModelPropertyCurve.h + ${CMAKE_CURRENT_LIST_DIR}/RimStimPlanModelStressCalculator.h + ${CMAKE_CURRENT_LIST_DIR}/RimStimPlanModelWellLogCalculator.h + ${CMAKE_CURRENT_LIST_DIR}/RimStimPlanModelPressureCalculator.h + ${CMAKE_CURRENT_LIST_DIR}/RimElasticProperties.h + ${CMAKE_CURRENT_LIST_DIR}/RimElasticPropertyScaling.h + ${CMAKE_CURRENT_LIST_DIR}/RimElasticPropertyScalingCollection.h + ${CMAKE_CURRENT_LIST_DIR}/RimFaciesProperties.h + ${CMAKE_CURRENT_LIST_DIR}/RimNonNetLayers.h + ${CMAKE_CURRENT_LIST_DIR}/RimFaciesInitialPressureConfig.h + ${CMAKE_CURRENT_LIST_DIR}/RimPressureTableItem.h + ${CMAKE_CURRENT_LIST_DIR}/RimPressureTable.h + ${CMAKE_CURRENT_LIST_DIR}/RimExtractionConfiguration.h) -set (SOURCE_GROUP_HEADER_FILES -${CMAKE_CURRENT_LIST_DIR}/RimStimPlanModelCollection.h -${CMAKE_CURRENT_LIST_DIR}/RimStimPlanModelTemplate.h -${CMAKE_CURRENT_LIST_DIR}/RimStimPlanModel.h -${CMAKE_CURRENT_LIST_DIR}/RimStimPlanModelTemplateCollection.h -${CMAKE_CURRENT_LIST_DIR}/RimStimPlanModelCalculator.h -${CMAKE_CURRENT_LIST_DIR}/RimStimPlanModelCurve.h -${CMAKE_CURRENT_LIST_DIR}/RimStimPlanModelElasticPropertyCalculator.h -${CMAKE_CURRENT_LIST_DIR}/RimStimPlanModelLayerCalculator.h -${CMAKE_CURRENT_LIST_DIR}/RimStimPlanModelPlotCollection.h -${CMAKE_CURRENT_LIST_DIR}/RimStimPlanModelPlot.h -${CMAKE_CURRENT_LIST_DIR}/RimStimPlanModelPropertyCalculator.h -${CMAKE_CURRENT_LIST_DIR}/RimStimPlanModelPropertyCurve.h -${CMAKE_CURRENT_LIST_DIR}/RimStimPlanModelStressCalculator.h -${CMAKE_CURRENT_LIST_DIR}/RimStimPlanModelWellLogCalculator.h -${CMAKE_CURRENT_LIST_DIR}/RimStimPlanModelPressureCalculator.h -${CMAKE_CURRENT_LIST_DIR}/RimElasticProperties.h -${CMAKE_CURRENT_LIST_DIR}/RimElasticPropertyScaling.h -${CMAKE_CURRENT_LIST_DIR}/RimElasticPropertyScalingCollection.h -${CMAKE_CURRENT_LIST_DIR}/RimFaciesProperties.h -${CMAKE_CURRENT_LIST_DIR}/RimNonNetLayers.h -${CMAKE_CURRENT_LIST_DIR}/RimFaciesInitialPressureConfig.h -${CMAKE_CURRENT_LIST_DIR}/RimPressureTableItem.h -${CMAKE_CURRENT_LIST_DIR}/RimPressureTable.h -${CMAKE_CURRENT_LIST_DIR}/RimExtractionConfiguration.h -) +set(SOURCE_GROUP_SOURCE_FILES + ${CMAKE_CURRENT_LIST_DIR}/RimStimPlanModelCollection.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimStimPlanModelTemplate.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimStimPlanModel.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimStimPlanModelTemplateCollection.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimStimPlanModelCalculator.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimStimPlanModelCurve.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimStimPlanModelElasticPropertyCalculator.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimStimPlanModelLayerCalculator.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimStimPlanModelPlotCollection.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimStimPlanModelPlot.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimStimPlanModelStressCalculator.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimStimPlanModelWellLogCalculator.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimStimPlanModelPressureCalculator.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimElasticProperties.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimElasticPropertyScaling.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimElasticPropertyScalingCollection.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimFaciesProperties.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimNonNetLayers.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimFaciesInitialPressureConfig.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimPressureTableItem.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimPressureTable.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimExtractionConfiguration.cpp) -set (SOURCE_GROUP_SOURCE_FILES -${CMAKE_CURRENT_LIST_DIR}/RimStimPlanModelCollection.cpp -${CMAKE_CURRENT_LIST_DIR}/RimStimPlanModelTemplate.cpp -${CMAKE_CURRENT_LIST_DIR}/RimStimPlanModel.cpp -${CMAKE_CURRENT_LIST_DIR}/RimStimPlanModelTemplateCollection.cpp -${CMAKE_CURRENT_LIST_DIR}/RimStimPlanModelCalculator.cpp -${CMAKE_CURRENT_LIST_DIR}/RimStimPlanModelCurve.cpp -${CMAKE_CURRENT_LIST_DIR}/RimStimPlanModelElasticPropertyCalculator.cpp -${CMAKE_CURRENT_LIST_DIR}/RimStimPlanModelLayerCalculator.cpp -${CMAKE_CURRENT_LIST_DIR}/RimStimPlanModelPlotCollection.cpp -${CMAKE_CURRENT_LIST_DIR}/RimStimPlanModelPlot.cpp -${CMAKE_CURRENT_LIST_DIR}/RimStimPlanModelStressCalculator.cpp -${CMAKE_CURRENT_LIST_DIR}/RimStimPlanModelWellLogCalculator.cpp -${CMAKE_CURRENT_LIST_DIR}/RimStimPlanModelPressureCalculator.cpp -${CMAKE_CURRENT_LIST_DIR}/RimElasticProperties.cpp -${CMAKE_CURRENT_LIST_DIR}/RimElasticPropertyScaling.cpp -${CMAKE_CURRENT_LIST_DIR}/RimElasticPropertyScalingCollection.cpp -${CMAKE_CURRENT_LIST_DIR}/RimFaciesProperties.cpp -${CMAKE_CURRENT_LIST_DIR}/RimNonNetLayers.cpp -${CMAKE_CURRENT_LIST_DIR}/RimFaciesInitialPressureConfig.cpp -${CMAKE_CURRENT_LIST_DIR}/RimPressureTableItem.cpp -${CMAKE_CURRENT_LIST_DIR}/RimPressureTable.cpp -${CMAKE_CURRENT_LIST_DIR}/RimExtractionConfiguration.cpp -) +list(APPEND CODE_HEADER_FILES ${SOURCE_GROUP_HEADER_FILES}) -list(APPEND CODE_HEADER_FILES -${SOURCE_GROUP_HEADER_FILES} -) +list(APPEND CODE_SOURCE_FILES ${SOURCE_GROUP_SOURCE_FILES}) -list(APPEND CODE_SOURCE_FILES -${SOURCE_GROUP_SOURCE_FILES} -) +list(APPEND QT_MOC_HEADERS) -list(APPEND QT_MOC_HEADERS -) - -source_group( "ProjectDataModel\\StimPlanModel" FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake ) +source_group( + "ProjectDataModel\\StimPlanModel" + FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} + ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake) diff --git a/ApplicationLibCode/ProjectDataModel/Streamlines/CMakeLists_files.cmake b/ApplicationLibCode/ProjectDataModel/Streamlines/CMakeLists_files.cmake index d130035bb2..2eab9b148e 100644 --- a/ApplicationLibCode/ProjectDataModel/Streamlines/CMakeLists_files.cmake +++ b/ApplicationLibCode/ProjectDataModel/Streamlines/CMakeLists_files.cmake @@ -1,26 +1,22 @@ +set(SOURCE_GROUP_HEADER_FILES + ${CMAKE_CURRENT_LIST_DIR}/RimStreamline.h + ${CMAKE_CURRENT_LIST_DIR}/RimStreamlineInViewCollection.h + ${CMAKE_CURRENT_LIST_DIR}/RimStreamlineGeneratorBase.h + ${CMAKE_CURRENT_LIST_DIR}/RimStreamlineDataAccess.h + ${CMAKE_CURRENT_LIST_DIR}/RimStreamlineGenerator.h) -set (SOURCE_GROUP_HEADER_FILES -${CMAKE_CURRENT_LIST_DIR}/RimStreamline.h -${CMAKE_CURRENT_LIST_DIR}/RimStreamlineInViewCollection.h -${CMAKE_CURRENT_LIST_DIR}/RimStreamlineGeneratorBase.h -${CMAKE_CURRENT_LIST_DIR}/RimStreamlineDataAccess.h -${CMAKE_CURRENT_LIST_DIR}/RimStreamlineGenerator.h -) +set(SOURCE_GROUP_SOURCE_FILES + ${CMAKE_CURRENT_LIST_DIR}/RimStreamline.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimStreamlineInViewCollection.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimStreamlineGeneratorBase.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimStreamlineDataAccess.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimStreamlineGenerator.cpp) -set (SOURCE_GROUP_SOURCE_FILES -${CMAKE_CURRENT_LIST_DIR}/RimStreamline.cpp -${CMAKE_CURRENT_LIST_DIR}/RimStreamlineInViewCollection.cpp -${CMAKE_CURRENT_LIST_DIR}/RimStreamlineGeneratorBase.cpp -${CMAKE_CURRENT_LIST_DIR}/RimStreamlineDataAccess.cpp -${CMAKE_CURRENT_LIST_DIR}/RimStreamlineGenerator.cpp -) +list(APPEND CODE_HEADER_FILES ${SOURCE_GROUP_HEADER_FILES}) -list(APPEND CODE_HEADER_FILES -${SOURCE_GROUP_HEADER_FILES} -) +list(APPEND CODE_SOURCE_FILES ${SOURCE_GROUP_SOURCE_FILES}) -list(APPEND CODE_SOURCE_FILES -${SOURCE_GROUP_SOURCE_FILES} -) - -source_group( "ProjectDataModel\\Streamlines" FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake ) +source_group( + "ProjectDataModel\\Streamlines" + FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} + ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake) diff --git a/ApplicationLibCode/ProjectDataModel/Summary/CMakeLists_files.cmake b/ApplicationLibCode/ProjectDataModel/Summary/CMakeLists_files.cmake index f6ceffd2be..d99a3e7f29 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/CMakeLists_files.cmake +++ b/ApplicationLibCode/ProjectDataModel/Summary/CMakeLists_files.cmake @@ -1,98 +1,92 @@ +set(SOURCE_GROUP_HEADER_FILES + ${CMAKE_CURRENT_LIST_DIR}/RimAsciiDataCurve.h + ${CMAKE_CURRENT_LIST_DIR}/RimFileSummaryCase.h + ${CMAKE_CURRENT_LIST_DIR}/RimGridSummaryCase.h + ${CMAKE_CURRENT_LIST_DIR}/RimSummaryCase.h + ${CMAKE_CURRENT_LIST_DIR}/RimSummaryCaseMainCollection.h + ${CMAKE_CURRENT_LIST_DIR}/RimSummaryCaseCollection.h + ${CMAKE_CURRENT_LIST_DIR}/RimSummaryCurve.h + ${CMAKE_CURRENT_LIST_DIR}/RimSummaryCurveAppearanceCalculator.h + ${CMAKE_CURRENT_LIST_DIR}/RimSummaryCurveAutoName.h + ${CMAKE_CURRENT_LIST_DIR}/RimSummaryCurveFilter.h + ${CMAKE_CURRENT_LIST_DIR}/RimSummaryPlotAxisFormatter.h + ${CMAKE_CURRENT_LIST_DIR}/RimSummaryFilter.h + ${CMAKE_CURRENT_LIST_DIR}/RimSummaryCurveCollection.h + ${CMAKE_CURRENT_LIST_DIR}/RimSummaryPlot.h + ${CMAKE_CURRENT_LIST_DIR}/RimSummaryPlotCollection.h + ${CMAKE_CURRENT_LIST_DIR}/RimSummaryCrossPlotCollection.h + ${CMAKE_CURRENT_LIST_DIR}/RimSummaryTimeAxisProperties.h + ${CMAKE_CURRENT_LIST_DIR}/RimObservedSummaryData.h + ${CMAKE_CURRENT_LIST_DIR}/RimSummaryObservedDataFile.h + ${CMAKE_CURRENT_LIST_DIR}/RimObservedEclipseUserData.h + ${CMAKE_CURRENT_LIST_DIR}/RimCalculatedSummaryCase.h + ${CMAKE_CURRENT_LIST_DIR}/RimCalculatedSummaryCurveReader.h + ${CMAKE_CURRENT_LIST_DIR}/RimSummaryAddress.h + ${CMAKE_CURRENT_LIST_DIR}/RimSummaryCrossPlot.h + ${CMAKE_CURRENT_LIST_DIR}/RimSummaryPlotSourceStepping.h + ${CMAKE_CURRENT_LIST_DIR}/RimCsvUserData.h + ${CMAKE_CURRENT_LIST_DIR}/RimSummaryPlotNameHelper.h + ${CMAKE_CURRENT_LIST_DIR}/RimEnsembleCurveSetCollection.h + ${CMAKE_CURRENT_LIST_DIR}/RimEnsembleCurveSet.h + ${CMAKE_CURRENT_LIST_DIR}/RimEnsembleCurveSetColorManager.h + ${CMAKE_CURRENT_LIST_DIR}/RimEnsembleCurveFilter.h + ${CMAKE_CURRENT_LIST_DIR}/RimEnsembleCurveFilterCollection.h + ${CMAKE_CURRENT_LIST_DIR}/RimEnsembleStatistics.h + ${CMAKE_CURRENT_LIST_DIR}/RimEnsembleStatisticsCase.h + ${CMAKE_CURRENT_LIST_DIR}/RimDerivedSummaryCase.h + ${CMAKE_CURRENT_LIST_DIR}/RimDerivedEnsembleCaseCollection.h + ${CMAKE_CURRENT_LIST_DIR}/RimSummaryPlotFilterTextCurveSetEditor.h + ${CMAKE_CURRENT_LIST_DIR}/RimObjectiveFunction.h + ${CMAKE_CURRENT_LIST_DIR}/RimObjectiveFunctionTools.h) -set (SOURCE_GROUP_HEADER_FILES -${CMAKE_CURRENT_LIST_DIR}/RimAsciiDataCurve.h -${CMAKE_CURRENT_LIST_DIR}/RimFileSummaryCase.h -${CMAKE_CURRENT_LIST_DIR}/RimGridSummaryCase.h -${CMAKE_CURRENT_LIST_DIR}/RimSummaryCase.h -${CMAKE_CURRENT_LIST_DIR}/RimSummaryCaseMainCollection.h -${CMAKE_CURRENT_LIST_DIR}/RimSummaryCaseCollection.h -${CMAKE_CURRENT_LIST_DIR}/RimSummaryCurve.h -${CMAKE_CURRENT_LIST_DIR}/RimSummaryCurveAppearanceCalculator.h -${CMAKE_CURRENT_LIST_DIR}/RimSummaryCurveAutoName.h -${CMAKE_CURRENT_LIST_DIR}/RimSummaryCurveFilter.h -${CMAKE_CURRENT_LIST_DIR}/RimSummaryPlotAxisFormatter.h -${CMAKE_CURRENT_LIST_DIR}/RimSummaryFilter.h -${CMAKE_CURRENT_LIST_DIR}/RimSummaryCurveCollection.h -${CMAKE_CURRENT_LIST_DIR}/RimSummaryPlot.h -${CMAKE_CURRENT_LIST_DIR}/RimSummaryPlotCollection.h -${CMAKE_CURRENT_LIST_DIR}/RimSummaryCrossPlotCollection.h -${CMAKE_CURRENT_LIST_DIR}/RimSummaryTimeAxisProperties.h -${CMAKE_CURRENT_LIST_DIR}/RimObservedSummaryData.h -${CMAKE_CURRENT_LIST_DIR}/RimSummaryObservedDataFile.h -${CMAKE_CURRENT_LIST_DIR}/RimObservedEclipseUserData.h -${CMAKE_CURRENT_LIST_DIR}/RimCalculatedSummaryCase.h -${CMAKE_CURRENT_LIST_DIR}/RimCalculatedSummaryCurveReader.h -${CMAKE_CURRENT_LIST_DIR}/RimSummaryAddress.h -${CMAKE_CURRENT_LIST_DIR}/RimSummaryCrossPlot.h -${CMAKE_CURRENT_LIST_DIR}/RimSummaryPlotSourceStepping.h -${CMAKE_CURRENT_LIST_DIR}/RimCsvUserData.h -${CMAKE_CURRENT_LIST_DIR}/RimSummaryPlotNameHelper.h -${CMAKE_CURRENT_LIST_DIR}/RimEnsembleCurveSetCollection.h -${CMAKE_CURRENT_LIST_DIR}/RimEnsembleCurveSet.h -${CMAKE_CURRENT_LIST_DIR}/RimEnsembleCurveSetColorManager.h -${CMAKE_CURRENT_LIST_DIR}/RimEnsembleCurveFilter.h -${CMAKE_CURRENT_LIST_DIR}/RimEnsembleCurveFilterCollection.h -${CMAKE_CURRENT_LIST_DIR}/RimEnsembleStatistics.h -${CMAKE_CURRENT_LIST_DIR}/RimEnsembleStatisticsCase.h -${CMAKE_CURRENT_LIST_DIR}/RimDerivedSummaryCase.h -${CMAKE_CURRENT_LIST_DIR}/RimDerivedEnsembleCaseCollection.h -${CMAKE_CURRENT_LIST_DIR}/RimSummaryPlotFilterTextCurveSetEditor.h -${CMAKE_CURRENT_LIST_DIR}/RimObjectiveFunction.h -${CMAKE_CURRENT_LIST_DIR}/RimObjectiveFunctionTools.h -) +set(SOURCE_GROUP_SOURCE_FILES + ${CMAKE_CURRENT_LIST_DIR}/RimAsciiDataCurve.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimFileSummaryCase.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimGridSummaryCase.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimSummaryCase.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimSummaryCaseMainCollection.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimSummaryCaseCollection.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimSummaryCurve.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimSummaryCurveAppearanceCalculator.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimSummaryCurveAutoName.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimSummaryCurveFilter.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimSummaryPlotAxisFormatter.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimSummaryFilter.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimSummaryCurveCollection.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimSummaryPlot.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimSummaryPlotCollection.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimSummaryCrossPlotCollection.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimSummaryTimeAxisProperties.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimObservedSummaryData.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimSummaryObservedDataFile.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimObservedEclipseUserData.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimCalculatedSummaryCase.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimCalculatedSummaryCurveReader.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimSummaryAddress.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimSummaryCrossPlot.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimSummaryPlotSourceStepping.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimCsvUserData.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimSummaryPlotNameHelper.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimEnsembleCurveSetCollection.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimEnsembleCurveSet.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimEnsembleCurveSetColorManager.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimEnsembleCurveFilter.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimEnsembleCurveFilterCollection.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimEnsembleStatistics.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimEnsembleStatisticsCase.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimDerivedSummaryCase.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimDerivedEnsembleCaseCollection.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimSummaryPlotFilterTextCurveSetEditor.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimObjectiveFunction.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimObjectiveFunctionTools.cpp) -set (SOURCE_GROUP_SOURCE_FILES -${CMAKE_CURRENT_LIST_DIR}/RimAsciiDataCurve.cpp -${CMAKE_CURRENT_LIST_DIR}/RimFileSummaryCase.cpp -${CMAKE_CURRENT_LIST_DIR}/RimGridSummaryCase.cpp -${CMAKE_CURRENT_LIST_DIR}/RimSummaryCase.cpp -${CMAKE_CURRENT_LIST_DIR}/RimSummaryCaseMainCollection.cpp -${CMAKE_CURRENT_LIST_DIR}/RimSummaryCaseCollection.cpp -${CMAKE_CURRENT_LIST_DIR}/RimSummaryCurve.cpp -${CMAKE_CURRENT_LIST_DIR}/RimSummaryCurveAppearanceCalculator.cpp -${CMAKE_CURRENT_LIST_DIR}/RimSummaryCurveAutoName.cpp -${CMAKE_CURRENT_LIST_DIR}/RimSummaryCurveFilter.cpp -${CMAKE_CURRENT_LIST_DIR}/RimSummaryPlotAxisFormatter.cpp -${CMAKE_CURRENT_LIST_DIR}/RimSummaryFilter.cpp -${CMAKE_CURRENT_LIST_DIR}/RimSummaryCurveCollection.cpp -${CMAKE_CURRENT_LIST_DIR}/RimSummaryPlot.cpp -${CMAKE_CURRENT_LIST_DIR}/RimSummaryPlotCollection.cpp -${CMAKE_CURRENT_LIST_DIR}/RimSummaryCrossPlotCollection.cpp -${CMAKE_CURRENT_LIST_DIR}/RimSummaryTimeAxisProperties.cpp -${CMAKE_CURRENT_LIST_DIR}/RimObservedSummaryData.cpp -${CMAKE_CURRENT_LIST_DIR}/RimSummaryObservedDataFile.cpp -${CMAKE_CURRENT_LIST_DIR}/RimObservedEclipseUserData.cpp -${CMAKE_CURRENT_LIST_DIR}/RimCalculatedSummaryCase.cpp -${CMAKE_CURRENT_LIST_DIR}/RimCalculatedSummaryCurveReader.cpp -${CMAKE_CURRENT_LIST_DIR}/RimSummaryAddress.cpp -${CMAKE_CURRENT_LIST_DIR}/RimSummaryCrossPlot.cpp -${CMAKE_CURRENT_LIST_DIR}/RimSummaryPlotSourceStepping.cpp -${CMAKE_CURRENT_LIST_DIR}/RimCsvUserData.cpp -${CMAKE_CURRENT_LIST_DIR}/RimSummaryPlotNameHelper.cpp -${CMAKE_CURRENT_LIST_DIR}/RimEnsembleCurveSetCollection.cpp -${CMAKE_CURRENT_LIST_DIR}/RimEnsembleCurveSet.cpp -${CMAKE_CURRENT_LIST_DIR}/RimEnsembleCurveSetColorManager.cpp -${CMAKE_CURRENT_LIST_DIR}/RimEnsembleCurveFilter.cpp -${CMAKE_CURRENT_LIST_DIR}/RimEnsembleCurveFilterCollection.cpp -${CMAKE_CURRENT_LIST_DIR}/RimEnsembleStatistics.cpp -${CMAKE_CURRENT_LIST_DIR}/RimEnsembleStatisticsCase.cpp -${CMAKE_CURRENT_LIST_DIR}/RimDerivedSummaryCase.cpp -${CMAKE_CURRENT_LIST_DIR}/RimDerivedEnsembleCaseCollection.cpp -${CMAKE_CURRENT_LIST_DIR}/RimSummaryPlotFilterTextCurveSetEditor.cpp -${CMAKE_CURRENT_LIST_DIR}/RimObjectiveFunction.cpp -${CMAKE_CURRENT_LIST_DIR}/RimObjectiveFunctionTools.cpp -) +list(APPEND CODE_HEADER_FILES ${SOURCE_GROUP_HEADER_FILES}) -list(APPEND CODE_HEADER_FILES -${SOURCE_GROUP_HEADER_FILES} -) +list(APPEND CODE_SOURCE_FILES ${SOURCE_GROUP_SOURCE_FILES}) -list(APPEND CODE_SOURCE_FILES -${SOURCE_GROUP_SOURCE_FILES} -) +list(APPEND QT_MOC_HEADERS ${CMAKE_CURRENT_LIST_DIR}/RimSummaryPlot.h) -list(APPEND QT_MOC_HEADERS -${CMAKE_CURRENT_LIST_DIR}/RimSummaryPlot.h -) - -source_group( "ProjectDataModel\\Summary" FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake ) +source_group( + "ProjectDataModel\\Summary" + FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} + ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake) diff --git a/ApplicationLibCode/ProjectDataModel/Surfaces/CMakeLists_files.cmake b/ApplicationLibCode/ProjectDataModel/Surfaces/CMakeLists_files.cmake index eedeafa11e..4a68972f81 100644 --- a/ApplicationLibCode/ProjectDataModel/Surfaces/CMakeLists_files.cmake +++ b/ApplicationLibCode/ProjectDataModel/Surfaces/CMakeLists_files.cmake @@ -1,36 +1,32 @@ +set(SOURCE_GROUP_HEADER_FILES + ${CMAKE_CURRENT_LIST_DIR}/RimSurface.h + ${CMAKE_CURRENT_LIST_DIR}/RimFileSurface.h + ${CMAKE_CURRENT_LIST_DIR}/RimGridCaseSurface.h + ${CMAKE_CURRENT_LIST_DIR}/RimSurfaceCollection.h + ${CMAKE_CURRENT_LIST_DIR}/RimSurfaceInView.h + ${CMAKE_CURRENT_LIST_DIR}/RimSurfaceInViewCollection.h + ${CMAKE_CURRENT_LIST_DIR}/RimSurfaceResultDefinition.h + ${CMAKE_CURRENT_LIST_DIR}/RimEnsembleSurface.h + ${CMAKE_CURRENT_LIST_DIR}/RimEnsembleSurfaceInView.h + ${CMAKE_CURRENT_LIST_DIR}/RimEnsembleStatisticsSurface.h) -set (SOURCE_GROUP_HEADER_FILES -${CMAKE_CURRENT_LIST_DIR}/RimSurface.h -${CMAKE_CURRENT_LIST_DIR}/RimFileSurface.h -${CMAKE_CURRENT_LIST_DIR}/RimGridCaseSurface.h -${CMAKE_CURRENT_LIST_DIR}/RimSurfaceCollection.h -${CMAKE_CURRENT_LIST_DIR}/RimSurfaceInView.h -${CMAKE_CURRENT_LIST_DIR}/RimSurfaceInViewCollection.h -${CMAKE_CURRENT_LIST_DIR}/RimSurfaceResultDefinition.h -${CMAKE_CURRENT_LIST_DIR}/RimEnsembleSurface.h -${CMAKE_CURRENT_LIST_DIR}/RimEnsembleSurfaceInView.h -${CMAKE_CURRENT_LIST_DIR}/RimEnsembleStatisticsSurface.h -) +set(SOURCE_GROUP_SOURCE_FILES + ${CMAKE_CURRENT_LIST_DIR}/RimSurface.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimFileSurface.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimGridCaseSurface.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimSurfaceCollection.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimSurfaceInView.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimSurfaceInViewCollection.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimSurfaceResultDefinition.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimEnsembleSurface.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimEnsembleSurfaceInView.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimEnsembleStatisticsSurface.cpp) -set (SOURCE_GROUP_SOURCE_FILES -${CMAKE_CURRENT_LIST_DIR}/RimSurface.cpp -${CMAKE_CURRENT_LIST_DIR}/RimFileSurface.cpp -${CMAKE_CURRENT_LIST_DIR}/RimGridCaseSurface.cpp -${CMAKE_CURRENT_LIST_DIR}/RimSurfaceCollection.cpp -${CMAKE_CURRENT_LIST_DIR}/RimSurfaceInView.cpp -${CMAKE_CURRENT_LIST_DIR}/RimSurfaceInViewCollection.cpp -${CMAKE_CURRENT_LIST_DIR}/RimSurfaceResultDefinition.cpp -${CMAKE_CURRENT_LIST_DIR}/RimEnsembleSurface.cpp -${CMAKE_CURRENT_LIST_DIR}/RimEnsembleSurfaceInView.cpp -${CMAKE_CURRENT_LIST_DIR}/RimEnsembleStatisticsSurface.cpp -) +list(APPEND CODE_HEADER_FILES ${SOURCE_GROUP_HEADER_FILES}) -list(APPEND CODE_HEADER_FILES -${SOURCE_GROUP_HEADER_FILES} -) +list(APPEND CODE_SOURCE_FILES ${SOURCE_GROUP_SOURCE_FILES}) -list(APPEND CODE_SOURCE_FILES -${SOURCE_GROUP_SOURCE_FILES} -) - -source_group( "ProjectDataModel\\Surface" FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake ) +source_group( + "ProjectDataModel\\Surface" + FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} + ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake) diff --git a/ApplicationLibCode/ProjectDataModel/WellLog/CMakeLists_files.cmake b/ApplicationLibCode/ProjectDataModel/WellLog/CMakeLists_files.cmake index fe9ee60f2b..700caf1597 100644 --- a/ApplicationLibCode/ProjectDataModel/WellLog/CMakeLists_files.cmake +++ b/ApplicationLibCode/ProjectDataModel/WellLog/CMakeLists_files.cmake @@ -1,64 +1,60 @@ +set(SOURCE_GROUP_HEADER_FILES + ${CMAKE_CURRENT_LIST_DIR}/Rim3dWellLogCurve.h + ${CMAKE_CURRENT_LIST_DIR}/Rim3dWellLogFileCurve.h + ${CMAKE_CURRENT_LIST_DIR}/Rim3dWellLogExtractionCurve.h + ${CMAKE_CURRENT_LIST_DIR}/Rim3dWellLogRftCurve.h + ${CMAKE_CURRENT_LIST_DIR}/RimWellLogPlotNameConfig.h + ${CMAKE_CURRENT_LIST_DIR}/RimWellLogExtractionCurveNameConfig.h + ${CMAKE_CURRENT_LIST_DIR}/RimWellLogFileCurveNameConfig.h + ${CMAKE_CURRENT_LIST_DIR}/RimWellLogRftCurveNameConfig.h + ${CMAKE_CURRENT_LIST_DIR}/RimWellLogCurveCommonDataSource.h + ${CMAKE_CURRENT_LIST_DIR}/RimEnsembleWellLogs.h + ${CMAKE_CURRENT_LIST_DIR}/RimEnsembleWellLogsCollection.h + ${CMAKE_CURRENT_LIST_DIR}/RimEnsembleWellLogCurveSet.h + ${CMAKE_CURRENT_LIST_DIR}/RimEnsembleWellLogStatistics.h + ${CMAKE_CURRENT_LIST_DIR}/RimEnsembleWellLogStatisticsCurve.h + ${CMAKE_CURRENT_LIST_DIR}/RimWellLogPlotCollection.h + ${CMAKE_CURRENT_LIST_DIR}/RimWellLogPlot.h + ${CMAKE_CURRENT_LIST_DIR}/RimWellLogTrack.h + ${CMAKE_CURRENT_LIST_DIR}/RimWellLogCurve.h + ${CMAKE_CURRENT_LIST_DIR}/RimWellLogExtractionCurve.h + ${CMAKE_CURRENT_LIST_DIR}/RimWellLogFile.h + ${CMAKE_CURRENT_LIST_DIR}/RimWellLogFileChannel.h + ${CMAKE_CURRENT_LIST_DIR}/RimWellLogFileCurve.h + ${CMAKE_CURRENT_LIST_DIR}/RimWellLogRftCurve.h + ${CMAKE_CURRENT_LIST_DIR}/RimWellLogWbsCurve.h) -set (SOURCE_GROUP_HEADER_FILES -${CMAKE_CURRENT_LIST_DIR}/Rim3dWellLogCurve.h -${CMAKE_CURRENT_LIST_DIR}/Rim3dWellLogFileCurve.h -${CMAKE_CURRENT_LIST_DIR}/Rim3dWellLogExtractionCurve.h -${CMAKE_CURRENT_LIST_DIR}/Rim3dWellLogRftCurve.h -${CMAKE_CURRENT_LIST_DIR}/RimWellLogPlotNameConfig.h -${CMAKE_CURRENT_LIST_DIR}/RimWellLogExtractionCurveNameConfig.h -${CMAKE_CURRENT_LIST_DIR}/RimWellLogFileCurveNameConfig.h -${CMAKE_CURRENT_LIST_DIR}/RimWellLogRftCurveNameConfig.h -${CMAKE_CURRENT_LIST_DIR}/RimWellLogCurveCommonDataSource.h -${CMAKE_CURRENT_LIST_DIR}/RimEnsembleWellLogs.h -${CMAKE_CURRENT_LIST_DIR}/RimEnsembleWellLogsCollection.h -${CMAKE_CURRENT_LIST_DIR}/RimEnsembleWellLogCurveSet.h -${CMAKE_CURRENT_LIST_DIR}/RimEnsembleWellLogStatistics.h -${CMAKE_CURRENT_LIST_DIR}/RimEnsembleWellLogStatisticsCurve.h -${CMAKE_CURRENT_LIST_DIR}/RimWellLogPlotCollection.h -${CMAKE_CURRENT_LIST_DIR}/RimWellLogPlot.h -${CMAKE_CURRENT_LIST_DIR}/RimWellLogTrack.h -${CMAKE_CURRENT_LIST_DIR}/RimWellLogCurve.h -${CMAKE_CURRENT_LIST_DIR}/RimWellLogExtractionCurve.h -${CMAKE_CURRENT_LIST_DIR}/RimWellLogFile.h -${CMAKE_CURRENT_LIST_DIR}/RimWellLogFileChannel.h -${CMAKE_CURRENT_LIST_DIR}/RimWellLogFileCurve.h -${CMAKE_CURRENT_LIST_DIR}/RimWellLogRftCurve.h -${CMAKE_CURRENT_LIST_DIR}/RimWellLogWbsCurve.h -) +set(SOURCE_GROUP_SOURCE_FILES + ${CMAKE_CURRENT_LIST_DIR}/RimWellLogPlotCollection.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimWellLogPlot.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimWellLogTrack.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimWellLogCurve.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimWellLogExtractionCurve.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimWellLogFile.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimWellLogFileChannel.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimWellLogFileCurve.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimWellLogRftCurve.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimWellLogWbsCurve.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimWellLogPlotNameConfig.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimWellLogExtractionCurveNameConfig.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimWellLogFileCurveNameConfig.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimWellLogRftCurveNameConfig.cpp + ${CMAKE_CURRENT_LIST_DIR}/Rim3dWellLogCurve.cpp + ${CMAKE_CURRENT_LIST_DIR}/Rim3dWellLogFileCurve.cpp + ${CMAKE_CURRENT_LIST_DIR}/Rim3dWellLogExtractionCurve.cpp + ${CMAKE_CURRENT_LIST_DIR}/Rim3dWellLogRftCurve.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimWellLogCurveCommonDataSource.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimEnsembleWellLogs.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimEnsembleWellLogsCollection.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimEnsembleWellLogCurveSet.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimEnsembleWellLogStatistics.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimEnsembleWellLogStatisticsCurve.cpp) -set (SOURCE_GROUP_SOURCE_FILES -${CMAKE_CURRENT_LIST_DIR}/RimWellLogPlotCollection.cpp -${CMAKE_CURRENT_LIST_DIR}/RimWellLogPlot.cpp -${CMAKE_CURRENT_LIST_DIR}/RimWellLogTrack.cpp -${CMAKE_CURRENT_LIST_DIR}/RimWellLogCurve.cpp -${CMAKE_CURRENT_LIST_DIR}/RimWellLogExtractionCurve.cpp -${CMAKE_CURRENT_LIST_DIR}/RimWellLogFile.cpp -${CMAKE_CURRENT_LIST_DIR}/RimWellLogFileChannel.cpp -${CMAKE_CURRENT_LIST_DIR}/RimWellLogFileCurve.cpp -${CMAKE_CURRENT_LIST_DIR}/RimWellLogRftCurve.cpp -${CMAKE_CURRENT_LIST_DIR}/RimWellLogWbsCurve.cpp -${CMAKE_CURRENT_LIST_DIR}/RimWellLogPlotNameConfig.cpp -${CMAKE_CURRENT_LIST_DIR}/RimWellLogExtractionCurveNameConfig.cpp -${CMAKE_CURRENT_LIST_DIR}/RimWellLogFileCurveNameConfig.cpp -${CMAKE_CURRENT_LIST_DIR}/RimWellLogRftCurveNameConfig.cpp -${CMAKE_CURRENT_LIST_DIR}/Rim3dWellLogCurve.cpp -${CMAKE_CURRENT_LIST_DIR}/Rim3dWellLogFileCurve.cpp -${CMAKE_CURRENT_LIST_DIR}/Rim3dWellLogExtractionCurve.cpp -${CMAKE_CURRENT_LIST_DIR}/Rim3dWellLogRftCurve.cpp -${CMAKE_CURRENT_LIST_DIR}/RimWellLogCurveCommonDataSource.cpp -${CMAKE_CURRENT_LIST_DIR}/RimEnsembleWellLogs.cpp -${CMAKE_CURRENT_LIST_DIR}/RimEnsembleWellLogsCollection.cpp -${CMAKE_CURRENT_LIST_DIR}/RimEnsembleWellLogCurveSet.cpp -${CMAKE_CURRENT_LIST_DIR}/RimEnsembleWellLogStatistics.cpp -${CMAKE_CURRENT_LIST_DIR}/RimEnsembleWellLogStatisticsCurve.cpp -) +list(APPEND CODE_HEADER_FILES ${SOURCE_GROUP_HEADER_FILES}) -list(APPEND CODE_HEADER_FILES -${SOURCE_GROUP_HEADER_FILES} -) +list(APPEND CODE_SOURCE_FILES ${SOURCE_GROUP_SOURCE_FILES}) -list(APPEND CODE_SOURCE_FILES -${SOURCE_GROUP_SOURCE_FILES} -) - -source_group( "ProjectDataModel\\WellLog" FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake ) +source_group( + "ProjectDataModel\\WellLog" + FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} + ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake) diff --git a/ApplicationLibCode/ProjectDataModel/WellMeasurement/CMakeLists_files.cmake b/ApplicationLibCode/ProjectDataModel/WellMeasurement/CMakeLists_files.cmake index d6e0f692a3..c09e374409 100644 --- a/ApplicationLibCode/ProjectDataModel/WellMeasurement/CMakeLists_files.cmake +++ b/ApplicationLibCode/ProjectDataModel/WellMeasurement/CMakeLists_files.cmake @@ -1,30 +1,26 @@ +set(SOURCE_GROUP_HEADER_FILES + ${CMAKE_CURRENT_LIST_DIR}/RimWellMeasurement.h + ${CMAKE_CURRENT_LIST_DIR}/RimWellMeasurementCollection.h + ${CMAKE_CURRENT_LIST_DIR}/RimWellMeasurementFilePath.h + ${CMAKE_CURRENT_LIST_DIR}/RimWellMeasurementCurve.h + ${CMAKE_CURRENT_LIST_DIR}/RimWellMeasurementFilter.h + ${CMAKE_CURRENT_LIST_DIR}/RimWellMeasurementInViewCollection.h + ${CMAKE_CURRENT_LIST_DIR}/RimWellMeasurementInView.h) -set (SOURCE_GROUP_HEADER_FILES -${CMAKE_CURRENT_LIST_DIR}/RimWellMeasurement.h -${CMAKE_CURRENT_LIST_DIR}/RimWellMeasurementCollection.h -${CMAKE_CURRENT_LIST_DIR}/RimWellMeasurementFilePath.h -${CMAKE_CURRENT_LIST_DIR}/RimWellMeasurementCurve.h -${CMAKE_CURRENT_LIST_DIR}/RimWellMeasurementFilter.h -${CMAKE_CURRENT_LIST_DIR}/RimWellMeasurementInViewCollection.h -${CMAKE_CURRENT_LIST_DIR}/RimWellMeasurementInView.h -) +set(SOURCE_GROUP_SOURCE_FILES + ${CMAKE_CURRENT_LIST_DIR}/RimWellMeasurement.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimWellMeasurementCollection.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimWellMeasurementFilePath.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimWellMeasurementCurve.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimWellMeasurementFilter.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimWellMeasurementInViewCollection.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimWellMeasurementInView.cpp) -set (SOURCE_GROUP_SOURCE_FILES -${CMAKE_CURRENT_LIST_DIR}/RimWellMeasurement.cpp -${CMAKE_CURRENT_LIST_DIR}/RimWellMeasurementCollection.cpp -${CMAKE_CURRENT_LIST_DIR}/RimWellMeasurementFilePath.cpp -${CMAKE_CURRENT_LIST_DIR}/RimWellMeasurementCurve.cpp -${CMAKE_CURRENT_LIST_DIR}/RimWellMeasurementFilter.cpp -${CMAKE_CURRENT_LIST_DIR}/RimWellMeasurementInViewCollection.cpp -${CMAKE_CURRENT_LIST_DIR}/RimWellMeasurementInView.cpp -) +list(APPEND CODE_HEADER_FILES ${SOURCE_GROUP_HEADER_FILES}) -list(APPEND CODE_HEADER_FILES -${SOURCE_GROUP_HEADER_FILES} -) +list(APPEND CODE_SOURCE_FILES ${SOURCE_GROUP_SOURCE_FILES}) -list(APPEND CODE_SOURCE_FILES -${SOURCE_GROUP_SOURCE_FILES} -) - -source_group( "ProjectDataModel\\WellMeasurement" FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake ) +source_group( + "ProjectDataModel\\WellMeasurement" + FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} + ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake) diff --git a/ApplicationLibCode/ProjectDataModel/WellPath/CMakeLists_files.cmake b/ApplicationLibCode/ProjectDataModel/WellPath/CMakeLists_files.cmake index 16360e5e0c..a9cf725ac1 100644 --- a/ApplicationLibCode/ProjectDataModel/WellPath/CMakeLists_files.cmake +++ b/ApplicationLibCode/ProjectDataModel/WellPath/CMakeLists_files.cmake @@ -1,38 +1,34 @@ +set(SOURCE_GROUP_HEADER_FILES + ${CMAKE_CURRENT_LIST_DIR}/RimWellPath.h + ${CMAKE_CURRENT_LIST_DIR}/RimWellPathGroup.h + ${CMAKE_CURRENT_LIST_DIR}/RimFileWellPath.h + ${CMAKE_CURRENT_LIST_DIR}/RimModeledWellPath.h + ${CMAKE_CURRENT_LIST_DIR}/RimWellPathGeometryDef.h + ${CMAKE_CURRENT_LIST_DIR}/RimWellPathGeometryDefTools.h + ${CMAKE_CURRENT_LIST_DIR}/RimWellPathAttribute.h + ${CMAKE_CURRENT_LIST_DIR}/RimWellPathAttributeCollection.h + ${CMAKE_CURRENT_LIST_DIR}/RimWellPathCollection.h + ${CMAKE_CURRENT_LIST_DIR}/RimWellPathTarget.h + ${CMAKE_CURRENT_LIST_DIR}/RimWellPathTieIn.h) -set (SOURCE_GROUP_HEADER_FILES -${CMAKE_CURRENT_LIST_DIR}/RimWellPath.h -${CMAKE_CURRENT_LIST_DIR}/RimWellPathGroup.h -${CMAKE_CURRENT_LIST_DIR}/RimFileWellPath.h -${CMAKE_CURRENT_LIST_DIR}/RimModeledWellPath.h -${CMAKE_CURRENT_LIST_DIR}/RimWellPathGeometryDef.h -${CMAKE_CURRENT_LIST_DIR}/RimWellPathGeometryDefTools.h -${CMAKE_CURRENT_LIST_DIR}/RimWellPathAttribute.h -${CMAKE_CURRENT_LIST_DIR}/RimWellPathAttributeCollection.h -${CMAKE_CURRENT_LIST_DIR}/RimWellPathCollection.h -${CMAKE_CURRENT_LIST_DIR}/RimWellPathTarget.h -${CMAKE_CURRENT_LIST_DIR}/RimWellPathTieIn.h -) +set(SOURCE_GROUP_SOURCE_FILES + ${CMAKE_CURRENT_LIST_DIR}/RimFileWellPath.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimModeledWellPath.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimWellPath.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimWellPathAttribute.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimWellPathAttributeCollection.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimWellPathCollection.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimWellPathGeometryDef.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimWellPathGeometryDefTools.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimWellPathGroup.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimWellPathTarget.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimWellPathTieIn.cpp) -set (SOURCE_GROUP_SOURCE_FILES -${CMAKE_CURRENT_LIST_DIR}/RimFileWellPath.cpp -${CMAKE_CURRENT_LIST_DIR}/RimModeledWellPath.cpp -${CMAKE_CURRENT_LIST_DIR}/RimWellPath.cpp -${CMAKE_CURRENT_LIST_DIR}/RimWellPathAttribute.cpp -${CMAKE_CURRENT_LIST_DIR}/RimWellPathAttributeCollection.cpp -${CMAKE_CURRENT_LIST_DIR}/RimWellPathCollection.cpp -${CMAKE_CURRENT_LIST_DIR}/RimWellPathGeometryDef.cpp -${CMAKE_CURRENT_LIST_DIR}/RimWellPathGeometryDefTools.cpp -${CMAKE_CURRENT_LIST_DIR}/RimWellPathGroup.cpp -${CMAKE_CURRENT_LIST_DIR}/RimWellPathTarget.cpp -${CMAKE_CURRENT_LIST_DIR}/RimWellPathTieIn.cpp -) +list(APPEND CODE_HEADER_FILES ${SOURCE_GROUP_HEADER_FILES}) -list(APPEND CODE_HEADER_FILES -${SOURCE_GROUP_HEADER_FILES} -) +list(APPEND CODE_SOURCE_FILES ${SOURCE_GROUP_SOURCE_FILES}) -list(APPEND CODE_SOURCE_FILES -${SOURCE_GROUP_SOURCE_FILES} -) - -source_group( "ProjectDataModel\\WellPath" FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake ) +source_group( + "ProjectDataModel\\WellPath" + FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} + ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake) diff --git a/ApplicationLibCode/ProjectDataModelCommands/CMakeLists_files.cmake b/ApplicationLibCode/ProjectDataModelCommands/CMakeLists_files.cmake index d340eae577..a2df2997b0 100644 --- a/ApplicationLibCode/ProjectDataModelCommands/CMakeLists_files.cmake +++ b/ApplicationLibCode/ProjectDataModelCommands/CMakeLists_files.cmake @@ -1,54 +1,50 @@ +set(SOURCE_GROUP_HEADER_FILES + ${CMAKE_CURRENT_LIST_DIR}/RimcSummaryPlotCollection.h + ${CMAKE_CURRENT_LIST_DIR}/RimcSummaryCase.h + ${CMAKE_CURRENT_LIST_DIR}/RimcSummaryResampleData.h + ${CMAKE_CURRENT_LIST_DIR}/RimcProject.h + ${CMAKE_CURRENT_LIST_DIR}/RimcElasticProperties.h + ${CMAKE_CURRENT_LIST_DIR}/RimcStimPlanModelCollection.h + ${CMAKE_CURRENT_LIST_DIR}/RimcStimPlanModelTemplateCollection.h + ${CMAKE_CURRENT_LIST_DIR}/RimcStimPlanModelPlotCollection.h + ${CMAKE_CURRENT_LIST_DIR}/RimcStimPlanModel.h + ${CMAKE_CURRENT_LIST_DIR}/RimcSurfaceCollection.h + ${CMAKE_CURRENT_LIST_DIR}/RimcSurface.h + ${CMAKE_CURRENT_LIST_DIR}/RimcDataContainerDouble.h + ${CMAKE_CURRENT_LIST_DIR}/RimcDataContainerString.h + ${CMAKE_CURRENT_LIST_DIR}/RimcDataContainerTime.h + ${CMAKE_CURRENT_LIST_DIR}/RimcWellLogPlotCollection.h + ${CMAKE_CURRENT_LIST_DIR}/RimcWellLogPlot.h + ${CMAKE_CURRENT_LIST_DIR}/RimcWellLogTrack.h + ${CMAKE_CURRENT_LIST_DIR}/RimcWellPathGeometryDef.h + ${CMAKE_CURRENT_LIST_DIR}/RimcModeledWellPath.h) -set (SOURCE_GROUP_HEADER_FILES -${CMAKE_CURRENT_LIST_DIR}/RimcSummaryPlotCollection.h -${CMAKE_CURRENT_LIST_DIR}/RimcSummaryCase.h -${CMAKE_CURRENT_LIST_DIR}/RimcSummaryResampleData.h -${CMAKE_CURRENT_LIST_DIR}/RimcProject.h -${CMAKE_CURRENT_LIST_DIR}/RimcElasticProperties.h -${CMAKE_CURRENT_LIST_DIR}/RimcStimPlanModelCollection.h -${CMAKE_CURRENT_LIST_DIR}/RimcStimPlanModelTemplateCollection.h -${CMAKE_CURRENT_LIST_DIR}/RimcStimPlanModelPlotCollection.h -${CMAKE_CURRENT_LIST_DIR}/RimcStimPlanModel.h -${CMAKE_CURRENT_LIST_DIR}/RimcSurfaceCollection.h -${CMAKE_CURRENT_LIST_DIR}/RimcSurface.h -${CMAKE_CURRENT_LIST_DIR}/RimcDataContainerDouble.h -${CMAKE_CURRENT_LIST_DIR}/RimcDataContainerString.h -${CMAKE_CURRENT_LIST_DIR}/RimcDataContainerTime.h -${CMAKE_CURRENT_LIST_DIR}/RimcWellLogPlotCollection.h -${CMAKE_CURRENT_LIST_DIR}/RimcWellLogPlot.h -${CMAKE_CURRENT_LIST_DIR}/RimcWellLogTrack.h -${CMAKE_CURRENT_LIST_DIR}/RimcWellPathGeometryDef.h -${CMAKE_CURRENT_LIST_DIR}/RimcModeledWellPath.h -) +set(SOURCE_GROUP_SOURCE_FILES + ${CMAKE_CURRENT_LIST_DIR}/RimcSummaryPlotCollection.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimcSummaryCase.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimcSummaryResampleData.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimcProject.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimcElasticProperties.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimcStimPlanModelCollection.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimcStimPlanModelTemplateCollection.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimcStimPlanModelPlotCollection.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimcStimPlanModel.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimcSurfaceCollection.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimcSurface.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimcDataContainerDouble.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimcDataContainerString.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimcDataContainerTime.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimcWellLogPlotCollection.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimcWellLogPlot.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimcWellLogTrack.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimcWellPathGeometryDef.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimcModeledWellPath.cpp) -set (SOURCE_GROUP_SOURCE_FILES -${CMAKE_CURRENT_LIST_DIR}/RimcSummaryPlotCollection.cpp -${CMAKE_CURRENT_LIST_DIR}/RimcSummaryCase.cpp -${CMAKE_CURRENT_LIST_DIR}/RimcSummaryResampleData.cpp -${CMAKE_CURRENT_LIST_DIR}/RimcProject.cpp -${CMAKE_CURRENT_LIST_DIR}/RimcElasticProperties.cpp -${CMAKE_CURRENT_LIST_DIR}/RimcStimPlanModelCollection.cpp -${CMAKE_CURRENT_LIST_DIR}/RimcStimPlanModelTemplateCollection.cpp -${CMAKE_CURRENT_LIST_DIR}/RimcStimPlanModelPlotCollection.cpp -${CMAKE_CURRENT_LIST_DIR}/RimcStimPlanModel.cpp -${CMAKE_CURRENT_LIST_DIR}/RimcSurfaceCollection.cpp -${CMAKE_CURRENT_LIST_DIR}/RimcSurface.cpp -${CMAKE_CURRENT_LIST_DIR}/RimcDataContainerDouble.cpp -${CMAKE_CURRENT_LIST_DIR}/RimcDataContainerString.cpp -${CMAKE_CURRENT_LIST_DIR}/RimcDataContainerTime.cpp -${CMAKE_CURRENT_LIST_DIR}/RimcWellLogPlotCollection.cpp -${CMAKE_CURRENT_LIST_DIR}/RimcWellLogPlot.cpp -${CMAKE_CURRENT_LIST_DIR}/RimcWellLogTrack.cpp -${CMAKE_CURRENT_LIST_DIR}/RimcWellPathGeometryDef.cpp -${CMAKE_CURRENT_LIST_DIR}/RimcModeledWellPath.cpp -) +list(APPEND CODE_HEADER_FILES ${SOURCE_GROUP_HEADER_FILES}) -list(APPEND CODE_HEADER_FILES -${SOURCE_GROUP_HEADER_FILES} -) +list(APPEND CODE_SOURCE_FILES ${SOURCE_GROUP_SOURCE_FILES}) -list(APPEND CODE_SOURCE_FILES -${SOURCE_GROUP_SOURCE_FILES} -) - -source_group( "ProjectDataModelCommands" FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake ) +source_group( + "ProjectDataModelCommands" + FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} + ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake) diff --git a/ApplicationLibCode/ProjectDataModelCommands/CommandRouter/CMakeLists_files.cmake b/ApplicationLibCode/ProjectDataModelCommands/CommandRouter/CMakeLists_files.cmake index a086f2fcf7..7e8524ddaa 100644 --- a/ApplicationLibCode/ProjectDataModelCommands/CommandRouter/CMakeLists_files.cmake +++ b/ApplicationLibCode/ProjectDataModelCommands/CommandRouter/CMakeLists_files.cmake @@ -1,20 +1,14 @@ +set(SOURCE_GROUP_HEADER_FILES ${CMAKE_CURRENT_LIST_DIR}/RimCommandRouter.h + ${CMAKE_CURRENT_LIST_DIR}/RimcExtractSurfaces.h) -set (SOURCE_GROUP_HEADER_FILES -${CMAKE_CURRENT_LIST_DIR}/RimCommandRouter.h -${CMAKE_CURRENT_LIST_DIR}/RimcExtractSurfaces.h -) +set(SOURCE_GROUP_SOURCE_FILES ${CMAKE_CURRENT_LIST_DIR}/RimCommandRouter.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimcExtractSurfaces.cpp) -set (SOURCE_GROUP_SOURCE_FILES -${CMAKE_CURRENT_LIST_DIR}/RimCommandRouter.cpp -${CMAKE_CURRENT_LIST_DIR}/RimcExtractSurfaces.cpp -) +list(APPEND CODE_HEADER_FILES ${SOURCE_GROUP_HEADER_FILES}) -list(APPEND CODE_HEADER_FILES -${SOURCE_GROUP_HEADER_FILES} -) +list(APPEND CODE_SOURCE_FILES ${SOURCE_GROUP_SOURCE_FILES}) -list(APPEND CODE_SOURCE_FILES -${SOURCE_GROUP_SOURCE_FILES} -) - -source_group( "ProjectDataModelCommands\\CommandRouter" FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake ) +source_group( + "ProjectDataModelCommands\\CommandRouter" + FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} + ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake) diff --git a/ApplicationLibCode/ReservoirDataModel/CMakeLists_files.cmake b/ApplicationLibCode/ReservoirDataModel/CMakeLists_files.cmake index 52ee882db0..e10469bd8f 100644 --- a/ApplicationLibCode/ReservoirDataModel/CMakeLists_files.cmake +++ b/ApplicationLibCode/ReservoirDataModel/CMakeLists_files.cmake @@ -1,192 +1,187 @@ +set(SOURCE_GROUP_HEADER_FILES + ${CMAKE_CURRENT_LIST_DIR}/RigActiveCellInfo.h + ${CMAKE_CURRENT_LIST_DIR}/RigCell.h + ${CMAKE_CURRENT_LIST_DIR}/RigEclipseCaseData.h + ${CMAKE_CURRENT_LIST_DIR}/RigGridBase.h + ${CMAKE_CURRENT_LIST_DIR}/RigGridManager.h + ${CMAKE_CURRENT_LIST_DIR}/RigResultAccessor.h + ${CMAKE_CURRENT_LIST_DIR}/RigResultAccessorFactory.h + ${CMAKE_CURRENT_LIST_DIR}/RigAllGridCellsResultAccessor.h + ${CMAKE_CURRENT_LIST_DIR}/RigActiveCellsResultAccessor.h + ${CMAKE_CURRENT_LIST_DIR}/RigCellEdgeResultAccessor.h + ${CMAKE_CURRENT_LIST_DIR}/RigCellGeometryTools.h + ${CMAKE_CURRENT_LIST_DIR}/RigCombTransResultAccessor.h + ${CMAKE_CURRENT_LIST_DIR}/RigCombMultResultAccessor.h + ${CMAKE_CURRENT_LIST_DIR}/RigResultModifier.h + ${CMAKE_CURRENT_LIST_DIR}/RigResultModifierFactory.h + ${CMAKE_CURRENT_LIST_DIR}/RigFormationNames.h + ${CMAKE_CURRENT_LIST_DIR}/RigAllanDiagramData.h + ${CMAKE_CURRENT_LIST_DIR}/RigFlowDiagResultAddress.h + ${CMAKE_CURRENT_LIST_DIR}/RigFlowDiagResults.h + ${CMAKE_CURRENT_LIST_DIR}/RigFlowDiagResultFrames.h + ${CMAKE_CURRENT_LIST_DIR}/RigFlowDiagSolverInterface.h + ${CMAKE_CURRENT_LIST_DIR}/RigFlowDiagInterfaceTools.h + ${CMAKE_CURRENT_LIST_DIR}/RigFlowDiagStatCalc.h + ${CMAKE_CURRENT_LIST_DIR}/RigFlowDiagVisibleCellsStatCalc.h + ${CMAKE_CURRENT_LIST_DIR}/RigAccWellFlowCalculator.h + ${CMAKE_CURRENT_LIST_DIR}/RigWellLogExtractor.h + ${CMAKE_CURRENT_LIST_DIR}/RigEclipseWellLogExtractor.h + ${CMAKE_CURRENT_LIST_DIR}/RigLocalGrid.h + ${CMAKE_CURRENT_LIST_DIR}/RigMainGrid.h + ${CMAKE_CURRENT_LIST_DIR}/RigReservoirBuilderMock.h + ${CMAKE_CURRENT_LIST_DIR}/RigCaseCellResultsData.h + ${CMAKE_CURRENT_LIST_DIR}/RigSimWellData.h + ${CMAKE_CURRENT_LIST_DIR}/RigWellPath.h + ${CMAKE_CURRENT_LIST_DIR}/RigFault.h + ${CMAKE_CURRENT_LIST_DIR}/RigNNCData.h + ${CMAKE_CURRENT_LIST_DIR}/cvfGeometryTools.h + ${CMAKE_CURRENT_LIST_DIR}/cvfGeometryTools.inl + ${CMAKE_CURRENT_LIST_DIR}/RigPipeInCellEvaluator.h + ${CMAKE_CURRENT_LIST_DIR}/RigTernaryResultAccessor.h + ${CMAKE_CURRENT_LIST_DIR}/RigEclipseNativeStatCalc.h + ${CMAKE_CURRENT_LIST_DIR}/RigEclipseNativeVisibleCellsStatCalc.h + ${CMAKE_CURRENT_LIST_DIR}/RigEclipseMultiPropertyStatCalc.h + ${CMAKE_CURRENT_LIST_DIR}/RigWellLogCurveData.h + ${CMAKE_CURRENT_LIST_DIR}/RigWellLogExtractionTools.h + ${CMAKE_CURRENT_LIST_DIR}/RigHexIntersectionTools.h + ${CMAKE_CURRENT_LIST_DIR}/RigTimeHistoryResultAccessor.h + ${CMAKE_CURRENT_LIST_DIR}/RigLasFileExporter.h + ${CMAKE_CURRENT_LIST_DIR}/RigSimulationWellCoordsAndMD.h + ${CMAKE_CURRENT_LIST_DIR}/RigFishbonesGeometry.h + ${CMAKE_CURRENT_LIST_DIR}/RigTesselatorTools.h + ${CMAKE_CURRENT_LIST_DIR}/RigCellGeometryTools.h + ${CMAKE_CURRENT_LIST_DIR}/RigWellPathIntersectionTools.h + ${CMAKE_CURRENT_LIST_DIR}/RigEclipseResultInfo.h + ${CMAKE_CURRENT_LIST_DIR}/RigEclipseResultAddress.h + ${CMAKE_CURRENT_LIST_DIR}/RigTofAccumulatedPhaseFractionsCalculator.h + ${CMAKE_CURRENT_LIST_DIR}/RigTofWellDistributionCalculator.h + ${CMAKE_CURRENT_LIST_DIR}/RigTransmissibilityEquations.h + ${CMAKE_CURRENT_LIST_DIR}/RigNumberOfFloodedPoreVolumesCalculator.h + ${CMAKE_CURRENT_LIST_DIR}/RigWeightedMeanCalc.h + ${CMAKE_CURRENT_LIST_DIR}/RigWellPathFormations.h + ${CMAKE_CURRENT_LIST_DIR}/RigStimPlanFractureDefinition.h + ${CMAKE_CURRENT_LIST_DIR}/RigFractureGrid.h + ${CMAKE_CURRENT_LIST_DIR}/RigFractureCell.h + ${CMAKE_CURRENT_LIST_DIR}/RigWellResultPoint.h + ${CMAKE_CURRENT_LIST_DIR}/RigWellPathGeometryTools.h + ${CMAKE_CURRENT_LIST_DIR}/RigWellPathGeometryExporter.h + ${CMAKE_CURRENT_LIST_DIR}/RigSurface.h + ${CMAKE_CURRENT_LIST_DIR}/RigCaseRealizationParameters.h + ${CMAKE_CURRENT_LIST_DIR}/RigGeoMechBoreHoleStressCalculator.h + ${CMAKE_CURRENT_LIST_DIR}/RigPolyLinesData.h + ${CMAKE_CURRENT_LIST_DIR}/RigCaseCellResultCalculator.h + ${CMAKE_CURRENT_LIST_DIR}/RigGridCrossPlotCurveGrouping.h + ${CMAKE_CURRENT_LIST_DIR}/RigEclipseCrossPlotDataExtractor.h + ${CMAKE_CURRENT_LIST_DIR}/RigEquil.h + ${CMAKE_CURRENT_LIST_DIR}/RigWbsParameter.h + ${CMAKE_CURRENT_LIST_DIR}/RigEclipseAllanFaultsStatCalc.h + ${CMAKE_CURRENT_LIST_DIR}/RigCellFaceGeometryTools.h + ${CMAKE_CURRENT_LIST_DIR}/RigNncConnection.h + ${CMAKE_CURRENT_LIST_DIR}/RigWellDiskData.h + ${CMAKE_CURRENT_LIST_DIR}/RigGocadData.h + ${CMAKE_CURRENT_LIST_DIR}/RigElasticProperties.h + ${CMAKE_CURRENT_LIST_DIR}/RigEnsembleFractureStatisticsCalculator.h + ${CMAKE_CURRENT_LIST_DIR}/RigHistogramData.h + ${CMAKE_CURRENT_LIST_DIR}/RigVisibleCategoriesCalculator.h + ${CMAKE_CURRENT_LIST_DIR}/RigTracerPoint.h + ${CMAKE_CURRENT_LIST_DIR}/RigTracer.h + ${CMAKE_CURRENT_LIST_DIR}/RigStimPlanModelTools.h + ${CMAKE_CURRENT_LIST_DIR}/RigSlice2D.h + ${CMAKE_CURRENT_LIST_DIR}/RigEnsembleParameter.h + ${CMAKE_CURRENT_LIST_DIR}/RigSurfaceResampler.h + ${CMAKE_CURRENT_LIST_DIR}/RigSurfaceStatisticsCalculator.h) -set (SOURCE_GROUP_HEADER_FILES -${CMAKE_CURRENT_LIST_DIR}/RigActiveCellInfo.h -${CMAKE_CURRENT_LIST_DIR}/RigCell.h -${CMAKE_CURRENT_LIST_DIR}/RigEclipseCaseData.h -${CMAKE_CURRENT_LIST_DIR}/RigGridBase.h -${CMAKE_CURRENT_LIST_DIR}/RigGridManager.h -${CMAKE_CURRENT_LIST_DIR}/RigResultAccessor.h -${CMAKE_CURRENT_LIST_DIR}/RigResultAccessorFactory.h -${CMAKE_CURRENT_LIST_DIR}/RigAllGridCellsResultAccessor.h -${CMAKE_CURRENT_LIST_DIR}/RigActiveCellsResultAccessor.h -${CMAKE_CURRENT_LIST_DIR}/RigCellEdgeResultAccessor.h -${CMAKE_CURRENT_LIST_DIR}/RigCellGeometryTools.h -${CMAKE_CURRENT_LIST_DIR}/RigCombTransResultAccessor.h -${CMAKE_CURRENT_LIST_DIR}/RigCombMultResultAccessor.h -${CMAKE_CURRENT_LIST_DIR}/RigResultModifier.h -${CMAKE_CURRENT_LIST_DIR}/RigResultModifierFactory.h -${CMAKE_CURRENT_LIST_DIR}/RigFormationNames.h -${CMAKE_CURRENT_LIST_DIR}/RigAllanDiagramData.h -${CMAKE_CURRENT_LIST_DIR}/RigFlowDiagResultAddress.h -${CMAKE_CURRENT_LIST_DIR}/RigFlowDiagResults.h -${CMAKE_CURRENT_LIST_DIR}/RigFlowDiagResultFrames.h -${CMAKE_CURRENT_LIST_DIR}/RigFlowDiagSolverInterface.h -${CMAKE_CURRENT_LIST_DIR}/RigFlowDiagInterfaceTools.h -${CMAKE_CURRENT_LIST_DIR}/RigFlowDiagStatCalc.h -${CMAKE_CURRENT_LIST_DIR}/RigFlowDiagVisibleCellsStatCalc.h -${CMAKE_CURRENT_LIST_DIR}/RigAccWellFlowCalculator.h -${CMAKE_CURRENT_LIST_DIR}/RigWellLogExtractor.h -${CMAKE_CURRENT_LIST_DIR}/RigEclipseWellLogExtractor.h -${CMAKE_CURRENT_LIST_DIR}/RigLocalGrid.h -${CMAKE_CURRENT_LIST_DIR}/RigMainGrid.h -${CMAKE_CURRENT_LIST_DIR}/RigReservoirBuilderMock.h -${CMAKE_CURRENT_LIST_DIR}/RigCaseCellResultsData.h -${CMAKE_CURRENT_LIST_DIR}/RigSimWellData.h -${CMAKE_CURRENT_LIST_DIR}/RigWellPath.h -${CMAKE_CURRENT_LIST_DIR}/RigFault.h -${CMAKE_CURRENT_LIST_DIR}/RigNNCData.h -${CMAKE_CURRENT_LIST_DIR}/cvfGeometryTools.h -${CMAKE_CURRENT_LIST_DIR}/cvfGeometryTools.inl -${CMAKE_CURRENT_LIST_DIR}/RigPipeInCellEvaluator.h -${CMAKE_CURRENT_LIST_DIR}/RigTernaryResultAccessor.h -${CMAKE_CURRENT_LIST_DIR}/RigEclipseNativeStatCalc.h -${CMAKE_CURRENT_LIST_DIR}/RigEclipseNativeVisibleCellsStatCalc.h -${CMAKE_CURRENT_LIST_DIR}/RigEclipseMultiPropertyStatCalc.h -${CMAKE_CURRENT_LIST_DIR}/RigWellLogCurveData.h -${CMAKE_CURRENT_LIST_DIR}/RigWellLogExtractionTools.h -${CMAKE_CURRENT_LIST_DIR}/RigHexIntersectionTools.h -${CMAKE_CURRENT_LIST_DIR}/RigTimeHistoryResultAccessor.h -${CMAKE_CURRENT_LIST_DIR}/RigLasFileExporter.h -${CMAKE_CURRENT_LIST_DIR}/RigSimulationWellCoordsAndMD.h -${CMAKE_CURRENT_LIST_DIR}/RigFishbonesGeometry.h -${CMAKE_CURRENT_LIST_DIR}/RigTesselatorTools.h -${CMAKE_CURRENT_LIST_DIR}/RigCellGeometryTools.h -${CMAKE_CURRENT_LIST_DIR}/RigWellPathIntersectionTools.h -${CMAKE_CURRENT_LIST_DIR}/RigEclipseResultInfo.h -${CMAKE_CURRENT_LIST_DIR}/RigEclipseResultAddress.h -${CMAKE_CURRENT_LIST_DIR}/RigTofAccumulatedPhaseFractionsCalculator.h -${CMAKE_CURRENT_LIST_DIR}/RigTofWellDistributionCalculator.h -${CMAKE_CURRENT_LIST_DIR}/RigTransmissibilityEquations.h -${CMAKE_CURRENT_LIST_DIR}/RigNumberOfFloodedPoreVolumesCalculator.h -${CMAKE_CURRENT_LIST_DIR}/RigWeightedMeanCalc.h -${CMAKE_CURRENT_LIST_DIR}/RigWellPathFormations.h -${CMAKE_CURRENT_LIST_DIR}/RigStimPlanFractureDefinition.h -${CMAKE_CURRENT_LIST_DIR}/RigFractureGrid.h -${CMAKE_CURRENT_LIST_DIR}/RigFractureCell.h -${CMAKE_CURRENT_LIST_DIR}/RigWellResultPoint.h -${CMAKE_CURRENT_LIST_DIR}/RigWellPathGeometryTools.h -${CMAKE_CURRENT_LIST_DIR}/RigWellPathGeometryExporter.h -${CMAKE_CURRENT_LIST_DIR}/RigSurface.h -${CMAKE_CURRENT_LIST_DIR}/RigCaseRealizationParameters.h -${CMAKE_CURRENT_LIST_DIR}/RigGeoMechBoreHoleStressCalculator.h -${CMAKE_CURRENT_LIST_DIR}/RigPolyLinesData.h -${CMAKE_CURRENT_LIST_DIR}/RigCaseCellResultCalculator.h -${CMAKE_CURRENT_LIST_DIR}/RigGridCrossPlotCurveGrouping.h -${CMAKE_CURRENT_LIST_DIR}/RigEclipseCrossPlotDataExtractor.h -${CMAKE_CURRENT_LIST_DIR}/RigEquil.h -${CMAKE_CURRENT_LIST_DIR}/RigWbsParameter.h -${CMAKE_CURRENT_LIST_DIR}/RigEclipseAllanFaultsStatCalc.h -${CMAKE_CURRENT_LIST_DIR}/RigCellFaceGeometryTools.h -${CMAKE_CURRENT_LIST_DIR}/RigNncConnection.h -${CMAKE_CURRENT_LIST_DIR}/RigWellDiskData.h -${CMAKE_CURRENT_LIST_DIR}/RigGocadData.h -${CMAKE_CURRENT_LIST_DIR}/RigElasticProperties.h -${CMAKE_CURRENT_LIST_DIR}/RigEnsembleFractureStatisticsCalculator.h -${CMAKE_CURRENT_LIST_DIR}/RigHistogramData.h -${CMAKE_CURRENT_LIST_DIR}/RigVisibleCategoriesCalculator.h -${CMAKE_CURRENT_LIST_DIR}/RigTracerPoint.h -${CMAKE_CURRENT_LIST_DIR}/RigTracer.h -${CMAKE_CURRENT_LIST_DIR}/RigStimPlanModelTools.h -${CMAKE_CURRENT_LIST_DIR}/RigSlice2D.h -${CMAKE_CURRENT_LIST_DIR}/RigEnsembleParameter.h -${CMAKE_CURRENT_LIST_DIR}/RigSurfaceResampler.h -${CMAKE_CURRENT_LIST_DIR}/RigSurfaceStatisticsCalculator.h -) +set(SOURCE_GROUP_SOURCE_FILES + ${CMAKE_CURRENT_LIST_DIR}/RigActiveCellInfo.cpp + ${CMAKE_CURRENT_LIST_DIR}/RigCell.cpp + ${CMAKE_CURRENT_LIST_DIR}/RigEclipseCaseData.cpp + ${CMAKE_CURRENT_LIST_DIR}/RigGridBase.cpp + ${CMAKE_CURRENT_LIST_DIR}/RigGridManager.cpp + ${CMAKE_CURRENT_LIST_DIR}/RigResultAccessor.cpp + ${CMAKE_CURRENT_LIST_DIR}/RigResultAccessorFactory.cpp + ${CMAKE_CURRENT_LIST_DIR}/RigAllGridCellsResultAccessor.cpp + ${CMAKE_CURRENT_LIST_DIR}/RigActiveCellsResultAccessor.cpp + ${CMAKE_CURRENT_LIST_DIR}/RigCellEdgeResultAccessor.cpp + ${CMAKE_CURRENT_LIST_DIR}/RigCellGeometryTools.cpp + ${CMAKE_CURRENT_LIST_DIR}/RigCombTransResultAccessor.cpp + ${CMAKE_CURRENT_LIST_DIR}/RigCombMultResultAccessor.cpp + ${CMAKE_CURRENT_LIST_DIR}/RigResultModifierFactory.cpp + ${CMAKE_CURRENT_LIST_DIR}/RigFormationNames.cpp + ${CMAKE_CURRENT_LIST_DIR}/RigAllanDiagramData.cpp + ${CMAKE_CURRENT_LIST_DIR}/RigFlowDiagResultAddress.cpp + ${CMAKE_CURRENT_LIST_DIR}/RigFlowDiagResults.cpp + ${CMAKE_CURRENT_LIST_DIR}/RigFlowDiagResultFrames.cpp + ${CMAKE_CURRENT_LIST_DIR}/RigFlowDiagSolverInterface.cpp + ${CMAKE_CURRENT_LIST_DIR}/RigFlowDiagStatCalc.cpp + ${CMAKE_CURRENT_LIST_DIR}/RigFlowDiagVisibleCellsStatCalc.cpp + ${CMAKE_CURRENT_LIST_DIR}/RigAccWellFlowCalculator.cpp + ${CMAKE_CURRENT_LIST_DIR}/RigWellLogExtractor.cpp + ${CMAKE_CURRENT_LIST_DIR}/RigEclipseWellLogExtractor.cpp + ${CMAKE_CURRENT_LIST_DIR}/RigLocalGrid.cpp + ${CMAKE_CURRENT_LIST_DIR}/RigMainGrid.cpp + ${CMAKE_CURRENT_LIST_DIR}/RigReservoirBuilderMock.cpp + ${CMAKE_CURRENT_LIST_DIR}/RigCaseCellResultsData.cpp + ${CMAKE_CURRENT_LIST_DIR}/RigSimWellData.cpp + ${CMAKE_CURRENT_LIST_DIR}/RigWellPath.cpp + ${CMAKE_CURRENT_LIST_DIR}/RigFault.cpp + ${CMAKE_CURRENT_LIST_DIR}/RigNNCData.cpp + ${CMAKE_CURRENT_LIST_DIR}/cvfGeometryTools.cpp + ${CMAKE_CURRENT_LIST_DIR}/RigTernaryResultAccessor.cpp + ${CMAKE_CURRENT_LIST_DIR}/RigEclipseNativeStatCalc.cpp + ${CMAKE_CURRENT_LIST_DIR}/RigEclipseNativeVisibleCellsStatCalc.cpp + ${CMAKE_CURRENT_LIST_DIR}/RigEclipseMultiPropertyStatCalc.cpp + ${CMAKE_CURRENT_LIST_DIR}/RigWellLogCurveData.cpp + ${CMAKE_CURRENT_LIST_DIR}/RigHexIntersectionTools.cpp + ${CMAKE_CURRENT_LIST_DIR}/RigTimeHistoryResultAccessor.cpp + ${CMAKE_CURRENT_LIST_DIR}/RigLasFileExporter.cpp + ${CMAKE_CURRENT_LIST_DIR}/RigSimulationWellCoordsAndMD.cpp + ${CMAKE_CURRENT_LIST_DIR}/RigFishbonesGeometry.cpp + ${CMAKE_CURRENT_LIST_DIR}/RigTesselatorTools.cpp + ${CMAKE_CURRENT_LIST_DIR}/RigCellGeometryTools.cpp + ${CMAKE_CURRENT_LIST_DIR}/RigWellPathIntersectionTools.cpp + ${CMAKE_CURRENT_LIST_DIR}/RigEclipseResultInfo.cpp + ${CMAKE_CURRENT_LIST_DIR}/RigTofAccumulatedPhaseFractionsCalculator.cpp + ${CMAKE_CURRENT_LIST_DIR}/RigTofWellDistributionCalculator.cpp + ${CMAKE_CURRENT_LIST_DIR}/RigTransmissibilityEquations.cpp + ${CMAKE_CURRENT_LIST_DIR}/RigNumberOfFloodedPoreVolumesCalculator.cpp + ${CMAKE_CURRENT_LIST_DIR}/RigWeightedMeanCalc.cpp + ${CMAKE_CURRENT_LIST_DIR}/RigWellPathFormations.cpp + ${CMAKE_CURRENT_LIST_DIR}/RigStimPlanFractureDefinition.cpp + ${CMAKE_CURRENT_LIST_DIR}/RigFractureGrid.cpp + ${CMAKE_CURRENT_LIST_DIR}/RigFractureCell.cpp + ${CMAKE_CURRENT_LIST_DIR}/RigWellResultPoint.cpp + ${CMAKE_CURRENT_LIST_DIR}/RigWellPathGeometryTools.cpp + ${CMAKE_CURRENT_LIST_DIR}/RigWellPathGeometryExporter.cpp + ${CMAKE_CURRENT_LIST_DIR}/RigSurface.cpp + ${CMAKE_CURRENT_LIST_DIR}/RigCaseRealizationParameters.cpp + ${CMAKE_CURRENT_LIST_DIR}/RigGeoMechBoreHoleStressCalculator.cpp + ${CMAKE_CURRENT_LIST_DIR}/RigPolyLinesData.cpp + ${CMAKE_CURRENT_LIST_DIR}/RigCaseCellResultCalculator.cpp + ${CMAKE_CURRENT_LIST_DIR}/RigEclipseCrossPlotDataExtractor.cpp + ${CMAKE_CURRENT_LIST_DIR}/RigEquil.cpp + ${CMAKE_CURRENT_LIST_DIR}/RigWbsParameter.cpp + ${CMAKE_CURRENT_LIST_DIR}/RigEclipseAllanFaultsStatCalc.cpp + ${CMAKE_CURRENT_LIST_DIR}/RigCellFaceGeometryTools.cpp + ${CMAKE_CURRENT_LIST_DIR}/RigNncConnection.cpp + ${CMAKE_CURRENT_LIST_DIR}/RigWellDiskData.cpp + ${CMAKE_CURRENT_LIST_DIR}/RigGocadData.cpp + ${CMAKE_CURRENT_LIST_DIR}/RigElasticProperties.cpp + ${CMAKE_CURRENT_LIST_DIR}/RigEnsembleFractureStatisticsCalculator.cpp + ${CMAKE_CURRENT_LIST_DIR}/RigHistogramData.cpp + ${CMAKE_CURRENT_LIST_DIR}/RigVisibleCategoriesCalculator.cpp + ${CMAKE_CURRENT_LIST_DIR}/RigTracerPoint.cpp + ${CMAKE_CURRENT_LIST_DIR}/RigTracer.cpp + ${CMAKE_CURRENT_LIST_DIR}/RigStimPlanModelTools.cpp + ${CMAKE_CURRENT_LIST_DIR}/RigSlice2D.cpp + ${CMAKE_CURRENT_LIST_DIR}/RigEnsembleParameter.cpp + ${CMAKE_CURRENT_LIST_DIR}/RigSurfaceResampler.cpp + ${CMAKE_CURRENT_LIST_DIR}/RigSurfaceStatisticsCalculator.cpp) +list(APPEND CODE_HEADER_FILES ${SOURCE_GROUP_HEADER_FILES}) -set (SOURCE_GROUP_SOURCE_FILES -${CMAKE_CURRENT_LIST_DIR}/RigActiveCellInfo.cpp -${CMAKE_CURRENT_LIST_DIR}/RigCell.cpp -${CMAKE_CURRENT_LIST_DIR}/RigEclipseCaseData.cpp -${CMAKE_CURRENT_LIST_DIR}/RigGridBase.cpp -${CMAKE_CURRENT_LIST_DIR}/RigGridManager.cpp -${CMAKE_CURRENT_LIST_DIR}/RigResultAccessor.cpp -${CMAKE_CURRENT_LIST_DIR}/RigResultAccessorFactory.cpp -${CMAKE_CURRENT_LIST_DIR}/RigAllGridCellsResultAccessor.cpp -${CMAKE_CURRENT_LIST_DIR}/RigActiveCellsResultAccessor.cpp -${CMAKE_CURRENT_LIST_DIR}/RigCellEdgeResultAccessor.cpp -${CMAKE_CURRENT_LIST_DIR}/RigCellGeometryTools.cpp -${CMAKE_CURRENT_LIST_DIR}/RigCombTransResultAccessor.cpp -${CMAKE_CURRENT_LIST_DIR}/RigCombMultResultAccessor.cpp -${CMAKE_CURRENT_LIST_DIR}/RigResultModifierFactory.cpp -${CMAKE_CURRENT_LIST_DIR}/RigFormationNames.cpp -${CMAKE_CURRENT_LIST_DIR}/RigAllanDiagramData.cpp -${CMAKE_CURRENT_LIST_DIR}/RigFlowDiagResultAddress.cpp -${CMAKE_CURRENT_LIST_DIR}/RigFlowDiagResults.cpp -${CMAKE_CURRENT_LIST_DIR}/RigFlowDiagResultFrames.cpp -${CMAKE_CURRENT_LIST_DIR}/RigFlowDiagSolverInterface.cpp -${CMAKE_CURRENT_LIST_DIR}/RigFlowDiagStatCalc.cpp -${CMAKE_CURRENT_LIST_DIR}/RigFlowDiagVisibleCellsStatCalc.cpp -${CMAKE_CURRENT_LIST_DIR}/RigAccWellFlowCalculator.cpp -${CMAKE_CURRENT_LIST_DIR}/RigWellLogExtractor.cpp -${CMAKE_CURRENT_LIST_DIR}/RigEclipseWellLogExtractor.cpp -${CMAKE_CURRENT_LIST_DIR}/RigLocalGrid.cpp -${CMAKE_CURRENT_LIST_DIR}/RigMainGrid.cpp -${CMAKE_CURRENT_LIST_DIR}/RigReservoirBuilderMock.cpp -${CMAKE_CURRENT_LIST_DIR}/RigCaseCellResultsData.cpp -${CMAKE_CURRENT_LIST_DIR}/RigSimWellData.cpp -${CMAKE_CURRENT_LIST_DIR}/RigWellPath.cpp -${CMAKE_CURRENT_LIST_DIR}/RigFault.cpp -${CMAKE_CURRENT_LIST_DIR}/RigNNCData.cpp -${CMAKE_CURRENT_LIST_DIR}/cvfGeometryTools.cpp -${CMAKE_CURRENT_LIST_DIR}/RigTernaryResultAccessor.cpp -${CMAKE_CURRENT_LIST_DIR}/RigEclipseNativeStatCalc.cpp -${CMAKE_CURRENT_LIST_DIR}/RigEclipseNativeVisibleCellsStatCalc.cpp -${CMAKE_CURRENT_LIST_DIR}/RigEclipseMultiPropertyStatCalc.cpp -${CMAKE_CURRENT_LIST_DIR}/RigWellLogCurveData.cpp -${CMAKE_CURRENT_LIST_DIR}/RigHexIntersectionTools.cpp -${CMAKE_CURRENT_LIST_DIR}/RigTimeHistoryResultAccessor.cpp -${CMAKE_CURRENT_LIST_DIR}/RigLasFileExporter.cpp -${CMAKE_CURRENT_LIST_DIR}/RigSimulationWellCoordsAndMD.cpp -${CMAKE_CURRENT_LIST_DIR}/RigFishbonesGeometry.cpp -${CMAKE_CURRENT_LIST_DIR}/RigTesselatorTools.cpp -${CMAKE_CURRENT_LIST_DIR}/RigCellGeometryTools.cpp -${CMAKE_CURRENT_LIST_DIR}/RigWellPathIntersectionTools.cpp -${CMAKE_CURRENT_LIST_DIR}/RigEclipseResultInfo.cpp -${CMAKE_CURRENT_LIST_DIR}/RigTofAccumulatedPhaseFractionsCalculator.cpp -${CMAKE_CURRENT_LIST_DIR}/RigTofWellDistributionCalculator.cpp -${CMAKE_CURRENT_LIST_DIR}/RigTransmissibilityEquations.cpp -${CMAKE_CURRENT_LIST_DIR}/RigNumberOfFloodedPoreVolumesCalculator.cpp -${CMAKE_CURRENT_LIST_DIR}/RigWeightedMeanCalc.cpp -${CMAKE_CURRENT_LIST_DIR}/RigWellPathFormations.cpp -${CMAKE_CURRENT_LIST_DIR}/RigStimPlanFractureDefinition.cpp -${CMAKE_CURRENT_LIST_DIR}/RigFractureGrid.cpp -${CMAKE_CURRENT_LIST_DIR}/RigFractureCell.cpp -${CMAKE_CURRENT_LIST_DIR}/RigWellResultPoint.cpp -${CMAKE_CURRENT_LIST_DIR}/RigWellPathGeometryTools.cpp -${CMAKE_CURRENT_LIST_DIR}/RigWellPathGeometryExporter.cpp -${CMAKE_CURRENT_LIST_DIR}/RigSurface.cpp -${CMAKE_CURRENT_LIST_DIR}/RigCaseRealizationParameters.cpp -${CMAKE_CURRENT_LIST_DIR}/RigGeoMechBoreHoleStressCalculator.cpp -${CMAKE_CURRENT_LIST_DIR}/RigPolyLinesData.cpp -${CMAKE_CURRENT_LIST_DIR}/RigCaseCellResultCalculator.cpp -${CMAKE_CURRENT_LIST_DIR}/RigEclipseCrossPlotDataExtractor.cpp -${CMAKE_CURRENT_LIST_DIR}/RigEquil.cpp -${CMAKE_CURRENT_LIST_DIR}/RigWbsParameter.cpp -${CMAKE_CURRENT_LIST_DIR}/RigEclipseAllanFaultsStatCalc.cpp -${CMAKE_CURRENT_LIST_DIR}/RigCellFaceGeometryTools.cpp -${CMAKE_CURRENT_LIST_DIR}/RigNncConnection.cpp -${CMAKE_CURRENT_LIST_DIR}/RigWellDiskData.cpp -${CMAKE_CURRENT_LIST_DIR}/RigGocadData.cpp -${CMAKE_CURRENT_LIST_DIR}/RigElasticProperties.cpp -${CMAKE_CURRENT_LIST_DIR}/RigEnsembleFractureStatisticsCalculator.cpp -${CMAKE_CURRENT_LIST_DIR}/RigHistogramData.cpp -${CMAKE_CURRENT_LIST_DIR}/RigVisibleCategoriesCalculator.cpp -${CMAKE_CURRENT_LIST_DIR}/RigTracerPoint.cpp -${CMAKE_CURRENT_LIST_DIR}/RigTracer.cpp -${CMAKE_CURRENT_LIST_DIR}/RigStimPlanModelTools.cpp -${CMAKE_CURRENT_LIST_DIR}/RigSlice2D.cpp -${CMAKE_CURRENT_LIST_DIR}/RigEnsembleParameter.cpp -${CMAKE_CURRENT_LIST_DIR}/RigSurfaceResampler.cpp -${CMAKE_CURRENT_LIST_DIR}/RigSurfaceStatisticsCalculator.cpp -) +list(APPEND CODE_SOURCE_FILES ${SOURCE_GROUP_SOURCE_FILES}) -list(APPEND CODE_HEADER_FILES -${SOURCE_GROUP_HEADER_FILES} -) - -list(APPEND CODE_SOURCE_FILES -${SOURCE_GROUP_SOURCE_FILES} -) - -source_group( "ReservoirDataModel" FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake ) +source_group( + "ReservoirDataModel" + FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} + ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake) diff --git a/ApplicationLibCode/ReservoirDataModel/CMakeLists_filesNotToUnitTest.cmake b/ApplicationLibCode/ReservoirDataModel/CMakeLists_filesNotToUnitTest.cmake index 8de6209ac7..a7627cfcc7 100644 --- a/ApplicationLibCode/ReservoirDataModel/CMakeLists_filesNotToUnitTest.cmake +++ b/ApplicationLibCode/ReservoirDataModel/CMakeLists_filesNotToUnitTest.cmake @@ -1,30 +1,26 @@ - -set (SOURCE_GROUP_HEADER_FILES +set(SOURCE_GROUP_HEADER_FILES ${CMAKE_CURRENT_LIST_DIR}/RigGeoMechWellLogExtractor.h ${CMAKE_CURRENT_LIST_DIR}/RigCaseToCaseCellMapper.h ${CMAKE_CURRENT_LIST_DIR}/RigCaseToCaseCellMapperTools.h ${CMAKE_CURRENT_LIST_DIR}/RigCaseToCaseRangeFilterMapper.h ${CMAKE_CURRENT_LIST_DIR}/RigSimulationWellCenterLineCalculator.h ${CMAKE_CURRENT_LIST_DIR}/RigWellLogFile.h - ${CMAKE_CURRENT_LIST_DIR}/RigReservoirGridTools.h -) + ${CMAKE_CURRENT_LIST_DIR}/RigReservoirGridTools.h) -set (SOURCE_GROUP_SOURCE_FILES +set(SOURCE_GROUP_SOURCE_FILES ${CMAKE_CURRENT_LIST_DIR}/RigGeoMechWellLogExtractor.cpp ${CMAKE_CURRENT_LIST_DIR}/RigCaseToCaseCellMapper.cpp ${CMAKE_CURRENT_LIST_DIR}/RigCaseToCaseCellMapperTools.cpp ${CMAKE_CURRENT_LIST_DIR}/RigCaseToCaseRangeFilterMapper.cpp ${CMAKE_CURRENT_LIST_DIR}/RigSimulationWellCenterLineCalculator.cpp ${CMAKE_CURRENT_LIST_DIR}/RigWellLogFile.cpp - ${CMAKE_CURRENT_LIST_DIR}/RigReservoirGridTools.cpp -) + ${CMAKE_CURRENT_LIST_DIR}/RigReservoirGridTools.cpp) -list(APPEND CODE_HEADER_FILES -${SOURCE_GROUP_HEADER_FILES} -) +list(APPEND CODE_HEADER_FILES ${SOURCE_GROUP_HEADER_FILES}) -list(APPEND CODE_SOURCE_FILES -${SOURCE_GROUP_SOURCE_FILES} -) +list(APPEND CODE_SOURCE_FILES ${SOURCE_GROUP_SOURCE_FILES}) -source_group( "ReservoirDataModel2" FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_filesNotToUnitTest.cmake ) +source_group( + "ReservoirDataModel2" + FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} + ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_filesNotToUnitTest.cmake) diff --git a/ApplicationLibCode/ReservoirDataModel/Completions/CMakeLists_files.cmake b/ApplicationLibCode/ReservoirDataModel/Completions/CMakeLists_files.cmake index 0f956a1c82..7a7db8a6bd 100644 --- a/ApplicationLibCode/ReservoirDataModel/Completions/CMakeLists_files.cmake +++ b/ApplicationLibCode/ReservoirDataModel/Completions/CMakeLists_files.cmake @@ -1,35 +1,30 @@ +set(SOURCE_GROUP_HEADER_FILES + ${CMAKE_CURRENT_LIST_DIR}/RigCompletionData.h + ${CMAKE_CURRENT_LIST_DIR}/RigCompletionDataGridCell.h + ${CMAKE_CURRENT_LIST_DIR}/RigEclipseToStimPlanCellTransmissibilityCalculator.h + ${CMAKE_CURRENT_LIST_DIR}/RigTransmissibilityCondenser.h + ${CMAKE_CURRENT_LIST_DIR}/RigFractureTransmissibilityEquations.h + ${CMAKE_CURRENT_LIST_DIR}/RigWellPathStimplanIntersector.h + ${CMAKE_CURRENT_LIST_DIR}/RigVirtualPerforationTransmissibilities.h + ${CMAKE_CURRENT_LIST_DIR}/RigEclipseToStimPlanCalculator.h + ${CMAKE_CURRENT_LIST_DIR}/RigPerforationTransmissibilityEquations.h) -set (SOURCE_GROUP_HEADER_FILES -${CMAKE_CURRENT_LIST_DIR}/RigCompletionData.h -${CMAKE_CURRENT_LIST_DIR}/RigCompletionDataGridCell.h -${CMAKE_CURRENT_LIST_DIR}/RigEclipseToStimPlanCellTransmissibilityCalculator.h -${CMAKE_CURRENT_LIST_DIR}/RigTransmissibilityCondenser.h -${CMAKE_CURRENT_LIST_DIR}/RigFractureTransmissibilityEquations.h -${CMAKE_CURRENT_LIST_DIR}/RigWellPathStimplanIntersector.h -${CMAKE_CURRENT_LIST_DIR}/RigVirtualPerforationTransmissibilities.h -${CMAKE_CURRENT_LIST_DIR}/RigEclipseToStimPlanCalculator.h -${CMAKE_CURRENT_LIST_DIR}/RigPerforationTransmissibilityEquations.h -) +set(SOURCE_GROUP_SOURCE_FILES + ${CMAKE_CURRENT_LIST_DIR}/RigCompletionData.cpp + ${CMAKE_CURRENT_LIST_DIR}/RigCompletionDataGridCell.cpp + ${CMAKE_CURRENT_LIST_DIR}/RigEclipseToStimPlanCellTransmissibilityCalculator.cpp + ${CMAKE_CURRENT_LIST_DIR}/RigTransmissibilityCondenser.cpp + ${CMAKE_CURRENT_LIST_DIR}/RigFractureTransmissibilityEquations.cpp + ${CMAKE_CURRENT_LIST_DIR}/RigWellPathStimplanIntersector.cpp + ${CMAKE_CURRENT_LIST_DIR}/RigVirtualPerforationTransmissibilities.cpp + ${CMAKE_CURRENT_LIST_DIR}/RigEclipseToStimPlanCalculator.cpp + ${CMAKE_CURRENT_LIST_DIR}/RigPerforationTransmissibilityEquations.cpp) +list(APPEND CODE_HEADER_FILES ${SOURCE_GROUP_HEADER_FILES}) -set (SOURCE_GROUP_SOURCE_FILES -${CMAKE_CURRENT_LIST_DIR}/RigCompletionData.cpp -${CMAKE_CURRENT_LIST_DIR}/RigCompletionDataGridCell.cpp -${CMAKE_CURRENT_LIST_DIR}/RigEclipseToStimPlanCellTransmissibilityCalculator.cpp -${CMAKE_CURRENT_LIST_DIR}/RigTransmissibilityCondenser.cpp -${CMAKE_CURRENT_LIST_DIR}/RigFractureTransmissibilityEquations.cpp -${CMAKE_CURRENT_LIST_DIR}/RigWellPathStimplanIntersector.cpp -${CMAKE_CURRENT_LIST_DIR}/RigVirtualPerforationTransmissibilities.cpp -${CMAKE_CURRENT_LIST_DIR}/RigEclipseToStimPlanCalculator.cpp -${CMAKE_CURRENT_LIST_DIR}/RigPerforationTransmissibilityEquations.cpp -) +list(APPEND CODE_SOURCE_FILES ${SOURCE_GROUP_SOURCE_FILES}) -list(APPEND CODE_HEADER_FILES -${SOURCE_GROUP_HEADER_FILES} -) - -list(APPEND CODE_SOURCE_FILES -${SOURCE_GROUP_SOURCE_FILES} -) - -source_group( "ReservoirDataModel\\Completions" FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake ) +source_group( + "ReservoirDataModel\\Completions" + FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} + ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake) diff --git a/ApplicationLibCode/UnitTests/CMakeLists_files.cmake b/ApplicationLibCode/UnitTests/CMakeLists_files.cmake index 57bb5a6c76..f11e64f2f5 100644 --- a/ApplicationLibCode/UnitTests/CMakeLists_files.cmake +++ b/ApplicationLibCode/UnitTests/CMakeLists_files.cmake @@ -1,101 +1,92 @@ +configure_file(${CMAKE_CURRENT_LIST_DIR}/RiaTestDataDirectory.h.cmake + ${CMAKE_BINARY_DIR}/Generated/RiaTestDataDirectory.h) -CONFIGURE_FILE( ${CMAKE_CURRENT_LIST_DIR}/RiaTestDataDirectory.h.cmake - ${CMAKE_BINARY_DIR}/Generated/RiaTestDataDirectory.h -) +set(SOURCE_GROUP_HEADER_FILES) -set (SOURCE_GROUP_HEADER_FILES -) +set(SOURCE_GROUP_SOURCE_FILES + ${CMAKE_CURRENT_LIST_DIR}/cvfGeometryTools-Test.cpp + ${CMAKE_CURRENT_LIST_DIR}/Ert-Test.cpp + ${CMAKE_CURRENT_LIST_DIR}/RifcCommandCore-Test.cpp + ${CMAKE_CURRENT_LIST_DIR}/RifEclipseInputFileTools-Test.cpp + ${CMAKE_CURRENT_LIST_DIR}/RifReaderEclipseOutput-Test.cpp + ${CMAKE_CURRENT_LIST_DIR}/RifReaderEclipseSummary-Test.cpp + ${CMAKE_CURRENT_LIST_DIR}/RigActiveCellInfo-Test.cpp + ${CMAKE_CURRENT_LIST_DIR}/RigReservoir-Test.cpp + ${CMAKE_CURRENT_LIST_DIR}/RigStatisticsMath-Test.cpp + ${CMAKE_CURRENT_LIST_DIR}/RigWellPathIntersectionTools-Test.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimWellLogExtractionCurveImpl-Test.cpp + ${CMAKE_CURRENT_LIST_DIR}/RivPipeGeometryGenerator-Test.cpp + ${CMAKE_CURRENT_LIST_DIR}/RivTernaryScalarMapper-Test.cpp + ${CMAKE_CURRENT_LIST_DIR}/ScalarMapper-Test.cpp + ${CMAKE_CURRENT_LIST_DIR}/WellPathAsciiFileReader-Test.cpp + ${CMAKE_CURRENT_LIST_DIR}/opm-flowdiagnostics-Test.cpp + ${CMAKE_CURRENT_LIST_DIR}/RigTofAccumulatedPhaseFractionsCalculator-Test.cpp + ${CMAKE_CURRENT_LIST_DIR}/HDF5FileReader-Test.cpp + ${CMAKE_CURRENT_LIST_DIR}/HDF5FileWriter-Test.cpp + ${CMAKE_CURRENT_LIST_DIR}/RigCellGeometryTools-Test.cpp + ${CMAKE_CURRENT_LIST_DIR}/RigHexIntersectionTools-Test.cpp + ${CMAKE_CURRENT_LIST_DIR}/ObservedDataParser-Test.cpp + ${CMAKE_CURRENT_LIST_DIR}/EclipseRftReader-Test.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicExpressionParser-Test.cpp + ${CMAKE_CURRENT_LIST_DIR}/RiuSummaryVectorDescriptionMap-Test.cpp + ${CMAKE_CURRENT_LIST_DIR}/FixedWidthDataParser-Test.cpp + ${CMAKE_CURRENT_LIST_DIR}/RigTimeCurveHistoryMerger-Test.cpp + ${CMAKE_CURRENT_LIST_DIR}/ListKeywordsForObjectsAndFields-Test.cpp + ${CMAKE_CURRENT_LIST_DIR}/RiaProjectFileVersionTools-Test.cpp + ${CMAKE_CURRENT_LIST_DIR}/RifElementPropertyTableReader-Test.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimRelocatePath-Test.cpp + ${CMAKE_CURRENT_LIST_DIR}/RigTransmissibilityCondenser-Test.cpp + ${CMAKE_CURRENT_LIST_DIR}/RiaEclipseUnitTools-Test.cpp + ${CMAKE_CURRENT_LIST_DIR}/RiaTextFileCompare-Test.cpp + ${CMAKE_CURRENT_LIST_DIR}/RifCaseRealizationParametersReader-Test.cpp + ${CMAKE_CURRENT_LIST_DIR}/RigWellLogExtractor-Test.cpp + ${CMAKE_CURRENT_LIST_DIR}/RigWellPathGeometryTools-Test.cpp + ${CMAKE_CURRENT_LIST_DIR}/RifEclipseSummaryAddress-Test.cpp + ${CMAKE_CURRENT_LIST_DIR}/RiaTimeHistoryCurveTools-Test.cpp + ${CMAKE_CURRENT_LIST_DIR}/SolveSpaceSolver-Test.cpp + ${CMAKE_CURRENT_LIST_DIR}/RiaPolyArcLineSampler-Test.cpp + ${CMAKE_CURRENT_LIST_DIR}/RifTextDataTableFormatter-Test.cpp + ${CMAKE_CURRENT_LIST_DIR}/RiaWeightedMean-Test.cpp + ${CMAKE_CURRENT_LIST_DIR}/RiaMedianCalculator-Test.cpp + ${CMAKE_CURRENT_LIST_DIR}/RiaWeightedGeometricMeanCalculator-Test.cpp + ${CMAKE_CURRENT_LIST_DIR}/RiaWeightedHarmonicMeanCalculator-Test.cpp + ${CMAKE_CURRENT_LIST_DIR}/RiaCellDividingTools-Test.cpp + ${CMAKE_CURRENT_LIST_DIR}/RiaFilePathTools-Test.cpp + ${CMAKE_CURRENT_LIST_DIR}/Intersect-Test.cpp + ${CMAKE_CURRENT_LIST_DIR}/RifPerforationIntervalReader-Test.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimWellPathCompletions-Test.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimSummaryCaseCollection-Test.cpp + ${CMAKE_CURRENT_LIST_DIR}/RifActiveCellsReader-Test.cpp + ${CMAKE_CURRENT_LIST_DIR}/RifCsvDataTableFormatter-Test.cpp + ${CMAKE_CURRENT_LIST_DIR}/RiaSummaryCurveAnalyzer-Test.cpp + ${CMAKE_CURRENT_LIST_DIR}/RiaStdStringTools-Test.cpp + ${CMAKE_CURRENT_LIST_DIR}/RiaInterpolationTools-Test.cpp + ${CMAKE_CURRENT_LIST_DIR}/RifWellMeasurementReader-Test.cpp + ${CMAKE_CURRENT_LIST_DIR}/RiaDateStringParser-Test.cpp + ${CMAKE_CURRENT_LIST_DIR}/RigHexGradientTools-Test.cpp + ${CMAKE_CURRENT_LIST_DIR}/RifSurfaceImporter-Test.cpp + ${CMAKE_CURRENT_LIST_DIR}/RifColorLegendData-Test.cpp + ${CMAKE_CURRENT_LIST_DIR}/RifRoffReader-Test.cpp + ${CMAKE_CURRENT_LIST_DIR}/RifElasticPropertiesReader-Test.cpp + ${CMAKE_CURRENT_LIST_DIR}/RiaStatisticsTools-Test.cpp + ${CMAKE_CURRENT_LIST_DIR}/RifStimPlanXmlReader-Test.cpp + ${CMAKE_CURRENT_LIST_DIR}/RigWellPathGeometryExporter-Test.cpp + ${CMAKE_CURRENT_LIST_DIR}/RifStimPlanModelDeviationFrkExporter-Test.cpp + ${CMAKE_CURRENT_LIST_DIR}/RifSummaryDataReader-Test.cpp + ${CMAKE_CURRENT_LIST_DIR}/RigSlice2D-Test.cpp + ${CMAKE_CURRENT_LIST_DIR}/RigSurfaceResampler-Test.cpp + ${CMAKE_CURRENT_LIST_DIR}/RigSurfaceStatisticsCalculator-Test.cpp) -set (SOURCE_GROUP_SOURCE_FILES -${CMAKE_CURRENT_LIST_DIR}/cvfGeometryTools-Test.cpp -${CMAKE_CURRENT_LIST_DIR}/Ert-Test.cpp -${CMAKE_CURRENT_LIST_DIR}/RifcCommandCore-Test.cpp -${CMAKE_CURRENT_LIST_DIR}/RifEclipseInputFileTools-Test.cpp -${CMAKE_CURRENT_LIST_DIR}/RifReaderEclipseOutput-Test.cpp -${CMAKE_CURRENT_LIST_DIR}/RifReaderEclipseSummary-Test.cpp -${CMAKE_CURRENT_LIST_DIR}/RigActiveCellInfo-Test.cpp -${CMAKE_CURRENT_LIST_DIR}/RigReservoir-Test.cpp -${CMAKE_CURRENT_LIST_DIR}/RigStatisticsMath-Test.cpp -${CMAKE_CURRENT_LIST_DIR}/RigWellPathIntersectionTools-Test.cpp -${CMAKE_CURRENT_LIST_DIR}/RimWellLogExtractionCurveImpl-Test.cpp -${CMAKE_CURRENT_LIST_DIR}/RivPipeGeometryGenerator-Test.cpp -${CMAKE_CURRENT_LIST_DIR}/RivTernaryScalarMapper-Test.cpp -${CMAKE_CURRENT_LIST_DIR}/ScalarMapper-Test.cpp -${CMAKE_CURRENT_LIST_DIR}/WellPathAsciiFileReader-Test.cpp -${CMAKE_CURRENT_LIST_DIR}/opm-flowdiagnostics-Test.cpp -${CMAKE_CURRENT_LIST_DIR}/RigTofAccumulatedPhaseFractionsCalculator-Test.cpp -${CMAKE_CURRENT_LIST_DIR}/HDF5FileReader-Test.cpp -${CMAKE_CURRENT_LIST_DIR}/HDF5FileWriter-Test.cpp -${CMAKE_CURRENT_LIST_DIR}/RigCellGeometryTools-Test.cpp -${CMAKE_CURRENT_LIST_DIR}/RigHexIntersectionTools-Test.cpp -${CMAKE_CURRENT_LIST_DIR}/ObservedDataParser-Test.cpp -${CMAKE_CURRENT_LIST_DIR}/EclipseRftReader-Test.cpp -${CMAKE_CURRENT_LIST_DIR}/RicExpressionParser-Test.cpp -${CMAKE_CURRENT_LIST_DIR}/RiuSummaryVectorDescriptionMap-Test.cpp -${CMAKE_CURRENT_LIST_DIR}/FixedWidthDataParser-Test.cpp -${CMAKE_CURRENT_LIST_DIR}/RigTimeCurveHistoryMerger-Test.cpp -${CMAKE_CURRENT_LIST_DIR}/ListKeywordsForObjectsAndFields-Test.cpp -${CMAKE_CURRENT_LIST_DIR}/RiaProjectFileVersionTools-Test.cpp -${CMAKE_CURRENT_LIST_DIR}/RifElementPropertyTableReader-Test.cpp -${CMAKE_CURRENT_LIST_DIR}/RimRelocatePath-Test.cpp -${CMAKE_CURRENT_LIST_DIR}/RigTransmissibilityCondenser-Test.cpp -${CMAKE_CURRENT_LIST_DIR}/RiaEclipseUnitTools-Test.cpp -${CMAKE_CURRENT_LIST_DIR}/RiaTextFileCompare-Test.cpp -${CMAKE_CURRENT_LIST_DIR}/RifCaseRealizationParametersReader-Test.cpp -${CMAKE_CURRENT_LIST_DIR}/RigWellLogExtractor-Test.cpp -${CMAKE_CURRENT_LIST_DIR}/RigWellPathGeometryTools-Test.cpp -${CMAKE_CURRENT_LIST_DIR}/RifEclipseSummaryAddress-Test.cpp -${CMAKE_CURRENT_LIST_DIR}/RiaTimeHistoryCurveTools-Test.cpp -${CMAKE_CURRENT_LIST_DIR}/SolveSpaceSolver-Test.cpp -${CMAKE_CURRENT_LIST_DIR}/RiaPolyArcLineSampler-Test.cpp -${CMAKE_CURRENT_LIST_DIR}/RifTextDataTableFormatter-Test.cpp -${CMAKE_CURRENT_LIST_DIR}/RiaWeightedMean-Test.cpp -${CMAKE_CURRENT_LIST_DIR}/RiaMedianCalculator-Test.cpp -${CMAKE_CURRENT_LIST_DIR}/RiaWeightedGeometricMeanCalculator-Test.cpp -${CMAKE_CURRENT_LIST_DIR}/RiaWeightedHarmonicMeanCalculator-Test.cpp -${CMAKE_CURRENT_LIST_DIR}/RiaCellDividingTools-Test.cpp -${CMAKE_CURRENT_LIST_DIR}/RiaFilePathTools-Test.cpp -${CMAKE_CURRENT_LIST_DIR}/Intersect-Test.cpp -${CMAKE_CURRENT_LIST_DIR}/RifPerforationIntervalReader-Test.cpp -${CMAKE_CURRENT_LIST_DIR}/RimWellPathCompletions-Test.cpp -${CMAKE_CURRENT_LIST_DIR}/RimSummaryCaseCollection-Test.cpp -${CMAKE_CURRENT_LIST_DIR}/RifActiveCellsReader-Test.cpp -${CMAKE_CURRENT_LIST_DIR}/RifCsvDataTableFormatter-Test.cpp -${CMAKE_CURRENT_LIST_DIR}/RiaSummaryCurveAnalyzer-Test.cpp -${CMAKE_CURRENT_LIST_DIR}/RiaStdStringTools-Test.cpp -${CMAKE_CURRENT_LIST_DIR}/RiaInterpolationTools-Test.cpp -${CMAKE_CURRENT_LIST_DIR}/RifWellMeasurementReader-Test.cpp -${CMAKE_CURRENT_LIST_DIR}/RiaDateStringParser-Test.cpp -${CMAKE_CURRENT_LIST_DIR}/RigHexGradientTools-Test.cpp -${CMAKE_CURRENT_LIST_DIR}/RifSurfaceImporter-Test.cpp -${CMAKE_CURRENT_LIST_DIR}/RifColorLegendData-Test.cpp -${CMAKE_CURRENT_LIST_DIR}/RifRoffReader-Test.cpp -${CMAKE_CURRENT_LIST_DIR}/RifElasticPropertiesReader-Test.cpp -${CMAKE_CURRENT_LIST_DIR}/RiaStatisticsTools-Test.cpp -${CMAKE_CURRENT_LIST_DIR}/RifStimPlanXmlReader-Test.cpp -${CMAKE_CURRENT_LIST_DIR}/RigWellPathGeometryExporter-Test.cpp -${CMAKE_CURRENT_LIST_DIR}/RifStimPlanModelDeviationFrkExporter-Test.cpp -${CMAKE_CURRENT_LIST_DIR}/RifSummaryDataReader-Test.cpp -${CMAKE_CURRENT_LIST_DIR}/RigSlice2D-Test.cpp -${CMAKE_CURRENT_LIST_DIR}/RigSurfaceResampler-Test.cpp -${CMAKE_CURRENT_LIST_DIR}/RigSurfaceStatisticsCalculator-Test.cpp -) - -if (RESINSIGHT_ENABLE_GRPC) - list(APPEND GPRC_UNIT_TEST_SOURCE_FILES - ${CMAKE_CURRENT_LIST_DIR}/RiaGrpcInterface-Test.cpp - ) - list(APPEND SOURCE_GROUP_SOURCE_FILES - ${GRPC_UNIT_TEST_SOURCE_FILES} - ) +if(RESINSIGHT_ENABLE_GRPC) + list(APPEND GPRC_UNIT_TEST_SOURCE_FILES + ${CMAKE_CURRENT_LIST_DIR}/RiaGrpcInterface-Test.cpp) + list(APPEND SOURCE_GROUP_SOURCE_FILES ${GRPC_UNIT_TEST_SOURCE_FILES}) endif(RESINSIGHT_ENABLE_GRPC) -list(APPEND CODE_HEADER_FILES -${SOURCE_GROUP_HEADER_FILES} -) +list(APPEND CODE_HEADER_FILES ${SOURCE_GROUP_HEADER_FILES}) -list(APPEND CODE_SOURCE_FILES -${SOURCE_GROUP_SOURCE_FILES} -) +list(APPEND CODE_SOURCE_FILES ${SOURCE_GROUP_SOURCE_FILES}) -source_group( "UnitTests" FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake ) +source_group( + "UnitTests" FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} + ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake) diff --git a/ApplicationLibCode/UserInterface/AnalysisPlots/CMakeLists_files.cmake b/ApplicationLibCode/UserInterface/AnalysisPlots/CMakeLists_files.cmake index 9202b054c5..3c8f09c9e8 100644 --- a/ApplicationLibCode/UserInterface/AnalysisPlots/CMakeLists_files.cmake +++ b/ApplicationLibCode/UserInterface/AnalysisPlots/CMakeLists_files.cmake @@ -1,26 +1,18 @@ +set(SOURCE_GROUP_HEADER_FILES + ${CMAKE_CURRENT_LIST_DIR}/RiuGroupedBarChartBuilder.h) -set (SOURCE_GROUP_HEADER_FILES -${CMAKE_CURRENT_LIST_DIR}/RiuGroupedBarChartBuilder.h +set(SOURCE_GROUP_SOURCE_FILES + ${CMAKE_CURRENT_LIST_DIR}/RiuGroupedBarChartBuilder.cpp) -) +list(APPEND CODE_HEADER_FILES ${SOURCE_GROUP_HEADER_FILES}) -set (SOURCE_GROUP_SOURCE_FILES -${CMAKE_CURRENT_LIST_DIR}/RiuGroupedBarChartBuilder.cpp -) +list(APPEND CODE_SOURCE_FILES ${SOURCE_GROUP_SOURCE_FILES}) -list(APPEND CODE_HEADER_FILES -${SOURCE_GROUP_HEADER_FILES} -) +list(APPEND QT_MOC_HEADERS) -list(APPEND CODE_SOURCE_FILES -${SOURCE_GROUP_SOURCE_FILES} -) +list(APPEND QT_UI_FILES) -list(APPEND QT_MOC_HEADERS - -) - -list(APPEND QT_UI_FILES -) - -source_group( "UserInterface/AnalysisPlots" FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake ) +source_group( + "UserInterface/AnalysisPlots" + FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} + ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake) diff --git a/ApplicationLibCode/UserInterface/CMakeLists_files.cmake b/ApplicationLibCode/UserInterface/CMakeLists_files.cmake index a198767add..6262f43062 100644 --- a/ApplicationLibCode/UserInterface/CMakeLists_files.cmake +++ b/ApplicationLibCode/UserInterface/CMakeLists_files.cmake @@ -1,271 +1,256 @@ +set(SOURCE_GROUP_HEADER_FILES + ${CMAKE_CURRENT_LIST_DIR}/RiuCadNavigation.h + ${CMAKE_CURRENT_LIST_DIR}/RiuCursors.h + ${CMAKE_CURRENT_LIST_DIR}/RiuDragDrop.h + ${CMAKE_CURRENT_LIST_DIR}/RiuFemResultTextBuilder.h + ${CMAKE_CURRENT_LIST_DIR}/RiuGeoQuestNavigation.h + ${CMAKE_CURRENT_LIST_DIR}/RiuInterfaceToViewWindow.h + ${CMAKE_CURRENT_LIST_DIR}/RiuQwtSymbol.h + ${CMAKE_CURRENT_LIST_DIR}/RiuQwtPlotCurve.h + ${CMAKE_CURRENT_LIST_DIR}/RiuQwtPlotCurveDefines.h + ${CMAKE_CURRENT_LIST_DIR}/RiuRimQwtPlotCurve.h + ${CMAKE_CURRENT_LIST_DIR}/RiuPlotMainWindow.h + ${CMAKE_CURRENT_LIST_DIR}/RiuMainWindow.h + ${CMAKE_CURRENT_LIST_DIR}/RiuMainWindowBase.h + ${CMAKE_CURRENT_LIST_DIR}/RiuMdiArea.h + ${CMAKE_CURRENT_LIST_DIR}/RiuMdiSubWindow.h + ${CMAKE_CURRENT_LIST_DIR}/RiuProcessMonitor.h + ${CMAKE_CURRENT_LIST_DIR}/RiuProjectPropertyView.h + ${CMAKE_CURRENT_LIST_DIR}/RiuPropertyViewTabWidget.h + ${CMAKE_CURRENT_LIST_DIR}/RiuPvtPlotPanel.h + ${CMAKE_CURRENT_LIST_DIR}/RiuPvtPlotUpdater.h + ${CMAKE_CURRENT_LIST_DIR}/RiuQwtLinearScaleEngine.h + ${CMAKE_CURRENT_LIST_DIR}/RiuQwtScalePicker.h + ${CMAKE_CURRENT_LIST_DIR}/RiuQwtCurvePointTracker.h + ${CMAKE_CURRENT_LIST_DIR}/RiuQwtPlotWheelZoomer.h + ${CMAKE_CURRENT_LIST_DIR}/RiuQwtPlotZoomer.h + ${CMAKE_CURRENT_LIST_DIR}/RiuWidgetDragger.h + ${CMAKE_CURRENT_LIST_DIR}/RiuRecentFileActionProvider.h + ${CMAKE_CURRENT_LIST_DIR}/RiuRelativePermeabilityPlotPanel.h + ${CMAKE_CURRENT_LIST_DIR}/RiuRelativePermeabilityPlotUpdater.h + ${CMAKE_CURRENT_LIST_DIR}/RiuResultInfoPanel.h + ${CMAKE_CURRENT_LIST_DIR}/RiuResultQwtPlot.h + ${CMAKE_CURRENT_LIST_DIR}/RiuResultTextBuilder.h + ${CMAKE_CURRENT_LIST_DIR}/RiuRmsNavigation.h + ${CMAKE_CURRENT_LIST_DIR}/RiuSelectionChangedHandler.h + ${CMAKE_CURRENT_LIST_DIR}/Riu3dSelectionManager.h + ${CMAKE_CURRENT_LIST_DIR}/RiuSimpleHistogramWidget.h + ${CMAKE_CURRENT_LIST_DIR}/RiuDockedQwtPlot.h + ${CMAKE_CURRENT_LIST_DIR}/RiuGridCrossQwtPlot.h + ${CMAKE_CURRENT_LIST_DIR}/RiuSummaryQwtPlot.h + ${CMAKE_CURRENT_LIST_DIR}/RiuTextDialog.h + ${CMAKE_CURRENT_LIST_DIR}/RiuTimeStepChangedHandler.h + ${CMAKE_CURRENT_LIST_DIR}/RiuTofAccumulatedPhaseFractionsPlot.h + ${CMAKE_CURRENT_LIST_DIR}/RiuToolTipMenu.h + ${CMAKE_CURRENT_LIST_DIR}/RiuTreeViewEventFilter.h + ${CMAKE_CURRENT_LIST_DIR}/RiuViewer.h + ${CMAKE_CURRENT_LIST_DIR}/RiuViewerToViewInterface.h + ${CMAKE_CURRENT_LIST_DIR}/RiuViewerCommands.h + ${CMAKE_CURRENT_LIST_DIR}/RiuCellAndNncPickEventHandler.h + ${CMAKE_CURRENT_LIST_DIR}/RiuPickItemInfo.h + ${CMAKE_CURRENT_LIST_DIR}/RiuWellLogPlot.h + ${CMAKE_CURRENT_LIST_DIR}/RiuWellLogTrack.h + ${CMAKE_CURRENT_LIST_DIR}/RiuMultiPlotPage.h + ${CMAKE_CURRENT_LIST_DIR}/RiuMultiPlotBook.h + ${CMAKE_CURRENT_LIST_DIR}/RiuQwtPlotWidget.h + ${CMAKE_CURRENT_LIST_DIR}/RiuQwtPlotLegend.h + ${CMAKE_CURRENT_LIST_DIR}/RiuPlotAnnotationTool.h + ${CMAKE_CURRENT_LIST_DIR}/RiuGeoMechXfTensorResultAccessor.h + ${CMAKE_CURRENT_LIST_DIR}/RiuFemTimeHistoryResultAccessor.h + ${CMAKE_CURRENT_LIST_DIR}/RiuEditPerforationCollectionWidget.h + ${CMAKE_CURRENT_LIST_DIR}/RiuAdvancedSnapshotExportWidget.h + ${CMAKE_CURRENT_LIST_DIR}/RiuWellAllocationPlot.h + ${CMAKE_CURRENT_LIST_DIR}/RiuFlowCharacteristicsPlot.h + ${CMAKE_CURRENT_LIST_DIR}/RiuNightchartsWidget.h + ${CMAKE_CURRENT_LIST_DIR}/RiuMessagePanel.h + ${CMAKE_CURRENT_LIST_DIR}/RiuPlotObjectPicker.h + ${CMAKE_CURRENT_LIST_DIR}/RiuContextMenuLauncher.h + ${CMAKE_CURRENT_LIST_DIR}/RiuSummaryCurveDefinitionKeywords.h + ${CMAKE_CURRENT_LIST_DIR}/RiuSummaryVectorSelectionUi.h + ${CMAKE_CURRENT_LIST_DIR}/RiuSummaryVectorSelectionDialog.h + ${CMAKE_CURRENT_LIST_DIR}/RiuSummaryVectorSelectionWidgetCreator.h + ${CMAKE_CURRENT_LIST_DIR}/RiuSummaryQuantityNameInfoProvider.h + ${CMAKE_CURRENT_LIST_DIR}/RiuExpressionContextMenuManager.h + ${CMAKE_CURRENT_LIST_DIR}/RiuCalculationsContextMenuManager.h + ${CMAKE_CURRENT_LIST_DIR}/RiuGridStatisticsHistogramWidget.h + ${CMAKE_CURRENT_LIST_DIR}/RiuTools.h + ${CMAKE_CURRENT_LIST_DIR}/RiuMohrsCirclePlot.h + ${CMAKE_CURRENT_LIST_DIR}/RiuPlotMainWindowTools.h + ${CMAKE_CURRENT_LIST_DIR}/Riu3DMainWindowTools.h + ${CMAKE_CURRENT_LIST_DIR}/RiuDockWidgetTools.h + ${CMAKE_CURRENT_LIST_DIR}/RiuQwtPlotItemGroup.h + ${CMAKE_CURRENT_LIST_DIR}/RiuQwtPlotTools.h + ${CMAKE_CURRENT_LIST_DIR}/RiuWellPathComponentPlotItem.h + ${CMAKE_CURRENT_LIST_DIR}/RiuMeasurementViewEventFilter.h + ${CMAKE_CURRENT_LIST_DIR}/RiuDraggableOverlayFrame.h + ${CMAKE_CURRENT_LIST_DIR}/RiuMdiMaximizeWindowGuard.h + ${CMAKE_CURRENT_LIST_DIR}/RiuMainWindowTools.h + ${CMAKE_CURRENT_LIST_DIR}/RiuComparisonViewMover.h + ${CMAKE_CURRENT_LIST_DIR}/RiuAbstractOverlayContentFrame.h + ${CMAKE_CURRENT_LIST_DIR}/RiuAbstractLegendFrame.h + ${CMAKE_CURRENT_LIST_DIR}/RiuCategoryLegendFrame.h + ${CMAKE_CURRENT_LIST_DIR}/RiuScalarMapperLegendFrame.h + ${CMAKE_CURRENT_LIST_DIR}/RiuFileDialogTools.h + ${CMAKE_CURRENT_LIST_DIR}/RiuGuiTheme.h + ${CMAKE_CURRENT_LIST_DIR}/RiuQssSyntaxHighlighter.h) -set (SOURCE_GROUP_HEADER_FILES -${CMAKE_CURRENT_LIST_DIR}/RiuCadNavigation.h -${CMAKE_CURRENT_LIST_DIR}/RiuCursors.h -${CMAKE_CURRENT_LIST_DIR}/RiuDragDrop.h -${CMAKE_CURRENT_LIST_DIR}/RiuFemResultTextBuilder.h -${CMAKE_CURRENT_LIST_DIR}/RiuGeoQuestNavigation.h -${CMAKE_CURRENT_LIST_DIR}/RiuInterfaceToViewWindow.h -${CMAKE_CURRENT_LIST_DIR}/RiuQwtSymbol.h -${CMAKE_CURRENT_LIST_DIR}/RiuQwtPlotCurve.h -${CMAKE_CURRENT_LIST_DIR}/RiuQwtPlotCurveDefines.h -${CMAKE_CURRENT_LIST_DIR}/RiuRimQwtPlotCurve.h -${CMAKE_CURRENT_LIST_DIR}/RiuPlotMainWindow.h -${CMAKE_CURRENT_LIST_DIR}/RiuMainWindow.h -${CMAKE_CURRENT_LIST_DIR}/RiuMainWindowBase.h -${CMAKE_CURRENT_LIST_DIR}/RiuMdiArea.h -${CMAKE_CURRENT_LIST_DIR}/RiuMdiSubWindow.h -${CMAKE_CURRENT_LIST_DIR}/RiuProcessMonitor.h -${CMAKE_CURRENT_LIST_DIR}/RiuProjectPropertyView.h -${CMAKE_CURRENT_LIST_DIR}/RiuPropertyViewTabWidget.h -${CMAKE_CURRENT_LIST_DIR}/RiuPvtPlotPanel.h -${CMAKE_CURRENT_LIST_DIR}/RiuPvtPlotUpdater.h -${CMAKE_CURRENT_LIST_DIR}/RiuQwtLinearScaleEngine.h -${CMAKE_CURRENT_LIST_DIR}/RiuQwtScalePicker.h -${CMAKE_CURRENT_LIST_DIR}/RiuQwtCurvePointTracker.h -${CMAKE_CURRENT_LIST_DIR}/RiuQwtPlotWheelZoomer.h -${CMAKE_CURRENT_LIST_DIR}/RiuQwtPlotZoomer.h -${CMAKE_CURRENT_LIST_DIR}/RiuWidgetDragger.h -${CMAKE_CURRENT_LIST_DIR}/RiuRecentFileActionProvider.h -${CMAKE_CURRENT_LIST_DIR}/RiuRelativePermeabilityPlotPanel.h -${CMAKE_CURRENT_LIST_DIR}/RiuRelativePermeabilityPlotUpdater.h -${CMAKE_CURRENT_LIST_DIR}/RiuResultInfoPanel.h -${CMAKE_CURRENT_LIST_DIR}/RiuResultQwtPlot.h -${CMAKE_CURRENT_LIST_DIR}/RiuResultTextBuilder.h -${CMAKE_CURRENT_LIST_DIR}/RiuRmsNavigation.h -${CMAKE_CURRENT_LIST_DIR}/RiuSelectionChangedHandler.h -${CMAKE_CURRENT_LIST_DIR}/Riu3dSelectionManager.h -${CMAKE_CURRENT_LIST_DIR}/RiuSimpleHistogramWidget.h -${CMAKE_CURRENT_LIST_DIR}/RiuDockedQwtPlot.h -${CMAKE_CURRENT_LIST_DIR}/RiuGridCrossQwtPlot.h -${CMAKE_CURRENT_LIST_DIR}/RiuSummaryQwtPlot.h -${CMAKE_CURRENT_LIST_DIR}/RiuTextDialog.h -${CMAKE_CURRENT_LIST_DIR}/RiuTimeStepChangedHandler.h -${CMAKE_CURRENT_LIST_DIR}/RiuTofAccumulatedPhaseFractionsPlot.h -${CMAKE_CURRENT_LIST_DIR}/RiuToolTipMenu.h -${CMAKE_CURRENT_LIST_DIR}/RiuTreeViewEventFilter.h -${CMAKE_CURRENT_LIST_DIR}/RiuViewer.h -${CMAKE_CURRENT_LIST_DIR}/RiuViewerToViewInterface.h -${CMAKE_CURRENT_LIST_DIR}/RiuViewerCommands.h -${CMAKE_CURRENT_LIST_DIR}/RiuCellAndNncPickEventHandler.h -${CMAKE_CURRENT_LIST_DIR}/RiuPickItemInfo.h -${CMAKE_CURRENT_LIST_DIR}/RiuWellLogPlot.h -${CMAKE_CURRENT_LIST_DIR}/RiuWellLogTrack.h -${CMAKE_CURRENT_LIST_DIR}/RiuMultiPlotPage.h -${CMAKE_CURRENT_LIST_DIR}/RiuMultiPlotBook.h -${CMAKE_CURRENT_LIST_DIR}/RiuQwtPlotWidget.h -${CMAKE_CURRENT_LIST_DIR}/RiuQwtPlotLegend.h -${CMAKE_CURRENT_LIST_DIR}/RiuPlotAnnotationTool.h -${CMAKE_CURRENT_LIST_DIR}/RiuGeoMechXfTensorResultAccessor.h -${CMAKE_CURRENT_LIST_DIR}/RiuFemTimeHistoryResultAccessor.h -${CMAKE_CURRENT_LIST_DIR}/RiuEditPerforationCollectionWidget.h -${CMAKE_CURRENT_LIST_DIR}/RiuAdvancedSnapshotExportWidget.h -${CMAKE_CURRENT_LIST_DIR}/RiuWellAllocationPlot.h -${CMAKE_CURRENT_LIST_DIR}/RiuFlowCharacteristicsPlot.h -${CMAKE_CURRENT_LIST_DIR}/RiuNightchartsWidget.h -${CMAKE_CURRENT_LIST_DIR}/RiuMessagePanel.h -${CMAKE_CURRENT_LIST_DIR}/RiuPlotObjectPicker.h -${CMAKE_CURRENT_LIST_DIR}/RiuContextMenuLauncher.h -${CMAKE_CURRENT_LIST_DIR}/RiuSummaryCurveDefinitionKeywords.h -${CMAKE_CURRENT_LIST_DIR}/RiuSummaryVectorSelectionUi.h -${CMAKE_CURRENT_LIST_DIR}/RiuSummaryVectorSelectionDialog.h -${CMAKE_CURRENT_LIST_DIR}/RiuSummaryVectorSelectionWidgetCreator.h -${CMAKE_CURRENT_LIST_DIR}/RiuSummaryQuantityNameInfoProvider.h -${CMAKE_CURRENT_LIST_DIR}/RiuExpressionContextMenuManager.h -${CMAKE_CURRENT_LIST_DIR}/RiuCalculationsContextMenuManager.h -${CMAKE_CURRENT_LIST_DIR}/RiuGridStatisticsHistogramWidget.h -${CMAKE_CURRENT_LIST_DIR}/RiuTools.h -${CMAKE_CURRENT_LIST_DIR}/RiuMohrsCirclePlot.h -${CMAKE_CURRENT_LIST_DIR}/RiuPlotMainWindowTools.h -${CMAKE_CURRENT_LIST_DIR}/Riu3DMainWindowTools.h -${CMAKE_CURRENT_LIST_DIR}/RiuDockWidgetTools.h -${CMAKE_CURRENT_LIST_DIR}/RiuQwtPlotItemGroup.h -${CMAKE_CURRENT_LIST_DIR}/RiuQwtPlotTools.h -${CMAKE_CURRENT_LIST_DIR}/RiuWellPathComponentPlotItem.h -${CMAKE_CURRENT_LIST_DIR}/RiuMeasurementViewEventFilter.h -${CMAKE_CURRENT_LIST_DIR}/RiuDraggableOverlayFrame.h -${CMAKE_CURRENT_LIST_DIR}/RiuMdiMaximizeWindowGuard.h -${CMAKE_CURRENT_LIST_DIR}/RiuMainWindowTools.h -${CMAKE_CURRENT_LIST_DIR}/RiuComparisonViewMover.h -${CMAKE_CURRENT_LIST_DIR}/RiuAbstractOverlayContentFrame.h -${CMAKE_CURRENT_LIST_DIR}/RiuAbstractLegendFrame.h -${CMAKE_CURRENT_LIST_DIR}/RiuCategoryLegendFrame.h -${CMAKE_CURRENT_LIST_DIR}/RiuScalarMapperLegendFrame.h -${CMAKE_CURRENT_LIST_DIR}/RiuFileDialogTools.h -${CMAKE_CURRENT_LIST_DIR}/RiuGuiTheme.h -${CMAKE_CURRENT_LIST_DIR}/RiuQssSyntaxHighlighter.h -) - -set (SOURCE_GROUP_SOURCE_FILES -${CMAKE_CURRENT_LIST_DIR}/RiuCadNavigation.cpp -${CMAKE_CURRENT_LIST_DIR}/RiuCursors.cpp -${CMAKE_CURRENT_LIST_DIR}/RiuDragDrop.cpp -${CMAKE_CURRENT_LIST_DIR}/RiuFemResultTextBuilder.cpp -${CMAKE_CURRENT_LIST_DIR}/RiuGeoQuestNavigation.cpp -${CMAKE_CURRENT_LIST_DIR}/RiuInterfaceToViewWindow.cpp -${CMAKE_CURRENT_LIST_DIR}/RiuQwtSymbol.cpp -${CMAKE_CURRENT_LIST_DIR}/RiuQwtPlotCurve.cpp -${CMAKE_CURRENT_LIST_DIR}/RiuQwtPlotCurveDefines.cpp -${CMAKE_CURRENT_LIST_DIR}/RiuRimQwtPlotCurve.cpp -${CMAKE_CURRENT_LIST_DIR}/RiuPlotMainWindow.cpp -${CMAKE_CURRENT_LIST_DIR}/RiuMainWindow.cpp -${CMAKE_CURRENT_LIST_DIR}/RiuMainWindowBase.cpp -${CMAKE_CURRENT_LIST_DIR}/RiuMdiArea.cpp -${CMAKE_CURRENT_LIST_DIR}/RiuMdiSubWindow.cpp -${CMAKE_CURRENT_LIST_DIR}/RiuProcessMonitor.cpp -${CMAKE_CURRENT_LIST_DIR}/RiuProjectPropertyView.cpp -${CMAKE_CURRENT_LIST_DIR}/RiuPropertyViewTabWidget.cpp -${CMAKE_CURRENT_LIST_DIR}/RiuPvtPlotPanel.cpp -${CMAKE_CURRENT_LIST_DIR}/RiuPvtPlotUpdater.cpp -${CMAKE_CURRENT_LIST_DIR}/RiuQwtLinearScaleEngine.cpp -${CMAKE_CURRENT_LIST_DIR}/RiuQwtScalePicker.cpp -${CMAKE_CURRENT_LIST_DIR}/RiuQwtCurvePointTracker.cpp -${CMAKE_CURRENT_LIST_DIR}/RiuQwtPlotWheelZoomer.cpp -${CMAKE_CURRENT_LIST_DIR}/RiuWidgetDragger.cpp -${CMAKE_CURRENT_LIST_DIR}/RiuRecentFileActionProvider.cpp -${CMAKE_CURRENT_LIST_DIR}/RiuRelativePermeabilityPlotPanel.cpp -${CMAKE_CURRENT_LIST_DIR}/RiuRelativePermeabilityPlotUpdater.cpp -${CMAKE_CURRENT_LIST_DIR}/RiuResultInfoPanel.cpp -${CMAKE_CURRENT_LIST_DIR}/RiuResultQwtPlot.cpp -${CMAKE_CURRENT_LIST_DIR}/RiuResultTextBuilder.cpp -${CMAKE_CURRENT_LIST_DIR}/RiuRmsNavigation.cpp -${CMAKE_CURRENT_LIST_DIR}/RiuSelectionChangedHandler.cpp -${CMAKE_CURRENT_LIST_DIR}/Riu3dSelectionManager.cpp -${CMAKE_CURRENT_LIST_DIR}/RiuSimpleHistogramWidget.cpp -${CMAKE_CURRENT_LIST_DIR}/RiuDockedQwtPlot.cpp -${CMAKE_CURRENT_LIST_DIR}/RiuGridCrossQwtPlot.cpp -${CMAKE_CURRENT_LIST_DIR}/RiuSummaryQwtPlot.cpp -${CMAKE_CURRENT_LIST_DIR}/RiuTextDialog.cpp -${CMAKE_CURRENT_LIST_DIR}/RiuTimeStepChangedHandler.cpp -${CMAKE_CURRENT_LIST_DIR}/RiuTofAccumulatedPhaseFractionsPlot.cpp -${CMAKE_CURRENT_LIST_DIR}/RiuToolTipMenu.cpp -${CMAKE_CURRENT_LIST_DIR}/RiuTreeViewEventFilter.cpp -${CMAKE_CURRENT_LIST_DIR}/RiuViewer.cpp -${CMAKE_CURRENT_LIST_DIR}/RiuViewerCommands.cpp -${CMAKE_CURRENT_LIST_DIR}/RiuCellAndNncPickEventHandler.cpp -${CMAKE_CURRENT_LIST_DIR}/RiuPickItemInfo.cpp -${CMAKE_CURRENT_LIST_DIR}/RiuWellLogTrack.cpp -${CMAKE_CURRENT_LIST_DIR}/RiuWellLogPlot.cpp -${CMAKE_CURRENT_LIST_DIR}/RiuMultiPlotPage.cpp -${CMAKE_CURRENT_LIST_DIR}/RiuMultiPlotBook.cpp -${CMAKE_CURRENT_LIST_DIR}/RiuQwtPlotWidget.cpp -${CMAKE_CURRENT_LIST_DIR}/RiuQwtPlotLegend.cpp -${CMAKE_CURRENT_LIST_DIR}/RiuPlotAnnotationTool.cpp -${CMAKE_CURRENT_LIST_DIR}/RiuGeoMechXfTensorResultAccessor.cpp -${CMAKE_CURRENT_LIST_DIR}/RiuFemTimeHistoryResultAccessor.cpp -${CMAKE_CURRENT_LIST_DIR}/RiuEditPerforationCollectionWidget.cpp -${CMAKE_CURRENT_LIST_DIR}/RiuAdvancedSnapshotExportWidget.cpp -${CMAKE_CURRENT_LIST_DIR}/RiuWellAllocationPlot.cpp -${CMAKE_CURRENT_LIST_DIR}/RiuFlowCharacteristicsPlot.cpp -${CMAKE_CURRENT_LIST_DIR}/RiuNightchartsWidget.cpp -${CMAKE_CURRENT_LIST_DIR}/RiuMessagePanel.cpp -${CMAKE_CURRENT_LIST_DIR}/RiuPlotObjectPicker.cpp -${CMAKE_CURRENT_LIST_DIR}/RiuContextMenuLauncher.cpp -${CMAKE_CURRENT_LIST_DIR}/RiuSummaryVectorSelectionUi.cpp -${CMAKE_CURRENT_LIST_DIR}/RiuSummaryVectorSelectionDialog.cpp -${CMAKE_CURRENT_LIST_DIR}/RiuSummaryVectorSelectionWidgetCreator.cpp -${CMAKE_CURRENT_LIST_DIR}/RiuSummaryQuantityNameInfoProvider.cpp -${CMAKE_CURRENT_LIST_DIR}/RiuExpressionContextMenuManager.cpp -${CMAKE_CURRENT_LIST_DIR}/RiuCalculationsContextMenuManager.cpp -${CMAKE_CURRENT_LIST_DIR}/RiuGridStatisticsHistogramWidget.cpp -${CMAKE_CURRENT_LIST_DIR}/RiuTools.cpp -${CMAKE_CURRENT_LIST_DIR}/RiuMohrsCirclePlot.cpp -${CMAKE_CURRENT_LIST_DIR}/RiuPlotMainWindowTools.cpp -${CMAKE_CURRENT_LIST_DIR}/Riu3DMainWindowTools.cpp -${CMAKE_CURRENT_LIST_DIR}/RiuDockWidgetTools.cpp -${CMAKE_CURRENT_LIST_DIR}/RiuQwtPlotItemGroup.cpp -${CMAKE_CURRENT_LIST_DIR}/RiuQwtPlotTools.cpp -${CMAKE_CURRENT_LIST_DIR}/RiuWellPathComponentPlotItem.cpp -${CMAKE_CURRENT_LIST_DIR}/RiuDraggableOverlayFrame.cpp -${CMAKE_CURRENT_LIST_DIR}/RiuMdiMaximizeWindowGuard.cpp -${CMAKE_CURRENT_LIST_DIR}/RiuMainWindowTools.cpp -${CMAKE_CURRENT_LIST_DIR}/RiuComparisonViewMover.cpp -${CMAKE_CURRENT_LIST_DIR}/RiuAbstractOverlayContentFrame.cpp -${CMAKE_CURRENT_LIST_DIR}/RiuAbstractLegendFrame.cpp -${CMAKE_CURRENT_LIST_DIR}/RiuCategoryLegendFrame.cpp -${CMAKE_CURRENT_LIST_DIR}/RiuScalarMapperLegendFrame.cpp -${CMAKE_CURRENT_LIST_DIR}/RiuFileDialogTools.cpp -${CMAKE_CURRENT_LIST_DIR}/RiuGuiTheme.cpp -${CMAKE_CURRENT_LIST_DIR}/RiuQssSyntaxHighlighter.cpp -${CMAKE_CURRENT_LIST_DIR}/RiuTextEditWithCompletion.cpp -${CMAKE_CURRENT_LIST_DIR}/RiuTextContentFrame.cpp -) - +set(SOURCE_GROUP_SOURCE_FILES + ${CMAKE_CURRENT_LIST_DIR}/RiuCadNavigation.cpp + ${CMAKE_CURRENT_LIST_DIR}/RiuCursors.cpp + ${CMAKE_CURRENT_LIST_DIR}/RiuDragDrop.cpp + ${CMAKE_CURRENT_LIST_DIR}/RiuFemResultTextBuilder.cpp + ${CMAKE_CURRENT_LIST_DIR}/RiuGeoQuestNavigation.cpp + ${CMAKE_CURRENT_LIST_DIR}/RiuInterfaceToViewWindow.cpp + ${CMAKE_CURRENT_LIST_DIR}/RiuQwtSymbol.cpp + ${CMAKE_CURRENT_LIST_DIR}/RiuQwtPlotCurve.cpp + ${CMAKE_CURRENT_LIST_DIR}/RiuQwtPlotCurveDefines.cpp + ${CMAKE_CURRENT_LIST_DIR}/RiuRimQwtPlotCurve.cpp + ${CMAKE_CURRENT_LIST_DIR}/RiuPlotMainWindow.cpp + ${CMAKE_CURRENT_LIST_DIR}/RiuMainWindow.cpp + ${CMAKE_CURRENT_LIST_DIR}/RiuMainWindowBase.cpp + ${CMAKE_CURRENT_LIST_DIR}/RiuMdiArea.cpp + ${CMAKE_CURRENT_LIST_DIR}/RiuMdiSubWindow.cpp + ${CMAKE_CURRENT_LIST_DIR}/RiuProcessMonitor.cpp + ${CMAKE_CURRENT_LIST_DIR}/RiuProjectPropertyView.cpp + ${CMAKE_CURRENT_LIST_DIR}/RiuPropertyViewTabWidget.cpp + ${CMAKE_CURRENT_LIST_DIR}/RiuPvtPlotPanel.cpp + ${CMAKE_CURRENT_LIST_DIR}/RiuPvtPlotUpdater.cpp + ${CMAKE_CURRENT_LIST_DIR}/RiuQwtLinearScaleEngine.cpp + ${CMAKE_CURRENT_LIST_DIR}/RiuQwtScalePicker.cpp + ${CMAKE_CURRENT_LIST_DIR}/RiuQwtCurvePointTracker.cpp + ${CMAKE_CURRENT_LIST_DIR}/RiuQwtPlotWheelZoomer.cpp + ${CMAKE_CURRENT_LIST_DIR}/RiuWidgetDragger.cpp + ${CMAKE_CURRENT_LIST_DIR}/RiuRecentFileActionProvider.cpp + ${CMAKE_CURRENT_LIST_DIR}/RiuRelativePermeabilityPlotPanel.cpp + ${CMAKE_CURRENT_LIST_DIR}/RiuRelativePermeabilityPlotUpdater.cpp + ${CMAKE_CURRENT_LIST_DIR}/RiuResultInfoPanel.cpp + ${CMAKE_CURRENT_LIST_DIR}/RiuResultQwtPlot.cpp + ${CMAKE_CURRENT_LIST_DIR}/RiuResultTextBuilder.cpp + ${CMAKE_CURRENT_LIST_DIR}/RiuRmsNavigation.cpp + ${CMAKE_CURRENT_LIST_DIR}/RiuSelectionChangedHandler.cpp + ${CMAKE_CURRENT_LIST_DIR}/Riu3dSelectionManager.cpp + ${CMAKE_CURRENT_LIST_DIR}/RiuSimpleHistogramWidget.cpp + ${CMAKE_CURRENT_LIST_DIR}/RiuDockedQwtPlot.cpp + ${CMAKE_CURRENT_LIST_DIR}/RiuGridCrossQwtPlot.cpp + ${CMAKE_CURRENT_LIST_DIR}/RiuSummaryQwtPlot.cpp + ${CMAKE_CURRENT_LIST_DIR}/RiuTextDialog.cpp + ${CMAKE_CURRENT_LIST_DIR}/RiuTimeStepChangedHandler.cpp + ${CMAKE_CURRENT_LIST_DIR}/RiuTofAccumulatedPhaseFractionsPlot.cpp + ${CMAKE_CURRENT_LIST_DIR}/RiuToolTipMenu.cpp + ${CMAKE_CURRENT_LIST_DIR}/RiuTreeViewEventFilter.cpp + ${CMAKE_CURRENT_LIST_DIR}/RiuViewer.cpp + ${CMAKE_CURRENT_LIST_DIR}/RiuViewerCommands.cpp + ${CMAKE_CURRENT_LIST_DIR}/RiuCellAndNncPickEventHandler.cpp + ${CMAKE_CURRENT_LIST_DIR}/RiuPickItemInfo.cpp + ${CMAKE_CURRENT_LIST_DIR}/RiuWellLogTrack.cpp + ${CMAKE_CURRENT_LIST_DIR}/RiuWellLogPlot.cpp + ${CMAKE_CURRENT_LIST_DIR}/RiuMultiPlotPage.cpp + ${CMAKE_CURRENT_LIST_DIR}/RiuMultiPlotBook.cpp + ${CMAKE_CURRENT_LIST_DIR}/RiuQwtPlotWidget.cpp + ${CMAKE_CURRENT_LIST_DIR}/RiuQwtPlotLegend.cpp + ${CMAKE_CURRENT_LIST_DIR}/RiuPlotAnnotationTool.cpp + ${CMAKE_CURRENT_LIST_DIR}/RiuGeoMechXfTensorResultAccessor.cpp + ${CMAKE_CURRENT_LIST_DIR}/RiuFemTimeHistoryResultAccessor.cpp + ${CMAKE_CURRENT_LIST_DIR}/RiuEditPerforationCollectionWidget.cpp + ${CMAKE_CURRENT_LIST_DIR}/RiuAdvancedSnapshotExportWidget.cpp + ${CMAKE_CURRENT_LIST_DIR}/RiuWellAllocationPlot.cpp + ${CMAKE_CURRENT_LIST_DIR}/RiuFlowCharacteristicsPlot.cpp + ${CMAKE_CURRENT_LIST_DIR}/RiuNightchartsWidget.cpp + ${CMAKE_CURRENT_LIST_DIR}/RiuMessagePanel.cpp + ${CMAKE_CURRENT_LIST_DIR}/RiuPlotObjectPicker.cpp + ${CMAKE_CURRENT_LIST_DIR}/RiuContextMenuLauncher.cpp + ${CMAKE_CURRENT_LIST_DIR}/RiuSummaryVectorSelectionUi.cpp + ${CMAKE_CURRENT_LIST_DIR}/RiuSummaryVectorSelectionDialog.cpp + ${CMAKE_CURRENT_LIST_DIR}/RiuSummaryVectorSelectionWidgetCreator.cpp + ${CMAKE_CURRENT_LIST_DIR}/RiuSummaryQuantityNameInfoProvider.cpp + ${CMAKE_CURRENT_LIST_DIR}/RiuExpressionContextMenuManager.cpp + ${CMAKE_CURRENT_LIST_DIR}/RiuCalculationsContextMenuManager.cpp + ${CMAKE_CURRENT_LIST_DIR}/RiuGridStatisticsHistogramWidget.cpp + ${CMAKE_CURRENT_LIST_DIR}/RiuTools.cpp + ${CMAKE_CURRENT_LIST_DIR}/RiuMohrsCirclePlot.cpp + ${CMAKE_CURRENT_LIST_DIR}/RiuPlotMainWindowTools.cpp + ${CMAKE_CURRENT_LIST_DIR}/Riu3DMainWindowTools.cpp + ${CMAKE_CURRENT_LIST_DIR}/RiuDockWidgetTools.cpp + ${CMAKE_CURRENT_LIST_DIR}/RiuQwtPlotItemGroup.cpp + ${CMAKE_CURRENT_LIST_DIR}/RiuQwtPlotTools.cpp + ${CMAKE_CURRENT_LIST_DIR}/RiuWellPathComponentPlotItem.cpp + ${CMAKE_CURRENT_LIST_DIR}/RiuDraggableOverlayFrame.cpp + ${CMAKE_CURRENT_LIST_DIR}/RiuMdiMaximizeWindowGuard.cpp + ${CMAKE_CURRENT_LIST_DIR}/RiuMainWindowTools.cpp + ${CMAKE_CURRENT_LIST_DIR}/RiuComparisonViewMover.cpp + ${CMAKE_CURRENT_LIST_DIR}/RiuAbstractOverlayContentFrame.cpp + ${CMAKE_CURRENT_LIST_DIR}/RiuAbstractLegendFrame.cpp + ${CMAKE_CURRENT_LIST_DIR}/RiuCategoryLegendFrame.cpp + ${CMAKE_CURRENT_LIST_DIR}/RiuScalarMapperLegendFrame.cpp + ${CMAKE_CURRENT_LIST_DIR}/RiuFileDialogTools.cpp + ${CMAKE_CURRENT_LIST_DIR}/RiuGuiTheme.cpp + ${CMAKE_CURRENT_LIST_DIR}/RiuQssSyntaxHighlighter.cpp + ${CMAKE_CURRENT_LIST_DIR}/RiuTextEditWithCompletion.cpp + ${CMAKE_CURRENT_LIST_DIR}/RiuTextContentFrame.cpp) if(Qt5Charts_FOUND) - list(APPEND CODE_HEADER_FILES - ${CMAKE_CURRENT_LIST_DIR}/RiuQtChartView.h) + list(APPEND CODE_HEADER_FILES ${CMAKE_CURRENT_LIST_DIR}/RiuQtChartView.h) - list(APPEND CODE_SOURCE_FILES - ${CMAKE_CURRENT_LIST_DIR}/RiuQtChartView.cpp) + list(APPEND CODE_SOURCE_FILES ${CMAKE_CURRENT_LIST_DIR}/RiuQtChartView.cpp) -# list(APPEND QT_MOC_HEADERS -# ${CMAKE_CURRENT_LIST_DIR}/RiuQtChartView.h) + # list(APPEND QT_MOC_HEADERS ${CMAKE_CURRENT_LIST_DIR}/RiuQtChartView.h) endif() +list(APPEND CODE_HEADER_FILES ${SOURCE_GROUP_HEADER_FILES}) +list(APPEND CODE_SOURCE_FILES ${SOURCE_GROUP_SOURCE_FILES}) -list(APPEND CODE_HEADER_FILES -${SOURCE_GROUP_HEADER_FILES} -) - -list(APPEND CODE_SOURCE_FILES -${SOURCE_GROUP_SOURCE_FILES} -) - - -list(APPEND QT_MOC_HEADERS -${CMAKE_CURRENT_LIST_DIR}/RiuMainWindowBase.h -${CMAKE_CURRENT_LIST_DIR}/RiuMainWindow.h -${CMAKE_CURRENT_LIST_DIR}/RiuPlotMainWindow.h -${CMAKE_CURRENT_LIST_DIR}/RiuMdiArea.h -${CMAKE_CURRENT_LIST_DIR}/RiuMdiSubWindow.h -${CMAKE_CURRENT_LIST_DIR}/RiuPvtPlotPanel.h -${CMAKE_CURRENT_LIST_DIR}/RiuRelativePermeabilityPlotPanel.h -${CMAKE_CURRENT_LIST_DIR}/RiuResultInfoPanel.h -${CMAKE_CURRENT_LIST_DIR}/RiuResultQwtPlot.h -${CMAKE_CURRENT_LIST_DIR}/RiuTextDialog.h -${CMAKE_CURRENT_LIST_DIR}/RiuViewer.h -${CMAKE_CURRENT_LIST_DIR}/RiuProcessMonitor.h -${CMAKE_CURRENT_LIST_DIR}/RiuViewerCommands.h -${CMAKE_CURRENT_LIST_DIR}/RiuTreeViewEventFilter.h -${CMAKE_CURRENT_LIST_DIR}/RiuWellLogPlot.h -${CMAKE_CURRENT_LIST_DIR}/RiuWellLogTrack.h -${CMAKE_CURRENT_LIST_DIR}/RiuMultiPlotPage.h -${CMAKE_CURRENT_LIST_DIR}/RiuMultiPlotBook.h -${CMAKE_CURRENT_LIST_DIR}/RiuQwtPlotWidget.h -${CMAKE_CURRENT_LIST_DIR}/RiuQwtPlotLegend.h -${CMAKE_CURRENT_LIST_DIR}/RiuRecentFileActionProvider.h -${CMAKE_CURRENT_LIST_DIR}/RiuDockedQwtPlot.h -${CMAKE_CURRENT_LIST_DIR}/RiuGridCrossQwtPlot.h -${CMAKE_CURRENT_LIST_DIR}/RiuSummaryQwtPlot.h -${CMAKE_CURRENT_LIST_DIR}/RiuTofAccumulatedPhaseFractionsPlot.h -${CMAKE_CURRENT_LIST_DIR}/RiuQwtScalePicker.h -${CMAKE_CURRENT_LIST_DIR}/RiuQwtPlotWheelZoomer.h -${CMAKE_CURRENT_LIST_DIR}/RiuWidgetDragger.h -${CMAKE_CURRENT_LIST_DIR}/RiuEditPerforationCollectionWidget.h -${CMAKE_CURRENT_LIST_DIR}/RiuAdvancedSnapshotExportWidget.h -${CMAKE_CURRENT_LIST_DIR}/RiuWellAllocationPlot.h -${CMAKE_CURRENT_LIST_DIR}/RiuFlowCharacteristicsPlot.h -${CMAKE_CURRENT_LIST_DIR}/RiuNightchartsWidget.h -${CMAKE_CURRENT_LIST_DIR}/RiuMessagePanel.h -${CMAKE_CURRENT_LIST_DIR}/RiuExpressionContextMenuManager.h -${CMAKE_CURRENT_LIST_DIR}/RiuCalculationsContextMenuManager.h -${CMAKE_CURRENT_LIST_DIR}/RiuMohrsCirclePlot.h -${CMAKE_CURRENT_LIST_DIR}/RiuDraggableOverlayFrame.h -${CMAKE_CURRENT_LIST_DIR}/RiuAbstractOverlayContentFrame.h -${CMAKE_CURRENT_LIST_DIR}/RiuAbstractLegendFrame.h -${CMAKE_CURRENT_LIST_DIR}/RiuCategoryLegendFrame.h -${CMAKE_CURRENT_LIST_DIR}/RiuScalarMapperLegendFrame.h -${CMAKE_CURRENT_LIST_DIR}/RiuTextEditWithCompletion.h -${CMAKE_CURRENT_LIST_DIR}/RiuTextContentFrame.h -) - -list(APPEND QT_UI_FILES -) - - - +list( + APPEND + QT_MOC_HEADERS + ${CMAKE_CURRENT_LIST_DIR}/RiuMainWindowBase.h + ${CMAKE_CURRENT_LIST_DIR}/RiuMainWindow.h + ${CMAKE_CURRENT_LIST_DIR}/RiuPlotMainWindow.h + ${CMAKE_CURRENT_LIST_DIR}/RiuMdiArea.h + ${CMAKE_CURRENT_LIST_DIR}/RiuMdiSubWindow.h + ${CMAKE_CURRENT_LIST_DIR}/RiuPvtPlotPanel.h + ${CMAKE_CURRENT_LIST_DIR}/RiuRelativePermeabilityPlotPanel.h + ${CMAKE_CURRENT_LIST_DIR}/RiuResultInfoPanel.h + ${CMAKE_CURRENT_LIST_DIR}/RiuResultQwtPlot.h + ${CMAKE_CURRENT_LIST_DIR}/RiuTextDialog.h + ${CMAKE_CURRENT_LIST_DIR}/RiuViewer.h + ${CMAKE_CURRENT_LIST_DIR}/RiuProcessMonitor.h + ${CMAKE_CURRENT_LIST_DIR}/RiuViewerCommands.h + ${CMAKE_CURRENT_LIST_DIR}/RiuTreeViewEventFilter.h + ${CMAKE_CURRENT_LIST_DIR}/RiuWellLogPlot.h + ${CMAKE_CURRENT_LIST_DIR}/RiuWellLogTrack.h + ${CMAKE_CURRENT_LIST_DIR}/RiuMultiPlotPage.h + ${CMAKE_CURRENT_LIST_DIR}/RiuMultiPlotBook.h + ${CMAKE_CURRENT_LIST_DIR}/RiuQwtPlotWidget.h + ${CMAKE_CURRENT_LIST_DIR}/RiuQwtPlotLegend.h + ${CMAKE_CURRENT_LIST_DIR}/RiuRecentFileActionProvider.h + ${CMAKE_CURRENT_LIST_DIR}/RiuDockedQwtPlot.h + ${CMAKE_CURRENT_LIST_DIR}/RiuGridCrossQwtPlot.h + ${CMAKE_CURRENT_LIST_DIR}/RiuSummaryQwtPlot.h + ${CMAKE_CURRENT_LIST_DIR}/RiuTofAccumulatedPhaseFractionsPlot.h + ${CMAKE_CURRENT_LIST_DIR}/RiuQwtScalePicker.h + ${CMAKE_CURRENT_LIST_DIR}/RiuQwtPlotWheelZoomer.h + ${CMAKE_CURRENT_LIST_DIR}/RiuWidgetDragger.h + ${CMAKE_CURRENT_LIST_DIR}/RiuEditPerforationCollectionWidget.h + ${CMAKE_CURRENT_LIST_DIR}/RiuAdvancedSnapshotExportWidget.h + ${CMAKE_CURRENT_LIST_DIR}/RiuWellAllocationPlot.h + ${CMAKE_CURRENT_LIST_DIR}/RiuFlowCharacteristicsPlot.h + ${CMAKE_CURRENT_LIST_DIR}/RiuNightchartsWidget.h + ${CMAKE_CURRENT_LIST_DIR}/RiuMessagePanel.h + ${CMAKE_CURRENT_LIST_DIR}/RiuExpressionContextMenuManager.h + ${CMAKE_CURRENT_LIST_DIR}/RiuCalculationsContextMenuManager.h + ${CMAKE_CURRENT_LIST_DIR}/RiuMohrsCirclePlot.h + ${CMAKE_CURRENT_LIST_DIR}/RiuDraggableOverlayFrame.h + ${CMAKE_CURRENT_LIST_DIR}/RiuAbstractOverlayContentFrame.h + ${CMAKE_CURRENT_LIST_DIR}/RiuAbstractLegendFrame.h + ${CMAKE_CURRENT_LIST_DIR}/RiuCategoryLegendFrame.h + ${CMAKE_CURRENT_LIST_DIR}/RiuScalarMapperLegendFrame.h + ${CMAKE_CURRENT_LIST_DIR}/RiuTextEditWithCompletion.h + ${CMAKE_CURRENT_LIST_DIR}/RiuTextContentFrame.h) +list(APPEND QT_UI_FILES) -source_group( "UserInterface" FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake ) +source_group( + "UserInterface" + FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} + ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake) From 9e1ef0e7e0ece8405d6cc8bf99479af0fef0c196 Mon Sep 17 00:00:00 2001 From: Kristian Bendiksen Date: Fri, 27 Aug 2021 10:25:08 +0200 Subject: [PATCH 081/308] #7893 StimPlanModelPlot: Select correct case for facies region annotations --- .../CompletionCommands/RicNewStimPlanModelPlotFeature.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ApplicationLibCode/Commands/CompletionCommands/RicNewStimPlanModelPlotFeature.cpp b/ApplicationLibCode/Commands/CompletionCommands/RicNewStimPlanModelPlotFeature.cpp index 904105e80d..d2f1ac868d 100644 --- a/ApplicationLibCode/Commands/CompletionCommands/RicNewStimPlanModelPlotFeature.cpp +++ b/ApplicationLibCode/Commands/CompletionCommands/RicNewStimPlanModelPlotFeature.cpp @@ -23,6 +23,7 @@ #include "RiaGuiApplication.h" #include "RiaLogging.h" +#include "RiaStimPlanModelDefines.h" #include "WellLogCommands/RicNewWellLogPlotFeatureImpl.h" #include "RigWellPath.h" @@ -81,8 +82,9 @@ RimStimPlanModelPlot* RicNewStimPlanModelPlotFeature::createPlot( RimStimPlanMod } { - auto task = progInfo.task( "Creating facies track", 2 ); - createFaciesTrack( plot, stimPlanModel, eclipseCase ); + auto task = progInfo.task( "Creating facies track", 2 ); + RimEclipseCase* faciesEclipseCase = stimPlanModel->eclipseCaseForProperty( RiaDefines::CurveProperty::FACIES ); + createFaciesTrack( plot, stimPlanModel, faciesEclipseCase ); } { From 4be97143686cd9503336b44ddefb95854342204f Mon Sep 17 00:00:00 2001 From: Kristian Bendiksen Date: Fri, 27 Aug 2021 10:26:23 +0200 Subject: [PATCH 082/308] #7893 Make accessor warning clearer in Well Log Track region annotations --- .../ProjectDataModel/WellLog/RimWellLogTrack.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/ApplicationLibCode/ProjectDataModel/WellLog/RimWellLogTrack.cpp b/ApplicationLibCode/ProjectDataModel/WellLog/RimWellLogTrack.cpp index dec9480b5b..759b5c8bf5 100644 --- a/ApplicationLibCode/ProjectDataModel/WellLog/RimWellLogTrack.cpp +++ b/ApplicationLibCode/ProjectDataModel/WellLog/RimWellLogTrack.cpp @@ -2678,7 +2678,13 @@ void RimWellLogTrack::updateResultPropertyNamesOnPlot() RigResultAccessorFactory::createFromResultDefinition( eclipseCase->eclipseCaseData(), 0, m_timeStep, m_resultDefinition ); if ( !resultAccessor.notNull() ) { - RiaLogging::error( "Unable to get result accessor" ); + QString resultTypeStr = caf::AppEnum( m_resultDefinition->resultType() ).uiText(); + RiaLogging::error( + QString( "Unable to find result for region annotation for '%1' track. Tried '%2' (%3) on case: '%4'" ) + .arg( m_description() ) + .arg( m_resultDefinition->resultVariable() ) + .arg( resultTypeStr ) + .arg( eclipseCase->caseUserDescription() ) ); return; } From 2f580a0c52a4c0d7b8660498ba1e72e244307d09 Mon Sep 17 00:00:00 2001 From: Kristian Bendiksen Date: Fri, 27 Aug 2021 11:08:55 +0200 Subject: [PATCH 083/308] #7863 StimPlan Model: Add TST correction for more correct zone thickness TST is now adjusted (average of TST and TVD in 3D) to improve the zone thickness in the well log plot. --- .../ReservoirDataModel/RigStimPlanModelTools.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ApplicationLibCode/ReservoirDataModel/RigStimPlanModelTools.cpp b/ApplicationLibCode/ReservoirDataModel/RigStimPlanModelTools.cpp index 479d8fbdd0..9e20662f97 100644 --- a/ApplicationLibCode/ReservoirDataModel/RigStimPlanModelTools.cpp +++ b/ApplicationLibCode/ReservoirDataModel/RigStimPlanModelTools.cpp @@ -88,6 +88,10 @@ cvf::Vec3d RigStimPlanModelTools::calculateTSTDirection( RigEclipseCaseData* ecl direction *= -1.0; } + // Calculate an adjusted TST direction to improve the zone thickness in the well log plot. + // Using average of TST and TVD (default direction) in 3D. + direction = ( direction + defaultDirection ) / 2.0; + return direction; } From 414ee77aa8207fd1aa48509365b3c6f1ed579cac Mon Sep 17 00:00:00 2001 From: Kristian Bendiksen Date: Mon, 30 Aug 2021 09:18:34 +0200 Subject: [PATCH 084/308] #7834 Ensemble Well Logs: add depth equalization (#7914) --- .../WellLog/RimEnsembleWellLogCurveSet.cpp | 28 ++- .../WellLog/RimEnsembleWellLogCurveSet.h | 10 +- .../WellLog/RimEnsembleWellLogStatistics.cpp | 219 ++++++++++++++++++ .../WellLog/RimEnsembleWellLogStatistics.h | 20 +- .../RimEnsembleWellLogStatisticsCurve.cpp | 3 +- .../WellLog/RimWellLogFileCurve.cpp | 70 ++++++ .../WellLog/RimWellLogFileCurve.h | 9 + .../ReservoirDataModel/CMakeLists_files.cmake | 6 +- .../RigWellLogIndexDepthOffset.cpp | 72 ++++++ .../RigWellLogIndexDepthOffset.h | 38 +++ .../generate_ensemble_of_well_logs.py | 8 +- 11 files changed, 473 insertions(+), 10 deletions(-) create mode 100644 ApplicationLibCode/ReservoirDataModel/RigWellLogIndexDepthOffset.cpp create mode 100644 ApplicationLibCode/ReservoirDataModel/RigWellLogIndexDepthOffset.h diff --git a/ApplicationLibCode/ProjectDataModel/WellLog/RimEnsembleWellLogCurveSet.cpp b/ApplicationLibCode/ProjectDataModel/WellLog/RimEnsembleWellLogCurveSet.cpp index df6f0aa01a..f86f7dc27c 100644 --- a/ApplicationLibCode/ProjectDataModel/WellLog/RimEnsembleWellLogCurveSet.cpp +++ b/ApplicationLibCode/ProjectDataModel/WellLog/RimEnsembleWellLogCurveSet.cpp @@ -39,6 +39,8 @@ #include "RimWellLogPlot.h" #include "RimWellLogTrack.h" +#include "RigWellLogIndexDepthOffset.h" + #include "RiuAbstractLegendFrame.h" #include "RiuDraggableOverlayFrame.h" #include "RiuPlotMainWindow.h" @@ -49,6 +51,8 @@ #include "cafPdmUiItem.h" #include "cafPdmUiTreeOrdering.h" +#include "cvfObject.h" + #include "qwt_plot_curve.h" #include "qwt_symbol.h" @@ -97,6 +101,7 @@ RimEnsembleWellLogCurveSet::RimEnsembleWellLogCurveSet() CAF_PDM_InitFieldNoDefault( &m_wellLogChannelName, "WellLogChannelName", "Well Log Channel Name", "", "", "" ); CAF_PDM_InitFieldNoDefault( &m_ensembleCurveSet, "FilterEnsembleCurveSet", "Filter by Ensemble Curve Set", "", "", "" ); + CAF_PDM_InitFieldNoDefault( &m_depthEqualization, "DepthEqualization", "Depth Equalization", "", "", "" ); CAF_PDM_InitField( &m_colorMode, "ColorMode", caf::AppEnum( ColorMode::SINGLE_COLOR ), "Coloring Mode", "", "", "" ); @@ -397,6 +402,11 @@ void RimEnsembleWellLogCurveSet::fieldChangedByUi( const caf::PdmFieldHandle* ch updateAllCurves(); updateTextInPlot = true; } + else if ( changedField == &m_depthEqualization ) + { + updateAllCurves(); + updateTextInPlot = true; + } else if ( changedField == &m_color ) { updateCurveColors(); @@ -437,6 +447,7 @@ void RimEnsembleWellLogCurveSet::defineUiOrdering( QString uiConfigName, caf::Pd uiOrdering.add( &m_ensembleWellLogs ); uiOrdering.add( &m_wellLogChannelName ); uiOrdering.add( &m_ensembleCurveSet ); + uiOrdering.add( &m_depthEqualization ); appendColorGroup( uiOrdering ); @@ -734,6 +745,12 @@ void RimEnsembleWellLogCurveSet::updateEnsembleCurves( const std::vectorhideEnsembleCurves() ) return; + cvf::ref offsets; + if ( m_depthEqualization() == RimEnsembleWellLogStatistics::DepthEqualization::K_LAYER ) + { + offsets = RimEnsembleWellLogStatistics::calculateIndexDepthOffset( sumCases ); + } + m_qwtPlotCurveForLegendText->attach( plotTrack->viewer() ); QString wellLogChannelName = m_wellLogChannelName(); @@ -771,6 +788,7 @@ void RimEnsembleWellLogCurveSet::updateEnsembleCurves( const std::vectorsetWellLogChannelName( wellLogChannelName ); curve->setWellLogFile( wellLogFile ); + if ( !offsets.isNull() ) curve->setIndexDepthOffsets( offsets ); curve->loadDataAndUpdate( true ); curve->updateCurveVisibility(); @@ -814,7 +832,7 @@ void RimEnsembleWellLogCurveSet::updateStatistics( const std::vectorwellLogFiles(); } - m_ensembleWellLogStatistics->calculate( wellLogFiles, wellLogChannelName ); + m_ensembleWellLogStatistics->calculate( wellLogFiles, wellLogChannelName, m_depthEqualization() ); } //-------------------------------------------------------------------------------------------------- @@ -898,6 +916,14 @@ void RimEnsembleWellLogCurveSet::showCurves( bool show ) m_showCurves = show; } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RimEnsembleWellLogStatistics::DepthEqualization RimEnsembleWellLogCurveSet::depthEqualization() const +{ + return m_depthEqualization(); +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationLibCode/ProjectDataModel/WellLog/RimEnsembleWellLogCurveSet.h b/ApplicationLibCode/ProjectDataModel/WellLog/RimEnsembleWellLogCurveSet.h index 3b092abe9d..6d572a4af8 100644 --- a/ApplicationLibCode/ProjectDataModel/WellLog/RimEnsembleWellLogCurveSet.h +++ b/ApplicationLibCode/ProjectDataModel/WellLog/RimEnsembleWellLogCurveSet.h @@ -22,6 +22,7 @@ #include "RimEnsembleCurveSetColorManager.h" #include "RimEnsembleCurveSetInterface.h" +#include "RimEnsembleWellLogStatistics.h" #include "RigEnsembleParameter.h" @@ -45,7 +46,6 @@ class RimEnsembleStatisticsCase; class RimWellLogCurve; class RimWellLogFileCurve; class RimWellLogFile; -class RimEnsembleWellLogStatistics; class RiuDraggableOverlayFrame; @@ -112,7 +112,8 @@ class RimEnsembleWellLogCurveSet : public caf::PdmObject, public RimEnsembleCurv void updateFilterLegend(); - const RimEnsembleWellLogStatistics* ensembleWellLogStatistics() const; + const RimEnsembleWellLogStatistics* ensembleWellLogStatistics() const; + RimEnsembleWellLogStatistics::DepthEqualization depthEqualization() const; void updateStatistics(); @@ -147,8 +148,9 @@ class RimEnsembleWellLogCurveSet : public caf::PdmObject, public RimEnsembleCurv private: caf::PdmField m_showCurves; - caf::PdmPtrArrayField m_curves; - caf::PdmPointer m_currentWellLogCurve; + caf::PdmPtrArrayField m_curves; + caf::PdmPointer m_currentWellLogCurve; + caf::PdmField> m_depthEqualization; caf::PdmField> m_colorMode; caf::PdmField m_color; diff --git a/ApplicationLibCode/ProjectDataModel/WellLog/RimEnsembleWellLogStatistics.cpp b/ApplicationLibCode/ProjectDataModel/WellLog/RimEnsembleWellLogStatistics.cpp index f6d8a32b03..2069af9c38 100644 --- a/ApplicationLibCode/ProjectDataModel/WellLog/RimEnsembleWellLogStatistics.cpp +++ b/ApplicationLibCode/ProjectDataModel/WellLog/RimEnsembleWellLogStatistics.cpp @@ -21,11 +21,13 @@ #include "RiaCurveMerger.h" #include "RiaDefines.h" #include "RiaLogging.h" +#include "RiaResultNames.h" #include "RiaWeightedMeanCalculator.h" #include "RiaWellLogUnitTools.h" #include "RigStatisticsMath.h" #include "RigWellLogFile.h" +#include "RigWellLogIndexDepthOffset.h" #include "RimWellLogFile.h" @@ -43,6 +45,16 @@ void caf::AppEnum::setUp() setDefault( RimEnsembleWellLogStatistics::StatisticsType::MEAN ); } + +template <> +void caf::AppEnum::setUp() +{ + addItem( RimEnsembleWellLogStatistics::DepthEqualization::K_LAYER, "K_LAYER", "By K-Layer" ); + addItem( RimEnsembleWellLogStatistics::DepthEqualization::NONE, "NONE", "None" ); + + setDefault( RimEnsembleWellLogStatistics::DepthEqualization::NONE ); +} + }; // namespace caf RimEnsembleWellLogStatistics::RimEnsembleWellLogStatistics() @@ -51,6 +63,23 @@ RimEnsembleWellLogStatistics::RimEnsembleWellLogStatistics() m_logChannelUnitString = RiaWellLogUnitTools::noUnitString(); } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimEnsembleWellLogStatistics::calculate( const std::vector& wellLogFiles, + const QString& wellLogChannelName, + DepthEqualization depthEqualization ) +{ + if ( depthEqualization == DepthEqualization::NONE ) + { + calculate( wellLogFiles, wellLogChannelName ); + } + else if ( depthEqualization == DepthEqualization::K_LAYER ) + { + calculateByKLayer( wellLogFiles, wellLogChannelName ); + } +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- @@ -127,6 +156,196 @@ void RimEnsembleWellLogStatistics::calculate( const std::vector } } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimEnsembleWellLogStatistics::calculateByKLayer( const std::vector& wellLogFiles, + const QString& wellLogChannelName ) +{ + cvf::ref offsets = RimEnsembleWellLogStatistics::calculateIndexDepthOffset( wellLogFiles ); + + std::map> topValues; + std::map> bottomValues; + + for ( RimWellLogFile* wellLogFile : wellLogFiles ) + { + QString errorMessage; + if ( wellLogFile->readFile( &errorMessage ) ) + { + RigWellLogFile* fileData = wellLogFile->wellLogFileData(); + + std::vector kIndexValues = fileData->values( RiaResultNames::indexKResultName() ); + std::vector values = fileData->values( wellLogChannelName ); + + CAF_ASSERT( values.size() == kIndexValues.size() ); + + std::set seenTopIndexes; + std::set seenBottomIndexes; + + for ( size_t i = 0; i < values.size(); i++ ) + { + int kLayer = static_cast( kIndexValues[i] ); + if ( seenTopIndexes.count( kLayer ) == 0 ) + { + seenTopIndexes.insert( kLayer ); + topValues[kLayer].push_back( values[i] ); + } + } + + for ( int i = static_cast( values.size() ) - 1; i >= 0; i-- ) + { + int kLayer = static_cast( kIndexValues[i] ); + if ( seenBottomIndexes.count( kLayer ) == 0 ) + { + seenBottomIndexes.insert( kLayer ); + bottomValues[kLayer].push_back( values[i] ); + } + } + } + } + + clearData(); + + std::vector kIndexes = offsets->sortedIndexes(); + for ( auto kIndex : kIndexes ) + { + double topMean = -1.0; + double bottomMean = -2.3; + // Top first + { + std::vector valuesAtDepth = topValues[kIndex]; + double p10, p50, p90, mean; + RigStatisticsMath::calculateStatisticsCurves( valuesAtDepth, &p10, &p50, &p90, &mean ); + m_measuredDepths.push_back( offsets->getTopDepth( kIndex ) ); + m_p10Data.push_back( p10 ); + m_p50Data.push_back( p50 ); + m_p90Data.push_back( p90 ); + m_meanData.push_back( mean ); + + topMean = mean; + } + + // Then bottom of k-layer + { + std::vector valuesAtDepth = bottomValues[kIndex]; + double p10, p50, p90, mean; + RigStatisticsMath::calculateStatisticsCurves( valuesAtDepth, &p10, &p50, &p90, &mean ); + m_measuredDepths.push_back( offsets->getBottomDepth( kIndex ) ); + m_p10Data.push_back( p10 ); + m_p50Data.push_back( p50 ); + m_p90Data.push_back( p90 ); + m_meanData.push_back( mean ); + + bottomMean = mean; + } + + RiaLogging::debug( QString( "[%1] top: %2 bttom: %3 %4 %5" ) + .arg( kIndex ) + .arg( offsets->getTopDepth( kIndex ) ) + .arg( offsets->getBottomDepth( kIndex ) ) + .arg( topMean ) + .arg( bottomMean ) ); + } +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +cvf::ref + RimEnsembleWellLogStatistics::calculateIndexDepthOffset( const std::vector& wellLogFiles ) +{ + int hack = 1000; + std::vector sumTopDepths( hack, 0.0 ); + std::vector numTopDepths( hack, 0 ); + + std::vector sumBottomDepths( hack, 0.0 ); + std::vector numBottomDepths( hack, 0 ); + + int minLayerK = std::numeric_limits::max(); + int maxLayerK = -std::numeric_limits::max(); + + std::vector> topValues; + + for ( RimWellLogFile* wellLogFile : wellLogFiles ) + { + QString errorMessage; + if ( wellLogFile->readFile( &errorMessage ) ) + { + RigWellLogFile* fileData = wellLogFile->wellLogFileData(); + + std::vector depths = fileData->depthValues(); + std::vector kIndexValues = fileData->values( RiaResultNames::indexKResultName() ); + + std::set seenTopIndexes; + std::set seenBottomIndexes; + if ( !depths.empty() && !kIndexValues.empty() ) + { + // Find top indexes + for ( size_t i = 0; i < kIndexValues.size(); i++ ) + { + int kLayer = static_cast( kIndexValues[i] ); + if ( seenTopIndexes.count( kLayer ) == 0 ) + { + // Only use the first value encountered per index per file. + // This is depth of the top of the index since the file is + // sorted by increasing depth. + seenTopIndexes.insert( kLayer ); + sumTopDepths[kLayer] += depths[i]; + numTopDepths[kLayer] += 1; + minLayerK = std::min( minLayerK, kLayer ); + maxLayerK = std::max( maxLayerK, kLayer ); + } + } + + // Find bottom indexes + for ( int i = static_cast( kIndexValues.size() ) - 1; i >= 0; i-- ) + { + int kLayer = static_cast( kIndexValues[i] ); + if ( seenBottomIndexes.count( kLayer ) == 0 ) + { + // Only use the last value encountered per index per file. + // This is depth of the bottom of the index since the file is + // sorted by increasing depth. + seenBottomIndexes.insert( kLayer ); + sumBottomDepths[kLayer] += depths[i]; + numBottomDepths[kLayer] += 1; + } + } + } + } + else + { + RiaLogging::error( errorMessage ); + } + } + + if ( minLayerK > maxLayerK ) + { + RiaLogging::error( + QString( "Invalid K layers found. Minimum: %1 > Maximum : %2" ).arg( minLayerK ).arg( maxLayerK ) ); + return nullptr; + } + + cvf::ref offset = cvf::make_ref(); + for ( int kLayer = minLayerK; kLayer <= maxLayerK; kLayer++ ) + { + if ( numTopDepths[kLayer] > 0 && numBottomDepths[kLayer] > 0 ) + { + double topDepth = sumTopDepths[kLayer] / numTopDepths[kLayer]; + double bottomDepth = sumBottomDepths[kLayer] / numBottomDepths[kLayer]; + RiaLogging::debug( QString( "K: %1 mean depth range: %2 - %3 Samples: %4 - %5" ) + .arg( kLayer ) + .arg( topDepth ) + .arg( bottomDepth ) + .arg( numTopDepths[kLayer] ) + .arg( numBottomDepths[kLayer] ) ); + offset->setIndexOffsetDepth( kLayer, topDepth, bottomDepth ); + } + } + + return offset; +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationLibCode/ProjectDataModel/WellLog/RimEnsembleWellLogStatistics.h b/ApplicationLibCode/ProjectDataModel/WellLog/RimEnsembleWellLogStatistics.h index 01cd11817e..7cf5d77b77 100644 --- a/ApplicationLibCode/ProjectDataModel/WellLog/RimEnsembleWellLogStatistics.h +++ b/ApplicationLibCode/ProjectDataModel/WellLog/RimEnsembleWellLogStatistics.h @@ -20,12 +20,16 @@ #include "RiaDefines.h" +#include + #include class QString; class RimWellLogFile; +class RigWellLogIndexDepthOffset; + //================================================================================================== /// //================================================================================================== @@ -40,6 +44,12 @@ class RimEnsembleWellLogStatistics MEAN }; + enum class DepthEqualization + { + K_LAYER, + NONE + }; + RimEnsembleWellLogStatistics(); const std::vector& measuredDepths() const; @@ -56,9 +66,17 @@ class RimEnsembleWellLogStatistics bool hasP90Data() const; bool hasMeanData() const; - void calculate( const std::vector& sumCases, const QString& wellLogChannelName ); + void calculate( const std::vector& sumCases, + const QString& wellLogChannelName, + DepthEqualization depthEqualization ); + + static cvf::ref + calculateIndexDepthOffset( const std::vector& wellLogFiles ); private: + void calculate( const std::vector& sumCases, const QString& wellLogChannelName ); + void calculateByKLayer( const std::vector& sumCases, const QString& wellLogChannelName ); + void clearData(); QString m_logChannelUnitString; diff --git a/ApplicationLibCode/ProjectDataModel/WellLog/RimEnsembleWellLogStatisticsCurve.cpp b/ApplicationLibCode/ProjectDataModel/WellLog/RimEnsembleWellLogStatisticsCurve.cpp index 49c5dda597..5817186d8a 100644 --- a/ApplicationLibCode/ProjectDataModel/WellLog/RimEnsembleWellLogStatisticsCurve.cpp +++ b/ApplicationLibCode/ProjectDataModel/WellLog/RimEnsembleWellLogStatisticsCurve.cpp @@ -128,7 +128,8 @@ void RimEnsembleWellLogStatisticsCurve::performDataExtraction( bool* isUsingPseu bool performDataSmoothing = false; if ( !values.empty() && !measuredDepthValues.empty() && measuredDepthValues.size() == values.size() ) { - addDatapointsForBottomOfSegment( measuredDepthValues, values ); + if ( m_ensembleWellLogCurveSet->depthEqualization() == RimEnsembleWellLogStatistics::DepthEqualization::NONE ) + addDatapointsForBottomOfSegment( measuredDepthValues, values ); this->setValuesAndDepths( values, measuredDepthValues, diff --git a/ApplicationLibCode/ProjectDataModel/WellLog/RimWellLogFileCurve.cpp b/ApplicationLibCode/ProjectDataModel/WellLog/RimWellLogFileCurve.cpp index ddaeb6d398..5a4f62a057 100644 --- a/ApplicationLibCode/ProjectDataModel/WellLog/RimWellLogFileCurve.cpp +++ b/ApplicationLibCode/ProjectDataModel/WellLog/RimWellLogFileCurve.cpp @@ -22,7 +22,9 @@ #include "RiaLogging.h" #include "RiaPreferences.h" +#include "RiaResultNames.h" #include "RigWellLogCurveData.h" +#include "RigWellLogIndexDepthOffset.h" #include "RigWellPath.h" #include "RimProject.h" @@ -94,6 +96,17 @@ void RimWellLogFileCurve::onLoadDataAndUpdate( bool updateParentPlot ) bool rkbDiff = m_wellPath->wellPathGeometry() ? m_wellPath->wellPathGeometry()->rkbDiff() : 0.0; + if ( !m_indexDepthOffsets.isNull() ) + { + // Adjust depths by reassigning depths for top and bottom of layer for each K layer + std::vector kIndexValues = wellLogFile->values( RiaResultNames::indexKResultName() ); + auto [valuesAdjusted, measuredDepthValuesAdjusted] = + adjustByIndexDepthOffsets( measuredDepthValues, values, kIndexValues ); + + values = valuesAdjusted; + measuredDepthValues = measuredDepthValuesAdjusted; + } + if ( tvdMslValues.size() != values.size() ) { RigWellPath* rigWellPath = m_wellPath->wellPathGeometry(); @@ -192,6 +205,55 @@ void RimWellLogFileCurve::onLoadDataAndUpdate( bool updateParentPlot ) } } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +std::pair, std::vector> + RimWellLogFileCurve::adjustByIndexDepthOffsets( const std::vector& measuredDepthValues, + const std::vector& values, + const std::vector& kIndexValues ) const +{ + CAF_ASSERT( values.size() == kIndexValues.size() ); + + auto findFirstIndex = []( int kLayer, const std::vector& vals ) { + for ( size_t i = 0; i < vals.size(); i++ ) + if ( kLayer == static_cast( vals[i] ) ) return i; + + return vals.size(); + }; + + auto findLastIndex = []( int kLayer, const std::vector& vals ) { + for ( int i = static_cast( vals.size() ) - 1; i >= 0; i-- ) + if ( kLayer == static_cast( vals[i] ) ) return static_cast( i ); + + return vals.size(); + }; + + std::vector kIndexes = m_indexDepthOffsets->sortedIndexes(); + + std::vector valuesAdjusted; + std::vector measuredDepthValuesAdjusted; + + for ( int kLayer : kIndexes ) + { + size_t firstIndex = findFirstIndex( kLayer, kIndexValues ); + size_t lastIndex = findLastIndex( kLayer, kIndexValues ); + + if ( firstIndex != kIndexValues.size() && lastIndex != kIndexValues.size() ) + { + // Add top + measuredDepthValuesAdjusted.push_back( m_indexDepthOffsets->getTopDepth( kLayer ) ); + valuesAdjusted.push_back( values[firstIndex] ); + + // Add bottom of layer + measuredDepthValuesAdjusted.push_back( m_indexDepthOffsets->getBottomDepth( kLayer ) ); + valuesAdjusted.push_back( values[lastIndex] ); + } + } + + return std::make_pair( valuesAdjusted, measuredDepthValuesAdjusted ); +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- @@ -224,6 +286,14 @@ void RimWellLogFileCurve::setWellLogFile( RimWellLogFile* wellLogFile ) m_wellLogFile = wellLogFile; } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimWellLogFileCurve::setIndexDepthOffsets( cvf::ref depthOffsets ) +{ + m_indexDepthOffsets = depthOffsets; +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationLibCode/ProjectDataModel/WellLog/RimWellLogFileCurve.h b/ApplicationLibCode/ProjectDataModel/WellLog/RimWellLogFileCurve.h index b888a6b064..7977c3f9bd 100644 --- a/ApplicationLibCode/ProjectDataModel/WellLog/RimWellLogFileCurve.h +++ b/ApplicationLibCode/ProjectDataModel/WellLog/RimWellLogFileCurve.h @@ -29,6 +29,7 @@ class RimWellPath; class RimWellLogFileChannel; class RimWellLogFile; +class RigWellLogIndexDepthOffset; //================================================================================================== /// @@ -46,6 +47,7 @@ class RimWellLogFileCurve : public RimWellLogCurve RimWellPath* wellPath() const; void setWellLogChannelName( const QString& name ); void setWellLogFile( RimWellLogFile* wellLogFile ); + void setIndexDepthOffsets( cvf::ref depthOffsets ); // Overrides from RimWellLogPlotCurve QString wellName() const override; @@ -69,9 +71,16 @@ class RimWellLogFileCurve : public RimWellLogCurve bool isRftPlotChild() const; + std::pair, std::vector> + adjustByIndexDepthOffsets( const std::vector& measuredDepthValues, + const std::vector& values, + const std::vector& kIndexValues ) const; + protected: caf::PdmPtrField m_wellPath; caf::PdmPtrField m_wellLogFile; caf::PdmField m_wellLogChannelName; caf::PdmField m_wellLogChannnelUnit; + + cvf::ref m_indexDepthOffsets; }; diff --git a/ApplicationLibCode/ReservoirDataModel/CMakeLists_files.cmake b/ApplicationLibCode/ReservoirDataModel/CMakeLists_files.cmake index e10469bd8f..c8ad0a11ff 100644 --- a/ApplicationLibCode/ReservoirDataModel/CMakeLists_files.cmake +++ b/ApplicationLibCode/ReservoirDataModel/CMakeLists_files.cmake @@ -89,7 +89,8 @@ set(SOURCE_GROUP_HEADER_FILES ${CMAKE_CURRENT_LIST_DIR}/RigSlice2D.h ${CMAKE_CURRENT_LIST_DIR}/RigEnsembleParameter.h ${CMAKE_CURRENT_LIST_DIR}/RigSurfaceResampler.h - ${CMAKE_CURRENT_LIST_DIR}/RigSurfaceStatisticsCalculator.h) + ${CMAKE_CURRENT_LIST_DIR}/RigSurfaceStatisticsCalculator.h + ${CMAKE_CURRENT_LIST_DIR}/RigWellLogIndexDepthOffset.h) set(SOURCE_GROUP_SOURCE_FILES ${CMAKE_CURRENT_LIST_DIR}/RigActiveCellInfo.cpp @@ -175,7 +176,8 @@ set(SOURCE_GROUP_SOURCE_FILES ${CMAKE_CURRENT_LIST_DIR}/RigSlice2D.cpp ${CMAKE_CURRENT_LIST_DIR}/RigEnsembleParameter.cpp ${CMAKE_CURRENT_LIST_DIR}/RigSurfaceResampler.cpp - ${CMAKE_CURRENT_LIST_DIR}/RigSurfaceStatisticsCalculator.cpp) + ${CMAKE_CURRENT_LIST_DIR}/RigSurfaceStatisticsCalculator.cpp + ${CMAKE_CURRENT_LIST_DIR}/RigWellLogIndexDepthOffset.cpp) list(APPEND CODE_HEADER_FILES ${SOURCE_GROUP_HEADER_FILES}) diff --git a/ApplicationLibCode/ReservoirDataModel/RigWellLogIndexDepthOffset.cpp b/ApplicationLibCode/ReservoirDataModel/RigWellLogIndexDepthOffset.cpp new file mode 100644 index 0000000000..d3f45dc623 --- /dev/null +++ b/ApplicationLibCode/ReservoirDataModel/RigWellLogIndexDepthOffset.cpp @@ -0,0 +1,72 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2021- Equinor ASA +// +// ResInsight is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// +#include "RigWellLogIndexDepthOffset.h" + +#include +#include + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RigWellLogIndexDepthOffset::setIndexOffsetDepth( int kIndex, double topDepth, double bottomDepth ) +{ + m_depthOffsets[kIndex] = std::pair( topDepth, bottomDepth ); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +double RigWellLogIndexDepthOffset::getTopDepth( int kIndex ) const +{ + auto hit = m_depthOffsets.find( kIndex ); + if ( hit != m_depthOffsets.end() ) + { + return hit->second.first; + } + + return std::numeric_limits::infinity(); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +double RigWellLogIndexDepthOffset::getBottomDepth( int kIndex ) const +{ + auto hit = m_depthOffsets.find( kIndex ); + if ( hit != m_depthOffsets.end() ) + { + return hit->second.second; + } + + return std::numeric_limits::infinity(); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +std::vector RigWellLogIndexDepthOffset::sortedIndexes() const +{ + std::vector indexes; + for ( auto m : m_depthOffsets ) + { + indexes.push_back( m.first ); + } + + std::sort( indexes.begin(), indexes.end() ); + return indexes; +} diff --git a/ApplicationLibCode/ReservoirDataModel/RigWellLogIndexDepthOffset.h b/ApplicationLibCode/ReservoirDataModel/RigWellLogIndexDepthOffset.h new file mode 100644 index 0000000000..cd5bf2c8d1 --- /dev/null +++ b/ApplicationLibCode/ReservoirDataModel/RigWellLogIndexDepthOffset.h @@ -0,0 +1,38 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2021- Equinor ASA +// +// ResInsight is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// +#pragma once + +#include "cvfObject.h" + +#include +#include + +class RigWellLogIndexDepthOffset : public cvf::Object +{ +public: + RigWellLogIndexDepthOffset() = default; + ~RigWellLogIndexDepthOffset() override = default; + + void setIndexOffsetDepth( int kIndex, double topDepth, double bottomDepth ); + double getTopDepth( int kIndex ) const; + double getBottomDepth( int kIndex ) const; + std::vector sortedIndexes() const; + +private: + std::map> m_depthOffsets; +}; diff --git a/GrpcInterface/Python/rips/PythonExamples/generate_ensemble_of_well_logs.py b/GrpcInterface/Python/rips/PythonExamples/generate_ensemble_of_well_logs.py index c1c03b05e5..1f8804e327 100644 --- a/GrpcInterface/Python/rips/PythonExamples/generate_ensemble_of_well_logs.py +++ b/GrpcInterface/Python/rips/PythonExamples/generate_ensemble_of_well_logs.py @@ -11,7 +11,11 @@ home_dir = expanduser("~") -properties = [("STATIC_NATIVE", "PORO", 0), ("DYNAMIC_NATIVE", "PRESSURE", 0)] +properties = [ + ("STATIC_NATIVE", "PORO", 0), + ("DYNAMIC_NATIVE", "PRESSURE", 0), + ("STATIC_NATIVE", "INDEX_K", 0), +] export_folder = tempfile.mkdtemp() @@ -77,3 +81,5 @@ export_folder = export_folder_path.as_posix() well_log_plot.export_data_as_las(export_folder=export_folder) + + resinsight.project.close() From 6547ef1525ff6fe08f92eb9ef3c80adb211daeab Mon Sep 17 00:00:00 2001 From: Kristian Bendiksen Date: Mon, 30 Aug 2021 10:19:45 +0200 Subject: [PATCH 085/308] 7834 cref removal (#7917) * #7834 Well Log Statistics: prefer std::shared_ptr to cvf::ref. * #7834 Use std::map to avoid hard-coded array length. --- .../WellLog/RimEnsembleWellLogCurveSet.cpp | 4 ++-- .../WellLog/RimEnsembleWellLogStatistics.cpp | 16 ++++++++-------- .../WellLog/RimEnsembleWellLogStatistics.h | 5 ++--- .../WellLog/RimWellLogFileCurve.cpp | 4 ++-- .../WellLog/RimWellLogFileCurve.h | 4 ++-- 5 files changed, 16 insertions(+), 17 deletions(-) diff --git a/ApplicationLibCode/ProjectDataModel/WellLog/RimEnsembleWellLogCurveSet.cpp b/ApplicationLibCode/ProjectDataModel/WellLog/RimEnsembleWellLogCurveSet.cpp index f86f7dc27c..9019a605cb 100644 --- a/ApplicationLibCode/ProjectDataModel/WellLog/RimEnsembleWellLogCurveSet.cpp +++ b/ApplicationLibCode/ProjectDataModel/WellLog/RimEnsembleWellLogCurveSet.cpp @@ -745,7 +745,7 @@ void RimEnsembleWellLogCurveSet::updateEnsembleCurves( const std::vectorhideEnsembleCurves() ) return; - cvf::ref offsets; + std::shared_ptr offsets; if ( m_depthEqualization() == RimEnsembleWellLogStatistics::DepthEqualization::K_LAYER ) { offsets = RimEnsembleWellLogStatistics::calculateIndexDepthOffset( sumCases ); @@ -788,7 +788,7 @@ void RimEnsembleWellLogCurveSet::updateEnsembleCurves( const std::vectorsetWellLogChannelName( wellLogChannelName ); curve->setWellLogFile( wellLogFile ); - if ( !offsets.isNull() ) curve->setIndexDepthOffsets( offsets ); + if ( offsets ) curve->setIndexDepthOffsets( offsets ); curve->loadDataAndUpdate( true ); curve->updateCurveVisibility(); diff --git a/ApplicationLibCode/ProjectDataModel/WellLog/RimEnsembleWellLogStatistics.cpp b/ApplicationLibCode/ProjectDataModel/WellLog/RimEnsembleWellLogStatistics.cpp index 2069af9c38..5256547e88 100644 --- a/ApplicationLibCode/ProjectDataModel/WellLog/RimEnsembleWellLogStatistics.cpp +++ b/ApplicationLibCode/ProjectDataModel/WellLog/RimEnsembleWellLogStatistics.cpp @@ -162,7 +162,8 @@ void RimEnsembleWellLogStatistics::calculate( const std::vector void RimEnsembleWellLogStatistics::calculateByKLayer( const std::vector& wellLogFiles, const QString& wellLogChannelName ) { - cvf::ref offsets = RimEnsembleWellLogStatistics::calculateIndexDepthOffset( wellLogFiles ); + std::shared_ptr offsets = + RimEnsembleWellLogStatistics::calculateIndexDepthOffset( wellLogFiles ); std::map> topValues; std::map> bottomValues; @@ -251,15 +252,14 @@ void RimEnsembleWellLogStatistics::calculateByKLayer( const std::vector +std::shared_ptr RimEnsembleWellLogStatistics::calculateIndexDepthOffset( const std::vector& wellLogFiles ) { - int hack = 1000; - std::vector sumTopDepths( hack, 0.0 ); - std::vector numTopDepths( hack, 0 ); + std::map sumTopDepths; + std::map numTopDepths; - std::vector sumBottomDepths( hack, 0.0 ); - std::vector numBottomDepths( hack, 0 ); + std::map sumBottomDepths; + std::map numBottomDepths; int minLayerK = std::numeric_limits::max(); int maxLayerK = -std::numeric_limits::max(); @@ -326,7 +326,7 @@ cvf::ref return nullptr; } - cvf::ref offset = cvf::make_ref(); + std::shared_ptr offset = std::make_shared(); for ( int kLayer = minLayerK; kLayer <= maxLayerK; kLayer++ ) { if ( numTopDepths[kLayer] > 0 && numBottomDepths[kLayer] > 0 ) diff --git a/ApplicationLibCode/ProjectDataModel/WellLog/RimEnsembleWellLogStatistics.h b/ApplicationLibCode/ProjectDataModel/WellLog/RimEnsembleWellLogStatistics.h index 7cf5d77b77..68dc295183 100644 --- a/ApplicationLibCode/ProjectDataModel/WellLog/RimEnsembleWellLogStatistics.h +++ b/ApplicationLibCode/ProjectDataModel/WellLog/RimEnsembleWellLogStatistics.h @@ -20,8 +20,7 @@ #include "RiaDefines.h" -#include - +#include #include class QString; @@ -70,7 +69,7 @@ class RimEnsembleWellLogStatistics const QString& wellLogChannelName, DepthEqualization depthEqualization ); - static cvf::ref + static std::shared_ptr calculateIndexDepthOffset( const std::vector& wellLogFiles ); private: diff --git a/ApplicationLibCode/ProjectDataModel/WellLog/RimWellLogFileCurve.cpp b/ApplicationLibCode/ProjectDataModel/WellLog/RimWellLogFileCurve.cpp index 5a4f62a057..e8aac5c81e 100644 --- a/ApplicationLibCode/ProjectDataModel/WellLog/RimWellLogFileCurve.cpp +++ b/ApplicationLibCode/ProjectDataModel/WellLog/RimWellLogFileCurve.cpp @@ -96,7 +96,7 @@ void RimWellLogFileCurve::onLoadDataAndUpdate( bool updateParentPlot ) bool rkbDiff = m_wellPath->wellPathGeometry() ? m_wellPath->wellPathGeometry()->rkbDiff() : 0.0; - if ( !m_indexDepthOffsets.isNull() ) + if ( m_indexDepthOffsets ) { // Adjust depths by reassigning depths for top and bottom of layer for each K layer std::vector kIndexValues = wellLogFile->values( RiaResultNames::indexKResultName() ); @@ -289,7 +289,7 @@ void RimWellLogFileCurve::setWellLogFile( RimWellLogFile* wellLogFile ) //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -void RimWellLogFileCurve::setIndexDepthOffsets( cvf::ref depthOffsets ) +void RimWellLogFileCurve::setIndexDepthOffsets( std::shared_ptr depthOffsets ) { m_indexDepthOffsets = depthOffsets; } diff --git a/ApplicationLibCode/ProjectDataModel/WellLog/RimWellLogFileCurve.h b/ApplicationLibCode/ProjectDataModel/WellLog/RimWellLogFileCurve.h index 7977c3f9bd..302e4d4496 100644 --- a/ApplicationLibCode/ProjectDataModel/WellLog/RimWellLogFileCurve.h +++ b/ApplicationLibCode/ProjectDataModel/WellLog/RimWellLogFileCurve.h @@ -47,7 +47,7 @@ class RimWellLogFileCurve : public RimWellLogCurve RimWellPath* wellPath() const; void setWellLogChannelName( const QString& name ); void setWellLogFile( RimWellLogFile* wellLogFile ); - void setIndexDepthOffsets( cvf::ref depthOffsets ); + void setIndexDepthOffsets( std::shared_ptr depthOffsets ); // Overrides from RimWellLogPlotCurve QString wellName() const override; @@ -82,5 +82,5 @@ class RimWellLogFileCurve : public RimWellLogCurve caf::PdmField m_wellLogChannelName; caf::PdmField m_wellLogChannnelUnit; - cvf::ref m_indexDepthOffsets; + std::shared_ptr m_indexDepthOffsets; }; From 1afba6c4369c6acc4e59c3f101d8fcd9f388fe8b Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Fri, 27 Aug 2021 11:11:49 +0200 Subject: [PATCH 086/308] #7909 : Add helper function to get edge vertices of a cell --- .../UnitTests/CMakeLists_files.cmake | 3 +- .../UnitTests/StructGridInterface-Test.cpp | 52 +++++++++++++++++++ Fwk/AppFwk/CommonCode/cvfStructGrid.cpp | 45 ++++++++++++++++ Fwk/AppFwk/CommonCode/cvfStructGrid.h | 3 ++ 4 files changed, 102 insertions(+), 1 deletion(-) create mode 100644 ApplicationLibCode/UnitTests/StructGridInterface-Test.cpp diff --git a/ApplicationLibCode/UnitTests/CMakeLists_files.cmake b/ApplicationLibCode/UnitTests/CMakeLists_files.cmake index f11e64f2f5..13d8143acd 100644 --- a/ApplicationLibCode/UnitTests/CMakeLists_files.cmake +++ b/ApplicationLibCode/UnitTests/CMakeLists_files.cmake @@ -75,7 +75,8 @@ set(SOURCE_GROUP_SOURCE_FILES ${CMAKE_CURRENT_LIST_DIR}/RifSummaryDataReader-Test.cpp ${CMAKE_CURRENT_LIST_DIR}/RigSlice2D-Test.cpp ${CMAKE_CURRENT_LIST_DIR}/RigSurfaceResampler-Test.cpp - ${CMAKE_CURRENT_LIST_DIR}/RigSurfaceStatisticsCalculator-Test.cpp) + ${CMAKE_CURRENT_LIST_DIR}/RigSurfaceStatisticsCalculator-Test.cpp + ${CMAKE_CURRENT_LIST_DIR}/StructGridInterface-Test.cpp) if(RESINSIGHT_ENABLE_GRPC) list(APPEND GPRC_UNIT_TEST_SOURCE_FILES diff --git a/ApplicationLibCode/UnitTests/StructGridInterface-Test.cpp b/ApplicationLibCode/UnitTests/StructGridInterface-Test.cpp new file mode 100644 index 0000000000..d7a788b3bf --- /dev/null +++ b/ApplicationLibCode/UnitTests/StructGridInterface-Test.cpp @@ -0,0 +1,52 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) Statoil ASA +// Copyright (C) Ceetron Solutions AS +// +// ResInsight is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// + +#include "gtest/gtest.h" + +#include "cvfStructGrid.h" + +using namespace cvf; + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +TEST( StructGridInterfaceTest, TestEdgeVertices ) +{ + { + // Baseline + + StructGridInterface::FaceType face1 = StructGridInterface::NEG_K; + StructGridInterface::FaceType face2 = StructGridInterface::POS_I; + + auto indices = StructGridInterface::edgeVertexIndices( face1, face2 ); + EXPECT_EQ( indices.first, 2 ); + EXPECT_EQ( indices.second, 1 ); + } + + { + // Opposite order as baseline test + + StructGridInterface::FaceType face1 = StructGridInterface::POS_I; + StructGridInterface::FaceType face2 = StructGridInterface::NEG_K; + + auto indices = StructGridInterface::edgeVertexIndices( face1, face2 ); + EXPECT_EQ( indices.first, 2 ); + EXPECT_EQ( indices.second, 1 ); + } +} diff --git a/Fwk/AppFwk/CommonCode/cvfStructGrid.cpp b/Fwk/AppFwk/CommonCode/cvfStructGrid.cpp index 2ebdea4b78..438b2b1b16 100644 --- a/Fwk/AppFwk/CommonCode/cvfStructGrid.cpp +++ b/Fwk/AppFwk/CommonCode/cvfStructGrid.cpp @@ -153,6 +153,51 @@ void StructGridInterface::cellFaceVertexIndices( FaceType face, cvf::ubyte verte } } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +std::pair StructGridInterface::edgeVertexIndices( FaceType face1, FaceType face2 ) +{ + // + // Return the two shared vertex indices between two faces + // Asserts if the two faces do not have any shared vertices + // The ordering is identical to the ordering in StructGridInterface::cellFaceVertexIndices + // + + // Ensure face1 has the largest enum value + if ( face2 > face1 ) std::swap( face1, face2 ); + + if ( face1 == NEG_K ) + { + if ( face2 == NEG_I ) return { 0, 3 }; + if ( face2 == POS_I ) return { 2, 1 }; + if ( face2 == NEG_J ) return { 1, 0 }; + if ( face2 == POS_J ) return { 3, 2 }; + } + + if ( face1 == POS_K ) + { + if ( face2 == NEG_I ) return { 7, 4 }; + if ( face2 == POS_I ) return { 5, 6 }; + if ( face2 == NEG_J ) return { 4, 5 }; + if ( face2 == POS_J ) return { 6, 7 }; + } + + if ( face1 == NEG_J ) + { + if ( face2 == NEG_I ) return { 4, 0 }; + if ( face2 == POS_I ) return { 1, 5 }; + } + + if ( face1 == POS_J ) + { + if ( face2 == NEG_I ) return { 3, 7 }; + if ( face2 == POS_I ) return { 6, 2 }; + } + + return {}; +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- diff --git a/Fwk/AppFwk/CommonCode/cvfStructGrid.h b/Fwk/AppFwk/CommonCode/cvfStructGrid.h index f662b35b33..afd21a189b 100644 --- a/Fwk/AppFwk/CommonCode/cvfStructGrid.h +++ b/Fwk/AppFwk/CommonCode/cvfStructGrid.h @@ -120,6 +120,9 @@ class StructGridInterface : public Object static GridAxisType gridAxisFromFace( FaceType face ); + static std::pair edgeVertexIndices( cvf::StructGridInterface::FaceType face1, + cvf::StructGridInterface::FaceType face2 ); + private: mutable double m_characteristicCellSizeI; mutable double m_characteristicCellSizeJ; From 5c564c152a1e72bad6f72717bc3e83acab6423bb Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Fri, 27 Aug 2021 11:28:04 +0200 Subject: [PATCH 087/308] #7909 Surface Extraction : Add watertight option to grid extraction --- .../Surfaces/RimGridCaseSurface.cpp | 159 ++++++++++++++++-- .../Surfaces/RimGridCaseSurface.h | 8 +- 2 files changed, 155 insertions(+), 12 deletions(-) diff --git a/ApplicationLibCode/ProjectDataModel/Surfaces/RimGridCaseSurface.cpp b/ApplicationLibCode/ProjectDataModel/Surfaces/RimGridCaseSurface.cpp index 690b5a52dd..46b3038b01 100644 --- a/ApplicationLibCode/ProjectDataModel/Surfaces/RimGridCaseSurface.cpp +++ b/ApplicationLibCode/ProjectDataModel/Surfaces/RimGridCaseSurface.cpp @@ -46,6 +46,8 @@ RimGridCaseSurface::RimGridCaseSurface() CAF_PDM_InitScriptableField( &m_oneBasedSliceIndex, "SliceIndex", 1, "Slice Index (K)", "", "", "" ); m_oneBasedSliceIndex.uiCapability()->setUiEditorTypeName( caf::PdmUiSliderEditor::uiEditorTypeName() ); + + CAF_PDM_InitScriptableField( &m_watertight, "Watertight", false, "Watertight Surface (fill gaps)", "", "", "" ); } //-------------------------------------------------------------------------------------------------- @@ -84,7 +86,7 @@ bool RimGridCaseSurface::onLoadData() //-------------------------------------------------------------------------------------------------- RimSurface* RimGridCaseSurface::createCopy() { - RimGridCaseSurface* newSurface = dynamic_cast( + auto* newSurface = dynamic_cast( xmlCapability()->copyByXmlSerialization( caf::PdmDefaultObjectFactory::instance() ) ); newSurface->setCase( m_case.value() ); // TODO: case seems to get lost in the xml copy, investigate later @@ -122,7 +124,7 @@ void RimGridCaseSurface::defineEditorAttribute( const caf::PdmFieldHandle* field { RimSurface::defineEditorAttribute( field, uiConfigName, attribute ); - caf::PdmUiSliderEditorAttribute* myAttr = dynamic_cast( attribute ); + auto* myAttr = dynamic_cast( attribute ); if ( myAttr && m_case ) { const cvf::StructGridInterface* grid = RigReservoirGridTools::mainGrid( m_case ); @@ -142,7 +144,7 @@ void RimGridCaseSurface::fieldChangedByUi( const caf::PdmFieldHandle* changedFie { RimSurface::fieldChangedByUi( changedField, oldValue, newValue ); - if ( changedField == &m_case || changedField == &m_oneBasedSliceIndex ) + if ( changedField == &m_case || changedField == &m_oneBasedSliceIndex || changedField == &m_watertight ) { clearCachedNativeData(); updateSurfaceData(); @@ -156,13 +158,13 @@ void RimGridCaseSurface::fieldChangedByUi( const caf::PdmFieldHandle* changedFie //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -void RimGridCaseSurface::extractDataFromGrid() +void RimGridCaseSurface::extractStructuredSurfaceFromGridData() { clearCachedNativeData(); if ( m_case ) { - RimEclipseCase* eclCase = dynamic_cast( m_case() ); + auto* eclCase = dynamic_cast( m_case() ); if ( eclCase && eclCase->mainGrid() ) { const RigMainGrid* grid = eclCase->mainGrid(); @@ -248,15 +250,15 @@ void RimGridCaseSurface::extractDataFromGrid() cvf::ubyte faceConn[4]; grid->cellFaceVertexIndices( faceType, faceConn ); - structGridVertexIndices.push_back( - std::make_pair( static_cast( column + 1 ), static_cast( row + 1 ) ) ); + structGridVertexIndices.emplace_back( static_cast( column + 1 ), + static_cast( row + 1 ) ); vertices.push_back( cornerVerts[faceConn[cellFaceIndex]] ); if ( row < maxRow && column < maxColumn ) { - cvf::uint triangleIndexLeft = static_cast( column * ( maxRow + 1 ) + row ); - cvf::uint triangleIndexRight = static_cast( ( column + 1 ) * ( maxRow + 1 ) + row ); + auto triangleIndexLeft = static_cast( column * ( maxRow + 1 ) + row ); + auto triangleIndexRight = static_cast( ( column + 1 ) * ( maxRow + 1 ) + row ); triangleIndices.push_back( triangleIndexLeft ); triangleIndices.push_back( triangleIndexLeft + 1 ); @@ -277,6 +279,141 @@ void RimGridCaseSurface::extractDataFromGrid() } } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimGridCaseSurface::extractGridDataUsingFourVerticesPerCell() +{ + clearCachedNativeData(); + + if ( !m_case ) return; + + auto* eclCase = dynamic_cast( m_case() ); + if ( eclCase && eclCase->mainGrid() ) + { + const RigMainGrid* grid = eclCase->mainGrid(); + + size_t minI = 0; + size_t minJ = 0; + size_t maxI = grid->cellCountI(); + size_t maxJ = grid->cellCountJ(); + + size_t zeroBasedLayerIndex = static_cast( m_oneBasedSliceIndex ) - 1; + + cvf::StructGridInterface::FaceType faceType = cvf::StructGridInterface::NEG_K; + + std::vector triangleIndices; + std::vector vertices; + + for ( size_t i = minI; i <= maxI; i++ ) + { + for ( size_t j = minJ; j <= maxJ; j++ ) + { + if ( !grid->isCellValid( i, j, zeroBasedLayerIndex ) ) continue; + + size_t currentCellIndex = grid->cellIndexFromIJK( i, j, zeroBasedLayerIndex ); + const auto& cell = grid->cell( currentCellIndex ); + if ( cell.isInvalid() ) continue; + + cvf::Vec3d currentCornerVerts[8]; + + { + cvf::ubyte currentFaceConn[4]; + grid->cellCornerVertices( currentCellIndex, currentCornerVerts ); + grid->cellFaceVertexIndices( faceType, currentFaceConn ); + + auto currentCellStartIndex = static_cast( vertices.size() ); + + for ( auto fc : currentFaceConn ) + { + vertices.push_back( currentCornerVerts[fc] ); + } + + triangleIndices.push_back( currentCellStartIndex ); + triangleIndices.push_back( currentCellStartIndex + 1 ); + triangleIndices.push_back( currentCellStartIndex + 2 ); + + triangleIndices.push_back( currentCellStartIndex ); + triangleIndices.push_back( currentCellStartIndex + 2 ); + triangleIndices.push_back( currentCellStartIndex + 3 ); + } + + if ( m_watertight() ) + { + if ( grid->findFaultFromCellIndexAndCellFace( currentCellIndex, cvf::StructGridInterface::POS_I ) ) + { + auto nextCell = grid->cell( currentCellIndex ).neighborCell( cvf::StructGridInterface::POS_I ); + if ( !nextCell.isInvalid() ) + { + size_t nextCellIndex = nextCell.mainGridCellIndex(); + cvf::Vec3d nextCellCornerVerts[8]; + grid->cellCornerVertices( nextCellIndex, nextCellCornerVerts ); + + auto startIndex = static_cast( vertices.size() ); + { + auto edgeVertexIndices = + grid->edgeVertexIndices( faceType, cvf::StructGridInterface::POS_I ); + vertices.push_back( currentCornerVerts[edgeVertexIndices.first] ); + vertices.push_back( currentCornerVerts[edgeVertexIndices.second] ); + } + { + auto edgeVertexIndices = + grid->edgeVertexIndices( faceType, cvf::StructGridInterface::NEG_I ); + vertices.push_back( nextCellCornerVerts[edgeVertexIndices.first] ); + vertices.push_back( nextCellCornerVerts[edgeVertexIndices.second] ); + } + + triangleIndices.push_back( startIndex ); + triangleIndices.push_back( startIndex + 1 ); + triangleIndices.push_back( startIndex + 2 ); + + triangleIndices.push_back( startIndex ); + triangleIndices.push_back( startIndex + 2 ); + triangleIndices.push_back( startIndex + 3 ); + } + } + + if ( grid->findFaultFromCellIndexAndCellFace( currentCellIndex, cvf::StructGridInterface::POS_J ) ) + { + auto nextCell = grid->cell( currentCellIndex ).neighborCell( cvf::StructGridInterface::POS_J ); + if ( !nextCell.isInvalid() ) + { + size_t nextCellIndex = nextCell.mainGridCellIndex(); + cvf::Vec3d nextCellCornerVerts[8]; + grid->cellCornerVertices( nextCellIndex, nextCellCornerVerts ); + + auto startIndex = static_cast( vertices.size() ); + { + auto edgeVertexIndices = + grid->edgeVertexIndices( faceType, cvf::StructGridInterface::POS_J ); + vertices.push_back( currentCornerVerts[edgeVertexIndices.first] ); + vertices.push_back( currentCornerVerts[edgeVertexIndices.second] ); + } + { + auto edgeVertexIndices = + grid->edgeVertexIndices( faceType, cvf::StructGridInterface::NEG_J ); + vertices.push_back( nextCellCornerVerts[edgeVertexIndices.first] ); + vertices.push_back( nextCellCornerVerts[edgeVertexIndices.second] ); + } + + triangleIndices.push_back( startIndex ); + triangleIndices.push_back( startIndex + 1 ); + triangleIndices.push_back( startIndex + 2 ); + + triangleIndices.push_back( startIndex ); + triangleIndices.push_back( startIndex + 2 ); + triangleIndices.push_back( startIndex + 3 ); + } + } + } + } + } + + m_vertices = vertices; + m_triangleIndices = triangleIndices; + } +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- @@ -357,7 +494,7 @@ bool RimGridCaseSurface::updateSurfaceData() { if ( m_vertices.empty() || m_triangleIndices.empty() || m_structGridIndices.empty() ) { - extractDataFromGrid(); + extractGridDataUsingFourVerticesPerCell(); } RigSurface* surfaceData = nullptr; @@ -413,7 +550,7 @@ bool RimGridCaseSurface::exportStructSurfaceFromGridCase( std::vector m_case; caf::PdmField m_oneBasedSliceIndex; + caf::PdmField m_watertight; std::vector m_triangleIndices; std::vector m_vertices; From 264e1decdc041add4292613b933e92c8fb2b4036 Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Mon, 30 Aug 2021 10:46:15 +0200 Subject: [PATCH 088/308] #7909 Surface Extraction : Updates based on review --- .../Surfaces/RimGridCaseSurface.cpp | 128 +++++++++--------- .../Surfaces/RimGridCaseSurface.h | 8 ++ .../UnitTests/StructGridInterface-Test.cpp | 3 +- Fwk/AppFwk/CommonCode/cvfStructGrid.cpp | 3 - 4 files changed, 70 insertions(+), 72 deletions(-) diff --git a/ApplicationLibCode/ProjectDataModel/Surfaces/RimGridCaseSurface.cpp b/ApplicationLibCode/ProjectDataModel/Surfaces/RimGridCaseSurface.cpp index 46b3038b01..6f8d1da5c4 100644 --- a/ApplicationLibCode/ProjectDataModel/Surfaces/RimGridCaseSurface.cpp +++ b/ApplicationLibCode/ProjectDataModel/Surfaces/RimGridCaseSurface.cpp @@ -300,7 +300,7 @@ void RimGridCaseSurface::extractGridDataUsingFourVerticesPerCell() size_t zeroBasedLayerIndex = static_cast( m_oneBasedSliceIndex ) - 1; - cvf::StructGridInterface::FaceType faceType = cvf::StructGridInterface::NEG_K; + cvf::StructGridInterface::FaceType extractionFace = cvf::StructGridInterface::NEG_K; std::vector triangleIndices; std::vector vertices; @@ -320,7 +320,7 @@ void RimGridCaseSurface::extractGridDataUsingFourVerticesPerCell() { cvf::ubyte currentFaceConn[4]; grid->cellCornerVertices( currentCellIndex, currentCornerVerts ); - grid->cellFaceVertexIndices( faceType, currentFaceConn ); + grid->cellFaceVertexIndices( extractionFace, currentFaceConn ); auto currentCellStartIndex = static_cast( vertices.size() ); @@ -340,71 +340,21 @@ void RimGridCaseSurface::extractGridDataUsingFourVerticesPerCell() if ( m_watertight() ) { - if ( grid->findFaultFromCellIndexAndCellFace( currentCellIndex, cvf::StructGridInterface::POS_I ) ) - { - auto nextCell = grid->cell( currentCellIndex ).neighborCell( cvf::StructGridInterface::POS_I ); - if ( !nextCell.isInvalid() ) - { - size_t nextCellIndex = nextCell.mainGridCellIndex(); - cvf::Vec3d nextCellCornerVerts[8]; - grid->cellCornerVertices( nextCellIndex, nextCellCornerVerts ); - - auto startIndex = static_cast( vertices.size() ); - { - auto edgeVertexIndices = - grid->edgeVertexIndices( faceType, cvf::StructGridInterface::POS_I ); - vertices.push_back( currentCornerVerts[edgeVertexIndices.first] ); - vertices.push_back( currentCornerVerts[edgeVertexIndices.second] ); - } - { - auto edgeVertexIndices = - grid->edgeVertexIndices( faceType, cvf::StructGridInterface::NEG_I ); - vertices.push_back( nextCellCornerVerts[edgeVertexIndices.first] ); - vertices.push_back( nextCellCornerVerts[edgeVertexIndices.second] ); - } - - triangleIndices.push_back( startIndex ); - triangleIndices.push_back( startIndex + 1 ); - triangleIndices.push_back( startIndex + 2 ); - - triangleIndices.push_back( startIndex ); - triangleIndices.push_back( startIndex + 2 ); - triangleIndices.push_back( startIndex + 3 ); - } - } - - if ( grid->findFaultFromCellIndexAndCellFace( currentCellIndex, cvf::StructGridInterface::POS_J ) ) - { - auto nextCell = grid->cell( currentCellIndex ).neighborCell( cvf::StructGridInterface::POS_J ); - if ( !nextCell.isInvalid() ) - { - size_t nextCellIndex = nextCell.mainGridCellIndex(); - cvf::Vec3d nextCellCornerVerts[8]; - grid->cellCornerVertices( nextCellIndex, nextCellCornerVerts ); - - auto startIndex = static_cast( vertices.size() ); - { - auto edgeVertexIndices = - grid->edgeVertexIndices( faceType, cvf::StructGridInterface::POS_J ); - vertices.push_back( currentCornerVerts[edgeVertexIndices.first] ); - vertices.push_back( currentCornerVerts[edgeVertexIndices.second] ); - } - { - auto edgeVertexIndices = - grid->edgeVertexIndices( faceType, cvf::StructGridInterface::NEG_J ); - vertices.push_back( nextCellCornerVerts[edgeVertexIndices.first] ); - vertices.push_back( nextCellCornerVerts[edgeVertexIndices.second] ); - } - - triangleIndices.push_back( startIndex ); - triangleIndices.push_back( startIndex + 1 ); - triangleIndices.push_back( startIndex + 2 ); - - triangleIndices.push_back( startIndex ); - triangleIndices.push_back( startIndex + 2 ); - triangleIndices.push_back( startIndex + 3 ); - } - } + addGeometryForFaultFaces( grid, + currentCellIndex, + extractionFace, + cvf::StructGridInterface::POS_I, + currentCornerVerts, + vertices, + triangleIndices ); + + addGeometryForFaultFaces( grid, + currentCellIndex, + extractionFace, + cvf::StructGridInterface::POS_J, + currentCornerVerts, + vertices, + triangleIndices ); } } } @@ -414,6 +364,50 @@ void RimGridCaseSurface::extractGridDataUsingFourVerticesPerCell() } } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimGridCaseSurface::addGeometryForFaultFaces( const RigMainGrid* grid, + size_t currentCellIndex, + cvf::StructGridInterface::FaceType extractionFace, + cvf::StructGridInterface::FaceType faultFace, + cvf::Vec3d* currentCornerVerts, + std::vector& vertices, + std::vector& triangleIndices ) +{ + if ( grid->findFaultFromCellIndexAndCellFace( currentCellIndex, faultFace ) ) + { + auto nextCell = grid->cell( currentCellIndex ).neighborCell( faultFace ); + if ( !nextCell.isInvalid() ) + { + size_t nextCellIndex = nextCell.mainGridCellIndex(); + cvf::Vec3d nextCellCornerVerts[8]; + grid->cellCornerVertices( nextCellIndex, nextCellCornerVerts ); + + auto startIndex = static_cast( vertices.size() ); + { + auto edgeVertexIndices = grid->edgeVertexIndices( extractionFace, faultFace ); + vertices.push_back( currentCornerVerts[edgeVertexIndices.first] ); + vertices.push_back( currentCornerVerts[edgeVertexIndices.second] ); + } + { + auto oppositeFaultFace = cvf::StructGridInterface::oppositeFace( faultFace ); + auto edgeVertexIndices = grid->edgeVertexIndices( extractionFace, oppositeFaultFace ); + vertices.push_back( nextCellCornerVerts[edgeVertexIndices.first] ); + vertices.push_back( nextCellCornerVerts[edgeVertexIndices.second] ); + } + + triangleIndices.push_back( startIndex ); + triangleIndices.push_back( startIndex + 1 ); + triangleIndices.push_back( startIndex + 2 ); + + triangleIndices.push_back( startIndex ); + triangleIndices.push_back( startIndex + 2 ); + triangleIndices.push_back( startIndex + 3 ); + } + } +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationLibCode/ProjectDataModel/Surfaces/RimGridCaseSurface.h b/ApplicationLibCode/ProjectDataModel/Surfaces/RimGridCaseSurface.h index eb69e0c7e3..22980b6e28 100644 --- a/ApplicationLibCode/ProjectDataModel/Surfaces/RimGridCaseSurface.h +++ b/ApplicationLibCode/ProjectDataModel/Surfaces/RimGridCaseSurface.h @@ -65,6 +65,14 @@ class RimGridCaseSurface : public RimSurface // Extract 4 vertices per grid cell void extractGridDataUsingFourVerticesPerCell(); + void addGeometryForFaultFaces( const RigMainGrid* grid, + size_t currentCellIndex, + cvf::StructGridInterface::FaceType extractionFace, + cvf::StructGridInterface::FaceType faultFace, + cvf::Vec3d* currentCornerVerts, + std::vector& vertices, + std::vector& triangleIndices ); + // This method will populate m_structGridIndices used when exporting to PTL file format // Fault geometry will be smoothed using this method void extractStructuredSurfaceFromGridData(); diff --git a/ApplicationLibCode/UnitTests/StructGridInterface-Test.cpp b/ApplicationLibCode/UnitTests/StructGridInterface-Test.cpp index d7a788b3bf..b75adae292 100644 --- a/ApplicationLibCode/UnitTests/StructGridInterface-Test.cpp +++ b/ApplicationLibCode/UnitTests/StructGridInterface-Test.cpp @@ -1,7 +1,6 @@ ///////////////////////////////////////////////////////////////////////////////// // -// Copyright (C) Statoil ASA -// Copyright (C) Ceetron Solutions AS +// Copyright (C) 2021- Equinor ASA // // ResInsight is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by diff --git a/Fwk/AppFwk/CommonCode/cvfStructGrid.cpp b/Fwk/AppFwk/CommonCode/cvfStructGrid.cpp index 438b2b1b16..08d947dbb6 100644 --- a/Fwk/AppFwk/CommonCode/cvfStructGrid.cpp +++ b/Fwk/AppFwk/CommonCode/cvfStructGrid.cpp @@ -158,11 +158,8 @@ void StructGridInterface::cellFaceVertexIndices( FaceType face, cvf::ubyte verte //-------------------------------------------------------------------------------------------------- std::pair StructGridInterface::edgeVertexIndices( FaceType face1, FaceType face2 ) { - // // Return the two shared vertex indices between two faces - // Asserts if the two faces do not have any shared vertices // The ordering is identical to the ordering in StructGridInterface::cellFaceVertexIndices - // // Ensure face1 has the largest enum value if ( face2 > face1 ) std::swap( face1, face2 ); From 8d425331790fb5877c09b7fed9aacbc3e305d570 Mon Sep 17 00:00:00 2001 From: Kristian Bendiksen Date: Mon, 30 Aug 2021 15:01:18 +0200 Subject: [PATCH 089/308] #7869 Ensemble Fracture Statistics: optimization by AABB tree. (#7924) --- .../RimEnsembleFractureStatistics.cpp | 37 +++++-------- .../ReservoirDataModel/RigFractureGrid.cpp | 54 +++++++++++++++++++ .../ReservoirDataModel/RigFractureGrid.h | 11 ++++ .../RigStimPlanFractureDefinition.cpp | 1 + 4 files changed, 80 insertions(+), 23 deletions(-) diff --git a/ApplicationLibCode/ProjectDataModel/Completions/RimEnsembleFractureStatistics.cpp b/ApplicationLibCode/ProjectDataModel/Completions/RimEnsembleFractureStatistics.cpp index 82c98c97bb..f97303a47d 100644 --- a/ApplicationLibCode/ProjectDataModel/Completions/RimEnsembleFractureStatistics.cpp +++ b/ApplicationLibCode/ProjectDataModel/Completions/RimEnsembleFractureStatistics.cpp @@ -899,17 +899,6 @@ double RimEnsembleFractureStatistics::linearSampling( double minVa return sampleDistance; } -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -bool RimEnsembleFractureStatistics::isCoordinateInsideFractureCell( double x, double y, const RigFractureCell& cell ) -{ - const cvf::Vec3d& minPoint = cell.getPolygon()[0]; - const cvf::Vec3d& maxPoint = cell.getPolygon()[2]; - // TODO: Investigate strange ordering for y coords. - return ( x > minPoint.x() && x <= maxPoint.x() && y <= minPoint.y() && y > maxPoint.y() ); -} - //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- @@ -939,24 +928,24 @@ void RimEnsembleFractureStatistics::sampleAllGrids( const std::vector& samplesY, std::vector>& samples ) { - for ( size_t y = 0; y < samplesY.size(); y++ ) + const int ny = samplesY.size(); +#pragma omp parallel for + for ( int y = 0; y < ny; y++ ) { for ( size_t x = 0; x < samplesX.size(); x++ ) { - double posX = samplesX[x]; - double posY = samplesY[y]; + double posX = samplesX[x]; + double posY = samplesY[y]; + cvf::Vec3d pos( posX, posY, 0.0 ); for ( auto fractureGrid : fractureGrids ) { - for ( auto fractureCell : fractureGrid->fractureCells() ) + const RigFractureCell* fractureCell = fractureGrid->getCellFromPosition( pos ); + if ( fractureCell ) { - if ( isCoordinateInsideFractureCell( posX, posY, fractureCell ) ) - { - size_t idx = y * samplesX.size() + x; - double value = fractureCell.getConductivityValue(); - if ( !std::isinf( value ) ) samples[idx].push_back( value ); - break; - } + size_t idx = y * samplesX.size() + x; + double value = fractureCell->getConductivityValue(); + if ( !std::isinf( value ) ) samples[idx].push_back( value ); } } } @@ -1032,7 +1021,9 @@ void RimEnsembleFractureStatistics::generateStatisticsGrids( RigSlice2D occurrenceGrid( numSamplesX, numSamplesY ); - for ( size_t y = 0; y < numSamplesY; y++ ) + const int ny = static_cast( numSamplesY ); +#pragma omp parallel for + for ( int y = 0; y < ny; y++ ) { for ( size_t x = 0; x < numSamplesX; x++ ) { diff --git a/ApplicationLibCode/ReservoirDataModel/RigFractureGrid.cpp b/ApplicationLibCode/ReservoirDataModel/RigFractureGrid.cpp index f3fa79d41d..cf6b1362a0 100644 --- a/ApplicationLibCode/ReservoirDataModel/RigFractureGrid.cpp +++ b/ApplicationLibCode/ReservoirDataModel/RigFractureGrid.cpp @@ -20,6 +20,9 @@ #include "RiaLogging.h" +#include "cvfBoundingBox.h" +#include "cvfBoundingBoxTree.h" + #include //-------------------------------------------------------------------------------------------------- @@ -122,3 +125,54 @@ std::pair RigFractureGrid::fractureCellAtWellCenter() const { return m_wellCenterFractureCellIJ; } + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RigFractureGrid::ensureCellSearchTreeIsBuilt() +{ + if ( m_cellBoundingBoxTree.isNull() ) + { + size_t itemCount = m_fractureCells.size(); + + std::vector cellBoundingBoxes( itemCount ); + std::vector boundingBoxIds( itemCount ); + + for ( size_t idx = 0; idx < itemCount; ++idx ) + { + const RigFractureCell& cell = m_fractureCells[idx]; + cvf::BoundingBox& cellBB = cellBoundingBoxes[idx]; + const std::vector& corners = cell.getPolygon(); + for ( auto c : corners ) + cellBB.add( c ); + + boundingBoxIds[idx] = idx; + } + + m_cellBoundingBoxTree = new cvf::BoundingBoxTree; + m_cellBoundingBoxTree->buildTreeFromBoundingBoxes( cellBoundingBoxes, &boundingBoxIds ); + } +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +const RigFractureCell* RigFractureGrid::getCellFromPosition( const cvf::Vec3d& position ) const +{ + cvf::BoundingBox inputBB; + inputBB.add( position ); + + std::vector indexes; + m_cellBoundingBoxTree->findIntersections( inputBB, &indexes ); + + if ( !indexes.empty() ) + { + // Hit: should only one cell since they have no overlap + return &m_fractureCells[indexes[0]]; + } + else + { + // No hit + return nullptr; + } +} diff --git a/ApplicationLibCode/ReservoirDataModel/RigFractureGrid.h b/ApplicationLibCode/ReservoirDataModel/RigFractureGrid.h index 526ec80957..655ac88f1b 100644 --- a/ApplicationLibCode/ReservoirDataModel/RigFractureGrid.h +++ b/ApplicationLibCode/ReservoirDataModel/RigFractureGrid.h @@ -23,6 +23,12 @@ #include +namespace cvf +{ +class BoundingBox; +class BoundingBoxTree; +} // namespace cvf + class RigFractureCell; //================================================================================================== @@ -47,9 +53,14 @@ class RigFractureGrid : public cvf::Object std::pair fractureCellAtWellCenter() const; + const RigFractureCell* getCellFromPosition( const cvf::Vec3d& position ) const; + void ensureCellSearchTreeIsBuilt(); + private: std::vector m_fractureCells; std::pair m_wellCenterFractureCellIJ; size_t m_iCellCount; size_t m_jCellCount; + + cvf::ref m_cellBoundingBoxTree; }; diff --git a/ApplicationLibCode/ReservoirDataModel/RigStimPlanFractureDefinition.cpp b/ApplicationLibCode/ReservoirDataModel/RigStimPlanFractureDefinition.cpp index ccef694bd5..d441c737e7 100644 --- a/ApplicationLibCode/ReservoirDataModel/RigStimPlanFractureDefinition.cpp +++ b/ApplicationLibCode/ReservoirDataModel/RigStimPlanFractureDefinition.cpp @@ -487,6 +487,7 @@ cvf::cref fractureGrid->setWellCenterFractureCellIJ( wellCenterStimPlanCellIJ ); fractureGrid->setICellCount( this->m_Xs.size() - 2 ); fractureGrid->setJCellCount( this->m_Ys.size() - 2 ); + fractureGrid->ensureCellSearchTreeIsBuilt(); return cvf::cref( fractureGrid.p() ); } From 697da887c4efe0c26eac7468ab653b104130d801 Mon Sep 17 00:00:00 2001 From: Eirik Marthinsen Date: Sun, 29 Aug 2021 21:14:13 +0100 Subject: [PATCH 090/308] AutoVcpkg: Copy bootstrap file from cmake folder AutoVcpkg assumed that the bootstrap file was in the root project folder, and not in a cmake subfolder. Note: It is not correct to use ${CMAKE_CURRENT_LIST_DIR} since this is inside a function and whould still refer to the folder of the calling file. The more elegant solution would be to use ${CMAKE_CURRENT_FUNCTION_LIST_DIR}, but that is not available until CMake 3.17. --- cmake/AutoVcpkg.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/AutoVcpkg.cmake b/cmake/AutoVcpkg.cmake index e087cc4940..75ae0d0117 100644 --- a/cmake/AutoVcpkg.cmake +++ b/cmake/AutoVcpkg.cmake @@ -77,7 +77,7 @@ function (vcpkg_bootstrap) find_program(AUTO_VCPKG_EXECUTABLE vcpkg PATHS ${AUTO_VCPKG_ROOT}) if (NOT AUTO_VCPKG_EXECUTABLE) - execute_process(COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_SOURCE_DIR}/vcpkg-bootstrap.cmake" "${AUTO_VCPKG_ROOT}") + execute_process(COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_SOURCE_DIR}/cmake/vcpkg-bootstrap.cmake" "${AUTO_VCPKG_ROOT}") execute_process(COMMAND ${CMAKE_COMMAND} -P "${AUTO_VCPKG_ROOT}/vcpkg-bootstrap.cmake" WORKING_DIRECTORY ${AUTO_VCPKG_ROOT}) endif () From 200d5c65a39ba92d196ffb3ada42bebb0928c534 Mon Sep 17 00:00:00 2001 From: Eirik Marthinsen Date: Sun, 29 Aug 2021 21:24:48 +0100 Subject: [PATCH 091/308] AutoVcpkg: Include Vcpkg toolchain Include the Vcpkg toolchain file after the installation of the first package. When building for the first time from a clean source tree, the Vcpkg toolchain file does not exist. At the same time CMake is only reading the toolchain file the very first time it is configuring, but since the toolchain file is only created when vcpkg is configured on the first call to vcpkg_install it will never read it. So it is not enough to just reconfigure. Note: It is not ideal to include it here since one might at some point install and search for a package at an erlier point in the script and fail to find it. Alternative approaces that I considered: - Include this file right after including AutoVcpkg. This would require 1 recompilation for the file to be found and read which is unfortunate. - Include this file in the config function in AutoVcpkg. This seemed difficult without including the file for every call to vcpkg_install, which seems unecessary. --- CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8dc65dfe10..3a52df9bdf 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -340,6 +340,7 @@ endif() # MSVC if(VCPKG_AUTO_INSTALL) vcpkg_install(boost-filesystem) vcpkg_install(boost-spirit) + include(${CMAKE_TOOLCHAIN_FILE}) endif() add_subdirectory(ThirdParty/custom-opm-flowdiagnostics) From 503d946bc119a022d95104585b81130edf2abcaa Mon Sep 17 00:00:00 2001 From: Kristian Bendiksen Date: Tue, 31 Aug 2021 08:12:40 +0200 Subject: [PATCH 092/308] #7923 Ensemble Fracture Statistics: export fracture orientation for result files (#7926) --- .../RifEnsembleFractureStatisticsExporter.cpp | 38 ++++++++++++++++--- .../RifEnsembleFractureStatisticsExporter.h | 8 +++- .../RimEnsembleFractureStatistics.cpp | 9 ++++- 3 files changed, 48 insertions(+), 7 deletions(-) diff --git a/ApplicationLibCode/FileInterface/RifEnsembleFractureStatisticsExporter.cpp b/ApplicationLibCode/FileInterface/RifEnsembleFractureStatisticsExporter.cpp index 006ddec513..a220691015 100644 --- a/ApplicationLibCode/FileInterface/RifEnsembleFractureStatisticsExporter.cpp +++ b/ApplicationLibCode/FileInterface/RifEnsembleFractureStatisticsExporter.cpp @@ -33,11 +33,12 @@ //-------------------------------------------------------------------------------------------------- bool RifEnsembleFractureStatisticsExporter::writeAsStimPlanXml( const std::vector>& statistics, const std::vector>& properties, - const QString& filePath, - const std::vector& gridXs, - const std::vector& gridYs, - double time, - RiaDefines::EclipseUnitSystem unitSystem ) + const QString& filePath, + const std::vector& gridXs, + const std::vector& gridYs, + double time, + RiaDefines::EclipseUnitSystem unitSystem, + RigStimPlanFractureDefinition::Orientation orientation ) { QFile data( filePath ); if ( !data.open( QFile::WriteOnly | QFile::Truncate ) ) @@ -47,6 +48,7 @@ bool RifEnsembleFractureStatisticsExporter::writeAsStimPlanXml( const std::vecto QTextStream stream( &data ); appendHeaderToStream( stream ); + appendOrientationToStream( stream, orientation ); appendGridDimensionsToStream( stream, gridXs, gridYs, unitSystem ); appendPropertiesToStream( stream, statistics, properties, gridYs, time ); appendFooterToStream( stream ); @@ -105,6 +107,19 @@ void RifEnsembleFractureStatisticsExporter::appendPropertiesToStream( stream << "" << endl; } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RifEnsembleFractureStatisticsExporter::appendOrientationToStream( QTextStream& stream, + RigStimPlanFractureDefinition::Orientation orientation ) +{ + if ( orientation != RigStimPlanFractureDefinition::Orientation::UNDEFINED ) + { + QString orientationString = getStringForOrientation( orientation ); + stream << QString( "%1" ).arg( orientationString ) << endl; + } +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- @@ -150,3 +165,16 @@ QString RifEnsembleFractureStatisticsExporter::getStringForUnitSystem( RiaDefine else return ""; } + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +QString RifEnsembleFractureStatisticsExporter::getStringForOrientation( RigStimPlanFractureDefinition::Orientation orientation ) +{ + if ( orientation == RigStimPlanFractureDefinition::Orientation::TRANSVERSE ) + return "transverse"; + else if ( orientation == RigStimPlanFractureDefinition::Orientation::LONGITUDINAL ) + return "longitudinal"; + else + return ""; +} diff --git a/ApplicationLibCode/FileInterface/RifEnsembleFractureStatisticsExporter.h b/ApplicationLibCode/FileInterface/RifEnsembleFractureStatisticsExporter.h index c8064209e6..99d93470bb 100644 --- a/ApplicationLibCode/FileInterface/RifEnsembleFractureStatisticsExporter.h +++ b/ApplicationLibCode/FileInterface/RifEnsembleFractureStatisticsExporter.h @@ -20,6 +20,8 @@ #include "RiaDefines.h" +#include "RigStimPlanFractureDefinition.h" + #include #include @@ -40,10 +42,12 @@ class RifEnsembleFractureStatisticsExporter const std::vector& gridXs, const std::vector& gridYs, double time, - RiaDefines::EclipseUnitSystem unitSystem ); + RiaDefines::EclipseUnitSystem unitSystem, + RigStimPlanFractureDefinition::Orientation orientation ); private: static void appendHeaderToStream( QTextStream& stream ); + static void appendOrientationToStream( QTextStream& stream, RigStimPlanFractureDefinition::Orientation orientation ); static void appendGridDimensionsToStream( QTextStream& stream, const std::vector& gridXs, const std::vector& gridYs, @@ -56,4 +60,6 @@ class RifEnsembleFractureStatisticsExporter static void appendFooterToStream( QTextStream& stream ); static QString getStringForUnitSystem( RiaDefines::EclipseUnitSystem unitSystem ); + + static QString getStringForOrientation( RigStimPlanFractureDefinition::Orientation orientation ); }; diff --git a/ApplicationLibCode/ProjectDataModel/Completions/RimEnsembleFractureStatistics.cpp b/ApplicationLibCode/ProjectDataModel/Completions/RimEnsembleFractureStatistics.cpp index f97303a47d..7c62cfd989 100644 --- a/ApplicationLibCode/ProjectDataModel/Completions/RimEnsembleFractureStatistics.cpp +++ b/ApplicationLibCode/ProjectDataModel/Completions/RimEnsembleFractureStatistics.cpp @@ -344,11 +344,17 @@ std::vector RimEnsembleFractureStatistics::computeStatistics() double timeStep = 1.0; double referenceDepth = 0.0; + + RigStimPlanFractureDefinition::Orientation orientation = RigStimPlanFractureDefinition::Orientation::UNDEFINED; if ( m_meshAlignmentType() == MeshAlignmentType::PERFORATION_DEPTH ) { for ( auto definition : stimPlanFractureDefinitions ) { referenceDepth += computeDepthOfWellPathAtFracture( definition ); + // Take the first orientation which is defined (all the fractures + // should have the same orientation). + if ( orientation == RigStimPlanFractureDefinition::Orientation::UNDEFINED ) + orientation = definition->orientation(); } referenceDepth /= stimPlanFractureDefinitions.size(); } @@ -421,7 +427,8 @@ std::vector RimEnsembleFractureStatistics::computeStatistics() gridXs, gridYsWithOffset, timeStep, - unitSystem ); + unitSystem, + orientation ); xmlFilePaths.push_back( xmlFilePath ); } From 638f926429eb131b921fc0ff9c548f665aa3ae45 Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Wed, 1 Sep 2021 08:13:16 +0200 Subject: [PATCH 093/308] cmake-format: Allow dangling parenthesis --- ApplicationExeCode/CMakeLists.txt | 193 ++++++++++++------ .../Application/CMakeLists_files.cmake | 12 +- .../Application/Tools/CMakeLists_files.cmake | 12 +- .../WellPathTools/CMakeLists_files.cmake | 9 +- ApplicationLibCode/CMakeLists.txt | 83 +++++--- .../CMakeLists_files.cmake | 9 +- .../Core/CMakeLists_files.cmake | 9 +- .../CMakeLists_files.cmake | 9 +- .../AnnotationCommands/CMakeLists_files.cmake | 12 +- .../CMakeLists_files.cmake | 9 +- ApplicationLibCode/Commands/CMakeLists.txt | 17 +- .../Commands/CMakeLists_files.cmake | 18 +- .../CellFilterCommands/CMakeLists_files.cmake | 9 +- .../CMakeLists_files.cmake | 9 +- .../CompletionCommands/CMakeLists_files.cmake | 9 +- .../CMakeLists_files.cmake | 9 +- .../CMakeLists_files.cmake | 9 +- .../CMakeLists_files.cmake | 9 +- .../EclipseCommands/CMakeLists_files.cmake | 9 +- .../EclipseWell/CMakeLists_files.cmake | 9 +- .../ExportCommands/CMakeLists_files.cmake | 9 +- .../FlowCommands/CMakeLists_files.cmake | 9 +- .../FractureCommands/CMakeLists_files.cmake | 12 +- .../GeoMechCommands/CMakeLists_files.cmake | 9 +- .../CMakeLists_files.cmake | 9 +- .../HoloLensCommands/CMakeLists_files.cmake | 12 +- .../CMakeLists_files.cmake | 12 +- .../CMakeLists_files.cmake | 9 +- .../CMakeLists_files.cmake | 9 +- .../CMakeLists_files.cmake | 12 +- .../CMakeLists_files.cmake | 9 +- .../CMakeLists_files.cmake | 9 +- .../CMakeLists_files.cmake | 12 +- .../StreamlineCommands/CMakeLists_files.cmake | 9 +- .../CMakeLists_files.cmake | 12 +- .../SurfaceCommands/CMakeLists_files.cmake | 9 +- .../ToggleCommands/CMakeLists_files.cmake | 9 +- .../Commands/ViewLink/CMakeLists_files.cmake | 9 +- .../WellLogCommands/CMakeLists_files.cmake | 9 +- .../WellPathCommands/CMakeLists_files.cmake | 6 +- .../FileInterface/CMakeLists_files.cmake | 3 +- .../GeoMech/GeoMechDataModel/CMakeLists.txt | 6 +- .../CMakeLists_files.cmake | 9 +- .../GeoMech/OdbReader/CMakeLists.txt | 14 +- .../OdbReader_UnitTests/CMakeLists.txt | 12 +- .../ModelVisualization/CMakeLists_files.cmake | 9 +- .../GridBox/CMakeLists_files.cmake | 9 +- .../Intersections/CMakeLists_files.cmake | 9 +- .../Streamlines/CMakeLists_files.cmake | 6 +- .../Surfaces/CMakeLists_files.cmake | 9 +- .../CMakeLists_files.cmake | 9 +- .../AnalysisPlots/CMakeLists_files.cmake | 9 +- .../Annotations/CMakeLists_files.cmake | 9 +- .../ProjectDataModel/CMakeLists_files.cmake | 15 +- .../CellFilters/CMakeLists_files.cmake | 9 +- .../Completions/CMakeLists_files.cmake | 9 +- .../CorrelationPlots/CMakeLists_files.cmake | 9 +- .../Faults/CMakeLists_files.cmake | 9 +- .../Flow/CMakeLists_files.cmake | 9 +- .../GeoMech/CMakeLists_files.cmake | 9 +- .../GridCrossPlots/CMakeLists_files.cmake | 9 +- .../CellFilters/CMakeLists_files.cmake | 9 +- .../Measurement/CMakeLists_files.cmake | 12 +- .../Parameters/CMakeLists_files.cmake | 9 +- .../PlotTemplates/CMakeLists_files.cmake | 9 +- .../ProcessControl/CMakeLists_files.cmake | 12 +- .../StimPlanModel/CMakeLists_files.cmake | 9 +- .../Streamlines/CMakeLists_files.cmake | 9 +- .../Summary/CMakeLists_files.cmake | 9 +- .../Surfaces/CMakeLists_files.cmake | 9 +- .../WellLog/CMakeLists_files.cmake | 9 +- .../WellMeasurement/CMakeLists_files.cmake | 9 +- .../WellPath/CMakeLists_files.cmake | 9 +- .../CMakeLists_files.cmake | 9 +- .../CommandRouter/CMakeLists_files.cmake | 9 +- .../ReservoirDataModel/CMakeLists_files.cmake | 9 +- .../CMakeLists_filesNotToUnitTest.cmake | 9 +- .../Completions/CMakeLists_files.cmake | 9 +- .../ResultStatisticsCache/CMakeLists.txt | 3 +- .../UnitTests/CMakeLists_files.cmake | 15 +- .../AnalysisPlots/CMakeLists_files.cmake | 9 +- .../UserInterface/CMakeLists_files.cmake | 12 +- CMakeLists.txt | 109 ++++++---- Fwk/AppFwk/CMakeLists.txt | 12 +- Fwk/AppFwk/CommonCode/CMakeLists.txt | 14 +- Fwk/AppFwk/cafAnimControl/CMakeLists.txt | 12 +- Fwk/AppFwk/cafCommand/CMakeLists.txt | 11 +- Fwk/AppFwk/cafCommandFeatures/CMakeLists.txt | 14 +- .../CMakeLists.txt | 3 +- Fwk/AppFwk/cafPdmCvf/CMakeLists.txt | 9 +- .../cafPdmCvf_UnitTests/CMakeLists.txt | 23 ++- Fwk/AppFwk/cafPdmScripting/CMakeLists.txt | 6 +- .../cafPdmScripting_UnitTests/CMakeLists.txt | 17 +- Fwk/AppFwk/cafProjectDataModel/CMakeLists.txt | 11 +- .../cafPdmCore/CMakeLists.txt | 11 +- .../cafPdmCore_UnitTests/CMakeLists.txt | 14 +- .../cafPdmUiCore/CMakeLists.txt | 17 +- .../cafPdmXml/CMakeLists.txt | 11 +- .../cafPdmXml_UnitTests/CMakeLists.txt | 14 +- .../CMakeLists.txt | 14 +- .../cafTestApplication/CMakeLists.txt | 18 +- .../cafTestCvfApplication/CMakeLists.txt | 23 ++- Fwk/AppFwk/cafUserInterface/CMakeLists.txt | 19 +- .../cafUserInterface_UnitTests/CMakeLists.txt | 23 ++- Fwk/AppFwk/cafViewer/CMakeLists.txt | 14 +- Fwk/AppFwk/cafVizExtensions/CMakeLists.txt | 9 +- .../CMakeLists.txt | 3 +- cmake/cmake-format.py | 2 +- 108 files changed, 977 insertions(+), 504 deletions(-) diff --git a/ApplicationExeCode/CMakeLists.txt b/ApplicationExeCode/CMakeLists.txt index 213b1f613f..97864137b5 100644 --- a/ApplicationExeCode/CMakeLists.txt +++ b/ApplicationExeCode/CMakeLists.txt @@ -14,7 +14,8 @@ endif() if(CMAKE_COMPILER_IS_GNUCXX) set(CMAKE_CXX_FLAGS - "${CMAKE_CXX_FLAGS} -Wno-deprecated -Wno-deprecated-declarations") + "${CMAKE_CXX_FLAGS} -Wno-deprecated -Wno-deprecated-declarations" + ) endif() # Open GL @@ -23,7 +24,8 @@ find_package(OpenGL) find_package( Qt5 COMPONENTS Core - QUIET) + QUIET +) if(Qt5Core_FOUND) find_package( @@ -38,7 +40,8 @@ if(Qt5Core_FOUND) Concurrent PrintSupport Svg - OPTIONAL_COMPONENTS Charts) + OPTIONAL_COMPONENTS Charts + ) set(QT_LIBRARIES Qt5::Core Qt5::Gui @@ -49,7 +52,8 @@ if(Qt5Core_FOUND) Qt5::Xml Qt5::Concurrent Qt5::PrintSupport - Qt5::Svg) + Qt5::Svg + ) if(Qt5Charts_FOUND) list(APPEND QT_LIBRARIES Qt5::Charts) endif(Qt5Charts_FOUND) @@ -70,12 +74,15 @@ set(CODE_SOURCE_FILES RiaMain.cpp) if(RESINSIGHT_ENABLE_GRPC) list(APPEND CODE_HEAD_FILES RiaGrpcConsoleApplication.h - RiaGrpcGuiApplication.h) + RiaGrpcGuiApplication.h + ) list(APPEND CODE_SOURCE_FILES RiaGrpcConsoleApplication.cpp - RiaGrpcGuiApplication.cpp) + RiaGrpcGuiApplication.cpp + ) list(APPEND QT_MOC_HEADERS RiaGrpcConsoleApplication.h - RiaGrpcGuiApplication.h) + RiaGrpcGuiApplication.h + ) # Find Protobuf installation Looks for protobuf-config.cmake file installed by # Protobuf's cmake installation. @@ -88,12 +95,14 @@ if(RESINSIGHT_ENABLE_GRPC) find_package(gRPC CONFIG REQUIRED) set(_PROTOBUF_LIBPROTOBUF protobuf::libprotobuf) set(_GRPC_GRPCPP_UNSECURE gRPC::grpc++_unsecure gRPC::grpc_unsecure - gRPC::gpr) + gRPC::gpr + ) set(GRPC_LINK_LIBRARIES ${_GRPC_GRPCPP_UNSECURE} ${_PROTOBUF_LIBPROTOBUF}) else() set(RESINSIGHT_GRPC_INSTALL_PREFIX "" - CACHE PATH "gRPC : Install prefix for gRPC") + CACHE PATH "gRPC : Install prefix for gRPC" + ) set(ENV{PKG_CONFIG_PATH} "${RESINSIGHT_GRPC_INSTALL_PREFIX}/lib/pkgconfig") find_package(PkgConfig REQUIRED) pkg_check_modules( @@ -104,7 +113,8 @@ if(RESINSIGHT_ENABLE_GRPC) grpc_unsecure gpr protobuf - libcares) + libcares + ) endif() endif() @@ -156,7 +166,8 @@ set(EXE_FILES ${HEADER_FILES} ${REFERENCED_CMAKE_FILES} .clang-format - .clang-tidy) + .clang-tidy +) add_executable(ResInsight ${EXE_FILES}) @@ -165,7 +176,8 @@ if(${CMAKE_SYSTEM_NAME} MATCHES "Linux") ResInsight PROPERTIES COMPILE_FLAGS - "-Wall -Wno-unused-parameter -Wno-reorder -Wno-parentheses -Wno-switch") + "-Wall -Wno-unused-parameter -Wno-reorder -Wno-parentheses -Wno-switch" + ) # Treat warnings as errors if asked to do so if(RESINSIGHT_TREAT_WARNINGS_AS_ERRORS) set_target_properties( @@ -212,8 +224,9 @@ if(MSVC) endif() message(STATUS "BUILD_FLAGS_FOR_MSVC ${BUILD_FLAGS_FOR_MSVC}") - set_target_properties(ResInsight PROPERTIES COMPILE_FLAGS - ${BUILD_FLAGS_FOR_MSVC}) + set_target_properties( + ResInsight PROPERTIES COMPILE_FLAGS ${BUILD_FLAGS_FOR_MSVC} + ) endif() @@ -227,22 +240,27 @@ if(APPLE) COMMAND sips -s format icns ${CMAKE_CURRENT_SOURCE_DIR}/Resources/AppLogo48x48.png --out ${CMAKE_CURRENT_BINARY_DIR}/Resources/ResInsight.icns - COMMENT Converting application icon) + COMMENT Converting application icon + ) add_custom_target( ResInsight-icns - DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/Resources/ResInsight.icns) + DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/Resources/ResInsight.icns + ) add_dependencies(ResInsight ResInsight-icns) set_target_properties( ResInsight PROPERTIES MACOSX_BUNDLE_ICON_FILE - ${CMAKE_CURRENT_BINARY_DIR}/Resources/ResInsight.icns) + ${CMAKE_CURRENT_BINARY_DIR}/Resources/ResInsight.icns + ) endif() if(RESINSIGHT_ENABLE_GRPC) list(APPEND THIRD_PARTY_LIBRARIES ${GRPC_LINK_LIBRARIES}) if(MSVC) - set_target_properties(ResInsight PROPERTIES LINK_FLAGS_RELWITHDEBINFO - "/NODEFAULTLIB:MSVCRTD.lib") + set_target_properties( + ResInsight PROPERTIES LINK_FLAGS_RELWITHDEBINFO + "/NODEFAULTLIB:MSVCRTD.lib" + ) endif() endif() @@ -264,7 +282,8 @@ set(LINK_LIBRARIES ${APP_FWK_LIBRARIES} ${VIZ_FWK_LIBRARIES} ApplicationLibCode - Commands) + Commands +) if(RESINSIGHT_ENABLE_GRPC) list(APPEND LINK_LIBRARIES GrpcInterface) @@ -291,12 +310,14 @@ set(UNITY_EXCLUDE_FILES qrc_cafCommandFeatures.cpp # Exclude files including opm-common ProjectDataModel/RimVfpTableExtractor.cpp - ProjectDataModel/RimVfpPlot.cpp) + ProjectDataModel/RimVfpPlot.cpp +) if(RESINSIGHT_ENABLE_UNITY_BUILD) foreach(fileToExclude ${UNITY_EXCLUDE_FILES}) - set_source_files_properties(${fileToExclude} - PROPERTIES SKIP_UNITY_BUILD_INCLUSION TRUE) + set_source_files_properties( + ${fileToExclude} PROPERTIES SKIP_UNITY_BUILD_INCLUSION TRUE + ) endforeach(fileToExclude) endif() @@ -330,7 +351,8 @@ if(MSVC) set(HDF5_DLL_NAMES hdf5 hdf5_cpp szip zlib) foreach(HDF5_DLL_NAME ${HDF5_DLL_NAMES}) list(APPEND RI_DLL_FILENAMES - ${RESINSIGHT_HDF5_DIR}/bin/${HDF5_DLL_NAME}.dll) + ${RESINSIGHT_HDF5_DIR}/bin/${HDF5_DLL_NAME}.dll + ) endforeach(HDF5_DLL_NAME) endif() @@ -342,7 +364,8 @@ foreach(FILE_TO_COPY ${RI_DLL_FILENAMES}) TARGET ResInsight POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_if_different ${FILE_TO_COPY} - $) + $ + ) endforeach() # Generate Python code in a target that is part of ALL_BUILD and depends on @@ -355,9 +378,11 @@ if(RESINSIGHT_ENABLE_GRPC) OUTPUT ${GENERATED_CLASSES_FILE} COMMAND ResInsight ARGS --console --generate ${GENERATED_CLASSES_FILE} DEPENDS ResInsight - COMMENT "Generating ${GENERATED_CLASSES_FILE}") - add_custom_target(RipsGeneratedPythonClasses ALL - SOURCES ${GENERATED_CLASSES_FILE}) + COMMENT "Generating ${GENERATED_CLASSES_FILE}" + ) + add_custom_target( + RipsGeneratedPythonClasses ALL SOURCES ${GENERATED_CLASSES_FILE} + ) source_group("Source Files" ${GENERATED_CLASSES_FILE}) add_dependencies(RipsGeneratedPythonClasses ResInsight) @@ -369,7 +394,8 @@ if(RESINSIGHT_ENABLE_GRPC) COMMAND ${CMAKE_COMMAND} -E copy_directory "${CMAKE_SOURCE_DIR}/GrpcInterface/Python" - $/Python) + $/Python + ) endif(RESINSIGHT_ENABLE_GRPC) @@ -389,19 +415,22 @@ if(RESINSIGHT_PRIVATE_INSTALL) # different installoptions that does things this way, and really do copy # them when doing PRIVATE_INSTALL set(RESINSIGHT_INSTALL_RPATH ${RESINSIGHT_INSTALL_RPATH} - ${RESINSIGHT_ODB_API_DIR}/lib) + ${RESINSIGHT_ODB_API_DIR}/lib + ) endif() if(EXISTS ${RESINSIGHT_ERT_EXTERNAL_LIB_ROOT}) # append the external ERT lib root set(RESINSIGHT_INSTALL_RPATH ${RESINSIGHT_INSTALL_RPATH} - ${RESINSIGHT_ERT_EXTERNAL_LIB_ROOT}) + ${RESINSIGHT_ERT_EXTERNAL_LIB_ROOT} + ) endif() # message("RESINSIGHT_INSTALL_RPATH : " "${RESINSIGHT_INSTALL_RPATH}") - set_target_properties(ResInsight PROPERTIES INSTALL_RPATH - "${RESINSIGHT_INSTALL_RPATH}") + set_target_properties( + ResInsight PROPERTIES INSTALL_RPATH "${RESINSIGHT_INSTALL_RPATH}" + ) # bundle Qt5 libraries option(RESINSIGHT_QT5_BUNDLE_LIBRARIES "Bundle Qt5 libraries" OFF) @@ -413,7 +442,8 @@ if(RESINSIGHT_PRIVATE_INSTALL) get_property( _filepath TARGET "Qt5::Core" - PROPERTY LOCATION_RELEASE) + PROPERTY LOCATION_RELEASE + ) get_filename_component(_dir ${_filepath} PATH) foreach(qtlib ${QT_LIBRARIES}) @@ -436,7 +466,8 @@ if(RESINSIGHT_PRIVATE_INSTALL) install( FILES ${FILE_AND_SYMLINKS} DESTINATION ${RESINSIGHT_INSTALL_FOLDER} - OPTIONAL) + OPTIONAL + ) endforeach() set(QT_PLUGIN_PATH "$ENV{QT_PLUGIN_PATH}") @@ -447,21 +478,26 @@ if(RESINSIGHT_PRIVATE_INSTALL) # include platform files install(FILES ${QT_PLUGIN_PATH}/platforms/libqxcb.so - DESTINATION ${RESINSIGHT_INSTALL_FOLDER}/platforms/) + DESTINATION ${RESINSIGHT_INSTALL_FOLDER}/platforms/ + ) install(FILES ${QT_PLUGIN_PATH}/imageformats/libqsvg.so - DESTINATION ${RESINSIGHT_INSTALL_FOLDER}/imageformats/) + DESTINATION ${RESINSIGHT_INSTALL_FOLDER}/imageformats/ + ) install(FILES ${QT_PLUGIN_PATH}/iconengines/libqsvgicon.so - DESTINATION ${RESINSIGHT_INSTALL_FOLDER}/iconengines/) + DESTINATION ${RESINSIGHT_INSTALL_FOLDER}/iconengines/ + ) # Required by xcb module used to create OpenGL widgets install( FILES ${QT_PLUGIN_PATH}/xcbglintegrations/libqxcb-egl-integration.so DESTINATION ${RESINSIGHT_INSTALL_FOLDER}/plugins/xcbglintegrations/ - OPTIONAL) + OPTIONAL + ) install( FILES ${QT_PLUGIN_PATH}/xcbglintegrations/libqxcb-glx-integration.so DESTINATION ${RESINSIGHT_INSTALL_FOLDER}/plugins/xcbglintegrations/ - OPTIONAL) + OPTIONAL + ) endif(RESINSIGHT_QT5_BUNDLE_LIBRARIES) @@ -477,14 +513,16 @@ if(RESINSIGHT_PRIVATE_INSTALL) if(WIN32 AND TARGET Qt5::qmake - AND NOT TARGET Qt5::windeployqt) + AND NOT TARGET Qt5::windeployqt + ) get_target_property(_qt5_qmake_location Qt5::qmake IMPORTED_LOCATION) execute_process( COMMAND "${_qt5_qmake_location}" -query QT_INSTALL_PREFIX RESULT_VARIABLE return_code OUTPUT_VARIABLE qt5_install_prefix - OUTPUT_STRIP_TRAILING_WHITESPACE) + OUTPUT_STRIP_TRAILING_WHITESPACE + ) set(imported_location "${qt5_install_prefix}/bin/windeployqt.exe") @@ -494,8 +532,9 @@ if(RESINSIGHT_PRIVATE_INSTALL) if(EXISTS ${imported_location}) add_executable(Qt5::windeployqt IMPORTED) - set_target_properties(Qt5::windeployqt PROPERTIES IMPORTED_LOCATION - ${imported_location}) + set_target_properties( + Qt5::windeployqt PROPERTIES IMPORTED_LOCATION ${imported_location} + ) endif() endif() @@ -514,7 +553,8 @@ if(RESINSIGHT_PRIVATE_INSTALL) Qt5::windeployqt --no-compiler-runtime --no-system-d3d-compiler --no-quick-import --no-translations --verbose 0 --dir "${CMAKE_CURRENT_BINARY_DIR}/windeployqt" - "$/$") + "$/$" + ) # Qt DLLs message(STATUS "Creating post build step for copying Qt DLLs") @@ -527,11 +567,13 @@ if(RESINSIGHT_PRIVATE_INSTALL) COMMAND ${CMAKE_COMMAND} -E copy_directory "${CMAKE_CURRENT_BINARY_DIR}/windeployqt/" - $) + $ + ) # copy deployment directory during installation install(DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/windeployqt/" - DESTINATION ${RESINSIGHT_INSTALL_FOLDER}) + DESTINATION ${RESINSIGHT_INSTALL_FOLDER} + ) endif() # install GRPC-related DLLs and generated_classes.py @@ -541,12 +583,14 @@ if(RESINSIGHT_PRIVATE_INSTALL) set(GRPC_DLL_NAMES ${PROTOBUF_DLL} cares ${ZLIB_DLL} abseil_dll) foreach(dllname ${GRPC_DLL_NAMES}) install(FILES $/${dllname}.dll - DESTINATION ${RESINSIGHT_INSTALL_FOLDER}) + DESTINATION ${RESINSIGHT_INSTALL_FOLDER} + ) endforeach(dllname ${GRPC_DLL_NAMES}) install( FILES ${CMAKE_SOURCE_DIR}/GrpcInterface/Python/rips/generated/generated_classes.py - DESTINATION ${RESINSIGHT_INSTALL_FOLDER}/Python/rips/generated) + DESTINATION ${RESINSIGHT_INSTALL_FOLDER}/Python/rips/generated + ) endif() # Boost @@ -555,7 +599,8 @@ if(RESINSIGHT_PRIVATE_INSTALL) get_property( _filepath TARGET "Boost::filesystem" - PROPERTY LOCATION_RELEASE) + PROPERTY LOCATION_RELEASE + ) message("_filepath: ${_filepath}") # The location of Boost is based on the file structure as installed by vcpkg @@ -571,14 +616,16 @@ if(RESINSIGHT_PRIVATE_INSTALL) install( FILES ${RI_BOOST_DLLS} DESTINATION ${RESINSIGHT_INSTALL_FOLDER} - CONFIGURATIONS Debug Release RelWithDebInfo) + CONFIGURATIONS Debug Release RelWithDebInfo + ) # CRT set(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP ON) set(CMAKE_INSTALL_OPENMP_LIBRARIES ON) include(InstallRequiredSystemLibraries) install(PROGRAMS ${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS} - DESTINATION ${RESINSIGHT_INSTALL_FOLDER}) + DESTINATION ${RESINSIGHT_INSTALL_FOLDER} + ) endif() @@ -597,7 +644,8 @@ if(RESINSIGHT_PRIVATE_INSTALL) GROUP_READ GROUP_EXECUTE WORLD_READ - WORLD_EXECUTE) + WORLD_EXECUTE + ) endif() else(RESINSIGHT_PRIVATE_INSTALL) @@ -609,13 +657,17 @@ else(RESINSIGHT_PRIVATE_INSTALL) install( FILES ${CMAKE_CURRENT_SOURCE_DIR}/Resources/AppLogo48x48.png DESTINATION share/icons/hicolor/48x48/apps - RENAME ResInsight.png) + RENAME ResInsight.png + ) # desktop environment icon; remember to call `update-desktop-database` in # package post-install scripts - configure_file(${CMAKE_CURRENT_SOURCE_DIR}/resinsight.desktop.in - ${CMAKE_CURRENT_BINARY_DIR}/resinsight.desktop @ONLY) + configure_file( + ${CMAKE_CURRENT_SOURCE_DIR}/resinsight.desktop.in + ${CMAKE_CURRENT_BINARY_DIR}/resinsight.desktop @ONLY + ) install(FILES ${CMAKE_CURRENT_BINARY_DIR}/resinsight.desktop - DESTINATION share/applications) + DESTINATION share/applications + ) endif(RESINSIGHT_PRIVATE_INSTALL) # OpenSSL @@ -633,25 +685,32 @@ if(RESINSIGHT_BUNDLE_OPENSSL) message("OpenSSL binary dir: ${OPENSSL_BIN_DIR}") install(FILES ${OPENSSL_BIN_DIR}/libcrypto-1_1-x64.dll - DESTINATION ${RESINSIGHT_INSTALL_FOLDER}) + DESTINATION ${RESINSIGHT_INSTALL_FOLDER} + ) install(FILES ${OPENSSL_BIN_DIR}/libssl-1_1-x64.dll - DESTINATION ${RESINSIGHT_INSTALL_FOLDER}) + DESTINATION ${RESINSIGHT_INSTALL_FOLDER} + ) endif(OPENSSL_FOUND) elseif(${CMAKE_SYSTEM_NAME} MATCHES "Linux") # Assumes that OpenSSL is installed by ./vcpkg install # --overlay-triplets=custom-triplets --triplet x64-linux-dynamic openssl set(OPENSSL_BIN_DIR - ${CMAKE_SOURCE_DIR}/ThirdParty/vcpkg/installed/x64-linux-dynamic/lib) + ${CMAKE_SOURCE_DIR}/ThirdParty/vcpkg/installed/x64-linux-dynamic/lib + ) message("OpenSSL binary dir: ${OPENSSL_BIN_DIR}") install(FILES ${OPENSSL_BIN_DIR}/libcrypto.so - DESTINATION ${RESINSIGHT_INSTALL_FOLDER}) + DESTINATION ${RESINSIGHT_INSTALL_FOLDER} + ) install(FILES ${OPENSSL_BIN_DIR}/libcrypto.so.1.1 - DESTINATION ${RESINSIGHT_INSTALL_FOLDER}) + DESTINATION ${RESINSIGHT_INSTALL_FOLDER} + ) install(FILES ${OPENSSL_BIN_DIR}/libssl.so - DESTINATION ${RESINSIGHT_INSTALL_FOLDER}) + DESTINATION ${RESINSIGHT_INSTALL_FOLDER} + ) install(FILES ${OPENSSL_BIN_DIR}/libssl.so.1.1 - DESTINATION ${RESINSIGHT_INSTALL_FOLDER}) + DESTINATION ${RESINSIGHT_INSTALL_FOLDER} + ) endif() endif(RESINSIGHT_BUNDLE_OPENSSL) @@ -687,7 +746,8 @@ endif() if(NOT ${OCTAVE_VERSION_STRING} EQUAL "") set(RESINSIGHT_PACKAGE_NAME - "${RESINSIGHT_PACKAGE_NAME}_oct-${OCTAVE_VERSION_STRING}") + "${RESINSIGHT_PACKAGE_NAME}_oct-${OCTAVE_VERSION_STRING}" + ) endif() if(RESINSIGHT_BUNDLE_OPENSSL AND OPENSSL_FOUND) @@ -697,7 +757,8 @@ endif() # Append el5 when compiled on RHEL5 and el6 if compiled on RHEL6 if(NOT "${RESINSIGHT_RHEL_SYSTEM_NAME}" STREQUAL "") set(RESINSIGHT_PACKAGE_NAME - "${RESINSIGHT_PACKAGE_NAME}_${RESINSIGHT_RHEL_SYSTEM_NAME}") + "${RESINSIGHT_PACKAGE_NAME}_${RESINSIGHT_RHEL_SYSTEM_NAME}" + ) else() set(RESINSIGHT_PACKAGE_NAME "${RESINSIGHT_PACKAGE_NAME}_${CPACK_SYSTEM_NAME}") endif() diff --git a/ApplicationLibCode/Application/CMakeLists_files.cmake b/ApplicationLibCode/Application/CMakeLists_files.cmake index 1d8912866b..5115e976db 100644 --- a/ApplicationLibCode/Application/CMakeLists_files.cmake +++ b/ApplicationLibCode/Application/CMakeLists_files.cmake @@ -22,7 +22,8 @@ set(SOURCE_GROUP_HEADER_FILES ${CMAKE_CURRENT_LIST_DIR}/RiaNncDefines.h ${CMAKE_CURRENT_LIST_DIR}/RiaStimPlanModelDefines.h ${CMAKE_CURRENT_LIST_DIR}/RiaResultNames.h - ${CMAKE_CURRENT_LIST_DIR}/RiaNumberFormat.h) + ${CMAKE_CURRENT_LIST_DIR}/RiaNumberFormat.h +) set(SOURCE_GROUP_SOURCE_FILES ${CMAKE_CURRENT_LIST_DIR}/RiaApplication.cpp @@ -48,7 +49,8 @@ set(SOURCE_GROUP_SOURCE_FILES ${CMAKE_CURRENT_LIST_DIR}/RiaNncDefines.cpp ${CMAKE_CURRENT_LIST_DIR}/RiaStimPlanModelDefines.cpp ${CMAKE_CURRENT_LIST_DIR}/RiaResultNames.cpp - ${CMAKE_CURRENT_LIST_DIR}/RiaNumberFormat.cpp) + ${CMAKE_CURRENT_LIST_DIR}/RiaNumberFormat.cpp +) list(APPEND CODE_HEADER_FILES ${SOURCE_GROUP_HEADER_FILES}) @@ -60,8 +62,10 @@ set(QT_MOC_HEADERS ${CMAKE_CURRENT_LIST_DIR}/RiaGuiApplication.h ${CMAKE_CURRENT_LIST_DIR}/RiaCompletionTypeCalculationScheduler.h ${CMAKE_CURRENT_LIST_DIR}/RiaViewRedrawScheduler.h - ${CMAKE_CURRENT_LIST_DIR}/RiaPlotWindowRedrawScheduler.h) + ${CMAKE_CURRENT_LIST_DIR}/RiaPlotWindowRedrawScheduler.h +) source_group( "Application" FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} - ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake) + ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake +) diff --git a/ApplicationLibCode/Application/Tools/CMakeLists_files.cmake b/ApplicationLibCode/Application/Tools/CMakeLists_files.cmake index 859eaa1bf9..db43061d75 100644 --- a/ApplicationLibCode/Application/Tools/CMakeLists_files.cmake +++ b/ApplicationLibCode/Application/Tools/CMakeLists_files.cmake @@ -44,7 +44,8 @@ set(SOURCE_GROUP_HEADER_FILES ${CMAKE_CURRENT_LIST_DIR}/RiaWellLogUnitTools.h ${CMAKE_CURRENT_LIST_DIR}/RiaWellLogUnitTools.inl ${CMAKE_CURRENT_LIST_DIR}/RiaTimeTTools.h - ${CMAKE_CURRENT_LIST_DIR}/RiaValidRegExpValidator.h) + ${CMAKE_CURRENT_LIST_DIR}/RiaValidRegExpValidator.h +) set(SOURCE_GROUP_HEADER_FILES ${CMAKE_CURRENT_LIST_DIR}/RiaArgumentParser.h @@ -93,7 +94,8 @@ set(SOURCE_GROUP_HEADER_FILES ${CMAKE_CURRENT_LIST_DIR}/RiaWellLogUnitTools.inl ${CMAKE_CURRENT_LIST_DIR}/RiaTimeTTools.h ${CMAKE_CURRENT_LIST_DIR}/RiaValidRegExpValidator.h - ${CMAKE_CURRENT_LIST_DIR}/RiaEnsembleNameTools.h) + ${CMAKE_CURRENT_LIST_DIR}/RiaEnsembleNameTools.h +) set(SOURCE_GROUP_SOURCE_FILES ${CMAKE_CURRENT_LIST_DIR}/RiaArgumentParser.cpp @@ -135,7 +137,8 @@ set(SOURCE_GROUP_SOURCE_FILES ${CMAKE_CURRENT_LIST_DIR}/RiaBoundingBoxTools.cpp ${CMAKE_CURRENT_LIST_DIR}/RiaTimeTTools.cpp ${CMAKE_CURRENT_LIST_DIR}/RiaValidRegExpValidator.cpp - ${CMAKE_CURRENT_LIST_DIR}/RiaEnsembleNameTools.cpp) + ${CMAKE_CURRENT_LIST_DIR}/RiaEnsembleNameTools.cpp +) list(APPEND CODE_SOURCE_FILES ${SOURCE_GROUP_SOURCE_FILES}) @@ -144,4 +147,5 @@ set(QT_MOC_HEADERS ${QT_MOC_HEADERS}) source_group( "Application\\Tools" FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} - ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake) + ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake +) diff --git a/ApplicationLibCode/Application/Tools/WellPathTools/CMakeLists_files.cmake b/ApplicationLibCode/Application/Tools/WellPathTools/CMakeLists_files.cmake index 7667b75edc..7e20e2818b 100644 --- a/ApplicationLibCode/Application/Tools/WellPathTools/CMakeLists_files.cmake +++ b/ApplicationLibCode/Application/Tools/WellPathTools/CMakeLists_files.cmake @@ -4,7 +4,8 @@ set(SOURCE_GROUP_HEADER_FILES ${CMAKE_CURRENT_LIST_DIR}/RiaSCurveCalculator.h ${CMAKE_CURRENT_LIST_DIR}/RiaArcCurveCalculator.h ${CMAKE_CURRENT_LIST_DIR}/RiaJCurveCalculator.h - ${CMAKE_CURRENT_LIST_DIR}/RiaLineArcWellPathCalculator.h) + ${CMAKE_CURRENT_LIST_DIR}/RiaLineArcWellPathCalculator.h +) set(SOURCE_GROUP_SOURCE_FILES ${CMAKE_CURRENT_LIST_DIR}/RiaPolyArcLineSampler.cpp @@ -12,7 +13,8 @@ set(SOURCE_GROUP_SOURCE_FILES ${CMAKE_CURRENT_LIST_DIR}/RiaSCurveCalculator.cpp ${CMAKE_CURRENT_LIST_DIR}/RiaArcCurveCalculator.cpp ${CMAKE_CURRENT_LIST_DIR}/RiaJCurveCalculator.cpp - ${CMAKE_CURRENT_LIST_DIR}/RiaLineArcWellPathCalculator.cpp) + ${CMAKE_CURRENT_LIST_DIR}/RiaLineArcWellPathCalculator.cpp +) list(APPEND CODE_HEADER_FILES ${SOURCE_GROUP_HEADER_FILES}) @@ -23,4 +25,5 @@ set(QT_MOC_HEADERS ${QT_MOC_HEADERS}) source_group( "Application\\Tools\\WellPathTools" FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} - ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake) + ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake +) diff --git a/ApplicationLibCode/CMakeLists.txt b/ApplicationLibCode/CMakeLists.txt index 0d63f10df4..16a8beb256 100644 --- a/ApplicationLibCode/CMakeLists.txt +++ b/ApplicationLibCode/CMakeLists.txt @@ -14,19 +14,22 @@ endif() if(CMAKE_COMPILER_IS_GNUCXX) set(CMAKE_CXX_FLAGS - "${CMAKE_CXX_FLAGS} -Wno-deprecated -Wno-deprecated-declarations") + "${CMAKE_CXX_FLAGS} -Wno-deprecated -Wno-deprecated-declarations" + ) endif() # Open GL find_package(OpenGL) option(RESINSIGHT_TREAT_WARNINGS_AS_ERRORS - "Treat warnings as errors (stops build)" OFF) + "Treat warnings as errors (stops build)" OFF +) find_package( Qt5 COMPONENTS Core - QUIET) + QUIET +) if(Qt5Core_FOUND) find_package( @@ -41,7 +44,8 @@ if(Qt5Core_FOUND) Concurrent PrintSupport Svg - OPTIONAL_COMPONENTS Charts) + OPTIONAL_COMPONENTS Charts + ) set(QT_LIBRARIES Qt5::Core Qt5::Gui @@ -52,7 +56,8 @@ if(Qt5Core_FOUND) Qt5::Xml Qt5::Concurrent Qt5::PrintSupport - Qt5::Svg) + Qt5::Svg + ) if(Qt5Charts_FOUND) list(APPEND QT_LIBRARIES Qt5::Charts) endif(Qt5Charts_FOUND) @@ -60,11 +65,15 @@ endif(Qt5Core_FOUND) # NB: The generated file is written to Cmake binary folder to avoid source tree # pollution This folder is added to include_directories -configure_file(${CMAKE_CURRENT_SOURCE_DIR}/Adm/RiaVersionInfo.h.cmake - ${CMAKE_BINARY_DIR}/Generated/RiaVersionInfo.h) - -configure_file(${CMAKE_CURRENT_LIST_DIR}/RiuThemesDirectory.h.cmake - ${CMAKE_BINARY_DIR}/Generated/RiuThemesDirectory.h) +configure_file( + ${CMAKE_CURRENT_SOURCE_DIR}/Adm/RiaVersionInfo.h.cmake + ${CMAKE_BINARY_DIR}/Generated/RiaVersionInfo.h +) + +configure_file( + ${CMAKE_CURRENT_LIST_DIR}/RiuThemesDirectory.h.cmake + ${CMAKE_BINARY_DIR}/Generated/RiuThemesDirectory.h +) if(MSVC) # Avoid Qt warnings about macro redefinitions for math constants add_definitions(-D_USE_MATH_DEFINES) @@ -120,7 +129,8 @@ include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/GeoMech/GeoMechDataModel ${CMAKE_CURRENT_SOURCE_DIR}/GeoMech/GeoMechVisualization ${CMAKE_BINARY_DIR}/Generated - ${CMAKE_CURRENT_BINARY_DIR}) + ${CMAKE_CURRENT_BINARY_DIR} +) # ############################################################################## # Eigen @@ -147,7 +157,8 @@ set(SOCKET_INTERFACE_FILES SocketInterface/RiaPropertyDataCommands.cpp SocketInterface/RiaWellDataCommands.cpp SocketInterface/RiaSocketTools.cpp - SocketInterface/RiaSocketDataTransfer.cpp) + SocketInterface/RiaSocketDataTransfer.cpp +) list(APPEND CPP_SOURCES ${SOCKET_INTERFACE_FILES} ${UNIT_TEST_FILES}) @@ -195,10 +206,12 @@ list( UserInterface/CMakeLists_files.cmake UserInterface/AnalysisPlots/CMakeLists_files.cmake CommandFileInterface/CMakeLists_files.cmake - CommandFileInterface/Core/CMakeLists_files.cmake) + CommandFileInterface/Core/CMakeLists_files.cmake +) option(RESINSIGHT_INCLUDE_APPLICATION_UNIT_TESTS - "Include ApplicationCode Unit Tests" OFF) + "Include ApplicationCode Unit Tests" OFF +) mark_as_advanced(FORCE RESINSIGHT_INCLUDE_APPLICATION_UNIT_TESTS) if(RESINSIGHT_INCLUDE_APPLICATION_UNIT_TESTS) add_definitions(-DUSE_UNIT_TESTS) @@ -206,7 +219,8 @@ if(RESINSIGHT_INCLUDE_APPLICATION_UNIT_TESTS) list(APPEND REFERENCED_CMAKE_FILES UnitTests/CMakeLists_files.cmake) list(APPEND CPP_SOURCES - ${ResInsight_SOURCE_DIR}/ThirdParty/gtest/gtest-all.cc) + ${ResInsight_SOURCE_DIR}/ThirdParty/gtest/gtest-all.cc + ) endif() @@ -253,7 +267,8 @@ if(RESINSIGHT_FOUND_HDF5) FileInterface/RifHdf5Exporter.h FileInterface/RifHdf5Exporter.cpp FileInterface/RifHdf5SummaryExporter.h - FileInterface/RifHdf5SummaryExporter.cpp) + FileInterface/RifHdf5SummaryExporter.cpp + ) list(APPEND CPP_SOURCES ${HDF5_FILES}) @@ -280,7 +295,8 @@ endif() set(QT_MOC_HEADERS ${QT_MOC_HEADERS} ProjectDataModel/RimMimeData.h - ProjectDataModel/RimBoxIntersection.h SocketInterface/RiaSocketServer.h) + ProjectDataModel/RimBoxIntersection.h SocketInterface/RiaSocketServer.h +) qt5_wrap_cpp(MOC_SOURCE_FILES ${QT_MOC_HEADERS}) qt5_wrap_ui(FORM_FILES_CPP ${QT_UI_FILES}) @@ -303,7 +319,8 @@ list( ../ResInsightVersion.cmake .clang-format .clang-tidy - Adm/RiaVersionInfo.h.cmake) + Adm/RiaVersionInfo.h.cmake +) add_library(${PROJECT_NAME} OBJECT ${ALL_SOURCE_FILES}) @@ -315,7 +332,8 @@ if(RESINSIGHT_ENABLE_PRECOMPILED_HEADERS) set_source_files_properties( ${ResInsight_SOURCE_DIR}/ThirdParty/gtest/gtest-all.cc - PROPERTIES SKIP_PRECOMPILE_HEADERS ON) + PROPERTIES SKIP_PRECOMPILE_HEADERS ON + ) endif() if(${CMAKE_SYSTEM_NAME} MATCHES "Linux") @@ -323,7 +341,8 @@ if(${CMAKE_SYSTEM_NAME} MATCHES "Linux") ${PROJECT_NAME} PROPERTIES COMPILE_FLAGS - "-Wall -Wno-unused-parameter -Wno-reorder -Wno-parentheses -Wno-switch") + "-Wall -Wno-unused-parameter -Wno-reorder -Wno-parentheses -Wno-switch" + ) # Treat warnings as errors if asked to do so if(RESINSIGHT_TREAT_WARNINGS_AS_ERRORS) set_target_properties( @@ -370,8 +389,9 @@ if(MSVC) endif() message(STATUS "BUILD_FLAGS_FOR_MSVC ${BUILD_FLAGS_FOR_MSVC}") - set_target_properties(${PROJECT_NAME} PROPERTIES COMPILE_FLAGS - ${BUILD_FLAGS_FOR_MSVC}) + set_target_properties( + ${PROJECT_NAME} PROPERTIES COMPILE_FLAGS ${BUILD_FLAGS_FOR_MSVC} + ) endif() @@ -387,7 +407,8 @@ set(LINK_LIBRARIES ${OPM_LIBRARIES} ${APP_FWK_LIBRARIES} ${VIZ_FWK_LIBRARIES} - ${RI_LIBRARIES}) + ${RI_LIBRARIES} +) # According to ivarun this is needed on OpenSuse, and Fedora. See: # https://github.com/OPM/ResInsight/pull/7 @@ -395,8 +416,9 @@ if(${CMAKE_SYSTEM_NAME} MATCHES "Linux") list(APPEND EXTERNAL_LINK_LIBRARIES rt) endif() -target_link_libraries(${PROJECT_NAME} ${LINK_LIBRARIES} - ${EXTERNAL_LINK_LIBRARIES}) +target_link_libraries( + ${PROJECT_NAME} ${LINK_LIBRARIES} ${EXTERNAL_LINK_LIBRARIES} +) target_include_directories( ${PROJECT_NAME} @@ -413,7 +435,8 @@ target_include_directories( ${CMAKE_SOURCE_DIR}/ApplicationLibCode/ProjectDataModel/Flow ${CMAKE_SOURCE_DIR}/ApplicationLibCode/ReservoirDataModel ${CMAKE_SOURCE_DIR}/ApplicationLibCode/SocketInterface - ${CMAKE_SOURCE_DIR}/ApplicationLibCode/UserInterface) + ${CMAKE_SOURCE_DIR}/ApplicationLibCode/UserInterface +) # ############################################################################## # Unity builds @@ -428,11 +451,13 @@ set(UNITY_EXCLUDE_FILES qrc_cafCommandFeatures.cpp # Exclude files including opm-common ProjectDataModel/RimVfpTableExtractor.cpp - ProjectDataModel/RimVfpPlot.cpp) + ProjectDataModel/RimVfpPlot.cpp +) if(RESINSIGHT_ENABLE_UNITY_BUILD) foreach(fileToExclude ${UNITY_EXCLUDE_FILES}) - set_source_files_properties(${fileToExclude} - PROPERTIES SKIP_UNITY_BUILD_INCLUSION TRUE) + set_source_files_properties( + ${fileToExclude} PROPERTIES SKIP_UNITY_BUILD_INCLUSION TRUE + ) endforeach(fileToExclude) endif() diff --git a/ApplicationLibCode/CommandFileInterface/CMakeLists_files.cmake b/ApplicationLibCode/CommandFileInterface/CMakeLists_files.cmake index c4fd0ec0fb..58f7e0900b 100644 --- a/ApplicationLibCode/CommandFileInterface/CMakeLists_files.cmake +++ b/ApplicationLibCode/CommandFileInterface/CMakeLists_files.cmake @@ -36,7 +36,8 @@ set(SOURCE_GROUP_HEADER_FILES ${CMAKE_CURRENT_LIST_DIR}/RicfNewWellBoreStabilityPlotFeature.h ${CMAKE_CURRENT_LIST_DIR}/RicfImportWellLogFiles.h ${CMAKE_CURRENT_LIST_DIR}/RicfImportFormationNames.h - ${CMAKE_CURRENT_LIST_DIR}/RicfExportWellLogPlotData.h) + ${CMAKE_CURRENT_LIST_DIR}/RicfExportWellLogPlotData.h +) set(SOURCE_GROUP_SOURCE_FILES ${CMAKE_CURRENT_LIST_DIR}/RicfCloseProject.cpp @@ -76,7 +77,8 @@ set(SOURCE_GROUP_SOURCE_FILES ${CMAKE_CURRENT_LIST_DIR}/RicfCreateWellBoreStabilityPlotFeature.cpp ${CMAKE_CURRENT_LIST_DIR}/RicfImportWellLogFiles.cpp ${CMAKE_CURRENT_LIST_DIR}/RicfImportFormationNames.cpp - ${CMAKE_CURRENT_LIST_DIR}/RicfExportWellLogPlotData.cpp) + ${CMAKE_CURRENT_LIST_DIR}/RicfExportWellLogPlotData.cpp +) list(APPEND CODE_HEADER_FILES ${SOURCE_GROUP_HEADER_FILES}) @@ -85,4 +87,5 @@ list(APPEND CODE_SOURCE_FILES ${SOURCE_GROUP_SOURCE_FILES}) source_group( "CommandFileInterface" FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} - ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake) + ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake +) diff --git a/ApplicationLibCode/CommandFileInterface/Core/CMakeLists_files.cmake b/ApplicationLibCode/CommandFileInterface/Core/CMakeLists_files.cmake index d0896cd12d..d541606e5f 100644 --- a/ApplicationLibCode/CommandFileInterface/Core/CMakeLists_files.cmake +++ b/ApplicationLibCode/CommandFileInterface/Core/CMakeLists_files.cmake @@ -1,9 +1,11 @@ set(SOURCE_GROUP_HEADER_FILES ${CMAKE_CURRENT_LIST_DIR}/RicfCommandObject.h - ${CMAKE_CURRENT_LIST_DIR}/RifcCommandFileReader.h) + ${CMAKE_CURRENT_LIST_DIR}/RifcCommandFileReader.h +) set(SOURCE_GROUP_SOURCE_FILES ${CMAKE_CURRENT_LIST_DIR}/RicfCommandObject.cpp - ${CMAKE_CURRENT_LIST_DIR}/RifcCommandFileReader.cpp) + ${CMAKE_CURRENT_LIST_DIR}/RifcCommandFileReader.cpp +) list(APPEND CODE_HEADER_FILES ${SOURCE_GROUP_HEADER_FILES}) @@ -12,4 +14,5 @@ list(APPEND CODE_SOURCE_FILES ${SOURCE_GROUP_SOURCE_FILES}) source_group( "CommandFileInterface\\Core" FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} - ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake) + ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake +) diff --git a/ApplicationLibCode/Commands/AnalysisPlotCommands/CMakeLists_files.cmake b/ApplicationLibCode/Commands/AnalysisPlotCommands/CMakeLists_files.cmake index 83ea2c1d7d..963c58b3ee 100644 --- a/ApplicationLibCode/Commands/AnalysisPlotCommands/CMakeLists_files.cmake +++ b/ApplicationLibCode/Commands/AnalysisPlotCommands/CMakeLists_files.cmake @@ -1,10 +1,12 @@ set(SOURCE_GROUP_HEADER_FILES ${CMAKE_CURRENT_LIST_DIR}/RicNewAnalysisPlotFeature.h - ${CMAKE_CURRENT_LIST_DIR}/RicNewPlotDataFilterFeature.h) + ${CMAKE_CURRENT_LIST_DIR}/RicNewPlotDataFilterFeature.h +) set(SOURCE_GROUP_SOURCE_FILES ${CMAKE_CURRENT_LIST_DIR}/RicNewAnalysisPlotFeature.cpp - ${CMAKE_CURRENT_LIST_DIR}/RicNewPlotDataFilterFeature.cpp) + ${CMAKE_CURRENT_LIST_DIR}/RicNewPlotDataFilterFeature.cpp +) list(APPEND COMMAND_COMMAND_CODE_HEADER_FILES ${SOURCE_GROUP_HEADER_FILES}) @@ -13,4 +15,5 @@ list(APPEND COMMAND_CODE_SOURCE_FILES ${SOURCE_GROUP_SOURCE_FILES}) source_group( "CommandFeature\\AnalysisPlotCommands" FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} - ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake) + ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake +) diff --git a/ApplicationLibCode/Commands/AnnotationCommands/CMakeLists_files.cmake b/ApplicationLibCode/Commands/AnnotationCommands/CMakeLists_files.cmake index 4e68f1e271..eee729026e 100644 --- a/ApplicationLibCode/Commands/AnnotationCommands/CMakeLists_files.cmake +++ b/ApplicationLibCode/Commands/AnnotationCommands/CMakeLists_files.cmake @@ -4,7 +4,8 @@ set(SOURCE_GROUP_HEADER_FILES ${CMAKE_CURRENT_LIST_DIR}/RicCreateTextAnnotationIn3dViewFeature.h ${CMAKE_CURRENT_LIST_DIR}/RicCreateReachCircleAnnotationFeature.h ${CMAKE_CURRENT_LIST_DIR}/RicCreateUserDefinedPolylinesAnnotationFeature.h - ${CMAKE_CURRENT_LIST_DIR}/RicTextAnnotation3dEditor.h) + ${CMAKE_CURRENT_LIST_DIR}/RicTextAnnotation3dEditor.h +) set(SOURCE_GROUP_SOURCE_FILES ${CMAKE_CURRENT_LIST_DIR}/RicImportPolylinesAnnotationFeature.cpp @@ -12,7 +13,8 @@ set(SOURCE_GROUP_SOURCE_FILES ${CMAKE_CURRENT_LIST_DIR}/RicCreateTextAnnotationIn3dViewFeature.cpp ${CMAKE_CURRENT_LIST_DIR}/RicCreateReachCircleAnnotationFeature.cpp ${CMAKE_CURRENT_LIST_DIR}/RicCreateUserDefinedPolylinesAnnotationFeature.cpp - ${CMAKE_CURRENT_LIST_DIR}/RicTextAnnotation3dEditor.cpp) + ${CMAKE_CURRENT_LIST_DIR}/RicTextAnnotation3dEditor.cpp +) list(APPEND COMMAND_CODE_HEADER_FILES ${SOURCE_GROUP_HEADER_FILES}) @@ -20,9 +22,11 @@ list(APPEND COMMAND_CODE_SOURCE_FILES ${SOURCE_GROUP_SOURCE_FILES}) set(COMMAND_QT_MOC_HEADERS ${COMMAND_QT_MOC_HEADERS} - ${CMAKE_CURRENT_LIST_DIR}/RicTextAnnotation3dEditor.h) + ${CMAKE_CURRENT_LIST_DIR}/RicTextAnnotation3dEditor.h +) source_group( "CommandFeature\\AnnotationCommands" FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} - ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake) + ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake +) diff --git a/ApplicationLibCode/Commands/ApplicationCommands/CMakeLists_files.cmake b/ApplicationLibCode/Commands/ApplicationCommands/CMakeLists_files.cmake index 5c46f26c48..9242df0179 100644 --- a/ApplicationLibCode/Commands/ApplicationCommands/CMakeLists_files.cmake +++ b/ApplicationLibCode/Commands/ApplicationCommands/CMakeLists_files.cmake @@ -18,7 +18,8 @@ set(SOURCE_GROUP_HEADER_FILES ${CMAKE_CURRENT_LIST_DIR}/RicDefaultDockConfigEclipseFeature.h ${CMAKE_CURRENT_LIST_DIR}/RicDefaultDockConfigGeoMechFeature.h ${CMAKE_CURRENT_LIST_DIR}/RicExportObjectAndFieldKeywordsFeature.h - ${CMAKE_CURRENT_LIST_DIR}/RicSaveProjectNoGlobalPathsFeature.h) + ${CMAKE_CURRENT_LIST_DIR}/RicSaveProjectNoGlobalPathsFeature.h +) set(SOURCE_GROUP_SOURCE_FILES ${CMAKE_CURRENT_LIST_DIR}/RicLaunchUnitTestsFeature.cpp @@ -40,7 +41,8 @@ set(SOURCE_GROUP_SOURCE_FILES ${CMAKE_CURRENT_LIST_DIR}/RicDefaultDockConfigEclipseFeature.cpp ${CMAKE_CURRENT_LIST_DIR}/RicDefaultDockConfigGeoMechFeature.cpp ${CMAKE_CURRENT_LIST_DIR}/RicExportObjectAndFieldKeywordsFeature.cpp - ${CMAKE_CURRENT_LIST_DIR}/RicSaveProjectNoGlobalPathsFeature.cpp) + ${CMAKE_CURRENT_LIST_DIR}/RicSaveProjectNoGlobalPathsFeature.cpp +) list(APPEND COMMAND_CODE_HEADER_FILES ${SOURCE_GROUP_HEADER_FILES}) @@ -51,4 +53,5 @@ set(COMMAND_QT_MOC_HEADERS ${COMMAND_QT_MOC_HEADERS}) source_group( "CommandFeature\\Application" FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} - ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake) + ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake +) diff --git a/ApplicationLibCode/Commands/CMakeLists.txt b/ApplicationLibCode/Commands/CMakeLists.txt index f0ba15fd9d..104491fae3 100644 --- a/ApplicationLibCode/Commands/CMakeLists.txt +++ b/ApplicationLibCode/Commands/CMakeLists.txt @@ -40,7 +40,8 @@ set(COMMAND_REFERENCED_CMAKE_FILES WellLogCommands/CMakeLists_files.cmake WellPathCommands/CMakeLists_files.cmake PlotTemplateCommands/CMakeLists_files.cmake - FractureCommands/CMakeLists_files.cmake) + FractureCommands/CMakeLists_files.cmake +) # Include source file lists from *.cmake files foreach(referencedfile ${COMMAND_REFERENCED_CMAKE_FILES}) @@ -55,13 +56,15 @@ qt5_wrap_cpp(COMMAND_MOC_SOURCE_FILES ${COMMAND_QT_MOC_HEADERS}) add_library( ${PROJECT_NAME} OBJECT ${COMMAND_CODE_SOURCE_FILES} ${COMMAND_CODE_HEADER_FILES} - ${COMMAND_MOC_SOURCE_FILES}) + ${COMMAND_MOC_SOURCE_FILES} +) target_include_directories( ${PROJECT_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_SOURCE_DIR}/ThirdParty ${CMAKE_SOURCE_DIR}/ThirdParty/custom-opm-common/generated-opm-common - ${CMAKE_SOURCE_DIR}/ThirdParty/custom-opm-common/opm-common) + ${CMAKE_SOURCE_DIR}/ThirdParty/custom-opm-common/opm-common +) if(MSVC) # The following warnings are supposed to be used in ResInsight, but @@ -88,8 +91,9 @@ if(MSVC) set(BUILD_FLAGS_FOR_MSVC "${BUILD_FLAGS_FOR_MSVC} /wd4505") endif() - set_target_properties(${PROJECT_NAME} PROPERTIES COMPILE_FLAGS - ${BUILD_FLAGS_FOR_MSVC}) + set_target_properties( + ${PROJECT_NAME} PROPERTIES COMPILE_FLAGS ${BUILD_FLAGS_FOR_MSVC} + ) endif() @@ -105,7 +109,8 @@ set(LINK_LIBRARIES nightcharts qwt ${QT_LIBRARIES} - Eigen3::Eigen) + Eigen3::Eigen +) target_link_libraries(${PROJECT_NAME} PRIVATE ${LINK_LIBRARIES}) diff --git a/ApplicationLibCode/Commands/CMakeLists_files.cmake b/ApplicationLibCode/Commands/CMakeLists_files.cmake index 246d230d08..f654491d69 100644 --- a/ApplicationLibCode/Commands/CMakeLists_files.cmake +++ b/ApplicationLibCode/Commands/CMakeLists_files.cmake @@ -72,7 +72,8 @@ set(SOURCE_GROUP_HEADER_FILES ${CMAKE_CURRENT_LIST_DIR}/RicNewPressureTableItemFeature.h ${CMAKE_CURRENT_LIST_DIR}/RicDeletePressureTableItemFeature.h ${CMAKE_CURRENT_LIST_DIR}/RicImportGridModelFromSummaryCaseFeature.h - ${CMAKE_CURRENT_LIST_DIR}/RicImportGridModelFromSummaryCurveFeature.h) + ${CMAKE_CURRENT_LIST_DIR}/RicImportGridModelFromSummaryCurveFeature.h +) set(SOURCE_GROUP_SOURCE_FILES ${CMAKE_CURRENT_LIST_DIR}/RicWellLogTools.cpp @@ -147,17 +148,20 @@ set(SOURCE_GROUP_SOURCE_FILES ${CMAKE_CURRENT_LIST_DIR}/RicNewPressureTableItemFeature.cpp ${CMAKE_CURRENT_LIST_DIR}/RicDeletePressureTableItemFeature.cpp ${CMAKE_CURRENT_LIST_DIR}/RicImportGridModelFromSummaryCaseFeature.cpp - ${CMAKE_CURRENT_LIST_DIR}/RicImportGridModelFromSummaryCurveFeature.cpp) + ${CMAKE_CURRENT_LIST_DIR}/RicImportGridModelFromSummaryCurveFeature.cpp +) if(Qt5Charts_FOUND) list( APPEND SOURCE_GROUP_HEADER_FILES ${CMAKE_CURRENT_LIST_DIR}/RicCreateEnsembleFractureStatisticsPlotFeature.h - ${CMAKE_CURRENT_LIST_DIR}/RicCreateGridStatisticsPlotFeature.h) + ${CMAKE_CURRENT_LIST_DIR}/RicCreateGridStatisticsPlotFeature.h + ) list( APPEND SOURCE_GROUP_SOURCE_FILES ${CMAKE_CURRENT_LIST_DIR}/RicCreateEnsembleFractureStatisticsPlotFeature.cpp - ${CMAKE_CURRENT_LIST_DIR}/RicCreateGridStatisticsPlotFeature.cpp) + ${CMAKE_CURRENT_LIST_DIR}/RicCreateGridStatisticsPlotFeature.cpp + ) endif() list(APPEND COMMAND_CODE_HEADER_FILES ${SOURCE_GROUP_HEADER_FILES}) @@ -170,9 +174,11 @@ list( ${CMAKE_CURRENT_LIST_DIR}/RicGridStatisticsDialog.h ${CMAKE_CURRENT_LIST_DIR}/RicRecursiveFileSearchDialog.h ${CMAKE_CURRENT_LIST_DIR}/RicSummaryCaseRestartDialog.h - ${CMAKE_CURRENT_LIST_DIR}/RicResampleDialog.h) + ${CMAKE_CURRENT_LIST_DIR}/RicResampleDialog.h +) source_group( "CommandFeature" FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} - ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake) + ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake +) diff --git a/ApplicationLibCode/Commands/CellFilterCommands/CMakeLists_files.cmake b/ApplicationLibCode/Commands/CellFilterCommands/CMakeLists_files.cmake index 5df3d96aac..812877b9aa 100644 --- a/ApplicationLibCode/Commands/CellFilterCommands/CMakeLists_files.cmake +++ b/ApplicationLibCode/Commands/CellFilterCommands/CMakeLists_files.cmake @@ -7,7 +7,8 @@ set(SOURCE_GROUP_HEADER_FILES ${CMAKE_CURRENT_LIST_DIR}/RicNewRangeFilterSliceJFeature.h ${CMAKE_CURRENT_LIST_DIR}/RicNewRangeFilterSliceKFeature.h ${CMAKE_CURRENT_LIST_DIR}/RicNewRangeFilterSlice3dviewFeature.h - ${CMAKE_CURRENT_LIST_DIR}/RicNewPolygonFilter3dviewFeature.h) + ${CMAKE_CURRENT_LIST_DIR}/RicNewPolygonFilter3dviewFeature.h +) set(SOURCE_GROUP_SOURCE_FILES ${CMAKE_CURRENT_LIST_DIR}/RicNewPolygonFilterFeature.cpp @@ -18,7 +19,8 @@ set(SOURCE_GROUP_SOURCE_FILES ${CMAKE_CURRENT_LIST_DIR}/RicNewRangeFilterSliceJFeature.cpp ${CMAKE_CURRENT_LIST_DIR}/RicNewRangeFilterSliceKFeature.cpp ${CMAKE_CURRENT_LIST_DIR}/RicNewRangeFilterSlice3dviewFeature.cpp - ${CMAKE_CURRENT_LIST_DIR}/RicNewPolygonFilter3dviewFeature.cpp) + ${CMAKE_CURRENT_LIST_DIR}/RicNewPolygonFilter3dviewFeature.cpp +) list(APPEND COMMAND_CODE_HEADER_FILES ${SOURCE_GROUP_HEADER_FILES}) @@ -27,4 +29,5 @@ list(APPEND COMMAND_CODE_SOURCE_FILES ${SOURCE_GROUP_SOURCE_FILES}) source_group( "CommandFeature\\CellFilterCommands" FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} - ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake) + ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake +) diff --git a/ApplicationLibCode/Commands/ColorLegendCommands/CMakeLists_files.cmake b/ApplicationLibCode/Commands/ColorLegendCommands/CMakeLists_files.cmake index 31f5cec93b..5945101d7b 100644 --- a/ApplicationLibCode/Commands/ColorLegendCommands/CMakeLists_files.cmake +++ b/ApplicationLibCode/Commands/ColorLegendCommands/CMakeLists_files.cmake @@ -2,13 +2,15 @@ set(SOURCE_GROUP_HEADER_FILES ${CMAKE_CURRENT_LIST_DIR}/RicImportColorCategoriesFeature.h ${CMAKE_CURRENT_LIST_DIR}/RicCopyStandardLegendFeature.h ${CMAKE_CURRENT_LIST_DIR}/RicInsertColorLegendFeature.h - ${CMAKE_CURRENT_LIST_DIR}/RicInsertColorLegendItemFeature.h) + ${CMAKE_CURRENT_LIST_DIR}/RicInsertColorLegendItemFeature.h +) set(SOURCE_GROUP_SOURCE_FILES ${CMAKE_CURRENT_LIST_DIR}/RicImportColorCategoriesFeature.cpp ${CMAKE_CURRENT_LIST_DIR}/RicCopyStandardLegendFeature.cpp ${CMAKE_CURRENT_LIST_DIR}/RicInsertColorLegendFeature.cpp - ${CMAKE_CURRENT_LIST_DIR}/RicInsertColorLegendItemFeature.cpp) + ${CMAKE_CURRENT_LIST_DIR}/RicInsertColorLegendItemFeature.cpp +) list(APPEND COMMAND_CODE_HEADER_FILES ${SOURCE_GROUP_HEADER_FILES}) @@ -17,4 +19,5 @@ list(APPEND COMMAND_CODE_SOURCE_FILES ${SOURCE_GROUP_SOURCE_FILES}) source_group( "CommandFeature\\ColorLegend" FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} - ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake) + ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake +) diff --git a/ApplicationLibCode/Commands/CompletionCommands/CMakeLists_files.cmake b/ApplicationLibCode/Commands/CompletionCommands/CMakeLists_files.cmake index 3df3504ed2..e950793c68 100644 --- a/ApplicationLibCode/Commands/CompletionCommands/CMakeLists_files.cmake +++ b/ApplicationLibCode/Commands/CompletionCommands/CMakeLists_files.cmake @@ -11,7 +11,8 @@ set(SOURCE_GROUP_HEADER_FILES ${CMAKE_CURRENT_LIST_DIR}/RicDeleteValveTemplateFeature.h ${CMAKE_CURRENT_LIST_DIR}/RicWellPathImportPerforationIntervalsFeature.h ${CMAKE_CURRENT_LIST_DIR}/RicNewStimPlanModelPlotFeature.h - ${CMAKE_CURRENT_LIST_DIR}/RicImportEnsembleFractureStatisticsFeature.h) + ${CMAKE_CURRENT_LIST_DIR}/RicImportEnsembleFractureStatisticsFeature.h +) set(SOURCE_GROUP_SOURCE_FILES ${CMAKE_CURRENT_LIST_DIR}/RicEditPerforationCollectionFeature.cpp @@ -26,7 +27,8 @@ set(SOURCE_GROUP_SOURCE_FILES ${CMAKE_CURRENT_LIST_DIR}/RicDeleteValveTemplateFeature.cpp ${CMAKE_CURRENT_LIST_DIR}/RicWellPathImportPerforationIntervalsFeature.cpp ${CMAKE_CURRENT_LIST_DIR}/RicNewStimPlanModelPlotFeature.cpp - ${CMAKE_CURRENT_LIST_DIR}/RicImportEnsembleFractureStatisticsFeature.cpp) + ${CMAKE_CURRENT_LIST_DIR}/RicImportEnsembleFractureStatisticsFeature.cpp +) list(APPEND COMMAND_CODE_HEADER_FILES ${SOURCE_GROUP_HEADER_FILES}) @@ -35,4 +37,5 @@ list(APPEND COMMAND_CODE_SOURCE_FILES ${SOURCE_GROUP_SOURCE_FILES}) source_group( "CommandFeature\\Completion" FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} - ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake) + ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake +) diff --git a/ApplicationLibCode/Commands/CompletionExportCommands/CMakeLists_files.cmake b/ApplicationLibCode/Commands/CompletionExportCommands/CMakeLists_files.cmake index 5b1fc485c3..5118c85375 100644 --- a/ApplicationLibCode/Commands/CompletionExportCommands/CMakeLists_files.cmake +++ b/ApplicationLibCode/Commands/CompletionExportCommands/CMakeLists_files.cmake @@ -20,7 +20,8 @@ set(SOURCE_GROUP_HEADER_FILES ${CMAKE_CURRENT_LIST_DIR}/RicWellPathFractureTextReportFeatureImpl.h ${CMAKE_CURRENT_LIST_DIR}/RicWellPathFractureReportItem.h ${CMAKE_CURRENT_LIST_DIR}/RicExportCompletionsForTemporaryLgrsFeature.h - ${CMAKE_CURRENT_LIST_DIR}/RicMswTableFormatterTools.h) + ${CMAKE_CURRENT_LIST_DIR}/RicMswTableFormatterTools.h +) set(SOURCE_GROUP_SOURCE_FILES ${CMAKE_CURRENT_LIST_DIR}/RicExportCompletionDataSettingsUi.cpp @@ -44,7 +45,8 @@ set(SOURCE_GROUP_SOURCE_FILES ${CMAKE_CURRENT_LIST_DIR}/RicWellPathFractureTextReportFeatureImpl.cpp ${CMAKE_CURRENT_LIST_DIR}/RicWellPathFractureReportItem.cpp ${CMAKE_CURRENT_LIST_DIR}/RicExportCompletionsForTemporaryLgrsFeature.cpp - ${CMAKE_CURRENT_LIST_DIR}/RicMswTableFormatterTools.cpp) + ${CMAKE_CURRENT_LIST_DIR}/RicMswTableFormatterTools.cpp +) list(APPEND COMMAND_CODE_HEADER_FILES ${SOURCE_GROUP_HEADER_FILES}) @@ -53,4 +55,5 @@ list(APPEND COMMAND_CODE_SOURCE_FILES ${SOURCE_GROUP_SOURCE_FILES}) source_group( "CommandFeature\\CompletionExport" FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} - ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake) + ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake +) diff --git a/ApplicationLibCode/Commands/CorrelationPlotCommands/CMakeLists_files.cmake b/ApplicationLibCode/Commands/CorrelationPlotCommands/CMakeLists_files.cmake index 6e4c75da24..fd833d71a8 100644 --- a/ApplicationLibCode/Commands/CorrelationPlotCommands/CMakeLists_files.cmake +++ b/ApplicationLibCode/Commands/CorrelationPlotCommands/CMakeLists_files.cmake @@ -2,13 +2,15 @@ set(SOURCE_GROUP_HEADER_FILES ${CMAKE_CURRENT_LIST_DIR}/RicNewCorrelationPlotFeature.h ${CMAKE_CURRENT_LIST_DIR}/RicNewCorrelationReportPlotFeature.h ${CMAKE_CURRENT_LIST_DIR}/RicNewCorrelationMatrixPlotFeature.h - ${CMAKE_CURRENT_LIST_DIR}/RicNewParameterResultCrossPlotFeature.h) + ${CMAKE_CURRENT_LIST_DIR}/RicNewParameterResultCrossPlotFeature.h +) set(SOURCE_GROUP_SOURCE_FILES ${CMAKE_CURRENT_LIST_DIR}/RicNewCorrelationPlotFeature.cpp ${CMAKE_CURRENT_LIST_DIR}/RicNewCorrelationMatrixPlotFeature.cpp ${CMAKE_CURRENT_LIST_DIR}/RicNewParameterResultCrossPlotFeature.cpp - ${CMAKE_CURRENT_LIST_DIR}/RicNewCorrelationReportPlotFeature.cpp) + ${CMAKE_CURRENT_LIST_DIR}/RicNewCorrelationReportPlotFeature.cpp +) list(APPEND COMMAND_CODE_HEADER_FILES ${SOURCE_GROUP_HEADER_FILES}) @@ -17,4 +19,5 @@ list(APPEND COMMAND_CODE_SOURCE_FILES ${SOURCE_GROUP_SOURCE_FILES}) source_group( "CommandFeature\\CorrelationPlotCommands" FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} - ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake) + ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake +) diff --git a/ApplicationLibCode/Commands/CrossSectionCommands/CMakeLists_files.cmake b/ApplicationLibCode/Commands/CrossSectionCommands/CMakeLists_files.cmake index 113d6910de..d1a18ed21d 100644 --- a/ApplicationLibCode/Commands/CrossSectionCommands/CMakeLists_files.cmake +++ b/ApplicationLibCode/Commands/CrossSectionCommands/CMakeLists_files.cmake @@ -5,7 +5,8 @@ set(SOURCE_GROUP_HEADER_FILES ${CMAKE_CURRENT_LIST_DIR}/RicNewWellPathIntersectionFeature.h ${CMAKE_CURRENT_LIST_DIR}/RicNewPolylineIntersectionFeature.h ${CMAKE_CURRENT_LIST_DIR}/RicNewAzimuthDipIntersectionFeature.h - ${CMAKE_CURRENT_LIST_DIR}/RicCopyIntersectionsToAllViewsInCaseFeature.h) + ${CMAKE_CURRENT_LIST_DIR}/RicCopyIntersectionsToAllViewsInCaseFeature.h +) set(SOURCE_GROUP_SOURCE_FILES ${CMAKE_CURRENT_LIST_DIR}/RicAppendIntersectionFeature.cpp @@ -14,7 +15,8 @@ set(SOURCE_GROUP_SOURCE_FILES ${CMAKE_CURRENT_LIST_DIR}/RicNewWellPathIntersectionFeature.cpp ${CMAKE_CURRENT_LIST_DIR}/RicNewPolylineIntersectionFeature.cpp ${CMAKE_CURRENT_LIST_DIR}/RicNewAzimuthDipIntersectionFeature.cpp - ${CMAKE_CURRENT_LIST_DIR}/RicCopyIntersectionsToAllViewsInCaseFeature.cpp) + ${CMAKE_CURRENT_LIST_DIR}/RicCopyIntersectionsToAllViewsInCaseFeature.cpp +) list(APPEND COMMAND_CODE_HEADER_FILES ${SOURCE_GROUP_HEADER_FILES}) @@ -23,4 +25,5 @@ list(APPEND COMMAND_CODE_SOURCE_FILES ${SOURCE_GROUP_SOURCE_FILES}) source_group( "CommandFeature\\CrossSection" FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} - ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake) + ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake +) diff --git a/ApplicationLibCode/Commands/EclipseCommands/CMakeLists_files.cmake b/ApplicationLibCode/Commands/EclipseCommands/CMakeLists_files.cmake index 57fb7fe4ff..f9428cf735 100644 --- a/ApplicationLibCode/Commands/EclipseCommands/CMakeLists_files.cmake +++ b/ApplicationLibCode/Commands/EclipseCommands/CMakeLists_files.cmake @@ -16,7 +16,8 @@ set(SOURCE_GROUP_HEADER_FILES ${CMAKE_CURRENT_LIST_DIR}/RicApplyPropertyFilterAsCellResultFeature.h ${CMAKE_CURRENT_LIST_DIR}/RicImportEclipseCaseTimeStepFilterFeature.h ${CMAKE_CURRENT_LIST_DIR}/RicEclipsePropertyFilterNewInViewFeature.h - ${CMAKE_CURRENT_LIST_DIR}/RicEclipseHideFaultFeature.h) + ${CMAKE_CURRENT_LIST_DIR}/RicEclipseHideFaultFeature.h +) set(SOURCE_GROUP_SOURCE_FILES ${CMAKE_CURRENT_LIST_DIR}/RicAddEclipseInputPropertyFeature.cpp @@ -36,7 +37,8 @@ set(SOURCE_GROUP_SOURCE_FILES ${CMAKE_CURRENT_LIST_DIR}/RicApplyPropertyFilterAsCellResultFeature.cpp ${CMAKE_CURRENT_LIST_DIR}/RicImportEclipseCaseTimeStepFilterFeature.cpp ${CMAKE_CURRENT_LIST_DIR}/RicEclipsePropertyFilterNewInViewFeature.cpp - ${CMAKE_CURRENT_LIST_DIR}/RicEclipseHideFaultFeature.cpp) + ${CMAKE_CURRENT_LIST_DIR}/RicEclipseHideFaultFeature.cpp +) list(APPEND COMMAND_CODE_HEADER_FILES ${SOURCE_GROUP_HEADER_FILES}) @@ -45,4 +47,5 @@ list(APPEND COMMAND_CODE_SOURCE_FILES ${SOURCE_GROUP_SOURCE_FILES}) source_group( "CommandFeature\\Eclipse" FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} - ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake) + ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake +) diff --git a/ApplicationLibCode/Commands/EclipseCommands/EclipseWell/CMakeLists_files.cmake b/ApplicationLibCode/Commands/EclipseCommands/EclipseWell/CMakeLists_files.cmake index 03448e6858..4c50fc6d14 100644 --- a/ApplicationLibCode/Commands/EclipseCommands/EclipseWell/CMakeLists_files.cmake +++ b/ApplicationLibCode/Commands/EclipseCommands/EclipseWell/CMakeLists_files.cmake @@ -1,10 +1,12 @@ set(SOURCE_GROUP_HEADER_FILES ${CMAKE_CURRENT_LIST_DIR}/RicEclipseWellFeatureImpl.h - ${CMAKE_CURRENT_LIST_DIR}/RicEclipseWellShowFeatures.h) + ${CMAKE_CURRENT_LIST_DIR}/RicEclipseWellShowFeatures.h +) set(SOURCE_GROUP_SOURCE_FILES ${CMAKE_CURRENT_LIST_DIR}/RicEclipseWellFeatureImpl.cpp - ${CMAKE_CURRENT_LIST_DIR}/RicEclipseWellShowFeatures.cpp) + ${CMAKE_CURRENT_LIST_DIR}/RicEclipseWellShowFeatures.cpp +) list(APPEND COMMAND_CODE_HEADER_FILES ${SOURCE_GROUP_HEADER_FILES}) @@ -13,4 +15,5 @@ list(APPEND COMMAND_CODE_SOURCE_FILES ${SOURCE_GROUP_SOURCE_FILES}) source_group( "CommandFeature\\Eclipse\\Well" FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} - ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake) + ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake +) diff --git a/ApplicationLibCode/Commands/ExportCommands/CMakeLists_files.cmake b/ApplicationLibCode/Commands/ExportCommands/CMakeLists_files.cmake index b1773fabf3..3c925601c8 100644 --- a/ApplicationLibCode/Commands/ExportCommands/CMakeLists_files.cmake +++ b/ApplicationLibCode/Commands/ExportCommands/CMakeLists_files.cmake @@ -25,7 +25,8 @@ set(SOURCE_GROUP_HEADER_FILES ${CMAKE_CURRENT_LIST_DIR}/RicExportLgrFeature.h ${CMAKE_CURRENT_LIST_DIR}/RicExportLgrUi.h ${CMAKE_CURRENT_LIST_DIR}/RicEclipseCellResultToFileImpl.h - ${CMAKE_CURRENT_LIST_DIR}/RicLgrSplitType.h) + ${CMAKE_CURRENT_LIST_DIR}/RicLgrSplitType.h +) set(SOURCE_GROUP_SOURCE_FILES ${CMAKE_CURRENT_LIST_DIR}/RicCellRangeUi.cpp @@ -53,7 +54,8 @@ set(SOURCE_GROUP_SOURCE_FILES ${CMAKE_CURRENT_LIST_DIR}/RicExportWellPathsUi.cpp ${CMAKE_CURRENT_LIST_DIR}/RicExportLgrFeature.cpp ${CMAKE_CURRENT_LIST_DIR}/RicExportLgrUi.cpp - ${CMAKE_CURRENT_LIST_DIR}/RicEclipseCellResultToFileImpl.cpp) + ${CMAKE_CURRENT_LIST_DIR}/RicEclipseCellResultToFileImpl.cpp +) list(APPEND COMMAND_CODE_HEADER_FILES ${SOURCE_GROUP_HEADER_FILES}) @@ -62,4 +64,5 @@ list(APPEND COMMAND_CODE_SOURCE_FILES ${SOURCE_GROUP_SOURCE_FILES}) source_group( "CommandFeature\\Export" FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} - ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake) + ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake +) diff --git a/ApplicationLibCode/Commands/FlowCommands/CMakeLists_files.cmake b/ApplicationLibCode/Commands/FlowCommands/CMakeLists_files.cmake index 0eda1910a6..6e352f3780 100644 --- a/ApplicationLibCode/Commands/FlowCommands/CMakeLists_files.cmake +++ b/ApplicationLibCode/Commands/FlowCommands/CMakeLists_files.cmake @@ -9,7 +9,8 @@ set(SOURCE_GROUP_HEADER_FILES ${CMAKE_CURRENT_LIST_DIR}/RicPlotProductionRateFeature.h ${CMAKE_CURRENT_LIST_DIR}/RicSelectViewUI.h ${CMAKE_CURRENT_LIST_DIR}/RicShowTotalAllocationDataFeature.h - ${CMAKE_CURRENT_LIST_DIR}/RicShowCumulativePhasePlotFeature.h) + ${CMAKE_CURRENT_LIST_DIR}/RicShowCumulativePhasePlotFeature.h +) set(SOURCE_GROUP_SOURCE_FILES ${CMAKE_CURRENT_LIST_DIR}/RicAddStoredFlowCharacteristicsPlotFeature.cpp @@ -22,7 +23,8 @@ set(SOURCE_GROUP_SOURCE_FILES ${CMAKE_CURRENT_LIST_DIR}/RicPlotProductionRateFeature.cpp ${CMAKE_CURRENT_LIST_DIR}/RicSelectViewUI.cpp ${CMAKE_CURRENT_LIST_DIR}/RicShowTotalAllocationDataFeature.cpp - ${CMAKE_CURRENT_LIST_DIR}/RicShowCumulativePhasePlotFeature.cpp) + ${CMAKE_CURRENT_LIST_DIR}/RicShowCumulativePhasePlotFeature.cpp +) list(APPEND COMMAND_CODE_HEADER_FILES ${SOURCE_GROUP_HEADER_FILES}) @@ -31,4 +33,5 @@ list(APPEND COMMAND_CODE_SOURCE_FILES ${SOURCE_GROUP_SOURCE_FILES}) source_group( "CommandFeature\\FlowDiagnostics" FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} - ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake) + ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake +) diff --git a/ApplicationLibCode/Commands/FractureCommands/CMakeLists_files.cmake b/ApplicationLibCode/Commands/FractureCommands/CMakeLists_files.cmake index 93c9860b4a..02cd25ab68 100644 --- a/ApplicationLibCode/Commands/FractureCommands/CMakeLists_files.cmake +++ b/ApplicationLibCode/Commands/FractureCommands/CMakeLists_files.cmake @@ -19,7 +19,8 @@ set(SOURCE_GROUP_HEADER_FILES ${CMAKE_CURRENT_LIST_DIR}/RicCreateMultipleFracturesOptionItemUi.h ${CMAKE_CURRENT_LIST_DIR}/RicCreateMultipleFracturesUi.h ${CMAKE_CURRENT_LIST_DIR}/RicNewOptionItemFeature.h - ${CMAKE_CURRENT_LIST_DIR}/RicDeleteOptionItemFeature.h) + ${CMAKE_CURRENT_LIST_DIR}/RicDeleteOptionItemFeature.h +) set(SOURCE_GROUP_SOURCE_FILES ${CMAKE_CURRENT_LIST_DIR}/RicPasteEllipseFractureFeature.cpp @@ -42,16 +43,19 @@ set(SOURCE_GROUP_SOURCE_FILES ${CMAKE_CURRENT_LIST_DIR}/RicCreateMultipleFracturesOptionItemUi.cpp ${CMAKE_CURRENT_LIST_DIR}/RicCreateMultipleFracturesUi.cpp ${CMAKE_CURRENT_LIST_DIR}/RicNewOptionItemFeature.cpp - ${CMAKE_CURRENT_LIST_DIR}/RicDeleteOptionItemFeature.cpp) + ${CMAKE_CURRENT_LIST_DIR}/RicDeleteOptionItemFeature.cpp +) list(APPEND COMMAND_CODE_HEADER_FILES ${SOURCE_GROUP_HEADER_FILES}) list(APPEND COMMAND_CODE_SOURCE_FILES ${SOURCE_GROUP_SOURCE_FILES}) list(APPEND COMMAND_QT_MOC_HEADERS - ${CMAKE_CURRENT_LIST_DIR}/RicCreateMultipleFracturesFeature.h) + ${CMAKE_CURRENT_LIST_DIR}/RicCreateMultipleFracturesFeature.h +) source_group( "CommandFeature\\Fracture" FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} - ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake) + ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake +) diff --git a/ApplicationLibCode/Commands/GeoMechCommands/CMakeLists_files.cmake b/ApplicationLibCode/Commands/GeoMechCommands/CMakeLists_files.cmake index c0b3b9cc17..c2d4443621 100644 --- a/ApplicationLibCode/Commands/GeoMechCommands/CMakeLists_files.cmake +++ b/ApplicationLibCode/Commands/GeoMechCommands/CMakeLists_files.cmake @@ -13,7 +13,8 @@ set(SOURCE_GROUP_HEADER_FILES ${CMAKE_CURRENT_LIST_DIR}/RicRunAdvFaultReactAssessmentFeature.h ${CMAKE_CURRENT_LIST_DIR}/RicRunBasicFaultReactAssessment3dFeature.h ${CMAKE_CURRENT_LIST_DIR}/RicRunAdvFaultReactAssessment3dFeature.h - ${CMAKE_CURRENT_LIST_DIR}/RicRunFaultReactAssessmentFeature.h) + ${CMAKE_CURRENT_LIST_DIR}/RicRunFaultReactAssessmentFeature.h +) set(SOURCE_GROUP_SOURCE_FILES ${CMAKE_CURRENT_LIST_DIR}/RicGeoMechCopyCaseFeature.cpp @@ -30,7 +31,8 @@ set(SOURCE_GROUP_SOURCE_FILES ${CMAKE_CURRENT_LIST_DIR}/RicRunAdvFaultReactAssessment3dFeature.cpp ${CMAKE_CURRENT_LIST_DIR}/RicRunBasicFaultReactAssessmentFeature.cpp ${CMAKE_CURRENT_LIST_DIR}/RicRunBasicFaultReactAssessment3dFeature.cpp - ${CMAKE_CURRENT_LIST_DIR}/RicRunFaultReactAssessmentFeature.cpp) + ${CMAKE_CURRENT_LIST_DIR}/RicRunFaultReactAssessmentFeature.cpp +) list(APPEND COMMAND_CODE_HEADER_FILES ${SOURCE_GROUP_HEADER_FILES}) @@ -42,4 +44,5 @@ list(APPEND COMMAND_CODE_SOURCE_FILES ${SOURCE_GROUP_SOURCE_FILES}) source_group( "CommandFeature\\GeoMechCommands" FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} - ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake) + ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake +) diff --git a/ApplicationLibCode/Commands/GridCrossPlotCommands/CMakeLists_files.cmake b/ApplicationLibCode/Commands/GridCrossPlotCommands/CMakeLists_files.cmake index 8796507509..b5cd988aef 100644 --- a/ApplicationLibCode/Commands/GridCrossPlotCommands/CMakeLists_files.cmake +++ b/ApplicationLibCode/Commands/GridCrossPlotCommands/CMakeLists_files.cmake @@ -4,7 +4,8 @@ set(SOURCE_GROUP_HEADER_FILES ${CMAKE_CURRENT_LIST_DIR}/RicSwapGridCrossPlotDataSetAxesFeature.h ${CMAKE_CURRENT_LIST_DIR}/RicPasteGridCrossPlotDataSetFeature.h ${CMAKE_CURRENT_LIST_DIR}/RicCreateSaturationPressurePlotsFeature.h - ${CMAKE_CURRENT_LIST_DIR}/RicSaturationPressureUi.h) + ${CMAKE_CURRENT_LIST_DIR}/RicSaturationPressureUi.h +) set(SOURCE_GROUP_SOURCE_FILES ${CMAKE_CURRENT_LIST_DIR}/RicCreateGridCrossPlotFeature.cpp @@ -12,7 +13,8 @@ set(SOURCE_GROUP_SOURCE_FILES ${CMAKE_CURRENT_LIST_DIR}/RicSwapGridCrossPlotDataSetAxesFeature.cpp ${CMAKE_CURRENT_LIST_DIR}/RicPasteGridCrossPlotDataSetFeature.cpp ${CMAKE_CURRENT_LIST_DIR}/RicCreateSaturationPressurePlotsFeature.cpp - ${CMAKE_CURRENT_LIST_DIR}/RicSaturationPressureUi.cpp) + ${CMAKE_CURRENT_LIST_DIR}/RicSaturationPressureUi.cpp +) list(APPEND COMMAND_CODE_HEADER_FILES ${SOURCE_GROUP_HEADER_FILES}) @@ -21,4 +23,5 @@ list(APPEND COMMAND_CODE_SOURCE_FILES ${SOURCE_GROUP_SOURCE_FILES}) source_group( "CommandFeature\\GridCrossPlot" FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} - ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake) + ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake +) diff --git a/ApplicationLibCode/Commands/HoloLensCommands/CMakeLists_files.cmake b/ApplicationLibCode/Commands/HoloLensCommands/CMakeLists_files.cmake index 9a9377ce5f..ae9633376e 100644 --- a/ApplicationLibCode/Commands/HoloLensCommands/CMakeLists_files.cmake +++ b/ApplicationLibCode/Commands/HoloLensCommands/CMakeLists_files.cmake @@ -19,7 +19,8 @@ set(SOURCE_GROUP_HEADER_FILES ${CMAKE_CURRENT_LIST_DIR}/VdeExportPart.h ${CMAKE_CURRENT_LIST_DIR}/VdeFileExporter.h ${CMAKE_CURRENT_LIST_DIR}/VdePacketDirectory.h - ${CMAKE_CURRENT_LIST_DIR}/VdeVizDataExtractor.h) + ${CMAKE_CURRENT_LIST_DIR}/VdeVizDataExtractor.h +) set(SOURCE_GROUP_SOURCE_FILES ${CMAKE_CURRENT_LIST_DIR}/RicHoloLensExportToFolderFeature.cpp @@ -41,7 +42,8 @@ set(SOURCE_GROUP_SOURCE_FILES ${CMAKE_CURRENT_LIST_DIR}/VdeExportPart.cpp ${CMAKE_CURRENT_LIST_DIR}/VdeFileExporter.cpp ${CMAKE_CURRENT_LIST_DIR}/VdePacketDirectory.cpp - ${CMAKE_CURRENT_LIST_DIR}/VdeVizDataExtractor.cpp) + ${CMAKE_CURRENT_LIST_DIR}/VdeVizDataExtractor.cpp +) list(APPEND COMMAND_CODE_HEADER_FILES ${SOURCE_GROUP_HEADER_FILES}) @@ -49,9 +51,11 @@ list(APPEND COMMAND_CODE_SOURCE_FILES ${SOURCE_GROUP_SOURCE_FILES}) set(COMMAND_QT_MOC_HEADERS ${COMMAND_QT_MOC_HEADERS} ${CMAKE_CURRENT_LIST_DIR}/RicHoloLensRestClient.h - ${CMAKE_CURRENT_LIST_DIR}/RicExportToSharingServerScheduler.h) + ${CMAKE_CURRENT_LIST_DIR}/RicExportToSharingServerScheduler.h +) source_group( "CommandFeature\\HoloLens" FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} - ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake) + ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake +) diff --git a/ApplicationLibCode/Commands/IntersectionBoxCommands/CMakeLists_files.cmake b/ApplicationLibCode/Commands/IntersectionBoxCommands/CMakeLists_files.cmake index 28946772cd..2439f5fa1f 100644 --- a/ApplicationLibCode/Commands/IntersectionBoxCommands/CMakeLists_files.cmake +++ b/ApplicationLibCode/Commands/IntersectionBoxCommands/CMakeLists_files.cmake @@ -5,7 +5,8 @@ set(SOURCE_GROUP_HEADER_FILES ${CMAKE_CURRENT_LIST_DIR}/RicIntersectionBoxXSliceFeature.h ${CMAKE_CURRENT_LIST_DIR}/RicIntersectionBoxYSliceFeature.h ${CMAKE_CURRENT_LIST_DIR}/RicIntersectionBoxZSliceFeature.h - ${CMAKE_CURRENT_LIST_DIR}/RicIntersectionBoxAtPosFeature.h) + ${CMAKE_CURRENT_LIST_DIR}/RicIntersectionBoxAtPosFeature.h +) set(SOURCE_GROUP_SOURCE_FILES ${CMAKE_CURRENT_LIST_DIR}/RicIntersectionFeatureImpl.cpp @@ -14,7 +15,8 @@ set(SOURCE_GROUP_SOURCE_FILES ${CMAKE_CURRENT_LIST_DIR}/RicIntersectionBoxXSliceFeature.cpp ${CMAKE_CURRENT_LIST_DIR}/RicIntersectionBoxYSliceFeature.cpp ${CMAKE_CURRENT_LIST_DIR}/RicIntersectionBoxZSliceFeature.cpp - ${CMAKE_CURRENT_LIST_DIR}/RicIntersectionBoxAtPosFeature.cpp) + ${CMAKE_CURRENT_LIST_DIR}/RicIntersectionBoxAtPosFeature.cpp +) list(APPEND COMMAND_CODE_HEADER_FILES ${SOURCE_GROUP_HEADER_FILES}) @@ -22,9 +24,11 @@ list(APPEND COMMAND_CODE_SOURCE_FILES ${SOURCE_GROUP_SOURCE_FILES}) set(COMMAND_QT_MOC_HEADERS ${COMMAND_QT_MOC_HEADERS} - ${CMAKE_CURRENT_LIST_DIR}/RicBoxManipulatorEventHandler.h) + ${CMAKE_CURRENT_LIST_DIR}/RicBoxManipulatorEventHandler.h +) source_group( "CommandFeature\\IntersectionBox" FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} - ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake) + ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake +) diff --git a/ApplicationLibCode/Commands/IntersectionViewCommands/CMakeLists_files.cmake b/ApplicationLibCode/Commands/IntersectionViewCommands/CMakeLists_files.cmake index 495cbc03e2..1622024aa3 100644 --- a/ApplicationLibCode/Commands/IntersectionViewCommands/CMakeLists_files.cmake +++ b/ApplicationLibCode/Commands/IntersectionViewCommands/CMakeLists_files.cmake @@ -1,8 +1,10 @@ set(SOURCE_GROUP_HEADER_FILES - ${CMAKE_CURRENT_LIST_DIR}/RicNewIntersectionViewFeature.h) + ${CMAKE_CURRENT_LIST_DIR}/RicNewIntersectionViewFeature.h +) set(SOURCE_GROUP_SOURCE_FILES - ${CMAKE_CURRENT_LIST_DIR}/RicNewIntersectionViewFeature.cpp) + ${CMAKE_CURRENT_LIST_DIR}/RicNewIntersectionViewFeature.cpp +) list(APPEND COMMAND_CODE_HEADER_FILES ${SOURCE_GROUP_HEADER_FILES}) @@ -11,4 +13,5 @@ list(APPEND COMMAND_CODE_SOURCE_FILES ${SOURCE_GROUP_SOURCE_FILES}) source_group( "CommandFeature\\IntersectionView" FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} - ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake) + ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake +) diff --git a/ApplicationLibCode/Commands/MeasurementCommands/CMakeLists_files.cmake b/ApplicationLibCode/Commands/MeasurementCommands/CMakeLists_files.cmake index b480476f7a..a375b3b2f9 100644 --- a/ApplicationLibCode/Commands/MeasurementCommands/CMakeLists_files.cmake +++ b/ApplicationLibCode/Commands/MeasurementCommands/CMakeLists_files.cmake @@ -1,10 +1,12 @@ set(SOURCE_GROUP_HEADER_FILES ${CMAKE_CURRENT_LIST_DIR}/RicToggleMeasurementModeFeature.h - ${CMAKE_CURRENT_LIST_DIR}/RicMeasurementPickEventHandler.h) + ${CMAKE_CURRENT_LIST_DIR}/RicMeasurementPickEventHandler.h +) set(SOURCE_GROUP_SOURCE_FILES ${CMAKE_CURRENT_LIST_DIR}/RicToggleMeasurementModeFeature.cpp - ${CMAKE_CURRENT_LIST_DIR}/RicMeasurementPickEventHandler.cpp) + ${CMAKE_CURRENT_LIST_DIR}/RicMeasurementPickEventHandler.cpp +) list(APPEND COMMAND_CODE_HEADER_FILES ${SOURCE_GROUP_HEADER_FILES}) @@ -15,4 +17,5 @@ list(APPEND COMMAND_QT_MOC_HEADERS) source_group( "CommandFeature\\Measurement" FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} - ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake) + ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake +) diff --git a/ApplicationLibCode/Commands/OctaveScriptCommands/CMakeLists_files.cmake b/ApplicationLibCode/Commands/OctaveScriptCommands/CMakeLists_files.cmake index 1632ed4d46..dcd6da42fe 100644 --- a/ApplicationLibCode/Commands/OctaveScriptCommands/CMakeLists_files.cmake +++ b/ApplicationLibCode/Commands/OctaveScriptCommands/CMakeLists_files.cmake @@ -8,7 +8,8 @@ set(SOURCE_GROUP_HEADER_FILES ${CMAKE_CURRENT_LIST_DIR}/RicNewOctaveScriptFeature.h ${CMAKE_CURRENT_LIST_DIR}/RicNewPythonScriptFeature.h ${CMAKE_CURRENT_LIST_DIR}/RicScriptFeatureImpl.h - ${CMAKE_CURRENT_LIST_DIR}/RicRefreshScriptsFeature.h) + ${CMAKE_CURRENT_LIST_DIR}/RicRefreshScriptsFeature.h +) set(SOURCE_GROUP_SOURCE_FILES ${CMAKE_CURRENT_LIST_DIR}/RicAddScriptPathFeature.cpp @@ -20,11 +21,13 @@ set(SOURCE_GROUP_SOURCE_FILES ${CMAKE_CURRENT_LIST_DIR}/RicNewOctaveScriptFeature.cpp ${CMAKE_CURRENT_LIST_DIR}/RicNewPythonScriptFeature.cpp ${CMAKE_CURRENT_LIST_DIR}/RicScriptFeatureImpl.cpp - ${CMAKE_CURRENT_LIST_DIR}/RicRefreshScriptsFeature.cpp) + ${CMAKE_CURRENT_LIST_DIR}/RicRefreshScriptsFeature.cpp +) set(COMMAND_QT_MOC_HEADERS ${COMMAND_QT_MOC_HEADERS} - ${CMAKE_CURRENT_LIST_DIR}/RicExecuteScriptForCasesFeature.h) + ${CMAKE_CURRENT_LIST_DIR}/RicExecuteScriptForCasesFeature.h +) list(APPEND COMMAND_CODE_HEADER_FILES ${SOURCE_GROUP_HEADER_FILES}) @@ -33,4 +36,5 @@ list(APPEND COMMAND_CODE_SOURCE_FILES ${SOURCE_GROUP_SOURCE_FILES}) source_group( "CommandFeature\\Script" FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} - ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake) + ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake +) diff --git a/ApplicationLibCode/Commands/OperationsUsingObjReferences/CMakeLists_files.cmake b/ApplicationLibCode/Commands/OperationsUsingObjReferences/CMakeLists_files.cmake index 17cc4b61ba..2aef75e722 100644 --- a/ApplicationLibCode/Commands/OperationsUsingObjReferences/CMakeLists_files.cmake +++ b/ApplicationLibCode/Commands/OperationsUsingObjReferences/CMakeLists_files.cmake @@ -5,7 +5,8 @@ set(SOURCE_GROUP_HEADER_FILES ${CMAKE_CURRENT_LIST_DIR}/RicPasteEclipseCasesFeature.h ${CMAKE_CURRENT_LIST_DIR}/RicPasteEclipseViewsFeature.h ${CMAKE_CURRENT_LIST_DIR}/RicPasteGeoMechViewsFeature.h - ${CMAKE_CURRENT_LIST_DIR}/RicPasteIntersectionsFeature.h) + ${CMAKE_CURRENT_LIST_DIR}/RicPasteIntersectionsFeature.h +) set(SOURCE_GROUP_SOURCE_FILES ${CMAKE_CURRENT_LIST_DIR}/RicCopyReferencesToClipboardFeature.cpp @@ -14,7 +15,8 @@ set(SOURCE_GROUP_SOURCE_FILES ${CMAKE_CURRENT_LIST_DIR}/RicPasteEclipseCasesFeature.cpp ${CMAKE_CURRENT_LIST_DIR}/RicPasteEclipseViewsFeature.cpp ${CMAKE_CURRENT_LIST_DIR}/RicPasteGeoMechViewsFeature.cpp - ${CMAKE_CURRENT_LIST_DIR}/RicPasteIntersectionsFeature.cpp) + ${CMAKE_CURRENT_LIST_DIR}/RicPasteIntersectionsFeature.cpp +) list(APPEND COMMAND_CODE_HEADER_FILES ${SOURCE_GROUP_HEADER_FILES}) @@ -23,4 +25,5 @@ list(APPEND COMMAND_CODE_SOURCE_FILES ${SOURCE_GROUP_SOURCE_FILES}) source_group( "CommandFeature\\ObjReferences" FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} - ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake) + ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake +) diff --git a/ApplicationLibCode/Commands/PlotTemplateCommands/CMakeLists_files.cmake b/ApplicationLibCode/Commands/PlotTemplateCommands/CMakeLists_files.cmake index 237993ca65..82de557305 100644 --- a/ApplicationLibCode/Commands/PlotTemplateCommands/CMakeLists_files.cmake +++ b/ApplicationLibCode/Commands/PlotTemplateCommands/CMakeLists_files.cmake @@ -5,7 +5,8 @@ set(SOURCE_GROUP_HEADER_FILES ${CMAKE_CURRENT_LIST_DIR}/RicSummaryPlotTemplateTools.h ${CMAKE_CURRENT_LIST_DIR}/RicReloadPlotTemplatesFeature.h ${CMAKE_CURRENT_LIST_DIR}/RicCreatePlotFromTemplateFeature.h - ${CMAKE_CURRENT_LIST_DIR}/RicCreatePlotFromTemplateByShortcutFeature.h) + ${CMAKE_CURRENT_LIST_DIR}/RicCreatePlotFromTemplateByShortcutFeature.h +) set(SOURCE_GROUP_SOURCE_FILES ${CMAKE_CURRENT_LIST_DIR}/RicSavePlotTemplateFeature.cpp @@ -14,7 +15,8 @@ set(SOURCE_GROUP_SOURCE_FILES ${CMAKE_CURRENT_LIST_DIR}/RicSummaryPlotTemplateTools.cpp ${CMAKE_CURRENT_LIST_DIR}/RicReloadPlotTemplatesFeature.cpp ${CMAKE_CURRENT_LIST_DIR}/RicCreatePlotFromTemplateFeature.cpp - ${CMAKE_CURRENT_LIST_DIR}/RicCreatePlotFromTemplateByShortcutFeature.cpp) + ${CMAKE_CURRENT_LIST_DIR}/RicCreatePlotFromTemplateByShortcutFeature.cpp +) list(APPEND COMMAND_CODE_HEADER_FILES ${SOURCE_GROUP_HEADER_FILES}) @@ -25,4 +27,5 @@ list(APPEND COMMAND_QT_MOC_HEADERS) source_group( "CommandFeature\\PlotTemplate" FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} - ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake) + ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake +) diff --git a/ApplicationLibCode/Commands/SsiHubImportCommands/CMakeLists_files.cmake b/ApplicationLibCode/Commands/SsiHubImportCommands/CMakeLists_files.cmake index 2e95491929..965f2d80a2 100644 --- a/ApplicationLibCode/Commands/SsiHubImportCommands/CMakeLists_files.cmake +++ b/ApplicationLibCode/Commands/SsiHubImportCommands/CMakeLists_files.cmake @@ -4,7 +4,8 @@ set(SOURCE_GROUP_HEADER_FILES ${CMAKE_CURRENT_LIST_DIR}/RimOilRegionEntry.h ${CMAKE_CURRENT_LIST_DIR}/RimWellPathImport.h ${CMAKE_CURRENT_LIST_DIR}/RimWellsEntry.h - ${CMAKE_CURRENT_LIST_DIR}/RiuWellImportWizard.h) + ${CMAKE_CURRENT_LIST_DIR}/RiuWellImportWizard.h +) set(SOURCE_GROUP_SOURCE_FILES ${CMAKE_CURRENT_LIST_DIR}/RicWellPathsImportSsihubFeature.cpp @@ -12,16 +13,19 @@ set(SOURCE_GROUP_SOURCE_FILES ${CMAKE_CURRENT_LIST_DIR}/RimOilRegionEntry.cpp ${CMAKE_CURRENT_LIST_DIR}/RimWellPathImport.cpp ${CMAKE_CURRENT_LIST_DIR}/RimWellsEntry.cpp - ${CMAKE_CURRENT_LIST_DIR}/RiuWellImportWizard.cpp) + ${CMAKE_CURRENT_LIST_DIR}/RiuWellImportWizard.cpp +) list(APPEND COMMAND_CODE_HEADER_FILES ${SOURCE_GROUP_HEADER_FILES}) list(APPEND COMMAND_CODE_SOURCE_FILES ${SOURCE_GROUP_SOURCE_FILES}) list(APPEND COMMAND_QT_MOC_HEADERS - ${CMAKE_CURRENT_LIST_DIR}/RiuWellImportWizard.h) + ${CMAKE_CURRENT_LIST_DIR}/RiuWellImportWizard.h +) source_group( "CommandFeature\\SsiHub" FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} - ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake) + ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake +) diff --git a/ApplicationLibCode/Commands/StreamlineCommands/CMakeLists_files.cmake b/ApplicationLibCode/Commands/StreamlineCommands/CMakeLists_files.cmake index 9de871fe94..09205b8636 100644 --- a/ApplicationLibCode/Commands/StreamlineCommands/CMakeLists_files.cmake +++ b/ApplicationLibCode/Commands/StreamlineCommands/CMakeLists_files.cmake @@ -1,8 +1,10 @@ set(SOURCE_GROUP_HEADER_FILES - ${CMAKE_CURRENT_LIST_DIR}/RicNewStreamlineFeature.h) + ${CMAKE_CURRENT_LIST_DIR}/RicNewStreamlineFeature.h +) set(SOURCE_GROUP_SOURCE_FILES - ${CMAKE_CURRENT_LIST_DIR}/RicNewStreamlineFeature.cpp) + ${CMAKE_CURRENT_LIST_DIR}/RicNewStreamlineFeature.cpp +) list(APPEND COMMAND_CODE_HEADER_FILES ${SOURCE_GROUP_HEADER_FILES}) @@ -11,4 +13,5 @@ list(APPEND COMMAND_CODE_SOURCE_FILES ${SOURCE_GROUP_SOURCE_FILES}) source_group( "CommandFeature\\StreamlineCommands" FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} - ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake) + ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake +) diff --git a/ApplicationLibCode/Commands/SummaryPlotCommands/CMakeLists_files.cmake b/ApplicationLibCode/Commands/SummaryPlotCommands/CMakeLists_files.cmake index 5e93b248a9..96ff126b96 100644 --- a/ApplicationLibCode/Commands/SummaryPlotCommands/CMakeLists_files.cmake +++ b/ApplicationLibCode/Commands/SummaryPlotCommands/CMakeLists_files.cmake @@ -42,7 +42,8 @@ set(SOURCE_GROUP_HEADER_FILES ${CMAKE_CURRENT_LIST_DIR}/RicClearSourceSteppingEnsembleCurveSetFeature.h ${CMAKE_CURRENT_LIST_DIR}/RicSetSourceSteppingEnsembleCurveSetFeature.h ${CMAKE_CURRENT_LIST_DIR}/RicActivateCurveFilterInToolbarFeature.h - ${CMAKE_CURRENT_LIST_DIR}/RicNewDerivedSummaryFeature.h) + ${CMAKE_CURRENT_LIST_DIR}/RicNewDerivedSummaryFeature.h +) set(SOURCE_GROUP_SOURCE_FILES ${CMAKE_CURRENT_LIST_DIR}/RicNewSummaryPlotFeature.cpp @@ -88,7 +89,8 @@ set(SOURCE_GROUP_SOURCE_FILES ${CMAKE_CURRENT_LIST_DIR}/RicClearSourceSteppingEnsembleCurveSetFeature.cpp ${CMAKE_CURRENT_LIST_DIR}/RicSetSourceSteppingEnsembleCurveSetFeature.cpp ${CMAKE_CURRENT_LIST_DIR}/RicActivateCurveFilterInToolbarFeature.cpp - ${CMAKE_CURRENT_LIST_DIR}/RicNewDerivedSummaryFeature.cpp) + ${CMAKE_CURRENT_LIST_DIR}/RicNewDerivedSummaryFeature.cpp +) list(APPEND COMMAND_CODE_HEADER_FILES ${SOURCE_GROUP_HEADER_FILES}) @@ -100,9 +102,11 @@ list( ${CMAKE_CURRENT_LIST_DIR}/RicSummaryPlotEditorWidgetCreator.h ${CMAKE_CURRENT_LIST_DIR}/RicSummaryPlotEditorDialog.h ${CMAKE_CURRENT_LIST_DIR}/RicSummaryCurveCalculatorWidgetCreator.h - ${CMAKE_CURRENT_LIST_DIR}/RicSummaryCurveCalculatorDialog.h) + ${CMAKE_CURRENT_LIST_DIR}/RicSummaryCurveCalculatorDialog.h +) source_group( "CommandFeature\\SummaryPlot" FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} - ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake) + ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake +) diff --git a/ApplicationLibCode/Commands/SurfaceCommands/CMakeLists_files.cmake b/ApplicationLibCode/Commands/SurfaceCommands/CMakeLists_files.cmake index 0ccb294650..63e20f2e9b 100644 --- a/ApplicationLibCode/Commands/SurfaceCommands/CMakeLists_files.cmake +++ b/ApplicationLibCode/Commands/SurfaceCommands/CMakeLists_files.cmake @@ -5,7 +5,8 @@ set(SOURCE_GROUP_HEADER_FILES ${CMAKE_CURRENT_LIST_DIR}/RicNewGridCaseSurfaceFeature.h ${CMAKE_CURRENT_LIST_DIR}/RicExportKLayerToPtlFeature.h ${CMAKE_CURRENT_LIST_DIR}/RicExportSurfaceToTsurfFeature.h - ${CMAKE_CURRENT_LIST_DIR}/RicNewSurfaceCollectionFeature.h) + ${CMAKE_CURRENT_LIST_DIR}/RicNewSurfaceCollectionFeature.h +) set(SOURCE_GROUP_SOURCE_FILES ${CMAKE_CURRENT_LIST_DIR}/RicImportSurfacesFeature.cpp @@ -14,7 +15,8 @@ set(SOURCE_GROUP_SOURCE_FILES ${CMAKE_CURRENT_LIST_DIR}/RicNewGridCaseSurfaceFeature.cpp ${CMAKE_CURRENT_LIST_DIR}/RicExportKLayerToPtlFeature.cpp ${CMAKE_CURRENT_LIST_DIR}/RicExportSurfaceToTsurfFeature.cpp - ${CMAKE_CURRENT_LIST_DIR}/RicNewSurfaceCollectionFeature.cpp) + ${CMAKE_CURRENT_LIST_DIR}/RicNewSurfaceCollectionFeature.cpp +) list(APPEND COMMAND_CODE_HEADER_FILES ${SOURCE_GROUP_HEADER_FILES}) @@ -26,4 +28,5 @@ list(APPEND COMMAND_CODE_SOURCE_FILES ${SOURCE_GROUP_SOURCE_FILES}) source_group( "CommandFeature\\SurfaceCommands" FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} - ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake) + ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake +) diff --git a/ApplicationLibCode/Commands/ToggleCommands/CMakeLists_files.cmake b/ApplicationLibCode/Commands/ToggleCommands/CMakeLists_files.cmake index 7bf1c71b13..2aa14ec6de 100644 --- a/ApplicationLibCode/Commands/ToggleCommands/CMakeLists_files.cmake +++ b/ApplicationLibCode/Commands/ToggleCommands/CMakeLists_files.cmake @@ -5,7 +5,8 @@ set(SOURCE_GROUP_HEADER_FILES ${CMAKE_CURRENT_LIST_DIR}/RicToggleItemsFeature.h ${CMAKE_CURRENT_LIST_DIR}/RicToggleItemsOnOthersOffFeature.h ${CMAKE_CURRENT_LIST_DIR}/RicCollapseSiblingsFeature.h - ${CMAKE_CURRENT_LIST_DIR}/RicMoveItemsToTopFeature.h) + ${CMAKE_CURRENT_LIST_DIR}/RicMoveItemsToTopFeature.h +) set(SOURCE_GROUP_SOURCE_FILES ${CMAKE_CURRENT_LIST_DIR}/RicToggleItemsFeatureImpl.cpp @@ -14,7 +15,8 @@ set(SOURCE_GROUP_SOURCE_FILES ${CMAKE_CURRENT_LIST_DIR}/RicToggleItemsFeature.cpp ${CMAKE_CURRENT_LIST_DIR}/RicToggleItemsOnOthersOffFeature.cpp ${CMAKE_CURRENT_LIST_DIR}/RicCollapseSiblingsFeature.cpp - ${CMAKE_CURRENT_LIST_DIR}/RicMoveItemsToTopFeature.cpp) + ${CMAKE_CURRENT_LIST_DIR}/RicMoveItemsToTopFeature.cpp +) list(APPEND COMMAND_CODE_HEADER_FILES ${SOURCE_GROUP_HEADER_FILES}) @@ -23,4 +25,5 @@ list(APPEND COMMAND_CODE_SOURCE_FILES ${SOURCE_GROUP_SOURCE_FILES}) source_group( "CommandFeature\\ToggleItems" FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} - ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake) + ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake +) diff --git a/ApplicationLibCode/Commands/ViewLink/CMakeLists_files.cmake b/ApplicationLibCode/Commands/ViewLink/CMakeLists_files.cmake index ab41db106c..ad5911aa3e 100644 --- a/ApplicationLibCode/Commands/ViewLink/CMakeLists_files.cmake +++ b/ApplicationLibCode/Commands/ViewLink/CMakeLists_files.cmake @@ -8,7 +8,8 @@ set(SOURCE_GROUP_HEADER_FILES ${CMAKE_CURRENT_LIST_DIR}/RicDeleteAllLinkedViewsFeature.h ${CMAKE_CURRENT_LIST_DIR}/RicSetMasterViewFeature.h ${CMAKE_CURRENT_LIST_DIR}/RicRemoveComparison3dViewFeature.h - ${CMAKE_CURRENT_LIST_DIR}/RicCompareTo3dViewFeature.h) + ${CMAKE_CURRENT_LIST_DIR}/RicCompareTo3dViewFeature.h +) set(SOURCE_GROUP_SOURCE_FILES ${CMAKE_CURRENT_LIST_DIR}/RicLinkVisibleViewsFeature.cpp @@ -20,7 +21,8 @@ set(SOURCE_GROUP_SOURCE_FILES ${CMAKE_CURRENT_LIST_DIR}/RicDeleteAllLinkedViewsFeature.cpp ${CMAKE_CURRENT_LIST_DIR}/RicSetMasterViewFeature.cpp ${CMAKE_CURRENT_LIST_DIR}/RicRemoveComparison3dViewFeature.cpp - ${CMAKE_CURRENT_LIST_DIR}/RicCompareTo3dViewFeature.cpp) + ${CMAKE_CURRENT_LIST_DIR}/RicCompareTo3dViewFeature.cpp +) list(APPEND COMMAND_CODE_HEADER_FILES ${SOURCE_GROUP_HEADER_FILES}) @@ -29,4 +31,5 @@ list(APPEND COMMAND_CODE_SOURCE_FILES ${SOURCE_GROUP_SOURCE_FILES}) source_group( "CommandFeature\\ViewLink" FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} - ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake) + ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake +) diff --git a/ApplicationLibCode/Commands/WellLogCommands/CMakeLists_files.cmake b/ApplicationLibCode/Commands/WellLogCommands/CMakeLists_files.cmake index e7460e12e6..84d957aec4 100644 --- a/ApplicationLibCode/Commands/WellLogCommands/CMakeLists_files.cmake +++ b/ApplicationLibCode/Commands/WellLogCommands/CMakeLists_files.cmake @@ -26,7 +26,8 @@ set(SOURCE_GROUP_HEADER_FILES ${CMAKE_CURRENT_LIST_DIR}/Ric3dWellLogCurvePickEventHandler.h ${CMAKE_CURRENT_LIST_DIR}/RicNewWellBoreStabilityPlotFeature.h ${CMAKE_CURRENT_LIST_DIR}/RicNewWellMeasurementCurveFeature.h - ${CMAKE_CURRENT_LIST_DIR}/RicNewEnsembleWellLogCurveSetFeature.h) + ${CMAKE_CURRENT_LIST_DIR}/RicNewEnsembleWellLogCurveSetFeature.h +) set(SOURCE_GROUP_SOURCE_FILES ${CMAKE_CURRENT_LIST_DIR}/RicAddWellLogToPlotFeature.cpp @@ -56,7 +57,8 @@ set(SOURCE_GROUP_SOURCE_FILES ${CMAKE_CURRENT_LIST_DIR}/Ric3dWellLogCurvePickEventHandler.cpp ${CMAKE_CURRENT_LIST_DIR}/RicNewWellBoreStabilityPlotFeature.cpp ${CMAKE_CURRENT_LIST_DIR}/RicNewWellMeasurementCurveFeature.cpp - ${CMAKE_CURRENT_LIST_DIR}/RicNewEnsembleWellLogCurveSetFeature.cpp) + ${CMAKE_CURRENT_LIST_DIR}/RicNewEnsembleWellLogCurveSetFeature.cpp +) list(APPEND COMMAND_CODE_HEADER_FILES ${SOURCE_GROUP_HEADER_FILES}) @@ -65,4 +67,5 @@ list(APPEND COMMAND_CODE_SOURCE_FILES ${SOURCE_GROUP_SOURCE_FILES}) source_group( "CommandFeature\\WellLog" FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} - ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake) + ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake +) diff --git a/ApplicationLibCode/Commands/WellPathCommands/CMakeLists_files.cmake b/ApplicationLibCode/Commands/WellPathCommands/CMakeLists_files.cmake index 8b01b186fc..53f8c498ce 100644 --- a/ApplicationLibCode/Commands/WellPathCommands/CMakeLists_files.cmake +++ b/ApplicationLibCode/Commands/WellPathCommands/CMakeLists_files.cmake @@ -78,9 +78,11 @@ list( ${CMAKE_CURRENT_LIST_DIR}/PointTangentManipulator/RicWellPathGeometry3dEditor.h ${CMAKE_CURRENT_LIST_DIR}/PointTangentManipulator/RicPolyline3dEditor.h ${CMAKE_CURRENT_LIST_DIR}/PointTangentManipulator/RicPolylineTarget3dEditor.h - ${CMAKE_CURRENT_LIST_DIR}/RicCreateMultipleWellPathLaterals.h) + ${CMAKE_CURRENT_LIST_DIR}/RicCreateMultipleWellPathLaterals.h +) source_group( "CommandFeature\\WellPath" FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} - ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake) + ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake +) diff --git a/ApplicationLibCode/FileInterface/CMakeLists_files.cmake b/ApplicationLibCode/FileInterface/CMakeLists_files.cmake index bf6057c54c..cf7a7f1e2f 100644 --- a/ApplicationLibCode/FileInterface/CMakeLists_files.cmake +++ b/ApplicationLibCode/FileInterface/CMakeLists_files.cmake @@ -147,4 +147,5 @@ list(APPEND CODE_SOURCE_FILES ${SOURCE_GROUP_SOURCE_FILES}) source_group( "FileInterface" FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} - ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake) + ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake +) diff --git a/ApplicationLibCode/GeoMech/GeoMechDataModel/CMakeLists.txt b/ApplicationLibCode/GeoMech/GeoMechDataModel/CMakeLists.txt index 8405217acc..666b195014 100644 --- a/ApplicationLibCode/GeoMech/GeoMechDataModel/CMakeLists.txt +++ b/ApplicationLibCode/GeoMech/GeoMechDataModel/CMakeLists.txt @@ -104,12 +104,14 @@ add_library( RigFemPartResultCalculatorShearSlipIndicator.h RigFemPartResultCalculatorShearSlipIndicator.cpp RimGeoMechGeometrySelectionItem.h - RimGeoMechGeometrySelectionItem.cpp) + RimGeoMechGeometrySelectionItem.cpp +) target_include_directories(${PROJECT_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) set(LINK_LIBRARIES LibCore cafPdmCvf cafTensor cafUserInterface CommonCode - ResultStatisticsCache) + ResultStatisticsCache +) target_link_libraries(${PROJECT_NAME} ${LINK_LIBRARIES}) diff --git a/ApplicationLibCode/GeoMech/GeoMechVisualization/CMakeLists_files.cmake b/ApplicationLibCode/GeoMech/GeoMechVisualization/CMakeLists_files.cmake index 05d250283a..7f765b58ef 100644 --- a/ApplicationLibCode/GeoMech/GeoMechVisualization/CMakeLists_files.cmake +++ b/ApplicationLibCode/GeoMech/GeoMechVisualization/CMakeLists_files.cmake @@ -5,7 +5,8 @@ set(SOURCE_GROUP_HEADER_FILES ${CMAKE_CURRENT_LIST_DIR}/RivGeoMechPartMgrCache.h ${CMAKE_CURRENT_LIST_DIR}/RivGeoMechVizLogic.h ${CMAKE_CURRENT_LIST_DIR}/RivFemPickSourceInfo.h - ${CMAKE_CURRENT_LIST_DIR}/RivFemElmVisibilityCalculator.h) + ${CMAKE_CURRENT_LIST_DIR}/RivFemElmVisibilityCalculator.h +) set(SOURCE_GROUP_SOURCE_FILES ${CMAKE_CURRENT_LIST_DIR}/RivFemPartGeometryGenerator.cpp @@ -14,7 +15,8 @@ set(SOURCE_GROUP_SOURCE_FILES ${CMAKE_CURRENT_LIST_DIR}/RivGeoMechPartMgrCache.cpp ${CMAKE_CURRENT_LIST_DIR}/RivGeoMechVizLogic.cpp ${CMAKE_CURRENT_LIST_DIR}/RivFemPickSourceInfo.cpp - ${CMAKE_CURRENT_LIST_DIR}/RivFemElmVisibilityCalculator.cpp) + ${CMAKE_CURRENT_LIST_DIR}/RivFemElmVisibilityCalculator.cpp +) list(APPEND CODE_HEADER_FILES ${SOURCE_GROUP_HEADER_FILES}) @@ -22,4 +24,5 @@ list(APPEND CODE_SOURCE_FILES ${SOURCE_GROUP_SOURCE_FILES}) source_group( "GeoMechViz" FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} - ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake) + ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake +) diff --git a/ApplicationLibCode/GeoMech/OdbReader/CMakeLists.txt b/ApplicationLibCode/GeoMech/OdbReader/CMakeLists.txt index 4ba39a8142..6685100e92 100644 --- a/ApplicationLibCode/GeoMech/OdbReader/CMakeLists.txt +++ b/ApplicationLibCode/GeoMech/OdbReader/CMakeLists.txt @@ -44,7 +44,8 @@ include_directories(${RESINSIGHT_ODB_API_DIR}/include) add_library( ${PROJECT_NAME} RifOdbReader.h RifOdbReader.cpp RifGeoMechReaderInterface.h - RifGeoMechReaderInterface.cpp OdbSetup.cmake) + RifGeoMechReaderInterface.cpp OdbSetup.cmake +) if(MSVC) list( @@ -61,7 +62,8 @@ if(MSVC) ${RESINSIGHT_ODB_API_DIR}/lib/ABQSMAOdbCoreGeom.lib ${RESINSIGHT_ODB_API_DIR}/lib/ABQSMAOdbDdbOdb.lib ${RESINSIGHT_ODB_API_DIR}/lib/ABQSMARomDiagEx.lib - ${RESINSIGHT_ODB_API_DIR}/lib/ABQSMASimInterface.lib) + ${RESINSIGHT_ODB_API_DIR}/lib/ABQSMASimInterface.lib + ) else() list( APPEND @@ -77,12 +79,14 @@ else() ${RESINSIGHT_ODB_API_DIR}/lib/libABQSMABasAlloc.so ${RESINSIGHT_ODB_API_DIR}/lib/libABQSMAAbuGeom.so ${RESINSIGHT_ODB_API_DIR}/lib/libABQSMARomDiagEx.so - ${RESINSIGHT_ODB_API_DIR}/lib/libABQSMASimInterface.so) + ${RESINSIGHT_ODB_API_DIR}/lib/libABQSMASimInterface.so + ) endif(MSVC) target_include_directories(${PROJECT_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) -target_link_libraries(${PROJECT_NAME} ${RI_ODB_LIBS} RigGeoMechDataModel - LibCore) +target_link_libraries( + ${PROJECT_NAME} ${RI_ODB_LIBS} RigGeoMechDataModel LibCore +) source_group("" FILES ${PROJECT_FILES}) diff --git a/ApplicationLibCode/GeoMech/OdbReader_UnitTests/CMakeLists.txt b/ApplicationLibCode/GeoMech/OdbReader_UnitTests/CMakeLists.txt index 4b744bf9e4..95e17c3061 100644 --- a/ApplicationLibCode/GeoMech/OdbReader_UnitTests/CMakeLists.txt +++ b/ApplicationLibCode/GeoMech/OdbReader_UnitTests/CMakeLists.txt @@ -4,13 +4,16 @@ project(OdbReader_UnitTests) set(RI_VIZ_FWK_ROOT ../../../Fwk/VizFwk - CACHE PATH "Path to VizFwk") + CACHE PATH "Path to VizFwk" +) set(RI_GTEST_ROOT ../../../ThirdParty - CACHE PATH "Path to folder containing gtest folder") + CACHE PATH "Path to folder containing gtest folder" +) set(RI_TEST_FILE "" - CACHE FILEPATH "Path to test file") + CACHE FILEPATH "Path to test file" +) include(${RI_VIZ_FWK_ROOT}/CMake/Utils/ceeDetermineCompilerFlags.cmake) @@ -29,7 +32,8 @@ include_directories(../GeoMechDataModel) include_directories(${RI_GTEST_ROOT}) set(UNIT_TEST_CPP_SOURCES main.cpp RifOdbReader-Test.cpp - ${RI_GTEST_ROOT}/gtest/gtest-all.cc) + ${RI_GTEST_ROOT}/gtest/gtest-all.cc +) add_executable(${PROJECT_NAME} ${UNIT_TEST_CPP_SOURCES}) target_link_libraries(${PROJECT_NAME} RifOdbReader) diff --git a/ApplicationLibCode/ModelVisualization/CMakeLists_files.cmake b/ApplicationLibCode/ModelVisualization/CMakeLists_files.cmake index cb231e1ef3..f91430c379 100644 --- a/ApplicationLibCode/ModelVisualization/CMakeLists_files.cmake +++ b/ApplicationLibCode/ModelVisualization/CMakeLists_files.cmake @@ -58,7 +58,8 @@ set(SOURCE_GROUP_HEADER_FILES ${CMAKE_CURRENT_LIST_DIR}/RivElementVectorResultPartMgr.h ${CMAKE_CURRENT_LIST_DIR}/RivPolylinePartMgr.h ${CMAKE_CURRENT_LIST_DIR}/RivCellFilterPartMgr.h - ${CMAKE_CURRENT_LIST_DIR}/RivDrawableSpheres.h) + ${CMAKE_CURRENT_LIST_DIR}/RivDrawableSpheres.h +) set(SOURCE_GROUP_SOURCE_FILES ${CMAKE_CURRENT_LIST_DIR}/RivCellEdgeEffectGenerator.cpp @@ -115,7 +116,8 @@ set(SOURCE_GROUP_SOURCE_FILES ${CMAKE_CURRENT_LIST_DIR}/RivElementVectorResultPartMgr.cpp ${CMAKE_CURRENT_LIST_DIR}/RivPolylinePartMgr.cpp ${CMAKE_CURRENT_LIST_DIR}/RivCellFilterPartMgr.cpp - ${CMAKE_CURRENT_LIST_DIR}/RivDrawableSpheres.cpp) + ${CMAKE_CURRENT_LIST_DIR}/RivDrawableSpheres.cpp +) list(APPEND CODE_HEADER_FILES ${SOURCE_GROUP_HEADER_FILES}) @@ -124,4 +126,5 @@ list(APPEND CODE_SOURCE_FILES ${SOURCE_GROUP_SOURCE_FILES}) source_group( "ModelVisualization" FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} - ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake) + ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake +) diff --git a/ApplicationLibCode/ModelVisualization/GridBox/CMakeLists_files.cmake b/ApplicationLibCode/ModelVisualization/GridBox/CMakeLists_files.cmake index bb854d9872..2dc3aa8249 100644 --- a/ApplicationLibCode/ModelVisualization/GridBox/CMakeLists_files.cmake +++ b/ApplicationLibCode/ModelVisualization/GridBox/CMakeLists_files.cmake @@ -1,8 +1,10 @@ set(SOURCE_GROUP_HEADER_FILES ${CMAKE_CURRENT_LIST_DIR}/RivPatchGenerator.h - ${CMAKE_CURRENT_LIST_DIR}/RivGridBoxGenerator.h) + ${CMAKE_CURRENT_LIST_DIR}/RivGridBoxGenerator.h +) set(SOURCE_GROUP_SOURCE_FILES ${CMAKE_CURRENT_LIST_DIR}/RivPatchGenerator.cpp - ${CMAKE_CURRENT_LIST_DIR}/RivGridBoxGenerator.cpp) + ${CMAKE_CURRENT_LIST_DIR}/RivGridBoxGenerator.cpp +) list(APPEND CODE_HEADER_FILES ${SOURCE_GROUP_HEADER_FILES}) @@ -11,4 +13,5 @@ list(APPEND CODE_SOURCE_FILES ${SOURCE_GROUP_SOURCE_FILES}) source_group( "ModelVisualization\\GridBox" FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} - ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake) + ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake +) diff --git a/ApplicationLibCode/ModelVisualization/Intersections/CMakeLists_files.cmake b/ApplicationLibCode/ModelVisualization/Intersections/CMakeLists_files.cmake index 9bf55fb091..d85cff4774 100644 --- a/ApplicationLibCode/ModelVisualization/Intersections/CMakeLists_files.cmake +++ b/ApplicationLibCode/ModelVisualization/Intersections/CMakeLists_files.cmake @@ -7,7 +7,8 @@ set(SOURCE_GROUP_HEADER_FILES ${CMAKE_CURRENT_LIST_DIR}/RivBoxIntersectionGeometryGenerator.h ${CMAKE_CURRENT_LIST_DIR}/RivBoxIntersectionPartMgr.h ${CMAKE_CURRENT_LIST_DIR}/RivBoxIntersectionSourceInfo.h - ${CMAKE_CURRENT_LIST_DIR}/RivSectionFlattener.h) + ${CMAKE_CURRENT_LIST_DIR}/RivSectionFlattener.h +) set(SOURCE_GROUP_SOURCE_FILES ${CMAKE_CURRENT_LIST_DIR}/RivExtrudedCurveIntersectionGeometryGenerator.cpp @@ -18,7 +19,8 @@ set(SOURCE_GROUP_SOURCE_FILES ${CMAKE_CURRENT_LIST_DIR}/RivBoxIntersectionGeometryGenerator.cpp ${CMAKE_CURRENT_LIST_DIR}/RivBoxIntersectionPartMgr.cpp ${CMAKE_CURRENT_LIST_DIR}/RivBoxIntersectionSourceInfo.cpp - ${CMAKE_CURRENT_LIST_DIR}/RivSectionFlattener.cpp) + ${CMAKE_CURRENT_LIST_DIR}/RivSectionFlattener.cpp +) list(APPEND CODE_HEADER_FILES ${SOURCE_GROUP_HEADER_FILES}) @@ -27,4 +29,5 @@ list(APPEND CODE_SOURCE_FILES ${SOURCE_GROUP_SOURCE_FILES}) source_group( "ModelVisualization\\Intersections" FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} - ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake) + ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake +) diff --git a/ApplicationLibCode/ModelVisualization/Streamlines/CMakeLists_files.cmake b/ApplicationLibCode/ModelVisualization/Streamlines/CMakeLists_files.cmake index b9ff5c3fb1..1d2ba62e08 100644 --- a/ApplicationLibCode/ModelVisualization/Streamlines/CMakeLists_files.cmake +++ b/ApplicationLibCode/ModelVisualization/Streamlines/CMakeLists_files.cmake @@ -1,7 +1,8 @@ set(SOURCE_GROUP_HEADER_FILES ${CMAKE_CURRENT_LIST_DIR}/RivStreamlinesPartMgr.h) set(SOURCE_GROUP_SOURCE_FILES - ${CMAKE_CURRENT_LIST_DIR}/RivStreamlinesPartMgr.cpp) + ${CMAKE_CURRENT_LIST_DIR}/RivStreamlinesPartMgr.cpp +) list(APPEND CODE_HEADER_FILES ${SOURCE_GROUP_HEADER_FILES}) @@ -10,4 +11,5 @@ list(APPEND CODE_SOURCE_FILES ${SOURCE_GROUP_SOURCE_FILES}) source_group( "ModelVisualization\\Streamlines" FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} - ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake) + ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake +) diff --git a/ApplicationLibCode/ModelVisualization/Surfaces/CMakeLists_files.cmake b/ApplicationLibCode/ModelVisualization/Surfaces/CMakeLists_files.cmake index dff7750c8e..398c6d58a3 100644 --- a/ApplicationLibCode/ModelVisualization/Surfaces/CMakeLists_files.cmake +++ b/ApplicationLibCode/ModelVisualization/Surfaces/CMakeLists_files.cmake @@ -1,12 +1,14 @@ set(SOURCE_GROUP_HEADER_FILES ${CMAKE_CURRENT_LIST_DIR}/RivSurfacePartMgr.h ${CMAKE_CURRENT_LIST_DIR}/RivSurfaceIntersectionGeometryGenerator.h - ${CMAKE_CURRENT_LIST_DIR}/RivReservoirSurfaceIntersectionSourceInfo.h) + ${CMAKE_CURRENT_LIST_DIR}/RivReservoirSurfaceIntersectionSourceInfo.h +) set(SOURCE_GROUP_SOURCE_FILES ${CMAKE_CURRENT_LIST_DIR}/RivSurfacePartMgr.cpp ${CMAKE_CURRENT_LIST_DIR}/RivSurfaceIntersectionGeometryGenerator.cpp - ${CMAKE_CURRENT_LIST_DIR}/RivReservoirSurfaceIntersectionSourceInfo.cpp) + ${CMAKE_CURRENT_LIST_DIR}/RivReservoirSurfaceIntersectionSourceInfo.cpp +) list(APPEND CODE_HEADER_FILES ${SOURCE_GROUP_HEADER_FILES}) @@ -15,4 +17,5 @@ list(APPEND CODE_SOURCE_FILES ${SOURCE_GROUP_SOURCE_FILES}) source_group( "ModelVisualization\\Surfaces" FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} - ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake) + ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake +) diff --git a/ApplicationLibCode/ModelVisualization/WindowEdgeAxesOverlayItem/CMakeLists_files.cmake b/ApplicationLibCode/ModelVisualization/WindowEdgeAxesOverlayItem/CMakeLists_files.cmake index ff49abed8f..ae8ad88b0f 100644 --- a/ApplicationLibCode/ModelVisualization/WindowEdgeAxesOverlayItem/CMakeLists_files.cmake +++ b/ApplicationLibCode/ModelVisualization/WindowEdgeAxesOverlayItem/CMakeLists_files.cmake @@ -1,8 +1,10 @@ set(SOURCE_GROUP_HEADER_FILES - ${CMAKE_CURRENT_LIST_DIR}/RivWindowEdgeAxesOverlayItem.h) + ${CMAKE_CURRENT_LIST_DIR}/RivWindowEdgeAxesOverlayItem.h +) set(SOURCE_GROUP_SOURCE_FILES - ${CMAKE_CURRENT_LIST_DIR}/RivWindowEdgeAxesOverlayItem.cpp) + ${CMAKE_CURRENT_LIST_DIR}/RivWindowEdgeAxesOverlayItem.cpp +) list(APPEND CODE_HEADER_FILES ${SOURCE_GROUP_HEADER_FILES}) @@ -11,4 +13,5 @@ list(APPEND CODE_SOURCE_FILES ${SOURCE_GROUP_SOURCE_FILES}) source_group( "ModelVisualization\\WindowEdgeAxesOverlayItem" FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} - ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake) + ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake +) diff --git a/ApplicationLibCode/ProjectDataModel/AnalysisPlots/CMakeLists_files.cmake b/ApplicationLibCode/ProjectDataModel/AnalysisPlots/CMakeLists_files.cmake index b95599493f..6a1a92f627 100644 --- a/ApplicationLibCode/ProjectDataModel/AnalysisPlots/CMakeLists_files.cmake +++ b/ApplicationLibCode/ProjectDataModel/AnalysisPlots/CMakeLists_files.cmake @@ -3,14 +3,16 @@ set(SOURCE_GROUP_HEADER_FILES ${CMAKE_CURRENT_LIST_DIR}/RimAnalysisPlotDataEntry.h ${CMAKE_CURRENT_LIST_DIR}/RimAnalysisPlotCollection.h ${CMAKE_CURRENT_LIST_DIR}/RimPlotDataFilterCollection.h - ${CMAKE_CURRENT_LIST_DIR}/RimPlotDataFilterItem.h) + ${CMAKE_CURRENT_LIST_DIR}/RimPlotDataFilterItem.h +) set(SOURCE_GROUP_SOURCE_FILES ${CMAKE_CURRENT_LIST_DIR}/RimAnalysisPlot.cpp ${CMAKE_CURRENT_LIST_DIR}/RimAnalysisPlotDataEntry.cpp ${CMAKE_CURRENT_LIST_DIR}/RimAnalysisPlotCollection.cpp ${CMAKE_CURRENT_LIST_DIR}/RimPlotDataFilterCollection.cpp - ${CMAKE_CURRENT_LIST_DIR}/RimPlotDataFilterItem.cpp) + ${CMAKE_CURRENT_LIST_DIR}/RimPlotDataFilterItem.cpp +) list(APPEND CODE_HEADER_FILES ${SOURCE_GROUP_HEADER_FILES}) @@ -21,4 +23,5 @@ list(APPEND QT_MOC_HEADERS) source_group( "ProjectDataModel\\AnalysisPlots" FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} - ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake) + ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake +) diff --git a/ApplicationLibCode/ProjectDataModel/Annotations/CMakeLists_files.cmake b/ApplicationLibCode/ProjectDataModel/Annotations/CMakeLists_files.cmake index d8fc54c87c..4366ff8992 100644 --- a/ApplicationLibCode/ProjectDataModel/Annotations/CMakeLists_files.cmake +++ b/ApplicationLibCode/ProjectDataModel/Annotations/CMakeLists_files.cmake @@ -15,7 +15,8 @@ set(SOURCE_GROUP_HEADER_FILES ${CMAKE_CURRENT_LIST_DIR}/RimReachCircleAnnotationInView.h ${CMAKE_CURRENT_LIST_DIR}/RimTextAnnotationInView.h ${CMAKE_CURRENT_LIST_DIR}/RimAnnotationGroupCollection.h - ${CMAKE_CURRENT_LIST_DIR}/RimPolylineTarget.h) + ${CMAKE_CURRENT_LIST_DIR}/RimPolylineTarget.h +) set(SOURCE_GROUP_SOURCE_FILES ${CMAKE_CURRENT_LIST_DIR}/RimAnnotationCollectionBase.cpp @@ -34,7 +35,8 @@ set(SOURCE_GROUP_SOURCE_FILES ${CMAKE_CURRENT_LIST_DIR}/RimReachCircleAnnotationInView.cpp ${CMAKE_CURRENT_LIST_DIR}/RimTextAnnotationInView.cpp ${CMAKE_CURRENT_LIST_DIR}/RimAnnotationGroupCollection.cpp - ${CMAKE_CURRENT_LIST_DIR}/RimPolylineTarget.cpp) + ${CMAKE_CURRENT_LIST_DIR}/RimPolylineTarget.cpp +) list(APPEND CODE_HEADER_FILES ${SOURCE_GROUP_HEADER_FILES}) @@ -45,4 +47,5 @@ set(QT_MOC_HEADERS ${QT_MOC_HEADERS}) source_group( "ProjectDataModel\\Annotations" FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} - ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake) + ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake +) diff --git a/ApplicationLibCode/ProjectDataModel/CMakeLists_files.cmake b/ApplicationLibCode/ProjectDataModel/CMakeLists_files.cmake index 2703dff253..c63c801856 100644 --- a/ApplicationLibCode/ProjectDataModel/CMakeLists_files.cmake +++ b/ApplicationLibCode/ProjectDataModel/CMakeLists_files.cmake @@ -118,7 +118,8 @@ set(SOURCE_GROUP_HEADER_FILES ${CMAKE_CURRENT_LIST_DIR}/RimPolylinesDataInterface.h ${CMAKE_CURRENT_LIST_DIR}/RimEnsembleCurveSetInterface.h ${CMAKE_CURRENT_LIST_DIR}/cafTreeNode.h - ${CMAKE_CURRENT_LIST_DIR}/RimMultipleLocations.h) + ${CMAKE_CURRENT_LIST_DIR}/RimMultipleLocations.h +) set(SOURCE_GROUP_SOURCE_FILES ${CMAKE_CURRENT_LIST_DIR}/RimEclipseCaseCollection.cpp @@ -235,7 +236,8 @@ set(SOURCE_GROUP_SOURCE_FILES ${CMAKE_CURRENT_LIST_DIR}/RimEquilibriumAxisAnnotation.cpp ${CMAKE_CURRENT_LIST_DIR}/RimTimeAxisAnnotation.cpp ${CMAKE_CURRENT_LIST_DIR}/cafTreeNode.cpp - ${CMAKE_CURRENT_LIST_DIR}/RimMultipleLocations.cpp) + ${CMAKE_CURRENT_LIST_DIR}/RimMultipleLocations.cpp +) if(Qt5Charts_FOUND) list( @@ -245,7 +247,8 @@ if(Qt5Charts_FOUND) ${CMAKE_CURRENT_LIST_DIR}/RimEnsembleFractureStatisticsPlot.h ${CMAKE_CURRENT_LIST_DIR}/RimEnsembleFractureStatisticsPlotCollection.h ${CMAKE_CURRENT_LIST_DIR}/RimGridStatisticsPlotCollection.h - ${CMAKE_CURRENT_LIST_DIR}/RimGridStatisticsPlot.h) + ${CMAKE_CURRENT_LIST_DIR}/RimGridStatisticsPlot.h + ) list( APPEND @@ -254,7 +257,8 @@ if(Qt5Charts_FOUND) ${CMAKE_CURRENT_LIST_DIR}/RimEnsembleFractureStatisticsPlot.cpp ${CMAKE_CURRENT_LIST_DIR}/RimEnsembleFractureStatisticsPlotCollection.cpp ${CMAKE_CURRENT_LIST_DIR}/RimGridStatisticsPlotCollection.cpp - ${CMAKE_CURRENT_LIST_DIR}/RimGridStatisticsPlot.cpp) + ${CMAKE_CURRENT_LIST_DIR}/RimGridStatisticsPlot.cpp + ) endif() list(APPEND CODE_HEADER_FILES ${SOURCE_GROUP_HEADER_FILES}) @@ -266,4 +270,5 @@ list(APPEND QT_MOC_HEADERS ${CMAKE_CURRENT_LIST_DIR}/RimPlot.h) source_group( "ProjectDataModel" FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} - ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake) + ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake +) diff --git a/ApplicationLibCode/ProjectDataModel/CellFilters/CMakeLists_files.cmake b/ApplicationLibCode/ProjectDataModel/CellFilters/CMakeLists_files.cmake index f2a51a0823..c0ed2d0dc4 100644 --- a/ApplicationLibCode/ProjectDataModel/CellFilters/CMakeLists_files.cmake +++ b/ApplicationLibCode/ProjectDataModel/CellFilters/CMakeLists_files.cmake @@ -10,7 +10,8 @@ set(SOURCE_GROUP_HEADER_FILES ${CMAKE_CURRENT_LIST_DIR}/RimGeoMechPropertyFilterCollection.h ${CMAKE_CURRENT_LIST_DIR}/RimPolygonFilter.h ${CMAKE_CURRENT_LIST_DIR}/RimUserDefinedFilter.h - ${CMAKE_CURRENT_LIST_DIR}/RimCellFilterIntervalTool.h) + ${CMAKE_CURRENT_LIST_DIR}/RimCellFilterIntervalTool.h +) set(SOURCE_GROUP_SOURCE_FILES ${CMAKE_CURRENT_LIST_DIR}/RimCellFilter.cpp @@ -24,7 +25,8 @@ set(SOURCE_GROUP_SOURCE_FILES ${CMAKE_CURRENT_LIST_DIR}/RimGeoMechPropertyFilterCollection.cpp ${CMAKE_CURRENT_LIST_DIR}/RimPolygonFilter.cpp ${CMAKE_CURRENT_LIST_DIR}/RimUserDefinedFilter.cpp - ${CMAKE_CURRENT_LIST_DIR}/RimCellFilterIntervalTool.cpp) + ${CMAKE_CURRENT_LIST_DIR}/RimCellFilterIntervalTool.cpp +) list(APPEND CODE_HEADER_FILES ${SOURCE_GROUP_HEADER_FILES}) @@ -33,4 +35,5 @@ list(APPEND CODE_SOURCE_FILES ${SOURCE_GROUP_SOURCE_FILES}) source_group( "ProjectDataModel\\CellFilters" FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} - ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake) + ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake +) diff --git a/ApplicationLibCode/ProjectDataModel/Completions/CMakeLists_files.cmake b/ApplicationLibCode/ProjectDataModel/Completions/CMakeLists_files.cmake index bc04c91a0e..954be3b55a 100644 --- a/ApplicationLibCode/ProjectDataModel/Completions/CMakeLists_files.cmake +++ b/ApplicationLibCode/ProjectDataModel/Completions/CMakeLists_files.cmake @@ -32,7 +32,8 @@ set(SOURCE_GROUP_HEADER_FILES ${CMAKE_CURRENT_LIST_DIR}/RimMultipleValveLocations.h ${CMAKE_CURRENT_LIST_DIR}/RimWellPathAicdParameters.h ${CMAKE_CURRENT_LIST_DIR}/RimEnsembleFractureStatistics.h - ${CMAKE_CURRENT_LIST_DIR}/RimEnsembleFractureStatisticsCollection.h) + ${CMAKE_CURRENT_LIST_DIR}/RimEnsembleFractureStatisticsCollection.h +) set(SOURCE_GROUP_SOURCE_FILES ${CMAKE_CURRENT_LIST_DIR}/RimCompletionCellIntersectionCalc.cpp @@ -65,7 +66,8 @@ set(SOURCE_GROUP_SOURCE_FILES ${CMAKE_CURRENT_LIST_DIR}/RimMultipleValveLocations.cpp ${CMAKE_CURRENT_LIST_DIR}/RimWellPathAicdParameters.cpp ${CMAKE_CURRENT_LIST_DIR}/RimEnsembleFractureStatistics.cpp - ${CMAKE_CURRENT_LIST_DIR}/RimEnsembleFractureStatisticsCollection.cpp) + ${CMAKE_CURRENT_LIST_DIR}/RimEnsembleFractureStatisticsCollection.cpp +) list(APPEND CODE_HEADER_FILES ${SOURCE_GROUP_HEADER_FILES}) @@ -74,4 +76,5 @@ list(APPEND CODE_SOURCE_FILES ${SOURCE_GROUP_SOURCE_FILES}) source_group( "ProjectDataModel\\Completions" FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} - ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake) + ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake +) diff --git a/ApplicationLibCode/ProjectDataModel/CorrelationPlots/CMakeLists_files.cmake b/ApplicationLibCode/ProjectDataModel/CorrelationPlots/CMakeLists_files.cmake index e2c4f64876..6a402f087b 100644 --- a/ApplicationLibCode/ProjectDataModel/CorrelationPlots/CMakeLists_files.cmake +++ b/ApplicationLibCode/ProjectDataModel/CorrelationPlots/CMakeLists_files.cmake @@ -4,7 +4,8 @@ set(SOURCE_GROUP_HEADER_FILES ${CMAKE_CURRENT_LIST_DIR}/RimCorrelationMatrixPlot.h ${CMAKE_CURRENT_LIST_DIR}/RimParameterResultCrossPlot.h ${CMAKE_CURRENT_LIST_DIR}/RimCorrelationPlotCollection.h - ${CMAKE_CURRENT_LIST_DIR}/RimCorrelationReportPlot.h) + ${CMAKE_CURRENT_LIST_DIR}/RimCorrelationReportPlot.h +) set(SOURCE_GROUP_SOURCE_FILES ${CMAKE_CURRENT_LIST_DIR}/RimAbstractCorrelationPlot.cpp @@ -12,7 +13,8 @@ set(SOURCE_GROUP_SOURCE_FILES ${CMAKE_CURRENT_LIST_DIR}/RimCorrelationMatrixPlot.cpp ${CMAKE_CURRENT_LIST_DIR}/RimParameterResultCrossPlot.cpp ${CMAKE_CURRENT_LIST_DIR}/RimCorrelationPlotCollection.cpp - ${CMAKE_CURRENT_LIST_DIR}/RimCorrelationReportPlot.cpp) + ${CMAKE_CURRENT_LIST_DIR}/RimCorrelationReportPlot.cpp +) list(APPEND CODE_HEADER_FILES ${SOURCE_GROUP_HEADER_FILES}) @@ -21,4 +23,5 @@ list(APPEND CODE_SOURCE_FILES ${SOURCE_GROUP_SOURCE_FILES}) source_group( "ProjectDataModel\\CorrelationPlots" FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} - ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake) + ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake +) diff --git a/ApplicationLibCode/ProjectDataModel/Faults/CMakeLists_files.cmake b/ApplicationLibCode/ProjectDataModel/Faults/CMakeLists_files.cmake index d9ba0dc8b4..ab8db4663f 100644 --- a/ApplicationLibCode/ProjectDataModel/Faults/CMakeLists_files.cmake +++ b/ApplicationLibCode/ProjectDataModel/Faults/CMakeLists_files.cmake @@ -3,14 +3,16 @@ set(SOURCE_GROUP_HEADER_FILES ${CMAKE_CURRENT_LIST_DIR}/RimFaultInViewCollection.h ${CMAKE_CURRENT_LIST_DIR}/RimFaultRASettings.h ${CMAKE_CURRENT_LIST_DIR}/RimFaultRAPreprocSettings.h - ${CMAKE_CURRENT_LIST_DIR}/RimFaultRAPostprocSettings.h) + ${CMAKE_CURRENT_LIST_DIR}/RimFaultRAPostprocSettings.h +) set(SOURCE_GROUP_SOURCE_FILES ${CMAKE_CURRENT_LIST_DIR}/RimFaultInView.cpp ${CMAKE_CURRENT_LIST_DIR}/RimFaultInViewCollection.cpp ${CMAKE_CURRENT_LIST_DIR}/RimFaultRASettings.cpp ${CMAKE_CURRENT_LIST_DIR}/RimFaultRAPreprocSettings.cpp - ${CMAKE_CURRENT_LIST_DIR}/RimFaultRAPostprocSettings.cpp) + ${CMAKE_CURRENT_LIST_DIR}/RimFaultRAPostprocSettings.cpp +) list(APPEND CODE_HEADER_FILES ${SOURCE_GROUP_HEADER_FILES}) @@ -19,4 +21,5 @@ list(APPEND CODE_SOURCE_FILES ${SOURCE_GROUP_SOURCE_FILES}) source_group( "ProjectDataModel\\Faults" FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} - ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake) + ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake +) diff --git a/ApplicationLibCode/ProjectDataModel/Flow/CMakeLists_files.cmake b/ApplicationLibCode/ProjectDataModel/Flow/CMakeLists_files.cmake index cb857a350e..9515ebb9a0 100644 --- a/ApplicationLibCode/ProjectDataModel/Flow/CMakeLists_files.cmake +++ b/ApplicationLibCode/ProjectDataModel/Flow/CMakeLists_files.cmake @@ -13,7 +13,8 @@ set(SOURCE_GROUP_HEADER_FILES ${CMAKE_CURRENT_LIST_DIR}/RimWellPlotTools.h ${CMAKE_CURRENT_LIST_DIR}/RimWellRftEnsembleCurveSet.h ${CMAKE_CURRENT_LIST_DIR}/RimWellDistributionPlot.h - ${CMAKE_CURRENT_LIST_DIR}/RimWellDistributionPlotCollection.h) + ${CMAKE_CURRENT_LIST_DIR}/RimWellDistributionPlotCollection.h +) set(SOURCE_GROUP_SOURCE_FILES ${CMAKE_CURRENT_LIST_DIR}/RimFlowDiagSolution.cpp @@ -30,7 +31,8 @@ set(SOURCE_GROUP_SOURCE_FILES ${CMAKE_CURRENT_LIST_DIR}/RimWellPlotTools.cpp ${CMAKE_CURRENT_LIST_DIR}/RimWellRftEnsembleCurveSet.cpp ${CMAKE_CURRENT_LIST_DIR}/RimWellDistributionPlot.cpp - ${CMAKE_CURRENT_LIST_DIR}/RimWellDistributionPlotCollection.cpp) + ${CMAKE_CURRENT_LIST_DIR}/RimWellDistributionPlotCollection.cpp +) list(APPEND CODE_HEADER_FILES ${SOURCE_GROUP_HEADER_FILES}) @@ -39,4 +41,5 @@ list(APPEND CODE_SOURCE_FILES ${SOURCE_GROUP_SOURCE_FILES}) source_group( "ProjectDataModel\\Flow" FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} - ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake) + ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake +) diff --git a/ApplicationLibCode/ProjectDataModel/GeoMech/CMakeLists_files.cmake b/ApplicationLibCode/ProjectDataModel/GeoMech/CMakeLists_files.cmake index 7d0d9655c7..d601f5a1c8 100644 --- a/ApplicationLibCode/ProjectDataModel/GeoMech/CMakeLists_files.cmake +++ b/ApplicationLibCode/ProjectDataModel/GeoMech/CMakeLists_files.cmake @@ -6,7 +6,8 @@ set(SOURCE_GROUP_HEADER_FILES ${CMAKE_CURRENT_LIST_DIR}/RimGeoMechCellColors.h ${CMAKE_CURRENT_LIST_DIR}/RimGeoMechContourMapProjection.h ${CMAKE_CURRENT_LIST_DIR}/RimGeoMechContourMapView.h - ${CMAKE_CURRENT_LIST_DIR}/RimGeoMechContourMapViewCollection.h) + ${CMAKE_CURRENT_LIST_DIR}/RimGeoMechContourMapViewCollection.h +) set(SOURCE_GROUP_SOURCE_FILES ${CMAKE_CURRENT_LIST_DIR}/RimGeoMechModels.cpp @@ -16,7 +17,8 @@ set(SOURCE_GROUP_SOURCE_FILES ${CMAKE_CURRENT_LIST_DIR}/RimGeoMechCellColors.cpp ${CMAKE_CURRENT_LIST_DIR}/RimGeoMechContourMapProjection.cpp ${CMAKE_CURRENT_LIST_DIR}/RimGeoMechContourMapView.cpp - ${CMAKE_CURRENT_LIST_DIR}/RimGeoMechContourMapViewCollection.cpp) + ${CMAKE_CURRENT_LIST_DIR}/RimGeoMechContourMapViewCollection.cpp +) list(APPEND CODE_HEADER_FILES ${SOURCE_GROUP_HEADER_FILES}) @@ -25,4 +27,5 @@ list(APPEND CODE_SOURCE_FILES ${SOURCE_GROUP_SOURCE_FILES}) source_group( "ProjectDataModel\\GeoMech" FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} - ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake) + ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake +) diff --git a/ApplicationLibCode/ProjectDataModel/GridCrossPlots/CMakeLists_files.cmake b/ApplicationLibCode/ProjectDataModel/GridCrossPlots/CMakeLists_files.cmake index 183e80fb17..aff355e8c0 100644 --- a/ApplicationLibCode/ProjectDataModel/GridCrossPlots/CMakeLists_files.cmake +++ b/ApplicationLibCode/ProjectDataModel/GridCrossPlots/CMakeLists_files.cmake @@ -4,7 +4,8 @@ set(SOURCE_GROUP_HEADER_FILES ${CMAKE_CURRENT_LIST_DIR}/RimGridCrossPlotCurve.h ${CMAKE_CURRENT_LIST_DIR}/RimGridCrossPlotDataSet.h ${CMAKE_CURRENT_LIST_DIR}/RimSaturationPressurePlot.h - ${CMAKE_CURRENT_LIST_DIR}/RimSaturationPressurePlotCollection.h) + ${CMAKE_CURRENT_LIST_DIR}/RimSaturationPressurePlotCollection.h +) set(SOURCE_GROUP_SOURCE_FILES ${CMAKE_CURRENT_LIST_DIR}/RimGridCrossPlot.cpp @@ -12,7 +13,8 @@ set(SOURCE_GROUP_SOURCE_FILES ${CMAKE_CURRENT_LIST_DIR}/RimGridCrossPlotCurve.cpp ${CMAKE_CURRENT_LIST_DIR}/RimGridCrossPlotDataSet.cpp ${CMAKE_CURRENT_LIST_DIR}/RimSaturationPressurePlot.cpp - ${CMAKE_CURRENT_LIST_DIR}/RimSaturationPressurePlotCollection.cpp) + ${CMAKE_CURRENT_LIST_DIR}/RimSaturationPressurePlotCollection.cpp +) list(APPEND CODE_HEADER_FILES ${SOURCE_GROUP_HEADER_FILES}) @@ -23,4 +25,5 @@ list(APPEND QT_MOC_HEADERS ${CMAKE_CURRENT_LIST_DIR}/RimGridCrossPlot.h) source_group( "ProjectDataModel\\GridCrossPlots" FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} - ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake) + ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake +) diff --git a/ApplicationLibCode/ProjectDataModel/GridCrossPlots/CellFilters/CMakeLists_files.cmake b/ApplicationLibCode/ProjectDataModel/GridCrossPlots/CellFilters/CMakeLists_files.cmake index 8fb9453e7b..52dcbe9860 100644 --- a/ApplicationLibCode/ProjectDataModel/GridCrossPlots/CellFilters/CMakeLists_files.cmake +++ b/ApplicationLibCode/ProjectDataModel/GridCrossPlots/CellFilters/CMakeLists_files.cmake @@ -1,12 +1,14 @@ set(SOURCE_GROUP_HEADER_FILES ${CMAKE_CURRENT_LIST_DIR}/RimPlotCellFilter.h ${CMAKE_CURRENT_LIST_DIR}/RimPlotCellFilterCollection.h - ${CMAKE_CURRENT_LIST_DIR}/RimPlotCellPropertyFilter.h) + ${CMAKE_CURRENT_LIST_DIR}/RimPlotCellPropertyFilter.h +) set(SOURCE_GROUP_SOURCE_FILES ${CMAKE_CURRENT_LIST_DIR}/RimPlotCellFilter.cpp ${CMAKE_CURRENT_LIST_DIR}/RimPlotCellFilterCollection.cpp - ${CMAKE_CURRENT_LIST_DIR}/RimPlotCellPropertyFilter.cpp) + ${CMAKE_CURRENT_LIST_DIR}/RimPlotCellPropertyFilter.cpp +) list(APPEND CODE_HEADER_FILES ${SOURCE_GROUP_HEADER_FILES}) @@ -15,4 +17,5 @@ list(APPEND CODE_SOURCE_FILES ${SOURCE_GROUP_SOURCE_FILES}) source_group( "ProjectDataModel\\GridCrossPlots\\CellFilters" FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} - ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake) + ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake +) diff --git a/ApplicationLibCode/ProjectDataModel/Measurement/CMakeLists_files.cmake b/ApplicationLibCode/ProjectDataModel/Measurement/CMakeLists_files.cmake index 60e00c38a2..b45bc96890 100644 --- a/ApplicationLibCode/ProjectDataModel/Measurement/CMakeLists_files.cmake +++ b/ApplicationLibCode/ProjectDataModel/Measurement/CMakeLists_files.cmake @@ -1,19 +1,23 @@ set(SOURCE_GROUP_HEADER_FILES ${CMAKE_CURRENT_LIST_DIR}/RimMeasurement.h - ${CMAKE_CURRENT_LIST_DIR}/RiuMeasurementEventFilter.h) + ${CMAKE_CURRENT_LIST_DIR}/RiuMeasurementEventFilter.h +) set(SOURCE_GROUP_SOURCE_FILES ${CMAKE_CURRENT_LIST_DIR}/RimMeasurement.cpp - ${CMAKE_CURRENT_LIST_DIR}/RiuMeasurementEventFilter.cpp) + ${CMAKE_CURRENT_LIST_DIR}/RiuMeasurementEventFilter.cpp +) list(APPEND CODE_HEADER_FILES ${SOURCE_GROUP_HEADER_FILES}) list(APPEND CODE_SOURCE_FILES ${SOURCE_GROUP_SOURCE_FILES}) set(QT_MOC_HEADERS ${CMAKE_CURRENT_LIST_DIR}/RiuMeasurementEventFilter.h - ${QT_MOC_HEADERS}) + ${QT_MOC_HEADERS} +) source_group( "ProjectDataModel\\Measurement" FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} - ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake) + ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake +) diff --git a/ApplicationLibCode/ProjectDataModel/Parameters/CMakeLists_files.cmake b/ApplicationLibCode/ProjectDataModel/Parameters/CMakeLists_files.cmake index 754f207cf6..9e0b78d1be 100644 --- a/ApplicationLibCode/ProjectDataModel/Parameters/CMakeLists_files.cmake +++ b/ApplicationLibCode/ProjectDataModel/Parameters/CMakeLists_files.cmake @@ -3,14 +3,16 @@ set(SOURCE_GROUP_HEADER_FILES ${CMAKE_CURRENT_LIST_DIR}/RimDoubleParameter.h ${CMAKE_CURRENT_LIST_DIR}/RimIntegerParameter.h ${CMAKE_CURRENT_LIST_DIR}/RimStringParameter.h - ${CMAKE_CURRENT_LIST_DIR}/RimParameterGroup.h) + ${CMAKE_CURRENT_LIST_DIR}/RimParameterGroup.h +) set(SOURCE_GROUP_SOURCE_FILES ${CMAKE_CURRENT_LIST_DIR}/RimGenericParameter.cpp ${CMAKE_CURRENT_LIST_DIR}/RimDoubleParameter.cpp ${CMAKE_CURRENT_LIST_DIR}/RimIntegerParameter.cpp ${CMAKE_CURRENT_LIST_DIR}/RimStringParameter.cpp - ${CMAKE_CURRENT_LIST_DIR}/RimParameterGroup.cpp) + ${CMAKE_CURRENT_LIST_DIR}/RimParameterGroup.cpp +) list(APPEND CODE_HEADER_FILES ${SOURCE_GROUP_HEADER_FILES}) @@ -19,4 +21,5 @@ list(APPEND CODE_SOURCE_FILES ${SOURCE_GROUP_SOURCE_FILES}) source_group( "ProjectDataModel\\Parameters" FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} - ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake) + ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake +) diff --git a/ApplicationLibCode/ProjectDataModel/PlotTemplates/CMakeLists_files.cmake b/ApplicationLibCode/ProjectDataModel/PlotTemplates/CMakeLists_files.cmake index 715ee167c8..2362866b95 100644 --- a/ApplicationLibCode/ProjectDataModel/PlotTemplates/CMakeLists_files.cmake +++ b/ApplicationLibCode/ProjectDataModel/PlotTemplates/CMakeLists_files.cmake @@ -1,10 +1,12 @@ set(SOURCE_GROUP_HEADER_FILES ${CMAKE_CURRENT_LIST_DIR}/RimPlotTemplateFolderItem.h - ${CMAKE_CURRENT_LIST_DIR}/RimPlotTemplateFileItem.h) + ${CMAKE_CURRENT_LIST_DIR}/RimPlotTemplateFileItem.h +) set(SOURCE_GROUP_SOURCE_FILES ${CMAKE_CURRENT_LIST_DIR}/RimPlotTemplateFolderItem.cpp - ${CMAKE_CURRENT_LIST_DIR}/RimPlotTemplateFileItem.cpp) + ${CMAKE_CURRENT_LIST_DIR}/RimPlotTemplateFileItem.cpp +) list(APPEND CODE_HEADER_FILES ${SOURCE_GROUP_HEADER_FILES}) @@ -13,4 +15,5 @@ list(APPEND CODE_SOURCE_FILES ${SOURCE_GROUP_SOURCE_FILES}) source_group( "ProjectDataModel\\PlotTemplates" FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} - ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake) + ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake +) diff --git a/ApplicationLibCode/ProjectDataModel/ProcessControl/CMakeLists_files.cmake b/ApplicationLibCode/ProjectDataModel/ProcessControl/CMakeLists_files.cmake index d57d70f196..c31e5d13da 100644 --- a/ApplicationLibCode/ProjectDataModel/ProcessControl/CMakeLists_files.cmake +++ b/ApplicationLibCode/ProjectDataModel/ProcessControl/CMakeLists_files.cmake @@ -1,17 +1,21 @@ set(SOURCE_GROUP_HEADER_FILES ${CMAKE_CURRENT_LIST_DIR}/RimProcess.h - ${CMAKE_CURRENT_LIST_DIR}/RimProcessMonitor.h) + ${CMAKE_CURRENT_LIST_DIR}/RimProcessMonitor.h +) set(SOURCE_GROUP_SOURCE_FILES ${CMAKE_CURRENT_LIST_DIR}/RimProcess.cpp - ${CMAKE_CURRENT_LIST_DIR}/RimProcessMonitor.cpp) + ${CMAKE_CURRENT_LIST_DIR}/RimProcessMonitor.cpp +) list(APPEND CODE_HEADER_FILES ${SOURCE_GROUP_HEADER_FILES}) list(APPEND CODE_SOURCE_FILES ${SOURCE_GROUP_SOURCE_FILES}) list(APPEND COMMAND_QT_MOC_HEADERS - ${CMAKE_CURRENT_LIST_DIR}/RimProcessMonitor.h) + ${CMAKE_CURRENT_LIST_DIR}/RimProcessMonitor.h +) source_group( "ProjectDataModel\\ProcessControl" FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} - ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake) + ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake +) diff --git a/ApplicationLibCode/ProjectDataModel/StimPlanModel/CMakeLists_files.cmake b/ApplicationLibCode/ProjectDataModel/StimPlanModel/CMakeLists_files.cmake index ed59f7aacc..9231aa59e8 100644 --- a/ApplicationLibCode/ProjectDataModel/StimPlanModel/CMakeLists_files.cmake +++ b/ApplicationLibCode/ProjectDataModel/StimPlanModel/CMakeLists_files.cmake @@ -22,7 +22,8 @@ set(SOURCE_GROUP_HEADER_FILES ${CMAKE_CURRENT_LIST_DIR}/RimFaciesInitialPressureConfig.h ${CMAKE_CURRENT_LIST_DIR}/RimPressureTableItem.h ${CMAKE_CURRENT_LIST_DIR}/RimPressureTable.h - ${CMAKE_CURRENT_LIST_DIR}/RimExtractionConfiguration.h) + ${CMAKE_CURRENT_LIST_DIR}/RimExtractionConfiguration.h +) set(SOURCE_GROUP_SOURCE_FILES ${CMAKE_CURRENT_LIST_DIR}/RimStimPlanModelCollection.cpp @@ -46,7 +47,8 @@ set(SOURCE_GROUP_SOURCE_FILES ${CMAKE_CURRENT_LIST_DIR}/RimFaciesInitialPressureConfig.cpp ${CMAKE_CURRENT_LIST_DIR}/RimPressureTableItem.cpp ${CMAKE_CURRENT_LIST_DIR}/RimPressureTable.cpp - ${CMAKE_CURRENT_LIST_DIR}/RimExtractionConfiguration.cpp) + ${CMAKE_CURRENT_LIST_DIR}/RimExtractionConfiguration.cpp +) list(APPEND CODE_HEADER_FILES ${SOURCE_GROUP_HEADER_FILES}) @@ -57,4 +59,5 @@ list(APPEND QT_MOC_HEADERS) source_group( "ProjectDataModel\\StimPlanModel" FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} - ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake) + ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake +) diff --git a/ApplicationLibCode/ProjectDataModel/Streamlines/CMakeLists_files.cmake b/ApplicationLibCode/ProjectDataModel/Streamlines/CMakeLists_files.cmake index 2eab9b148e..17fe7accae 100644 --- a/ApplicationLibCode/ProjectDataModel/Streamlines/CMakeLists_files.cmake +++ b/ApplicationLibCode/ProjectDataModel/Streamlines/CMakeLists_files.cmake @@ -3,14 +3,16 @@ set(SOURCE_GROUP_HEADER_FILES ${CMAKE_CURRENT_LIST_DIR}/RimStreamlineInViewCollection.h ${CMAKE_CURRENT_LIST_DIR}/RimStreamlineGeneratorBase.h ${CMAKE_CURRENT_LIST_DIR}/RimStreamlineDataAccess.h - ${CMAKE_CURRENT_LIST_DIR}/RimStreamlineGenerator.h) + ${CMAKE_CURRENT_LIST_DIR}/RimStreamlineGenerator.h +) set(SOURCE_GROUP_SOURCE_FILES ${CMAKE_CURRENT_LIST_DIR}/RimStreamline.cpp ${CMAKE_CURRENT_LIST_DIR}/RimStreamlineInViewCollection.cpp ${CMAKE_CURRENT_LIST_DIR}/RimStreamlineGeneratorBase.cpp ${CMAKE_CURRENT_LIST_DIR}/RimStreamlineDataAccess.cpp - ${CMAKE_CURRENT_LIST_DIR}/RimStreamlineGenerator.cpp) + ${CMAKE_CURRENT_LIST_DIR}/RimStreamlineGenerator.cpp +) list(APPEND CODE_HEADER_FILES ${SOURCE_GROUP_HEADER_FILES}) @@ -19,4 +21,5 @@ list(APPEND CODE_SOURCE_FILES ${SOURCE_GROUP_SOURCE_FILES}) source_group( "ProjectDataModel\\Streamlines" FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} - ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake) + ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake +) diff --git a/ApplicationLibCode/ProjectDataModel/Summary/CMakeLists_files.cmake b/ApplicationLibCode/ProjectDataModel/Summary/CMakeLists_files.cmake index d99a3e7f29..a3d2865cd9 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/CMakeLists_files.cmake +++ b/ApplicationLibCode/ProjectDataModel/Summary/CMakeLists_files.cmake @@ -37,7 +37,8 @@ set(SOURCE_GROUP_HEADER_FILES ${CMAKE_CURRENT_LIST_DIR}/RimDerivedEnsembleCaseCollection.h ${CMAKE_CURRENT_LIST_DIR}/RimSummaryPlotFilterTextCurveSetEditor.h ${CMAKE_CURRENT_LIST_DIR}/RimObjectiveFunction.h - ${CMAKE_CURRENT_LIST_DIR}/RimObjectiveFunctionTools.h) + ${CMAKE_CURRENT_LIST_DIR}/RimObjectiveFunctionTools.h +) set(SOURCE_GROUP_SOURCE_FILES ${CMAKE_CURRENT_LIST_DIR}/RimAsciiDataCurve.cpp @@ -78,7 +79,8 @@ set(SOURCE_GROUP_SOURCE_FILES ${CMAKE_CURRENT_LIST_DIR}/RimDerivedEnsembleCaseCollection.cpp ${CMAKE_CURRENT_LIST_DIR}/RimSummaryPlotFilterTextCurveSetEditor.cpp ${CMAKE_CURRENT_LIST_DIR}/RimObjectiveFunction.cpp - ${CMAKE_CURRENT_LIST_DIR}/RimObjectiveFunctionTools.cpp) + ${CMAKE_CURRENT_LIST_DIR}/RimObjectiveFunctionTools.cpp +) list(APPEND CODE_HEADER_FILES ${SOURCE_GROUP_HEADER_FILES}) @@ -89,4 +91,5 @@ list(APPEND QT_MOC_HEADERS ${CMAKE_CURRENT_LIST_DIR}/RimSummaryPlot.h) source_group( "ProjectDataModel\\Summary" FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} - ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake) + ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake +) diff --git a/ApplicationLibCode/ProjectDataModel/Surfaces/CMakeLists_files.cmake b/ApplicationLibCode/ProjectDataModel/Surfaces/CMakeLists_files.cmake index 4a68972f81..0c0f77d3a3 100644 --- a/ApplicationLibCode/ProjectDataModel/Surfaces/CMakeLists_files.cmake +++ b/ApplicationLibCode/ProjectDataModel/Surfaces/CMakeLists_files.cmake @@ -8,7 +8,8 @@ set(SOURCE_GROUP_HEADER_FILES ${CMAKE_CURRENT_LIST_DIR}/RimSurfaceResultDefinition.h ${CMAKE_CURRENT_LIST_DIR}/RimEnsembleSurface.h ${CMAKE_CURRENT_LIST_DIR}/RimEnsembleSurfaceInView.h - ${CMAKE_CURRENT_LIST_DIR}/RimEnsembleStatisticsSurface.h) + ${CMAKE_CURRENT_LIST_DIR}/RimEnsembleStatisticsSurface.h +) set(SOURCE_GROUP_SOURCE_FILES ${CMAKE_CURRENT_LIST_DIR}/RimSurface.cpp @@ -20,7 +21,8 @@ set(SOURCE_GROUP_SOURCE_FILES ${CMAKE_CURRENT_LIST_DIR}/RimSurfaceResultDefinition.cpp ${CMAKE_CURRENT_LIST_DIR}/RimEnsembleSurface.cpp ${CMAKE_CURRENT_LIST_DIR}/RimEnsembleSurfaceInView.cpp - ${CMAKE_CURRENT_LIST_DIR}/RimEnsembleStatisticsSurface.cpp) + ${CMAKE_CURRENT_LIST_DIR}/RimEnsembleStatisticsSurface.cpp +) list(APPEND CODE_HEADER_FILES ${SOURCE_GROUP_HEADER_FILES}) @@ -29,4 +31,5 @@ list(APPEND CODE_SOURCE_FILES ${SOURCE_GROUP_SOURCE_FILES}) source_group( "ProjectDataModel\\Surface" FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} - ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake) + ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake +) diff --git a/ApplicationLibCode/ProjectDataModel/WellLog/CMakeLists_files.cmake b/ApplicationLibCode/ProjectDataModel/WellLog/CMakeLists_files.cmake index 700caf1597..861abfda47 100644 --- a/ApplicationLibCode/ProjectDataModel/WellLog/CMakeLists_files.cmake +++ b/ApplicationLibCode/ProjectDataModel/WellLog/CMakeLists_files.cmake @@ -22,7 +22,8 @@ set(SOURCE_GROUP_HEADER_FILES ${CMAKE_CURRENT_LIST_DIR}/RimWellLogFileChannel.h ${CMAKE_CURRENT_LIST_DIR}/RimWellLogFileCurve.h ${CMAKE_CURRENT_LIST_DIR}/RimWellLogRftCurve.h - ${CMAKE_CURRENT_LIST_DIR}/RimWellLogWbsCurve.h) + ${CMAKE_CURRENT_LIST_DIR}/RimWellLogWbsCurve.h +) set(SOURCE_GROUP_SOURCE_FILES ${CMAKE_CURRENT_LIST_DIR}/RimWellLogPlotCollection.cpp @@ -48,7 +49,8 @@ set(SOURCE_GROUP_SOURCE_FILES ${CMAKE_CURRENT_LIST_DIR}/RimEnsembleWellLogsCollection.cpp ${CMAKE_CURRENT_LIST_DIR}/RimEnsembleWellLogCurveSet.cpp ${CMAKE_CURRENT_LIST_DIR}/RimEnsembleWellLogStatistics.cpp - ${CMAKE_CURRENT_LIST_DIR}/RimEnsembleWellLogStatisticsCurve.cpp) + ${CMAKE_CURRENT_LIST_DIR}/RimEnsembleWellLogStatisticsCurve.cpp +) list(APPEND CODE_HEADER_FILES ${SOURCE_GROUP_HEADER_FILES}) @@ -57,4 +59,5 @@ list(APPEND CODE_SOURCE_FILES ${SOURCE_GROUP_SOURCE_FILES}) source_group( "ProjectDataModel\\WellLog" FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} - ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake) + ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake +) diff --git a/ApplicationLibCode/ProjectDataModel/WellMeasurement/CMakeLists_files.cmake b/ApplicationLibCode/ProjectDataModel/WellMeasurement/CMakeLists_files.cmake index c09e374409..cc215728d6 100644 --- a/ApplicationLibCode/ProjectDataModel/WellMeasurement/CMakeLists_files.cmake +++ b/ApplicationLibCode/ProjectDataModel/WellMeasurement/CMakeLists_files.cmake @@ -5,7 +5,8 @@ set(SOURCE_GROUP_HEADER_FILES ${CMAKE_CURRENT_LIST_DIR}/RimWellMeasurementCurve.h ${CMAKE_CURRENT_LIST_DIR}/RimWellMeasurementFilter.h ${CMAKE_CURRENT_LIST_DIR}/RimWellMeasurementInViewCollection.h - ${CMAKE_CURRENT_LIST_DIR}/RimWellMeasurementInView.h) + ${CMAKE_CURRENT_LIST_DIR}/RimWellMeasurementInView.h +) set(SOURCE_GROUP_SOURCE_FILES ${CMAKE_CURRENT_LIST_DIR}/RimWellMeasurement.cpp @@ -14,7 +15,8 @@ set(SOURCE_GROUP_SOURCE_FILES ${CMAKE_CURRENT_LIST_DIR}/RimWellMeasurementCurve.cpp ${CMAKE_CURRENT_LIST_DIR}/RimWellMeasurementFilter.cpp ${CMAKE_CURRENT_LIST_DIR}/RimWellMeasurementInViewCollection.cpp - ${CMAKE_CURRENT_LIST_DIR}/RimWellMeasurementInView.cpp) + ${CMAKE_CURRENT_LIST_DIR}/RimWellMeasurementInView.cpp +) list(APPEND CODE_HEADER_FILES ${SOURCE_GROUP_HEADER_FILES}) @@ -23,4 +25,5 @@ list(APPEND CODE_SOURCE_FILES ${SOURCE_GROUP_SOURCE_FILES}) source_group( "ProjectDataModel\\WellMeasurement" FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} - ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake) + ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake +) diff --git a/ApplicationLibCode/ProjectDataModel/WellPath/CMakeLists_files.cmake b/ApplicationLibCode/ProjectDataModel/WellPath/CMakeLists_files.cmake index a9cf725ac1..625611c03e 100644 --- a/ApplicationLibCode/ProjectDataModel/WellPath/CMakeLists_files.cmake +++ b/ApplicationLibCode/ProjectDataModel/WellPath/CMakeLists_files.cmake @@ -9,7 +9,8 @@ set(SOURCE_GROUP_HEADER_FILES ${CMAKE_CURRENT_LIST_DIR}/RimWellPathAttributeCollection.h ${CMAKE_CURRENT_LIST_DIR}/RimWellPathCollection.h ${CMAKE_CURRENT_LIST_DIR}/RimWellPathTarget.h - ${CMAKE_CURRENT_LIST_DIR}/RimWellPathTieIn.h) + ${CMAKE_CURRENT_LIST_DIR}/RimWellPathTieIn.h +) set(SOURCE_GROUP_SOURCE_FILES ${CMAKE_CURRENT_LIST_DIR}/RimFileWellPath.cpp @@ -22,7 +23,8 @@ set(SOURCE_GROUP_SOURCE_FILES ${CMAKE_CURRENT_LIST_DIR}/RimWellPathGeometryDefTools.cpp ${CMAKE_CURRENT_LIST_DIR}/RimWellPathGroup.cpp ${CMAKE_CURRENT_LIST_DIR}/RimWellPathTarget.cpp - ${CMAKE_CURRENT_LIST_DIR}/RimWellPathTieIn.cpp) + ${CMAKE_CURRENT_LIST_DIR}/RimWellPathTieIn.cpp +) list(APPEND CODE_HEADER_FILES ${SOURCE_GROUP_HEADER_FILES}) @@ -31,4 +33,5 @@ list(APPEND CODE_SOURCE_FILES ${SOURCE_GROUP_SOURCE_FILES}) source_group( "ProjectDataModel\\WellPath" FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} - ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake) + ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake +) diff --git a/ApplicationLibCode/ProjectDataModelCommands/CMakeLists_files.cmake b/ApplicationLibCode/ProjectDataModelCommands/CMakeLists_files.cmake index a2df2997b0..0a6f3daada 100644 --- a/ApplicationLibCode/ProjectDataModelCommands/CMakeLists_files.cmake +++ b/ApplicationLibCode/ProjectDataModelCommands/CMakeLists_files.cmake @@ -17,7 +17,8 @@ set(SOURCE_GROUP_HEADER_FILES ${CMAKE_CURRENT_LIST_DIR}/RimcWellLogPlot.h ${CMAKE_CURRENT_LIST_DIR}/RimcWellLogTrack.h ${CMAKE_CURRENT_LIST_DIR}/RimcWellPathGeometryDef.h - ${CMAKE_CURRENT_LIST_DIR}/RimcModeledWellPath.h) + ${CMAKE_CURRENT_LIST_DIR}/RimcModeledWellPath.h +) set(SOURCE_GROUP_SOURCE_FILES ${CMAKE_CURRENT_LIST_DIR}/RimcSummaryPlotCollection.cpp @@ -38,7 +39,8 @@ set(SOURCE_GROUP_SOURCE_FILES ${CMAKE_CURRENT_LIST_DIR}/RimcWellLogPlot.cpp ${CMAKE_CURRENT_LIST_DIR}/RimcWellLogTrack.cpp ${CMAKE_CURRENT_LIST_DIR}/RimcWellPathGeometryDef.cpp - ${CMAKE_CURRENT_LIST_DIR}/RimcModeledWellPath.cpp) + ${CMAKE_CURRENT_LIST_DIR}/RimcModeledWellPath.cpp +) list(APPEND CODE_HEADER_FILES ${SOURCE_GROUP_HEADER_FILES}) @@ -47,4 +49,5 @@ list(APPEND CODE_SOURCE_FILES ${SOURCE_GROUP_SOURCE_FILES}) source_group( "ProjectDataModelCommands" FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} - ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake) + ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake +) diff --git a/ApplicationLibCode/ProjectDataModelCommands/CommandRouter/CMakeLists_files.cmake b/ApplicationLibCode/ProjectDataModelCommands/CommandRouter/CMakeLists_files.cmake index 7e8524ddaa..d7fc5659af 100644 --- a/ApplicationLibCode/ProjectDataModelCommands/CommandRouter/CMakeLists_files.cmake +++ b/ApplicationLibCode/ProjectDataModelCommands/CommandRouter/CMakeLists_files.cmake @@ -1,8 +1,10 @@ set(SOURCE_GROUP_HEADER_FILES ${CMAKE_CURRENT_LIST_DIR}/RimCommandRouter.h - ${CMAKE_CURRENT_LIST_DIR}/RimcExtractSurfaces.h) + ${CMAKE_CURRENT_LIST_DIR}/RimcExtractSurfaces.h +) set(SOURCE_GROUP_SOURCE_FILES ${CMAKE_CURRENT_LIST_DIR}/RimCommandRouter.cpp - ${CMAKE_CURRENT_LIST_DIR}/RimcExtractSurfaces.cpp) + ${CMAKE_CURRENT_LIST_DIR}/RimcExtractSurfaces.cpp +) list(APPEND CODE_HEADER_FILES ${SOURCE_GROUP_HEADER_FILES}) @@ -11,4 +13,5 @@ list(APPEND CODE_SOURCE_FILES ${SOURCE_GROUP_SOURCE_FILES}) source_group( "ProjectDataModelCommands\\CommandRouter" FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} - ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake) + ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake +) diff --git a/ApplicationLibCode/ReservoirDataModel/CMakeLists_files.cmake b/ApplicationLibCode/ReservoirDataModel/CMakeLists_files.cmake index c8ad0a11ff..86ebebf947 100644 --- a/ApplicationLibCode/ReservoirDataModel/CMakeLists_files.cmake +++ b/ApplicationLibCode/ReservoirDataModel/CMakeLists_files.cmake @@ -90,7 +90,8 @@ set(SOURCE_GROUP_HEADER_FILES ${CMAKE_CURRENT_LIST_DIR}/RigEnsembleParameter.h ${CMAKE_CURRENT_LIST_DIR}/RigSurfaceResampler.h ${CMAKE_CURRENT_LIST_DIR}/RigSurfaceStatisticsCalculator.h - ${CMAKE_CURRENT_LIST_DIR}/RigWellLogIndexDepthOffset.h) + ${CMAKE_CURRENT_LIST_DIR}/RigWellLogIndexDepthOffset.h +) set(SOURCE_GROUP_SOURCE_FILES ${CMAKE_CURRENT_LIST_DIR}/RigActiveCellInfo.cpp @@ -177,7 +178,8 @@ set(SOURCE_GROUP_SOURCE_FILES ${CMAKE_CURRENT_LIST_DIR}/RigEnsembleParameter.cpp ${CMAKE_CURRENT_LIST_DIR}/RigSurfaceResampler.cpp ${CMAKE_CURRENT_LIST_DIR}/RigSurfaceStatisticsCalculator.cpp - ${CMAKE_CURRENT_LIST_DIR}/RigWellLogIndexDepthOffset.cpp) + ${CMAKE_CURRENT_LIST_DIR}/RigWellLogIndexDepthOffset.cpp +) list(APPEND CODE_HEADER_FILES ${SOURCE_GROUP_HEADER_FILES}) @@ -186,4 +188,5 @@ list(APPEND CODE_SOURCE_FILES ${SOURCE_GROUP_SOURCE_FILES}) source_group( "ReservoirDataModel" FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} - ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake) + ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake +) diff --git a/ApplicationLibCode/ReservoirDataModel/CMakeLists_filesNotToUnitTest.cmake b/ApplicationLibCode/ReservoirDataModel/CMakeLists_filesNotToUnitTest.cmake index a7627cfcc7..db93b2faa9 100644 --- a/ApplicationLibCode/ReservoirDataModel/CMakeLists_filesNotToUnitTest.cmake +++ b/ApplicationLibCode/ReservoirDataModel/CMakeLists_filesNotToUnitTest.cmake @@ -5,7 +5,8 @@ set(SOURCE_GROUP_HEADER_FILES ${CMAKE_CURRENT_LIST_DIR}/RigCaseToCaseRangeFilterMapper.h ${CMAKE_CURRENT_LIST_DIR}/RigSimulationWellCenterLineCalculator.h ${CMAKE_CURRENT_LIST_DIR}/RigWellLogFile.h - ${CMAKE_CURRENT_LIST_DIR}/RigReservoirGridTools.h) + ${CMAKE_CURRENT_LIST_DIR}/RigReservoirGridTools.h +) set(SOURCE_GROUP_SOURCE_FILES ${CMAKE_CURRENT_LIST_DIR}/RigGeoMechWellLogExtractor.cpp @@ -14,7 +15,8 @@ set(SOURCE_GROUP_SOURCE_FILES ${CMAKE_CURRENT_LIST_DIR}/RigCaseToCaseRangeFilterMapper.cpp ${CMAKE_CURRENT_LIST_DIR}/RigSimulationWellCenterLineCalculator.cpp ${CMAKE_CURRENT_LIST_DIR}/RigWellLogFile.cpp - ${CMAKE_CURRENT_LIST_DIR}/RigReservoirGridTools.cpp) + ${CMAKE_CURRENT_LIST_DIR}/RigReservoirGridTools.cpp +) list(APPEND CODE_HEADER_FILES ${SOURCE_GROUP_HEADER_FILES}) @@ -23,4 +25,5 @@ list(APPEND CODE_SOURCE_FILES ${SOURCE_GROUP_SOURCE_FILES}) source_group( "ReservoirDataModel2" FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} - ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_filesNotToUnitTest.cmake) + ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_filesNotToUnitTest.cmake +) diff --git a/ApplicationLibCode/ReservoirDataModel/Completions/CMakeLists_files.cmake b/ApplicationLibCode/ReservoirDataModel/Completions/CMakeLists_files.cmake index 7a7db8a6bd..b4ba15d3d4 100644 --- a/ApplicationLibCode/ReservoirDataModel/Completions/CMakeLists_files.cmake +++ b/ApplicationLibCode/ReservoirDataModel/Completions/CMakeLists_files.cmake @@ -7,7 +7,8 @@ set(SOURCE_GROUP_HEADER_FILES ${CMAKE_CURRENT_LIST_DIR}/RigWellPathStimplanIntersector.h ${CMAKE_CURRENT_LIST_DIR}/RigVirtualPerforationTransmissibilities.h ${CMAKE_CURRENT_LIST_DIR}/RigEclipseToStimPlanCalculator.h - ${CMAKE_CURRENT_LIST_DIR}/RigPerforationTransmissibilityEquations.h) + ${CMAKE_CURRENT_LIST_DIR}/RigPerforationTransmissibilityEquations.h +) set(SOURCE_GROUP_SOURCE_FILES ${CMAKE_CURRENT_LIST_DIR}/RigCompletionData.cpp @@ -18,7 +19,8 @@ set(SOURCE_GROUP_SOURCE_FILES ${CMAKE_CURRENT_LIST_DIR}/RigWellPathStimplanIntersector.cpp ${CMAKE_CURRENT_LIST_DIR}/RigVirtualPerforationTransmissibilities.cpp ${CMAKE_CURRENT_LIST_DIR}/RigEclipseToStimPlanCalculator.cpp - ${CMAKE_CURRENT_LIST_DIR}/RigPerforationTransmissibilityEquations.cpp) + ${CMAKE_CURRENT_LIST_DIR}/RigPerforationTransmissibilityEquations.cpp +) list(APPEND CODE_HEADER_FILES ${SOURCE_GROUP_HEADER_FILES}) @@ -27,4 +29,5 @@ list(APPEND CODE_SOURCE_FILES ${SOURCE_GROUP_SOURCE_FILES}) source_group( "ReservoirDataModel\\Completions" FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} - ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake) + ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake +) diff --git a/ApplicationLibCode/ResultStatisticsCache/CMakeLists.txt b/ApplicationLibCode/ResultStatisticsCache/CMakeLists.txt index bf91ad13d5..4d5325a1f2 100644 --- a/ApplicationLibCode/ResultStatisticsCache/CMakeLists.txt +++ b/ApplicationLibCode/ResultStatisticsCache/CMakeLists.txt @@ -8,7 +8,8 @@ add_library( ${PROJECT_NAME} RigStatisticsCalculator.h RigStatisticsCalculator.cpp RigStatisticsDataCache.h RigStatisticsDataCache.cpp RigStatisticsMath.h - RigStatisticsMath.cpp) + RigStatisticsMath.cpp +) target_include_directories(${PROJECT_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) diff --git a/ApplicationLibCode/UnitTests/CMakeLists_files.cmake b/ApplicationLibCode/UnitTests/CMakeLists_files.cmake index 13d8143acd..12660ffc50 100644 --- a/ApplicationLibCode/UnitTests/CMakeLists_files.cmake +++ b/ApplicationLibCode/UnitTests/CMakeLists_files.cmake @@ -1,5 +1,7 @@ -configure_file(${CMAKE_CURRENT_LIST_DIR}/RiaTestDataDirectory.h.cmake - ${CMAKE_BINARY_DIR}/Generated/RiaTestDataDirectory.h) +configure_file( + ${CMAKE_CURRENT_LIST_DIR}/RiaTestDataDirectory.h.cmake + ${CMAKE_BINARY_DIR}/Generated/RiaTestDataDirectory.h +) set(SOURCE_GROUP_HEADER_FILES) @@ -76,11 +78,13 @@ set(SOURCE_GROUP_SOURCE_FILES ${CMAKE_CURRENT_LIST_DIR}/RigSlice2D-Test.cpp ${CMAKE_CURRENT_LIST_DIR}/RigSurfaceResampler-Test.cpp ${CMAKE_CURRENT_LIST_DIR}/RigSurfaceStatisticsCalculator-Test.cpp - ${CMAKE_CURRENT_LIST_DIR}/StructGridInterface-Test.cpp) + ${CMAKE_CURRENT_LIST_DIR}/StructGridInterface-Test.cpp +) if(RESINSIGHT_ENABLE_GRPC) list(APPEND GPRC_UNIT_TEST_SOURCE_FILES - ${CMAKE_CURRENT_LIST_DIR}/RiaGrpcInterface-Test.cpp) + ${CMAKE_CURRENT_LIST_DIR}/RiaGrpcInterface-Test.cpp + ) list(APPEND SOURCE_GROUP_SOURCE_FILES ${GRPC_UNIT_TEST_SOURCE_FILES}) endif(RESINSIGHT_ENABLE_GRPC) @@ -90,4 +94,5 @@ list(APPEND CODE_SOURCE_FILES ${SOURCE_GROUP_SOURCE_FILES}) source_group( "UnitTests" FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} - ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake) + ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake +) diff --git a/ApplicationLibCode/UserInterface/AnalysisPlots/CMakeLists_files.cmake b/ApplicationLibCode/UserInterface/AnalysisPlots/CMakeLists_files.cmake index 3c8f09c9e8..0d37cd3736 100644 --- a/ApplicationLibCode/UserInterface/AnalysisPlots/CMakeLists_files.cmake +++ b/ApplicationLibCode/UserInterface/AnalysisPlots/CMakeLists_files.cmake @@ -1,8 +1,10 @@ set(SOURCE_GROUP_HEADER_FILES - ${CMAKE_CURRENT_LIST_DIR}/RiuGroupedBarChartBuilder.h) + ${CMAKE_CURRENT_LIST_DIR}/RiuGroupedBarChartBuilder.h +) set(SOURCE_GROUP_SOURCE_FILES - ${CMAKE_CURRENT_LIST_DIR}/RiuGroupedBarChartBuilder.cpp) + ${CMAKE_CURRENT_LIST_DIR}/RiuGroupedBarChartBuilder.cpp +) list(APPEND CODE_HEADER_FILES ${SOURCE_GROUP_HEADER_FILES}) @@ -15,4 +17,5 @@ list(APPEND QT_UI_FILES) source_group( "UserInterface/AnalysisPlots" FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} - ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake) + ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake +) diff --git a/ApplicationLibCode/UserInterface/CMakeLists_files.cmake b/ApplicationLibCode/UserInterface/CMakeLists_files.cmake index 6262f43062..344f285a01 100644 --- a/ApplicationLibCode/UserInterface/CMakeLists_files.cmake +++ b/ApplicationLibCode/UserInterface/CMakeLists_files.cmake @@ -92,7 +92,8 @@ set(SOURCE_GROUP_HEADER_FILES ${CMAKE_CURRENT_LIST_DIR}/RiuScalarMapperLegendFrame.h ${CMAKE_CURRENT_LIST_DIR}/RiuFileDialogTools.h ${CMAKE_CURRENT_LIST_DIR}/RiuGuiTheme.h - ${CMAKE_CURRENT_LIST_DIR}/RiuQssSyntaxHighlighter.h) + ${CMAKE_CURRENT_LIST_DIR}/RiuQssSyntaxHighlighter.h +) set(SOURCE_GROUP_SOURCE_FILES ${CMAKE_CURRENT_LIST_DIR}/RiuCadNavigation.cpp @@ -186,7 +187,8 @@ set(SOURCE_GROUP_SOURCE_FILES ${CMAKE_CURRENT_LIST_DIR}/RiuGuiTheme.cpp ${CMAKE_CURRENT_LIST_DIR}/RiuQssSyntaxHighlighter.cpp ${CMAKE_CURRENT_LIST_DIR}/RiuTextEditWithCompletion.cpp - ${CMAKE_CURRENT_LIST_DIR}/RiuTextContentFrame.cpp) + ${CMAKE_CURRENT_LIST_DIR}/RiuTextContentFrame.cpp +) if(Qt5Charts_FOUND) list(APPEND CODE_HEADER_FILES ${CMAKE_CURRENT_LIST_DIR}/RiuQtChartView.h) @@ -246,11 +248,13 @@ list( ${CMAKE_CURRENT_LIST_DIR}/RiuCategoryLegendFrame.h ${CMAKE_CURRENT_LIST_DIR}/RiuScalarMapperLegendFrame.h ${CMAKE_CURRENT_LIST_DIR}/RiuTextEditWithCompletion.h - ${CMAKE_CURRENT_LIST_DIR}/RiuTextContentFrame.h) + ${CMAKE_CURRENT_LIST_DIR}/RiuTextContentFrame.h +) list(APPEND QT_UI_FILES) source_group( "UserInterface" FILES ${SOURCE_GROUP_HEADER_FILES} ${SOURCE_GROUP_SOURCE_FILES} - ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake) + ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_files.cmake +) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3a52df9bdf..475c1a9071 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -14,7 +14,8 @@ if(UNIX) option( RESINSIGHT_PREFER_LEGACY_OPENGL "Link with Legacy OpenGL libraries. This may be necessary in some virtualization environments" - ON) + ON + ) if(RESINSIGHT_PREFER_LEGACY_OPENGL) set(OpenGL_GL_PREFERENCE LEGACY) endif() @@ -24,14 +25,16 @@ set_property(GLOBAL PROPERTY USE_FOLDERS ON) set(BUILD_SHARED_LIBS OFF - CACHE BOOL "ERT: Build shared libraries") + CACHE BOOL "ERT: Build shared libraries" +) list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake") option(RESINSIGHT_BUNDLE_TESTMODELS "Copy TestModels into the installation" OFF) option(VCPKG_AUTO_INSTALL - "Automatically download build pre-requisites with VCPKG" OFF) + "Automatically download build pre-requisites with VCPKG" OFF +) if(VCPKG_AUTO_INSTALL) include(AutoVcpkg) set(AUTO_VCPKG_ROOT "${CMAKE_SOURCE_DIR}/ThirdParty/vcpkg") @@ -73,7 +76,8 @@ if(RESINSIGHT_USE_OPENMP) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS} -DUSE_OPENMP") set(CMAKE_EXE_LINKER_FLAGS - "${CMAKE_EXE_LINKER_FLAGS} ${OpenMP_EXE_LINKER_FLAGS}") + "${CMAKE_EXE_LINKER_FLAGS} ${OpenMP_EXE_LINKER_FLAGS}" + ) else() message(STATUS "Disabling OpenMP support") endif() @@ -112,9 +116,11 @@ if(RESINSIGHT_ENABLE_GRPC) option( RESINSIGHT_GRPC_DOWNLOAD_PYTHON_MODULE "Download the gRPC python modules to enable generation of Python interface" - ON) + ON + ) option(RESINSIGHT_GRPC_BUNDLE_PYTHON_MODULE - "Bundle the gRPC python modules into the install folder" OFF) + "Bundle the gRPC python modules into the install folder" OFF + ) add_definitions(-DENABLE_GRPC) endif() @@ -124,7 +130,8 @@ endif() # CMAKE_UNITY_BUILD was introduced in CMake 3.16.2 option(RESINSIGHT_ENABLE_UNITY_BUILD - "Experimental speedup of compilation using CMake Unity Build" OFF) + "Experimental speedup of compilation using CMake Unity Build" OFF +) mark_as_advanced(FORCE RESINSIGHT_ENABLE_UNITY_BUILD) if(RESINSIGHT_ENABLE_UNITY_BUILD) set(CAF_ENABLE_UNITY_BUILD true) @@ -145,15 +152,18 @@ if(NOT MSVC) # libraries and includes set(RESINSIGHT_ERT_EXTERNAL_LIB_ROOT "" - CACHE PATH "Path to installed ERT libraries") + CACHE PATH "Path to installed ERT libraries" + ) set(RESINSIGHT_ERT_EXTERNAL_INCLUDE_ROOT "" - CACHE PATH "Path to installed ERT includes") + CACHE PATH "Path to installed ERT includes" + ) endif() if(RESINSIGHT_ERT_EXTERNAL_LIB_ROOT OR RESINSIGHT_ERT_EXTERNAL_INCLUDE_ROOT) if(NOT (RESINSIGHT_ERT_EXTERNAL_LIB_ROOT - AND RESINSIGHT_ERT_EXTERNAL_INCLUDE_ROOT)) + AND RESINSIGHT_ERT_EXTERNAL_INCLUDE_ROOT) + ) message( FATAL_ERROR "Both RESINSIGHT_ERT_EXTERNAL_LIB_ROOT and RESINSIGHT_ERT_EXTERNAL_INCLUDE_ROOT must be defined" @@ -162,7 +172,8 @@ if(RESINSIGHT_ERT_EXTERNAL_LIB_ROOT OR RESINSIGHT_ERT_EXTERNAL_INCLUDE_ROOT) message( FATAL_ERROR - "TODO: Building using and external system installed ERT is broken.") + "TODO: Building using and external system installed ERT is broken." + ) list(APPEND ERT_INCLUDE_DIRS ${RESINSIGHT_ERT_EXTERNAL_INCLUDE_ROOT}) @@ -174,10 +185,12 @@ else() # directly set(INSTALL_ERT OFF - CACHE BOOL "ERT: Install library") + CACHE BOOL "ERT: Install library" + ) set(ERT_USE_OPENMP ${OPENMP_FOUND} - CACHE BOOL "ERT: Compile using OpenMP") + CACHE BOOL "ERT: Compile using OpenMP" + ) # Remember original state set(ORIGINAL_BUILD_SHARED_LIBS ${BUILD_SHARED_LIBS}) @@ -189,7 +202,8 @@ else() else() set(RESINSIGHT_ERT_EXTERNAL_SOURCE_ROOT "" - CACHE STRING "Path to ERT CMakeList.txt (source path)") + CACHE STRING "Path to ERT CMakeList.txt (source path)" + ) # Force dynamic linking on other platforms Copy of libraries into install # folder of ResInsight is done a bit further down in this file @@ -197,8 +211,9 @@ else() endif() if(RESINSIGHT_ERT_EXTERNAL_SOURCE_ROOT) - add_subdirectory(${RESINSIGHT_ERT_EXTERNAL_SOURCE_ROOT} - ${CMAKE_BINARY_DIR}/ThirdParty/Ert) + add_subdirectory( + ${RESINSIGHT_ERT_EXTERNAL_SOURCE_ROOT} ${CMAKE_BINARY_DIR}/ThirdParty/Ert + ) else() add_subdirectory(ThirdParty/Ert) endif() @@ -215,7 +230,8 @@ else() set_target_properties( ecl PROPERTIES COMPILE_FLAGS - "-Wno-deprecated -Wno-deprecated-declarations -Wno-clobbered") + "-Wno-deprecated -Wno-deprecated-declarations -Wno-clobbered" + ) endif() list(APPEND THIRD_PARTY_LIBRARIES ecl) @@ -252,7 +268,8 @@ if(GIT_FOUND AND EXISTS "${PROJECT_SOURCE_DIR}/.git") COMMAND ${GIT_EXECUTABLE} submodule update --init --recursive -- ${SUBDIR} WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} - RESULT_VARIABLE GIT_SUBMOD_RESULT) + RESULT_VARIABLE GIT_SUBMOD_RESULT + ) if(NOT GIT_SUBMOD_RESULT EQUAL "0") message( FATAL_ERROR @@ -283,7 +300,8 @@ if(buildcache_program) if(CMAKE_CXX_FLAGS_DEBUG MATCHES "/Zi") message(STATUS "Clearing pdb setting") string(REGEX REPLACE "/Zi" "" CMAKE_CXX_FLAGS_DEBUG - "${CMAKE_CXX_FLAGS_DEBUG}") + "${CMAKE_CXX_FLAGS_DEBUG}" + ) endif() set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /Z7") @@ -298,13 +316,15 @@ endif() if(MSVC) set(RESINSIGHT_HDF5_DIR "" - CACHE PATH "Windows Only: Optional path to HDF5 libraries on Windows") + CACHE PATH "Windows Only: Optional path to HDF5 libraries on Windows" + ) endif() if(MSVC) if(NOT ${RESINSIGHT_HDF5_DIR} EQUAL "") list(APPEND EXTERNAL_LINK_LIBRARIES ${RESINSIGHT_HDF5_DIR}/lib/hdf5.lib - ${RESINSIGHT_HDF5_DIR}/lib/hdf5_cpp.lib) + ${RESINSIGHT_HDF5_DIR}/lib/hdf5_cpp.lib + ) set(RESINSIGHT_FOUND_HDF5 1) message(STATUS "Using HDF5 from : ${RESINSIGHT_HDF5_DIR}") @@ -349,7 +369,8 @@ add_subdirectory(ThirdParty/custom-opm-common) add_subdirectory(ThirdParty/custom-opm-common/custom-opm-parser-tests) list(APPEND OPM_LIBRARIES custom-opm-flowdiagnostics custom-opm-flowdiag-app - custom-opm-common) + custom-opm-common +) set_property(TARGET ${OPM_LIBRARIES} PROPERTY FOLDER "Thirdparty/OPM") @@ -373,7 +394,8 @@ find_package( Script ScriptTools Widgets - OPTIONAL_COMPONENTS Charts) + OPTIONAL_COMPONENTS Charts +) if(Qt5Charts_FOUND) message(STATUS "QtCharts found: ${Qt5Charts_LIBRARIES}") add_definitions(-DUSE_QTCHARTS) @@ -446,7 +468,8 @@ if(CMAKE_COMPILER_IS_GNUCC) __sync_fetch_and_add(&a, 1); __sync_sub_and_fetch(&a, 1); __sync_fetch_and_sub(&a, 1); }" - HAVE_GCC_SYNC_FUNCTIONS) + HAVE_GCC_SYNC_FUNCTIONS + ) endif() if(HAVE_GCC_SYNC_FUNCTIONS) @@ -474,7 +497,8 @@ list( LibViewing LibRender LibGeometry - LibCore) + LibCore +) set_property(TARGET ${VIZ_FWK_LIBRARIES} PROPERTY FOLDER "VizFwk") @@ -520,7 +544,8 @@ list( cafTensor CommonCode cafVizExtensions - cafPdmScripting) + cafPdmScripting +) set_property(TARGET ${APP_FWK_LIBRARIES} PROPERTY FOLDER "AppFwk") @@ -530,11 +555,13 @@ mark_as_advanced(FORCE RESINSIGHT_INCLUDE_APPFWK_TESTS) if(RESINSIGHT_INCLUDE_APPFWK_TESTS) # Unit Tests add_subdirectory(Fwk/AppFwk/cafProjectDataModel/cafProjectDataModel_UnitTests) - set_property(TARGET cafProjectDataModel_UnitTests PROPERTY FOLDER - "AppFwkTests") + set_property( + TARGET cafProjectDataModel_UnitTests PROPERTY FOLDER "AppFwkTests" + ) add_subdirectory( - Fwk/AppFwk/cafProjectDataModel/cafPdmCore/cafPdmCore_UnitTests) + Fwk/AppFwk/cafProjectDataModel/cafPdmCore/cafPdmCore_UnitTests + ) set_property(TARGET cafPdmCore_UnitTests PROPERTY FOLDER "AppFwkTests") add_subdirectory(Fwk/AppFwk/cafProjectDataModel/cafPdmXml/cafPdmXml_UnitTests) @@ -560,7 +587,8 @@ set(RESINSIGHT_INSTALL_FOLDER ".") # override system install prefix if private installation chosen option(RESINSIGHT_PRIVATE_INSTALL "Linux only: Install the libecl shared libraries along the executable" - ON) + ON +) mark_as_advanced(FORCE RESINSIGHT_PRIVATE_INSTALL) if(RESINSIGHT_PRIVATE_INSTALL) @@ -577,7 +605,8 @@ if(RESINSIGHT_PRIVATE_INSTALL) ${CMAKE_BINARY_DIR}/ThirdParty/Ert/${CMAKE_INSTALL_LIBDIR}/libecl.so.2.4 ) install(FILES ${ERT_SHARED_LIB_FILES} - DESTINATION ${RESINSIGHT_INSTALL_FOLDER}) + DESTINATION ${RESINSIGHT_INSTALL_FOLDER} + ) endif() if(APPLE) @@ -588,7 +617,8 @@ if(RESINSIGHT_PRIVATE_INSTALL) ) install( FILES ${ERT_SHARED_LIB_FILES} - DESTINATION ${RESINSIGHT_INSTALL_FOLDER}/ResInsight.app/Contents/MacOS) + DESTINATION ${RESINSIGHT_INSTALL_FOLDER}/ResInsight.app/Contents/MacOS + ) endif() endif(RESINSIGHT_PRIVATE_INSTALL) @@ -602,7 +632,8 @@ if(RESINSIGHT_HDF5_BUNDLE_LIBRARIES) if(${POS_IN_STRING} GREATER -1) file(GLOB FILE_AND_SYMLINKS ${FILE_TO_COPY}*) install(FILES ${FILE_AND_SYMLINKS} - DESTINATION ${RESINSIGHT_INSTALL_FOLDER}) + DESTINATION ${RESINSIGHT_INSTALL_FOLDER} + ) endif() endforeach() endif() @@ -610,7 +641,8 @@ endif(RESINSIGHT_HDF5_BUNDLE_LIBRARIES) if(RESINSIGHT_BUNDLE_TESTMODELS) install(DIRECTORY ${CMAKE_SOURCE_DIR}/TestModels - DESTINATION ${RESINSIGHT_INSTALL_FOLDER}) + DESTINATION ${RESINSIGHT_INSTALL_FOLDER} + ) endif() # ############################################################################## @@ -628,14 +660,16 @@ if(OCTAVE_MKOCTFILE) add_subdirectory(OctavePlugin) else(OCTAVE_MKOCTFILE) message( - STATUS "Could not find OCTAVE_MKOCTFILE, skipping OctavePlugin library") + STATUS "Could not find OCTAVE_MKOCTFILE, skipping OctavePlugin library" + ) endif(OCTAVE_MKOCTFILE) # ############################################################################## # Code documentation using Doxygen # ############################################################################## option(RESINSIGHT_BUILD_DOCUMENTATION - "Use Doxygen to create the HTML based API documentation" OFF) + "Use Doxygen to create the HTML based API documentation" OFF +) if(RESINSIGHT_BUILD_DOCUMENTATION) find_package(Doxygen) if(NOT DOXYGEN_FOUND) @@ -650,7 +684,8 @@ if(RESINSIGHT_BUILD_DOCUMENTATION) add_custom_target( Docs COMMAND ${DOXYGEN_EXECUTABLE} ${PROJECT_BINARY_DIR}/Doxyfile - SOURCES ${PROJECT_BINARY_DIR}/Doxyfile) + SOURCES ${PROJECT_BINARY_DIR}/Doxyfile + ) # IF you do NOT want the documentation to be generated EVERY time you build # the project then leave out the 'ALL' keyword from the above command. endif(RESINSIGHT_BUILD_DOCUMENTATION) diff --git a/Fwk/AppFwk/CMakeLists.txt b/Fwk/AppFwk/CMakeLists.txt index 5d34e9995e..f5bb62baf2 100644 --- a/Fwk/AppFwk/CMakeLists.txt +++ b/Fwk/AppFwk/CMakeLists.txt @@ -20,13 +20,15 @@ if(CEE_USE_QT5) find_package( Qt5 COMPONENTS - REQUIRED Core Gui OpenGL Widgets) + REQUIRED Core Gui OpenGL Widgets + ) set(QT_LIBRARIES Qt5::Core Qt5::Gui Qt5::OpenGL Qt5::Widgets) else() find_package( Qt4 COMPONENTS QtCore QtGui QtMain QtOpenGl - REQUIRED) + REQUIRED + ) include(${QT_USE_FILE}) endif(CEE_USE_QT5) @@ -70,5 +72,7 @@ add_subdirectory(cafPdmScripting/cafPdmScripting_UnitTests) # folders set_property(GLOBAL PROPERTY USE_FOLDERS ON) -set_property(TARGET cafPdmCore cafPdmCore_UnitTests cafPdmXml - cafPdmXml_UnitTests cafPdmUiCore PROPERTY FOLDER "PdmCore") +set_property( + TARGET cafPdmCore cafPdmCore_UnitTests cafPdmXml cafPdmXml_UnitTests + cafPdmUiCore PROPERTY FOLDER "PdmCore" +) diff --git a/Fwk/AppFwk/CommonCode/CMakeLists.txt b/Fwk/AppFwk/CommonCode/CMakeLists.txt index 44d6642db6..265d2f508f 100644 --- a/Fwk/AppFwk/CommonCode/CMakeLists.txt +++ b/Fwk/AppFwk/CommonCode/CMakeLists.txt @@ -19,7 +19,8 @@ set(MOC_HEADER_FILES cafMessagePanel.h) find_package( Qt5 COMPONENTS - REQUIRED Core Gui Widgets OpenGL) + REQUIRED Core Gui Widgets OpenGL +) set(QT_LIBRARIES Qt5::Core Qt5::Gui Qt5::Widgets Qt5::OpenGL) qt5_wrap_cpp(MOC_SOURCE_FILES ${MOC_HEADER_FILES}) @@ -50,7 +51,8 @@ add_library( cvfStructGridScalarDataAccess.h cafVecIjk.cpp cafVecIjk.h - ${MOC_SOURCE_FILES}) + ${MOC_SOURCE_FILES} +) target_include_directories(${PROJECT_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) @@ -62,11 +64,13 @@ target_link_libraries( LibRender LibGuiQt cafPdmCore - ${QT_LIBRARIES}) + ${QT_LIBRARIES} +) if(MSVC) - set_target_properties(${PROJECT_NAME} PROPERTIES COMPILE_FLAGS - "/W4 /wd4100 /wd4127") + set_target_properties( + ${PROJECT_NAME} PROPERTIES COMPILE_FLAGS "/W4 /wd4100 /wd4127" + ) endif() source_group("" FILES ${PROJECT_FILES}) diff --git a/Fwk/AppFwk/cafAnimControl/CMakeLists.txt b/Fwk/AppFwk/cafAnimControl/CMakeLists.txt index c40f7d2674..a312c2a722 100644 --- a/Fwk/AppFwk/cafAnimControl/CMakeLists.txt +++ b/Fwk/AppFwk/cafAnimControl/CMakeLists.txt @@ -10,12 +10,14 @@ endif() # Qt set(MOC_HEADER_FILES cafFrameAnimationControl.h cafAnimationToolBar.h - cafPopupMenuButton.h) + cafPopupMenuButton.h +) find_package( Qt5 COMPONENTS - REQUIRED Core Gui Widgets) + REQUIRED Core Gui Widgets +) set(QT_LIBRARIES Qt5::Core Qt5::Gui Qt5::Widgets) qt5_wrap_cpp(MOC_SOURCE_FILES ${MOC_HEADER_FILES}) @@ -28,12 +30,14 @@ qt5_wrap_cpp(MOC_SOURCE_FILES ${MOC_HEADER_FILES}) set(QRC_FILES ${QRC_FILES} ${CMAKE_CURRENT_SOURCE_DIR}/Resources/cafAnimControl.qrc - PARENT_SCOPE) + PARENT_SCOPE +) set(PROJECT_FILES cafFrameAnimationControl.h cafFrameAnimationControl.cpp cafAnimationToolBar.h cafAnimationToolBar.cpp cafPopupMenuButton.h - cafPopupMenuButton.cpp) + cafPopupMenuButton.cpp +) add_library(${PROJECT_NAME} ${PROJECT_FILES} ${MOC_SOURCE_FILES}) diff --git a/Fwk/AppFwk/cafCommand/CMakeLists.txt b/Fwk/AppFwk/cafCommand/CMakeLists.txt index 585383a037..5c881804b4 100644 --- a/Fwk/AppFwk/cafCommand/CMakeLists.txt +++ b/Fwk/AppFwk/cafCommand/CMakeLists.txt @@ -15,7 +15,8 @@ set(MOC_HEADER_FILES cafCmdFeature.h cafCmdFeatureManager.h) find_package( Qt5 COMPONENTS - REQUIRED Core Gui Widgets) + REQUIRED Core Gui Widgets +) set(QT_LIBRARIES Qt5::Core Qt5::Gui Qt5::Widgets) qt5_wrap_cpp(MOC_SOURCE_FILES ${MOC_HEADER_FILES}) @@ -36,7 +37,8 @@ set(PROJECT_FILES cafCmdFeatureManager.cpp cafCmdFeatureManager.h cafCmdFeatureMenuBuilder.cpp - cafCmdFeatureMenuBuilder.h) + cafCmdFeatureMenuBuilder.h +) add_library(${PROJECT_NAME} ${PROJECT_FILES} ${MOC_SOURCE_FILES}) @@ -45,8 +47,9 @@ target_include_directories(${PROJECT_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) target_link_libraries(${PROJECT_NAME} cafProjectDataModel ${QT_LIBRARIES}) if(MSVC) - set_target_properties(${PROJECT_NAME} PROPERTIES COMPILE_FLAGS - "/W4 /wd4100 /wd4127") + set_target_properties( + ${PROJECT_NAME} PROPERTIES COMPILE_FLAGS "/W4 /wd4100 /wd4127" + ) endif() source_group("" FILES ${PROJECT_FILES}) diff --git a/Fwk/AppFwk/cafCommandFeatures/CMakeLists.txt b/Fwk/AppFwk/cafCommandFeatures/CMakeLists.txt index 6ee3f46924..824774da4e 100644 --- a/Fwk/AppFwk/cafCommandFeatures/CMakeLists.txt +++ b/Fwk/AppFwk/cafCommandFeatures/CMakeLists.txt @@ -15,7 +15,8 @@ set(MOC_HEADER_FILES) find_package( Qt5 COMPONENTS - REQUIRED Core Gui Widgets) + REQUIRED Core Gui Widgets +) set(QT_LIBRARIES Qt5::Core Qt5::Gui Qt5::Widgets) qt5_wrap_cpp(MOC_SOURCE_FILES ${MOC_HEADER_FILES}) @@ -42,7 +43,8 @@ set(PROJECT_FILES ToggleCommands/cafToggleItemsOnFeature.cpp ToggleCommands/cafToggleItemsOnFeature.h ToggleCommands/cafToggleItemsOnOthersOffFeature.cpp - ToggleCommands/cafToggleItemsOnOthersOffFeature.h) + ToggleCommands/cafToggleItemsOnOthersOffFeature.h +) # NOTE! Resources in this subfolder appends to the variable QRC_FILES in parent # scope CMakeList.txt in the application folder (parent scope) must use the @@ -53,7 +55,8 @@ set(PROJECT_FILES set(QRC_FILES ${QRC_FILES} ${CMAKE_CURRENT_SOURCE_DIR}/Resources/cafCommandFeatures.qrc - PARENT_SCOPE) + PARENT_SCOPE +) # NOTE! Adding the library as a cmake "OBJECT" library to make sure the linker # is not pruning the seemingly unused features, and to make sure that the static @@ -88,8 +91,9 @@ set_property(TARGET ${PROJECT_NAME} PROPERTY POSITION_INDEPENDENT_CODE ON) # ${PROJECT_NAME} cafCommand cafUserInterface ${QT_LIBRARIES} ) if(MSVC) - set_target_properties(${PROJECT_NAME} PROPERTIES COMPILE_FLAGS - "/W4 /wd4100 /wd4127") + set_target_properties( + ${PROJECT_NAME} PROPERTIES COMPILE_FLAGS "/W4 /wd4100 /wd4127" + ) endif() source_group("" FILES ${PROJECT_FILES}) diff --git a/Fwk/AppFwk/cafHexInterpolator/cafHexInterpolator_UnitTest/CMakeLists.txt b/Fwk/AppFwk/cafHexInterpolator/cafHexInterpolator_UnitTest/CMakeLists.txt index 964f60567a..ecba3ce456 100644 --- a/Fwk/AppFwk/cafHexInterpolator/cafHexInterpolator_UnitTest/CMakeLists.txt +++ b/Fwk/AppFwk/cafHexInterpolator/cafHexInterpolator_UnitTest/CMakeLists.txt @@ -19,7 +19,8 @@ include_directories(${CMAKE_CURRENT_SOURCE_DIR} # required for gtest-all.cpp ) set(PROJECT_FILES cafHexInterpolatorBasicTest.cpp - cafHexInterpolator_UnitTests_main.cpp) + cafHexInterpolator_UnitTests_main.cpp +) # add the executable add_executable(${PROJECT_NAME} ${PROJECT_FILES} gtest/gtest-all.cpp) diff --git a/Fwk/AppFwk/cafPdmCvf/CMakeLists.txt b/Fwk/AppFwk/cafPdmCvf/CMakeLists.txt index 54eb75a7f2..8b6ba0d3c3 100644 --- a/Fwk/AppFwk/cafPdmCvf/CMakeLists.txt +++ b/Fwk/AppFwk/cafPdmCvf/CMakeLists.txt @@ -12,7 +12,8 @@ endif() find_package( Qt5 COMPONENTS - REQUIRED Core Gui Widgets) + REQUIRED Core Gui Widgets +) set(QT_LIBRARIES Qt5::Core Qt5::Gui Qt5::Widgets) qt5_wrap_cpp(MOC_SOURCE_FILES ${MOC_HEADER_FILES}) @@ -44,11 +45,13 @@ add_library( cafPdmMat3d/cafPdmXmlMat3d.h cafPdmMat3d/cafPdmFieldCvfMat3d.h ${MOC_HEADER_FILES} - ${MOC_SOURCE_FILES}) + ${MOC_SOURCE_FILES} +) target_include_directories( ${PROJECT_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_CURRENT_SOURCE_DIR}/cafPdmMat3d) + ${CMAKE_CURRENT_SOURCE_DIR}/cafPdmMat3d +) target_link_libraries(${PROJECT_NAME} cafUserInterface LibCore ${QT_LIBRARIES}) diff --git a/Fwk/AppFwk/cafPdmCvf/cafPdmCvf_UnitTests/CMakeLists.txt b/Fwk/AppFwk/cafPdmCvf/cafPdmCvf_UnitTests/CMakeLists.txt index ca3f96c242..5de8dc5906 100644 --- a/Fwk/AppFwk/cafPdmCvf/cafPdmCvf_UnitTests/CMakeLists.txt +++ b/Fwk/AppFwk/cafPdmCvf/cafPdmCvf_UnitTests/CMakeLists.txt @@ -7,7 +7,8 @@ else() find_package( Qt4 COMPONENTS QtCore - REQUIRED) + REQUIRED + ) include(${QT_USE_FILE}) endif(Qt5Core_FOUND) @@ -15,11 +16,13 @@ project(cafPdmCvf_UnitTests) include_directories( ${CMAKE_CURRENT_SOURCE_DIR} ${cafPdmCore_SOURCE_DIR} ${cafPdmXml_SOURCE_DIR} - ${cafPdmCvf_SOURCE_DIR} ${LibCore_SOURCE_DIR}) + ${cafPdmCvf_SOURCE_DIR} ${LibCore_SOURCE_DIR} +) set(PROJECT_FILES cafPdmCvf_UnitTests.cpp gtest/gtest-all.cpp cafPdmCoreVec3dTest.cpp - cafPdmCoreColor3fTest.cpp cafPdmCoreMat4dTest.cpp) + cafPdmCoreColor3fTest.cpp cafPdmCoreMat4dTest.cpp +) # add the executable add_executable(${PROJECT_NAME} ${PROJECT_FILES}) @@ -30,8 +33,9 @@ endif() source_group("" FILES ${PROJECT_FILES}) -target_link_libraries(${PROJECT_NAME} cafPdmCore cafPdmXml LibCore cafPdmCvf - ${QT_LIBRARIES}) +target_link_libraries( + ${PROJECT_NAME} cafPdmCore cafPdmXml LibCore cafPdmCvf ${QT_LIBRARIES} +) # Copy Qt Dlls if(Qt5Core_FOUND) @@ -40,7 +44,8 @@ if(Qt5Core_FOUND) TARGET ${PROJECT_NAME} POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_if_different $ - $) + $ + ) endforeach(qtlib) # Copy Qt Dlls else() @@ -52,12 +57,14 @@ else() # Debug execute_process( COMMAND cmake -E copy_if_different ${QT_BINARY_DIR}/${qtlib}d4.dll - ${CMAKE_BINARY_DIR}/Debug/${qtlib}d4.dll) + ${CMAKE_BINARY_DIR}/Debug/${qtlib}d4.dll + ) # Release execute_process( COMMAND cmake -E copy_if_different ${QT_BINARY_DIR}/${qtlib}4.dll - ${CMAKE_BINARY_DIR}/Release/${qtlib}4.dll) + ${CMAKE_BINARY_DIR}/Release/${qtlib}4.dll + ) endforeach(qtlib) endif(MSVC) endif(Qt5Core_FOUND) diff --git a/Fwk/AppFwk/cafPdmScripting/CMakeLists.txt b/Fwk/AppFwk/cafPdmScripting/CMakeLists.txt index 392acc23fa..1b546e73c8 100644 --- a/Fwk/AppFwk/cafPdmScripting/CMakeLists.txt +++ b/Fwk/AppFwk/cafPdmScripting/CMakeLists.txt @@ -31,7 +31,8 @@ set(PROJECT_FILES cafPdmMarkdownGenerator.h cafPdmMarkdownGenerator.cpp cafPdmMarkdownBuilder.h - cafPdmMarkdownBuilder.cpp) + cafPdmMarkdownBuilder.cpp +) set(CAF_LIBS cafProjectDataModel) @@ -42,7 +43,8 @@ if(CAF_CVF_SCRIPTING) cafPdmFieldScriptingCapabilityCvfColor3.h cafPdmFieldScriptingCapabilityCvfColor3.cpp cafPdmFieldScriptingCapabilityCvfVec3d.h - cafPdmFieldScriptingCapabilityCvfVec3d.cpp) + cafPdmFieldScriptingCapabilityCvfVec3d.cpp + ) list(APPEND CAF_LIBS cafPdmCvf) endif() diff --git a/Fwk/AppFwk/cafPdmScripting/cafPdmScripting_UnitTests/CMakeLists.txt b/Fwk/AppFwk/cafPdmScripting/cafPdmScripting_UnitTests/CMakeLists.txt index b3988c5442..946793e218 100644 --- a/Fwk/AppFwk/cafPdmScripting/cafPdmScripting_UnitTests/CMakeLists.txt +++ b/Fwk/AppFwk/cafPdmScripting/cafPdmScripting_UnitTests/CMakeLists.txt @@ -5,7 +5,8 @@ project(cafPdmScripting_UnitTests) find_package( Qt5 COMPONENTS - REQUIRED Core Xml Gui) + REQUIRED Core Xml Gui +) set(QT_LIBRARIES Qt5::Core Qt5::Xml Qt5::Gui) if(MSVC AND (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 19.11)) @@ -22,11 +23,14 @@ include_directories(${CMAKE_CURRENT_SOURCE_DIR} # required for gtest-all.cpp ) # add the executable -add_executable(${PROJECT_NAME} cafPdmScripting_UnitTests.cpp - gtest/gtest-all.cpp cafPdmScriptingBasicTest.cpp) +add_executable( + ${PROJECT_NAME} cafPdmScripting_UnitTests.cpp gtest/gtest-all.cpp + cafPdmScriptingBasicTest.cpp +) -target_link_libraries(${PROJECT_NAME} cafPdmScripting ${QT_LIBRARIES} - ${THREAD_LIBRARY}) +target_link_libraries( + ${PROJECT_NAME} cafPdmScripting ${QT_LIBRARIES} ${THREAD_LIBRARY} +) source_group("" FILES ${PROJECT_FILES}) @@ -37,6 +41,7 @@ if(Qt5Core_FOUND) TARGET ${PROJECT_NAME} POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_if_different $ - $) + $ + ) endforeach(qtlib) endif(Qt5Core_FOUND) diff --git a/Fwk/AppFwk/cafProjectDataModel/CMakeLists.txt b/Fwk/AppFwk/cafProjectDataModel/CMakeLists.txt index b27df67334..ea2fa22cac 100644 --- a/Fwk/AppFwk/cafProjectDataModel/CMakeLists.txt +++ b/Fwk/AppFwk/cafProjectDataModel/CMakeLists.txt @@ -12,7 +12,8 @@ endif() find_package( Qt5 COMPONENTS - REQUIRED Core Gui Widgets) + REQUIRED Core Gui Widgets +) set(QT_LIBRARIES Qt5::Core Qt5::Gui Qt5::Widgets) set(PROJECT_FILES @@ -23,7 +24,8 @@ set(PROJECT_FILES cafPdmObjectGroup.cpp cafPdmObjectGroup.h cafPdmObject.cpp - cafPdmObject.h) + cafPdmObject.h +) add_library(${PROJECT_NAME} ${PROJECT_FILES}) @@ -32,8 +34,9 @@ target_link_libraries(${PROJECT_NAME} cafPdmUiCore cafPdmXml ${QT_LIBRARIES}) target_include_directories(${PROJECT_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) if(MSVC) - set_target_properties(${PROJECT_NAME} PROPERTIES COMPILE_FLAGS - "/W4 /wd4100 /wd4127") + set_target_properties( + ${PROJECT_NAME} PROPERTIES COMPILE_FLAGS "/W4 /wd4100 /wd4127" + ) endif() source_group("" FILES ${PROJECT_FILES}) diff --git a/Fwk/AppFwk/cafProjectDataModel/cafPdmCore/CMakeLists.txt b/Fwk/AppFwk/cafProjectDataModel/cafPdmCore/CMakeLists.txt index 181085144b..9637b34f47 100644 --- a/Fwk/AppFwk/cafProjectDataModel/cafPdmCore/CMakeLists.txt +++ b/Fwk/AppFwk/cafProjectDataModel/cafPdmCore/CMakeLists.txt @@ -11,7 +11,8 @@ endif() find_package( Qt5 COMPONENTS - REQUIRED Core) + REQUIRED Core +) set(QT_LIBRARIES Qt5::Core) set(PROJECT_FILES @@ -58,7 +59,8 @@ set(PROJECT_FILES cafAsyncObjectDeleter.h cafAsyncObjectDeleter.inl cafAsyncWorkerManager.h - cafAsyncWorkerManager.cpp) + cafAsyncWorkerManager.cpp +) add_library(${PROJECT_NAME} ${PROJECT_FILES}) @@ -67,8 +69,9 @@ target_include_directories(${PROJECT_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) target_link_libraries(${PROJECT_NAME} ${QT_LIBRARIES}) if(MSVC) - set_target_properties(${PROJECT_NAME} PROPERTIES COMPILE_FLAGS - "/W4 /wd4100 /wd4127") + set_target_properties( + ${PROJECT_NAME} PROPERTIES COMPILE_FLAGS "/W4 /wd4100 /wd4127" + ) endif() source_group("" FILES ${PROJECT_FILES}) diff --git a/Fwk/AppFwk/cafProjectDataModel/cafPdmCore/cafPdmCore_UnitTests/CMakeLists.txt b/Fwk/AppFwk/cafProjectDataModel/cafPdmCore/cafPdmCore_UnitTests/CMakeLists.txt index e09ce30274..14743e48c4 100644 --- a/Fwk/AppFwk/cafProjectDataModel/cafPdmCore/cafPdmCore_UnitTests/CMakeLists.txt +++ b/Fwk/AppFwk/cafProjectDataModel/cafPdmCore/cafPdmCore_UnitTests/CMakeLists.txt @@ -6,7 +6,8 @@ project(cafPdmCore_UnitTests) find_package( Qt5 COMPONENTS - REQUIRED Core Gui Widgets) + REQUIRED Core Gui Widgets +) set(QT_LIBRARIES Qt5::Core Qt5::Widgets Qt5::Gui) if(MSVC AND (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 19.11)) @@ -34,7 +35,8 @@ set(PROJECT_FILES Parent.cpp Parent.h TestObj.cpp - TestObj.h) + TestObj.h +) # add the executable add_executable(${PROJECT_NAME} ${PROJECT_FILES}) @@ -45,8 +47,9 @@ if(Qt5Core_FOUND) set(QT_LIBRARIES Qt5::Core Qt5::Gui Qt5::Widgets) endif() -target_link_libraries(${PROJECT_NAME} cafPdmCore ${QT_LIBRARIES} - ${THREAD_LIBRARY}) +target_link_libraries( + ${PROJECT_NAME} cafPdmCore ${QT_LIBRARIES} ${THREAD_LIBRARY} +) # Copy Qt Dlls foreach(qtlib ${QT_LIBRARIES}) @@ -54,5 +57,6 @@ foreach(qtlib ${QT_LIBRARIES}) TARGET ${PROJECT_NAME} POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_if_different $ - $) + $ + ) endforeach(qtlib) diff --git a/Fwk/AppFwk/cafProjectDataModel/cafPdmUiCore/CMakeLists.txt b/Fwk/AppFwk/cafProjectDataModel/cafPdmUiCore/CMakeLists.txt index 1532753d3a..678fb2e06b 100644 --- a/Fwk/AppFwk/cafProjectDataModel/cafPdmUiCore/CMakeLists.txt +++ b/Fwk/AppFwk/cafProjectDataModel/cafPdmUiCore/CMakeLists.txt @@ -10,13 +10,15 @@ endif() # These headers need to go through Qt's MOC compiler set(MOC_HEADER_FILES cafPdmUiEditorHandle.h cafPdmUiFieldEditorHandle.h - cafPdmUiSelection3dEditorVisualizer.h cafQShortenedLabel.h) + cafPdmUiSelection3dEditorVisualizer.h cafQShortenedLabel.h +) # Qt find_package( Qt5 COMPONENTS - REQUIRED Core Gui Widgets) + REQUIRED Core Gui Widgets +) set(QT_LIBRARIES Qt5::Core Qt5::Gui Qt5::Widgets) qt5_wrap_cpp(MOC_SOURCE_FILES ${MOC_HEADER_FILES}) @@ -69,7 +71,8 @@ set(PROJECT_FILES cafIconProvider.cpp cafIconProvider.h cafFontTools.cpp - cafFontTools.h) + cafFontTools.h +) # NOTE! Resources in this subfolder appends to the variable QRC_FILES in parent # scope CMakeList.txt in the application folder (parent scope) must use the @@ -80,7 +83,8 @@ set(PROJECT_FILES set(QRC_FILES ${QRC_FILES} ${CMAKE_CURRENT_SOURCE_DIR}/Resources/caf.qrc - PARENT_SCOPE) + PARENT_SCOPE +) add_library(${PROJECT_NAME} ${PROJECT_FILES} ${MOC_SOURCE_FILES}) @@ -89,8 +93,9 @@ target_link_libraries(${PROJECT_NAME} cafPdmCore ${QT_LIBRARIES}) target_include_directories(${PROJECT_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) if(MSVC) - set_target_properties(${PROJECT_NAME} PROPERTIES COMPILE_FLAGS - "/W4 /wd4100 /wd4127") + set_target_properties( + ${PROJECT_NAME} PROPERTIES COMPILE_FLAGS "/W4 /wd4100 /wd4127" + ) endif() source_group("" FILES ${PROJECT_FILES}) diff --git a/Fwk/AppFwk/cafProjectDataModel/cafPdmXml/CMakeLists.txt b/Fwk/AppFwk/cafProjectDataModel/cafPdmXml/CMakeLists.txt index 00994bc0a8..d05661cac8 100644 --- a/Fwk/AppFwk/cafProjectDataModel/cafPdmXml/CMakeLists.txt +++ b/Fwk/AppFwk/cafProjectDataModel/cafPdmXml/CMakeLists.txt @@ -12,7 +12,8 @@ endif() find_package( Qt5 COMPONENTS - REQUIRED Core Xml) + REQUIRED Core Xml +) set(QT_LIBRARIES Qt5::Core Qt5::Xml) include_directories(..) @@ -38,7 +39,8 @@ set(PROJECT_FILES cafPdmObjectFactory.h cafPdmSettings.h cafPdmSettings.cpp - cafPdmXmlStringValidation.h) + cafPdmXmlStringValidation.h +) add_library(${PROJECT_NAME} ${PROJECT_FILES}) @@ -47,8 +49,9 @@ target_link_libraries(${PROJECT_NAME} cafPdmCore ${QT_LIBRARIES}) target_include_directories(${PROJECT_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) if(MSVC) - set_target_properties(${PROJECT_NAME} PROPERTIES COMPILE_FLAGS - "/W4 /wd4100 /wd4127") + set_target_properties( + ${PROJECT_NAME} PROPERTIES COMPILE_FLAGS "/W4 /wd4100 /wd4127" + ) endif() source_group("" FILES ${PROJECT_FILES}) diff --git a/Fwk/AppFwk/cafProjectDataModel/cafPdmXml/cafPdmXml_UnitTests/CMakeLists.txt b/Fwk/AppFwk/cafProjectDataModel/cafPdmXml/cafPdmXml_UnitTests/CMakeLists.txt index 5f5d4740e3..b1aca842c3 100644 --- a/Fwk/AppFwk/cafProjectDataModel/cafPdmXml/cafPdmXml_UnitTests/CMakeLists.txt +++ b/Fwk/AppFwk/cafProjectDataModel/cafPdmXml/cafPdmXml_UnitTests/CMakeLists.txt @@ -5,7 +5,8 @@ project(cafPdmXml_UnitTests) find_package( Qt5 COMPONENTS - REQUIRED Core Xml) + REQUIRED Core Xml +) set(QT_LIBRARIES Qt5::Core Qt5::Xml) if(MSVC AND (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 19.11)) @@ -25,14 +26,16 @@ include_directories(${CMAKE_CURRENT_SOURCE_DIR} # required for gtest-all.cpp add_executable( ${PROJECT_NAME} cafPdmXml_UnitTests.cpp gtest/gtest-all.cpp cafPdmXmlBasicTest.cpp - cafPdmAdvancedTemplateTest.cpp cafPdmXmlNumberTest.cpp cafPdmPtrArrayTest.cpp) + cafPdmAdvancedTemplateTest.cpp cafPdmXmlNumberTest.cpp cafPdmPtrArrayTest.cpp +) if(Qt5Core_FOUND) set(QT_LIBRARIES Qt5::Core Qt5::Xml) endif() -target_link_libraries(${PROJECT_NAME} cafPdmXml ${QT_LIBRARIES} - ${THREAD_LIBRARY}) +target_link_libraries( + ${PROJECT_NAME} cafPdmXml ${QT_LIBRARIES} ${THREAD_LIBRARY} +) source_group("" FILES ${PROJECT_FILES}) @@ -43,6 +46,7 @@ if(Qt5Core_FOUND) TARGET ${PROJECT_NAME} POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_if_different $ - $) + $ + ) endforeach(qtlib) endif(Qt5Core_FOUND) diff --git a/Fwk/AppFwk/cafProjectDataModel/cafProjectDataModel_UnitTests/CMakeLists.txt b/Fwk/AppFwk/cafProjectDataModel/cafProjectDataModel_UnitTests/CMakeLists.txt index 18d0536556..ef58eb40b1 100644 --- a/Fwk/AppFwk/cafProjectDataModel/cafProjectDataModel_UnitTests/CMakeLists.txt +++ b/Fwk/AppFwk/cafProjectDataModel/cafProjectDataModel_UnitTests/CMakeLists.txt @@ -6,7 +6,8 @@ project(cafProjectDataModel_UnitTests) find_package( Qt5 COMPONENTS - REQUIRED Core Xml Gui) + REQUIRED Core Xml Gui +) set(QT_LIBRARIES Qt5::Core Qt5::Xml Qt5::Gui) if(MSVC AND (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 19.11)) @@ -23,13 +24,15 @@ include_directories(${CMAKE_CURRENT_SOURCE_DIR} # required for gtest-all.cpp ) set(PROJECT_FILES cafPdmBasicTest.cpp cafProjectDataModel_UnitTests.cpp - Child.cpp Parent.cpp TestObj.cpp) + Child.cpp Parent.cpp TestObj.cpp +) # add the executable add_executable(${PROJECT_NAME} ${PROJECT_FILES} gtest/gtest-all.cpp) -target_link_libraries(${PROJECT_NAME} cafProjectDataModel ${QT_LIBRARIES} - ${THREAD_LIBRARY}) +target_link_libraries( + ${PROJECT_NAME} cafProjectDataModel ${QT_LIBRARIES} ${THREAD_LIBRARY} +) source_group("" FILES ${PROJECT_FILES}) @@ -39,5 +42,6 @@ foreach(qtlib ${QT_LIBRARIES}) TARGET ${PROJECT_NAME} POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_if_different $ - $) + $ + ) endforeach(qtlib) diff --git a/Fwk/AppFwk/cafTests/cafTestApplication/CMakeLists.txt b/Fwk/AppFwk/cafTests/cafTestApplication/CMakeLists.txt index 4e2184e049..88102d6e33 100644 --- a/Fwk/AppFwk/cafTests/cafTestApplication/CMakeLists.txt +++ b/Fwk/AppFwk/cafTests/cafTestApplication/CMakeLists.txt @@ -9,7 +9,8 @@ find_package(OpenGL) # Qt MOC set(MOC_HEADER_FILES MainWindow.h WidgetLayoutTest.h CustomObjectEditor.h - MenuItemProducer.h) + MenuItemProducer.h +) # Resource file set(QRC_FILES ${QRC_FILES} textedit.qrc) @@ -17,7 +18,8 @@ set(QRC_FILES ${QRC_FILES} textedit.qrc) find_package( Qt5 COMPONENTS - REQUIRED Core Gui Widgets OpenGL) + REQUIRED Core Gui Widgets OpenGL +) set(QT_LIBRARIES Qt5::Core Qt5::Gui Qt5::Widgets Qt5::OpenGL) qt5_wrap_cpp(MOC_SOURCE_FILES ${MOC_HEADER_FILES}) qt5_add_resources(QRC_FILES_CPP ${QRC_FILES}) @@ -42,7 +44,8 @@ set(PROJECT_FILES MenuItemProducer.cpp MenuItemProducer.h TamComboBox.h - TamComboBox.cpp) + TamComboBox.cpp +) # add the executable add_executable( @@ -71,8 +74,10 @@ if(${CMAKE_SYSTEM_NAME} MATCHES "Linux") list(APPEND EXTERNAL_LINK_LIBRARIES rt pthread) endif() -target_link_libraries(${PROJECT_NAME} ${TAP_LINK_LIBRARIES} ${QT_LIBRARIES} - ${EXTERNAL_LINK_LIBRARIES}) +target_link_libraries( + ${PROJECT_NAME} ${TAP_LINK_LIBRARIES} ${QT_LIBRARIES} + ${EXTERNAL_LINK_LIBRARIES} +) source_group("" FILES ${PROJECT_FILES}) @@ -81,5 +86,6 @@ foreach(qtlib ${QT_LIBRARIES}) TARGET ${PROJECT_NAME} POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_if_different $ - $) + $ + ) endforeach(qtlib) diff --git a/Fwk/AppFwk/cafTests/cafTestCvfApplication/CMakeLists.txt b/Fwk/AppFwk/cafTests/cafTestCvfApplication/CMakeLists.txt index 8f951a7e4c..dc8227f54f 100644 --- a/Fwk/AppFwk/cafTests/cafTestCvfApplication/CMakeLists.txt +++ b/Fwk/AppFwk/cafTests/cafTestCvfApplication/CMakeLists.txt @@ -11,7 +11,8 @@ set(QRC_FILES textedit.qrc) find_package( Qt5 COMPONENTS - REQUIRED Core Gui Widgets OpenGL) + REQUIRED Core Gui Widgets OpenGL +) set(QT_LIBRARIES Qt5::Core Qt5::Gui Qt5::Widgets Qt5::OpenGL) qt5_wrap_cpp(MOC_SOURCE_FILES ${MOC_HEADER_FILES}) qt5_add_resources(QRC_FILES_CPP ${QRC_FILES}) @@ -25,22 +26,27 @@ include_directories( ${LibRender_SOURCE_DIR} ${LibViewing_SOURCE_DIR} ${cafProjectDataModel_SOURCE_DIR} - ${cafUserInterface_SOURCE_DIR}) + ${cafUserInterface_SOURCE_DIR} +) if(USE_COMMAND_FRAMEWORK) include_directories(${cafCommand_SOURCE_DIR}) add_definitions(-DTAP_USE_COMMAND_FRAMEWORK) endif(USE_COMMAND_FRAMEWORK) -include_directories(${cafPdmCore_SOURCE_DIR} ${cafPdmUiCore_SOURCE_DIR} - ${cafPdmXml_SOURCE_DIR} ${cafPdmCvf_SOURCE_DIR}) +include_directories( + ${cafPdmCore_SOURCE_DIR} ${cafPdmUiCore_SOURCE_DIR} ${cafPdmXml_SOURCE_DIR} + ${cafPdmCvf_SOURCE_DIR} +) set(PROJECT_FILES Main.cpp MainWindow.cpp WidgetLayoutTest.cpp - TapCvfSpecialization.cpp TapProject.cpp) + TapCvfSpecialization.cpp TapProject.cpp +) # add the executable -add_executable(${PROJECT_NAME} ${PROJECT_FILES} ${MOC_SOURCE_FILES} - ${QRC_FILES_CPP}) +add_executable( + ${PROJECT_NAME} ${PROJECT_FILES} ${MOC_SOURCE_FILES} ${QRC_FILES_CPP} +) set(TAP_LINK_LIBRARIES cafUserInterface cafPdmXml cafPdmCvf ${QT_LIBRARIES}) @@ -57,5 +63,6 @@ foreach(qtlib ${QT_LIBRARIES}) TARGET ${PROJECT_NAME} POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_if_different $ - $) + $ + ) endforeach(qtlib) diff --git a/Fwk/AppFwk/cafUserInterface/CMakeLists.txt b/Fwk/AppFwk/cafUserInterface/CMakeLists.txt index bd36958fcc..15d71efcd3 100644 --- a/Fwk/AppFwk/cafUserInterface/CMakeLists.txt +++ b/Fwk/AppFwk/cafUserInterface/CMakeLists.txt @@ -52,12 +52,14 @@ set(MOC_HEADER_FILES cafPdmUniqueIdValidator.h cafPdmDoubleStringValidator.h cafPdmUiPickableLineEditor.h - cafPdmUiLabelEditor.h) + cafPdmUiLabelEditor.h +) find_package( Qt5 COMPONENTS - REQUIRED Core Gui Widgets) + REQUIRED Core Gui Widgets +) set(QT_LIBRARIES Qt5::Core Qt5::Gui Qt5::Widgets) qt5_wrap_cpp(MOC_SOURCE_FILES ${MOC_HEADER_FILES}) @@ -162,14 +164,17 @@ set(PROJECT_FILES cafStyleSheetTools.h cafStyleSheetTools.cpp cafPdmUiTabbedPropertyViewDialog.h - cafPdmUiTabbedPropertyViewDialog.cpp) + cafPdmUiTabbedPropertyViewDialog.cpp +) -add_library(${PROJECT_NAME} ${PROJECT_FILES} ${MOC_SOURCE_FILES} - ${QRC_FILES_CPP}) +add_library( + ${PROJECT_NAME} ${PROJECT_FILES} ${MOC_SOURCE_FILES} ${QRC_FILES_CPP} +) if(MSVC) - set_target_properties(${PROJECT_NAME} PROPERTIES COMPILE_FLAGS - "/W4 /wd4100 /wd4127") + set_target_properties( + ${PROJECT_NAME} PROPERTIES COMPILE_FLAGS "/W4 /wd4100 /wd4127" + ) endif() target_include_directories(${PROJECT_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) diff --git a/Fwk/AppFwk/cafUserInterface/cafUserInterface_UnitTests/CMakeLists.txt b/Fwk/AppFwk/cafUserInterface/cafUserInterface_UnitTests/CMakeLists.txt index 2c1fcccbab..e29067d251 100644 --- a/Fwk/AppFwk/cafUserInterface/cafUserInterface_UnitTests/CMakeLists.txt +++ b/Fwk/AppFwk/cafUserInterface/cafUserInterface_UnitTests/CMakeLists.txt @@ -9,28 +9,32 @@ if(CEE_USE_QT5) find_package( Qt5 COMPONENTS - REQUIRED Core Gui Widgets) + REQUIRED Core Gui Widgets + ) set(QT_LIBRARIES Qt5::Core Qt5::Gui Qt5::Widgets) else() find_package( Qt4 COMPONENTS QtCore QtGui QtMain - REQUIRED) + REQUIRED + ) include(${QT_USE_FILE}) endif(CEE_USE_QT5) include_directories(${CMAKE_CURRENT_SOURCE_DIR}) set(PROJECT_FILES cafUserInterface_UnitTests.cpp cafPdmUiTreeViewModelTest.cpp - cafPdmUiTreeSelectionQModelTest.cpp gtest/gtest-all.cpp) + cafPdmUiTreeSelectionQModelTest.cpp gtest/gtest-all.cpp +) # add the executable add_executable(${PROJECT_NAME} ${PROJECT_FILES}) source_group("" FILES ${PROJECT_FILES}) -target_link_libraries(${PROJECT_NAME} cafUserInterface ${QT_LIBRARIES} - ${THREAD_LIBRARY}) +target_link_libraries( + ${PROJECT_NAME} cafUserInterface ${QT_LIBRARIES} ${THREAD_LIBRARY} +) # Copy Qt Dlls if(Qt5Core_FOUND) @@ -39,7 +43,8 @@ if(Qt5Core_FOUND) TARGET ${PROJECT_NAME} POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_if_different $ - $) + $ + ) endforeach(qtlib) # Copy Qt Dlls else() @@ -51,12 +56,14 @@ else() # Debug execute_process( COMMAND cmake -E copy_if_different ${QT_BINARY_DIR}/${qtlib}d4.dll - ${CMAKE_BINARY_DIR}/Debug/${qtlib}d4.dll) + ${CMAKE_BINARY_DIR}/Debug/${qtlib}d4.dll + ) # Release execute_process( COMMAND cmake -E copy_if_different ${QT_BINARY_DIR}/${qtlib}4.dll - ${CMAKE_BINARY_DIR}/Release/${qtlib}4.dll) + ${CMAKE_BINARY_DIR}/Release/${qtlib}4.dll + ) endforeach(qtlib) endif(MSVC) endif(Qt5Core_FOUND) diff --git a/Fwk/AppFwk/cafViewer/CMakeLists.txt b/Fwk/AppFwk/cafViewer/CMakeLists.txt index 441ca54b1d..6d14359ce3 100644 --- a/Fwk/AppFwk/cafViewer/CMakeLists.txt +++ b/Fwk/AppFwk/cafViewer/CMakeLists.txt @@ -16,7 +16,8 @@ set(MOC_HEADER_FILES cafViewer.h) find_package( Qt5 COMPONENTS - REQUIRED Core Gui Widgets OpenGL) + REQUIRED Core Gui Widgets OpenGL +) set(QT_LIBRARIES Qt5::Core Qt5::Gui Qt5::Widgets Qt5::OpenGL) qt5_wrap_cpp(MOC_SOURCE_FILES ${MOC_HEADER_FILES}) @@ -37,7 +38,8 @@ add_library( cafOpenGLWidget.h cafViewer.cpp cafViewer.h - ${MOC_SOURCE_FILES}) + ${MOC_SOURCE_FILES} +) target_include_directories(${PROJECT_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) @@ -49,11 +51,13 @@ target_link_libraries( LibRender LibGuiQt cafAnimControl - ${QT_LIBRARIES}) + ${QT_LIBRARIES} +) if(MSVC) - set_target_properties(${PROJECT_NAME} PROPERTIES COMPILE_FLAGS - "/W4 /wd4100 /wd4127") + set_target_properties( + ${PROJECT_NAME} PROPERTIES COMPILE_FLAGS "/W4 /wd4100 /wd4127" + ) endif() source_group("" FILES ${PROJECT_FILES}) diff --git a/Fwk/AppFwk/cafVizExtensions/CMakeLists.txt b/Fwk/AppFwk/cafVizExtensions/CMakeLists.txt index e1930b6de5..509082cd05 100644 --- a/Fwk/AppFwk/cafVizExtensions/CMakeLists.txt +++ b/Fwk/AppFwk/cafVizExtensions/CMakeLists.txt @@ -15,7 +15,8 @@ find_package(OpenGL) find_package( Qt5 COMPONENTS - REQUIRED Core Gui Widgets OpenGL) + REQUIRED Core Gui Widgets OpenGL +) set(QT_LIBRARIES Qt5::Core Qt5::Gui Qt5::Widgets Qt5::OpenGL) qt5_wrap_cpp(MOC_SOURCE_FILES ${MOC_HEADER_FILES}) @@ -49,7 +50,8 @@ add_library( TranspWB_PartlyTranspPartsFrag.glsl TranspWB_TransparentPartsFrag.glsl cafHexGridIntersectionTools/cafHexGridIntersectionTools.h - cafHexGridIntersectionTools/cafHexGridIntersectionTools.cpp) + cafHexGridIntersectionTools/cafHexGridIntersectionTools.cpp +) target_include_directories(${PROJECT_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) @@ -61,6 +63,7 @@ target_link_libraries( LibRender LibGuiQt CommonCode - ${QT_LIBRARIES}) + ${QT_LIBRARIES} +) source_group("" FILES ${PROJECT_FILES}) diff --git a/Fwk/AppFwk/cafVizExtensions/cafHexGridIntersectionTools/cafHexGridIntersectionTools_UnitTest/CMakeLists.txt b/Fwk/AppFwk/cafVizExtensions/cafHexGridIntersectionTools/cafHexGridIntersectionTools_UnitTest/CMakeLists.txt index d8dede727a..4838dcce1d 100644 --- a/Fwk/AppFwk/cafVizExtensions/cafHexGridIntersectionTools/cafHexGridIntersectionTools_UnitTest/CMakeLists.txt +++ b/Fwk/AppFwk/cafVizExtensions/cafHexGridIntersectionTools/cafHexGridIntersectionTools_UnitTest/CMakeLists.txt @@ -21,7 +21,8 @@ include_directories(${CMAKE_CURRENT_SOURCE_DIR} # required for gtest-all.cpp set(PROJECT_FILES cafHexGridIntersectionToolsBasicTests.cpp cafHexGridIntersectionTools_UnitTests_main.cpp - ../cafHexGridIntersectionTools.cpp ../cafHexGridIntersectionTools.h) + ../cafHexGridIntersectionTools.cpp ../cafHexGridIntersectionTools.h +) # add the executable add_executable(${PROJECT_NAME} ${PROJECT_FILES} gtest/gtest-all.cpp) diff --git a/cmake/cmake-format.py b/cmake/cmake-format.py index 2d18340701..3dde4ae4ac 100644 --- a/cmake/cmake-format.py +++ b/cmake/cmake-format.py @@ -17,4 +17,4 @@ # If a statement is wrapped to more than one line, than dangle the closing # parenthesis on its own line. - dangle_parens = False + dangle_parens = True From be29b278f255f7b2e54cef6383865b436e65b750 Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Wed, 1 Sep 2021 08:25:22 +0200 Subject: [PATCH 094/308] #7929 Python : Avoid creation of new view when opening case --- .../Tools/RiaImportEclipseCaseTools.cpp | 47 +++++++++++++------ .../Tools/RiaImportEclipseCaseTools.h | 6 ++- .../CommandFileInterface/RicfCreateView.cpp | 4 +- .../CommandFileInterface/RicfLoadCase.cpp | 7 ++- ...cImportGridModelFromSummaryCaseFeature.cpp | 3 +- .../RimEnsembleFractureStatistics.cpp | 2 +- .../ProjectDataModel/RimEclipseCase.cpp | 6 +-- .../Python/rips/PythonExamples/load_case.py | 1 + .../Python/rips/tests/test_properties.py | 3 +- .../rips/tests/test_simulation_wells.py | 1 + 10 files changed, 53 insertions(+), 27 deletions(-) diff --git a/ApplicationLibCode/Application/Tools/RiaImportEclipseCaseTools.cpp b/ApplicationLibCode/Application/Tools/RiaImportEclipseCaseTools.cpp index 48bbf3432c..fc484bf6bf 100644 --- a/ApplicationLibCode/Application/Tools/RiaImportEclipseCaseTools.cpp +++ b/ApplicationLibCode/Application/Tools/RiaImportEclipseCaseTools.cpp @@ -70,6 +70,7 @@ /// //-------------------------------------------------------------------------------------------------- bool RiaImportEclipseCaseTools::openEclipseCasesFromFile( const QStringList& fileNames, + bool createView, FileCaseIdMap* openedFilesOut, bool noDialog ) { @@ -87,7 +88,7 @@ bool RiaImportEclipseCaseTools::openEclipseCasesFromFile( const QStringList& fil // Import eclipse case files for ( const QString& gridCaseFile : selector.gridCaseFiles() ) { - int caseId = RiaImportEclipseCaseTools::openEclipseCaseFromFile( gridCaseFile ); + int caseId = RiaImportEclipseCaseTools::openEclipseCaseFromFile( gridCaseFile, createView ); if ( caseId >= 0 ) { openedFiles.insert( std::make_pair( gridCaseFile, caseId ) ); @@ -223,11 +224,11 @@ bool RiaImportEclipseCaseTools::openEclipseCasesFromFile( const QStringList& fil //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -int RiaImportEclipseCaseTools::openEclipseCaseFromFile( const QString& fileName ) +int RiaImportEclipseCaseTools::openEclipseCaseFromFile( const QString& fileName, bool createView ) { if ( !caf::Utils::fileExists( fileName ) ) return -1; - return RiaImportEclipseCaseTools::openEclipseCaseShowTimeStepFilterImpl( fileName, false ); + return RiaImportEclipseCaseTools::openEclipseCaseShowTimeStepFilterImpl( fileName, createView, false ); } //-------------------------------------------------------------------------------------------------- @@ -237,7 +238,8 @@ bool RiaImportEclipseCaseTools::openEclipseCaseShowTimeStepFilter( const QString { if ( !caf::Utils::fileExists( fileName ) ) return false; - return RiaImportEclipseCaseTools::openEclipseCaseShowTimeStepFilterImpl( fileName, true ) >= 0; + bool createView = true; + return RiaImportEclipseCaseTools::openEclipseCaseShowTimeStepFilterImpl( fileName, createView, true ) >= 0; } //-------------------------------------------------------------------------------------------------- @@ -294,13 +296,16 @@ int RiaImportEclipseCaseTools::openEclipseInputCaseFromFileNames( const QStringL //-------------------------------------------------------------------------------------------------- bool RiaImportEclipseCaseTools::openMockModel( const QString& name ) { - return RiaImportEclipseCaseTools::openEclipseCaseShowTimeStepFilterImpl( name, false ); + bool createView = true; + return RiaImportEclipseCaseTools::openEclipseCaseShowTimeStepFilterImpl( name, createView, false ); } //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -int RiaImportEclipseCaseTools::openEclipseCaseShowTimeStepFilterImpl( const QString& fileName, bool showTimeStepFilter ) +int RiaImportEclipseCaseTools::openEclipseCaseShowTimeStepFilterImpl( const QString& fileName, + bool showTimeStepFilter, + bool createView ) { QFileInfo gridFileName( fileName ); QString caseName = gridFileName.completeBaseName(); @@ -335,21 +340,33 @@ int RiaImportEclipseCaseTools::openEclipseCaseShowTimeStepFilterImpl( const QStr return -1; } - RimEclipseView* riv = rimResultReservoir->createAndAddReservoirView(); + if ( createView ) + { + RimEclipseView* riv = rimResultReservoir->createAndAddReservoirView(); - riv->loadDataAndUpdate(); + riv->loadDataAndUpdate(); - if ( !riv->cellResult()->hasResult() ) - { - riv->cellResult()->setResultVariable( RiaResultNames::undefinedResultName() ); - } + if ( !riv->cellResult()->hasResult() ) + { + riv->cellResult()->setResultVariable( RiaResultNames::undefinedResultName() ); + } - analysisModels->updateConnectedEditors(); + analysisModels->updateConnectedEditors(); - if ( RiaGuiApplication::isRunning() ) + if ( RiaGuiApplication::isRunning() ) + { + RiuMainWindow::instance()->selectAsCurrentItem( riv->cellResult() ); + } + } + else { - RiuMainWindow::instance()->selectAsCurrentItem( riv->cellResult() ); + // Make sure the placeholder result entries are created, as this functionality is triggered when creating a + // view. See RimEclipseView::onLoadDataAndUpdate() and the call to openReserviorCase() + rimResultReservoir->openReserviorCase(); + + analysisModels->updateConnectedEditors(); } + return rimResultReservoir->caseId(); } diff --git a/ApplicationLibCode/Application/Tools/RiaImportEclipseCaseTools.h b/ApplicationLibCode/Application/Tools/RiaImportEclipseCaseTools.h index 5c809df264..8b095fbae2 100644 --- a/ApplicationLibCode/Application/Tools/RiaImportEclipseCaseTools.h +++ b/ApplicationLibCode/Application/Tools/RiaImportEclipseCaseTools.h @@ -34,8 +34,10 @@ class RiaImportEclipseCaseTools typedef std::map FileCaseIdMap; static bool openEclipseCasesFromFile( const QStringList& fileNames, + bool createView, FileCaseIdMap* openedFilesOut = nullptr, bool noDialog = false ); + static bool openEclipseCaseShowTimeStepFilter( const QString& fileName ); static int openEclipseInputCaseFromFileNames( const QStringList& fileNames, QString* fileContainingGrid = nullptr ); @@ -43,8 +45,8 @@ class RiaImportEclipseCaseTools static bool addEclipseCases( const QStringList& fileNames, RimIdenticalGridCaseGroup** resultingCaseGroup = nullptr ); - static int openEclipseCaseFromFile( const QString& fileName ); + static int openEclipseCaseFromFile( const QString& fileName, bool createView ); private: - static int openEclipseCaseShowTimeStepFilterImpl( const QString& fileName, bool showTimeStepFilter ); + static int openEclipseCaseShowTimeStepFilterImpl( const QString& fileName, bool showTimeStepFilter, bool createView ); }; diff --git a/ApplicationLibCode/CommandFileInterface/RicfCreateView.cpp b/ApplicationLibCode/CommandFileInterface/RicfCreateView.cpp index cb5825c415..af3e6f1796 100644 --- a/ApplicationLibCode/CommandFileInterface/RicfCreateView.cpp +++ b/ApplicationLibCode/CommandFileInterface/RicfCreateView.cpp @@ -56,16 +56,16 @@ caf::PdmScriptResponse RicfCreateView::execute() if ( eclipseCase ) { RimEclipseView* view = eclipseCase->createAndAddReservoirView(); - viewId = view->id(); view->loadDataAndUpdate(); + viewId = view->id(); eclipseCase->updateConnectedEditors(); Riu3DMainWindowTools::setExpanded( view ); } else if ( geoMechCase ) { RimGeoMechView* view = geoMechCase->createAndAddReservoirView(); - viewId = view->id(); view->loadDataAndUpdate(); + viewId = view->id(); geoMechCase->updateConnectedEditors(); Riu3DMainWindowTools::setExpanded( view ); } diff --git a/ApplicationLibCode/CommandFileInterface/RicfLoadCase.cpp b/ApplicationLibCode/CommandFileInterface/RicfLoadCase.cpp index 764039e1cc..2e7a87f993 100644 --- a/ApplicationLibCode/CommandFileInterface/RicfLoadCase.cpp +++ b/ApplicationLibCode/CommandFileInterface/RicfLoadCase.cpp @@ -64,7 +64,12 @@ caf::PdmScriptResponse RicfLoadCase::execute() } RiaImportEclipseCaseTools::FileCaseIdMap fileCaseIdMap; - bool ok = RiaImportEclipseCaseTools::openEclipseCasesFromFile( QStringList( { absolutePath } ), &fileCaseIdMap, true ); + bool createView = false; + bool doNotShowDialog = true; + bool ok = RiaImportEclipseCaseTools::openEclipseCasesFromFile( QStringList( { absolutePath } ), + createView, + &fileCaseIdMap, + doNotShowDialog ); if ( !ok ) { QString error = QString( "loadCase: Unable to load case from %1" ).arg( absolutePath ); diff --git a/ApplicationLibCode/Commands/RicImportGridModelFromSummaryCaseFeature.cpp b/ApplicationLibCode/Commands/RicImportGridModelFromSummaryCaseFeature.cpp index 53b626a1c9..44710aed8b 100644 --- a/ApplicationLibCode/Commands/RicImportGridModelFromSummaryCaseFeature.cpp +++ b/ApplicationLibCode/Commands/RicImportGridModelFromSummaryCaseFeature.cpp @@ -51,7 +51,8 @@ bool RicImportGridModelFromSummaryCaseFeature::openOrImportGridModelFromSummaryC if ( QFileInfo::exists( candidateGridFileName ) ) { - auto id = RiaImportEclipseCaseTools::openEclipseCaseFromFile( candidateGridFileName ); + bool createView = true; + auto id = RiaImportEclipseCaseTools::openEclipseCaseFromFile( candidateGridFileName, createView ); if ( id > -1 ) { RiaLogging::info( QString( "Imported %1" ).arg( candidateGridFileName ) ); diff --git a/ApplicationLibCode/ProjectDataModel/Completions/RimEnsembleFractureStatistics.cpp b/ApplicationLibCode/ProjectDataModel/Completions/RimEnsembleFractureStatistics.cpp index 7c62cfd989..92e8e2be1a 100644 --- a/ApplicationLibCode/ProjectDataModel/Completions/RimEnsembleFractureStatistics.cpp +++ b/ApplicationLibCode/ProjectDataModel/Completions/RimEnsembleFractureStatistics.cpp @@ -935,7 +935,7 @@ void RimEnsembleFractureStatistics::sampleAllGrids( const std::vector& samplesY, std::vector>& samples ) { - const int ny = samplesY.size(); + const int ny = static_cast( samplesY.size() ); #pragma omp parallel for for ( int y = 0; y < ny; y++ ) { diff --git a/ApplicationLibCode/ProjectDataModel/RimEclipseCase.cpp b/ApplicationLibCode/ProjectDataModel/RimEclipseCase.cpp index dbbc57228e..e769651144 100644 --- a/ApplicationLibCode/ProjectDataModel/RimEclipseCase.cpp +++ b/ApplicationLibCode/ProjectDataModel/RimEclipseCase.cpp @@ -905,10 +905,8 @@ void RimEclipseCase::setFilesContainingFaults( const std::vector& pathS //-------------------------------------------------------------------------------------------------- bool RimEclipseCase::ensureReservoirCaseIsOpen() { - if ( m_rigEclipseCase.notNull() ) - { - return true; - } + // Call openReserviorCase, as this is a cheap method to call multiple times + // Add extra testing here if performance issues are seen return openReserviorCase(); } diff --git a/GrpcInterface/Python/rips/PythonExamples/load_case.py b/GrpcInterface/Python/rips/PythonExamples/load_case.py index 7652992898..002a601e84 100644 --- a/GrpcInterface/Python/rips/PythonExamples/load_case.py +++ b/GrpcInterface/Python/rips/PythonExamples/load_case.py @@ -17,6 +17,7 @@ test_models_path, "TEST10K_FLT_LGR_NNC/TEST10K_FLT_LGR_NNC.EGRID" ) case = resinsight.project.load_case(path_name) +case.create_view() # Print out lots of information from the case object print("Case id: " + str(case.id)) diff --git a/GrpcInterface/Python/rips/tests/test_properties.py b/GrpcInterface/Python/rips/tests/test_properties.py index 4fb8647a9f..18224dd10a 100644 --- a/GrpcInterface/Python/rips/tests/test_properties.py +++ b/GrpcInterface/Python/rips/tests/test_properties.py @@ -101,7 +101,8 @@ def test_10k_PoroPermX(rips_instance, initialize_test): def test_exportPropertyInView(rips_instance, initialize_test): case_path = dataroot.PATH + "/TEST10K_FLT_LGR_NNC/TEST10K_FLT_LGR_NNC.EGRID" - rips_instance.project.load_case(case_path) + case = rips_instance.project.load_case(case_path) + case.create_view() with tempfile.TemporaryDirectory(prefix="rips") as tmpdirname: print("Temporary folder: ", tmpdirname) rips_instance.set_export_folder(export_type="PROPERTIES", path=tmpdirname) diff --git a/GrpcInterface/Python/rips/tests/test_simulation_wells.py b/GrpcInterface/Python/rips/tests/test_simulation_wells.py index 6ff8d65ba3..798d6e78c1 100644 --- a/GrpcInterface/Python/rips/tests/test_simulation_wells.py +++ b/GrpcInterface/Python/rips/tests/test_simulation_wells.py @@ -10,6 +10,7 @@ def test_10k(rips_instance, initialize_test): case_path = dataroot.PATH + "/TEST10K_FLT_LGR_NNC/TEST10K_FLT_LGR_NNC.EGRID" case = rips_instance.project.load_case(path=case_path) + case.create_view() assert len(case.grids()) == 2 cell_count_info = case.cell_count() From 16ec5f793a000f2bd1ba7f7107c0e7f9aa0994e7 Mon Sep 17 00:00:00 2001 From: Kristian Bendiksen Date: Wed, 1 Sep 2021 09:34:40 +0200 Subject: [PATCH 095/308] Fix incorrect argument order when loading eclipse grid. (#7937) --- .../Application/Tools/RiaImportEclipseCaseTools.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/ApplicationLibCode/Application/Tools/RiaImportEclipseCaseTools.cpp b/ApplicationLibCode/Application/Tools/RiaImportEclipseCaseTools.cpp index fc484bf6bf..15f83dd258 100644 --- a/ApplicationLibCode/Application/Tools/RiaImportEclipseCaseTools.cpp +++ b/ApplicationLibCode/Application/Tools/RiaImportEclipseCaseTools.cpp @@ -228,7 +228,8 @@ int RiaImportEclipseCaseTools::openEclipseCaseFromFile( const QString& fileName, { if ( !caf::Utils::fileExists( fileName ) ) return -1; - return RiaImportEclipseCaseTools::openEclipseCaseShowTimeStepFilterImpl( fileName, createView, false ); + bool showTimeStepFilter = false; + return RiaImportEclipseCaseTools::openEclipseCaseShowTimeStepFilterImpl( fileName, showTimeStepFilter, createView ); } //-------------------------------------------------------------------------------------------------- @@ -238,8 +239,9 @@ bool RiaImportEclipseCaseTools::openEclipseCaseShowTimeStepFilter( const QString { if ( !caf::Utils::fileExists( fileName ) ) return false; - bool createView = true; - return RiaImportEclipseCaseTools::openEclipseCaseShowTimeStepFilterImpl( fileName, createView, true ) >= 0; + bool showTimeStepFilter = true; + bool createView = true; + return RiaImportEclipseCaseTools::openEclipseCaseShowTimeStepFilterImpl( fileName, showTimeStepFilter, createView ) >= 0; } //-------------------------------------------------------------------------------------------------- @@ -296,8 +298,9 @@ int RiaImportEclipseCaseTools::openEclipseInputCaseFromFileNames( const QStringL //-------------------------------------------------------------------------------------------------- bool RiaImportEclipseCaseTools::openMockModel( const QString& name ) { - bool createView = true; - return RiaImportEclipseCaseTools::openEclipseCaseShowTimeStepFilterImpl( name, createView, false ); + bool showTimeStepFilter = false; + bool createView = true; + return RiaImportEclipseCaseTools::openEclipseCaseShowTimeStepFilterImpl( name, showTimeStepFilter, createView ); } //-------------------------------------------------------------------------------------------------- From b397c230acfd8115ba3421c005f0a3916d269008 Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Thu, 2 Sep 2021 08:55:35 +0200 Subject: [PATCH 096/308] #7940 Python : Traverse inheritance stack to find correct script class name --- .../ProjectDataModel/RimEclipseView.cpp | 4 +- .../RigCaseCellResultsData.cpp | 1 - ...afPdmObjectScriptingCapabilityRegister.cpp | 10 ++++- .../cafPdmObjectScriptingCapabilityRegister.h | 1 + GrpcInterface/RiaGrpcServiceInterface.cpp | 37 +++++++++++++++---- 5 files changed, 43 insertions(+), 10 deletions(-) diff --git a/ApplicationLibCode/ProjectDataModel/RimEclipseView.cpp b/ApplicationLibCode/ProjectDataModel/RimEclipseView.cpp index 6e184e5e4e..0438de752e 100644 --- a/ApplicationLibCode/ProjectDataModel/RimEclipseView.cpp +++ b/ApplicationLibCode/ProjectDataModel/RimEclipseView.cpp @@ -2082,6 +2082,8 @@ std::vector RimEclipseView::currentCellResultData() const std::vector resultData; if ( currentGridCellResults() && cellResult() ) { + if ( !currentGridCellResults()->hasResultEntry( cellResult()->eclipseResultAddress() ) ) return {}; + int timeStep = 0; if ( cellResult()->hasDynamicResult() ) { @@ -2097,7 +2099,7 @@ std::vector RimEclipseView::currentCellResultData() const //-------------------------------------------------------------------------------------------------- void RimEclipseView::setCurrentCellResultData( const std::vector& values ) { - if ( currentGridCellResults() && cellResult() ) + if ( !values.empty() && currentGridCellResults() && cellResult() ) { int timeStep = 0; if ( cellResult()->hasDynamicResult() ) diff --git a/ApplicationLibCode/ReservoirDataModel/RigCaseCellResultsData.cpp b/ApplicationLibCode/ReservoirDataModel/RigCaseCellResultsData.cpp index 11e0488fdc..58c9cefb63 100644 --- a/ApplicationLibCode/ReservoirDataModel/RigCaseCellResultsData.cpp +++ b/ApplicationLibCode/ReservoirDataModel/RigCaseCellResultsData.cpp @@ -520,7 +520,6 @@ const RigActiveCellInfo* RigCaseCellResultsData::activeCellInfo() const void RigCaseCellResultsData::recalculateStatistics( const RigEclipseResultAddress& resVarAddr ) { size_t scalarResultIndex = findScalarResultIndexFromAddress( resVarAddr ); - CVF_TIGHT_ASSERT( scalarResultIndex < m_cellScalarResults.size() ); if ( scalarResultIndex < m_cellScalarResults.size() ) { m_statisticsDataCache[scalarResultIndex]->clearAllStatistics(); diff --git a/Fwk/AppFwk/cafPdmScripting/cafPdmObjectScriptingCapabilityRegister.cpp b/Fwk/AppFwk/cafPdmScripting/cafPdmObjectScriptingCapabilityRegister.cpp index c0af5ac044..20bc993e6b 100644 --- a/Fwk/AppFwk/cafPdmScripting/cafPdmObjectScriptingCapabilityRegister.cpp +++ b/Fwk/AppFwk/cafPdmScripting/cafPdmObjectScriptingCapabilityRegister.cpp @@ -99,5 +99,13 @@ QString PdmObjectScriptingCapabilityRegister::scriptClassComment( const QString& //-------------------------------------------------------------------------------------------------- bool PdmObjectScriptingCapabilityRegister::isScriptable( const caf::PdmObject* object ) { - return s_classKeywordToScriptClassName.find( object->classKeyword() ) != s_classKeywordToScriptClassName.end(); + return isScriptable( object->classKeyword() ); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +bool PdmObjectScriptingCapabilityRegister::isScriptable( const QString& classKeyword ) +{ + return s_classKeywordToScriptClassName.find( classKeyword ) != s_classKeywordToScriptClassName.end(); } diff --git a/Fwk/AppFwk/cafPdmScripting/cafPdmObjectScriptingCapabilityRegister.h b/Fwk/AppFwk/cafPdmScripting/cafPdmObjectScriptingCapabilityRegister.h index 5ed5915a3e..6177bee7f2 100644 --- a/Fwk/AppFwk/cafPdmScripting/cafPdmObjectScriptingCapabilityRegister.h +++ b/Fwk/AppFwk/cafPdmScripting/cafPdmObjectScriptingCapabilityRegister.h @@ -57,6 +57,7 @@ class PdmObjectScriptingCapabilityRegister static QString scriptClassComment( const QString& classKeyword ); static bool isScriptable( const caf::PdmObject* object ); + static bool isScriptable( const QString& classKeyword ); private: static std::map s_classKeywordToScriptClassName; diff --git a/GrpcInterface/RiaGrpcServiceInterface.cpp b/GrpcInterface/RiaGrpcServiceInterface.cpp index a7e26290f4..5a18e7c26e 100644 --- a/GrpcInterface/RiaGrpcServiceInterface.cpp +++ b/GrpcInterface/RiaGrpcServiceInterface.cpp @@ -73,15 +73,39 @@ void RiaGrpcServiceInterface::copyPdmObjectFromCafToRips( const caf::PdmObjectHa CAF_ASSERT( source && destination && source->xmlCapability() ); QString classKeyword = source->xmlCapability()->classKeyword(); - QString scriptName = caf::PdmObjectScriptingCapabilityRegister::scriptClassNameFromClassKeyword( classKeyword ); - destination->set_class_keyword( scriptName.toStdString() ); + + QString scriptClassName; + + // Find first scriptable object in inheritance stack + { + auto pdmObject = dynamic_cast( source ); + auto classKeywordStack = pdmObject->classInheritanceStack(); + + // Reverse to get leaf node first + classKeywordStack.reverse(); + + for ( const auto& candidateClassKeyword : classKeywordStack ) + { + if ( caf::PdmObjectScriptingCapabilityRegister::isScriptable( candidateClassKeyword ) ) + { + scriptClassName = + caf::PdmObjectScriptingCapabilityRegister::scriptClassNameFromClassKeyword( candidateClassKeyword ); + + break; + } + } + + // Fallback to source object class name + if ( scriptClassName.isEmpty() ) scriptClassName = classKeyword; + } + + destination->set_class_keyword( scriptClassName.toStdString() ); destination->set_address( reinterpret_cast( source ) ); bool visible = true; if ( source->uiCapability() && source->uiCapability()->objectToggleField() ) { - const caf::PdmField* boolField = - dynamic_cast*>( source->uiCapability()->objectToggleField() ); + const auto* boolField = dynamic_cast*>( source->uiCapability()->objectToggleField() ); if ( boolField ) { visible = boolField->value(); @@ -124,8 +148,7 @@ void RiaGrpcServiceInterface::copyPdmObjectFromRipsToCaf( const rips::PdmObject* if ( destination->uiCapability() && destination->uiCapability()->objectToggleField() ) { - caf::PdmField* boolField = - dynamic_cast*>( destination->uiCapability()->objectToggleField() ); + auto* boolField = dynamic_cast*>( destination->uiCapability()->objectToggleField() ); if ( boolField ) { QVariant oldValue = boolField->toQVariant(); @@ -185,7 +208,7 @@ bool RiaGrpcServiceInterface::assignFieldValue( const QString& stringValue auto scriptability = field->template capability(); if ( field && scriptability != nullptr ) { - caf::PdmValueField* valueField = dynamic_cast( field ); + auto* valueField = dynamic_cast( field ); QTextStream stream( stringValue.toLatin1() ); caf::PdmScriptIOMessages messages; if ( valueField ) *oldValue = valueField->toQVariant(); From 97d678d9e8c5f0fd51872dcf1c9f4adfa18e0f68 Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Thu, 2 Sep 2021 09:07:53 +0200 Subject: [PATCH 097/308] #7933 Export Snapshot : Fix failing example --- .../Python/rips/PythonExamples/export_snapshots.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/GrpcInterface/Python/rips/PythonExamples/export_snapshots.py b/GrpcInterface/Python/rips/PythonExamples/export_snapshots.py index 1acb77ef18..8d12013312 100644 --- a/GrpcInterface/Python/rips/PythonExamples/export_snapshots.py +++ b/GrpcInterface/Python/rips/PythonExamples/export_snapshots.py @@ -36,11 +36,10 @@ print("Number of time_steps: " + str(len(time_steps))) for view in case.views(): - if view.is_eclipse_view(): - for property in property_list: - view.apply_cell_result( - result_type="DYNAMIC_NATIVE", result_variable=property - ) + for property in property_list: + view.apply_cell_result( + result_type="DYNAMIC_NATIVE", result_variable=property + ) for time_step in range(0, len(time_steps), 10): view.set_time_step(time_step=time_step) view.export_snapshot() From e961dce97d9e4ef825573f7915a69da7d1d5de93 Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Thu, 2 Sep 2021 13:15:14 +0200 Subject: [PATCH 098/308] #7944 Cell selection: Avoid crash for Pflotran simulation case --- .../ReservoirDataModel/RigFlowDiagSolverInterface.cpp | 10 +++++----- ThirdParty/Ert/lib/ecl/ecl_grid.cpp | 3 +-- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/ApplicationLibCode/ReservoirDataModel/RigFlowDiagSolverInterface.cpp b/ApplicationLibCode/ReservoirDataModel/RigFlowDiagSolverInterface.cpp index 85b20e8eda..e3ebbb1781 100644 --- a/ApplicationLibCode/ReservoirDataModel/RigFlowDiagSolverInterface.cpp +++ b/ApplicationLibCode/ReservoirDataModel/RigFlowDiagSolverInterface.cpp @@ -121,13 +121,13 @@ class RigOpmFlowDiagStaticData : public cvf::Object { Opm::ECLInitFileData initData( init ); - m_eclGraph.reset( new Opm::ECLGraph( Opm::ECLGraph::load( mainGrid, initData ) ) ); - - m_hasUnifiedRestartFile = false; - m_poreVolume = m_eclGraph->poreVolume(); - try { + m_eclGraph.reset( new Opm::ECLGraph( Opm::ECLGraph::load( mainGrid, initData ) ) ); + + m_hasUnifiedRestartFile = false; + m_poreVolume = m_eclGraph->poreVolume(); + m_eclSaturationFunc.reset( new Opm::ECLSaturationFunc( *m_eclGraph, initData ) ); } catch ( ... ) diff --git a/ThirdParty/Ert/lib/ecl/ecl_grid.cpp b/ThirdParty/Ert/lib/ecl/ecl_grid.cpp index 6c5140dc12..5877f15a71 100644 --- a/ThirdParty/Ert/lib/ecl/ecl_grid.cpp +++ b/ThirdParty/Ert/lib/ecl/ecl_grid.cpp @@ -6369,8 +6369,7 @@ static bool ecl_grid_init_coord_section__( const ecl_grid_type * grid , int i, i const int top_index = ecl_grid_get_top_valid_index( grid , i , j ); const int bottom_index = ecl_grid_get_bottom_valid_index( grid , i , j ); - if (top_index == -1) - util_exit("% : no cell with a valid geometry description found in (i,j) = %d,%d - then what? \n",__func__ , i,j); + if (top_index == -1) return false; { point_type top_point; From 640c59d682ca129114b4f1a338968bf214fe9a75 Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Thu, 2 Sep 2021 15:09:50 +0200 Subject: [PATCH 099/308] #7942 Summary Plot: Make reading of summary data file more robust - remove the gsl::not_null for pointer to curve data - For summary cases linked to a grid model case, do not try to read the original location of file if grid file location is not valid (will happen when a project file is moved) --- .../Application/RiaSummaryCurveDefinition.cpp | 6 +++--- .../Application/RiaSummaryCurveDefinition.h | 5 ++--- .../ProjectDataModel/Summary/RimGridSummaryCase.cpp | 8 ++++++-- ThirdParty/Ert/lib/ecl/ecl_grid.cpp | 2 ++ 4 files changed, 13 insertions(+), 8 deletions(-) diff --git a/ApplicationLibCode/Application/RiaSummaryCurveDefinition.cpp b/ApplicationLibCode/Application/RiaSummaryCurveDefinition.cpp index c95062c8ad..4dc0d45ecf 100644 --- a/ApplicationLibCode/Application/RiaSummaryCurveDefinition.cpp +++ b/ApplicationLibCode/Application/RiaSummaryCurveDefinition.cpp @@ -37,7 +37,7 @@ RiaSummaryCurveDefinition::RiaSummaryCurveDefinition() //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -RiaSummaryCurveDefinition::RiaSummaryCurveDefinition( gsl::not_null summaryCase, +RiaSummaryCurveDefinition::RiaSummaryCurveDefinition( RimSummaryCase* summaryCase, const RifEclipseSummaryAddress& summaryAddress, bool isEnsembleCurve ) : m_summaryCase( summaryCase ) @@ -55,8 +55,8 @@ RiaSummaryCurveDefinition::RiaSummaryCurveDefinition( gsl::not_null ensemble, - const RifEclipseSummaryAddress& summaryAddress ) +RiaSummaryCurveDefinition::RiaSummaryCurveDefinition( RimSummaryCaseCollection* ensemble, + const RifEclipseSummaryAddress& summaryAddress ) : m_summaryCase( nullptr ) , m_summaryAddress( summaryAddress ) , m_ensemble( ensemble ) diff --git a/ApplicationLibCode/Application/RiaSummaryCurveDefinition.h b/ApplicationLibCode/Application/RiaSummaryCurveDefinition.h index 7e7e081022..9aeb40a761 100644 --- a/ApplicationLibCode/Application/RiaSummaryCurveDefinition.h +++ b/ApplicationLibCode/Application/RiaSummaryCurveDefinition.h @@ -37,11 +37,10 @@ class RiaSummaryCurveDefinition { public: RiaSummaryCurveDefinition(); - explicit RiaSummaryCurveDefinition( gsl::not_null summaryCase, + explicit RiaSummaryCurveDefinition( RimSummaryCase* summaryCase, const RifEclipseSummaryAddress& summaryAddress, bool isEnsembleCurve ); - explicit RiaSummaryCurveDefinition( gsl::not_null ensemble, - const RifEclipseSummaryAddress& summaryAddress ); + explicit RiaSummaryCurveDefinition( RimSummaryCaseCollection* ensemble, const RifEclipseSummaryAddress& summaryAddress ); RimSummaryCase* summaryCase() const; const RifEclipseSummaryAddress& summaryAddress() const; diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimGridSummaryCase.cpp b/ApplicationLibCode/ProjectDataModel/Summary/RimGridSummaryCase.cpp index cdb70dae51..8b2adcbee9 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimGridSummaryCase.cpp +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimGridSummaryCase.cpp @@ -145,9 +145,13 @@ RimEclipseCase* RimGridSummaryCase::associatedEclipseCase() //-------------------------------------------------------------------------------------------------- QString RimGridSummaryCase::summaryHeaderFilename() const { - if ( !m_eclipseCase() ) return m_summaryHeaderFilename().path(); + if ( m_eclipseCase() ) + { + auto candidate = summaryHeaderFilenameFromEclipseCase( m_eclipseCase ); + if ( QFileInfo::exists( candidate ) ) return candidate; + } - return summaryHeaderFilenameFromEclipseCase( m_eclipseCase() ); + return m_summaryHeaderFilename().path(); } //-------------------------------------------------------------------------------------------------- diff --git a/ThirdParty/Ert/lib/ecl/ecl_grid.cpp b/ThirdParty/Ert/lib/ecl/ecl_grid.cpp index 5877f15a71..c458846a9a 100644 --- a/ThirdParty/Ert/lib/ecl/ecl_grid.cpp +++ b/ThirdParty/Ert/lib/ecl/ecl_grid.cpp @@ -6369,6 +6369,8 @@ static bool ecl_grid_init_coord_section__( const ecl_grid_type * grid , int i, i const int top_index = ecl_grid_get_top_valid_index( grid , i , j ); const int bottom_index = ecl_grid_get_bottom_valid_index( grid , i , j ); + // util_exit("% : no cell with a valid geometry description found in (i,j) = %d,%d - then what? \n",__func__ , i,j); + // https://github.com/OPM/ResInsight/issues/7944 if (top_index == -1) return false; { From ea6e734a554c46841f8f30f613cc441420a192b1 Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Thu, 2 Sep 2021 16:00:48 +0200 Subject: [PATCH 100/308] Janitor : Add name to all parts to be able to find the source code producing the part --- .../ModelVisualization/Riv3dWellLogPlanePartMgr.cpp | 4 ++++ .../ModelVisualization/RivContourMapProjectionPartMgr.cpp | 4 ++++ .../ModelVisualization/RivElementVectorResultPartMgr.cpp | 2 ++ .../ModelVisualization/RivPipeGeometryGenerator.cpp | 4 ++++ .../ModelVisualization/RivReachCircleAnnotationPartMgr.cpp | 2 ++ .../ModelVisualization/RivTensorResultPartMgr.cpp | 1 + .../ModelVisualization/RivTextAnnotationPartMgr.cpp | 1 + .../RivWellConnectionFactorGeometryGenerator.cpp | 1 + .../ModelVisualization/RivWellConnectionsPartMgr.cpp | 6 ++++-- .../ModelVisualization/RivWellPathPartMgr.cpp | 2 ++ .../ModelVisualization/RivWellSpheresPartMgr.cpp | 2 ++ .../Streamlines/RivStreamlinesPartMgr.cpp | 2 ++ 12 files changed, 29 insertions(+), 2 deletions(-) diff --git a/ApplicationLibCode/ModelVisualization/Riv3dWellLogPlanePartMgr.cpp b/ApplicationLibCode/ModelVisualization/Riv3dWellLogPlanePartMgr.cpp index 605321c144..a6f8712f08 100644 --- a/ApplicationLibCode/ModelVisualization/Riv3dWellLogPlanePartMgr.cpp +++ b/ApplicationLibCode/ModelVisualization/Riv3dWellLogPlanePartMgr.cpp @@ -141,6 +141,7 @@ void Riv3dWellLogPlanePartMgr::append3dWellLogCurveToModel( cvf::ModelBasicList* cvf::ref effect = meshEffectGen.generateCachedEffect(); cvf::ref part = new cvf::Part; + part->setName( "append3dWellLogCurveToModel" ); part->setDrawable( curveDrawable.p() ); part->setEffect( effect.p() ); @@ -244,6 +245,7 @@ void Riv3dWellLogPlanePartMgr::appendDrawSurfaceToModel( cvf::ModelBasicList* cvf::ref part = createPart( background.p(), backgroundEffect.p() ); if ( part.notNull() ) { + part->setName( "Riv3dWellLogPlanePartMgr::background" ); model->addPart( part.p() ); part->setSourceInfo( sourceInfo.p() ); } @@ -257,6 +259,7 @@ void Riv3dWellLogPlanePartMgr::appendDrawSurfaceToModel( cvf::ModelBasicList* cvf::ref part = createPart( border.p(), borderEffect.p() ); if ( part.notNull() ) { + part->setName( "Riv3dWellLogPlanePartMgr::border" ); model->addPart( part.p() ); } } @@ -273,6 +276,7 @@ void Riv3dWellLogPlanePartMgr::appendDrawSurfaceToModel( cvf::ModelBasicList* cvf::ref part = createPart( normals.p(), curveNormalsEffect.p() ); if ( part.notNull() ) { + part->setName( "Riv3dWellLogPlanePartMgr::normals" ); model->addPart( part.p() ); part->setSourceInfo( sourceInfo.p() ); } diff --git a/ApplicationLibCode/ModelVisualization/RivContourMapProjectionPartMgr.cpp b/ApplicationLibCode/ModelVisualization/RivContourMapProjectionPartMgr.cpp index 034c4f4f1e..7077117ce4 100644 --- a/ApplicationLibCode/ModelVisualization/RivContourMapProjectionPartMgr.cpp +++ b/ApplicationLibCode/ModelVisualization/RivContourMapProjectionPartMgr.cpp @@ -82,6 +82,7 @@ void RivContourMapProjectionPartMgr::appendPickPointVisToModel( cvf::ModelBasicL cvf::ref effect = meshEffectGen.generateCachedEffect(); cvf::ref part = new cvf::Part; + part->setName( "RivContourMapProjectionPartMgr::appendPickPointVisToModel" ); part->setDrawable( drawable.p() ); part->setEffect( effect.p() ); part->setSourceInfo( new RivMeshLinesSourceInfo( m_contourMapProjection.p() ) ); @@ -158,6 +159,7 @@ void RivContourMapProjectionPartMgr::appendContourLinesToModel( const cvf::Camer cvf::ref effect = meshEffectGen.generateCachedEffect(); cvf::ref part = new cvf::Part; + part->setName( "RivContourMapProjectionPartMgr::contourDrawable_mesh" ); part->setDrawable( contourDrawable.p() ); part->setEffect( effect.p() ); part->setPriority( RivPartPriority::MeshLines ); @@ -173,6 +175,7 @@ void RivContourMapProjectionPartMgr::appendContourLinesToModel( const cvf::Camer for ( auto labelDrawableRef : labelDrawables ) { cvf::ref part = new cvf::Part; + part->setName( "RivContourMapProjectionPartMgr::labelDrawableRef" ); part->setDrawable( labelDrawableRef.p() ); part->setEffect( m_labelEffect.p() ); part->setPriority( RivPartPriority::Text ); @@ -237,6 +240,7 @@ cvf::ref geo->setVertexArray( vertexArray.p() ); cvf::ref part = new cvf::Part; + part->setName( "RivContourMapProjectionPartMgr::createProjectionMapPart" ); part->setDrawable( geo.p() ); cvf::ScalarMapper* mapper = m_contourMapProjection->legendConfig()->scalarMapper(); diff --git a/ApplicationLibCode/ModelVisualization/RivElementVectorResultPartMgr.cpp b/ApplicationLibCode/ModelVisualization/RivElementVectorResultPartMgr.cpp index a689b5bb1b..a8ea28a5f6 100644 --- a/ApplicationLibCode/ModelVisualization/RivElementVectorResultPartMgr.cpp +++ b/ApplicationLibCode/ModelVisualization/RivElementVectorResultPartMgr.cpp @@ -372,6 +372,8 @@ cvf::ref drawable->setTextureCoordArray( lineTexCoords.p() ); cvf::ref part = new cvf::Part; + part->setName( "RivElementVectorResultPartMgr::createPart" ); + part->setDrawable( drawable.p() ); part->setEffect( effect.p() ); diff --git a/ApplicationLibCode/ModelVisualization/RivPipeGeometryGenerator.cpp b/ApplicationLibCode/ModelVisualization/RivPipeGeometryGenerator.cpp index 2bbe45fd78..a01bc55737 100644 --- a/ApplicationLibCode/ModelVisualization/RivPipeGeometryGenerator.cpp +++ b/ApplicationLibCode/ModelVisualization/RivPipeGeometryGenerator.cpp @@ -801,6 +801,7 @@ void RivPipeGeometryGenerator::cylinderWithCenterLineParts( cvf::CollectionsetName( "RivPipeGeometryGenerator::surface" ); part->setDrawable( surfaceGeo.p() ); caf::SurfaceEffectGenerator surfaceGen( cvf::Color4f( color ), caf::PO_1 ); @@ -815,6 +816,7 @@ void RivPipeGeometryGenerator::cylinderWithCenterLineParts( cvf::CollectionsetName( "RivPipeGeometryGenerator::centerLineGeo" ); part->setDrawable( centerLineGeo.p() ); caf::SurfaceEffectGenerator surfaceGen( cvf::Color4f( color ), caf::PO_1 ); @@ -844,6 +846,7 @@ void RivPipeGeometryGenerator::tubeWithCenterLinePartsAndVariableWidth( cvf::Col if ( surfaceGeo.notNull() ) { cvf::Part* part = new cvf::Part; + part->setName( "tubeWithCenterLinePartsAndVariableWidth::surface" ); part->setDrawable( surfaceGeo.p() ); caf::SurfaceEffectGenerator surfaceGen( cvf::Color4f( color ), caf::PO_1 ); @@ -858,6 +861,7 @@ void RivPipeGeometryGenerator::tubeWithCenterLinePartsAndVariableWidth( cvf::Col if ( centerLineGeo.notNull() ) { cvf::Part* part = new cvf::Part; + part->setName( "tubeWithCenterLinePartsAndVariableWidth::centerLineGeo" ); part->setDrawable( centerLineGeo.p() ); caf::SurfaceEffectGenerator surfaceGen( cvf::Color4f( color ), caf::PO_1 ); diff --git a/ApplicationLibCode/ModelVisualization/RivReachCircleAnnotationPartMgr.cpp b/ApplicationLibCode/ModelVisualization/RivReachCircleAnnotationPartMgr.cpp index 51be932be9..de0e2ebe15 100644 --- a/ApplicationLibCode/ModelVisualization/RivReachCircleAnnotationPartMgr.cpp +++ b/ApplicationLibCode/ModelVisualization/RivReachCircleAnnotationPartMgr.cpp @@ -82,6 +82,7 @@ void RivReachCircleAnnotationPartMgr::buildParts( const caf::DisplayCoordTransfo cvf::ref drawableGeo = RivPolylineGenerator::createLineAlongPolylineDrawable( points ); cvf::ref part = new cvf::Part; + part->setName( "RivReachCircleAnnotationPartMgr" ); part->setDrawable( drawableGeo.p() ); caf::MeshEffectGenerator effgen( lineColor ); @@ -111,6 +112,7 @@ void RivReachCircleAnnotationPartMgr::buildParts( const caf::DisplayCoordTransfo cvf::ref drawableGeo = RivPolylineGenerator::createLineAlongPolylineDrawable( symbol ); cvf::ref part = new cvf::Part; + part->setName( "RivReachCircleAnnotationPartMgr" ); part->setDrawable( drawableGeo.p() ); caf::MeshEffectGenerator effgen( lineColor ); diff --git a/ApplicationLibCode/ModelVisualization/RivTensorResultPartMgr.cpp b/ApplicationLibCode/ModelVisualization/RivTensorResultPartMgr.cpp index 81c1312c2f..730370f30a 100644 --- a/ApplicationLibCode/ModelVisualization/RivTensorResultPartMgr.cpp +++ b/ApplicationLibCode/ModelVisualization/RivTensorResultPartMgr.cpp @@ -373,6 +373,7 @@ cvf::ref RivTensorResultPartMgr::createPart( const std::vectorsetTextureCoordArray( lineTexCoords.p() ); cvf::ref part = new cvf::Part; + part->setName( "RivTensorResultPartMgr" ); part->setDrawable( drawable.p() ); part->setEffect( scalarMapperMeshEffect.p() ); diff --git a/ApplicationLibCode/ModelVisualization/RivTextAnnotationPartMgr.cpp b/ApplicationLibCode/ModelVisualization/RivTextAnnotationPartMgr.cpp index b2dd173829..11d318f891 100644 --- a/ApplicationLibCode/ModelVisualization/RivTextAnnotationPartMgr.cpp +++ b/ApplicationLibCode/ModelVisualization/RivTextAnnotationPartMgr.cpp @@ -103,6 +103,7 @@ void RivTextAnnotationPartMgr::buildParts( const caf::DisplayCoordTransform* dis cvf::ref drawableGeo = RivPolylineGenerator::createLineAlongPolylineDrawable( points ); cvf::ref part = new cvf::Part; + part->setName( "RivTextAnnotationPartMgr" ); part->setDrawable( drawableGeo.p() ); caf::MeshEffectGenerator colorEffgen( anchorLineColor ); diff --git a/ApplicationLibCode/ModelVisualization/RivWellConnectionFactorGeometryGenerator.cpp b/ApplicationLibCode/ModelVisualization/RivWellConnectionFactorGeometryGenerator.cpp index 43a032f25a..f9836b8796 100644 --- a/ApplicationLibCode/ModelVisualization/RivWellConnectionFactorGeometryGenerator.cpp +++ b/ApplicationLibCode/ModelVisualization/RivWellConnectionFactorGeometryGenerator.cpp @@ -57,6 +57,7 @@ cvf::ref RivWellConnectionFactorGeometryGenerator::createSurfacePart( if ( drawable.notNull() ) { cvf::ref part = new cvf::Part; + part->setName( "RivWellConnectionFactorGeometryGenerator" ); part->setDrawable( drawable.p() ); // Compute texture coords diff --git a/ApplicationLibCode/ModelVisualization/RivWellConnectionsPartMgr.cpp b/ApplicationLibCode/ModelVisualization/RivWellConnectionsPartMgr.cpp index 381ae6ec8c..e0255cb3cf 100644 --- a/ApplicationLibCode/ModelVisualization/RivWellConnectionsPartMgr.cpp +++ b/ApplicationLibCode/ModelVisualization/RivWellConnectionsPartMgr.cpp @@ -238,8 +238,10 @@ cvf::ref RivWellConnectionsPartMgr::createArrowPart( const cvf::Vec3f const cvf::Color4f& arrowColor, bool enableLighting ) { - cvf::ref part = new cvf::Part; - cvf::ref geo = createArrowGeometry( startPoint, endPoint, width, isProducer ); + cvf::ref part = new cvf::Part; + part->setName( "RivWellConnectionsPartMgr::createArrowPart" ); + + cvf::ref geo = createArrowGeometry( startPoint, endPoint, width, isProducer ); part->setDrawable( geo.p() ); caf::SurfaceEffectGenerator surfaceGen( arrowColor, caf::PO_1 ); diff --git a/ApplicationLibCode/ModelVisualization/RivWellPathPartMgr.cpp b/ApplicationLibCode/ModelVisualization/RivWellPathPartMgr.cpp index a055f67ec4..b7fac7e4c7 100644 --- a/ApplicationLibCode/ModelVisualization/RivWellPathPartMgr.cpp +++ b/ApplicationLibCode/ModelVisualization/RivWellPathPartMgr.cpp @@ -697,6 +697,7 @@ void RivWellPathPartMgr::buildWellPathParts( const caf::DisplayCoordTransform* d if ( m_surfaceDrawable.notNull() ) { m_surfacePart = new cvf::Part; + m_surfacePart->setName( "RivWellPathPartMgr::surface" ); m_surfacePart->setDrawable( m_surfaceDrawable.p() ); RivWellPathSourceInfo* sourceInfo = new RivWellPathSourceInfo( m_rimWellPath, m_pipeGeomGenerator.p() ); @@ -711,6 +712,7 @@ void RivWellPathPartMgr::buildWellPathParts( const caf::DisplayCoordTransform* d if ( m_centerLineDrawable.notNull() ) { m_centerLinePart = new cvf::Part; + m_centerLinePart->setName( "RivWellPathPartMgr::centerLinePart" ); m_centerLinePart->setDrawable( m_centerLineDrawable.p() ); caf::MeshEffectGenerator gen( m_rimWellPath->wellPathColor() ); diff --git a/ApplicationLibCode/ModelVisualization/RivWellSpheresPartMgr.cpp b/ApplicationLibCode/ModelVisualization/RivWellSpheresPartMgr.cpp index d5c92ecee3..d32765d161 100644 --- a/ApplicationLibCode/ModelVisualization/RivWellSpheresPartMgr.cpp +++ b/ApplicationLibCode/ModelVisualization/RivWellSpheresPartMgr.cpp @@ -167,6 +167,8 @@ cvf::ref RivWellSpheresPartMgr::createPart( std::vectorsetGlyph( builder.trianglesUShort().p(), builder.vertices().p() ); cvf::ref part = new cvf::Part; + part->setName( "RivWellSpheresPartMgr" ); + part->setDrawable( vectorDrawable.p() ); cvf::ref eff = new cvf::Effect; diff --git a/ApplicationLibCode/ModelVisualization/Streamlines/RivStreamlinesPartMgr.cpp b/ApplicationLibCode/ModelVisualization/Streamlines/RivStreamlinesPartMgr.cpp index b5c44a5ba2..9dbc65b9ab 100644 --- a/ApplicationLibCode/ModelVisualization/Streamlines/RivStreamlinesPartMgr.cpp +++ b/ApplicationLibCode/ModelVisualization/Streamlines/RivStreamlinesPartMgr.cpp @@ -218,6 +218,8 @@ cvf::ref RivStreamlinesPartMgr::createPart( const RimStreamlineInView drawable->setTextureCoordArray( lineTexCoords.p() ); cvf::ref part = new cvf::Part; + part->setName( "RivStreamlinesPartMgr" ); + part->setDrawable( drawable.p() ); part->setEffect( effect.p() ); part->updateBoundingBox(); From 7260d318e48fff823742871c25b3756ff5809f0c Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Fri, 3 Sep 2021 08:19:34 +0200 Subject: [PATCH 101/308] #7929 Python : Make sure progress dialog is created after early exit On some systems, the progress dialog triggers redraw with incomplete data and causes crash. Make sure the progress dialog is created after early exit --- .../ProjectDataModel/RimEclipseResultCase.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/ApplicationLibCode/ProjectDataModel/RimEclipseResultCase.cpp b/ApplicationLibCode/ProjectDataModel/RimEclipseResultCase.cpp index 197cfb4d1b..1911a4e0bf 100644 --- a/ApplicationLibCode/ProjectDataModel/RimEclipseResultCase.cpp +++ b/ApplicationLibCode/ProjectDataModel/RimEclipseResultCase.cpp @@ -109,14 +109,16 @@ bool RimEclipseResultCase::openEclipseGridFile() //-------------------------------------------------------------------------------------------------- bool RimEclipseResultCase::importGridAndResultMetaData( bool showTimeStepFilter ) { + // Early exit if data is already read + // Make sure that the progress info dialog is created after the return statement. If created before, the progress + // dialog triggers a redraw with incomplete geometry data and causes a crash + if ( m_gridAndWellDataIsReadFromFile ) return true; + caf::ProgressInfo progInfo( 50, "Reading Eclipse Grid File" ); progInfo.setProgressDescription( "Open Grid File" ); progInfo.setNextProgressIncrement( 48 ); - // Early exit if data is already read - if ( m_gridAndWellDataIsReadFromFile ) return true; - cvf::ref readerInterface; if ( gridFileName().contains( "Result Mock Debug Model" ) ) From 1e43fd4c36c9d7e6e75ef0f51745285e47d7e2eb Mon Sep 17 00:00:00 2001 From: Kristian Bendiksen Date: Fri, 3 Sep 2021 10:08:01 +0200 Subject: [PATCH 102/308] #7927 Surface Extraction: fix index mixup. --- .../CommandRouter/RimcExtractSurfaces.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ApplicationLibCode/ProjectDataModelCommands/CommandRouter/RimcExtractSurfaces.cpp b/ApplicationLibCode/ProjectDataModelCommands/CommandRouter/RimcExtractSurfaces.cpp index d05d954fb3..cb53bbd26b 100644 --- a/ApplicationLibCode/ProjectDataModelCommands/CommandRouter/RimcExtractSurfaces.cpp +++ b/ApplicationLibCode/ProjectDataModelCommands/CommandRouter/RimcExtractSurfaces.cpp @@ -63,9 +63,9 @@ caf::PdmObjectHandle* RimcCommandRouter_extractSurfaces::execute() auto dims = grid1.dimension(); int minI = m_minimumI() == -1 ? 0 : m_minimumI(); - int maxI = m_maximumJ() == -1 ? dims[0] - 1 : m_maximumI(); - int minJ = m_minimumI() == -1 ? 0 : m_minimumJ(); - int maxJ = m_minimumI() == -1 ? dims[1] - 1 : m_maximumJ(); + int maxI = m_maximumI() == -1 ? dims[0] - 1 : m_maximumI(); + int minJ = m_minimumJ() == -1 ? 0 : m_minimumJ(); + int maxJ = m_maximumJ() == -1 ? dims[1] - 1 : m_maximumJ(); std::array range = { minI, maxI, minJ, maxJ }; From 2b3fbe022e705ac69c6592ca017466aa355afefb Mon Sep 17 00:00:00 2001 From: Kristian Bendiksen Date: Wed, 1 Sep 2021 19:32:53 +0200 Subject: [PATCH 103/308] #7927 Add user interface for exporting multiple surfaces. --- .../Commands/CMakeLists_files.cmake | 4 + .../RicGenerateMultipleSurfacesFeature.cpp | 135 +++++++++++++++++ .../RicGenerateMultipleSurfacesFeature.h | 42 ++++++ .../RicGenerateMultipleSurfacesUi.cpp | 141 ++++++++++++++++++ .../Commands/RicGenerateMultipleSurfacesUi.h | 62 ++++++++ .../RicImportEnsembleSurfaceFeature.cpp | 8 + .../RicImportEnsembleSurfaceFeature.h | 3 + .../RimContextCommandBuilder.cpp | 1 + .../ProjectDataModel/RimDialogData.cpp | 17 +++ .../ProjectDataModel/RimDialogData.h | 3 + .../CommandRouter/RimcExtractSurfaces.cpp | 77 ++++++++-- .../CommandRouter/RimcExtractSurfaces.h | 9 ++ 12 files changed, 489 insertions(+), 13 deletions(-) create mode 100644 ApplicationLibCode/Commands/RicGenerateMultipleSurfacesFeature.cpp create mode 100644 ApplicationLibCode/Commands/RicGenerateMultipleSurfacesFeature.h create mode 100644 ApplicationLibCode/Commands/RicGenerateMultipleSurfacesUi.cpp create mode 100644 ApplicationLibCode/Commands/RicGenerateMultipleSurfacesUi.h diff --git a/ApplicationLibCode/Commands/CMakeLists_files.cmake b/ApplicationLibCode/Commands/CMakeLists_files.cmake index f654491d69..fb06ed6d76 100644 --- a/ApplicationLibCode/Commands/CMakeLists_files.cmake +++ b/ApplicationLibCode/Commands/CMakeLists_files.cmake @@ -73,6 +73,8 @@ set(SOURCE_GROUP_HEADER_FILES ${CMAKE_CURRENT_LIST_DIR}/RicDeletePressureTableItemFeature.h ${CMAKE_CURRENT_LIST_DIR}/RicImportGridModelFromSummaryCaseFeature.h ${CMAKE_CURRENT_LIST_DIR}/RicImportGridModelFromSummaryCurveFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicGenerateMultipleSurfacesFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicGenerateMultipleSurfacesUi.h ) set(SOURCE_GROUP_SOURCE_FILES @@ -149,6 +151,8 @@ set(SOURCE_GROUP_SOURCE_FILES ${CMAKE_CURRENT_LIST_DIR}/RicDeletePressureTableItemFeature.cpp ${CMAKE_CURRENT_LIST_DIR}/RicImportGridModelFromSummaryCaseFeature.cpp ${CMAKE_CURRENT_LIST_DIR}/RicImportGridModelFromSummaryCurveFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicGenerateMultipleSurfacesFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicGenerateMultipleSurfacesUi.cpp ) if(Qt5Charts_FOUND) diff --git a/ApplicationLibCode/Commands/RicGenerateMultipleSurfacesFeature.cpp b/ApplicationLibCode/Commands/RicGenerateMultipleSurfacesFeature.cpp new file mode 100644 index 0000000000..328fd0f33b --- /dev/null +++ b/ApplicationLibCode/Commands/RicGenerateMultipleSurfacesFeature.cpp @@ -0,0 +1,135 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2021- Equinor ASA +// +// ResInsight is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// + +#include "RicGenerateMultipleSurfacesFeature.h" + +#include "RiaApplication.h" +#include "RiaLogging.h" + +#include "CommandRouter/RimcExtractSurfaces.h" +#include "RicGenerateMultipleSurfacesUi.h" +#include "RicImportEnsembleSurfaceFeature.h" +#include "RicRecursiveFileSearchDialog.h" +#include "RimDialogData.h" +#include "RimProject.h" + +#include "Riu3DMainWindowTools.h" +#include "RiuPropertyViewTabWidget.h" + +#include "cafCmdFeatureManager.h" +#include "cafPdmSettings.h" +#include "cafPdmUiPropertyViewDialog.h" +#include "cafProgressInfo.h" +#include "cafSelectionManager.h" + +#include +#include +#include + +CAF_CMD_SOURCE_INIT( RicGenerateMultipleSurfacesFeature, "RicGenerateMultipleSurfacesFeature" ); + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RicGenerateMultipleSurfacesFeature::openDialogAndExecuteCommand() +{ + // Get the list of egrid files + RiaApplication* app = RiaApplication::instance(); + QString defaultDir = app->lastUsedDialogDirectory( "BINARY_GRID" ); + + QString pathFilter( "*" ); + QString fileNameFilter( "*" ); + + RicRecursiveFileSearchDialogResult result = + RicRecursiveFileSearchDialog::runRecursiveSearchDialog( nullptr, + "Choose Eclipse Cases", + defaultDir, + pathFilter, + fileNameFilter, + QStringList( ".EGRID" ) ); + + if ( !result.ok || result.files.isEmpty() ) + { + return; + } + + // Read min/max k layer from first grid case + int minLayerK = -1; + int maxLayerK = -1; + if ( !RimcCommandRouter_extractSurfaces::readMinMaxLayerFromGridFile( result.files[0], minLayerK, maxLayerK ) ) + return; + + RicGenerateMultipleSurfacesUi* ui = RimProject::current()->dialogData()->generateEnsembleSurfacesUi(); + ui->setLayersMinMax( minLayerK, maxLayerK ); + + RiuPropertyViewTabWidget propertyDialog( Riu3DMainWindowTools::mainWindowWidget(), + ui, + "Export Multiple Surfaces", + ui->tabNames() ); + + if ( propertyDialog.exec() == QDialog::Accepted ) + { + executeCommand( *ui, result.files.toStdList() ); + } +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RicGenerateMultipleSurfacesFeature::executeCommand( const RicGenerateMultipleSurfacesUi& ui, + const std::list& fileNames ) +{ + std::vector layers = ui.layers(); + + caf::ProgressInfo progress( fileNames.size(), "Generating ensemble surfaces" ); + + QStringList allSurfaceFileNames; + for ( auto fileName : fileNames ) + { + auto task = progress.task( QString( "Extracting surfaces for %1" ).arg( fileName ) ); + auto [isOk, surfaceFileNames] = RimcCommandRouter_extractSurfaces::extractSurfaces( fileName, layers ); + if ( isOk ) allSurfaceFileNames << surfaceFileNames; + } + + if ( ui.autoCreateEnsembleSurfaces() ) + RicImportEnsembleSurfaceFeature::importEnsembleSurfaceFromFiles( allSurfaceFileNames ); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +bool RicGenerateMultipleSurfacesFeature::isCommandEnabled() +{ + return true; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RicGenerateMultipleSurfacesFeature::onActionTriggered( bool isChecked ) +{ + openDialogAndExecuteCommand(); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RicGenerateMultipleSurfacesFeature::setupActionLook( QAction* actionToSetup ) +{ + actionToSetup->setText( "Generate Multiple Surfaces..." ); +} diff --git a/ApplicationLibCode/Commands/RicGenerateMultipleSurfacesFeature.h b/ApplicationLibCode/Commands/RicGenerateMultipleSurfacesFeature.h new file mode 100644 index 0000000000..d39ba26abe --- /dev/null +++ b/ApplicationLibCode/Commands/RicGenerateMultipleSurfacesFeature.h @@ -0,0 +1,42 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2021- Equinor ASA +// +// ResInsight is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// + +#pragma once + +#include "cafCmdFeature.h" + +#include + +class RicGenerateMultipleSurfacesUi; + +//================================================================================================== +/// +//================================================================================================== +class RicGenerateMultipleSurfacesFeature : public caf::CmdFeature +{ + CAF_CMD_HEADER_INIT; + +public: + static void openDialogAndExecuteCommand(); + static void executeCommand( const RicGenerateMultipleSurfacesUi& ui, const std::list& fileNames ); + +protected: + bool isCommandEnabled() override; + void onActionTriggered( bool isChecked ) override; + void setupActionLook( QAction* actionToSetup ) override; +}; diff --git a/ApplicationLibCode/Commands/RicGenerateMultipleSurfacesUi.cpp b/ApplicationLibCode/Commands/RicGenerateMultipleSurfacesUi.cpp new file mode 100644 index 0000000000..f86071cf39 --- /dev/null +++ b/ApplicationLibCode/Commands/RicGenerateMultipleSurfacesUi.cpp @@ -0,0 +1,141 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2021- Equinor ASA +// +// ResInsight is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// + +#include "RicGenerateMultipleSurfacesUi.h" + +#include "RiaApplication.h" + +#include "cafPdmObject.h" +#include "cafPdmUiListEditor.h" +#include "cafPdmUiOrdering.h" + +CAF_PDM_SOURCE_INIT( RicGenerateMultipleSurfacesUi, "RicGenerateMultipleSurfacesUi" ); + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RicGenerateMultipleSurfacesUi::RicGenerateMultipleSurfacesUi() +{ + CAF_PDM_InitObject( "Export Multiple Surfaces", "", "", "" ); + + CAF_PDM_InitFieldNoDefault( &m_layers, "Layers", "Layers", "", "", "" ); + CAF_PDM_InitField( &m_autoCreateEnsembleSurfaces, + "AutoCreateEnsembleSurfaces", + false, + "Create Ensemble Surfaces From Exported Files", + "", + "", + "" ); + + CAF_PDM_InitFieldNoDefault( &m_minLayer, "MinLayer", "MinLayer", "", "", "" ); + CAF_PDM_InitFieldNoDefault( &m_maxLayer, "MaxLayer", "MaxLayer", "", "", "" ); + + m_tabNames << "Layers" + << "Ensemble Surfaces"; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RicGenerateMultipleSurfacesUi::~RicGenerateMultipleSurfacesUi() +{ +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +const QStringList& RicGenerateMultipleSurfacesUi::tabNames() const +{ + return m_tabNames; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RicGenerateMultipleSurfacesUi::setLayersMinMax( int minLayer, int maxLayer ) +{ + m_minLayer = minLayer; + m_maxLayer = maxLayer; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RicGenerateMultipleSurfacesUi::defineEditorAttribute( const caf::PdmFieldHandle* field, + QString uiConfigName, + caf::PdmUiEditorAttribute* attribute ) +{ + if ( field == &m_layers ) + { + caf::PdmUiListEditorAttribute* myAttr = dynamic_cast( attribute ); + if ( myAttr ) + { + myAttr->m_heightHint = 280; + } + } +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RicGenerateMultipleSurfacesUi::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) +{ + if ( uiConfigName == m_tabNames[0] ) + { + uiOrdering.add( &m_layers ); + } + else if ( uiConfigName == m_tabNames[1] ) + { + uiOrdering.add( &m_autoCreateEnsembleSurfaces ); + } + uiOrdering.skipRemainingFields( true ); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +QList + RicGenerateMultipleSurfacesUi::calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions, + bool* useOptionsOnly ) +{ + QList options; + if ( fieldNeedingOptions == &m_layers ) + { + for ( int layer = m_minLayer; layer < m_maxLayer; layer++ ) + { + options.push_back( caf::PdmOptionItemInfo( QString::number( layer ), layer ) ); + } + } + return options; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +std::vector RicGenerateMultipleSurfacesUi::layers() const +{ + return m_layers(); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +bool RicGenerateMultipleSurfacesUi::autoCreateEnsembleSurfaces() const +{ + return m_autoCreateEnsembleSurfaces; +} diff --git a/ApplicationLibCode/Commands/RicGenerateMultipleSurfacesUi.h b/ApplicationLibCode/Commands/RicGenerateMultipleSurfacesUi.h new file mode 100644 index 0000000000..b72a86abe8 --- /dev/null +++ b/ApplicationLibCode/Commands/RicGenerateMultipleSurfacesUi.h @@ -0,0 +1,62 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2021- Equinor ASA +// +// ResInsight is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// + +#pragma once + +#include "cafPdmField.h" +#include "cafPdmObject.h" + +#include +#include + +class RigEclipseCaseData; + +//================================================================================================== +/// +//================================================================================================== +class RicGenerateMultipleSurfacesUi : public caf::PdmObject +{ + CAF_PDM_HEADER_INIT; + +public: + RicGenerateMultipleSurfacesUi(); + ~RicGenerateMultipleSurfacesUi() override; + const QStringList& tabNames() const; + + void setLayersMinMax( int minLayer, int maxLayer ); + + std::vector layers() const; + + bool autoCreateEnsembleSurfaces() const; + +protected: + void defineEditorAttribute( const caf::PdmFieldHandle* field, + QString uiConfigName, + caf::PdmUiEditorAttribute* attribute ) override; + void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override; + + QList calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions, + bool* useOptionsOnly ) override; + + caf::PdmField> m_layers; + caf::PdmField m_autoCreateEnsembleSurfaces; + caf::PdmField m_minLayer; + caf::PdmField m_maxLayer; + + QStringList m_tabNames; +}; diff --git a/ApplicationLibCode/Commands/RicImportEnsembleSurfaceFeature.cpp b/ApplicationLibCode/Commands/RicImportEnsembleSurfaceFeature.cpp index b1a8d105f9..6b5b51fe88 100644 --- a/ApplicationLibCode/Commands/RicImportEnsembleSurfaceFeature.cpp +++ b/ApplicationLibCode/Commands/RicImportEnsembleSurfaceFeature.cpp @@ -23,6 +23,7 @@ #include "RiaLogging.h" #include "RiaSummaryTools.h" +#include "RicImportEnsembleFeature.h" #include "RicRecursiveFileSearchDialog.h" #include "RimEnsembleSurface.h" @@ -63,6 +64,13 @@ void RicImportEnsembleSurfaceFeature::onActionTriggered( bool isChecked ) RiaApplication* app = RiaApplication::instance(); QString pathCacheName = "ENSEMBLE_SURFACE_FILES"; QStringList fileNames = runRecursiveFileSearchDialog( "Import Ensemble Surface", pathCacheName ); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RicImportEnsembleSurfaceFeature::importEnsembleSurfaceFromFiles( const QStringList& fileNames ) +{ if ( fileNames.isEmpty() ) return; QString ensembleName = RiaEnsembleNameTools::findSuitableEnsembleName( fileNames ); diff --git a/ApplicationLibCode/Commands/RicImportEnsembleSurfaceFeature.h b/ApplicationLibCode/Commands/RicImportEnsembleSurfaceFeature.h index 197f7bacc1..a7affdb562 100644 --- a/ApplicationLibCode/Commands/RicImportEnsembleSurfaceFeature.h +++ b/ApplicationLibCode/Commands/RicImportEnsembleSurfaceFeature.h @@ -27,10 +27,13 @@ //================================================================================================== class RicImportEnsembleSurfaceFeature : public caf::CmdFeature { +public: CAF_CMD_HEADER_INIT; RicImportEnsembleSurfaceFeature(); + static void importEnsembleSurfaceFromFiles( const QStringList& fileNames ); + protected: // Overrides bool isCommandEnabled() override; diff --git a/ApplicationLibCode/ProjectDataModel/RimContextCommandBuilder.cpp b/ApplicationLibCode/ProjectDataModel/RimContextCommandBuilder.cpp index f3c1142f9a..9eea87b6ab 100644 --- a/ApplicationLibCode/ProjectDataModel/RimContextCommandBuilder.cpp +++ b/ApplicationLibCode/ProjectDataModel/RimContextCommandBuilder.cpp @@ -970,6 +970,7 @@ caf::CmdFeatureMenuBuilder RimContextCommandBuilder::commandsFromSelection() menuBuilder << "RicImportSurfacesFeature"; menuBuilder << "RicNewGridSurfaceFeature"; menuBuilder << "RicImportEnsembleSurfaceFeature"; + menuBuilder << "RicGenerateMultipleSurfacesFeature"; menuBuilder.addSeparator(); menuBuilder << "RicNewSurfaceCollectionFeature"; } diff --git a/ApplicationLibCode/ProjectDataModel/RimDialogData.cpp b/ApplicationLibCode/ProjectDataModel/RimDialogData.cpp index 7b9b48f8f6..c711a1a068 100644 --- a/ApplicationLibCode/ProjectDataModel/RimDialogData.cpp +++ b/ApplicationLibCode/ProjectDataModel/RimDialogData.cpp @@ -27,6 +27,7 @@ #include "ExportCommands/RicExportWellPathsUi.h" #include "FractureCommands/RicCreateMultipleFracturesUi.h" #include "HoloLensCommands/RicHoloLensExportToFolderUi.h" +#include "RicGenerateMultipleSurfacesUi.h" CAF_PDM_SOURCE_INIT( RimDialogData, "RimDialogData" ); @@ -65,6 +66,14 @@ RimDialogData::RimDialogData() CAF_PDM_InitFieldNoDefault( &m_mockModelSettings, "MockModelSettings", "Mock Model Settings", "", "", "" ); m_mockModelSettings = new RimMockModelSettings(); + + CAF_PDM_InitFieldNoDefault( &m_generateEnsembleSurfacesUi, + "GenerateMultipleSurfacesUi", + "Generate Ensmeble Surfaces Ui", + "", + "", + "" ); + m_generateEnsembleSurfacesUi = new RicGenerateMultipleSurfacesUi(); } //-------------------------------------------------------------------------------------------------- @@ -155,3 +164,11 @@ RimMockModelSettings* RimDialogData::mockModelSettings() const { return m_mockModelSettings; } + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RicGenerateMultipleSurfacesUi* RimDialogData::generateEnsembleSurfacesUi() const +{ + return m_generateEnsembleSurfacesUi; +} diff --git a/ApplicationLibCode/ProjectDataModel/RimDialogData.h b/ApplicationLibCode/ProjectDataModel/RimDialogData.h index 87c2a3cbd2..c8c83386ec 100644 --- a/ApplicationLibCode/ProjectDataModel/RimDialogData.h +++ b/ApplicationLibCode/ProjectDataModel/RimDialogData.h @@ -29,6 +29,7 @@ class RicHoloLensExportToFolderUi; class RicExportWellPathsUi; class RicExportLgrUi; class RimMockModelSettings; +class RicGenerateMultipleSurfacesUi; //================================================================================================== /// @@ -61,6 +62,7 @@ class RimDialogData : public caf::PdmObject RicExportLgrUi* exportLgrData() const; RicExportEclipseSectorModelUi* exportSectorModelUi() const; RimMockModelSettings* mockModelSettings() const; + RicGenerateMultipleSurfacesUi* generateEnsembleSurfacesUi() const; private: caf::PdmChildField m_exportCarfin; @@ -71,4 +73,5 @@ class RimDialogData : public caf::PdmObject caf::PdmChildField m_exportLgrData; caf::PdmChildField m_exportSectorModelData; caf::PdmChildField m_mockModelSettings; + caf::PdmChildField m_generateEnsembleSurfacesUi; }; diff --git a/ApplicationLibCode/ProjectDataModelCommands/CommandRouter/RimcExtractSurfaces.cpp b/ApplicationLibCode/ProjectDataModelCommands/CommandRouter/RimcExtractSurfaces.cpp index cb53bbd26b..248422020c 100644 --- a/ApplicationLibCode/ProjectDataModelCommands/CommandRouter/RimcExtractSurfaces.cpp +++ b/ApplicationLibCode/ProjectDataModelCommands/CommandRouter/RimcExtractSurfaces.cpp @@ -56,20 +56,36 @@ RimcCommandRouter_extractSurfaces::RimcCommandRouter_extractSurfaces( caf::PdmOb //-------------------------------------------------------------------------------------------------- caf::PdmObjectHandle* RimcCommandRouter_extractSurfaces::execute() { + extractSurfaces( m_gridModelFilename, m_layers(), m_minimumI(), m_maximumI(), m_minimumJ(), m_maximumJ() ); + return nullptr; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +std::pair RimcCommandRouter_extractSurfaces::extractSurfaces( const QString& gridModelFilename, + const std::vector& layers, + int minI, + int maxI, + int minJ, + int maxJ ) +{ + QStringList surfaceFileNames; + try { - std::string filename = m_gridModelFilename().toStdString(); + std::string filename = gridModelFilename.toStdString(); Opm::EclIO::EGrid grid1( filename ); auto dims = grid1.dimension(); - int minI = m_minimumI() == -1 ? 0 : m_minimumI(); - int maxI = m_maximumI() == -1 ? dims[0] - 1 : m_maximumI(); - int minJ = m_minimumJ() == -1 ? 0 : m_minimumJ(); - int maxJ = m_maximumJ() == -1 ? dims[1] - 1 : m_maximumJ(); + minI = minI == -1 ? 0 : minI; + maxI = maxI == -1 ? dims[0] - 1 : maxI; + minJ = minJ == -1 ? 0 : minJ; + maxJ = maxJ == -1 ? dims[1] - 1 : maxJ; std::array range = { minI, maxI, minJ, maxJ }; - for ( auto layer : m_layers() ) + for ( auto layer : layers ) { bool bottom = false; auto xyz_data = grid1.getXYZ_layer( layer, range, bottom ); @@ -108,27 +124,62 @@ caf::PdmObjectHandle* RimcCommandRouter_extractSurfaces::execute() startOfCellCoordIndex += 4; } - // Write to TS file on disk + QString surfaceExportDirName = "surfaceexport"; - QFileInfo fi( m_gridModelFilename ); - QString surfaceFilename = fi.absoluteDir().absolutePath() + - QString( "/surfaceexport/layer-%1.ts" ).arg( layer ); + // Create missing directories + QFileInfo fi( gridModelFilename ); + if ( !fi.absoluteDir().exists( surfaceExportDirName ) ) + { + if ( !fi.absoluteDir().mkpath( surfaceExportDirName ) ) + { + RiaLogging::error( "Unable to create directory for surface export: " + fi.absoluteDir().absolutePath() ); + return std::make_pair( false, surfaceFileNames ); + } + } + + // Write to TS file on disk + QString surfaceFilename = fi.absoluteDir().absolutePath() + + QString( "/%1/layer-%2.ts" ).arg( surfaceExportDirName ).arg( layer ); // TODO: Add more info in surface comment if ( !RifSurfaceExporter::writeGocadTSurfFile( surfaceFilename, "Surface comment", vertices, triangleIndices ) ) { RiaLogging::error( "Failed to export surface data to " + surfaceFilename ); + return std::make_pair( false, surfaceFileNames ); } else { - RiaLogging::error( "Successfully exported surface data to " + surfaceFilename ); + surfaceFileNames << surfaceFilename; + RiaLogging::info( "Successfully exported surface data to " + surfaceFilename ); } } + + return std::make_pair( true, surfaceFileNames ); } catch ( ... ) { - RiaLogging::error( "Error during creation of surface data for model " + m_gridModelFilename() ); + RiaLogging::error( "Error during creation of surface data for model " + gridModelFilename ); + return std::make_pair( false, surfaceFileNames ); } +} - return nullptr; +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +bool RimcCommandRouter_extractSurfaces::readMinMaxLayerFromGridFile( const QString& gridFileName, int& minK, int& maxK ) +{ + try + { + Opm::EclIO::EGrid grid1( gridFileName.toStdString() ); + + auto dims = grid1.dimension(); + minK = 1; + maxK = dims[2]; + return true; + } + catch ( ... ) + { + RiaLogging::error( "Unable to read dimensions from " + gridFileName ); + return false; + } } diff --git a/ApplicationLibCode/ProjectDataModelCommands/CommandRouter/RimcExtractSurfaces.h b/ApplicationLibCode/ProjectDataModelCommands/CommandRouter/RimcExtractSurfaces.h index 0c295ffad9..da11e780cf 100644 --- a/ApplicationLibCode/ProjectDataModelCommands/CommandRouter/RimcExtractSurfaces.h +++ b/ApplicationLibCode/ProjectDataModelCommands/CommandRouter/RimcExtractSurfaces.h @@ -25,6 +25,7 @@ #include "cvfVector3.h" #include +#include #include @@ -40,6 +41,14 @@ class RimcCommandRouter_extractSurfaces : public RimCommandRouterMethod caf::PdmObjectHandle* execute() override; + static bool readMinMaxLayerFromGridFile( const QString& gridFileName, int& minK, int& maxK ); + static std::pair extractSurfaces( const QString& gridModelFileName, + const std::vector& layers, + int minI = -1, + int maxI = -1, + int minJ = -1, + int maxJ = -1 ); + private: caf::PdmField m_gridModelFilename; caf::PdmField> m_layers; From 7f460b2958acbb85119544220d29c418aa5b9f2d Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Wed, 8 Sep 2021 11:50:01 +0200 Subject: [PATCH 104/308] #7957 Move progressdialog control to General tab The freeze bug in Qt is triggered when the progress bar is displayed for long-running processes. A temporary workaround for freeze issues is to disable the progress bar. Move the setting into General tab to make it easily available for all users. --- ApplicationLibCode/Application/RiaPreferences.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ApplicationLibCode/Application/RiaPreferences.cpp b/ApplicationLibCode/Application/RiaPreferences.cpp index b0beb154f6..63eb0431bd 100644 --- a/ApplicationLibCode/Application/RiaPreferences.cpp +++ b/ApplicationLibCode/Application/RiaPreferences.cpp @@ -438,6 +438,7 @@ void RiaPreferences::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& otherGroup->add( &showLasCurveWithoutTvdWarning ); otherGroup->add( &holoLensDisableCertificateVerification ); otherGroup->add( &m_useUndoRedo ); + otherGroup->add( &m_showProgressBar ); } else if ( uiConfigName == RiaPreferences::tabNameEclipseGrid() ) { @@ -536,7 +537,6 @@ void RiaPreferences::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& } uiOrdering.add( &m_gtestFilter ); - uiOrdering.add( &m_showProgressBar ); uiOrdering.add( &m_showProjectChangedDialog ); uiOrdering.add( &m_showTestToolbar ); uiOrdering.add( &m_includeFractureDebugInfoFile ); From a3a2aac9b6ad6ad5e45a83548c29a8f67270f39f Mon Sep 17 00:00:00 2001 From: Kristian Bendiksen Date: Wed, 8 Sep 2021 11:14:07 +0200 Subject: [PATCH 105/308] Add method to remove plot in Well Log Plot Collection. --- .../WellLog/RimWellLogPlotCollection.cpp | 9 +++++++++ .../WellLog/RimWellLogPlotCollection.h | 10 ++++++---- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/ApplicationLibCode/ProjectDataModel/WellLog/RimWellLogPlotCollection.cpp b/ApplicationLibCode/ProjectDataModel/WellLog/RimWellLogPlotCollection.cpp index 85663e4682..b34174bfbb 100644 --- a/ApplicationLibCode/ProjectDataModel/WellLog/RimWellLogPlotCollection.cpp +++ b/ApplicationLibCode/ProjectDataModel/WellLog/RimWellLogPlotCollection.cpp @@ -166,6 +166,15 @@ void RimWellLogPlotCollection::deleteAllPlots() m_wellLogPlots.deleteAllChildObjects(); } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimWellLogPlotCollection::removePlot( gsl::not_null plot ) +{ + m_wellLogPlots.removeChildObject( plot ); + updateAllRequiredEditors(); +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationLibCode/ProjectDataModel/WellLog/RimWellLogPlotCollection.h b/ApplicationLibCode/ProjectDataModel/WellLog/RimWellLogPlotCollection.h index c00e47076b..cacbe501f1 100644 --- a/ApplicationLibCode/ProjectDataModel/WellLog/RimWellLogPlotCollection.h +++ b/ApplicationLibCode/ProjectDataModel/WellLog/RimWellLogPlotCollection.h @@ -59,10 +59,12 @@ class RimWellLogPlotCollection : public caf::PdmObject, public RimPlotCollection RigGeoMechWellLogExtractor* findOrCreateExtractor( RimWellPath* wellPath, RimGeoMechCase* geoMechCase ); std::vector wellLogPlots() const; - void addWellLogPlot( gsl::not_null wellLogPlot ); - void deleteAllPlots() override; - void loadDataAndUpdateAllPlots() override; - size_t plotCount() const override; + + void addWellLogPlot( gsl::not_null wellLogPlot ); + void removePlot( gsl::not_null plot ); + void deleteAllPlots() override; + void loadDataAndUpdateAllPlots() override; + size_t plotCount() const override; void deleteAllExtractors(); void removeExtractors( const RigWellPath* wellPathGeometry ); From 8f5beb88510990fa6cb9fa13a3576318a9787d6f Mon Sep 17 00:00:00 2001 From: Kristian Bendiksen Date: Mon, 6 Sep 2021 09:32:24 +0200 Subject: [PATCH 106/308] #7928 Add user interface for exporting multiple well logs. --- .../Commands/CMakeLists_files.cmake | 4 + .../RicCreateEnsembleWellLogFeature.cpp | 281 ++++++++++++++++++ .../RicCreateEnsembleWellLogFeature.h | 44 +++ .../Commands/RicCreateEnsembleWellLogUi.cpp | 231 ++++++++++++++ .../Commands/RicCreateEnsembleWellLogUi.h | 68 +++++ .../RicImportEnsembleWellLogsFeature.cpp | 21 +- .../RicImportEnsembleWellLogsFeature.h | 4 + .../WellPathCommands/RicImportWellPaths.h | 5 +- .../RimContextCommandBuilder.cpp | 1 + .../ProjectDataModel/RimDialogData.cpp | 12 + .../ProjectDataModel/RimDialogData.h | 3 + .../WellLog/RimEnsembleWellLogCurveSet.cpp | 17 ++ .../WellLog/RimEnsembleWellLogCurveSet.h | 3 + .../RimcWellLogPlot.cpp | 17 +- .../RimcWellLogPlot.h | 6 + .../RimcWellLogPlotCollection.cpp | 28 +- .../RimcWellLogPlotCollection.h | 4 + .../RimcWellLogTrack.cpp | 58 ++-- .../RimcWellLogTrack.h | 10 + 19 files changed, 778 insertions(+), 39 deletions(-) create mode 100644 ApplicationLibCode/Commands/RicCreateEnsembleWellLogFeature.cpp create mode 100644 ApplicationLibCode/Commands/RicCreateEnsembleWellLogFeature.h create mode 100644 ApplicationLibCode/Commands/RicCreateEnsembleWellLogUi.cpp create mode 100644 ApplicationLibCode/Commands/RicCreateEnsembleWellLogUi.h diff --git a/ApplicationLibCode/Commands/CMakeLists_files.cmake b/ApplicationLibCode/Commands/CMakeLists_files.cmake index fb06ed6d76..c044253652 100644 --- a/ApplicationLibCode/Commands/CMakeLists_files.cmake +++ b/ApplicationLibCode/Commands/CMakeLists_files.cmake @@ -75,6 +75,8 @@ set(SOURCE_GROUP_HEADER_FILES ${CMAKE_CURRENT_LIST_DIR}/RicImportGridModelFromSummaryCurveFeature.h ${CMAKE_CURRENT_LIST_DIR}/RicGenerateMultipleSurfacesFeature.h ${CMAKE_CURRENT_LIST_DIR}/RicGenerateMultipleSurfacesUi.h + ${CMAKE_CURRENT_LIST_DIR}/RicCreateEnsembleWellLogFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicCreateEnsembleWellLogUi.h ) set(SOURCE_GROUP_SOURCE_FILES @@ -153,6 +155,8 @@ set(SOURCE_GROUP_SOURCE_FILES ${CMAKE_CURRENT_LIST_DIR}/RicImportGridModelFromSummaryCurveFeature.cpp ${CMAKE_CURRENT_LIST_DIR}/RicGenerateMultipleSurfacesFeature.cpp ${CMAKE_CURRENT_LIST_DIR}/RicGenerateMultipleSurfacesUi.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicCreateEnsembleWellLogFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicCreateEnsembleWellLogUi.cpp ) if(Qt5Charts_FOUND) diff --git a/ApplicationLibCode/Commands/RicCreateEnsembleWellLogFeature.cpp b/ApplicationLibCode/Commands/RicCreateEnsembleWellLogFeature.cpp new file mode 100644 index 0000000000..056137f4cb --- /dev/null +++ b/ApplicationLibCode/Commands/RicCreateEnsembleWellLogFeature.cpp @@ -0,0 +1,281 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2021- Equinor ASA +// +// ResInsight is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// + +#include "RicCreateEnsembleWellLogFeature.h" + +#include "RiaApplication.h" +#include "RiaColorTables.h" +#include "RiaImportEclipseCaseTools.h" +#include "RiaLogging.h" + +#include "ExportCommands/RicExportToLasFileFeature.h" +#include "RicCreateEnsembleWellLogUi.h" +#include "RicImportEnsembleWellLogsFeature.h" +#include "RicRecursiveFileSearchDialog.h" +#include "WellPathCommands/RicImportWellPaths.h" + +#include "RimDialogData.h" +#include "RimEclipseCase.h" +#include "RimEnsembleWellLogCurveSet.h" +#include "RimMainPlotCollection.h" +#include "RimProject.h" +#include "RimWellLogTrack.h" +#include "RimcWellLogPlot.h" +#include "RimcWellLogPlotCollection.h" +#include "RimcWellLogTrack.h" + +#include "Riu3DMainWindowTools.h" +#include "RiuPlotMainWindowTools.h" +#include "RiuPropertyViewTabWidget.h" + +#include "cafCmdFeatureManager.h" +#include "cafPdmSettings.h" +#include "cafPdmUiPropertyViewDialog.h" +#include "cafProgressInfo.h" +#include "cafSelectionManager.h" + +#include +#include +#include + +CAF_CMD_SOURCE_INIT( RicCreateEnsembleWellLogFeature, "RicCreateEnsembleWellLogFeature" ); + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RicCreateEnsembleWellLogFeature::openDialogAndExecuteCommand() +{ + // Get the list of egrid files + RiaApplication* app = RiaApplication::instance(); + QString defaultDir = app->lastUsedDialogDirectory( "BINARY_GRID" ); + + QString pathFilter( "*" ); + QString fileNameFilter( "*" ); + + RicRecursiveFileSearchDialogResult result = + RicRecursiveFileSearchDialog::runRecursiveSearchDialog( nullptr, + "Choose Eclipse Cases", + defaultDir, + pathFilter, + fileNameFilter, + QStringList( ".EGRID" ) ); + + if ( !result.ok || result.files.isEmpty() ) + { + return; + } + + // Use case data from first case + RimEclipseCase* eclipseCase = loadEclipseCase( result.files[0] ); + + RicCreateEnsembleWellLogUi* ui = RimProject::current()->dialogData()->createEnsembleWellLogUi(); + ui->setCaseData( eclipseCase->eclipseCaseData() ); + + RiuPropertyViewTabWidget propertyDialog( Riu3DMainWindowTools::mainWindowWidget(), + ui, + "Create Ensemble Well Log", + ui->tabNames() ); + + if ( propertyDialog.exec() == QDialog::Accepted && !ui->properties().empty() && !ui->wellPathFilePath().isEmpty() ) + { + executeCommand( *ui, result.files.toStdList() ); + } +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RicCreateEnsembleWellLogFeature::executeCommand( const RicCreateEnsembleWellLogUi& ui, + const std::list& fileNames ) +{ + caf::ProgressInfo progress( fileNames.size(), "Creating ensemble well log" ); + + std::vector> properties = ui.properties(); + + RimWellLogPlotCollection* plotCollection = RimProject::current()->mainPlotCollection()->wellLogPlotCollection(); + + // Load well path from file + QStringList wellPathFilePaths; + wellPathFilePaths << ui.wellPathFilePath(); + bool importGrouped = false; + QStringList errorMessages; + std::vector wellPaths = + RicImportWellPaths::importWellPaths( wellPathFilePaths, importGrouped, &errorMessages ); + if ( wellPaths.empty() ) return; + + RimWellPath* wellPath = wellPaths[0]; + + QStringList allLasFileNames; + for ( auto fileName : fileNames ) + { + auto task = progress.task( QString( "Extracting well log for %1" ).arg( fileName ) ); + + // Load eclipse case + RimEclipseCase* eclipseCase = loadEclipseCase( fileName ); + if ( !eclipseCase ) + { + RiaLogging::error( QString( "Failed to load model from file: " ).arg( fileName ) ); + return; + } + + // Create the well log plot + RimWellLogPlot* wellLogPlot = + RimcWellLogPlotCollection_newWellLogPlot::createWellLogPlot( plotCollection, wellPath, eclipseCase ); + + // Create well log track + QString title = "Track"; + RimWellLogTrack* wellLogTrack = + RimcWellLogPlot_newWellLogTrack::createWellLogTrack( wellLogPlot, eclipseCase, wellPath, title ); + + // Create a well log curve for each property + for ( auto property : properties ) + { + QString propertyName = property.first; + RiaDefines::ResultCatType resultCategoryType = property.second; + int timeStep = ui.timeStep(); + RimcWellLogTrack_addExtractionCurve::addExtractionCurve( wellLogTrack, + eclipseCase, + wellPath, + propertyName, + resultCategoryType, + timeStep ); + } + + { + // Create missing directories + QString wellLogExportDirName = "lasexport"; + QFileInfo fi( fileName ); + QString exportFolder = fi.absoluteDir().absolutePath() + QString( "/%1/" ).arg( wellLogExportDirName ); + + if ( !fi.absoluteDir().exists( wellLogExportDirName ) ) + { + if ( !fi.absoluteDir().mkpath( wellLogExportDirName ) ) + { + RiaLogging::error( QString( "Unable to create directory for well log export: " ).arg( exportFolder ) ); + return; + } + } + + // Export to las file + QString filePrefix = ""; + bool exportTvdRkb = false; + bool capitalizeFileNames = false; + bool alwaysOverwrite = true; + double resampleInterval = 0.0; + bool convertCurveUnits = false; + + std::vector lasFiles = RicExportToLasFileFeature::exportToLasFiles( exportFolder, + filePrefix, + wellLogPlot, + exportTvdRkb, + capitalizeFileNames, + alwaysOverwrite, + resampleInterval, + convertCurveUnits ); + for ( auto lasFile : lasFiles ) + allLasFileNames << lasFile; + } + + // Remove the temporary plots after export + plotCollection->removePlot( wellLogPlot ); + } + + if ( ui.autoCreateEnsembleWellLogs() ) + { + RimEnsembleWellLogs* ensembleWellLogs = + RicImportEnsembleWellLogsFeature::createEnsembleWellLogsFromFiles( allLasFileNames ); + if ( ensembleWellLogs ) + { + RimEclipseCase* eclipseCase = nullptr; + + // Create the well log plot + RimWellLogPlot* wellLogPlot = + RimcWellLogPlotCollection_newWellLogPlot::createWellLogPlot( plotCollection, wellPath, eclipseCase ); + + // Create a track per property + for ( auto property : properties ) + { + // Create well log track + cvf::Color3f color = RiaColorTables::normalPaletteColors().cycledColor3f( wellLogPlot->plotCount() ); + QString title = QString( "Track %1" ).arg( wellLogPlot->plotCount() ); + RimWellLogTrack* wellLogTrack = + RimcWellLogPlot_newWellLogTrack::createWellLogTrack( wellLogPlot, eclipseCase, wellPath, title ); + RimEnsembleWellLogCurveSet* ensembleWellLogCurveSet = new RimEnsembleWellLogCurveSet(); + ensembleWellLogCurveSet->setEnsembleWellLogs( ensembleWellLogs ); + ensembleWellLogCurveSet->setColor( color ); + ensembleWellLogCurveSet->setWellLogChannelName( property.first ); + wellLogTrack->setEnsembleWellLogCurveSet( ensembleWellLogCurveSet ); + ensembleWellLogCurveSet->loadDataAndUpdate( true ); + } + + wellLogPlot->updateConnectedEditors(); + + RiuPlotMainWindowTools::showPlotMainWindow(); + RiuPlotMainWindowTools::selectAsCurrentItem( wellLogPlot ); + } + } +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RimEclipseCase* RicCreateEnsembleWellLogFeature::loadEclipseCase( const QString& fileName ) +{ + QString absolutePath = fileName; + QFileInfo projectPathInfo( absolutePath ); + if ( !projectPathInfo.exists() ) + { + QDir startDir( RiaApplication::instance()->startDir() ); + absolutePath = startDir.absoluteFilePath( fileName ); + } + + RiaImportEclipseCaseTools::FileCaseIdMap fileCaseIdMap; + bool createView = false; + bool doNotShowDialog = true; + bool ok = RiaImportEclipseCaseTools::openEclipseCasesFromFile( QStringList( { absolutePath } ), + createView, + &fileCaseIdMap, + doNotShowDialog ); + if ( !ok || fileCaseIdMap.empty() ) return nullptr; + + return RimProject::current()->eclipseCaseFromCaseId( fileCaseIdMap.begin()->second ); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +bool RicCreateEnsembleWellLogFeature::isCommandEnabled() +{ + return true; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RicCreateEnsembleWellLogFeature::onActionTriggered( bool isChecked ) +{ + openDialogAndExecuteCommand(); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RicCreateEnsembleWellLogFeature::setupActionLook( QAction* actionToSetup ) +{ + actionToSetup->setText( "Create Ensemble Well Log..." ); +} diff --git a/ApplicationLibCode/Commands/RicCreateEnsembleWellLogFeature.h b/ApplicationLibCode/Commands/RicCreateEnsembleWellLogFeature.h new file mode 100644 index 0000000000..125e135765 --- /dev/null +++ b/ApplicationLibCode/Commands/RicCreateEnsembleWellLogFeature.h @@ -0,0 +1,44 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2021- Equinor ASA +// +// ResInsight is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// + +#pragma once + +#include "cafCmdFeature.h" + +#include + +class RicCreateEnsembleWellLogUi; +class RimEclipseCase; + +//================================================================================================== +/// +//================================================================================================== +class RicCreateEnsembleWellLogFeature : public caf::CmdFeature +{ + CAF_CMD_HEADER_INIT; + +public: + static void openDialogAndExecuteCommand(); + static void executeCommand( const RicCreateEnsembleWellLogUi& ui, const std::list& fileNames ); + static RimEclipseCase* loadEclipseCase( const QString& fileName ); + +protected: + bool isCommandEnabled() override; + void onActionTriggered( bool isChecked ) override; + void setupActionLook( QAction* actionToSetup ) override; +}; diff --git a/ApplicationLibCode/Commands/RicCreateEnsembleWellLogUi.cpp b/ApplicationLibCode/Commands/RicCreateEnsembleWellLogUi.cpp new file mode 100644 index 0000000000..d4ef95ee90 --- /dev/null +++ b/ApplicationLibCode/Commands/RicCreateEnsembleWellLogUi.cpp @@ -0,0 +1,231 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2021- Equinor ASA +// +// ResInsight is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// + +#include "RicCreateEnsembleWellLogUi.h" + +#include "RiaApplication.h" + +#include "RiaDefines.h" +#include "RigEclipseCaseData.h" + +#include "RigEclipseResultAddress.h" +#include "RimEclipseCase.h" +#include "RimEclipseResultDefinition.h" +#include "RimTools.h" + +#include "cafPdmObject.h" +#include "cafPdmUiCheckBoxEditor.h" +#include "cafPdmUiListEditor.h" +#include "cafPdmUiOrdering.h" +#include "cafPdmUiTreeSelectionEditor.h" + +CAF_PDM_SOURCE_INIT( RicCreateEnsembleWellLogUi, "RicCreateEnsembleWellLogUi" ); + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RicCreateEnsembleWellLogUi::RicCreateEnsembleWellLogUi() +{ + CAF_PDM_InitObject( "Create Ensemble Well Log", "", "", "" ); + + CAF_PDM_InitField( &m_autoCreateEnsembleWellLogs, + "AutoCreateEnsembleWellLogs", + false, + "Create Ensemble Well Logs From Exported Files", + "", + "", + "" ); + caf::PdmUiNativeCheckBoxEditor::configureFieldForEditor( &m_autoCreateEnsembleWellLogs ); + + CAF_PDM_InitField( &m_timeStep, "TimeStep", 0, "Time Step", "", "", "" ); + CAF_PDM_InitFieldNoDefault( &m_well, "Well", "Well", "", "", "" ); + CAF_PDM_InitFieldNoDefault( &m_selectedKeywords, "SelectedProperties", "Selected Properties", "", "", "" ); + m_selectedKeywords.uiCapability()->setUiEditorTypeName( caf::PdmUiTreeSelectionEditor::uiEditorTypeName() ); + + m_tabNames << "Well" + << "Properties"; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RicCreateEnsembleWellLogUi::~RicCreateEnsembleWellLogUi() +{ +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +const QStringList& RicCreateEnsembleWellLogUi::tabNames() const +{ + return m_tabNames; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RicCreateEnsembleWellLogUi::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) +{ + if ( uiConfigName == m_tabNames[0] ) + { + uiOrdering.add( &m_well ); + uiOrdering.add( &m_autoCreateEnsembleWellLogs ); + } + else if ( uiConfigName == m_tabNames[1] ) + { + uiOrdering.add( &m_selectedKeywords ); + uiOrdering.add( &m_timeStep ); + } + uiOrdering.skipRemainingFields( true ); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +QList + RicCreateEnsembleWellLogUi::calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions, bool* useOptionsOnly ) +{ + QList options; + + if ( fieldNeedingOptions == &m_selectedKeywords ) + { + RigCaseCellResultsData* resultData = m_caseData->results( RiaDefines::PorosityModelType::MATRIX_MODEL ); + + std::vector resultCategories = validResultCategories(); + for ( auto catType : resultCategories ) + { + QList allOptions = + RimEclipseResultDefinition::calcOptionsForVariableUiFieldStandard( catType, resultData ); + + bool isFirstOfCategory = true; + for ( caf::PdmOptionItemInfo option : allOptions ) + { + if ( resultData->hasResultEntry( RigEclipseResultAddress( catType, option.optionUiText() ) ) ) + { + if ( isFirstOfCategory ) + { + // Add the category title only when there is at least one valid result + options.push_back( + caf::PdmOptionItemInfo::createHeader( caf::AppEnum::uiText( catType ), + true ) ); + isFirstOfCategory = false; + } + + options.push_back( option ); + } + } + } + } + else if ( fieldNeedingOptions == &m_timeStep ) + { + RimTools::timeStepsForCase( m_caseData->ownerCase(), &options ); + } + + return options; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +bool RicCreateEnsembleWellLogUi::autoCreateEnsembleWellLogs() const +{ + return m_autoCreateEnsembleWellLogs; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +std::vector> RicCreateEnsembleWellLogUi::properties() const +{ + std::vector selectedKeyWords = m_selectedKeywords(); + + auto findResultCategory = []( const QString& keyword, + const std::vector& categories, + RigEclipseCaseData* caseData ) { + // Find the result category for a given keyword + RigCaseCellResultsData* resultData = caseData->results( RiaDefines::PorosityModelType::MATRIX_MODEL ); + for ( auto category : categories ) + if ( resultData->hasResultEntry( RigEclipseResultAddress( category, keyword ) ) ) return category; + + return RiaDefines::ResultCatType::UNDEFINED; + }; + + std::vector resultCategories = validResultCategories(); + + std::vector> props; + for ( auto keyword : selectedKeyWords ) + { + auto resultCategory = findResultCategory( keyword, resultCategories, m_caseData ); + props.push_back( std::make_pair( keyword, resultCategory ) ); + } + + return props; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +std::vector RicCreateEnsembleWellLogUi::validResultCategories() const +{ + return { RiaDefines::ResultCatType::STATIC_NATIVE, + RiaDefines::ResultCatType::DYNAMIC_NATIVE, + RiaDefines::ResultCatType::INPUT_PROPERTY }; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +int RicCreateEnsembleWellLogUi::timeStep() const +{ + return m_timeStep; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +QString RicCreateEnsembleWellLogUi::wellPathFilePath() const +{ + return m_well().path(); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RicCreateEnsembleWellLogUi::setCaseData( RigEclipseCaseData* caseData ) +{ + m_caseData = caseData; + + if ( m_selectedKeywords().empty() ) + { + RigCaseCellResultsData* resultData = caseData->results( RiaDefines::PorosityModelType::MATRIX_MODEL ); + std::vector defaultKeywords = { "INDEX_K", "PORO", "PERMZ", "PRESSURE" }; + std::vector categories = validResultCategories(); + + for ( auto keyword : defaultKeywords ) + { + for ( auto category : categories ) + { + if ( resultData->hasResultEntry( RigEclipseResultAddress( category, keyword ) ) ) + { + m_selectedKeywords.v().push_back( keyword ); + break; + } + } + } + } +} diff --git a/ApplicationLibCode/Commands/RicCreateEnsembleWellLogUi.h b/ApplicationLibCode/Commands/RicCreateEnsembleWellLogUi.h new file mode 100644 index 0000000000..ffb747e1b5 --- /dev/null +++ b/ApplicationLibCode/Commands/RicCreateEnsembleWellLogUi.h @@ -0,0 +1,68 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2021- Equinor ASA +// +// ResInsight is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// + +#pragma once + +#include "RiaDefines.h" + +#include "cafPdmField.h" +#include "cafPdmObject.h" + +#include +#include + +class RigEclipseCaseData; + +//================================================================================================== +/// +//================================================================================================== +class RicCreateEnsembleWellLogUi : public caf::PdmObject +{ + CAF_PDM_HEADER_INIT; + +public: + RicCreateEnsembleWellLogUi(); + ~RicCreateEnsembleWellLogUi() override; + const QStringList& tabNames() const; + + bool autoCreateEnsembleWellLogs() const; + + int timeStep() const; + QString wellPathFilePath() const; + std::vector> properties() const; + + void setCaseData( RigEclipseCaseData* caseData ); + +protected: + void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override; + + QList calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions, + bool* useOptionsOnly ) override; + + std::vector validResultCategories() const; + +private: + caf::PdmField m_well; + caf::PdmField m_autoCreateEnsembleWellLogs; + + caf::PdmField> m_selectedKeywords; + caf::PdmField m_timeStep; + + QStringList m_tabNames; + RigEclipseCaseData* m_caseData; +}; diff --git a/ApplicationLibCode/Commands/RicImportEnsembleWellLogsFeature.cpp b/ApplicationLibCode/Commands/RicImportEnsembleWellLogsFeature.cpp index 87a9af67e2..dbd8f83175 100644 --- a/ApplicationLibCode/Commands/RicImportEnsembleWellLogsFeature.cpp +++ b/ApplicationLibCode/Commands/RicImportEnsembleWellLogsFeature.cpp @@ -19,10 +19,9 @@ #include "RicImportEnsembleWellLogsFeature.h" #include "RiaApplication.h" +#include "RiaEnsembleNameTools.h" #include "RiaLogging.h" -#include "WellLogCommands/RicWellLogsImportFileFeature.h" - #include "RimEnsembleWellLogs.h" #include "RimEnsembleWellLogsCollection.h" #include "RimOilField.h" @@ -30,6 +29,7 @@ #include "RimWellLogFile.h" #include "RicRecursiveFileSearchDialog.h" +#include "WellLogCommands/RicWellLogsImportFileFeature.h" #include #include @@ -63,8 +63,15 @@ void RicImportEnsembleWellLogsFeature::onActionTriggered( bool isChecked ) QStringList fileNames = runRecursiveFileSearchDialog( "Import Ensemble Well Logs", pathCacheName ); if ( fileNames.isEmpty() ) return; - QString ensembleName = "Ensemble Well Logs"; - if ( ensembleName.isEmpty() ) return; + createEnsembleWellLogsFromFiles( fileNames ); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RimEnsembleWellLogs* RicImportEnsembleWellLogsFeature::createEnsembleWellLogsFromFiles( const QStringList& fileNames ) +{ + if ( fileNames.isEmpty() ) return nullptr; std::vector cases; for ( QString fileNames : fileNames ) @@ -78,15 +85,19 @@ void RicImportEnsembleWellLogsFeature::onActionTriggered( bool isChecked ) } } - if ( cases.empty() ) return; + if ( cases.empty() ) return nullptr; RimEnsembleWellLogs* ensemble = new RimEnsembleWellLogs; + + QString ensembleName = RiaEnsembleNameTools::findSuitableEnsembleName( fileNames ); ensemble->setName( ensembleName ); for ( auto wellLogFile : cases ) ensemble->addWellLogFile( wellLogFile ); RimProject::current()->activeOilField()->ensembleWellLogsCollection->addEnsembleWellLogs( ensemble ); RimProject::current()->activeOilField()->ensembleWellLogsCollection->updateConnectedEditors(); + + return ensemble; } //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationLibCode/Commands/RicImportEnsembleWellLogsFeature.h b/ApplicationLibCode/Commands/RicImportEnsembleWellLogsFeature.h index e5d025c2cf..3d5650f23d 100644 --- a/ApplicationLibCode/Commands/RicImportEnsembleWellLogsFeature.h +++ b/ApplicationLibCode/Commands/RicImportEnsembleWellLogsFeature.h @@ -22,6 +22,8 @@ #include +class RimEnsembleWellLogs; + //================================================================================================== /// //================================================================================================== @@ -31,6 +33,8 @@ class RicImportEnsembleWellLogsFeature : public caf::CmdFeature RicImportEnsembleWellLogsFeature(); + static RimEnsembleWellLogs* createEnsembleWellLogsFromFiles( const QStringList& fileNames ); + protected: // Overrides bool isCommandEnabled() override; diff --git a/ApplicationLibCode/Commands/WellPathCommands/RicImportWellPaths.h b/ApplicationLibCode/Commands/WellPathCommands/RicImportWellPaths.h index 0c53f1dbe1..8d2378ad6a 100644 --- a/ApplicationLibCode/Commands/WellPathCommands/RicImportWellPaths.h +++ b/ApplicationLibCode/Commands/WellPathCommands/RicImportWellPaths.h @@ -42,9 +42,10 @@ class RicImportWellPaths : public caf::CmdFeature, public RicfCommandObject RicImportWellPaths(); caf::PdmScriptResponse execute() override; -protected: static std::vector - importWellPaths( const QStringList& wellPathFilePaths, bool importGrouped, QStringList* errorMessages ); + importWellPaths( const QStringList& wellPathFilePaths, bool importGrouped, QStringList* errorMessages ); + +protected: static QStringList wellPathNameFilters(); bool isCommandEnabled() override; diff --git a/ApplicationLibCode/ProjectDataModel/RimContextCommandBuilder.cpp b/ApplicationLibCode/ProjectDataModel/RimContextCommandBuilder.cpp index 9eea87b6ab..48b69fc1cd 100644 --- a/ApplicationLibCode/ProjectDataModel/RimContextCommandBuilder.cpp +++ b/ApplicationLibCode/ProjectDataModel/RimContextCommandBuilder.cpp @@ -340,6 +340,7 @@ caf::CmdFeatureMenuBuilder RimContextCommandBuilder::commandsFromSelection() { menuBuilder << "RicNewEditableWellPathFeature"; menuBuilder << "RicPasteModeledWellPathFeature"; + menuBuilder << "RicCreateEnsembleWellLogFeature"; menuBuilder.addSeparator(); menuBuilder.subMenuStart( "Import" ); menuBuilder << "RicWellPathsImportFileFeature"; diff --git a/ApplicationLibCode/ProjectDataModel/RimDialogData.cpp b/ApplicationLibCode/ProjectDataModel/RimDialogData.cpp index c711a1a068..5dd734969e 100644 --- a/ApplicationLibCode/ProjectDataModel/RimDialogData.cpp +++ b/ApplicationLibCode/ProjectDataModel/RimDialogData.cpp @@ -27,6 +27,7 @@ #include "ExportCommands/RicExportWellPathsUi.h" #include "FractureCommands/RicCreateMultipleFracturesUi.h" #include "HoloLensCommands/RicHoloLensExportToFolderUi.h" +#include "RicCreateEnsembleWellLogUi.h" #include "RicGenerateMultipleSurfacesUi.h" CAF_PDM_SOURCE_INIT( RimDialogData, "RimDialogData" ); @@ -74,6 +75,9 @@ RimDialogData::RimDialogData() "", "" ); m_generateEnsembleSurfacesUi = new RicGenerateMultipleSurfacesUi(); + + CAF_PDM_InitFieldNoDefault( &m_createEnsembleWellLogUi, "CreateEnsembleWellLogUi", "Create Ensemble Well Log Ui", "", "", "" ); + m_createEnsembleWellLogUi = new RicCreateEnsembleWellLogUi(); } //-------------------------------------------------------------------------------------------------- @@ -172,3 +176,11 @@ RicGenerateMultipleSurfacesUi* RimDialogData::generateEnsembleSurfacesUi() const { return m_generateEnsembleSurfacesUi; } + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RicCreateEnsembleWellLogUi* RimDialogData::createEnsembleWellLogUi() const +{ + return m_createEnsembleWellLogUi; +} diff --git a/ApplicationLibCode/ProjectDataModel/RimDialogData.h b/ApplicationLibCode/ProjectDataModel/RimDialogData.h index c8c83386ec..b4738beefe 100644 --- a/ApplicationLibCode/ProjectDataModel/RimDialogData.h +++ b/ApplicationLibCode/ProjectDataModel/RimDialogData.h @@ -30,6 +30,7 @@ class RicExportWellPathsUi; class RicExportLgrUi; class RimMockModelSettings; class RicGenerateMultipleSurfacesUi; +class RicCreateEnsembleWellLogUi; //================================================================================================== /// @@ -63,6 +64,7 @@ class RimDialogData : public caf::PdmObject RicExportEclipseSectorModelUi* exportSectorModelUi() const; RimMockModelSettings* mockModelSettings() const; RicGenerateMultipleSurfacesUi* generateEnsembleSurfacesUi() const; + RicCreateEnsembleWellLogUi* createEnsembleWellLogUi() const; private: caf::PdmChildField m_exportCarfin; @@ -74,4 +76,5 @@ class RimDialogData : public caf::PdmObject caf::PdmChildField m_exportSectorModelData; caf::PdmChildField m_mockModelSettings; caf::PdmChildField m_generateEnsembleSurfacesUi; + caf::PdmChildField m_createEnsembleWellLogUi; }; diff --git a/ApplicationLibCode/ProjectDataModel/WellLog/RimEnsembleWellLogCurveSet.cpp b/ApplicationLibCode/ProjectDataModel/WellLog/RimEnsembleWellLogCurveSet.cpp index 9019a605cb..0c19ccb6ce 100644 --- a/ApplicationLibCode/ProjectDataModel/WellLog/RimEnsembleWellLogCurveSet.cpp +++ b/ApplicationLibCode/ProjectDataModel/WellLog/RimEnsembleWellLogCurveSet.cpp @@ -764,6 +764,7 @@ void RimEnsembleWellLogCurveSet::updateEnsembleCurves( const std::vectoraddCurve( curve ); + curve->setUiTreeHidden( true ); QString errorMessage; if ( wellLogFile->readFile( &errorMessage ) ) @@ -1153,3 +1154,19 @@ void RimEnsembleWellLogCurveSet::initAfterRead() { connectEnsembleCurveSetFilterSignals(); } + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimEnsembleWellLogCurveSet::setEnsembleWellLogs( RimEnsembleWellLogs* ensembleWellLogs ) +{ + m_ensembleWellLogs = ensembleWellLogs; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimEnsembleWellLogCurveSet::setWellLogChannelName( const QString& wellLogChannelName ) +{ + m_wellLogChannelName = wellLogChannelName; +} diff --git a/ApplicationLibCode/ProjectDataModel/WellLog/RimEnsembleWellLogCurveSet.h b/ApplicationLibCode/ProjectDataModel/WellLog/RimEnsembleWellLogCurveSet.h index 6d572a4af8..6912ff52b2 100644 --- a/ApplicationLibCode/ProjectDataModel/WellLog/RimEnsembleWellLogCurveSet.h +++ b/ApplicationLibCode/ProjectDataModel/WellLog/RimEnsembleWellLogCurveSet.h @@ -117,6 +117,9 @@ class RimEnsembleWellLogCurveSet : public caf::PdmObject, public RimEnsembleCurv void updateStatistics(); + void setEnsembleWellLogs( RimEnsembleWellLogs* ensembleWellLogs ); + void setWellLogChannelName( const QString& wellLogChannelName ); + private: void updateEnsembleCurves( const std::vector& curves ); void updateStatisticsCurves( const std::vector& curves ); diff --git a/ApplicationLibCode/ProjectDataModelCommands/RimcWellLogPlot.cpp b/ApplicationLibCode/ProjectDataModelCommands/RimcWellLogPlot.cpp index a65c3ea1f5..9914021ca4 100644 --- a/ApplicationLibCode/ProjectDataModelCommands/RimcWellLogPlot.cpp +++ b/ApplicationLibCode/ProjectDataModelCommands/RimcWellLogPlot.cpp @@ -60,9 +60,20 @@ caf::PdmObjectHandle* RimcWellLogPlot_newWellLogTrack::execute() if ( !wellLogPlot ) return nullptr; - RimWellLogTrack* plotTrack = RicNewWellLogPlotFeatureImpl::createWellLogPlotTrack( false, m_title, wellLogPlot ); - if ( m_case() ) plotTrack->setFormationCase( m_case ); - if ( m_wellPath() ) plotTrack->setFormationWellPath( m_wellPath ); + return createWellLogTrack( wellLogPlot, m_case(), m_wellPath(), m_title() ); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RimWellLogTrack* RimcWellLogPlot_newWellLogTrack::createWellLogTrack( RimWellLogPlot* wellLogPlot, + RimEclipseCase* eclipseCase, + RimWellPath* wellPath, + const QString& title ) +{ + RimWellLogTrack* plotTrack = RicNewWellLogPlotFeatureImpl::createWellLogPlotTrack( false, title, wellLogPlot ); + if ( eclipseCase ) plotTrack->setFormationCase( eclipseCase ); + if ( wellPath ) plotTrack->setFormationWellPath( wellPath ); plotTrack->setColSpan( RimPlot::TWO ); plotTrack->setLegendsVisible( true ); plotTrack->setPlotTitleVisible( true ); diff --git a/ApplicationLibCode/ProjectDataModelCommands/RimcWellLogPlot.h b/ApplicationLibCode/ProjectDataModelCommands/RimcWellLogPlot.h index b480a1c653..4c38a9da9b 100644 --- a/ApplicationLibCode/ProjectDataModelCommands/RimcWellLogPlot.h +++ b/ApplicationLibCode/ProjectDataModelCommands/RimcWellLogPlot.h @@ -28,6 +28,7 @@ class RimEclipseCase; class RimWellPath; +class RimWellLogTrack; //================================================================================================== /// @@ -43,6 +44,11 @@ class RimcWellLogPlot_newWellLogTrack : public caf::PdmObjectMethod bool resultIsPersistent() const override; std::unique_ptr defaultResult() const override; + static RimWellLogTrack* createWellLogTrack( RimWellLogPlot* wellLogPlot, + RimEclipseCase* eclipseCase, + RimWellPath* wellPath, + const QString& title ); + private: caf::PdmField m_title; caf::PdmPtrField m_case; diff --git a/ApplicationLibCode/ProjectDataModelCommands/RimcWellLogPlotCollection.cpp b/ApplicationLibCode/ProjectDataModelCommands/RimcWellLogPlotCollection.cpp index 58c9c6c96d..202393ec67 100644 --- a/ApplicationLibCode/ProjectDataModelCommands/RimcWellLogPlotCollection.cpp +++ b/ApplicationLibCode/ProjectDataModelCommands/RimcWellLogPlotCollection.cpp @@ -20,6 +20,7 @@ #include "RiaApplication.h" #include "RiaGuiApplication.h" +#include "RimcWellLogPlot.h" #include "WellLogCommands/RicNewWellLogPlotFeatureImpl.h" #include "RimEclipseCase.h" @@ -64,17 +65,28 @@ caf::PdmObjectHandle* RimcWellLogPlotCollection_newWellLogPlot::execute() if ( m_case && m_wellPath && wellLogPlotCollection ) { - newWellLogPlot = new RimWellLogPlot; - newWellLogPlot->setAsPlotMdiWindow(); + newWellLogPlot = createWellLogPlot( wellLogPlotCollection, m_wellPath, m_case ); + } - wellLogPlotCollection->addWellLogPlot( newWellLogPlot ); + return newWellLogPlot; +} - newWellLogPlot->commonDataSource()->setCaseToApply( m_case ); - newWellLogPlot->commonDataSource()->setWellPathToApply( m_wellPath ); - newWellLogPlot->loadDataAndUpdate(); - newWellLogPlot->updateConnectedEditors(); - } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RimWellLogPlot* RimcWellLogPlotCollection_newWellLogPlot::createWellLogPlot( RimWellLogPlotCollection* wellLogPlotCollection, + RimWellPath* wellPath, + RimEclipseCase* eclipseCase ) +{ + RimWellLogPlot* newWellLogPlot = new RimWellLogPlot; + newWellLogPlot->setAsPlotMdiWindow(); + + wellLogPlotCollection->addWellLogPlot( newWellLogPlot ); + newWellLogPlot->commonDataSource()->setCaseToApply( eclipseCase ); + newWellLogPlot->commonDataSource()->setWellPathToApply( wellPath ); + newWellLogPlot->loadDataAndUpdate(); + newWellLogPlot->updateConnectedEditors(); return newWellLogPlot; } diff --git a/ApplicationLibCode/ProjectDataModelCommands/RimcWellLogPlotCollection.h b/ApplicationLibCode/ProjectDataModelCommands/RimcWellLogPlotCollection.h index 0480c13300..f31c3cc2c5 100644 --- a/ApplicationLibCode/ProjectDataModelCommands/RimcWellLogPlotCollection.h +++ b/ApplicationLibCode/ProjectDataModelCommands/RimcWellLogPlotCollection.h @@ -42,6 +42,10 @@ class RimcWellLogPlotCollection_newWellLogPlot : public caf::PdmObjectMethod bool resultIsPersistent() const override; std::unique_ptr defaultResult() const override; + static RimWellLogPlot* createWellLogPlot( RimWellLogPlotCollection* wellLogPlotCollection, + RimWellPath* wellPath, + RimEclipseCase* eclipseCase ); + private: caf::PdmPtrField m_case; caf::PdmPtrField m_wellPath; diff --git a/ApplicationLibCode/ProjectDataModelCommands/RimcWellLogTrack.cpp b/ApplicationLibCode/ProjectDataModelCommands/RimcWellLogTrack.cpp index 21378e5ce3..c27ab775f5 100644 --- a/ApplicationLibCode/ProjectDataModelCommands/RimcWellLogTrack.cpp +++ b/ApplicationLibCode/ProjectDataModelCommands/RimcWellLogTrack.cpp @@ -18,6 +18,7 @@ #include "RimcWellLogTrack.h" #include "RiaApplication.h" +#include "RiaDefines.h" #include "RiaGuiApplication.h" #include "WellLogCommands/RicNewWellLogPlotFeatureImpl.h" @@ -61,35 +62,50 @@ caf::PdmObjectHandle* RimcWellLogTrack_addExtractionCurve::execute() if ( m_case && m_wellPath && wellLogTrack ) { - RimWellLogExtractionCurve* curve = new RimWellLogExtractionCurve; - curve->setWellPath( m_wellPath ); - curve->setCase( m_case ); - curve->setCurrentTimeStep( m_timeStep ); - curve->setEclipseResultVariable( m_propertyName ); - RiaDefines::ResultCatType resultCategoryType = caf::AppEnum::fromText( m_propertyType ); - curve->setEclipseResultCategory( resultCategoryType ); - wellLogTrack->addCurve( curve ); - curve->loadDataAndUpdate( true ); + return addExtractionCurve( wellLogTrack, m_case, m_wellPath, m_propertyName, resultCategoryType, m_timeStep ); + } - curve->updateConnectedEditors(); + return nullptr; +} - wellLogTrack->setXAxisGridVisibility( RimWellLogPlot::AXIS_GRID_MAJOR ); - wellLogTrack->setShowRegionLabels( true ); - wellLogTrack->setAutoScaleXEnabled( true ); - wellLogTrack->updateConnectedEditors(); - wellLogTrack->setShowWindow( true ); +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RimWellLogExtractionCurve* + RimcWellLogTrack_addExtractionCurve::addExtractionCurve( RimWellLogTrack* wellLogTrack, + RimEclipseCase* eclipseCase, + RimWellPath* wellPath, + const QString& propertyName, + RiaDefines::ResultCatType resultCategoryType, + int timeStep ) +{ + RimWellLogExtractionCurve* curve = new RimWellLogExtractionCurve; + curve->setWellPath( wellPath ); + curve->setCase( eclipseCase ); + curve->setCurrentTimeStep( timeStep ); + curve->setEclipseResultVariable( propertyName ); - RiaApplication::instance()->project()->updateConnectedEditors(); + curve->setEclipseResultCategory( resultCategoryType ); - RimWellLogPlot* wellLogPlot = dynamic_cast( wellLogTrack->parentField() ); - if ( wellLogPlot ) wellLogPlot->loadDataAndUpdate(); + wellLogTrack->addCurve( curve ); + curve->loadDataAndUpdate( true ); - return curve; - } + curve->updateConnectedEditors(); - return nullptr; + wellLogTrack->setXAxisGridVisibility( RimWellLogPlot::AXIS_GRID_MAJOR ); + wellLogTrack->setShowRegionLabels( true ); + wellLogTrack->setAutoScaleXEnabled( true ); + wellLogTrack->updateConnectedEditors(); + wellLogTrack->setShowWindow( true ); + + RiaApplication::instance()->project()->updateConnectedEditors(); + + RimWellLogPlot* wellLogPlot = dynamic_cast( wellLogTrack->parentField() ); + if ( wellLogPlot ) wellLogPlot->loadDataAndUpdate(); + + return curve; } //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationLibCode/ProjectDataModelCommands/RimcWellLogTrack.h b/ApplicationLibCode/ProjectDataModelCommands/RimcWellLogTrack.h index 70dc049952..b7cead3bee 100644 --- a/ApplicationLibCode/ProjectDataModelCommands/RimcWellLogTrack.h +++ b/ApplicationLibCode/ProjectDataModelCommands/RimcWellLogTrack.h @@ -18,6 +18,8 @@ #pragma once +#include "RiaDefines.h" + #include "cafPdmField.h" #include "cafPdmObjectHandle.h" #include "cafPdmObjectMethod.h" @@ -27,6 +29,7 @@ class RimEclipseCase; class RimWellPath; class RimWellLogTrack; +class RimWellLogExtractionCurve; //================================================================================================== /// @@ -42,6 +45,13 @@ class RimcWellLogTrack_addExtractionCurve : public caf::PdmObjectMethod bool resultIsPersistent() const override; std::unique_ptr defaultResult() const override; + static RimWellLogExtractionCurve* addExtractionCurve( RimWellLogTrack* wellLogTrack, + RimEclipseCase* eclipseCase, + RimWellPath* wellPath, + const QString& propertyName, + RiaDefines::ResultCatType resultCategoryType, + int timeStep ); + private: caf::PdmPtrField m_case; caf::PdmPtrField m_wellPath; From acdcbe44b40ff987395035b5b212124b8cd40558 Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Thu, 9 Sep 2021 10:16:37 +0200 Subject: [PATCH 107/308] Merge pull request #7975 from OPM/7973-custom-export-filename Export Completions : Custom export file name fails in some cases --- ...ellPathExportCompletionDataFeatureImpl.cpp | 1 + .../RicWellPathExportMswCompletionsImpl.cpp | 23 +++++++++++++++---- .../export_well_path_completions.py | 23 +++++++++++++++++++ 3 files changed, 43 insertions(+), 4 deletions(-) create mode 100644 GrpcInterface/Python/rips/PythonExamples/export_well_path_completions.py diff --git a/ApplicationLibCode/Commands/CompletionExportCommands/RicWellPathExportCompletionDataFeatureImpl.cpp b/ApplicationLibCode/Commands/CompletionExportCommands/RicWellPathExportCompletionDataFeatureImpl.cpp index 19f75e6e0d..d1269c9549 100644 --- a/ApplicationLibCode/Commands/CompletionExportCommands/RicWellPathExportCompletionDataFeatureImpl.cpp +++ b/ApplicationLibCode/Commands/CompletionExportCommands/RicWellPathExportCompletionDataFeatureImpl.cpp @@ -94,6 +94,7 @@ void RicWellPathExportCompletionDataFeatureImpl::exportCompletions( const std::v return; } + if ( exportSettings.customFileName().isEmpty() ) { QDir folder( exportSettings.folder ); if ( !folder.exists() ) diff --git a/ApplicationLibCode/Commands/CompletionExportCommands/RicWellPathExportMswCompletionsImpl.cpp b/ApplicationLibCode/Commands/CompletionExportCommands/RicWellPathExportMswCompletionsImpl.cpp index fba6ed89a6..39e3bae93e 100644 --- a/ApplicationLibCode/Commands/CompletionExportCommands/RicWellPathExportMswCompletionsImpl.cpp +++ b/ApplicationLibCode/Commands/CompletionExportCommands/RicWellPathExportMswCompletionsImpl.cpp @@ -71,28 +71,43 @@ void RicWellPathExportMswCompletionsImpl::exportWellSegmentsForAllCompletions( if ( exportSettings.fileSplit() == RicExportCompletionDataSettingsUi::ExportSplit::UNIFIED_FILE ) { { - QString fileName; + QString fileName; + QString folderName; + QFileInfo fi( exportSettings.customFileName() ); if ( !exportSettings.customFileName().isEmpty() ) - fileName = fi.baseName() + "_MSW"; + { + fileName = fi.baseName(); + folderName = fi.absolutePath(); + } else + { fileName = QString( "UnifiedCompletions_MSW_%1" ).arg( exportSettings.caseToApply->caseUserDescription() ); + folderName = exportSettings.folder; + } unifiedExportFile = - RicWellPathExportCompletionsFileTools::openFileForExport( exportSettings.folder, fileName, fi.suffix() ); + RicWellPathExportCompletionsFileTools::openFileForExport( folderName, fileName, fi.suffix() ); } { QString lgrFileName; + QString folderName; QFileInfo fi( exportSettings.customFileName() ); if ( !exportSettings.customFileName().isEmpty() ) + { lgrFileName = fi.baseName() + "_LGR_MSW"; + folderName = fi.absolutePath(); + } else + { lgrFileName = QString( "UnifiedCompletions_LGR_MSW_%1" ).arg( exportSettings.caseToApply->caseUserDescription() ); + folderName = exportSettings.folder; + } unifiedLgrExportFile = - RicWellPathExportCompletionsFileTools::openFileForExport( exportSettings.folder, lgrFileName, fi.suffix() ); + RicWellPathExportCompletionsFileTools::openFileForExport( folderName, lgrFileName, fi.suffix() ); } } diff --git a/GrpcInterface/Python/rips/PythonExamples/export_well_path_completions.py b/GrpcInterface/Python/rips/PythonExamples/export_well_path_completions.py new file mode 100644 index 0000000000..e9586ea0a1 --- /dev/null +++ b/GrpcInterface/Python/rips/PythonExamples/export_well_path_completions.py @@ -0,0 +1,23 @@ +############################################################################ +# This script will export completions for a well path for all cases in the project +# +############################################################################ + +import os +import rips + +# Load instance +resinsight = rips.Instance.find() +cases = resinsight.project.cases() + +for case in cases: + print("Case name: ", case.name) + print("Case id: ", case.id) + + case.export_well_path_completions( + time_step=0, + well_path_names=["Well-1"], + file_split="UNIFIED_FILE", + include_perforations=True, + custom_file_name="d:/scratch/well_path_export/myfile.myext", + ) From d9a35e5282ec05df1fead23cd758bcc4099cf785 Mon Sep 17 00:00:00 2001 From: Kristian Bendiksen Date: Wed, 8 Sep 2021 15:39:31 +0200 Subject: [PATCH 108/308] #7969 Minor tweaks to Create Ensemble Surface ui --- .../Commands/RicGenerateMultipleSurfacesUi.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/ApplicationLibCode/Commands/RicGenerateMultipleSurfacesUi.cpp b/ApplicationLibCode/Commands/RicGenerateMultipleSurfacesUi.cpp index f86071cf39..aa9e17a47a 100644 --- a/ApplicationLibCode/Commands/RicGenerateMultipleSurfacesUi.cpp +++ b/ApplicationLibCode/Commands/RicGenerateMultipleSurfacesUi.cpp @@ -21,6 +21,7 @@ #include "RiaApplication.h" #include "cafPdmObject.h" +#include "cafPdmUiCheckBoxEditor.h" #include "cafPdmUiListEditor.h" #include "cafPdmUiOrdering.h" @@ -41,12 +42,12 @@ RicGenerateMultipleSurfacesUi::RicGenerateMultipleSurfacesUi() "", "", "" ); + caf::PdmUiNativeCheckBoxEditor::configureFieldForEditor( &m_autoCreateEnsembleSurfaces ); CAF_PDM_InitFieldNoDefault( &m_minLayer, "MinLayer", "MinLayer", "", "", "" ); CAF_PDM_InitFieldNoDefault( &m_maxLayer, "MaxLayer", "MaxLayer", "", "", "" ); - m_tabNames << "Layers" - << "Ensemble Surfaces"; + m_tabNames << "Configuration"; } //-------------------------------------------------------------------------------------------------- @@ -98,9 +99,6 @@ void RicGenerateMultipleSurfacesUi::defineUiOrdering( QString uiConfigName, caf: if ( uiConfigName == m_tabNames[0] ) { uiOrdering.add( &m_layers ); - } - else if ( uiConfigName == m_tabNames[1] ) - { uiOrdering.add( &m_autoCreateEnsembleSurfaces ); } uiOrdering.skipRemainingFields( true ); From 6173b4f421cc0071e57ad049078b87a61c6af417 Mon Sep 17 00:00:00 2001 From: Kristian Bendiksen Date: Wed, 8 Sep 2021 20:02:40 +0200 Subject: [PATCH 109/308] #7969 Rename command to "Create Ensemble Surface" --- .../Commands/CMakeLists_files.cmake | 8 +++--- ...pp => RicCreateEnsembleSurfaceFeature.cpp} | 26 +++++++++--------- ...re.h => RicCreateEnsembleSurfaceFeature.h} | 6 ++--- ...sUi.cpp => RicCreateEnsembleSurfaceUi.cpp} | 27 +++++++++---------- ...facesUi.h => RicCreateEnsembleSurfaceUi.h} | 6 ++--- .../RimContextCommandBuilder.cpp | 2 +- .../ProjectDataModel/RimDialogData.cpp | 15 ++++------- .../ProjectDataModel/RimDialogData.h | 6 ++--- 8 files changed, 45 insertions(+), 51 deletions(-) rename ApplicationLibCode/Commands/{RicGenerateMultipleSurfacesFeature.cpp => RicCreateEnsembleSurfaceFeature.cpp} (82%) rename ApplicationLibCode/Commands/{RicGenerateMultipleSurfacesFeature.h => RicCreateEnsembleSurfaceFeature.h} (85%) rename ApplicationLibCode/Commands/{RicGenerateMultipleSurfacesUi.cpp => RicCreateEnsembleSurfaceUi.cpp} (79%) rename ApplicationLibCode/Commands/{RicGenerateMultipleSurfacesUi.h => RicCreateEnsembleSurfaceUi.h} (93%) diff --git a/ApplicationLibCode/Commands/CMakeLists_files.cmake b/ApplicationLibCode/Commands/CMakeLists_files.cmake index c044253652..319eef42ed 100644 --- a/ApplicationLibCode/Commands/CMakeLists_files.cmake +++ b/ApplicationLibCode/Commands/CMakeLists_files.cmake @@ -73,8 +73,8 @@ set(SOURCE_GROUP_HEADER_FILES ${CMAKE_CURRENT_LIST_DIR}/RicDeletePressureTableItemFeature.h ${CMAKE_CURRENT_LIST_DIR}/RicImportGridModelFromSummaryCaseFeature.h ${CMAKE_CURRENT_LIST_DIR}/RicImportGridModelFromSummaryCurveFeature.h - ${CMAKE_CURRENT_LIST_DIR}/RicGenerateMultipleSurfacesFeature.h - ${CMAKE_CURRENT_LIST_DIR}/RicGenerateMultipleSurfacesUi.h + ${CMAKE_CURRENT_LIST_DIR}/RicCreateEnsembleSurfaceFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicCreateEnsembleSurfaceUi.h ${CMAKE_CURRENT_LIST_DIR}/RicCreateEnsembleWellLogFeature.h ${CMAKE_CURRENT_LIST_DIR}/RicCreateEnsembleWellLogUi.h ) @@ -153,8 +153,8 @@ set(SOURCE_GROUP_SOURCE_FILES ${CMAKE_CURRENT_LIST_DIR}/RicDeletePressureTableItemFeature.cpp ${CMAKE_CURRENT_LIST_DIR}/RicImportGridModelFromSummaryCaseFeature.cpp ${CMAKE_CURRENT_LIST_DIR}/RicImportGridModelFromSummaryCurveFeature.cpp - ${CMAKE_CURRENT_LIST_DIR}/RicGenerateMultipleSurfacesFeature.cpp - ${CMAKE_CURRENT_LIST_DIR}/RicGenerateMultipleSurfacesUi.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicCreateEnsembleSurfaceFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicCreateEnsembleSurfaceUi.cpp ${CMAKE_CURRENT_LIST_DIR}/RicCreateEnsembleWellLogFeature.cpp ${CMAKE_CURRENT_LIST_DIR}/RicCreateEnsembleWellLogUi.cpp ) diff --git a/ApplicationLibCode/Commands/RicGenerateMultipleSurfacesFeature.cpp b/ApplicationLibCode/Commands/RicCreateEnsembleSurfaceFeature.cpp similarity index 82% rename from ApplicationLibCode/Commands/RicGenerateMultipleSurfacesFeature.cpp rename to ApplicationLibCode/Commands/RicCreateEnsembleSurfaceFeature.cpp index 328fd0f33b..ff4d97e9c3 100644 --- a/ApplicationLibCode/Commands/RicGenerateMultipleSurfacesFeature.cpp +++ b/ApplicationLibCode/Commands/RicCreateEnsembleSurfaceFeature.cpp @@ -16,13 +16,13 @@ // ///////////////////////////////////////////////////////////////////////////////// -#include "RicGenerateMultipleSurfacesFeature.h" +#include "RicCreateEnsembleSurfaceFeature.h" #include "RiaApplication.h" #include "RiaLogging.h" #include "CommandRouter/RimcExtractSurfaces.h" -#include "RicGenerateMultipleSurfacesUi.h" +#include "RicCreateEnsembleSurfaceUi.h" #include "RicImportEnsembleSurfaceFeature.h" #include "RicRecursiveFileSearchDialog.h" #include "RimDialogData.h" @@ -41,12 +41,12 @@ #include #include -CAF_CMD_SOURCE_INIT( RicGenerateMultipleSurfacesFeature, "RicGenerateMultipleSurfacesFeature" ); +CAF_CMD_SOURCE_INIT( RicCreateEnsembleSurfaceFeature, "RicCreateEnsembleSurfaceFeature" ); //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -void RicGenerateMultipleSurfacesFeature::openDialogAndExecuteCommand() +void RicCreateEnsembleSurfaceFeature::openDialogAndExecuteCommand() { // Get the list of egrid files RiaApplication* app = RiaApplication::instance(); @@ -74,12 +74,12 @@ void RicGenerateMultipleSurfacesFeature::openDialogAndExecuteCommand() if ( !RimcCommandRouter_extractSurfaces::readMinMaxLayerFromGridFile( result.files[0], minLayerK, maxLayerK ) ) return; - RicGenerateMultipleSurfacesUi* ui = RimProject::current()->dialogData()->generateEnsembleSurfacesUi(); + RicCreateEnsembleSurfaceUi* ui = RimProject::current()->dialogData()->createEnsembleSurfaceUi(); ui->setLayersMinMax( minLayerK, maxLayerK ); RiuPropertyViewTabWidget propertyDialog( Riu3DMainWindowTools::mainWindowWidget(), ui, - "Export Multiple Surfaces", + "Create Ensemble Surface", ui->tabNames() ); if ( propertyDialog.exec() == QDialog::Accepted ) @@ -91,12 +91,12 @@ void RicGenerateMultipleSurfacesFeature::openDialogAndExecuteCommand() //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -void RicGenerateMultipleSurfacesFeature::executeCommand( const RicGenerateMultipleSurfacesUi& ui, - const std::list& fileNames ) +void RicCreateEnsembleSurfaceFeature::executeCommand( const RicCreateEnsembleSurfaceUi& ui, + const std::list& fileNames ) { std::vector layers = ui.layers(); - caf::ProgressInfo progress( fileNames.size(), "Generating ensemble surfaces" ); + caf::ProgressInfo progress( fileNames.size(), "Generating ensemble surface" ); QStringList allSurfaceFileNames; for ( auto fileName : fileNames ) @@ -113,7 +113,7 @@ void RicGenerateMultipleSurfacesFeature::executeCommand( const RicGenerateMultip //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -bool RicGenerateMultipleSurfacesFeature::isCommandEnabled() +bool RicCreateEnsembleSurfaceFeature::isCommandEnabled() { return true; } @@ -121,7 +121,7 @@ bool RicGenerateMultipleSurfacesFeature::isCommandEnabled() //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -void RicGenerateMultipleSurfacesFeature::onActionTriggered( bool isChecked ) +void RicCreateEnsembleSurfaceFeature::onActionTriggered( bool isChecked ) { openDialogAndExecuteCommand(); } @@ -129,7 +129,7 @@ void RicGenerateMultipleSurfacesFeature::onActionTriggered( bool isChecked ) //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -void RicGenerateMultipleSurfacesFeature::setupActionLook( QAction* actionToSetup ) +void RicCreateEnsembleSurfaceFeature::setupActionLook( QAction* actionToSetup ) { - actionToSetup->setText( "Generate Multiple Surfaces..." ); + actionToSetup->setText( "Create Ensemble Surface..." ); } diff --git a/ApplicationLibCode/Commands/RicGenerateMultipleSurfacesFeature.h b/ApplicationLibCode/Commands/RicCreateEnsembleSurfaceFeature.h similarity index 85% rename from ApplicationLibCode/Commands/RicGenerateMultipleSurfacesFeature.h rename to ApplicationLibCode/Commands/RicCreateEnsembleSurfaceFeature.h index d39ba26abe..4ef62c1889 100644 --- a/ApplicationLibCode/Commands/RicGenerateMultipleSurfacesFeature.h +++ b/ApplicationLibCode/Commands/RicCreateEnsembleSurfaceFeature.h @@ -22,18 +22,18 @@ #include -class RicGenerateMultipleSurfacesUi; +class RicCreateEnsembleSurfaceUi; //================================================================================================== /// //================================================================================================== -class RicGenerateMultipleSurfacesFeature : public caf::CmdFeature +class RicCreateEnsembleSurfaceFeature : public caf::CmdFeature { CAF_CMD_HEADER_INIT; public: static void openDialogAndExecuteCommand(); - static void executeCommand( const RicGenerateMultipleSurfacesUi& ui, const std::list& fileNames ); + static void executeCommand( const RicCreateEnsembleSurfaceUi& ui, const std::list& fileNames ); protected: bool isCommandEnabled() override; diff --git a/ApplicationLibCode/Commands/RicGenerateMultipleSurfacesUi.cpp b/ApplicationLibCode/Commands/RicCreateEnsembleSurfaceUi.cpp similarity index 79% rename from ApplicationLibCode/Commands/RicGenerateMultipleSurfacesUi.cpp rename to ApplicationLibCode/Commands/RicCreateEnsembleSurfaceUi.cpp index aa9e17a47a..198229fbad 100644 --- a/ApplicationLibCode/Commands/RicGenerateMultipleSurfacesUi.cpp +++ b/ApplicationLibCode/Commands/RicCreateEnsembleSurfaceUi.cpp @@ -16,7 +16,7 @@ // ///////////////////////////////////////////////////////////////////////////////// -#include "RicGenerateMultipleSurfacesUi.h" +#include "RicCreateEnsembleSurfaceUi.h" #include "RiaApplication.h" @@ -25,12 +25,12 @@ #include "cafPdmUiListEditor.h" #include "cafPdmUiOrdering.h" -CAF_PDM_SOURCE_INIT( RicGenerateMultipleSurfacesUi, "RicGenerateMultipleSurfacesUi" ); +CAF_PDM_SOURCE_INIT( RicCreateEnsembleSurfaceUi, "RicCreateEnsembleSurfaceUi" ); //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -RicGenerateMultipleSurfacesUi::RicGenerateMultipleSurfacesUi() +RicCreateEnsembleSurfaceUi::RicCreateEnsembleSurfaceUi() { CAF_PDM_InitObject( "Export Multiple Surfaces", "", "", "" ); @@ -53,14 +53,14 @@ RicGenerateMultipleSurfacesUi::RicGenerateMultipleSurfacesUi() //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -RicGenerateMultipleSurfacesUi::~RicGenerateMultipleSurfacesUi() +RicCreateEnsembleSurfaceUi::~RicCreateEnsembleSurfaceUi() { } //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -const QStringList& RicGenerateMultipleSurfacesUi::tabNames() const +const QStringList& RicCreateEnsembleSurfaceUi::tabNames() const { return m_tabNames; } @@ -68,7 +68,7 @@ const QStringList& RicGenerateMultipleSurfacesUi::tabNames() const //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -void RicGenerateMultipleSurfacesUi::setLayersMinMax( int minLayer, int maxLayer ) +void RicCreateEnsembleSurfaceUi::setLayersMinMax( int minLayer, int maxLayer ) { m_minLayer = minLayer; m_maxLayer = maxLayer; @@ -77,9 +77,9 @@ void RicGenerateMultipleSurfacesUi::setLayersMinMax( int minLayer, int maxLayer //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -void RicGenerateMultipleSurfacesUi::defineEditorAttribute( const caf::PdmFieldHandle* field, - QString uiConfigName, - caf::PdmUiEditorAttribute* attribute ) +void RicCreateEnsembleSurfaceUi::defineEditorAttribute( const caf::PdmFieldHandle* field, + QString uiConfigName, + caf::PdmUiEditorAttribute* attribute ) { if ( field == &m_layers ) { @@ -94,7 +94,7 @@ void RicGenerateMultipleSurfacesUi::defineEditorAttribute( const caf::PdmFieldHa //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -void RicGenerateMultipleSurfacesUi::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) +void RicCreateEnsembleSurfaceUi::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) { if ( uiConfigName == m_tabNames[0] ) { @@ -108,8 +108,7 @@ void RicGenerateMultipleSurfacesUi::defineUiOrdering( QString uiConfigName, caf: /// //-------------------------------------------------------------------------------------------------- QList - RicGenerateMultipleSurfacesUi::calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions, - bool* useOptionsOnly ) + RicCreateEnsembleSurfaceUi::calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions, bool* useOptionsOnly ) { QList options; if ( fieldNeedingOptions == &m_layers ) @@ -125,7 +124,7 @@ QList //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -std::vector RicGenerateMultipleSurfacesUi::layers() const +std::vector RicCreateEnsembleSurfaceUi::layers() const { return m_layers(); } @@ -133,7 +132,7 @@ std::vector RicGenerateMultipleSurfacesUi::layers() const //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -bool RicGenerateMultipleSurfacesUi::autoCreateEnsembleSurfaces() const +bool RicCreateEnsembleSurfaceUi::autoCreateEnsembleSurfaces() const { return m_autoCreateEnsembleSurfaces; } diff --git a/ApplicationLibCode/Commands/RicGenerateMultipleSurfacesUi.h b/ApplicationLibCode/Commands/RicCreateEnsembleSurfaceUi.h similarity index 93% rename from ApplicationLibCode/Commands/RicGenerateMultipleSurfacesUi.h rename to ApplicationLibCode/Commands/RicCreateEnsembleSurfaceUi.h index b72a86abe8..95bc6dd1ee 100644 --- a/ApplicationLibCode/Commands/RicGenerateMultipleSurfacesUi.h +++ b/ApplicationLibCode/Commands/RicCreateEnsembleSurfaceUi.h @@ -29,13 +29,13 @@ class RigEclipseCaseData; //================================================================================================== /// //================================================================================================== -class RicGenerateMultipleSurfacesUi : public caf::PdmObject +class RicCreateEnsembleSurfaceUi : public caf::PdmObject { CAF_PDM_HEADER_INIT; public: - RicGenerateMultipleSurfacesUi(); - ~RicGenerateMultipleSurfacesUi() override; + RicCreateEnsembleSurfaceUi(); + ~RicCreateEnsembleSurfaceUi() override; const QStringList& tabNames() const; void setLayersMinMax( int minLayer, int maxLayer ); diff --git a/ApplicationLibCode/ProjectDataModel/RimContextCommandBuilder.cpp b/ApplicationLibCode/ProjectDataModel/RimContextCommandBuilder.cpp index 48b69fc1cd..6391dfd16e 100644 --- a/ApplicationLibCode/ProjectDataModel/RimContextCommandBuilder.cpp +++ b/ApplicationLibCode/ProjectDataModel/RimContextCommandBuilder.cpp @@ -971,7 +971,7 @@ caf::CmdFeatureMenuBuilder RimContextCommandBuilder::commandsFromSelection() menuBuilder << "RicImportSurfacesFeature"; menuBuilder << "RicNewGridSurfaceFeature"; menuBuilder << "RicImportEnsembleSurfaceFeature"; - menuBuilder << "RicGenerateMultipleSurfacesFeature"; + menuBuilder << "RicCreateEnsembleSurfaceFeature"; menuBuilder.addSeparator(); menuBuilder << "RicNewSurfaceCollectionFeature"; } diff --git a/ApplicationLibCode/ProjectDataModel/RimDialogData.cpp b/ApplicationLibCode/ProjectDataModel/RimDialogData.cpp index 5dd734969e..9a6d6b2f05 100644 --- a/ApplicationLibCode/ProjectDataModel/RimDialogData.cpp +++ b/ApplicationLibCode/ProjectDataModel/RimDialogData.cpp @@ -27,8 +27,8 @@ #include "ExportCommands/RicExportWellPathsUi.h" #include "FractureCommands/RicCreateMultipleFracturesUi.h" #include "HoloLensCommands/RicHoloLensExportToFolderUi.h" +#include "RicCreateEnsembleSurfaceUi.h" #include "RicCreateEnsembleWellLogUi.h" -#include "RicGenerateMultipleSurfacesUi.h" CAF_PDM_SOURCE_INIT( RimDialogData, "RimDialogData" ); @@ -68,13 +68,8 @@ RimDialogData::RimDialogData() CAF_PDM_InitFieldNoDefault( &m_mockModelSettings, "MockModelSettings", "Mock Model Settings", "", "", "" ); m_mockModelSettings = new RimMockModelSettings(); - CAF_PDM_InitFieldNoDefault( &m_generateEnsembleSurfacesUi, - "GenerateMultipleSurfacesUi", - "Generate Ensmeble Surfaces Ui", - "", - "", - "" ); - m_generateEnsembleSurfacesUi = new RicGenerateMultipleSurfacesUi(); + CAF_PDM_InitFieldNoDefault( &m_createEnsembleSurfaceUi, "CreateEnsembleSurfaceUi", "Create Ensmeble Surface Ui", "", "", "" ); + m_createEnsembleSurfaceUi = new RicCreateEnsembleSurfaceUi(); CAF_PDM_InitFieldNoDefault( &m_createEnsembleWellLogUi, "CreateEnsembleWellLogUi", "Create Ensemble Well Log Ui", "", "", "" ); m_createEnsembleWellLogUi = new RicCreateEnsembleWellLogUi(); @@ -172,9 +167,9 @@ RimMockModelSettings* RimDialogData::mockModelSettings() const //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -RicGenerateMultipleSurfacesUi* RimDialogData::generateEnsembleSurfacesUi() const +RicCreateEnsembleSurfaceUi* RimDialogData::createEnsembleSurfaceUi() const { - return m_generateEnsembleSurfacesUi; + return m_createEnsembleSurfaceUi; } //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationLibCode/ProjectDataModel/RimDialogData.h b/ApplicationLibCode/ProjectDataModel/RimDialogData.h index b4738beefe..4376fb03b5 100644 --- a/ApplicationLibCode/ProjectDataModel/RimDialogData.h +++ b/ApplicationLibCode/ProjectDataModel/RimDialogData.h @@ -29,7 +29,7 @@ class RicHoloLensExportToFolderUi; class RicExportWellPathsUi; class RicExportLgrUi; class RimMockModelSettings; -class RicGenerateMultipleSurfacesUi; +class RicCreateEnsembleSurfaceUi; class RicCreateEnsembleWellLogUi; //================================================================================================== @@ -63,7 +63,7 @@ class RimDialogData : public caf::PdmObject RicExportLgrUi* exportLgrData() const; RicExportEclipseSectorModelUi* exportSectorModelUi() const; RimMockModelSettings* mockModelSettings() const; - RicGenerateMultipleSurfacesUi* generateEnsembleSurfacesUi() const; + RicCreateEnsembleSurfaceUi* createEnsembleSurfaceUi() const; RicCreateEnsembleWellLogUi* createEnsembleWellLogUi() const; private: @@ -75,6 +75,6 @@ class RimDialogData : public caf::PdmObject caf::PdmChildField m_exportLgrData; caf::PdmChildField m_exportSectorModelData; caf::PdmChildField m_mockModelSettings; - caf::PdmChildField m_generateEnsembleSurfacesUi; + caf::PdmChildField m_createEnsembleSurfaceUi; caf::PdmChildField m_createEnsembleWellLogUi; }; From 0e0bd751f645d578b43c28666d503cf1b6088d7b Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Thu, 9 Sep 2021 15:16:34 +0200 Subject: [PATCH 110/308] #7973 Export Completions : Further improvements Fix typo Make sure compdat export works for custom file name --- ...cWellPathExportCompletionDataFeatureImpl.cpp | 17 ++++++++++++++--- .../RicWellPathExportMswCompletionsImpl.cpp | 2 +- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/ApplicationLibCode/Commands/CompletionExportCommands/RicWellPathExportCompletionDataFeatureImpl.cpp b/ApplicationLibCode/Commands/CompletionExportCommands/RicWellPathExportCompletionDataFeatureImpl.cpp index d1269c9549..2933d73e3e 100644 --- a/ApplicationLibCode/Commands/CompletionExportCommands/RicWellPathExportCompletionDataFeatureImpl.cpp +++ b/ApplicationLibCode/Commands/CompletionExportCommands/RicWellPathExportCompletionDataFeatureImpl.cpp @@ -268,11 +268,22 @@ void RicWellPathExportCompletionDataFeatureImpl::exportCompletions( const std::v if ( exportSettings.fileSplit == RicExportCompletionDataSettingsUi::ExportSplit::UNIFIED_FILE ) { - QString fileName = exportSettings.customFileName(); - if ( fileName.isEmpty() ) fileName = QString( "UnifiedCompletions_%1" ).arg( eclipseCaseName ); + QString fileName; + QString folderName; + if ( exportSettings.customFileName().isEmpty() ) + { + fileName = QString( "UnifiedCompletions_%1" ).arg( eclipseCaseName ); + folderName = exportSettings.folder; + } + else + { + fileName = exportSettings.customFileName(); + QFileInfo fi( fileName ); + folderName = fi.absolutePath(); + } sortAndExportCompletionsToFile( exportSettings.caseToApply, - exportSettings.folder, + folderName, fileName, completions, fractureDataReportItems, diff --git a/ApplicationLibCode/Commands/CompletionExportCommands/RicWellPathExportMswCompletionsImpl.cpp b/ApplicationLibCode/Commands/CompletionExportCommands/RicWellPathExportMswCompletionsImpl.cpp index 39e3bae93e..8edc1d3fec 100644 --- a/ApplicationLibCode/Commands/CompletionExportCommands/RicWellPathExportMswCompletionsImpl.cpp +++ b/ApplicationLibCode/Commands/CompletionExportCommands/RicWellPathExportMswCompletionsImpl.cpp @@ -77,7 +77,7 @@ void RicWellPathExportMswCompletionsImpl::exportWellSegmentsForAllCompletions( QFileInfo fi( exportSettings.customFileName() ); if ( !exportSettings.customFileName().isEmpty() ) { - fileName = fi.baseName(); + fileName = fi.baseName() + "_MSW"; folderName = fi.absolutePath(); } else From c603e6fe9032bb1e3f56b96f7d653e0f62ec381d Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Thu, 9 Sep 2021 11:19:22 +0200 Subject: [PATCH 111/308] Janitor : Improve Ensemble File Search dialog - auto search on launch - add recently used history to file filter --- .../Commands/RicRecursiveFileSearchDialog.cpp | 91 ++++++++++++++----- .../Commands/RicRecursiveFileSearchDialog.h | 7 +- 2 files changed, 71 insertions(+), 27 deletions(-) diff --git a/ApplicationLibCode/Commands/RicRecursiveFileSearchDialog.cpp b/ApplicationLibCode/Commands/RicRecursiveFileSearchDialog.cpp index a245af4a35..eb4b4b7e95 100644 --- a/ApplicationLibCode/Commands/RicRecursiveFileSearchDialog.cpp +++ b/ApplicationLibCode/Commands/RicRecursiveFileSearchDialog.cpp @@ -76,20 +76,15 @@ RicRecursiveFileSearchDialogResult RicRecursiveFileSearchDialog::runRecursiveSea QString pathFilterText = dir; RiaFilePathTools::appendSeparatorIfNo( pathFilterText ); pathFilterText += pathFilter; + dialog.m_fileFilterField->addItem( fileNameFilter ); + dialog.m_pathFilterField->addItem( QDir::toNativeSeparators( pathFilterText ) ); - const QString searchHistoryStringsRegistryKey = - QString( "RicRecursiveFileSearchDialog %1" ).arg( caption ).replace( " ", "_" ); - const int maxItemsInRegistry = 10; - { - RiaStringListSerializer stringListSerializer( searchHistoryStringsRegistryKey ); - QStringList files = stringListSerializer.textStrings(); + const QString filePathRegistryKey = QString( "RicRecursiveFileSearchDialog %1" ).arg( caption ).replace( " ", "_" ); + populateComboBoxHistoryFromRegistry( dialog.m_pathFilterField, filePathRegistryKey ); - int numRecentFiles = std::min( files.size(), maxItemsInRegistry ); - for ( int i = 0; i < numRecentFiles; i++ ) - { - dialog.m_pathFilterField->addItem( files[i] ); - } - } + const QString fileFilterRegistryKey = + QString( "RicRecursiveFileSearchDialog file filter %1" ).arg( caption ).replace( " ", "_" ); + populateComboBoxHistoryFromRegistry( dialog.m_fileFilterField, fileFilterRegistryKey ); QSettings settings; const QString useRealizationStarRegistryKey = "RecursiveFileSearchDialog_use_realization"; @@ -97,11 +92,12 @@ RicRecursiveFileSearchDialogResult RicRecursiveFileSearchDialog::runRecursiveSea bool isChecked = settings.value( useRealizationStarRegistryKey, true ).toBool(); dialog.m_useRealizationStarCheckBox->setChecked( isChecked ); - dialog.m_pathFilterField->addItem( QDir::toNativeSeparators( pathFilterText ) ); - dialog.m_pathFilterField->setCurrentText( QDir::toNativeSeparators( pathFilterText ) ); + dialog.m_fileFilterField->setCurrentText( fileNameFilter ); + dialog.m_fileFilterField->setEditable( true ); + dialog.m_pathFilterField->setCurrentText( QDir::toNativeSeparators( pathFilterText ) ); dialog.m_pathFilterField->setEditable( true ); - dialog.m_fileFilterField->setText( fileNameFilter ); + dialog.m_fileExtensions = trimLeftStrings( fileExtensions, "." ); dialog.updateEffectiveFilter(); @@ -113,10 +109,18 @@ RicRecursiveFileSearchDialogResult RicRecursiveFileSearchDialog::runRecursiveSea if ( dialog.result() == QDialog::Accepted ) { - RiaStringListSerializer stringListSerializer( searchHistoryStringsRegistryKey ); - stringListSerializer.addString( dialog.m_pathFilterField->currentText(), maxItemsInRegistry ); - settings.setValue( useRealizationStarRegistryKey, dialog.m_useRealizationStarCheckBox->isChecked() ); + + const int maxItemsInRegistry = 10; + + { + RiaStringListSerializer stringListSerializer( filePathRegistryKey ); + stringListSerializer.addString( dialog.m_pathFilterField->currentText(), maxItemsInRegistry ); + } + { + RiaStringListSerializer stringListSerializer( fileFilterRegistryKey ); + stringListSerializer.addString( dialog.m_fileFilterField->currentText(), maxItemsInRegistry ); + } } return RicRecursiveFileSearchDialogResult( dialog.result() == QDialog::Accepted, @@ -141,7 +145,7 @@ RicRecursiveFileSearchDialog::RicRecursiveFileSearchDialog( QWidget* parent ) m_pathFilterLabel = new QLabel(); m_pathFilterField = new QComboBox(); m_fileFilterLabel = new QLabel(); - m_fileFilterField = new QLineEdit(); + m_fileFilterField = new QComboBox(); m_effectiveFilterLabel = new QLabel(); m_effectiveFilterContentLabel = new QLabel(); m_searchRootLabel = new QLabel(); @@ -155,13 +159,20 @@ RicRecursiveFileSearchDialog::RicRecursiveFileSearchDialog( QWidget* parent ) connect( m_pathFilterField, SIGNAL( currentTextChanged( const QString& ) ), this, - SLOT( slotFilterChanged( const QString& ) ) ); + SLOT( slotPathFilterChanged( const QString& ) ) ); connect( m_pathFilterField, SIGNAL( editTextChanged( const QString& ) ), this, - SLOT( slotFilterChanged( const QString& ) ) ); + SLOT( slotPathFilterChanged( const QString& ) ) ); - connect( m_fileFilterField, SIGNAL( textChanged( const QString& ) ), this, SLOT( slotFilterChanged( const QString& ) ) ); + connect( m_fileFilterField, + SIGNAL( currentTextChanged( const QString& ) ), + this, + SLOT( slotFileFilterChanged( const QString& ) ) ); + connect( m_fileFilterField, + SIGNAL( editTextChanged( const QString& ) ), + this, + SLOT( slotFileFilterChanged( const QString& ) ) ); connect( m_fileListWidget, SIGNAL( customContextMenuRequested( const QPoint& ) ), @@ -312,7 +323,7 @@ QString RicRecursiveFileSearchDialog::pathFilterWithoutStartSeparator() const //-------------------------------------------------------------------------------------------------- QString RicRecursiveFileSearchDialog::fileNameFilter() const { - return m_fileFilterField->text().trimmed(); + return m_fileFilterField->currentText().trimmed(); } //-------------------------------------------------------------------------------------------------- @@ -338,7 +349,7 @@ QString RicRecursiveFileSearchDialog::extensionFromFileNameFilter() const { for ( const QString& ext : m_fileExtensions ) { - if ( m_fileFilterField->text().endsWith( ext, Qt::CaseInsensitive ) ) + if ( m_fileFilterField->currentText().endsWith( ext, Qt::CaseInsensitive ) ) { return ext; } @@ -559,6 +570,23 @@ QString RicRecursiveFileSearchDialog::replaceWithRealizationStar( const QString& return textWithStar; } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RicRecursiveFileSearchDialog::populateComboBoxHistoryFromRegistry( QComboBox* comboBox, const QString& registryKey ) +{ + RiaStringListSerializer stringListSerializer( registryKey ); + QStringList files = stringListSerializer.textStrings(); + + const int maxItemsInRegistry = 10; + + int numRecentFiles = std::min( files.size(), maxItemsInRegistry ); + for ( int i = 0; i < numRecentFiles; i++ ) + { + comboBox->addItem( files[i] ); + } +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- @@ -609,8 +637,21 @@ void RicRecursiveFileSearchDialog::warningIfInvalidCharacters() //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -void RicRecursiveFileSearchDialog::slotFilterChanged( const QString& text ) +void RicRecursiveFileSearchDialog::slotPathFilterChanged( const QString& text ) +{ + updateEffectiveFilter(); + warningIfInvalidCharacters(); + m_findOrCancelButton->setDefault( true ); + + slotFindOrCancelButtonClicked(); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RicRecursiveFileSearchDialog::slotFileFilterChanged( const QString& text ) { + clearFileList(); updateEffectiveFilter(); warningIfInvalidCharacters(); m_findOrCancelButton->setDefault( true ); diff --git a/ApplicationLibCode/Commands/RicRecursiveFileSearchDialog.h b/ApplicationLibCode/Commands/RicRecursiveFileSearchDialog.h index 70341d9a5e..c95989e5fc 100644 --- a/ApplicationLibCode/Commands/RicRecursiveFileSearchDialog.h +++ b/ApplicationLibCode/Commands/RicRecursiveFileSearchDialog.h @@ -89,8 +89,11 @@ class RicRecursiveFileSearchDialog : public QDialog QStringList createFileNameFilterList(); static QString replaceWithRealizationStar( const QString& text ); + static void populateComboBoxHistoryFromRegistry( QComboBox* comboBox, const QString& registryKey ); + private slots: - void slotFilterChanged( const QString& text ); + void slotPathFilterChanged( const QString& text ); + void slotFileFilterChanged( const QString& text ); void slotBrowseButtonClicked(); void slotUseRealizationStarClicked(); void slotFindOrCancelButtonClicked(); @@ -111,7 +114,7 @@ private slots: QCheckBox* m_useRealizationStarCheckBox; QLabel* m_fileFilterLabel; - QLineEdit* m_fileFilterField; + QComboBox* m_fileFilterField; QLabel* m_effectiveFilterLabel; QLabel* m_effectiveFilterContentLabel; From a5b80c649bb35be1112fe079732487e71e9b04ad Mon Sep 17 00:00:00 2001 From: jonjenssen <69144954+jonjenssen@users.noreply.github.com> Date: Thu, 9 Sep 2021 17:34:27 +0200 Subject: [PATCH 112/308] Merge pull request #7960 from OPM/geomech_WIA4 GeoMech: Well Integrity Analysis --- ApplicationExeCode/Resources/ResInsight.qrc | 1 + .../Resources/WellIntAnalysis.png | Bin 0 -> 507 bytes .../Application/RiaPreferencesGeoMech.cpp | 67 +- .../Application/RiaPreferencesGeoMech.h | 16 +- .../GeoMechCommands/CMakeLists_files.cmake | 4 + .../RicNewFaultReactAssessmentFeature.cpp | 3 +- .../RicNewWellIntegrityAnalysisFeature.cpp | 109 +++ .../RicNewWellIntegrityAnalysisFeature.h | 36 + .../RicRunWellIntegrityAnalysisFeature.cpp | 114 ++++ .../RicRunWellIntegrityAnalysisFeature.h | 36 + .../FileInterface/CMakeLists_files.cmake | 2 + .../FileInterface/RifParameterXmlReader.cpp | 33 +- .../FileInterface/RifWellIAFileWriter.cpp | 159 +++++ .../FileInterface/RifWellIAFileWriter.h | 33 + .../ModelVisualization/CMakeLists_files.cmake | 2 + .../RivBoxGeometryGenerator.cpp | 107 +++ .../RivBoxGeometryGenerator.h | 43 ++ .../ModelVisualization/RivWellPathPartMgr.cpp | 77 +++ .../ModelVisualization/RivWellPathPartMgr.h | 5 +- .../Parameters/CMakeLists_files.cmake | 4 + .../Parameters/RimDoubleParameter.cpp | 15 + .../Parameters/RimDoubleParameter.h | 2 + .../Parameters/RimGenericParameter.cpp | 8 + .../Parameters/RimGenericParameter.h | 3 + .../Parameters/RimIntegerParameter.cpp | 23 + .../Parameters/RimIntegerParameter.h | 3 + .../Parameters/RimListParameter.cpp | 60 ++ .../Parameters/RimListParameter.h | 43 ++ .../Parameters/RimParameterGroup.cpp | 84 ++- .../Parameters/RimParameterGroup.h | 20 +- .../Parameters/RimParameterGroups.cpp | 92 +++ .../Parameters/RimParameterGroups.h | 45 ++ .../Parameters/RimStringParameter.cpp | 23 + .../Parameters/RimStringParameter.h | 3 + .../RimContextCommandBuilder.cpp | 11 +- .../WellPath/CMakeLists_files.cmake | 10 + .../WellPath/RimWellIADataAccess.cpp | 130 ++++ .../WellPath/RimWellIADataAccess.h | 58 ++ .../WellPath/RimWellIAModelBox.cpp | 109 +++ .../WellPath/RimWellIAModelBox.h | 47 ++ .../WellPath/RimWellIAModelData.cpp | 120 ++++ .../WellPath/RimWellIAModelData.h | 58 ++ .../WellPath/RimWellIASettings.cpp | 640 ++++++++++++++++++ .../WellPath/RimWellIASettings.h | 145 ++++ .../WellPath/RimWellIASettingsCollection.cpp | 119 ++++ .../WellPath/RimWellIASettingsCollection.h | 55 ++ .../ProjectDataModel/WellPath/RimWellPath.cpp | 20 + .../ProjectDataModel/WellPath/RimWellPath.h | 3 + .../UserInterface/RiuViewerCommands.cpp | 8 + 49 files changed, 2778 insertions(+), 30 deletions(-) create mode 100644 ApplicationExeCode/Resources/WellIntAnalysis.png create mode 100644 ApplicationLibCode/Commands/GeoMechCommands/RicNewWellIntegrityAnalysisFeature.cpp create mode 100644 ApplicationLibCode/Commands/GeoMechCommands/RicNewWellIntegrityAnalysisFeature.h create mode 100644 ApplicationLibCode/Commands/GeoMechCommands/RicRunWellIntegrityAnalysisFeature.cpp create mode 100644 ApplicationLibCode/Commands/GeoMechCommands/RicRunWellIntegrityAnalysisFeature.h create mode 100644 ApplicationLibCode/FileInterface/RifWellIAFileWriter.cpp create mode 100644 ApplicationLibCode/FileInterface/RifWellIAFileWriter.h create mode 100644 ApplicationLibCode/ModelVisualization/RivBoxGeometryGenerator.cpp create mode 100644 ApplicationLibCode/ModelVisualization/RivBoxGeometryGenerator.h create mode 100644 ApplicationLibCode/ProjectDataModel/Parameters/RimListParameter.cpp create mode 100644 ApplicationLibCode/ProjectDataModel/Parameters/RimListParameter.h create mode 100644 ApplicationLibCode/ProjectDataModel/Parameters/RimParameterGroups.cpp create mode 100644 ApplicationLibCode/ProjectDataModel/Parameters/RimParameterGroups.h create mode 100644 ApplicationLibCode/ProjectDataModel/WellPath/RimWellIADataAccess.cpp create mode 100644 ApplicationLibCode/ProjectDataModel/WellPath/RimWellIADataAccess.h create mode 100644 ApplicationLibCode/ProjectDataModel/WellPath/RimWellIAModelBox.cpp create mode 100644 ApplicationLibCode/ProjectDataModel/WellPath/RimWellIAModelBox.h create mode 100644 ApplicationLibCode/ProjectDataModel/WellPath/RimWellIAModelData.cpp create mode 100644 ApplicationLibCode/ProjectDataModel/WellPath/RimWellIAModelData.h create mode 100644 ApplicationLibCode/ProjectDataModel/WellPath/RimWellIASettings.cpp create mode 100644 ApplicationLibCode/ProjectDataModel/WellPath/RimWellIASettings.h create mode 100644 ApplicationLibCode/ProjectDataModel/WellPath/RimWellIASettingsCollection.cpp create mode 100644 ApplicationLibCode/ProjectDataModel/WellPath/RimWellIASettingsCollection.h diff --git a/ApplicationExeCode/Resources/ResInsight.qrc b/ApplicationExeCode/Resources/ResInsight.qrc index 90ca2b8c23..73ec220987 100644 --- a/ApplicationExeCode/Resources/ResInsight.qrc +++ b/ApplicationExeCode/Resources/ResInsight.qrc @@ -239,6 +239,7 @@ redo.png ComboBoxDown.svg ComboBoxUp.svg + WellIntAnalysis.png fs_CellFace.glsl diff --git a/ApplicationExeCode/Resources/WellIntAnalysis.png b/ApplicationExeCode/Resources/WellIntAnalysis.png new file mode 100644 index 0000000000000000000000000000000000000000..e14905a8e0617ca4c8733c11758cd9927dde8f3b GIT binary patch literal 507 zcmVPx#1ZP1_K>z@;j|==^1poj532;bRa{vGf6951U69E94oEQKA0gy>VK~y+TosrKg zL{SvS&%Bp1$ilBdNwc$2{slr3GaEI63H(e2A`Liv3+H+p+J&;v4e~Q^AJ#+uE5ZP-5`Z__&=Ir> zr6JM}rBEcOml}(0yIpLays>REfOhAhJ!l2%Wu2B@Xk3RHb<*v^9Rr7obPspNN!YkT z6>z)Y7@jV?bQ>q$V!8mq;UwMjnEVrq&J(hV2wpeWk(LO1(ly0Zj_Ezn+Gemn~^h>5eTZTBgu`) zzD`?g^Yu7aoHRFb%#3jsiTOIH2J?@?%Gi_BnOb}u)FBQfP-sjqYx%JN4h_K;peQuO xTs?m4-~}q_P@as}@Yfr3!GhRxuQSz%d;_+)iqgWy$+rLi002ovPDHLkV1g+%*GB*V literal 0 HcmV?d00001 diff --git a/ApplicationLibCode/Application/RiaPreferencesGeoMech.cpp b/ApplicationLibCode/Application/RiaPreferencesGeoMech.cpp index e4e1ec2833..cb356bc591 100644 --- a/ApplicationLibCode/Application/RiaPreferencesGeoMech.cpp +++ b/ApplicationLibCode/Application/RiaPreferencesGeoMech.cpp @@ -64,6 +64,14 @@ RiaPreferencesGeoMech::RiaPreferencesGeoMech() m_geomechFRADefaultAdvXML.uiCapability()->setUiEditorTypeName( caf::PdmUiFilePathEditor::uiEditorTypeName() ); m_geomechFRADefaultAdvXML.uiCapability()->setUiLabelPosition( caf::PdmUiItemInfo::TOP ); + CAF_PDM_InitFieldNoDefault( &m_geomechWIADefaultXML, "geomechWIADefaultXML", "Default Parameter XML File", "", "", "" ); + m_geomechWIADefaultXML.uiCapability()->setUiEditorTypeName( caf::PdmUiFilePathEditor::uiEditorTypeName() ); + m_geomechWIADefaultXML.uiCapability()->setUiLabelPosition( caf::PdmUiItemInfo::TOP ); + + CAF_PDM_InitFieldNoDefault( &m_geomechWIACommand, "geomechWIACommand", "Command to run", "", "", "" ); + m_geomechWIACommand.uiCapability()->setUiEditorTypeName( caf::PdmUiFilePathEditor::uiEditorTypeName() ); + m_geomechWIACommand.uiCapability()->setUiLabelPosition( caf::PdmUiItemInfo::TOP ); + CAF_PDM_InitField( &m_keepTemporaryFiles, "keepTemporaryFile", false, @@ -88,18 +96,22 @@ RiaPreferencesGeoMech* RiaPreferencesGeoMech::current() void RiaPreferencesGeoMech::appendItems( caf::PdmUiOrdering& uiOrdering ) const { caf::PdmUiGroup* faultRAGroup = uiOrdering.addNewGroup( "Fault Reactivation Assessment" ); - caf::PdmUiGroup* cmdGroup = faultRAGroup->addNewGroup( "Commands (without parameters)" ); + caf::PdmUiGroup* cmdFRAGroup = faultRAGroup->addNewGroup( "Commands (without parameters)" ); - cmdGroup->add( &m_geomechFRAPreprocCommand ); - cmdGroup->add( &m_geomechFRAPostprocCommand ); - cmdGroup->add( &m_geomechFRAMacrisCommand ); + cmdFRAGroup->add( &m_geomechFRAPreprocCommand ); + cmdFRAGroup->add( &m_geomechFRAPostprocCommand ); + cmdFRAGroup->add( &m_geomechFRAMacrisCommand ); - caf::PdmUiGroup* paramGroup = faultRAGroup->addNewGroup( "Parameters" ); - paramGroup->add( &m_geomechFRADefaultBasicXML ); - paramGroup->add( &m_geomechFRADefaultAdvXML ); + caf::PdmUiGroup* paramFRAGroup = faultRAGroup->addNewGroup( "Parameters" ); + paramFRAGroup->add( &m_geomechFRADefaultBasicXML ); + paramFRAGroup->add( &m_geomechFRADefaultAdvXML ); - caf::PdmUiGroup* settingsGroup = faultRAGroup->addNewGroup( "Settings" ); - settingsGroup->add( &m_keepTemporaryFiles ); + caf::PdmUiGroup* wellIAGroup = uiOrdering.addNewGroup( "Well Integrity Analysis" ); + wellIAGroup->add( &m_geomechWIACommand ); + wellIAGroup->add( &m_geomechWIADefaultXML ); + + caf::PdmUiGroup* commonGroup = uiOrdering.addNewGroup( "Common Settings" ); + commonGroup->add( &m_keepTemporaryFiles ); } //-------------------------------------------------------------------------------------------------- @@ -149,6 +161,22 @@ QString RiaPreferencesGeoMech::geomechFRADefaultAdvXML() const return m_geomechFRADefaultAdvXML; } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +QString RiaPreferencesGeoMech::geomechWIACommand() const +{ + return m_geomechWIACommand; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +QString RiaPreferencesGeoMech::geomechWIADefaultXML() const +{ + return m_geomechWIADefaultXML; +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- @@ -169,12 +197,31 @@ bool RiaPreferencesGeoMech::validateFRASettings() const files << geomechFRADefaultBasicXML(); files << geomechFRADefaultAdvXML(); + return filesExists( files ); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +bool RiaPreferencesGeoMech::validateWIASettings() const +{ + QStringList files; + files << geomechWIACommand(); + files << geomechWIADefaultXML(); + + return filesExists( files ); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +bool RiaPreferencesGeoMech::filesExists( QStringList& files ) const +{ for ( int i = 0; i < files.size(); i++ ) { if ( files[i].isEmpty() ) return false; QFile file( files[i] ); if ( !file.exists() ) return false; } - return true; } diff --git a/ApplicationLibCode/Application/RiaPreferencesGeoMech.h b/ApplicationLibCode/Application/RiaPreferencesGeoMech.h index 6f304b7e77..267fb77068 100644 --- a/ApplicationLibCode/Application/RiaPreferencesGeoMech.h +++ b/ApplicationLibCode/Application/RiaPreferencesGeoMech.h @@ -35,7 +35,9 @@ class RiaPreferencesGeoMech : public caf::PdmObject static RiaPreferencesGeoMech* current(); void appendItems( caf::PdmUiOrdering& uiOrdering ) const; + bool validateFRASettings() const; + bool validateWIASettings() const; // geomech settings QString geomechFRAPreprocCommand() const; @@ -43,16 +45,26 @@ class RiaPreferencesGeoMech : public caf::PdmObject QString geomechFRAMacrisCommand() const; QString geomechFRADefaultBasicXML() const; QString geomechFRADefaultAdvXML() const; - bool keepTemporaryFiles() const; + + QString geomechWIADefaultXML() const; + QString geomechWIACommand() const; + + bool keepTemporaryFiles() const; protected: void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override; private: + bool filesExists( QStringList& filelist ) const; + caf::PdmField m_geomechFRAPreprocCommand; caf::PdmField m_geomechFRAPostprocCommand; caf::PdmField m_geomechFRAMacrisCommand; caf::PdmField m_geomechFRADefaultBasicXML; caf::PdmField m_geomechFRADefaultAdvXML; - caf::PdmField m_keepTemporaryFiles; + + caf::PdmField m_geomechWIADefaultXML; + caf::PdmField m_geomechWIACommand; + + caf::PdmField m_keepTemporaryFiles; }; diff --git a/ApplicationLibCode/Commands/GeoMechCommands/CMakeLists_files.cmake b/ApplicationLibCode/Commands/GeoMechCommands/CMakeLists_files.cmake index c2d4443621..52f4842590 100644 --- a/ApplicationLibCode/Commands/GeoMechCommands/CMakeLists_files.cmake +++ b/ApplicationLibCode/Commands/GeoMechCommands/CMakeLists_files.cmake @@ -14,6 +14,8 @@ set(SOURCE_GROUP_HEADER_FILES ${CMAKE_CURRENT_LIST_DIR}/RicRunBasicFaultReactAssessment3dFeature.h ${CMAKE_CURRENT_LIST_DIR}/RicRunAdvFaultReactAssessment3dFeature.h ${CMAKE_CURRENT_LIST_DIR}/RicRunFaultReactAssessmentFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicNewWellIntegrityAnalysisFeature.h + ${CMAKE_CURRENT_LIST_DIR}/RicRunWellIntegrityAnalysisFeature.h ) set(SOURCE_GROUP_SOURCE_FILES @@ -32,6 +34,8 @@ set(SOURCE_GROUP_SOURCE_FILES ${CMAKE_CURRENT_LIST_DIR}/RicRunBasicFaultReactAssessmentFeature.cpp ${CMAKE_CURRENT_LIST_DIR}/RicRunBasicFaultReactAssessment3dFeature.cpp ${CMAKE_CURRENT_LIST_DIR}/RicRunFaultReactAssessmentFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicNewWellIntegrityAnalysisFeature.cpp + ${CMAKE_CURRENT_LIST_DIR}/RicRunWellIntegrityAnalysisFeature.cpp ) list(APPEND COMMAND_CODE_HEADER_FILES ${SOURCE_GROUP_HEADER_FILES}) diff --git a/ApplicationLibCode/Commands/GeoMechCommands/RicNewFaultReactAssessmentFeature.cpp b/ApplicationLibCode/Commands/GeoMechCommands/RicNewFaultReactAssessmentFeature.cpp index 52a6eb4fad..71b5b917a5 100644 --- a/ApplicationLibCode/Commands/GeoMechCommands/RicNewFaultReactAssessmentFeature.cpp +++ b/ApplicationLibCode/Commands/GeoMechCommands/RicNewFaultReactAssessmentFeature.cpp @@ -70,7 +70,8 @@ void RicNewFaultReactAssessmentFeature::onActionTriggered( bool isChecked ) { QMessageBox::critical( nullptr, "Fault Reactivation Assessment", - "Please go to ResInsight preferences and set/check the GeoMechanical settings!" ); + "Fault Reactivation Assessment has not been properly set up.\nPlease go to ResInsight " + "preferences and set/check the GeoMechanical settings." ); return; } diff --git a/ApplicationLibCode/Commands/GeoMechCommands/RicNewWellIntegrityAnalysisFeature.cpp b/ApplicationLibCode/Commands/GeoMechCommands/RicNewWellIntegrityAnalysisFeature.cpp new file mode 100644 index 0000000000..2755fa3428 --- /dev/null +++ b/ApplicationLibCode/Commands/GeoMechCommands/RicNewWellIntegrityAnalysisFeature.cpp @@ -0,0 +1,109 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2021- Equinor ASA +// +// ResInsight is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// + +#include "RicNewWellIntegrityAnalysisFeature.h" + +#include "RiaApplication.h" +#include "RiaPreferencesGeoMech.h" + +#include "RimGeoMechView.h" +#include "RimProject.h" +#include "RimWellIASettings.h" +#include "RimWellIASettingsCollection.h" +#include "RimWellPath.h" + +#include "Riu3DMainWindowTools.h" +#include "Riu3dSelectionManager.h" +#include "RiuFileDialogTools.h" + +#include +#include + +CAF_CMD_SOURCE_INIT( RicNewWellIntegrityAnalysisFeature, "RicNewWellIntegrityAnalysisFeature" ); + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RicNewWellIntegrityAnalysisFeature::onActionTriggered( bool isChecked ) +{ + RiuWellPathSelectionItem* wellPathItem = RiuWellPathSelectionItem::wellPathSelectionItem(); + if ( !wellPathItem ) return; + + RimWellPath* wellPath = wellPathItem->m_wellpath; + if ( !wellPath ) return; + + RimWellIASettingsCollection* coll = wellPath->wellIASettingsCollection(); + if ( !coll ) return; + + RimGeoMechView* view = dynamic_cast( RiaApplication::instance()->activeGridView() ); + RimGeoMechCase* theCase = nullptr; + if ( view ) + { + theCase = view->geoMechCase(); + } + + if ( !RiaPreferencesGeoMech::current()->validateWIASettings() ) + { + QMessageBox::critical( nullptr, + "Well Integrity Analysis", + "Well Integrity Analysis has not been properly set up.\nPlease go to ResInsight " + "preferences and set / check the GeoMechanical settings." ); + + return; + } + + // get base directory for our work, should be a new, empty folder somewhere + QString defaultDir = + RiaApplication::instance()->lastUsedDialogDirectoryWithFallbackToProjectFolder( "WELL_INTEGRITY_ANALYSIS" ); + QString baseDir = RiuFileDialogTools::getExistingDirectory( nullptr, tr( "Select Working Directory" ), defaultDir ); + if ( baseDir.isNull() || baseDir.isEmpty() ) return; + RiaApplication::instance()->setLastUsedDialogDirectory( "WELL_INTEGRITY_ANALYSIS", baseDir ); + + QString errMsg; + + RimWellIASettings* newWIA = + coll->startWellIntegrationAnalysis( baseDir, wellPath, wellPathItem->m_measuredDepth, theCase, errMsg ); + + if ( newWIA ) + { + wellPath->updateConnectedEditors(); + Riu3DMainWindowTools::selectAsCurrentItem( newWIA ); + newWIA->updateVisualization(); + } + else + { + QMessageBox::critical( nullptr, "Well Integrity Analysis", errMsg ); + } +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RicNewWellIntegrityAnalysisFeature::setupActionLook( QAction* actionToSetup ) +{ + actionToSetup->setIcon( QIcon( ":/WellIntAnalysis.png" ) ); + actionToSetup->setText( "New Well Integration Analysis at this Depth" ); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +bool RicNewWellIntegrityAnalysisFeature::isCommandEnabled() +{ + return true; +} diff --git a/ApplicationLibCode/Commands/GeoMechCommands/RicNewWellIntegrityAnalysisFeature.h b/ApplicationLibCode/Commands/GeoMechCommands/RicNewWellIntegrityAnalysisFeature.h new file mode 100644 index 0000000000..60cbfa9523 --- /dev/null +++ b/ApplicationLibCode/Commands/GeoMechCommands/RicNewWellIntegrityAnalysisFeature.h @@ -0,0 +1,36 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2021 Equinor ASA +// +// ResInsight is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// + +#pragma once + +#include "cafCmdFeature.h" + +#include + +//================================================================================================== +/// +//================================================================================================== +class RicNewWellIntegrityAnalysisFeature : public caf::CmdFeature +{ + CAF_CMD_HEADER_INIT; + +protected: + void onActionTriggered( bool isChecked ) override; + void setupActionLook( QAction* actionToSetup ) override; + bool isCommandEnabled() override; +}; diff --git a/ApplicationLibCode/Commands/GeoMechCommands/RicRunWellIntegrityAnalysisFeature.cpp b/ApplicationLibCode/Commands/GeoMechCommands/RicRunWellIntegrityAnalysisFeature.cpp new file mode 100644 index 0000000000..f027153f58 --- /dev/null +++ b/ApplicationLibCode/Commands/GeoMechCommands/RicRunWellIntegrityAnalysisFeature.cpp @@ -0,0 +1,114 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2021- Equinor ASA +// +// ResInsight is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// + +#include "RicRunWellIntegrityAnalysisFeature.h" + +#include "RiaApplication.h" +#include "RiaPreferencesGeoMech.h" + +#include "RifWellIAFileWriter.h" + +#include "RimGeoMechView.h" +#include "RimProcess.h" +#include "RimProject.h" +#include "RimWellIASettings.h" +#include "RimWellIASettingsCollection.h" +#include "RimWellPath.h" + +#include "Riu3DMainWindowTools.h" +#include "Riu3dSelectionManager.h" +#include "RiuFileDialogTools.h" + +#include "cafProgressInfo.h" +#include "cafSelectionManagerTools.h" + +#include +#include + +CAF_CMD_SOURCE_INIT( RicRunWellIntegrityAnalysisFeature, "RicRunWellIntegrityAnalysisFeature" ); + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RicRunWellIntegrityAnalysisFeature::onActionTriggered( bool isChecked ) +{ + RimWellIASettings* modelSettings = + dynamic_cast( caf::SelectionManager::instance()->selectedItem() ); + + if ( modelSettings == nullptr ) return; + + const QString wiaTitle( "Well Integrity Analysis" ); + + QString outErrorText; + + caf::ProgressInfo runProgress( 3, wiaTitle + " running , please wait..." ); + + runProgress.setProgressDescription( "Writing input files." ); + + modelSettings->extractModelData(); + + if ( !RifWellIAFileWriter::writeToJsonFile( *modelSettings, outErrorText ) ) + { + QMessageBox::critical( nullptr, wiaTitle, outErrorText ); + return; + } + + if ( !RifWellIAFileWriter::writeToCSVFile( *modelSettings, outErrorText ) ) + { + QMessageBox::critical( nullptr, wiaTitle, outErrorText ); + return; + } + + runProgress.incrementProgress(); + runProgress.setProgressDescription( "Running Abaqus modeling." ); + + QString command = RiaPreferencesGeoMech::current()->geomechWIACommand(); + QStringList parameters = modelSettings->commandParameters(); + + RimProcess process; + process.setCommand( command ); + process.setParameters( parameters ); + + if ( !process.execute() ) + { + QMessageBox::critical( nullptr, wiaTitle, "Failed to run modeling. Check log window for additional information." ); + return; + } + + runProgress.incrementProgress(); + runProgress.setProgressDescription( "Loading modeling results." ); + + // TODO - load results from Abaqus modeling here. +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RicRunWellIntegrityAnalysisFeature::setupActionLook( QAction* actionToSetup ) +{ + actionToSetup->setIcon( QIcon( ":/WellIntAnalysis.png" ) ); + actionToSetup->setText( "Run..." ); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +bool RicRunWellIntegrityAnalysisFeature::isCommandEnabled() +{ + return true; +} diff --git a/ApplicationLibCode/Commands/GeoMechCommands/RicRunWellIntegrityAnalysisFeature.h b/ApplicationLibCode/Commands/GeoMechCommands/RicRunWellIntegrityAnalysisFeature.h new file mode 100644 index 0000000000..576b2aee46 --- /dev/null +++ b/ApplicationLibCode/Commands/GeoMechCommands/RicRunWellIntegrityAnalysisFeature.h @@ -0,0 +1,36 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2021 Equinor ASA +// +// ResInsight is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// + +#pragma once + +#include "cafCmdFeature.h" + +#include + +//================================================================================================== +/// +//================================================================================================== +class RicRunWellIntegrityAnalysisFeature : public caf::CmdFeature +{ + CAF_CMD_HEADER_INIT; + +protected: + void onActionTriggered( bool isChecked ) override; + void setupActionLook( QAction* actionToSetup ) override; + bool isCommandEnabled() override; +}; diff --git a/ApplicationLibCode/FileInterface/CMakeLists_files.cmake b/ApplicationLibCode/FileInterface/CMakeLists_files.cmake index cf7a7f1e2f..6ce00f5605 100644 --- a/ApplicationLibCode/FileInterface/CMakeLists_files.cmake +++ b/ApplicationLibCode/FileInterface/CMakeLists_files.cmake @@ -66,6 +66,7 @@ set(SOURCE_GROUP_HEADER_FILES ${CMAKE_CURRENT_LIST_DIR}/RifEnsembleFractureStatisticsExporter.h ${CMAKE_CURRENT_LIST_DIR}/RifSummaryReaderMultipleFiles.h ${CMAKE_CURRENT_LIST_DIR}/RifEclEclipseSummary.h + ${CMAKE_CURRENT_LIST_DIR}/RifWellIAFileWriter.h # HDF5 file reader is directly included in ResInsight main CmakeList.txt # ${CMAKE_CURRENT_LIST_DIR}/RifHdf5Reader.h ) @@ -136,6 +137,7 @@ set(SOURCE_GROUP_SOURCE_FILES ${CMAKE_CURRENT_LIST_DIR}/RifEnsembleFractureStatisticsExporter.cpp ${CMAKE_CURRENT_LIST_DIR}/RifSummaryReaderMultipleFiles.cpp ${CMAKE_CURRENT_LIST_DIR}/RifEclEclipseSummary.cpp + ${CMAKE_CURRENT_LIST_DIR}/RifWellIAFileWriter.cpp # HDF5 file reader is directly included in ResInsight main CmakeList.txt # ${CMAKE_CURRENT_LIST_DIR}/RifHdf5Reader.cpp ) diff --git a/ApplicationLibCode/FileInterface/RifParameterXmlReader.cpp b/ApplicationLibCode/FileInterface/RifParameterXmlReader.cpp index 8a4650e069..790e439bab 100644 --- a/ApplicationLibCode/FileInterface/RifParameterXmlReader.cpp +++ b/ApplicationLibCode/FileInterface/RifParameterXmlReader.cpp @@ -21,6 +21,7 @@ #include "RimDoubleParameter.h" #include "RimGenericParameter.h" #include "RimIntegerParameter.h" +#include "RimListParameter.h" #include "RimStringParameter.h" #include "RimParameterGroup.h" @@ -52,6 +53,10 @@ RimGenericParameter* getParameterFromTypeStr( QString typestr ) { return new RimStringParameter(); } + else if ( typestr == "list" ) + { + return new RimListParameter(); + } return nullptr; } @@ -76,7 +81,8 @@ bool RifParameterXmlReader::parseFile( QString& outErrorText ) RimParameterGroup* group = nullptr; - std::list reqattrs = { QString( "name" ), QString( "label" ), QString( "type" ) }; + std::list reqGroupAttrs = { QString( "name" ) }; + std::list reqParamAttrs = { QString( "name" ), QString( "label" ), QString( "type" ) }; bool bResult = true; @@ -91,15 +97,35 @@ bool RifParameterXmlReader::parseFile( QString& outErrorText ) m_parameters.push_back( group ); } + // check that we have the required attributes + for ( auto& reqattr : reqGroupAttrs ) + { + if ( !xml.attributes().hasAttribute( reqattr ) ) + { + outErrorText += "Missing required attribute \"" + reqattr + "\" for a parameter group."; + bResult = false; + break; + } + } + if ( !bResult ) break; + group = new RimParameterGroup(); + if ( xml.attributes().hasAttribute( "name" ) ) + { + group->setName( xml.attributes().value( "name" ).toString() ); + } if ( xml.attributes().hasAttribute( "label" ) ) { - group->setName( xml.attributes().value( "label" ).toString() ); + group->setLabel( xml.attributes().value( "label" ).toString() ); } if ( xml.attributes().hasAttribute( "expanded" ) ) { group->setExpanded( xml.attributes().value( "expanded" ).toString().toLower() == "true" ); } + if ( xml.attributes().hasAttribute( "comment" ) ) + { + group->setComment( xml.attributes().value( "comment" ).toString() ); + } continue; } @@ -108,7 +134,7 @@ bool RifParameterXmlReader::parseFile( QString& outErrorText ) if ( group == nullptr ) continue; // check that we have the required attributes - for ( auto& reqattr : reqattrs ) + for ( auto& reqattr : reqParamAttrs ) { if ( !xml.attributes().hasAttribute( reqattr ) ) { @@ -117,6 +143,7 @@ bool RifParameterXmlReader::parseFile( QString& outErrorText ) break; } } + if ( !bResult ) break; // get a parameter of the required type QString paramtypestr = xml.attributes().value( "type" ).toString().toLower(); diff --git a/ApplicationLibCode/FileInterface/RifWellIAFileWriter.cpp b/ApplicationLibCode/FileInterface/RifWellIAFileWriter.cpp new file mode 100644 index 0000000000..41436e7ac7 --- /dev/null +++ b/ApplicationLibCode/FileInterface/RifWellIAFileWriter.cpp @@ -0,0 +1,159 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2021 Equinor ASA +// +// ResInsight is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// + +#include "RifWellIAFileWriter.h" + +#include "RimGenericParameter.h" +#include "RimParameterGroup.h" +#include "RimParameterGroups.h" +#include "RimWellIAModelData.h" +#include "RimWellIASettings.h" + +#include +#include + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +bool RifWellIAFileWriter::writeToJsonFile( RimWellIASettings& settings, QString& outErrorText ) +{ + QString filename = settings.jsonInputFilename(); + + outErrorText = "Unable to write to file \"" + filename + "\" - "; + + QFile file( filename ); + if ( file.open( QIODevice::ReadWrite | QIODevice::Truncate | QIODevice::Text ) ) + { + QTextStream stream( &file ); + + stream << "{" << endl; + stream << "\"comments\": \"All units are SI unless mentioned otherwise; temperature is in Celcius; use forward " + "slash (/) in 'directory' definition\"," + << endl; + stream << "\"directory\": \"" + settings.outputBaseDirectory() + "\"," << endl; + stream << "\"output_name\": \"" + settings.name() + "\""; + + RimParameterGroups mergedGroups; + + bool mergeInCommentParameter = true; + + for ( auto& group : settings.inputParameterGroups() ) + { + mergedGroups.mergeGroup( group, mergeInCommentParameter ); + } + for ( auto& group : settings.resinsightParameterGroups() ) + { + mergedGroups.mergeGroup( group, mergeInCommentParameter ); + } + + for ( auto& group : mergedGroups.groups() ) + { + stream << "," << endl; + + stream << "\"" + group->name() + "\": {" << endl; + + const auto& parameters = group->parameters(); + + for ( size_t i = 0; i < parameters.size(); ) + { + stream << " \"" + parameters[i]->name() + "\": " + parameters[i]->jsonValue(); + + i++; + if ( i < parameters.size() ) + { + stream << ","; + } + stream << endl; + } + + stream << " }"; + } + + stream << endl << "}" << endl; + file.close(); + } + else + { + outErrorText += "Could not open file."; + return false; + } + + outErrorText = ""; + return true; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +bool RifWellIAFileWriter::writeToCSVFile( RimWellIASettings& settings, QString& outErrorText ) +{ + QString filename = settings.csvInputFilename(); + + outErrorText = "Unable to write to file \"" + filename + "\" - "; + + QFile file( filename ); + if ( file.open( QIODevice::ReadWrite | QIODevice::Truncate | QIODevice::Text ) ) + { + QTextStream stream( &file ); + + stream << "Time_days, Pcasing_Pa, P_form_Pa, Temp_C," + "U1-1,U2,U3,U1-2,U2,U3,U1-3,U2,U3,U1-4,U2,U3,U1-5,U2,U3,U1-6,U2,U3,U1-7,U2,U3,U1-8,U2,U3," + "X,Y,Z,X2,Y,Z,X3,Y,Z,X4,Y,Z,X5,Y,Z,X6,Y,Z,X7,Y,Z,X8,Y,Z"; + stream << endl; + + for ( auto& modeldata : settings.modelData() ) + { + stream << modeldata->dayOffset(); + stream << ","; + stream << modeldata->casingPressure(); + stream << ","; + stream << modeldata->formationPressure(); + stream << ","; + stream << modeldata->temperature(); + + for ( auto& u : modeldata->displacements() ) + { + stream << ","; + stream << u.x(); + stream << ","; + stream << u.y(); + stream << ","; + stream << u.z(); + } + + for ( auto& pos : settings.modelBoxVertices() ) + { + stream << ","; + stream << pos.x(); + stream << ","; + stream << pos.y(); + stream << ","; + stream << pos.z(); + } + stream << endl; + } + } + else + { + outErrorText += "Could not open file."; + return false; + } + + outErrorText = ""; + return true; +} diff --git a/ApplicationLibCode/FileInterface/RifWellIAFileWriter.h b/ApplicationLibCode/FileInterface/RifWellIAFileWriter.h new file mode 100644 index 0000000000..48cb474a95 --- /dev/null +++ b/ApplicationLibCode/FileInterface/RifWellIAFileWriter.h @@ -0,0 +1,33 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2021 Equinor ASA +// +// ResInsight is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// + +#pragma once + +#include + +class RimWellIASettings; + +class RifWellIAFileWriter +{ +public: + static bool writeToJsonFile( RimWellIASettings& settings, QString& outErrorText ); + static bool writeToCSVFile( RimWellIASettings& settings, QString& outErrorText ); + +private: + RifWellIAFileWriter(){}; +}; diff --git a/ApplicationLibCode/ModelVisualization/CMakeLists_files.cmake b/ApplicationLibCode/ModelVisualization/CMakeLists_files.cmake index f91430c379..d57c872507 100644 --- a/ApplicationLibCode/ModelVisualization/CMakeLists_files.cmake +++ b/ApplicationLibCode/ModelVisualization/CMakeLists_files.cmake @@ -59,6 +59,7 @@ set(SOURCE_GROUP_HEADER_FILES ${CMAKE_CURRENT_LIST_DIR}/RivPolylinePartMgr.h ${CMAKE_CURRENT_LIST_DIR}/RivCellFilterPartMgr.h ${CMAKE_CURRENT_LIST_DIR}/RivDrawableSpheres.h + ${CMAKE_CURRENT_LIST_DIR}/RivBoxGeometryGenerator.h ) set(SOURCE_GROUP_SOURCE_FILES @@ -117,6 +118,7 @@ set(SOURCE_GROUP_SOURCE_FILES ${CMAKE_CURRENT_LIST_DIR}/RivPolylinePartMgr.cpp ${CMAKE_CURRENT_LIST_DIR}/RivCellFilterPartMgr.cpp ${CMAKE_CURRENT_LIST_DIR}/RivDrawableSpheres.cpp + ${CMAKE_CURRENT_LIST_DIR}/RivBoxGeometryGenerator.cpp ) list(APPEND CODE_HEADER_FILES ${SOURCE_GROUP_HEADER_FILES}) diff --git a/ApplicationLibCode/ModelVisualization/RivBoxGeometryGenerator.cpp b/ApplicationLibCode/ModelVisualization/RivBoxGeometryGenerator.cpp new file mode 100644 index 0000000000..bbb9f3028e --- /dev/null +++ b/ApplicationLibCode/ModelVisualization/RivBoxGeometryGenerator.cpp @@ -0,0 +1,107 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2021- Equinor ASA +// +// ResInsight is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// + +#include "RivBoxGeometryGenerator.h" + +#include "cafEffectGenerator.h" + +#include "cvfBase.h" +#include "cvfDrawableGeo.h" +#include "cvfPart.h" +#include "cvfPrimitiveSetDirect.h" +#include "cvfPrimitiveSetIndexedUInt.h" +#include "cvfStructGridGeometryGenerator.h" +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +cvf::ref RivBoxGeometryGenerator::createBoxFromVertices( const std::vector& vertices, + const cvf::Color3f color ) +{ + std::vector boxVertices; + + for ( int enumInt = cvf::StructGridInterface::POS_I; enumInt < cvf::StructGridInterface::NO_FACE; enumInt++ ) + { + cvf::StructGridInterface::FaceType face = static_cast( enumInt ); + + cvf::ubyte faceConn[4]; + cvf::StructGridInterface::cellFaceVertexIndices( face, faceConn ); + + for ( int n = 0; n < 4; n++ ) + { + boxVertices.push_back( cvf::Vec3f( vertices[faceConn[n]] ) ); + } + } + + cvf::ref geo = new cvf::DrawableGeo; + + cvf::ref cvfVertices = new cvf::Vec3fArray; + cvfVertices->assign( boxVertices ); + + if ( !( cvfVertices.notNull() && cvfVertices->size() != 0 ) ) return nullptr; + + geo->setVertexArray( cvfVertices.p() ); + + cvf::ref indices = lineIndicesFromQuadVertexArray( cvfVertices.p() ); + + cvf::ref prim = new cvf::PrimitiveSetIndexedUInt( cvf::PT_LINES ); + prim->setIndices( indices.p() ); + + geo->addPrimitiveSet( prim.p() ); + + cvf::ref part = new cvf::Part; + part->setName( cvf::String( "RivBoxGeometryGenerator::createBoxFromVertices" ) ); + + part->setDrawable( geo.p() ); + + cvf::ref eff; + caf::MeshEffectGenerator effGen( color ); + eff = effGen.generateUnCachedEffect(); + part->setEffect( eff.p() ); + + return part; +} + +cvf::ref RivBoxGeometryGenerator::lineIndicesFromQuadVertexArray( const cvf::Vec3fArray* vertexArray ) +{ + // TODO - see issue #7890 + + CVF_ASSERT( vertexArray ); + + size_t numVertices = vertexArray->size(); + int numQuads = static_cast( numVertices / 4 ); + CVF_ASSERT( numVertices % 4 == 0 ); + + cvf::ref indices = new cvf::UIntArray; + indices->resize( numQuads * 8 ); + +#pragma omp parallel for + for ( int i = 0; i < numQuads; i++ ) + { + int idx = 8 * i; + indices->set( idx + 0, i * 4 + 0 ); + indices->set( idx + 1, i * 4 + 1 ); + indices->set( idx + 2, i * 4 + 1 ); + indices->set( idx + 3, i * 4 + 2 ); + indices->set( idx + 4, i * 4 + 2 ); + indices->set( idx + 5, i * 4 + 3 ); + indices->set( idx + 6, i * 4 + 3 ); + indices->set( idx + 7, i * 4 + 0 ); + } + + return indices; +} diff --git a/ApplicationLibCode/ModelVisualization/RivBoxGeometryGenerator.h b/ApplicationLibCode/ModelVisualization/RivBoxGeometryGenerator.h new file mode 100644 index 0000000000..fb2aba26d0 --- /dev/null +++ b/ApplicationLibCode/ModelVisualization/RivBoxGeometryGenerator.h @@ -0,0 +1,43 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2021- Equinor ASA +// +// ResInsight is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// + +#pragma once + +#include +#include +#include +#include + +namespace cvf +{ +class Part; +} // namespace cvf + +//================================================================================================== +/// +//================================================================================================== +class RivBoxGeometryGenerator +{ +public: + static cvf::ref createBoxFromVertices( const std::vector& vertices, const cvf::Color3f color ); + + static cvf::ref lineIndicesFromQuadVertexArray( const cvf::Vec3fArray* vertexArray ); + +private: + RivBoxGeometryGenerator(){}; +}; diff --git a/ApplicationLibCode/ModelVisualization/RivWellPathPartMgr.cpp b/ApplicationLibCode/ModelVisualization/RivWellPathPartMgr.cpp index b7fac7e4c7..152c05a8f6 100644 --- a/ApplicationLibCode/ModelVisualization/RivWellPathPartMgr.cpp +++ b/ApplicationLibCode/ModelVisualization/RivWellPathPartMgr.cpp @@ -37,6 +37,8 @@ #include "RimPerforationInterval.h" #include "RimRegularLegendConfig.h" #include "RimTools.h" +#include "RimWellIASettings.h" +#include "RimWellIASettingsCollection.h" #include "RimWellMeasurement.h" #include "RimWellMeasurementCollection.h" #include "RimWellMeasurementFilter.h" @@ -53,6 +55,7 @@ #include "RimWellPathValve.h" #include "Riv3dWellLogPlanePartMgr.h" +#include "RivBoxGeometryGenerator.h" #include "RivDrawableSpheres.h" #include "RivFishbonesSubsPartMgr.h" #include "RivObjectSourceInfo.h" @@ -868,6 +871,7 @@ void RivWellPathPartMgr::appendStaticGeometryPartsToModel( cvf::ModelBasicList* appendFishboneSubsPartsToModel( model, displayCoordTransform, characteristicCellSize ); appendWellPathAttributesToModel( model, displayCoordTransform, characteristicCellSize ); + appendWellIntegrityIntervalsToModel( model, displayCoordTransform, characteristicCellSize ); RimGridView* gridView = dynamic_cast( m_rimView.p() ); if ( gridView ) @@ -1021,3 +1025,76 @@ double RivWellPathPartMgr::wellMeasurementRadius( double return wellPathCollection->wellPathRadiusScaleFactor() * wellMeasurementInView->radiusScaleFactor() * characteristicCellSize; } + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RivWellPathPartMgr::appendWellIntegrityIntervalsToModel( cvf::ModelBasicList* model, + const caf::DisplayCoordTransform* displayCoordTransform, + double characteristicCellSize ) +{ + if ( !m_rimWellPath ) return; + + RimWellPathCollection* wellPathCollection = this->wellPathCollection(); + if ( !wellPathCollection ) return; + + RigWellPath* wellPathGeometry = m_rimWellPath->wellPathGeometry(); + if ( !wellPathGeometry ) return; + + // Since we're using the index of measured depths to find the index of a point, ensure they're equal + CVF_ASSERT( wellPathGeometry->measuredDepths().size() == wellPathGeometry->wellPathPoints().size() ); + + double wellPathRadius = this->wellPathRadius( characteristicCellSize, wellPathCollection ); + double wiaIntervalRadius = wellPathRadius * 1.15; + + RivPipeGeometryGenerator geoGenerator; + + for ( auto wiaModel : m_rimWellPath->wellIASettingsCollection()->settings() ) + { + if ( !wiaModel->isChecked() ) continue; + if ( wiaModel->startMD() > wiaModel->endMD() ) continue; + + double horizontalLengthAlongWellPath = 0.0; + std::vector intervalCL; + { + std::pair, std::vector> intervalCoordsAndMD = + wellPathGeometry->clippedPointSubset( wiaModel->startMD(), wiaModel->endMD(), &horizontalLengthAlongWellPath ); + intervalCL = intervalCoordsAndMD.first; + } + + if ( intervalCL.size() < 2 ) continue; + + std::vector intervalCLDisplayCS; + + for ( cvf::Vec3d& point : intervalCL ) + { + intervalCLDisplayCS.push_back( displayCoordTransform->transformToDisplayCoord( point ) ); + } + cvf::ref objectSourceInfo = new RivObjectSourceInfo( wiaModel ); + + cvf::Collection parts; + geoGenerator.cylinderWithCenterLineParts( &parts, intervalCLDisplayCS, cvf::Color3f::ORCHID, wiaIntervalRadius ); + for ( auto& part : parts ) + { + part->setSourceInfo( objectSourceInfo.p() ); + model->addPart( part.p() ); + } + + if ( wiaModel->showBox() ) + { + const auto& vertices = wiaModel->modelBoxVertices(); + + std::vector transformedVertices; + + for ( auto& v : vertices ) + { + transformedVertices.push_back( cvf::Vec3f( displayCoordTransform->transformToDisplayCoord( v ) ) ); + } + + cvf::ref boxpart = + RivBoxGeometryGenerator::createBoxFromVertices( transformedVertices, cvf::Color3f::ORCHID ); + boxpart->setSourceInfo( objectSourceInfo.p() ); + model->addPart( boxpart.p() ); + } + } +} diff --git a/ApplicationLibCode/ModelVisualization/RivWellPathPartMgr.h b/ApplicationLibCode/ModelVisualization/RivWellPathPartMgr.h index b63d846426..c18565939e 100644 --- a/ApplicationLibCode/ModelVisualization/RivWellPathPartMgr.h +++ b/ApplicationLibCode/ModelVisualization/RivWellPathPartMgr.h @@ -98,7 +98,6 @@ class RivWellPathPartMgr : public cvf::Object const caf::DisplayCoordTransform* displayCoordTransform, double characteristicCellSize ); - void appendPerforationsToModel( cvf::ModelBasicList* model, size_t timeStepIndex, const caf::DisplayCoordTransform* displayCoordTransform, @@ -116,6 +115,10 @@ class RivWellPathPartMgr : public cvf::Object const caf::DisplayCoordTransform* displayCoordTransform, double characteristicCellSize ); + void appendWellIntegrityIntervalsToModel( cvf::ModelBasicList* model, + const caf::DisplayCoordTransform* displayCoordTransform, + double characteristicCellSize ); + void buildWellPathParts( const caf::DisplayCoordTransform* displayCoordTransform, double characteristicCellSize, const cvf::BoundingBox& wellPathClipBoundingBox, diff --git a/ApplicationLibCode/ProjectDataModel/Parameters/CMakeLists_files.cmake b/ApplicationLibCode/ProjectDataModel/Parameters/CMakeLists_files.cmake index 9e0b78d1be..28426a65b7 100644 --- a/ApplicationLibCode/ProjectDataModel/Parameters/CMakeLists_files.cmake +++ b/ApplicationLibCode/ProjectDataModel/Parameters/CMakeLists_files.cmake @@ -3,7 +3,9 @@ set(SOURCE_GROUP_HEADER_FILES ${CMAKE_CURRENT_LIST_DIR}/RimDoubleParameter.h ${CMAKE_CURRENT_LIST_DIR}/RimIntegerParameter.h ${CMAKE_CURRENT_LIST_DIR}/RimStringParameter.h + ${CMAKE_CURRENT_LIST_DIR}/RimListParameter.h ${CMAKE_CURRENT_LIST_DIR}/RimParameterGroup.h + ${CMAKE_CURRENT_LIST_DIR}/RimParameterGroups.h ) set(SOURCE_GROUP_SOURCE_FILES @@ -11,7 +13,9 @@ set(SOURCE_GROUP_SOURCE_FILES ${CMAKE_CURRENT_LIST_DIR}/RimDoubleParameter.cpp ${CMAKE_CURRENT_LIST_DIR}/RimIntegerParameter.cpp ${CMAKE_CURRENT_LIST_DIR}/RimStringParameter.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimListParameter.cpp ${CMAKE_CURRENT_LIST_DIR}/RimParameterGroup.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimParameterGroups.cpp ) list(APPEND CODE_HEADER_FILES ${SOURCE_GROUP_HEADER_FILES}) diff --git a/ApplicationLibCode/ProjectDataModel/Parameters/RimDoubleParameter.cpp b/ApplicationLibCode/ProjectDataModel/Parameters/RimDoubleParameter.cpp index 970e9b5cf4..b0d0fdbae8 100644 --- a/ApplicationLibCode/ProjectDataModel/Parameters/RimDoubleParameter.cpp +++ b/ApplicationLibCode/ProjectDataModel/Parameters/RimDoubleParameter.cpp @@ -84,3 +84,18 @@ double RimDoubleParameter::value() const { return m_value(); } + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RimGenericParameter* RimDoubleParameter::duplicate() const +{ + RimDoubleParameter* retval = new RimDoubleParameter(); + retval->setName( name() ); + retval->setValue( value() ); + retval->setDescription( description() ); + retval->setLabel( label() ); + retval->setAdvanced( isAdvanced() ); + + return retval; +} diff --git a/ApplicationLibCode/ProjectDataModel/Parameters/RimDoubleParameter.h b/ApplicationLibCode/ProjectDataModel/Parameters/RimDoubleParameter.h index 57cbb413dc..181929b69a 100644 --- a/ApplicationLibCode/ProjectDataModel/Parameters/RimDoubleParameter.h +++ b/ApplicationLibCode/ProjectDataModel/Parameters/RimDoubleParameter.h @@ -44,6 +44,8 @@ class RimDoubleParameter : public RimGenericParameter double value() const; + virtual RimGenericParameter* duplicate() const; + private: caf::PdmField m_value; }; diff --git a/ApplicationLibCode/ProjectDataModel/Parameters/RimGenericParameter.cpp b/ApplicationLibCode/ProjectDataModel/Parameters/RimGenericParameter.cpp index e75feeb38e..2d6975ee0d 100644 --- a/ApplicationLibCode/ProjectDataModel/Parameters/RimGenericParameter.cpp +++ b/ApplicationLibCode/ProjectDataModel/Parameters/RimGenericParameter.cpp @@ -143,3 +143,11 @@ QString RimGenericParameter::description() const { return m_description(); } + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +QString RimGenericParameter::jsonValue() const +{ + return stringValue(); +} diff --git a/ApplicationLibCode/ProjectDataModel/Parameters/RimGenericParameter.h b/ApplicationLibCode/ProjectDataModel/Parameters/RimGenericParameter.h index 2b4c2a65f7..6b3cc7d919 100644 --- a/ApplicationLibCode/ProjectDataModel/Parameters/RimGenericParameter.h +++ b/ApplicationLibCode/ProjectDataModel/Parameters/RimGenericParameter.h @@ -43,6 +43,7 @@ class RimGenericParameter : public caf::PdmObject virtual void setValue( QString value ) = 0; virtual QVariant variantValue() const = 0; virtual QString stringValue() const = 0; + virtual QString jsonValue() const; QString name() const; QString label() const; @@ -50,6 +51,8 @@ class RimGenericParameter : public caf::PdmObject bool isAdvanced() const; bool isValid() const; + virtual RimGenericParameter* duplicate() const = 0; + protected: void setValid( bool valid ); diff --git a/ApplicationLibCode/ProjectDataModel/Parameters/RimIntegerParameter.cpp b/ApplicationLibCode/ProjectDataModel/Parameters/RimIntegerParameter.cpp index 6ce5c1d358..97c2dc1c84 100644 --- a/ApplicationLibCode/ProjectDataModel/Parameters/RimIntegerParameter.cpp +++ b/ApplicationLibCode/ProjectDataModel/Parameters/RimIntegerParameter.cpp @@ -69,6 +69,14 @@ QVariant RimIntegerParameter::variantValue() const return QVariant( m_value() ); } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +int RimIntegerParameter::value() const +{ + return m_value(); +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- @@ -76,3 +84,18 @@ QString RimIntegerParameter::stringValue() const { return QString::number( m_value() ); } + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RimGenericParameter* RimIntegerParameter::duplicate() const +{ + RimIntegerParameter* retval = new RimIntegerParameter(); + retval->setName( name() ); + retval->setValue( value() ); + retval->setDescription( description() ); + retval->setLabel( label() ); + retval->setAdvanced( isAdvanced() ); + + return retval; +} diff --git a/ApplicationLibCode/ProjectDataModel/Parameters/RimIntegerParameter.h b/ApplicationLibCode/ProjectDataModel/Parameters/RimIntegerParameter.h index dd53ad7046..3e4468ebdc 100644 --- a/ApplicationLibCode/ProjectDataModel/Parameters/RimIntegerParameter.h +++ b/ApplicationLibCode/ProjectDataModel/Parameters/RimIntegerParameter.h @@ -41,6 +41,9 @@ class RimIntegerParameter : public RimGenericParameter void setValue( QString value ) override; QVariant variantValue() const override; QString stringValue() const override; + int value() const; + + RimGenericParameter* duplicate() const override; private: caf::PdmField m_value; diff --git a/ApplicationLibCode/ProjectDataModel/Parameters/RimListParameter.cpp b/ApplicationLibCode/ProjectDataModel/Parameters/RimListParameter.cpp new file mode 100644 index 0000000000..67d757a7f4 --- /dev/null +++ b/ApplicationLibCode/ProjectDataModel/Parameters/RimListParameter.cpp @@ -0,0 +1,60 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2021 - Equinor ASA +// +// ResInsight is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// + +#include "RimListParameter.h" + +#include + +CAF_PDM_SOURCE_INIT( RimListParameter, "ListParameter" ); + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RimListParameter::RimListParameter() +{ +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RimListParameter::~RimListParameter() +{ +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +QString RimListParameter::jsonValue() const +{ + return stringValue(); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RimGenericParameter* RimListParameter::duplicate() const +{ + RimListParameter* retval = new RimListParameter(); + retval->setName( name() ); + retval->setValue( stringValue() ); + retval->setDescription( description() ); + retval->setLabel( label() ); + retval->setAdvanced( isAdvanced() ); + + return retval; +} diff --git a/ApplicationLibCode/ProjectDataModel/Parameters/RimListParameter.h b/ApplicationLibCode/ProjectDataModel/Parameters/RimListParameter.h new file mode 100644 index 0000000000..884da59238 --- /dev/null +++ b/ApplicationLibCode/ProjectDataModel/Parameters/RimListParameter.h @@ -0,0 +1,43 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2021 - Equinor ASA +// +// ResInsight is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// + +#pragma once + +#include "cafPdmField.h" +#include "cafPdmObject.h" + +#include + +#include "RimStringParameter.h" + +//================================================================================================== +/// +/// +//================================================================================================== +class RimListParameter : public RimStringParameter +{ + CAF_PDM_HEADER_INIT; + +public: + RimListParameter(); + ~RimListParameter() override; + + QString jsonValue() const override; + + RimGenericParameter* duplicate() const override; +}; diff --git a/ApplicationLibCode/ProjectDataModel/Parameters/RimParameterGroup.cpp b/ApplicationLibCode/ProjectDataModel/Parameters/RimParameterGroup.cpp index 40106692bd..b077badd8c 100644 --- a/ApplicationLibCode/ProjectDataModel/Parameters/RimParameterGroup.cpp +++ b/ApplicationLibCode/ProjectDataModel/Parameters/RimParameterGroup.cpp @@ -49,9 +49,24 @@ RimParameterGroup::RimParameterGroup() m_name.uiCapability()->setUiHidden( true ); m_name.uiCapability()->setUiReadOnly( true ); + CAF_PDM_InitFieldNoDefault( &m_label, "Label", "Label", "", "", "" ); + m_label.uiCapability()->setUiHidden( true ); + m_label.uiCapability()->setUiReadOnly( true ); + + CAF_PDM_InitFieldNoDefault( &m_comment, "Comment", "Comment", "", "", "" ); + m_comment.uiCapability()->setUiHidden( true ); + m_comment.uiCapability()->setUiReadOnly( true ); + m_comment.uiCapability()->setUiLabelPosition( caf::PdmUiItemInfo::HIDDEN ); + CAF_PDM_InitFieldNoDefault( &m_showExpanded, "Expanded", "Expanded", "", "", "" ); - m_name.uiCapability()->setUiHidden( true ); - m_name.uiCapability()->setUiReadOnly( true ); + m_showExpanded.uiCapability()->setUiHidden( true ); + m_showExpanded.uiCapability()->setUiReadOnly( true ); + + CAF_PDM_InitFieldNoDefault( &m_labelProxy, "LabelProxy", "Label Proxy", "", "", "" ); + m_labelProxy.registerGetMethod( this, &RimParameterGroup::labelOrName ); + m_labelProxy.uiCapability()->setUiReadOnly( true ); + m_labelProxy.uiCapability()->setUiHidden( true ); + m_labelProxy.xmlCapability()->disableIO(); } //-------------------------------------------------------------------------------------------------- @@ -66,7 +81,16 @@ RimParameterGroup::~RimParameterGroup() //-------------------------------------------------------------------------------------------------- caf::PdmFieldHandle* RimParameterGroup::userDescriptionField() { - return &m_name; + return &m_labelProxy; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +QString RimParameterGroup::labelOrName() const +{ + if ( m_label().isEmpty() ) return m_name; + return m_label; } //-------------------------------------------------------------------------------------------------- @@ -87,7 +111,7 @@ void RimParameterGroup::addParameter( QString name, int value ) p->setLabel( name ); p->setValue( value ); - m_parameters.push_back( p ); + addParameter( p ); } //-------------------------------------------------------------------------------------------------- @@ -100,7 +124,7 @@ void RimParameterGroup::addParameter( QString name, QString value ) p->setLabel( name ); p->setValue( value ); - m_parameters.push_back( p ); + addParameter( p ); } //-------------------------------------------------------------------------------------------------- @@ -113,7 +137,7 @@ void RimParameterGroup::addParameter( QString name, double value ) p->setLabel( name ); p->setValue( value ); - m_parameters.push_back( p ); + addParameter( p ); } //-------------------------------------------------------------------------------------------------- @@ -151,7 +175,8 @@ void RimParameterGroup::defineEditorAttribute( const caf::PdmFieldHandle* field, //-------------------------------------------------------------------------------------------------- void RimParameterGroup::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) { - auto group = uiOrdering.addNewGroup( name() ); + auto group = uiOrdering.addNewGroup( label() ); + if ( !m_comment().isEmpty() ) group->add( &m_comment ); group->add( &m_parameters ); uiOrdering.skipRemainingFields( true ); @@ -165,6 +190,22 @@ void RimParameterGroup::setName( QString name ) m_name = name; } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimParameterGroup::setLabel( QString label ) +{ + m_label = label; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimParameterGroup::setComment( QString comment ) +{ + m_comment = comment; +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- @@ -189,6 +230,22 @@ QString RimParameterGroup::name() const return m_name; } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +QString RimParameterGroup::comment() const +{ + return m_comment; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +QString RimParameterGroup::label() const +{ + return labelOrName(); +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- @@ -237,3 +294,16 @@ RimGenericParameter* RimParameterGroup::parameter( QString name ) const return nullptr; } + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +QVariant RimParameterGroup::parameterValue( QString name ) const +{ + RimGenericParameter* p = parameter( name ); + if ( p ) + { + return p->variantValue(); + } + return QVariant(); +} diff --git a/ApplicationLibCode/ProjectDataModel/Parameters/RimParameterGroup.h b/ApplicationLibCode/ProjectDataModel/Parameters/RimParameterGroup.h index 52c5f46a4b..0a6f5b3e07 100644 --- a/ApplicationLibCode/ProjectDataModel/Parameters/RimParameterGroup.h +++ b/ApplicationLibCode/ProjectDataModel/Parameters/RimParameterGroup.h @@ -21,8 +21,10 @@ #include "cafPdmChildArrayField.h" #include "cafPdmField.h" #include "cafPdmObject.h" +#include "cafPdmProxyValueField.h" #include +#include #include class RimGenericParameter; @@ -47,6 +49,8 @@ class RimParameterGroup : public caf::PdmObject void appendParametersToList( std::list& parameterList ); void setName( QString name ); + void setLabel( QString label ); + void setComment( QString comment ); void setExpanded( bool expand ); void setParameterValue( QString name, int value ); @@ -55,20 +59,28 @@ class RimParameterGroup : public caf::PdmObject bool isExpanded() const; QString name() const; + QString comment() const; + QString label() const; std::vector parameters() const; RimGenericParameter* parameter( QString name ) const; + QVariant parameterValue( QString name ) const; private: - void defineEditorAttribute( const caf::PdmFieldHandle* field, - QString uiConfigName, - caf::PdmUiEditorAttribute* attribute ) override; - void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override; + void defineEditorAttribute( const caf::PdmFieldHandle* field, + QString uiConfigName, + caf::PdmUiEditorAttribute* attribute ) override; + void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override; + caf::PdmFieldHandle* userDescriptionField() override; + QString labelOrName() const; private: caf::PdmChildArrayField m_parameters; caf::PdmField m_showExpanded; caf::PdmField m_name; + caf::PdmField m_label; + caf::PdmField m_comment; + caf::PdmProxyValueField m_labelProxy; }; diff --git a/ApplicationLibCode/ProjectDataModel/Parameters/RimParameterGroups.cpp b/ApplicationLibCode/ProjectDataModel/Parameters/RimParameterGroups.cpp new file mode 100644 index 0000000000..e11b94ea00 --- /dev/null +++ b/ApplicationLibCode/ProjectDataModel/Parameters/RimParameterGroups.cpp @@ -0,0 +1,92 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2021- Equinor ASA +// +// ResInsight is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// + +#include "RimParameterGroups.h" + +#include "RimGenericParameter.h" +#include "RimParameterGroup.h" + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RimParameterGroups::RimParameterGroups() +{ +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RimParameterGroups::~RimParameterGroups() +{ + clear(); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimParameterGroups::clear() +{ + for ( const auto& [key, value] : m_groups ) + { + delete value; + } + m_groups.clear(); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimParameterGroups::mergeGroup( RimParameterGroup* group, bool addCommentAsParameter /* = false */ ) +{ + const QString grpName = group->name(); + + if ( m_groups.count( grpName ) == 0 ) + { + RimParameterGroup* newGroup = new RimParameterGroup(); + newGroup->setName( grpName ); + newGroup->setLabel( group->label() ); + newGroup->setComment( group->comment() ); + if ( addCommentAsParameter && !newGroup->comment().isEmpty() ) + { + newGroup->addParameter( "comments", newGroup->comment() ); + } + + m_groups[grpName] = newGroup; + } + + RimParameterGroup* dstGroup = m_groups[grpName]; + for ( auto& parameter : group->parameters() ) + { + dstGroup->addParameter( parameter->duplicate() ); + } +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +const std::vector RimParameterGroups::groups() const +{ + std::vector retGroups; + + for ( const auto& [key, value] : m_groups ) + { + retGroups.push_back( value ); + } + + return retGroups; +} diff --git a/ApplicationLibCode/ProjectDataModel/Parameters/RimParameterGroups.h b/ApplicationLibCode/ProjectDataModel/Parameters/RimParameterGroups.h new file mode 100644 index 0000000000..d60d02756c --- /dev/null +++ b/ApplicationLibCode/ProjectDataModel/Parameters/RimParameterGroups.h @@ -0,0 +1,45 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2021 - Equinor ASA +// +// ResInsight is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// + +#pragma once + +#include +#include +#include + +class RimParameterGroup; + +//================================================================================================== +/// +/// +//================================================================================================== +class RimParameterGroups +{ +public: + RimParameterGroups(); + ~RimParameterGroups(); + + void mergeGroup( RimParameterGroup* group, bool addCommentAsParameter = false ); + + const std::vector groups() const; + + void clear(); + +private: + std::map m_groups; +}; diff --git a/ApplicationLibCode/ProjectDataModel/Parameters/RimStringParameter.cpp b/ApplicationLibCode/ProjectDataModel/Parameters/RimStringParameter.cpp index 9416fac698..cff206b900 100644 --- a/ApplicationLibCode/ProjectDataModel/Parameters/RimStringParameter.cpp +++ b/ApplicationLibCode/ProjectDataModel/Parameters/RimStringParameter.cpp @@ -66,3 +66,26 @@ QString RimStringParameter::stringValue() const { return m_value(); } + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +QString RimStringParameter::jsonValue() const +{ + return QString( "\"%1\"" ).arg( stringValue() ); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RimGenericParameter* RimStringParameter::duplicate() const +{ + RimStringParameter* retval = new RimStringParameter(); + retval->setName( name() ); + retval->setValue( stringValue() ); + retval->setDescription( description() ); + retval->setLabel( label() ); + retval->setAdvanced( isAdvanced() ); + + return retval; +} diff --git a/ApplicationLibCode/ProjectDataModel/Parameters/RimStringParameter.h b/ApplicationLibCode/ProjectDataModel/Parameters/RimStringParameter.h index 9929e57ca5..28816bf92d 100644 --- a/ApplicationLibCode/ProjectDataModel/Parameters/RimStringParameter.h +++ b/ApplicationLibCode/ProjectDataModel/Parameters/RimStringParameter.h @@ -40,6 +40,9 @@ class RimStringParameter : public RimGenericParameter void setValue( QString value ) override; QVariant variantValue() const override; QString stringValue() const override; + QString jsonValue() const override; + + RimGenericParameter* duplicate() const override; private: caf::PdmField m_value; diff --git a/ApplicationLibCode/ProjectDataModel/RimContextCommandBuilder.cpp b/ApplicationLibCode/ProjectDataModel/RimContextCommandBuilder.cpp index 6391dfd16e..5840e88254 100644 --- a/ApplicationLibCode/ProjectDataModel/RimContextCommandBuilder.cpp +++ b/ApplicationLibCode/ProjectDataModel/RimContextCommandBuilder.cpp @@ -137,6 +137,7 @@ #include "RimViewLinkerCollection.h" #include "RimVirtualPerforationResults.h" #include "RimWellAllocationPlot.h" +#include "RimWellIASettings.h" #include "RimWellLogCurve.h" #include "RimWellLogFile.h" #include "RimWellLogFileChannel.h" @@ -1099,9 +1100,9 @@ caf::CmdFeatureMenuBuilder RimContextCommandBuilder::commandsFromSelection() menuBuilder << "RicNewMultiPlotFeature"; // Work in progress -- End + appendCreateCompletions( menuBuilder, menuBuilder.itemCount() > 0u ); - bool addedExportWellPaths = appendExportWellPaths( menuBuilder, menuBuilder.itemCount() > 0u ) > 0; - appendExportCompletions( menuBuilder, menuBuilder.itemCount() > 0u && !addedExportWellPaths ); + appendExportWellPaths( menuBuilder, menuBuilder.itemCount() > 0u ); if ( menuBuilder.itemCount() > 0u ) { @@ -1177,6 +1178,12 @@ caf::CmdFeatureMenuBuilder RimContextCommandBuilder::commandsFromSelection() menuBuilder << "Separator"; menuBuilder << "RicNewSimWellFractureFeature"; } +#ifdef USE_ODB_API + else if ( dynamic_cast( firstUiItem ) ) + { + menuBuilder << "RicRunWellIntegrityAnalysisFeature"; + } +#endif menuBuilder.addSeparator(); menuBuilder << "RicCopyIntersectionsToAllViewsInCaseFeature"; } diff --git a/ApplicationLibCode/ProjectDataModel/WellPath/CMakeLists_files.cmake b/ApplicationLibCode/ProjectDataModel/WellPath/CMakeLists_files.cmake index 625611c03e..fd3d9472d2 100644 --- a/ApplicationLibCode/ProjectDataModel/WellPath/CMakeLists_files.cmake +++ b/ApplicationLibCode/ProjectDataModel/WellPath/CMakeLists_files.cmake @@ -10,6 +10,11 @@ set(SOURCE_GROUP_HEADER_FILES ${CMAKE_CURRENT_LIST_DIR}/RimWellPathCollection.h ${CMAKE_CURRENT_LIST_DIR}/RimWellPathTarget.h ${CMAKE_CURRENT_LIST_DIR}/RimWellPathTieIn.h + ${CMAKE_CURRENT_LIST_DIR}/RimWellIASettings.h + ${CMAKE_CURRENT_LIST_DIR}/RimWellIASettingsCollection.h + ${CMAKE_CURRENT_LIST_DIR}/RimWellIAModelBox.h + ${CMAKE_CURRENT_LIST_DIR}/RimWellIAModelData.h + ${CMAKE_CURRENT_LIST_DIR}/RimWellIADataAccess.h ) set(SOURCE_GROUP_SOURCE_FILES @@ -24,6 +29,11 @@ set(SOURCE_GROUP_SOURCE_FILES ${CMAKE_CURRENT_LIST_DIR}/RimWellPathGroup.cpp ${CMAKE_CURRENT_LIST_DIR}/RimWellPathTarget.cpp ${CMAKE_CURRENT_LIST_DIR}/RimWellPathTieIn.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimWellIASettings.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimWellIASettingsCollection.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimWellIAModelBox.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimWellIAModelData.cpp + ${CMAKE_CURRENT_LIST_DIR}/RimWellIADataAccess.cpp ) list(APPEND CODE_HEADER_FILES ${SOURCE_GROUP_HEADER_FILES}) diff --git a/ApplicationLibCode/ProjectDataModel/WellPath/RimWellIADataAccess.cpp b/ApplicationLibCode/ProjectDataModel/WellPath/RimWellIADataAccess.cpp new file mode 100644 index 0000000000..7d48dbf649 --- /dev/null +++ b/ApplicationLibCode/ProjectDataModel/WellPath/RimWellIADataAccess.cpp @@ -0,0 +1,130 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2021 - Equinor ASA +// +// ResInsight is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// + +#include "RimWellIADataAccess.h" + +#include "RigFemClosestResultIndexCalculator.h" +#include "RigFemPartCollection.h" +#include "RigFemPartResultsCollection.h" +#include "RigGeoMechCaseData.h" +#include "RimGeoMechCase.h" + +#include "../cafHexInterpolator/cafHexInterpolator.h" // Use relative path, as this is a header only file not part of a library + +#include "cvfBoundingBox.h" + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RimWellIADataAccess::RimWellIADataAccess( RimGeoMechCase* thecase ) + : m_case( thecase ) + , m_caseData( nullptr ) +{ + if ( m_case ) m_caseData = m_case->geoMechData(); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RimWellIADataAccess::~RimWellIADataAccess() +{ +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +int RimWellIADataAccess::resultIndex( RigFemResultPosEnum resultType, cvf::Vec3d position ) +{ + int closestCell = elementIndex( position ); + + if ( closestCell < 0 ) return -1; + + RigFemClosestResultIndexCalculator closestIndexCalc( m_caseData->femParts()->part( 0 ), resultType, closestCell, -1, position ); + + return closestIndexCalc.resultIndexToClosestResult(); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +int RimWellIADataAccess::elementIndex( cvf::Vec3d position ) +{ + cvf::BoundingBox bb; + bb.add( position ); + + std::vector closeCells; + m_caseData->femParts()->part( 0 )->findIntersectingCells( bb, &closeCells ); + if ( closeCells.size() == 0 ) return -1; + + return (int)closeCells[0]; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +double RimWellIADataAccess::resultValue( QString fieldName, + QString componentName, + RigFemResultPosEnum resultType, + size_t resultIndex, + int timeStep ) +{ + RigFemResultAddress address( resultType, fieldName.toStdString(), componentName.toStdString() ); + + const std::vector& scalarResults = m_caseData->femPartResults()->resultValues( address, 0, timeStep ); + + if ( resultIndex < scalarResults.size() ) return scalarResults[resultIndex]; + + return 0.0; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +double RimWellIADataAccess::interpolatedResultValue( QString fieldName, + QString componentName, + RigFemResultPosEnum resultType, + cvf::Vec3d position, + int timeStep ) +{ + RigFemResultAddress address( resultType, fieldName.toStdString(), componentName.toStdString() ); + + int elmIdx = elementIndex( position ); + + RigFemPart* femPart = m_caseData->femParts()->part( 0 ); + RigElementType elmType = femPart->elementType( elmIdx ); + const int* elementConn = femPart->connectivities( elmIdx ); + int elmNodeCount = RigFemTypes::elementNodeCount( elmType ); + + const std::vector& scalarResults = m_caseData->femPartResults()->resultValues( address, 0, timeStep ); + + std::array nodeResults; + std::array nodeCorners; + + for ( int lNodeIdx = 0; lNodeIdx < elmNodeCount; ++lNodeIdx ) + { + int nodeIdx = elementConn[lNodeIdx]; + size_t resIdx = femPart->resultValueIdxFromResultPosType( resultType, elmIdx, lNodeIdx ); + if ( resIdx >= scalarResults.size() ) + nodeResults[lNodeIdx] = 0.0; + else + nodeResults[lNodeIdx] = scalarResults[resIdx]; + nodeCorners[lNodeIdx] = cvf::Vec3d( femPart->nodes().coordinates[nodeIdx] ); + } + + return caf::HexInterpolator::interpolateHex( nodeCorners, nodeResults, position ); +} diff --git a/ApplicationLibCode/ProjectDataModel/WellPath/RimWellIADataAccess.h b/ApplicationLibCode/ProjectDataModel/WellPath/RimWellIADataAccess.h new file mode 100644 index 0000000000..9b1c64f280 --- /dev/null +++ b/ApplicationLibCode/ProjectDataModel/WellPath/RimWellIADataAccess.h @@ -0,0 +1,58 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2021 - Equinor ASA +// +// ResInsight is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// + +#pragma once + +#include "RigFemResultPosEnum.h" + +#include "cvfVector3.h" + +#include + +#include + +class RimGeoMechCase; +class RigGeoMechCaseData; + +//================================================================================================== +/// +/// +//================================================================================================== +class RimWellIADataAccess +{ +public: + RimWellIADataAccess( RimGeoMechCase* thecase ); + ~RimWellIADataAccess(); + + int resultIndex( RigFemResultPosEnum resultType, cvf::Vec3d position ); + int elementIndex( cvf::Vec3d position ); + double resultValue( QString fieldName, + QString componentName, + RigFemResultPosEnum resultType, + size_t resultIndex, + int timeStep ); + double interpolatedResultValue( QString fieldname, + QString componentName, + RigFemResultPosEnum resultType, + cvf::Vec3d position, + int timeStep ); + +private: + RimGeoMechCase* m_case; + RigGeoMechCaseData* m_caseData; +}; diff --git a/ApplicationLibCode/ProjectDataModel/WellPath/RimWellIAModelBox.cpp b/ApplicationLibCode/ProjectDataModel/WellPath/RimWellIAModelBox.cpp new file mode 100644 index 0000000000..b22c61a403 --- /dev/null +++ b/ApplicationLibCode/ProjectDataModel/WellPath/RimWellIAModelBox.cpp @@ -0,0 +1,109 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2021 - Equinor ASA +// +// ResInsight is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// + +#include "RimWellIAModelBox.h" + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RimWellIAModelBox::RimWellIAModelBox() +{ + m_vertices.resize( 8 ); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RimWellIAModelBox::~RimWellIAModelBox() +{ +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +std::vector RimWellIAModelBox::vertices() const +{ + return m_vertices; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +cvf::Vec3d RimWellIAModelBox::center() const +{ + return m_center; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +bool RimWellIAModelBox::updateBox( cvf::Vec3d startPos, cvf::Vec3d endPos, double xyBuffer, double depthBuffer ) +{ + m_center = startPos + endPos; + m_center /= 2.0; + + cvf::Vec3d upwards = startPos - endPos; + upwards.normalize(); + cvf::Vec3d downwards = upwards * -1.0; + cvf::Vec3d xdir = upwards.perpendicularVector(); + xdir.normalize(); + cvf::Vec3d ydir = upwards ^ xdir; + ydir.normalize(); + + cvf::Vec3d topCenter = startPos + upwards * depthBuffer; + cvf::Vec3d bottomCenter = endPos + downwards * depthBuffer; + + std::vector topVertices = generateRectangle( topCenter, xdir, ydir, xyBuffer ); + std::vector bottomVertices = generateRectangle( bottomCenter, xdir, ydir, xyBuffer ); + + for ( size_t i = 0; i < 4; i++ ) + { + m_vertices[i] = bottomVertices[i]; + m_vertices[i + 4] = topVertices[i]; + } + + return true; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +std::vector + RimWellIAModelBox::generateRectangle( cvf::Vec3d center, cvf::Vec3d unitX, cvf::Vec3d unitY, double buffer ) +{ + std::vector corners; + corners.resize( 4 ); + + corners[0] = center; + corners[0] -= unitX * buffer; + corners[0] -= unitY * buffer; + + corners[1] = center; + corners[1] += unitX * buffer; + corners[1] -= unitY * buffer; + + corners[2] = center; + corners[2] += unitX * buffer; + corners[2] += unitY * buffer; + + corners[3] = center; + corners[3] -= unitX * buffer; + corners[3] += unitY * buffer; + + return corners; +} diff --git a/ApplicationLibCode/ProjectDataModel/WellPath/RimWellIAModelBox.h b/ApplicationLibCode/ProjectDataModel/WellPath/RimWellIAModelBox.h new file mode 100644 index 0000000000..70bba17d19 --- /dev/null +++ b/ApplicationLibCode/ProjectDataModel/WellPath/RimWellIAModelBox.h @@ -0,0 +1,47 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2021 - Equinor ASA +// +// ResInsight is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// + +#pragma once + +#include "cvfVector3.h" + +#include +#include +#include + +//================================================================================================== +/// +/// +//================================================================================================== +class RimWellIAModelBox +{ +public: + RimWellIAModelBox(); + ~RimWellIAModelBox(); + + std::vector vertices() const; + cvf::Vec3d center() const; + + bool updateBox( cvf::Vec3d startPos, cvf::Vec3d endPos, double xyBuffer, double depthBuffer ); + +private: + std::vector generateRectangle( cvf::Vec3d center, cvf::Vec3d unitX, cvf::Vec3d unitY, double buffer ); + + std::vector m_vertices; + cvf::Vec3d m_center; +}; diff --git a/ApplicationLibCode/ProjectDataModel/WellPath/RimWellIAModelData.cpp b/ApplicationLibCode/ProjectDataModel/WellPath/RimWellIAModelData.cpp new file mode 100644 index 0000000000..7b4df7c8c9 --- /dev/null +++ b/ApplicationLibCode/ProjectDataModel/WellPath/RimWellIAModelData.cpp @@ -0,0 +1,120 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2021 - Equinor ASA +// +// ResInsight is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// + +#include "RimWellIAModelData.h" + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RimWellIAModelData::RimWellIAModelData() +{ + m_displacements.resize( 8 ); + m_casingPressure = 0.0; + m_formationPressure = 0.0; + m_temperature = 0.0; + m_dayoffset = 0; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RimWellIAModelData::~RimWellIAModelData() +{ +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +std::vector RimWellIAModelData::displacements() const +{ + return m_displacements; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimWellIAModelData::setDisplacement( int cornerIndex, cvf::Vec3d displacement ) +{ + size_t ci = cornerIndex; + + if ( ( cornerIndex >= 0 ) && ( ci < m_displacements.size() ) ) m_displacements[ci] = displacement; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimWellIAModelData::setCasingPressure( double pressure ) +{ + m_casingPressure = pressure; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +double RimWellIAModelData::casingPressure() const +{ + return m_casingPressure; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimWellIAModelData::setFormationPressure( double pressure ) +{ + m_formationPressure = pressure; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +double RimWellIAModelData::formationPressure() const +{ + return m_formationPressure; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimWellIAModelData::setTemperature( double temp ) +{ + m_temperature = temp; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +double RimWellIAModelData::temperature() const +{ + return m_temperature; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +int RimWellIAModelData::dayOffset() const +{ + return m_dayoffset; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimWellIAModelData::setDayOffset( int days ) +{ + m_dayoffset = days; +} diff --git a/ApplicationLibCode/ProjectDataModel/WellPath/RimWellIAModelData.h b/ApplicationLibCode/ProjectDataModel/WellPath/RimWellIAModelData.h new file mode 100644 index 0000000000..c4bdf48736 --- /dev/null +++ b/ApplicationLibCode/ProjectDataModel/WellPath/RimWellIAModelData.h @@ -0,0 +1,58 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2021 - Equinor ASA +// +// ResInsight is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// + +#pragma once + +#include "cvfVector3.h" + +#include +#include +#include + +//================================================================================================== +/// +/// +//================================================================================================== +class RimWellIAModelData +{ +public: + RimWellIAModelData(); + ~RimWellIAModelData(); + + std::vector displacements() const; + void setDisplacement( int cornerIndex, cvf::Vec3d displacement ); + + void setCasingPressure( double pressure ); + double casingPressure() const; + + void setFormationPressure( double pressure ); + double formationPressure() const; + + void setTemperature( double temp ); + double temperature() const; + + int dayOffset() const; + void setDayOffset( int days ); + +private: + std::vector m_displacements; + double m_casingPressure; + double m_formationPressure; + double m_temperature; + int m_dayoffset; +}; diff --git a/ApplicationLibCode/ProjectDataModel/WellPath/RimWellIASettings.cpp b/ApplicationLibCode/ProjectDataModel/WellPath/RimWellIASettings.cpp new file mode 100644 index 0000000000..f24e42e5f0 --- /dev/null +++ b/ApplicationLibCode/ProjectDataModel/WellPath/RimWellIASettings.cpp @@ -0,0 +1,640 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2021 - Equinor ASA +// +// ResInsight is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// + +#include "RimWellIASettings.h" + +#include "RiaApplication.h" +#include "RiaPreferencesGeoMech.h" + +#include "RigWellPath.h" +#include "RigWellPathGeometryTools.h" + +#include "RimDoubleParameter.h" +#include "RimGenericParameter.h" +#include "RimGeoMechCase.h" +#include "RimIntegerParameter.h" +#include "RimParameterGroup.h" +#include "RimProject.h" +#include "RimStringParameter.h" +#include "RimTools.h" +#include "RimWellIADataAccess.h" +#include "RimWellIAModelData.h" +#include "RimWellPath.h" + +#include "RifParameterXmlReader.h" + +#include "cafPdmFieldCvfVec3d.h" +#include "cafPdmFieldScriptingCapability.h" +#include "cafPdmObjectScriptingCapability.h" +#include "cafPdmUiComboBoxEditor.h" +#include "cafPdmUiDateEditor.h" +#include "cafPdmUiDoubleSliderEditor.h" +#include "cafPdmUiFilePathEditor.h" +#include "cafPdmUiTableViewEditor.h" + +#include +#include + +#include + +CAF_PDM_SOURCE_INIT( RimWellIASettings, "RimWellIASettings" ); + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RimWellIASettings::RimWellIASettings() +{ + CAF_PDM_InitObject( "Integrity Analysis Model Settings", ":/WellIntAnalysis.png", "", "" ); + + setName( "Model" ); + + CAF_PDM_InitFieldNoDefault( &m_geomechCase, "GeomechCase", "GeoMech Case", "", "", "" ); + + CAF_PDM_InitFieldNoDefault( &m_baseDir, "BaseDir", "Working Directory", "", "", "" ); + m_baseDir.uiCapability()->setUiReadOnly( true ); + + CAF_PDM_InitField( &m_startMD, "StartMeasuredDepth", 0.0, "Start MD", "", "", "" ); + CAF_PDM_InitField( &m_endMD, "EndMeasuredDepth", 0.0, "End MD", "", "", "" ); + m_startMD.uiCapability()->setUiEditorTypeName( caf::PdmUiDoubleSliderEditor::uiEditorTypeName() ); + m_endMD.uiCapability()->setUiEditorTypeName( caf::PdmUiDoubleSliderEditor::uiEditorTypeName() ); + + CAF_PDM_InitField( &m_bufferXY, "BufferXY", 20.0, "Model Size (XY)", "", "", "" ); + CAF_PDM_InitField( &m_bufferZ, "BufferZ", 15.0, "Depth buffer size", "", "", "" ); + + CAF_PDM_InitFieldNoDefault( &m_parameters, "ModelingParameters", "Modeling Parameters", ":/Bullet.png", "", "" ); + + CAF_PDM_InitFieldNoDefault( &m_csvParameters, "TimeStepParameters", "Time Step Parameters", ":/Bullet.png", "", "" ); + + CAF_PDM_InitFieldNoDefault( &m_nameProxy, "NameProxy", "Name Proxy", "", "", "" ); + m_nameProxy.registerGetMethod( this, &RimWellIASettings::fullName ); + m_nameProxy.uiCapability()->setUiReadOnly( true ); + m_nameProxy.uiCapability()->setUiHidden( true ); + m_nameProxy.xmlCapability()->disableIO(); + + CAF_PDM_InitField( &m_showBox, "showBox", false, "Show model box", "", "", "" ); + + CAF_PDM_InitFieldNoDefault( &m_geostaticDate, "startDate", "Start Date (geostatic):", "", "", "" ); + + CAF_PDM_InitField( &m_boxValid, "boxValid", false, "Model box is valid", "", "", "" ); + m_boxValid.uiCapability()->setUiHidden( true ); + + this->setDeletable( true ); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RimWellIASettings::~RimWellIASettings() +{ + resetResInsightParameters(); + resetModelData(); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +bool RimWellIASettings::initSettings( QString& outErrmsg ) +{ + initCsvParameters(); + + RifParameterXmlReader basicreader( RiaPreferencesGeoMech::current()->geomechWIADefaultXML() ); + if ( !basicreader.parseFile( outErrmsg ) ) return false; + + m_parameters.clear(); + for ( auto group : basicreader.parameterGroups() ) + { + m_parameters.push_back( group ); + } + + return true; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimWellIASettings::updateVisualization() +{ + generateModelBox(); + RiaApplication::instance()->project()->scheduleCreateDisplayModelAndRedrawAllViews(); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimWellIASettings::fieldChangedByUi( const caf::PdmFieldHandle* changedField, + const QVariant& oldValue, + const QVariant& newValue ) +{ + if ( ( changedField == &m_startMD ) || ( changedField == &m_endMD ) || ( changedField == objectToggleField() ) || + ( changedField == &m_bufferXY ) || ( changedField == &m_bufferZ ) || ( changedField == &m_showBox ) ) + { + updateVisualization(); + } + + this->updateConnectedEditors(); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +QList RimWellIASettings::calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions, + bool* useOptionsOnly ) +{ + QList options; + + if ( fieldNeedingOptions == &m_geomechCase ) + { + RimTools::geoMechCaseOptionItems( &options ); + } + + return options; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimWellIASettings::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) +{ + RimWellPath* wellPath; + firstAncestorOrThisOfType( wellPath ); + if ( wellPath ) + { + if ( wellPath->unitSystem() == RiaDefines::EclipseUnitSystem::UNITS_METRIC ) + { + m_startMD.uiCapability()->setUiName( "Start MD [m]" ); + m_endMD.uiCapability()->setUiName( "End MD [m]" ); + } + else if ( wellPath->unitSystem() == RiaDefines::EclipseUnitSystem::UNITS_FIELD ) + { + m_startMD.uiCapability()->setUiName( "Start MD [ft]" ); + m_endMD.uiCapability()->setUiName( "End MD [ft]" ); + } + } + + auto generalGroup = uiOrdering.addNewGroup( "General" ); + generalGroup->add( nameField() ); + generalGroup->add( &m_baseDir ); + + auto geoGroup = uiOrdering.addNewGroup( "GeoMechanical Settings" ); + geoGroup->add( &m_geomechCase ); + geoGroup->add( &m_geostaticDate ); + + auto modelGroup = uiOrdering.addNewGroup( "Model Settings" ); + modelGroup->add( &m_startMD ); + modelGroup->add( &m_endMD ); + modelGroup->add( &m_bufferXY ); + modelGroup->add( &m_bufferZ ); + modelGroup->add( &m_showBox ); + + uiOrdering.skipRemainingFields( true ); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimWellIASettings::defineEditorAttribute( const caf::PdmFieldHandle* field, + QString uiConfigName, + caf::PdmUiEditorAttribute* attribute ) +{ + if ( field == &m_startMD || field == &m_endMD ) + { + caf::PdmUiDoubleSliderEditorAttribute* myAttr = dynamic_cast( attribute ); + + if ( myAttr ) + { + RimWellPath* wellPath = nullptr; + this->firstAncestorOrThisOfType( wellPath ); + if ( !wellPath ) return; + + myAttr->m_minimum = wellPath->uniqueStartMD(); + myAttr->m_maximum = wellPath->uniqueEndMD(); + } + } + else if ( field == &m_geostaticDate ) + { + caf::PdmUiDateEditorAttribute* myAttr = dynamic_cast( attribute ); + if ( myAttr ) + { + myAttr->dateFormat = "dd MMM yyyy"; + } + } +} + +//-------------------------------------------------------------------------------------------------- +/// Return the name to show in the tree selector +//-------------------------------------------------------------------------------------------------- +QString RimWellIASettings::fullName() const +{ + return QString( "%1 - [%2 - %3]" ).arg( name() ).arg( m_startMD ).arg( m_endMD ); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +bool RimWellIASettings::modelBoxValid() const +{ + return m_boxValid; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +std::vector RimWellIASettings::modelBoxVertices() const +{ + return m_modelbox.vertices(); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +std::vector RimWellIASettings::modelData() const +{ + return m_modelData; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +caf::PdmFieldHandle* RimWellIASettings::userDescriptionField() +{ + return &m_nameProxy; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +QString RimWellIASettings::geomechCaseFilename() const +{ + if ( m_geomechCase ) return m_geomechCase->gridFileName(); + return ""; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +QString RimWellIASettings::geomechCaseName() const +{ + QFileInfo fi( geomechCaseFilename() ); + return fi.baseName(); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RimGeoMechCase* RimWellIASettings::geomechCase() const +{ + return m_geomechCase; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +QDateTime RimWellIASettings::geostaticDate() const +{ + return m_geostaticDate; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +QString RimWellIASettings::outputBaseDirectory() const +{ + return m_baseDir(); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +QString RimWellIASettings::jsonInputFilename() const +{ + return m_baseDir() + "/model_input.json"; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +QString RimWellIASettings::csvInputFilename() const +{ + return m_baseDir() + "/model_input.csv"; +} + +QStringList RimWellIASettings::commandParameters() const +{ + QStringList retlist; + + retlist << m_baseDir(); + retlist << jsonInputFilename(); + retlist << csvInputFilename(); + + return retlist; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimWellIASettings::setGeoMechCase( RimGeoMechCase* geomechCase ) +{ + m_geomechCase = geomechCase; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimWellIASettings::setOutputBaseDirectory( QString baseDir ) +{ + m_baseDir = baseDir; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimWellIASettings::setShowBox( bool show ) +{ + m_showBox = show; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +bool RimWellIASettings::showBox() const +{ + return m_showBox && m_boxValid; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +const std::list RimWellIASettings::inputParameterGroups() const +{ + std::list retlist; + + for ( auto& group : m_parameters ) + retlist.push_back( group ); + + return retlist; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +const std::list RimWellIASettings::resinsightParameterGroups() const +{ + std::list retlist; + + for ( auto& group : m_parametersRI ) + retlist.push_back( group ); + + return retlist; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimWellIASettings::resetResInsightParameters() +{ + for ( auto& group : m_parametersRI ) + { + delete group; + } + m_parametersRI.clear(); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimWellIASettings::updateResInsightParameters() +{ + resetResInsightParameters(); + + RimParameterGroup* wellcoords = new RimParameterGroup(); + wellcoords->setName( "well_coordinates" ); + wellcoords->setLabel( "Well Coordinates" ); + wellcoords->addParameter( "x_well", m_modelbox.center().x() ); + wellcoords->addParameter( "y_well", m_modelbox.center().y() ); + wellcoords->addParameter( "z_well", m_modelbox.center().z() ); + m_parametersRI.push_back( wellcoords ); + + RimParameterGroup* initcond = new RimParameterGroup(); + initcond->setName( "BC_initial_conditions" ); + initcond->setLabel( "BC Initial Conditions" ); + initcond->addParameter( "analysis_depth", std::abs( m_modelbox.center().z() ) ); + + m_parametersRI.push_back( initcond ); + + RimParameterGroup* initialStress = new RimParameterGroup(); + initialStress->setName( "initial_stress" ); + initialStress->setLabel( "Initial Stress" ); + initialStress->setComment( + "SXX is in North direction, SYY is East, SZZ is vertical; PP is the initial pore pressure in the " + "formation, set to 0 for hydrostatic assumption; inclination is 0 for a vertical well" ); + + cvf::Vec3d position = m_modelbox.center(); + RimWellIADataAccess dataAccess( m_geomechCase ); + std::vector nativeKeys{ "S11", "S22", "S33", "S12", "S13", "S23" }; + std::vector paramKeys{ "SXX", "SYY", "SZZ", "SXY", "SXZ", "SYZ" }; + + for ( size_t i = 0; i < nativeKeys.size(); i++ ) + { + double stressValue = + dataAccess.interpolatedResultValue( "ST", nativeKeys[i], RigFemResultPosEnum::RIG_ELEMENT_NODAL, position, 0 ); + initialStress->addParameter( paramKeys[i], stressValue ); + } + + double ppValue = dataAccess.interpolatedResultValue( "POR-Bar", "", RigFemResultPosEnum::RIG_NODAL, position, 0 ); + initialStress->addParameter( "PP", ppValue ); + + auto angles = RigWellPathGeometryTools::calculateAzimuthAndInclinationAtMd( ( m_startMD + m_endMD ) / 2.0, + wellPath()->wellPathGeometry() ); + initialStress->addParameter( "azimuth_well", angles.first ); + initialStress->addParameter( "inclination_well", angles.second ); + + m_parametersRI.push_back( initialStress ); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimWellIASettings::addCsvGroup( QString name, QStringList timeSteps, double defaultValue /* = 0.0 */ ) +{ + RimParameterGroup* group = new RimParameterGroup(); + group->setName( name ); + const int noParams = timeSteps.size(); + + for ( int i = 0; i < noParams; i++ ) + { + group->addParameter( timeSteps[i], defaultValue ); + } + m_csvParameters.push_back( group ); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimWellIASettings::initCsvParameters() +{ + m_csvParameters.clear(); + + QStringList timeSteps = m_geomechCase->timeStepStrings(); + + addCsvGroup( m_csvGroupNames[(size_t)CSV_GROUPNAME::CASING_PRESSURE], timeSteps ); + addCsvGroup( m_csvGroupNames[(size_t)CSV_GROUPNAME::FORMATION_PRESSURE], timeSteps ); + addCsvGroup( m_csvGroupNames[(size_t)CSV_GROUPNAME::TEMPERATURE], timeSteps, 70.0 ); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimWellIASettings::setDepthInterval( double startMD, double endMD ) +{ + m_startMD = startMD; + m_endMD = endMD; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +double RimWellIASettings::startMD() +{ + return m_startMD; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +double RimWellIASettings::endMD() +{ + return m_endMD; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimWellIASettings::resetModelData() +{ + for ( auto& modeldata : m_modelData ) + { + delete modeldata; + } + m_modelData.clear(); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RimWellPath* RimWellIASettings::wellPath() const +{ + RimWellPath* wellpath = nullptr; + this->firstAncestorOrThisOfTypeAsserted( wellpath ); + return wellpath; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimWellIASettings::generateModelBox() +{ + RimWellPath* path = wellPath(); + if ( !path ) return; + + RigWellPath* wellgeom = path->wellPathGeometry(); + if ( !wellgeom ) return; + + cvf::Vec3d startPos = wellgeom->interpolatedPointAlongWellPath( m_startMD ); + cvf::Vec3d endPos = wellgeom->interpolatedPointAlongWellPath( m_endMD ); + + m_boxValid = m_modelbox.updateBox( startPos, endPos, m_bufferXY, m_bufferZ ); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimWellIASettings::extractModelData() +{ + generateModelBox(); + updateResInsightParameters(); + resetModelData(); + + QDateTime startDate = geostaticDate(); + + int timestep = 0; + auto timeStepStrings = m_geomechCase->timeStepStrings(); + + for ( auto& date : timeStepDates() ) + { + RimWellIAModelData* data = new RimWellIAModelData(); + data->setDayOffset( startDate.daysTo( date ) ); + + for ( auto& group : m_csvParameters ) + { + if ( group->name() == m_csvGroupNames[(size_t)CSV_GROUPNAME::CASING_PRESSURE] ) + { + data->setCasingPressure( group->parameterValue( timeStepStrings[timestep] ).toDouble() ); + } + else if ( group->name() == m_csvGroupNames[(size_t)CSV_GROUPNAME::FORMATION_PRESSURE] ) + { + data->setFormationPressure( group->parameterValue( timeStepStrings[timestep] ).toDouble() ); + } + else if ( group->name() == m_csvGroupNames[(size_t)CSV_GROUPNAME::TEMPERATURE] ) + { + data->setTemperature( group->parameterValue( timeStepStrings[timestep] ).toDouble() ); + } + } + + const std::vector displacements = extractDisplacments( m_modelbox.vertices(), timestep ); + + for ( size_t i = 0; i < displacements.size(); i++ ) + { + data->setDisplacement( (int)i, displacements[i] ); + } + m_modelData.push_back( data ); + timestep++; + } +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +std::vector RimWellIASettings::timeStepDates() +{ + std::vector dates = m_geomechCase->timeStepDates(); + + if ( dates.size() < (size_t)m_geomechCase->timeStepStrings().size() ) + dates.insert( dates.begin(), m_geostaticDate ); + + return dates; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +std::vector RimWellIASettings::extractDisplacments( std::vector corners, int timeStep ) +{ + RimWellIADataAccess dataAccess( m_geomechCase ); + + std::vector displacements; + + for ( auto& pos : corners ) + { + double u1 = dataAccess.interpolatedResultValue( "U", "U1", RigFemResultPosEnum::RIG_NODAL, pos, timeStep ); + double u2 = dataAccess.interpolatedResultValue( "U", "U2", RigFemResultPosEnum::RIG_NODAL, pos, timeStep ); + double u3 = dataAccess.interpolatedResultValue( "U", "U3", RigFemResultPosEnum::RIG_NODAL, pos, timeStep ); + + displacements.push_back( cvf::Vec3d( u1, u2, u3 ) ); + } + return displacements; +} diff --git a/ApplicationLibCode/ProjectDataModel/WellPath/RimWellIASettings.h b/ApplicationLibCode/ProjectDataModel/WellPath/RimWellIASettings.h new file mode 100644 index 0000000000..cc5b00b1f8 --- /dev/null +++ b/ApplicationLibCode/ProjectDataModel/WellPath/RimWellIASettings.h @@ -0,0 +1,145 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2021 Equinor ASA +// +// ResInsight is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// +#pragma once + +#include "RimCheckableNamedObject.h" +#include "RimWellIAModelBox.h" + +#include "cafPdmChildArrayField.h" +#include "cafPdmField.h" +#include "cafPdmFieldCvfVec3d.h" +#include "cafPdmObject.h" +#include "cafPdmProxyValueField.h" +#include "cafPdmPtrField.h" + +#include "cvfVector3.h" + +#include +#include +#include + +#include +#include +#include + +class RimGeoMechCase; +class RimParameterGroup; +class RimGenericParameter; +class RimWellPath; +class RimWellIAModelData; + +class RimWellIASettings : public RimCheckableNamedObject +{ + CAF_PDM_HEADER_INIT; + +public: + RimWellIASettings(); + ~RimWellIASettings() override; + + bool initSettings( QString& outErrmsg ); + + void setGeoMechCase( RimGeoMechCase* geomechCase ); + RimGeoMechCase* geomechCase() const; + QString geomechCaseFilename() const; + QString geomechCaseName() const; + + QDateTime geostaticDate() const; + + void setOutputBaseDirectory( QString baseDir ); + QString outputBaseDirectory() const; + + bool showBox() const; + void setShowBox( bool show ); + + const std::list inputParameterGroups() const; + const std::list resinsightParameterGroups() const; + + void setDepthInterval( double startMD, double endMD ); + double startMD(); + double endMD(); + + QString jsonInputFilename() const; + QString csvInputFilename() const; + + QStringList commandParameters() const; + + RimWellPath* wellPath() const; + + bool modelBoxValid() const; + std::vector modelBoxVertices() const; + std::vector modelData() const; + + void extractModelData(); + void updateVisualization(); + +protected: + QList calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions, + bool* useOptionsOnly ) override; + + void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) override; + void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override; + void defineEditorAttribute( const caf::PdmFieldHandle* field, + QString uiConfigName, + caf::PdmUiEditorAttribute* attribute ) override; + + caf::PdmFieldHandle* userDescriptionField() override; + + QString fullName() const; + +private: + std::vector timeStepDates(); + + void initCsvParameters(); + void updateResInsightParameters(); + void generateModelBox(); + void resetModelData(); + void resetResInsightParameters(); + + void addCsvGroup( QString name, QStringList timeSteps, double defaultValue = 0.0 ); + + std::vector extractDisplacments( std::vector corners, int timeStep ); + +private: + caf::PdmProxyValueField m_nameProxy; + + caf::PdmPtrField m_geomechCase; + caf::PdmField m_baseDir; + + caf::PdmField m_showBox; + caf::PdmField m_boxValid; + caf::PdmField m_startMD; + caf::PdmField m_endMD; + caf::PdmField m_bufferXY; + caf::PdmField m_bufferZ; + caf::PdmField m_geostaticDate; + + caf::PdmChildArrayField m_parameters; + std::vector m_parametersRI; + caf::PdmChildArrayField m_csvParameters; + + RimWellIAModelBox m_modelbox; + std::vector m_modelData; + + enum class CSV_GROUPNAME + { + FORMATION_PRESSURE = 0, + CASING_PRESSURE = 1, + TEMPERATURE = 2 + }; + const std::vector m_csvGroupNames{ "Formation Pressure", "Casing Pressure", "Temperature" }; +}; diff --git a/ApplicationLibCode/ProjectDataModel/WellPath/RimWellIASettingsCollection.cpp b/ApplicationLibCode/ProjectDataModel/WellPath/RimWellIASettingsCollection.cpp new file mode 100644 index 0000000000..0917c5874f --- /dev/null +++ b/ApplicationLibCode/ProjectDataModel/WellPath/RimWellIASettingsCollection.cpp @@ -0,0 +1,119 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2021 Equinor ASA +// +// ResInsight is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// + +#include "RimWellIASettingsCollection.h" + +#include "RiaApplication.h" +#include "RiaLogging.h" + +#include "RimGeoMechCase.h" +#include "RimProject.h" +#include "RimWellIASettings.h" +#include "RimWellPath.h" +#include "cafPdmFieldScriptingCapability.h" +#include "cafPdmObjectScriptingCapability.h" + +#include "QFile" + +CAF_PDM_SOURCE_INIT( RimWellIASettingsCollection, "RimWellIASettingsCollection" ); + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RimWellIASettingsCollection::RimWellIASettingsCollection() +{ + CAF_PDM_InitObject( "Integrity Analysis Models", ":/WellIntAnalysis.png", "", "" ); + + CAF_PDM_InitFieldNoDefault( &m_wellIASettings, "WellIASettings", "Settings", "", "", "" ); + m_wellIASettings.uiCapability()->setUiTreeHidden( true ); + + setDeletable( true ); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RimWellIASettingsCollection::~RimWellIASettingsCollection() +{ +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RimWellIASettings* RimWellIASettingsCollection::startWellIntegrationAnalysis( QString baseDir, + RimWellPath* wellPath, + double measuredDepth, + RimGeoMechCase* theCase, + QString& outErrmsg ) +{ + RimWellIASettings* modelSettings = new RimWellIASettings(); + modelSettings->setGeoMechCase( theCase ); + + double depthSize = 50; + if ( theCase ) depthSize = theCase->characteristicCellSize(); + modelSettings->setDepthInterval( measuredDepth, measuredDepth + depthSize ); + modelSettings->setOutputBaseDirectory( baseDir ); + + QString errmsg; + if ( !modelSettings->initSettings( errmsg ) ) + { + delete modelSettings; + outErrmsg = "Unable to load default parameters from the WIA default parameter XML file:\n" + errmsg; + return nullptr; + } + + m_wellIASettings.push_back( modelSettings ); + + return modelSettings; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +std::vector RimWellIASettingsCollection::settings() const +{ + return m_wellIASettings.childObjects(); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +bool RimWellIASettingsCollection::isEnabled() const +{ + return true; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +bool RimWellIASettingsCollection::hasSettings() const +{ + return m_wellIASettings.size() > 0; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimWellIASettingsCollection::onChildDeleted( caf::PdmChildArrayFieldHandle* childArray, + std::vector& referringObjects ) +{ + RimWellPath* wellPath; + this->firstAncestorOrThisOfType( wellPath ); + if ( wellPath ) wellPath->updateConnectedEditors(); + RiaApplication::instance()->project()->scheduleCreateDisplayModelAndRedrawAllViews(); +} diff --git a/ApplicationLibCode/ProjectDataModel/WellPath/RimWellIASettingsCollection.h b/ApplicationLibCode/ProjectDataModel/WellPath/RimWellIASettingsCollection.h new file mode 100644 index 0000000000..7d6bc735cb --- /dev/null +++ b/ApplicationLibCode/ProjectDataModel/WellPath/RimWellIASettingsCollection.h @@ -0,0 +1,55 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2021 Equinor ASA +// +// ResInsight is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// +#pragma once + +#include "cafPdmField.h" + +#include "cafPdmChildArrayField.h" +#include "cafPdmObject.h" + +#include + +class RimWellIASettings; +class RimWellPath; +class RimGeoMechCase; + +class RimWellIASettingsCollection : public caf::PdmObject +{ + CAF_PDM_HEADER_INIT; + +public: + RimWellIASettingsCollection(); + ~RimWellIASettingsCollection() override; + + std::vector settings() const; + + bool isEnabled() const; + bool hasSettings() const; + + RimWellIASettings* startWellIntegrationAnalysis( QString baseDir, + RimWellPath* wellPath, + double measuredDepth, + RimGeoMechCase* theCase, + QString& outErrmsg ); + + void onChildDeleted( caf::PdmChildArrayFieldHandle* childArray, + std::vector& referringObjects ) override; + +private: + caf::PdmChildArrayField m_wellIASettings; +}; diff --git a/ApplicationLibCode/ProjectDataModel/WellPath/RimWellPath.cpp b/ApplicationLibCode/ProjectDataModel/WellPath/RimWellPath.cpp index 7ee7c3bcda..a41fef02a2 100644 --- a/ApplicationLibCode/ProjectDataModel/WellPath/RimWellPath.cpp +++ b/ApplicationLibCode/ProjectDataModel/WellPath/RimWellPath.cpp @@ -42,6 +42,7 @@ #include "RimProject.h" #include "RimStimPlanModelCollection.h" #include "RimTools.h" +#include "RimWellIASettingsCollection.h" #include "RimWellLogFile.h" #include "RimWellLogFileChannel.h" #include "RimWellLogPlotCollection.h" @@ -137,6 +138,12 @@ RimWellPath::RimWellPath() CAF_PDM_InitFieldNoDefault( &m_wellPathTieIn, "WellPathTieIn", "well Path Tie-In", "", "", "" ); m_wellPathTieIn = new RimWellPathTieIn; m_wellPathTieIn->connectWellPaths( nullptr, this, 0.0 ); + + CAF_PDM_InitFieldNoDefault( &m_wellIASettingsCollection, "WellIASettings", "Integrity Analysis Settings", "", "", "" ); + m_wellIASettingsCollection = new RimWellIASettingsCollection(); + m_wellIASettingsCollection->uiCapability()->setUiTreeHidden( true ); + + this->setDeletable( true ); } //-------------------------------------------------------------------------------------------------- @@ -610,6 +617,14 @@ const RimWellPathAttributeCollection* RimWellPath::attributeCollection() const return m_wellPathAttributes; } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RimWellIASettingsCollection* RimWellPath::wellIASettingsCollection() +{ + return m_wellIASettingsCollection; +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- @@ -714,6 +729,11 @@ void RimWellPath::defineUiTreeOrdering( caf::PdmUiTreeOrdering& uiTreeOrdering, { uiTreeOrdering.add( &m_wellLogFiles ); + if ( m_wellIASettingsCollection()->isEnabled() && m_wellIASettingsCollection()->hasSettings() ) + { + uiTreeOrdering.add( m_wellIASettingsCollection() ); + } + if ( m_completionSettings() && !allCompletionsRecursively().empty() ) { uiTreeOrdering.add( m_completionSettings() ); diff --git a/ApplicationLibCode/ProjectDataModel/WellPath/RimWellPath.h b/ApplicationLibCode/ProjectDataModel/WellPath/RimWellPath.h index 7c94e3d6cc..0cd051badd 100644 --- a/ApplicationLibCode/ProjectDataModel/WellPath/RimWellPath.h +++ b/ApplicationLibCode/ProjectDataModel/WellPath/RimWellPath.h @@ -59,6 +59,7 @@ class Rim3dWellLogCurve; class Rim3dWellLogCurveCollection; class RimWellPathTieIn; class RimMswCompletionParameters; +class RimWellIASettingsCollection; //================================================================================================== /// @@ -136,6 +137,7 @@ class RimWellPath : public caf::PdmObject, public RimWellPathComponentInterface const RimStimPlanModelCollection* stimPlanModelCollection() const; RimWellPathAttributeCollection* attributeCollection(); const RimWellPathAttributeCollection* attributeCollection() const; + RimWellIASettingsCollection* wellIASettingsCollection(); bool showWellPathLabel() const; bool showWellPath() const; @@ -210,6 +212,7 @@ class RimWellPath : public caf::PdmObject, public RimWellPathComponentInterface caf::PdmChildField m_completionSettings; caf::PdmChildField m_completions; caf::PdmChildField m_wellPathAttributes; + caf::PdmChildField m_wellIASettingsCollection; caf::PdmChildField m_wellPathTieIn; diff --git a/ApplicationLibCode/UserInterface/RiuViewerCommands.cpp b/ApplicationLibCode/UserInterface/RiuViewerCommands.cpp index 7d0a2a6a4c..cd2a03eda6 100644 --- a/ApplicationLibCode/UserInterface/RiuViewerCommands.cpp +++ b/ApplicationLibCode/UserInterface/RiuViewerCommands.cpp @@ -67,6 +67,7 @@ #include "RimSurfaceInView.h" #include "RimTextAnnotation.h" #include "RimViewController.h" +#include "RimWellIASettingsCollection.h" #include "RimWellPath.h" #include "Riu3dSelectionManager.h" @@ -538,6 +539,13 @@ void RiuViewerCommands::displayContextMenu( QMouseEvent* event ) menuBuilder.subMenuEnd(); menuBuilder.addSeparator(); + + if ( wellPath->wellIASettingsCollection()->isEnabled() ) + { + menuBuilder << "RicNewWellIntegrityAnalysisFeature"; + menuBuilder.addSeparator(); + } + menuBuilder.subMenuStart( "Create Completions", QIcon( ":/FishBoneGroup16x16.png" ) ); menuBuilder << "RicNewPerforationIntervalAtMeasuredDepthFeature"; From 0c69cdf2031e949c7b019419ead2bcad7fbfe87f Mon Sep 17 00:00:00 2001 From: jonjenssen <69144954+jonjenssen@users.noreply.github.com> Date: Fri, 10 Sep 2021 08:19:44 +0200 Subject: [PATCH 113/308] Use only one implementation of lineIndicesFromQuadVertexArray (#7980) * Use only one implementation of lineIndicesFromQuadVertexArray --- .../RivFemPartGeometryGenerator.cpp | 47 ++++--------------- .../RivFemPartGeometryGenerator.h | 3 +- .../RivBoxGeometryGenerator.cpp | 32 +------------ .../RivBoxGeometryGenerator.h | 2 - .../RivFaultGeometryGenerator.cpp | 38 ++------------- .../RivFaultGeometryGenerator.h | 2 - .../RivWellFracturePartMgr.cpp | 4 +- .../cvfStructGridGeometryGenerator.cpp | 4 +- .../cvfStructGridGeometryGenerator.h | 4 +- .../cafBoxManipulatorGeometryGenerator.cpp | 37 ++------------- .../cafBoxManipulatorGeometryGenerator.h | 2 - 11 files changed, 25 insertions(+), 150 deletions(-) diff --git a/ApplicationLibCode/GeoMech/GeoMechVisualization/RivFemPartGeometryGenerator.cpp b/ApplicationLibCode/GeoMech/GeoMechVisualization/RivFemPartGeometryGenerator.cpp index fda6255651..3f318f77c6 100644 --- a/ApplicationLibCode/GeoMech/GeoMechVisualization/RivFemPartGeometryGenerator.cpp +++ b/ApplicationLibCode/GeoMech/GeoMechVisualization/RivFemPartGeometryGenerator.cpp @@ -27,6 +27,7 @@ #include "cvfOutlineEdgeExtractor.h" #include "cvfPrimitiveSetIndexedUInt.h" #include "cvfScalarMapper.h" +#include "cvfStructGridGeometryGenerator.h" #include #include @@ -84,8 +85,9 @@ ref RivFemPartGeometryGenerator::createMeshDrawable() ref geo = new DrawableGeo; geo->setVertexArray( m_quadVertices.p() ); - ref indices = lineIndicesFromQuadVertexArray( m_quadVertices.p() ); - ref prim = new PrimitiveSetIndexedUInt( PT_LINES ); + ref indices = cvf::StructGridGeometryGenerator::lineIndicesFromQuadVertexArray( m_quadVertices.p() ); + + ref prim = new PrimitiveSetIndexedUInt( PT_LINES ); prim->setIndices( indices.p() ); geo->addPrimitiveSet( prim.p() ); @@ -101,7 +103,7 @@ ref RivFemPartGeometryGenerator::createOutlineMeshDrawable( double cvf::OutlineEdgeExtractor ee( creaseAngle, *m_quadVertices ); - ref indices = lineIndicesFromQuadVertexArray( m_quadVertices.p() ); + ref indices = cvf::StructGridGeometryGenerator::lineIndicesFromQuadVertexArray( m_quadVertices.p() ); ee.addPrimitives( 4, *indices ); ref lineIndices = ee.lineIndices(); @@ -120,40 +122,6 @@ ref RivFemPartGeometryGenerator::createOutlineMeshDrawable( double return geo; } -//-------------------------------------------------------------------------------------------------- -/// -/// -/// -/// -//-------------------------------------------------------------------------------------------------- -ref RivFemPartGeometryGenerator::lineIndicesFromQuadVertexArray( const Vec3fArray* vertexArray ) -{ - CVF_ASSERT( vertexArray ); - - size_t numVertices = vertexArray->size(); - int numQuads = static_cast( numVertices / 4 ); - CVF_ASSERT( numVertices % 4 == 0 ); - - ref indices = new UIntArray; - indices->resize( numQuads * 8 ); - -#pragma omp parallel for - for ( int i = 0; i < numQuads; i++ ) - { - int idx = 8 * i; - indices->set( idx + 0, i * 4 + 0 ); - indices->set( idx + 1, i * 4 + 1 ); - indices->set( idx + 2, i * 4 + 1 ); - indices->set( idx + 3, i * 4 + 2 ); - indices->set( idx + 4, i * 4 + 2 ); - indices->set( idx + 5, i * 4 + 3 ); - indices->set( idx + 6, i * 4 + 3 ); - indices->set( idx + 7, i * 4 + 0 ); - } - - return indices; -} - //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- @@ -336,8 +304,9 @@ cvf::ref ref geo = new DrawableGeo; geo->setVertexArray( quadVertices.p() ); - ref indices = lineIndicesFromQuadVertexArray( quadVertices.p() ); - ref prim = new PrimitiveSetIndexedUInt( PT_LINES ); + ref indices = cvf::StructGridGeometryGenerator::lineIndicesFromQuadVertexArray( quadVertices.p() ); + + ref prim = new PrimitiveSetIndexedUInt( PT_LINES ); prim->setIndices( indices.p() ); geo->addPrimitiveSet( prim.p() ); diff --git a/ApplicationLibCode/GeoMech/GeoMechVisualization/RivFemPartGeometryGenerator.h b/ApplicationLibCode/GeoMech/GeoMechVisualization/RivFemPartGeometryGenerator.h index 36b1539496..053f71b66b 100644 --- a/ApplicationLibCode/GeoMech/GeoMechVisualization/RivFemPartGeometryGenerator.h +++ b/ApplicationLibCode/GeoMech/GeoMechVisualization/RivFemPartGeometryGenerator.h @@ -96,8 +96,7 @@ class RivFemPartGeometryGenerator : public cvf::Object const cvf::Vec3d& displayModelOffset ); private: - static cvf::ref lineIndicesFromQuadVertexArray( const cvf::Vec3fArray* vertexArray ); - void computeArrays(); + void computeArrays(); private: // Input diff --git a/ApplicationLibCode/ModelVisualization/RivBoxGeometryGenerator.cpp b/ApplicationLibCode/ModelVisualization/RivBoxGeometryGenerator.cpp index bbb9f3028e..d9b784bb68 100644 --- a/ApplicationLibCode/ModelVisualization/RivBoxGeometryGenerator.cpp +++ b/ApplicationLibCode/ModelVisualization/RivBoxGeometryGenerator.cpp @@ -56,7 +56,7 @@ cvf::ref RivBoxGeometryGenerator::createBoxFromVertices( const std::v geo->setVertexArray( cvfVertices.p() ); - cvf::ref indices = lineIndicesFromQuadVertexArray( cvfVertices.p() ); + cvf::ref indices = cvf::StructGridGeometryGenerator::lineIndicesFromQuadVertexArray( cvfVertices.p() ); cvf::ref prim = new cvf::PrimitiveSetIndexedUInt( cvf::PT_LINES ); prim->setIndices( indices.p() ); @@ -75,33 +75,3 @@ cvf::ref RivBoxGeometryGenerator::createBoxFromVertices( const std::v return part; } - -cvf::ref RivBoxGeometryGenerator::lineIndicesFromQuadVertexArray( const cvf::Vec3fArray* vertexArray ) -{ - // TODO - see issue #7890 - - CVF_ASSERT( vertexArray ); - - size_t numVertices = vertexArray->size(); - int numQuads = static_cast( numVertices / 4 ); - CVF_ASSERT( numVertices % 4 == 0 ); - - cvf::ref indices = new cvf::UIntArray; - indices->resize( numQuads * 8 ); - -#pragma omp parallel for - for ( int i = 0; i < numQuads; i++ ) - { - int idx = 8 * i; - indices->set( idx + 0, i * 4 + 0 ); - indices->set( idx + 1, i * 4 + 1 ); - indices->set( idx + 2, i * 4 + 1 ); - indices->set( idx + 3, i * 4 + 2 ); - indices->set( idx + 4, i * 4 + 2 ); - indices->set( idx + 5, i * 4 + 3 ); - indices->set( idx + 6, i * 4 + 3 ); - indices->set( idx + 7, i * 4 + 0 ); - } - - return indices; -} diff --git a/ApplicationLibCode/ModelVisualization/RivBoxGeometryGenerator.h b/ApplicationLibCode/ModelVisualization/RivBoxGeometryGenerator.h index fb2aba26d0..58952c2c31 100644 --- a/ApplicationLibCode/ModelVisualization/RivBoxGeometryGenerator.h +++ b/ApplicationLibCode/ModelVisualization/RivBoxGeometryGenerator.h @@ -36,8 +36,6 @@ class RivBoxGeometryGenerator public: static cvf::ref createBoxFromVertices( const std::vector& vertices, const cvf::Color3f color ); - static cvf::ref lineIndicesFromQuadVertexArray( const cvf::Vec3fArray* vertexArray ); - private: RivBoxGeometryGenerator(){}; }; diff --git a/ApplicationLibCode/ModelVisualization/RivFaultGeometryGenerator.cpp b/ApplicationLibCode/ModelVisualization/RivFaultGeometryGenerator.cpp index 55da4bf588..2e76b81f5a 100644 --- a/ApplicationLibCode/ModelVisualization/RivFaultGeometryGenerator.cpp +++ b/ApplicationLibCode/ModelVisualization/RivFaultGeometryGenerator.cpp @@ -79,8 +79,9 @@ cvf::ref RivFaultGeometryGenerator::createMeshDrawable() cvf::ref geo = new cvf::DrawableGeo; geo->setVertexArray( m_vertices.p() ); - cvf::ref indices = lineIndicesFromQuadVertexArray( m_vertices.p() ); - cvf::ref prim = new cvf::PrimitiveSetIndexedUInt( cvf::PT_LINES ); + cvf::ref indices = cvf::StructGridGeometryGenerator::lineIndicesFromQuadVertexArray( m_vertices.p() ); + + cvf::ref prim = new cvf::PrimitiveSetIndexedUInt( cvf::PT_LINES ); prim->setIndices( indices.p() ); geo->addPrimitiveSet( prim.p() ); @@ -96,7 +97,7 @@ cvf::ref RivFaultGeometryGenerator::createOutlineMeshDrawable( cvf::OutlineEdgeExtractor ee( creaseAngle, *m_vertices ); - cvf::ref indices = lineIndicesFromQuadVertexArray( m_vertices.p() ); + cvf::ref indices = cvf::StructGridGeometryGenerator::lineIndicesFromQuadVertexArray( m_vertices.p() ); ee.addPrimitives( 4, *indices ); cvf::ref lineIndices = ee.lineIndices(); @@ -115,37 +116,6 @@ cvf::ref RivFaultGeometryGenerator::createOutlineMeshDrawable( return geo; } -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -cvf::ref RivFaultGeometryGenerator::lineIndicesFromQuadVertexArray( const cvf::Vec3fArray* vertexArray ) -{ - CVF_ASSERT( vertexArray ); - - size_t numVertices = vertexArray->size(); - int numQuads = static_cast( numVertices / 4 ); - CVF_ASSERT( numVertices % 4 == 0 ); - - cvf::ref indices = new cvf::UIntArray; - indices->resize( numQuads * 8 ); - -#pragma omp parallel for - for ( int i = 0; i < numQuads; i++ ) - { - int idx = 8 * i; - indices->set( idx + 0, i * 4 + 0 ); - indices->set( idx + 1, i * 4 + 1 ); - indices->set( idx + 2, i * 4 + 1 ); - indices->set( idx + 3, i * 4 + 2 ); - indices->set( idx + 4, i * 4 + 2 ); - indices->set( idx + 5, i * 4 + 3 ); - indices->set( idx + 6, i * 4 + 3 ); - indices->set( idx + 7, i * 4 + 0 ); - } - - return indices; -} - //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationLibCode/ModelVisualization/RivFaultGeometryGenerator.h b/ApplicationLibCode/ModelVisualization/RivFaultGeometryGenerator.h index b027e1d16a..cdf24c0688 100644 --- a/ApplicationLibCode/ModelVisualization/RivFaultGeometryGenerator.h +++ b/ApplicationLibCode/ModelVisualization/RivFaultGeometryGenerator.h @@ -57,8 +57,6 @@ class RivFaultGeometryGenerator : public cvf::Object cvf::ref createMeshDrawable(); cvf::ref createOutlineMeshDrawable( double creaseAngle ); - static cvf::ref lineIndicesFromQuadVertexArray( const cvf::Vec3fArray* vertexArray ); - private: void computeArrays(); diff --git a/ApplicationLibCode/ModelVisualization/RivWellFracturePartMgr.cpp b/ApplicationLibCode/ModelVisualization/RivWellFracturePartMgr.cpp index c07e9ba601..bbc73d17ee 100644 --- a/ApplicationLibCode/ModelVisualization/RivWellFracturePartMgr.cpp +++ b/ApplicationLibCode/ModelVisualization/RivWellFracturePartMgr.cpp @@ -60,6 +60,7 @@ #include "cvfPrimitiveSetIndexedUInt.h" #include "cvfRenderStateDepth.h" #include "cvfScalarMapperContinuousLinear.h" +#include "cvfStructGridGeometryGenerator.h" #include "cvfTransform.h" #include @@ -1077,7 +1078,8 @@ cvf::ref cvf::ref stimPlanMeshGeo = new cvf::DrawableGeo; stimPlanMeshGeo->setVertexArray( stimPlanMeshVertexList ); - cvf::ref indices = RivFaultGeometryGenerator::lineIndicesFromQuadVertexArray( stimPlanMeshVertexList ); + cvf::ref indices = + cvf::StructGridGeometryGenerator::lineIndicesFromQuadVertexArray( stimPlanMeshVertexList ); cvf::ref prim = new cvf::PrimitiveSetIndexedUInt( cvf::PT_LINES ); prim->setIndices( indices.p() ); diff --git a/Fwk/AppFwk/CommonCode/cvfStructGridGeometryGenerator.cpp b/Fwk/AppFwk/CommonCode/cvfStructGridGeometryGenerator.cpp index 1aa7c68ef4..062de40632 100644 --- a/Fwk/AppFwk/CommonCode/cvfStructGridGeometryGenerator.cpp +++ b/Fwk/AppFwk/CommonCode/cvfStructGridGeometryGenerator.cpp @@ -324,12 +324,12 @@ ref StructGridGeometryGenerator::lineIndicesFromQuadVertexArray( cons CVF_ASSERT( numVertices % 4 == 0 ); ref indices = new UIntArray; - indices->resize( numQuads * 8 ); + indices->resize( (size_t)numQuads * 8 ); #pragma omp parallel for for ( int i = 0; i < numQuads; i++ ) { - int idx = 8 * i; + size_t idx = (size_t)i * 8; indices->set( idx + 0, i * 4 + 0 ); indices->set( idx + 1, i * 4 + 1 ); indices->set( idx + 2, i * 4 + 1 ); diff --git a/Fwk/AppFwk/CommonCode/cvfStructGridGeometryGenerator.h b/Fwk/AppFwk/CommonCode/cvfStructGridGeometryGenerator.h index 6dcb3e22c6..b5cb0ccc78 100644 --- a/Fwk/AppFwk/CommonCode/cvfStructGridGeometryGenerator.h +++ b/Fwk/AppFwk/CommonCode/cvfStructGridGeometryGenerator.h @@ -200,10 +200,10 @@ class StructGridGeometryGenerator : public Object static ref createMeshDrawableFromSingleCell( const StructGridInterface* grid, size_t cellIndex, const cvf::Vec3d& displayModelOffset ); + static ref lineIndicesFromQuadVertexArray( const Vec3fArray* vertexArray ); private: - static ref lineIndicesFromQuadVertexArray( const Vec3fArray* vertexArray ); - bool isCellFaceVisible( size_t i, size_t j, size_t k, StructGridInterface::FaceType face ) const; + bool isCellFaceVisible( size_t i, size_t j, size_t k, StructGridInterface::FaceType face ) const; void computeArrays(); diff --git a/Fwk/AppFwk/cafVizExtensions/cafBoxManipulatorGeometryGenerator.cpp b/Fwk/AppFwk/cafVizExtensions/cafBoxManipulatorGeometryGenerator.cpp index c0734c9b21..329afc22de 100644 --- a/Fwk/AppFwk/cafVizExtensions/cafBoxManipulatorGeometryGenerator.cpp +++ b/Fwk/AppFwk/cafVizExtensions/cafBoxManipulatorGeometryGenerator.cpp @@ -5,6 +5,7 @@ #include "cvfDrawableGeo.h" #include "cvfGeometryBuilderFaceList.h" #include "cvfPrimitiveSetIndexedUInt.h" +#include "cvfStructGridGeometryGenerator.h" using namespace cvf; @@ -59,8 +60,9 @@ cvf::ref BoxManipulatorGeometryGenerator::createBoundingBoxMes cvf::ref geo = new cvf::DrawableGeo; geo->setVertexArray( m_vertices.p() ); - cvf::ref indices = lineIndicesFromQuadVertexArray( m_vertices.p() ); - cvf::ref prim = new cvf::PrimitiveSetIndexedUInt( cvf::PT_LINES ); + cvf::ref indices = cvf::StructGridGeometryGenerator::lineIndicesFromQuadVertexArray( m_vertices.p() ); + + cvf::ref prim = new cvf::PrimitiveSetIndexedUInt( cvf::PT_LINES ); prim->setIndices( indices.p() ); geo->addPrimitiveSet( prim.p() ); @@ -88,35 +90,4 @@ void BoxManipulatorGeometryGenerator::calculateArrays() // TODO: Rotate generated vertices } -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -cvf::ref BoxManipulatorGeometryGenerator::lineIndicesFromQuadVertexArray( const cvf::Vec3fArray* vertexArray ) -{ - CVF_ASSERT( vertexArray ); - - size_t numVertices = vertexArray->size(); - int numQuads = static_cast( numVertices / 4 ); - CVF_ASSERT( numVertices % 4 == 0 ); - - cvf::ref indices = new cvf::UIntArray; - indices->resize( numQuads * 8 ); - -#pragma omp parallel for - for ( int i = 0; i < numQuads; i++ ) - { - int idx = 8 * i; - indices->set( idx + 0, i * 4 + 0 ); - indices->set( idx + 1, i * 4 + 1 ); - indices->set( idx + 2, i * 4 + 1 ); - indices->set( idx + 3, i * 4 + 2 ); - indices->set( idx + 4, i * 4 + 2 ); - indices->set( idx + 5, i * 4 + 3 ); - indices->set( idx + 6, i * 4 + 3 ); - indices->set( idx + 7, i * 4 + 0 ); - } - - return indices; -} - } // namespace caf diff --git a/Fwk/AppFwk/cafVizExtensions/cafBoxManipulatorGeometryGenerator.h b/Fwk/AppFwk/cafVizExtensions/cafBoxManipulatorGeometryGenerator.h index ae1f0f5a66..53bd363ef0 100644 --- a/Fwk/AppFwk/cafVizExtensions/cafBoxManipulatorGeometryGenerator.h +++ b/Fwk/AppFwk/cafVizExtensions/cafBoxManipulatorGeometryGenerator.h @@ -32,8 +32,6 @@ class BoxManipulatorGeometryGenerator : public cvf::Object private: void calculateArrays(); - static cvf::ref lineIndicesFromQuadVertexArray( const cvf::Vec3fArray* vertexArray ); - private: cvf::Vec3d m_origin; cvf::Vec3d m_size; From 117d2017037ca04989d2a7baf0d0b53d19924a4d Mon Sep 17 00:00:00 2001 From: Kristian Bendiksen Date: Fri, 10 Sep 2021 14:54:46 +0200 Subject: [PATCH 114/308] #7963 Ensemble Fracture Statistics: add progress bar. (#7985) Also avoid recalculating the statistics for each added file. --- .../RicImportEnsembleFractureStatisticsFeature.cpp | 10 ++++++++++ .../Completions/RimEnsembleFractureStatistics.cpp | 5 +++-- .../RigEnsembleFractureStatisticsCalculator.cpp | 11 +++++++++++ .../RigEnsembleFractureStatisticsCalculator.h | 4 ++++ 4 files changed, 28 insertions(+), 2 deletions(-) diff --git a/ApplicationLibCode/Commands/CompletionCommands/RicImportEnsembleFractureStatisticsFeature.cpp b/ApplicationLibCode/Commands/CompletionCommands/RicImportEnsembleFractureStatisticsFeature.cpp index 64428dbbbc..62e2560bd8 100644 --- a/ApplicationLibCode/Commands/CompletionCommands/RicImportEnsembleFractureStatisticsFeature.cpp +++ b/ApplicationLibCode/Commands/CompletionCommands/RicImportEnsembleFractureStatisticsFeature.cpp @@ -28,6 +28,8 @@ #include "RimOilField.h" #include "RimProject.h" +#include "cafProgressInfo.h" + #include #include @@ -72,11 +74,19 @@ void RicImportEnsembleFractureStatisticsFeature::onActionTriggered( bool isCheck auto fractureGroupStatistics = new RimEnsembleFractureStatistics; fractureGroupStatistics->setName( "Ensemble Fracture Statistics" ); + caf::ProgressInfo progInfo( fileNames.size() + 1, "Creating Ensemble Fracture Statistics" ); + for ( auto f : fileNames ) { + auto task = progInfo.task( "Loading files", 1 ); fractureGroupStatistics->addFilePath( f ); } + { + auto task = progInfo.task( "Generating statistics", 1 ); + fractureGroupStatistics->loadAndUpdateData(); + } + fractureGroupStatisticsCollection->addFractureGroupStatistics( fractureGroupStatistics ); fractureGroupStatisticsCollection->updateConnectedEditors(); diff --git a/ApplicationLibCode/ProjectDataModel/Completions/RimEnsembleFractureStatistics.cpp b/ApplicationLibCode/ProjectDataModel/Completions/RimEnsembleFractureStatistics.cpp index 92e8e2be1a..bd0beeaaf9 100644 --- a/ApplicationLibCode/ProjectDataModel/Completions/RimEnsembleFractureStatistics.cpp +++ b/ApplicationLibCode/ProjectDataModel/Completions/RimEnsembleFractureStatistics.cpp @@ -170,7 +170,6 @@ RimEnsembleFractureStatistics::~RimEnsembleFractureStatistics() void RimEnsembleFractureStatistics::addFilePath( const QString& filePath ) { m_filePaths.v().push_back( filePath ); - loadAndUpdateData(); } //-------------------------------------------------------------------------------------------------- @@ -1162,7 +1161,9 @@ QString RimEnsembleFractureStatistics::generateStatisticsTable( QString name = caf::AppEnum::uiText( propertyType ); int numBins = 50; RigHistogramData histogramData = - RigEnsembleFractureStatisticsCalculator::createStatisticsData( this, propertyType, numBins ); + RigEnsembleFractureStatisticsCalculator::createStatisticsData( stimPlanFractureDefinitions, + propertyType, + numBins ); text += QString( "" "%1" diff --git a/ApplicationLibCode/ReservoirDataModel/RigEnsembleFractureStatisticsCalculator.cpp b/ApplicationLibCode/ReservoirDataModel/RigEnsembleFractureStatisticsCalculator.cpp index 4d3d0666b9..a2747c16d0 100644 --- a/ApplicationLibCode/ReservoirDataModel/RigEnsembleFractureStatisticsCalculator.cpp +++ b/ApplicationLibCode/ReservoirDataModel/RigEnsembleFractureStatisticsCalculator.cpp @@ -63,6 +63,17 @@ RigHistogramData RigEnsembleFractureStatisticsCalculator::createStatisticsData( { std::vector> defs = esf->readFractureDefinitions(); + return createStatisticsData( defs, propertyType, numBins ); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RigHistogramData RigEnsembleFractureStatisticsCalculator::createStatisticsData( + const std::vector>& defs, + PropertyType propertyType, + int numBins ) +{ std::vector samples; if ( propertyType == PropertyType::HEIGHT ) { diff --git a/ApplicationLibCode/ReservoirDataModel/RigEnsembleFractureStatisticsCalculator.h b/ApplicationLibCode/ReservoirDataModel/RigEnsembleFractureStatisticsCalculator.h index 9972d7839d..0fab640daf 100644 --- a/ApplicationLibCode/ReservoirDataModel/RigEnsembleFractureStatisticsCalculator.h +++ b/ApplicationLibCode/ReservoirDataModel/RigEnsembleFractureStatisticsCalculator.h @@ -52,6 +52,10 @@ class RigEnsembleFractureStatisticsCalculator static RigHistogramData createStatisticsData( const RimEnsembleFractureStatistics* esf, PropertyType propertyType, int numBins ); + static RigHistogramData createStatisticsData( const std::vector>& defs, + PropertyType propertyType, + int numBins ); + private: static std::vector calculateGridStatistics( const std::vector>& defs, double( func )( cvf::cref ) ); From dab22c4716a2f95a41bbcc7f261a1f88b4ebf226 Mon Sep 17 00:00:00 2001 From: Kristian Bendiksen Date: Mon, 13 Sep 2021 08:42:04 +0200 Subject: [PATCH 115/308] #7986 Ensemble Fracture Statistics: block negative number of cells. (#7991) --- .../RimEnsembleFractureStatistics.cpp | 22 ++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/ApplicationLibCode/ProjectDataModel/Completions/RimEnsembleFractureStatistics.cpp b/ApplicationLibCode/ProjectDataModel/Completions/RimEnsembleFractureStatistics.cpp index bd0beeaaf9..6c71d2c2df 100644 --- a/ApplicationLibCode/ProjectDataModel/Completions/RimEnsembleFractureStatistics.cpp +++ b/ApplicationLibCode/ProjectDataModel/Completions/RimEnsembleFractureStatistics.cpp @@ -45,6 +45,7 @@ #include "FractureCommands/RicNewStimPlanFractureTemplateFeature.h" #include "cafAppEnum.h" +#include "cafPdmUiLineEditor.h" #include "cafPdmUiTextEditor.h" #include "cafPdmUiToolButtonEditor.h" #include "cafPdmUiTreeSelectionEditor.h" @@ -53,6 +54,7 @@ #include #include +#include namespace caf { @@ -244,6 +246,16 @@ void RimEnsembleFractureStatistics::defineEditorAttribute( const caf::PdmFieldHa myAttr->textMode = caf::PdmUiTextEditorAttribute::HTML; } } + else if ( field == &m_adaptiveNumLayers || field == &m_numSamplesX || field == &m_numSamplesY ) + { + caf::PdmUiLineEditorAttribute* lineEditorAttr = dynamic_cast( attribute ); + if ( lineEditorAttr ) + { + // Positive integer + QIntValidator* validator = new QIntValidator( 1, std::numeric_limits::max(), nullptr ); + lineEditorAttr->validator = validator; + } + } } //-------------------------------------------------------------------------------------------------- @@ -601,6 +613,9 @@ void RimEnsembleFractureStatistics::generateUniformMesh( double mi std::vector& gridXs, std::vector& gridYs ) const { + CAF_ASSERT( m_numSamplesX > 0 ); + CAF_ASSERT( m_numSamplesY > 0 ); + int numSamplesX = m_numSamplesX(); double sampleDistanceX = linearSampling( minX, maxX, numSamplesX, gridXs ); @@ -862,7 +877,11 @@ void RimEnsembleFractureStatistics::generateAllLayers( int RimEnsembleFractureStatistics::getTargetNumberOfLayers( const std::vector>& stimPlanFractureDefinitions ) const { - if ( m_adaptiveNumLayersType() == AdaptiveNumLayersType::USER_DEFINED ) return m_adaptiveNumLayers(); + if ( m_adaptiveNumLayersType() == AdaptiveNumLayersType::USER_DEFINED ) + { + CAF_ASSERT( m_adaptiveNumLayers() > 0 ); + return m_adaptiveNumLayers(); + } int maxNy = 0; int minNy = std::numeric_limits::max(); @@ -894,6 +913,7 @@ double RimEnsembleFractureStatistics::linearSampling( double minVa int numSamples, std::vector& samples ) { + CAF_ASSERT( numSamples > 0 ); double sampleDistance = ( maxValue - minValue ) / numSamples; for ( int s = 0; s < numSamples; s++ ) From c7917915cd39031500839f0418975982478cacde Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Fri, 10 Sep 2021 16:39:50 +0200 Subject: [PATCH 116/308] #7912 Summary Data Import : Add fmt to ThirdParty --- ThirdParty/custom-opm-common/CMakeLists.txt | 3 + ThirdParty/fmtlib/LICENSE.rst | 27 + ThirdParty/fmtlib/README.opm | 12 + ThirdParty/fmtlib/include/fmt/chrono.h | 1123 ++++++ ThirdParty/fmtlib/include/fmt/color.h | 566 +++ ThirdParty/fmtlib/include/fmt/compile.h | 665 ++++ ThirdParty/fmtlib/include/fmt/core.h | 1882 ++++++++++ ThirdParty/fmtlib/include/fmt/format-inl.h | 1453 ++++++++ ThirdParty/fmtlib/include/fmt/format.h | 3729 +++++++++++++++++++ ThirdParty/fmtlib/include/fmt/locale.h | 78 + ThirdParty/fmtlib/include/fmt/os.h | 450 +++ ThirdParty/fmtlib/include/fmt/ostream.h | 167 + ThirdParty/fmtlib/include/fmt/posix.h | 2 + ThirdParty/fmtlib/include/fmt/printf.h | 751 ++++ ThirdParty/fmtlib/include/fmt/ranges.h | 386 ++ 15 files changed, 11294 insertions(+) create mode 100644 ThirdParty/fmtlib/LICENSE.rst create mode 100644 ThirdParty/fmtlib/README.opm create mode 100644 ThirdParty/fmtlib/include/fmt/chrono.h create mode 100644 ThirdParty/fmtlib/include/fmt/color.h create mode 100644 ThirdParty/fmtlib/include/fmt/compile.h create mode 100644 ThirdParty/fmtlib/include/fmt/core.h create mode 100644 ThirdParty/fmtlib/include/fmt/format-inl.h create mode 100644 ThirdParty/fmtlib/include/fmt/format.h create mode 100644 ThirdParty/fmtlib/include/fmt/locale.h create mode 100644 ThirdParty/fmtlib/include/fmt/os.h create mode 100644 ThirdParty/fmtlib/include/fmt/ostream.h create mode 100644 ThirdParty/fmtlib/include/fmt/posix.h create mode 100644 ThirdParty/fmtlib/include/fmt/printf.h create mode 100644 ThirdParty/fmtlib/include/fmt/ranges.h diff --git a/ThirdParty/custom-opm-common/CMakeLists.txt b/ThirdParty/custom-opm-common/CMakeLists.txt index c97e496d2e..a1500244f3 100644 --- a/ThirdParty/custom-opm-common/CMakeLists.txt +++ b/ThirdParty/custom-opm-common/CMakeLists.txt @@ -30,6 +30,9 @@ include_directories( generated-opm-common/include ) + add_definitions(-DFMT_HEADER_ONLY) + include_directories(SYSTEM ../fmtlib/include) + # Set defines to include requred files set(ENABLE_ECL_INPUT true) #set(ENABLE_ECL_OUTPUT true) diff --git a/ThirdParty/fmtlib/LICENSE.rst b/ThirdParty/fmtlib/LICENSE.rst new file mode 100644 index 0000000000..f0ec3db4d2 --- /dev/null +++ b/ThirdParty/fmtlib/LICENSE.rst @@ -0,0 +1,27 @@ +Copyright (c) 2012 - present, Victor Zverovich + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +--- Optional exception to the license --- + +As an exception, if, as a result of your compiling your source code, portions +of this Software are embedded into a machine-executable object form of such +source code, you may redistribute such embedded portions in such object form +without including the above copyright and permission notices. diff --git a/ThirdParty/fmtlib/README.opm b/ThirdParty/fmtlib/README.opm new file mode 100644 index 0000000000..ee971f32c9 --- /dev/null +++ b/ThirdParty/fmtlib/README.opm @@ -0,0 +1,12 @@ +The include/ directory is a copy of the include directory from version 7.0.3 of +the fmtlib distribution. The fmtlib can be found at https://github.com/fmtlib/fmt + +The fmtlib code embedded here should be compiled in header only mode, to ensure +that the symbol FMT_HEADER_ONLY must be defined before the the fmt/format.h +header is included: + + #define FMT_HEADER_ONLY + #include + + .... + auto msg = fmt::format("Hello {}", "world"); \ No newline at end of file diff --git a/ThirdParty/fmtlib/include/fmt/chrono.h b/ThirdParty/fmtlib/include/fmt/chrono.h new file mode 100644 index 0000000000..e70b8053a6 --- /dev/null +++ b/ThirdParty/fmtlib/include/fmt/chrono.h @@ -0,0 +1,1123 @@ +// Formatting library for C++ - chrono support +// +// Copyright (c) 2012 - present, Victor Zverovich +// All rights reserved. +// +// For the license information refer to format.h. + +#ifndef FMT_CHRONO_H_ +#define FMT_CHRONO_H_ + +#include +#include +#include +#include + +#include "format.h" +#include "locale.h" + +FMT_BEGIN_NAMESPACE + +// Enable safe chrono durations, unless explicitly disabled. +#ifndef FMT_SAFE_DURATION_CAST +# define FMT_SAFE_DURATION_CAST 1 +#endif +#if FMT_SAFE_DURATION_CAST + +// For conversion between std::chrono::durations without undefined +// behaviour or erroneous results. +// This is a stripped down version of duration_cast, for inclusion in fmt. +// See https://github.com/pauldreik/safe_duration_cast +// +// Copyright Paul Dreik 2019 +namespace safe_duration_cast { + +template ::value && + std::numeric_limits::is_signed == + std::numeric_limits::is_signed)> +FMT_CONSTEXPR To lossless_integral_conversion(const From from, int& ec) { + ec = 0; + using F = std::numeric_limits; + using T = std::numeric_limits; + static_assert(F::is_integer, "From must be integral"); + static_assert(T::is_integer, "To must be integral"); + + // A and B are both signed, or both unsigned. + if (F::digits <= T::digits) { + // From fits in To without any problem. + } else { + // From does not always fit in To, resort to a dynamic check. + if (from < (T::min)() || from > (T::max)()) { + // outside range. + ec = 1; + return {}; + } + } + return static_cast(from); +} + +/** + * converts From to To, without loss. If the dynamic value of from + * can't be converted to To without loss, ec is set. + */ +template ::value && + std::numeric_limits::is_signed != + std::numeric_limits::is_signed)> +FMT_CONSTEXPR To lossless_integral_conversion(const From from, int& ec) { + ec = 0; + using F = std::numeric_limits; + using T = std::numeric_limits; + static_assert(F::is_integer, "From must be integral"); + static_assert(T::is_integer, "To must be integral"); + + if (F::is_signed && !T::is_signed) { + // From may be negative, not allowed! + if (fmt::detail::is_negative(from)) { + ec = 1; + return {}; + } + + // From is positive. Can it always fit in To? + if (F::digits <= T::digits) { + // yes, From always fits in To. + } else { + // from may not fit in To, we have to do a dynamic check + if (from > static_cast((T::max)())) { + ec = 1; + return {}; + } + } + } + + if (!F::is_signed && T::is_signed) { + // can from be held in To? + if (F::digits < T::digits) { + // yes, From always fits in To. + } else { + // from may not fit in To, we have to do a dynamic check + if (from > static_cast((T::max)())) { + // outside range. + ec = 1; + return {}; + } + } + } + + // reaching here means all is ok for lossless conversion. + return static_cast(from); + +} // function + +template ::value)> +FMT_CONSTEXPR To lossless_integral_conversion(const From from, int& ec) { + ec = 0; + return from; +} // function + +// clang-format off +/** + * converts From to To if possible, otherwise ec is set. + * + * input | output + * ---------------------------------|--------------- + * NaN | NaN + * Inf | Inf + * normal, fits in output | converted (possibly lossy) + * normal, does not fit in output | ec is set + * subnormal | best effort + * -Inf | -Inf + */ +// clang-format on +template ::value)> +FMT_CONSTEXPR To safe_float_conversion(const From from, int& ec) { + ec = 0; + using T = std::numeric_limits; + static_assert(std::is_floating_point::value, "From must be floating"); + static_assert(std::is_floating_point::value, "To must be floating"); + + // catch the only happy case + if (std::isfinite(from)) { + if (from >= T::lowest() && from <= (T::max)()) { + return static_cast(from); + } + // not within range. + ec = 1; + return {}; + } + + // nan and inf will be preserved + return static_cast(from); +} // function + +template ::value)> +FMT_CONSTEXPR To safe_float_conversion(const From from, int& ec) { + ec = 0; + static_assert(std::is_floating_point::value, "From must be floating"); + return from; +} + +/** + * safe duration cast between integral durations + */ +template ::value), + FMT_ENABLE_IF(std::is_integral::value)> +To safe_duration_cast(std::chrono::duration from, + int& ec) { + using From = std::chrono::duration; + ec = 0; + // the basic idea is that we need to convert from count() in the from type + // to count() in the To type, by multiplying it with this: + struct Factor + : std::ratio_divide {}; + + static_assert(Factor::num > 0, "num must be positive"); + static_assert(Factor::den > 0, "den must be positive"); + + // the conversion is like this: multiply from.count() with Factor::num + // /Factor::den and convert it to To::rep, all this without + // overflow/underflow. let's start by finding a suitable type that can hold + // both To, From and Factor::num + using IntermediateRep = + typename std::common_type::type; + + // safe conversion to IntermediateRep + IntermediateRep count = + lossless_integral_conversion(from.count(), ec); + if (ec) { + return {}; + } + // multiply with Factor::num without overflow or underflow + if (Factor::num != 1) { + const auto max1 = detail::max_value() / Factor::num; + if (count > max1) { + ec = 1; + return {}; + } + const auto min1 = + (std::numeric_limits::min)() / Factor::num; + if (count < min1) { + ec = 1; + return {}; + } + count *= Factor::num; + } + + // this can't go wrong, right? den>0 is checked earlier. + if (Factor::den != 1) { + count /= Factor::den; + } + // convert to the to type, safely + using ToRep = typename To::rep; + const ToRep tocount = lossless_integral_conversion(count, ec); + if (ec) { + return {}; + } + return To{tocount}; +} + +/** + * safe duration_cast between floating point durations + */ +template ::value), + FMT_ENABLE_IF(std::is_floating_point::value)> +To safe_duration_cast(std::chrono::duration from, + int& ec) { + using From = std::chrono::duration; + ec = 0; + if (std::isnan(from.count())) { + // nan in, gives nan out. easy. + return To{std::numeric_limits::quiet_NaN()}; + } + // maybe we should also check if from is denormal, and decide what to do about + // it. + + // +-inf should be preserved. + if (std::isinf(from.count())) { + return To{from.count()}; + } + + // the basic idea is that we need to convert from count() in the from type + // to count() in the To type, by multiplying it with this: + struct Factor + : std::ratio_divide {}; + + static_assert(Factor::num > 0, "num must be positive"); + static_assert(Factor::den > 0, "den must be positive"); + + // the conversion is like this: multiply from.count() with Factor::num + // /Factor::den and convert it to To::rep, all this without + // overflow/underflow. let's start by finding a suitable type that can hold + // both To, From and Factor::num + using IntermediateRep = + typename std::common_type::type; + + // force conversion of From::rep -> IntermediateRep to be safe, + // even if it will never happen be narrowing in this context. + IntermediateRep count = + safe_float_conversion(from.count(), ec); + if (ec) { + return {}; + } + + // multiply with Factor::num without overflow or underflow + if (Factor::num != 1) { + constexpr auto max1 = detail::max_value() / + static_cast(Factor::num); + if (count > max1) { + ec = 1; + return {}; + } + constexpr auto min1 = std::numeric_limits::lowest() / + static_cast(Factor::num); + if (count < min1) { + ec = 1; + return {}; + } + count *= static_cast(Factor::num); + } + + // this can't go wrong, right? den>0 is checked earlier. + if (Factor::den != 1) { + using common_t = typename std::common_type::type; + count /= static_cast(Factor::den); + } + + // convert to the to type, safely + using ToRep = typename To::rep; + + const ToRep tocount = safe_float_conversion(count, ec); + if (ec) { + return {}; + } + return To{tocount}; +} +} // namespace safe_duration_cast +#endif + +// Prevents expansion of a preceding token as a function-style macro. +// Usage: f FMT_NOMACRO() +#define FMT_NOMACRO + +namespace detail { +inline null<> localtime_r FMT_NOMACRO(...) { return null<>(); } +inline null<> localtime_s(...) { return null<>(); } +inline null<> gmtime_r(...) { return null<>(); } +inline null<> gmtime_s(...) { return null<>(); } +} // namespace detail + +// Thread-safe replacement for std::localtime +inline std::tm localtime(std::time_t time) { + struct dispatcher { + std::time_t time_; + std::tm tm_; + + dispatcher(std::time_t t) : time_(t) {} + + bool run() { + using namespace fmt::detail; + return handle(localtime_r(&time_, &tm_)); + } + + bool handle(std::tm* tm) { return tm != nullptr; } + + bool handle(detail::null<>) { + using namespace fmt::detail; + return fallback(localtime_s(&tm_, &time_)); + } + + bool fallback(int res) { return res == 0; } + +#if !FMT_MSC_VER + bool fallback(detail::null<>) { + using namespace fmt::detail; + std::tm* tm = std::localtime(&time_); + if (tm) tm_ = *tm; + return tm != nullptr; + } +#endif + }; + dispatcher lt(time); + // Too big time values may be unsupported. + if (!lt.run()) FMT_THROW(format_error("time_t value out of range")); + return lt.tm_; +} + +// Thread-safe replacement for std::gmtime +inline std::tm gmtime(std::time_t time) { + struct dispatcher { + std::time_t time_; + std::tm tm_; + + dispatcher(std::time_t t) : time_(t) {} + + bool run() { + using namespace fmt::detail; + return handle(gmtime_r(&time_, &tm_)); + } + + bool handle(std::tm* tm) { return tm != nullptr; } + + bool handle(detail::null<>) { + using namespace fmt::detail; + return fallback(gmtime_s(&tm_, &time_)); + } + + bool fallback(int res) { return res == 0; } + +#if !FMT_MSC_VER + bool fallback(detail::null<>) { + std::tm* tm = std::gmtime(&time_); + if (tm) tm_ = *tm; + return tm != nullptr; + } +#endif + }; + dispatcher gt(time); + // Too big time values may be unsupported. + if (!gt.run()) FMT_THROW(format_error("time_t value out of range")); + return gt.tm_; +} + +namespace detail { +inline size_t strftime(char* str, size_t count, const char* format, + const std::tm* time) { + return std::strftime(str, count, format, time); +} + +inline size_t strftime(wchar_t* str, size_t count, const wchar_t* format, + const std::tm* time) { + return std::wcsftime(str, count, format, time); +} +} // namespace detail + +template struct formatter { + template + auto parse(ParseContext& ctx) -> decltype(ctx.begin()) { + auto it = ctx.begin(); + if (it != ctx.end() && *it == ':') ++it; + auto end = it; + while (end != ctx.end() && *end != '}') ++end; + tm_format.reserve(detail::to_unsigned(end - it + 1)); + tm_format.append(it, end); + tm_format.push_back('\0'); + return end; + } + + template + auto format(const std::tm& tm, FormatContext& ctx) -> decltype(ctx.out()) { + basic_memory_buffer buf; + size_t start = buf.size(); + for (;;) { + size_t size = buf.capacity() - start; + size_t count = detail::strftime(&buf[start], size, &tm_format[0], &tm); + if (count != 0) { + buf.resize(start + count); + break; + } + if (size >= tm_format.size() * 256) { + // If the buffer is 256 times larger than the format string, assume + // that `strftime` gives an empty result. There doesn't seem to be a + // better way to distinguish the two cases: + // https://github.com/fmtlib/fmt/issues/367 + break; + } + const size_t MIN_GROWTH = 10; + buf.reserve(buf.capacity() + (size > MIN_GROWTH ? size : MIN_GROWTH)); + } + return std::copy(buf.begin(), buf.end(), ctx.out()); + } + + basic_memory_buffer tm_format; +}; + +namespace detail { +template FMT_CONSTEXPR const char* get_units() { + return nullptr; +} +template <> FMT_CONSTEXPR const char* get_units() { return "as"; } +template <> FMT_CONSTEXPR const char* get_units() { return "fs"; } +template <> FMT_CONSTEXPR const char* get_units() { return "ps"; } +template <> FMT_CONSTEXPR const char* get_units() { return "ns"; } +template <> FMT_CONSTEXPR const char* get_units() { return "µs"; } +template <> FMT_CONSTEXPR const char* get_units() { return "ms"; } +template <> FMT_CONSTEXPR const char* get_units() { return "cs"; } +template <> FMT_CONSTEXPR const char* get_units() { return "ds"; } +template <> FMT_CONSTEXPR const char* get_units>() { return "s"; } +template <> FMT_CONSTEXPR const char* get_units() { return "das"; } +template <> FMT_CONSTEXPR const char* get_units() { return "hs"; } +template <> FMT_CONSTEXPR const char* get_units() { return "ks"; } +template <> FMT_CONSTEXPR const char* get_units() { return "Ms"; } +template <> FMT_CONSTEXPR const char* get_units() { return "Gs"; } +template <> FMT_CONSTEXPR const char* get_units() { return "Ts"; } +template <> FMT_CONSTEXPR const char* get_units() { return "Ps"; } +template <> FMT_CONSTEXPR const char* get_units() { return "Es"; } +template <> FMT_CONSTEXPR const char* get_units>() { + return "m"; +} +template <> FMT_CONSTEXPR const char* get_units>() { + return "h"; +} + +enum class numeric_system { + standard, + // Alternative numeric system, e.g. 十二 instead of 12 in ja_JP locale. + alternative +}; + +// Parses a put_time-like format string and invokes handler actions. +template +FMT_CONSTEXPR const Char* parse_chrono_format(const Char* begin, + const Char* end, + Handler&& handler) { + auto ptr = begin; + while (ptr != end) { + auto c = *ptr; + if (c == '}') break; + if (c != '%') { + ++ptr; + continue; + } + if (begin != ptr) handler.on_text(begin, ptr); + ++ptr; // consume '%' + if (ptr == end) FMT_THROW(format_error("invalid format")); + c = *ptr++; + switch (c) { + case '%': + handler.on_text(ptr - 1, ptr); + break; + case 'n': { + const Char newline[] = {'\n'}; + handler.on_text(newline, newline + 1); + break; + } + case 't': { + const Char tab[] = {'\t'}; + handler.on_text(tab, tab + 1); + break; + } + // Day of the week: + case 'a': + handler.on_abbr_weekday(); + break; + case 'A': + handler.on_full_weekday(); + break; + case 'w': + handler.on_dec0_weekday(numeric_system::standard); + break; + case 'u': + handler.on_dec1_weekday(numeric_system::standard); + break; + // Month: + case 'b': + handler.on_abbr_month(); + break; + case 'B': + handler.on_full_month(); + break; + // Hour, minute, second: + case 'H': + handler.on_24_hour(numeric_system::standard); + break; + case 'I': + handler.on_12_hour(numeric_system::standard); + break; + case 'M': + handler.on_minute(numeric_system::standard); + break; + case 'S': + handler.on_second(numeric_system::standard); + break; + // Other: + case 'c': + handler.on_datetime(numeric_system::standard); + break; + case 'x': + handler.on_loc_date(numeric_system::standard); + break; + case 'X': + handler.on_loc_time(numeric_system::standard); + break; + case 'D': + handler.on_us_date(); + break; + case 'F': + handler.on_iso_date(); + break; + case 'r': + handler.on_12_hour_time(); + break; + case 'R': + handler.on_24_hour_time(); + break; + case 'T': + handler.on_iso_time(); + break; + case 'p': + handler.on_am_pm(); + break; + case 'Q': + handler.on_duration_value(); + break; + case 'q': + handler.on_duration_unit(); + break; + case 'z': + handler.on_utc_offset(); + break; + case 'Z': + handler.on_tz_name(); + break; + // Alternative representation: + case 'E': { + if (ptr == end) FMT_THROW(format_error("invalid format")); + c = *ptr++; + switch (c) { + case 'c': + handler.on_datetime(numeric_system::alternative); + break; + case 'x': + handler.on_loc_date(numeric_system::alternative); + break; + case 'X': + handler.on_loc_time(numeric_system::alternative); + break; + default: + FMT_THROW(format_error("invalid format")); + } + break; + } + case 'O': + if (ptr == end) FMT_THROW(format_error("invalid format")); + c = *ptr++; + switch (c) { + case 'w': + handler.on_dec0_weekday(numeric_system::alternative); + break; + case 'u': + handler.on_dec1_weekday(numeric_system::alternative); + break; + case 'H': + handler.on_24_hour(numeric_system::alternative); + break; + case 'I': + handler.on_12_hour(numeric_system::alternative); + break; + case 'M': + handler.on_minute(numeric_system::alternative); + break; + case 'S': + handler.on_second(numeric_system::alternative); + break; + default: + FMT_THROW(format_error("invalid format")); + } + break; + default: + FMT_THROW(format_error("invalid format")); + } + begin = ptr; + } + if (begin != ptr) handler.on_text(begin, ptr); + return ptr; +} + +struct chrono_format_checker { + FMT_NORETURN void report_no_date() { FMT_THROW(format_error("no date")); } + + template void on_text(const Char*, const Char*) {} + FMT_NORETURN void on_abbr_weekday() { report_no_date(); } + FMT_NORETURN void on_full_weekday() { report_no_date(); } + FMT_NORETURN void on_dec0_weekday(numeric_system) { report_no_date(); } + FMT_NORETURN void on_dec1_weekday(numeric_system) { report_no_date(); } + FMT_NORETURN void on_abbr_month() { report_no_date(); } + FMT_NORETURN void on_full_month() { report_no_date(); } + void on_24_hour(numeric_system) {} + void on_12_hour(numeric_system) {} + void on_minute(numeric_system) {} + void on_second(numeric_system) {} + FMT_NORETURN void on_datetime(numeric_system) { report_no_date(); } + FMT_NORETURN void on_loc_date(numeric_system) { report_no_date(); } + FMT_NORETURN void on_loc_time(numeric_system) { report_no_date(); } + FMT_NORETURN void on_us_date() { report_no_date(); } + FMT_NORETURN void on_iso_date() { report_no_date(); } + void on_12_hour_time() {} + void on_24_hour_time() {} + void on_iso_time() {} + void on_am_pm() {} + void on_duration_value() {} + void on_duration_unit() {} + FMT_NORETURN void on_utc_offset() { report_no_date(); } + FMT_NORETURN void on_tz_name() { report_no_date(); } +}; + +template ::value)> +inline bool isnan(T) { + return false; +} +template ::value)> +inline bool isnan(T value) { + return std::isnan(value); +} + +template ::value)> +inline bool isfinite(T) { + return true; +} +template ::value)> +inline bool isfinite(T value) { + return std::isfinite(value); +} + +// Converts value to int and checks that it's in the range [0, upper). +template ::value)> +inline int to_nonnegative_int(T value, int upper) { + FMT_ASSERT(value >= 0 && value <= upper, "invalid value"); + (void)upper; + return static_cast(value); +} +template ::value)> +inline int to_nonnegative_int(T value, int upper) { + FMT_ASSERT( + std::isnan(value) || (value >= 0 && value <= static_cast(upper)), + "invalid value"); + (void)upper; + return static_cast(value); +} + +template ::value)> +inline T mod(T x, int y) { + return x % static_cast(y); +} +template ::value)> +inline T mod(T x, int y) { + return std::fmod(x, static_cast(y)); +} + +// If T is an integral type, maps T to its unsigned counterpart, otherwise +// leaves it unchanged (unlike std::make_unsigned). +template ::value> +struct make_unsigned_or_unchanged { + using type = T; +}; + +template struct make_unsigned_or_unchanged { + using type = typename std::make_unsigned::type; +}; + +#if FMT_SAFE_DURATION_CAST +// throwing version of safe_duration_cast +template +To fmt_safe_duration_cast(std::chrono::duration from) { + int ec; + To to = safe_duration_cast::safe_duration_cast(from, ec); + if (ec) FMT_THROW(format_error("cannot format duration")); + return to; +} +#endif + +template ::value)> +inline std::chrono::duration get_milliseconds( + std::chrono::duration d) { + // this may overflow and/or the result may not fit in the + // target type. +#if FMT_SAFE_DURATION_CAST + using CommonSecondsType = + typename std::common_type::type; + const auto d_as_common = fmt_safe_duration_cast(d); + const auto d_as_whole_seconds = + fmt_safe_duration_cast(d_as_common); + // this conversion should be nonproblematic + const auto diff = d_as_common - d_as_whole_seconds; + const auto ms = + fmt_safe_duration_cast>(diff); + return ms; +#else + auto s = std::chrono::duration_cast(d); + return std::chrono::duration_cast(d - s); +#endif +} + +template ::value)> +inline std::chrono::duration get_milliseconds( + std::chrono::duration d) { + using common_type = typename std::common_type::type; + auto ms = mod(d.count() * static_cast(Period::num) / + static_cast(Period::den) * 1000, + 1000); + return std::chrono::duration(static_cast(ms)); +} + +template +OutputIt format_duration_value(OutputIt out, Rep val, int precision) { + const Char pr_f[] = {'{', ':', '.', '{', '}', 'f', '}', 0}; + if (precision >= 0) return format_to(out, pr_f, val, precision); + const Char fp_f[] = {'{', ':', 'g', '}', 0}; + const Char format[] = {'{', '}', 0}; + return format_to(out, std::is_floating_point::value ? fp_f : format, + val); +} +template +OutputIt copy_unit(string_view unit, OutputIt out, Char) { + return std::copy(unit.begin(), unit.end(), out); +} + +template +OutputIt copy_unit(string_view unit, OutputIt out, wchar_t) { + // This works when wchar_t is UTF-32 because units only contain characters + // that have the same representation in UTF-16 and UTF-32. + utf8_to_utf16 u(unit); + return std::copy(u.c_str(), u.c_str() + u.size(), out); +} + +template +OutputIt format_duration_unit(OutputIt out) { + if (const char* unit = get_units()) + return copy_unit(string_view(unit), out, Char()); + const Char num_f[] = {'[', '{', '}', ']', 's', 0}; + if (const_check(Period::den == 1)) return format_to(out, num_f, Period::num); + const Char num_def_f[] = {'[', '{', '}', '/', '{', '}', ']', 's', 0}; + return format_to(out, num_def_f, Period::num, Period::den); +} + +template +struct chrono_formatter { + FormatContext& context; + OutputIt out; + int precision; + // rep is unsigned to avoid overflow. + using rep = + conditional_t::value && sizeof(Rep) < sizeof(int), + unsigned, typename make_unsigned_or_unchanged::type>; + rep val; + using seconds = std::chrono::duration; + seconds s; + using milliseconds = std::chrono::duration; + bool negative; + + using char_type = typename FormatContext::char_type; + + explicit chrono_formatter(FormatContext& ctx, OutputIt o, + std::chrono::duration d) + : context(ctx), + out(o), + val(static_cast(d.count())), + negative(false) { + if (d.count() < 0) { + val = 0 - val; + negative = true; + } + + // this may overflow and/or the result may not fit in the + // target type. +#if FMT_SAFE_DURATION_CAST + // might need checked conversion (rep!=Rep) + auto tmpval = std::chrono::duration(val); + s = fmt_safe_duration_cast(tmpval); +#else + s = std::chrono::duration_cast( + std::chrono::duration(val)); +#endif + } + + // returns true if nan or inf, writes to out. + bool handle_nan_inf() { + if (isfinite(val)) { + return false; + } + if (isnan(val)) { + write_nan(); + return true; + } + // must be +-inf + if (val > 0) { + write_pinf(); + } else { + write_ninf(); + } + return true; + } + + Rep hour() const { return static_cast(mod((s.count() / 3600), 24)); } + + Rep hour12() const { + Rep hour = static_cast(mod((s.count() / 3600), 12)); + return hour <= 0 ? 12 : hour; + } + + Rep minute() const { return static_cast(mod((s.count() / 60), 60)); } + Rep second() const { return static_cast(mod(s.count(), 60)); } + + std::tm time() const { + auto time = std::tm(); + time.tm_hour = to_nonnegative_int(hour(), 24); + time.tm_min = to_nonnegative_int(minute(), 60); + time.tm_sec = to_nonnegative_int(second(), 60); + return time; + } + + void write_sign() { + if (negative) { + *out++ = '-'; + negative = false; + } + } + + void write(Rep value, int width) { + write_sign(); + if (isnan(value)) return write_nan(); + uint32_or_64_or_128_t n = + to_unsigned(to_nonnegative_int(value, max_value())); + int num_digits = detail::count_digits(n); + if (width > num_digits) out = std::fill_n(out, width - num_digits, '0'); + out = format_decimal(out, n, num_digits).end; + } + + void write_nan() { std::copy_n("nan", 3, out); } + void write_pinf() { std::copy_n("inf", 3, out); } + void write_ninf() { std::copy_n("-inf", 4, out); } + + void format_localized(const tm& time, char format, char modifier = 0) { + if (isnan(val)) return write_nan(); + auto locale = context.locale().template get(); + auto& facet = std::use_facet>(locale); + std::basic_ostringstream os; + os.imbue(locale); + facet.put(os, os, ' ', &time, format, modifier); + auto str = os.str(); + std::copy(str.begin(), str.end(), out); + } + + void on_text(const char_type* begin, const char_type* end) { + std::copy(begin, end, out); + } + + // These are not implemented because durations don't have date information. + void on_abbr_weekday() {} + void on_full_weekday() {} + void on_dec0_weekday(numeric_system) {} + void on_dec1_weekday(numeric_system) {} + void on_abbr_month() {} + void on_full_month() {} + void on_datetime(numeric_system) {} + void on_loc_date(numeric_system) {} + void on_loc_time(numeric_system) {} + void on_us_date() {} + void on_iso_date() {} + void on_utc_offset() {} + void on_tz_name() {} + + void on_24_hour(numeric_system ns) { + if (handle_nan_inf()) return; + + if (ns == numeric_system::standard) return write(hour(), 2); + auto time = tm(); + time.tm_hour = to_nonnegative_int(hour(), 24); + format_localized(time, 'H', 'O'); + } + + void on_12_hour(numeric_system ns) { + if (handle_nan_inf()) return; + + if (ns == numeric_system::standard) return write(hour12(), 2); + auto time = tm(); + time.tm_hour = to_nonnegative_int(hour12(), 12); + format_localized(time, 'I', 'O'); + } + + void on_minute(numeric_system ns) { + if (handle_nan_inf()) return; + + if (ns == numeric_system::standard) return write(minute(), 2); + auto time = tm(); + time.tm_min = to_nonnegative_int(minute(), 60); + format_localized(time, 'M', 'O'); + } + + void on_second(numeric_system ns) { + if (handle_nan_inf()) return; + + if (ns == numeric_system::standard) { + write(second(), 2); +#if FMT_SAFE_DURATION_CAST + // convert rep->Rep + using duration_rep = std::chrono::duration; + using duration_Rep = std::chrono::duration; + auto tmpval = fmt_safe_duration_cast(duration_rep{val}); +#else + auto tmpval = std::chrono::duration(val); +#endif + auto ms = get_milliseconds(tmpval); + if (ms != std::chrono::milliseconds(0)) { + *out++ = '.'; + write(ms.count(), 3); + } + return; + } + auto time = tm(); + time.tm_sec = to_nonnegative_int(second(), 60); + format_localized(time, 'S', 'O'); + } + + void on_12_hour_time() { + if (handle_nan_inf()) return; + format_localized(time(), 'r'); + } + + void on_24_hour_time() { + if (handle_nan_inf()) { + *out++ = ':'; + handle_nan_inf(); + return; + } + + write(hour(), 2); + *out++ = ':'; + write(minute(), 2); + } + + void on_iso_time() { + on_24_hour_time(); + *out++ = ':'; + if (handle_nan_inf()) return; + write(second(), 2); + } + + void on_am_pm() { + if (handle_nan_inf()) return; + format_localized(time(), 'p'); + } + + void on_duration_value() { + if (handle_nan_inf()) return; + write_sign(); + out = format_duration_value(out, val, precision); + } + + void on_duration_unit() { + out = format_duration_unit(out); + } +}; +} // namespace detail + +template +struct formatter, Char> { + private: + basic_format_specs specs; + int precision; + using arg_ref_type = detail::arg_ref; + arg_ref_type width_ref; + arg_ref_type precision_ref; + mutable basic_string_view format_str; + using duration = std::chrono::duration; + + struct spec_handler { + formatter& f; + basic_format_parse_context& context; + basic_string_view format_str; + + template FMT_CONSTEXPR arg_ref_type make_arg_ref(Id arg_id) { + context.check_arg_id(arg_id); + return arg_ref_type(arg_id); + } + + FMT_CONSTEXPR arg_ref_type make_arg_ref(basic_string_view arg_id) { + context.check_arg_id(arg_id); + return arg_ref_type(arg_id); + } + + FMT_CONSTEXPR arg_ref_type make_arg_ref(detail::auto_id) { + return arg_ref_type(context.next_arg_id()); + } + + void on_error(const char* msg) { FMT_THROW(format_error(msg)); } + void on_fill(basic_string_view fill) { f.specs.fill = fill; } + void on_align(align_t align) { f.specs.align = align; } + void on_width(int width) { f.specs.width = width; } + void on_precision(int _precision) { f.precision = _precision; } + void end_precision() {} + + template void on_dynamic_width(Id arg_id) { + f.width_ref = make_arg_ref(arg_id); + } + + template void on_dynamic_precision(Id arg_id) { + f.precision_ref = make_arg_ref(arg_id); + } + }; + + using iterator = typename basic_format_parse_context::iterator; + struct parse_range { + iterator begin; + iterator end; + }; + + FMT_CONSTEXPR parse_range do_parse(basic_format_parse_context& ctx) { + auto begin = ctx.begin(), end = ctx.end(); + if (begin == end || *begin == '}') return {begin, begin}; + spec_handler handler{*this, ctx, format_str}; + begin = detail::parse_align(begin, end, handler); + if (begin == end) return {begin, begin}; + begin = detail::parse_width(begin, end, handler); + if (begin == end) return {begin, begin}; + if (*begin == '.') { + if (std::is_floating_point::value) + begin = detail::parse_precision(begin, end, handler); + else + handler.on_error("precision not allowed for this argument type"); + } + end = parse_chrono_format(begin, end, detail::chrono_format_checker()); + return {begin, end}; + } + + public: + formatter() : precision(-1) {} + + FMT_CONSTEXPR auto parse(basic_format_parse_context& ctx) + -> decltype(ctx.begin()) { + auto range = do_parse(ctx); + format_str = basic_string_view( + &*range.begin, detail::to_unsigned(range.end - range.begin)); + return range.end; + } + + template + auto format(const duration& d, FormatContext& ctx) -> decltype(ctx.out()) { + auto begin = format_str.begin(), end = format_str.end(); + // As a possible future optimization, we could avoid extra copying if width + // is not specified. + basic_memory_buffer buf; + auto out = std::back_inserter(buf); + detail::handle_dynamic_spec(specs.width, width_ref, + ctx); + detail::handle_dynamic_spec(precision, + precision_ref, ctx); + if (begin == end || *begin == '}') { + out = detail::format_duration_value(out, d.count(), precision); + detail::format_duration_unit(out); + } else { + detail::chrono_formatter f( + ctx, out, d); + f.precision = precision; + parse_chrono_format(begin, end, f); + } + return detail::write( + ctx.out(), basic_string_view(buf.data(), buf.size()), specs); + } +}; + +FMT_END_NAMESPACE + +#endif // FMT_CHRONO_H_ diff --git a/ThirdParty/fmtlib/include/fmt/color.h b/ThirdParty/fmtlib/include/fmt/color.h new file mode 100644 index 0000000000..b65f892afc --- /dev/null +++ b/ThirdParty/fmtlib/include/fmt/color.h @@ -0,0 +1,566 @@ +// Formatting library for C++ - color support +// +// Copyright (c) 2018 - present, Victor Zverovich and fmt contributors +// All rights reserved. +// +// For the license information refer to format.h. + +#ifndef FMT_COLOR_H_ +#define FMT_COLOR_H_ + +#include "format.h" + +FMT_BEGIN_NAMESPACE + +enum class color : uint32_t { + alice_blue = 0xF0F8FF, // rgb(240,248,255) + antique_white = 0xFAEBD7, // rgb(250,235,215) + aqua = 0x00FFFF, // rgb(0,255,255) + aquamarine = 0x7FFFD4, // rgb(127,255,212) + azure = 0xF0FFFF, // rgb(240,255,255) + beige = 0xF5F5DC, // rgb(245,245,220) + bisque = 0xFFE4C4, // rgb(255,228,196) + black = 0x000000, // rgb(0,0,0) + blanched_almond = 0xFFEBCD, // rgb(255,235,205) + blue = 0x0000FF, // rgb(0,0,255) + blue_violet = 0x8A2BE2, // rgb(138,43,226) + brown = 0xA52A2A, // rgb(165,42,42) + burly_wood = 0xDEB887, // rgb(222,184,135) + cadet_blue = 0x5F9EA0, // rgb(95,158,160) + chartreuse = 0x7FFF00, // rgb(127,255,0) + chocolate = 0xD2691E, // rgb(210,105,30) + coral = 0xFF7F50, // rgb(255,127,80) + cornflower_blue = 0x6495ED, // rgb(100,149,237) + cornsilk = 0xFFF8DC, // rgb(255,248,220) + crimson = 0xDC143C, // rgb(220,20,60) + cyan = 0x00FFFF, // rgb(0,255,255) + dark_blue = 0x00008B, // rgb(0,0,139) + dark_cyan = 0x008B8B, // rgb(0,139,139) + dark_golden_rod = 0xB8860B, // rgb(184,134,11) + dark_gray = 0xA9A9A9, // rgb(169,169,169) + dark_green = 0x006400, // rgb(0,100,0) + dark_khaki = 0xBDB76B, // rgb(189,183,107) + dark_magenta = 0x8B008B, // rgb(139,0,139) + dark_olive_green = 0x556B2F, // rgb(85,107,47) + dark_orange = 0xFF8C00, // rgb(255,140,0) + dark_orchid = 0x9932CC, // rgb(153,50,204) + dark_red = 0x8B0000, // rgb(139,0,0) + dark_salmon = 0xE9967A, // rgb(233,150,122) + dark_sea_green = 0x8FBC8F, // rgb(143,188,143) + dark_slate_blue = 0x483D8B, // rgb(72,61,139) + dark_slate_gray = 0x2F4F4F, // rgb(47,79,79) + dark_turquoise = 0x00CED1, // rgb(0,206,209) + dark_violet = 0x9400D3, // rgb(148,0,211) + deep_pink = 0xFF1493, // rgb(255,20,147) + deep_sky_blue = 0x00BFFF, // rgb(0,191,255) + dim_gray = 0x696969, // rgb(105,105,105) + dodger_blue = 0x1E90FF, // rgb(30,144,255) + fire_brick = 0xB22222, // rgb(178,34,34) + floral_white = 0xFFFAF0, // rgb(255,250,240) + forest_green = 0x228B22, // rgb(34,139,34) + fuchsia = 0xFF00FF, // rgb(255,0,255) + gainsboro = 0xDCDCDC, // rgb(220,220,220) + ghost_white = 0xF8F8FF, // rgb(248,248,255) + gold = 0xFFD700, // rgb(255,215,0) + golden_rod = 0xDAA520, // rgb(218,165,32) + gray = 0x808080, // rgb(128,128,128) + green = 0x008000, // rgb(0,128,0) + green_yellow = 0xADFF2F, // rgb(173,255,47) + honey_dew = 0xF0FFF0, // rgb(240,255,240) + hot_pink = 0xFF69B4, // rgb(255,105,180) + indian_red = 0xCD5C5C, // rgb(205,92,92) + indigo = 0x4B0082, // rgb(75,0,130) + ivory = 0xFFFFF0, // rgb(255,255,240) + khaki = 0xF0E68C, // rgb(240,230,140) + lavender = 0xE6E6FA, // rgb(230,230,250) + lavender_blush = 0xFFF0F5, // rgb(255,240,245) + lawn_green = 0x7CFC00, // rgb(124,252,0) + lemon_chiffon = 0xFFFACD, // rgb(255,250,205) + light_blue = 0xADD8E6, // rgb(173,216,230) + light_coral = 0xF08080, // rgb(240,128,128) + light_cyan = 0xE0FFFF, // rgb(224,255,255) + light_golden_rod_yellow = 0xFAFAD2, // rgb(250,250,210) + light_gray = 0xD3D3D3, // rgb(211,211,211) + light_green = 0x90EE90, // rgb(144,238,144) + light_pink = 0xFFB6C1, // rgb(255,182,193) + light_salmon = 0xFFA07A, // rgb(255,160,122) + light_sea_green = 0x20B2AA, // rgb(32,178,170) + light_sky_blue = 0x87CEFA, // rgb(135,206,250) + light_slate_gray = 0x778899, // rgb(119,136,153) + light_steel_blue = 0xB0C4DE, // rgb(176,196,222) + light_yellow = 0xFFFFE0, // rgb(255,255,224) + lime = 0x00FF00, // rgb(0,255,0) + lime_green = 0x32CD32, // rgb(50,205,50) + linen = 0xFAF0E6, // rgb(250,240,230) + magenta = 0xFF00FF, // rgb(255,0,255) + maroon = 0x800000, // rgb(128,0,0) + medium_aquamarine = 0x66CDAA, // rgb(102,205,170) + medium_blue = 0x0000CD, // rgb(0,0,205) + medium_orchid = 0xBA55D3, // rgb(186,85,211) + medium_purple = 0x9370DB, // rgb(147,112,219) + medium_sea_green = 0x3CB371, // rgb(60,179,113) + medium_slate_blue = 0x7B68EE, // rgb(123,104,238) + medium_spring_green = 0x00FA9A, // rgb(0,250,154) + medium_turquoise = 0x48D1CC, // rgb(72,209,204) + medium_violet_red = 0xC71585, // rgb(199,21,133) + midnight_blue = 0x191970, // rgb(25,25,112) + mint_cream = 0xF5FFFA, // rgb(245,255,250) + misty_rose = 0xFFE4E1, // rgb(255,228,225) + moccasin = 0xFFE4B5, // rgb(255,228,181) + navajo_white = 0xFFDEAD, // rgb(255,222,173) + navy = 0x000080, // rgb(0,0,128) + old_lace = 0xFDF5E6, // rgb(253,245,230) + olive = 0x808000, // rgb(128,128,0) + olive_drab = 0x6B8E23, // rgb(107,142,35) + orange = 0xFFA500, // rgb(255,165,0) + orange_red = 0xFF4500, // rgb(255,69,0) + orchid = 0xDA70D6, // rgb(218,112,214) + pale_golden_rod = 0xEEE8AA, // rgb(238,232,170) + pale_green = 0x98FB98, // rgb(152,251,152) + pale_turquoise = 0xAFEEEE, // rgb(175,238,238) + pale_violet_red = 0xDB7093, // rgb(219,112,147) + papaya_whip = 0xFFEFD5, // rgb(255,239,213) + peach_puff = 0xFFDAB9, // rgb(255,218,185) + peru = 0xCD853F, // rgb(205,133,63) + pink = 0xFFC0CB, // rgb(255,192,203) + plum = 0xDDA0DD, // rgb(221,160,221) + powder_blue = 0xB0E0E6, // rgb(176,224,230) + purple = 0x800080, // rgb(128,0,128) + rebecca_purple = 0x663399, // rgb(102,51,153) + red = 0xFF0000, // rgb(255,0,0) + rosy_brown = 0xBC8F8F, // rgb(188,143,143) + royal_blue = 0x4169E1, // rgb(65,105,225) + saddle_brown = 0x8B4513, // rgb(139,69,19) + salmon = 0xFA8072, // rgb(250,128,114) + sandy_brown = 0xF4A460, // rgb(244,164,96) + sea_green = 0x2E8B57, // rgb(46,139,87) + sea_shell = 0xFFF5EE, // rgb(255,245,238) + sienna = 0xA0522D, // rgb(160,82,45) + silver = 0xC0C0C0, // rgb(192,192,192) + sky_blue = 0x87CEEB, // rgb(135,206,235) + slate_blue = 0x6A5ACD, // rgb(106,90,205) + slate_gray = 0x708090, // rgb(112,128,144) + snow = 0xFFFAFA, // rgb(255,250,250) + spring_green = 0x00FF7F, // rgb(0,255,127) + steel_blue = 0x4682B4, // rgb(70,130,180) + tan = 0xD2B48C, // rgb(210,180,140) + teal = 0x008080, // rgb(0,128,128) + thistle = 0xD8BFD8, // rgb(216,191,216) + tomato = 0xFF6347, // rgb(255,99,71) + turquoise = 0x40E0D0, // rgb(64,224,208) + violet = 0xEE82EE, // rgb(238,130,238) + wheat = 0xF5DEB3, // rgb(245,222,179) + white = 0xFFFFFF, // rgb(255,255,255) + white_smoke = 0xF5F5F5, // rgb(245,245,245) + yellow = 0xFFFF00, // rgb(255,255,0) + yellow_green = 0x9ACD32 // rgb(154,205,50) +}; // enum class color + +enum class terminal_color : uint8_t { + black = 30, + red, + green, + yellow, + blue, + magenta, + cyan, + white, + bright_black = 90, + bright_red, + bright_green, + bright_yellow, + bright_blue, + bright_magenta, + bright_cyan, + bright_white +}; + +enum class emphasis : uint8_t { + bold = 1, + italic = 1 << 1, + underline = 1 << 2, + strikethrough = 1 << 3 +}; + +// rgb is a struct for red, green and blue colors. +// Using the name "rgb" makes some editors show the color in a tooltip. +struct rgb { + FMT_CONSTEXPR rgb() : r(0), g(0), b(0) {} + FMT_CONSTEXPR rgb(uint8_t r_, uint8_t g_, uint8_t b_) : r(r_), g(g_), b(b_) {} + FMT_CONSTEXPR rgb(uint32_t hex) + : r((hex >> 16) & 0xFF), g((hex >> 8) & 0xFF), b(hex & 0xFF) {} + FMT_CONSTEXPR rgb(color hex) + : r((uint32_t(hex) >> 16) & 0xFF), + g((uint32_t(hex) >> 8) & 0xFF), + b(uint32_t(hex) & 0xFF) {} + uint8_t r; + uint8_t g; + uint8_t b; +}; + +namespace detail { + +// color is a struct of either a rgb color or a terminal color. +struct color_type { + FMT_CONSTEXPR color_type() FMT_NOEXCEPT : is_rgb(), value{} {} + FMT_CONSTEXPR color_type(color rgb_color) FMT_NOEXCEPT : is_rgb(true), + value{} { + value.rgb_color = static_cast(rgb_color); + } + FMT_CONSTEXPR color_type(rgb rgb_color) FMT_NOEXCEPT : is_rgb(true), value{} { + value.rgb_color = (static_cast(rgb_color.r) << 16) | + (static_cast(rgb_color.g) << 8) | rgb_color.b; + } + FMT_CONSTEXPR color_type(terminal_color term_color) FMT_NOEXCEPT : is_rgb(), + value{} { + value.term_color = static_cast(term_color); + } + bool is_rgb; + union color_union { + uint8_t term_color; + uint32_t rgb_color; + } value; +}; +} // namespace detail + +// Experimental text formatting support. +class text_style { + public: + FMT_CONSTEXPR text_style(emphasis em = emphasis()) FMT_NOEXCEPT + : set_foreground_color(), + set_background_color(), + ems(em) {} + + FMT_CONSTEXPR text_style& operator|=(const text_style& rhs) { + if (!set_foreground_color) { + set_foreground_color = rhs.set_foreground_color; + foreground_color = rhs.foreground_color; + } else if (rhs.set_foreground_color) { + if (!foreground_color.is_rgb || !rhs.foreground_color.is_rgb) + FMT_THROW(format_error("can't OR a terminal color")); + foreground_color.value.rgb_color |= rhs.foreground_color.value.rgb_color; + } + + if (!set_background_color) { + set_background_color = rhs.set_background_color; + background_color = rhs.background_color; + } else if (rhs.set_background_color) { + if (!background_color.is_rgb || !rhs.background_color.is_rgb) + FMT_THROW(format_error("can't OR a terminal color")); + background_color.value.rgb_color |= rhs.background_color.value.rgb_color; + } + + ems = static_cast(static_cast(ems) | + static_cast(rhs.ems)); + return *this; + } + + friend FMT_CONSTEXPR text_style operator|(text_style lhs, + const text_style& rhs) { + return lhs |= rhs; + } + + FMT_CONSTEXPR text_style& operator&=(const text_style& rhs) { + if (!set_foreground_color) { + set_foreground_color = rhs.set_foreground_color; + foreground_color = rhs.foreground_color; + } else if (rhs.set_foreground_color) { + if (!foreground_color.is_rgb || !rhs.foreground_color.is_rgb) + FMT_THROW(format_error("can't AND a terminal color")); + foreground_color.value.rgb_color &= rhs.foreground_color.value.rgb_color; + } + + if (!set_background_color) { + set_background_color = rhs.set_background_color; + background_color = rhs.background_color; + } else if (rhs.set_background_color) { + if (!background_color.is_rgb || !rhs.background_color.is_rgb) + FMT_THROW(format_error("can't AND a terminal color")); + background_color.value.rgb_color &= rhs.background_color.value.rgb_color; + } + + ems = static_cast(static_cast(ems) & + static_cast(rhs.ems)); + return *this; + } + + friend FMT_CONSTEXPR text_style operator&(text_style lhs, + const text_style& rhs) { + return lhs &= rhs; + } + + FMT_CONSTEXPR bool has_foreground() const FMT_NOEXCEPT { + return set_foreground_color; + } + FMT_CONSTEXPR bool has_background() const FMT_NOEXCEPT { + return set_background_color; + } + FMT_CONSTEXPR bool has_emphasis() const FMT_NOEXCEPT { + return static_cast(ems) != 0; + } + FMT_CONSTEXPR detail::color_type get_foreground() const FMT_NOEXCEPT { + FMT_ASSERT(has_foreground(), "no foreground specified for this style"); + return foreground_color; + } + FMT_CONSTEXPR detail::color_type get_background() const FMT_NOEXCEPT { + FMT_ASSERT(has_background(), "no background specified for this style"); + return background_color; + } + FMT_CONSTEXPR emphasis get_emphasis() const FMT_NOEXCEPT { + FMT_ASSERT(has_emphasis(), "no emphasis specified for this style"); + return ems; + } + + private: + FMT_CONSTEXPR text_style(bool is_foreground, + detail::color_type text_color) FMT_NOEXCEPT + : set_foreground_color(), + set_background_color(), + ems() { + if (is_foreground) { + foreground_color = text_color; + set_foreground_color = true; + } else { + background_color = text_color; + set_background_color = true; + } + } + + friend FMT_CONSTEXPR_DECL text_style fg(detail::color_type foreground) + FMT_NOEXCEPT; + friend FMT_CONSTEXPR_DECL text_style bg(detail::color_type background) + FMT_NOEXCEPT; + + detail::color_type foreground_color; + detail::color_type background_color; + bool set_foreground_color; + bool set_background_color; + emphasis ems; +}; + +FMT_CONSTEXPR text_style fg(detail::color_type foreground) FMT_NOEXCEPT { + return text_style(/*is_foreground=*/true, foreground); +} + +FMT_CONSTEXPR text_style bg(detail::color_type background) FMT_NOEXCEPT { + return text_style(/*is_foreground=*/false, background); +} + +FMT_CONSTEXPR text_style operator|(emphasis lhs, emphasis rhs) FMT_NOEXCEPT { + return text_style(lhs) | rhs; +} + +namespace detail { + +template struct ansi_color_escape { + FMT_CONSTEXPR ansi_color_escape(detail::color_type text_color, + const char* esc) FMT_NOEXCEPT { + // If we have a terminal color, we need to output another escape code + // sequence. + if (!text_color.is_rgb) { + bool is_background = esc == detail::data::background_color; + uint32_t value = text_color.value.term_color; + // Background ASCII codes are the same as the foreground ones but with + // 10 more. + if (is_background) value += 10u; + + size_t index = 0; + buffer[index++] = static_cast('\x1b'); + buffer[index++] = static_cast('['); + + if (value >= 100u) { + buffer[index++] = static_cast('1'); + value %= 100u; + } + buffer[index++] = static_cast('0' + value / 10u); + buffer[index++] = static_cast('0' + value % 10u); + + buffer[index++] = static_cast('m'); + buffer[index++] = static_cast('\0'); + return; + } + + for (int i = 0; i < 7; i++) { + buffer[i] = static_cast(esc[i]); + } + rgb color(text_color.value.rgb_color); + to_esc(color.r, buffer + 7, ';'); + to_esc(color.g, buffer + 11, ';'); + to_esc(color.b, buffer + 15, 'm'); + buffer[19] = static_cast(0); + } + FMT_CONSTEXPR ansi_color_escape(emphasis em) FMT_NOEXCEPT { + uint8_t em_codes[4] = {}; + uint8_t em_bits = static_cast(em); + if (em_bits & static_cast(emphasis::bold)) em_codes[0] = 1; + if (em_bits & static_cast(emphasis::italic)) em_codes[1] = 3; + if (em_bits & static_cast(emphasis::underline)) em_codes[2] = 4; + if (em_bits & static_cast(emphasis::strikethrough)) + em_codes[3] = 9; + + size_t index = 0; + for (int i = 0; i < 4; ++i) { + if (!em_codes[i]) continue; + buffer[index++] = static_cast('\x1b'); + buffer[index++] = static_cast('['); + buffer[index++] = static_cast('0' + em_codes[i]); + buffer[index++] = static_cast('m'); + } + buffer[index++] = static_cast(0); + } + FMT_CONSTEXPR operator const Char*() const FMT_NOEXCEPT { return buffer; } + + FMT_CONSTEXPR const Char* begin() const FMT_NOEXCEPT { return buffer; } + FMT_CONSTEXPR const Char* end() const FMT_NOEXCEPT { + return buffer + std::char_traits::length(buffer); + } + + private: + Char buffer[7u + 3u * 4u + 1u]; + + static FMT_CONSTEXPR void to_esc(uint8_t c, Char* out, + char delimiter) FMT_NOEXCEPT { + out[0] = static_cast('0' + c / 100); + out[1] = static_cast('0' + c / 10 % 10); + out[2] = static_cast('0' + c % 10); + out[3] = static_cast(delimiter); + } +}; + +template +FMT_CONSTEXPR ansi_color_escape make_foreground_color( + detail::color_type foreground) FMT_NOEXCEPT { + return ansi_color_escape(foreground, detail::data::foreground_color); +} + +template +FMT_CONSTEXPR ansi_color_escape make_background_color( + detail::color_type background) FMT_NOEXCEPT { + return ansi_color_escape(background, detail::data::background_color); +} + +template +FMT_CONSTEXPR ansi_color_escape make_emphasis(emphasis em) FMT_NOEXCEPT { + return ansi_color_escape(em); +} + +template +inline void fputs(const Char* chars, FILE* stream) FMT_NOEXCEPT { + std::fputs(chars, stream); +} + +template <> +inline void fputs(const wchar_t* chars, FILE* stream) FMT_NOEXCEPT { + std::fputws(chars, stream); +} + +template inline void reset_color(FILE* stream) FMT_NOEXCEPT { + fputs(detail::data::reset_color, stream); +} + +template <> inline void reset_color(FILE* stream) FMT_NOEXCEPT { + fputs(detail::data::wreset_color, stream); +} + +template +inline void reset_color(basic_memory_buffer& buffer) FMT_NOEXCEPT { + const char* begin = data::reset_color; + const char* end = begin + sizeof(data::reset_color) - 1; + buffer.append(begin, end); +} + +template +void vformat_to(basic_memory_buffer& buf, const text_style& ts, + basic_string_view format_str, + basic_format_args> args) { + bool has_style = false; + if (ts.has_emphasis()) { + has_style = true; + auto emphasis = detail::make_emphasis(ts.get_emphasis()); + buf.append(emphasis.begin(), emphasis.end()); + } + if (ts.has_foreground()) { + has_style = true; + auto foreground = detail::make_foreground_color(ts.get_foreground()); + buf.append(foreground.begin(), foreground.end()); + } + if (ts.has_background()) { + has_style = true; + auto background = detail::make_background_color(ts.get_background()); + buf.append(background.begin(), background.end()); + } + detail::vformat_to(buf, format_str, args); + if (has_style) detail::reset_color(buf); +} +} // namespace detail + +template > +void vprint(std::FILE* f, const text_style& ts, const S& format, + basic_format_args> args) { + basic_memory_buffer buf; + detail::vformat_to(buf, ts, to_string_view(format), args); + buf.push_back(Char(0)); + detail::fputs(buf.data(), f); +} + +/** + Formats a string and prints it to the specified file stream using ANSI + escape sequences to specify text formatting. + Example: + fmt::print(fmt::emphasis::bold | fg(fmt::color::red), + "Elapsed time: {0:.2f} seconds", 1.23); + */ +template ::value)> +void print(std::FILE* f, const text_style& ts, const S& format_str, + const Args&... args) { + detail::check_format_string(format_str); + using context = buffer_context>; + format_arg_store as{args...}; + vprint(f, ts, format_str, basic_format_args(as)); +} + +/** + Formats a string and prints it to stdout using ANSI escape sequences to + specify text formatting. + Example: + fmt::print(fmt::emphasis::bold | fg(fmt::color::red), + "Elapsed time: {0:.2f} seconds", 1.23); + */ +template ::value)> +void print(const text_style& ts, const S& format_str, const Args&... args) { + return print(stdout, ts, format_str, args...); +} + +template > +inline std::basic_string vformat( + const text_style& ts, const S& format_str, + basic_format_args>> args) { + basic_memory_buffer buf; + detail::vformat_to(buf, ts, to_string_view(format_str), args); + return fmt::to_string(buf); +} + +/** + \rst + Formats arguments and returns the result as a string using ANSI + escape sequences to specify text formatting. + + **Example**:: + + #include + std::string message = fmt::format(fmt::emphasis::bold | fg(fmt::color::red), + "The answer is {}", 42); + \endrst +*/ +template > +inline std::basic_string format(const text_style& ts, const S& format_str, + const Args&... args) { + return vformat(ts, to_string_view(format_str), + detail::make_args_checked(format_str, args...)); +} + +FMT_END_NAMESPACE + +#endif // FMT_COLOR_H_ diff --git a/ThirdParty/fmtlib/include/fmt/compile.h b/ThirdParty/fmtlib/include/fmt/compile.h new file mode 100644 index 0000000000..d7e6449ebb --- /dev/null +++ b/ThirdParty/fmtlib/include/fmt/compile.h @@ -0,0 +1,665 @@ +// Formatting library for C++ - experimental format string compilation +// +// Copyright (c) 2012 - present, Victor Zverovich and fmt contributors +// All rights reserved. +// +// For the license information refer to format.h. + +#ifndef FMT_COMPILE_H_ +#define FMT_COMPILE_H_ + +#include + +#include "format.h" + +FMT_BEGIN_NAMESPACE +namespace detail { + +// A compile-time string which is compiled into fast formatting code. +class compiled_string {}; + +template +struct is_compiled_string : std::is_base_of {}; + +/** + \rst + Converts a string literal *s* into a format string that will be parsed at + compile time and converted into efficient formatting code. Requires C++17 + ``constexpr if`` compiler support. + + **Example**:: + + // Converts 42 into std::string using the most efficient method and no + // runtime format string processing. + std::string s = fmt::format(FMT_COMPILE("{}"), 42); + \endrst + */ +#define FMT_COMPILE(s) FMT_STRING_IMPL(s, fmt::detail::compiled_string) + +template +const T& first(const T& value, const Tail&...) { + return value; +} + +// Part of a compiled format string. It can be either literal text or a +// replacement field. +template struct format_part { + enum class kind { arg_index, arg_name, text, replacement }; + + struct replacement { + arg_ref arg_id; + dynamic_format_specs specs; + }; + + kind part_kind; + union value { + int arg_index; + basic_string_view str; + replacement repl; + + FMT_CONSTEXPR value(int index = 0) : arg_index(index) {} + FMT_CONSTEXPR value(basic_string_view s) : str(s) {} + FMT_CONSTEXPR value(replacement r) : repl(r) {} + } val; + // Position past the end of the argument id. + const Char* arg_id_end = nullptr; + + FMT_CONSTEXPR format_part(kind k = kind::arg_index, value v = {}) + : part_kind(k), val(v) {} + + static FMT_CONSTEXPR format_part make_arg_index(int index) { + return format_part(kind::arg_index, index); + } + static FMT_CONSTEXPR format_part make_arg_name(basic_string_view name) { + return format_part(kind::arg_name, name); + } + static FMT_CONSTEXPR format_part make_text(basic_string_view text) { + return format_part(kind::text, text); + } + static FMT_CONSTEXPR format_part make_replacement(replacement repl) { + return format_part(kind::replacement, repl); + } +}; + +template struct part_counter { + unsigned num_parts = 0; + + FMT_CONSTEXPR void on_text(const Char* begin, const Char* end) { + if (begin != end) ++num_parts; + } + + FMT_CONSTEXPR int on_arg_id() { return ++num_parts, 0; } + FMT_CONSTEXPR int on_arg_id(int) { return ++num_parts, 0; } + FMT_CONSTEXPR int on_arg_id(basic_string_view) { + return ++num_parts, 0; + } + + FMT_CONSTEXPR void on_replacement_field(int, const Char*) {} + + FMT_CONSTEXPR const Char* on_format_specs(int, const Char* begin, + const Char* end) { + // Find the matching brace. + unsigned brace_counter = 0; + for (; begin != end; ++begin) { + if (*begin == '{') { + ++brace_counter; + } else if (*begin == '}') { + if (brace_counter == 0u) break; + --brace_counter; + } + } + return begin; + } + + FMT_CONSTEXPR void on_error(const char*) {} +}; + +// Counts the number of parts in a format string. +template +FMT_CONSTEXPR unsigned count_parts(basic_string_view format_str) { + part_counter counter; + parse_format_string(format_str, counter); + return counter.num_parts; +} + +template +class format_string_compiler : public error_handler { + private: + using part = format_part; + + PartHandler handler_; + part part_; + basic_string_view format_str_; + basic_format_parse_context parse_context_; + + public: + FMT_CONSTEXPR format_string_compiler(basic_string_view format_str, + PartHandler handler) + : handler_(handler), + format_str_(format_str), + parse_context_(format_str) {} + + FMT_CONSTEXPR void on_text(const Char* begin, const Char* end) { + if (begin != end) + handler_(part::make_text({begin, to_unsigned(end - begin)})); + } + + FMT_CONSTEXPR int on_arg_id() { + part_ = part::make_arg_index(parse_context_.next_arg_id()); + return 0; + } + + FMT_CONSTEXPR int on_arg_id(int id) { + parse_context_.check_arg_id(id); + part_ = part::make_arg_index(id); + return 0; + } + + FMT_CONSTEXPR int on_arg_id(basic_string_view id) { + part_ = part::make_arg_name(id); + return 0; + } + + FMT_CONSTEXPR void on_replacement_field(int, const Char* ptr) { + part_.arg_id_end = ptr; + handler_(part_); + } + + FMT_CONSTEXPR const Char* on_format_specs(int, const Char* begin, + const Char* end) { + auto repl = typename part::replacement(); + dynamic_specs_handler> handler( + repl.specs, parse_context_); + auto it = parse_format_specs(begin, end, handler); + if (*it != '}') on_error("missing '}' in format string"); + repl.arg_id = part_.part_kind == part::kind::arg_index + ? arg_ref(part_.val.arg_index) + : arg_ref(part_.val.str); + auto part = part::make_replacement(repl); + part.arg_id_end = begin; + handler_(part); + return it; + } +}; + +// Compiles a format string and invokes handler(part) for each parsed part. +template +FMT_CONSTEXPR void compile_format_string(basic_string_view format_str, + PartHandler handler) { + parse_format_string( + format_str, + format_string_compiler(format_str, handler)); +} + +template +void format_arg( + basic_format_parse_context& parse_ctx, + Context& ctx, Id arg_id) { + ctx.advance_to(visit_format_arg( + arg_formatter(ctx, &parse_ctx), + ctx.arg(arg_id))); +} + +// vformat_to is defined in a subnamespace to prevent ADL. +namespace cf { +template +auto vformat_to(OutputIt out, CompiledFormat& cf, + basic_format_args args) -> typename Context::iterator { + using char_type = typename Context::char_type; + basic_format_parse_context parse_ctx( + to_string_view(cf.format_str_)); + Context ctx(out, args); + + const auto& parts = cf.parts(); + for (auto part_it = std::begin(parts); part_it != std::end(parts); + ++part_it) { + const auto& part = *part_it; + const auto& value = part.val; + + using format_part_t = format_part; + switch (part.part_kind) { + case format_part_t::kind::text: { + const auto text = value.str; + auto output = ctx.out(); + auto&& it = reserve(output, text.size()); + it = std::copy_n(text.begin(), text.size(), it); + ctx.advance_to(output); + break; + } + + case format_part_t::kind::arg_index: + advance_to(parse_ctx, part.arg_id_end); + detail::format_arg(parse_ctx, ctx, value.arg_index); + break; + + case format_part_t::kind::arg_name: + advance_to(parse_ctx, part.arg_id_end); + detail::format_arg(parse_ctx, ctx, value.str); + break; + + case format_part_t::kind::replacement: { + const auto& arg_id_value = value.repl.arg_id.val; + const auto arg = value.repl.arg_id.kind == arg_id_kind::index + ? ctx.arg(arg_id_value.index) + : ctx.arg(arg_id_value.name); + + auto specs = value.repl.specs; + + handle_dynamic_spec(specs.width, specs.width_ref, ctx); + handle_dynamic_spec(specs.precision, + specs.precision_ref, ctx); + + error_handler h; + numeric_specs_checker checker(h, arg.type()); + if (specs.align == align::numeric) checker.require_numeric_argument(); + if (specs.sign != sign::none) checker.check_sign(); + if (specs.alt) checker.require_numeric_argument(); + if (specs.precision >= 0) checker.check_precision(); + + advance_to(parse_ctx, part.arg_id_end); + ctx.advance_to( + visit_format_arg(arg_formatter( + ctx, nullptr, &specs), + arg)); + break; + } + } + } + return ctx.out(); +} +} // namespace cf + +struct basic_compiled_format {}; + +template +struct compiled_format_base : basic_compiled_format { + using char_type = char_t; + using parts_container = std::vector>; + + parts_container compiled_parts; + + explicit compiled_format_base(basic_string_view format_str) { + compile_format_string(format_str, + [this](const format_part& part) { + compiled_parts.push_back(part); + }); + } + + const parts_container& parts() const { return compiled_parts; } +}; + +template struct format_part_array { + format_part data[N] = {}; + FMT_CONSTEXPR format_part_array() = default; +}; + +template +FMT_CONSTEXPR format_part_array compile_to_parts( + basic_string_view format_str) { + format_part_array parts; + unsigned counter = 0; + // This is not a lambda for compatibility with older compilers. + struct { + format_part* parts; + unsigned* counter; + FMT_CONSTEXPR void operator()(const format_part& part) { + parts[(*counter)++] = part; + } + } collector{parts.data, &counter}; + compile_format_string(format_str, collector); + if (counter < N) { + parts.data[counter] = + format_part::make_text(basic_string_view()); + } + return parts; +} + +template constexpr const T& constexpr_max(const T& a, const T& b) { + return (a < b) ? b : a; +} + +template +struct compiled_format_base::value>> + : basic_compiled_format { + using char_type = char_t; + + FMT_CONSTEXPR explicit compiled_format_base(basic_string_view) {} + +// Workaround for old compilers. Format string compilation will not be +// performed there anyway. +#if FMT_USE_CONSTEXPR + static FMT_CONSTEXPR_DECL const unsigned num_format_parts = + constexpr_max(count_parts(to_string_view(S())), 1u); +#else + static const unsigned num_format_parts = 1; +#endif + + using parts_container = format_part[num_format_parts]; + + const parts_container& parts() const { + static FMT_CONSTEXPR_DECL const auto compiled_parts = + compile_to_parts( + detail::to_string_view(S())); + return compiled_parts.data; + } +}; + +template +class compiled_format : private compiled_format_base { + public: + using typename compiled_format_base::char_type; + + private: + basic_string_view format_str_; + + template + friend auto cf::vformat_to(OutputIt out, CompiledFormat& cf, + basic_format_args args) -> + typename Context::iterator; + + public: + compiled_format() = delete; + explicit constexpr compiled_format(basic_string_view format_str) + : compiled_format_base(format_str), format_str_(format_str) {} +}; + +#ifdef __cpp_if_constexpr +template struct type_list {}; + +// Returns a reference to the argument at index N from [first, rest...]. +template +constexpr const auto& get(const T& first, const Args&... rest) { + static_assert(N < 1 + sizeof...(Args), "index is out of bounds"); + if constexpr (N == 0) + return first; + else + return get(rest...); +} + +template struct get_type_impl; + +template struct get_type_impl> { + using type = remove_cvref_t(std::declval()...))>; +}; + +template +using get_type = typename get_type_impl::type; + +template struct is_compiled_format : std::false_type {}; + +template struct text { + basic_string_view data; + using char_type = Char; + + template + OutputIt format(OutputIt out, const Args&...) const { + return write(out, data); + } +}; + +template +struct is_compiled_format> : std::true_type {}; + +template +constexpr text make_text(basic_string_view s, size_t pos, + size_t size) { + return {{&s[pos], size}}; +} + +// A replacement field that refers to argument N. +template struct field { + using char_type = Char; + + template + OutputIt format(OutputIt out, const Args&... args) const { + // This ensures that the argument type is convertile to `const T&`. + const T& arg = get(args...); + return write(out, arg); + } +}; + +template +struct is_compiled_format> : std::true_type {}; + +// A replacement field that refers to argument N and has format specifiers. +template struct spec_field { + using char_type = Char; + mutable formatter fmt; + + template + OutputIt format(OutputIt out, const Args&... args) const { + // This ensures that the argument type is convertile to `const T&`. + const T& arg = get(args...); + basic_format_context ctx(out, {}); + return fmt.format(arg, ctx); + } +}; + +template +struct is_compiled_format> : std::true_type {}; + +template struct concat { + L lhs; + R rhs; + using char_type = typename L::char_type; + + template + OutputIt format(OutputIt out, const Args&... args) const { + out = lhs.format(out, args...); + return rhs.format(out, args...); + } +}; + +template +struct is_compiled_format> : std::true_type {}; + +template +constexpr concat make_concat(L lhs, R rhs) { + return {lhs, rhs}; +} + +struct unknown_format {}; + +template +constexpr size_t parse_text(basic_string_view str, size_t pos) { + for (size_t size = str.size(); pos != size; ++pos) { + if (str[pos] == '{' || str[pos] == '}') break; + } + return pos; +} + +template +constexpr auto compile_format_string(S format_str); + +template +constexpr auto parse_tail(T head, S format_str) { + if constexpr (POS != + basic_string_view(format_str).size()) { + constexpr auto tail = compile_format_string(format_str); + if constexpr (std::is_same, + unknown_format>()) + return tail; + else + return make_concat(head, tail); + } else { + return head; + } +} + +template struct parse_specs_result { + formatter fmt; + size_t end; +}; + +template +constexpr parse_specs_result parse_specs(basic_string_view str, + size_t pos) { + str.remove_prefix(pos); + auto ctx = basic_format_parse_context(str); + auto f = formatter(); + auto end = f.parse(ctx); + return {f, pos + (end - str.data()) + 1}; +} + +// Compiles a non-empty format string and returns the compiled representation +// or unknown_format() on unrecognized input. +template +constexpr auto compile_format_string(S format_str) { + using char_type = typename S::char_type; + constexpr basic_string_view str = format_str; + if constexpr (str[POS] == '{') { + if (POS + 1 == str.size()) + throw format_error("unmatched '{' in format string"); + if constexpr (str[POS + 1] == '{') { + return parse_tail(make_text(str, POS, 1), format_str); + } else if constexpr (str[POS + 1] == '}') { + using type = get_type; + return parse_tail(field(), + format_str); + } else if constexpr (str[POS + 1] == ':') { + using type = get_type; + constexpr auto result = parse_specs(str, POS + 2); + return parse_tail( + spec_field{result.fmt}, format_str); + } else { + return unknown_format(); + } + } else if constexpr (str[POS] == '}') { + if (POS + 1 == str.size()) + throw format_error("unmatched '}' in format string"); + return parse_tail(make_text(str, POS, 1), format_str); + } else { + constexpr auto end = parse_text(str, POS + 1); + return parse_tail(make_text(str, POS, end - POS), + format_str); + } +} + +template ::value || + detail::is_compiled_string::value)> +constexpr auto compile(S format_str) { + constexpr basic_string_view str = format_str; + if constexpr (str.size() == 0) { + return detail::make_text(str, 0, 0); + } else { + constexpr auto result = + detail::compile_format_string, 0, 0>( + format_str); + if constexpr (std::is_same, + detail::unknown_format>()) { + return detail::compiled_format(to_string_view(format_str)); + } else { + return result; + } + } +} +#else +template ::value)> +constexpr auto compile(S format_str) -> detail::compiled_format { + return detail::compiled_format(to_string_view(format_str)); +} +#endif // __cpp_if_constexpr + +// Compiles the format string which must be a string literal. +template +auto compile(const Char (&format_str)[N]) + -> detail::compiled_format { + return detail::compiled_format( + basic_string_view(format_str, N - 1)); +} +} // namespace detail + +// DEPRECATED! use FMT_COMPILE instead. +template +FMT_DEPRECATED auto compile(const Args&... args) + -> decltype(detail::compile(args...)) { + return detail::compile(args...); +} + +#if FMT_USE_CONSTEXPR +# ifdef __cpp_if_constexpr + +template ::value)> +FMT_INLINE std::basic_string format(const CompiledFormat& cf, + const Args&... args) { + basic_memory_buffer buffer; + detail::buffer& base = buffer; + cf.format(std::back_inserter(base), args...); + return to_string(buffer); +} + +template ::value)> +OutputIt format_to(OutputIt out, const CompiledFormat& cf, + const Args&... args) { + return cf.format(out, args...); +} +# endif // __cpp_if_constexpr +#endif // FMT_USE_CONSTEXPR + +template ::value)> +std::basic_string format(const CompiledFormat& cf, const Args&... args) { + basic_memory_buffer buffer; + using context = buffer_context; + detail::buffer& base = buffer; + detail::cf::vformat_to(std::back_inserter(base), cf, + make_format_args(args...)); + return to_string(buffer); +} + +template ::value)> +FMT_INLINE std::basic_string format(const S&, + Args&&... args) { + constexpr basic_string_view str = S(); + if (str.size() == 2 && str[0] == '{' && str[1] == '}') + return fmt::to_string(detail::first(args...)); + constexpr auto compiled = detail::compile(S()); + return format(compiled, std::forward(args)...); +} + +template ::value)> +OutputIt format_to(OutputIt out, const CompiledFormat& cf, + const Args&... args) { + using char_type = typename CompiledFormat::char_type; + using context = format_context_t; + return detail::cf::vformat_to(out, cf, + make_format_args(args...)); +} + +template ::value)> +OutputIt format_to(OutputIt out, const S&, const Args&... args) { + constexpr auto compiled = detail::compile(S()); + return format_to(out, compiled, args...); +} + +template < + typename OutputIt, typename CompiledFormat, typename... Args, + FMT_ENABLE_IF(detail::is_output_iterator::value&& std::is_base_of< + detail::basic_compiled_format, CompiledFormat>::value)> +format_to_n_result format_to_n(OutputIt out, size_t n, + const CompiledFormat& cf, + const Args&... args) { + auto it = + format_to(detail::truncating_iterator(out, n), cf, args...); + return {it.base(), it.count()}; +} + +template +size_t formatted_size(const CompiledFormat& cf, const Args&... args) { + return format_to(detail::counting_iterator(), cf, args...).count(); +} + +FMT_END_NAMESPACE + +#endif // FMT_COMPILE_H_ diff --git a/ThirdParty/fmtlib/include/fmt/core.h b/ThirdParty/fmtlib/include/fmt/core.h new file mode 100644 index 0000000000..37799a3a0c --- /dev/null +++ b/ThirdParty/fmtlib/include/fmt/core.h @@ -0,0 +1,1882 @@ +// Formatting library for C++ - the core API +// +// Copyright (c) 2012 - present, Victor Zverovich +// All rights reserved. +// +// For the license information refer to format.h. + +#ifndef FMT_CORE_H_ +#define FMT_CORE_H_ + +#include // std::FILE +#include +#include +#include +#include +#include +#include +#include + +// The fmt library version in the form major * 10000 + minor * 100 + patch. +#define FMT_VERSION 70003 + +#ifdef __clang__ +# define FMT_CLANG_VERSION (__clang_major__ * 100 + __clang_minor__) +#else +# define FMT_CLANG_VERSION 0 +#endif + +#if defined(__GNUC__) && !defined(__clang__) +# define FMT_GCC_VERSION (__GNUC__ * 100 + __GNUC_MINOR__) +#else +# define FMT_GCC_VERSION 0 +#endif + +#if defined(__INTEL_COMPILER) +# define FMT_ICC_VERSION __INTEL_COMPILER +#else +# define FMT_ICC_VERSION 0 +#endif + +#if __cplusplus >= 201103L || defined(__GXX_EXPERIMENTAL_CXX0X__) +# define FMT_HAS_GXX_CXX11 FMT_GCC_VERSION +#else +# define FMT_HAS_GXX_CXX11 0 +#endif + +#ifdef __NVCC__ +# define FMT_NVCC __NVCC__ +#else +# define FMT_NVCC 0 +#endif + +#ifdef _MSC_VER +# define FMT_MSC_VER _MSC_VER +# define FMT_SUPPRESS_MSC_WARNING(n) __pragma(warning(suppress : n)) +#else +# define FMT_MSC_VER 0 +# define FMT_SUPPRESS_MSC_WARNING(n) +#endif +#ifdef __has_feature +# define FMT_HAS_FEATURE(x) __has_feature(x) +#else +# define FMT_HAS_FEATURE(x) 0 +#endif + +#if defined(__has_include) && !defined(__INTELLISENSE__) && \ + !(FMT_ICC_VERSION && FMT_ICC_VERSION < 1600) +# define FMT_HAS_INCLUDE(x) __has_include(x) +#else +# define FMT_HAS_INCLUDE(x) 0 +#endif + +#ifdef __has_cpp_attribute +# define FMT_HAS_CPP_ATTRIBUTE(x) __has_cpp_attribute(x) +#else +# define FMT_HAS_CPP_ATTRIBUTE(x) 0 +#endif + +#define FMT_HAS_CPP14_ATTRIBUTE(attribute) \ + (__cplusplus >= 201402L && FMT_HAS_CPP_ATTRIBUTE(attribute)) + +#define FMT_HAS_CPP17_ATTRIBUTE(attribute) \ + (__cplusplus >= 201703L && FMT_HAS_CPP_ATTRIBUTE(attribute)) + +// Check if relaxed C++14 constexpr is supported. +// GCC doesn't allow throw in constexpr until version 6 (bug 67371). +#ifndef FMT_USE_CONSTEXPR +# define FMT_USE_CONSTEXPR \ + (FMT_HAS_FEATURE(cxx_relaxed_constexpr) || FMT_MSC_VER >= 1910 || \ + (FMT_GCC_VERSION >= 600 && __cplusplus >= 201402L)) && \ + !FMT_NVCC && !FMT_ICC_VERSION +#endif +#if FMT_USE_CONSTEXPR +# define FMT_CONSTEXPR constexpr +# define FMT_CONSTEXPR_DECL constexpr +#else +# define FMT_CONSTEXPR inline +# define FMT_CONSTEXPR_DECL +#endif + +#ifndef FMT_OVERRIDE +# if FMT_HAS_FEATURE(cxx_override) || \ + (FMT_GCC_VERSION >= 408 && FMT_HAS_GXX_CXX11) || FMT_MSC_VER >= 1900 +# define FMT_OVERRIDE override +# else +# define FMT_OVERRIDE +# endif +#endif + +// Check if exceptions are disabled. +#ifndef FMT_EXCEPTIONS +# if (defined(__GNUC__) && !defined(__EXCEPTIONS)) || \ + FMT_MSC_VER && !_HAS_EXCEPTIONS +# define FMT_EXCEPTIONS 0 +# else +# define FMT_EXCEPTIONS 1 +# endif +#endif + +// Define FMT_USE_NOEXCEPT to make fmt use noexcept (C++11 feature). +#ifndef FMT_USE_NOEXCEPT +# define FMT_USE_NOEXCEPT 0 +#endif + +#if FMT_USE_NOEXCEPT || FMT_HAS_FEATURE(cxx_noexcept) || \ + (FMT_GCC_VERSION >= 408 && FMT_HAS_GXX_CXX11) || FMT_MSC_VER >= 1900 +# define FMT_DETECTED_NOEXCEPT noexcept +# define FMT_HAS_CXX11_NOEXCEPT 1 +#else +# define FMT_DETECTED_NOEXCEPT throw() +# define FMT_HAS_CXX11_NOEXCEPT 0 +#endif + +#ifndef FMT_NOEXCEPT +# if FMT_EXCEPTIONS || FMT_HAS_CXX11_NOEXCEPT +# define FMT_NOEXCEPT FMT_DETECTED_NOEXCEPT +# else +# define FMT_NOEXCEPT +# endif +#endif + +// [[noreturn]] is disabled on MSVC and NVCC because of bogus unreachable code +// warnings. +#if FMT_EXCEPTIONS && FMT_HAS_CPP_ATTRIBUTE(noreturn) && !FMT_MSC_VER && \ + !FMT_NVCC +# define FMT_NORETURN [[noreturn]] +#else +# define FMT_NORETURN +#endif + +#ifndef FMT_DEPRECATED +# if FMT_HAS_CPP14_ATTRIBUTE(deprecated) || FMT_MSC_VER >= 1900 +# define FMT_DEPRECATED [[deprecated]] +# else +# if defined(__GNUC__) || defined(__clang__) +# define FMT_DEPRECATED __attribute__((deprecated)) +# elif FMT_MSC_VER +# define FMT_DEPRECATED __declspec(deprecated) +# else +# define FMT_DEPRECATED /* deprecated */ +# endif +# endif +#endif + +// Workaround broken [[deprecated]] in the Intel, PGI and NVCC compilers. +#if FMT_ICC_VERSION || defined(__PGI) || FMT_NVCC +# define FMT_DEPRECATED_ALIAS +#else +# define FMT_DEPRECATED_ALIAS FMT_DEPRECATED +#endif + +#ifndef FMT_INLINE +# if FMT_GCC_VERSION || FMT_CLANG_VERSION +# define FMT_INLINE inline __attribute__((always_inline)) +# else +# define FMT_INLINE inline +# endif +#endif + +#ifndef FMT_BEGIN_NAMESPACE +# if FMT_HAS_FEATURE(cxx_inline_namespaces) || FMT_GCC_VERSION >= 404 || \ + FMT_MSC_VER >= 1900 +# define FMT_INLINE_NAMESPACE inline namespace +# define FMT_END_NAMESPACE \ + } \ + } +# else +# define FMT_INLINE_NAMESPACE namespace +# define FMT_END_NAMESPACE \ + } \ + using namespace v7; \ + } +# endif +# define FMT_BEGIN_NAMESPACE \ + namespace fmt { \ + FMT_INLINE_NAMESPACE v7 { +#endif + +#if !defined(FMT_HEADER_ONLY) && defined(_WIN32) +# define FMT_CLASS_API FMT_SUPPRESS_MSC_WARNING(4275) +# ifdef FMT_EXPORT +# define FMT_API __declspec(dllexport) +# define FMT_EXTERN_TEMPLATE_API FMT_API +# define FMT_EXPORTED +# elif defined(FMT_SHARED) +# define FMT_API __declspec(dllimport) +# define FMT_EXTERN_TEMPLATE_API FMT_API +# endif +#else +# define FMT_CLASS_API +#endif +#ifndef FMT_API +# define FMT_API +#endif +#ifndef FMT_EXTERN_TEMPLATE_API +# define FMT_EXTERN_TEMPLATE_API +#endif +#ifndef FMT_INSTANTIATION_DEF_API +# define FMT_INSTANTIATION_DEF_API FMT_API +#endif + +#ifndef FMT_HEADER_ONLY +# define FMT_EXTERN extern +#else +# define FMT_EXTERN +#endif + +// libc++ supports string_view in pre-c++17. +#if (FMT_HAS_INCLUDE() && \ + (__cplusplus > 201402L || defined(_LIBCPP_VERSION))) || \ + (defined(_MSVC_LANG) && _MSVC_LANG > 201402L && _MSC_VER >= 1910) +# include +# define FMT_USE_STRING_VIEW +#elif FMT_HAS_INCLUDE("experimental/string_view") && __cplusplus >= 201402L +# include +# define FMT_USE_EXPERIMENTAL_STRING_VIEW +#endif + +#ifndef FMT_UNICODE +# define FMT_UNICODE !FMT_MSC_VER +#endif +#if FMT_UNICODE && FMT_MSC_VER +# pragma execution_character_set("utf-8") +#endif + +FMT_BEGIN_NAMESPACE + +// Implementations of enable_if_t and other metafunctions for older systems. +template +using enable_if_t = typename std::enable_if::type; +template +using conditional_t = typename std::conditional::type; +template using bool_constant = std::integral_constant; +template +using remove_reference_t = typename std::remove_reference::type; +template +using remove_const_t = typename std::remove_const::type; +template +using remove_cvref_t = typename std::remove_cv>::type; +template struct type_identity { using type = T; }; +template using type_identity_t = typename type_identity::type; + +struct monostate {}; + +// An enable_if helper to be used in template parameters which results in much +// shorter symbols: https://godbolt.org/z/sWw4vP. Extra parentheses are needed +// to workaround a bug in MSVC 2019 (see #1140 and #1186). +#define FMT_ENABLE_IF(...) enable_if_t<(__VA_ARGS__), int> = 0 + +namespace detail { + +// A helper function to suppress bogus "conditional expression is constant" +// warnings. +template constexpr T const_check(T value) { return value; } + +FMT_NORETURN FMT_API void assert_fail(const char* file, int line, + const char* message); + +#ifndef FMT_ASSERT +# ifdef NDEBUG +// FMT_ASSERT is not empty to avoid -Werror=empty-body. +# define FMT_ASSERT(condition, message) ((void)0) +# else +# define FMT_ASSERT(condition, message) \ + ((condition) /* void() fails with -Winvalid-constexpr on clang 4.0.1 */ \ + ? (void)0 \ + : ::fmt::detail::assert_fail(__FILE__, __LINE__, (message))) +# endif +#endif + +#if defined(FMT_USE_STRING_VIEW) +template using std_string_view = std::basic_string_view; +#elif defined(FMT_USE_EXPERIMENTAL_STRING_VIEW) +template +using std_string_view = std::experimental::basic_string_view; +#else +template struct std_string_view {}; +#endif + +#ifdef FMT_USE_INT128 +// Do nothing. +#elif defined(__SIZEOF_INT128__) && !FMT_NVCC && !(FMT_CLANG_VERSION && FMT_MSC_VER) +# define FMT_USE_INT128 1 +using int128_t = __int128_t; +using uint128_t = __uint128_t; +#else +# define FMT_USE_INT128 0 +#endif +#if !FMT_USE_INT128 +struct int128_t {}; +struct uint128_t {}; +#endif + +// Casts a nonnegative integer to unsigned. +template +FMT_CONSTEXPR typename std::make_unsigned::type to_unsigned(Int value) { + FMT_ASSERT(value >= 0, "negative value"); + return static_cast::type>(value); +} + +FMT_SUPPRESS_MSC_WARNING(4566) constexpr unsigned char micro[] = "\u00B5"; + +template constexpr bool is_unicode() { + return FMT_UNICODE || sizeof(Char) != 1 || + (sizeof(micro) == 3 && micro[0] == 0xC2 && micro[1] == 0xB5); +} + +#ifdef __cpp_char8_t +using char8_type = char8_t; +#else +enum char8_type : unsigned char {}; +#endif +} // namespace detail + +#ifdef FMT_USE_INTERNAL +namespace internal = detail; // DEPRECATED +#endif + +/** + An implementation of ``std::basic_string_view`` for pre-C++17. It provides a + subset of the API. ``fmt::basic_string_view`` is used for format strings even + if ``std::string_view`` is available to prevent issues when a library is + compiled with a different ``-std`` option than the client code (which is not + recommended). + */ +template class basic_string_view { + private: + const Char* data_; + size_t size_; + + public: + using value_type = Char; + using iterator = const Char*; + + constexpr basic_string_view() FMT_NOEXCEPT : data_(nullptr), size_(0) {} + + /** Constructs a string reference object from a C string and a size. */ + constexpr basic_string_view(const Char* s, size_t count) FMT_NOEXCEPT + : data_(s), + size_(count) {} + + /** + \rst + Constructs a string reference object from a C string computing + the size with ``std::char_traits::length``. + \endrst + */ +#if __cplusplus >= 201703L // C++17's char_traits::length() is constexpr. + FMT_CONSTEXPR +#endif + basic_string_view(const Char* s) + : data_(s), size_(std::char_traits::length(s)) {} + + /** Constructs a string reference from a ``std::basic_string`` object. */ + template + FMT_CONSTEXPR basic_string_view( + const std::basic_string& s) FMT_NOEXCEPT + : data_(s.data()), + size_(s.size()) {} + + template >::value)> + FMT_CONSTEXPR basic_string_view(S s) FMT_NOEXCEPT : data_(s.data()), + size_(s.size()) {} + + /** Returns a pointer to the string data. */ + constexpr const Char* data() const { return data_; } + + /** Returns the string size. */ + constexpr size_t size() const { return size_; } + + constexpr iterator begin() const { return data_; } + constexpr iterator end() const { return data_ + size_; } + + constexpr const Char& operator[](size_t pos) const { return data_[pos]; } + + FMT_CONSTEXPR void remove_prefix(size_t n) { + data_ += n; + size_ -= n; + } + + // Lexicographically compare this string reference to other. + int compare(basic_string_view other) const { + size_t str_size = size_ < other.size_ ? size_ : other.size_; + int result = std::char_traits::compare(data_, other.data_, str_size); + if (result == 0) + result = size_ == other.size_ ? 0 : (size_ < other.size_ ? -1 : 1); + return result; + } + + friend bool operator==(basic_string_view lhs, basic_string_view rhs) { + return lhs.compare(rhs) == 0; + } + friend bool operator!=(basic_string_view lhs, basic_string_view rhs) { + return lhs.compare(rhs) != 0; + } + friend bool operator<(basic_string_view lhs, basic_string_view rhs) { + return lhs.compare(rhs) < 0; + } + friend bool operator<=(basic_string_view lhs, basic_string_view rhs) { + return lhs.compare(rhs) <= 0; + } + friend bool operator>(basic_string_view lhs, basic_string_view rhs) { + return lhs.compare(rhs) > 0; + } + friend bool operator>=(basic_string_view lhs, basic_string_view rhs) { + return lhs.compare(rhs) >= 0; + } +}; + +using string_view = basic_string_view; +using wstring_view = basic_string_view; + +/** Specifies if ``T`` is a character type. Can be specialized by users. */ +template struct is_char : std::false_type {}; +template <> struct is_char : std::true_type {}; +template <> struct is_char : std::true_type {}; +template <> struct is_char : std::true_type {}; +template <> struct is_char : std::true_type {}; +template <> struct is_char : std::true_type {}; + +/** + \rst + Returns a string view of `s`. In order to add custom string type support to + {fmt} provide an overload of `to_string_view` for it in the same namespace as + the type for the argument-dependent lookup to work. + + **Example**:: + + namespace my_ns { + inline string_view to_string_view(const my_string& s) { + return {s.data(), s.length()}; + } + } + std::string message = fmt::format(my_string("The answer is {}"), 42); + \endrst + */ +template ::value)> +inline basic_string_view to_string_view(const Char* s) { + return s; +} + +template +inline basic_string_view to_string_view( + const std::basic_string& s) { + return s; +} + +template +inline basic_string_view to_string_view(basic_string_view s) { + return s; +} + +template >::value)> +inline basic_string_view to_string_view(detail::std_string_view s) { + return s; +} + +// A base class for compile-time strings. It is defined in the fmt namespace to +// make formatting functions visible via ADL, e.g. format(FMT_STRING("{}"), 42). +struct compile_string {}; + +template +struct is_compile_string : std::is_base_of {}; + +template ::value)> +constexpr basic_string_view to_string_view(const S& s) { + return s; +} + +namespace detail { +void to_string_view(...); +using fmt::v7::to_string_view; + +// Specifies whether S is a string type convertible to fmt::basic_string_view. +// It should be a constexpr function but MSVC 2017 fails to compile it in +// enable_if and MSVC 2015 fails to compile it as an alias template. +template +struct is_string : std::is_class()))> { +}; + +template struct char_t_impl {}; +template struct char_t_impl::value>> { + using result = decltype(to_string_view(std::declval())); + using type = typename result::value_type; +}; + +struct error_handler { + constexpr error_handler() = default; + constexpr error_handler(const error_handler&) = default; + + // This function is intentionally not constexpr to give a compile-time error. + FMT_NORETURN FMT_API void on_error(const char* message); +}; +} // namespace detail + +/** String's character type. */ +template using char_t = typename detail::char_t_impl::type; + +/** + \rst + Parsing context consisting of a format string range being parsed and an + argument counter for automatic indexing. + + You can use one of the following type aliases for common character types: + + +-----------------------+-------------------------------------+ + | Type | Definition | + +=======================+=====================================+ + | format_parse_context | basic_format_parse_context | + +-----------------------+-------------------------------------+ + | wformat_parse_context | basic_format_parse_context | + +-----------------------+-------------------------------------+ + \endrst + */ +template +class basic_format_parse_context : private ErrorHandler { + private: + basic_string_view format_str_; + int next_arg_id_; + + public: + using char_type = Char; + using iterator = typename basic_string_view::iterator; + + explicit constexpr basic_format_parse_context( + basic_string_view format_str, ErrorHandler eh = {}) + : ErrorHandler(eh), format_str_(format_str), next_arg_id_(0) {} + + /** + Returns an iterator to the beginning of the format string range being + parsed. + */ + constexpr iterator begin() const FMT_NOEXCEPT { return format_str_.begin(); } + + /** + Returns an iterator past the end of the format string range being parsed. + */ + constexpr iterator end() const FMT_NOEXCEPT { return format_str_.end(); } + + /** Advances the begin iterator to ``it``. */ + FMT_CONSTEXPR void advance_to(iterator it) { + format_str_.remove_prefix(detail::to_unsigned(it - begin())); + } + + /** + Reports an error if using the manual argument indexing; otherwise returns + the next argument index and switches to the automatic indexing. + */ + FMT_CONSTEXPR int next_arg_id() { + // Don't check if the argument id is valid to avoid overhead and because it + // will be checked during formatting anyway. + if (next_arg_id_ >= 0) return next_arg_id_++; + on_error("cannot switch from manual to automatic argument indexing"); + return 0; + } + + /** + Reports an error if using the automatic argument indexing; otherwise + switches to the manual indexing. + */ + FMT_CONSTEXPR void check_arg_id(int) { + if (next_arg_id_ > 0) + on_error("cannot switch from automatic to manual argument indexing"); + else + next_arg_id_ = -1; + } + + FMT_CONSTEXPR void check_arg_id(basic_string_view) {} + + FMT_CONSTEXPR void on_error(const char* message) { + ErrorHandler::on_error(message); + } + + constexpr ErrorHandler error_handler() const { return *this; } +}; + +using format_parse_context = basic_format_parse_context; +using wformat_parse_context = basic_format_parse_context; + +template class basic_format_arg; +template class basic_format_args; +template class dynamic_format_arg_store; + +// A formatter for objects of type T. +template +struct formatter { + // A deleted default constructor indicates a disabled formatter. + formatter() = delete; +}; + +// Specifies if T has an enabled formatter specialization. A type can be +// formattable even if it doesn't have a formatter e.g. via a conversion. +template +using has_formatter = + std::is_constructible>; + +namespace detail { + +/** + \rst + A contiguous memory buffer with an optional growing ability. It is an internal + class and shouldn't be used directly, only via `~fmt::basic_memory_buffer`. + \endrst + */ +template class buffer { + private: + T* ptr_; + size_t size_; + size_t capacity_; + + protected: + // Don't initialize ptr_ since it is not accessed to save a few cycles. + FMT_SUPPRESS_MSC_WARNING(26495) + buffer(size_t sz) FMT_NOEXCEPT : size_(sz), capacity_(sz) {} + + buffer(T* p = nullptr, size_t sz = 0, size_t cap = 0) FMT_NOEXCEPT + : ptr_(p), + size_(sz), + capacity_(cap) {} + + /** Sets the buffer data and capacity. */ + void set(T* buf_data, size_t buf_capacity) FMT_NOEXCEPT { + ptr_ = buf_data; + capacity_ = buf_capacity; + } + + /** Increases the buffer capacity to hold at least *capacity* elements. */ + virtual void grow(size_t capacity) = 0; + + public: + using value_type = T; + using const_reference = const T&; + + buffer(const buffer&) = delete; + void operator=(const buffer&) = delete; + virtual ~buffer() = default; + + T* begin() FMT_NOEXCEPT { return ptr_; } + T* end() FMT_NOEXCEPT { return ptr_ + size_; } + + const T* begin() const FMT_NOEXCEPT { return ptr_; } + const T* end() const FMT_NOEXCEPT { return ptr_ + size_; } + + /** Returns the size of this buffer. */ + size_t size() const FMT_NOEXCEPT { return size_; } + + /** Returns the capacity of this buffer. */ + size_t capacity() const FMT_NOEXCEPT { return capacity_; } + + /** Returns a pointer to the buffer data. */ + T* data() FMT_NOEXCEPT { return ptr_; } + + /** Returns a pointer to the buffer data. */ + const T* data() const FMT_NOEXCEPT { return ptr_; } + + /** + Resizes the buffer. If T is a POD type new elements may not be initialized. + */ + void resize(size_t new_size) { + reserve(new_size); + size_ = new_size; + } + + /** Clears this buffer. */ + void clear() { size_ = 0; } + + /** Reserves space to store at least *capacity* elements. */ + void reserve(size_t new_capacity) { + if (new_capacity > capacity_) grow(new_capacity); + } + + void push_back(const T& value) { + reserve(size_ + 1); + ptr_[size_++] = value; + } + + /** Appends data to the end of the buffer. */ + template void append(const U* begin, const U* end); + + template T& operator[](I index) { return ptr_[index]; } + template const T& operator[](I index) const { + return ptr_[index]; + } +}; + +// A container-backed buffer. +template +class container_buffer : public buffer { + private: + Container& container_; + + protected: + void grow(size_t capacity) FMT_OVERRIDE { + container_.resize(capacity); + this->set(&container_[0], capacity); + } + + public: + explicit container_buffer(Container& c) + : buffer(c.size()), container_(c) {} +}; + +// Extracts a reference to the container from back_insert_iterator. +template +inline Container& get_container(std::back_insert_iterator it) { + using bi_iterator = std::back_insert_iterator; + struct accessor : bi_iterator { + accessor(bi_iterator iter) : bi_iterator(iter) {} + using bi_iterator::container; + }; + return *accessor(it).container; +} + +template +struct fallback_formatter { + fallback_formatter() = delete; +}; + +// Specifies if T has an enabled fallback_formatter specialization. +template +using has_fallback_formatter = + std::is_constructible>; + +struct view {}; + +template struct named_arg : view { + const Char* name; + const T& value; + named_arg(const Char* n, const T& v) : name(n), value(v) {} +}; + +template struct named_arg_info { + const Char* name; + int id; +}; + +template +struct arg_data { + // args_[0].named_args points to named_args_ to avoid bloating format_args. + T args_[1 + (NUM_ARGS != 0 ? NUM_ARGS : 1)]; + named_arg_info named_args_[NUM_NAMED_ARGS]; + + template + arg_data(const U&... init) : args_{T(named_args_, NUM_NAMED_ARGS), init...} {} + arg_data(const arg_data& other) = delete; + const T* args() const { return args_ + 1; } + named_arg_info* named_args() { return named_args_; } +}; + +template +struct arg_data { + T args_[NUM_ARGS != 0 ? NUM_ARGS : 1]; + + template + FMT_INLINE arg_data(const U&... init) : args_{init...} {} + FMT_INLINE const T* args() const { return args_; } + FMT_INLINE std::nullptr_t named_args() { return nullptr; } +}; + +template +inline void init_named_args(named_arg_info*, int, int) {} + +template +void init_named_args(named_arg_info* named_args, int arg_count, + int named_arg_count, const T&, const Tail&... args) { + init_named_args(named_args, arg_count + 1, named_arg_count, args...); +} + +template +void init_named_args(named_arg_info* named_args, int arg_count, + int named_arg_count, const named_arg& arg, + const Tail&... args) { + named_args[named_arg_count++] = {arg.name, arg_count}; + init_named_args(named_args, arg_count + 1, named_arg_count, args...); +} + +template +FMT_INLINE void init_named_args(std::nullptr_t, int, int, const Args&...) {} + +template struct is_named_arg : std::false_type {}; + +template +struct is_named_arg> : std::true_type {}; + +template constexpr size_t count() { return B ? 1 : 0; } +template constexpr size_t count() { + return (B1 ? 1 : 0) + count(); +} + +template constexpr size_t count_named_args() { + return count::value...>(); +} + +enum class type { + none_type, + // Integer types should go first, + int_type, + uint_type, + long_long_type, + ulong_long_type, + int128_type, + uint128_type, + bool_type, + char_type, + last_integer_type = char_type, + // followed by floating-point types. + float_type, + double_type, + long_double_type, + last_numeric_type = long_double_type, + cstring_type, + string_type, + pointer_type, + custom_type +}; + +// Maps core type T to the corresponding type enum constant. +template +struct type_constant : std::integral_constant {}; + +#define FMT_TYPE_CONSTANT(Type, constant) \ + template \ + struct type_constant \ + : std::integral_constant {} + +FMT_TYPE_CONSTANT(int, int_type); +FMT_TYPE_CONSTANT(unsigned, uint_type); +FMT_TYPE_CONSTANT(long long, long_long_type); +FMT_TYPE_CONSTANT(unsigned long long, ulong_long_type); +FMT_TYPE_CONSTANT(int128_t, int128_type); +FMT_TYPE_CONSTANT(uint128_t, uint128_type); +FMT_TYPE_CONSTANT(bool, bool_type); +FMT_TYPE_CONSTANT(Char, char_type); +FMT_TYPE_CONSTANT(float, float_type); +FMT_TYPE_CONSTANT(double, double_type); +FMT_TYPE_CONSTANT(long double, long_double_type); +FMT_TYPE_CONSTANT(const Char*, cstring_type); +FMT_TYPE_CONSTANT(basic_string_view, string_type); +FMT_TYPE_CONSTANT(const void*, pointer_type); + +constexpr bool is_integral_type(type t) { + return t > type::none_type && t <= type::last_integer_type; +} + +constexpr bool is_arithmetic_type(type t) { + return t > type::none_type && t <= type::last_numeric_type; +} + +template struct string_value { + const Char* data; + size_t size; +}; + +template struct named_arg_value { + const named_arg_info* data; + size_t size; +}; + +template struct custom_value { + using parse_context = typename Context::parse_context_type; + const void* value; + void (*format)(const void* arg, parse_context& parse_ctx, Context& ctx); +}; + +// A formatting argument value. +template class value { + public: + using char_type = typename Context::char_type; + + union { + int int_value; + unsigned uint_value; + long long long_long_value; + unsigned long long ulong_long_value; + int128_t int128_value; + uint128_t uint128_value; + bool bool_value; + char_type char_value; + float float_value; + double double_value; + long double long_double_value; + const void* pointer; + string_value string; + custom_value custom; + named_arg_value named_args; + }; + + constexpr FMT_INLINE value(int val = 0) : int_value(val) {} + constexpr FMT_INLINE value(unsigned val) : uint_value(val) {} + FMT_INLINE value(long long val) : long_long_value(val) {} + FMT_INLINE value(unsigned long long val) : ulong_long_value(val) {} + FMT_INLINE value(int128_t val) : int128_value(val) {} + FMT_INLINE value(uint128_t val) : uint128_value(val) {} + FMT_INLINE value(float val) : float_value(val) {} + FMT_INLINE value(double val) : double_value(val) {} + FMT_INLINE value(long double val) : long_double_value(val) {} + FMT_INLINE value(bool val) : bool_value(val) {} + FMT_INLINE value(char_type val) : char_value(val) {} + FMT_INLINE value(const char_type* val) { string.data = val; } + FMT_INLINE value(basic_string_view val) { + string.data = val.data(); + string.size = val.size(); + } + FMT_INLINE value(const void* val) : pointer(val) {} + FMT_INLINE value(const named_arg_info* args, size_t size) + : named_args{args, size} {} + + template FMT_INLINE value(const T& val) { + custom.value = &val; + // Get the formatter type through the context to allow different contexts + // have different extension points, e.g. `formatter` for `format` and + // `printf_formatter` for `printf`. + custom.format = format_custom_arg< + T, conditional_t::value, + typename Context::template formatter_type, + fallback_formatter>>; + } + + private: + // Formats an argument of a custom type, such as a user-defined class. + template + static void format_custom_arg(const void* arg, + typename Context::parse_context_type& parse_ctx, + Context& ctx) { + Formatter f; + parse_ctx.advance_to(f.parse(parse_ctx)); + ctx.advance_to(f.format(*static_cast(arg), ctx)); + } +}; + +template +FMT_CONSTEXPR basic_format_arg make_arg(const T& value); + +// To minimize the number of types we need to deal with, long is translated +// either to int or to long long depending on its size. +enum { long_short = sizeof(long) == sizeof(int) }; +using long_type = conditional_t; +using ulong_type = conditional_t; + +// Maps formatting arguments to core types. +template struct arg_mapper { + using char_type = typename Context::char_type; + + FMT_CONSTEXPR int map(signed char val) { return val; } + FMT_CONSTEXPR unsigned map(unsigned char val) { return val; } + FMT_CONSTEXPR int map(short val) { return val; } + FMT_CONSTEXPR unsigned map(unsigned short val) { return val; } + FMT_CONSTEXPR int map(int val) { return val; } + FMT_CONSTEXPR unsigned map(unsigned val) { return val; } + FMT_CONSTEXPR long_type map(long val) { return val; } + FMT_CONSTEXPR ulong_type map(unsigned long val) { return val; } + FMT_CONSTEXPR long long map(long long val) { return val; } + FMT_CONSTEXPR unsigned long long map(unsigned long long val) { return val; } + FMT_CONSTEXPR int128_t map(int128_t val) { return val; } + FMT_CONSTEXPR uint128_t map(uint128_t val) { return val; } + FMT_CONSTEXPR bool map(bool val) { return val; } + + template ::value)> + FMT_CONSTEXPR char_type map(T val) { + static_assert( + std::is_same::value || std::is_same::value, + "mixing character types is disallowed"); + return val; + } + + FMT_CONSTEXPR float map(float val) { return val; } + FMT_CONSTEXPR double map(double val) { return val; } + FMT_CONSTEXPR long double map(long double val) { return val; } + + FMT_CONSTEXPR const char_type* map(char_type* val) { return val; } + FMT_CONSTEXPR const char_type* map(const char_type* val) { return val; } + template ::value)> + FMT_CONSTEXPR basic_string_view map(const T& val) { + static_assert(std::is_same>::value, + "mixing character types is disallowed"); + return to_string_view(val); + } + template , T>::value && + !is_string::value && !has_formatter::value && + !has_fallback_formatter::value)> + FMT_CONSTEXPR basic_string_view map(const T& val) { + return basic_string_view(val); + } + template < + typename T, + FMT_ENABLE_IF( + std::is_constructible, T>::value && + !std::is_constructible, T>::value && + !is_string::value && !has_formatter::value && + !has_fallback_formatter::value)> + FMT_CONSTEXPR basic_string_view map(const T& val) { + return std_string_view(val); + } + FMT_CONSTEXPR const char* map(const signed char* val) { + static_assert(std::is_same::value, "invalid string type"); + return reinterpret_cast(val); + } + FMT_CONSTEXPR const char* map(const unsigned char* val) { + static_assert(std::is_same::value, "invalid string type"); + return reinterpret_cast(val); + } + FMT_CONSTEXPR const char* map(signed char* val) { + const auto* const_val = val; + return map(const_val); + } + FMT_CONSTEXPR const char* map(unsigned char* val) { + const auto* const_val = val; + return map(const_val); + } + + FMT_CONSTEXPR const void* map(void* val) { return val; } + FMT_CONSTEXPR const void* map(const void* val) { return val; } + FMT_CONSTEXPR const void* map(std::nullptr_t val) { return val; } + template FMT_CONSTEXPR int map(const T*) { + // Formatting of arbitrary pointers is disallowed. If you want to output + // a pointer cast it to "void *" or "const void *". In particular, this + // forbids formatting of "[const] volatile char *" which is printed as bool + // by iostreams. + static_assert(!sizeof(T), "formatting of non-void pointers is disallowed"); + return 0; + } + + template ::value && + !has_formatter::value && + !has_fallback_formatter::value)> + FMT_CONSTEXPR auto map(const T& val) + -> decltype(std::declval().map( + static_cast::type>(val))) { + return map(static_cast::type>(val)); + } + template ::value && !is_char::value && + (has_formatter::value || + has_fallback_formatter::value))> + FMT_CONSTEXPR const T& map(const T& val) { + return val; + } + + template + FMT_CONSTEXPR auto map(const named_arg& val) + -> decltype(std::declval().map(val.value)) { + return map(val.value); + } + + int map(...) { + constexpr bool formattable = sizeof(Context) == 0; + static_assert( + formattable, + "Cannot format argument. To make type T formattable provide a " + "formatter specialization: " + "https://fmt.dev/latest/api.html#formatting-user-defined-types"); + return 0; + } +}; + +// A type constant after applying arg_mapper. +template +using mapped_type_constant = + type_constant().map(std::declval())), + typename Context::char_type>; + +enum { packed_arg_bits = 4 }; +// Maximum number of arguments with packed types. +enum { max_packed_args = 62 / packed_arg_bits }; +enum : unsigned long long { is_unpacked_bit = 1ULL << 63 }; +enum : unsigned long long { has_named_args_bit = 1ULL << 62 }; +} // namespace detail + +// A formatting argument. It is a trivially copyable/constructible type to +// allow storage in basic_memory_buffer. +template class basic_format_arg { + private: + detail::value value_; + detail::type type_; + + template + friend FMT_CONSTEXPR basic_format_arg detail::make_arg( + const T& value); + + template + friend FMT_CONSTEXPR auto visit_format_arg(Visitor&& vis, + const basic_format_arg& arg) + -> decltype(vis(0)); + + friend class basic_format_args; + friend class dynamic_format_arg_store; + + using char_type = typename Context::char_type; + + template + friend struct detail::arg_data; + + basic_format_arg(const detail::named_arg_info* args, size_t size) + : value_(args, size) {} + + public: + class handle { + public: + explicit handle(detail::custom_value custom) : custom_(custom) {} + + void format(typename Context::parse_context_type& parse_ctx, + Context& ctx) const { + custom_.format(custom_.value, parse_ctx, ctx); + } + + private: + detail::custom_value custom_; + }; + + constexpr basic_format_arg() : type_(detail::type::none_type) {} + + constexpr explicit operator bool() const FMT_NOEXCEPT { + return type_ != detail::type::none_type; + } + + detail::type type() const { return type_; } + + bool is_integral() const { return detail::is_integral_type(type_); } + bool is_arithmetic() const { return detail::is_arithmetic_type(type_); } +}; + +/** + \rst + Visits an argument dispatching to the appropriate visit method based on + the argument type. For example, if the argument type is ``double`` then + ``vis(value)`` will be called with the value of type ``double``. + \endrst + */ +template +FMT_CONSTEXPR_DECL FMT_INLINE auto visit_format_arg( + Visitor&& vis, const basic_format_arg& arg) -> decltype(vis(0)) { + using char_type = typename Context::char_type; + switch (arg.type_) { + case detail::type::none_type: + break; + case detail::type::int_type: + return vis(arg.value_.int_value); + case detail::type::uint_type: + return vis(arg.value_.uint_value); + case detail::type::long_long_type: + return vis(arg.value_.long_long_value); + case detail::type::ulong_long_type: + return vis(arg.value_.ulong_long_value); +#if FMT_USE_INT128 + case detail::type::int128_type: + return vis(arg.value_.int128_value); + case detail::type::uint128_type: + return vis(arg.value_.uint128_value); +#else + case detail::type::int128_type: + case detail::type::uint128_type: + break; +#endif + case detail::type::bool_type: + return vis(arg.value_.bool_value); + case detail::type::char_type: + return vis(arg.value_.char_value); + case detail::type::float_type: + return vis(arg.value_.float_value); + case detail::type::double_type: + return vis(arg.value_.double_value); + case detail::type::long_double_type: + return vis(arg.value_.long_double_value); + case detail::type::cstring_type: + return vis(arg.value_.string.data); + case detail::type::string_type: + return vis(basic_string_view(arg.value_.string.data, + arg.value_.string.size)); + case detail::type::pointer_type: + return vis(arg.value_.pointer); + case detail::type::custom_type: + return vis(typename basic_format_arg::handle(arg.value_.custom)); + } + return vis(monostate()); +} + +// Checks whether T is a container with contiguous storage. +template struct is_contiguous : std::false_type {}; +template +struct is_contiguous> : std::true_type {}; +template +struct is_contiguous> : std::true_type {}; + +namespace detail { + +template +struct is_back_insert_iterator : std::false_type {}; +template +struct is_back_insert_iterator> + : std::true_type {}; + +template +struct is_contiguous_back_insert_iterator : std::false_type {}; +template +struct is_contiguous_back_insert_iterator> + : is_contiguous {}; + +// A type-erased reference to an std::locale to avoid heavy include. +class locale_ref { + private: + const void* locale_; // A type-erased pointer to std::locale. + + public: + locale_ref() : locale_(nullptr) {} + template explicit locale_ref(const Locale& loc); + + explicit operator bool() const FMT_NOEXCEPT { return locale_ != nullptr; } + + template Locale get() const; +}; + +template constexpr unsigned long long encode_types() { return 0; } + +template +constexpr unsigned long long encode_types() { + return static_cast(mapped_type_constant::value) | + (encode_types() << packed_arg_bits); +} + +template +FMT_CONSTEXPR basic_format_arg make_arg(const T& value) { + basic_format_arg arg; + arg.type_ = mapped_type_constant::value; + arg.value_ = arg_mapper().map(value); + return arg; +} + +// The type template parameter is there to avoid an ODR violation when using +// a fallback formatter in one translation unit and an implicit conversion in +// another (not recommended). +template +inline value make_arg(const T& val) { + return arg_mapper().map(val); +} + +template +inline basic_format_arg make_arg(const T& value) { + return make_arg(value); +} + +template struct is_reference_wrapper : std::false_type {}; +template +struct is_reference_wrapper> : std::true_type {}; + +template const T& unwrap(const T& v) { return v; } +template const T& unwrap(const std::reference_wrapper& v) { + return static_cast(v); +} + +class dynamic_arg_list { + // Workaround for clang's -Wweak-vtables. Unlike for regular classes, for + // templates it doesn't complain about inability to deduce single translation + // unit for placing vtable. So storage_node_base is made a fake template. + template struct node { + virtual ~node() = default; + std::unique_ptr> next; + }; + + template struct typed_node : node<> { + T value; + + template + FMT_CONSTEXPR typed_node(const Arg& arg) : value(arg) {} + + template + FMT_CONSTEXPR typed_node(const basic_string_view& arg) + : value(arg.data(), arg.size()) {} + }; + + std::unique_ptr> head_; + + public: + template const T& push(const Arg& arg) { + auto new_node = std::unique_ptr>(new typed_node(arg)); + auto& value = new_node->value; + new_node->next = std::move(head_); + head_ = std::move(new_node); + return value; + } +}; +} // namespace detail + +// Formatting context. +template class basic_format_context { + public: + /** The character type for the output. */ + using char_type = Char; + + private: + OutputIt out_; + basic_format_args args_; + detail::locale_ref loc_; + + public: + using iterator = OutputIt; + using format_arg = basic_format_arg; + using parse_context_type = basic_format_parse_context; + template using formatter_type = formatter; + + basic_format_context(const basic_format_context&) = delete; + void operator=(const basic_format_context&) = delete; + /** + Constructs a ``basic_format_context`` object. References to the arguments are + stored in the object so make sure they have appropriate lifetimes. + */ + basic_format_context(OutputIt out, + basic_format_args ctx_args, + detail::locale_ref loc = detail::locale_ref()) + : out_(out), args_(ctx_args), loc_(loc) {} + + format_arg arg(int id) const { return args_.get(id); } + format_arg arg(basic_string_view name) { return args_.get(name); } + int arg_id(basic_string_view name) { return args_.get_id(name); } + const basic_format_args& args() const { return args_; } + + detail::error_handler error_handler() { return {}; } + void on_error(const char* message) { error_handler().on_error(message); } + + // Returns an iterator to the beginning of the output range. + iterator out() { return out_; } + + // Advances the begin iterator to ``it``. + void advance_to(iterator it) { + if (!detail::is_back_insert_iterator()) out_ = it; + } + + detail::locale_ref locale() { return loc_; } +}; + +template +using buffer_context = + basic_format_context>, Char>; +using format_context = buffer_context; +using wformat_context = buffer_context; + +// Workaround a bug in gcc: https://stackoverflow.com/q/62767544/471164. +#define FMT_BUFFER_CONTEXT(Char) \ + basic_format_context>, Char> + +/** + \rst + An array of references to arguments. It can be implicitly converted into + `~fmt::basic_format_args` for passing into type-erased formatting functions + such as `~fmt::vformat`. + \endrst + */ +template +class format_arg_store +#if FMT_GCC_VERSION && FMT_GCC_VERSION < 409 + // Workaround a GCC template argument substitution bug. + : public basic_format_args +#endif +{ + private: + static const size_t num_args = sizeof...(Args); + static const size_t num_named_args = detail::count_named_args(); + static const bool is_packed = num_args <= detail::max_packed_args; + + using value_type = conditional_t, + basic_format_arg>; + + detail::arg_data + data_; + + friend class basic_format_args; + + static constexpr unsigned long long desc = + (is_packed ? detail::encode_types() + : detail::is_unpacked_bit | num_args) | + (num_named_args != 0 + ? static_cast(detail::has_named_args_bit) + : 0); + + public: + format_arg_store(const Args&... args) + : +#if FMT_GCC_VERSION && FMT_GCC_VERSION < 409 + basic_format_args(*this), +#endif + data_{detail::make_arg< + is_packed, Context, + detail::mapped_type_constant::value>(args)...} { + detail::init_named_args(data_.named_args(), 0, 0, args...); + } +}; + +/** + \rst + Constructs an `~fmt::format_arg_store` object that contains references to + arguments and can be implicitly converted to `~fmt::format_args`. `Context` + can be omitted in which case it defaults to `~fmt::context`. + See `~fmt::arg` for lifetime considerations. + \endrst + */ +template +inline format_arg_store make_format_args( + const Args&... args) { + return {args...}; +} + +/** + \rst + Returns a named argument to be used in a formatting function. It should only + be used in a call to a formatting function. + + **Example**:: + + fmt::print("Elapsed time: {s:.2f} seconds", fmt::arg("s", 1.23)); + \endrst + */ +template +inline detail::named_arg arg(const Char* name, const T& arg) { + static_assert(!detail::is_named_arg(), "nested named arguments"); + return {name, arg}; +} + +/** + \rst + A dynamic version of `fmt::format_arg_store`. + It's equipped with a storage to potentially temporary objects which lifetimes + could be shorter than the format arguments object. + + It can be implicitly converted into `~fmt::basic_format_args` for passing + into type-erased formatting functions such as `~fmt::vformat`. + \endrst + */ +template +class dynamic_format_arg_store +#if FMT_GCC_VERSION && FMT_GCC_VERSION < 409 + // Workaround a GCC template argument substitution bug. + : public basic_format_args +#endif +{ + private: + using char_type = typename Context::char_type; + + template struct need_copy { + static constexpr detail::type mapped_type = + detail::mapped_type_constant::value; + + enum { + value = !(detail::is_reference_wrapper::value || + std::is_same>::value || + std::is_same>::value || + (mapped_type != detail::type::cstring_type && + mapped_type != detail::type::string_type && + mapped_type != detail::type::custom_type)) + }; + }; + + template + using stored_type = conditional_t::value, + std::basic_string, T>; + + // Storage of basic_format_arg must be contiguous. + std::vector> data_; + std::vector> named_info_; + + // Storage of arguments not fitting into basic_format_arg must grow + // without relocation because items in data_ refer to it. + detail::dynamic_arg_list dynamic_args_; + + friend class basic_format_args; + + unsigned long long get_types() const { + return detail::is_unpacked_bit | data_.size() | + (named_info_.empty() + ? 0ULL + : static_cast(detail::has_named_args_bit)); + } + + const basic_format_arg* data() const { + return named_info_.empty() ? data_.data() : data_.data() + 1; + } + + template void emplace_arg(const T& arg) { + data_.emplace_back(detail::make_arg(arg)); + } + + template + void emplace_arg(const detail::named_arg& arg) { + if (named_info_.empty()) { + constexpr const detail::named_arg_info* zero_ptr{nullptr}; + data_.insert(data_.begin(), {zero_ptr, 0}); + } + data_.emplace_back(detail::make_arg(detail::unwrap(arg.value))); + auto pop_one = [](std::vector>* data) { + data->pop_back(); + }; + std::unique_ptr>, decltype(pop_one)> + guard{&data_, pop_one}; + named_info_.push_back({arg.name, static_cast(data_.size() - 2u)}); + data_[0].value_.named_args = {named_info_.data(), named_info_.size()}; + guard.release(); + } + + public: + /** + \rst + Adds an argument into the dynamic store for later passing to a formatting + function. + + Note that custom types and string types (but not string views) are copied + into the store dynamically allocating memory if necessary. + + **Example**:: + + fmt::dynamic_format_arg_store store; + store.push_back(42); + store.push_back("abc"); + store.push_back(1.5f); + std::string result = fmt::vformat("{} and {} and {}", store); + \endrst + */ + template void push_back(const T& arg) { + if (detail::const_check(need_copy::value)) + emplace_arg(dynamic_args_.push>(arg)); + else + emplace_arg(detail::unwrap(arg)); + } + + /** + \rst + Adds a reference to the argument into the dynamic store for later passing to + a formatting function. Supports named arguments wrapped in + ``std::reference_wrapper`` via ``std::ref()``/``std::cref()``. + + **Example**:: + + fmt::dynamic_format_arg_store store; + char str[] = "1234567890"; + store.push_back(std::cref(str)); + int a1_val{42}; + auto a1 = fmt::arg("a1_", a1_val); + store.push_back(std::cref(a1)); + + // Changing str affects the output but only for string and custom types. + str[0] = 'X'; + + std::string result = fmt::vformat("{} and {a1_}"); + assert(result == "X234567890 and 42"); + \endrst + */ + template void push_back(std::reference_wrapper arg) { + static_assert( + detail::is_named_arg::type>::value || + need_copy::value, + "objects of built-in types and string views are always copied"); + emplace_arg(arg.get()); + } + + /** + Adds named argument into the dynamic store for later passing to a formatting + function. ``std::reference_wrapper`` is supported to avoid copying of the + argument. + */ + template + void push_back(const detail::named_arg& arg) { + const char_type* arg_name = + dynamic_args_.push>(arg.name).c_str(); + if (detail::const_check(need_copy::value)) { + emplace_arg( + fmt::arg(arg_name, dynamic_args_.push>(arg.value))); + } else { + emplace_arg(fmt::arg(arg_name, arg.value)); + } + } + + /** Erase all elements from the store */ + void clear() { + data_.clear(); + named_info_.clear(); + dynamic_args_ = detail::dynamic_arg_list(); + } + + /** + \rst + Reserves space to store at least *new_cap* arguments including + *new_cap_named* named arguments. + \endrst + */ + void reserve(size_t new_cap, size_t new_cap_named) { + FMT_ASSERT(new_cap >= new_cap_named, + "Set of arguments includes set of named arguments"); + data_.reserve(new_cap); + named_info_.reserve(new_cap_named); + } +}; + +/** + \rst + A view of a collection of formatting arguments. To avoid lifetime issues it + should only be used as a parameter type in type-erased functions such as + ``vformat``:: + + void vlog(string_view format_str, format_args args); // OK + format_args args = make_format_args(42); // Error: dangling reference + \endrst + */ +template class basic_format_args { + public: + using size_type = int; + using format_arg = basic_format_arg; + + private: + // A descriptor that contains information about formatting arguments. + // If the number of arguments is less or equal to max_packed_args then + // argument types are passed in the descriptor. This reduces binary code size + // per formatting function call. + unsigned long long desc_; + union { + // If is_packed() returns true then argument values are stored in values_; + // otherwise they are stored in args_. This is done to improve cache + // locality and reduce compiled code size since storing larger objects + // may require more code (at least on x86-64) even if the same amount of + // data is actually copied to stack. It saves ~10% on the bloat test. + const detail::value* values_; + const format_arg* args_; + }; + + bool is_packed() const { return (desc_ & detail::is_unpacked_bit) == 0; } + bool has_named_args() const { + return (desc_ & detail::has_named_args_bit) != 0; + } + + detail::type type(int index) const { + int shift = index * detail::packed_arg_bits; + unsigned int mask = (1 << detail::packed_arg_bits) - 1; + return static_cast((desc_ >> shift) & mask); + } + + basic_format_args(unsigned long long desc, + const detail::value* values) + : desc_(desc), values_(values) {} + basic_format_args(unsigned long long desc, const format_arg* args) + : desc_(desc), args_(args) {} + + public: + basic_format_args() : desc_(0) {} + + /** + \rst + Constructs a `basic_format_args` object from `~fmt::format_arg_store`. + \endrst + */ + template + FMT_INLINE basic_format_args(const format_arg_store& store) + : basic_format_args(store.desc, store.data_.args()) {} + + /** + \rst + Constructs a `basic_format_args` object from + `~fmt::dynamic_format_arg_store`. + \endrst + */ + FMT_INLINE basic_format_args(const dynamic_format_arg_store& store) + : basic_format_args(store.get_types(), store.data()) {} + + /** + \rst + Constructs a `basic_format_args` object from a dynamic set of arguments. + \endrst + */ + basic_format_args(const format_arg* args, int count) + : basic_format_args(detail::is_unpacked_bit | detail::to_unsigned(count), + args) {} + + /** Returns the argument with the specified id. */ + format_arg get(int id) const { + format_arg arg; + if (!is_packed()) { + if (id < max_size()) arg = args_[id]; + return arg; + } + if (id >= detail::max_packed_args) return arg; + arg.type_ = type(id); + if (arg.type_ == detail::type::none_type) return arg; + arg.value_ = values_[id]; + return arg; + } + + template format_arg get(basic_string_view name) const { + int id = get_id(name); + return id >= 0 ? get(id) : format_arg(); + } + + template int get_id(basic_string_view name) const { + if (!has_named_args()) return -1; + const auto& named_args = + (is_packed() ? values_[-1] : args_[-1].value_).named_args; + for (size_t i = 0; i < named_args.size; ++i) { + if (named_args.data[i].name == name) return named_args.data[i].id; + } + return -1; + } + + int max_size() const { + unsigned long long max_packed = detail::max_packed_args; + return static_cast(is_packed() ? max_packed + : desc_ & ~detail::is_unpacked_bit); + } +}; + +/** An alias to ``basic_format_args``. */ +// It is a separate type rather than an alias to make symbols readable. +struct format_args : basic_format_args { + template + FMT_INLINE format_args(const Args&... args) : basic_format_args(args...) {} +}; +struct wformat_args : basic_format_args { + using basic_format_args::basic_format_args; +}; + +namespace detail { + +// Reports a compile-time error if S is not a valid format string. +template ::value)> +FMT_INLINE void check_format_string(const S&) { +#ifdef FMT_ENFORCE_COMPILE_STRING + static_assert(is_compile_string::value, + "FMT_ENFORCE_COMPILE_STRING requires all format strings to use " + "FMT_STRING."); +#endif +} +template ::value)> +void check_format_string(S); + +template > +inline format_arg_store, remove_reference_t...> +make_args_checked(const S& format_str, + const remove_reference_t&... args) { + static_assert(count<(std::is_base_of>::value && + std::is_reference::value)...>() == 0, + "passing views as lvalues is disallowed"); + check_format_string(format_str); + return {args...}; +} + +template ::value)> +std::basic_string vformat( + basic_string_view format_str, + basic_format_args>> args); + +FMT_API std::string vformat(string_view format_str, format_args args); + +template +typename FMT_BUFFER_CONTEXT(Char)::iterator vformat_to( + buffer& buf, basic_string_view format_str, + basic_format_args)> args); + +template ::value)> +inline void vprint_mojibake(std::FILE*, basic_string_view, const Args&) {} + +FMT_API void vprint_mojibake(std::FILE*, string_view, format_args); +#ifndef _WIN32 +inline void vprint_mojibake(std::FILE*, string_view, format_args) {} +#endif +} // namespace detail + +/** Formats a string and writes the output to ``out``. */ +// GCC 8 and earlier cannot handle std::back_insert_iterator with +// vformat_to(...) overload, so SFINAE on iterator type instead. +template < + typename OutputIt, typename S, typename Char = char_t, + FMT_ENABLE_IF(detail::is_contiguous_back_insert_iterator::value)> +OutputIt vformat_to( + OutputIt out, const S& format_str, + basic_format_args>> args) { + auto& c = detail::get_container(out); + detail::container_buffer> buf(c); + detail::vformat_to(buf, to_string_view(format_str), args); + return out; +} + +template ::value&& detail::is_string::value)> +inline std::back_insert_iterator format_to( + std::back_insert_iterator out, const S& format_str, + Args&&... args) { + return vformat_to(out, to_string_view(format_str), + detail::make_args_checked(format_str, args...)); +} + +template > +FMT_INLINE std::basic_string vformat( + const S& format_str, + basic_format_args>> args) { + return detail::vformat(to_string_view(format_str), args); +} + +/** + \rst + Formats arguments and returns the result as a string. + + **Example**:: + + #include + std::string message = fmt::format("The answer is {}", 42); + \endrst +*/ +// Pass char_t as a default template parameter instead of using +// std::basic_string> to reduce the symbol size. +template > +FMT_INLINE std::basic_string format(const S& format_str, Args&&... args) { + const auto& vargs = detail::make_args_checked(format_str, args...); + return detail::vformat(to_string_view(format_str), vargs); +} + +FMT_API void vprint(string_view, format_args); +FMT_API void vprint(std::FILE*, string_view, format_args); + +/** + \rst + Formats ``args`` according to specifications in ``format_str`` and writes the + output to the file ``f``. Strings are assumed to be Unicode-encoded unless the + ``FMT_UNICODE`` macro is set to 0. + + **Example**:: + + fmt::print(stderr, "Don't {}!", "panic"); + \endrst + */ +template > +inline void print(std::FILE* f, const S& format_str, Args&&... args) { + const auto& vargs = detail::make_args_checked(format_str, args...); + return detail::is_unicode() + ? vprint(f, to_string_view(format_str), vargs) + : detail::vprint_mojibake(f, to_string_view(format_str), vargs); +} + +/** + \rst + Formats ``args`` according to specifications in ``format_str`` and writes + the output to ``stdout``. Strings are assumed to be Unicode-encoded unless + the ``FMT_UNICODE`` macro is set to 0. + + **Example**:: + + fmt::print("Elapsed time: {0:.2f} seconds", 1.23); + \endrst + */ +template > +inline void print(const S& format_str, Args&&... args) { + const auto& vargs = detail::make_args_checked(format_str, args...); + return detail::is_unicode() + ? vprint(to_string_view(format_str), vargs) + : detail::vprint_mojibake(stdout, to_string_view(format_str), + vargs); +} +FMT_END_NAMESPACE + +#endif // FMT_CORE_H_ diff --git a/ThirdParty/fmtlib/include/fmt/format-inl.h b/ThirdParty/fmtlib/include/fmt/format-inl.h new file mode 100644 index 0000000000..d8c9c8a5ee --- /dev/null +++ b/ThirdParty/fmtlib/include/fmt/format-inl.h @@ -0,0 +1,1453 @@ +// Formatting library for C++ - implementation +// +// Copyright (c) 2012 - 2016, Victor Zverovich +// All rights reserved. +// +// For the license information refer to format.h. + +#ifndef FMT_FORMAT_INL_H_ +#define FMT_FORMAT_INL_H_ + +#include +#include +#include +#include +#include +#include // for std::memmove +#include +#include + +#include "format.h" +#if !defined(FMT_STATIC_THOUSANDS_SEPARATOR) +# include +#endif + +#ifdef _WIN32 +# if !defined(NOMINMAX) && !defined(WIN32_LEAN_AND_MEAN) +# define NOMINMAX +# define WIN32_LEAN_AND_MEAN +# include +# undef WIN32_LEAN_AND_MEAN +# undef NOMINMAX +# else +# include +# endif +# include +#endif + +#ifdef _MSC_VER +# pragma warning(push) +# pragma warning(disable : 4702) // unreachable code +#endif + +// Dummy implementations of strerror_r and strerror_s called if corresponding +// system functions are not available. +inline fmt::detail::null<> strerror_r(int, char*, ...) { return {}; } +inline fmt::detail::null<> strerror_s(char*, size_t, ...) { return {}; } + +FMT_BEGIN_NAMESPACE +namespace detail { + +FMT_FUNC void assert_fail(const char* file, int line, const char* message) { + // Use unchecked std::fprintf to avoid triggering another assertion when + // writing to stderr fails + std::fprintf(stderr, "%s:%d: assertion failed: %s", file, line, message); + // Chosen instead of std::abort to satisfy Clang in CUDA mode during device + // code pass. + std::terminate(); +} + +#ifndef _MSC_VER +# define FMT_SNPRINTF snprintf +#else // _MSC_VER +inline int fmt_snprintf(char* buffer, size_t size, const char* format, ...) { + va_list args; + va_start(args, format); + int result = vsnprintf_s(buffer, size, _TRUNCATE, format, args); + va_end(args); + return result; +} +# define FMT_SNPRINTF fmt_snprintf +#endif // _MSC_VER + +// A portable thread-safe version of strerror. +// Sets buffer to point to a string describing the error code. +// This can be either a pointer to a string stored in buffer, +// or a pointer to some static immutable string. +// Returns one of the following values: +// 0 - success +// ERANGE - buffer is not large enough to store the error message +// other - failure +// Buffer should be at least of size 1. +FMT_FUNC int safe_strerror(int error_code, char*& buffer, + size_t buffer_size) FMT_NOEXCEPT { + FMT_ASSERT(buffer != nullptr && buffer_size != 0, "invalid buffer"); + + class dispatcher { + private: + int error_code_; + char*& buffer_; + size_t buffer_size_; + + // A noop assignment operator to avoid bogus warnings. + void operator=(const dispatcher&) {} + + // Handle the result of XSI-compliant version of strerror_r. + int handle(int result) { + // glibc versions before 2.13 return result in errno. + return result == -1 ? errno : result; + } + + // Handle the result of GNU-specific version of strerror_r. + FMT_MAYBE_UNUSED + int handle(char* message) { + // If the buffer is full then the message is probably truncated. + if (message == buffer_ && strlen(buffer_) == buffer_size_ - 1) + return ERANGE; + buffer_ = message; + return 0; + } + + // Handle the case when strerror_r is not available. + FMT_MAYBE_UNUSED + int handle(detail::null<>) { + return fallback(strerror_s(buffer_, buffer_size_, error_code_)); + } + + // Fallback to strerror_s when strerror_r is not available. + FMT_MAYBE_UNUSED + int fallback(int result) { + // If the buffer is full then the message is probably truncated. + return result == 0 && strlen(buffer_) == buffer_size_ - 1 ? ERANGE + : result; + } + +#if !FMT_MSC_VER + // Fallback to strerror if strerror_r and strerror_s are not available. + int fallback(detail::null<>) { + errno = 0; + buffer_ = strerror(error_code_); + return errno; + } +#endif + + public: + dispatcher(int err_code, char*& buf, size_t buf_size) + : error_code_(err_code), buffer_(buf), buffer_size_(buf_size) {} + + int run() { return handle(strerror_r(error_code_, buffer_, buffer_size_)); } + }; + return dispatcher(error_code, buffer, buffer_size).run(); +} + +FMT_FUNC void format_error_code(detail::buffer& out, int error_code, + string_view message) FMT_NOEXCEPT { + // Report error code making sure that the output fits into + // inline_buffer_size to avoid dynamic memory allocation and potential + // bad_alloc. + out.resize(0); + static const char SEP[] = ": "; + static const char ERROR_STR[] = "error "; + // Subtract 2 to account for terminating null characters in SEP and ERROR_STR. + size_t error_code_size = sizeof(SEP) + sizeof(ERROR_STR) - 2; + auto abs_value = static_cast>(error_code); + if (detail::is_negative(error_code)) { + abs_value = 0 - abs_value; + ++error_code_size; + } + error_code_size += detail::to_unsigned(detail::count_digits(abs_value)); + auto it = std::back_inserter(out); + if (message.size() <= inline_buffer_size - error_code_size) + format_to(it, "{}{}", message, SEP); + format_to(it, "{}{}", ERROR_STR, error_code); + assert(out.size() <= inline_buffer_size); +} + +FMT_FUNC void report_error(format_func func, int error_code, + string_view message) FMT_NOEXCEPT { + memory_buffer full_message; + func(full_message, error_code, message); + // Don't use fwrite_fully because the latter may throw. + (void)std::fwrite(full_message.data(), full_message.size(), 1, stderr); + std::fputc('\n', stderr); +} + +// A wrapper around fwrite that throws on error. +FMT_FUNC void fwrite_fully(const void* ptr, size_t size, size_t count, + FILE* stream) { + size_t written = std::fwrite(ptr, size, count, stream); + if (written < count) FMT_THROW(system_error(errno, "cannot write to file")); +} +} // namespace detail + +#if !defined(FMT_STATIC_THOUSANDS_SEPARATOR) +namespace detail { + +template +locale_ref::locale_ref(const Locale& loc) : locale_(&loc) { + static_assert(std::is_same::value, ""); +} + +template Locale locale_ref::get() const { + static_assert(std::is_same::value, ""); + return locale_ ? *static_cast(locale_) : std::locale(); +} + +template FMT_FUNC std::string grouping_impl(locale_ref loc) { + return std::use_facet>(loc.get()).grouping(); +} +template FMT_FUNC Char thousands_sep_impl(locale_ref loc) { + return std::use_facet>(loc.get()) + .thousands_sep(); +} +template FMT_FUNC Char decimal_point_impl(locale_ref loc) { + return std::use_facet>(loc.get()) + .decimal_point(); +} +} // namespace detail +#else +template +FMT_FUNC std::string detail::grouping_impl(locale_ref) { + return "\03"; +} +template FMT_FUNC Char detail::thousands_sep_impl(locale_ref) { + return FMT_STATIC_THOUSANDS_SEPARATOR; +} +template FMT_FUNC Char detail::decimal_point_impl(locale_ref) { + return '.'; +} +#endif + +FMT_API FMT_FUNC format_error::~format_error() FMT_NOEXCEPT = default; +FMT_API FMT_FUNC system_error::~system_error() FMT_NOEXCEPT = default; + +FMT_FUNC void system_error::init(int err_code, string_view format_str, + format_args args) { + error_code_ = err_code; + memory_buffer buffer; + format_system_error(buffer, err_code, vformat(format_str, args)); + std::runtime_error& base = *this; + base = std::runtime_error(to_string(buffer)); +} + +namespace detail { + +template <> FMT_FUNC int count_digits<4>(detail::fallback_uintptr n) { + // fallback_uintptr is always stored in little endian. + int i = static_cast(sizeof(void*)) - 1; + while (i > 0 && n.value[i] == 0) --i; + auto char_digits = std::numeric_limits::digits / 4; + return i >= 0 ? i * char_digits + count_digits<4, unsigned>(n.value[i]) : 1; +} + +template +const typename basic_data::digit_pair basic_data::digits[] = { + {'0', '0'}, {'0', '1'}, {'0', '2'}, {'0', '3'}, {'0', '4'}, + {'0', '5'}, {'0', '6'}, {'0', '7'}, {'0', '8'}, {'0', '9'}, + {'1', '0'}, {'1', '1'}, {'1', '2'}, {'1', '3'}, {'1', '4'}, + {'1', '5'}, {'1', '6'}, {'1', '7'}, {'1', '8'}, {'1', '9'}, + {'2', '0'}, {'2', '1'}, {'2', '2'}, {'2', '3'}, {'2', '4'}, + {'2', '5'}, {'2', '6'}, {'2', '7'}, {'2', '8'}, {'2', '9'}, + {'3', '0'}, {'3', '1'}, {'3', '2'}, {'3', '3'}, {'3', '4'}, + {'3', '5'}, {'3', '6'}, {'3', '7'}, {'3', '8'}, {'3', '9'}, + {'4', '0'}, {'4', '1'}, {'4', '2'}, {'4', '3'}, {'4', '4'}, + {'4', '5'}, {'4', '6'}, {'4', '7'}, {'4', '8'}, {'4', '9'}, + {'5', '0'}, {'5', '1'}, {'5', '2'}, {'5', '3'}, {'5', '4'}, + {'5', '5'}, {'5', '6'}, {'5', '7'}, {'5', '8'}, {'5', '9'}, + {'6', '0'}, {'6', '1'}, {'6', '2'}, {'6', '3'}, {'6', '4'}, + {'6', '5'}, {'6', '6'}, {'6', '7'}, {'6', '8'}, {'6', '9'}, + {'7', '0'}, {'7', '1'}, {'7', '2'}, {'7', '3'}, {'7', '4'}, + {'7', '5'}, {'7', '6'}, {'7', '7'}, {'7', '8'}, {'7', '9'}, + {'8', '0'}, {'8', '1'}, {'8', '2'}, {'8', '3'}, {'8', '4'}, + {'8', '5'}, {'8', '6'}, {'8', '7'}, {'8', '8'}, {'8', '9'}, + {'9', '0'}, {'9', '1'}, {'9', '2'}, {'9', '3'}, {'9', '4'}, + {'9', '5'}, {'9', '6'}, {'9', '7'}, {'9', '8'}, {'9', '9'}}; + +template +const char basic_data::hex_digits[] = "0123456789abcdef"; + +#define FMT_POWERS_OF_10(factor) \ + factor * 10, (factor)*100, (factor)*1000, (factor)*10000, (factor)*100000, \ + (factor)*1000000, (factor)*10000000, (factor)*100000000, \ + (factor)*1000000000 + +template +const uint64_t basic_data::powers_of_10_64[] = { + 1, FMT_POWERS_OF_10(1), FMT_POWERS_OF_10(1000000000ULL), + 10000000000000000000ULL}; + +template +const uint32_t basic_data::zero_or_powers_of_10_32[] = {0, + FMT_POWERS_OF_10(1)}; + +template +const uint64_t basic_data::zero_or_powers_of_10_64[] = { + 0, FMT_POWERS_OF_10(1), FMT_POWERS_OF_10(1000000000ULL), + 10000000000000000000ULL}; + +// Normalized 64-bit significands of pow(10, k), for k = -348, -340, ..., 340. +// These are generated by support/compute-powers.py. +template +const uint64_t basic_data::pow10_significands[] = { + 0xfa8fd5a0081c0288, 0xbaaee17fa23ebf76, 0x8b16fb203055ac76, + 0xcf42894a5dce35ea, 0x9a6bb0aa55653b2d, 0xe61acf033d1a45df, + 0xab70fe17c79ac6ca, 0xff77b1fcbebcdc4f, 0xbe5691ef416bd60c, + 0x8dd01fad907ffc3c, 0xd3515c2831559a83, 0x9d71ac8fada6c9b5, + 0xea9c227723ee8bcb, 0xaecc49914078536d, 0x823c12795db6ce57, + 0xc21094364dfb5637, 0x9096ea6f3848984f, 0xd77485cb25823ac7, + 0xa086cfcd97bf97f4, 0xef340a98172aace5, 0xb23867fb2a35b28e, + 0x84c8d4dfd2c63f3b, 0xc5dd44271ad3cdba, 0x936b9fcebb25c996, + 0xdbac6c247d62a584, 0xa3ab66580d5fdaf6, 0xf3e2f893dec3f126, + 0xb5b5ada8aaff80b8, 0x87625f056c7c4a8b, 0xc9bcff6034c13053, + 0x964e858c91ba2655, 0xdff9772470297ebd, 0xa6dfbd9fb8e5b88f, + 0xf8a95fcf88747d94, 0xb94470938fa89bcf, 0x8a08f0f8bf0f156b, + 0xcdb02555653131b6, 0x993fe2c6d07b7fac, 0xe45c10c42a2b3b06, + 0xaa242499697392d3, 0xfd87b5f28300ca0e, 0xbce5086492111aeb, + 0x8cbccc096f5088cc, 0xd1b71758e219652c, 0x9c40000000000000, + 0xe8d4a51000000000, 0xad78ebc5ac620000, 0x813f3978f8940984, + 0xc097ce7bc90715b3, 0x8f7e32ce7bea5c70, 0xd5d238a4abe98068, + 0x9f4f2726179a2245, 0xed63a231d4c4fb27, 0xb0de65388cc8ada8, + 0x83c7088e1aab65db, 0xc45d1df942711d9a, 0x924d692ca61be758, + 0xda01ee641a708dea, 0xa26da3999aef774a, 0xf209787bb47d6b85, + 0xb454e4a179dd1877, 0x865b86925b9bc5c2, 0xc83553c5c8965d3d, + 0x952ab45cfa97a0b3, 0xde469fbd99a05fe3, 0xa59bc234db398c25, + 0xf6c69a72a3989f5c, 0xb7dcbf5354e9bece, 0x88fcf317f22241e2, + 0xcc20ce9bd35c78a5, 0x98165af37b2153df, 0xe2a0b5dc971f303a, + 0xa8d9d1535ce3b396, 0xfb9b7cd9a4a7443c, 0xbb764c4ca7a44410, + 0x8bab8eefb6409c1a, 0xd01fef10a657842c, 0x9b10a4e5e9913129, + 0xe7109bfba19c0c9d, 0xac2820d9623bf429, 0x80444b5e7aa7cf85, + 0xbf21e44003acdd2d, 0x8e679c2f5e44ff8f, 0xd433179d9c8cb841, + 0x9e19db92b4e31ba9, 0xeb96bf6ebadf77d9, 0xaf87023b9bf0ee6b, +}; + +// Binary exponents of pow(10, k), for k = -348, -340, ..., 340, corresponding +// to significands above. +template +const int16_t basic_data::pow10_exponents[] = { + -1220, -1193, -1166, -1140, -1113, -1087, -1060, -1034, -1007, -980, -954, + -927, -901, -874, -847, -821, -794, -768, -741, -715, -688, -661, + -635, -608, -582, -555, -529, -502, -475, -449, -422, -396, -369, + -343, -316, -289, -263, -236, -210, -183, -157, -130, -103, -77, + -50, -24, 3, 30, 56, 83, 109, 136, 162, 189, 216, + 242, 269, 295, 322, 348, 375, 402, 428, 455, 481, 508, + 534, 561, 588, 614, 641, 667, 694, 720, 747, 774, 800, + 827, 853, 880, 907, 933, 960, 986, 1013, 1039, 1066}; + +template +const char basic_data::foreground_color[] = "\x1b[38;2;"; +template +const char basic_data::background_color[] = "\x1b[48;2;"; +template const char basic_data::reset_color[] = "\x1b[0m"; +template const wchar_t basic_data::wreset_color[] = L"\x1b[0m"; +template const char basic_data::signs[] = {0, '-', '+', ' '}; +template +const char basic_data::left_padding_shifts[] = {31, 31, 0, 1, 0}; +template +const char basic_data::right_padding_shifts[] = {0, 31, 0, 1, 0}; + +template struct bits { + static FMT_CONSTEXPR_DECL const int value = + static_cast(sizeof(T) * std::numeric_limits::digits); +}; + +class fp; +template fp normalize(fp value); + +// Lower (upper) boundary is a value half way between a floating-point value +// and its predecessor (successor). Boundaries have the same exponent as the +// value so only significands are stored. +struct boundaries { + uint64_t lower; + uint64_t upper; +}; + +// A handmade floating-point number f * pow(2, e). +class fp { + private: + using significand_type = uint64_t; + + public: + significand_type f; + int e; + + // All sizes are in bits. + // Subtract 1 to account for an implicit most significant bit in the + // normalized form. + static FMT_CONSTEXPR_DECL const int double_significand_size = + std::numeric_limits::digits - 1; + static FMT_CONSTEXPR_DECL const uint64_t implicit_bit = + 1ULL << double_significand_size; + static FMT_CONSTEXPR_DECL const int significand_size = + bits::value; + + fp() : f(0), e(0) {} + fp(uint64_t f_val, int e_val) : f(f_val), e(e_val) {} + + // Constructs fp from an IEEE754 double. It is a template to prevent compile + // errors on platforms where double is not IEEE754. + template explicit fp(Double d) { assign(d); } + + // Assigns d to this and return true iff predecessor is closer than successor. + template + bool assign(Double d) { + // Assume double is in the format [sign][exponent][significand]. + using limits = std::numeric_limits; + const int exponent_size = + bits::value - double_significand_size - 1; // -1 for sign + const uint64_t significand_mask = implicit_bit - 1; + const uint64_t exponent_mask = (~0ULL >> 1) & ~significand_mask; + const int exponent_bias = (1 << exponent_size) - limits::max_exponent - 1; + auto u = bit_cast(d); + f = u & significand_mask; + int biased_e = + static_cast((u & exponent_mask) >> double_significand_size); + // Predecessor is closer if d is a normalized power of 2 (f == 0) other than + // the smallest normalized number (biased_e > 1). + bool is_predecessor_closer = f == 0 && biased_e > 1; + if (biased_e != 0) + f += implicit_bit; + else + biased_e = 1; // Subnormals use biased exponent 1 (min exponent). + e = biased_e - exponent_bias - double_significand_size; + return is_predecessor_closer; + } + + template + bool assign(Double) { + *this = fp(); + return false; + } + + // Assigns d to this together with computing lower and upper boundaries, + // where a boundary is a value half way between the number and its predecessor + // (lower) or successor (upper). The upper boundary is normalized and lower + // has the same exponent but may be not normalized. + template boundaries assign_with_boundaries(Double d) { + bool is_lower_closer = assign(d); + fp lower = + is_lower_closer ? fp((f << 2) - 1, e - 2) : fp((f << 1) - 1, e - 1); + // 1 in normalize accounts for the exponent shift above. + fp upper = normalize<1>(fp((f << 1) + 1, e - 1)); + lower.f <<= lower.e - upper.e; + return boundaries{lower.f, upper.f}; + } + + template boundaries assign_float_with_boundaries(Double d) { + assign(d); + constexpr int min_normal_e = std::numeric_limits::min_exponent - + std::numeric_limits::digits; + significand_type half_ulp = 1 << (std::numeric_limits::digits - + std::numeric_limits::digits - 1); + if (min_normal_e > e) half_ulp <<= min_normal_e - e; + fp upper = normalize<0>(fp(f + half_ulp, e)); + fp lower = fp( + f - (half_ulp >> ((f == implicit_bit && e > min_normal_e) ? 1 : 0)), e); + lower.f <<= lower.e - upper.e; + return boundaries{lower.f, upper.f}; + } +}; + +// Normalizes the value converted from double and multiplied by (1 << SHIFT). +template fp normalize(fp value) { + // Handle subnormals. + const auto shifted_implicit_bit = fp::implicit_bit << SHIFT; + while ((value.f & shifted_implicit_bit) == 0) { + value.f <<= 1; + --value.e; + } + // Subtract 1 to account for hidden bit. + const auto offset = + fp::significand_size - fp::double_significand_size - SHIFT - 1; + value.f <<= offset; + value.e -= offset; + return value; +} + +inline bool operator==(fp x, fp y) { return x.f == y.f && x.e == y.e; } + +// Computes lhs * rhs / pow(2, 64) rounded to nearest with half-up tie breaking. +inline uint64_t multiply(uint64_t lhs, uint64_t rhs) { +#if FMT_USE_INT128 + auto product = static_cast<__uint128_t>(lhs) * rhs; + auto f = static_cast(product >> 64); + return (static_cast(product) & (1ULL << 63)) != 0 ? f + 1 : f; +#else + // Multiply 32-bit parts of significands. + uint64_t mask = (1ULL << 32) - 1; + uint64_t a = lhs >> 32, b = lhs & mask; + uint64_t c = rhs >> 32, d = rhs & mask; + uint64_t ac = a * c, bc = b * c, ad = a * d, bd = b * d; + // Compute mid 64-bit of result and round. + uint64_t mid = (bd >> 32) + (ad & mask) + (bc & mask) + (1U << 31); + return ac + (ad >> 32) + (bc >> 32) + (mid >> 32); +#endif +} + +inline fp operator*(fp x, fp y) { return {multiply(x.f, y.f), x.e + y.e + 64}; } + +// Returns a cached power of 10 `c_k = c_k.f * pow(2, c_k.e)` such that its +// (binary) exponent satisfies `min_exponent <= c_k.e <= min_exponent + 28`. +inline fp get_cached_power(int min_exponent, int& pow10_exponent) { + const int64_t one_over_log2_10 = 0x4d104d42; // round(pow(2, 32) / log2(10)) + int index = static_cast( + ((min_exponent + fp::significand_size - 1) * one_over_log2_10 + + ((int64_t(1) << 32) - 1)) // ceil + >> 32 // arithmetic shift + ); + // Decimal exponent of the first (smallest) cached power of 10. + const int first_dec_exp = -348; + // Difference between 2 consecutive decimal exponents in cached powers of 10. + const int dec_exp_step = 8; + index = (index - first_dec_exp - 1) / dec_exp_step + 1; + pow10_exponent = first_dec_exp + index * dec_exp_step; + return {data::pow10_significands[index], data::pow10_exponents[index]}; +} + +// A simple accumulator to hold the sums of terms in bigint::square if uint128_t +// is not available. +struct accumulator { + uint64_t lower; + uint64_t upper; + + accumulator() : lower(0), upper(0) {} + explicit operator uint32_t() const { return static_cast(lower); } + + void operator+=(uint64_t n) { + lower += n; + if (lower < n) ++upper; + } + void operator>>=(int shift) { + assert(shift == 32); + (void)shift; + lower = (upper << 32) | (lower >> 32); + upper >>= 32; + } +}; + +class bigint { + private: + // A bigint is stored as an array of bigits (big digits), with bigit at index + // 0 being the least significant one. + using bigit = uint32_t; + using double_bigit = uint64_t; + enum { bigits_capacity = 32 }; + basic_memory_buffer bigits_; + int exp_; + + bigit operator[](int index) const { return bigits_[to_unsigned(index)]; } + bigit& operator[](int index) { return bigits_[to_unsigned(index)]; } + + static FMT_CONSTEXPR_DECL const int bigit_bits = bits::value; + + friend struct formatter; + + void subtract_bigits(int index, bigit other, bigit& borrow) { + auto result = static_cast((*this)[index]) - other - borrow; + (*this)[index] = static_cast(result); + borrow = static_cast(result >> (bigit_bits * 2 - 1)); + } + + void remove_leading_zeros() { + int num_bigits = static_cast(bigits_.size()) - 1; + while (num_bigits > 0 && (*this)[num_bigits] == 0) --num_bigits; + bigits_.resize(to_unsigned(num_bigits + 1)); + } + + // Computes *this -= other assuming aligned bigints and *this >= other. + void subtract_aligned(const bigint& other) { + FMT_ASSERT(other.exp_ >= exp_, "unaligned bigints"); + FMT_ASSERT(compare(*this, other) >= 0, ""); + bigit borrow = 0; + int i = other.exp_ - exp_; + for (size_t j = 0, n = other.bigits_.size(); j != n; ++i, ++j) { + subtract_bigits(i, other.bigits_[j], borrow); + } + while (borrow > 0) subtract_bigits(i, 0, borrow); + remove_leading_zeros(); + } + + void multiply(uint32_t value) { + const double_bigit wide_value = value; + bigit carry = 0; + for (size_t i = 0, n = bigits_.size(); i < n; ++i) { + double_bigit result = bigits_[i] * wide_value + carry; + bigits_[i] = static_cast(result); + carry = static_cast(result >> bigit_bits); + } + if (carry != 0) bigits_.push_back(carry); + } + + void multiply(uint64_t value) { + const bigit mask = ~bigit(0); + const double_bigit lower = value & mask; + const double_bigit upper = value >> bigit_bits; + double_bigit carry = 0; + for (size_t i = 0, n = bigits_.size(); i < n; ++i) { + double_bigit result = bigits_[i] * lower + (carry & mask); + carry = + bigits_[i] * upper + (result >> bigit_bits) + (carry >> bigit_bits); + bigits_[i] = static_cast(result); + } + while (carry != 0) { + bigits_.push_back(carry & mask); + carry >>= bigit_bits; + } + } + + public: + bigint() : exp_(0) {} + explicit bigint(uint64_t n) { assign(n); } + ~bigint() { assert(bigits_.capacity() <= bigits_capacity); } + + bigint(const bigint&) = delete; + void operator=(const bigint&) = delete; + + void assign(const bigint& other) { + auto size = other.bigits_.size(); + bigits_.resize(size); + auto data = other.bigits_.data(); + std::copy(data, data + size, make_checked(bigits_.data(), size)); + exp_ = other.exp_; + } + + void assign(uint64_t n) { + size_t num_bigits = 0; + do { + bigits_[num_bigits++] = n & ~bigit(0); + n >>= bigit_bits; + } while (n != 0); + bigits_.resize(num_bigits); + exp_ = 0; + } + + int num_bigits() const { return static_cast(bigits_.size()) + exp_; } + + FMT_NOINLINE bigint& operator<<=(int shift) { + assert(shift >= 0); + exp_ += shift / bigit_bits; + shift %= bigit_bits; + if (shift == 0) return *this; + bigit carry = 0; + for (size_t i = 0, n = bigits_.size(); i < n; ++i) { + bigit c = bigits_[i] >> (bigit_bits - shift); + bigits_[i] = (bigits_[i] << shift) + carry; + carry = c; + } + if (carry != 0) bigits_.push_back(carry); + return *this; + } + + template bigint& operator*=(Int value) { + FMT_ASSERT(value > 0, ""); + multiply(uint32_or_64_or_128_t(value)); + return *this; + } + + friend int compare(const bigint& lhs, const bigint& rhs) { + int num_lhs_bigits = lhs.num_bigits(), num_rhs_bigits = rhs.num_bigits(); + if (num_lhs_bigits != num_rhs_bigits) + return num_lhs_bigits > num_rhs_bigits ? 1 : -1; + int i = static_cast(lhs.bigits_.size()) - 1; + int j = static_cast(rhs.bigits_.size()) - 1; + int end = i - j; + if (end < 0) end = 0; + for (; i >= end; --i, --j) { + bigit lhs_bigit = lhs[i], rhs_bigit = rhs[j]; + if (lhs_bigit != rhs_bigit) return lhs_bigit > rhs_bigit ? 1 : -1; + } + if (i != j) return i > j ? 1 : -1; + return 0; + } + + // Returns compare(lhs1 + lhs2, rhs). + friend int add_compare(const bigint& lhs1, const bigint& lhs2, + const bigint& rhs) { + int max_lhs_bigits = (std::max)(lhs1.num_bigits(), lhs2.num_bigits()); + int num_rhs_bigits = rhs.num_bigits(); + if (max_lhs_bigits + 1 < num_rhs_bigits) return -1; + if (max_lhs_bigits > num_rhs_bigits) return 1; + auto get_bigit = [](const bigint& n, int i) -> bigit { + return i >= n.exp_ && i < n.num_bigits() ? n[i - n.exp_] : 0; + }; + double_bigit borrow = 0; + int min_exp = (std::min)((std::min)(lhs1.exp_, lhs2.exp_), rhs.exp_); + for (int i = num_rhs_bigits - 1; i >= min_exp; --i) { + double_bigit sum = + static_cast(get_bigit(lhs1, i)) + get_bigit(lhs2, i); + bigit rhs_bigit = get_bigit(rhs, i); + if (sum > rhs_bigit + borrow) return 1; + borrow = rhs_bigit + borrow - sum; + if (borrow > 1) return -1; + borrow <<= bigit_bits; + } + return borrow != 0 ? -1 : 0; + } + + // Assigns pow(10, exp) to this bigint. + void assign_pow10(int exp) { + assert(exp >= 0); + if (exp == 0) return assign(1); + // Find the top bit. + int bitmask = 1; + while (exp >= bitmask) bitmask <<= 1; + bitmask >>= 1; + // pow(10, exp) = pow(5, exp) * pow(2, exp). First compute pow(5, exp) by + // repeated squaring and multiplication. + assign(5); + bitmask >>= 1; + while (bitmask != 0) { + square(); + if ((exp & bitmask) != 0) *this *= 5; + bitmask >>= 1; + } + *this <<= exp; // Multiply by pow(2, exp) by shifting. + } + + void square() { + basic_memory_buffer n(std::move(bigits_)); + int num_bigits = static_cast(bigits_.size()); + int num_result_bigits = 2 * num_bigits; + bigits_.resize(to_unsigned(num_result_bigits)); + using accumulator_t = conditional_t; + auto sum = accumulator_t(); + for (int bigit_index = 0; bigit_index < num_bigits; ++bigit_index) { + // Compute bigit at position bigit_index of the result by adding + // cross-product terms n[i] * n[j] such that i + j == bigit_index. + for (int i = 0, j = bigit_index; j >= 0; ++i, --j) { + // Most terms are multiplied twice which can be optimized in the future. + sum += static_cast(n[i]) * n[j]; + } + (*this)[bigit_index] = static_cast(sum); + sum >>= bits::value; // Compute the carry. + } + // Do the same for the top half. + for (int bigit_index = num_bigits; bigit_index < num_result_bigits; + ++bigit_index) { + for (int j = num_bigits - 1, i = bigit_index - j; i < num_bigits;) + sum += static_cast(n[i++]) * n[j--]; + (*this)[bigit_index] = static_cast(sum); + sum >>= bits::value; + } + --num_result_bigits; + remove_leading_zeros(); + exp_ *= 2; + } + + // Divides this bignum by divisor, assigning the remainder to this and + // returning the quotient. + int divmod_assign(const bigint& divisor) { + FMT_ASSERT(this != &divisor, ""); + if (compare(*this, divisor) < 0) return 0; + int num_bigits = static_cast(bigits_.size()); + FMT_ASSERT(divisor.bigits_[divisor.bigits_.size() - 1u] != 0, ""); + int exp_difference = exp_ - divisor.exp_; + if (exp_difference > 0) { + // Align bigints by adding trailing zeros to simplify subtraction. + bigits_.resize(to_unsigned(num_bigits + exp_difference)); + for (int i = num_bigits - 1, j = i + exp_difference; i >= 0; --i, --j) + bigits_[j] = bigits_[i]; + std::uninitialized_fill_n(bigits_.data(), exp_difference, 0); + exp_ -= exp_difference; + } + int quotient = 0; + do { + subtract_aligned(divisor); + ++quotient; + } while (compare(*this, divisor) >= 0); + return quotient; + } +}; + +enum class round_direction { unknown, up, down }; + +// Given the divisor (normally a power of 10), the remainder = v % divisor for +// some number v and the error, returns whether v should be rounded up, down, or +// whether the rounding direction can't be determined due to error. +// error should be less than divisor / 2. +inline round_direction get_round_direction(uint64_t divisor, uint64_t remainder, + uint64_t error) { + FMT_ASSERT(remainder < divisor, ""); // divisor - remainder won't overflow. + FMT_ASSERT(error < divisor, ""); // divisor - error won't overflow. + FMT_ASSERT(error < divisor - error, ""); // error * 2 won't overflow. + // Round down if (remainder + error) * 2 <= divisor. + if (remainder <= divisor - remainder && error * 2 <= divisor - remainder * 2) + return round_direction::down; + // Round up if (remainder - error) * 2 >= divisor. + if (remainder >= error && + remainder - error >= divisor - (remainder - error)) { + return round_direction::up; + } + return round_direction::unknown; +} + +namespace digits { +enum result { + more, // Generate more digits. + done, // Done generating digits. + error // Digit generation cancelled due to an error. +}; +} + +// A version of count_digits optimized for grisu_gen_digits. +inline int grisu_count_digits(uint32_t n) { + if (n < 10) return 1; + if (n < 100) return 2; + if (n < 1000) return 3; + if (n < 10000) return 4; + if (n < 100000) return 5; + if (n < 1000000) return 6; + if (n < 10000000) return 7; + if (n < 100000000) return 8; + if (n < 1000000000) return 9; + return 10; +} + +// Generates output using the Grisu digit-gen algorithm. +// error: the size of the region (lower, upper) outside of which numbers +// definitely do not round to value (Delta in Grisu3). +template +FMT_ALWAYS_INLINE digits::result grisu_gen_digits(fp value, uint64_t error, + int& exp, Handler& handler) { + const fp one(1ULL << -value.e, value.e); + // The integral part of scaled value (p1 in Grisu) = value / one. It cannot be + // zero because it contains a product of two 64-bit numbers with MSB set (due + // to normalization) - 1, shifted right by at most 60 bits. + auto integral = static_cast(value.f >> -one.e); + FMT_ASSERT(integral != 0, ""); + FMT_ASSERT(integral == value.f >> -one.e, ""); + // The fractional part of scaled value (p2 in Grisu) c = value % one. + uint64_t fractional = value.f & (one.f - 1); + exp = grisu_count_digits(integral); // kappa in Grisu. + // Divide by 10 to prevent overflow. + auto result = handler.on_start(data::powers_of_10_64[exp - 1] << -one.e, + value.f / 10, error * 10, exp); + if (result != digits::more) return result; + // Generate digits for the integral part. This can produce up to 10 digits. + do { + uint32_t digit = 0; + auto divmod_integral = [&](uint32_t divisor) { + digit = integral / divisor; + integral %= divisor; + }; + // This optimization by Milo Yip reduces the number of integer divisions by + // one per iteration. + switch (exp) { + case 10: + divmod_integral(1000000000); + break; + case 9: + divmod_integral(100000000); + break; + case 8: + divmod_integral(10000000); + break; + case 7: + divmod_integral(1000000); + break; + case 6: + divmod_integral(100000); + break; + case 5: + divmod_integral(10000); + break; + case 4: + divmod_integral(1000); + break; + case 3: + divmod_integral(100); + break; + case 2: + divmod_integral(10); + break; + case 1: + digit = integral; + integral = 0; + break; + default: + FMT_ASSERT(false, "invalid number of digits"); + } + --exp; + uint64_t remainder = + (static_cast(integral) << -one.e) + fractional; + result = handler.on_digit(static_cast('0' + digit), + data::powers_of_10_64[exp] << -one.e, remainder, + error, exp, true); + if (result != digits::more) return result; + } while (exp > 0); + // Generate digits for the fractional part. + for (;;) { + fractional *= 10; + error *= 10; + char digit = + static_cast('0' + static_cast(fractional >> -one.e)); + fractional &= one.f - 1; + --exp; + result = handler.on_digit(digit, one.f, fractional, error, exp, false); + if (result != digits::more) return result; + } +} + +// The fixed precision digit handler. +struct fixed_handler { + char* buf; + int size; + int precision; + int exp10; + bool fixed; + + digits::result on_start(uint64_t divisor, uint64_t remainder, uint64_t error, + int& exp) { + // Non-fixed formats require at least one digit and no precision adjustment. + if (!fixed) return digits::more; + // Adjust fixed precision by exponent because it is relative to decimal + // point. + precision += exp + exp10; + // Check if precision is satisfied just by leading zeros, e.g. + // format("{:.2f}", 0.001) gives "0.00" without generating any digits. + if (precision > 0) return digits::more; + if (precision < 0) return digits::done; + auto dir = get_round_direction(divisor, remainder, error); + if (dir == round_direction::unknown) return digits::error; + buf[size++] = dir == round_direction::up ? '1' : '0'; + return digits::done; + } + + digits::result on_digit(char digit, uint64_t divisor, uint64_t remainder, + uint64_t error, int, bool integral) { + FMT_ASSERT(remainder < divisor, ""); + buf[size++] = digit; + if (size < precision) return digits::more; + if (!integral) { + // Check if error * 2 < divisor with overflow prevention. + // The check is not needed for the integral part because error = 1 + // and divisor > (1 << 32) there. + if (error >= divisor || error >= divisor - error) return digits::error; + } else { + FMT_ASSERT(error == 1 && divisor > 2, ""); + } + auto dir = get_round_direction(divisor, remainder, error); + if (dir != round_direction::up) + return dir == round_direction::down ? digits::done : digits::error; + ++buf[size - 1]; + for (int i = size - 1; i > 0 && buf[i] > '9'; --i) { + buf[i] = '0'; + ++buf[i - 1]; + } + if (buf[0] > '9') { + buf[0] = '1'; + buf[size++] = '0'; + } + return digits::done; + } +}; + +// The shortest representation digit handler. +struct grisu_shortest_handler { + char* buf; + int size; + // Distance between scaled value and upper bound (wp_W in Grisu3). + uint64_t diff; + + digits::result on_start(uint64_t, uint64_t, uint64_t, int&) { + return digits::more; + } + + // Decrement the generated number approaching value from above. + void round(uint64_t d, uint64_t divisor, uint64_t& remainder, + uint64_t error) { + while ( + remainder < d && error - remainder >= divisor && + (remainder + divisor < d || d - remainder >= remainder + divisor - d)) { + --buf[size - 1]; + remainder += divisor; + } + } + + // Implements Grisu's round_weed. + digits::result on_digit(char digit, uint64_t divisor, uint64_t remainder, + uint64_t error, int exp, bool integral) { + buf[size++] = digit; + if (remainder >= error) return digits::more; + uint64_t unit = integral ? 1 : data::powers_of_10_64[-exp]; + uint64_t up = (diff - 1) * unit; // wp_Wup + round(up, divisor, remainder, error); + uint64_t down = (diff + 1) * unit; // wp_Wdown + if (remainder < down && error - remainder >= divisor && + (remainder + divisor < down || + down - remainder > remainder + divisor - down)) { + return digits::error; + } + return 2 * unit <= remainder && remainder <= error - 4 * unit + ? digits::done + : digits::error; + } +}; + +// Formats value using a variation of the Fixed-Precision Positive +// Floating-Point Printout ((FPP)^2) algorithm by Steele & White: +// https://fmt.dev/p372-steele.pdf. +template +void fallback_format(Double d, buffer& buf, int& exp10) { + bigint numerator; // 2 * R in (FPP)^2. + bigint denominator; // 2 * S in (FPP)^2. + // lower and upper are differences between value and corresponding boundaries. + bigint lower; // (M^- in (FPP)^2). + bigint upper_store; // upper's value if different from lower. + bigint* upper = nullptr; // (M^+ in (FPP)^2). + fp value; + // Shift numerator and denominator by an extra bit or two (if lower boundary + // is closer) to make lower and upper integers. This eliminates multiplication + // by 2 during later computations. + // TODO: handle float + int shift = value.assign(d) ? 2 : 1; + uint64_t significand = value.f << shift; + if (value.e >= 0) { + numerator.assign(significand); + numerator <<= value.e; + lower.assign(1); + lower <<= value.e; + if (shift != 1) { + upper_store.assign(1); + upper_store <<= value.e + 1; + upper = &upper_store; + } + denominator.assign_pow10(exp10); + denominator <<= 1; + } else if (exp10 < 0) { + numerator.assign_pow10(-exp10); + lower.assign(numerator); + if (shift != 1) { + upper_store.assign(numerator); + upper_store <<= 1; + upper = &upper_store; + } + numerator *= significand; + denominator.assign(1); + denominator <<= shift - value.e; + } else { + numerator.assign(significand); + denominator.assign_pow10(exp10); + denominator <<= shift - value.e; + lower.assign(1); + if (shift != 1) { + upper_store.assign(1ULL << 1); + upper = &upper_store; + } + } + if (!upper) upper = &lower; + // Invariant: value == (numerator / denominator) * pow(10, exp10). + bool even = (value.f & 1) == 0; + int num_digits = 0; + char* data = buf.data(); + for (;;) { + int digit = numerator.divmod_assign(denominator); + bool low = compare(numerator, lower) - even < 0; // numerator <[=] lower. + // numerator + upper >[=] pow10: + bool high = add_compare(numerator, *upper, denominator) + even > 0; + data[num_digits++] = static_cast('0' + digit); + if (low || high) { + if (!low) { + ++data[num_digits - 1]; + } else if (high) { + int result = add_compare(numerator, numerator, denominator); + // Round half to even. + if (result > 0 || (result == 0 && (digit % 2) != 0)) + ++data[num_digits - 1]; + } + buf.resize(to_unsigned(num_digits)); + exp10 -= num_digits - 1; + return; + } + numerator *= 10; + lower *= 10; + if (upper != &lower) *upper *= 10; + } +} + +// Formats value using the Grisu algorithm +// (https://www.cs.tufts.edu/~nr/cs257/archive/florian-loitsch/printf.pdf) +// if T is a IEEE754 binary32 or binary64 and snprintf otherwise. +template +int format_float(T value, int precision, float_specs specs, buffer& buf) { + static_assert(!std::is_same::value, ""); + FMT_ASSERT(value >= 0, "value is negative"); + + const bool fixed = specs.format == float_format::fixed; + if (value <= 0) { // <= instead of == to silence a warning. + if (precision <= 0 || !fixed) { + buf.push_back('0'); + return 0; + } + buf.resize(to_unsigned(precision)); + std::uninitialized_fill_n(buf.data(), precision, '0'); + return -precision; + } + + if (!specs.use_grisu) return snprintf_float(value, precision, specs, buf); + + int exp = 0; + const int min_exp = -60; // alpha in Grisu. + int cached_exp10 = 0; // K in Grisu. + if (precision < 0) { + fp fp_value; + auto boundaries = specs.binary32 + ? fp_value.assign_float_with_boundaries(value) + : fp_value.assign_with_boundaries(value); + fp_value = normalize(fp_value); + // Find a cached power of 10 such that multiplying value by it will bring + // the exponent in the range [min_exp, -32]. + const fp cached_pow = get_cached_power( + min_exp - (fp_value.e + fp::significand_size), cached_exp10); + // Multiply value and boundaries by the cached power of 10. + fp_value = fp_value * cached_pow; + boundaries.lower = multiply(boundaries.lower, cached_pow.f); + boundaries.upper = multiply(boundaries.upper, cached_pow.f); + assert(min_exp <= fp_value.e && fp_value.e <= -32); + --boundaries.lower; // \tilde{M}^- - 1 ulp -> M^-_{\downarrow}. + ++boundaries.upper; // \tilde{M}^+ + 1 ulp -> M^+_{\uparrow}. + // Numbers outside of (lower, upper) definitely do not round to value. + grisu_shortest_handler handler{buf.data(), 0, + boundaries.upper - fp_value.f}; + auto result = + grisu_gen_digits(fp(boundaries.upper, fp_value.e), + boundaries.upper - boundaries.lower, exp, handler); + if (result == digits::error) { + exp += handler.size - cached_exp10 - 1; + fallback_format(value, buf, exp); + return exp; + } + buf.resize(to_unsigned(handler.size)); + } else { + if (precision > 17) return snprintf_float(value, precision, specs, buf); + fp normalized = normalize(fp(value)); + const auto cached_pow = get_cached_power( + min_exp - (normalized.e + fp::significand_size), cached_exp10); + normalized = normalized * cached_pow; + fixed_handler handler{buf.data(), 0, precision, -cached_exp10, fixed}; + if (grisu_gen_digits(normalized, 1, exp, handler) == digits::error) + return snprintf_float(value, precision, specs, buf); + int num_digits = handler.size; + if (!fixed) { + // Remove trailing zeros. + while (num_digits > 0 && buf[num_digits - 1] == '0') { + --num_digits; + ++exp; + } + } + buf.resize(to_unsigned(num_digits)); + } + return exp - cached_exp10; +} + +template +int snprintf_float(T value, int precision, float_specs specs, + buffer& buf) { + // Buffer capacity must be non-zero, otherwise MSVC's vsnprintf_s will fail. + FMT_ASSERT(buf.capacity() > buf.size(), "empty buffer"); + static_assert(!std::is_same::value, ""); + + // Subtract 1 to account for the difference in precision since we use %e for + // both general and exponent format. + if (specs.format == float_format::general || + specs.format == float_format::exp) + precision = (precision >= 0 ? precision : 6) - 1; + + // Build the format string. + enum { max_format_size = 7 }; // The longest format is "%#.*Le". + char format[max_format_size]; + char* format_ptr = format; + *format_ptr++ = '%'; + if (specs.showpoint && specs.format == float_format::hex) *format_ptr++ = '#'; + if (precision >= 0) { + *format_ptr++ = '.'; + *format_ptr++ = '*'; + } + if (std::is_same()) *format_ptr++ = 'L'; + *format_ptr++ = specs.format != float_format::hex + ? (specs.format == float_format::fixed ? 'f' : 'e') + : (specs.upper ? 'A' : 'a'); + *format_ptr = '\0'; + + // Format using snprintf. + auto offset = buf.size(); + for (;;) { + auto begin = buf.data() + offset; + auto capacity = buf.capacity() - offset; +#ifdef FMT_FUZZ + if (precision > 100000) + throw std::runtime_error( + "fuzz mode - avoid large allocation inside snprintf"); +#endif + // Suppress the warning about a nonliteral format string. + // Cannot use auto because of a bug in MinGW (#1532). + int (*snprintf_ptr)(char*, size_t, const char*, ...) = FMT_SNPRINTF; + int result = precision >= 0 + ? snprintf_ptr(begin, capacity, format, precision, value) + : snprintf_ptr(begin, capacity, format, value); + if (result < 0) { + buf.reserve(buf.capacity() + 1); // The buffer will grow exponentially. + continue; + } + auto size = to_unsigned(result); + // Size equal to capacity means that the last character was truncated. + if (size >= capacity) { + buf.reserve(size + offset + 1); // Add 1 for the terminating '\0'. + continue; + } + auto is_digit = [](char c) { return c >= '0' && c <= '9'; }; + if (specs.format == float_format::fixed) { + if (precision == 0) { + buf.resize(size); + return 0; + } + // Find and remove the decimal point. + auto end = begin + size, p = end; + do { + --p; + } while (is_digit(*p)); + int fraction_size = static_cast(end - p - 1); + std::memmove(p, p + 1, to_unsigned(fraction_size)); + buf.resize(size - 1); + return -fraction_size; + } + if (specs.format == float_format::hex) { + buf.resize(size + offset); + return 0; + } + // Find and parse the exponent. + auto end = begin + size, exp_pos = end; + do { + --exp_pos; + } while (*exp_pos != 'e'); + char sign = exp_pos[1]; + assert(sign == '+' || sign == '-'); + int exp = 0; + auto p = exp_pos + 2; // Skip 'e' and sign. + do { + assert(is_digit(*p)); + exp = exp * 10 + (*p++ - '0'); + } while (p != end); + if (sign == '-') exp = -exp; + int fraction_size = 0; + if (exp_pos != begin + 1) { + // Remove trailing zeros. + auto fraction_end = exp_pos - 1; + while (*fraction_end == '0') --fraction_end; + // Move the fractional part left to get rid of the decimal point. + fraction_size = static_cast(fraction_end - begin - 1); + std::memmove(begin + 1, begin + 2, to_unsigned(fraction_size)); + } + buf.resize(to_unsigned(fraction_size) + offset + 1); + return exp - fraction_size; + } +} + +// A public domain branchless UTF-8 decoder by Christopher Wellons: +// https://github.com/skeeto/branchless-utf8 +/* Decode the next character, c, from buf, reporting errors in e. + * + * Since this is a branchless decoder, four bytes will be read from the + * buffer regardless of the actual length of the next character. This + * means the buffer _must_ have at least three bytes of zero padding + * following the end of the data stream. + * + * Errors are reported in e, which will be non-zero if the parsed + * character was somehow invalid: invalid byte sequence, non-canonical + * encoding, or a surrogate half. + * + * The function returns a pointer to the next character. When an error + * occurs, this pointer will be a guess that depends on the particular + * error, but it will always advance at least one byte. + */ +FMT_FUNC const char* utf8_decode(const char* buf, uint32_t* c, int* e) { + static const char lengths[] = {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, + 0, 0, 2, 2, 2, 2, 3, 3, 4, 0}; + static const int masks[] = {0x00, 0x7f, 0x1f, 0x0f, 0x07}; + static const uint32_t mins[] = {4194304, 0, 128, 2048, 65536}; + static const int shiftc[] = {0, 18, 12, 6, 0}; + static const int shifte[] = {0, 6, 4, 2, 0}; + + auto s = reinterpret_cast(buf); + int len = lengths[s[0] >> 3]; + + // Compute the pointer to the next character early so that the next + // iteration can start working on the next character. Neither Clang + // nor GCC figure out this reordering on their own. + const char* next = buf + len + !len; + + // Assume a four-byte character and load four bytes. Unused bits are + // shifted out. + *c = uint32_t(s[0] & masks[len]) << 18; + *c |= uint32_t(s[1] & 0x3f) << 12; + *c |= uint32_t(s[2] & 0x3f) << 6; + *c |= uint32_t(s[3] & 0x3f) << 0; + *c >>= shiftc[len]; + + // Accumulate the various error conditions. + *e = (*c < mins[len]) << 6; // non-canonical encoding + *e |= ((*c >> 11) == 0x1b) << 7; // surrogate half? + *e |= (*c > 0x10FFFF) << 8; // out of range? + *e |= (s[1] & 0xc0) >> 2; + *e |= (s[2] & 0xc0) >> 4; + *e |= (s[3]) >> 6; + *e ^= 0x2a; // top two bits of each tail byte correct? + *e >>= shifte[len]; + + return next; +} +} // namespace detail + +template <> struct formatter { + format_parse_context::iterator parse(format_parse_context& ctx) { + return ctx.begin(); + } + + format_context::iterator format(const detail::bigint& n, + format_context& ctx) { + auto out = ctx.out(); + bool first = true; + for (auto i = n.bigits_.size(); i > 0; --i) { + auto value = n.bigits_[i - 1u]; + if (first) { + out = format_to(out, "{:x}", value); + first = false; + continue; + } + out = format_to(out, "{:08x}", value); + } + if (n.exp_ > 0) + out = format_to(out, "p{}", n.exp_ * detail::bigint::bigit_bits); + return out; + } +}; + +FMT_FUNC detail::utf8_to_utf16::utf8_to_utf16(string_view s) { + auto transcode = [this](const char* p) { + auto cp = uint32_t(); + auto error = 0; + p = utf8_decode(p, &cp, &error); + if (error != 0) FMT_THROW(std::runtime_error("invalid utf8")); + if (cp <= 0xFFFF) { + buffer_.push_back(static_cast(cp)); + } else { + cp -= 0x10000; + buffer_.push_back(static_cast(0xD800 + (cp >> 10))); + buffer_.push_back(static_cast(0xDC00 + (cp & 0x3FF))); + } + return p; + }; + auto p = s.data(); + const size_t block_size = 4; // utf8_decode always reads blocks of 4 chars. + if (s.size() >= block_size) { + for (auto end = p + s.size() - block_size + 1; p < end;) p = transcode(p); + } + if (auto num_chars_left = s.data() + s.size() - p) { + char buf[2 * block_size - 1] = {}; + memcpy(buf, p, to_unsigned(num_chars_left)); + p = buf; + do { + p = transcode(p); + } while (p - buf < num_chars_left); + } + buffer_.push_back(0); +} + +FMT_FUNC void format_system_error(detail::buffer& out, int error_code, + string_view message) FMT_NOEXCEPT { + FMT_TRY { + memory_buffer buf; + buf.resize(inline_buffer_size); + for (;;) { + char* system_message = &buf[0]; + int result = + detail::safe_strerror(error_code, system_message, buf.size()); + if (result == 0) { + format_to(std::back_inserter(out), "{}: {}", message, system_message); + return; + } + if (result != ERANGE) + break; // Can't get error message, report error code instead. + buf.resize(buf.size() * 2); + } + } + FMT_CATCH(...) {} + format_error_code(out, error_code, message); +} + +FMT_FUNC void detail::error_handler::on_error(const char* message) { + FMT_THROW(format_error(message)); +} + +FMT_FUNC void report_system_error(int error_code, + fmt::string_view message) FMT_NOEXCEPT { + report_error(format_system_error, error_code, message); +} + +struct stringifier { + template FMT_INLINE std::string operator()(T value) const { + return to_string(value); + } + std::string operator()(basic_format_arg::handle h) const { + memory_buffer buf; + detail::buffer& base = buf; + format_parse_context parse_ctx({}); + format_context format_ctx(std::back_inserter(base), {}, {}); + h.format(parse_ctx, format_ctx); + return to_string(buf); + } +}; + +FMT_FUNC std::string detail::vformat(string_view format_str, format_args args) { + if (format_str.size() == 2 && equal2(format_str.data(), "{}")) { + auto arg = args.get(0); + if (!arg) error_handler().on_error("argument not found"); + return visit_format_arg(stringifier(), arg); + } + memory_buffer buffer; + detail::vformat_to(buffer, format_str, args); + return to_string(buffer); +} + +FMT_FUNC void vprint(std::FILE* f, string_view format_str, format_args args) { + memory_buffer buffer; + detail::vformat_to(buffer, format_str, + basic_format_args>(args)); +#ifdef _WIN32 + auto fd = _fileno(f); + if (_isatty(fd)) { + detail::utf8_to_utf16 u16(string_view(buffer.data(), buffer.size())); + auto written = DWORD(); + if (!WriteConsoleW(reinterpret_cast(_get_osfhandle(fd)), + u16.c_str(), static_cast(u16.size()), &written, + nullptr)) { + FMT_THROW(format_error("failed to write to console")); + } + return; + } +#endif + detail::fwrite_fully(buffer.data(), 1, buffer.size(), f); +} + +#ifdef _WIN32 +// Print assuming legacy (non-Unicode) encoding. +FMT_FUNC void detail::vprint_mojibake(std::FILE* f, string_view format_str, + format_args args) { + memory_buffer buffer; + detail::vformat_to(buffer, format_str, + basic_format_args>(args)); + fwrite_fully(buffer.data(), 1, buffer.size(), f); +} +#endif + +FMT_FUNC void vprint(string_view format_str, format_args args) { + vprint(stdout, format_str, args); +} + +FMT_END_NAMESPACE + +#ifdef _MSC_VER +# pragma warning(pop) +#endif + +#endif // FMT_FORMAT_INL_H_ diff --git a/ThirdParty/fmtlib/include/fmt/format.h b/ThirdParty/fmtlib/include/fmt/format.h new file mode 100644 index 0000000000..17509b7b45 --- /dev/null +++ b/ThirdParty/fmtlib/include/fmt/format.h @@ -0,0 +1,3729 @@ +/* + Formatting library for C++ + + Copyright (c) 2012 - present, Victor Zverovich + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + "Software"), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE + LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + --- Optional exception to the license --- + + As an exception, if, as a result of your compiling your source code, portions + of this Software are embedded into a machine-executable object form of such + source code, you may redistribute such embedded portions in such object form + without including the above copyright and permission notices. + */ + +#ifndef FMT_FORMAT_H_ +#define FMT_FORMAT_H_ + +#include +#include +#include +#include +#include +#include +#include + +#include "core.h" + +#ifdef __INTEL_COMPILER +# define FMT_ICC_VERSION __INTEL_COMPILER +#elif defined(__ICL) +# define FMT_ICC_VERSION __ICL +#else +# define FMT_ICC_VERSION 0 +#endif + +#ifdef __NVCC__ +# define FMT_CUDA_VERSION (__CUDACC_VER_MAJOR__ * 100 + __CUDACC_VER_MINOR__) +#else +# define FMT_CUDA_VERSION 0 +#endif + +#ifdef __has_builtin +# define FMT_HAS_BUILTIN(x) __has_builtin(x) +#else +# define FMT_HAS_BUILTIN(x) 0 +#endif + +#if FMT_GCC_VERSION || FMT_CLANG_VERSION +# define FMT_NOINLINE __attribute__((noinline)) +#else +# define FMT_NOINLINE +#endif + +#if __cplusplus == 201103L || __cplusplus == 201402L +# if defined(__clang__) +# define FMT_FALLTHROUGH [[clang::fallthrough]] +# elif FMT_GCC_VERSION >= 700 && !defined(__PGI) && \ + (!defined(__EDG_VERSION__) || __EDG_VERSION__ >= 520) +# define FMT_FALLTHROUGH [[gnu::fallthrough]] +# else +# define FMT_FALLTHROUGH +# endif +#elif FMT_HAS_CPP17_ATTRIBUTE(fallthrough) || \ + (defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) +# define FMT_FALLTHROUGH [[fallthrough]] +#else +# define FMT_FALLTHROUGH +#endif + +#ifndef FMT_MAYBE_UNUSED +# if FMT_HAS_CPP17_ATTRIBUTE(maybe_unused) +# define FMT_MAYBE_UNUSED [[maybe_unused]] +# else +# define FMT_MAYBE_UNUSED +# endif +#endif + +#ifndef FMT_THROW +# if FMT_EXCEPTIONS +# if FMT_MSC_VER || FMT_NVCC +FMT_BEGIN_NAMESPACE +namespace detail { +template inline void do_throw(const Exception& x) { + // Silence unreachable code warnings in MSVC and NVCC because these + // are nearly impossible to fix in a generic code. + volatile bool b = true; + if (b) throw x; +} +} // namespace detail +FMT_END_NAMESPACE +# define FMT_THROW(x) detail::do_throw(x) +# else +# define FMT_THROW(x) throw x +# endif +# else +# define FMT_THROW(x) \ + do { \ + static_cast(sizeof(x)); \ + FMT_ASSERT(false, ""); \ + } while (false) +# endif +#endif + +#if FMT_EXCEPTIONS +# define FMT_TRY try +# define FMT_CATCH(x) catch (x) +#else +# define FMT_TRY if (true) +# define FMT_CATCH(x) if (false) +#endif + +#ifndef FMT_USE_USER_DEFINED_LITERALS +// EDG based compilers (Intel, NVIDIA, Elbrus, etc), GCC and MSVC support UDLs. +# if (FMT_HAS_FEATURE(cxx_user_literals) || FMT_GCC_VERSION >= 407 || \ + FMT_MSC_VER >= 1900) && \ + (!defined(__EDG_VERSION__) || __EDG_VERSION__ >= /* UDL feature */ 480) +# define FMT_USE_USER_DEFINED_LITERALS 1 +# else +# define FMT_USE_USER_DEFINED_LITERALS 0 +# endif +#endif + +#ifndef FMT_USE_UDL_TEMPLATE +// EDG frontend based compilers (icc, nvcc, etc) and GCC < 6.4 do not properly +// support UDL templates and GCC >= 9 warns about them. +# if FMT_USE_USER_DEFINED_LITERALS && \ + (!defined(__EDG_VERSION__) || __EDG_VERSION__ >= 501) && \ + ((FMT_GCC_VERSION >= 604 && __cplusplus >= 201402L) || \ + FMT_CLANG_VERSION >= 304) +# define FMT_USE_UDL_TEMPLATE 1 +# else +# define FMT_USE_UDL_TEMPLATE 0 +# endif +#endif + +#ifndef FMT_USE_FLOAT +# define FMT_USE_FLOAT 1 +#endif + +#ifndef FMT_USE_DOUBLE +# define FMT_USE_DOUBLE 1 +#endif + +#ifndef FMT_USE_LONG_DOUBLE +# define FMT_USE_LONG_DOUBLE 1 +#endif + +// __builtin_clz is broken in clang with Microsoft CodeGen: +// https://github.com/fmtlib/fmt/issues/519 +#if (FMT_GCC_VERSION || FMT_HAS_BUILTIN(__builtin_clz)) && !FMT_MSC_VER +# define FMT_BUILTIN_CLZ(n) __builtin_clz(n) +#endif +#if (FMT_GCC_VERSION || FMT_HAS_BUILTIN(__builtin_clzll)) && !FMT_MSC_VER +# define FMT_BUILTIN_CLZLL(n) __builtin_clzll(n) +#endif + +// Some compilers masquerade as both MSVC and GCC-likes or otherwise support +// __builtin_clz and __builtin_clzll, so only define FMT_BUILTIN_CLZ using the +// MSVC intrinsics if the clz and clzll builtins are not available. +#if FMT_MSC_VER && !defined(FMT_BUILTIN_CLZLL) && !defined(_MANAGED) +# include // _BitScanReverse, _BitScanReverse64 + +FMT_BEGIN_NAMESPACE +namespace detail { +// Avoid Clang with Microsoft CodeGen's -Wunknown-pragmas warning. +# ifndef __clang__ +# pragma intrinsic(_BitScanReverse) +# endif +inline uint32_t clz(uint32_t x) { + unsigned long r = 0; + _BitScanReverse(&r, x); + + FMT_ASSERT(x != 0, ""); + // Static analysis complains about using uninitialized data + // "r", but the only way that can happen is if "x" is 0, + // which the callers guarantee to not happen. + FMT_SUPPRESS_MSC_WARNING(6102) + return 31 - r; +} +# define FMT_BUILTIN_CLZ(n) detail::clz(n) + +# if defined(_WIN64) && !defined(__clang__) +# pragma intrinsic(_BitScanReverse64) +# endif + +inline uint32_t clzll(uint64_t x) { + unsigned long r = 0; +# ifdef _WIN64 + _BitScanReverse64(&r, x); +# else + // Scan the high 32 bits. + if (_BitScanReverse(&r, static_cast(x >> 32))) return 63 - (r + 32); + + // Scan the low 32 bits. + _BitScanReverse(&r, static_cast(x)); +# endif + + FMT_ASSERT(x != 0, ""); + // Static analysis complains about using uninitialized data + // "r", but the only way that can happen is if "x" is 0, + // which the callers guarantee to not happen. + FMT_SUPPRESS_MSC_WARNING(6102) + return 63 - r; +} +# define FMT_BUILTIN_CLZLL(n) detail::clzll(n) +} // namespace detail +FMT_END_NAMESPACE +#endif + +// Enable the deprecated numeric alignment. +#ifndef FMT_DEPRECATED_NUMERIC_ALIGN +# define FMT_DEPRECATED_NUMERIC_ALIGN 0 +#endif + +FMT_BEGIN_NAMESPACE +namespace detail { + +// An equivalent of `*reinterpret_cast(&source)` that doesn't have +// undefined behavior (e.g. due to type aliasing). +// Example: uint64_t d = bit_cast(2.718); +template +inline Dest bit_cast(const Source& source) { + static_assert(sizeof(Dest) == sizeof(Source), "size mismatch"); + Dest dest; + std::memcpy(&dest, &source, sizeof(dest)); + return dest; +} + +inline bool is_big_endian() { + const auto u = 1u; + struct bytes { + char data[sizeof(u)]; + }; + return bit_cast(u).data[0] == 0; +} + +// A fallback implementation of uintptr_t for systems that lack it. +struct fallback_uintptr { + unsigned char value[sizeof(void*)]; + + fallback_uintptr() = default; + explicit fallback_uintptr(const void* p) { + *this = bit_cast(p); + if (is_big_endian()) { + for (size_t i = 0, j = sizeof(void*) - 1; i < j; ++i, --j) + std::swap(value[i], value[j]); + } + } +}; +#ifdef UINTPTR_MAX +using uintptr_t = ::uintptr_t; +inline uintptr_t to_uintptr(const void* p) { return bit_cast(p); } +#else +using uintptr_t = fallback_uintptr; +inline fallback_uintptr to_uintptr(const void* p) { + return fallback_uintptr(p); +} +#endif + +// Returns the largest possible value for type T. Same as +// std::numeric_limits::max() but shorter and not affected by the max macro. +template constexpr T max_value() { + return (std::numeric_limits::max)(); +} +template constexpr int num_bits() { + return std::numeric_limits::digits; +} +// std::numeric_limits::digits may return 0 for 128-bit ints. +template <> constexpr int num_bits() { return 128; } +template <> constexpr int num_bits() { return 128; } +template <> constexpr int num_bits() { + return static_cast(sizeof(void*) * + std::numeric_limits::digits); +} + +FMT_INLINE void assume(bool condition) { + (void)condition; +#if FMT_HAS_BUILTIN(__builtin_assume) + __builtin_assume(condition); +#endif +} + +// A workaround for gcc 4.8 to make void_t work in a SFINAE context. +template struct void_t_impl { using type = void; }; + +template +using void_t = typename detail::void_t_impl::type; + +// An approximation of iterator_t for pre-C++20 systems. +template +using iterator_t = decltype(std::begin(std::declval())); +template using sentinel_t = decltype(std::end(std::declval())); + +// Detect the iterator category of *any* given type in a SFINAE-friendly way. +// Unfortunately, older implementations of std::iterator_traits are not safe +// for use in a SFINAE-context. +template +struct iterator_category : std::false_type {}; + +template struct iterator_category { + using type = std::random_access_iterator_tag; +}; + +template +struct iterator_category> { + using type = typename It::iterator_category; +}; + +// Detect if *any* given type models the OutputIterator concept. +template class is_output_iterator { + // Check for mutability because all iterator categories derived from + // std::input_iterator_tag *may* also meet the requirements of an + // OutputIterator, thereby falling into the category of 'mutable iterators' + // [iterator.requirements.general] clause 4. The compiler reveals this + // property only at the point of *actually dereferencing* the iterator! + template + static decltype(*(std::declval())) test(std::input_iterator_tag); + template static char& test(std::output_iterator_tag); + template static const char& test(...); + + using type = decltype(test(typename iterator_category::type{})); + + public: + enum { value = !std::is_const>::value }; +}; + +// A workaround for std::string not having mutable data() until C++17. +template inline Char* get_data(std::basic_string& s) { + return &s[0]; +} +template +inline typename Container::value_type* get_data(Container& c) { + return c.data(); +} + +#if defined(_SECURE_SCL) && _SECURE_SCL +// Make a checked iterator to avoid MSVC warnings. +template using checked_ptr = stdext::checked_array_iterator; +template checked_ptr make_checked(T* p, size_t size) { + return {p, size}; +} +#else +template using checked_ptr = T*; +template inline T* make_checked(T* p, size_t) { return p; } +#endif + +template ::value)> +#if FMT_CLANG_VERSION +__attribute__((no_sanitize("undefined"))) +#endif +inline checked_ptr +reserve(std::back_insert_iterator it, size_t n) { + Container& c = get_container(it); + size_t size = c.size(); + c.resize(size + n); + return make_checked(get_data(c) + size, n); +} + +template inline Iterator& reserve(Iterator& it, size_t) { + return it; +} + +template ::value)> +inline std::back_insert_iterator base_iterator( + std::back_insert_iterator& it, + checked_ptr) { + return it; +} + +template +inline Iterator base_iterator(Iterator, Iterator it) { + return it; +} + +// An output iterator that counts the number of objects written to it and +// discards them. +class counting_iterator { + private: + size_t count_; + + public: + using iterator_category = std::output_iterator_tag; + using difference_type = std::ptrdiff_t; + using pointer = void; + using reference = void; + using _Unchecked_type = counting_iterator; // Mark iterator as checked. + + struct value_type { + template void operator=(const T&) {} + }; + + counting_iterator() : count_(0) {} + + size_t count() const { return count_; } + + counting_iterator& operator++() { + ++count_; + return *this; + } + + counting_iterator operator++(int) { + auto it = *this; + ++*this; + return it; + } + + value_type operator*() const { return {}; } +}; + +template class truncating_iterator_base { + protected: + OutputIt out_; + size_t limit_; + size_t count_; + + truncating_iterator_base(OutputIt out, size_t limit) + : out_(out), limit_(limit), count_(0) {} + + public: + using iterator_category = std::output_iterator_tag; + using value_type = typename std::iterator_traits::value_type; + using difference_type = void; + using pointer = void; + using reference = void; + using _Unchecked_type = + truncating_iterator_base; // Mark iterator as checked. + + OutputIt base() const { return out_; } + size_t count() const { return count_; } +}; + +// An output iterator that truncates the output and counts the number of objects +// written to it. +template ::value_type>::type> +class truncating_iterator; + +template +class truncating_iterator + : public truncating_iterator_base { + mutable typename truncating_iterator_base::value_type blackhole_; + + public: + using value_type = typename truncating_iterator_base::value_type; + + truncating_iterator(OutputIt out, size_t limit) + : truncating_iterator_base(out, limit) {} + + truncating_iterator& operator++() { + if (this->count_++ < this->limit_) ++this->out_; + return *this; + } + + truncating_iterator operator++(int) { + auto it = *this; + ++*this; + return it; + } + + value_type& operator*() const { + return this->count_ < this->limit_ ? *this->out_ : blackhole_; + } +}; + +template +class truncating_iterator + : public truncating_iterator_base { + public: + truncating_iterator(OutputIt out, size_t limit) + : truncating_iterator_base(out, limit) {} + + template truncating_iterator& operator=(T val) { + if (this->count_++ < this->limit_) *this->out_++ = val; + return *this; + } + + truncating_iterator& operator++() { return *this; } + truncating_iterator& operator++(int) { return *this; } + truncating_iterator& operator*() { return *this; } +}; + +template +inline size_t count_code_points(basic_string_view s) { + return s.size(); +} + +// Counts the number of code points in a UTF-8 string. +inline size_t count_code_points(basic_string_view s) { + const char* data = s.data(); + size_t num_code_points = 0; + for (size_t i = 0, size = s.size(); i != size; ++i) { + if ((data[i] & 0xc0) != 0x80) ++num_code_points; + } + return num_code_points; +} + +inline size_t count_code_points(basic_string_view s) { + return count_code_points(basic_string_view( + reinterpret_cast(s.data()), s.size())); +} + +template +inline size_t code_point_index(basic_string_view s, size_t n) { + size_t size = s.size(); + return n < size ? n : size; +} + +// Calculates the index of the nth code point in a UTF-8 string. +inline size_t code_point_index(basic_string_view s, size_t n) { + const char8_type* data = s.data(); + size_t num_code_points = 0; + for (size_t i = 0, size = s.size(); i != size; ++i) { + if ((data[i] & 0xc0) != 0x80 && ++num_code_points > n) { + return i; + } + } + return s.size(); +} + +template +using needs_conversion = bool_constant< + std::is_same::value_type, + char>::value && + std::is_same::value>; + +template ::value)> +OutputIt copy_str(InputIt begin, InputIt end, OutputIt it) { + return std::copy(begin, end, it); +} + +template ::value)> +OutputIt copy_str(InputIt begin, InputIt end, OutputIt it) { + return std::transform(begin, end, it, + [](char c) { return static_cast(c); }); +} + +#ifndef FMT_USE_GRISU +# define FMT_USE_GRISU 1 +#endif + +template constexpr bool use_grisu() { + return FMT_USE_GRISU && std::numeric_limits::is_iec559 && + sizeof(T) <= sizeof(double); +} + +template +template +void buffer::append(const U* begin, const U* end) { + size_t new_size = size_ + to_unsigned(end - begin); + reserve(new_size); + std::uninitialized_copy(begin, end, + make_checked(ptr_ + size_, capacity_ - size_)); + size_ = new_size; +} +} // namespace detail + +// The number of characters to store in the basic_memory_buffer object itself +// to avoid dynamic memory allocation. +enum { inline_buffer_size = 500 }; + +/** + \rst + A dynamically growing memory buffer for trivially copyable/constructible types + with the first ``SIZE`` elements stored in the object itself. + + You can use one of the following type aliases for common character types: + + +----------------+------------------------------+ + | Type | Definition | + +================+==============================+ + | memory_buffer | basic_memory_buffer | + +----------------+------------------------------+ + | wmemory_buffer | basic_memory_buffer | + +----------------+------------------------------+ + + **Example**:: + + fmt::memory_buffer out; + format_to(out, "The answer is {}.", 42); + + This will append the following output to the ``out`` object: + + .. code-block:: none + + The answer is 42. + + The output can be converted to an ``std::string`` with ``to_string(out)``. + \endrst + */ +template > +class basic_memory_buffer : public detail::buffer { + private: + T store_[SIZE]; + + // Don't inherit from Allocator avoid generating type_info for it. + Allocator alloc_; + + // Deallocate memory allocated by the buffer. + void deallocate() { + T* data = this->data(); + if (data != store_) alloc_.deallocate(data, this->capacity()); + } + + protected: + void grow(size_t size) FMT_OVERRIDE; + + public: + using value_type = T; + using const_reference = const T&; + + explicit basic_memory_buffer(const Allocator& alloc = Allocator()) + : alloc_(alloc) { + this->set(store_, SIZE); + } + ~basic_memory_buffer() FMT_OVERRIDE { deallocate(); } + + private: + // Move data from other to this buffer. + void move(basic_memory_buffer& other) { + alloc_ = std::move(other.alloc_); + T* data = other.data(); + size_t size = other.size(), capacity = other.capacity(); + if (data == other.store_) { + this->set(store_, capacity); + std::uninitialized_copy(other.store_, other.store_ + size, + detail::make_checked(store_, capacity)); + } else { + this->set(data, capacity); + // Set pointer to the inline array so that delete is not called + // when deallocating. + other.set(other.store_, 0); + } + this->resize(size); + } + + public: + /** + \rst + Constructs a :class:`fmt::basic_memory_buffer` object moving the content + of the other object to it. + \endrst + */ + basic_memory_buffer(basic_memory_buffer&& other) FMT_NOEXCEPT { move(other); } + + /** + \rst + Moves the content of the other ``basic_memory_buffer`` object to this one. + \endrst + */ + basic_memory_buffer& operator=(basic_memory_buffer&& other) FMT_NOEXCEPT { + FMT_ASSERT(this != &other, ""); + deallocate(); + move(other); + return *this; + } + + // Returns a copy of the allocator associated with this buffer. + Allocator get_allocator() const { return alloc_; } +}; + +template +void basic_memory_buffer::grow(size_t size) { +#ifdef FMT_FUZZ + if (size > 5000) throw std::runtime_error("fuzz mode - won't grow that much"); +#endif + size_t old_capacity = this->capacity(); + size_t new_capacity = old_capacity + old_capacity / 2; + if (size > new_capacity) new_capacity = size; + T* old_data = this->data(); + T* new_data = + std::allocator_traits::allocate(alloc_, new_capacity); + // The following code doesn't throw, so the raw pointer above doesn't leak. + std::uninitialized_copy(old_data, old_data + this->size(), + detail::make_checked(new_data, new_capacity)); + this->set(new_data, new_capacity); + // deallocate must not throw according to the standard, but even if it does, + // the buffer already uses the new storage and will deallocate it in + // destructor. + if (old_data != store_) alloc_.deallocate(old_data, old_capacity); +} + +using memory_buffer = basic_memory_buffer; +using wmemory_buffer = basic_memory_buffer; + +template +struct is_contiguous> : std::true_type { +}; + +/** A formatting error such as invalid format string. */ +FMT_CLASS_API +class FMT_API format_error : public std::runtime_error { + public: + explicit format_error(const char* message) : std::runtime_error(message) {} + explicit format_error(const std::string& message) + : std::runtime_error(message) {} + format_error(const format_error&) = default; + format_error& operator=(const format_error&) = default; + format_error(format_error&&) = default; + format_error& operator=(format_error&&) = default; + ~format_error() FMT_NOEXCEPT FMT_OVERRIDE; +}; + +namespace detail { + +template +using is_signed = + std::integral_constant::is_signed || + std::is_same::value>; + +// Returns true if value is negative, false otherwise. +// Same as `value < 0` but doesn't produce warnings if T is an unsigned type. +template ::value)> +FMT_CONSTEXPR bool is_negative(T value) { + return value < 0; +} +template ::value)> +FMT_CONSTEXPR bool is_negative(T) { + return false; +} + +template ::value)> +FMT_CONSTEXPR bool is_supported_floating_point(T) { + return (std::is_same::value && FMT_USE_FLOAT) || + (std::is_same::value && FMT_USE_DOUBLE) || + (std::is_same::value && FMT_USE_LONG_DOUBLE); +} + +// Smallest of uint32_t, uint64_t, uint128_t that is large enough to +// represent all values of T. +template +using uint32_or_64_or_128_t = + conditional_t() <= 32, uint32_t, + conditional_t() <= 64, uint64_t, uint128_t>>; + +// Static data is placed in this class template for the header-only config. +template struct FMT_EXTERN_TEMPLATE_API basic_data { + static const uint64_t powers_of_10_64[]; + static const uint32_t zero_or_powers_of_10_32[]; + static const uint64_t zero_or_powers_of_10_64[]; + static const uint64_t pow10_significands[]; + static const int16_t pow10_exponents[]; + // GCC generates slightly better code for pairs than chars. + using digit_pair = char[2]; + static const digit_pair digits[]; + static const char hex_digits[]; + static const char foreground_color[]; + static const char background_color[]; + static const char reset_color[5]; + static const wchar_t wreset_color[5]; + static const char signs[]; + static const char left_padding_shifts[5]; + static const char right_padding_shifts[5]; +}; + +#ifndef FMT_EXPORTED +FMT_EXTERN template struct basic_data; +#endif + +// This is a struct rather than an alias to avoid shadowing warnings in gcc. +struct data : basic_data<> {}; + +#ifdef FMT_BUILTIN_CLZLL +// Returns the number of decimal digits in n. Leading zeros are not counted +// except for n == 0 in which case count_digits returns 1. +inline int count_digits(uint64_t n) { + // Based on http://graphics.stanford.edu/~seander/bithacks.html#IntegerLog10 + // and the benchmark https://github.com/localvoid/cxx-benchmark-count-digits. + int t = (64 - FMT_BUILTIN_CLZLL(n | 1)) * 1233 >> 12; + return t - (n < data::zero_or_powers_of_10_64[t]) + 1; +} +#else +// Fallback version of count_digits used when __builtin_clz is not available. +inline int count_digits(uint64_t n) { + int count = 1; + for (;;) { + // Integer division is slow so do it for a group of four digits instead + // of for every digit. The idea comes from the talk by Alexandrescu + // "Three Optimization Tips for C++". See speed-test for a comparison. + if (n < 10) return count; + if (n < 100) return count + 1; + if (n < 1000) return count + 2; + if (n < 10000) return count + 3; + n /= 10000u; + count += 4; + } +} +#endif + +#if FMT_USE_INT128 +inline int count_digits(uint128_t n) { + int count = 1; + for (;;) { + // Integer division is slow so do it for a group of four digits instead + // of for every digit. The idea comes from the talk by Alexandrescu + // "Three Optimization Tips for C++". See speed-test for a comparison. + if (n < 10) return count; + if (n < 100) return count + 1; + if (n < 1000) return count + 2; + if (n < 10000) return count + 3; + n /= 10000U; + count += 4; + } +} +#endif + +// Counts the number of digits in n. BITS = log2(radix). +template inline int count_digits(UInt n) { + int num_digits = 0; + do { + ++num_digits; + } while ((n >>= BITS) != 0); + return num_digits; +} + +template <> int count_digits<4>(detail::fallback_uintptr n); + +#if FMT_GCC_VERSION || FMT_CLANG_VERSION +# define FMT_ALWAYS_INLINE inline __attribute__((always_inline)) +#else +# define FMT_ALWAYS_INLINE +#endif + +#ifdef FMT_BUILTIN_CLZ +// Optional version of count_digits for better performance on 32-bit platforms. +inline int count_digits(uint32_t n) { + int t = (32 - FMT_BUILTIN_CLZ(n | 1)) * 1233 >> 12; + return t - (n < data::zero_or_powers_of_10_32[t]) + 1; +} +#endif + +template constexpr int digits10() FMT_NOEXCEPT { + return std::numeric_limits::digits10; +} +template <> constexpr int digits10() FMT_NOEXCEPT { return 38; } +template <> constexpr int digits10() FMT_NOEXCEPT { return 38; } + +template FMT_API std::string grouping_impl(locale_ref loc); +template inline std::string grouping(locale_ref loc) { + return grouping_impl(loc); +} +template <> inline std::string grouping(locale_ref loc) { + return grouping_impl(loc); +} + +template FMT_API Char thousands_sep_impl(locale_ref loc); +template inline Char thousands_sep(locale_ref loc) { + return Char(thousands_sep_impl(loc)); +} +template <> inline wchar_t thousands_sep(locale_ref loc) { + return thousands_sep_impl(loc); +} + +template FMT_API Char decimal_point_impl(locale_ref loc); +template inline Char decimal_point(locale_ref loc) { + return Char(decimal_point_impl(loc)); +} +template <> inline wchar_t decimal_point(locale_ref loc) { + return decimal_point_impl(loc); +} + +// Compares two characters for equality. +template bool equal2(const Char* lhs, const char* rhs) { + return lhs[0] == rhs[0] && lhs[1] == rhs[1]; +} +inline bool equal2(const char* lhs, const char* rhs) { + return memcmp(lhs, rhs, 2) == 0; +} + +// Copies two characters from src to dst. +template void copy2(Char* dst, const char* src) { + *dst++ = static_cast(*src++); + *dst = static_cast(*src); +} +inline void copy2(char* dst, const char* src) { memcpy(dst, src, 2); } + +template struct format_decimal_result { + Iterator begin; + Iterator end; +}; + +// Formats a decimal unsigned integer value writing into out pointing to a +// buffer of specified size. The caller must ensure that the buffer is large +// enough. +template +inline format_decimal_result format_decimal(Char* out, UInt value, + int size) { + FMT_ASSERT(size >= count_digits(value), "invalid digit count"); + out += size; + Char* end = out; + while (value >= 100) { + // Integer division is slow so do it for a group of two digits instead + // of for every digit. The idea comes from the talk by Alexandrescu + // "Three Optimization Tips for C++". See speed-test for a comparison. + out -= 2; + copy2(out, data::digits[value % 100]); + value /= 100; + } + if (value < 10) { + *--out = static_cast('0' + value); + return {out, end}; + } + out -= 2; + copy2(out, data::digits[value]); + return {out, end}; +} + +template >::value)> +inline format_decimal_result format_decimal(Iterator out, UInt value, + int num_digits) { + // Buffer should be large enough to hold all digits (<= digits10 + 1). + enum { max_size = digits10() + 1 }; + Char buffer[2 * max_size]; + auto end = format_decimal(buffer, value, num_digits).end; + return {out, detail::copy_str(buffer, end, out)}; +} + +template +inline Char* format_uint(Char* buffer, UInt value, int num_digits, + bool upper = false) { + buffer += num_digits; + Char* end = buffer; + do { + const char* digits = upper ? "0123456789ABCDEF" : data::hex_digits; + unsigned digit = (value & ((1 << BASE_BITS) - 1)); + *--buffer = static_cast(BASE_BITS < 4 ? static_cast('0' + digit) + : digits[digit]); + } while ((value >>= BASE_BITS) != 0); + return end; +} + +template +Char* format_uint(Char* buffer, detail::fallback_uintptr n, int num_digits, + bool = false) { + auto char_digits = std::numeric_limits::digits / 4; + int start = (num_digits + char_digits - 1) / char_digits - 1; + if (int start_digits = num_digits % char_digits) { + unsigned value = n.value[start--]; + buffer = format_uint(buffer, value, start_digits); + } + for (; start >= 0; --start) { + unsigned value = n.value[start]; + buffer += char_digits; + auto p = buffer; + for (int i = 0; i < char_digits; ++i) { + unsigned digit = (value & ((1 << BASE_BITS) - 1)); + *--p = static_cast(data::hex_digits[digit]); + value >>= BASE_BITS; + } + } + return buffer; +} + +template +inline It format_uint(It out, UInt value, int num_digits, bool upper = false) { + // Buffer should be large enough to hold all digits (digits / BASE_BITS + 1). + char buffer[num_bits() / BASE_BITS + 1]; + format_uint(buffer, value, num_digits, upper); + return detail::copy_str(buffer, buffer + num_digits, out); +} + +// A converter from UTF-8 to UTF-16. +class utf8_to_utf16 { + private: + wmemory_buffer buffer_; + + public: + FMT_API explicit utf8_to_utf16(string_view s); + operator wstring_view() const { return {&buffer_[0], size()}; } + size_t size() const { return buffer_.size() - 1; } + const wchar_t* c_str() const { return &buffer_[0]; } + std::wstring str() const { return {&buffer_[0], size()}; } +}; + +template struct null {}; + +// Workaround an array initialization issue in gcc 4.8. +template struct fill_t { + private: + enum { max_size = 4 }; + Char data_[max_size]; + unsigned char size_; + + public: + FMT_CONSTEXPR void operator=(basic_string_view s) { + auto size = s.size(); + if (size > max_size) { + FMT_THROW(format_error("invalid fill")); + return; + } + for (size_t i = 0; i < size; ++i) data_[i] = s[i]; + size_ = static_cast(size); + } + + size_t size() const { return size_; } + const Char* data() const { return data_; } + + FMT_CONSTEXPR Char& operator[](size_t index) { return data_[index]; } + FMT_CONSTEXPR const Char& operator[](size_t index) const { + return data_[index]; + } + + static FMT_CONSTEXPR fill_t make() { + auto fill = fill_t(); + fill[0] = Char(' '); + fill.size_ = 1; + return fill; + } +}; +} // namespace detail + +// We cannot use enum classes as bit fields because of a gcc bug +// https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61414. +namespace align { +enum type { none, left, right, center, numeric }; +} +using align_t = align::type; + +namespace sign { +enum type { none, minus, plus, space }; +} +using sign_t = sign::type; + +// Format specifiers for built-in and string types. +template struct basic_format_specs { + int width; + int precision; + char type; + align_t align : 4; + sign_t sign : 3; + bool alt : 1; // Alternate form ('#'). + detail::fill_t fill; + + constexpr basic_format_specs() + : width(0), + precision(-1), + type(0), + align(align::none), + sign(sign::none), + alt(false), + fill(detail::fill_t::make()) {} +}; + +using format_specs = basic_format_specs; + +namespace detail { + +// A floating-point presentation format. +enum class float_format : unsigned char { + general, // General: exponent notation or fixed point based on magnitude. + exp, // Exponent notation with the default precision of 6, e.g. 1.2e-3. + fixed, // Fixed point with the default precision of 6, e.g. 0.0012. + hex +}; + +struct float_specs { + int precision; + float_format format : 8; + sign_t sign : 8; + bool upper : 1; + bool locale : 1; + bool binary32 : 1; + bool use_grisu : 1; + bool showpoint : 1; +}; + +// Writes the exponent exp in the form "[+-]d{2,3}" to buffer. +template It write_exponent(int exp, It it) { + FMT_ASSERT(-10000 < exp && exp < 10000, "exponent out of range"); + if (exp < 0) { + *it++ = static_cast('-'); + exp = -exp; + } else { + *it++ = static_cast('+'); + } + if (exp >= 100) { + const char* top = data::digits[exp / 100]; + if (exp >= 1000) *it++ = static_cast(top[0]); + *it++ = static_cast(top[1]); + exp %= 100; + } + const char* d = data::digits[exp]; + *it++ = static_cast(d[0]); + *it++ = static_cast(d[1]); + return it; +} + +template class float_writer { + private: + // The number is given as v = digits_ * pow(10, exp_). + const char* digits_; + int num_digits_; + int exp_; + size_t size_; + float_specs specs_; + Char decimal_point_; + + template It prettify(It it) const { + // pow(10, full_exp - 1) <= v <= pow(10, full_exp). + int full_exp = num_digits_ + exp_; + if (specs_.format == float_format::exp) { + // Insert a decimal point after the first digit and add an exponent. + *it++ = static_cast(*digits_); + int num_zeros = specs_.precision - num_digits_; + if (num_digits_ > 1 || specs_.showpoint) *it++ = decimal_point_; + it = copy_str(digits_ + 1, digits_ + num_digits_, it); + if (num_zeros > 0 && specs_.showpoint) + it = std::fill_n(it, num_zeros, static_cast('0')); + *it++ = static_cast(specs_.upper ? 'E' : 'e'); + return write_exponent(full_exp - 1, it); + } + if (num_digits_ <= full_exp) { + // 1234e7 -> 12340000000[.0+] + it = copy_str(digits_, digits_ + num_digits_, it); + it = std::fill_n(it, full_exp - num_digits_, static_cast('0')); + if (specs_.showpoint || specs_.precision < 0) { + *it++ = decimal_point_; + int num_zeros = specs_.precision - full_exp; + if (num_zeros <= 0) { + if (specs_.format != float_format::fixed) + *it++ = static_cast('0'); + return it; + } +#ifdef FMT_FUZZ + if (num_zeros > 5000) + throw std::runtime_error("fuzz mode - avoiding excessive cpu use"); +#endif + it = std::fill_n(it, num_zeros, static_cast('0')); + } + } else if (full_exp > 0) { + // 1234e-2 -> 12.34[0+] + it = copy_str(digits_, digits_ + full_exp, it); + if (!specs_.showpoint) { + // Remove trailing zeros. + int num_digits = num_digits_; + while (num_digits > full_exp && digits_[num_digits - 1] == '0') + --num_digits; + if (num_digits != full_exp) *it++ = decimal_point_; + return copy_str(digits_ + full_exp, digits_ + num_digits, it); + } + *it++ = decimal_point_; + it = copy_str(digits_ + full_exp, digits_ + num_digits_, it); + if (specs_.precision > num_digits_) { + // Add trailing zeros. + int num_zeros = specs_.precision - num_digits_; + it = std::fill_n(it, num_zeros, static_cast('0')); + } + } else { + // 1234e-6 -> 0.001234 + *it++ = static_cast('0'); + int num_zeros = -full_exp; + int num_digits = num_digits_; + if (num_digits == 0 && specs_.precision >= 0 && + specs_.precision < num_zeros) { + num_zeros = specs_.precision; + } + // Remove trailing zeros. + if (!specs_.showpoint) + while (num_digits > 0 && digits_[num_digits - 1] == '0') --num_digits; + if (num_zeros != 0 || num_digits != 0 || specs_.showpoint) { + *it++ = decimal_point_; + it = std::fill_n(it, num_zeros, static_cast('0')); + it = copy_str(digits_, digits_ + num_digits, it); + } + } + return it; + } + + public: + float_writer(const char* digits, int num_digits, int exp, float_specs specs, + Char decimal_point) + : digits_(digits), + num_digits_(num_digits), + exp_(exp), + specs_(specs), + decimal_point_(decimal_point) { + int full_exp = num_digits + exp - 1; + int precision = specs.precision > 0 ? specs.precision : 16; + if (specs_.format == float_format::general && + !(full_exp >= -4 && full_exp < precision)) { + specs_.format = float_format::exp; + } + size_ = prettify(counting_iterator()).count(); + size_ += specs.sign ? 1 : 0; + } + + size_t size() const { return size_; } + + template It operator()(It it) const { + if (specs_.sign) *it++ = static_cast(data::signs[specs_.sign]); + return prettify(it); + } +}; + +template +int format_float(T value, int precision, float_specs specs, buffer& buf); + +// Formats a floating-point number with snprintf. +template +int snprintf_float(T value, int precision, float_specs specs, + buffer& buf); + +template T promote_float(T value) { return value; } +inline double promote_float(float value) { return static_cast(value); } + +template +FMT_CONSTEXPR void handle_int_type_spec(char spec, Handler&& handler) { + switch (spec) { + case 0: + case 'd': + handler.on_dec(); + break; + case 'x': + case 'X': + handler.on_hex(); + break; + case 'b': + case 'B': + handler.on_bin(); + break; + case 'o': + handler.on_oct(); + break; +#ifdef FMT_DEPRECATED_N_SPECIFIER + case 'n': +#endif + case 'L': + handler.on_num(); + break; + case 'c': + handler.on_chr(); + break; + default: + handler.on_error(); + } +} + +template +FMT_CONSTEXPR float_specs parse_float_type_spec( + const basic_format_specs& specs, ErrorHandler&& eh = {}) { + auto result = float_specs(); + result.showpoint = specs.alt; + switch (specs.type) { + case 0: + result.format = float_format::general; + result.showpoint |= specs.precision > 0; + break; + case 'G': + result.upper = true; + FMT_FALLTHROUGH; + case 'g': + result.format = float_format::general; + break; + case 'E': + result.upper = true; + FMT_FALLTHROUGH; + case 'e': + result.format = float_format::exp; + result.showpoint |= specs.precision != 0; + break; + case 'F': + result.upper = true; + FMT_FALLTHROUGH; + case 'f': + result.format = float_format::fixed; + result.showpoint |= specs.precision != 0; + break; + case 'A': + result.upper = true; + FMT_FALLTHROUGH; + case 'a': + result.format = float_format::hex; + break; +#ifdef FMT_DEPRECATED_N_SPECIFIER + case 'n': +#endif + case 'L': + result.locale = true; + break; + default: + eh.on_error("invalid type specifier"); + break; + } + return result; +} + +template +FMT_CONSTEXPR void handle_char_specs(const basic_format_specs* specs, + Handler&& handler) { + if (!specs) return handler.on_char(); + if (specs->type && specs->type != 'c') return handler.on_int(); + if (specs->align == align::numeric || specs->sign != sign::none || specs->alt) + handler.on_error("invalid format specifier for char"); + handler.on_char(); +} + +template +FMT_CONSTEXPR void handle_cstring_type_spec(Char spec, Handler&& handler) { + if (spec == 0 || spec == 's') + handler.on_string(); + else if (spec == 'p') + handler.on_pointer(); + else + handler.on_error("invalid type specifier"); +} + +template +FMT_CONSTEXPR void check_string_type_spec(Char spec, ErrorHandler&& eh) { + if (spec != 0 && spec != 's') eh.on_error("invalid type specifier"); +} + +template +FMT_CONSTEXPR void check_pointer_type_spec(Char spec, ErrorHandler&& eh) { + if (spec != 0 && spec != 'p') eh.on_error("invalid type specifier"); +} + +template class int_type_checker : private ErrorHandler { + public: + FMT_CONSTEXPR explicit int_type_checker(ErrorHandler eh) : ErrorHandler(eh) {} + + FMT_CONSTEXPR void on_dec() {} + FMT_CONSTEXPR void on_hex() {} + FMT_CONSTEXPR void on_bin() {} + FMT_CONSTEXPR void on_oct() {} + FMT_CONSTEXPR void on_num() {} + FMT_CONSTEXPR void on_chr() {} + + FMT_CONSTEXPR void on_error() { + ErrorHandler::on_error("invalid type specifier"); + } +}; + +template +class char_specs_checker : public ErrorHandler { + private: + char type_; + + public: + FMT_CONSTEXPR char_specs_checker(char type, ErrorHandler eh) + : ErrorHandler(eh), type_(type) {} + + FMT_CONSTEXPR void on_int() { + handle_int_type_spec(type_, int_type_checker(*this)); + } + FMT_CONSTEXPR void on_char() {} +}; + +template +class cstring_type_checker : public ErrorHandler { + public: + FMT_CONSTEXPR explicit cstring_type_checker(ErrorHandler eh) + : ErrorHandler(eh) {} + + FMT_CONSTEXPR void on_string() {} + FMT_CONSTEXPR void on_pointer() {} +}; + +template +FMT_NOINLINE OutputIt fill(OutputIt it, size_t n, const fill_t& fill) { + auto fill_size = fill.size(); + if (fill_size == 1) return std::fill_n(it, n, fill[0]); + for (size_t i = 0; i < n; ++i) it = std::copy_n(fill.data(), fill_size, it); + return it; +} + +// Writes the output of f, padded according to format specifications in specs. +// size: output size in code units. +// width: output display width in (terminal) column positions. +template +inline OutputIt write_padded(OutputIt out, + const basic_format_specs& specs, size_t size, + size_t width, const F& f) { + static_assert(align == align::left || align == align::right, ""); + unsigned spec_width = to_unsigned(specs.width); + size_t padding = spec_width > width ? spec_width - width : 0; + auto* shifts = align == align::left ? data::left_padding_shifts + : data::right_padding_shifts; + size_t left_padding = padding >> shifts[specs.align]; + auto it = reserve(out, size + padding * specs.fill.size()); + it = fill(it, left_padding, specs.fill); + it = f(it); + it = fill(it, padding - left_padding, specs.fill); + return base_iterator(out, it); +} + +template +inline OutputIt write_padded(OutputIt out, + const basic_format_specs& specs, size_t size, + const F& f) { + return write_padded(out, specs, size, size, f); +} + +template +OutputIt write_bytes(OutputIt out, string_view bytes, + const basic_format_specs& specs) { + using iterator = remove_reference_t; + return write_padded(out, specs, bytes.size(), [bytes](iterator it) { + const char* data = bytes.data(); + return copy_str(data, data + bytes.size(), it); + }); +} + +// Data for write_int that doesn't depend on output iterator type. It is used to +// avoid template code bloat. +template struct write_int_data { + size_t size; + size_t padding; + + write_int_data(int num_digits, string_view prefix, + const basic_format_specs& specs) + : size(prefix.size() + to_unsigned(num_digits)), padding(0) { + if (specs.align == align::numeric) { + auto width = to_unsigned(specs.width); + if (width > size) { + padding = width - size; + size = width; + } + } else if (specs.precision > num_digits) { + size = prefix.size() + to_unsigned(specs.precision); + padding = to_unsigned(specs.precision - num_digits); + } + } +}; + +// Writes an integer in the format +// +// where are written by f(it). +template +OutputIt write_int(OutputIt out, int num_digits, string_view prefix, + const basic_format_specs& specs, F f) { + auto data = write_int_data(num_digits, prefix, specs); + using iterator = remove_reference_t; + return write_padded(out, specs, data.size, [=](iterator it) { + if (prefix.size() != 0) + it = copy_str(prefix.begin(), prefix.end(), it); + it = std::fill_n(it, data.padding, static_cast('0')); + return f(it); + }); +} + +template +OutputIt write(OutputIt out, basic_string_view s, + const basic_format_specs& specs) { + auto data = s.data(); + auto size = s.size(); + if (specs.precision >= 0 && to_unsigned(specs.precision) < size) + size = code_point_index(s, to_unsigned(specs.precision)); + auto width = specs.width != 0 + ? count_code_points(basic_string_view(data, size)) + : 0; + using iterator = remove_reference_t; + return write_padded(out, specs, size, width, [=](iterator it) { + return copy_str(data, data + size, it); + }); +} + +// The handle_int_type_spec handler that writes an integer. +template struct int_writer { + OutputIt out; + locale_ref locale; + const basic_format_specs& specs; + UInt abs_value; + char prefix[4]; + unsigned prefix_size; + + using iterator = + remove_reference_t(), 0))>; + + string_view get_prefix() const { return string_view(prefix, prefix_size); } + + template + int_writer(OutputIt output, locale_ref loc, Int value, + const basic_format_specs& s) + : out(output), + locale(loc), + specs(s), + abs_value(static_cast(value)), + prefix_size(0) { + static_assert(std::is_same, UInt>::value, ""); + if (is_negative(value)) { + prefix[0] = '-'; + ++prefix_size; + abs_value = 0 - abs_value; + } else if (specs.sign != sign::none && specs.sign != sign::minus) { + prefix[0] = specs.sign == sign::plus ? '+' : ' '; + ++prefix_size; + } + } + + void on_dec() { + auto num_digits = count_digits(abs_value); + out = write_int( + out, num_digits, get_prefix(), specs, [this, num_digits](iterator it) { + return format_decimal(it, abs_value, num_digits).end; + }); + } + + void on_hex() { + if (specs.alt) { + prefix[prefix_size++] = '0'; + prefix[prefix_size++] = specs.type; + } + int num_digits = count_digits<4>(abs_value); + out = write_int(out, num_digits, get_prefix(), specs, + [this, num_digits](iterator it) { + return format_uint<4, Char>(it, abs_value, num_digits, + specs.type != 'x'); + }); + } + + void on_bin() { + if (specs.alt) { + prefix[prefix_size++] = '0'; + prefix[prefix_size++] = static_cast(specs.type); + } + int num_digits = count_digits<1>(abs_value); + out = write_int(out, num_digits, get_prefix(), specs, + [this, num_digits](iterator it) { + return format_uint<1, Char>(it, abs_value, num_digits); + }); + } + + void on_oct() { + int num_digits = count_digits<3>(abs_value); + if (specs.alt && specs.precision <= num_digits && abs_value != 0) { + // Octal prefix '0' is counted as a digit, so only add it if precision + // is not greater than the number of digits. + prefix[prefix_size++] = '0'; + } + out = write_int(out, num_digits, get_prefix(), specs, + [this, num_digits](iterator it) { + return format_uint<3, Char>(it, abs_value, num_digits); + }); + } + + enum { sep_size = 1 }; + + void on_num() { + std::string groups = grouping(locale); + if (groups.empty()) return on_dec(); + auto sep = thousands_sep(locale); + if (!sep) return on_dec(); + int num_digits = count_digits(abs_value); + int size = num_digits, n = num_digits; + std::string::const_iterator group = groups.cbegin(); + while (group != groups.cend() && n > *group && *group > 0 && + *group != max_value()) { + size += sep_size; + n -= *group; + ++group; + } + if (group == groups.cend()) size += sep_size * ((n - 1) / groups.back()); + char digits[40]; + format_decimal(digits, abs_value, num_digits); + basic_memory_buffer buffer; + size += prefix_size; + buffer.resize(size); + basic_string_view s(&sep, sep_size); + // Index of a decimal digit with the least significant digit having index 0. + int digit_index = 0; + group = groups.cbegin(); + auto p = buffer.data() + size; + for (int i = num_digits - 1; i >= 0; --i) { + *--p = static_cast(digits[i]); + if (*group <= 0 || ++digit_index % *group != 0 || + *group == max_value()) + continue; + if (group + 1 != groups.cend()) { + digit_index = 0; + ++group; + } + p -= s.size(); + std::uninitialized_copy(s.data(), s.data() + s.size(), + make_checked(p, s.size())); + } + if (prefix_size != 0) p[-1] = static_cast('-'); + using iterator = remove_reference_t; + auto data = buffer.data(); + out = write_padded(out, specs, size, size, [=](iterator it) { + return copy_str(data, data + size, it); + }); + } + + void on_chr() { *out++ = static_cast(abs_value); } + + FMT_NORETURN void on_error() { + FMT_THROW(format_error("invalid type specifier")); + } +}; + +template +OutputIt write_nonfinite(OutputIt out, bool isinf, + const basic_format_specs& specs, + const float_specs& fspecs) { + auto str = + isinf ? (fspecs.upper ? "INF" : "inf") : (fspecs.upper ? "NAN" : "nan"); + constexpr size_t str_size = 3; + auto sign = fspecs.sign; + auto size = str_size + (sign ? 1 : 0); + using iterator = remove_reference_t; + return write_padded(out, specs, size, [=](iterator it) { + if (sign) *it++ = static_cast(data::signs[sign]); + return copy_str(str, str + str_size, it); + }); +} + +template ::value)> +OutputIt write(OutputIt out, T value, basic_format_specs specs, + locale_ref loc = {}) { + if (const_check(!is_supported_floating_point(value))) return out; + float_specs fspecs = parse_float_type_spec(specs); + fspecs.sign = specs.sign; + if (std::signbit(value)) { // value < 0 is false for NaN so use signbit. + fspecs.sign = sign::minus; + value = -value; + } else if (fspecs.sign == sign::minus) { + fspecs.sign = sign::none; + } + + if (!std::isfinite(value)) + return write_nonfinite(out, std::isinf(value), specs, fspecs); + + if (specs.align == align::numeric && fspecs.sign) { + auto it = reserve(out, 1); + *it++ = static_cast(data::signs[fspecs.sign]); + out = base_iterator(out, it); + fspecs.sign = sign::none; + if (specs.width != 0) --specs.width; + } + + memory_buffer buffer; + if (fspecs.format == float_format::hex) { + if (fspecs.sign) buffer.push_back(data::signs[fspecs.sign]); + snprintf_float(promote_float(value), specs.precision, fspecs, buffer); + return write_bytes(out, {buffer.data(), buffer.size()}, specs); + } + int precision = specs.precision >= 0 || !specs.type ? specs.precision : 6; + if (fspecs.format == float_format::exp) { + if (precision == max_value()) + FMT_THROW(format_error("number is too big")); + else + ++precision; + } + if (const_check(std::is_same())) fspecs.binary32 = true; + fspecs.use_grisu = use_grisu(); + int exp = format_float(promote_float(value), precision, fspecs, buffer); + fspecs.precision = precision; + Char point = + fspecs.locale ? decimal_point(loc) : static_cast('.'); + float_writer w(buffer.data(), static_cast(buffer.size()), exp, + fspecs, point); + return write_padded(out, specs, w.size(), w); +} + +template ::value)> +OutputIt write(OutputIt out, T value) { + if (const_check(!is_supported_floating_point(value))) return out; + auto fspecs = float_specs(); + if (std::signbit(value)) { // value < 0 is false for NaN so use signbit. + fspecs.sign = sign::minus; + value = -value; + } + + auto specs = basic_format_specs(); + if (!std::isfinite(value)) + return write_nonfinite(out, std::isinf(value), specs, fspecs); + + memory_buffer buffer; + int precision = -1; + if (const_check(std::is_same())) fspecs.binary32 = true; + fspecs.use_grisu = use_grisu(); + int exp = format_float(promote_float(value), precision, fspecs, buffer); + fspecs.precision = precision; + float_writer w(buffer.data(), static_cast(buffer.size()), exp, + fspecs, static_cast('.')); + return base_iterator(out, w(reserve(out, w.size()))); +} + +template +OutputIt write_char(OutputIt out, Char value, + const basic_format_specs& specs) { + using iterator = remove_reference_t; + return write_padded(out, specs, 1, [=](iterator it) { + *it++ = value; + return it; + }); +} + +template +OutputIt write_ptr(OutputIt out, UIntPtr value, + const basic_format_specs* specs) { + int num_digits = count_digits<4>(value); + auto size = to_unsigned(num_digits) + size_t(2); + using iterator = remove_reference_t; + auto write = [=](iterator it) { + *it++ = static_cast('0'); + *it++ = static_cast('x'); + return format_uint<4, Char>(it, value, num_digits); + }; + return specs ? write_padded(out, *specs, size, write) + : base_iterator(out, write(reserve(out, size))); +} + +template struct is_integral : std::is_integral {}; +template <> struct is_integral : std::true_type {}; +template <> struct is_integral : std::true_type {}; + +template +OutputIt write(OutputIt out, monostate) { + FMT_ASSERT(false, ""); + return out; +} + +template ::value)> +OutputIt write(OutputIt out, string_view value) { + auto it = reserve(out, value.size()); + it = copy_str(value.begin(), value.end(), it); + return base_iterator(out, it); +} + +template +OutputIt write(OutputIt out, basic_string_view value) { + auto it = reserve(out, value.size()); + it = std::copy(value.begin(), value.end(), it); + return base_iterator(out, it); +} + +template ::value && + !std::is_same::value && + !std::is_same::value)> +OutputIt write(OutputIt out, T value) { + auto abs_value = static_cast>(value); + bool negative = is_negative(value); + // Don't do -abs_value since it trips unsigned-integer-overflow sanitizer. + if (negative) abs_value = ~abs_value + 1; + int num_digits = count_digits(abs_value); + auto it = reserve(out, (negative ? 1 : 0) + static_cast(num_digits)); + if (negative) *it++ = static_cast('-'); + it = format_decimal(it, abs_value, num_digits).end; + return base_iterator(out, it); +} + +template +OutputIt write(OutputIt out, bool value) { + return write(out, string_view(value ? "true" : "false")); +} + +template +OutputIt write(OutputIt out, Char value) { + auto it = reserve(out, 1); + *it++ = value; + return base_iterator(out, it); +} + +template +OutputIt write(OutputIt out, const Char* value) { + if (!value) { + FMT_THROW(format_error("string pointer is null")); + } else { + auto length = std::char_traits::length(value); + out = write(out, basic_string_view(value, length)); + } + return out; +} + +template +OutputIt write(OutputIt out, const void* value) { + return write_ptr(out, to_uintptr(value), nullptr); +} + +template +auto write(OutputIt out, const T& value) -> typename std::enable_if< + mapped_type_constant>::value == + type::custom_type, + OutputIt>::type { + basic_format_context ctx(out, {}, {}); + return formatter().format(value, ctx); +} + +// An argument visitor that formats the argument and writes it via the output +// iterator. It's a class and not a generic lambda for compatibility with C++11. +template struct default_arg_formatter { + using context = basic_format_context; + + OutputIt out; + basic_format_args args; + locale_ref loc; + + template OutputIt operator()(T value) { + return write(out, value); + } + + OutputIt operator()(typename basic_format_arg::handle handle) { + basic_format_parse_context parse_ctx({}); + basic_format_context format_ctx(out, args, loc); + handle.format(parse_ctx, format_ctx); + return format_ctx.out(); + } +}; + +template +class arg_formatter_base { + public: + using iterator = OutputIt; + using char_type = Char; + using format_specs = basic_format_specs; + + private: + iterator out_; + locale_ref locale_; + format_specs* specs_; + + // Attempts to reserve space for n extra characters in the output range. + // Returns a pointer to the reserved range or a reference to out_. + auto reserve(size_t n) -> decltype(detail::reserve(out_, n)) { + return detail::reserve(out_, n); + } + + using reserve_iterator = remove_reference_t(), 0))>; + + template void write_int(T value, const format_specs& spec) { + using uint_type = uint32_or_64_or_128_t; + int_writer w(out_, locale_, value, spec); + handle_int_type_spec(spec.type, w); + out_ = w.out; + } + + void write(char value) { + auto&& it = reserve(1); + *it++ = value; + } + + template ::value)> + void write(Ch value) { + out_ = detail::write(out_, value); + } + + void write(string_view value) { + auto&& it = reserve(value.size()); + it = copy_str(value.begin(), value.end(), it); + } + void write(wstring_view value) { + static_assert(std::is_same::value, ""); + auto&& it = reserve(value.size()); + it = std::copy(value.begin(), value.end(), it); + } + + template + void write(const Ch* s, size_t size, const format_specs& specs) { + auto width = specs.width != 0 + ? count_code_points(basic_string_view(s, size)) + : 0; + out_ = write_padded(out_, specs, size, width, [=](reserve_iterator it) { + return copy_str(s, s + size, it); + }); + } + + template + void write(basic_string_view s, const format_specs& specs = {}) { + out_ = detail::write(out_, s, specs); + } + + void write_pointer(const void* p) { + out_ = write_ptr(out_, to_uintptr(p), specs_); + } + + struct char_spec_handler : ErrorHandler { + arg_formatter_base& formatter; + Char value; + + char_spec_handler(arg_formatter_base& f, Char val) + : formatter(f), value(val) {} + + void on_int() { + // char is only formatted as int if there are specs. + formatter.write_int(static_cast(value), *formatter.specs_); + } + void on_char() { + if (formatter.specs_) + formatter.out_ = write_char(formatter.out_, value, *formatter.specs_); + else + formatter.write(value); + } + }; + + struct cstring_spec_handler : error_handler { + arg_formatter_base& formatter; + const Char* value; + + cstring_spec_handler(arg_formatter_base& f, const Char* val) + : formatter(f), value(val) {} + + void on_string() { formatter.write(value); } + void on_pointer() { formatter.write_pointer(value); } + }; + + protected: + iterator out() { return out_; } + format_specs* specs() { return specs_; } + + void write(bool value) { + if (specs_) + write(string_view(value ? "true" : "false"), *specs_); + else + out_ = detail::write(out_, value); + } + + void write(const Char* value) { + if (!value) { + FMT_THROW(format_error("string pointer is null")); + } else { + auto length = std::char_traits::length(value); + basic_string_view sv(value, length); + specs_ ? write(sv, *specs_) : write(sv); + } + } + + public: + arg_formatter_base(OutputIt out, format_specs* s, locale_ref loc) + : out_(out), locale_(loc), specs_(s) {} + + iterator operator()(monostate) { + FMT_ASSERT(false, "invalid argument type"); + return out_; + } + + template ::value)> + FMT_INLINE iterator operator()(T value) { + if (specs_) + write_int(value, *specs_); + else + out_ = detail::write(out_, value); + return out_; + } + + iterator operator()(Char value) { + handle_char_specs(specs_, + char_spec_handler(*this, static_cast(value))); + return out_; + } + + iterator operator()(bool value) { + if (specs_ && specs_->type) return (*this)(value ? 1 : 0); + write(value != 0); + return out_; + } + + template ::value)> + iterator operator()(T value) { + auto specs = specs_ ? *specs_ : format_specs(); + if (const_check(is_supported_floating_point(value))) + out_ = detail::write(out_, value, specs, locale_); + else + FMT_ASSERT(false, "unsupported float argument type"); + return out_; + } + + iterator operator()(const Char* value) { + if (!specs_) return write(value), out_; + handle_cstring_type_spec(specs_->type, cstring_spec_handler(*this, value)); + return out_; + } + + iterator operator()(basic_string_view value) { + if (specs_) { + check_string_type_spec(specs_->type, error_handler()); + write(value, *specs_); + } else { + write(value); + } + return out_; + } + + iterator operator()(const void* value) { + if (specs_) check_pointer_type_spec(specs_->type, error_handler()); + write_pointer(value); + return out_; + } +}; + +template FMT_CONSTEXPR bool is_name_start(Char c) { + return ('a' <= c && c <= 'z') || ('A' <= c && c <= 'Z') || '_' == c; +} + +// Parses the range [begin, end) as an unsigned integer. This function assumes +// that the range is non-empty and the first character is a digit. +template +FMT_CONSTEXPR int parse_nonnegative_int(const Char*& begin, const Char* end, + ErrorHandler&& eh) { + FMT_ASSERT(begin != end && '0' <= *begin && *begin <= '9', ""); + unsigned value = 0; + // Convert to unsigned to prevent a warning. + constexpr unsigned max_int = max_value(); + unsigned big = max_int / 10; + do { + // Check for overflow. + if (value > big) { + value = max_int + 1; + break; + } + value = value * 10 + unsigned(*begin - '0'); + ++begin; + } while (begin != end && '0' <= *begin && *begin <= '9'); + if (value > max_int) eh.on_error("number is too big"); + return static_cast(value); +} + +template class custom_formatter { + private: + using char_type = typename Context::char_type; + + basic_format_parse_context& parse_ctx_; + Context& ctx_; + + public: + explicit custom_formatter(basic_format_parse_context& parse_ctx, + Context& ctx) + : parse_ctx_(parse_ctx), ctx_(ctx) {} + + bool operator()(typename basic_format_arg::handle h) const { + h.format(parse_ctx_, ctx_); + return true; + } + + template bool operator()(T) const { return false; } +}; + +template +using is_integer = + bool_constant::value && !std::is_same::value && + !std::is_same::value && + !std::is_same::value>; + +template class width_checker { + public: + explicit FMT_CONSTEXPR width_checker(ErrorHandler& eh) : handler_(eh) {} + + template ::value)> + FMT_CONSTEXPR unsigned long long operator()(T value) { + if (is_negative(value)) handler_.on_error("negative width"); + return static_cast(value); + } + + template ::value)> + FMT_CONSTEXPR unsigned long long operator()(T) { + handler_.on_error("width is not integer"); + return 0; + } + + private: + ErrorHandler& handler_; +}; + +template class precision_checker { + public: + explicit FMT_CONSTEXPR precision_checker(ErrorHandler& eh) : handler_(eh) {} + + template ::value)> + FMT_CONSTEXPR unsigned long long operator()(T value) { + if (is_negative(value)) handler_.on_error("negative precision"); + return static_cast(value); + } + + template ::value)> + FMT_CONSTEXPR unsigned long long operator()(T) { + handler_.on_error("precision is not integer"); + return 0; + } + + private: + ErrorHandler& handler_; +}; + +// A format specifier handler that sets fields in basic_format_specs. +template class specs_setter { + public: + explicit FMT_CONSTEXPR specs_setter(basic_format_specs& specs) + : specs_(specs) {} + + FMT_CONSTEXPR specs_setter(const specs_setter& other) + : specs_(other.specs_) {} + + FMT_CONSTEXPR void on_align(align_t align) { specs_.align = align; } + FMT_CONSTEXPR void on_fill(basic_string_view fill) { + specs_.fill = fill; + } + FMT_CONSTEXPR void on_plus() { specs_.sign = sign::plus; } + FMT_CONSTEXPR void on_minus() { specs_.sign = sign::minus; } + FMT_CONSTEXPR void on_space() { specs_.sign = sign::space; } + FMT_CONSTEXPR void on_hash() { specs_.alt = true; } + + FMT_CONSTEXPR void on_zero() { + specs_.align = align::numeric; + specs_.fill[0] = Char('0'); + } + + FMT_CONSTEXPR void on_width(int width) { specs_.width = width; } + FMT_CONSTEXPR void on_precision(int precision) { + specs_.precision = precision; + } + FMT_CONSTEXPR void end_precision() {} + + FMT_CONSTEXPR void on_type(Char type) { + specs_.type = static_cast(type); + } + + protected: + basic_format_specs& specs_; +}; + +template class numeric_specs_checker { + public: + FMT_CONSTEXPR numeric_specs_checker(ErrorHandler& eh, detail::type arg_type) + : error_handler_(eh), arg_type_(arg_type) {} + + FMT_CONSTEXPR void require_numeric_argument() { + if (!is_arithmetic_type(arg_type_)) + error_handler_.on_error("format specifier requires numeric argument"); + } + + FMT_CONSTEXPR void check_sign() { + require_numeric_argument(); + if (is_integral_type(arg_type_) && arg_type_ != type::int_type && + arg_type_ != type::long_long_type && arg_type_ != type::char_type) { + error_handler_.on_error("format specifier requires signed argument"); + } + } + + FMT_CONSTEXPR void check_precision() { + if (is_integral_type(arg_type_) || arg_type_ == type::pointer_type) + error_handler_.on_error("precision not allowed for this argument type"); + } + + private: + ErrorHandler& error_handler_; + detail::type arg_type_; +}; + +// A format specifier handler that checks if specifiers are consistent with the +// argument type. +template class specs_checker : public Handler { + private: + numeric_specs_checker checker_; + + // Suppress an MSVC warning about using this in initializer list. + FMT_CONSTEXPR Handler& error_handler() { return *this; } + + public: + FMT_CONSTEXPR specs_checker(const Handler& handler, detail::type arg_type) + : Handler(handler), checker_(error_handler(), arg_type) {} + + FMT_CONSTEXPR specs_checker(const specs_checker& other) + : Handler(other), checker_(error_handler(), other.arg_type_) {} + + FMT_CONSTEXPR void on_align(align_t align) { + if (align == align::numeric) checker_.require_numeric_argument(); + Handler::on_align(align); + } + + FMT_CONSTEXPR void on_plus() { + checker_.check_sign(); + Handler::on_plus(); + } + + FMT_CONSTEXPR void on_minus() { + checker_.check_sign(); + Handler::on_minus(); + } + + FMT_CONSTEXPR void on_space() { + checker_.check_sign(); + Handler::on_space(); + } + + FMT_CONSTEXPR void on_hash() { + checker_.require_numeric_argument(); + Handler::on_hash(); + } + + FMT_CONSTEXPR void on_zero() { + checker_.require_numeric_argument(); + Handler::on_zero(); + } + + FMT_CONSTEXPR void end_precision() { checker_.check_precision(); } +}; + +template