diff --git a/ApplicationCode/ProjectDataModel/Rim3dWellLogExtractionCurve.cpp b/ApplicationCode/ProjectDataModel/Rim3dWellLogExtractionCurve.cpp index 025c45261c..5b7caaa934 100644 --- a/ApplicationCode/ProjectDataModel/Rim3dWellLogExtractionCurve.cpp +++ b/ApplicationCode/ProjectDataModel/Rim3dWellLogExtractionCurve.cpp @@ -336,25 +336,7 @@ double Rim3dWellLogExtractionCurve::rkbDiff() const if (wellPath && wellPath->wellPathGeometry()) { - RigWellPath* geo = wellPath->wellPathGeometry(); - - if (geo->hasDatumElevation()) - { - return geo->datumElevation(); - } - - // If measured depth is zero, use the z-value of the well path points - if (geo->m_wellPathPoints.size() > 0 && geo->m_measuredDepths.size() > 0) - { - double epsilon = 1e-3; - - if (cvf::Math::abs(geo->m_measuredDepths[0]) < epsilon) - { - double diff = geo->m_measuredDepths[0] - (-geo->wellPathPoints()[0].z()); - - return diff; - } - } + return wellPath->wellPathGeometry()->rkbDiff(); } return HUGE_VAL; diff --git a/ApplicationCode/ProjectDataModel/RimWellLogExtractionCurve.cpp b/ApplicationCode/ProjectDataModel/RimWellLogExtractionCurve.cpp index dcad7a8e73..56cc3bd9db 100644 --- a/ApplicationCode/ProjectDataModel/RimWellLogExtractionCurve.cpp +++ b/ApplicationCode/ProjectDataModel/RimWellLogExtractionCurve.cpp @@ -858,27 +858,8 @@ double RimWellLogExtractionCurve::rkbDiff() const { if (m_wellPath && m_wellPath->wellPathGeometry()) { - RigWellPath* geo = m_wellPath->wellPathGeometry(); - - if (geo->hasDatumElevation()) - { - return geo->datumElevation(); - } - - // If measured depth is zero, use the z-value of the well path points - if (geo->m_wellPathPoints.size() > 0 && geo->m_measuredDepths.size() > 0) - { - double epsilon = 1e-3; - - if (cvf::Math::abs(geo->m_measuredDepths[0]) < epsilon) - { - double diff = geo->m_measuredDepths[0] - (-geo->m_wellPathPoints[0].z()); - - return diff; - } - } + return m_wellPath->wellPathGeometry()->rkbDiff(); } - return HUGE_VAL; } diff --git a/ApplicationCode/ReservoirDataModel/RigWellPath.cpp b/ApplicationCode/ReservoirDataModel/RigWellPath.cpp index 73697b9d73..65fe1c9bf8 100644 --- a/ApplicationCode/ReservoirDataModel/RigWellPath.cpp +++ b/ApplicationCode/ReservoirDataModel/RigWellPath.cpp @@ -56,6 +56,32 @@ double RigWellPath::datumElevation() const return m_datumElevation; } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +double RigWellPath::rkbDiff() const +{ + if (hasDatumElevation()) + { + return datumElevation(); + } + + // If measured depth is zero, use the z-value of the well path points + if (m_wellPathPoints.size() > 0 && m_measuredDepths.size() > 0) + { + double epsilon = 1e-3; + + if (cvf::Math::abs(m_measuredDepths[0]) < epsilon) + { + double diff = m_measuredDepths[0] - (-wellPathPoints()[0].z()); + + return diff; + } + } + return HUGE_VAL; +} + + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationCode/ReservoirDataModel/RigWellPath.h b/ApplicationCode/ReservoirDataModel/RigWellPath.h index 7280a9a563..aa5a3caba8 100644 --- a/ApplicationCode/ReservoirDataModel/RigWellPath.h +++ b/ApplicationCode/ReservoirDataModel/RigWellPath.h @@ -44,6 +44,7 @@ public: void setDatumElevation(double value); bool hasDatumElevation() const; double datumElevation() const; + double rkbDiff() const; cvf::Vec3d interpolatedVectorAlongWellPath(const std::vector& vectors, double measuredDepth, double * horizontalLengthAlongWellToStartClipPoint = nullptr) const;