Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/tesselation.hpp

    rb998c3 rf1ef60a  
    2323#include <list>
    2424#include <set>
    25 #include <stack>
    2625
    2726#include "atom_particleinfo.hpp"
     
    4847#define VRMLSUffix ".wrl"
    4948
    50 #define ParallelEpsilon 1e-3
    51 
    5249// ======================================================= some template functions =========================================
    5350
    5451#define PointMap map < int, class BoundaryPointSet * >
    55 #define PointSet set < class BoundaryPointSet * >
    56 #define PointList list < class BoundaryPointSet * >
    5752#define PointPair pair < int, class BoundaryPointSet * >
    5853#define PointTestPair pair < PointMap::iterator, bool >
    59 
    6054#define CandidateList list <class CandidateForTesselation *>
    61 #define CandidateMap map <class BoundaryLineSet *, class CandidateForTesselation *>
    6255
    6356#define LineMap multimap < int, class BoundaryLineSet * >
    64 #define LineSet set < class BoundaryLineSet * >
    65 #define LineList list < class BoundaryLineSet * >
    6657#define LinePair pair < int, class BoundaryLineSet * >
    6758#define LineTestPair pair < LineMap::iterator, bool >
    6859
    6960#define TriangleMap map < int, class BoundaryTriangleSet * >
    70 #define TriangleSet set < class BoundaryTriangleSet * >
    71 #define TriangleList list < class BoundaryTriangleSet * >
    7261#define TrianglePair pair < int, class BoundaryTriangleSet * >
    7362#define TriangleTestPair pair < TrianglePair::iterator, bool >
    7463
    75 #define PolygonMap map < int, class BoundaryPolygonSet * >
    76 #define PolygonSet set < class BoundaryPolygonSet * >
    77 #define PolygonList list < class BoundaryPolygonSet * >
    78 
    7964#define DistanceMultiMap multimap <double, pair < PointMap::iterator, PointMap::iterator> >
    8065#define DistanceMultiMapPair pair <double, pair < PointMap::iterator, PointMap::iterator> >
    81 
    82 #define TesselPointList list <TesselPoint *>
    83 #define TesselPointSet set <TesselPoint *>
    8466
    8567/********************************************** declarations *******************************/
     
    132114    TriangleMap triangles;
    133115    int Nr;
    134     bool skipped;
    135116};
    136117
     
    158139    class BoundaryLineSet *lines[3];
    159140    Vector NormalVector;
    160     Vector SphereCenter;
    161141    int Nr;
    162142};
    163143
    164144ostream & 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);
    197145
    198146// =========================================================== class TESSELPOINT ===========================================
     
    222170  virtual ~PointCloud();
    223171
    224   virtual const char * const GetName() const { return "unknown"; };
    225172  virtual Vector *GetCenter() const { return NULL; };
    226173  virtual TesselPoint *GetPoint() const { return NULL; };
     
    230177  virtual void GoToFirst() const {};
    231178  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; };
    234181};
    235182
     
    238185class CandidateForTesselation {
    239186  public :
    240   CandidateForTesselation(BoundaryLineSet* currentBaseLine);
    241187  CandidateForTesselation(TesselPoint* candidate, BoundaryLineSet* currentBaseLine, Vector OptCandidateCenter, Vector OtherOptCandidateCenter);
    242188  ~CandidateForTesselation();
    243189
    244   TesselPointList pointlist;
     190  TesselPoint *point;
    245191  BoundaryLineSet *BaseLine;
    246192  Vector OptCenter;
    247193  Vector OtherOptCenter;
    248   bool IsDegenerated;
    249   double ShortestAngle;
    250   double OtherShortestAngle;
    251 };
    252 
    253 ostream & operator <<(ostream &ost, const  CandidateForTesselation &a);
     194};
    254195
    255196// =========================================================== class TESSELATION ===========================================
     
    269210    void AddTesselationTriangle();
    270211    void AddTesselationTriangle(const int nr);
    271     void AddCandidateTriangle(CandidateForTesselation CandidateLine);
    272212    void RemoveTesselationTriangle(class BoundaryTriangleSet *triangle);
    273213    void RemoveTesselationLine(class BoundaryLineSet *line);
     
    278218    void FindStartingTriangle(const double RADIUS, const LinkedCell *LC);
    279219    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);
    282222    int CheckPresenceOfTriangle(class TesselPoint *Candidates[3]) const;
    283223    class BoundaryTriangleSet * GetPresentTriangle(TesselPoint *Candidates[3]);
     
    295235    void RemoveDegeneratedTriangles();
    296236    void AddBoundaryPointByDegeneratedTriangle(class TesselPoint *point, LinkedCell *LC);
    297     int CorrectAllDegeneratedPolygons();
    298237
    299238    set<TesselPoint*> * GetAllConnectedPoints(const TesselPoint* const Point) const;
     
    301240    list<list<TesselPoint*> *> * GetPathsOfConnectedPoints(const TesselPoint* const Point) const;
    302241    list<list<TesselPoint*> *> * GetClosedPathsOfConnectedPoints(const TesselPoint* const Point) const;
    303     list<TesselPoint*> * GetCircleOfSetOfPoints(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;
    304243    class BoundaryPointSet *GetCommonEndpoint(const BoundaryLineSet * line1, const BoundaryLineSet * line2) const;
    305244    list<BoundaryTriangleSet*> *FindTriangles(const TesselPoint* const Points[3]) const;
     
    320259    PointMap PointsOnBoundary;
    321260    LineMap LinesOnBoundary;
    322     CandidateMap OpenLines;
    323261    TriangleMap TrianglesOnBoundary;
    324262    int PointsOnBoundaryCount;
     
    348286    mutable PointMap::const_iterator InternalPointer;
    349287
    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;
    351289};
    352290
Note: See TracChangeset for help on using the changeset viewer.