Pathfinder
|
This file implements all functionality declared in Intersection.h. More...
#include <iostream>
#include <cmath>
#include <memory>
#include <chrono>
#include <spdlog/spdlog.h>
#include <spdlog/sinks/basic_file_sink.h>
#include <spdlog/stopwatch.h>
#include <spdlog/fmt/chrono.h>
#include "Intersection.h"
#include "TupleAccess.h"
#include "Vec.h"
#include "Flat.h"
#include "Compare.h"
Namespaces | |
Pathfinder | |
Enumerations | |
enum | Pathfinder::relativePosition : short { Pathfinder::below, Pathfinder::online, Pathfinder::above, Pathfinder::below, Pathfinder::online, Pathfinder::above } |
Functions | |
float | Pathfinder::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. More... | |
std::tuple< std::vector< short >, std::vector< short >, std::vector< short >, std::vector< short >, std::vector< short > > | Pathfinder::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. More... | |
short | Pathfinder::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. More... | |
std::tuple< short, short > | Pathfinder::tIndex2endpoints (const short &id) |
Translate the index of the tValues vector to the endpoints which were involved in the t value computation. More... | |
short | Pathfinder::endpoints2tIndex (const std::tuple< short, short > &e) |
Translate a pair of endpoint indices into the corresponding index of the tValue vector. More... | |
short | Pathfinder::getEquivalenttValueIndex (const short &id) |
For a given index of the tValues tuple, return the index of the tValues tuple which contains the t value that was comuputed by the same vertices but in reverse order. More... | |
std::tuple< bool, bool, bool > | Pathfinder::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) |
boost::optional< short > | Pathfinder::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. More... | |
float | Pathfinder::distanceToNewPoint (const Line3Norm &lij, const short &droppedCoord, const float &pointX, const float &pointY) |
boost::optional< Geometry::Vec3 > | Pathfinder::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) |
std::vector< std::vector< Geometry::Vec3 > > | Pathfinder::cutPlaneIntersectionsToPolygon (const Polygon *tri, const std::vector< std::vector< Geometry::Vec3 >> &intersections) |
std::tuple< float, float, float, float, float, float > | Pathfinder::computetValues (const Plane &p, const Polygon *tri) |
Given a plane and a polygon, compute the six possible t values. More... | |
std::vector< uint32_t > | Pathfinder::polygonInAABBIds (MeshAccessor *ma, AABB aabb) |
Compute which polygons of the mesh managed by ma intersect with the AABB aabb. More... | |
std::vector< Geometry::Vec3 > | Pathfinder::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. More... | |
std::vector< Geometry::Vec3 > | Pathfinder::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. More... | |
Geometry::Vec3 | Pathfinder::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 2ii. More... | |
std::vector< Geometry::Vec3 > | Pathfinder::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. More... | |
std::vector< std::tuple< Graph *, Graph *, std::vector< Geometry::Vec3 > > > | Pathfinder::intersection (Graph *smaller, Graph *bigger) |
Compute the intersection between the meshes. More... | |
This file implements all functionality declared in Intersection.h.