2018-03-22 08:35:54 -05:00
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
2019-01-09 08:21:38 -06:00
|
|
|
// Copyright (C) 2018- Equinor ASA
|
2018-03-22 08:35:54 -05: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.
|
|
|
|
//
|
|
|
|
// 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 <http://www.gnu.org/licenses/gpl.html>
|
|
|
|
// for more details.
|
|
|
|
//
|
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "cvfVector3.h"
|
|
|
|
|
2022-03-18 07:16:07 -05:00
|
|
|
#include <QPolygon>
|
2019-08-30 08:23:11 -05:00
|
|
|
|
2021-08-13 09:48:33 -05:00
|
|
|
#include <gsl/gsl>
|
2022-03-18 07:16:07 -05:00
|
|
|
#include <vector>
|
2021-08-13 09:48:33 -05:00
|
|
|
|
2018-03-22 08:35:54 -05:00
|
|
|
class RigWellPath;
|
|
|
|
|
|
|
|
//==================================================================================================
|
2019-09-04 03:54:41 -05:00
|
|
|
///
|
2018-03-22 08:35:54 -05:00
|
|
|
//==================================================================================================
|
|
|
|
class RigWellPathGeometryTools
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
enum VertexOrganization
|
|
|
|
{
|
|
|
|
LINE_SEGMENTS,
|
|
|
|
POLYLINE
|
|
|
|
};
|
|
|
|
|
|
|
|
public:
|
2019-09-06 03:40:57 -05:00
|
|
|
static std::vector<cvf::Vec3d> calculateLineSegmentNormals( const std::vector<cvf::Vec3d>& vertices, double angle );
|
|
|
|
static std::vector<double> interpolateMdFromTvd( const std::vector<double>& originalMdValues,
|
|
|
|
const std::vector<double>& originalTvdValues,
|
|
|
|
const std::vector<double>& tvdValuesToInterpolateFrom );
|
2019-08-28 09:00:01 -05:00
|
|
|
|
2023-02-26 03:48:40 -06:00
|
|
|
static std::pair<double, double> calculateAzimuthAndInclinationAtMd( double measuredDepth,
|
|
|
|
gsl::not_null<const RigWellPath*> wellPathGeometry );
|
2021-08-13 09:48:33 -05:00
|
|
|
|
2018-04-13 06:34:41 -05:00
|
|
|
private:
|
2019-09-06 03:40:57 -05:00
|
|
|
static std::vector<cvf::Vec3d> interpolateUndefinedNormals( const cvf::Vec3d& planeNormal,
|
|
|
|
const std::vector<cvf::Vec3d>& normals,
|
|
|
|
const std::vector<cvf::Vec3d>& vertices );
|
|
|
|
static cvf::Vec3d estimateDominantDirectionInXYPlane( const std::vector<cvf::Vec3d>& vertices );
|
2019-08-28 09:00:01 -05:00
|
|
|
|
2022-03-18 07:16:07 -05:00
|
|
|
static double solveForX( const QPolygonF& spline, double minX, double maxX, double y );
|
2019-09-02 08:11:00 -05:00
|
|
|
|
2023-02-26 03:48:40 -06:00
|
|
|
static QPolygonF createSplinePoints( const std::vector<double>& originalMdValues, const std::vector<double>& originalTvdValues );
|
2022-03-18 07:16:07 -05:00
|
|
|
|
2023-02-26 03:48:40 -06:00
|
|
|
static std::vector<int> findSplineSegmentsContainingRoots( const QPolygonF& points, const std::vector<double>& tvdValuesToInterpolateFrom );
|
2022-03-18 07:16:07 -05:00
|
|
|
|
|
|
|
// Temporary helper function to method removed from Qwt >= 6.2
|
|
|
|
static int lookup( double x, const QPolygonF& values );
|
|
|
|
static double value( double x, const QPolygonF& values );
|
2018-03-22 08:35:54 -05:00
|
|
|
};
|