#7333 Well Log Plot: Improve Stack Curve with Phase Colors

Improve curve colors when only one curve of a given phase is displayed
Make sure to call the base class directly above current inheritance level
Improve colors
This commit is contained in:
Magne Sjaastad
2021-02-22 08:38:20 +01:00
parent 93a3060757
commit 084835ce66
9 changed files with 91 additions and 15 deletions

View File

@@ -46,16 +46,33 @@ RiaDefines::PhaseType RimStackablePlotCurve::phaseType() const
//--------------------------------------------------------------------------------------------------
void RimStackablePlotCurve::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 );
cvf::Color3f curveColor( cvf::Color3::BROWN );
auto color = interpolatedPhaseColors.cycledColor3f( index );
this->setColor( color );
this->setFillColor( color );
if ( count == 1 )
{
curveColor = RiaColorTables::phaseColor( phaseType() );
}
else
{
auto allPhaseColors = RiaColorTables::phaseColors();
auto it = allPhaseColors.find( phaseType() );
if ( it != allPhaseColors.end() )
{
caf::ColorTable interpolatedPhaseColors = it->second.interpolated( count );
curveColor = interpolatedPhaseColors.cycledColor3f( index );
}
}
m_fillColor = curveColor;
{
auto moreSaturatedColor = RiaColorTools::toQColor( curveColor );
moreSaturatedColor = RiaColorTools::modifySaturation( moreSaturatedColor, 1.2 );
m_curveColor = RiaColorTools::fromQColorTo3f( moreSaturatedColor );
}
this->updateCurveAppearance();
}

View File

@@ -312,9 +312,15 @@ void RimWellLogCurve::fieldChangedByUi( const caf::PdmFieldHandle* changedField,
const QVariant& oldValue,
const QVariant& newValue )
{
RimPlotCurve::fieldChangedByUi( changedField, oldValue, newValue );
RimStackablePlotCurve::fieldChangedByUi( changedField, oldValue, newValue );
if ( changedField == &m_showCurve && m_showCurve() )
{
updateZoomInParentPlot();
}
if ( changedField == &m_isStacked )
{
loadDataAndUpdate( true );
}
}

View File

@@ -2027,6 +2027,7 @@ void RimWellLogTrack::connectCurveSignals( RimWellLogCurve* curve )
curve->visibilityChanged.connect( this, &RimWellLogTrack::curveVisibilityChanged );
curve->appearanceChanged.connect( this, &RimWellLogTrack::curveAppearanceChanged );
curve->stackingChanged.connect( this, &RimWellLogTrack::curveStackingChanged );
curve->stackingColorsChanged.connect( this, &RimWellLogTrack::curveStackingChanged );
}
//--------------------------------------------------------------------------------------------------