Delaunator
2D Delaunay Triangulation in C++ with Python wrapper.
 All Classes Namespaces Functions
delaunator.h
1 #ifndef DELAUNATOR_MAIN_INTERFACE_H_INCLUDED
2 #define DELAUNATOR_MAIN_INTERFACE_H_INCLUDED
3 
4 
5 
6 /*
7  * LIBRARIES
8  */
9 // LOCAL MODULES
10 #include "commons.h"
11 #include "triangulation.h"
12 
13 
14 
15 /*
16  * DEFINES
17  */
18 
19 
20 
21 /*
22  * PREDECLARATIONS
23  */
24 
25 
26 
27 
28 
29 
35 class Delaunator {
36  public:
37  // CONSTRUCTOR
38  Delaunator(const float, const float,
39  const float, const float,
40  const VertexFinderMode =
41  VERTEX_FINDER_MODE_LAST);
42  ~Delaunator();
43  // PUBLIC METHODS
44  // modify triangulation
46  VirtualVertex* addVirtualVertex(float, float);
50  // object probing
51  VirtualVertex* virtualVertexAt(Coordinates, float=EPSILON) const;
52  VirtualVertex* virtualVertexAt(float, float, float=EPSILON) const;
53  std::list<VirtualVertex*> virtualVerticesAt(Coordinates, float=EPSILON) const;
54  std::list<VirtualVertex*> virtualVerticesAt(float, float, float=EPSILON) const;
55  // ACCESSORS
57  unsigned int objectCount() const { return this->object_count; }
58  float getXmin() const { return this->triangulation->getXmin(); }
59  float getXmax() const { return this->triangulation->getXmax(); }
60  float getYmin() const { return this->triangulation->getYmin(); }
61  float getYmax() const { return this->triangulation->getYmax(); }
62  float epsilon() const { return EPSILON; }
63  float distanceMax() const;
64  //TriangulationVertexFinderMode getFinderMode() const;
65  //void setFinderMode(TriangulationVertexFinderMode);
66 
67  // PREDICATS
68  bool haveVertex(Vertex*) const;
69  bool collideAt(Coordinates) const;
70 #ifdef DEBUG
71  bool opt_isdebug() const { return true; }
72 #else
73  bool opt_isdebug() const { return false; }
74 #endif
75 #ifdef FOLLOW_SEARCH
76  bool opt_follow_search() const { return true; }
77 #else
78  bool opt_follow_search() const { return false; }
79 #endif
80 
81 
82  // ITERATORS
83  std::list<VirtualVertex*> virtualVertices() const;
84  //IteratorVertexToNeighbourVertices getNeighbors(Vertex*);
86  //IteratorOnEdges iterEdges() { return IteratorOnEdges(&this->edges); }
87  //IteratorOnEdges_read iterEdges_read() const
88  //{ return IteratorOnEdges_read(&this->edges); }
90  //IteratorOnAllEdges iterAllEdges() { return IteratorOnAllEdges(&this->edges); }
91  //IteratorOnAllEdges_read iterAllEdges_read() const
92  //{ return IteratorOnAllEdges_read(&this->edges); }
94  //IteratorOnFaces iterFaces() { return IteratorOnFaces(&this->faces); }
95  //IteratorOnFaces_read iterFaces_read() const
96  //{ return IteratorOnFaces_read(&this->faces); }
98  //IteratorOnAllFaces iterAllFaces() { return IteratorOnAllFaces(&this->faces); }
99  //IteratorOnAllFaces_read iterAllFaces_read() const
100  //{ return IteratorOnAllFaces_read(&this->faces); }
102  //IteratorOnVertices iterVertices() { return IteratorOnVertices(&this->vertices); }
103  //IteratorOnVertices_read iterVertices_read() const
104  //{ return IteratorOnVertices_read(&this->vertices); }
106  //IteratorOnAllVertices iterAllVertices() { return IteratorOnAllVertices(&this->vertices); }
107  //IteratorOnAllVertices_read iterAllVertices_read() const
108  //{ return IteratorOnAllVertices_read(&this->vertices); }
109 
110 
111 
112 
113 // PRIVATE
114  private:
115  // ATTRIBUTES
116  Triangulation* triangulation;
117  unsigned int object_count;
118  // PRIVATE METHODS
119 };
120 
121 
122 
123 #endif