diff --git a/ApplicationCode/ProjectDataModel/Completions/RimFracture.h b/ApplicationCode/ProjectDataModel/Completions/RimFracture.h index 0c4dea0a60..8ce6f74901 100644 --- a/ApplicationCode/ProjectDataModel/Completions/RimFracture.h +++ b/ApplicationCode/ProjectDataModel/Completions/RimFracture.h @@ -98,6 +98,7 @@ public: virtual double fractureMD() const = 0; virtual void loadDataAndUpdate() = 0; + virtual std::vector perforationLengthCenterLineCoords() const = 0; friend class RimFractureTemplate; diff --git a/ApplicationCode/ProjectDataModel/Completions/RimSimWellFracture.cpp b/ApplicationCode/ProjectDataModel/Completions/RimSimWellFracture.cpp index 8d9a5c5781..2c42b1028e 100644 --- a/ApplicationCode/ProjectDataModel/Completions/RimSimWellFracture.cpp +++ b/ApplicationCode/ProjectDataModel/Completions/RimSimWellFracture.cpp @@ -30,6 +30,7 @@ #include "RimSimWellInView.h" #include "cafPdmUiDoubleSliderEditor.h" +#include "RigWellPath.h" @@ -131,6 +132,29 @@ void RimSimWellFracture::loadDataAndUpdate() updateAzimuthBasedOnWellAzimuthAngle(); } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +std::vector RimSimWellFracture::perforationLengthCenterLineCoords() const +{ + std::vector 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; +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationCode/ProjectDataModel/Completions/RimSimWellFracture.h b/ApplicationCode/ProjectDataModel/Completions/RimSimWellFracture.h index 2c4e474310..7b7f074d11 100644 --- a/ApplicationCode/ProjectDataModel/Completions/RimSimWellFracture.h +++ b/ApplicationCode/ProjectDataModel/Completions/RimSimWellFracture.h @@ -52,6 +52,8 @@ public: virtual void loadDataAndUpdate() override; + virtual std::vector 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; diff --git a/ApplicationCode/ProjectDataModel/Completions/RimWellPathFracture.cpp b/ApplicationCode/ProjectDataModel/Completions/RimWellPathFracture.cpp index ca8b51ebff..33d5d1f11b 100644 --- a/ApplicationCode/ProjectDataModel/Completions/RimWellPathFracture.cpp +++ b/ApplicationCode/ProjectDataModel/Completions/RimWellPathFracture.cpp @@ -132,6 +132,28 @@ void RimWellPathFracture::loadDataAndUpdate() updateAzimuthBasedOnWellAzimuthAngle(); } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +std::vector RimWellPathFracture::perforationLengthCenterLineCoords() const +{ + std::vector 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; +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationCode/ProjectDataModel/Completions/RimWellPathFracture.h b/ApplicationCode/ProjectDataModel/Completions/RimWellPathFracture.h index 5ff63787b3..44f0457b17 100644 --- a/ApplicationCode/ProjectDataModel/Completions/RimWellPathFracture.h +++ b/ApplicationCode/ProjectDataModel/Completions/RimWellPathFracture.h @@ -47,6 +47,8 @@ public: virtual void loadDataAndUpdate() override; + virtual std::vector 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;