#6533 Speed up ensemble curve preview.

Made faster by hiding legends and error bars when there are many curves.
This commit is contained in:
Kristian Bendiksen 2020-09-23 14:35:57 +02:00 committed by Gaute Lindkvist
parent 7f9cab5300
commit 3e1a019783
4 changed files with 18 additions and 1 deletions

View File

@ -455,11 +455,16 @@ void RicSummaryPlotEditorUi::updatePreviewCurvesFromCurveDefinitions(
size_t ensembleCurveCnt = ensembleCurveCount( allCurveDefsToDisplay );
// Disable legends when adding curves
m_previewPlot->setLegendsVisible( false );
// Add new curves
for ( const auto& curveDef : curveDefsToAdd )
{
RimSummaryCase* currentCase = curveDef.summaryCase();
RimSummaryCurve* curve = new RimSummaryCurve();
curve->setErrorBarsVisible( false );
curve->showLegend( false );
curve->setSummaryCaseY( currentCase );
curve->setSummaryAddressYAndApplyInterpolation( curveDef.summaryAddress() );
curve->applyCurveAutoNameSettings( *m_curveNameConfig() );
@ -522,6 +527,8 @@ void RicSummaryPlotEditorUi::updatePreviewCurvesFromCurveDefinitions(
}
}
// Enable legends if there is not too many curves
m_previewPlot->setLegendsVisible( !warningDisplayed );
m_previewPlot->loadDataAndUpdate();
m_previewPlot->zoomAll();
m_previewPlot->updateConnectedEditors();

View File

@ -301,6 +301,14 @@ void RimPlotCurve::setLegendEntryText( const QString& legendEntryText )
m_legendEntryText = legendEntryText;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimPlotCurve::setErrorBarsVisible( bool isVisible )
{
m_showErrorBars = isVisible;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------

View File

@ -115,6 +115,8 @@ public:
void setZOrder( double z );
void setErrorBarsVisible( bool isVisible );
virtual void updateCurveAppearance();
bool isCrossPlotCurve() const;
void updateUiIconFromPlotSymbol();

View File

@ -967,7 +967,7 @@ void RimEnsembleCurveSet::updateEnsembleCurves( const std::vector<RimSummaryCase
if ( plot->viewer() )
{
plot->viewer()->updateLegend();
if ( plot->legendsVisible() ) plot->viewer()->updateLegend();
plot->viewer()->scheduleReplot();
plot->updateAxes();
plot->updatePlotInfoLabel();