mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#3318 Plot editor performance. Do not call update method for every toggle change
This commit is contained in:
parent
a56a93cb30
commit
7d2889c66b
@ -231,6 +231,9 @@ RiuSummaryCurveDefSelection::RiuSummaryCurveDefSelection() : m_identifierFieldsM
|
|||||||
m_multiSelectionMode = false;
|
m_multiSelectionMode = false;
|
||||||
m_hideEnsembles = false;
|
m_hideEnsembles = false;
|
||||||
m_hideSummaryCases = false;
|
m_hideSummaryCases = false;
|
||||||
|
|
||||||
|
m_prevCurveCount = 0;
|
||||||
|
m_prevCurveSetCount = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@ -553,9 +556,15 @@ void RiuSummaryCurveDefSelection::fieldChangedByUi(const caf::PdmFieldHandle* ch
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_toggleChangedHandler != nullptr)
|
size_t curveCount = allCurveDefinitionsFromSelection().size();
|
||||||
|
size_t curveSetCount = allCurveSetDefinitionsFromSelections().size();
|
||||||
|
|
||||||
|
if (m_toggleChangedHandler != nullptr && (curveCount != m_prevCurveCount || curveSetCount != m_prevCurveSetCount))
|
||||||
{
|
{
|
||||||
m_toggleChangedHandler();
|
m_toggleChangedHandler();
|
||||||
|
|
||||||
|
m_prevCurveCount = curveCount;
|
||||||
|
m_prevCurveSetCount = curveSetCount;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -116,4 +116,7 @@ private:
|
|||||||
bool m_hideSummaryCases;
|
bool m_hideSummaryCases;
|
||||||
|
|
||||||
std::function<void()> m_toggleChangedHandler;
|
std::function<void()> m_toggleChangedHandler;
|
||||||
|
|
||||||
|
size_t m_prevCurveCount;
|
||||||
|
size_t m_prevCurveSetCount;
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user