#5472 Add indication of water depth to formation and casing track

* Also add lighter formation lines as an option and make this default for WBS plots
This commit is contained in:
Gaute Lindkvist 2020-02-07 11:08:47 +01:00
parent 47f9c8c7c6
commit 438febe049
9 changed files with 167 additions and 61 deletions

View File

@ -484,6 +484,20 @@ const caf::ColorTable& RiaColorTables::wellPathsPaletteColors()
return colorTable; return colorTable;
} }
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
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
};
static caf::ColorTable colorTable = caf::ColorTable( colors );
return colorTable;
}
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------

View File

@ -59,6 +59,7 @@ public:
static const caf::ColorTable& timestepsPaletteColors(); static const caf::ColorTable& timestepsPaletteColors();
static const caf::ColorTable& editableWellPathsPaletteColors(); static const caf::ColorTable& editableWellPathsPaletteColors();
static const caf::ColorTable& wellPathsPaletteColors(); static const caf::ColorTable& wellPathsPaletteColors();
static const caf::ColorTable& waterAndRockPaletteColors();
static cvf::Color3f undefinedCellColor(); static cvf::Color3f undefinedCellColor();

View File

@ -311,7 +311,8 @@ void RicNewWellBoreStabilityPlotFeature::createStabilityCurvesTrack( RimWellBore
stabilityCurvesTrack->setXAxisGridVisibility( RimWellLogPlot::AXIS_GRID_MAJOR_AND_MINOR ); stabilityCurvesTrack->setXAxisGridVisibility( RimWellLogPlot::AXIS_GRID_MAJOR_AND_MINOR );
stabilityCurvesTrack->setFormationWellPath( wellPath ); stabilityCurvesTrack->setFormationWellPath( wellPath );
stabilityCurvesTrack->setFormationCase( geoMechCase ); stabilityCurvesTrack->setFormationCase( geoMechCase );
stabilityCurvesTrack->setAnnotationType( RiuPlotAnnotationTool::NO_ANNOTATIONS ); stabilityCurvesTrack->setAnnotationType( RiuPlotAnnotationTool::FORMATION_ANNOTATIONS );
stabilityCurvesTrack->setAnnotationDisplay( RiuPlotAnnotationTool::LIGHT_LINES );
stabilityCurvesTrack->setShowRegionLabels( true ); stabilityCurvesTrack->setShowRegionLabels( true );
std::vector<QString> resultNames = RiaDefines::wbsDerivedResultNames(); std::vector<QString> resultNames = RiaDefines::wbsDerivedResultNames();
@ -414,6 +415,7 @@ void RicNewWellBoreStabilityPlotFeature::createAnglesTrack( RimWellBoreStability
wellPathAnglesTrack->setXAxisGridVisibility( RimWellLogPlot::AXIS_GRID_MAJOR_AND_MINOR ); wellPathAnglesTrack->setXAxisGridVisibility( RimWellLogPlot::AXIS_GRID_MAJOR_AND_MINOR );
wellPathAnglesTrack->setFormationWellPath( wellPath ); wellPathAnglesTrack->setFormationWellPath( wellPath );
wellPathAnglesTrack->setFormationCase( geoMechCase ); wellPathAnglesTrack->setFormationCase( geoMechCase );
wellPathAnglesTrack->setAnnotationType( RiuPlotAnnotationTool::NO_ANNOTATIONS ); wellPathAnglesTrack->setAnnotationType( RiuPlotAnnotationTool::FORMATION_ANNOTATIONS );
wellPathAnglesTrack->setAnnotationDisplay( RiuPlotAnnotationTool::LIGHT_LINES );
wellPathAnglesTrack->setShowRegionLabels( false ); wellPathAnglesTrack->setShowRegionLabels( false );
} }

View File

@ -139,6 +139,7 @@ template <>
void AppEnum<RiuPlotAnnotationTool::RegionDisplay>::setUp() void AppEnum<RiuPlotAnnotationTool::RegionDisplay>::setUp()
{ {
addItem( RiuPlotAnnotationTool::DARK_LINES, "DARK_LINES", "Dark Lines" ); addItem( RiuPlotAnnotationTool::DARK_LINES, "DARK_LINES", "Dark Lines" );
addItem( RiuPlotAnnotationTool::LIGHT_LINES, "LIGHT_LINES", "Light Lines" );
addItem( RiuPlotAnnotationTool::COLORED_LINES, "COLORED_LINES", "Colored Lines" ); addItem( RiuPlotAnnotationTool::COLORED_LINES, "COLORED_LINES", "Colored Lines" );
addItem( RiuPlotAnnotationTool::COLOR_SHADING, "COLOR_SHADING", "Color Shading" ); addItem( RiuPlotAnnotationTool::COLOR_SHADING, "COLOR_SHADING", "Color Shading" );
addItem( RiuPlotAnnotationTool::COLOR_SHADING_AND_LINES, "SHADING_AND_LINES", "Color Shading and Lines" ); addItem( RiuPlotAnnotationTool::COLOR_SHADING_AND_LINES, "SHADING_AND_LINES", "Color Shading and Lines" );
@ -1487,6 +1488,14 @@ void RimWellLogTrack::setAnnotationDisplay( RiuPlotAnnotationTool::RegionDisplay
m_regionAnnotationDisplay = annotationDisplay; m_regionAnnotationDisplay = annotationDisplay;
} }
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellLogTrack::setAnnotationTransparency( int percent )
{
m_colorShadingTransparency = percent;
}
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
@ -1535,6 +1544,14 @@ void RimWellLogTrack::setShowWellPathAttributes( bool on )
m_showWellPathAttributes = on; m_showWellPathAttributes = on;
} }
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellLogTrack::setShowBothSidesOfWell( bool on )
{
m_showWellPathComponentsBothSides = on;
}
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
@ -1840,6 +1857,40 @@ void RimWellLogTrack::handleWheelEvent( QWheelEvent* event )
} }
} }
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::vector<std::pair<double, double>> RimWellLogTrack::waterAndRockRegions( RiaDefines::DepthTypeEnum depthType,
const RigWellLogExtractor* extractor ) const
{
if ( depthType == RiaDefines::MEASURED_DEPTH )
{
double waterStartMD = 0.0;
if ( extractor->wellPathData()->rkbDiff() != std::numeric_limits<double>::infinity() )
{
waterStartMD += extractor->wellPathData()->rkbDiff();
}
double waterEndMD = extractor->cellIntersectionMDs().front();
double rockEndMD = extractor->cellIntersectionMDs().back();
return {{waterStartMD, waterEndMD}, {waterEndMD, rockEndMD}};
}
else if ( depthType == RiaDefines::TRUE_VERTICAL_DEPTH )
{
double waterStartTVD = 0.0;
double waterEndTVD = extractor->cellIntersectionTVDs().front();
double rockEndTVD = extractor->cellIntersectionTVDs().back();
return {{waterStartTVD, waterEndTVD}, {waterEndTVD, rockEndTVD}};
}
else if ( depthType == RiaDefines::TRUE_VERTICAL_DEPTH_RKB )
{
double waterStartTVDRKB = extractor->wellPathData()->rkbDiff();
double waterEndTVDRKB = extractor->cellIntersectionTVDs().front() + extractor->wellPathData()->rkbDiff();
double rockEndTVDRKB = extractor->cellIntersectionTVDs().back() + extractor->wellPathData()->rkbDiff();
return {{waterStartTVDRKB, waterEndTVDRKB}, {waterEndTVDRKB, rockEndTVDRKB}};
}
return {};
}
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
@ -2174,17 +2225,43 @@ void RimWellLogTrack::updateRegionAnnotationsOnPlot()
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
void RimWellLogTrack::updateFormationNamesOnPlot() void RimWellLogTrack::updateFormationNamesOnPlot()
{ {
std::vector<QString> formationNamesToPlot;
RimWellLogPlot* plot = nullptr; RimWellLogPlot* plot = nullptr;
firstAncestorOrThisOfTypeAsserted( plot ); firstAncestorOrThisOfTypeAsserted( plot );
if ( m_formationSource == CASE ) if ( m_formationSource() == WELL_PICK_FILTER )
{ {
if ( ( m_formationSimWellName == QString( "None" ) && m_formationWellPathForSourceCase == nullptr ) || if ( m_formationWellPathForSourceWellPath == nullptr ) return;
m_formationCase == nullptr )
return;
if ( !( plot->depthType() == RiaDefines::MEASURED_DEPTH || plot->depthType() == RiaDefines::TRUE_VERTICAL_DEPTH ||
plot->depthType() == RiaDefines::TRUE_VERTICAL_DEPTH_RKB ) )
{
return;
}
std::vector<double> yValues;
const RigWellPathFormations* formations = m_formationWellPathForSourceWellPath->formationsGeometry();
if ( !formations ) return;
std::vector<QString> formationNamesToPlot;
formations->depthAndFormationNamesUpToLevel( m_formationLevel(),
&formationNamesToPlot,
&yValues,
m_showformationFluids(),
plot->depthType() );
if ( plot->depthType() == RiaDefines::TRUE_VERTICAL_DEPTH_RKB )
{
for ( double& depthValue : yValues )
{
depthValue += m_formationWellPathForSourceWellPath->wellPathGeometry()->rkbDiff();
}
}
m_annotationTool->attachWellPicks( m_plotWidget, formationNamesToPlot, yValues );
}
else
{
RimMainPlotCollection* mainPlotCollection; RimMainPlotCollection* mainPlotCollection;
this->firstAncestorOrThisOfTypeAsserted( mainPlotCollection ); this->firstAncestorOrThisOfTypeAsserted( mainPlotCollection );
@ -2194,6 +2271,7 @@ void RimWellLogTrack::updateFormationNamesOnPlot()
RigEclipseWellLogExtractor* eclWellLogExtractor = nullptr; RigEclipseWellLogExtractor* eclWellLogExtractor = nullptr;
RigGeoMechWellLogExtractor* geoMechWellLogExtractor = nullptr; RigGeoMechWellLogExtractor* geoMechWellLogExtractor = nullptr;
RigWellLogExtractor* extractor = nullptr;
if ( m_formationTrajectoryType == SIMULATION_WELL ) if ( m_formationTrajectoryType == SIMULATION_WELL )
{ {
@ -2222,6 +2300,7 @@ void RimWellLogTrack::updateFormationNamesOnPlot()
RiaDefines::activeFormationNamesResultName() ) ); RiaDefines::activeFormationNamesResultName() ) );
curveData = RimWellLogTrack::curveSamplingPointData( eclWellLogExtractor, resultAccessor.p() ); curveData = RimWellLogTrack::curveSamplingPointData( eclWellLogExtractor, resultAccessor.p() );
extractor = eclWellLogExtractor;
} }
else else
{ {
@ -2235,60 +2314,52 @@ void RimWellLogTrack::updateFormationNamesOnPlot()
RigFemResultAddress( RIG_FORMATION_NAMES, RigFemResultAddress( RIG_FORMATION_NAMES,
activeFormationNamesResultName, activeFormationNamesResultName,
"" ) ); "" ) );
extractor = geoMechWellLogExtractor;
} }
std::vector<std::pair<double, double>> yValues; // Attach water and rock base formations
std::vector<QString> formationNamesVector = RimWellLogTrack::formationNamesVector( m_formationCase ); const std::pair<double, double> xRange = std::make_pair( m_visibleXRangeMin(), m_visibleXRangeMax() );
RimWellLogTrack::findRegionNamesToPlot( curveData,
formationNamesVector,
plot->depthType(),
&formationNamesToPlot,
&yValues );
std::pair<double, double> xRange = std::make_pair( m_visibleXRangeMin(), m_visibleXRangeMax() );
caf::ColorTable colorTable( RimRegularLegendConfig::colorArrayFromColorType( m_colorShadingPalette() ) );
const caf::ColorTable waterAndRockColors = RiaColorTables::waterAndRockPaletteColors();
const std::vector<std::pair<double, double>> waterAndRockIntervals = waterAndRockRegions( plot->depthType(),
extractor );
int waterAndRockTransparency = m_colorShadingTransparency / 2;
m_annotationTool->attachNamedRegions( m_plotWidget, m_annotationTool->attachNamedRegions( m_plotWidget,
formationNamesToPlot, {"Water", ""},
xRange, xRange,
yValues, waterAndRockIntervals,
m_regionAnnotationDisplay(), m_regionAnnotationDisplay(),
colorTable, waterAndRockColors,
( ( 100 - m_colorShadingTransparency ) * 255 ) / 100, ( ( 100 - waterAndRockTransparency ) * 255 ) / 100,
m_showRegionLabels() ); m_showRegionLabels() );
}
else if ( m_formationSource() == WELL_PICK_FILTER )
{
if ( m_formationWellPathForSourceWellPath == nullptr ) return;
if ( !( plot->depthType() == RiaDefines::MEASURED_DEPTH || plot->depthType() == RiaDefines::TRUE_VERTICAL_DEPTH || if ( m_formationSource == CASE )
plot->depthType() == RiaDefines::TRUE_VERTICAL_DEPTH_RKB ) )
{ {
return; if ( ( m_formationSimWellName == QString( "None" ) && m_formationWellPathForSourceCase == nullptr ) ||
m_formationCase == nullptr )
return;
std::vector<std::pair<double, double>> yValues;
std::vector<QString> formationNamesVector = RimWellLogTrack::formationNamesVector( m_formationCase );
std::vector<QString> formationNamesToPlot;
RimWellLogTrack::findRegionNamesToPlot( curveData,
formationNamesVector,
plot->depthType(),
&formationNamesToPlot,
&yValues );
caf::ColorTable colorTable( RimRegularLegendConfig::colorArrayFromColorType( m_colorShadingPalette() ) );
m_annotationTool->attachNamedRegions( m_plotWidget,
formationNamesToPlot,
xRange,
yValues,
m_regionAnnotationDisplay(),
colorTable,
( ( 100 - m_colorShadingTransparency ) * 255 ) / 100,
m_showRegionLabels() );
} }
std::vector<double> yValues;
const RigWellPathFormations* formations = m_formationWellPathForSourceWellPath->formationsGeometry();
if ( !formations ) return;
formations->depthAndFormationNamesUpToLevel( m_formationLevel(),
&formationNamesToPlot,
&yValues,
m_showformationFluids(),
plot->depthType() );
if ( plot->depthType() == RiaDefines::TRUE_VERTICAL_DEPTH_RKB )
{
for ( double& depthValue : yValues )
{
depthValue += m_formationWellPathForSourceWellPath->wellPathGeometry()->rkbDiff();
}
}
m_annotationTool->attachWellPicks( m_plotWidget, formationNamesToPlot, yValues );
} }
} }

View File

@ -53,6 +53,7 @@ class RimWellLogPlotCollection;
class RigGeoMechWellLogExtractor; class RigGeoMechWellLogExtractor;
class RigResultAccessor; class RigResultAccessor;
class RigFemResultAddress; class RigFemResultAddress;
class RigWellLogExtractor;
class QwtPlotCurve; class QwtPlotCurve;
@ -163,6 +164,7 @@ public:
void setAnnotationType( RiuPlotAnnotationTool::RegionAnnotationType annotationType ); void setAnnotationType( RiuPlotAnnotationTool::RegionAnnotationType annotationType );
void setAnnotationDisplay( RiuPlotAnnotationTool::RegionDisplay annotationDisplay ); void setAnnotationDisplay( RiuPlotAnnotationTool::RegionDisplay annotationDisplay );
void setAnnotationTransparency( int percent );
RiuPlotAnnotationTool::RegionAnnotationType annotationType() const; RiuPlotAnnotationTool::RegionAnnotationType annotationType() const;
RiuPlotAnnotationTool::RegionDisplay annotationDisplay() const; RiuPlotAnnotationTool::RegionDisplay annotationDisplay() const;
@ -173,6 +175,7 @@ public:
bool showWellPathAttributes() const; bool showWellPathAttributes() const;
void setShowWellPathAttributes( bool on ); void setShowWellPathAttributes( bool on );
void setShowBothSidesOfWell( bool on );
void setWellPathAttributesSource( RimWellPath* wellPath ); void setWellPathAttributesSource( RimWellPath* wellPath );
RimWellPath* wellPathAttributeSource() const; RimWellPath* wellPathAttributeSource() const;
@ -279,6 +282,9 @@ private:
void handleWheelEvent( QWheelEvent* event ) override; void handleWheelEvent( QWheelEvent* event ) override;
std::vector<std::pair<double, double>> waterAndRockRegions( RiaDefines::DepthTypeEnum depthType,
const RigWellLogExtractor* extractor ) const;
private: private:
QString m_xAxisTitle; QString m_xAxisTitle;

View File

@ -39,7 +39,7 @@ RigWellLogExtractor::~RigWellLogExtractor() {}
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
const std::vector<double>& RigWellLogExtractor::cellIntersectionMDs() const std::vector<double>& RigWellLogExtractor::cellIntersectionMDs() const
{ {
return m_intersectionMeasuredDepths; return m_intersectionMeasuredDepths;
} }
@ -47,7 +47,7 @@ const std::vector<double>& RigWellLogExtractor::cellIntersectionMDs()
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
const std::vector<double>& RigWellLogExtractor::cellIntersectionTVDs() const std::vector<double>& RigWellLogExtractor::cellIntersectionTVDs() const
{ {
return m_intersectionTVDs; return m_intersectionTVDs;
} }
@ -88,7 +88,7 @@ std::vector<WellPathCellIntersectionInfo> RigWellLogExtractor::cellIntersectionI
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
const std::vector<size_t>& RigWellLogExtractor::intersectedCellsGlobIdx() const std::vector<size_t>& RigWellLogExtractor::intersectedCellsGlobIdx() const
{ {
return m_intersectedCellsGlobIdx; return m_intersectedCellsGlobIdx;
} }

View File

@ -58,9 +58,9 @@ public:
RigWellLogExtractor( const RigWellPath* wellpath, const std::string& wellCaseErrorMsgName ); RigWellLogExtractor( const RigWellPath* wellpath, const std::string& wellCaseErrorMsgName );
~RigWellLogExtractor() override; ~RigWellLogExtractor() override;
const std::vector<double>& cellIntersectionMDs(); const std::vector<double>& cellIntersectionMDs() const;
const std::vector<double>& cellIntersectionTVDs(); const std::vector<double>& cellIntersectionTVDs() const;
const std::vector<size_t>& intersectedCellsGlobIdx(); const std::vector<size_t>& intersectedCellsGlobIdx() const;
const RigWellPath* wellPathData() const; const RigWellPath* wellPathData() const;

View File

@ -97,12 +97,23 @@ void RiuPlotAnnotationTool::attachNamedRegions( QwtPlot*
QColor lineColor( 0, 0, 0, 0 ); QColor lineColor( 0, 0, 0, 0 );
QColor textColor( 0, 0, 0, 255 ); QColor textColor( 0, 0, 0, 255 );
if ( regionDisplay & DARK_LINES || regionDisplay & COLORED_LINES ) if ( regionDisplay & DARK_LINES || regionDisplay & COLORED_LINES || regionDisplay & LIGHT_LINES )
{ {
cvf::Color3ub cvfColor = catMapper.mapToColor( static_cast<double>( i ) ); cvf::Color3ub cvfColor = catMapper.mapToColor( static_cast<double>( i ) );
QColor cycledColor( cvfColor.r(), cvfColor.g(), cvfColor.b() ); QColor cycledColor( cvfColor.r(), cvfColor.g(), cvfColor.b() );
lineColor = regionDisplay & DARK_LINES ? QColor( 0, 0, 100 ) : cycledColor; if ( regionDisplay & DARK_LINES )
{
lineColor = QColor( 50, 50, 100 );
}
else if ( regionDisplay & LIGHT_LINES )
{
lineColor = QColor( 200, 200, 200 );
}
else
{
lineColor = cycledColor;
}
textColor = lineColor; textColor = lineColor;
} }
Qt::Alignment horizontalAlignment = trackTextAlignment( trackSpan ); Qt::Alignment horizontalAlignment = trackTextAlignment( trackSpan );

View File

@ -44,7 +44,8 @@ public:
DARK_LINES = 0x01, DARK_LINES = 0x01,
COLORED_LINES = 0x02, COLORED_LINES = 0x02,
COLOR_SHADING = 0x04, COLOR_SHADING = 0x04,
COLOR_SHADING_AND_LINES = 0x05 COLOR_SHADING_AND_LINES = 0x05,
LIGHT_LINES = 0x08,
}; };
enum TrackSpan enum TrackSpan
{ {