Add Well paths to other well paths

This commit is contained in:
Gaute Lindkvist
2020-10-07 13:53:36 +02:00
parent 2a06f74076
commit 52e3214b0e
6 changed files with 88 additions and 5 deletions

View File

@@ -341,6 +341,36 @@ void RigWellPath::twoClosestPoints( const cvf::Vec3d& position, cvf::Vec3d* p1,
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
double RigWellPath::identicalTubeLength( const RigWellPath& other ) const
{
const double eps = 1.0e-8;
size_t minimumVertices = std::min( m_wellPathPoints.size(), other.wellPathPoints().size() );
if ( minimumVertices < 2u ) return 0.0;
size_t minimumSegments = minimumVertices - 1u;
double identicalMD = 0.0;
for ( size_t segmentIndex = 0; segmentIndex < minimumSegments; ++segmentIndex )
{
size_t vIndex1 = segmentIndex;
size_t vIndex2 = segmentIndex + 1u;
if ( ( m_wellPathPoints[vIndex1] - other.wellPathPoints()[vIndex1] ).length() < eps &&
( m_wellPathPoints[vIndex2] - other.wellPathPoints()[vIndex2] ).length() < eps )
{
identicalMD = m_measuredDepths[vIndex2];
}
else
{
break;
}
}
return identicalMD;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------

View File

@@ -68,6 +68,7 @@ public:
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;
std::pair<std::vector<cvf::Vec3d>, std::vector<double>>
clippedPointSubset( double startMD, double endMD, double* horizontalLengthAlongWellToStartClipPoint = nullptr ) const;