mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#3521 Make different size casings take up different columns.
This commit is contained in:
parent
8e5e58037c
commit
e3b7cc0558
@ -1034,7 +1034,7 @@ void RimWellLogTrack::applyXZoomFromVisibleRange()
|
|||||||
double componentRangeMin = -0.25;
|
double componentRangeMin = -0.25;
|
||||||
if (m_showWellPathComponentsBothSides)
|
if (m_showWellPathComponentsBothSides)
|
||||||
{
|
{
|
||||||
componentRangeMin = -1.0;
|
componentRangeMin = -1.5;
|
||||||
}
|
}
|
||||||
|
|
||||||
m_wellLogTrackPlotWidget->setXRange(componentRangeMin, componentRangeMax, QwtPlot::xBottom);
|
m_wellLogTrackPlotWidget->setXRange(componentRangeMin, componentRangeMax, QwtPlot::xBottom);
|
||||||
|
@ -28,6 +28,7 @@
|
|||||||
#include "RimWellLogPlot.h"
|
#include "RimWellLogPlot.h"
|
||||||
#include "RimWellLogTrack.h"
|
#include "RimWellLogTrack.h"
|
||||||
#include "RimWellPathAttribute.h"
|
#include "RimWellPathAttribute.h"
|
||||||
|
#include "RimWellPathAttributeCollection.h"
|
||||||
#include "RimWellPath.h"
|
#include "RimWellPath.h"
|
||||||
|
|
||||||
#include "RigWellPath.h"
|
#include "RigWellPath.h"
|
||||||
@ -46,6 +47,7 @@
|
|||||||
RiuWellPathComponentPlotItem::RiuWellPathComponentPlotItem(const RimWellPath* wellPath)
|
RiuWellPathComponentPlotItem::RiuWellPathComponentPlotItem(const RimWellPath* wellPath)
|
||||||
: m_wellPath(wellPath)
|
: m_wellPath(wellPath)
|
||||||
, m_componentType(RiaDefines::WELL_PATH)
|
, m_componentType(RiaDefines::WELL_PATH)
|
||||||
|
, m_columnOffset(0.0)
|
||||||
, m_depthType(RimWellLogPlot::MEASURED_DEPTH)
|
, m_depthType(RimWellLogPlot::MEASURED_DEPTH)
|
||||||
, m_showLabel(false)
|
, m_showLabel(false)
|
||||||
{
|
{
|
||||||
@ -63,6 +65,7 @@ RiuWellPathComponentPlotItem::RiuWellPathComponentPlotItem(const RimWellPath* we
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
RiuWellPathComponentPlotItem::RiuWellPathComponentPlotItem(const RimWellPath* wellPath, const RimWellPathComponentInterface* component)
|
RiuWellPathComponentPlotItem::RiuWellPathComponentPlotItem(const RimWellPath* wellPath, const RimWellPathComponentInterface* component)
|
||||||
: m_wellPath(wellPath)
|
: m_wellPath(wellPath)
|
||||||
|
, m_columnOffset(0.0)
|
||||||
, m_depthType(RimWellLogPlot::MEASURED_DEPTH)
|
, m_depthType(RimWellLogPlot::MEASURED_DEPTH)
|
||||||
, m_showLabel(false)
|
, m_showLabel(false)
|
||||||
{
|
{
|
||||||
@ -73,6 +76,8 @@ RiuWellPathComponentPlotItem::RiuWellPathComponentPlotItem(const RimWellPath* we
|
|||||||
m_legendTitle = component->componentTypeLabel();
|
m_legendTitle = component->componentTypeLabel();
|
||||||
m_startMD = component->startMD();
|
m_startMD = component->startMD();
|
||||||
m_endMD = component->endMD();
|
m_endMD = component->endMD();
|
||||||
|
|
||||||
|
calculateColumnOffsets(component);
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@ -112,6 +117,40 @@ RiaDefines::WellPathComponentType RiuWellPathComponentPlotItem::componentType()
|
|||||||
return m_componentType;
|
return m_componentType;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RiuWellPathComponentPlotItem::calculateColumnOffsets(const RimWellPathComponentInterface* component)
|
||||||
|
{
|
||||||
|
std::set<double> uniqueCasingDiameters;
|
||||||
|
|
||||||
|
std::vector<RimWellPathAttributeCollection*> attributeCollection;
|
||||||
|
m_wellPath->descendantsIncludingThisOfType(attributeCollection);
|
||||||
|
for (const RimWellPathAttribute* otherAttribute : attributeCollection.front()->attributes())
|
||||||
|
{
|
||||||
|
if (otherAttribute->componentType() == RiaDefines::CASING)
|
||||||
|
{
|
||||||
|
uniqueCasingDiameters.insert(otherAttribute->diameterInInches());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!uniqueCasingDiameters.empty())
|
||||||
|
{
|
||||||
|
m_maxColumnOffset = (uniqueCasingDiameters.size() - 1) * 0.25;
|
||||||
|
|
||||||
|
const RimWellPathAttribute* myAttribute = dynamic_cast<const RimWellPathAttribute*>(component);
|
||||||
|
if (myAttribute && myAttribute->componentType() == RiaDefines::CASING)
|
||||||
|
{
|
||||||
|
int nNarrowerCasings = std::count_if(uniqueCasingDiameters.begin(), uniqueCasingDiameters.end(), [myAttribute](double otherCasingDiameter)
|
||||||
|
{
|
||||||
|
return otherCasingDiameter < myAttribute->diameterInInches();
|
||||||
|
});
|
||||||
|
|
||||||
|
m_columnOffset = nNarrowerCasings * 0.25;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@ -121,39 +160,45 @@ void RiuWellPathComponentPlotItem::onLoadDataAndUpdate(bool updateParentPlot)
|
|||||||
std::tie(startDepth, endDepth) = depthsOfDepthType();
|
std::tie(startDepth, endDepth) = depthsOfDepthType();
|
||||||
double midDepth = 0.5 * (startDepth + endDepth);
|
double midDepth = 0.5 * (startDepth + endDepth);
|
||||||
|
|
||||||
|
double casingTrackEnd = 0.75 + m_maxColumnOffset;
|
||||||
|
|
||||||
if (m_componentType == RiaDefines::WELL_PATH)
|
if (m_componentType == RiaDefines::WELL_PATH)
|
||||||
{
|
{
|
||||||
addColumnFeature(-0.25, 0.25, startDepth, endDepth, componentColor());
|
addColumnFeature(-0.25, 0.25, startDepth, endDepth, componentColor());
|
||||||
}
|
}
|
||||||
else if (m_componentType == RiaDefines::CASING)
|
else if (m_componentType == RiaDefines::CASING)
|
||||||
{
|
{
|
||||||
addColumnFeature(-0.75, -0.5, startDepth, endDepth, componentColor());
|
double posMin = 0.5 + m_columnOffset;
|
||||||
addColumnFeature(0.5, 0.75, startDepth, endDepth, componentColor());
|
double posMax = 0.75 + m_columnOffset;
|
||||||
addMarker(-0.75, endDepth,10, RiuQwtSymbol::SYMBOL_LEFT_ANGLED_TRIANGLE, componentColor());
|
addColumnFeature(-posMax, -posMin, startDepth, endDepth, componentColor());
|
||||||
addMarker(0.75, endDepth, 10, RiuQwtSymbol::SYMBOL_RIGHT_ANGLED_TRIANGLE, componentColor(), label());
|
addColumnFeature(posMin, posMax, startDepth, endDepth, componentColor());
|
||||||
|
addMarker(-posMax, endDepth,12, RiuQwtSymbol::SYMBOL_LEFT_ANGLED_TRIANGLE, componentColor());
|
||||||
|
addMarker(posMax, endDepth, 12, RiuQwtSymbol::SYMBOL_RIGHT_ANGLED_TRIANGLE, componentColor());
|
||||||
|
addMarker(casingTrackEnd, endDepth, 12, RiuQwtSymbol::SYMBOL_RIGHT_ANGLED_TRIANGLE, componentColor(0.0), label());
|
||||||
|
|
||||||
}
|
}
|
||||||
else if (m_componentType == RiaDefines::LINER)
|
else if (m_componentType == RiaDefines::LINER)
|
||||||
{
|
{
|
||||||
addColumnFeature(-0.5, -0.25, startDepth, endDepth, componentColor());
|
addColumnFeature(-0.5, -0.25, startDepth, endDepth, componentColor());
|
||||||
addColumnFeature(0.25, 0.5, startDepth, endDepth, componentColor());
|
addColumnFeature(0.25, 0.5, startDepth, endDepth, componentColor());
|
||||||
addMarker(0.75, endDepth, 10, RiuQwtSymbol::SYMBOL_RIGHT_ANGLED_TRIANGLE, componentColor(0.0), label());
|
addMarker(casingTrackEnd, endDepth, 10, RiuQwtSymbol::SYMBOL_RIGHT_ANGLED_TRIANGLE, componentColor(0.0), label());
|
||||||
}
|
}
|
||||||
else if (m_componentType == RiaDefines::PERFORATION_INTERVAL)
|
else if (m_componentType == RiaDefines::PERFORATION_INTERVAL)
|
||||||
{
|
{
|
||||||
addColumnFeature(-0.75, -0.25, startDepth, endDepth, componentColor(), Qt::Dense6Pattern);
|
addColumnFeature(-casingTrackEnd, -0.25, startDepth, endDepth, componentColor(), Qt::Dense6Pattern);
|
||||||
addColumnFeature(0.25, 0.75, startDepth, endDepth, componentColor(), Qt::Dense6Pattern);
|
addColumnFeature(0.25, casingTrackEnd, startDepth, endDepth, componentColor(), Qt::Dense6Pattern);
|
||||||
// Empirically a spacing of around 30 in depth between symbols looks good in the most relevant zoom levels.
|
// Empirically a spacing of around 30 in depth between symbols looks good in the most relevant zoom levels.
|
||||||
const double markerSpacing = 30;
|
const double markerSpacing = 30;
|
||||||
const int markerSize = 6;
|
const int markerSize = 6;
|
||||||
double markerDepth = startDepth;
|
double markerDepth = startDepth;
|
||||||
while (markerDepth < endDepth - 5)
|
while (markerDepth < endDepth - 5)
|
||||||
{
|
{
|
||||||
addMarker(-0.75, markerDepth, markerSize, RiuQwtSymbol::SYMBOL_LEFT_TRIANGLE, componentColor());
|
addMarker(-casingTrackEnd, markerDepth, markerSize, RiuQwtSymbol::SYMBOL_LEFT_TRIANGLE, componentColor());
|
||||||
addMarker(0.75, markerDepth, markerSize, RiuQwtSymbol::SYMBOL_RIGHT_TRIANGLE, componentColor());
|
addMarker(casingTrackEnd, markerDepth, markerSize, RiuQwtSymbol::SYMBOL_RIGHT_TRIANGLE, componentColor());
|
||||||
|
|
||||||
markerDepth += markerSpacing;
|
markerDepth += markerSpacing;
|
||||||
}
|
}
|
||||||
addMarker(0.75, midDepth, 10, RiuQwtSymbol::SYMBOL_RIGHT_TRIANGLE, componentColor(0.0), label());
|
addMarker(casingTrackEnd, midDepth, 10, RiuQwtSymbol::SYMBOL_RIGHT_TRIANGLE, componentColor(0.0), label());
|
||||||
|
|
||||||
QwtPlotItem* legendItem1 = createMarker(16.0, 0.0, 6, RiuQwtSymbol::SYMBOL_RIGHT_TRIANGLE, componentColor());
|
QwtPlotItem* legendItem1 = createMarker(16.0, 0.0, 6, RiuQwtSymbol::SYMBOL_RIGHT_TRIANGLE, componentColor());
|
||||||
legendItem1->setLegendIconSize(QSize(4, 8));
|
legendItem1->setLegendIconSize(QSize(4, 8));
|
||||||
@ -164,17 +209,17 @@ void RiuWellPathComponentPlotItem::onLoadDataAndUpdate(bool updateParentPlot)
|
|||||||
}
|
}
|
||||||
else if (m_componentType == RiaDefines::FISHBONES)
|
else if (m_componentType == RiaDefines::FISHBONES)
|
||||||
{
|
{
|
||||||
addColumnFeature(-0.75, -0.25, startDepth, endDepth, componentColor(), Qt::BDiagPattern);
|
addColumnFeature(-casingTrackEnd, -0.25, startDepth, endDepth, componentColor(), Qt::BDiagPattern);
|
||||||
addColumnFeature(0.25, 0.75, startDepth, endDepth, componentColor(), Qt::FDiagPattern);
|
addColumnFeature(0.25, casingTrackEnd, startDepth, endDepth, componentColor(), Qt::FDiagPattern);
|
||||||
addMarker(0.75, midDepth, 10, RiuQwtSymbol::SYMBOL_RIGHT_ANGLED_TRIANGLE, componentColor(0.0), label());
|
addMarker(casingTrackEnd, midDepth, 10, RiuQwtSymbol::SYMBOL_RIGHT_ANGLED_TRIANGLE, componentColor(0.0), label());
|
||||||
}
|
}
|
||||||
else if (m_componentType == RiaDefines::FRACTURE)
|
else if (m_componentType == RiaDefines::FRACTURE)
|
||||||
{
|
{
|
||||||
addColumnFeature(-0.75, -0.25, startDepth, endDepth, componentColor(), Qt::SolidPattern);
|
addColumnFeature(-casingTrackEnd, -0.25, startDepth, endDepth, componentColor(), Qt::SolidPattern);
|
||||||
addColumnFeature(0.25, 0.75, startDepth, endDepth, componentColor(), Qt::SolidPattern);
|
addColumnFeature(0.25, casingTrackEnd, startDepth, endDepth, componentColor(), Qt::SolidPattern);
|
||||||
addMarker(0.75, startDepth, 10, RiuQwtSymbol::SYMBOL_NONE, componentColor(), "", Qt::AlignTop | Qt::AlignRight, Qt::Horizontal, true);
|
addMarker(casingTrackEnd, startDepth, 10, RiuQwtSymbol::SYMBOL_NONE, componentColor(), "", Qt::AlignTop | Qt::AlignRight, Qt::Horizontal, true);
|
||||||
addMarker(0.75, endDepth, 10, RiuQwtSymbol::SYMBOL_NONE, componentColor(), "", Qt::AlignTop | Qt::AlignRight, Qt::Horizontal, true);
|
addMarker(casingTrackEnd, endDepth, 10, RiuQwtSymbol::SYMBOL_NONE, componentColor(), "", Qt::AlignTop | Qt::AlignRight, Qt::Horizontal, true);
|
||||||
addMarker(0.75, startDepth, 1, RiuQwtSymbol::SYMBOL_RIGHT_ANGLED_TRIANGLE, componentColor(0.0f), label(), Qt::AlignTop | Qt::AlignRight);
|
addMarker(casingTrackEnd, startDepth, 1, RiuQwtSymbol::SYMBOL_RIGHT_ANGLED_TRIANGLE, componentColor(0.0f), label(), Qt::AlignTop | Qt::AlignRight);
|
||||||
}
|
}
|
||||||
else if (m_componentType == RiaDefines::ICD)
|
else if (m_componentType == RiaDefines::ICD)
|
||||||
{
|
{
|
||||||
@ -193,9 +238,9 @@ void RiuWellPathComponentPlotItem::onLoadDataAndUpdate(bool updateParentPlot)
|
|||||||
}
|
}
|
||||||
else if (m_componentType == RiaDefines::PACKER)
|
else if (m_componentType == RiaDefines::PACKER)
|
||||||
{
|
{
|
||||||
addColumnFeature(-0.75, -0.25, startDepth, endDepth, componentColor(), Qt::DiagCrossPattern);
|
addColumnFeature(-casingTrackEnd, -0.25, startDepth, endDepth, componentColor(), Qt::DiagCrossPattern);
|
||||||
addColumnFeature(0.25, 0.75, startDepth, endDepth, componentColor(), Qt::DiagCrossPattern);
|
addColumnFeature(0.25, casingTrackEnd, startDepth, endDepth, componentColor(), Qt::DiagCrossPattern);
|
||||||
addMarker(0.75, midDepth, 10, RiuQwtSymbol::SYMBOL_RIGHT_ANGLED_TRIANGLE, componentColor(0.0), label());
|
addMarker(casingTrackEnd, midDepth, 10, RiuQwtSymbol::SYMBOL_RIGHT_ANGLED_TRIANGLE, componentColor(0.0), label());
|
||||||
}
|
}
|
||||||
m_combinedComponentGroup.setTitle(legendTitle());
|
m_combinedComponentGroup.setTitle(legendTitle());
|
||||||
m_combinedComponentGroup.setLegendIconSize(QSize(20, 16));
|
m_combinedComponentGroup.setLegendIconSize(QSize(20, 16));
|
||||||
|
@ -76,7 +76,9 @@ public:
|
|||||||
void attachToQwt();
|
void attachToQwt();
|
||||||
void detachFromQwt();
|
void detachFromQwt();
|
||||||
void reattachToQwt();
|
void reattachToQwt();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
void calculateColumnOffsets(const RimWellPathComponentInterface* component);
|
||||||
|
|
||||||
void onLoadDataAndUpdate(bool updateParentPlot);
|
void onLoadDataAndUpdate(bool updateParentPlot);
|
||||||
|
|
||||||
@ -126,6 +128,8 @@ private:
|
|||||||
double m_endMD;
|
double m_endMD;
|
||||||
QString m_label;
|
QString m_label;
|
||||||
QString m_legendTitle;
|
QString m_legendTitle;
|
||||||
|
double m_columnOffset;
|
||||||
|
double m_maxColumnOffset;
|
||||||
|
|
||||||
RimWellLogPlot::DepthTypeEnum m_depthType;
|
RimWellLogPlot::DepthTypeEnum m_depthType;
|
||||||
QPointer<QwtPlot> m_parentQwtPlot;
|
QPointer<QwtPlot> m_parentQwtPlot;
|
||||||
|
Loading…
Reference in New Issue
Block a user