#6293 Make sure stacking is only available for some curv

* Well Log Curves and Summary Curves for now.
This commit is contained in:
Gaute Lindkvist
2020-08-11 09:11:10 +02:00
parent b92c61ac1c
commit af44659860
14 changed files with 200 additions and 108 deletions

View File

@@ -126,8 +126,6 @@ RimPlotCurve::RimPlotCurve()
, visibilityChanged( this )
, dataChanged( this )
, nameChanged( this )
, stackingChanged( this )
, stackingColorsChanged( this )
{
CAF_PDM_InitObject( "Curve", ":/WellLogCurve16x16.png", "", "" );
@@ -172,9 +170,6 @@ RimPlotCurve::RimPlotCurve()
CAF_PDM_InitFieldNoDefault( &m_symbolLabelPosition, "SymbolLabelPosition", "Symbol Label Position", "", "", "" );
CAF_PDM_InitField( &m_isStacked, "StackCurve", false, "Stack Curve", "", "", "" );
CAF_PDM_InitField( &m_isStackedWithPhaseColors, "StackPhaseColors", false, " with Phase Colors", "", "", "" );
m_qwtPlotCurve = new RiuRimQwtPlotCurve( this );
m_qwtCurveErrorBars = new QwtPlotIntervalCurve();
m_qwtCurveErrorBars->setStyle( QwtPlotIntervalCurve::CurveStyle::NoCurve );
@@ -264,19 +259,6 @@ void RimPlotCurve::fieldChangedByUi( const caf::PdmFieldHandle* changedField, co
{
updateCurveAppearance();
}
else if ( changedField == &m_isStacked )
{
if ( !m_isStacked() && m_fillStyle() != Qt::NoBrush )
{
// Switch off area fill when turning off stacking.
m_fillStyle = Qt::NoBrush;
}
stackingChanged.send( m_isStacked() );
}
else if ( changedField == &m_isStackedWithPhaseColors )
{
stackingColorsChanged.send( m_isStackedWithPhaseColors() );
}
RiuPlotMainWindowTools::refreshToolbars();
if ( m_parentQwtPlot ) m_parentQwtPlot->replot();
@@ -652,9 +634,6 @@ void RimPlotCurve::setSamplesFromTimeTAndYValues( const std::vector<time_t>& dat
//--------------------------------------------------------------------------------------------------
void RimPlotCurve::appearanceUiOrdering( caf::PdmUiOrdering& uiOrdering )
{
uiOrdering.add( &m_isStacked );
if ( m_isStacked() ) uiOrdering.add( &m_isStackedWithPhaseColors );
uiOrdering.add( &m_curveColor );
uiOrdering.add( &m_pointSymbol );
if ( RiuQwtSymbol::isFilledSymbol( m_pointSymbol() ) )
@@ -699,63 +678,6 @@ void RimPlotCurve::updateUiIconFromPlotSymbol()
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RiaDefines::PhaseType RimPlotCurve::phaseType() const
{
return RiaDefines::PhaseType::PHASE_NOT_APPLICABLE;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimPlotCurve::assignStackColor( size_t index, size_t count )
{
auto allPhaseColors = RiaColorTables::phaseColors();
auto it = allPhaseColors.find( phaseType() );
if ( it != allPhaseColors.end() )
{
caf::ColorTable interpolatedPhaseColors = it->second.interpolated( count );
auto color = interpolatedPhaseColors.cycledColor3f( index );
this->setColor( color );
this->setFillColor( color );
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RimPlotCurve::isStacked() const
{
return m_isStacked();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RimPlotCurve::isStackedWithPhaseColors() const
{
return m_isStackedWithPhaseColors;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimPlotCurve::setIsStacked( bool stacked )
{
m_isStacked = stacked;
if ( !m_isStacked() && m_fillStyle() != Qt::NoBrush )
{
// Switch off area fill when turning off stacking.
m_fillStyle = Qt::NoBrush;
}
stackingChanged.send( m_isStacked() );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------