mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Janitor : Encapsulate dynamic cast to selection item type
This commit is contained in:
@@ -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<RiuWellPathSelectionItem*>( selItem );
|
||||
|
||||
return wellPathItem;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user