#2690 Update all summary curves, not just visible when changing the vector for the whole collection

* Also make sure the curve names take into account all curves in the project tree and in the legend text.
* Make sure plot name is updated when a curve is deleted.
This commit is contained in:
Gaute Lindkvist
2018-05-15 08:43:50 +02:00
parent e2dc1486e7
commit 77dd3cbc43
12 changed files with 57 additions and 112 deletions
@@ -175,6 +175,7 @@ void RimSummaryCurveCollection::deleteCurve(RimSummaryCurve* curve)
{
m_curves.removeChildObject(curve);
delete curve;
updateCaseNameHasChanged();
}
}
@@ -186,24 +187,6 @@ std::vector<RimSummaryCurve*> RimSummaryCurveCollection::curves() const
return m_curves.childObjects();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::vector<RimSummaryCurve*> RimSummaryCurveCollection::visibleCurves() const
{
std::vector<RimSummaryCurve*> visible;
for (auto c : m_curves)
{
if (c->isCurveVisible())
{
visible.push_back(c);
}
}
return visible;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@@ -250,6 +233,8 @@ void RimSummaryCurveCollection::updateCaseNameHasChanged()
RimSummaryPlot* parentPlot;
firstAncestorOrThisOfTypeAsserted(parentPlot);
parentPlot->updatePlotTitle();
if (parentPlot->qwtPlot()) parentPlot->qwtPlot()->updateLegend();
}