mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Area Fill: Fix are fill issue related to stacking of curves
This commit is contained in:
@@ -1027,7 +1027,7 @@ void RimPlotCurve::updateCurveAppearance()
|
||||
QColor fillColor = RiaColorTools::toQColor( m_curveAppearance->fillColor() );
|
||||
|
||||
fillColor = RiaColorTools::blendQColors( fillColor, QColor( Qt::white ), 3, 1 );
|
||||
QBrush fillBrush( fillColor, m_curveAppearance->fillStyle() );
|
||||
QBrush fillBrush( fillColor, fillStyle() );
|
||||
m_plotCurve->setAppearance( m_curveAppearance->lineStyle(),
|
||||
m_curveAppearance->interpolation(),
|
||||
m_curveAppearance->lineThickness(),
|
||||
|
||||
@@ -76,7 +76,7 @@ public:
|
||||
void setSymbolSize( int sizeInPixels );
|
||||
void setLineThickness( int thickness );
|
||||
void resetAppearance();
|
||||
Qt::BrushStyle fillStyle() const;
|
||||
virtual Qt::BrushStyle fillStyle() const;
|
||||
void setFillStyle( Qt::BrushStyle brushStyle );
|
||||
void setFillColor( const cvf::Color3f& fillColor );
|
||||
|
||||
|
||||
@@ -108,7 +108,6 @@ void RimStackablePlotCurve::setIsStacked( bool stacked )
|
||||
{
|
||||
m_isStacked = stacked;
|
||||
|
||||
updateStackingAppearance();
|
||||
stackingChanged.send( m_isStacked() );
|
||||
}
|
||||
|
||||
@@ -121,7 +120,6 @@ void RimStackablePlotCurve::fieldChangedByUi( const caf::PdmFieldHandle* changed
|
||||
|
||||
if ( changedField == &m_isStacked )
|
||||
{
|
||||
updateStackingAppearance();
|
||||
stackingChanged.send( m_isStacked() );
|
||||
}
|
||||
else if ( changedField == &m_isStackedWithPhaseColors )
|
||||
@@ -171,21 +169,11 @@ void RimStackablePlotCurve::defaultUiOrdering( caf::PdmUiOrdering& uiOrdering )
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimStackablePlotCurve::updateCurveAppearance()
|
||||
Qt::BrushStyle RimStackablePlotCurve::fillStyle() const
|
||||
{
|
||||
updateStackingAppearance();
|
||||
auto selectedFillStyle = RimPlotCurve::fillStyle();
|
||||
|
||||
RimPlotCurve::updateCurveAppearance();
|
||||
}
|
||||
if ( m_isStacked() && selectedFillStyle == Qt::NoBrush ) return Qt::SolidPattern;
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimStackablePlotCurve::updateStackingAppearance()
|
||||
{
|
||||
if ( !m_isStacked() && fillStyle() != Qt::NoBrush )
|
||||
{
|
||||
// Switch off area fill when turning off stacking.
|
||||
setFillStyle( Qt::NoBrush );
|
||||
}
|
||||
return selectedFillStyle;
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ public:
|
||||
bool isStacked() const;
|
||||
bool isStackedWithPhaseColors() const;
|
||||
void setIsStacked( bool stacked );
|
||||
void updateCurveAppearance() override;
|
||||
Qt::BrushStyle fillStyle() const override;
|
||||
|
||||
void defaultUiOrdering( caf::PdmUiOrdering& uiOrdering );
|
||||
void stackingUiOrdering( caf::PdmUiOrdering& uiOrdering );
|
||||
@@ -44,7 +44,6 @@ protected:
|
||||
|
||||
private:
|
||||
void onFillColorChanged( const caf::SignalEmitter* emitter ) override;
|
||||
void updateStackingAppearance();
|
||||
|
||||
protected:
|
||||
caf::PdmField<bool> m_isStacked;
|
||||
|
||||
@@ -1831,12 +1831,6 @@ bool RimSummaryPlot::updateStackedCurveDataForAxis( RiuPlotAxis plotAxis )
|
||||
std::map<RiaDefines::PhaseType, size_t> curvePhaseCount;
|
||||
for ( RimSummaryCurve* curve : stackedCurves )
|
||||
{
|
||||
// Apply a area filled style if it isn't already set
|
||||
if ( curve->fillStyle() == Qt::NoBrush )
|
||||
{
|
||||
curve->setFillStyle( Qt::SolidPattern );
|
||||
}
|
||||
|
||||
curve->loadDataAndUpdate( false );
|
||||
|
||||
curvePhaseCount[curve->phaseType()]++;
|
||||
|
||||
Reference in New Issue
Block a user