Thea

A polygon in 2space. More...
#include <Polygon2.hpp>
Classes  
struct  IndexedVertex 
A vertex plus an index. More...  
struct  TriangulationOptions 
Options controlling interior triangulation. More...  
Public Member Functions  
void  addVertex (Vector2 const &p) 
Add a vertex to the polygon. More...  
void  addVertex (Vector2 const &p, intx index) 
Add an indexed vertex to the polygon. More...  
void  clear () 
Delete all vertices from the polygon. More...  
Real  computeArea () const 
Compute the area of the polygon. More...  
IndexedVertex  getVertex (intx poly_index) const 
Get the vertex at position poly_index in the sequence of vertices around the polygon boundary. More...  
intx  numVertices () const 
Get the number of vertices in the polygon. More...  
Polygon2 ()  
Construct an empty polygon. More...  
intx  triangulate (Array< intx > &tri_indices) const 
Triangulate the polygon and return the set of triangle indices (in successive groups of 3). More...  
intx  triangulateInterior (Array< Vector2 > &tri_verts, Array< intx > &tri_indices, Array< bool > *tri_vert_is_boundary=nullptr, TriangulationOptions const &options=TriangulationOptions::defaults()) const 
Triangulate the polygon, inserting Steiner vertices as necessary in the interior of the polygon for a wellconditioned result. More...  
~Polygon2 ()  
Destructor. More...  
A polygon in 2space.
Definition at line 26 of file Polygon2.hpp.
Polygon2  (  ) 
Construct an empty polygon.
Definition at line 35 of file Polygon2.cpp.
~Polygon2  (  ) 
Destructor.
Definition at line 39 of file Polygon2.cpp.
void addVertex  (  Vector2 const &  p  ) 
Add a vertex to the polygon.
The vertex is inserted at the end of the current sequence of vertices, and by default is assigned an index that is one more than the maximum index in the polygon so far (or zero if this is the first vertex).
Definition at line 45 of file Polygon2.cpp.
void addVertex  (  Vector2 const &  p, 
intx  index  
) 
Add an indexed vertex to the polygon.
The vertex is inserted at the end of the current sequence of vertices.
Definition at line 51 of file Polygon2.cpp.
void clear  (  ) 
Delete all vertices from the polygon.
Definition at line 70 of file Polygon2.cpp.
Real computeArea  (  )  const 
Compute the area of the polygon.
Definition at line 194 of file Polygon2.cpp.
Polygon2::IndexedVertex getVertex  (  intx  poly_index  )  const 
Get the vertex at position poly_index in the sequence of vertices around the polygon boundary.
Definition at line 63 of file Polygon2.cpp.
intx numVertices  (  )  const 
Get the number of vertices in the polygon.
Definition at line 57 of file Polygon2.cpp.
Triangulate the polygon and return the set of triangle indices (in successive groups of 3).
All prior data in the supplied array are cleared.
Definition at line 76 of file Polygon2.cpp.
intx triangulateInterior  (  Array< Vector2 > &  tri_verts, 
Array< intx > &  tri_indices,  
Array< bool > *  tri_vert_is_boundary = nullptr , 

TriangulationOptions const &  options = TriangulationOptions::defaults() 

)  const 
Triangulate the polygon, inserting Steiner vertices as necessary in the interior of the polygon for a wellconditioned result.
All prior data in the supplied arrays are cleared.
tri_verts  Used to return the vertices of the output triangulation. 
tri_indices  Used to return the vertex indices of output triangles (w.r.t. tri_verts), in successive groups of 3. 
tri_vert_is_boundary  If notnull, used to return a flag for each output vertex indicating whether it's on the boundary of the triangulated domain or not. 
options  Options controlling the quality of the triangulation. 
Definition at line 82 of file Polygon2.cpp.