Auto-update MSW segments on UI changes (opt-in)

Adds an 'Auto Update Segments' toggle (default: on) to the MSW Segment
Visualization group in WellPathCollection. When enabled, MSW segments
are automatically recomputed and redrawn whenever the user modifies:
- Well path geometry or targets
- Perforation intervals
- Fishbone laterals
- Fractures
- Well path fields

The update is triggered via a new updateMswSegmentsForObject()
method, which resolves the top-level well from the changed object, clears
existing segments for all lateral wells in that group, recomputes segments
using updateSegments(), and schedules a full redraw.

When auto-update is disabled, an 'Update Segments' button is shown
instead, allowing manual control.
This commit is contained in:
Magne Sjaastad committed 2026-03-17 20:15:07 +01:00
1 parent a73067b6ea
commit 211ae24241
14 files changed
+156 -14

No files matched your search

@@ -32,6 +32,7 @@
#include "RimModeledWellPath.h"
#include "RimProject.h"
#include "RimWellPathCollection.h"
#include "RimWellPathGeometryDefTools.h"
#include "RimWellPathTarget.h"
@@ -552,6 +553,22 @@ void RimWellPathGeometryDef::fieldChangedByUi( const caf::PdmFieldHandle* change
}
changed.send( false );
if ( auto wellPathCollection = RimWellPathCollection::instance() )
{
wellPathCollection->updateMswSegmentsForObject( this );
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellPathGeometryDef::childFieldChangedByUi( const caf::PdmFieldHandle* changedChildField )
{
if ( auto wellPathCollection = RimWellPathCollection::instance() )
{
wellPathCollection->updateMswSegmentsForObject( this );
}
}
//--------------------------------------------------------------------------------------------------