///////////////////////////////////////////////////////////////////////////////// // // Copyright (C) 2018- Statoil 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 "cvfBase.h" #include "cvfDrawableGeo.h" #include "cvfObject.h" #include "cvfVector3.h" #include "cafPdmPointer.h" #include namespace caf { class DisplayCoordTransform; } namespace cvf { class BoundingBox; } class RigWellPath; class RimWellPath; class Rim3dWellLogCurve; class Riv3dWellLogCurveGeometryGenerator : public cvf::Object { public: typedef std::pair PointValuePair; Riv3dWellLogCurveGeometryGenerator(RimWellPath* wellPath); void createCurveDrawables(const caf::DisplayCoordTransform* displayCoordTransform, const cvf::BoundingBox& wellPathClipBoundingBox, const Rim3dWellLogCurve* rim3dWellLogCurve, double planeOffsetFromWellPathCenter, double planeWidth, const std::vector& drawSurfaceVertices); 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); void projectVerticesOntoTriangles(const std::vector& drawSurfaceVertices); static cvf::Vec3f projectPointOntoTriangle(const cvf::Vec3f& point, const cvf::Vec3f& triangleVertex1, const cvf::Vec3f& triangleVertex2, const cvf::Vec3f& 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; };