mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#6259 Implement stacking per curve
This commit is contained in:
@@ -126,6 +126,8 @@ RimPlotCurve::RimPlotCurve()
|
||||
, visibilityChanged( this )
|
||||
, dataChanged( this )
|
||||
, nameChanged( this )
|
||||
, stackingChanged( this )
|
||||
, stackingColorsChanged( this )
|
||||
{
|
||||
CAF_PDM_InitObject( "Curve", ":/WellLogCurve16x16.png", "", "" );
|
||||
|
||||
@@ -170,6 +172,9 @@ RimPlotCurve::RimPlotCurve()
|
||||
|
||||
CAF_PDM_InitFieldNoDefault( &m_symbolLabelPosition, "SymbolLabelPosition", "Symbol Label Position", "", "", "" );
|
||||
|
||||
CAF_PDM_InitField( &m_stackCurve, "StackCurve", false, "Stack Curve", "", "", "" );
|
||||
CAF_PDM_InitField( &m_stackWithPhaseColors, "StackPhaseColors", false, " with Phase Colors", "", "", "" );
|
||||
|
||||
m_qwtPlotCurve = new RiuRimQwtPlotCurve( this );
|
||||
m_qwtCurveErrorBars = new QwtPlotIntervalCurve();
|
||||
m_qwtCurveErrorBars->setStyle( QwtPlotIntervalCurve::CurveStyle::NoCurve );
|
||||
@@ -259,6 +264,20 @@ void RimPlotCurve::fieldChangedByUi( const caf::PdmFieldHandle* changedField, co
|
||||
{
|
||||
updateCurveAppearance();
|
||||
}
|
||||
else if ( changedField == &m_stackCurve )
|
||||
{
|
||||
if ( !m_stackCurve() && m_fillStyle() != Qt::NoBrush )
|
||||
{
|
||||
// Switch off area fill when turning off stacking.
|
||||
m_fillStyle = Qt::NoBrush;
|
||||
}
|
||||
stackingChanged.send( m_stackCurve() );
|
||||
}
|
||||
else if ( changedField == &m_stackWithPhaseColors )
|
||||
{
|
||||
stackingColorsChanged.send( m_stackWithPhaseColors() );
|
||||
}
|
||||
|
||||
RiuPlotMainWindowTools::refreshToolbars();
|
||||
if ( m_parentQwtPlot ) m_parentQwtPlot->replot();
|
||||
}
|
||||
@@ -633,6 +652,9 @@ void RimPlotCurve::setSamplesFromTimeTAndYValues( const std::vector<time_t>& dat
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimPlotCurve::appearanceUiOrdering( caf::PdmUiOrdering& uiOrdering )
|
||||
{
|
||||
uiOrdering.add( &m_stackCurve );
|
||||
if ( m_stackCurve() ) uiOrdering.add( &m_stackWithPhaseColors );
|
||||
|
||||
uiOrdering.add( &m_curveColor );
|
||||
uiOrdering.add( &m_pointSymbol );
|
||||
if ( RiuQwtSymbol::isFilledSymbol( m_pointSymbol() ) )
|
||||
@@ -702,6 +724,22 @@ void RimPlotCurve::assignStackColor( size_t index, size_t count )
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimPlotCurve::stacked() const
|
||||
{
|
||||
return m_stackCurve();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimPlotCurve::stackWithPhaseColors() const
|
||||
{
|
||||
return m_stackWithPhaseColors;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user