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