From b706192ea39dce8e36a1384fec1b4fa062259add Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Fri, 24 Jun 2022 16:16:46 +0200 Subject: [PATCH] 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 --- .../RiaPlotWindowRedrawScheduler.cpp | 8 ++- ...RicAppendSummaryPlotsForObjectsFeature.cpp | 3 +- .../FileInterface/RifReaderOpmRft.cpp | 7 +- .../ProjectDataModel/RimMultiPlot.cpp | 9 +++ .../ProjectDataModel/RimPlot.cpp | 2 +- .../ProjectDataModel/RimPlotCurve.cpp | 19 ++++- .../ProjectDataModel/RimPlotCurve.h | 2 + .../Summary/RimEnsembleCurveSet.cpp | 16 ++--- .../Summary/RimEnsembleCurveSet.h | 2 +- .../Summary/RimEnsembleCurveSetCollection.cpp | 2 +- .../Summary/RimSummaryCurve.cpp | 70 +++++++++++-------- .../Summary/RimSummaryCurve.h | 5 +- .../Summary/RimSummaryPlot.cpp | 50 ++++++++----- .../ProjectDataModel/Summary/RimSummaryPlot.h | 1 + .../UserInterface/RiuMultiPlotBook.cpp | 2 +- .../UserInterface/RiuSummaryQwtPlot.cpp | 4 +- 16 files changed, 133 insertions(+), 69 deletions(-) diff --git a/ApplicationLibCode/Application/RiaPlotWindowRedrawScheduler.cpp b/ApplicationLibCode/Application/RiaPlotWindowRedrawScheduler.cpp index a26d6080cc..f0d1f65c2f 100644 --- a/ApplicationLibCode/Application/RiaPlotWindowRedrawScheduler.cpp +++ b/ApplicationLibCode/Application/RiaPlotWindowRedrawScheduler.cpp @@ -107,12 +107,10 @@ void RiaPlotWindowRedrawScheduler::clearAllScheduledUpdates() void RiaPlotWindowRedrawScheduler::performScheduledUpdatesAndReplots() { std::map, RiaDefines::MultiPlotPageUpdateType> plotBooksToUpdate; - std::set> plotWidgetsToReplot; std::map, 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> plotWidgetsToReplot; + plotWidgetsToReplot.swap( m_plotWidgetsToReplot ); + for ( const QPointer& plot : plotWidgetsToReplot ) { if ( !plot.isNull() ) diff --git a/ApplicationLibCode/Commands/PlotBuilderCommands/RicAppendSummaryPlotsForObjectsFeature.cpp b/ApplicationLibCode/Commands/PlotBuilderCommands/RicAppendSummaryPlotsForObjectsFeature.cpp index ff458695d7..f918369bf8 100644 --- a/ApplicationLibCode/Commands/PlotBuilderCommands/RicAppendSummaryPlotsForObjectsFeature.cpp +++ b/ApplicationLibCode/Commands/PlotBuilderCommands/RicAppendSummaryPlotsForObjectsFeature.cpp @@ -95,12 +95,11 @@ void RicAppendSummaryPlotsForObjectsFeature::appendPlots( RimSummaryMultiPlot* s summaryMultiPlot->addPlot( duplicatedPlot ); duplicatedPlot->resolveReferencesRecursively(); + duplicatedPlot->loadDataAndUpdate(); } } info.incrementProgress(); } - - summaryMultiPlot->loadDataAndUpdate(); } //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationLibCode/FileInterface/RifReaderOpmRft.cpp b/ApplicationLibCode/FileInterface/RifReaderOpmRft.cpp index a8fae6a2f1..ad1dabf252 100644 --- a/ApplicationLibCode/FileInterface/RifReaderOpmRft.cpp +++ b/ApplicationLibCode/FileInterface/RifReaderOpmRft.cpp @@ -520,9 +520,14 @@ void RifReaderOpmRft::buildSegmentBranchTypes( const RftSegmentKey& segmentKey ) std::vector RifReaderOpmRft::importWellData( const std::string& wellName, const std::string& propertyName, const RftDate& date ) const { + // PERFORMANCE NOTE + // Use method hasRft() that do not throw exception if RFT data is not available. Using this method and avoid + // try/catch and exceptions is way faster. + if ( !m_opm_rft->hasRft( wellName, date ) ) return {}; + try { - // THe hasArray method can throw, so we must use a try/catch block here + // The hasArray method can throw, so we must use a try/catch block here if ( m_opm_rft->hasArray( propertyName, wellName, date ) ) { return m_opm_rft->getRft( propertyName, wellName, date ); diff --git a/ApplicationLibCode/ProjectDataModel/RimMultiPlot.cpp b/ApplicationLibCode/ProjectDataModel/RimMultiPlot.cpp index da433e2739..aac63f88a2 100644 --- a/ApplicationLibCode/ProjectDataModel/RimMultiPlot.cpp +++ b/ApplicationLibCode/ProjectDataModel/RimMultiPlot.cpp @@ -797,12 +797,21 @@ QList RimMultiPlot::calculateValueOptions( const caf::Pd //-------------------------------------------------------------------------------------------------- void RimMultiPlot::onLoadDataAndUpdate() { + // PERFORMANCE NOTE + // Creation and update of the legend widgets is expensive. Disable display of legends during construction of the + // multi plot and creation of widgets. The legends will be made visible due to redraw operations always scheduled + // after this method. + bool originalShowState = m_showPlotLegends(); + m_showPlotLegends = false; + updateMdiWindowVisibility(); updatePlotWindowTitle(); applyPlotWindowTitleToWidgets(); updatePlots(); updateLayout(); RiuPlotMainWindowTools::refreshToolbars(); + + m_showPlotLegends = originalShowState; } //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationLibCode/ProjectDataModel/RimPlot.cpp b/ApplicationLibCode/ProjectDataModel/RimPlot.cpp index 8960498f63..02d557d66c 100644 --- a/ApplicationLibCode/ProjectDataModel/RimPlot.cpp +++ b/ApplicationLibCode/ProjectDataModel/RimPlot.cpp @@ -76,7 +76,7 @@ QWidget* RimPlot::createViewWidget( QWidget* parent /*= nullptr */ ) RiuPlotWidget* plotWidget = doCreatePlotViewWidget( parent ); updateWindowVisibility(); - plotWidget->scheduleReplot(); + if ( showWindow() ) plotWidget->scheduleReplot(); return plotWidget; } diff --git a/ApplicationLibCode/ProjectDataModel/RimPlotCurve.cpp b/ApplicationLibCode/ProjectDataModel/RimPlotCurve.cpp index f5108e91c3..c3ac4a6de9 100644 --- a/ApplicationLibCode/ProjectDataModel/RimPlotCurve.cpp +++ b/ApplicationLibCode/ProjectDataModel/RimPlotCurve.cpp @@ -718,6 +718,14 @@ void RimPlotCurve::setSamplesFromTimeTAndYValues( const std::vector& dat } } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +double RimPlotCurve::computeCurveZValue() +{ + return 1.0; +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- @@ -996,6 +1004,12 @@ void RimPlotCurve::setParentPlotNoReplot( RiuPlotWidget* plotWidget ) } m_plotCurve = m_parentPlot->createPlotCurve( this, "", RiaColorTools::toQColor( m_curveAppearance->color() ) ); + + // PERFORMANCE NOTE + // When the z-value of a curve is changed, several update calls are made to the plot. Make sure that the default + // z-value is correct to avoid these calls. + m_plotCurve->setZ( computeCurveZValue() ); + m_plotCurve->attachToPlot( plotWidget ); } @@ -1005,6 +1019,9 @@ void RimPlotCurve::setParentPlotNoReplot( RiuPlotWidget* plotWidget ) void RimPlotCurve::setParentPlotAndReplot( RiuPlotWidget* plotWidget ) { CAF_ASSERT( plotWidget ); + + if ( m_parentPlot == plotWidget ) return; + setParentPlotNoReplot( plotWidget ); plotWidget->replot(); } @@ -1035,7 +1052,7 @@ void RimPlotCurve::detach( bool deletePlotCurve ) } } - replotParentPlot(); + m_parentPlot->scheduleReplot(); } //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationLibCode/ProjectDataModel/RimPlotCurve.h b/ApplicationLibCode/ProjectDataModel/RimPlotCurve.h index 1cb8713bd0..c8a98d55cb 100644 --- a/ApplicationLibCode/ProjectDataModel/RimPlotCurve.h +++ b/ApplicationLibCode/ProjectDataModel/RimPlotCurve.h @@ -157,6 +157,8 @@ protected: const std::vector& yValues, bool useLogarithmicScale ); + virtual double computeCurveZValue(); + protected: // Overridden PDM methods void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) override; diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimEnsembleCurveSet.cpp b/ApplicationLibCode/ProjectDataModel/Summary/RimEnsembleCurveSet.cpp index 5747c996c0..fa6f2fe872 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimEnsembleCurveSet.cpp +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimEnsembleCurveSet.cpp @@ -302,8 +302,7 @@ void RimEnsembleCurveSet::setParentPlotNoReplot( RiuPlotWidget* plot ) { for ( RimSummaryCurve* curve : m_curves ) { - // TODO: attach without replotting - curve->attach( plot ); + curve->setParentPlotNoReplot( plot ); } if ( !m_plotCurveForLegendText ) @@ -315,11 +314,11 @@ void RimEnsembleCurveSet::setParentPlotNoReplot( RiuPlotWidget* plot ) //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -void RimEnsembleCurveSet::detachPlotCurves( bool deletePlotCurve ) +void RimEnsembleCurveSet::deletePlotCurves() { for ( RimSummaryCurve* curve : m_curves ) { - curve->detach( deletePlotCurve ); + curve->deletePlotCurve(); } if ( m_plotCurveForLegendText ) @@ -1361,7 +1360,7 @@ void RimEnsembleCurveSet::updateFilterLegend() plot->plotWidget()->removeOverlayFrame( m_filterOverlayFrame ); } } - plot->plotWidget()->scheduleReplot(); + plot->scheduleReplotIfVisible(); } } @@ -1423,7 +1422,7 @@ void RimEnsembleCurveSet::updateObjectiveFunctionLegend() } } } - plot->plotWidget()->scheduleReplot(); + plot->scheduleReplotIfVisible(); } //-------------------------------------------------------------------------------------------------- @@ -1612,7 +1611,7 @@ void RimEnsembleCurveSet::updateCurveColors() plot->plotWidget()->removeOverlayFrame( m_legendOverlayFrame ); } } - plot->plotWidget()->scheduleReplot(); + plot->scheduleReplotIfVisible(); } } @@ -1708,7 +1707,6 @@ void RimEnsembleCurveSet::updateEnsembleCurves( const std::vectorsetLeftOrRightAxisY( axisY() ); - curve->updateCurveVisibility(); newSummaryCurves.push_back( curve ); } @@ -1733,7 +1731,7 @@ void RimEnsembleCurveSet::updateEnsembleCurves( const std::vectorplotWidget() ) { if ( plot->legendsVisible() ) plot->plotWidget()->updateLegend(); - plot->plotWidget()->scheduleReplot(); + plot->scheduleReplotIfVisible(); plot->updateAxes(); plot->updatePlotInfoLabel(); } diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimEnsembleCurveSet.h b/ApplicationLibCode/ProjectDataModel/Summary/RimEnsembleCurveSet.h index 2aa535d10f..27056ab436 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimEnsembleCurveSet.h +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimEnsembleCurveSet.h @@ -98,7 +98,7 @@ public: void loadDataAndUpdate( bool updateParentPlot ); void setParentPlotNoReplot( RiuPlotWidget* plot ); - void detachPlotCurves( bool deletePlotCurve = false ); + void deletePlotCurves(); void reattachPlotCurves(); void addCurve( RimSummaryCurve* curve ); diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimEnsembleCurveSetCollection.cpp b/ApplicationLibCode/ProjectDataModel/Summary/RimEnsembleCurveSetCollection.cpp index 065f6ae460..ad5ac9c921 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimEnsembleCurveSetCollection.cpp +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimEnsembleCurveSetCollection.cpp @@ -117,7 +117,7 @@ void RimEnsembleCurveSetCollection::detachPlotCurves() { for ( const auto& curveSet : m_curveSets ) { - curveSet->detachPlotCurves(); + curveSet->deletePlotCurves(); } } diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCurve.cpp b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCurve.cpp index c90437f5b7..d151c45714 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCurve.cpp +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCurve.cpp @@ -786,6 +786,44 @@ void RimSummaryCurve::initAfterRead() } } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +double RimSummaryCurve::computeCurveZValue() +{ + auto sumAddr = summaryAddressY(); + auto sumCase = summaryCaseY(); + + double zOrder = 0.0; + + if ( sumCase && sumAddr.isValid() ) + { + if ( sumCase->isObservedData() ) + { + zOrder = RiuQwtPlotCurveDefines::zDepthForIndex( RiuQwtPlotCurveDefines::ZIndex::Z_SINGLE_CURVE_OBSERVED ); + } + else if ( sumAddr.category() == RifEclipseSummaryAddress::SUMMARY_ENSEMBLE_STATISTICS ) + { + zOrder = RiuQwtPlotCurveDefines::zDepthForIndex( RiuQwtPlotCurveDefines::ZIndex::Z_ENSEMBLE_STAT_CURVE ); + } + else if ( sumCase->ensemble() ) + { + zOrder = RiuQwtPlotCurveDefines::zDepthForIndex( RiuQwtPlotCurveDefines::ZIndex::Z_ENSEMBLE_CURVE ); + } + else + { + zOrder = RiuQwtPlotCurveDefines::zDepthForIndex( RiuQwtPlotCurveDefines::ZIndex::Z_SINGLE_CURVE_NON_OBSERVED ); + } + } + + if ( m_isTopZWithinCategory ) + { + zOrder += 1.0; + } + + return zOrder; +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- @@ -894,37 +932,9 @@ void RimSummaryCurve::setResampling( RiaDefines::DateTimePeriodEnum resampling ) //-------------------------------------------------------------------------------------------------- void RimSummaryCurve::setZIndexFromCurveInfo() { - auto sumAddr = summaryAddressY(); - auto sumCase = summaryCaseY(); + auto zValue = computeCurveZValue(); - double zOrder = 0.0; - - if ( sumCase && sumAddr.isValid() ) - { - if ( sumCase->isObservedData() ) - { - zOrder = RiuQwtPlotCurveDefines::zDepthForIndex( RiuQwtPlotCurveDefines::ZIndex::Z_SINGLE_CURVE_OBSERVED ); - } - else if ( sumAddr.category() == RifEclipseSummaryAddress::SUMMARY_ENSEMBLE_STATISTICS ) - { - zOrder = RiuQwtPlotCurveDefines::zDepthForIndex( RiuQwtPlotCurveDefines::ZIndex::Z_ENSEMBLE_STAT_CURVE ); - } - else if ( sumCase->ensemble() ) - { - zOrder = RiuQwtPlotCurveDefines::zDepthForIndex( RiuQwtPlotCurveDefines::ZIndex::Z_ENSEMBLE_CURVE ); - } - else - { - zOrder = RiuQwtPlotCurveDefines::zDepthForIndex( RiuQwtPlotCurveDefines::ZIndex::Z_SINGLE_CURVE_NON_OBSERVED ); - } - } - - if ( m_isTopZWithinCategory ) - { - zOrder += 1.0; - } - - setZOrder( zOrder ); + setZOrder( zValue ); } //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCurve.h b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCurve.h index d32b975176..27e403ae77 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCurve.h +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCurve.h @@ -107,8 +107,9 @@ protected: void updateLegendsInPlot() override; - void defineUiTreeOrdering( caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName = "" ) override; - void initAfterRead() override; + void defineUiTreeOrdering( caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName = "" ) override; + void initAfterRead() override; + double computeCurveZValue() override; private: RifSummaryReaderInterface* valuesSummaryReaderX() const; diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryPlot.cpp b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryPlot.cpp index 437bd6c064..b4519fd1a0 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryPlot.cpp +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryPlot.cpp @@ -237,12 +237,6 @@ void RimSummaryPlot::updateAxes() updateTimeAxis( timeAxisProperties() ); } - if ( plotWidget() ) - { - plotWidget()->updateAxes(); - plotWidget()->scheduleReplot(); - } - updateZoomInParentPlot(); } @@ -584,7 +578,7 @@ void RimSummaryPlot::updatePlotTitle() QString plotTitle = description(); plotWidget()->setPlotTitle( plotTitle ); plotWidget()->setPlotTitleEnabled( m_showPlotTitle && !isSubPlot() ); - plotWidget()->scheduleReplot(); + scheduleReplotIfVisible(); } } @@ -869,11 +863,28 @@ void RimSummaryPlot::updateAxis( RiaDefines::PlotAxis plotAxis ) timeHistoryQuantities.insert( c->quantityName() ); } + std::vector curveDefs; + for ( auto summaryCurve : summaryCurves() ) + { + if ( summaryCurve->axisY() != riuPlotAxis ) continue; + + curveDefs.push_back( summaryCurve->curveDefinitionY() ); + } + + for ( auto curveSet : ensembleCurveSetCollection()->curveSets() ) + { + if ( curveSet->axisY() != riuPlotAxis ) continue; + + RiaSummaryCurveDefinition def( curveSet->summaryCaseCollection(), curveSet->summaryAddress() ); + curveDefs.push_back( def ); + } + RimSummaryPlotAxisFormatter calc( axisProperties, - visibleSummaryCurvesForAxis( riuPlotAxis ), {}, + curveDefs, visibleAsciiDataCurvesForAxis( riuPlotAxis ), timeHistoryQuantities ); + calc.applyAxisPropertiesToPlot( plotWidget() ); } } @@ -971,6 +982,14 @@ bool RimSummaryPlot::isOnlyWaterCutCurvesVisible( RiuPlotAxis plotAxis ) return ( waterCutCurveCount == curves.size() ); } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimSummaryPlot::scheduleReplotIfVisible() +{ + if ( showWindow() && plotWidget() ) plotWidget()->scheduleReplot(); +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- @@ -1465,7 +1484,7 @@ void RimSummaryPlot::fieldChangedByUi( const caf::PdmFieldHandle* changedField, for ( auto& curveSet : this->ensembleCurveSetCollection()->curveSets() ) { - curveSet->detachPlotCurves( true ); + curveSet->deletePlotCurves(); } // Destroy viewer @@ -1498,7 +1517,7 @@ void RimSummaryPlot::updateStackedCurveData() if ( plotWidget() && anyStackedCurvesPresent ) { reattachAllCurves(); - plotWidget()->scheduleReplot(); + scheduleReplotIfVisible(); } } @@ -1686,7 +1705,7 @@ void RimSummaryPlot::updateZoomInParentPlot() plotWidget()->updateAxes(); updateZoomFromParentPlot(); plotWidget()->updateZoomDependentCurveProperties(); - plotWidget()->scheduleReplot(); + scheduleReplotIfVisible(); } //-------------------------------------------------------------------------------------------------- @@ -1775,10 +1794,7 @@ void RimSummaryPlot::curveVisibilityChanged( const caf::SignalEmitter* emitter, //-------------------------------------------------------------------------------------------------- void RimSummaryPlot::curveAppearanceChanged( const caf::SignalEmitter* emitter ) { - if ( plotWidget() ) - { - plotWidget()->scheduleReplot(); - } + scheduleReplotIfVisible(); } //-------------------------------------------------------------------------------------------------- @@ -2651,7 +2667,7 @@ bool RimSummaryPlot::handleGlobalKeyEvent( QKeyEvent* keyEvent ) void RimSummaryPlot::onCurveCollectionChanged( const SignalEmitter* emitter ) { updateStackedCurveData(); - if ( plotWidget() ) plotWidget()->scheduleReplot(); + scheduleReplotIfVisible(); updateAllRequiredEditors(); } @@ -2923,7 +2939,7 @@ void RimSummaryPlot::onChildDeleted( caf::PdmChildArrayFieldHandle* childAr plotWidget()->pruneAxes( usedPlotAxis ); updateAxes(); - plotWidget()->scheduleReplot(); + scheduleReplotIfVisible(); } } } diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryPlot.h b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryPlot.h index 0f8cf99a54..b22152d220 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryPlot.h +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryPlot.h @@ -206,6 +206,7 @@ public: std::vector visibleCurvesForLegend() override; RimSummaryPlotSourceStepping* sourceStepper(); + void scheduleReplotIfVisible(); public: // RimViewWindow overrides diff --git a/ApplicationLibCode/UserInterface/RiuMultiPlotBook.cpp b/ApplicationLibCode/UserInterface/RiuMultiPlotBook.cpp index 62e9c96253..e866660621 100644 --- a/ApplicationLibCode/UserInterface/RiuMultiPlotBook.cpp +++ b/ApplicationLibCode/UserInterface/RiuMultiPlotBook.cpp @@ -491,7 +491,7 @@ bool RiuMultiPlotBook::showYAxis( int row, int column ) const //-------------------------------------------------------------------------------------------------- void RiuMultiPlotBook::performUpdate( RiaDefines::MultiPlotPageUpdateType whatToUpdate ) { - if ( !m_plotDefinition || !m_plotDefinition->isValid() ) return; + if ( !m_plotDefinition || !m_plotDefinition->isValid() || !m_plotDefinition->showWindow() ) return; applyLook(); if ( ( ( whatToUpdate & RiaDefines::MultiPlotPageUpdateType::PLOT ) == RiaDefines::MultiPlotPageUpdateType::PLOT ) || diff --git a/ApplicationLibCode/UserInterface/RiuSummaryQwtPlot.cpp b/ApplicationLibCode/UserInterface/RiuSummaryQwtPlot.cpp index 85dad5c4ec..deee087cc4 100644 --- a/ApplicationLibCode/UserInterface/RiuSummaryQwtPlot.cpp +++ b/ApplicationLibCode/UserInterface/RiuSummaryQwtPlot.cpp @@ -108,7 +108,9 @@ RiuSummaryQwtPlot::RiuSummaryQwtPlot( RimSummaryPlot* plot, QWidget* parent /*= RiuQwtPlotTools::setCommonPlotBehaviour( m_plotWidget->qwtPlot() ); RiuQwtPlotTools::setDefaultAxes( m_plotWidget->qwtPlot() ); - m_plotWidget->setInternalLegendVisible( true ); + // PERFORMANCE NOTE + // Do not set internal legends visible, as this will cause a performance hit. + m_plotWidget->setInternalLegendVisible( false ); m_annotationTool = std::unique_ptr( new RiuPlotAnnotationTool() ); }