///////////////////////////////////////////////////////////////////////////////// // // Copyright (C) 2018- Equinor ASA // // ResInsight is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY // WARRANTY; without even the implied warranty of MERCHANTABILITY or // FITNESS FOR A PARTICULAR PURPOSE. // // See the GNU General Public License at // for more details. // ///////////////////////////////////////////////////////////////////////////////// #pragma once #include "cvfDrawableGeo.h" #include "cvfObject.h" #include "cvfVector3.h" #include "cafPdmPointer.h" #include #include namespace caf { class DisplayCoordTransform; } namespace cvf { class BoundingBox; } class RigWellPath; class RimWellPath; class Rim3dWellLogCurve; class Riv3dWellLogCurveGeometryGenerator : public cvf::Object { public: using PointValuePair = std::pair; Riv3dWellLogCurveGeometryGenerator( RimWellPath* wellPath ); void createCurveDrawables( gsl::not_null displayCoordTransform, const cvf::BoundingBox& wellPathClipBoundingBox, gsl::not_null wellLogCurve, double planeOffsetFromWellPathCenter, double planeWidth, const std::vector& drawSurfaceVertices, int currentTimeStep ); void clearCurvePointsAndGeometry(); const RigWellPath* wellPathGeometry() const; cvf::ref curveDrawable(); bool findClosestPointOnCurve( const cvf::Vec3d& globalIntersection, cvf::Vec3d* closestPoint, double* measuredDepthAtPoint, double* valueAtClosestPoint ) const; private: void createNewVerticesAlongTriangleEdges( const std::vector& drawSurfaceVertices ); static void createNewVerticesAlongSegment( const cvf::Vec3d& ptStart, const cvf::Vec3d& ptEnd, const std::vector& drawSurfaceVertices, std::vector* extraVertices ); static std::vector projectVerticesOntoTriangles( const std::vector& originalVertices, const std::vector& drawSurfaceVertices ); static cvf::Vec3d projectPointOntoTriangle( const cvf::Vec3d& point, const cvf::Vec3d& triangleVertex1, const cvf::Vec3d& triangleVertex2, const cvf::Vec3d& triangleVertex3, bool* wasInsideTriangle ); caf::PdmPointer m_wellPath; double m_planeWidth; cvf::ref m_curveDrawable; std::vector m_curveVertices; std::vector m_curveMeasuredDepths; std::vector m_curveValues; };