#4352 Hide Fracture CONDUCTIVTY legend if no visible fractures

This commit is contained in:
Magne Sjaastad 2019-04-24 13:07:54 +02:00
parent efc7cca5c7
commit 521e170178

View File

@ -1199,6 +1199,20 @@ void RimEclipseView::updateLegends()
} }
} }
{
bool hasAnyVisibleFractures = false;
{
std::vector<RimFracture*> fractures;
RiaApplication::instance()->project()->activeOilField()->descendantsIncludingThisOfType(fractures);
for (const auto& f : fractures)
{
if (f->isEnabled()) hasAnyVisibleFractures = true;
}
}
if (hasAnyVisibleFractures)
{
RimRegularLegendConfig* stimPlanLegend = fractureColors()->activeLegend(); RimRegularLegendConfig* stimPlanLegend = fractureColors()->activeLegend();
if (stimPlanLegend && stimPlanLegend->showLegend()) if (stimPlanLegend && stimPlanLegend->showLegend())
{ {
@ -1209,6 +1223,8 @@ void RimEclipseView::updateLegends()
m_viewer->addColorLegendToBottomLeftCorner(stimPlanLegend->titledOverlayFrame()); m_viewer->addColorLegendToBottomLeftCorner(stimPlanLegend->titledOverlayFrame());
} }
} }
}
}
if (m_virtualPerforationResult->showConnectionFactors() && m_virtualPerforationResult->legendConfig()->showLegend()) if (m_virtualPerforationResult->showConnectionFactors() && m_virtualPerforationResult->legendConfig()->showLegend())
{ {