|
Correa 1
C++ library with Python bindings to analyse the shape of simple closed curves in R^2
|
#include <Polygon.h>
Public Member Functions | |
| Polygon (Polygon &polygon) | |
| Polygon & | operator= (const Polygon &other) |
| double | area () |
| double | originalArea () |
| double | length () |
| void | centerScale (double range, int iscale) |
| void | centerScaleArea () |
| void | scaleArea () |
| void | boundaryLength0 () |
| void | boundaryLength () |
| void | distorsion () |
| void | shift (Vector2D center, bool verbose) |
| int | size () |
| void | labelPolygon (const double EPSILON) |
| Vector2D | calculateCentroid () |
| bool | isPointInside (const Vector2D &point) const |
Public Attributes | |
| std::vector< Vertex > | vertices |
| std::vector< double > | bdLength0 |
| std::vector< double > | bdLength |
| double | distorsion_ |
| double | originalArea_ |
| std::vector< std::pair< int, int > > | edges |
Polygon class Stores the polygon and calculates various information about it.
| correa::Polygon::Polygon | ( | Polygon & | polygon | ) |
Copy constructor.
| double correa::Polygon::area | ( | ) |
Calculates the area of polygon.
| void correa::Polygon::boundaryLength | ( | ) |
Calculates the length of boundary edges.
| void correa::Polygon::boundaryLength0 | ( | ) |
Calculates the length of boundary edges.
| void correa::Polygon::centerScale | ( | double | range, |
| int | iscale ) |
Center and rescale the polygon. Automatically recenters to the center of mass of the vertices.
| range | |
| iscale |
| void correa::Polygon::centerScaleArea | ( | ) |
Center and rescale the polygon. Automatically recenters to the center of mass of the vertices.
| void correa::Polygon::distorsion | ( | ) |
Calculates the distorsion in edge lengths.
| bool correa::Polygon::isPointInside | ( | const Vector2D & | point | ) | const |
Computes the signed distance from a point to the polygon outline. Positive distance indicates the point is outside the polygon, negative distance indicates the point is inside the polygon.
| point | The point to compute the distance from. |
Checks if a point is inside the polygon using the ray casting algorithm. This implements the Jordan curve theorem: a point is inside a polygon if a ray from the point crosses the polygon boundary an odd number of times.
| point | The point to check |
| double correa::Polygon::length | ( | ) |
Calculates the length of polygon.
Assignment operator - properly handles prev/next iterator relinking
| void correa::Polygon::scaleArea | ( | ) |
Rescale the polygon. Automatically recenters to the center of mass of the vertices.