mirror of
https://github.com/OPM/ResInsight.git
synced 2026-10-26 23:20:29 -05:00
Refactor MSW segment update to use static method
Refactored RimMswSegmentCollection::updateSegments from an instance method to a static method that requires explicit top-level RimWellPath and RimEclipseCase parameters. Updated RimWellPathCollection to collect unique top-level wells and call the new static method.
This commit is contained in:
1 parent
3d2f369d6d
commit
e6e6d5b818
4 files changed
+29
-26
No files matched your search
@@ -601,6 +601,8 @@ caf::PdmFieldHandle* RimWellPathCollection::objectToggleField()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimWellPathCollection::updateMswSegments()
|
||||
{
|
||||
std::set<RimWellPath*> topLevelWells;
|
||||
|
||||
for ( const auto& wellPath : m_wellPaths )
|
||||
{
|
||||
if ( !wellPath ) continue;
|
||||
@@ -611,7 +613,15 @@ void RimWellPathCollection::updateMswSegments()
|
||||
auto* segmentCollection = completions->mswSegmentCollection();
|
||||
if ( !segmentCollection ) continue;
|
||||
|
||||
segmentCollection->updateSegments( m_mswEclipseCase() );
|
||||
segmentCollection->clearSegments();
|
||||
|
||||
topLevelWells.insert( wellPath->topLevelWellPath() );
|
||||
}
|
||||
|
||||
// Update segments for all top level wells, which will update the segments for all connected well paths
|
||||
for ( RimWellPath* topLevelWell : topLevelWells )
|
||||
{
|
||||
RimMswSegmentCollection::updateSegments( topLevelWell, m_mswEclipseCase() );
|
||||
}
|
||||
|
||||
if ( RimProject* project = RimProject::current() )
|
||||
|
||||
Reference in new issue
Block a user