|
The AreaCon Library
1.0
A C++ library for area-constrained partitioning operations
|
#include <areacon.h>
Public Member Functions | |
| void | SetVertices (const std::vector< Point > Vertices, const bool GetExtrema=true) |
| std::vector< Point > | GetVertices (void) const |
| int | GetNVertices (void) const |
| bool | pnpoly (const Point Test) const |
| void | GetExtrema (double &minx, double &miny, double &maxx, double &maxy) const |
| Poly (std::vector< Point > Vertices={}) | |
Private Member Functions | |
| void | InitializePoly (void) |
Private Attributes | |
| double | minx |
| double | miny |
| double | maxx |
| double | maxy |
| std::vector< Point > | Vertices |
| int | NPoly |
The base class for defining (convex) polygons.
| AreaCon::Poly::Poly | ( | std::vector< Point > | Vertices = {} | ) |
Default Constructor
| [in] | Vertices | The points defining the vertices of the polygon in counter-clockwise order (the first vertex is not repeated). |
| void AreaCon::Poly::GetExtrema | ( | double & | minx, |
| double & | miny, | ||
| double & | maxx, | ||
| double & | maxy | ||
| ) | const |
Returns the extreme x and y values.
| [out] | minx,miny,maxx,maxy |
| int AreaCon::Poly::GetNVertices | ( | void | ) | const |
| std::vector< Point > AreaCon::Poly::GetVertices | ( | void | ) | const |
|
private |
A function used to initialize the polygon by calculating extrema and running checks for dimensional consistency.
| bool AreaCon::Poly::pnpoly | ( | const Point | Test | ) | const |
Determines if the point Test lies within the polygon.
| [in] | Test | The test point |
| void AreaCon::Poly::SetVertices | ( | const std::vector< Point > | Vertices, |
| const bool | GetExtrema = true |
||
| ) |
A function used for setting the vertices of the polygon.
| [in] | Vertices | The points defining the vertices of the polygon in counter-clockwise order (the first vertex is not repeated). |
| [in] | GetExtrema | Flag that determines whether the extrema should be calculated and re-set |
|
private |
The maximum x coordinate of the polygon
|
private |
The maximum y coordinate of the polygon
|
private |
The minimum x coordinate of the polygon
|
private |
The minimum y coordinate of the polygon
|
private |
The number of vertices that the polygon has
|
private |
The Vertices of the polygon