#include <Polygon.h>
|
|
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.
◆ Polygon()
| correa::Polygon::Polygon |
( |
Polygon & | polygon | ) |
|
◆ area()
| double correa::Polygon::area |
( |
| ) |
|
Calculates the area of polygon.
◆ boundaryLength()
| void correa::Polygon::boundaryLength |
( |
| ) |
|
Calculates the length of boundary edges.
◆ boundaryLength0()
| void correa::Polygon::boundaryLength0 |
( |
| ) |
|
Calculates the length of boundary edges.
◆ centerScale()
| void correa::Polygon::centerScale |
( |
double | range, |
|
|
int | iscale ) |
Center and rescale the polygon. Automatically recenters to the center of mass of the vertices.
- Parameters
-
◆ centerScaleArea()
| void correa::Polygon::centerScaleArea |
( |
| ) |
|
Center and rescale the polygon. Automatically recenters to the center of mass of the vertices.
◆ distorsion()
| void correa::Polygon::distorsion |
( |
| ) |
|
Calculates the distorsion in edge lengths.
◆ isPointInside()
| 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.
- Parameters
-
| point | The point to compute the distance from. |
- Returns
- The signed distance to the polygon outline.
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.
- Parameters
-
- Returns
- true if the point is inside the polygon, false otherwise
◆ length()
| double correa::Polygon::length |
( |
| ) |
|
Calculates the length of polygon.
◆ operator=()
| Polygon & correa::Polygon::operator= |
( |
const Polygon & | other | ) |
|
Assignment operator - properly handles prev/next iterator relinking
◆ scaleArea()
| void correa::Polygon::scaleArea |
( |
| ) |
|
Rescale the polygon. Automatically recenters to the center of mass of the vertices.
The documentation for this class was generated from the following file: