///////////////////////////////////////////////////////////////////////////////// // // Copyright (C) 2011-2012 Statoil ASA, Ceetron AS // // 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 "cafSignal.h" #include "cvfObject.h" #include "cvfVector3.h" #include namespace cvf { class BoundingBox; } //================================================================================================== /// //================================================================================================== class RigWellPath : public cvf::Object, public caf::SignalEmitter { public: caf::Signal<> objectBeingDeleted; public: RigWellPath(); RigWellPath( const std::vector& wellPathPoints, const std::vector& measuredDepths ); RigWellPath( const RigWellPath& rhs ); RigWellPath& operator=( const RigWellPath& rhs ); ~RigWellPath() override; const std::vector& wellPathPoints() const; const std::vector& measuredDepths() const; std::vector trueVerticalDepths() const; void setWellPathPoints( const std::vector& wellPathPoints ); void setMeasuredDepths( const std::vector& measuredDepths ); void addWellPathPoint( const cvf::Vec3d& wellPathPoint ); void addMeasuredDepth( double measuredDepth ); void setDatumElevation( double value ); bool hasDatumElevation() const; double datumElevation() const; double rkbDiff() const; cvf::Vec3d interpolatedVectorValuesAlongWellPath( const std::vector& vectors, double measuredDepth, double* horizontalLengthAlongWellToStartClipPoint = nullptr ) const; cvf::Vec3d interpolatedPointAlongWellPath( double measuredDepth, double* horizontalLengthAlongWellToStartClipPoint = nullptr ) const; cvf::Vec3d tangentAlongWellPath( double measuredDepth ) const; double wellPathAzimuthAngle( const cvf::Vec3d& position ) const; void twoClosestPoints( const cvf::Vec3d& position, cvf::Vec3d* p1, cvf::Vec3d* p2 ) const; double identicalTubeLength( const RigWellPath& otherWellPathGeometry ) const; double closestMeasuredDepth( const cvf::Vec3d& position ) const; static cvf::ref commonGeometry( const std::vector& allGeometries ); void setUniqueStartAndEndIndex( size_t uniqueStartIndex, size_t uniqueEndIndex ); size_t uniqueStartIndex() const; size_t uniqueEndIndex() const; std::vector uniqueWellPathPoints() const; std::vector uniqueMeasuredDepths() const; std::pair, std::vector> clippedPointSubset( double startMD, double endMD, double* horizontalLengthAlongWellToStartClipPoint = nullptr ) const; std::vector wellPathPointsIncludingInterpolatedIntersectionPoint( double intersectionMeasuredDepth ) const; static bool isAnyPointInsideBoundingBox( const std::vector& points, const cvf::BoundingBox& boundingBox ); static std::vector clipPolylineStartAboveZ( const std::vector& polyLine, const double maxZ, double& horizontalLengthAlongWellToClipPoint, double& measuredDepthAtFirstClipPoint, size_t& indexToFirstVisibleSegment ); private: std::pair closestIndices( const cvf::Vec3d& position ) const; private: std::vector m_wellPathPoints; std::vector m_measuredDepths; bool m_hasDatumElevation; double m_datumElevation; size_t m_uniqueStartIndex; size_t m_uniqueEndIndex; };