#14101 Make Fault Distance objects deletable

Enable the standard tree Delete action on RimFaultDistance via
setDeletable( true ). On deletion, remove the generated FAULTDIST result
from the case in the destructor; the object is still attached to the
project tree while the destructor body runs, so the owner case is
reachable.
This commit is contained in:
Kristian Bendiksen
2026-06-08 21:42:19 +02:00
committed by Magne Sjaastad
parent 12cd173c62
commit a90e7bb26a
2 changed files with 12 additions and 0 deletions
@@ -59,6 +59,17 @@ RimFaultDistance::RimFaultDistance()
CAF_PDM_InitFieldNoDefault( &m_generateButton, "Generate", "" );
caf::PdmUiPushButtonEditor::configureEditorLabelLeft( &m_generateButton );
setDeletable( true );
}
//--------------------------------------------------------------------------------------------------
/// Remove the generated result from the case when the object is deleted. The object is still
/// attached to the project tree while this destructor body runs, so the owner case is reachable.
//--------------------------------------------------------------------------------------------------
RimFaultDistance::~RimFaultDistance()
{
removeGeneratedResult( m_resultName() );
}
//--------------------------------------------------------------------------------------------------
@@ -43,6 +43,7 @@ class RimFaultDistance : public caf::PdmObject
public:
RimFaultDistance();
~RimFaultDistance() override;
QString resultName() const;
void setResultName( const QString& name );