OGS
AnalyticalGeometry.h
Go to the documentation of this file.
1 
15 #pragma once
16 
17 #include <memory>
18 
19 #include "Polygon.h"
20 
21 namespace GeoLib
22 {
23 
25 {
26  CW = -1,
27  COLLINEAR = 0,
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);
57 template <typename InputIterator>
58 std::pair<Eigen::Vector3d, double> getNewellPlane(InputIterator pnts_begin,
59  InputIterator pnts_end);
60 
70 template <class T_POINT>
71 std::pair<Eigen::Vector3d, double> getNewellPlane(
72  const std::vector<T_POINT*>& pnts);
73 
76 template <class T_POINT>
77 std::pair<Eigen::Vector3d, double> getNewellPlane(
78  const std::vector<T_POINT>& pnts);
79 
87 Eigen::Matrix3d compute2DRotationMatrixToX(Eigen::Vector3d const& v);
88 
94 Eigen::Matrix3d compute3DRotationMatrixToX(Eigen::Vector3d const& v);
95 
102 Eigen::Matrix3d computeRotationMatrixToXY(Eigen::Vector3d const& n);
103 
110 template <typename InputIterator>
111 void rotatePoints(Eigen::Matrix3d const& rot_mat, InputIterator pnts_begin,
112  InputIterator pnts_end);
113 
119 template <typename P>
120 void rotatePoints(Eigen::Matrix3d const& rot_mat, std::vector<P*> const& pnts);
121 
128 Eigen::Matrix3d rotatePointsToXY(std::vector<Point*>& pnts);
129 
139 template <typename InputIterator1, typename InputIterator2>
140 Eigen::Matrix3d rotatePointsToXY(InputIterator1 p_pnts_begin,
141  InputIterator1 p_pnts_end,
142  InputIterator2 r_pnts_begin,
143  InputIterator2 r_pnts_end);
144 
153 bool lineSegmentsIntersect(const Polyline* ply,
154  Polyline::SegmentIterator& seg_it0,
155  Polyline::SegmentIterator& seg_it1,
156  Point& intersection_pnt);
157 
164 bool parallel(Eigen::Vector3d v, Eigen::Vector3d w);
165 
174 bool lineSegmentIntersect(LineSegment const& s0, LineSegment const& s1,
175  Point& s);
176 
186 std::vector<MathLib::Point3d> lineSegmentIntersect2d(
187  LineSegment const& ab, LineSegment const& cd);
188 
194 std::unique_ptr<Point> triangleLineIntersection(
195  MathLib::Point3d const& a, MathLib::Point3d const& b,
196  MathLib::Point3d const& c, MathLib::Point3d const& p,
197  MathLib::Point3d const& q);
198 
205 void computeAndInsertAllIntersectionPoints(PointVec &pnt_vec,
206  std::vector<Polyline*> & plys);
207 
219 Polygon rotatePolygonToXY(Polygon const& polygon_in,
220  Eigen::Vector3d& plane_normal);
221 
228 void sortSegments(MathLib::Point3d const& seg_beg_pnt,
229  std::vector<LineSegment>& sub_segments);
230 
231 } // end namespace GeoLib
232 
233 #include "AnalyticalGeometry-impl.h"
Definition of the Polygon class.
Orientation getOrientationFast(MathLib::Point3d const &p0, MathLib::Point3d const &p1, MathLib::Point3d const &p2)
GeoLib::Polygon rotatePolygonToXY(GeoLib::Polygon const &polygon_in, Eigen::Vector3d &plane_normal)
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)
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)
static const double q
TemplateElement< PointRule1 > Point
Definition: Point.h:20