Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/tesselation.hpp

    rf66195 r7c14ec  
    1313using namespace std;
    1414
    15 /*********************************************** includes ***********************************/
    16 
    1715// include config.h
    1816#ifdef HAVE_CONFIG_H
     
    2422#include <set>
    2523
     24
     25#include "helpers.hpp"
     26#include "linkedcell.hpp"
     27#include "tesselationhelpers.hpp"
    2628#include "vector.hpp"
    27 
    28 /****************************************** forward declarations *****************************/
    2929
    3030class BoundaryPointSet;
    3131class BoundaryLineSet;
    3232class BoundaryTriangleSet;
    33 class LinkedCell;
    3433class TesselPoint;
    3534class PointCloud;
    3635class 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"
    4636
    4737// ======================================================= some template functions =========================================
     
    6353#define DistanceMultiMapPair pair <double, pair < PointMap::iterator, PointMap::iterator> >
    6454
    65 /********************************************** declarations *******************************/
     55
    6656
    6757template <typename T> void SetEndpointsOrdered(T endpoints[2], T endpoint1, T endpoint2)
     
    125115
    126116    void GetNormalVector(Vector &NormalVector);
    127     void GetCenter(Vector *center);
    128117    bool GetIntersectionInsideTriangle(ofstream *out, Vector *MolCenter, Vector *x, Vector *Intersection);
    129118    bool ContainsBoundaryLine(class BoundaryLineSet *line);
    130119    bool ContainsBoundaryPoint(class BoundaryPointSet *point);
    131     bool ContainsBoundaryPoint(class TesselPoint *point);
    132120    class BoundaryPointSet *GetThirdEndpoint(class BoundaryLineSet *line);
    133121    bool IsPresentTupel(class BoundaryPointSet *Points[3]);
    134     bool IsPresentTupel(class BoundaryTriangleSet *T);
     122    void GetCenter(Vector *center);
    135123
    136124    class BoundaryPointSet *endpoints[3];
     
    208196    void AlwaysAddTesselationTriangleLine(class BoundaryPointSet *a, class BoundaryPointSet *b, int n);
    209197    void AddTesselationTriangle();
    210     void AddTesselationTriangle(int nr);
    211198    void RemoveTesselationTriangle(class BoundaryTriangleSet *triangle);
    212199    void RemoveTesselationLine(class BoundaryLineSet *line);
    213200    void RemoveTesselationPoint(class BoundaryPointSet *point);
    214201
     202    bool IsInside(Vector *pointer);
    215203    class BoundaryPointSet *GetCommonEndpoint(class BoundaryLineSet * line1, class BoundaryLineSet * line2);
    216204
    217205    // concave envelope
    218206    void FindStartingTriangle(ofstream *out, const double RADIUS, class LinkedCell *LC);
    219     void FindSecondPointForTesselation(class TesselPoint* a, Vector Oben, class TesselPoint*& OptCandidate, double Storage[3], 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);
    220208    void FindThirdPointForTesselation(Vector NormalVector, Vector SearchDirection, Vector OldSphereCenter, class BoundaryLineSet *BaseLine, class TesselPoint *ThirdNode, CandidateList* &candidates, double *ShortestAngle, const double RADIUS, class LinkedCell *LC);
    221     bool FindNextSuitableTriangle(ofstream *out, BoundaryLineSet &Line, BoundaryTriangleSet &T, const double& RADIUS, LinkedCell *LC);
     209    bool FindNextSuitableTriangle(ofstream *out, BoundaryLineSet &Line, BoundaryTriangleSet &T, const double& RADIUS, int N, LinkedCell *LC);
    222210    int CheckPresenceOfTriangle(ofstream *out, class TesselPoint *Candidates[3]);
    223     class BoundaryTriangleSet * GetPresentTriangle(ofstream *out, TesselPoint *Candidates[3]);
    224211
    225212    // convex envelope
     
    228215    bool InsertStraddlingPoints(ofstream *out, PointCloud *cloud, LinkedCell *LC);
    229216    double RemovePointFromTesselatedSurface(ofstream *out, class BoundaryPointSet *point);
    230     class BoundaryLineSet * FlipBaseline(ofstream *out, class BoundaryLineSet *Base);
    231     double PickFarthestofTwoBaselines(ofstream *out, class BoundaryLineSet *Base);
     217    bool FlipBaseline(ofstream *out, class BoundaryLineSet *Base);
     218    bool PickFarthestofTwoBaselines(ofstream *out, class BoundaryLineSet *Base);
    232219    class BoundaryPointSet *IsConvexRectangle(ofstream *out, class BoundaryLineSet *Base);
    233     map<int, int> * FindAllDegeneratedTriangles();
    234     map<int, int> * FindAllDegeneratedLines();
     220    map<int, int> FindAllDegeneratedTriangles();
    235221    void RemoveDegeneratedTriangles();
    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);
     222
     223    list<TesselPoint*> * GetCircleOfConnectedPoints(ofstream *out, TesselPoint* Point);
     224    list<TesselPoint*> * GetNeighboursOnCircleOfConnectedPoints(ofstream *out, list<TesselPoint*> *connectedPoints, TesselPoint* Point, Vector* Reference);
    243225    list<BoundaryTriangleSet*> *FindTriangles(TesselPoint* Points[3]);
    244226    list<BoundaryTriangleSet*> * FindClosestTrianglesToPoint(ofstream *out, Vector *x, LinkedCell* LC);
     
    247229    bool IsInnerPoint(ofstream *out, TesselPoint *Point, LinkedCell* LC);
    248230    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);
    257231
    258232    PointMap PointsOnBoundary;
     
    277251    class BoundaryLineSet *BLS[3];
    278252    class BoundaryTriangleSet *BTS;
    279     class BoundaryTriangleSet *LastTriangle;
    280     int TriangleFilesWritten;
    281253
    282254  private:
     
    286258};
    287259
     260bool CheckLineCriteriaForDegeneratedTriangle(class BoundaryPointSet *nodes[3]);
     261bool SortCandidates(class CandidateForTesselation* candidate1, class CandidateForTesselation* candidate2);
     262TesselPoint* FindClosestPoint(const Vector* Point, TesselPoint *&SecondPoint, LinkedCell* LC);
     263TesselPoint* FindSecondClosestPoint(const Vector*, LinkedCell*);
     264double GetAngle(const Vector &point, const Vector &reference, const Vector OrthogonalVector);
     265Vector * GetClosestPointBetweenLine(ofstream *out, class BoundaryLineSet *Base, class BoundaryLineSet *OtherBase);
    288266
    289267#endif /* TESSELATION_HPP_ */
Note: See TracChangeset for help on using the changeset viewer.