Improve well path modeling

* Improve handling of MD at first target
* When sea level well target is disabled, update MD of first target
* Show well target spheres by default, allow toggling of spheres
* Activate well target modifiers when clicking on well targets
* Remove selection update causing an unstable 3D view
* Improve display and handling of multiple locations
* Add special 3D target for tie in well target
* Add slider to tie in MD input field
* Show MD in well path target table
* Delete all well path laterals when deleting a well path

* Python : Add lateral to parent well
* Python : Add perforation interval
This commit is contained in:
Magne Sjaastad
2021-08-13 16:48:33 +02:00
committed by GitHub
parent 40bd4c285a
commit 8dbb1d5ccd
50 changed files with 1377 additions and 310 deletions

View File

@@ -24,6 +24,7 @@
#include "Riu3dSelectionManager.h"
#include "cafSelectionManager.h"
#include "cafSelectionManagerTools.h"
#include <QAction>
@@ -34,7 +35,7 @@ CAF_CMD_SOURCE_INIT( RicLinkWellPathFeature, "RicLinkWellPathFeature" );
//--------------------------------------------------------------------------------------------------
bool RicLinkWellPathFeature::isCommandEnabled()
{
return ( wellPathGeometryDef() != nullptr );
return ( !wellPaths().empty() );
}
//--------------------------------------------------------------------------------------------------
@@ -42,10 +43,14 @@ bool RicLinkWellPathFeature::isCommandEnabled()
//--------------------------------------------------------------------------------------------------
void RicLinkWellPathFeature::onActionTriggered( bool isChecked )
{
if ( auto geoDef = wellPathGeometryDef() )
for ( auto w : wellPaths() )
{
geoDef->enableLinkOfReferencePointUpdates( isChecked );
geoDef->updateConnectedEditors();
if ( auto modeledWell = dynamic_cast<RimModeledWellPath*>( w ) )
{
auto geoDef = modeledWell->geometryDefinition();
geoDef->enableLinkOfReferencePointUpdates( isChecked );
geoDef->updateConnectedEditors();
}
}
}
@@ -58,6 +63,8 @@ void RicLinkWellPathFeature::setupActionLook( QAction* actionToSetup )
actionToSetup->setText( text );
actionToSetup->setCheckable( true );
actionToSetup->setChecked( isCommandChecked() );
actionToSetup->setIcon( QIcon( ":/chain.png" ) );
}
//--------------------------------------------------------------------------------------------------
@@ -65,27 +72,39 @@ void RicLinkWellPathFeature::setupActionLook( QAction* actionToSetup )
//--------------------------------------------------------------------------------------------------
bool RicLinkWellPathFeature::isCommandChecked()
{
if ( auto geoDef = wellPathGeometryDef() )
if ( !wellPaths().empty() )
{
return geoDef->isReferencePointUpdatesLinked();
auto firstWell = dynamic_cast<RimModeledWellPath*>( wellPaths().front() );
if ( auto geoDef = firstWell->geometryDefinition() )
{
return geoDef->isReferencePointUpdatesLinked();
}
}
return false;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimWellPathGeometryDef* RicLinkWellPathFeature::wellPathGeometryDef()
std::vector<RimWellPath*> RicLinkWellPathFeature::wellPaths()
{
std::vector<RimWellPath*> wellPaths;
auto wellPathSelectionItem = RiuWellPathSelectionItem::wellPathSelectionItem();
if ( wellPathSelectionItem && wellPathSelectionItem->m_wellpath )
{
if ( auto modeledWellPath = dynamic_cast<RimModeledWellPath*>( wellPathSelectionItem->m_wellpath ) )
if ( auto modeledWellPath =
dynamic_cast<RimModeledWellPath*>( wellPathSelectionItem->m_wellpath->topLevelWellPath() ) )
{
return modeledWellPath->geometryDefinition();
wellPaths.push_back( modeledWellPath );
}
}
return nullptr;
auto selectedWells = caf::selectedObjectsByTypeStrict<RimWellPath*>();
for ( auto w : selectedWells )
{
wellPaths.push_back( w->topLevelWellPath() );
}
return wellPaths;
}