| [357fba] | 1 | /* | 
|---|
|  | 2 | * tesselation.hpp | 
|---|
|  | 3 | * | 
|---|
|  | 4 | *  The tesselation class is meant to contain the envelope (concave, convex or neither) of a set of Vectors. As we actually mean this stuff for atoms, we have to encapsulate it all a bit. | 
|---|
|  | 5 | * | 
|---|
|  | 6 | *  Created on: Aug 3, 2009 | 
|---|
|  | 7 | *      Author: heber | 
|---|
|  | 8 | */ | 
|---|
|  | 9 |  | 
|---|
|  | 10 | #ifndef TESSELATION_HPP_ | 
|---|
|  | 11 | #define TESSELATION_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 <map> | 
|---|
|  | 23 | #include <list> | 
|---|
| [7c14ec] | 24 | #include <set> | 
|---|
| [856098] | 25 | #include <stack> | 
|---|
| [357fba] | 26 |  | 
|---|
| [6b919f8] | 27 | #include "atom_particleinfo.hpp" | 
|---|
| [4455f4] | 28 | #include "helpers.hpp" | 
|---|
| [6b919f8] | 29 | #include "vector.hpp" | 
|---|
| [357fba] | 30 |  | 
|---|
| [f66195] | 31 | /****************************************** forward declarations *****************************/ | 
|---|
|  | 32 |  | 
|---|
| [357fba] | 33 | class BoundaryPointSet; | 
|---|
|  | 34 | class BoundaryLineSet; | 
|---|
|  | 35 | class BoundaryTriangleSet; | 
|---|
| [f66195] | 36 | class LinkedCell; | 
|---|
| [357fba] | 37 | class TesselPoint; | 
|---|
|  | 38 | class PointCloud; | 
|---|
|  | 39 | class Tesselation; | 
|---|
|  | 40 |  | 
|---|
| [f66195] | 41 | /********************************************** definitions *********************************/ | 
|---|
|  | 42 |  | 
|---|
| [57066a] | 43 | #define DoTecplotOutput 1 | 
|---|
|  | 44 | #define DoRaster3DOutput 1 | 
|---|
|  | 45 | #define DoVRMLOutput 1 | 
|---|
|  | 46 | #define TecplotSuffix ".dat" | 
|---|
|  | 47 | #define Raster3DSuffix ".r3d" | 
|---|
|  | 48 | #define VRMLSUffix ".wrl" | 
|---|
|  | 49 |  | 
|---|
| [fad93c] | 50 | #define ParallelEpsilon 1e-3 | 
|---|
|  | 51 |  | 
|---|
| [357fba] | 52 | // ======================================================= some template functions ========================================= | 
|---|
|  | 53 |  | 
|---|
| [c15ca2] | 54 | #define IndexToIndex map <int, int> | 
|---|
|  | 55 |  | 
|---|
| [357fba] | 56 | #define PointMap map < int, class BoundaryPointSet * > | 
|---|
| [262bae] | 57 | #define PointSet set < class BoundaryPointSet * > | 
|---|
|  | 58 | #define PointList list < class BoundaryPointSet * > | 
|---|
| [357fba] | 59 | #define PointPair pair < int, class BoundaryPointSet * > | 
|---|
|  | 60 | #define PointTestPair pair < PointMap::iterator, bool > | 
|---|
| [262bae] | 61 |  | 
|---|
| [357fba] | 62 | #define CandidateList list <class CandidateForTesselation *> | 
|---|
| [1e168b] | 63 | #define CandidateMap map <class BoundaryLineSet *, class CandidateForTesselation *> | 
|---|
| [357fba] | 64 |  | 
|---|
|  | 65 | #define LineMap multimap < int, class BoundaryLineSet * > | 
|---|
| [262bae] | 66 | #define LineSet set < class BoundaryLineSet * > | 
|---|
|  | 67 | #define LineList list < class BoundaryLineSet * > | 
|---|
| [357fba] | 68 | #define LinePair pair < int, class BoundaryLineSet * > | 
|---|
|  | 69 | #define LineTestPair pair < LineMap::iterator, bool > | 
|---|
|  | 70 |  | 
|---|
|  | 71 | #define TriangleMap map < int, class BoundaryTriangleSet * > | 
|---|
| [262bae] | 72 | #define TriangleSet set < class BoundaryTriangleSet * > | 
|---|
|  | 73 | #define TriangleList list < class BoundaryTriangleSet * > | 
|---|
| [357fba] | 74 | #define TrianglePair pair < int, class BoundaryTriangleSet * > | 
|---|
|  | 75 | #define TriangleTestPair pair < TrianglePair::iterator, bool > | 
|---|
|  | 76 |  | 
|---|
| [262bae] | 77 | #define PolygonMap map < int, class BoundaryPolygonSet * > | 
|---|
|  | 78 | #define PolygonSet set < class BoundaryPolygonSet * > | 
|---|
|  | 79 | #define PolygonList list < class BoundaryPolygonSet * > | 
|---|
|  | 80 |  | 
|---|
| [97498a] | 81 | #define DistanceToPointMap multimap <double, class BoundaryPointSet * > | 
|---|
|  | 82 | #define DistanceToPointPair pair <double, class BoundaryPointSet * > | 
|---|
| [c15ca2] | 83 |  | 
|---|
| [357fba] | 84 | #define DistanceMultiMap multimap <double, pair < PointMap::iterator, PointMap::iterator> > | 
|---|
|  | 85 | #define DistanceMultiMapPair pair <double, pair < PointMap::iterator, PointMap::iterator> > | 
|---|
|  | 86 |  | 
|---|
| [f67b6e] | 87 | #define TesselPointList list <TesselPoint *> | 
|---|
| [262bae] | 88 | #define TesselPointSet set <TesselPoint *> | 
|---|
| [f67b6e] | 89 |  | 
|---|
| [244a84] | 90 | #define ListOfTesselPointList list<list <TesselPoint *> *> | 
|---|
|  | 91 |  | 
|---|
| [f66195] | 92 | /********************************************** declarations *******************************/ | 
|---|
| [357fba] | 93 |  | 
|---|
|  | 94 | template <typename T> void SetEndpointsOrdered(T endpoints[2], T endpoint1, T endpoint2) | 
|---|
|  | 95 | { | 
|---|
|  | 96 | if (endpoint1->Nr < endpoint2->Nr) { | 
|---|
|  | 97 | endpoints[0] = endpoint1; | 
|---|
|  | 98 | endpoints[1] = endpoint2; | 
|---|
|  | 99 | } else { | 
|---|
|  | 100 | endpoints[0] = endpoint2; | 
|---|
|  | 101 | endpoints[1] = endpoint1; | 
|---|
|  | 102 | } | 
|---|
|  | 103 | }; | 
|---|
|  | 104 |  | 
|---|
|  | 105 | // ======================================================== class BoundaryPointSet ========================================= | 
|---|
|  | 106 |  | 
|---|
|  | 107 | class BoundaryPointSet { | 
|---|
|  | 108 | public: | 
|---|
|  | 109 | BoundaryPointSet(); | 
|---|
| [9473f6] | 110 | BoundaryPointSet(TesselPoint * const Walker); | 
|---|
| [357fba] | 111 | ~BoundaryPointSet(); | 
|---|
|  | 112 |  | 
|---|
| [9473f6] | 113 | void AddLine(BoundaryLineSet * const line); | 
|---|
| [357fba] | 114 |  | 
|---|
|  | 115 | LineMap lines; | 
|---|
|  | 116 | int LinesCount; | 
|---|
|  | 117 | TesselPoint *node; | 
|---|
| [16d866] | 118 | double value; | 
|---|
| [357fba] | 119 | int Nr; | 
|---|
|  | 120 | }; | 
|---|
|  | 121 |  | 
|---|
| [776b64] | 122 | ostream & operator << (ostream &ost, const BoundaryPointSet &a); | 
|---|
| [357fba] | 123 |  | 
|---|
|  | 124 | // ======================================================== class BoundaryLineSet ========================================== | 
|---|
|  | 125 |  | 
|---|
|  | 126 | class BoundaryLineSet { | 
|---|
|  | 127 | public: | 
|---|
|  | 128 | BoundaryLineSet(); | 
|---|
| [9473f6] | 129 | BoundaryLineSet(BoundaryPointSet * const Point[2], const int number); | 
|---|
|  | 130 | BoundaryLineSet(BoundaryPointSet * const Point1, BoundaryPointSet * const Point2, const int number); | 
|---|
| [357fba] | 131 | ~BoundaryLineSet(); | 
|---|
|  | 132 |  | 
|---|
| [9473f6] | 133 | void AddTriangle(BoundaryTriangleSet * const triangle); | 
|---|
|  | 134 | bool IsConnectedTo(const BoundaryLineSet * const line) const; | 
|---|
|  | 135 | bool ContainsBoundaryPoint(const BoundaryPointSet * const point) const; | 
|---|
|  | 136 | bool CheckConvexityCriterion() const; | 
|---|
|  | 137 | class BoundaryPointSet *GetOtherEndpoint(const BoundaryPointSet * const point) const; | 
|---|
| [357fba] | 138 |  | 
|---|
|  | 139 | class BoundaryPointSet *endpoints[2]; | 
|---|
|  | 140 | TriangleMap triangles; | 
|---|
|  | 141 | int Nr; | 
|---|
| [1e168b] | 142 | bool skipped; | 
|---|
| [357fba] | 143 | }; | 
|---|
|  | 144 |  | 
|---|
| [776b64] | 145 | ostream & operator << (ostream &ost, const BoundaryLineSet &a); | 
|---|
| [357fba] | 146 |  | 
|---|
|  | 147 | // ======================================================== class BoundaryTriangleSet ======================================= | 
|---|
|  | 148 |  | 
|---|
|  | 149 | class BoundaryTriangleSet { | 
|---|
|  | 150 | public: | 
|---|
|  | 151 | BoundaryTriangleSet(); | 
|---|
| [9473f6] | 152 | BoundaryTriangleSet(class BoundaryLineSet * const line[3], const int number); | 
|---|
| [357fba] | 153 | ~BoundaryTriangleSet(); | 
|---|
|  | 154 |  | 
|---|
| [9473f6] | 155 | void GetNormalVector(const Vector &NormalVector); | 
|---|
|  | 156 | void GetCenter(Vector * const center) const; | 
|---|
|  | 157 | bool GetIntersectionInsideTriangle(const Vector * const MolCenter, const Vector * const x, Vector * const Intersection) const; | 
|---|
|  | 158 | double GetClosestPointInsideTriangle(const Vector * const x, Vector * const ClosestPoint) const; | 
|---|
|  | 159 | bool ContainsBoundaryLine(const BoundaryLineSet * const line) const; | 
|---|
|  | 160 | bool ContainsBoundaryPoint(const BoundaryPointSet * const point) const; | 
|---|
|  | 161 | bool ContainsBoundaryPoint(const TesselPoint * const point) const; | 
|---|
|  | 162 | class BoundaryPointSet *GetThirdEndpoint(const BoundaryLineSet * const line) const; | 
|---|
|  | 163 | bool IsPresentTupel(const BoundaryPointSet * const Points[3]) const; | 
|---|
|  | 164 | bool IsPresentTupel(const BoundaryTriangleSet * const T) const; | 
|---|
| [357fba] | 165 |  | 
|---|
|  | 166 | class BoundaryPointSet *endpoints[3]; | 
|---|
|  | 167 | class BoundaryLineSet *lines[3]; | 
|---|
|  | 168 | Vector NormalVector; | 
|---|
| [b998c3] | 169 | Vector SphereCenter; | 
|---|
| [357fba] | 170 | int Nr; | 
|---|
|  | 171 | }; | 
|---|
|  | 172 |  | 
|---|
| [776b64] | 173 | ostream & operator << (ostream &ost, const BoundaryTriangleSet &a); | 
|---|
| [357fba] | 174 |  | 
|---|
| [262bae] | 175 |  | 
|---|
|  | 176 | // ======================================================== class BoundaryTriangleSet ======================================= | 
|---|
|  | 177 |  | 
|---|
|  | 178 | /** Set of BoundaryPointSet. | 
|---|
|  | 179 | * This is just meant as a container for a group of endpoints, extending the node, line, triangle concept. However, this has | 
|---|
|  | 180 | * only marginally something to do with the tesselation. Hence, there is no incorporation into the bookkeeping of the Tesselation | 
|---|
|  | 181 | * class (i.e. no allocation, no deletion). | 
|---|
|  | 182 | * \note we assume that the set of endpoints reside (more or less) on a plane. | 
|---|
|  | 183 | */ | 
|---|
|  | 184 | class BoundaryPolygonSet { | 
|---|
|  | 185 | public: | 
|---|
|  | 186 | BoundaryPolygonSet(); | 
|---|
|  | 187 | ~BoundaryPolygonSet(); | 
|---|
|  | 188 |  | 
|---|
|  | 189 | Vector * GetNormalVector(const Vector &NormalVector) const; | 
|---|
|  | 190 | void GetCenter(Vector *center) const; | 
|---|
|  | 191 | bool ContainsBoundaryLine(const BoundaryLineSet * const line) const; | 
|---|
|  | 192 | bool ContainsBoundaryPoint(const BoundaryPointSet * const point) const; | 
|---|
|  | 193 | bool ContainsBoundaryPoint(const TesselPoint * const point) const; | 
|---|
|  | 194 | bool ContainsBoundaryTriangle(const BoundaryTriangleSet * const point) const; | 
|---|
|  | 195 | bool ContainsPresentTupel(const BoundaryPointSet * const * Points, const int dim) const; | 
|---|
|  | 196 | bool ContainsPresentTupel(const BoundaryPolygonSet * const P) const; | 
|---|
|  | 197 | bool ContainsPresentTupel(const PointSet &endpoints) const; | 
|---|
| [856098] | 198 | TriangleSet * GetAllContainedTrianglesFromEndpoints() const; | 
|---|
| [262bae] | 199 | bool FillPolygonFromTrianglesOfLine(const BoundaryLineSet * const line); | 
|---|
|  | 200 |  | 
|---|
|  | 201 | PointSet endpoints; | 
|---|
|  | 202 | int Nr; | 
|---|
|  | 203 | }; | 
|---|
|  | 204 |  | 
|---|
|  | 205 | ostream & operator << (ostream &ost, const BoundaryPolygonSet &a); | 
|---|
|  | 206 |  | 
|---|
| [357fba] | 207 | // =========================================================== class TESSELPOINT =========================================== | 
|---|
|  | 208 |  | 
|---|
|  | 209 | /** Is a single point of the set of Vectors, also a super-class to be inherited and and its functions to be implemented. | 
|---|
|  | 210 | */ | 
|---|
| [4455f4] | 211 | class TesselPoint : virtual public ParticleInfo { | 
|---|
| [357fba] | 212 | public: | 
|---|
|  | 213 | TesselPoint(); | 
|---|
| [5c7bf8] | 214 | virtual ~TesselPoint(); | 
|---|
| [357fba] | 215 |  | 
|---|
|  | 216 | Vector *node;   // pointer to position of the dot in space | 
|---|
| [5c7bf8] | 217 |  | 
|---|
|  | 218 | virtual ostream & operator << (ostream &ost); | 
|---|
| [357fba] | 219 | }; | 
|---|
|  | 220 |  | 
|---|
|  | 221 | ostream & operator << (ostream &ost, const TesselPoint &a); | 
|---|
|  | 222 |  | 
|---|
|  | 223 | // =========================================================== class POINTCLOUD ============================================ | 
|---|
|  | 224 |  | 
|---|
|  | 225 | /** Super-class for all point clouds structures, also molecules. They have to inherit this structure and implement the virtual function to access the Vectors. | 
|---|
|  | 226 | * This basically encapsulates a list structure. | 
|---|
|  | 227 | */ | 
|---|
|  | 228 | class PointCloud { | 
|---|
|  | 229 | public: | 
|---|
|  | 230 | PointCloud(); | 
|---|
| [ab1932] | 231 | virtual ~PointCloud(); | 
|---|
| [357fba] | 232 |  | 
|---|
| [6a7f78c] | 233 | virtual const char * const GetName() const { return "unknown"; }; | 
|---|
| [e138de] | 234 | virtual Vector *GetCenter() const { return NULL; }; | 
|---|
| [776b64] | 235 | virtual TesselPoint *GetPoint() const { return NULL; }; | 
|---|
|  | 236 | virtual TesselPoint *GetTerminalPoint() const { return NULL; }; | 
|---|
| [71b20e] | 237 | virtual int GetMaxId() const { return 0; }; | 
|---|
| [776b64] | 238 | virtual void GoToNext() const {}; | 
|---|
|  | 239 | virtual void GoToPrevious() const {}; | 
|---|
|  | 240 | virtual void GoToFirst() const {}; | 
|---|
|  | 241 | virtual void GoToLast() const {}; | 
|---|
| [6a7f78c] | 242 | virtual bool IsEmpty() const { return true; }; | 
|---|
|  | 243 | virtual bool IsEnd() const { return true; }; | 
|---|
| [357fba] | 244 | }; | 
|---|
|  | 245 |  | 
|---|
|  | 246 | // ======================================================== class CandidateForTesselation ========================================= | 
|---|
|  | 247 |  | 
|---|
|  | 248 | class CandidateForTesselation { | 
|---|
|  | 249 | public : | 
|---|
| [1e168b] | 250 | CandidateForTesselation(BoundaryLineSet* currentBaseLine); | 
|---|
| [357fba] | 251 | CandidateForTesselation(TesselPoint* candidate, BoundaryLineSet* currentBaseLine, Vector OptCandidateCenter, Vector OtherOptCandidateCenter); | 
|---|
|  | 252 | ~CandidateForTesselation(); | 
|---|
|  | 253 |  | 
|---|
| [f67b6e] | 254 | TesselPointList pointlist; | 
|---|
| [357fba] | 255 | BoundaryLineSet *BaseLine; | 
|---|
|  | 256 | Vector OptCenter; | 
|---|
|  | 257 | Vector OtherOptCenter; | 
|---|
| [1e168b] | 258 | double ShortestAngle; | 
|---|
|  | 259 | double OtherShortestAngle; | 
|---|
| [357fba] | 260 | }; | 
|---|
|  | 261 |  | 
|---|
| [1e168b] | 262 | ostream & operator <<(ostream &ost, const  CandidateForTesselation &a); | 
|---|
|  | 263 |  | 
|---|
| [357fba] | 264 | // =========================================================== class TESSELATION =========================================== | 
|---|
|  | 265 |  | 
|---|
|  | 266 | /** Contains the envelope to a PointCloud. | 
|---|
|  | 267 | */ | 
|---|
| [5c7bf8] | 268 | class Tesselation : public PointCloud { | 
|---|
| [357fba] | 269 | public: | 
|---|
|  | 270 |  | 
|---|
|  | 271 | Tesselation(); | 
|---|
| [5c7bf8] | 272 | virtual ~Tesselation(); | 
|---|
| [357fba] | 273 |  | 
|---|
| [776b64] | 274 | void AddTesselationPoint(TesselPoint* Candidate, const int n); | 
|---|
| [f1ef60a] | 275 | void SetTesselationPoint(TesselPoint* Candidate, const int n) const; | 
|---|
| [776b64] | 276 | void AddTesselationLine(class BoundaryPointSet *a, class BoundaryPointSet *b, const int n); | 
|---|
|  | 277 | void AlwaysAddTesselationTriangleLine(class BoundaryPointSet *a, class BoundaryPointSet *b, const int n); | 
|---|
| [16d866] | 278 | void AddTesselationTriangle(); | 
|---|
| [776b64] | 279 | void AddTesselationTriangle(const int nr); | 
|---|
| [f67b6e] | 280 | void AddCandidateTriangle(CandidateForTesselation CandidateLine); | 
|---|
| [16d866] | 281 | void RemoveTesselationTriangle(class BoundaryTriangleSet *triangle); | 
|---|
|  | 282 | void RemoveTesselationLine(class BoundaryLineSet *line); | 
|---|
|  | 283 | void RemoveTesselationPoint(class BoundaryPointSet *point); | 
|---|
|  | 284 |  | 
|---|
| [357fba] | 285 |  | 
|---|
|  | 286 | // concave envelope | 
|---|
| [e138de] | 287 | void FindStartingTriangle(const double RADIUS, const LinkedCell *LC); | 
|---|
| [776b64] | 288 | void FindSecondPointForTesselation(class TesselPoint* a, Vector Oben, class TesselPoint*& OptCandidate, double Storage[3], double RADIUS, const LinkedCell *LC); | 
|---|
| [f67b6e] | 289 | void FindThirdPointForTesselation(Vector &NormalVector, Vector &SearchDirection, Vector &OldSphereCenter, CandidateForTesselation &CandidateLine, const class TesselPoint  * const ThirdNode, const double RADIUS, const LinkedCell *LC) const; | 
|---|
| [1e168b] | 290 | bool FindNextSuitableTriangle(CandidateForTesselation &CandidateLine, BoundaryTriangleSet &T, const double& RADIUS, const LinkedCell *LC); | 
|---|
| [f1ef60a] | 291 | int CheckPresenceOfTriangle(class TesselPoint *Candidates[3]) const; | 
|---|
| [e138de] | 292 | class BoundaryTriangleSet * GetPresentTriangle(TesselPoint *Candidates[3]); | 
|---|
| [357fba] | 293 |  | 
|---|
|  | 294 | // convex envelope | 
|---|
| [e138de] | 295 | void TesselateOnBoundary(const PointCloud * const cloud); | 
|---|
|  | 296 | void GuessStartingTriangle(); | 
|---|
|  | 297 | bool InsertStraddlingPoints(const PointCloud *cloud, const LinkedCell *LC); | 
|---|
|  | 298 | double RemovePointFromTesselatedSurface(class BoundaryPointSet *point); | 
|---|
|  | 299 | class BoundaryLineSet * FlipBaseline(class BoundaryLineSet *Base); | 
|---|
|  | 300 | double PickFarthestofTwoBaselines(class BoundaryLineSet *Base); | 
|---|
|  | 301 | class BoundaryPointSet *IsConvexRectangle(class BoundaryLineSet *Base); | 
|---|
| [244a84] | 302 | IndexToIndex * FindAllDegeneratedTriangles(); | 
|---|
|  | 303 | IndexToIndex * FindAllDegeneratedLines(); | 
|---|
| [7c14ec] | 304 | void RemoveDegeneratedTriangles(); | 
|---|
| [e138de] | 305 | void AddBoundaryPointByDegeneratedTriangle(class TesselPoint *point, LinkedCell *LC); | 
|---|
| [262bae] | 306 | int CorrectAllDegeneratedPolygons(); | 
|---|
| [16d866] | 307 |  | 
|---|
| [244a84] | 308 | TesselPointSet * GetAllConnectedPoints(const TesselPoint* const Point) const; | 
|---|
|  | 309 | TriangleSet * GetAllTriangles(const BoundaryPointSet * const Point) const; | 
|---|
|  | 310 | ListOfTesselPointList * GetPathsOfConnectedPoints(const TesselPoint* const Point) const; | 
|---|
|  | 311 | ListOfTesselPointList * GetClosedPathsOfConnectedPoints(const TesselPoint* const Point) const; | 
|---|
|  | 312 | TesselPointList * GetCircleOfSetOfPoints(TesselPointSet *SetOfNeighbours, const TesselPoint* const Point, const Vector * const Reference = NULL) const; | 
|---|
|  | 313 | TesselPointList * GetCircleOfConnectedTriangles(TesselPointSet *SetOfNeighbours, const TesselPoint* const Point, const Vector * const Reference) const; | 
|---|
|  | 314 | class BoundaryPointSet * GetCommonEndpoint(const BoundaryLineSet * line1, const BoundaryLineSet * line2) const; | 
|---|
|  | 315 | TriangleList * FindTriangles(const TesselPoint* const Points[3]) const; | 
|---|
|  | 316 | TriangleList * FindClosestTrianglesToVector(const Vector *x, const LinkedCell* LC) const; | 
|---|
|  | 317 | BoundaryTriangleSet * FindClosestTriangleToVector(const Vector *x, const LinkedCell* LC) const; | 
|---|
| [241485] | 318 | bool IsInnerPoint(const Vector &Point, const LinkedCell* const LC) const; | 
|---|
| [244a84] | 319 | double GetDistanceSquaredToTriangle(const Vector &Point, const BoundaryTriangleSet* const triangle) const; | 
|---|
| [9473f6] | 320 | double GetDistanceSquaredToSurface(const Vector &Point, const LinkedCell* const LC) const; | 
|---|
| [776b64] | 321 | bool AddBoundaryPoint(TesselPoint * Walker, const int n); | 
|---|
| [97498a] | 322 | DistanceToPointMap * FindClosestBoundaryPointsToVector(const Vector *x, const LinkedCell* LC) const; | 
|---|
| [c15ca2] | 323 | BoundaryLineSet * FindClosestBoundaryLineToVector(const Vector *x, const LinkedCell* LC) const; | 
|---|
| [ab1932] | 324 |  | 
|---|
| [0077b5] | 325 | // print for debugging | 
|---|
| [776b64] | 326 | void PrintAllBoundaryPoints(ofstream *out) const; | 
|---|
|  | 327 | void PrintAllBoundaryLines(ofstream *out) const; | 
|---|
|  | 328 | void PrintAllBoundaryTriangles(ofstream *out) const; | 
|---|
| [0077b5] | 329 |  | 
|---|
| [57066a] | 330 | // store envelope in file | 
|---|
| [e138de] | 331 | void Output(const char *filename, const PointCloud * const cloud); | 
|---|
| [0077b5] | 332 |  | 
|---|
| [357fba] | 333 | PointMap PointsOnBoundary; | 
|---|
|  | 334 | LineMap LinesOnBoundary; | 
|---|
| [1e168b] | 335 | CandidateMap OpenLines; | 
|---|
| [357fba] | 336 | TriangleMap TrianglesOnBoundary; | 
|---|
|  | 337 | int PointsOnBoundaryCount; | 
|---|
|  | 338 | int LinesOnBoundaryCount; | 
|---|
|  | 339 | int TrianglesOnBoundaryCount; | 
|---|
|  | 340 |  | 
|---|
| [5c7bf8] | 341 | // PointCloud implementation for PointsOnBoundary | 
|---|
| [776b64] | 342 | virtual Vector *GetCenter(ofstream *out) const; | 
|---|
|  | 343 | virtual TesselPoint *GetPoint() const; | 
|---|
|  | 344 | virtual TesselPoint *GetTerminalPoint() const; | 
|---|
|  | 345 | virtual void GoToNext() const; | 
|---|
|  | 346 | virtual void GoToPrevious() const; | 
|---|
|  | 347 | virtual void GoToFirst() const; | 
|---|
|  | 348 | virtual void GoToLast() const; | 
|---|
|  | 349 | virtual bool IsEmpty() const; | 
|---|
|  | 350 | virtual bool IsEnd() const; | 
|---|
| [5c7bf8] | 351 |  | 
|---|
| [357fba] | 352 | class BoundaryPointSet *BPS[2]; | 
|---|
|  | 353 | class BoundaryLineSet *BLS[3]; | 
|---|
|  | 354 | class BoundaryTriangleSet *BTS; | 
|---|
| [57066a] | 355 | class BoundaryTriangleSet *LastTriangle; | 
|---|
|  | 356 | int TriangleFilesWritten; | 
|---|
| [5c7bf8] | 357 |  | 
|---|
| [08ef35] | 358 | private: | 
|---|
| [f1ef60a] | 359 | mutable class BoundaryPointSet *TPS[3]; //this is a Storage for pointers to triangle points, this and BPS[2] needed due to AddLine restrictions | 
|---|
| [08ef35] | 360 |  | 
|---|
| [776b64] | 361 | mutable PointMap::const_iterator InternalPointer; | 
|---|
| [f1ef60a] | 362 |  | 
|---|
| [f67b6e] | 363 | //bool HasOtherBaselineBetterCandidate(const BoundaryLineSet * const BaseRay, const TesselPoint * const OptCandidate, double ShortestAngle, double RADIUS, const LinkedCell * const LC) const; | 
|---|
| [357fba] | 364 | }; | 
|---|
|  | 365 |  | 
|---|
|  | 366 |  | 
|---|
|  | 367 | #endif /* TESSELATION_HPP_ */ | 
|---|