Temp work

This commit is contained in:
Gaute Lindkvist
2020-07-02 13:06:31 +02:00
parent f202f4b8a7
commit d861af44b6
23 changed files with 300 additions and 110 deletions

View File

@@ -56,7 +56,11 @@ CAF_PDM_SOURCE_INIT(RimPlotAxisProperties, "SummaryYAxisProperties");
///
//--------------------------------------------------------------------------------------------------
RimPlotAxisProperties::RimPlotAxisProperties()
: m_enableTitleTextSettings(true)
: settingsChanged(this)
, logarithmicChanged(this)
, stackingChanged(this)
, stackingColorsChanged(this)
, m_enableTitleTextSettings(true)
, m_isRangeSettingsEnabled(true)
{
CAF_PDM_InitObject("Axis Properties", ":/LeftAxis16x16.png", "", "");
@@ -88,6 +92,7 @@ RimPlotAxisProperties::RimPlotAxisProperties()
CAF_PDM_InitField(&isLogarithmicScaleEnabled, "LogarithmicScale", false, "Logarithmic Scale", "", "", "");
CAF_PDM_InitField(&m_isAxisInverted, "AxisInverted", false, "Invert Axis", "", "", "");
CAF_PDM_InitField(&m_stackCurves, "StackCurves", false, "Stack Curves", "", "", "");
CAF_PDM_InitField(&m_stackWithPhaseColors, "StackPhaseColors", false, " with Phase Colors", "", "", "");
CAF_PDM_InitFieldNoDefault(&m_titlePositionEnum, "TitlePosition", "Title Position", "", "", "");
@@ -189,6 +194,10 @@ void RimPlotAxisProperties::defineUiOrdering( QString uiConfigName, caf::PdmUiOr
scaleGroup.add( &m_isAxisInverted );
}
scaleGroup.add( &m_stackCurves );
if ( m_stackCurves )
{
scaleGroup.add( &m_stackWithPhaseColors );
}
scaleGroup.add( &numberFormat );
if ( numberFormat() != NUMBER_FORMAT_AUTO )
@@ -357,6 +366,14 @@ bool RimPlotAxisProperties::stackCurves() const
return m_stackCurves();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RimPlotAxisProperties::stackWithPhaseColors() const
{
return m_stackWithPhaseColors;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@@ -405,18 +422,21 @@ void RimPlotAxisProperties::fieldChangedByUi( const caf::PdmFieldHandle* changed
m_isAutoZoom = false;
}
RimPlot* parentPlot = nullptr;
this->firstAncestorOrThisOfType( parentPlot );
if ( parentPlot )
if ( changedField == &isLogarithmicScaleEnabled )
{
if ( changedField == &isLogarithmicScaleEnabled || changedField == &m_stackCurves )
{
parentPlot->loadDataAndUpdate();
}
else
{
parentPlot->updateAxes();
}
logarithmicChanged.send( isLogarithmicScaleEnabled() );
}
else if ( changedField == &m_stackCurves )
{
stackingChanged.send( m_stackCurves() );
}
else if ( changedField == &m_stackWithPhaseColors )
{
stackingColorsChanged.send( m_stackWithPhaseColors() );
}
else
{
settingsChanged.send();
}
}