![]() |
NDEVR
API Documentation
|
Stores convenience functions for a concavec polygon Works on a Polygon object to decompose it into triangles or sub-polygons. More...
Public Member Functions | |
| ConcavePolygon () | |
| Default constructor. | |
| ConcavePolygon (const VertexArray &_vertices) | |
| Constructs a ConcavePolygon from a vertex array, ensuring right-handed winding. | |
| bool | checkIfRightHanded () |
| Checks whether this polygon's vertices are in right-handed (counter-clockwise) winding order. | |
| void | convexDecomp () |
| Decomposes this concave polygon into convex sub-polygons. | |
| t_vertex | getPoint (uint04 index) const |
| Retrieves a vertex by index. | |
| int | getPointCount () const |
| Returns the number of vertices in the polygon. | |
| const VertexArray & | getVertices () const |
| Returns a const reference to the polygon's vertex array. | |
| void | returnLowestLevelPolys (Buffer< Polygon< t_type, t_vertex > > &returnArr) |
| Appends all decomposed convex sub-polygons to the given buffer. | |
Stores convenience functions for a concavec polygon Works on a Polygon object to decompose it into triangles or sub-polygons.
Definition at line 41 of file ConcaveToConvexPolygon.h.
|
inline |
Constructs a ConcavePolygon from a vertex array, ensuring right-handed winding.
| [in] | _vertices | The vertices defining the concave polygon boundary. |
Definition at line 438 of file ConcaveToConvexPolygon.h.
References checkIfRightHanded().
|
inline |
Checks whether this polygon's vertices are in right-handed (counter-clockwise) winding order.
Definition at line 455 of file ConcaveToConvexPolygon.h.
References checkIfRightHanded().
Referenced by ConcavePolygon(), checkIfRightHanded(), and convexDecomp().
|
inline |
Decomposes this concave polygon into convex sub-polygons.
Iteratively splits the polygon at reflex vertices until all resulting sub-polygons are convex. Results are stored internally and can be retrieved via returnLowestLevelPolys().
Definition at line 467 of file ConcaveToConvexPolygon.h.
References Buffer< t_type, t_memory_manager >::add(), Bounds< t_dims, t_type, t_vertex >::addToBounds(), cast(), checkIfRightHanded(), getMax(), getMin(), IsInvalid(), IsValid(), Polygon< t_type, t_vertex >::vertex(), and Polygon< t_type, t_vertex >::vertexCount().
|
inline |
Retrieves a vertex by index.
| [in] | index | The index of the vertex to retrieve. |
Definition at line 563 of file ConcaveToConvexPolygon.h.
|
inline |
Returns the number of vertices in the polygon.
Definition at line 575 of file ConcaveToConvexPolygon.h.
|
inline |
Returns a const reference to the polygon's vertex array.
Definition at line 543 of file ConcaveToConvexPolygon.h.
|
inline |
Appends all decomposed convex sub-polygons to the given buffer.
| [in] | returnArr | The buffer to append the resulting convex polygons to. |
Definition at line 553 of file ConcaveToConvexPolygon.h.