mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#6843 Grid Cross Plot : Render discrete colors, not continous
This commit is contained in:
@@ -1890,6 +1890,7 @@ void RimEclipseResultDefinition::updateRangesForExplicitLegends( RimRegularLegen
|
||||
if ( !eclipseCaseData ) return;
|
||||
|
||||
RigCaseCellResultsData* cellResultsData = eclipseCaseData->results( this->porosityModel() );
|
||||
cellResultsData->ensureKnownResultLoaded( this->eclipseResultAddress() );
|
||||
|
||||
double globalMin, globalMax;
|
||||
double globalPosClosestToZero, globalNegClosestToZero;
|
||||
|
||||
@@ -17,6 +17,8 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
#include "RiuScalarMapperLegendFrame.h"
|
||||
|
||||
#include "cvfScalarMapperDiscreteLinear.h"
|
||||
#include "cvfScalarMapperDiscreteLog.h"
|
||||
#include "cvfString.h"
|
||||
#include "cvfqtUtils.h"
|
||||
|
||||
@@ -162,8 +164,16 @@ void RiuScalarMapperLegendFrame::renderRect( QPainter* painter, const LayoutInfo
|
||||
int rectIndexFromBottom = rectCount() - rectIndex - 1;
|
||||
cvf::Color3ub startColor = m_scalarMapper->mapToColor( m_tickValues[rectIndexFromBottom] );
|
||||
cvf::Color3ub endColor = m_scalarMapper->mapToColor( m_tickValues[rectIndexFromBottom + 1] );
|
||||
QColor startQColor( startColor.r(), startColor.g(), startColor.b() );
|
||||
QColor endQColor( endColor.r(), endColor.g(), endColor.b() );
|
||||
|
||||
if ( dynamic_cast<const cvf::ScalarMapperDiscreteLog*>( m_scalarMapper.p() ) ||
|
||||
dynamic_cast<const cvf::ScalarMapperDiscreteLinear*>( m_scalarMapper.p() ) )
|
||||
{
|
||||
// Do not draw gradient for discrete legends
|
||||
endColor = startColor;
|
||||
}
|
||||
|
||||
QColor startQColor( startColor.r(), startColor.g(), startColor.b() );
|
||||
QColor endQColor( endColor.r(), endColor.g(), endColor.b() );
|
||||
|
||||
QRectF gradientRect( QPointF( layout.tickStartX,
|
||||
layout.colorBarRect.bottom() - layout.tickYPixelPos[rectIndexFromBottom] + 1 ),
|
||||
|
||||
Reference in New Issue
Block a user