This is an extension of Triangulator to handle polygons with three- dimensional points. More...
#include "triangulator3.h"
Public Member Functions | |
int | add_vertex (const LPoint3d &point) |
Adds a new vertex to the vertex pool. More... | |
int | add_vertex (double x, double y, double z) |
Adds a new vertex to the vertex pool. More... | |
void | clear () |
Removes all vertices and polygon specifications from the Triangulator, and prepares it to start over. More... | |
int | get_num_vertices () const |
const LPlaned & | get_plane () const |
const LPoint3d & | get_vertex (int n) const |
void | triangulate () |
Does the work of triangulating the specified polygon. More... | |
Public Member Functions inherited from Triangulator | |
void | add_hole_vertex (int index) |
Adds the next consecutive vertex of the current hole. More... | |
void | add_polygon_vertex (int index) |
Adds the next consecutive vertex of the polygon. More... | |
int | add_vertex (const LPoint2d &point) |
Adds a new vertex to the vertex pool. More... | |
int | add_vertex (double x, double y) |
Adds a new vertex to the vertex pool. More... | |
void | begin_hole () |
Finishes the previous hole, if any, and prepares to add a new hole. More... | |
void | clear () |
Removes all vertices and polygon specifications from the Triangulator, and prepares it to start over. More... | |
void | clear_polygon () |
Removes the current polygon definition (and its set of holes), but does not clear the vertex pool. More... | |
int | get_num_triangles () const |
Returns the number of triangles generated by the previous call to triangulate(). More... | |
int | get_num_vertices () const |
int | get_triangle_v0 (int n) const |
Returns vertex 0 of the nth triangle generated by the previous call to triangulate(). More... | |
int | get_triangle_v1 (int n) const |
Returns vertex 1 of the nth triangle generated by the previous call to triangulate(). More... | |
int | get_triangle_v2 (int n) const |
Returns vertex 2 of the nth triangle generated by the previous call to triangulate(). More... | |
const LPoint2d & | get_vertex (int n) const |
bool | is_left_winding () const |
Returns true if the polygon vertices are listed in counterclockwise order, or false if they appear to be listed in clockwise order. More... | |
void | triangulate () |
Does the work of triangulating the specified polygon. More... | |
Public Attributes | |
get_num_vertices | |
Returns the number of vertices in the pool. More... | |
get_plane | |
Returns the plane of the polygon. More... | |
get_vertex | |
Returns the nth vertex. More... | |
Public Attributes inherited from Triangulator | |
get_num_vertices | |
Returns the number of vertices in the pool. More... | |
get_vertex | |
Returns the nth vertex. More... | |
This is an extension of Triangulator to handle polygons with three- dimensional points.
It assumes all of the points lie in a single plane, and internally projects the supplied points into 2-D for passing to the underlying Triangulator object.
Definition at line 28 of file triangulator3.h.
int Triangulator3::add_vertex | ( | const LPoint3d & | point | ) |
Adds a new vertex to the vertex pool.
Returns the vertex index number.
Definition at line 39 of file triangulator3.cxx.
Referenced by add_vertex().
|
inline |
Adds a new vertex to the vertex pool.
Returns the vertex index number.
Definition at line 18 of file triangulator3.I.
References add_vertex().
void Triangulator3::clear | ( | ) |
Removes all vertices and polygon specifications from the Triangulator, and prepares it to start over.
Definition at line 29 of file triangulator3.cxx.
References Triangulator::clear().
void Triangulator3::triangulate | ( | ) |
Does the work of triangulating the specified polygon.
After this call, you may retrieve the new triangles one at a time by iterating through get_triangle_v0/1/2().
Definition at line 51 of file triangulator3.cxx.
|
inline |
Returns the number of vertices in the pool.
Note that the Triangulator might append new vertices, in addition to those added by the user, if any of the polygon is self-intersecting, or if any of the holes intersect some part of the polygon edges.
Definition at line 38 of file triangulator3.h.
|
inline |
Returns the plane of the polygon.
This is only available after calling triangulate().
Definition at line 44 of file triangulator3.h.
|
inline |
Returns the nth vertex.
Definition at line 38 of file triangulator3.h.