Changes in src/tesselation.hpp [f1ef60a:125b3c]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/tesselation.hpp
rf1ef60a r125b3c 23 23 #include <list> 24 24 #include <set> 25 #include <stack> 25 26 26 27 #include "atom_particleinfo.hpp" … … 47 48 #define VRMLSUffix ".wrl" 48 49 50 #define ParallelEpsilon 1e-3 51 49 52 // ======================================================= some template functions ========================================= 50 53 51 54 #define PointMap map < int, class BoundaryPointSet * > 55 #define PointSet set < class BoundaryPointSet * > 56 #define PointList list < class BoundaryPointSet * > 52 57 #define PointPair pair < int, class BoundaryPointSet * > 53 58 #define PointTestPair pair < PointMap::iterator, bool > 59 54 60 #define CandidateList list <class CandidateForTesselation *> 61 #define CandidateMap map <class BoundaryLineSet *, class CandidateForTesselation *> 55 62 56 63 #define LineMap multimap < int, class BoundaryLineSet * > 64 #define LineSet set < class BoundaryLineSet * > 65 #define LineList list < class BoundaryLineSet * > 57 66 #define LinePair pair < int, class BoundaryLineSet * > 58 67 #define LineTestPair pair < LineMap::iterator, bool > 59 68 60 69 #define TriangleMap map < int, class BoundaryTriangleSet * > 70 #define TriangleSet set < class BoundaryTriangleSet * > 71 #define TriangleList list < class BoundaryTriangleSet * > 61 72 #define TrianglePair pair < int, class BoundaryTriangleSet * > 62 73 #define TriangleTestPair pair < TrianglePair::iterator, bool > 63 74 75 #define PolygonMap map < int, class BoundaryPolygonSet * > 76 #define PolygonSet set < class BoundaryPolygonSet * > 77 #define PolygonList list < class BoundaryPolygonSet * > 78 64 79 #define DistanceMultiMap multimap <double, pair < PointMap::iterator, PointMap::iterator> > 65 80 #define DistanceMultiMapPair pair <double, pair < PointMap::iterator, PointMap::iterator> > 81 82 #define TesselPointList list <TesselPoint *> 83 #define TesselPointSet set <TesselPoint *> 66 84 67 85 /********************************************** declarations *******************************/ … … 114 132 TriangleMap triangles; 115 133 int Nr; 134 bool skipped; 116 135 }; 117 136 … … 139 158 class BoundaryLineSet *lines[3]; 140 159 Vector NormalVector; 160 Vector SphereCenter; 141 161 int Nr; 142 162 }; 143 163 144 164 ostream & operator << (ostream &ost, const BoundaryTriangleSet &a); 165 166 167 // ======================================================== class BoundaryTriangleSet ======================================= 168 169 /** Set of BoundaryPointSet. 170 * This is just meant as a container for a group of endpoints, extending the node, line, triangle concept. However, this has 171 * only marginally something to do with the tesselation. Hence, there is no incorporation into the bookkeeping of the Tesselation 172 * class (i.e. no allocation, no deletion). 173 * \note we assume that the set of endpoints reside (more or less) on a plane. 174 */ 175 class BoundaryPolygonSet { 176 public: 177 BoundaryPolygonSet(); 178 ~BoundaryPolygonSet(); 179 180 Vector * GetNormalVector(const Vector &NormalVector) const; 181 void GetCenter(Vector *center) const; 182 bool ContainsBoundaryLine(const BoundaryLineSet * const line) const; 183 bool ContainsBoundaryPoint(const BoundaryPointSet * const point) const; 184 bool ContainsBoundaryPoint(const TesselPoint * const point) const; 185 bool ContainsBoundaryTriangle(const BoundaryTriangleSet * const point) const; 186 bool ContainsPresentTupel(const BoundaryPointSet * const * Points, const int dim) const; 187 bool ContainsPresentTupel(const BoundaryPolygonSet * const P) const; 188 bool ContainsPresentTupel(const PointSet &endpoints) const; 189 TriangleSet * GetAllContainedTrianglesFromEndpoints() const; 190 bool FillPolygonFromTrianglesOfLine(const BoundaryLineSet * const line); 191 192 PointSet endpoints; 193 int Nr; 194 }; 195 196 ostream & operator << (ostream &ost, const BoundaryPolygonSet &a); 145 197 146 198 // =========================================================== class TESSELPOINT =========================================== … … 170 222 virtual ~PointCloud(); 171 223 224 virtual const char * const GetName() const { return "unknown"; }; 172 225 virtual Vector *GetCenter() const { return NULL; }; 173 226 virtual TesselPoint *GetPoint() const { return NULL; }; … … 177 230 virtual void GoToFirst() const {}; 178 231 virtual void GoToLast() const {}; 179 virtual bool IsEmpty() const { return false; };180 virtual bool IsEnd() const { return false; };232 virtual bool IsEmpty() const { return true; }; 233 virtual bool IsEnd() const { return true; }; 181 234 }; 182 235 … … 185 238 class CandidateForTesselation { 186 239 public : 240 CandidateForTesselation(BoundaryLineSet* currentBaseLine); 187 241 CandidateForTesselation(TesselPoint* candidate, BoundaryLineSet* currentBaseLine, Vector OptCandidateCenter, Vector OtherOptCandidateCenter); 188 242 ~CandidateForTesselation(); 189 243 190 TesselPoint *point;244 TesselPointList pointlist; 191 245 BoundaryLineSet *BaseLine; 192 246 Vector OptCenter; 193 247 Vector OtherOptCenter; 194 }; 248 double ShortestAngle; 249 double OtherShortestAngle; 250 }; 251 252 ostream & operator <<(ostream &ost, const CandidateForTesselation &a); 195 253 196 254 // =========================================================== class TESSELATION =========================================== … … 210 268 void AddTesselationTriangle(); 211 269 void AddTesselationTriangle(const int nr); 270 void AddCandidateTriangle(CandidateForTesselation CandidateLine); 212 271 void RemoveTesselationTriangle(class BoundaryTriangleSet *triangle); 213 272 void RemoveTesselationLine(class BoundaryLineSet *line); … … 218 277 void FindStartingTriangle(const double RADIUS, const LinkedCell *LC); 219 278 void FindSecondPointForTesselation(class TesselPoint* a, Vector Oben, class TesselPoint*& OptCandidate, double Storage[3], double RADIUS, const LinkedCell *LC); 220 void FindThirdPointForTesselation(Vector &NormalVector, Vector &SearchDirection, Vector &OldSphereCenter, class BoundaryLineSet *BaseLine, const class TesselPoint * const ThirdNode, CandidateList* &candidates, double *ShortestAngle, const double RADIUS, const LinkedCell *LC) const;221 bool FindNextSuitableTriangle( BoundaryLineSet &Line, BoundaryTriangleSet &T, const double& RADIUS, const LinkedCell *LC);279 void FindThirdPointForTesselation(Vector &NormalVector, Vector &SearchDirection, Vector &OldSphereCenter, CandidateForTesselation &CandidateLine, const class TesselPoint * const ThirdNode, const double RADIUS, const LinkedCell *LC) const; 280 bool FindNextSuitableTriangle(CandidateForTesselation &CandidateLine, BoundaryTriangleSet &T, const double& RADIUS, const LinkedCell *LC); 222 281 int CheckPresenceOfTriangle(class TesselPoint *Candidates[3]) const; 223 282 class BoundaryTriangleSet * GetPresentTriangle(TesselPoint *Candidates[3]); … … 235 294 void RemoveDegeneratedTriangles(); 236 295 void AddBoundaryPointByDegeneratedTriangle(class TesselPoint *point, LinkedCell *LC); 296 int CorrectAllDegeneratedPolygons(); 237 297 238 298 set<TesselPoint*> * GetAllConnectedPoints(const TesselPoint* const Point) const; … … 240 300 list<list<TesselPoint*> *> * GetPathsOfConnectedPoints(const TesselPoint* const Point) const; 241 301 list<list<TesselPoint*> *> * GetClosedPathsOfConnectedPoints(const TesselPoint* const Point) const; 242 list<TesselPoint*> * GetCircleOf ConnectedPoints(const TesselPoint* const Point, const Vector * const Reference = NULL) const;302 list<TesselPoint*> * GetCircleOfSetOfPoints(set<TesselPoint*> *SetOfNeighbours, const TesselPoint* const Point, const Vector * const Reference = NULL) const; 243 303 class BoundaryPointSet *GetCommonEndpoint(const BoundaryLineSet * line1, const BoundaryLineSet * line2) const; 244 304 list<BoundaryTriangleSet*> *FindTriangles(const TesselPoint* const Points[3]) const; … … 259 319 PointMap PointsOnBoundary; 260 320 LineMap LinesOnBoundary; 321 CandidateMap OpenLines; 261 322 TriangleMap TrianglesOnBoundary; 262 323 int PointsOnBoundaryCount; … … 286 347 mutable PointMap::const_iterator InternalPointer; 287 348 288 bool HasOtherBaselineBetterCandidate(const BoundaryLineSet * const BaseRay, const TesselPoint * const OptCandidate, double ShortestAngle, double RADIUS, const LinkedCell * const LC) const;349 //bool HasOtherBaselineBetterCandidate(const BoundaryLineSet * const BaseRay, const TesselPoint * const OptCandidate, double ShortestAngle, double RADIUS, const LinkedCell * const LC) const; 289 350 }; 290 351
Note:
See TracChangeset
for help on using the changeset viewer.