mirror of
https://github.com/OPM/ResInsight.git
synced 2026-10-26 07:00:17 -05:00
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:
1 parent
a73067b6ea
commit
211ae24241
14 files changed
+156
-14
No files matched your search
@@ -44,7 +44,6 @@
|
||||
#include "RimPerforationCollection.h"
|
||||
#include "RimProject.h"
|
||||
#include "RimStimPlanModelCollection.h"
|
||||
#include "RimTools.h"
|
||||
#include "RimValveCollection.h"
|
||||
#include "RimWellEventTimeline.h"
|
||||
#include "RimWellIASettingsCollection.h"
|
||||
@@ -190,8 +189,7 @@ double RimWellPath::wellPathRadius( double characteristicCellSize ) const
|
||||
{
|
||||
double radius = characteristicCellSize * m_wellPathRadiusScaleFactor();
|
||||
|
||||
RimWellPathCollection* coll = RimTools::wellPathCollection();
|
||||
if ( coll )
|
||||
if ( auto coll = RimWellPathCollection::instance() )
|
||||
{
|
||||
radius *= coll->wellPathRadiusScaleFactor();
|
||||
}
|
||||
@@ -492,6 +490,11 @@ void RimWellPath::fieldChangedByUi( const caf::PdmFieldHandle* changedField, con
|
||||
else
|
||||
{
|
||||
proj->scheduleCreateDisplayModelAndRedrawAllViews();
|
||||
|
||||
if ( auto wellPathCollection = RimWellPathCollection::instance() )
|
||||
{
|
||||
wellPathCollection->updateMswSegmentsForObject( this );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -848,7 +851,7 @@ void RimWellPath::defineObjectEditorAttribute( QString uiConfigName, caf::PdmUiE
|
||||
// The nodes for well paths are created by the well path collection object. When a well path object is asked to
|
||||
// be updated in the project tree, always rebuild the tree from the well path collection object.
|
||||
|
||||
myAttr->objectForUpdateOfUiTree = RimTools::wellPathCollection();
|
||||
myAttr->objectForUpdateOfUiTree = RimWellPathCollection::instance();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user