#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,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<RimFracture*> 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());
}
}
}
}