#2838 Ensemble Curve Name : Hide Qwt legend if result legend is used

This commit is contained in:
Magne Sjaastad 2018-05-02 14:59:38 +02:00
parent cfab910272
commit cff95a1880
3 changed files with 23 additions and 2 deletions

View File

@ -594,6 +594,13 @@ void RimPlotCurve::updateLegendEntryVisibilityNoPlotUpdate()
// Hide legend display for curves other than the first
showLegendInQwt = false;
}
else
{
if (ensembleCurveSet->colorMode() == RimEnsembleCurveSet::BY_ENSEMBLE_PARAM)
{
showLegendInQwt = false;
}
}
}
else
{
@ -608,8 +615,7 @@ void RimPlotCurve::updateLegendEntryVisibilityNoPlotUpdate()
showLegendInQwt = false;
}
}
}
m_qwtPlotCurve->setItemAttribute(QwtPlotItem::Legend, showLegendInQwt);
}

View File

@ -328,6 +328,14 @@ RimSummaryCaseCollection* RimEnsembleCurveSet::summaryCaseCollection() const
return m_yValuesSummaryGroup();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimEnsembleCurveSet::ColorMode RimEnsembleCurveSet::colorMode() const
{
return m_colorMode();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@ -642,6 +650,11 @@ void RimEnsembleCurveSet::updateCurveColors()
}
plot->qwtPlot()->replot();
}
if (firstCurve())
{
firstCurve()->updateLegendEntryVisibilityAndPlotLegend();
}
}
//--------------------------------------------------------------------------------------------------

View File

@ -84,6 +84,8 @@ public:
void setSummaryCaseCollection(RimSummaryCaseCollection* sumCaseCollection);
RimSummaryCaseCollection* summaryCaseCollection() const;
ColorMode colorMode() const;
private:
caf::PdmFieldHandle* userDescriptionField() override;
caf::PdmFieldHandle* objectToggleField();