mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Add updateCurveAppearance() to stackable curve
This commit is contained in:
@@ -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 );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
};
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user