#1544 Fracture : Add function used to compute perforation length coords

This commit is contained in:
Magne Sjaastad 2018-01-19 14:05:57 +01:00
parent c7d61ed7f4
commit 53418179ba
5 changed files with 51 additions and 0 deletions

View File

@ -98,6 +98,7 @@ public:
virtual double fractureMD() const = 0;
virtual void loadDataAndUpdate() = 0;
virtual std::vector<cvf::Vec3d> perforationLengthCenterLineCoords() const = 0;
friend class RimFractureTemplate;

View File

@ -30,6 +30,7 @@
#include "RimSimWellInView.h"
#include "cafPdmUiDoubleSliderEditor.h"
#include "RigWellPath.h"
@ -131,6 +132,29 @@ void RimSimWellFracture::loadDataAndUpdate()
updateAzimuthBasedOnWellAzimuthAngle();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::vector<cvf::Vec3d> RimSimWellFracture::perforationLengthCenterLineCoords() const
{
std::vector<cvf::Vec3d> coords;
if (!m_branchCenterLines.empty() && m_branchIndex < m_branchCenterLines.size())
{
RigWellPath wellPathGeometry;
wellPathGeometry.m_wellPathPoints = m_branchCenterLines[m_branchIndex].wellPathPoints();
wellPathGeometry.m_measuredDepths = m_branchCenterLines[m_branchIndex].measuredDepths();
double startMd = m_location - perforationLength() / 2.0;
double endMd = m_location + perforationLength() / 2.0;
coords = wellPathGeometry.clippedPointSubset(startMd, endMd).first;
}
return coords;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------

View File

@ -52,6 +52,8 @@ public:
virtual void loadDataAndUpdate() override;
virtual std::vector<cvf::Vec3d> perforationLengthCenterLineCoords() const override;
protected:
virtual void defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering) override;
virtual void defineEditorAttribute(const caf::PdmFieldHandle* field, QString uiConfigName, caf::PdmUiEditorAttribute* attribute) override;

View File

@ -132,6 +132,28 @@ void RimWellPathFracture::loadDataAndUpdate()
updateAzimuthBasedOnWellAzimuthAngle();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::vector<cvf::Vec3d> RimWellPathFracture::perforationLengthCenterLineCoords() const
{
std::vector<cvf::Vec3d> wellPathCoords;
RimWellPath* wellPath = nullptr;
this->firstAncestorOrThisOfType(wellPath);
if (wellPath && wellPath->wellPathGeometry())
{
double startMd = m_measuredDepth - perforationLength() / 2.0;
double endMd = m_measuredDepth + perforationLength() / 2.0;
auto coordsAndMd = wellPath->wellPathGeometry()->clippedPointSubset(startMd, endMd);
wellPathCoords = coordsAndMd.first;
}
return wellPathCoords;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------

View File

@ -47,6 +47,8 @@ public:
virtual void loadDataAndUpdate() override;
virtual std::vector<cvf::Vec3d> perforationLengthCenterLineCoords() const override;
protected:
virtual void defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering) override;
virtual void defineEditorAttribute(const caf::PdmFieldHandle* field, QString uiConfigName, caf::PdmUiEditorAttribute * attribute) override;