OGS
AnalyticalGeometry.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) OpenGeoSys Community (opengeosys.org)
2// SPDX-License-Identifier: BSD-3-Clause
3
4#pragma once
5
6#include <memory>
7
8#include "Polygon.h"
9
10namespace GeoLib
11{
12
14{
15 CW = -1,
17 CCW = 1
18};
19
26 MathLib::Point3d const& p1,
27 MathLib::Point3d const& p2);
34 MathLib::Point3d const& p1,
35 MathLib::Point3d const& p2);
49template <typename InputIterator>
50std::pair<Eigen::Vector3d, double> getNewellPlane(InputIterator pnts_begin,
51 InputIterator pnts_end);
52
63template <class T_POINT>
64std::pair<Eigen::Vector3d, double> getNewellPlane(
65 const std::vector<T_POINT*>& pnts);
66
69template <class T_POINT>
70std::pair<Eigen::Vector3d, double> getNewellPlane(
71 const std::vector<T_POINT>& pnts);
72
80Eigen::Matrix3d compute2DRotationMatrixToX(Eigen::Vector3d const& v);
81
88Eigen::Matrix3d compute3DRotationMatrixToX(Eigen::Vector3d const& v);
89
96Eigen::Matrix3d computeRotationMatrixToXY(Eigen::Vector3d const& n);
97
106template <typename InputIterator>
107void rotatePoints(Eigen::Matrix3d const& rot_mat, InputIterator pnts_begin,
108 InputIterator pnts_end);
109
115template <typename P>
116void rotatePoints(Eigen::Matrix3d const& rot_mat, std::vector<P*> const& pnts);
117
125Eigen::Matrix3d rotatePointsToXY(std::vector<Point*>& pnts);
126
140template <typename InputIterator1, typename InputIterator2>
141Eigen::Matrix3d rotatePointsToXY(InputIterator1 p_pnts_begin,
142 InputIterator1 p_pnts_end,
143 InputIterator2 r_pnts_begin,
144 InputIterator2 r_pnts_end);
145
156bool lineSegmentsIntersect(const Polyline* ply,
159 Point& intersection_pnt);
160
167bool parallel(Eigen::Vector3d v, Eigen::Vector3d w);
168
177bool lineSegmentIntersect(LineSegment const& s0, LineSegment const& s1,
178 Point& s);
179
189std::vector<MathLib::Point3d> lineSegmentIntersect2d(LineSegment const& ab,
190 LineSegment const& cd);
191
197std::unique_ptr<Point> triangleLineIntersection(MathLib::Point3d const& a,
198 MathLib::Point3d const& b,
199 MathLib::Point3d const& c,
200 MathLib::Point3d const& p,
201 MathLib::Point3d const& q);
202
212 std::vector<Polyline*>& plys);
213
224std::tuple<std::vector<GeoLib::Point*>, Eigen::Vector3d>
226
233void sortSegments(MathLib::Point3d const& seg_beg_pnt,
234 std::vector<LineSegment>& sub_segments);
235
236} // end namespace GeoLib
237
This class manages pointers to Points in a std::vector along with a name. It also handles the deletio...
Definition PointVec.h:25
Class Polyline consists mainly of a reference to a point vector and a vector that stores the indices ...
Definition Polyline.h:29
Orientation getOrientationFast(MathLib::Point3d const &p0, MathLib::Point3d const &p1, MathLib::Point3d const &p2)
Eigen::Matrix3d compute3DRotationMatrixToX(Eigen::Vector3d const &v)
bool lineSegmentsIntersect(const GeoLib::Polyline *ply, GeoLib::Polyline::SegmentIterator &seg_it0, GeoLib::Polyline::SegmentIterator &seg_it1, GeoLib::Point &intersection_pnt)
void computeAndInsertAllIntersectionPoints(GeoLib::PointVec &pnt_vec, std::vector< GeoLib::Polyline * > &plys)
void rotatePoints(Eigen::Matrix3d const &rot_mat, InputIterator pnts_begin, InputIterator pnts_end)
bool parallel(Eigen::Vector3d v, Eigen::Vector3d w)
std::tuple< std::vector< GeoLib::Point * >, Eigen::Vector3d > rotatePolygonPointsToXY(GeoLib::Polygon const &polygon_in)
Eigen::Matrix3d computeRotationMatrixToXY(Eigen::Vector3d const &n)
Eigen::Matrix3d rotatePointsToXY(InputIterator1 p_pnts_begin, InputIterator1 p_pnts_end, InputIterator2 r_pnts_begin, InputIterator2 r_pnts_end)
void sortSegments(MathLib::Point3d const &seg_beg_pnt, std::vector< GeoLib::LineSegment > &sub_segments)
std::vector< MathLib::Point3d > lineSegmentIntersect2d(GeoLib::LineSegment const &ab, GeoLib::LineSegment const &cd)
std::unique_ptr< GeoLib::Point > triangleLineIntersection(MathLib::Point3d const &a, MathLib::Point3d const &b, MathLib::Point3d const &c, MathLib::Point3d const &p, MathLib::Point3d const &q)
std::pair< Eigen::Vector3d, double > getNewellPlane(InputIterator pnts_begin, InputIterator pnts_end)
Eigen::Matrix3d compute2DRotationMatrixToX(Eigen::Vector3d const &v)
bool lineSegmentIntersect(GeoLib::LineSegment const &s0, GeoLib::LineSegment const &s1, GeoLib::Point &s)
Orientation getOrientation(MathLib::Point3d const &p0, MathLib::Point3d const &p1, MathLib::Point3d const &p2)