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