ICAROUS
All Classes Namespaces Files Functions Variables Enumerations Enumerator Macros Modules Pages
Public Member Functions | Private Attributes | List of all members
larcfm::Poly3D Class Reference

#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< Vect2getVerticesRef () 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
 

Detailed Description

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.

Member Function Documentation

◆ averagePoint()

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.

Returns
point

◆ contains()

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.

Parameters
vvector
Returns
true if contains

◆ contains2D()

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.

Parameters
vvector
Returns
true if contains

◆ getBoundingRectangle()

BoundingRectangle larcfm::Poly3D::getBoundingRectangle ( ) const

Creates a bounding rectangle from the vertices of the polygon.

Returns
distance

◆ isConvex()

bool larcfm::Poly3D::isConvex ( ) const

Returns true if this polygon is convex

Returns
true, if convex

◆ remove()

void larcfm::Poly3D::remove ( int  n)

Remove a point from this SimplePolyNew.

Parameters
nIndex (in order added) of the point to be removed.

◆ reverseOrder()

Poly3D larcfm::Poly3D::reverseOrder ( ) const

Reverses the order of the vertices

Returns
polygon

The documentation for this class was generated from the following files: