#14539 Summary Plot: Preserve user defined axis ranges when the data source changes

An axis range defined by the user is now kept when a summary case or ensemble is added, reloaded or replaced. The range is marked as user defined when the user edits the min/max values, unchecks "Set Range Automatically" or zooms interactively in the plot.

The user defined range is released by "Zoom All", by double click in a plot, by checking "Set Range Automatically" or by changing the Y axis range aggregation of a summary multi plot.
This commit is contained in:
Magne Sjaastad committed 2026-09-09 12:08:10 +02:00
1 parent f38332b2e6
commit 110bdbe0c7
11 files changed
+121 -7

No files matched your search

@@ -586,14 +586,14 @@ double RimPlotAxisProperties::visibleRangeMax() const
//--------------------------------------------------------------------------------------------------
void RimPlotAxisProperties::enableAutoValueMinMax( bool enable )
{
// Never replace a range defined by the user by an automatically computed range
const bool useAutoValue = enable && !isRangeUserDefined();
m_visibleRangeMin.uiCapability()->enableAutoValueSupport( enable );
m_visibleRangeMax.uiCapability()->enableAutoValueSupport( enable );
if ( enable )
{
m_visibleRangeMin.uiCapability()->enableAutoValue( enable );
m_visibleRangeMax.uiCapability()->enableAutoValue( enable );
}
m_visibleRangeMin.uiCapability()->enableAutoValue( useAutoValue );
m_visibleRangeMax.uiCapability()->enableAutoValue( useAutoValue );
}
//--------------------------------------------------------------------------------------------------
@@ -711,12 +711,22 @@ void RimPlotAxisProperties::fieldChangedByUi( const caf::PdmFieldHandle* changed
if ( m_visibleRangeMin > m_visibleRangeMax ) m_visibleRangeMax = oldValue.toDouble();
m_isAutoZoom = false;
// The range is defined by the user unless the value comes from the auto value of the field
setRangeUserDefined( !m_visibleRangeMax.uiCapability()->isAutoValueEnabled() );
}
else if ( changedField == &m_visibleRangeMin )
{
if ( m_visibleRangeMin > m_visibleRangeMax ) m_visibleRangeMin = oldValue.toDouble();
m_isAutoZoom = false;
// The range is defined by the user unless the value comes from the auto value of the field
setRangeUserDefined( !m_visibleRangeMin.uiCapability()->isAutoValueEnabled() );
}
else if ( changedField == &m_isAutoZoom )
{
setRangeUserDefined( !m_isAutoZoom() );
}
if ( changedField == &m_isLogarithmicScaleEnabled )