mirror of
https://github.com/OPM/ResInsight.git
synced 2026-10-26 23:20:29 -05:00
#14493 Delete curves for all cases in one pass when deleting a summary ensemble
deleteSummaryCaseCollection() looped over every case in the ensemble, and for each case scanned every summary plot and called updateConnectedEditors() on every multi plot. For an ensemble with many realizations this scanned each plot once per realization, and updated the connected editors once per realization and multi plot. This showed up as a hot spot in the profiler. Replace deleteCurvesAssosiatedWithCase() with deleteCurvesAssosiatedWithCases(), which takes a set of cases and returns whether anything was deleted. Each plot is now scanned once, and the connected editors of a multi plot are updated only when that multi plot actually lost a curve. RicCloseSummaryCaseFeature and RicCloseObservedDataFeature are updated to the new signature. RicCloseSummaryCaseFeature also scans each plot once instead of once per case.
This commit is contained in:
1 parent
1d4a15fd89
commit
1660e333ff
7 files changed
+39
-21
No files matched your search
@@ -229,7 +229,7 @@ std::vector<RimSummaryCurve*> RimSummaryCurveCollection::curves() const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSummaryCurveCollection::deleteCurvesAssosiatedWithCase( RimSummaryCase* summaryCase )
|
||||
bool RimSummaryCurveCollection::deleteCurvesAssosiatedWithCases( const std::set<RimSummaryCase*>& summaryCases )
|
||||
{
|
||||
std::vector<RimSummaryCurve*> summaryCurvesToDelete;
|
||||
|
||||
@@ -238,7 +238,7 @@ void RimSummaryCurveCollection::deleteCurvesAssosiatedWithCase( RimSummaryCase*
|
||||
if ( !summaryCurve ) continue;
|
||||
if ( !summaryCurve->summaryCaseY() ) continue;
|
||||
|
||||
if ( summaryCurve->summaryCaseY() == summaryCase )
|
||||
if ( summaryCases.contains( summaryCurve->summaryCaseY() ) )
|
||||
{
|
||||
summaryCurvesToDelete.push_back( summaryCurve );
|
||||
}
|
||||
@@ -248,6 +248,8 @@ void RimSummaryCurveCollection::deleteCurvesAssosiatedWithCase( RimSummaryCase*
|
||||
m_curves.removeChild( summaryCurve );
|
||||
delete summaryCurve;
|
||||
}
|
||||
|
||||
return !summaryCurvesToDelete.empty();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -26,6 +26,8 @@
|
||||
#include "cafPdmField.h"
|
||||
#include "cafPdmObject.h"
|
||||
|
||||
#include <set>
|
||||
|
||||
class RimSummaryCase;
|
||||
class RimSummaryCurve;
|
||||
class RimSummaryPlot;
|
||||
@@ -75,7 +77,8 @@ private:
|
||||
void deleteCurve( RimSummaryCurve* curve );
|
||||
void removeCurve( RimSummaryCurve* curve );
|
||||
|
||||
void deleteCurvesAssosiatedWithCase( RimSummaryCase* summaryCase );
|
||||
/// Delete the curves associated with any of the given cases. Returns true if any curve was deleted.
|
||||
bool deleteCurvesAssosiatedWithCases( const std::set<RimSummaryCase*>& summaryCases );
|
||||
void deleteAllCurves();
|
||||
void updateCaseNameHasChanged();
|
||||
|
||||
|
||||
@@ -1497,12 +1497,14 @@ void RimSummaryPlot::deleteCurves( const std::vector<RimSummaryCurve*>& curves )
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSummaryPlot::deleteCurvesAssosiatedWithCase( RimSummaryCase* summaryCase )
|
||||
bool RimSummaryPlot::deleteCurvesAssosiatedWithCases( const std::set<RimSummaryCase*>& summaryCases )
|
||||
{
|
||||
if ( m_summaryCurveCollection )
|
||||
{
|
||||
m_summaryCurveCollection->deleteCurvesAssosiatedWithCase( summaryCase );
|
||||
return m_summaryCurveCollection->deleteCurvesAssosiatedWithCases( summaryCases );
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -107,7 +107,8 @@ public:
|
||||
|
||||
void deleteCurves( const std::vector<RimSummaryCurve*>& curves );
|
||||
|
||||
void deleteCurvesAssosiatedWithCase( RimSummaryCase* summaryCase );
|
||||
/// Delete the curves associated with any of the given cases. Returns true if any curve was deleted.
|
||||
bool deleteCurvesAssosiatedWithCases( const std::set<RimSummaryCase*>& summaryCases );
|
||||
|
||||
RimEnsembleCurveSetCollection* ensembleCurveSetCollection() const;
|
||||
|
||||
|
||||
Reference in new issue
Block a user