mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Performance: Use curve with most addresses to define source stepping addresses
If we have many single curves in one plot, using addresses for all curves destroys performance. Make sure we only use addresses for the curve with most available addresses.
This commit is contained in:
@@ -636,21 +636,53 @@ std::set<RifEclipseSummaryAddress> RimSummaryPlotSourceStepping::adressesForSour
|
||||
std::vector<RimSummaryCurve*> curves;
|
||||
if ( dataSourceSteppingObject() ) curves = dataSourceSteppingObject()->curvesForStepping( m_sourceSteppingType );
|
||||
|
||||
for ( auto curve : curves )
|
||||
size_t maxAddrCount = 0;
|
||||
int maxAddrIndex = -1;
|
||||
|
||||
for ( size_t i = 0; i < curves.size(); i++ )
|
||||
{
|
||||
auto curve = curves[i];
|
||||
if ( !curve ) continue;
|
||||
|
||||
if ( isYAxisStepping() && curve->summaryCaseY() && curve->summaryCaseY()->summaryReader() )
|
||||
{
|
||||
auto addresses = curve->summaryCaseY()->summaryReader()->allResultAddresses();
|
||||
addressSet.insert( addresses.begin(), addresses.end() );
|
||||
|
||||
size_t addrCount = addresses.size();
|
||||
if ( addrCount > maxAddrCount )
|
||||
{
|
||||
maxAddrCount = addrCount;
|
||||
maxAddrIndex = (int)i;
|
||||
}
|
||||
}
|
||||
|
||||
if ( isXAxisStepping() && curve->summaryCaseX() && curve->summaryCaseX()->summaryReader() )
|
||||
{
|
||||
auto addresses = curve->summaryCaseX()->summaryReader()->allResultAddresses();
|
||||
size_t addrCount = addresses.size();
|
||||
if ( addrCount > maxAddrCount )
|
||||
{
|
||||
maxAddrCount = addrCount;
|
||||
maxAddrIndex = (int)i;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ( maxAddrIndex >= 0 )
|
||||
{
|
||||
auto curve = curves[maxAddrIndex];
|
||||
|
||||
if ( isXAxisStepping() && curve->summaryCaseX() && curve->summaryCaseX()->summaryReader() )
|
||||
{
|
||||
auto addresses = curve->summaryCaseX()->summaryReader()->allResultAddresses();
|
||||
addressSet.insert( addresses.begin(), addresses.end() );
|
||||
}
|
||||
|
||||
if ( isYAxisStepping() && curve->summaryCaseY() && curve->summaryCaseY()->summaryReader() )
|
||||
{
|
||||
auto addresses = curve->summaryCaseY()->summaryReader()->allResultAddresses();
|
||||
addressSet.insert( addresses.begin(), addresses.end() );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user