| [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 |  | 
|---|
|  | 22 | #include <gsl/gsl_linalg.h> | 
|---|
|  | 23 | #include <gsl/gsl_matrix.h> | 
|---|
|  | 24 | #include <gsl/gsl_multimin.h> | 
|---|
|  | 25 | #include <gsl/gsl_permutation.h> | 
|---|
|  | 26 | #include <gsl/gsl_vector.h> | 
|---|
|  | 27 |  | 
|---|
| [f66195] | 28 | #include <iostream> | 
|---|
|  | 29 |  | 
|---|
| [91e7e4a] | 30 | #include "defs.hpp" | 
|---|
| [f66195] | 31 |  | 
|---|
|  | 32 | /****************************************** forward declarations *****************************/ | 
|---|
|  | 33 |  | 
|---|
|  | 34 | class BoundaryPointSet; | 
|---|
|  | 35 | class BoundaryLineSet; | 
|---|
|  | 36 | class BoundaryTriangleSet; | 
|---|
|  | 37 | class LinkedCell; | 
|---|
|  | 38 | class TesselPoint; | 
|---|
|  | 39 | class PointCloud; | 
|---|
|  | 40 | class Tesselation; | 
|---|
|  | 41 | class Vector; | 
|---|
|  | 42 |  | 
|---|
|  | 43 | /********************************************** definitions *********************************/ | 
|---|
| [357fba] | 44 |  | 
|---|
| [91e7e4a] | 45 | #define HULLEPSILON 1e-10 | 
|---|
|  | 46 |  | 
|---|
| [f66195] | 47 | /********************************************** declarations *******************************/ | 
|---|
|  | 48 |  | 
|---|
| [f1cccd] | 49 | double DetGet(gsl_matrix *A, int inPlace); | 
|---|
|  | 50 | void GetSphere(Vector *center, Vector &a, Vector &b, Vector &c, double RADIUS); | 
|---|
|  | 51 | 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); | 
|---|
| [357fba] | 52 | void GetCenterofCircumcircle(Vector *Center, Vector *a, Vector *b, Vector *c); | 
|---|
|  | 53 | double GetPathLengthonCircumCircle(Vector &CircleCenter, Vector &CirclePlaneNormal, double CircleRadius, Vector &NewSphereCenter, Vector &OldSphereCenter, Vector &NormalVector, Vector &SearchDirection); | 
|---|
|  | 54 | double MinIntersectDistance(const gsl_vector * x, void *params); | 
|---|
|  | 55 | bool existsIntersection(Vector point1, Vector point2, Vector point3, Vector point4); | 
|---|
| [91e7e4a] | 56 | double CalculateVolumeofGeneralTetraeder(Vector *a, Vector *b, Vector *c, Vector *d); | 
|---|
| [57066a] | 57 | double GetAngle(const Vector &point, const Vector &reference, const Vector OrthogonalVector); | 
|---|
|  | 58 |  | 
|---|
|  | 59 | bool CheckLineCriteriaForDegeneratedTriangle(class BoundaryPointSet *nodes[3]); | 
|---|
|  | 60 | bool SortCandidates(class CandidateForTesselation* candidate1, class CandidateForTesselation* candidate2); | 
|---|
|  | 61 | TesselPoint* FindClosestPoint(const Vector* Point, TesselPoint *&SecondPoint, LinkedCell* LC); | 
|---|
|  | 62 | TesselPoint* FindSecondClosestPoint(const Vector*, LinkedCell*); | 
|---|
|  | 63 | Vector * GetClosestPointBetweenLine(ofstream *out, class BoundaryLineSet *Base, class BoundaryLineSet *OtherBase); | 
|---|
|  | 64 |  | 
|---|
|  | 65 | void WriteTecplotFile(ofstream *out, ofstream *tecplot, class Tesselation *TesselStruct, PointCloud *cloud, int N); | 
|---|
|  | 66 | void WriteRaster3dFile(ofstream *out, ofstream *rasterfile, class Tesselation *Tess, PointCloud *cloud); | 
|---|
|  | 67 | void IncludeSphereinRaster3D(ofstream *out, ofstream *rasterfile, class Tesselation *Tess, PointCloud *cloud); | 
|---|
|  | 68 | void WriteVrmlFile(ofstream *out, ofstream *vrmlfile, class Tesselation *Tess, PointCloud *cloud); | 
|---|
| [7dea7c] | 69 | void CalculateConcavityPerBoundaryPoint(ofstream *out, class Tesselation *TesselStruct); | 
|---|
| [c4d4df] | 70 | double DistanceToTrianglePlane(ofstream *out, Vector *x, BoundaryTriangleSet *triangle); | 
|---|
| [7dea7c] | 71 |  | 
|---|
|  | 72 | bool CheckListOfBaselines(ofstream *out, Tesselation *TesselStruct); | 
|---|
| [91e7e4a] | 73 |  | 
|---|
| [357fba] | 74 |  | 
|---|
|  | 75 | #endif /* TESSELATIONHELPERS_HPP_ */ | 
|---|