Major rewrite of MSW export model

This commit is contained in:
Magne Sjaastad
2021-04-13 07:22:56 +02:00
parent 9ecfefe094
commit 63690d5196
65 changed files with 2766 additions and 2225 deletions

View File

@@ -99,7 +99,33 @@ void RicWellPathExportCompletionDataFeature::prepareExportSettingsAndExportCompl
s->descendantsIncludingThisOfType( simWellFractures );
}
for ( auto w : wellPaths )
std::vector<RimWellPath*> topLevelWells;
{
std::set<RimWellPath*> myWells;
for ( auto w : wellPaths )
{
myWells.insert( w->topLevelWellPath() );
}
topLevelWells.assign( myWells.begin(), myWells.end() );
}
std::vector<RimWellPath*> allLaterals;
{
std::set<RimWellPath*> laterals;
for ( auto t : topLevelWells )
{
auto laterals = t->wellPathLateralsRecursively();
for ( auto l : laterals )
{
allLaterals.push_back( l );
}
}
}
for ( auto w : allLaterals )
{
w->descendantsIncludingThisOfType( wellPathFractures );
w->descendantsIncludingThisOfType( wellPathFishbones );
@@ -162,7 +188,7 @@ void RicWellPathExportCompletionDataFeature::prepareExportSettingsAndExportCompl
RiaApplication::instance()->setLastUsedDialogDirectory( "COMPLETIONS", exportSettings->folder );
RicWellPathExportCompletionDataFeatureImpl::exportCompletions( wellPaths, simWells, *exportSettings );
RicWellPathExportCompletionDataFeatureImpl::exportCompletions( topLevelWells, simWells, *exportSettings );
}
}
@@ -220,25 +246,5 @@ std::vector<RimWellPath*> RicWellPathExportCompletionDataFeature::selectedWellPa
std::vector<RimWellPath*> wellPaths;
caf::SelectionManager::instance()->objectsByType( &wellPaths );
std::set<RimWellPath*> uniqueWellPaths( wellPaths.begin(), wellPaths.end() );
wellPaths.assign( uniqueWellPaths.begin(), uniqueWellPaths.end() );
if ( wellPaths.empty() )
{
RimWellPathCompletions* completions =
caf::SelectionManager::instance()->selectedItemAncestorOfType<RimWellPathCompletions>();
if ( completions )
{
RimWellPath* wellPath = nullptr;
completions->firstAncestorOrThisOfTypeAsserted( wellPath );
wellPaths.push_back( wellPath );
}
}
wellPaths.erase( std::remove_if( wellPaths.begin(),
wellPaths.end(),
[]( auto wellPath ) { return !wellPath->isTopLevelWellPath(); } ),
wellPaths.end() );
return wellPaths;
}