mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Show well completion annotations in horizontal plots (#9193)
This commit is contained in:
parent
613ab6279d
commit
4b1a6b48a5
@ -77,6 +77,28 @@ bool RiaDefines::isVertical( RiaDefines::PlotAxis axis )
|
|||||||
return ( axis == RiaDefines::PlotAxis::PLOT_AXIS_LEFT || axis == RiaDefines::PlotAxis::PLOT_AXIS_RIGHT );
|
return ( axis == RiaDefines::PlotAxis::PLOT_AXIS_LEFT || axis == RiaDefines::PlotAxis::PLOT_AXIS_RIGHT );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
RiaDefines::PlotAxis RiaDefines::opposite( PlotAxis axis )
|
||||||
|
{
|
||||||
|
switch ( axis )
|
||||||
|
{
|
||||||
|
case RiaDefines::PlotAxis::PLOT_AXIS_BOTTOM:
|
||||||
|
return RiaDefines::PlotAxis::PLOT_AXIS_TOP;
|
||||||
|
case RiaDefines::PlotAxis::PLOT_AXIS_TOP:
|
||||||
|
return RiaDefines::PlotAxis::PLOT_AXIS_BOTTOM;
|
||||||
|
case RiaDefines::PlotAxis::PLOT_AXIS_LEFT:
|
||||||
|
return RiaDefines::PlotAxis::PLOT_AXIS_RIGHT;
|
||||||
|
case RiaDefines::PlotAxis::PLOT_AXIS_RIGHT:
|
||||||
|
return RiaDefines::PlotAxis::PLOT_AXIS_LEFT;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Should never come here
|
||||||
|
CVF_ASSERT( false );
|
||||||
|
return {};
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
@ -63,8 +63,9 @@ double minimumDefaultValuePlot();
|
|||||||
double minimumDefaultLogValuePlot();
|
double minimumDefaultLogValuePlot();
|
||||||
double maximumDefaultValuePlot();
|
double maximumDefaultValuePlot();
|
||||||
|
|
||||||
bool isHorizontal( PlotAxis axis );
|
bool isHorizontal( PlotAxis axis );
|
||||||
bool isVertical( PlotAxis axis );
|
bool isVertical( PlotAxis axis );
|
||||||
|
PlotAxis opposite( PlotAxis axis );
|
||||||
|
|
||||||
double scalingFactor( QPaintDevice* paintDevice );
|
double scalingFactor( QPaintDevice* paintDevice );
|
||||||
|
|
||||||
|
@ -1222,10 +1222,17 @@ RimDepthTrackPlot::DepthOrientation RimDepthTrackPlot::depthOrientation() const
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
RiuPlotAxis RimDepthTrackPlot::depthAxis() const
|
RiuPlotAxis RimDepthTrackPlot::depthAxis() const
|
||||||
{
|
{
|
||||||
if ( m_depthOrientation() == RimDepthTrackPlot::DepthOrientation::VERTICAL )
|
return depthAxis( m_depthOrientation() );
|
||||||
return RiuPlotAxis::defaultLeft();
|
}
|
||||||
else
|
|
||||||
return RiuPlotAxis::defaultBottom();
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
RiuPlotAxis RimDepthTrackPlot::depthAxis( DepthOrientation depthOrientation )
|
||||||
|
{
|
||||||
|
if ( depthOrientation == RimDepthTrackPlot::DepthOrientation::VERTICAL ) return RiuPlotAxis::defaultLeft();
|
||||||
|
|
||||||
|
return RiuPlotAxis::defaultBottom();
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@ -1233,10 +1240,37 @@ RiuPlotAxis RimDepthTrackPlot::depthAxis() const
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
RiuPlotAxis RimDepthTrackPlot::valueAxis() const
|
RiuPlotAxis RimDepthTrackPlot::valueAxis() const
|
||||||
{
|
{
|
||||||
if ( m_depthOrientation() == RimDepthTrackPlot::DepthOrientation::VERTICAL )
|
return valueAxis( m_depthOrientation() );
|
||||||
return RiuPlotAxis::defaultTop();
|
}
|
||||||
else
|
|
||||||
return RiuPlotAxis::defaultLeft();
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
RiuPlotAxis RimDepthTrackPlot::valueAxis( DepthOrientation depthOrientation )
|
||||||
|
{
|
||||||
|
if ( depthOrientation == RimDepthTrackPlot::DepthOrientation::VERTICAL ) return RiuPlotAxis::defaultTop();
|
||||||
|
|
||||||
|
return RiuPlotAxis::defaultLeft();
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
RiuPlotAxis RimDepthTrackPlot::annotationAxis() const
|
||||||
|
{
|
||||||
|
return annotationAxis( m_depthOrientation() );
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
RiuPlotAxis RimDepthTrackPlot::annotationAxis( DepthOrientation depthOrientation )
|
||||||
|
{
|
||||||
|
auto riuAxis = valueAxis( depthOrientation );
|
||||||
|
|
||||||
|
auto oppositeAxis = RiaDefines::opposite( riuAxis.axis() );
|
||||||
|
|
||||||
|
return RiuPlotAxis( oppositeAxis );
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
@ -107,6 +107,7 @@ public:
|
|||||||
RimDepthTrackPlot::DepthOrientation depthOrientation() const;
|
RimDepthTrackPlot::DepthOrientation depthOrientation() const;
|
||||||
RiuPlotAxis depthAxis() const;
|
RiuPlotAxis depthAxis() const;
|
||||||
RiuPlotAxis valueAxis() const;
|
RiuPlotAxis valueAxis() const;
|
||||||
|
RiuPlotAxis annotationAxis() const;
|
||||||
|
|
||||||
void setAutoScalePropertyValuesEnabled( bool enabled );
|
void setAutoScalePropertyValuesEnabled( bool enabled );
|
||||||
void setAutoScaleDepthValuesEnabled( bool enabled );
|
void setAutoScaleDepthValuesEnabled( bool enabled );
|
||||||
@ -149,6 +150,10 @@ public:
|
|||||||
bool isFirstVisibleTrack( RimWellLogTrack* track );
|
bool isFirstVisibleTrack( RimWellLogTrack* track );
|
||||||
bool isLastVisibleTrack( RimWellLogTrack* track );
|
bool isLastVisibleTrack( RimWellLogTrack* track );
|
||||||
|
|
||||||
|
static RiuPlotAxis depthAxis( DepthOrientation depthOrientation );
|
||||||
|
static RiuPlotAxis valueAxis( DepthOrientation depthOrientation );
|
||||||
|
static RiuPlotAxis annotationAxis( DepthOrientation depthOrientation );
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
QImage snapshotWindowContent() override;
|
QImage snapshotWindowContent() override;
|
||||||
|
|
||||||
|
@ -452,7 +452,7 @@ void RimWellLogTrack::calculateDepthZoomRange()
|
|||||||
{
|
{
|
||||||
double minObjectDepth = HUGE_VAL;
|
double minObjectDepth = HUGE_VAL;
|
||||||
double maxObjectDepth = -HUGE_VAL;
|
double maxObjectDepth = -HUGE_VAL;
|
||||||
if ( plotObject->yValueRange( &minObjectDepth, &maxObjectDepth ) )
|
if ( plotObject->depthValueRange( &minObjectDepth, &maxObjectDepth ) )
|
||||||
{
|
{
|
||||||
if ( minObjectDepth < minDepth )
|
if ( minObjectDepth < minDepth )
|
||||||
{
|
{
|
||||||
@ -522,7 +522,7 @@ void RimWellLogTrack::updatePropertyValueZoom()
|
|||||||
{
|
{
|
||||||
m_plotWidget->setAxisRange( RiuPlotAxis::defaultBottom(), componentRangeMin, componentRangeMax );
|
m_plotWidget->setAxisRange( RiuPlotAxis::defaultBottom(), componentRangeMin, componentRangeMax );
|
||||||
}
|
}
|
||||||
else if ( wellLogPlot->depthOrientation() == RimDepthTrackPlot::DepthOrientation::VERTICAL )
|
else
|
||||||
{
|
{
|
||||||
m_plotWidget->setAxisRange( RiuPlotAxis::defaultRight(), componentRangeMin, componentRangeMax );
|
m_plotWidget->setAxisRange( RiuPlotAxis::defaultRight(), componentRangeMin, componentRangeMax );
|
||||||
}
|
}
|
||||||
@ -3258,11 +3258,13 @@ void RimWellLogTrack::updateWellPathAttributesOnPlot()
|
|||||||
|
|
||||||
RimDepthTrackPlot* wellLogPlot;
|
RimDepthTrackPlot* wellLogPlot;
|
||||||
this->firstAncestorOrThisOfTypeAsserted( wellLogPlot );
|
this->firstAncestorOrThisOfTypeAsserted( wellLogPlot );
|
||||||
RimWellLogPlot::DepthTypeEnum depthType = wellLogPlot->depthType();
|
RimWellLogPlot::DepthTypeEnum depthType = wellLogPlot->depthType();
|
||||||
|
auto depthOrientation = wellLogPlot->depthOrientation();
|
||||||
|
|
||||||
for ( auto& attributePlotObject : m_wellPathAttributePlotObjects )
|
for ( auto& attributePlotObject : m_wellPathAttributePlotObjects )
|
||||||
{
|
{
|
||||||
attributePlotObject->setDepthType( depthType );
|
attributePlotObject->setDepthType( depthType );
|
||||||
|
attributePlotObject->setDepthOrientation( depthOrientation );
|
||||||
attributePlotObject->setShowLabel( m_showWellPathComponentLabels() );
|
attributePlotObject->setShowLabel( m_showWellPathComponentLabels() );
|
||||||
attributePlotObject->loadDataAndUpdate( false );
|
attributePlotObject->loadDataAndUpdate( false );
|
||||||
attributePlotObject->setParentPlotNoReplot( m_plotWidget->qwtPlot() );
|
attributePlotObject->setParentPlotNoReplot( m_plotWidget->qwtPlot() );
|
||||||
|
@ -60,7 +60,8 @@ public:
|
|||||||
SYMBOL_STAR2,
|
SYMBOL_STAR2,
|
||||||
SYMBOL_HEXAGON,
|
SYMBOL_HEXAGON,
|
||||||
SYMBOL_LEFT_TRIANGLE,
|
SYMBOL_LEFT_TRIANGLE,
|
||||||
SYMBOL_RIGHT_TRIANGLE
|
SYMBOL_RIGHT_TRIANGLE,
|
||||||
|
SYMBOL_DOWN_ALIGNED_TRIANGLE
|
||||||
};
|
};
|
||||||
|
|
||||||
RiuPlotCurveSymbol( PointSymbolEnum riuStyle,
|
RiuPlotCurveSymbol( PointSymbolEnum riuStyle,
|
||||||
|
@ -61,6 +61,18 @@ RiuQwtSymbol::RiuQwtSymbol( PointSymbolEnum riuStyle, const QString& label, Labe
|
|||||||
case SYMBOL_DOWN_TRIANGLE:
|
case SYMBOL_DOWN_TRIANGLE:
|
||||||
style = QwtSymbol::DTriangle;
|
style = QwtSymbol::DTriangle;
|
||||||
break;
|
break;
|
||||||
|
case SYMBOL_DOWN_ALIGNED_TRIANGLE:
|
||||||
|
style = QwtSymbol::Path;
|
||||||
|
{
|
||||||
|
QPainterPath path;
|
||||||
|
path.moveTo( 0, 0 );
|
||||||
|
path.lineTo( 0, -10 );
|
||||||
|
path.lineTo( -10, -10 );
|
||||||
|
path.lineTo( 0, 0 );
|
||||||
|
setPath( path );
|
||||||
|
setPinPoint( QPointF( 0, -10 ) );
|
||||||
|
}
|
||||||
|
break;
|
||||||
case SYMBOL_LEFT_ALIGNED_TRIANGLE:
|
case SYMBOL_LEFT_ALIGNED_TRIANGLE:
|
||||||
style = QwtSymbol::Path;
|
style = QwtSymbol::Path;
|
||||||
{
|
{
|
||||||
|
@ -20,7 +20,9 @@
|
|||||||
|
|
||||||
#include "RiaColorTables.h"
|
#include "RiaColorTables.h"
|
||||||
#include "RiaColorTools.h"
|
#include "RiaColorTools.h"
|
||||||
|
#include "RiaPlotDefines.h"
|
||||||
|
|
||||||
|
#include "RimDepthTrackPlot.h"
|
||||||
#include "RimFishbones.h"
|
#include "RimFishbones.h"
|
||||||
#include "RimFracture.h"
|
#include "RimFracture.h"
|
||||||
#include "RimFractureTemplate.h"
|
#include "RimFractureTemplate.h"
|
||||||
@ -33,6 +35,7 @@
|
|||||||
#include "RimWellPathValve.h"
|
#include "RimWellPathValve.h"
|
||||||
|
|
||||||
#include "RigWellPath.h"
|
#include "RigWellPath.h"
|
||||||
|
#include "RiuPlotAxis.h"
|
||||||
#include "RiuQwtPlotTools.h"
|
#include "RiuQwtPlotTools.h"
|
||||||
|
|
||||||
#include "qwt_plot.h"
|
#include "qwt_plot.h"
|
||||||
@ -51,6 +54,7 @@ RiuWellPathComponentPlotItem::RiuWellPathComponentPlotItem( const RimWellPath* w
|
|||||||
, m_componentType( RiaDefines::WellPathComponentType::WELL_PATH )
|
, m_componentType( RiaDefines::WellPathComponentType::WELL_PATH )
|
||||||
, m_columnOffset( 0.0 )
|
, m_columnOffset( 0.0 )
|
||||||
, m_depthType( RiaDefines::DepthTypeEnum::MEASURED_DEPTH )
|
, m_depthType( RiaDefines::DepthTypeEnum::MEASURED_DEPTH )
|
||||||
|
, m_depthOrientation( RimWellLogPlot::DepthOrientation::VERTICAL )
|
||||||
, m_maxColumnOffset( 0.0 )
|
, m_maxColumnOffset( 0.0 )
|
||||||
, m_showLabel( false )
|
, m_showLabel( false )
|
||||||
{
|
{
|
||||||
@ -181,8 +185,18 @@ void RiuWellPathComponentPlotItem::onLoadDataAndUpdate( bool updateParentPlot )
|
|||||||
double posMax = 0.75 + m_columnOffset;
|
double posMax = 0.75 + m_columnOffset;
|
||||||
addColumnFeature( -posMax, -posMin, startDepth, endDepth, componentColor() );
|
addColumnFeature( -posMax, -posMin, startDepth, endDepth, componentColor() );
|
||||||
addColumnFeature( posMin, posMax, startDepth, endDepth, componentColor() );
|
addColumnFeature( posMin, posMax, startDepth, endDepth, componentColor() );
|
||||||
addMarker( -posMax, endDepth, 12, RiuPlotCurveSymbol::SYMBOL_LEFT_ANGLED_TRIANGLE, componentColor() );
|
|
||||||
addMarker( posMax, endDepth, 12, RiuPlotCurveSymbol::SYMBOL_RIGHT_ANGLED_TRIANGLE, componentColor() );
|
if ( m_depthOrientation == RimWellLogPlot::DepthOrientation::VERTICAL )
|
||||||
|
{
|
||||||
|
addMarker( -posMax, endDepth, 12, RiuPlotCurveSymbol::SYMBOL_LEFT_ANGLED_TRIANGLE, componentColor() );
|
||||||
|
addMarker( posMax, endDepth, 12, RiuPlotCurveSymbol::SYMBOL_RIGHT_ANGLED_TRIANGLE, componentColor() );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
addMarker( -posMax, endDepth, 12, RiuPlotCurveSymbol::SYMBOL_DOWN_ALIGNED_TRIANGLE, componentColor() );
|
||||||
|
addMarker( posMax, endDepth, 12, RiuPlotCurveSymbol::SYMBOL_LEFT_ANGLED_TRIANGLE, componentColor() );
|
||||||
|
}
|
||||||
|
|
||||||
addMarker( casingTrackEnd,
|
addMarker( casingTrackEnd,
|
||||||
endDepth,
|
endDepth,
|
||||||
12,
|
12,
|
||||||
@ -209,18 +223,20 @@ void RiuWellPathComponentPlotItem::onLoadDataAndUpdate( bool updateParentPlot )
|
|||||||
const double markerSpacing = 30;
|
const double markerSpacing = 30;
|
||||||
const int markerSize = 6;
|
const int markerSize = 6;
|
||||||
double markerDepth = startDepth;
|
double markerDepth = startDepth;
|
||||||
|
|
||||||
|
auto plotSymbol1 = RiuPlotCurveSymbol::SYMBOL_LEFT_ALIGNED_TRIANGLE;
|
||||||
|
auto plotSymbol2 = RiuPlotCurveSymbol::SYMBOL_RIGHT_ALIGNED_TRIANGLE;
|
||||||
|
|
||||||
|
if ( m_depthOrientation == RimWellLogPlot::DepthOrientation::HORIZONTAL )
|
||||||
|
{
|
||||||
|
plotSymbol1 = RiuPlotCurveSymbol::SYMBOL_DOWN_TRIANGLE;
|
||||||
|
plotSymbol2 = RiuPlotCurveSymbol::SYMBOL_UP_TRIANGLE;
|
||||||
|
}
|
||||||
|
|
||||||
while ( markerDepth < endDepth - 5 )
|
while ( markerDepth < endDepth - 5 )
|
||||||
{
|
{
|
||||||
addMarker( -casingTrackEnd,
|
addMarker( -casingTrackEnd, markerDepth, markerSize, plotSymbol1, componentColor() );
|
||||||
markerDepth,
|
addMarker( casingTrackEnd, markerDepth, markerSize, plotSymbol2, componentColor() );
|
||||||
markerSize,
|
|
||||||
RiuPlotCurveSymbol::SYMBOL_LEFT_ALIGNED_TRIANGLE,
|
|
||||||
componentColor() );
|
|
||||||
addMarker( casingTrackEnd,
|
|
||||||
markerDepth,
|
|
||||||
markerSize,
|
|
||||||
RiuPlotCurveSymbol::SYMBOL_RIGHT_ALIGNED_TRIANGLE,
|
|
||||||
componentColor() );
|
|
||||||
|
|
||||||
markerDepth += markerSpacing;
|
markerDepth += markerSpacing;
|
||||||
}
|
}
|
||||||
@ -396,35 +412,36 @@ std::pair<double, double> RiuWellPathComponentPlotItem::depthsOfDepthType() cons
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RiuWellPathComponentPlotItem::addMarker( double posX,
|
void RiuWellPathComponentPlotItem::addMarker( double position,
|
||||||
double depth,
|
double depth,
|
||||||
int size,
|
int size,
|
||||||
RiuPlotCurveSymbol::PointSymbolEnum symbolType,
|
RiuPlotCurveSymbol::PointSymbolEnum symbolType,
|
||||||
cvf::Color4f baseColor,
|
cvf::Color4f baseColor,
|
||||||
const QString& label /*= QString("")*/,
|
const QString& label /*= QString( "" )*/,
|
||||||
Qt::Alignment labelAlignment /*= Qt::AlignTop*/,
|
Qt::Alignment labelAlignment /*= Qt::AlignVCenter | Qt::AlignRight*/,
|
||||||
Qt::Orientation labelOrientation /*= Qt::Vertical*/,
|
Qt::Orientation labelOrientation /*= Qt::Horizontal*/,
|
||||||
bool drawLine /*= false*/,
|
bool drawLine /*= false*/,
|
||||||
bool contrastTextColor /*= true*/ )
|
bool contrastTextColor /*= false */ )
|
||||||
{
|
{
|
||||||
QwtPlotItem* marker =
|
QwtPlotItem* marker =
|
||||||
createMarker( posX, depth, size, symbolType, baseColor, label, labelAlignment, labelOrientation, drawLine, contrastTextColor );
|
createMarker( position, depth, size, symbolType, baseColor, label, labelAlignment, labelOrientation, drawLine, contrastTextColor );
|
||||||
m_combinedComponentGroup.addPlotItem( marker );
|
m_combinedComponentGroup.addPlotItem( marker );
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
QwtPlotItem* RiuWellPathComponentPlotItem::createMarker( double posX,
|
QwtPlotItem*
|
||||||
double depth,
|
RiuWellPathComponentPlotItem::createMarker( double position,
|
||||||
int size,
|
double depth,
|
||||||
RiuPlotCurveSymbol::PointSymbolEnum symbolType,
|
int size,
|
||||||
cvf::Color4f baseColor,
|
RiuPlotCurveSymbol::PointSymbolEnum symbolType,
|
||||||
const QString& label /*= QString("")*/,
|
cvf::Color4f baseColor,
|
||||||
Qt::Alignment labelAlignment /*= Qt::AlignTop*/,
|
const QString& label /*= QString( "" )*/,
|
||||||
Qt::Orientation labelOrientation /*= Qt::Vertical*/,
|
Qt::Alignment labelAlignment /*= Qt::AlignVCenter | Qt::AlignRight*/,
|
||||||
bool drawLine /*= false*/,
|
Qt::Orientation labelOrientation /*= Qt::Horizontal*/,
|
||||||
bool contrastTextColor /*= true*/ )
|
bool drawLine /*= false*/,
|
||||||
|
bool contrastTextColor /*= false */ )
|
||||||
{
|
{
|
||||||
QColor bgColor = RiaColorTools::toQColor( baseColor );
|
QColor bgColor = RiaColorTools::toQColor( baseColor );
|
||||||
QColor textColor = RiaColorTools::toQColor( baseColor.toColor3f(), 1.0 );
|
QColor textColor = RiaColorTools::toQColor( baseColor.toColor3f(), 1.0 );
|
||||||
@ -438,8 +455,19 @@ QwtPlotItem* RiuWellPathComponentPlotItem::createMarker( double
|
|||||||
symbol->setColor( bgColor );
|
symbol->setColor( bgColor );
|
||||||
marker->setSymbol( symbol );
|
marker->setSymbol( symbol );
|
||||||
marker->setSpacing( 6 );
|
marker->setSpacing( 6 );
|
||||||
marker->setXValue( posX );
|
|
||||||
marker->setYValue( depth );
|
if ( m_depthOrientation == RimWellLogPlot::DepthOrientation::HORIZONTAL )
|
||||||
|
{
|
||||||
|
marker->setXValue( depth );
|
||||||
|
marker->setYValue( position );
|
||||||
|
labelOrientation = Qt::Vertical;
|
||||||
|
labelAlignment = Qt::AlignTop;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
marker->setXValue( position );
|
||||||
|
marker->setYValue( depth );
|
||||||
|
}
|
||||||
|
|
||||||
if ( m_showLabel )
|
if ( m_showLabel )
|
||||||
{
|
{
|
||||||
@ -455,7 +483,15 @@ QwtPlotItem* RiuWellPathComponentPlotItem::createMarker( double
|
|||||||
|
|
||||||
if ( drawLine )
|
if ( drawLine )
|
||||||
{
|
{
|
||||||
marker->setLineStyle( QwtPlotMarker::HLine );
|
if ( m_depthOrientation == RimWellLogPlot::DepthOrientation::HORIZONTAL )
|
||||||
|
{
|
||||||
|
marker->setLineStyle( QwtPlotMarker::HLine );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
marker->setLineStyle( QwtPlotMarker::VLine );
|
||||||
|
}
|
||||||
|
|
||||||
marker->setLinePen( bgColor, 2.0, Qt::SolidLine );
|
marker->setLinePen( bgColor, 2.0, Qt::SolidLine );
|
||||||
}
|
}
|
||||||
return marker;
|
return marker;
|
||||||
@ -464,13 +500,26 @@ QwtPlotItem* RiuWellPathComponentPlotItem::createMarker( double
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RiuWellPathComponentPlotItem::addColumnFeature( double startX,
|
void RiuWellPathComponentPlotItem::addColumnFeature( double startPosition,
|
||||||
double endX,
|
double endPosition,
|
||||||
double startDepth,
|
double startDepth,
|
||||||
double endDepth,
|
double endDepth,
|
||||||
cvf::Color4f baseColor,
|
cvf::Color4f baseColor,
|
||||||
Qt::BrushStyle brushStyle /*= Qt::SolidPattern*/ )
|
Qt::BrushStyle brushStyle /*= Qt::SolidPattern */ )
|
||||||
{
|
{
|
||||||
|
double startX = startPosition;
|
||||||
|
double endX = endPosition;
|
||||||
|
double startY = startDepth;
|
||||||
|
double endY = endDepth;
|
||||||
|
|
||||||
|
if ( m_depthOrientation == RimWellLogPlot::DepthOrientation::HORIZONTAL )
|
||||||
|
{
|
||||||
|
startX = startDepth;
|
||||||
|
endX = endDepth;
|
||||||
|
startY = startPosition;
|
||||||
|
endY = endPosition;
|
||||||
|
}
|
||||||
|
|
||||||
QColor baseQColor = RiaColorTools::toQColor( baseColor );
|
QColor baseQColor = RiaColorTools::toQColor( baseColor );
|
||||||
if ( brushStyle != Qt::SolidPattern )
|
if ( brushStyle != Qt::SolidPattern )
|
||||||
{
|
{
|
||||||
@ -478,11 +527,11 @@ void RiuWellPathComponentPlotItem::addColumnFeature( double startX,
|
|||||||
QColor semiTransparentWhite( Qt::white );
|
QColor semiTransparentWhite( Qt::white );
|
||||||
semiTransparentWhite.setAlphaF( 0.9f );
|
semiTransparentWhite.setAlphaF( 0.9f );
|
||||||
QwtPlotItem* backgroundShape =
|
QwtPlotItem* backgroundShape =
|
||||||
RiuQwtPlotTools::createBoxShape( label(), startX, endX, startDepth, endDepth, semiTransparentWhite, Qt::SolidPattern );
|
RiuQwtPlotTools::createBoxShape( label(), startX, endX, startY, endY, semiTransparentWhite, Qt::SolidPattern );
|
||||||
m_combinedComponentGroup.addPlotItem( backgroundShape );
|
m_combinedComponentGroup.addPlotItem( backgroundShape );
|
||||||
|
|
||||||
QwtPlotItem* patternShape =
|
QwtPlotItem* patternShape =
|
||||||
RiuQwtPlotTools::createBoxShape( label(), startX, endX, startDepth, endDepth, baseQColor, brushStyle );
|
RiuQwtPlotTools::createBoxShape( label(), startX, endX, startY, endY, baseQColor, brushStyle );
|
||||||
m_combinedComponentGroup.addPlotItem( patternShape );
|
m_combinedComponentGroup.addPlotItem( patternShape );
|
||||||
if ( endX >= 0.0 )
|
if ( endX >= 0.0 )
|
||||||
{
|
{
|
||||||
@ -498,7 +547,7 @@ void RiuWellPathComponentPlotItem::addColumnFeature( double startX,
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
QwtPlotItem* backgroundShape =
|
QwtPlotItem* backgroundShape =
|
||||||
RiuQwtPlotTools::createBoxShape( label(), startX, endX, startDepth, endDepth, baseQColor, Qt::SolidPattern );
|
RiuQwtPlotTools::createBoxShape( label(), startX, endX, startY, endY, baseQColor, Qt::SolidPattern );
|
||||||
m_combinedComponentGroup.addPlotItem( backgroundShape );
|
m_combinedComponentGroup.addPlotItem( backgroundShape );
|
||||||
|
|
||||||
if ( endX >= 0.0 )
|
if ( endX >= 0.0 )
|
||||||
@ -521,7 +570,7 @@ cvf::Color4f RiuWellPathComponentPlotItem::componentColor( float alpha /*= 1.0*/
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
bool RiuWellPathComponentPlotItem::xValueRange( double* minimumValue, double* maximumValue ) const
|
bool RiuWellPathComponentPlotItem::propertyValueRange( double* minimumValue, double* maximumValue ) const
|
||||||
{
|
{
|
||||||
CVF_ASSERT( minimumValue && maximumValue );
|
CVF_ASSERT( minimumValue && maximumValue );
|
||||||
*maximumValue = 1.0;
|
*maximumValue = 1.0;
|
||||||
@ -532,7 +581,7 @@ bool RiuWellPathComponentPlotItem::xValueRange( double* minimumValue, double* ma
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
bool RiuWellPathComponentPlotItem::yValueRange( double* minimumValue, double* maximumValue ) const
|
bool RiuWellPathComponentPlotItem::depthValueRange( double* minimumValue, double* maximumValue ) const
|
||||||
{
|
{
|
||||||
CVF_ASSERT( minimumValue && maximumValue );
|
CVF_ASSERT( minimumValue && maximumValue );
|
||||||
|
|
||||||
@ -560,6 +609,14 @@ void RiuWellPathComponentPlotItem::setDepthType( RimWellLogPlot::DepthTypeEnum d
|
|||||||
m_depthType = depthType;
|
m_depthType = depthType;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RiuWellPathComponentPlotItem::setDepthOrientation( RimWellLogPlot::DepthOrientation depthOrientation )
|
||||||
|
{
|
||||||
|
m_depthOrientation = depthOrientation;
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@ -597,6 +654,18 @@ void RiuWellPathComponentPlotItem::attachToQwt()
|
|||||||
if ( m_parentQwtPlot )
|
if ( m_parentQwtPlot )
|
||||||
{
|
{
|
||||||
m_combinedComponentGroup.attach( m_parentQwtPlot );
|
m_combinedComponentGroup.attach( m_parentQwtPlot );
|
||||||
|
|
||||||
|
auto riuAxis = RimDepthTrackPlot::annotationAxis( m_depthOrientation );
|
||||||
|
auto qwtAxis = RiuQwtPlotTools::toQwtPlotAxisEnum( riuAxis.axis() );
|
||||||
|
|
||||||
|
if ( m_depthOrientation == RimWellLogPlot::DepthOrientation::VERTICAL )
|
||||||
|
{
|
||||||
|
m_combinedComponentGroup.setXAxis( qwtAxis );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
m_combinedComponentGroup.setYAxis( qwtAxis );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -60,37 +60,39 @@ public:
|
|||||||
|
|
||||||
RiaDefines::WellPathComponentType componentType() const;
|
RiaDefines::WellPathComponentType componentType() const;
|
||||||
|
|
||||||
bool xValueRange( double* minimumValue, double* maximumValue ) const;
|
bool propertyValueRange( double* minimumValue, double* maximumValue ) const;
|
||||||
bool yValueRange( double* minimumValue, double* maximumValue ) const;
|
bool depthValueRange( double* minimumValue, double* maximumValue ) const;
|
||||||
|
|
||||||
void setShowLabel( bool showLabel );
|
void setShowLabel( bool showLabel );
|
||||||
void setDepthType( RimWellLogPlot::DepthTypeEnum depthType );
|
void setDepthType( RimWellLogPlot::DepthTypeEnum depthType );
|
||||||
|
void setDepthOrientation( RimWellLogPlot::DepthOrientation depthOrientation );
|
||||||
void setContributeToLegend( bool contributeToLegend );
|
void setContributeToLegend( bool contributeToLegend );
|
||||||
|
|
||||||
void setParentQwtPlotAndReplot( QwtPlot* plot );
|
|
||||||
void setParentPlotNoReplot( QwtPlot* plot );
|
void setParentPlotNoReplot( QwtPlot* plot );
|
||||||
void attachToQwt();
|
void attachToQwt();
|
||||||
void detachFromQwt();
|
void detachFromQwt();
|
||||||
void reattachToQwt();
|
void reattachToQwt();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
void setParentQwtPlotAndReplot( QwtPlot* plot );
|
||||||
void calculateColumnOffsets( const RimWellPathComponentInterface* component );
|
void calculateColumnOffsets( const RimWellPathComponentInterface* component );
|
||||||
|
|
||||||
void onLoadDataAndUpdate( bool updateParentPlot );
|
void onLoadDataAndUpdate( bool updateParentPlot );
|
||||||
|
|
||||||
std::pair<double, double> depthsOfDepthType() const;
|
std::pair<double, double> depthsOfDepthType() const;
|
||||||
|
|
||||||
void addMarker( double posX,
|
void addMarker( double position,
|
||||||
double depth,
|
double depth,
|
||||||
int size,
|
int size,
|
||||||
RiuPlotCurveSymbol::PointSymbolEnum symbolType,
|
RiuPlotCurveSymbol::PointSymbolEnum symbolType,
|
||||||
cvf::Color4f baseColor,
|
cvf::Color4f baseColor,
|
||||||
const QString& label = QString( "" ),
|
const QString& label = QString( "" ),
|
||||||
Qt::Alignment labelAlignment = Qt::AlignVCenter | Qt::AlignRight,
|
Qt::Alignment labelAlignment = Qt::AlignVCenter | Qt::AlignRight,
|
||||||
Qt::Orientation labelOrientation = Qt::Horizontal,
|
Qt::Orientation labelOrientation = Qt::Horizontal,
|
||||||
bool drawLine = false,
|
bool drawLine = false,
|
||||||
bool contrastTextColor = false );
|
bool contrastTextColor = false );
|
||||||
QwtPlotItem* createMarker( double posX,
|
|
||||||
|
QwtPlotItem* createMarker( double position,
|
||||||
double depth,
|
double depth,
|
||||||
int size,
|
int size,
|
||||||
RiuPlotCurveSymbol::PointSymbolEnum symbolType,
|
RiuPlotCurveSymbol::PointSymbolEnum symbolType,
|
||||||
@ -100,12 +102,13 @@ private:
|
|||||||
Qt::Orientation labelOrientation = Qt::Horizontal,
|
Qt::Orientation labelOrientation = Qt::Horizontal,
|
||||||
bool drawLine = false,
|
bool drawLine = false,
|
||||||
bool contrastTextColor = false );
|
bool contrastTextColor = false );
|
||||||
void addColumnFeature( double startX,
|
|
||||||
double endX,
|
void addColumnFeature( double startPosition,
|
||||||
double startDepth,
|
double endPosition,
|
||||||
double endDepth,
|
double startDepth,
|
||||||
cvf::Color4f baseColor,
|
double endDepth,
|
||||||
Qt::BrushStyle brushStyle = Qt::SolidPattern );
|
cvf::Color4f baseColor,
|
||||||
|
Qt::BrushStyle brushStyle = Qt::SolidPattern );
|
||||||
|
|
||||||
cvf::Color4f componentColor( float alpha = 1.0 ) const;
|
cvf::Color4f componentColor( float alpha = 1.0 ) const;
|
||||||
|
|
||||||
@ -121,9 +124,10 @@ private:
|
|||||||
double m_columnOffset;
|
double m_columnOffset;
|
||||||
double m_maxColumnOffset;
|
double m_maxColumnOffset;
|
||||||
|
|
||||||
RimWellLogPlot::DepthTypeEnum m_depthType;
|
RimWellLogPlot::DepthTypeEnum m_depthType;
|
||||||
QPointer<QwtPlot> m_parentQwtPlot;
|
RimWellLogPlot::DepthOrientation m_depthOrientation;
|
||||||
RiuQwtPlotItemGroup m_combinedComponentGroup;
|
QPointer<QwtPlot> m_parentQwtPlot;
|
||||||
|
RiuQwtPlotItemGroup m_combinedComponentGroup;
|
||||||
|
|
||||||
bool m_showLabel;
|
bool m_showLabel;
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user