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:
@@ -58,8 +58,6 @@ CAF_PDM_SOURCE_INIT(RimPlotAxisProperties, "SummaryYAxisProperties");
|
||||
RimPlotAxisProperties::RimPlotAxisProperties()
|
||||
: settingsChanged(this)
|
||||
, logarithmicChanged(this)
|
||||
, stackingChanged(this)
|
||||
, stackingColorsChanged(this)
|
||||
, m_enableTitleTextSettings(true)
|
||||
, m_isRangeSettingsEnabled(true)
|
||||
{
|
||||
@@ -91,8 +89,6 @@ RimPlotAxisProperties::RimPlotAxisProperties()
|
||||
CAF_PDM_InitField(&m_isAutoZoom, "AutoZoom", true, "Set Range Automatically", "", "", "");
|
||||
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", "", "", "");
|
||||
|
||||
@@ -197,11 +193,6 @@ void RimPlotAxisProperties::defineUiOrdering( QString uiConfigName, caf::PdmUiOr
|
||||
scaleGroup.add( &isLogarithmicScaleEnabled );
|
||||
scaleGroup.add( &m_isAxisInverted );
|
||||
}
|
||||
scaleGroup.add( &m_stackCurves );
|
||||
if ( m_stackCurves )
|
||||
{
|
||||
scaleGroup.add( &m_stackWithPhaseColors );
|
||||
}
|
||||
scaleGroup.add( &numberFormat );
|
||||
|
||||
if ( numberFormat() != NUMBER_FORMAT_AUTO )
|
||||
@@ -362,22 +353,6 @@ void RimPlotAxisProperties::setAxisInverted( bool inverted )
|
||||
m_isAxisInverted = inverted;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimPlotAxisProperties::stackCurves() const
|
||||
{
|
||||
return m_stackCurves();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimPlotAxisProperties::stackWithPhaseColors() const
|
||||
{
|
||||
return m_stackWithPhaseColors;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -430,14 +405,6 @@ void RimPlotAxisProperties::fieldChangedByUi( const caf::PdmFieldHandle* changed
|
||||
{
|
||||
logarithmicChanged.send( isLogarithmicScaleEnabled() );
|
||||
}
|
||||
else if ( changedField == &m_stackCurves )
|
||||
{
|
||||
stackingChanged.send( m_stackCurves() );
|
||||
}
|
||||
else if ( changedField == &m_stackWithPhaseColors )
|
||||
{
|
||||
stackingColorsChanged.send( m_stackWithPhaseColors() );
|
||||
}
|
||||
else
|
||||
{
|
||||
settingsChanged.send();
|
||||
|
||||
@@ -53,8 +53,6 @@ public:
|
||||
public:
|
||||
caf::Signal<> settingsChanged;
|
||||
caf::Signal<bool> logarithmicChanged;
|
||||
caf::Signal<bool> stackingChanged;
|
||||
caf::Signal<bool> stackingColorsChanged;
|
||||
|
||||
public:
|
||||
RimPlotAxisProperties();
|
||||
@@ -78,8 +76,6 @@ public:
|
||||
void setAutoZoom( bool enableAutoZoom );
|
||||
bool isAxisInverted() const;
|
||||
void setAxisInverted( bool inverted );
|
||||
bool stackCurves() const;
|
||||
bool stackWithPhaseColors() const;
|
||||
|
||||
std::vector<RimPlotAxisAnnotation*> annotations() const;
|
||||
void appendAnnotation( RimPlotAxisAnnotation* annotation );
|
||||
@@ -122,8 +118,6 @@ private:
|
||||
caf::PdmField<bool> m_displayUnitText;
|
||||
caf::PdmField<bool> m_isAutoZoom;
|
||||
caf::PdmField<bool> m_isAxisInverted;
|
||||
caf::PdmField<bool> m_stackCurves;
|
||||
caf::PdmField<bool> m_stackWithPhaseColors;
|
||||
|
||||
caf::PdmField<QString> m_name;
|
||||
QwtPlot::Axis m_axis;
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -49,6 +49,8 @@ public:
|
||||
caf::Signal<bool> visibilityChanged;
|
||||
caf::Signal<> dataChanged;
|
||||
caf::Signal<QString> nameChanged;
|
||||
caf::Signal<bool> stackingChanged;
|
||||
caf::Signal<bool> stackingColorsChanged;
|
||||
|
||||
public:
|
||||
typedef caf::AppEnum<RiuQwtPlotCurve::CurveInterpolationEnum> CurveInterpolation;
|
||||
@@ -121,6 +123,8 @@ public:
|
||||
|
||||
virtual RiaDefines::PhaseType phaseType() const;
|
||||
void assignStackColor( size_t index, size_t count );
|
||||
bool stacked() const;
|
||||
bool stackWithPhaseColors() const;
|
||||
|
||||
protected:
|
||||
virtual QString createCurveAutoName() = 0;
|
||||
@@ -191,4 +195,7 @@ protected:
|
||||
caf::PdmField<CurveInterpolation> m_curveInterpolation;
|
||||
caf::PdmField<LabelPosition> m_symbolLabelPosition;
|
||||
caf::PdmField<cvf::Color3f> m_symbolEdgeColor;
|
||||
|
||||
caf::PdmField<bool> m_stackCurve;
|
||||
caf::PdmField<bool> m_stackWithPhaseColors;
|
||||
};
|
||||
|
||||
@@ -187,8 +187,6 @@ RimWellLogTrack::RimWellLogTrack()
|
||||
m_visibleDepthRangeMax.uiCapability()->setUiHidden( true );
|
||||
m_visibleDepthRangeMax.xmlCapability()->disableIO();
|
||||
|
||||
CAF_PDM_InitField( &m_stackCurves, "StackCurves", false, "Stack Curves", "", "", "" );
|
||||
CAF_PDM_InitField( &m_stackWithPhaseColors, "StackWithPhaseColors", false, " with phase colors", "", "", "" );
|
||||
CAF_PDM_InitField( &m_isAutoScaleXEnabled, "AutoScaleX", true, "Auto Scale", "", "", "" );
|
||||
m_isAutoScaleXEnabled.uiCapability()->setUiHidden( true );
|
||||
|
||||
@@ -476,7 +474,7 @@ void RimWellLogTrack::updateXZoom()
|
||||
m_visibleXRangeMax = m_availableXRangeMax;
|
||||
|
||||
// Set min limit to 0.0 for stacked curves
|
||||
if ( m_stackCurves && !m_isLogarithmicScaleEnabled )
|
||||
if ( !visibleStackedCurves().empty() && !m_isLogarithmicScaleEnabled )
|
||||
{
|
||||
m_visibleXRangeMin = 0.0;
|
||||
}
|
||||
@@ -720,14 +718,6 @@ void RimWellLogTrack::fieldChangedByUi( const caf::PdmFieldHandle* changedField,
|
||||
updateParentLayout();
|
||||
RiuPlotMainWindowTools::refreshToolbars();
|
||||
}
|
||||
else if ( changedField == &m_stackCurves || changedField == &m_stackWithPhaseColors )
|
||||
{
|
||||
updateStackedCurveData();
|
||||
|
||||
m_isAutoScaleXEnabled = true;
|
||||
updateXZoom();
|
||||
m_plotWidget->scheduleReplot();
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -735,7 +725,8 @@ void RimWellLogTrack::fieldChangedByUi( const caf::PdmFieldHandle* changedField,
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimWellLogTrack::curveDataChanged( const caf::SignalEmitter* emitter )
|
||||
{
|
||||
if ( m_stackCurves )
|
||||
const RimWellLogCurve* curve = dynamic_cast<const RimWellLogCurve*>( emitter );
|
||||
if ( curve->stacked() )
|
||||
{
|
||||
updateStackedCurveData();
|
||||
}
|
||||
@@ -746,7 +737,8 @@ void RimWellLogTrack::curveDataChanged( const caf::SignalEmitter* emitter )
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimWellLogTrack::curveVisibilityChanged( const caf::SignalEmitter* emitter, bool visible )
|
||||
{
|
||||
if ( m_stackCurves )
|
||||
const RimWellLogCurve* curve = dynamic_cast<const RimWellLogCurve*>( emitter );
|
||||
if ( curve->stacked() )
|
||||
{
|
||||
updateStackedCurveData();
|
||||
}
|
||||
@@ -763,6 +755,30 @@ void RimWellLogTrack::curveAppearanceChanged( const caf::SignalEmitter* emitter
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimWellLogTrack::curveStackingChanged( const caf::SignalEmitter* emitter, bool stacked )
|
||||
{
|
||||
updateStackedCurveData();
|
||||
|
||||
m_isAutoScaleXEnabled = true;
|
||||
updateXZoom();
|
||||
m_plotWidget->scheduleReplot();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimWellLogTrack::curveStackingColorsChanged( const caf::SignalEmitter* emitter, bool stackWithPhaseColors )
|
||||
{
|
||||
updateStackedCurveData();
|
||||
|
||||
m_isAutoScaleXEnabled = true;
|
||||
updateXZoom();
|
||||
m_plotWidget->scheduleReplot();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -1078,6 +1094,7 @@ void RimWellLogTrack::addCurve( RimWellLogCurve* curve )
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimWellLogTrack::insertCurve( RimWellLogCurve* curve, size_t index )
|
||||
{
|
||||
qDebug() << "Drag index: " << index;
|
||||
if ( index >= m_curves.size() )
|
||||
{
|
||||
addCurve( curve );
|
||||
@@ -2035,6 +2052,8 @@ void RimWellLogTrack::connectCurveSignals( RimWellLogCurve* curve )
|
||||
curve->dataChanged.connect( this, &RimWellLogTrack::curveDataChanged );
|
||||
curve->visibilityChanged.connect( this, &RimWellLogTrack::curveVisibilityChanged );
|
||||
curve->appearanceChanged.connect( this, &RimWellLogTrack::curveAppearanceChanged );
|
||||
curve->stackingChanged.connect( this, &RimWellLogTrack::curveStackingChanged );
|
||||
curve->stackingColorsChanged.connect( this, &RimWellLogTrack::curveStackingColorsChanged );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -2045,6 +2064,8 @@ void RimWellLogTrack::disconnectCurveSignals( RimWellLogCurve* curve )
|
||||
curve->dataChanged.disconnect( this );
|
||||
curve->visibilityChanged.disconnect( this );
|
||||
curve->appearanceChanged.disconnect( this );
|
||||
curve->stackingChanged.disconnect( this );
|
||||
curve->stackingColorsChanged.disconnect( this );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -2098,7 +2119,7 @@ std::map<int, std::vector<RimWellLogCurve*>> RimWellLogTrack::visibleStackedCurv
|
||||
{
|
||||
stackedCurves[wfrCurve->groupId()].push_back( wfrCurve );
|
||||
}
|
||||
else if ( m_stackCurves() )
|
||||
else if ( curve->stacked() )
|
||||
{
|
||||
stackedCurves[-1].push_back( curve );
|
||||
}
|
||||
@@ -2168,11 +2189,6 @@ void RimWellLogTrack::uiOrderingForXAxisSettings( caf::PdmUiOrdering& uiOrdering
|
||||
gridGroup->add( &m_visibleXRangeMin );
|
||||
gridGroup->add( &m_visibleXRangeMax );
|
||||
gridGroup->add( &m_xAxisGridVisibility );
|
||||
gridGroup->add( &m_stackCurves );
|
||||
if ( m_stackCurves )
|
||||
{
|
||||
gridGroup->add( &m_stackWithPhaseColors );
|
||||
}
|
||||
|
||||
// TODO Revisit if these settings are required
|
||||
// See issue https://github.com/OPM/ResInsight/issues/4367
|
||||
@@ -2454,7 +2470,7 @@ void RimWellLogTrack::updateStackedCurveData()
|
||||
|
||||
curve->setOverrideCurveData( allStackedValues, plotDepthValues, polyLineStartStopIndices );
|
||||
curve->setZOrder( zPos );
|
||||
if ( m_stackWithPhaseColors() )
|
||||
if ( curve->stackWithPhaseColors() )
|
||||
{
|
||||
curve->assignStackColor( stackIndex, curvePhaseCount[curve->phaseType()] );
|
||||
}
|
||||
|
||||
@@ -253,6 +253,8 @@ private:
|
||||
void curveDataChanged( const caf::SignalEmitter* emitter );
|
||||
void curveVisibilityChanged( const caf::SignalEmitter* emitter, bool visible );
|
||||
void curveAppearanceChanged( const caf::SignalEmitter* emitter );
|
||||
void curveStackingChanged( const caf::SignalEmitter* emitter, bool stacked );
|
||||
void curveStackingColorsChanged( const caf::SignalEmitter* emitter, bool stackWithPhaseColors );
|
||||
|
||||
QList<caf::PdmOptionItemInfo> calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions,
|
||||
bool* useOptionsOnly ) override;
|
||||
@@ -311,8 +313,6 @@ private:
|
||||
caf::PdmField<double> m_visibleDepthRangeMin;
|
||||
caf::PdmField<double> m_visibleDepthRangeMax;
|
||||
|
||||
caf::PdmField<bool> m_stackCurves;
|
||||
caf::PdmField<bool> m_stackWithPhaseColors;
|
||||
caf::PdmField<bool> m_isAutoScaleXEnabled;
|
||||
caf::PdmField<bool> m_isLogarithmicScaleEnabled;
|
||||
caf::PdmField<RimWellLogPlot::AxisGridEnum> m_xAxisGridVisibility;
|
||||
|
||||
@@ -72,6 +72,7 @@
|
||||
#include <QRectF>
|
||||
#include <QString>
|
||||
|
||||
#include <algorithm>
|
||||
#include <limits>
|
||||
#include <set>
|
||||
|
||||
@@ -528,6 +529,23 @@ RimSummaryCurveCollection* RimSummaryPlot::summaryCurveCollection() const
|
||||
return m_summaryCurveCollection();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<RimSummaryCurve*> RimSummaryPlot::visibleStackedSummaryCurvesForAxis( RiaDefines::PlotAxis plotAxis )
|
||||
{
|
||||
auto visibleCurves = visibleSummaryCurvesForAxis( plotAxis );
|
||||
|
||||
std::vector<RimSummaryCurve*> visibleStackedCurves;
|
||||
|
||||
std::copy_if( visibleCurves.begin(),
|
||||
visibleCurves.end(),
|
||||
std::back_inserter( visibleStackedCurves ),
|
||||
[]( RimSummaryCurve* curve ) { return curve->stacked(); } );
|
||||
|
||||
return visibleStackedCurves;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -1352,8 +1370,8 @@ void RimSummaryPlot::childFieldChangedByUi( const caf::PdmFieldHandle* changedCh
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSummaryPlot::updateStackedCurveData()
|
||||
{
|
||||
if ( m_leftYAxisProperties->stackCurves() ) updateStackedCurveDataForAxis( RiaDefines::PlotAxis::PLOT_AXIS_LEFT );
|
||||
if ( m_rightYAxisProperties->stackCurves() ) updateStackedCurveDataForAxis( RiaDefines::PlotAxis::PLOT_AXIS_RIGHT );
|
||||
updateStackedCurveDataForAxis( RiaDefines::PlotAxis::PLOT_AXIS_LEFT );
|
||||
updateStackedCurveDataForAxis( RiaDefines::PlotAxis::PLOT_AXIS_RIGHT );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -1361,12 +1379,14 @@ void RimSummaryPlot::updateStackedCurveData()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSummaryPlot::updateStackedCurveDataForAxis( RiaDefines::PlotAxis plotAxis )
|
||||
{
|
||||
RimPlotAxisProperties* axisProperties = yAxisPropertiesLeftOrRight( plotAxis );
|
||||
|
||||
std::map<RiaDefines::PhaseType, size_t> curvePhaseCount;
|
||||
|
||||
auto stackedCurves = visibleStackedSummaryCurvesForAxis( plotAxis );
|
||||
|
||||
if ( stackedCurves.size() <= 1u ) return; // No point in stacking if there's less than two curves
|
||||
|
||||
// Reset all curves
|
||||
for ( RimSummaryCurve* curve : visibleSummaryCurvesForAxis( plotAxis ) )
|
||||
for ( RimSummaryCurve* curve : stackedCurves )
|
||||
{
|
||||
// Apply a area filled style if it isn't already set
|
||||
if ( curve->fillStyle() == Qt::NoBrush )
|
||||
@@ -1379,13 +1399,12 @@ void RimSummaryPlot::updateStackedCurveDataForAxis( RiaDefines::PlotAxis plotAxi
|
||||
curvePhaseCount[curve->phaseType()]++;
|
||||
}
|
||||
|
||||
if ( axisProperties->stackCurves() )
|
||||
{
|
||||
// Z-position of curve, to draw them in correct order
|
||||
double zPos = -10000.0;
|
||||
|
||||
std::vector<time_t> allTimeSteps;
|
||||
for ( RimSummaryCurve* curve : visibleSummaryCurvesForAxis( plotAxis ) )
|
||||
for ( RimSummaryCurve* curve : stackedCurves )
|
||||
{
|
||||
allTimeSteps.insert( allTimeSteps.end(), curve->timeStepsY().begin(), curve->timeStepsY().end() );
|
||||
}
|
||||
@@ -1395,7 +1414,7 @@ void RimSummaryPlot::updateStackedCurveDataForAxis( RiaDefines::PlotAxis plotAxi
|
||||
std::vector<double> allStackedValues( allTimeSteps.size(), 0.0 );
|
||||
|
||||
size_t stackIndex = 0u;
|
||||
for ( RimSummaryCurve* curve : visibleSummaryCurvesForAxis( plotAxis ) )
|
||||
for ( RimSummaryCurve* curve : stackedCurves )
|
||||
{
|
||||
for ( size_t i = 0; i < allTimeSteps.size(); ++i )
|
||||
{
|
||||
@@ -1408,7 +1427,7 @@ void RimSummaryPlot::updateStackedCurveDataForAxis( RiaDefines::PlotAxis plotAxi
|
||||
|
||||
curve->setOverrideCurveDataY( allTimeSteps, allStackedValues );
|
||||
curve->setZOrder( zPos );
|
||||
if ( axisProperties->stackWithPhaseColors() )
|
||||
if ( curve->stackWithPhaseColors() )
|
||||
{
|
||||
curve->assignStackColor( stackIndex, curvePhaseCount[curve->phaseType()] );
|
||||
}
|
||||
@@ -1597,6 +1616,8 @@ void RimSummaryPlot::connectCurveSignals( RimSummaryCurve* curve )
|
||||
curve->dataChanged.connect( this, &RimSummaryPlot::curveDataChanged );
|
||||
curve->visibilityChanged.connect( this, &RimSummaryPlot::curveVisibilityChanged );
|
||||
curve->appearanceChanged.connect( this, &RimSummaryPlot::curveAppearanceChanged );
|
||||
curve->stackingChanged.connect( this, &RimSummaryPlot::curveStackingChanged );
|
||||
curve->stackingColorsChanged.connect( this, &RimSummaryPlot::curveStackingColorsChanged );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -1607,6 +1628,8 @@ void RimSummaryPlot::disconnectCurveSignals( RimSummaryCurve* curve )
|
||||
curve->dataChanged.disconnect( this );
|
||||
curve->visibilityChanged.disconnect( this );
|
||||
curve->appearanceChanged.disconnect( this );
|
||||
curve->stackingChanged.disconnect( this );
|
||||
curve->stackingColorsChanged.disconnect( this );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -1636,6 +1659,22 @@ void RimSummaryPlot::curveAppearanceChanged( const caf::SignalEmitter* emitter )
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSummaryPlot::curveStackingChanged( const caf::SignalEmitter* emitter, bool stacked )
|
||||
{
|
||||
updateStackedCurveData();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSummaryPlot::curveStackingColorsChanged( const caf::SignalEmitter* emitter, bool stackWithPhaseColors )
|
||||
{
|
||||
updateStackedCurveData();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -1643,8 +1682,6 @@ void RimSummaryPlot::connectAxisSignals( RimPlotAxisProperties* axis )
|
||||
{
|
||||
axis->settingsChanged.connect( this, &RimSummaryPlot::axisSettingsChanged );
|
||||
axis->logarithmicChanged.connect( this, &RimSummaryPlot::axisLogarithmicChanged );
|
||||
axis->stackingChanged.connect( this, &RimSummaryPlot::axisStackingChanged );
|
||||
axis->stackingColorsChanged.connect( this, &RimSummaryPlot::axisStackingColorsChanged );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -1663,30 +1700,6 @@ void RimSummaryPlot::axisLogarithmicChanged( const caf::SignalEmitter* emitter,
|
||||
loadDataAndUpdate();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSummaryPlot::axisStackingChanged( const caf::SignalEmitter* emitter, bool stackCurves )
|
||||
{
|
||||
auto axisProps = dynamic_cast<const RimPlotAxisProperties*>( emitter );
|
||||
if ( axisProps )
|
||||
{
|
||||
updateStackedCurveDataForAxis( axisProps->plotAxisType() );
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSummaryPlot::axisStackingColorsChanged( const caf::SignalEmitter* emitter, bool stackWithPhaseColors )
|
||||
{
|
||||
auto axisProps = dynamic_cast<const RimPlotAxisProperties*>( emitter );
|
||||
if ( axisProps )
|
||||
{
|
||||
updateStackedCurveDataForAxis( axisProps->plotAxisType() );
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -215,6 +215,7 @@ private:
|
||||
std::vector<RimGridTimeHistoryCurve*> visibleTimeHistoryCurvesForAxis( RiaDefines::PlotAxis plotAxis ) const;
|
||||
std::vector<RimAsciiDataCurve*> visibleAsciiDataCurvesForAxis( RiaDefines::PlotAxis plotAxis ) const;
|
||||
bool hasVisibleCurvesForAxis( RiaDefines::PlotAxis plotAxis ) const;
|
||||
std::vector<RimSummaryCurve*> visibleStackedSummaryCurvesForAxis( RiaDefines::PlotAxis plotAxis );
|
||||
|
||||
RimPlotAxisProperties* yAxisPropertiesLeftOrRight( RiaDefines::PlotAxis leftOrRightPlotAxis ) const;
|
||||
void updateYAxis( RiaDefines::PlotAxis plotAxis );
|
||||
@@ -234,12 +235,12 @@ private:
|
||||
void curveDataChanged( const caf::SignalEmitter* emitter );
|
||||
void curveVisibilityChanged( const caf::SignalEmitter* emitter, bool visible );
|
||||
void curveAppearanceChanged( const caf::SignalEmitter* emitter );
|
||||
void curveStackingChanged( const caf::SignalEmitter* emitter, bool stacked );
|
||||
void curveStackingColorsChanged( const caf::SignalEmitter* emitter, bool stackWithPhaseColors );
|
||||
|
||||
void connectAxisSignals( RimPlotAxisProperties* axis );
|
||||
void axisSettingsChanged( const caf::SignalEmitter* emitter );
|
||||
void axisLogarithmicChanged( const caf::SignalEmitter* emitter, bool isLogarithmic );
|
||||
void axisStackingChanged( const caf::SignalEmitter* emitter, bool stackCurves );
|
||||
void axisStackingColorsChanged( const caf::SignalEmitter* emitter, bool stackWithPhaseColors );
|
||||
|
||||
private:
|
||||
caf::PdmField<bool> m_normalizeCurveYValues;
|
||||
|
||||
Reference in New Issue
Block a user