Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/tesselation.hpp

    r7c14ec rf66195  
    1313using namespace std;
    1414
     15/*********************************************** includes ***********************************/
     16
    1517// include config.h
    1618#ifdef HAVE_CONFIG_H
     
    2224#include <set>
    2325
    24 
    25 #include "helpers.hpp"
    26 #include "linkedcell.hpp"
    27 #include "tesselationhelpers.hpp"
    2826#include "vector.hpp"
     27
     28/****************************************** forward declarations *****************************/
    2929
    3030class BoundaryPointSet;
    3131class BoundaryLineSet;
    3232class BoundaryTriangleSet;
     33class LinkedCell;
    3334class TesselPoint;
    3435class PointCloud;
    3536class Tesselation;
     37
     38/********************************************** definitions *********************************/
     39
     40#define DoTecplotOutput 1
     41#define DoRaster3DOutput 1
     42#define DoVRMLOutput 1
     43#define TecplotSuffix ".dat"
     44#define Raster3DSuffix ".r3d"
     45#define VRMLSUffix ".wrl"
    3646
    3747// ======================================================= some template functions =========================================
     
    5363#define DistanceMultiMapPair pair <double, pair < PointMap::iterator, PointMap::iterator> >
    5464
    55 
     65/********************************************** declarations *******************************/
    5666
    5767template <typename T> void SetEndpointsOrdered(T endpoints[2], T endpoint1, T endpoint2)
     
    115125
    116126    void GetNormalVector(Vector &NormalVector);
     127    void GetCenter(Vector *center);
    117128    bool GetIntersectionInsideTriangle(ofstream *out, Vector *MolCenter, Vector *x, Vector *Intersection);
    118129    bool ContainsBoundaryLine(class BoundaryLineSet *line);
    119130    bool ContainsBoundaryPoint(class BoundaryPointSet *point);
     131    bool ContainsBoundaryPoint(class TesselPoint *point);
    120132    class BoundaryPointSet *GetThirdEndpoint(class BoundaryLineSet *line);
    121133    bool IsPresentTupel(class BoundaryPointSet *Points[3]);
    122     void GetCenter(Vector *center);
     134    bool IsPresentTupel(class BoundaryTriangleSet *T);
    123135
    124136    class BoundaryPointSet *endpoints[3];
     
    196208    void AlwaysAddTesselationTriangleLine(class BoundaryPointSet *a, class BoundaryPointSet *b, int n);
    197209    void AddTesselationTriangle();
     210    void AddTesselationTriangle(int nr);
    198211    void RemoveTesselationTriangle(class BoundaryTriangleSet *triangle);
    199212    void RemoveTesselationLine(class BoundaryLineSet *line);
    200213    void RemoveTesselationPoint(class BoundaryPointSet *point);
    201214
    202     bool IsInside(Vector *pointer);
    203215    class BoundaryPointSet *GetCommonEndpoint(class BoundaryLineSet * line1, class BoundaryLineSet * line2);
    204216
    205217    // concave envelope
    206218    void FindStartingTriangle(ofstream *out, const double RADIUS, class LinkedCell *LC);
    207     void FindSecondPointForTesselation(class TesselPoint* a, class TesselPoint* Candidate, Vector Oben, class TesselPoint*& OptCandidate, double Storage[3], double RADIUS, class LinkedCell *LC);
     219    void FindSecondPointForTesselation(class TesselPoint* a, Vector Oben, class TesselPoint*& OptCandidate, double Storage[3], double RADIUS, class LinkedCell *LC);
    208220    void FindThirdPointForTesselation(Vector NormalVector, Vector SearchDirection, Vector OldSphereCenter, class BoundaryLineSet *BaseLine, class TesselPoint *ThirdNode, CandidateList* &candidates, double *ShortestAngle, const double RADIUS, class LinkedCell *LC);
    209     bool FindNextSuitableTriangle(ofstream *out, BoundaryLineSet &Line, BoundaryTriangleSet &T, const double& RADIUS, int N, LinkedCell *LC);
     221    bool FindNextSuitableTriangle(ofstream *out, BoundaryLineSet &Line, BoundaryTriangleSet &T, const double& RADIUS, LinkedCell *LC);
    210222    int CheckPresenceOfTriangle(ofstream *out, class TesselPoint *Candidates[3]);
     223    class BoundaryTriangleSet * GetPresentTriangle(ofstream *out, TesselPoint *Candidates[3]);
    211224
    212225    // convex envelope
     
    215228    bool InsertStraddlingPoints(ofstream *out, PointCloud *cloud, LinkedCell *LC);
    216229    double RemovePointFromTesselatedSurface(ofstream *out, class BoundaryPointSet *point);
    217     bool FlipBaseline(ofstream *out, class BoundaryLineSet *Base);
    218     bool PickFarthestofTwoBaselines(ofstream *out, class BoundaryLineSet *Base);
     230    class BoundaryLineSet * FlipBaseline(ofstream *out, class BoundaryLineSet *Base);
     231    double PickFarthestofTwoBaselines(ofstream *out, class BoundaryLineSet *Base);
    219232    class BoundaryPointSet *IsConvexRectangle(ofstream *out, class BoundaryLineSet *Base);
    220     map<int, int> FindAllDegeneratedTriangles();
     233    map<int, int> * FindAllDegeneratedTriangles();
     234    map<int, int> * FindAllDegeneratedLines();
    221235    void RemoveDegeneratedTriangles();
    222 
    223     list<TesselPoint*> * GetCircleOfConnectedPoints(ofstream *out, TesselPoint* Point);
    224     list<TesselPoint*> * GetNeighboursOnCircleOfConnectedPoints(ofstream *out, list<TesselPoint*> *connectedPoints, TesselPoint* Point, Vector* Reference);
     236    void AddBoundaryPointByDegeneratedTriangle(ofstream *out, class TesselPoint *point, LinkedCell *LC);
     237
     238    set<TesselPoint*> * GetAllConnectedPoints(ofstream *out, TesselPoint* Point);
     239    set<BoundaryTriangleSet*> *GetAllTriangles(ofstream *out, class BoundaryPointSet *Point);
     240    list<list<TesselPoint*> *> * GetPathsOfConnectedPoints(ofstream *out, TesselPoint* Point);
     241    list<list<TesselPoint*> *> * GetClosedPathsOfConnectedPoints(ofstream *out, TesselPoint* Point);
     242    list<TesselPoint*> * GetCircleOfConnectedPoints(ofstream *out, TesselPoint* Point, Vector *Reference = NULL);
    225243    list<BoundaryTriangleSet*> *FindTriangles(TesselPoint* Points[3]);
    226244    list<BoundaryTriangleSet*> * FindClosestTrianglesToPoint(ofstream *out, Vector *x, LinkedCell* LC);
     
    229247    bool IsInnerPoint(ofstream *out, TesselPoint *Point, LinkedCell* LC);
    230248    bool AddBoundaryPoint(TesselPoint *Walker, int n);
     249
     250    // print for debugging
     251    void PrintAllBoundaryPoints(ofstream *out);
     252    void PrintAllBoundaryLines(ofstream *out);
     253    void PrintAllBoundaryTriangles(ofstream *out);
     254
     255    // store envelope in file
     256    void Output(ofstream *out, const char *filename, PointCloud *cloud);
    231257
    232258    PointMap PointsOnBoundary;
     
    251277    class BoundaryLineSet *BLS[3];
    252278    class BoundaryTriangleSet *BTS;
     279    class BoundaryTriangleSet *LastTriangle;
     280    int TriangleFilesWritten;
    253281
    254282  private:
     
    258286};
    259287
    260 bool CheckLineCriteriaForDegeneratedTriangle(class BoundaryPointSet *nodes[3]);
    261 bool SortCandidates(class CandidateForTesselation* candidate1, class CandidateForTesselation* candidate2);
    262 TesselPoint* FindClosestPoint(const Vector* Point, TesselPoint *&SecondPoint, LinkedCell* LC);
    263 TesselPoint* FindSecondClosestPoint(const Vector*, LinkedCell*);
    264 double GetAngle(const Vector &point, const Vector &reference, const Vector OrthogonalVector);
    265 Vector * GetClosestPointBetweenLine(ofstream *out, class BoundaryLineSet *Base, class BoundaryLineSet *OtherBase);
    266288
    267289#endif /* TESSELATION_HPP_ */
Note: See TracChangeset for help on using the changeset viewer.