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

#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< LatLonAltvertices
 
BoundingRectangle boundingRect
 
bool boundingRectangleDefined
 
double top
 
double bottom
 
Vect3 cpos
 
LatLonAlt lastAdd
 

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 Poly3DLLs will have access to its full definition.

Member Function Documentation

◆ area()

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.

Returns
area

◆ centroid()

LatLonAlt larcfm::Poly3DLL::centroid ( )

Note that the calculations used here are Euclidean, and only return the approximate centroid for polygons on a sphere.

Returns
the geometric centroid.
the geometric centroid.

◆ contains()

bool larcfm::Poly3DLL::contains ( const LatLonAlt lla)

This uses a standard raycasting check for point inclusion. It does not explicitly use ACCoRD detection algorithms.

Parameters
llapoint
Returns
true if contains

This uses a standard raycasting check for point inclusion. It does not explicitly use ACCoRD detection algorithms.

◆ contains2D()

bool larcfm::Poly3DLL::contains2D ( const LatLonAlt lla)

This uses a standard raycasting check for point inclusion. It does not explicitly use ACCoRD detection algorithms.

Parameters
llapoint
Returns
true if contains

This uses a standard raycasting check for point inclusion. It does not explicitly use ACCoRD detection algorithms.

◆ isConvex()

bool larcfm::Poly3DLL::isConvex ( ) const

Returns true if this polygon is convex

Returns
true, if convex

◆ remove()

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

Remove a point from this SimplePolyNew.

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

◆ set()

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.

Parameters
nindex
pposition
Returns
false, if an invalid vertex is detected, true otherwise

◆ signedArea()

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.

Returns
the signed area of the polygon

Planar geometric area of a simple polygon. It is positive if the vertices are ordered counterclockwise and negative if clockwise.

Returns
the signed area of the polygon

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