diff --git a/ApplicationLibCode/Commands/CompletionExportCommands/RicWellPathExportCompletionDataFeatureImpl.cpp b/ApplicationLibCode/Commands/CompletionExportCommands/RicWellPathExportCompletionDataFeatureImpl.cpp index 59a8f17b87..b21578fe44 100644 --- a/ApplicationLibCode/Commands/CompletionExportCommands/RicWellPathExportCompletionDataFeatureImpl.cpp +++ b/ApplicationLibCode/Commands/CompletionExportCommands/RicWellPathExportCompletionDataFeatureImpl.cpp @@ -144,23 +144,19 @@ void RicWellPathExportCompletionDataFeatureImpl::exportCompletions( const std::v { caf::ProgressInfo progress( topLevelWellPaths.size(), "Extracting Completion Data For Well Paths" ); - for ( RimWellPath* wellPath : topLevelWellPaths ) + for ( RimWellPath* topLevelWellPath : topLevelWellPaths ) { std::vector allWellPathLaterals; - if ( wellPath->unitSystem() == exportSettings.caseToApply->eclipseCaseData()->unitsType() ) + if ( topLevelWellPath->unitSystem() == exportSettings.caseToApply->eclipseCaseData()->unitsType() ) { - auto tieInWells = wellPath->wellPathLateralsRecursively(); - for ( auto w : tieInWells ) - { - allWellPathLaterals.push_back( w ); - } + allWellPathLaterals = topLevelWellPath->wellPathLateralsRecursively(); } else { int caseId = exportSettings.caseToApply->caseId(); QString format = QString( "Unit systems for well path \"%1\" must match unit system of chosen eclipse case \"%2\"" ); - QString errMsg = format.arg( wellPath->name() ).arg( caseId ); + QString errMsg = format.arg( topLevelWellPath->name() ).arg( caseId ); RiaLogging::error( errMsg ); } diff --git a/ApplicationLibCode/Commands/RicDeleteSubItemsFeature.cpp b/ApplicationLibCode/Commands/RicDeleteSubItemsFeature.cpp index 7e4cb1fa4f..46a35c26f8 100644 --- a/ApplicationLibCode/Commands/RicDeleteSubItemsFeature.cpp +++ b/ApplicationLibCode/Commands/RicDeleteSubItemsFeature.cpp @@ -124,7 +124,7 @@ bool RicDeleteSubItemsFeature::hasDeletableSubItems( caf::PdmUiItem* uiItem ) { auto collection = dynamic_cast( uiItem ); - if ( collection && !collection->topLevelWellPaths().empty() ) + if ( collection && !collection->allWellPaths().empty() ) { return true; } diff --git a/ApplicationLibCode/Commands/WellPathCommands/RicImportWellPaths.cpp b/ApplicationLibCode/Commands/WellPathCommands/RicImportWellPaths.cpp index cb4f0ba10b..1eacb7b706 100644 --- a/ApplicationLibCode/Commands/WellPathCommands/RicImportWellPaths.cpp +++ b/ApplicationLibCode/Commands/WellPathCommands/RicImportWellPaths.cpp @@ -175,7 +175,7 @@ std::vector RicImportWellPaths::importWellPaths( const QStringList project->scheduleCreateDisplayModelAndRedrawAllViews(); RimOilField* oilField = project->activeOilField(); - if ( oilField && !oilField->wellPathCollection->topLevelWellPaths().empty() ) + if ( oilField && !oilField->wellPathCollection->allWellPaths().empty() ) { RimWellPath* wellPath = oilField->wellPathCollection->mostRecentlyUpdatedWellPath(); if ( wellPath ) diff --git a/ApplicationLibCode/Commands/WellPathCommands/RicWellPathFormationsImportFileFeature.cpp b/ApplicationLibCode/Commands/WellPathCommands/RicWellPathFormationsImportFileFeature.cpp index 153b63f204..7154634b13 100644 --- a/ApplicationLibCode/Commands/WellPathCommands/RicWellPathFormationsImportFileFeature.cpp +++ b/ApplicationLibCode/Commands/WellPathCommands/RicWellPathFormationsImportFileFeature.cpp @@ -78,7 +78,7 @@ void RicWellPathFormationsImportFileFeature::onActionTriggered( bool isChecked ) if ( !oilField ) return; - if ( oilField->wellPathCollection->topLevelWellPaths().size() > 0 ) + if ( oilField->wellPathCollection->allWellPaths().size() > 0 ) { RimWellPath* wellPath = oilField->wellPathCollection->mostRecentlyUpdatedWellPath(); if ( wellPath ) diff --git a/ApplicationLibCode/ProjectDataModel/RimWellPathCollection.cpp b/ApplicationLibCode/ProjectDataModel/RimWellPathCollection.cpp index dda09a0ea9..8879113ba0 100644 --- a/ApplicationLibCode/ProjectDataModel/RimWellPathCollection.cpp +++ b/ApplicationLibCode/ProjectDataModel/RimWellPathCollection.cpp @@ -270,7 +270,7 @@ std::vector scheduleRedrawAffectedViews(); updateAllRequiredEditors(); - return topLevelWellPaths(); + return allWellPaths(); } //-------------------------------------------------------------------------------------------------- @@ -285,22 +285,12 @@ void RimWellPathCollection::addWellPath( gsl::not_null wellPath, b m_mostRecentlyUpdatedWellPath = wellPath; } -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -std::vector RimWellPathCollection::topLevelWellPaths() const -{ - return m_wellPaths.childObjects(); -} - //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- std::vector RimWellPathCollection::allWellPaths() const { - std::vector wellPaths; - descendantsOfType( wellPaths ); - return wellPaths; + return m_wellPaths.childObjects(); } //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationLibCode/ProjectDataModel/RimWellPathCollection.h b/ApplicationLibCode/ProjectDataModel/RimWellPathCollection.h index 1fe8286e51..97964b3500 100644 --- a/ApplicationLibCode/ProjectDataModel/RimWellPathCollection.h +++ b/ApplicationLibCode/ProjectDataModel/RimWellPathCollection.h @@ -94,7 +94,6 @@ public: void loadDataAndUpdate(); std::vector addWellPaths( QStringList filePaths, bool importGrouped, QStringList* errorMessages ); - std::vector topLevelWellPaths() const; std::vector allWellPaths() const; void removeWellPath( gsl::not_null wellPath );