2013-05-16 13:06:00 +02:00
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
//
|
|
|
|
|
// Copyright (C) 2011-2012 Statoil ASA, Ceetron AS
|
2019-09-06 10:40:57 +02:00
|
|
|
//
|
2013-05-16 13:06:00 +02:00
|
|
|
// 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.
|
2019-09-06 10:40:57 +02:00
|
|
|
//
|
2013-05-16 13:06:00 +02:00
|
|
|
// 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.
|
2019-09-06 10:40:57 +02:00
|
|
|
//
|
|
|
|
|
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
2013-05-16 13:06:00 +02:00
|
|
|
// for more details.
|
|
|
|
|
//
|
|
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
2020-10-06 15:00:39 +02:00
|
|
|
#include "cafSignal.h"
|
|
|
|
|
|
2019-09-06 10:40:57 +02:00
|
|
|
#include "cvfObject.h"
|
2013-05-16 13:06:00 +02:00
|
|
|
#include "cvfVector3.h"
|
|
|
|
|
|
2020-10-06 15:00:39 +02:00
|
|
|
#include <vector>
|
|
|
|
|
|
2018-03-20 13:12:20 +01:00
|
|
|
namespace cvf
|
|
|
|
|
{
|
2019-09-06 10:40:57 +02:00
|
|
|
class BoundingBox;
|
2018-03-20 13:12:20 +01:00
|
|
|
}
|
|
|
|
|
|
2013-05-16 13:06:00 +02:00
|
|
|
//==================================================================================================
|
2019-09-06 10:40:57 +02:00
|
|
|
///
|
2013-05-16 13:06:00 +02:00
|
|
|
//==================================================================================================
|
2020-10-06 15:00:39 +02:00
|
|
|
class RigWellPath : public cvf::Object, public caf::SignalEmitter
|
2013-05-16 13:06:00 +02:00
|
|
|
{
|
2020-10-06 15:00:39 +02:00
|
|
|
public:
|
|
|
|
|
caf::Signal<> objectBeingDeleted;
|
|
|
|
|
|
2013-05-16 13:06:00 +02:00
|
|
|
public:
|
2020-10-06 12:37:16 +02:00
|
|
|
RigWellPath();
|
|
|
|
|
RigWellPath( const std::vector<cvf::Vec3d>& wellPathPoints, const std::vector<double>& measuredDepths );
|
|
|
|
|
RigWellPath( const RigWellPath& rhs );
|
|
|
|
|
RigWellPath& operator=( const RigWellPath& rhs );
|
2021-04-15 02:14:51 +00:00
|
|
|
~RigWellPath() override;
|
2016-10-25 14:56:26 +02:00
|
|
|
|
2019-09-06 10:40:57 +02:00
|
|
|
const std::vector<cvf::Vec3d>& wellPathPoints() const;
|
2020-10-06 12:37:16 +02:00
|
|
|
const std::vector<double>& measuredDepths() const;
|
2019-09-06 10:40:57 +02:00
|
|
|
std::vector<double> trueVerticalDepths() const;
|
2018-07-02 14:51:17 +02:00
|
|
|
|
2020-10-06 12:37:16 +02:00
|
|
|
void setWellPathPoints( const std::vector<cvf::Vec3d>& wellPathPoints );
|
|
|
|
|
void setMeasuredDepths( const std::vector<double>& measuredDepths );
|
|
|
|
|
|
|
|
|
|
void addWellPathPoint( const cvf::Vec3d& wellPathPoint );
|
|
|
|
|
void addMeasuredDepth( double measuredDepth );
|
|
|
|
|
|
2019-09-06 10:40:57 +02:00
|
|
|
void setDatumElevation( double value );
|
|
|
|
|
bool hasDatumElevation() const;
|
|
|
|
|
double datumElevation() const;
|
|
|
|
|
double rkbDiff() const;
|
|
|
|
|
cvf::Vec3d interpolatedVectorValuesAlongWellPath( const std::vector<cvf::Vec3d>& vectors,
|
|
|
|
|
double measuredDepth,
|
|
|
|
|
double* horizontalLengthAlongWellToStartClipPoint = nullptr ) const;
|
|
|
|
|
cvf::Vec3d interpolatedPointAlongWellPath( double measuredDepth,
|
|
|
|
|
double* horizontalLengthAlongWellToStartClipPoint = nullptr ) const;
|
|
|
|
|
|
2021-01-04 11:09:01 +01:00
|
|
|
cvf::Vec3d tangentAlongWellPath( double measuredDepth ) const;
|
|
|
|
|
|
2019-09-06 10:40:57 +02:00
|
|
|
double wellPathAzimuthAngle( const cvf::Vec3d& position ) const;
|
|
|
|
|
void twoClosestPoints( const cvf::Vec3d& position, cvf::Vec3d* p1, cvf::Vec3d* p2 ) const;
|
2020-10-07 13:53:36 +02:00
|
|
|
double identicalTubeLength( const RigWellPath& otherWellPathGeometry ) const;
|
2021-08-13 16:48:33 +02:00
|
|
|
double closestMeasuredDepth( const cvf::Vec3d& position ) const;
|
2019-09-06 10:40:57 +02:00
|
|
|
|
2020-10-14 18:55:17 +02:00
|
|
|
static cvf::ref<RigWellPath> commonGeometry( const std::vector<const RigWellPath*>& allGeometries );
|
2021-02-26 14:27:59 +01:00
|
|
|
void setUniqueStartAndEndIndex( size_t uniqueStartIndex, size_t uniqueEndIndex );
|
2021-01-04 11:09:01 +01:00
|
|
|
size_t uniqueStartIndex() const;
|
2021-02-26 14:27:59 +01:00
|
|
|
size_t uniqueEndIndex() const;
|
2020-10-16 07:36:29 +02:00
|
|
|
std::vector<cvf::Vec3d> uniqueWellPathPoints() const;
|
2021-01-04 11:09:01 +01:00
|
|
|
std::vector<double> uniqueMeasuredDepths() const;
|
2020-10-09 08:38:18 +02:00
|
|
|
|
2019-11-04 14:35:41 +01:00
|
|
|
std::pair<std::vector<cvf::Vec3d>, std::vector<double>>
|
2020-02-12 11:43:15 +01:00
|
|
|
clippedPointSubset( double startMD, double endMD, double* horizontalLengthAlongWellToStartClipPoint = nullptr ) const;
|
2018-04-13 14:35:14 +02:00
|
|
|
|
2019-09-06 10:40:57 +02:00
|
|
|
std::vector<cvf::Vec3d> wellPathPointsIncludingInterpolatedIntersectionPoint( double intersectionMeasuredDepth ) const;
|
2017-09-19 17:20:49 +02:00
|
|
|
|
2019-09-06 10:40:57 +02:00
|
|
|
static bool isAnyPointInsideBoundingBox( const std::vector<cvf::Vec3d>& points, const cvf::BoundingBox& boundingBox );
|
2016-10-25 14:56:26 +02:00
|
|
|
|
2019-09-06 10:40:57 +02:00
|
|
|
static std::vector<cvf::Vec3d> clipPolylineStartAboveZ( const std::vector<cvf::Vec3d>& polyLine,
|
|
|
|
|
double maxZ,
|
|
|
|
|
double* horizontalLengthAlongWellToClipPoint,
|
|
|
|
|
size_t* indexToFirstVisibleSegment );
|
2018-01-16 07:54:03 +01:00
|
|
|
|
2021-08-13 16:48:33 +02:00
|
|
|
private:
|
|
|
|
|
std::pair<size_t, size_t> closestIndices( const cvf::Vec3d& position ) const;
|
|
|
|
|
|
2016-10-25 14:56:26 +02:00
|
|
|
private:
|
2020-10-06 12:37:16 +02:00
|
|
|
std::vector<cvf::Vec3d> m_wellPathPoints;
|
|
|
|
|
std::vector<double> m_measuredDepths;
|
|
|
|
|
|
2019-09-06 10:40:57 +02:00
|
|
|
bool m_hasDatumElevation;
|
|
|
|
|
double m_datumElevation;
|
2021-02-26 14:27:59 +01:00
|
|
|
size_t m_uniqueStartIndex;
|
|
|
|
|
size_t m_uniqueEndIndex;
|
2013-05-16 13:06:00 +02:00
|
|
|
};
|