mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#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:
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
@@ -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 );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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 );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user