Ignore:
Timestamp:
Aug 8, 2009, 7:25:28 PM (16 years ago)
Author:
Frederik Heber <heber@…>
Children:
70c4567
Parents:
51abbe
Message:

BUGFIXes to Find_convex_... and Find_non_convex_... algorithms

  • Find_non_convex_border() - very first baseline of starting triangle is skipped as it is the most outward.
  • BoundaryLineSet::TrianglesCount is removed and replaced by triangles.size(), as it is redundant and we made mistakes in not reducing TrianglesCount on triangle erase.
  • BoundaryLineSet::CheckConvexityCriterion() - extra check when NormalVector point in the very same directions,
  • BoundaryTriangleSet::GetIntersectionInsideTriangle() - CrossPoint return value is checked, i===3 checked not >3!
  • new stream operator for TesselPoint with single argument.
  • class Tesselation inherits PointCloud and implements all functions (including virtual destructor) in order to have PointsOnBoundary parsable by LinkedCell.
  • Tesselation::InsertStraddlingPoints() - LinkedCell is created for every atom just from the BoundaryPoints and not for all (so that only BoundaryPoints can be found), old triangle is now really deleted, lots of verbosity added and fixed.
  • Tesselation::GetCommonEndpoint() - connectedClosestPoint is deleted lateron, SecondPoint argument but not used.
  • Tesselation::FindClosestPoint() - returns second second closest point in new second argument.
  • Tesselation::getCircleOfConnectedPoints() - we find the BoundaryPoint if possible and just look through its lines if found, plane is centered at closest point and normal is between it and the center of all on circle, getAngle() corrections incorporated and vector is always projected onto circle plane.
  • new function Tesselation findSecondClosestPoint().
  • getAngle() - just receives third vector with which it dedices between [0,pi) and [pi,2pi), the vectors are assumed to be relative to one common center already.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • molecuilder/src/tesselation.hpp

    r51abbe r0cf171  
    9999    class BoundaryPointSet *endpoints[2];
    100100    TriangleMap triangles;
    101     int TrianglesCount;
    102101    int Nr;
    103102};
     
    136135public:
    137136  TesselPoint();
    138   ~TesselPoint();
     137  virtual ~TesselPoint();
    139138
    140139  Vector *node;   // pointer to position of the dot in space
    141140  int nr;       // index to easierly identify
    142141  char *Name;   // some name to reference to on output
     142
     143  virtual ostream & operator << (ostream &ost);
    143144};
    144145
     
    183184/** Contains the envelope to a PointCloud.
    184185 */
    185 class Tesselation {
     186class Tesselation : public PointCloud {
    186187  public:
    187188
    188189    Tesselation();
    189     ~Tesselation();
     190    virtual ~Tesselation();
    190191
    191192    void AddPoint(TesselPoint *Walker);
     
    224225    int TrianglesOnBoundaryCount;
    225226
     227    // PointCloud implementation for PointsOnBoundary
     228    virtual Vector *GetCenter(ofstream *out);
     229    virtual TesselPoint *GetPoint();
     230    virtual TesselPoint *GetTerminalPoint();
     231    virtual void GoToNext();
     232    virtual void GoToPrevious();
     233    virtual void GoToFirst();
     234    virtual void GoToLast();
     235    virtual bool IsEmpty();
     236    virtual bool IsEnd();
     237
    226238  private:
    227239    class BoundaryPointSet *TPS[3]; //this is a Storage for pointers to triangle points, this and BPS[2] needed due to AddLine restrictions
     
    229241    class BoundaryLineSet *BLS[3];
    230242    class BoundaryTriangleSet *BTS;
     243
     244    PointMap::iterator InternalPointer;
    231245};
    232246
    233247bool CheckLineCriteriaforDegeneratedTriangle(class BoundaryPointSet *nodes[3]);
    234248bool sortCandidates(class CandidateForTesselation* candidate1, class CandidateForTesselation* candidate2);
    235 TesselPoint* findClosestPoint(const Vector* Point, LinkedCell* LC);
    236 double getAngle(const Vector &point, const Vector &reference, const Vector &center, Vector OrthogonalVector);
     249TesselPoint* findClosestPoint(const Vector* Point, TesselPoint *&SecondPoint, LinkedCell* LC);
     250TesselPoint* findSecondClosestPoint(const Vector*, LinkedCell*);
     251double getAngle(const Vector &point, const Vector &reference, const Vector OrthogonalVector);
    237252
    238253#endif /* TESSELATION_HPP_ */
Note: See TracChangeset for help on using the changeset viewer.