ICAROUS
|
#include <Poly3D.h>
Public Member Functions | |
void | calcCentroid () |
Poly3D (double b, double t) | |
Poly3D (const Poly2D &v, double b, double t) | |
Poly3D (const Poly3D &p) | |
Poly2D | poly2D () const |
bool | equals (const Poly3D &p) const |
void | add (const Vect2 &v) |
void | insert (int i, const Vect2 &v) |
Vect2 | get2D (int i) const |
void | set (int i, const Vect2 &v) |
void | remove (int n) |
int | size () const |
double | getTop () const |
void | setTop (double t) |
double | getBottom () const |
void | setBottom (double b) |
const std::vector< Vect2 > | getVerticesRef () const |
Vect3 | centroid () const |
Vect3 | averagePoint () const |
bool | isConvex () const |
Poly3D | reverseOrder () const |
std::string | toString () |
bool | contains (const Vect3 &v) const |
bool | contains2D (const Vect2 &v) const |
double | area () const |
BoundingRectangle | getBoundingRectangle () const |
Private Attributes | |
Poly2D | p2d |
double | top |
double | bottom |
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 Poly3Ds will have access to its full definition.
Vect3 larcfm::Poly3D::averagePoint | ( | ) | const |
Return the average of all vertices. Note this is not the same as the centroid, and will be weighted towards concentrations of vertices instead of concentrations of area/mass. This will, however, have the nice property of having a constant linear velocity between two polygons, even if they morph shape.
bool larcfm::Poly3D::contains | ( | const Vect3 & | v | ) | const |
This uses a standard raycasting check for point inclusion. It does not explicitly use ACCoRD detection algorithms.
v | vector |
bool larcfm::Poly3D::contains2D | ( | const Vect2 & | v | ) | const |
This uses a standard raycasting check for point inclusion. It does not explicitly use ACCoRD detection algorithms.
v | vector |
BoundingRectangle larcfm::Poly3D::getBoundingRectangle | ( | ) | const |
Creates a bounding rectangle from the vertices of the polygon.
bool larcfm::Poly3D::isConvex | ( | ) | const |
Returns true if this polygon is convex
void larcfm::Poly3D::remove | ( | int | n | ) |
Remove a point from this SimplePolyNew.
n | Index (in order added) of the point to be removed. |
Poly3D larcfm::Poly3D::reverseOrder | ( | ) | const |
Reverses the order of the vertices