DFNgen  2.0
DFN Model Generator
computationalGeometry.h
Go to the documentation of this file.
1 #ifndef _computationalGeometry_h_
2 #define _computationalGeometry_h_
3 #include "structures.h"
4 #include <fstream>
5 
6 void createBoundingBox(struct Poly &newPoly);
7 void printBoundingBox(struct Poly &newPoly);
8 bool checkBoundingBox(struct Poly &poly1, struct Poly &poly2);
9 struct IntPoints findIntersections(short &flag, struct Poly &poly1, struct Poly &poly2);
10 int FRAM(struct IntPoints &intPts,unsigned int count, std::vector<IntPoints> &intPtsList, struct Poly &newPoly, struct Poly &poly2, struct Stats &pstats, std::vector<TriplePtTempData> &tempData, std::vector<Point> &triplePoints, std::vector<IntPoints> &tempIntPts);
11 int intersectionChecking(struct Poly &newPoly, std::vector<Poly> &acceptedPoly, std::vector<IntPoints> &intpts, struct Stats &pstats, std::vector<Point> &triplePoints);
12 double pointToLineSeg(const double *point,const double *line);
13 double pointToLineSeg(const Point &point, const double *line);
14 bool checkDistanceFromNodes(struct Poly &poly, IntPoints &intPts, double minSize, Stats &pstats);
15 bool checkCloseEdge(Poly &poly1, IntPoints &intPts, double shrinkLimit, Stats &pstats);
16 double lineSegToLineSeg(const double *line1, const double *line2, Point &pt);
17 double lineSegToLineSegSep(const double *line1, const double *line2);
18 Point lineIntersection3D(const double *p1, double *v1, const double *p2, double *v2);
19 bool checkDistIntPtsEdge(struct PointList &tmpPoints, struct Poly &newPoly, struct Poly &poly2);
20 void applyRotation2D(struct Poly &newPoly, float angle);
21 void applyRotation3D(struct Poly &newPoly, double *normal);
22 void translate(Poly &newPoly, double *translation);
23 int checkForTripleIntersections(IntPoints &intPts,unsigned int count,std::vector<IntPoints> &intPtsList, Poly &newPoly, Poly &poly2, std::vector<TriplePtTempData> &tempData, std::vector<Point> &triplePoints);
24 struct IntPoints polyAndIntersection_RotationToXY(struct IntPoints &intersection, Poly &newPoly, std::vector<Point> &triplePoints, std::vector<Point> &tempTripPts);
25 double *rotationMatrix(double *normalA, double *normalB);
26 bool shrinkIntersection(IntPoints &intPts, double *edge, double shrinkLimit, double firstNodeMinDist, double minDist);
27 bool checkDistToOldIntersections(std::vector<IntPoints> &intPtsList, IntPoints &intPts, Poly &poly2, double minDistance);
28 bool checkDistToNewIntersections(std::vector<IntPoints> &tempIntPts, IntPoints &intpts, std::vector<TriplePtTempData> &tempTripPts, double minDistance);
29 bool PointOnLineSeg(const Point &pt, const double *line);
30 bool PointOnLineSeg(const double *pt, const double *line);
31 #endif
32 
struct IntPoints polyAndIntersection_RotationToXY(struct IntPoints &intersection, Poly &newPoly, std::vector< Point > &triplePoints, std::vector< Point > &tempTripPts)
void translate(Poly &newPoly, double *translation)
double lineSegToLineSeg(const double *line1, const double *line2, Point &pt)
struct IntPoints findIntersections(short &flag, struct Poly &poly1, struct Poly &poly2)
bool checkDistToNewIntersections(std::vector< IntPoints > &tempIntPts, IntPoints &intpts, std::vector< TriplePtTempData > &tempTripPts, double minDistance)
void printBoundingBox(struct Poly &newPoly)
Point lineIntersection3D(const double *p1, double *v1, const double *p2, double *v2)
double lineSegToLineSegSep(const double *line1, const double *line2)
double pointToLineSeg(const double *point, const double *line)
bool checkDistIntPtsEdge(struct PointList &tmpPoints, struct Poly &newPoly, struct Poly &poly2)
int checkForTripleIntersections(IntPoints &intPts, unsigned int count, std::vector< IntPoints > &intPtsList, Poly &newPoly, Poly &poly2, std::vector< TriplePtTempData > &tempData, std::vector< Point > &triplePoints)
bool shrinkIntersection(IntPoints &intPts, double *edge, double shrinkLimit, double firstNodeMinDist, double minDist)
void applyRotation3D(struct Poly &newPoly, double *normal)
bool checkCloseEdge(Poly &poly1, IntPoints &intPts, double shrinkLimit, Stats &pstats)
void createBoundingBox(struct Poly &newPoly)
int FRAM(struct IntPoints &intPts, unsigned int count, std::vector< IntPoints > &intPtsList, struct Poly &newPoly, struct Poly &poly2, struct Stats &pstats, std::vector< TriplePtTempData > &tempData, std::vector< Point > &triplePoints, std::vector< IntPoints > &tempIntPts)
bool checkBoundingBox(struct Poly &poly1, struct Poly &poly2)
int intersectionChecking(struct Poly &newPoly, std::vector< Poly > &acceptedPoly, std::vector< IntPoints > &intpts, struct Stats &pstats, std::vector< Point > &triplePoints)
double normal[3]
Definition: structures.h:55
bool checkDistanceFromNodes(struct Poly &poly, IntPoints &intPts, double minSize, Stats &pstats)
bool PointOnLineSeg(const Point &pt, const double *line)
void applyRotation2D(struct Poly &newPoly, float angle)
bool checkDistToOldIntersections(std::vector< IntPoints > &intPtsList, IntPoints &intPts, Poly &poly2, double minDistance)
double * rotationMatrix(double *normalA, double *normalB)
double translation[3]
Definition: structures.h:52