#7727 Well Path : Simplify access to all well paths

This commit is contained in:
Magne Sjaastad 2021-05-27 11:25:13 +02:00
parent 087cf41773
commit afb293db52
6 changed files with 9 additions and 24 deletions

View File

@ -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<RimWellPath*> 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 );
}

View File

@ -124,7 +124,7 @@ bool RicDeleteSubItemsFeature::hasDeletableSubItems( caf::PdmUiItem* uiItem )
{
auto collection = dynamic_cast<RimWellPathCollection*>( uiItem );
if ( collection && !collection->topLevelWellPaths().empty() )
if ( collection && !collection->allWellPaths().empty() )
{
return true;
}

View File

@ -175,7 +175,7 @@ std::vector<RimWellPath*> 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 )

View File

@ -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 )

View File

@ -270,7 +270,7 @@ std::vector<RimWellPath*>
scheduleRedrawAffectedViews();
updateAllRequiredEditors();
return topLevelWellPaths();
return allWellPaths();
}
//--------------------------------------------------------------------------------------------------
@ -285,22 +285,12 @@ void RimWellPathCollection::addWellPath( gsl::not_null<RimWellPath*> wellPath, b
m_mostRecentlyUpdatedWellPath = wellPath;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::vector<RimWellPath*> RimWellPathCollection::topLevelWellPaths() const
{
return m_wellPaths.childObjects();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::vector<RimWellPath*> RimWellPathCollection::allWellPaths() const
{
std::vector<RimWellPath*> wellPaths;
descendantsOfType( wellPaths );
return wellPaths;
return m_wellPaths.childObjects();
}
//--------------------------------------------------------------------------------------------------

View File

@ -94,7 +94,6 @@ public:
void loadDataAndUpdate();
std::vector<RimWellPath*> addWellPaths( QStringList filePaths, bool importGrouped, QStringList* errorMessages );
std::vector<RimWellPath*> topLevelWellPaths() const;
std::vector<RimWellPath*> allWellPaths() const;
void removeWellPath( gsl::not_null<RimWellPath*> wellPath );