Add valve visualization to MSW wells

* Refactor geo generator
* Add valve visualization to segments that are connected to a valve
This commit is contained in:
Magne Sjaastad
2023-03-02 13:06:38 +01:00
committed by GitHub
parent 8a2d9ec83e
commit d47d4060cc
16 changed files with 452 additions and 200 deletions

View File

@@ -574,6 +574,43 @@ bool RimSimWellInView::isWellSpheresVisible( size_t frameIndex ) const
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RimSimWellInView::isWellValvesVisible( size_t frameIndex ) const
{
const RimEclipseView* reservoirView = nullptr;
this->firstAncestorOrThisOfType( reservoirView );
if ( reservoirView == nullptr ) return false;
if ( this->simWellData() == nullptr ) return false;
if ( frameIndex >= this->simWellData()->m_resultTimeStepIndexToWellTimeStepIndex.size() )
{
return false;
}
size_t wellTimeStepIndex = this->simWellData()->m_resultTimeStepIndexToWellTimeStepIndex[frameIndex];
if ( wellTimeStepIndex == cvf::UNDEFINED_SIZE_T )
{
return false;
}
if ( !this->showWell() ) return false;
if ( !reservoirView->wellCollection()->isActive() ) return false;
if ( !reservoirView->wellCollection()->showValves() ) return false;
if ( reservoirView->intersectionCollection()->hasActiveIntersectionForSimulationWell( this ) ) return true;
if ( reservoirView->wellCollection()->showWellsIntersectingVisibleCells() && reservoirView->cellFilterCollection()->hasActiveFilters() )
{
return intersectsDynamicWellCellsFilteredCells( frameIndex );
}
return true;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------

View File

@@ -65,6 +65,7 @@ public:
bool isWellCellsVisible() const;
bool isWellPipeVisible( size_t frameIndex ) const;
bool isWellSpheresVisible( size_t frameIndex ) const;
bool isWellValvesVisible( size_t frameIndex ) const;
bool isUsingCellCenterForPipe() const;
RigWellDiskData wellDiskData() const;

View File

@@ -212,6 +212,8 @@ RimSimWellInViewCollection::RimSimWellInViewCollection()
m_showWellCellFence.uiCapability()->setUiEditorTypeName( caf::PdmUiCheckBoxTristateEditor::uiEditorTypeName() );
m_showWellCellFence.xmlCapability()->disableIO();
CAF_PDM_InitField( &m_showWellValves, "ShowWellValvesTristate", true, "Valves" );
CAF_PDM_InitFieldNoDefault( &m_wellDiskSummaryCase, "WellDiskSummaryCase", "Summary Case" );
CAF_PDM_InitField( &m_wellDiskQuantity, "WellDiskQuantity", QString( "WOPT" ), "Disk Quantity" );
@@ -439,7 +441,8 @@ void RimSimWellInViewCollection::fieldChangedByUi( const caf::PdmFieldHandle* ch
{
m_reservoirView->updateDisplayModelForCurrentTimeStepAndRedraw();
}
else if ( &spheresScaleFactor == changedField || &m_showWellSpheres == changedField || &showConnectionStatusColors == changedField )
else if ( &spheresScaleFactor == changedField || &m_showWellSpheres == changedField ||
&showConnectionStatusColors == changedField || &m_showWellValves == changedField )
{
m_reservoirView->scheduleSimWellGeometryRegen();
m_reservoirView->scheduleCreateDisplayModelAndRedraw();
@@ -650,6 +653,7 @@ void RimSimWellInViewCollection::defineUiOrdering( QString uiConfigName, caf::Pd
appearanceGroup->add( &m_showWellSpheres );
appearanceGroup->add( &m_showWellDisks );
appearanceGroup->add( &m_showWellCommunicationLines );
appearanceGroup->add( &m_showWellValves );
if ( !isContourMap )
{
@@ -943,6 +947,14 @@ double RimSimWellInViewCollection::wellDiskScaleFactor() const
return m_wellDiskScaleFactor();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RimSimWellInViewCollection::showValves() const
{
return m_showWellValves();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------

View File

@@ -161,6 +161,8 @@ public:
void scaleWellDisks();
double wellDiskScaleFactor() const;
bool showValves() const;
caf::PdmField<cvf::Color3f> wellDiskColor;
protected:
@@ -196,6 +198,7 @@ private:
caf::PdmField<caf::Tristate> m_showWellCells;
caf::PdmField<caf::Tristate> m_showWellCellFence;
caf::PdmField<bool> m_showWellValves;
caf::PdmField<bool> m_showWellCommunicationLines;
// Well Discs