/* * 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 "BoundaryMaps.hpp" #include "Helpers/defs.hpp" /****************************************** forward declarations *****************************/ class BoundaryPointSet; class BoundaryLineSet; class BoundaryTriangleSet; class BoundaryPolygonSet; class CandidateForTesselation; class LinkedCell_deprecated; class TesselPoint; class IPointCloud; class Tesselation; class Vector; /********************************************** definitions *********************************/ /********************************************** declarations *******************************/ void GetSphere(Vector & Center, const Vector &a, const Vector &b, const Vector &c, const double RADIUS); void GetCenterOfSphere(Vector& Center, const Vector &a, const Vector &b, const Vector &c, Vector &NewUmkreismittelpunkt, const Vector &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); void GetCenterofCircumcircle(Vector & Center, const Vector &a, const Vector &b, const Vector &c); double GetPathLengthonCircumCircle(const Vector &CircleCenter, const Vector &CirclePlaneNormal, const double CircleRadius, const Vector &NewSphereCenter, const Vector &OldSphereCenter, const Vector &NormalVector, const Vector &SearchDirection, const double HULLEPSILON); double CalculateVolumeofGeneralTetraeder(const Vector &a, const Vector &b, const Vector &c, const Vector &d); double CalculateAreaofGeneralTriangle(const Vector &A, const Vector &B, const Vector &C); double GetAngle(const Vector &point, const Vector &reference, const Vector &OrthogonalVector); bool CheckLineCriteriaForDegeneratedTriangle(const BoundaryPointSet * const nodes[3]); bool SortCandidates(const CandidateForTesselation* candidate1, const CandidateForTesselation *candidate2); TesselPoint* FindClosestTesselPoint(const Vector & Point, TesselPoint *&SecondPoint, const LinkedCell_deprecated* const LC); TesselPoint* FindSecondClosestTesselPoint(const Vector &, const LinkedCell_deprecated* const LC); Vector * GetClosestPointBetweenLine(const BoundaryLineSet * const Base, const BoundaryLineSet * const OtherBase); void WriteTecplotFile(ofstream * const tecplot, const Tesselation * const TesselStruct, IPointCloud & cloud, const int N); void WriteRaster3dFile(ofstream * const rasterfile, const Tesselation * const Tess, IPointCloud & cloud); void IncludeSphereinRaster3D(ofstream * const rasterfile, const Tesselation *Tess, IPointCloud & cloud); void WriteVrmlFile(ofstream * const vrmlfile, const Tesselation * const Tess, IPointCloud & cloud); void CalculateConcavityPerBoundaryPoint(const Tesselation * const TesselStruct); void CalculateConstrictionPerBoundaryPoint(const Tesselation * const TesselStruct, const Tesselation * const Convex); double DistanceToTrianglePlane(const Vector &x, const BoundaryTriangleSet * const triangle); bool CheckListOfBaselines(const Tesselation * const TesselStruct); int CountTrianglePairContainingPolygon(const BoundaryPolygonSet * const P, const TriangleSet * const T); bool ArePolygonsEdgeConnected(const BoundaryPolygonSet * const P1, const BoundaryPolygonSet * const P2); void CombinePolygons(BoundaryPolygonSet * const P1, BoundaryPolygonSet * &P2); #endif /* TESSELATIONHELPERS_HPP_ */