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:
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user