2018-07-02 14:47:56 +02:00
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
//
|
2019-01-09 15:15:34 +01:00
|
|
|
// Copyright (C) 2018- Equinor ASA
|
2018-11-16 08:43:19 +01:00
|
|
|
//
|
2018-07-02 14:47:56 +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.
|
2018-11-16 08:43:19 +01:00
|
|
|
//
|
2018-07-02 14:47:56 +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.
|
2018-11-16 08:43:19 +01:00
|
|
|
//
|
|
|
|
|
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
2018-07-02 14:47:56 +02:00
|
|
|
// for more details.
|
|
|
|
|
//
|
|
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
2019-01-09 15:15:34 +01:00
|
|
|
|
2018-07-02 14:47:56 +02:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include "cvfVector3.h"
|
|
|
|
|
|
|
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
|
|
class RiaPolyArcLineSampler
|
|
|
|
|
{
|
|
|
|
|
public:
|
2019-09-06 10:40:57 +02:00
|
|
|
RiaPolyArcLineSampler( const cvf::Vec3d& startTangent, const std::vector<cvf::Vec3d>& lineArcEndPoints );
|
2018-07-02 14:47:56 +02:00
|
|
|
|
2020-10-06 12:37:16 +02:00
|
|
|
std::pair<std::vector<cvf::Vec3d>, std::vector<double>> sampledPointsAndMDs( double maxSampleInterval,
|
|
|
|
|
bool isResamplingLines );
|
2018-07-02 14:47:56 +02:00
|
|
|
|
2019-09-06 10:40:57 +02:00
|
|
|
static std::vector<cvf::Vec3d> pointsWithoutDuplicates( const std::vector<cvf::Vec3d>& points );
|
2018-07-02 14:47:56 +02:00
|
|
|
|
|
|
|
|
private:
|
2019-09-06 10:40:57 +02:00
|
|
|
void sampleLine( cvf::Vec3d p1, cvf::Vec3d p2, cvf::Vec3d* endTangent );
|
|
|
|
|
void sampleArc( cvf::Vec3d t1, cvf::Vec3d p1, cvf::Vec3d p2, cvf::Vec3d* endTangent );
|
|
|
|
|
void sampleSegment( cvf::Vec3d t1, cvf::Vec3d p1, cvf::Vec3d p2, cvf::Vec3d* endTangent );
|
2018-07-02 14:47:56 +02:00
|
|
|
|
2020-06-03 20:31:58 +00:00
|
|
|
std::vector<cvf::Vec3d>* m_points; // Internal temporary pointers to collections being filled.
|
2018-07-02 14:47:56 +02:00
|
|
|
std::vector<double>* m_meshDs;
|
|
|
|
|
|
2019-11-19 11:08:59 +01:00
|
|
|
double m_maxSamplingsInterval;
|
|
|
|
|
const double m_maxSamplingArcAngle = 0.07310818; // Angle from 6 deg dogleg on 10 m
|
|
|
|
|
bool m_isResamplingLines;
|
|
|
|
|
double m_totalMD;
|
2018-07-02 14:47:56 +02:00
|
|
|
|
2018-11-16 08:43:19 +01:00
|
|
|
cvf::Vec3d m_startTangent;
|
|
|
|
|
std::vector<cvf::Vec3d> m_lineArcEndPoints;
|
|
|
|
|
};
|