mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#2838 Ensemble Curve Name : Improve logic for display of legend
This commit is contained in:
parent
26975e3ce3
commit
b023bd02a3
@ -19,6 +19,7 @@
|
|||||||
#include "RimPlotCurve.h"
|
#include "RimPlotCurve.h"
|
||||||
|
|
||||||
#include "RimEnsembleCurveSet.h"
|
#include "RimEnsembleCurveSet.h"
|
||||||
|
#include "RimEnsembleCurveSetCollection.h"
|
||||||
#include "RimSummaryCurve.h"
|
#include "RimSummaryCurve.h"
|
||||||
#include "RimSummaryCurveCollection.h"
|
#include "RimSummaryCurveCollection.h"
|
||||||
#include "RimSummaryCurveFilter.h"
|
#include "RimSummaryCurveFilter.h"
|
||||||
@ -583,14 +584,6 @@ void RimPlotCurve::updateLegendEntryVisibilityNoPlotUpdate()
|
|||||||
{
|
{
|
||||||
bool showLegendInQwt = m_showLegend();
|
bool showLegendInQwt = m_showLegend();
|
||||||
|
|
||||||
RimSummaryPlot* summaryPlot = nullptr;
|
|
||||||
this->firstAncestorOrThisOfType(summaryPlot);
|
|
||||||
if (summaryPlot && summaryPlot->curveCount() == 1)
|
|
||||||
{
|
|
||||||
// Disable display of legend if the summary plot has only one single curve
|
|
||||||
showLegendInQwt = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
RimEnsembleCurveSet* ensembleCurveSet = nullptr;
|
RimEnsembleCurveSet* ensembleCurveSet = nullptr;
|
||||||
this->firstAncestorOrThisOfType(ensembleCurveSet);
|
this->firstAncestorOrThisOfType(ensembleCurveSet);
|
||||||
if (ensembleCurveSet)
|
if (ensembleCurveSet)
|
||||||
@ -602,6 +595,21 @@ void RimPlotCurve::updateLegendEntryVisibilityNoPlotUpdate()
|
|||||||
showLegendInQwt = false;
|
showLegendInQwt = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
RimSummaryPlot* summaryPlot = nullptr;
|
||||||
|
this->firstAncestorOrThisOfType(summaryPlot);
|
||||||
|
|
||||||
|
if (summaryPlot)
|
||||||
|
{
|
||||||
|
if (summaryPlot->ensembleCurveSets()->visibleCurveSets().empty() && summaryPlot->curveCount() == 1)
|
||||||
|
{
|
||||||
|
// Disable display of legend if the summary plot has only one single curve
|
||||||
|
showLegendInQwt = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
m_qwtPlotCurve->setItemAttribute(QwtPlotItem::Legend, showLegendInQwt);
|
m_qwtPlotCurve->setItemAttribute(QwtPlotItem::Legend, showLegendInQwt);
|
||||||
}
|
}
|
||||||
|
@ -212,6 +212,8 @@ std::vector<RimEnsembleCurveSet*> RimEnsembleCurveSetCollection::visibleCurveSet
|
|||||||
{
|
{
|
||||||
std::vector<RimEnsembleCurveSet*> visible;
|
std::vector<RimEnsembleCurveSet*> visible;
|
||||||
|
|
||||||
|
if (m_showCurves())
|
||||||
|
{
|
||||||
for (auto c : m_curveSets)
|
for (auto c : m_curveSets)
|
||||||
{
|
{
|
||||||
if (c->isCurvesVisible())
|
if (c->isCurvesVisible())
|
||||||
@ -219,6 +221,7 @@ std::vector<RimEnsembleCurveSet*> RimEnsembleCurveSetCollection::visibleCurveSet
|
|||||||
visible.push_back(c);
|
visible.push_back(c);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return visible;
|
return visible;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user