From 8d358472d9dcbceb658ac97338f34cf4a3626883 Mon Sep 17 00:00:00 2001 From: Kristian Bendiksen Date: Wed, 27 May 2026 10:28:14 +0200 Subject: [PATCH] #13913 Add "Active Wells Only" visibility toggle for simulation wells Adds a collection-level checkbox in the simulation well "Visibility" group that hides wells which are not open at the current time step. Mirrors the existing "Wells Through Visible Cells Only" sibling toggle in placement, default (off), and contour-map gating. The frame-aware predicates isWellPipeVisible, isWellSpheresVisible, isWellValvesVisible and isWellDiskVisible now short-circuit to false when the toggle is on and RigSimWellData::isOpen(frameIndex) is false, placed before the active-intersection bypass so the user's filter is not overridden. Fixes #13913 --- ApplicationLibCode/ProjectDataModel/RimSimWellInView.cpp | 8 ++++++++ .../ProjectDataModel/RimSimWellInViewCollection.cpp | 5 ++++- .../ProjectDataModel/RimSimWellInViewCollection.h | 2 ++ 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/ApplicationLibCode/ProjectDataModel/RimSimWellInView.cpp b/ApplicationLibCode/ProjectDataModel/RimSimWellInView.cpp index c17e260c82a..ead9acf4b6b 100644 --- a/ApplicationLibCode/ProjectDataModel/RimSimWellInView.cpp +++ b/ApplicationLibCode/ProjectDataModel/RimSimWellInView.cpp @@ -508,6 +508,8 @@ bool RimSimWellInView::isWellPipeVisible( size_t frameIndex ) const if ( !showWellPipe() ) return false; + if ( reservoirView->wellCollection()->showOnlyActiveWells() && !simWellData()->isOpen( frameIndex ) ) return false; + if ( reservoirView->intersectionCollection()->hasActiveIntersectionForSimulationWell( this ) ) return true; if ( reservoirView->wellCollection()->showWellsIntersectingVisibleCells() && @@ -548,6 +550,8 @@ bool RimSimWellInView::isWellSpheresVisible( size_t frameIndex ) const if ( !showWellSpheres() ) return false; + if ( reservoirView->wellCollection()->showOnlyActiveWells() && !simWellData()->isOpen( frameIndex ) ) return false; + if ( reservoirView->intersectionCollection()->hasActiveIntersectionForSimulationWell( this ) ) return true; if ( reservoirView->wellCollection()->showWellsIntersectingVisibleCells() && reservoirView->cellFilterCollection()->hasActiveFilters() ) @@ -586,6 +590,8 @@ bool RimSimWellInView::isWellValvesVisible( size_t frameIndex ) const if ( !reservoirView->wellCollection()->isActive() ) return false; if ( !reservoirView->wellCollection()->showValves() ) return false; + if ( reservoirView->wellCollection()->showOnlyActiveWells() && !simWellData()->isOpen( frameIndex ) ) return false; + if ( reservoirView->intersectionCollection()->hasActiveIntersectionForSimulationWell( this ) ) return true; if ( reservoirView->wellCollection()->showWellsIntersectingVisibleCells() && reservoirView->cellFilterCollection()->hasActiveFilters() ) @@ -664,6 +670,8 @@ bool RimSimWellInView::isWellDiskVisible( size_t frameIndex ) const if ( !showWellDisks() ) return false; + if ( reservoirView->wellCollection()->showOnlyActiveWells() && !simWellData()->isOpen( frameIndex ) ) return false; + if ( reservoirView->intersectionCollection()->hasActiveIntersectionForSimulationWell( this ) ) return true; if ( reservoirView->wellCollection()->showWellsIntersectingVisibleCells() && diff --git a/ApplicationLibCode/ProjectDataModel/RimSimWellInViewCollection.cpp b/ApplicationLibCode/ProjectDataModel/RimSimWellInViewCollection.cpp index ddb92b442b0..8aa05c7e339 100644 --- a/ApplicationLibCode/ProjectDataModel/RimSimWellInViewCollection.cpp +++ b/ApplicationLibCode/ProjectDataModel/RimSimWellInViewCollection.cpp @@ -144,6 +144,8 @@ RimSimWellInViewCollection::RimSimWellInViewCollection() // CAF_PDM_InitField(&showWellsIntersectingVisibleCells, "ShowWellsIntersectingVisibleCells", false, "Hide Wells // Missing Visible Cells"); + CAF_PDM_InitField( &m_showOnlyActiveWells, "ShowOnlyActiveWells", false, "Active Wells Only" ); + // Appearance CAF_PDM_InitFieldNoDefault( &m_showWellHead, "ShowWellHeadTristate", "Well Head" ); CAF_PDM_InitFieldNoDefault( &m_showWellLabel, "ShowWellLabelTristate", "Label" ); @@ -404,7 +406,7 @@ void RimSimWellInViewCollection::fieldChangedByUi( const caf::PdmFieldHandle* ch } if ( &isActive == changedField || &m_showWellCells == changedField || &m_showWellCellFence == changedField || - &wellCellFenceType == changedField || &showWellsIntersectingVisibleCells == changedField ) + &wellCellFenceType == changedField || &showWellsIntersectingVisibleCells == changedField || &m_showOnlyActiveWells == changedField ) { m_reservoirView->scheduleGeometryRegen( VISIBLE_WELL_CELLS ); m_reservoirView->scheduleCreateDisplayModelAndRedraw(); @@ -611,6 +613,7 @@ void RimSimWellInViewCollection::defineUiOrdering( QString uiConfigName, caf::Pd if ( !isContourMap ) { appearanceGroup->add( &showWellsIntersectingVisibleCells ); + appearanceGroup->add( &m_showOnlyActiveWells ); } appearanceGroup->add( &m_showWellLabel ); appearanceGroup->add( &m_showWellHead ); diff --git a/ApplicationLibCode/ProjectDataModel/RimSimWellInViewCollection.h b/ApplicationLibCode/ProjectDataModel/RimSimWellInViewCollection.h index 9d3feb7e2e8..28404a64082 100644 --- a/ApplicationLibCode/ProjectDataModel/RimSimWellInViewCollection.h +++ b/ApplicationLibCode/ProjectDataModel/RimSimWellInViewCollection.h @@ -125,6 +125,7 @@ class RimSimWellInViewCollection : public caf::PdmObject bool showWellCells(); bool showWellCommunicationLines() { return m_showWellCommunicationLines(); } + bool showOnlyActiveWells() const { return m_showOnlyActiveWells(); } caf::PdmField wellCellFenceType; caf::PdmField wellCellTransparencyLevel; @@ -199,6 +200,7 @@ class RimSimWellInViewCollection : public caf::PdmObject caf::PdmField m_showWellValves; caf::PdmField m_showWellCommunicationLines; + caf::PdmField m_showOnlyActiveWells; // Well Discs caf::PdmField> m_wellDiskPropertyType;