Pathfinder
Flat.h
Go to the documentation of this file.
1 
10 #ifndef FLAT_H
11 #define FLAT_H
12 
13 #include "Line2.h"
14 
15 namespace Pathfinder {
16 
27  short
29  const Polygon* tri
30  );
31 
32 
43  std::tuple<Geometry::Vec2, Geometry::Vec2, Geometry::Vec2>
44  flattenTri(
45  const Polygon* tri,
46  const short& coord
47  );
48 
49 
59  Geometry::Vec2
61  const Geometry::Vec3& a,
62  const short& coord
63  );
64 
65 
83  std::tuple<short, short, short>
85  Geometry::Vec2 point,
86  const std::tuple<Line2, Line2, Line2>& tri
87  );
88 
89 
112  std::vector<bool>
114  const std::vector<Geometry::Vec3>& pointVec,
115  const std::tuple<Line2, Line2, Line2>& tri,
116  const short& droppedCoord,
117  const std::tuple<short, short, short>& relPosCenter
118  );
119 
120 
141  std::vector<bool>
143  const std::vector<Geometry::Vec2>& pointVec,
144  const std::tuple<Line2, Line2, Line2>& tri,
145  const std::tuple<short, short, short>& relPosCenter
146  );
147 
148 
168  bool
170  const Geometry::Vec3& point,
171  const std::tuple<Line2, Line2, Line2>& tri,
172  const short& droppedCoord,
173  const std::tuple<short, short, short>& relPosCenter
174  );
175 
176 
194  bool
196  const Geometry::Vec2& point,
197  const std::tuple<Line2, Line2, Line2>& tri,
198  const std::tuple<short, short, short>& relPosCenter
199  );
200 
201 
215  bool
217  Geometry::Vec2& p,
218  Geometry::Vec2& lowerLeft,
219  Geometry::Vec2& upperRight
220  );
221 
222 
237  std::tuple<Geometry::Vec2, Geometry::Vec2>
239  Geometry::Vec2& pi,
240  Geometry::Vec2& pj
241  );
242 
243 }
244 
245 #endif
short coordToDrop(const Polygon *tri)
Decide which coordinate shall be dropped for flattening this polygon.
Definition: Flat.cpp:30
bool pointInRectangle(Geometry::Vec2 &p, Geometry::Vec2 &lowerLeft, Geometry::Vec2 &upperRight)
Given a rectangle defined by two points, check if p lies inside it.
Definition: Flat.cpp:231
Definition: AABB.cpp:21
std::tuple< Geometry::Vec2, Geometry::Vec2, Geometry::Vec2 > flattenTri(const Polygon *tri, const short &coord)
Flatten the given polygon onto the xy/xz/yz plane.
Definition: Flat.cpp:53
std::tuple< short, short, short > determineRelativePos(Geometry::Vec2 point, const std::tuple< Line2, Line2, Line2 > &tri)
Determine the relative position of a point to three lines.
Definition: Flat.cpp:83
bool pointInsideTri(const Geometry::Vec3 &point, const std::tuple< Line2, Line2, Line2 > &tri, const short &droppedCoord, const std::tuple< short, short, short > &relPosCenter)
For a point in three-dimensional space, determine if it lies inside or outside a given polygon...
Definition: Flat.cpp:184
This file declares the struct Line2 that represents a two-dimensional line.
std::tuple< Geometry::Vec2, Geometry::Vec2 > buildRectangle(Geometry::Vec2 &pi, Geometry::Vec2 &pj)
Given two points, construct a tuple of points that describe the lower left and upper right corner of ...
Definition: Flat.cpp:247
Geometry::Vec2 flattenVec3(const Geometry::Vec3 &a, const short &coord)
Flatten the given vector onto the xy/xz/yz plane.
Definition: Flat.cpp:72
std::vector< bool > pointVecInsideTri(const std::vector< Geometry::Vec3 > &pointVec, const std::tuple< Line2, Line2, Line2 > &tri, const short &droppedCoord, const std::tuple< short, short, short > &relPosCenter)
For a vector of points in three-dimensional space, determine if the inidividual points lie inside or ...
Definition: Flat.cpp:124