mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Performance updates (#9082)
* Avoid creation of curve legend widgets during construction of a multi plot * Make sure default z-value is correct to avoid expensive Qwt updates * Avoid duplicate plot updates * Do not create internal Qwt legend by default * RFT import: Avoid expensive method throwing exception if no data is found
This commit is contained in:
@@ -107,12 +107,10 @@ void RiaPlotWindowRedrawScheduler::clearAllScheduledUpdates()
|
||||
void RiaPlotWindowRedrawScheduler::performScheduledUpdatesAndReplots()
|
||||
{
|
||||
std::map<QPointer<RiuMultiPlotBook>, RiaDefines::MultiPlotPageUpdateType> plotBooksToUpdate;
|
||||
std::set<QPointer<RiuPlotWidget>> plotWidgetsToReplot;
|
||||
std::map<QPointer<RiuMultiPlotPage>, RiaDefines::MultiPlotPageUpdateType> pagesToUpdate;
|
||||
|
||||
pagesToUpdate.swap( m_plotPagesToUpdate );
|
||||
plotBooksToUpdate.swap( m_plotBooksToUpdate );
|
||||
plotWidgetsToReplot.swap( m_plotWidgetsToReplot );
|
||||
|
||||
for ( auto& [plotBook, updateType] : plotBooksToUpdate )
|
||||
{
|
||||
@@ -135,6 +133,12 @@ void RiaPlotWindowRedrawScheduler::performScheduledUpdatesAndReplots()
|
||||
page->performUpdate( updateType );
|
||||
}
|
||||
|
||||
// PERFORMANCE NOTE
|
||||
// As the book and page updates can trigger widget updates, make sure to get the list of widgets to replot after
|
||||
// these updates
|
||||
std::set<QPointer<RiuPlotWidget>> plotWidgetsToReplot;
|
||||
plotWidgetsToReplot.swap( m_plotWidgetsToReplot );
|
||||
|
||||
for ( const QPointer<RiuPlotWidget>& plot : plotWidgetsToReplot )
|
||||
{
|
||||
if ( !plot.isNull() )
|
||||
|
||||
Reference in New Issue
Block a user