Add updateCurveAppearance() to stackable curve

This commit is contained in:
Magne Sjaastad
2023-10-12 14:08:49 +02:00
parent 55cafc64c3
commit 0f4d2a61f6
3 changed files with 34 additions and 14 deletions

View File

@@ -15,6 +15,7 @@
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
#include "RimStackablePlotCurve.h"
#include "RiaColorTables.h"
@@ -107,11 +108,7 @@ void RimStackablePlotCurve::setIsStacked( bool stacked )
{
m_isStacked = stacked;
if ( !m_isStacked() && fillStyle() != Qt::NoBrush )
{
// Switch off area fill when turning off stacking.
setFillStyle( Qt::NoBrush );
}
updateStackingAppearance();
stackingChanged.send( m_isStacked() );
}
@@ -124,11 +121,7 @@ void RimStackablePlotCurve::fieldChangedByUi( const caf::PdmFieldHandle* changed
if ( changedField == &m_isStacked )
{
if ( !m_isStacked() && fillStyle() != Qt::NoBrush )
{
// Switch off area fill when turning off stacking.
setFillStyle( Qt::NoBrush );
}
updateStackingAppearance();
stackingChanged.send( m_isStacked() );
}
else if ( changedField == &m_isStackedWithPhaseColors )
@@ -174,3 +167,25 @@ void RimStackablePlotCurve::defaultUiOrdering( caf::PdmUiOrdering& uiOrdering )
nameGroup->add( &m_showLegend );
RimPlotCurve::curveNameUiOrdering( *nameGroup );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimStackablePlotCurve::updateCurveAppearance()
{
updateStackingAppearance();
RimPlotCurve::updateCurveAppearance();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimStackablePlotCurve::updateStackingAppearance()
{
if ( !m_isStacked() && fillStyle() != Qt::NoBrush )
{
// Switch off area fill when turning off stacking.
setFillStyle( Qt::NoBrush );
}
}

View File

@@ -34,16 +34,21 @@ public:
bool isStacked() const;
bool isStackedWithPhaseColors() const;
void setIsStacked( bool stacked );
void updateCurveAppearance() override;
void defaultUiOrdering( caf::PdmUiOrdering& uiOrdering );
void stackingUiOrdering( caf::PdmUiOrdering& uiOrdering );
protected:
void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) override;
void stackingUiOrdering( caf::PdmUiOrdering& uiOrdering );
void defaultUiOrdering( caf::PdmUiOrdering& uiOrdering );
private:
void onFillColorChanged( const caf::SignalEmitter* emitter ) override;
void updateStackingAppearance();
protected:
caf::PdmField<bool> m_isStacked;
private:
caf::PdmField<bool> m_isStackedWithPhaseColors;
};

View File

@@ -405,7 +405,7 @@ void RimWellLogCurve::fieldChangedByUi( const caf::PdmFieldHandle* changedField,
if ( changedField == &m_showCurve )
{
if ( m_isStacked() || m_showCurve() )
if ( isStacked() || m_showCurve() )
{
updateZoomInParentPlot();
}