Represents a polygon as a list of vertices in CCW order.
More...
|
| std::vector< Coord > | v |
| | The vertices of the polygon in CCW order. More...
|
| |
Represents a polygon as a list of vertices in CCW order.
◆ addVert()
| void Polygon::addVert |
( |
Coord |
vert | ) |
|
|
inline |
Add a vertex to the polygon.
- Parameters
-
- See also
- Coord
◆ adjacent()
| bool Polygon::adjacent |
( |
Polygon & |
p, |
|
|
int * |
edgeIndex1 = NULL, |
|
|
int * |
edgeIndex2 = NULL |
|
) |
| const |
|
inline |
Determine if the polygon is adjacent.
- Parameters
-
| p | the polygon |
| edgeIndex1 | if not null, stores the index of the shared edge for this polygon |
| edgeIndex2 | if not null, stores the index of the shared edge for p |
- Returns
- true if adjacent and stores indeces in edgeIndex1 and edgeIndex2 if not null, else false and stores -1 in edgeIndex1 and edgeIndex2 if not null
◆ center()
| Coord Polygon::center |
( |
| ) |
const |
|
inline |
Get the center of the polygon.
- Returns
- the approximate center of the polygon as a Coord
- See also
- Coord
◆ edge()
| Edge Polygon::edge |
( |
unsigned int |
i | ) |
const |
|
inline |
Construct an edge of the polygon given the index of the first vertex.
- Parameters
-
| i | index of the first vertex |
- Returns
- the corresponding edge
- See also
- Edge
◆ size()
| unsigned int Polygon::size |
( |
| ) |
const |
|
inline |
Get the number of vertices in the polygon.
- Returns
- the number of vertices
◆ str()
| std::string Polygon::str |
( |
| ) |
const |
|
inline |
Get the string representation of the polygon.
- Returns
- the string representation of the polygon
| std::vector<Coord> Polygon::v |
The vertices of the polygon in CCW order.
- See also
- Coord
The documentation for this struct was generated from the following file: