mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#1728 Curves assisiated with closed summary case(s) are deleted
This commit is contained in:
@@ -48,6 +48,8 @@
|
||||
#include "qwt_abstract_legend.h"
|
||||
#include "qwt_legend.h"
|
||||
|
||||
#include "vector"
|
||||
|
||||
|
||||
CAF_PDM_SOURCE_INIT(RimSummaryPlot, "SummaryPlot");
|
||||
|
||||
@@ -759,6 +761,41 @@ void RimSummaryPlot::addCurve(RimSummaryCurve* curve)
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSummaryPlot::removeCurve(RimSummaryCurve* curve)
|
||||
{
|
||||
if (curve)
|
||||
{
|
||||
m_summaryCurves.removeChildObject(curve);
|
||||
delete curve;
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSummaryPlot::removeCurveAssosiatedWithCase(RimSummaryCase* summaryCase)
|
||||
{
|
||||
std::vector<RimSummaryCurve*> summaryCurvesToDelete;
|
||||
|
||||
for (RimSummaryCurve* summaryCurve : m_summaryCurves)
|
||||
{
|
||||
if (!summaryCurve) continue;
|
||||
if (!summaryCurve->summaryCase()) continue;
|
||||
|
||||
if (summaryCurve->summaryCase() == summaryCase)
|
||||
{
|
||||
summaryCurvesToDelete.push_back(summaryCurve);
|
||||
}
|
||||
}
|
||||
for (RimSummaryCurve* summaryCurve : summaryCurvesToDelete)
|
||||
{
|
||||
removeCurve(summaryCurve);
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user