Easy3D 2.6.1
|
A 2D polygon representation. More...
#include <easy3d/core/polygon.h>
Public Member Functions | |
GenericPolygon ()=default | |
Default constructor. | |
GenericPolygon (std::size_t size) | |
Initializes with a know size. | |
template<class InputIterator> | |
GenericPolygon (InputIterator first, InputIterator last) | |
Initializes from a known range. | |
bool | is_clockwise () const |
Checks if the polygon has a clockwise orientation (right-hand rule). | |
void | reverse_orientation () |
Reverses the orientation of the polygon. The first vertex (pointed to by p.begin() , or [0]) remains the same. | |
bool | contains (const Vec< 2, FT > &point) const |
Tests if a point lies inside the polygon. | |
bool | contains (const GenericPolygon< FT > &plg) const |
Tests if a polygon plg lies inside this polygon (i.e., all its vertices are inside). | |
FT | signed_area () const |
Returns the signed area of the polygon. The signed area is positive for counter clockwise polygons and negative for clockwise polygons. | |
FT | area () const |
Returns the area of this polygon. This is the absolute value of the signed area, so it is always positive. | |
GenericBox< 2, FT > | bbox () const |
Returns the smallest axis-aligned bounding box containing this polygon. | |
A 2D polygon representation.
|
inline |
Checks if the polygon has a clockwise orientation (right-hand rule).
This method determines the orientation of a polygon based on the sign of its signed area: