mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#8522 Summary Plot: Prune unused axes after move or delete
This commit is contained in:
@@ -753,6 +753,7 @@ void RimEnsembleCurveSet::fieldChangedByUi( const caf::PdmFieldHandle* changedFi
|
||||
|
||||
updatePlotAxis();
|
||||
plot->updateAxes();
|
||||
plot->updateAll();
|
||||
|
||||
updateTextInPlot = true;
|
||||
}
|
||||
@@ -2099,6 +2100,11 @@ void RimEnsembleCurveSet::setAxisY( RiuPlotAxis plotAxis )
|
||||
RimSummaryPlot* plot = nullptr;
|
||||
firstAncestorOrThisOfTypeAsserted( plot );
|
||||
m_plotAxisProperties = plot->axisPropertiesForPlotAxis( plotAxis );
|
||||
|
||||
for ( RimSummaryCurve* curve : curves() )
|
||||
{
|
||||
curve->setLeftOrRightAxisY( axisY() );
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -845,7 +845,7 @@ void RimSummaryPlot::updateZoomForAxis( RiuPlotAxis plotAxis )
|
||||
}
|
||||
|
||||
double min, max;
|
||||
RimPlotAxisLogRangeCalculator calc( RiaDefines::PlotAxis::PLOT_AXIS_LEFT, plotCurves );
|
||||
RimPlotAxisLogRangeCalculator calc( plotAxis.axis(), plotCurves );
|
||||
calc.computeAxisRange( &min, &max );
|
||||
|
||||
if ( yAxisProps->isAxisInverted() )
|
||||
@@ -2008,7 +2008,7 @@ RiuPlotWidget* RimSummaryPlot::doCreatePlotViewWidget( QWidget* mainWindowParent
|
||||
|
||||
for ( auto axisProperties : m_axisProperties )
|
||||
{
|
||||
plotWidget()->ensureAxis( axisProperties->plotAxisType() );
|
||||
plotWidget()->ensureAxisIsCreated( axisProperties->plotAxisType() );
|
||||
}
|
||||
|
||||
for ( RimGridTimeHistoryCurve* curve : m_gridTimeHistoryCurves )
|
||||
@@ -2482,6 +2482,13 @@ void RimSummaryPlot::onChildDeleted( caf::PdmChildArrayFieldHandle* childAr
|
||||
|
||||
if ( plotWidget() )
|
||||
{
|
||||
std::set<RiuPlotAxis> usedPlotAxis;
|
||||
for ( auto axisProperties : m_axisProperties )
|
||||
{
|
||||
usedPlotAxis.insert( axisProperties->plotAxisType() );
|
||||
}
|
||||
|
||||
plotWidget()->pruneAxes( usedPlotAxis );
|
||||
updateAxes();
|
||||
plotWidget()->scheduleReplot();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user