mirror of
https://github.com/OPM/ResInsight.git
synced 2026-09-03 20:53:13 -05:00
#3339 Make order of summary curves in plot predictable.
* The issue is sorting on pointer address for ensembles and summary cases. Instead sort by name. * The crucial changes are in RiaSummaryCurveDefinition.cpp, RimSummaryCase and RimSummaryCaseCollection. * The rest of the changes are just fallout from changing the pure virtual method RimSummaryCase::caseName to be const. The rest just follows. * RimGridSummaryCase::caseName does alter something, but this variable was already declared mutable.
This commit is contained in:
@@ -144,11 +144,23 @@ bool RiaSummaryCurveDefinition::operator<(const RiaSummaryCurveDefinition& other
|
||||
{
|
||||
if (m_summaryCase != other.summaryCase())
|
||||
{
|
||||
// Try comparing the dereferenced objects first. They have a predictable sorting operator.
|
||||
if (m_summaryCase && other.summaryCase())
|
||||
{
|
||||
return *m_summaryCase < *other.summaryCase();
|
||||
}
|
||||
// Sorting by pointer address, which may appear random to the user.
|
||||
return m_summaryCase < other.summaryCase();
|
||||
}
|
||||
|
||||
if (m_ensemble != other.ensemble())
|
||||
{
|
||||
// Try comparing the dereferenced objects first. They have a predictable sorting operator.
|
||||
if (m_ensemble && other.ensemble())
|
||||
{
|
||||
return *m_ensemble < *other.ensemble();
|
||||
}
|
||||
// Sorting by pointer address, which may appear random to the user.
|
||||
return (m_ensemble < other.ensemble());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user