mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#3318 Plot editor performance. Several performance fixes
This commit is contained in:
@@ -304,6 +304,7 @@ void RimEnsembleCurveSet::deleteCurve(RimSummaryCurve* curve)
|
||||
if (curve)
|
||||
{
|
||||
m_curves.removeChildObject(curve);
|
||||
curve->markCachedDataForPurge();
|
||||
delete curve;
|
||||
}
|
||||
}
|
||||
@@ -1097,6 +1098,17 @@ void RimEnsembleCurveSet::showCurves(bool show)
|
||||
m_showCurves = show;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimEnsembleCurveSet::markCachedDataForPurge()
|
||||
{
|
||||
for (const auto curve : m_curves)
|
||||
{
|
||||
curve->markCachedDataForPurge();
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -104,6 +104,8 @@ public:
|
||||
RimEnsembleCurveSet* clone() const;
|
||||
void showCurves(bool show);
|
||||
|
||||
void markCachedDataForPurge();
|
||||
|
||||
void updateAllTextInPlot();
|
||||
std::vector<QString> ensembleParameterNames() const;
|
||||
|
||||
|
||||
@@ -160,11 +160,21 @@ void RimEnsembleCurveSetCollection::addCurveSet(RimEnsembleCurveSet* curveSet)
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimEnsembleCurveSetCollection::deleteCurveSet(RimEnsembleCurveSet* curveSet)
|
||||
{
|
||||
if (curveSet)
|
||||
deleteCurveSets({ curveSet });
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimEnsembleCurveSetCollection::deleteCurveSets(const std::vector<RimEnsembleCurveSet*> curveSets)
|
||||
{
|
||||
for(const auto curveSet : curveSets)
|
||||
{
|
||||
m_curveSets.removeChildObject(curveSet);
|
||||
curveSet->markCachedDataForPurge();
|
||||
delete curveSet;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -50,6 +50,7 @@ public:
|
||||
|
||||
void addCurveSet(RimEnsembleCurveSet* curveSet);
|
||||
void deleteCurveSet(RimEnsembleCurveSet* curveSet);
|
||||
void deleteCurveSets(const std::vector<RimEnsembleCurveSet*> curveSets);
|
||||
|
||||
std::vector<RimEnsembleCurveSet*> curveSets() const;
|
||||
size_t curveSetCount() const;
|
||||
|
||||
@@ -53,6 +53,8 @@ RimSummaryCaseCollection::RimSummaryCaseCollection()
|
||||
|
||||
CAF_PDM_InitField(&m_isEnsemble, "IsEnsemble", false, "Is Ensemble", "", "", "");
|
||||
m_isEnsemble.uiCapability()->setUiHidden(true);
|
||||
|
||||
m_commonAddressCount = 0;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -182,6 +184,10 @@ std::set<RifEclipseSummaryAddress> RimSummaryCaseCollection::calculateUnionOfSum
|
||||
|
||||
const std::set<RifEclipseSummaryAddress>& readerAddresses = reader->allResultAddresses();
|
||||
addressUnion.insert(readerAddresses.begin(), readerAddresses.end());
|
||||
|
||||
// We assume that all cases have the same addresses when they have equal number of addresses.
|
||||
// In that case there is no need to calculate the union, we only use the addresses from the first case
|
||||
if (m_commonAddressCount > 0) break;
|
||||
}
|
||||
return addressUnion;
|
||||
}
|
||||
@@ -314,6 +320,27 @@ void RimSummaryCaseCollection::calculateEnsembleParametersIntersectionHash()
|
||||
auto crp = sumCase->caseRealizationParameters();
|
||||
if(crp) crp->calculateParametersHash(paramNames);
|
||||
}
|
||||
|
||||
// Find common addess count
|
||||
for (const auto sumCase : sumCases)
|
||||
{
|
||||
const auto reader = sumCase->summaryReader();
|
||||
if(!reader) continue;
|
||||
auto currAddrCount = reader->allResultAddresses().size();
|
||||
|
||||
if (m_commonAddressCount == 0)
|
||||
{
|
||||
m_commonAddressCount = currAddrCount;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (currAddrCount != m_commonAddressCount)
|
||||
{
|
||||
m_commonAddressCount = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -100,5 +100,7 @@ protected:
|
||||
private:
|
||||
caf::PdmField<QString> m_name;
|
||||
caf::PdmProxyValueField<QString> m_nameAndItemCount;
|
||||
caf::PdmField<bool> m_isEnsemble;
|
||||
caf::PdmField<bool> m_isEnsemble;
|
||||
|
||||
size_t m_commonAddressCount; // if different address count among cases, set to 0
|
||||
};
|
||||
|
||||
@@ -738,6 +738,14 @@ void RimSummaryCurve::forceUpdateCurveAppearanceFromCaseType()
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSummaryCurve::markCachedDataForPurge()
|
||||
{
|
||||
valuesSummaryReaderY()->markForCachePurge(m_yValuesCurveVariable->address());
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -79,6 +79,8 @@ public:
|
||||
virtual QString curveExportDescription(const RifEclipseSummaryAddress& address = RifEclipseSummaryAddress()) const override;
|
||||
void forceUpdateCurveAppearanceFromCaseType();
|
||||
|
||||
void markCachedDataForPurge();
|
||||
|
||||
protected:
|
||||
// RimPlotCurve overrides
|
||||
virtual QString createCurveAutoName() override;
|
||||
|
||||
@@ -179,8 +179,8 @@ void RimSummaryCurveCollection::deleteCurve(RimSummaryCurve* curve)
|
||||
if (curve)
|
||||
{
|
||||
m_curves.removeChildObject(curve);
|
||||
curve->markCachedDataForPurge();
|
||||
delete curve;
|
||||
updateCaseNameHasChanged();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -60,7 +60,7 @@
|
||||
|
||||
#include <set>
|
||||
#include <limits>
|
||||
|
||||
#include <QDebug>
|
||||
|
||||
CAF_PDM_SOURCE_INIT(RimSummaryPlot, "SummaryPlot");
|
||||
|
||||
@@ -953,7 +953,15 @@ void RimSummaryPlot::addCurveNoUpdate(RimSummaryCurve* curve)
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSummaryPlot::deleteCurve(RimSummaryCurve* curve)
|
||||
{
|
||||
if (curve)
|
||||
deleteCurves({ curve });
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSummaryPlot::deleteCurves(const std::vector<RimSummaryCurve*>& curves)
|
||||
{
|
||||
for(const auto curve : curves)
|
||||
{
|
||||
if (m_summaryCurveCollection)
|
||||
{
|
||||
@@ -962,7 +970,7 @@ void RimSummaryPlot::deleteCurve(RimSummaryCurve* curve)
|
||||
if (c == curve)
|
||||
{
|
||||
m_summaryCurveCollection->deleteCurve(curve);
|
||||
return;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -983,12 +991,13 @@ void RimSummaryPlot::deleteCurve(RimSummaryCurve* curve)
|
||||
}
|
||||
m_ensembleCurveSetCollection->deleteCurveSet(curveSet);
|
||||
}
|
||||
return;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
updateCaseNameHasChanged();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -74,6 +74,8 @@ public:
|
||||
void addCurveNoUpdate(RimSummaryCurve* curve);
|
||||
|
||||
void deleteCurve(RimSummaryCurve* curve);
|
||||
void deleteCurves(const std::vector<RimSummaryCurve*>& curves);
|
||||
|
||||
void setCurveCollection(RimSummaryCurveCollection* curveCollection);
|
||||
void deleteCurvesAssosiatedWithCase(RimSummaryCase* summaryCase);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user