Delaunator
2D Delaunay Triangulation in C++ with Python wrapper.
 All Classes Namespaces Functions
face.h
1 #ifndef FACE_H_INCLUDED
2 #define FACE_H_INCLUDED
3 
4 
5 
6 /*
7  * LIBRARIES
8  */
9 // LOCAL MODULES
10 #include "commons.h"
11 #include "geometry.h"
12 #include "vertex.h"
13 #include "edge.h"
14 
15 
16 /*
17  * DEFINES
18  */
19 
20 
21 
22 
23 /*
24  * PREDECLARATIONS
25  */
26 class Edge;
27 
28 
29 
34 class Face {
35  public:
36  // CONSTRUCTOR
37  Face(Edge*, bool=true);
38  ~Face();
39  // PUBLIC METHODS
40  void computeInternalValues();
41  bool collideAt(Coordinates);
43  // ACCESSORS
44  //getter
45  bool isVisible() const { return this->visible; }
46  Edge* getEdge() const { return this->edge; }
47  Edge* getEdge1() const;
48  Edge* getEdge2() const;
49  Edge* getEdge3() const;
50  Vertex* getP1() const;
51  Vertex* getP2() const;
52  Vertex* getP3() const;
53  unsigned int getID() const { return this->id; }
54  Coordinates circumcenter() const {
55  return this->circumcenter_;
56  }
57  float circumcircleRadius() const {
58  return this->circumcenter().distanceTo(*this->getP1());
59  }
60  //setter
61  void setEdge(Edge*);
62  void setVisibility(bool v) { this->visible = v; }
63  private:
64  // ATTRIBUTES
65  Edge* edge; // any edge that describe that face
66  bool visible; // in a graphical representation
67  Coordinates centroid, circumcenter_;
68  unsigned int id;
69  static unsigned int last_id;
70  // PRIVATE METHODS
71 };
72 
73 
74 // EXTERNAL METHODS
75 #if !SWIG
76  std::ostream& operator<<(std::ostream&, Face const &);
77 #endif
78 
79 #endif