9437 fix missing summary sub plot update

Summary plot: fix missing sub plot title updates.
Janitor: improve RiuPlotWidget interface.
This commit is contained in:
Kristian Bendiksen 2022-11-29 19:28:57 +01:00 committed by GitHub
parent 14db528c98
commit 99553382f5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 17 additions and 11 deletions

View File

@ -209,6 +209,7 @@ void RimSummaryMultiPlot::insertPlot( RimPlot* plot, size_t index )
sumPlot->axisChanged.connect( this, &RimSummaryMultiPlot::onSubPlotAxisChanged );
sumPlot->curvesChanged.connect( this, &RimSummaryMultiPlot::onSubPlotChanged );
sumPlot->plotZoomedByUser.connect( this, &RimSummaryMultiPlot::onSubPlotZoomed );
sumPlot->titleChanged.connect( this, &RimSummaryMultiPlot::onSubPlotChanged );
bool isMinMaxOverridden = m_axisRangeAggregation() != AxisRangeAggregation::NONE;
setAutoValueStatesForPlot( sumPlot, isMinMaxOverridden, m_autoAdjustAppearance() );
@ -550,9 +551,9 @@ void RimSummaryMultiPlot::updatePlotWindowTitle()
setMultiPlotTitle( title );
}
if ( m_autoSubPlotTitle )
for ( auto plot : summaryPlots() )
{
for ( auto plot : summaryPlots() )
if ( m_autoSubPlotTitle )
{
auto subPlotNameHelper = plot->plotTitleHelper();
@ -563,11 +564,11 @@ void RimSummaryMultiPlot::updatePlotWindowTitle()
auto plotName = subPlotNameHelper->aggregatedPlotTitle( *m_nameHelper );
plot->setPlotTitleVisible( true );
plot->setDescription( plotName );
plot->updatePlotTitle();
}
if ( !m_viewer.isNull() ) m_viewer->scheduleTitleUpdate();
plot->updatePlotTitle();
}
if ( !m_viewer.isNull() ) m_viewer->scheduleTitleUpdate();
}
//--------------------------------------------------------------------------------------------------
@ -715,6 +716,7 @@ void RimSummaryMultiPlot::initAfterRead()
plot->axisChanged.connect( this, &RimSummaryMultiPlot::onSubPlotAxisChanged );
plot->curvesChanged.connect( this, &RimSummaryMultiPlot::onSubPlotChanged );
plot->plotZoomedByUser.connect( this, &RimSummaryMultiPlot::onSubPlotZoomed );
plot->titleChanged.connect( this, &RimSummaryMultiPlot::onSubPlotChanged );
}
updateStepDimensionFromDefault();
}

View File

@ -105,6 +105,7 @@ RimSummaryPlot::RimSummaryPlot( bool isCrossPlot )
, curvesChanged( this )
, axisChanged( this )
, plotZoomedByUser( this )
, titleChanged( this )
, m_isValid( true )
{
CAF_PDM_InitScriptableObject( "Summary Plot", ":/SummaryPlotLight16x16.png", "", "A Summary Plot" );
@ -1485,6 +1486,8 @@ void RimSummaryPlot::fieldChangedByUi( const caf::PdmFieldHandle* changedField,
c->updateCurveNameNoLegendUpdate();
}
}
titleChanged.send();
}
if ( changedField == &m_showPlotLegends ) updateLegend();

View File

@ -82,6 +82,7 @@ public:
caf::Signal<> curvesChanged;
caf::Signal<RimSummaryPlot*> axisChanged;
caf::Signal<> plotZoomedByUser;
caf::Signal<> titleChanged;
public:
RimSummaryPlot( bool isCrossPlot = false );

View File

@ -115,8 +115,8 @@ public:
virtual void setPlotTitle( const QString& plotTitle ) = 0;
const QString& plotTitle() const;
void setPlotTitleEnabled( bool enabled );
bool plotTitleEnabled() const;
virtual void setPlotTitleEnabled( bool enabled ) = 0;
virtual bool plotTitleEnabled() const = 0;
virtual void setPlotTitleFontSize( int titleFontSize ) = 0;
virtual void setLegendFontSize( int fontSize ) = 0;

View File

@ -112,8 +112,8 @@ public:
void setPlotTitle( const QString& plotTitle ) override;
const QString& plotTitle() const;
void setPlotTitleEnabled( bool enabled );
bool plotTitleEnabled() const;
void setPlotTitleEnabled( bool enabled ) override;
bool plotTitleEnabled() const override;
void setPlotTitleFontSize( int titleFontSize ) override;
void setLegendFontSize( int fontSize ) override;

View File

@ -101,8 +101,8 @@ public:
void setPlotTitle( const QString& plotTitle ) override;
const QString& plotTitle() const;
void setPlotTitleEnabled( bool enabled );
bool plotTitleEnabled() const;
void setPlotTitleEnabled( bool enabled ) override;
bool plotTitleEnabled() const override;
void setPlotTitleFontSize( int titleFontSize ) override;
void setLegendFontSize( int fontSize ) override;