| 1 | /* | 
|---|
| 2 | * TesselationHelpers.hpp | 
|---|
| 3 | * | 
|---|
| 4 | *  Auxiliary functions for the tesselation. | 
|---|
| 5 | * | 
|---|
| 6 | *  Created on: Aug 3, 2009 | 
|---|
| 7 | *      Author: heber | 
|---|
| 8 | */ | 
|---|
| 9 |  | 
|---|
| 10 | #ifndef TESSELATIONHELPERS_HPP_ | 
|---|
| 11 | #define TESSELATIONHELPERS_HPP_ | 
|---|
| 12 |  | 
|---|
| 13 | using namespace std; | 
|---|
| 14 |  | 
|---|
| 15 | /*********************************************** includes ***********************************/ | 
|---|
| 16 |  | 
|---|
| 17 | // include config.h | 
|---|
| 18 | #ifdef HAVE_CONFIG_H | 
|---|
| 19 | #include <config.h> | 
|---|
| 20 | #endif | 
|---|
| 21 |  | 
|---|
| 22 | #include <iosfwd> | 
|---|
| 23 |  | 
|---|
| 24 | #include "defs.hpp" | 
|---|
| 25 |  | 
|---|
| 26 | /****************************************** forward declarations *****************************/ | 
|---|
| 27 |  | 
|---|
| 28 | class BoundaryPointSet; | 
|---|
| 29 | class BoundaryLineSet; | 
|---|
| 30 | class BoundaryTriangleSet; | 
|---|
| 31 | class LinkedCell; | 
|---|
| 32 | class TesselPoint; | 
|---|
| 33 | class PointCloud; | 
|---|
| 34 | class Tesselation; | 
|---|
| 35 | class Vector; | 
|---|
| 36 |  | 
|---|
| 37 | /********************************************** definitions *********************************/ | 
|---|
| 38 |  | 
|---|
| 39 | #define HULLEPSILON 1e-9 //!< TODO: Get rid of HULLEPSILON, points to numerical instabilities | 
|---|
| 40 |  | 
|---|
| 41 | /********************************************** declarations *******************************/ | 
|---|
| 42 |  | 
|---|
| 43 | void GetSphere(Vector * const Center, const Vector &a, const Vector &b, const Vector &c, const double RADIUS); | 
|---|
| 44 | void GetCenterOfSphere(Vector* const Center, const Vector &a, const Vector &b, const Vector &c, Vector * const NewUmkreismittelpunkt, const Vector* const Direction, const Vector* const AlternativeDirection, const double HalfplaneIndicator, const double AlternativeIndicator, const double alpha, const double beta, const double gamma, const double RADIUS, const double Umkreisradius); | 
|---|
| 45 | void GetCenterofCircumcircle(Vector * const Center, const Vector &a, const Vector &b, const Vector &c); | 
|---|
| 46 | double GetPathLengthonCircumCircle(const Vector &CircleCenter, const Vector &CirclePlaneNormal, const double CircleRadius, const Vector &NewSphereCenter, const Vector &OldSphereCenter, const Vector &NormalVector, const Vector &SearchDirection); | 
|---|
| 47 | double CalculateVolumeofGeneralTetraeder(const Vector &a, const Vector &b, const Vector &c, const Vector &d); | 
|---|
| 48 | double CalculateAreaofGeneralTriangle(const Vector &A, const Vector &B, const Vector &C); | 
|---|
| 49 | double GetAngle(const Vector &point, const Vector &reference, const Vector &OrthogonalVector); | 
|---|
| 50 |  | 
|---|
| 51 | bool CheckLineCriteriaForDegeneratedTriangle(const BoundaryPointSet * const nodes[3]); | 
|---|
| 52 | bool SortCandidates(const CandidateForTesselation* candidate1, const CandidateForTesselation *candidate2); | 
|---|
| 53 | TesselPoint* FindClosestTesselPoint(const Vector* Point, TesselPoint *&SecondPoint, const LinkedCell* const LC); | 
|---|
| 54 | TesselPoint* FindSecondClosestTesselPoint(const Vector*, const LinkedCell* const LC); | 
|---|
| 55 | Vector * GetClosestPointBetweenLine(const BoundaryLineSet * const Base, const BoundaryLineSet * const OtherBase); | 
|---|
| 56 |  | 
|---|
| 57 | void WriteTecplotFile(ofstream * const tecplot, const Tesselation * const TesselStruct, const PointCloud * const cloud, const int N); | 
|---|
| 58 | void WriteRaster3dFile(ofstream * const rasterfile, const Tesselation * const Tess, const PointCloud * const cloud); | 
|---|
| 59 | void IncludeSphereinRaster3D(ofstream * const rasterfile, const Tesselation *Tess, const PointCloud *cloud); | 
|---|
| 60 | void WriteVrmlFile(ofstream * const vrmlfile, const Tesselation * const Tess, const PointCloud * const cloud); | 
|---|
| 61 | void CalculateConcavityPerBoundaryPoint(const Tesselation * const TesselStruct); | 
|---|
| 62 | void CalculateConstrictionPerBoundaryPoint(const Tesselation * const TesselStruct, const Tesselation * const Convex); | 
|---|
| 63 | double DistanceToTrianglePlane(const Vector *x, const BoundaryTriangleSet * const triangle); | 
|---|
| 64 |  | 
|---|
| 65 | bool CheckListOfBaselines(const Tesselation * const TesselStruct); | 
|---|
| 66 |  | 
|---|
| 67 | int CountTrianglePairContainingPolygon(const BoundaryPolygonSet * const P, const TriangleSet * const T); | 
|---|
| 68 | bool ArePolygonsEdgeConnected(const BoundaryPolygonSet * const P1, const BoundaryPolygonSet * const P2); | 
|---|
| 69 | void CombinePolygons(BoundaryPolygonSet * const P1, BoundaryPolygonSet * &P2); | 
|---|
| 70 |  | 
|---|
| 71 |  | 
|---|
| 72 | #endif /* TESSELATIONHELPERS_HPP_ */ | 
|---|