From 521e170178ec906e829dadda00dd602103954171 Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Wed, 24 Apr 2019 13:07:54 +0200 Subject: [PATCH] #4352 Hide Fracture CONDUCTIVTY legend if no visible fractures --- .../ProjectDataModel/RimEclipseView.cpp | 28 +++++++++++++++---- 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/ApplicationCode/ProjectDataModel/RimEclipseView.cpp b/ApplicationCode/ProjectDataModel/RimEclipseView.cpp index 174f2f5f62..e4333aaaf1 100644 --- a/ApplicationCode/ProjectDataModel/RimEclipseView.cpp +++ b/ApplicationCode/ProjectDataModel/RimEclipseView.cpp @@ -1199,14 +1199,30 @@ void RimEclipseView::updateLegends() } } - RimRegularLegendConfig* stimPlanLegend = fractureColors()->activeLegend(); - if (stimPlanLegend && stimPlanLegend->showLegend()) { - fractureColors()->updateLegendData(); - - if (fractureColors()->isChecked() && stimPlanLegend->titledOverlayFrame()) + bool hasAnyVisibleFractures = false; { - m_viewer->addColorLegendToBottomLeftCorner(stimPlanLegend->titledOverlayFrame()); + std::vector fractures; + RiaApplication::instance()->project()->activeOilField()->descendantsIncludingThisOfType(fractures); + + for (const auto& f : fractures) + { + if (f->isEnabled()) hasAnyVisibleFractures = true; + } + } + + if (hasAnyVisibleFractures) + { + RimRegularLegendConfig* stimPlanLegend = fractureColors()->activeLegend(); + if (stimPlanLegend && stimPlanLegend->showLegend()) + { + fractureColors()->updateLegendData(); + + if (fractureColors()->isChecked() && stimPlanLegend->titledOverlayFrame()) + { + m_viewer->addColorLegendToBottomLeftCorner(stimPlanLegend->titledOverlayFrame()); + } + } } }