ICAROUS
|
#include <Poly3DLL.h>
Public Member Functions | |
Poly3DLL (double b, double t) | |
Poly3DLL (const std::vector< LatLonAlt > &verts, double b, double t) | |
Poly3DLL (const Poly3DLL &p) | |
void | add (const LatLonAlt &lla) |
void | add (double lat, double lon, double alt) |
void | insert (int i, const LatLonAlt &lla) |
bool | set (int n, const LatLonAlt &p) |
LatLonAlt | get (int i) const |
void | remove (int n) |
int | size () const |
double | getTop () const |
void | setTop (double t) |
double | getBottom () const |
void | setBottom (double b) |
bool | isClockwise () |
LatLonAlt | centroid () |
LatLonAlt | averagePoint () |
void | recalcBoundingRectangle () |
std::string | toString () const |
bool | contains (const LatLonAlt &lla) |
bool | contains2D (const LatLonAlt &lla) |
bool | equals (const Poly3DLL &p) const |
bool | isConvex () const |
Poly3DLL | reverseOrder () |
double | sumAngles (int dir) const |
double | area () |
double | signedArea () |
BoundingRectangle | getBoundingRectangle () |
const std::vector< LatLonAlt > & | getVerticesRef () const |
Private Attributes | |
std::vector< LatLonAlt > | vertices |
BoundingRectangle | boundingRect |
bool | boundingRectangleDefined |
double | top |
double | bottom |
Vect3 | cpos |
LatLonAlt | lastAdd |
Euclidean space representation of polygon with height info. This extends Vect3 (temporarily) in order to take advantage to polymorphism of detection algorithms. If treated as a normal Vect3 point, this ignores the polygon information. Only functions that are aware of Poly3DLLs will have access to its full definition.
double larcfm::Poly3DLL::area | ( | ) |
This returns the approximate area of the polyon in square meters. Calculation for area is a standard formula extending Girard's Theorem for the area of a triangle on a sphere (A = (E-PI)*R^2) Considering this is based on the angular excess of the triangles in question, and polygons are generally very small compared to the radius of the Earth, this is very sensitive to minor inaccuracies in the interior angle calculations.
LatLonAlt larcfm::Poly3DLL::centroid | ( | ) |
Note that the calculations used here are Euclidean, and only return the approximate centroid for polygons on a sphere.
bool larcfm::Poly3DLL::contains | ( | const LatLonAlt & | lla | ) |
This uses a standard raycasting check for point inclusion. It does not explicitly use ACCoRD detection algorithms.
lla | point |
This uses a standard raycasting check for point inclusion. It does not explicitly use ACCoRD detection algorithms.
bool larcfm::Poly3DLL::contains2D | ( | const LatLonAlt & | lla | ) |
This uses a standard raycasting check for point inclusion. It does not explicitly use ACCoRD detection algorithms.
lla | point |
This uses a standard raycasting check for point inclusion. It does not explicitly use ACCoRD detection algorithms.
bool larcfm::Poly3DLL::isConvex | ( | ) | const |
Returns true if this polygon is convex
void larcfm::Poly3DLL::remove | ( | int | n | ) |
Remove a point from this SimplePolyNew.
n | Index (in order added) of the point to be removed. |
bool larcfm::Poly3DLL::set | ( | int | n, |
const LatLonAlt & | p | ||
) |
Change the position of a point already added to the SimplePolyNew, indicated by its index. This currently does NOT set the Z component of the point.
n | index |
p | position |
double larcfm::Poly3DLL::signedArea | ( | ) |
Planar geometric area of a simple polygon. It is positive if the vertices are ordered counterclockwise and negative if clockwise. This returns the area in square radians (used for centroid calculation) Note that the area calculations used here are Euclidean, and do not return the actual area occupied by the polygon.
Planar geometric area of a simple polygon. It is positive if the vertices are ordered counterclockwise and negative if clockwise.