[357fba] | 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 |
|
---|
[f66195] | 15 | /*********************************************** includes ***********************************/
|
---|
| 16 |
|
---|
[357fba] | 17 | // include config.h
|
---|
| 18 | #ifdef HAVE_CONFIG_H
|
---|
| 19 | #include <config.h>
|
---|
| 20 | #endif
|
---|
| 21 |
|
---|
[986ed3] | 22 | #include <iosfwd>
|
---|
[f66195] | 23 |
|
---|
[91e7e4a] | 24 | #include "defs.hpp"
|
---|
[f66195] | 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 *********************************/
|
---|
[357fba] | 38 |
|
---|
[b32dbb] | 39 | #define HULLEPSILON 1e-9 //!< TODO: Get rid of HULLEPSILON, points to numerical instabilities
|
---|
[91e7e4a] | 40 |
|
---|
[f66195] | 41 | /********************************************** declarations *******************************/
|
---|
| 42 |
|
---|
[c0f6c6] | 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);
|
---|
[b32dbb] | 48 | double CalculateAreaofGeneralTriangle(const Vector &A, const Vector &B, const Vector &C);
|
---|
[c0f6c6] | 49 | double GetAngle(const Vector &point, const Vector &reference, const Vector &OrthogonalVector);
|
---|
[57066a] | 50 |
|
---|
[c0f6c6] | 51 | bool CheckLineCriteriaForDegeneratedTriangle(const BoundaryPointSet * const nodes[3]);
|
---|
| 52 | bool SortCandidates(const CandidateForTesselation* candidate1, const CandidateForTesselation *candidate2);
|
---|
[71b20e] | 53 | TesselPoint* FindClosestTesselPoint(const Vector* Point, TesselPoint *&SecondPoint, const LinkedCell* const LC);
|
---|
| 54 | TesselPoint* FindSecondClosestTesselPoint(const Vector*, const LinkedCell* const LC);
|
---|
[e138de] | 55 | Vector * GetClosestPointBetweenLine(const BoundaryLineSet * const Base, const BoundaryLineSet * const OtherBase);
|
---|
[776b64] | 56 |
|
---|
[e138de] | 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);
|
---|
[b32dbb] | 62 | void CalculateConstrictionPerBoundaryPoint(const Tesselation * const TesselStruct, const Tesselation * const Convex);
|
---|
[e138de] | 63 | double DistanceToTrianglePlane(const Vector *x, const BoundaryTriangleSet * const triangle);
|
---|
[776b64] | 64 |
|
---|
[e138de] | 65 | bool CheckListOfBaselines(const Tesselation * const TesselStruct);
|
---|
[91e7e4a] | 66 |
|
---|
[262bae] | 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 |
|
---|
[357fba] | 71 |
|
---|
| 72 | #endif /* TESSELATIONHELPERS_HPP_ */
|
---|