OGS
AnalyticalGeometry.h
Go to the documentation of this file.
1
15#pragma once
16
17#include <memory>
18
19#include "Polygon.h"
20
21namespace GeoLib
22{
23
25{
26 CW = -1,
28 CCW = 1
29};
30
37 MathLib::Point3d const& p1,
38 MathLib::Point3d const& p2);
45 MathLib::Point3d const& p1,
46 MathLib::Point3d const& p2);
60template <typename InputIterator>
61std::pair<Eigen::Vector3d, double> getNewellPlane(InputIterator pnts_begin,
62 InputIterator pnts_end);
63
74template <class T_POINT>
75std::pair<Eigen::Vector3d, double> getNewellPlane(
76 const std::vector<T_POINT*>& pnts);
77
80template <class T_POINT>
81std::pair<Eigen::Vector3d, double> getNewellPlane(
82 const std::vector<T_POINT>& pnts);
83
91Eigen::Matrix3d compute2DRotationMatrixToX(Eigen::Vector3d const& v);
92
99Eigen::Matrix3d compute3DRotationMatrixToX(Eigen::Vector3d const& v);
100
107Eigen::Matrix3d computeRotationMatrixToXY(Eigen::Vector3d const& n);
108
117template <typename InputIterator>
118void rotatePoints(Eigen::Matrix3d const& rot_mat, InputIterator pnts_begin,
119 InputIterator pnts_end);
120
126template <typename P>
127void rotatePoints(Eigen::Matrix3d const& rot_mat, std::vector<P*> const& pnts);
128
136Eigen::Matrix3d rotatePointsToXY(std::vector<Point*>& pnts);
137
151template <typename InputIterator1, typename InputIterator2>
152Eigen::Matrix3d rotatePointsToXY(InputIterator1 p_pnts_begin,
153 InputIterator1 p_pnts_end,
154 InputIterator2 r_pnts_begin,
155 InputIterator2 r_pnts_end);
156
167bool lineSegmentsIntersect(const Polyline* ply,
168 Polyline::SegmentIterator& seg_it0,
169 Polyline::SegmentIterator& seg_it1,
170 Point& intersection_pnt);
171
178bool parallel(Eigen::Vector3d v, Eigen::Vector3d w);
179
188bool lineSegmentIntersect(LineSegment const& s0, LineSegment const& s1,
189 Point& s);
190
200std::vector<MathLib::Point3d> lineSegmentIntersect2d(LineSegment const& ab,
201 LineSegment const& cd);
202
208std::unique_ptr<Point> triangleLineIntersection(MathLib::Point3d const& a,
209 MathLib::Point3d const& b,
210 MathLib::Point3d const& c,
211 MathLib::Point3d const& p,
212 MathLib::Point3d const& q);
213
222void computeAndInsertAllIntersectionPoints(PointVec& pnt_vec,
223 std::vector<Polyline*>& plys);
224
235std::tuple<std::vector<GeoLib::Point*>, Eigen::Vector3d>
237
244void sortSegments(MathLib::Point3d const& seg_beg_pnt,
245 std::vector<LineSegment>& sub_segments);
246
247} // end namespace GeoLib
248
Definition of the Polygon class.
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)