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

View File

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

View File

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