#5472 Improve visualisation of water depth

This commit is contained in:
Gaute Lindkvist 2020-02-07 15:20:19 +01:00
parent dfe6d0b94e
commit 2949d3458d
4 changed files with 17 additions and 10 deletions

View File

@ -491,7 +491,7 @@ const caf::ColorTable& RiaColorTables::waterAndRockPaletteColors()
{
static std::vector<cvf::Color3ub> colors{
cvf::Color3ub( 127, 205, 255 ), // Sea Blue
cvf::Color3ub( 220, 220, 220 ) // Light Gray
cvf::Color3ub( 100, 100, 100 ) // Gray
};
static caf::ColorTable colorTable = caf::ColorTable( colors );

View File

@ -2324,13 +2324,15 @@ void RimWellLogTrack::updateFormationNamesOnPlot()
const std::vector<std::pair<double, double>> waterAndRockIntervals = waterAndRockRegions( plot->depthType(),
extractor );
m_annotationTool->attachNamedRegions( m_plotWidget,
{"Water", ""},
{"Surface", "Seabed"},
xRange,
waterAndRockIntervals,
m_regionAnnotationDisplay(),
waterAndRockColors,
( ( 100 - m_colorShadingTransparency ) * 255 ) / 100,
m_showRegionLabels() );
m_showRegionLabels(),
RiuPlotAnnotationTool::LEFT_COLUMN,
{Qt::SolidPattern, Qt::Dense6Pattern} );
if ( m_formationSource == CASE )
{

View File

@ -50,7 +50,8 @@ void RiuPlotAnnotationTool::attachNamedRegions( QwtPlot*
const caf::ColorTable& colorTable,
int shadingAlphaByte,
bool showNames /*= true */,
TrackSpan trackSpan /*= FULL_WIDTH*/ )
TrackSpan trackSpan /*= FULL_WIDTH*/,
const std::vector<Qt::BrushStyle>& brushStyles /* = {}*/ )
{
if ( names.size() != yPositions.size() ) return;
m_plot = plot;
@ -66,12 +67,10 @@ void RiuPlotAnnotationTool::attachNamedRegions( QwtPlot*
for ( size_t i = 0; i < names.size(); i++ )
{
if ( names[i].isEmpty() ) continue;
QwtPlotMarker* line( new QwtPlotMarker() );
QString name;
if ( showNames )
if ( showNames && !names[i].isEmpty() )
{
name = names[i];
if ( ( regionDisplay & COLOR_SHADING ) == 0 && names[i].toLower().indexOf( "top" ) == -1 )
@ -88,7 +87,12 @@ void RiuPlotAnnotationTool::attachNamedRegions( QwtPlot*
shading->setOrientation( Qt::Horizontal );
shading->setInterval( yPositions[i].first, yPositions[i].second );
shading->setPen( shadingColor, 0.0, Qt::NoPen );
shading->setBrush( QBrush( shadingColor ) );
QBrush brush( shadingColor );
if ( i < brushStyles.size() )
{
brush.setStyle( brushStyles[i] );
}
shading->setBrush( brush );
shading->attach( m_plot );
shading->setZ( -100.0 );
shading->setXAxis( QwtPlot::xTop );

View File

@ -66,8 +66,9 @@ public:
RegionDisplay regionDisplay,
const caf::ColorTable& colorTable,
int shadingAlphaByte,
bool showNames = true,
TrackSpan trackSpan = FULL_WIDTH );
bool showNames = true,
TrackSpan trackSpan = FULL_WIDTH,
const std::vector<Qt::BrushStyle>& brushStyles = {} );
void attachWellPicks( QwtPlot* plot, const std::vector<QString>& names, const std::vector<double>& yPositions );
void attachAnnotationLine( QwtPlot* plot, const QColor& color, const QString& annotationText, const double yPosition );