Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/tesselation.hpp

    r125b3c r244a84  
    5252// ======================================================= some template functions =========================================
    5353
     54#define IndexToIndex map <int, int>
     55
    5456#define PointMap map < int, class BoundaryPointSet * >
    5557#define PointSet set < class BoundaryPointSet * >
     
    7779#define PolygonList list < class BoundaryPolygonSet * >
    7880
     81#define DistanceToPointMap multimap <double, class BoundaryPointSet * >
     82#define DistanceToPointPair pair <double, class BoundaryPointSet * >
     83
    7984#define DistanceMultiMap multimap <double, pair < PointMap::iterator, PointMap::iterator> >
    8085#define DistanceMultiMapPair pair <double, pair < PointMap::iterator, PointMap::iterator> >
     
    8287#define TesselPointList list <TesselPoint *>
    8388#define TesselPointSet set <TesselPoint *>
     89
     90#define ListOfTesselPointList list<list <TesselPoint *> *>
    8491
    8592/********************************************** declarations *******************************/
     
    101108  public:
    102109    BoundaryPointSet();
    103     BoundaryPointSet(TesselPoint * Walker);
     110    BoundaryPointSet(TesselPoint * const Walker);
    104111    ~BoundaryPointSet();
    105112
    106     void AddLine(class BoundaryLineSet *line);
     113    void AddLine(BoundaryLineSet * const line);
    107114
    108115    LineMap lines;
     
    120127  public:
    121128    BoundaryLineSet();
    122     BoundaryLineSet(class BoundaryPointSet *Point[2], const int number);
     129    BoundaryLineSet(BoundaryPointSet * const Point[2], const int number);
     130    BoundaryLineSet(BoundaryPointSet * const Point1, BoundaryPointSet * const Point2, const int number);
    123131    ~BoundaryLineSet();
    124132
    125     void AddTriangle(class BoundaryTriangleSet *triangle);
    126     bool IsConnectedTo(class BoundaryLineSet *line);
    127     bool ContainsBoundaryPoint(class BoundaryPointSet *point);
    128     bool CheckConvexityCriterion();
    129     class BoundaryPointSet *GetOtherEndpoint(class BoundaryPointSet *);
     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;
    130138
    131139    class BoundaryPointSet *endpoints[2];
     
    142150  public:
    143151    BoundaryTriangleSet();
    144     BoundaryTriangleSet(class BoundaryLineSet *line[3], int number);
     152    BoundaryTriangleSet(class BoundaryLineSet * const line[3], const int number);
    145153    ~BoundaryTriangleSet();
    146154
    147     void GetNormalVector(Vector &NormalVector);
    148     void GetCenter(Vector *center);
    149     bool GetIntersectionInsideTriangle(Vector *MolCenter, Vector *x, Vector *Intersection);
    150     bool ContainsBoundaryLine(class BoundaryLineSet *line);
    151     bool ContainsBoundaryPoint(class BoundaryPointSet *point);
    152     bool ContainsBoundaryPoint(class TesselPoint *point);
    153     class BoundaryPointSet *GetThirdEndpoint(class BoundaryLineSet *line);
    154     bool IsPresentTupel(class BoundaryPointSet *Points[3]);
    155     bool IsPresentTupel(class BoundaryTriangleSet *T);
     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;
    156165
    157166    class BoundaryPointSet *endpoints[3];
     
    226235  virtual TesselPoint *GetPoint() const { return NULL; };
    227236  virtual TesselPoint *GetTerminalPoint() const { return NULL; };
     237  virtual int GetMaxId() const { return 0; };
    228238  virtual void GoToNext() const {};
    229239  virtual void GoToPrevious() const {};
     
    290300    double PickFarthestofTwoBaselines(class BoundaryLineSet *Base);
    291301    class BoundaryPointSet *IsConvexRectangle(class BoundaryLineSet *Base);
    292     map<int, int> * FindAllDegeneratedTriangles();
    293     map<int, int> * FindAllDegeneratedLines();
     302    IndexToIndex * FindAllDegeneratedTriangles();
     303    IndexToIndex * FindAllDegeneratedLines();
    294304    void RemoveDegeneratedTriangles();
    295305    void AddBoundaryPointByDegeneratedTriangle(class TesselPoint *point, LinkedCell *LC);
    296306    int CorrectAllDegeneratedPolygons();
    297307
    298     set<TesselPoint*> * GetAllConnectedPoints(const TesselPoint* const Point) const;
    299     set<BoundaryTriangleSet*> *GetAllTriangles(const BoundaryPointSet * const Point) const;
    300     list<list<TesselPoint*> *> * GetPathsOfConnectedPoints(const TesselPoint* const Point) const;
    301     list<list<TesselPoint*> *> * GetClosedPathsOfConnectedPoints(const TesselPoint* const Point) const;
    302     list<TesselPoint*> * GetCircleOfSetOfPoints(set<TesselPoint*> *SetOfNeighbours, const TesselPoint* const Point, const Vector * const Reference = NULL) const;
    303     class BoundaryPointSet *GetCommonEndpoint(const BoundaryLineSet * line1, const BoundaryLineSet * line2) const;
    304     list<BoundaryTriangleSet*> *FindTriangles(const TesselPoint* const Points[3]) const;
    305     list<BoundaryTriangleSet*> * FindClosestTrianglesToPoint(const Vector *x, const LinkedCell* LC) const;
    306     class BoundaryTriangleSet * FindClosestTriangleToPoint(const Vector *x, const LinkedCell* LC) const;
     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;
    307318    bool IsInnerPoint(const Vector &Point, const LinkedCell* const LC) const;
    308     bool IsInnerPoint(const TesselPoint * const Point, const LinkedCell* const LC) const;
     319    double GetDistanceSquaredToTriangle(const Vector &Point, const BoundaryTriangleSet* const triangle) const;
     320    double GetDistanceSquaredToSurface(const Vector &Point, const LinkedCell* const LC) const;
    309321    bool AddBoundaryPoint(TesselPoint * Walker, const int n);
     322    DistanceToPointMap * FindClosestBoundaryPointsToVector(const Vector *x, const LinkedCell* LC) const;
     323    BoundaryLineSet * FindClosestBoundaryLineToVector(const Vector *x, const LinkedCell* LC) const;
    310324
    311325    // print for debugging
Note: See TracChangeset for help on using the changeset viewer.