Intersection : Support creation of multiple intersections from sim wells

This commit is contained in:
Magne Sjaastad 2022-01-10 22:19:22 +01:00
parent 051bbe6467
commit eb02908dc7
2 changed files with 12 additions and 11 deletions

View File

@ -46,18 +46,18 @@ bool RicNewSimWellIntersectionFeature::isCommandEnabled()
//--------------------------------------------------------------------------------------------------
void RicNewSimWellIntersectionFeature::onActionTriggered( bool isChecked )
{
std::vector<RimSimWellInView*> collection;
caf::SelectionManager::instance()->objectsByType( &collection );
CVF_ASSERT( collection.size() == 1 );
std::vector<RimSimWellInView*> simWells;
caf::SelectionManager::instance()->objectsByType( &simWells );
RimSimWellInView* simWell = collection[0];
for ( auto simWell : simWells )
{
RimEclipseView* eclView = nullptr;
simWell->firstAncestorOrThisOfType( eclView );
CVF_ASSERT( eclView );
RimEclipseView* eclView = nullptr;
simWell->firstAncestorOrThisOfType( eclView );
CVF_ASSERT( eclView );
RicNewSimWellIntersectionCmd* cmd = new RicNewSimWellIntersectionCmd( eclView->intersectionCollection(), simWell );
caf::CmdExecCommandManager::instance()->processExecuteCommand( cmd );
auto* cmd = new RicNewSimWellIntersectionCmd( eclView->intersectionCollection(), simWell );
caf::CmdExecCommandManager::instance()->processExecuteCommand( cmd );
}
}
//--------------------------------------------------------------------------------------------------
@ -103,7 +103,7 @@ void RicNewSimWellIntersectionCmd::redo()
CVF_ASSERT( m_intersectionCollection );
CVF_ASSERT( m_simWell );
RimExtrudedCurveIntersection* intersection = new RimExtrudedCurveIntersection();
auto* intersection = new RimExtrudedCurveIntersection();
intersection->setName( m_simWell->name );
intersection->configureForSimulationWell( m_simWell );

View File

@ -1182,6 +1182,7 @@ caf::CmdFeatureMenuBuilder RimContextCommandBuilder::commandsFromSelection()
menuBuilder << "RicEclipseWellShowWellCellFenceFeature";
menuBuilder << "Separator";
menuBuilder << "RicNewSimWellFractureFeature";
menuBuilder << "RicNewSimWellIntersectionFeature";
}
#ifdef USE_ODB_API
else if ( dynamic_cast<RimWellIASettings*>( firstUiItem ) )