/* * TesselationHelpers.hpp * * Auxiliary functions for the tesselation. * * Created on: Aug 3, 2009 * Author: heber */ #ifndef TESSELATIONHELPERS_HPP_ #define TESSELATIONHELPERS_HPP_ using namespace std; /*********************************************** includes ***********************************/ // include config.h #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include #include #include #include "defs.hpp" /****************************************** forward declarations *****************************/ class BoundaryPointSet; class BoundaryLineSet; class BoundaryTriangleSet; class LinkedCell; class TesselPoint; class PointCloud; class Tesselation; class Vector; /********************************************** definitions *********************************/ #define HULLEPSILON 1e-10 /********************************************** declarations *******************************/ double DetGet(gsl_matrix *A, int inPlace); void GetSphere(Vector *center, Vector &a, Vector &b, Vector &c, double RADIUS); void GetCenterOfSphere(Vector* Center, Vector a, Vector b, Vector c, Vector *NewUmkreismittelpunkt, Vector* Direction, Vector* AlternativeDirection, double HalfplaneIndicator, double AlternativeIndicator, double alpha, double beta, double gamma, double RADIUS, double Umkreisradius); void GetCenterofCircumcircle(Vector *Center, Vector *a, Vector *b, Vector *c); double GetPathLengthonCircumCircle(Vector &CircleCenter, Vector &CirclePlaneNormal, double CircleRadius, Vector &NewSphereCenter, Vector &OldSphereCenter, Vector &NormalVector, Vector &SearchDirection); double MinIntersectDistance(const gsl_vector * x, void *params); bool existsIntersection(Vector point1, Vector point2, Vector point3, Vector point4); double CalculateVolumeofGeneralTetraeder(Vector *a, Vector *b, Vector *c, Vector *d); double GetAngle(const Vector &point, const Vector &reference, const Vector OrthogonalVector); bool CheckLineCriteriaForDegeneratedTriangle(class BoundaryPointSet *nodes[3]); bool SortCandidates(class CandidateForTesselation* candidate1, class CandidateForTesselation* candidate2); TesselPoint* FindClosestPoint(const Vector* Point, TesselPoint *&SecondPoint, LinkedCell* LC); TesselPoint* FindSecondClosestPoint(const Vector*, LinkedCell*); Vector * GetClosestPointBetweenLine(ofstream *out, class BoundaryLineSet *Base, class BoundaryLineSet *OtherBase); void WriteTecplotFile(ofstream *out, ofstream *tecplot, class Tesselation *TesselStruct, PointCloud *cloud, int N); void WriteRaster3dFile(ofstream *out, ofstream *rasterfile, class Tesselation *Tess, PointCloud *cloud); void IncludeSphereinRaster3D(ofstream *out, ofstream *rasterfile, class Tesselation *Tess, PointCloud *cloud); void WriteVrmlFile(ofstream *out, ofstream *vrmlfile, class Tesselation *Tess, PointCloud *cloud); void CalculateConcavityPerBoundaryPoint(ofstream *out, class Tesselation *TesselStruct); double DistanceToTrianglePlane(ofstream *out, Vector *x, BoundaryTriangleSet *triangle); bool CheckListOfBaselines(ofstream *out, Tesselation *TesselStruct); #endif /* TESSELATIONHELPERS_HPP_ */