mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#6533 Speed up ensemble curve preview.
Made faster by hiding legends and error bars when there are many curves.
This commit is contained in:
parent
7f9cab5300
commit
3e1a019783
@ -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();
|
||||
|
@ -301,6 +301,14 @@ void RimPlotCurve::setLegendEntryText( const QString& legendEntryText )
|
||||
m_legendEntryText = legendEntryText;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimPlotCurve::setErrorBarsVisible( bool isVisible )
|
||||
{
|
||||
m_showErrorBars = isVisible;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -115,6 +115,8 @@ public:
|
||||
|
||||
void setZOrder( double z );
|
||||
|
||||
void setErrorBarsVisible( bool isVisible );
|
||||
|
||||
virtual void updateCurveAppearance();
|
||||
bool isCrossPlotCurve() const;
|
||||
void updateUiIconFromPlotSymbol();
|
||||
|
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user