mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#1094 Gray out wells not visible because they do not intersect visible cells
This commit is contained in:
parent
bd14f97a2b
commit
7b6574327e
@ -791,6 +791,13 @@ void RimEclipseView::updateDisplayModelVisibility()
|
||||
m_viewer->update();
|
||||
|
||||
faultCollection->updateConnectedEditors();
|
||||
|
||||
// This is required to update the read-only state of simulation wells
|
||||
// when a range filter is manipulated and visible simulation wells might change
|
||||
//
|
||||
// The visibility is controlled by RimEclipseWell::defineUiTreeOrdering
|
||||
// updateConnectedEditors will call recursively on child objects
|
||||
wellCollection->updateConnectedEditors();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -231,6 +231,31 @@ void RimEclipseWell::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering&
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimEclipseWell::defineUiTreeOrdering(caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName /*= ""*/)
|
||||
{
|
||||
const RimEclipseView* reservoirView = nullptr;
|
||||
this->firstAncestorOrThisOfType(reservoirView);
|
||||
if (!reservoirView) return;
|
||||
|
||||
const RimEclipseWellCollection* wellColl = nullptr;
|
||||
this->firstAncestorOrThisOfType(wellColl);
|
||||
if (!wellColl) return;
|
||||
|
||||
if (wellColl->showWellsIntersectingVisibleCells() && !this->intersectsVisibleCells(static_cast<size_t>(reservoirView->currentTimeStep())))
|
||||
{
|
||||
// Mark well as read only if well is not intersecting visible cells
|
||||
|
||||
this->uiCapability()->setUiReadOnly(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
this->uiCapability()->setUiReadOnly(false);
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -83,6 +83,7 @@ public:
|
||||
protected:
|
||||
virtual void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue) override;
|
||||
virtual void defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering) override;
|
||||
virtual void defineUiTreeOrdering(caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName = "") override;
|
||||
|
||||
private:
|
||||
bool intersectsVisibleCells(size_t frameIndex) const;
|
||||
|
Loading…
Reference in New Issue
Block a user