10 #ifndef INTERSECTION_H 11 #define INTERSECTION_H 13 #include <boost/optional/optional_io.hpp> 37 const Geometry::Vec3& p1,
38 const Geometry::Vec3& p2
60 std::tuple<std::vector<short>,
66 const std::tuple<float, float, float, float, float, float>& tValues
84 const std::tuple<std::vector<short>,
88 std::vector<short>>& categorizedtValueIndices
106 std::tuple<short, short>
126 const std::tuple<short, short>& e
174 std::tuple<bool, bool, bool>
178 const std::tuple<boost::optional<float>,
179 boost::optional<float>,
180 boost::optional<float>>& intersections,
181 const std::tuple<Line2, Line2, Line2>& tri,
182 const std::tuple<bool, bool, bool>& centerAbove
205 boost::optional<short>
207 const std::tuple<Line2, Line2, Line2>& tri,
208 const std::tuple<boost::optional<float>,
209 boost::optional<float>,
210 boost::optional<float>>& intersections,
211 const std::tuple<bool, bool, bool>& valid,
212 Geometry::Vec2& pjFlat
234 const short& droppedCoord,
256 boost::optional<Geometry::Vec3>
258 const Geometry::Vec3& pi,
259 const Geometry::Vec3& pj,
260 const short& droppedCoord,
261 const std::vector<bool>& inside,
262 const std::tuple<Line2, Line2, Line2>& tri
282 std::vector<std::vector<boost::optional<Geometry::Vec3>>>
284 const std::vector<Geometry::Vec3>& tri,
285 const std::vector<std::vector<Geometry::Vec3>>& intersections
304 std::tuple<float, float, float, float, float, float>
322 std::vector<uint32_t>
344 std::vector<Geometry::Vec3>
347 const std::tuple<float, float, float, float, float, float>& tValues,
348 const std::tuple<std::vector<short>,
352 std::vector<short>>& categorizedtValueIndices
373 std::vector<Geometry::Vec3>
376 const std::tuple<float, float, float, float, float, float>& tValues,
377 const std::tuple<std::vector<short>,
381 std::vector<short>>& categorizedtValueIndices
400 const short& vertexOnPlane,
401 const std::tuple<float, float, float, float, float, float>& tValues
417 std::vector<Geometry::Vec3>
420 const std::tuple<std::vector<short>,
424 std::vector<short>>& categorizedtValueIndices
436 std::vector<std::tuple<Graph*, Graph*, std::vector<Geometry::Vec3>>>
short determineIntersectionCase(const std::tuple< std::vector< short >, std::vector< short >, std::vector< short >, std::vector< short >, std::vector< short >> &categorizedtValueIndices)
Determine which intersection case should be considered for the computed t values. ...
Definition: Intersection.cpp:83
boost::optional< Geometry::Vec3 > cutPointToPolygon(const Geometry::Vec3 &pi, const Geometry::Vec3 &pj, const short &droppedCoord, const std::vector< bool > &inside, const Polygon *tri, const std::tuple< Line2, Line2, Line2 > &triLines, const std::tuple< short, short, short > &relPosCenter)
Definition: Intersection.cpp:316
This file declares the struct Plane that represents a plane in three-dimensional space.
std::tuple< short, short > tIndex2endpoints(const short &id)
Translate the index of the tValues vector to the endpoints which were involved in the t value computa...
Definition: Intersection.cpp:108
short endpoints2tIndex(const std::tuple< short, short > &e)
Translate a pair of endpoint indices into the corresponding index of the tValue vector.
Definition: Intersection.cpp:122
std::tuple< float, float, float, float, float, float > computetValues(const Plane &p, const Polygon *tri)
Given a plane and a polygon, compute the six possible t values.
Definition: Intersection.cpp:485
boost::optional< short > chooseIntersection(const std::tuple< Line2, Line2, Line2 > &tri, const std::tuple< boost::optional< float >, boost::optional< float >, boost::optional< float >> &intersections, const std::tuple< bool, bool, bool > &valid, Geometry::Vec2 &pjFlat)
When moving a point on an intersection line, determine which intersection to use as a new endpoint...
Definition: Intersection.cpp:225
std::vector< uint32_t > polygonInAABBIds(MeshAccessor *ma, AABB aabb)
Compute which polygons of the mesh managed by ma intersect with the AABB aabb.
Definition: Intersection.cpp:498
std::vector< Geometry::Vec3 > handleIntersectionCase1(Polygon *tri, const std::tuple< float, float, float, float, float, float > &tValues, const std::tuple< std::vector< short >, std::vector< short >, std::vector< short >, std::vector< short >, std::vector< short >> &categorizedtValueIndices)
Do the necessary computations to obtain the intersection endpoints for intersection case 1...
Definition: Intersection.cpp:517
Geometry::Vec3 handleIntersectionCase2ii(const Polygon *tri, const short &vertexOnPlane, const std::tuple< float, float, float, float, float, float > &tValues)
Do the necessary computations to obtain the additional intersection endpoint for intersection case 2i...
Definition: Intersection.cpp:630
short getEquivalenttValueIndex(const short &id)
For a given index of the tValues tuple, return the index of the tValues tuple which contains the t va...
Definition: Intersection.cpp:145
float t(const Plane &p, const Geometry::Vec3 &p1, const Geometry::Vec3 &p2)
Compute the t value for a plane and two points that form a line.
Definition: Intersection.cpp:30
boost::adjacency_list< boost::vecS, boost::vecS, boost::undirectedS, GraphVertex, GraphEdge > Graph
Shorthand notation for the graph used.
Definition: Using.h:42
std::vector< std::tuple< Graph *, Graph *, std::vector< Geometry::Vec3 > > > intersection(Graph *smaller, Graph *bigger)
Compute the intersection between the meshes.
Definition: Intersection.cpp:707
std::vector< std::vector< Geometry::Vec3 > > cutPlaneIntersectionsToPolygon(const Polygon *tri, const std::vector< std::vector< Geometry::Vec3 >> &intersections)
Definition: Intersection.cpp:374
This file declares the struct Line2 that represents a two-dimensional line.
std::tuple< std::vector< short >, std::vector< short >, std::vector< short >, std::vector< short >, std::vector< short > > categorizetValueIndices(const std::tuple< float, float, float, float, float, float > &tValues)
Sort each computed t into a tuple of vectors where each vector corresponds to one specific interval...
Definition: Intersection.cpp:45
This file declares the struct Line3Norm that inherits from Line3.
std::vector< Geometry::Vec3 > handleIntersectionCase3(Polygon *tri, const std::tuple< std::vector< short >, std::vector< short >, std::vector< short >, std::vector< short >, std::vector< short >> &categorizedtValueIndices)
Do the necessary computations to obtain the intersection endpoints for intersection case 3...
Definition: Intersection.cpp:669
std::vector< Geometry::Vec3 > handleIntersectionCase2(const Polygon *tri, const std::tuple< float, float, float, float, float, float > &tValues, const std::tuple< std::vector< short >, std::vector< short >, std::vector< short >, std::vector< short >, std::vector< short >> &categorizedtValueIndices)
Do the necessary computations to obtain the intersection endpoints for intersection case 2...
Definition: Intersection.cpp:565
float distanceToNewPoint(const Line3Norm &lij, const short &droppedCoord, const float &pointX, const float &pointY)
Definition: Intersection.cpp:261
std::tuple< bool, bool, bool > intersectionTupleValid(Geometry::Vec2 &pi, Geometry::Vec2 &pj, const std::tuple< boost::optional< float >, boost::optional< float >, boost::optional< float >> &intersections, const std::tuple< Line2, Line2, Line2 > &tri, const std::tuple< short, short, short > &relPosCenter)
Definition: Intersection.cpp:159
This file declares the struct Line3Unnorm that inherits from Line3.