se2ez
se2ez::geo Namespace Reference

Operations on geometry. More...

Functions

bool isConvex (const Geometry &geometry)
 Checks if a polygon is convex. More...
 
bool isSimple (const Geometry &geometry)
 Checks if a polygon is simple, that is, it has no holes. More...
 
void makeClockwise (Geometry &geometry)
 If not clockwise, reorders polygon vertices to be in clockwise orientation. More...
 
void makeCounterClockwise (Geometry &geometry)
 If not counterclockwise, reorders polygon vertices to be in counterclockwise orientation. More...
 
double area (const Geometry &geometry)
 Compute the area of a polygon. More...
 
std::vector< GeometryPtrconvexifyApproximate (const GeometryPtr &geometry)
 Performs an approximate convex decomposition on the geometry. More...
 
std::vector< GeometryPtrconvexifyOptimal (const GeometryPtr &geometry)
 Performs an optimal convex decomposition on the geometry. More...
 
std::vector< GeometryPtrshatter (const GeometryPtr &geometry)
 "Shatters" a convex polygon into a fan of triangles using the first point as the root for all triangles. More...
 

Detailed Description

Operations on geometry.

Function Documentation

◆ area()

double se2ez::geo::area ( const Geometry geometry)

Compute the area of a polygon.

Parameters
[in]geometryGeometry to compute area for.
Returns
The signed area of the polygon (negative if clockwise, positive if counter).

Definition at line 106 of file polygon.cpp.

◆ convexifyApproximate()

std::vector< GeometryPtr > se2ez::geo::convexifyApproximate ( const GeometryPtr geometry)

Performs an approximate convex decomposition on the geometry.

Parameters
[in]geometryGeometry to decompose.
Returns
A vector of the convex partitions of the original geometry.

Definition at line 113 of file polygon.cpp.

◆ convexifyOptimal()

std::vector< GeometryPtr > se2ez::geo::convexifyOptimal ( const GeometryPtr geometry)

Performs an optimal convex decomposition on the geometry.

Parameters
[in]geometryGeometry to decompose.
Returns
A vector of the convex partitions of the original geometry.

Definition at line 141 of file polygon.cpp.

◆ isConvex()

bool se2ez::geo::isConvex ( const Geometry geometry)

Checks if a polygon is convex.

Parameters
[in]geometryGeometry to check (must be a polygon)
Returns
Returns true if the polygon is convex, false otherwise.

Definition at line 68 of file polygon.cpp.

◆ isSimple()

bool se2ez::geo::isSimple ( const Geometry geometry)

Checks if a polygon is simple, that is, it has no holes.

Parameters
[in]geometryGeometry to check (must be a polygon)
Returns
Returns true if the polygon is simple.

Definition at line 75 of file polygon.cpp.

◆ makeClockwise()

void se2ez::geo::makeClockwise ( Geometry geometry)

If not clockwise, reorders polygon vertices to be in clockwise orientation.

Parameters
[in,out]geometryGeometry to reorder.

Definition at line 82 of file polygon.cpp.

◆ makeCounterClockwise()

void se2ez::geo::makeCounterClockwise ( Geometry geometry)

If not counterclockwise, reorders polygon vertices to be in counterclockwise orientation.

Parameters
[in,out]geometryGeometry to reorder.

Definition at line 94 of file polygon.cpp.

◆ shatter()

std::vector< GeometryPtr > se2ez::geo::shatter ( const GeometryPtr geometry)

"Shatters" a convex polygon into a fan of triangles using the first point as the root for all triangles.

Parameters
[in]geometryGeometry to shatter.
Returns
A vector of triangle polygons from the original geometry.

Definition at line 167 of file polygon.cpp.