Represents a polygon (convex or non-convex) defined by its vertices enclosed in IntervalVectors.
More...
#include <codac2_Polygon.h>
|
|
| Polygon () |
| | Default protected constructor used internally.
|
| |
Represents a polygon (convex or non-convex) defined by its vertices enclosed in IntervalVectors.
A polygon can be constructed from a list of vertices (either Vector or IntervalVector) or from a list of edges (Segments). Internally, it stores a list of edges enclosed in Segments.
◆ Polygon() [1/6]
| codac2::Polygon::Polygon |
( |
std::initializer_list< Vector > | vertices | ) |
|
Constructs a Polygon from an initializer list of Vector vertices.
- Parameters
-
| vertices | A list of vertices defining the polygon. |
◆ Polygon() [2/6]
| codac2::Polygon::Polygon |
( |
const std::vector< Vector > & | vertices | ) |
|
Constructs a Polygon from a vector of Vector vertices.
- Parameters
-
| vertices | A vector of vertices defining the polygon. |
◆ Polygon() [3/6]
| codac2::Polygon::Polygon |
( |
const std::vector< IntervalVector > & | vertices | ) |
|
|
explicit |
◆ Polygon() [4/6]
| codac2::Polygon::Polygon |
( |
std::initializer_list< Segment > | edges | ) |
|
Constructs a Polygon from an initializer list of Segment edges.
- Parameters
-
| edges | A list of Segments forming the polygon. |
◆ Polygon() [5/6]
| codac2::Polygon::Polygon |
( |
const std::vector< Segment > & | edges | ) |
|
Constructs a Polygon from a vector of Segment edges.
- Parameters
-
| edges | A vector of Segments forming the polygon. |
◆ Polygon() [6/6]
Constructs a box as a Polygon.
Typically used to create a rectangular polygon.
- Parameters
-
◆ edges()
| const std::vector< Segment > & codac2::Polygon::edges |
( |
| ) |
const |
Returns the list of edges of the polygon.
- Returns
- A constant reference to the vector of
Segments.
◆ unsorted_vertices()
| std::list< IntervalVector > codac2::Polygon::unsorted_vertices |
( |
| ) |
const |
Returns the list of unique vertices in no particular order.
If a vertex is involved several times in the polygon definition, then it will be returned only once in the output list.
- Returns
- A list of
IntervalVectors enclosing the unique vertices.
◆ sorted_vertices()
| std::vector< IntervalVector > codac2::Polygon::sorted_vertices |
( |
| ) |
const |
Returns the list of vertices sorted in polygonal order.
- Returns
- A vector of
IntervalVectors enclosing the ordered vertices.
◆ box()
Computes the bounding box of the polygon.
- Returns
- The
IntervalVector hull box.
◆ is_empty()
| bool codac2::Polygon::is_empty |
( |
| ) |
const |
Checks whether the polygon is empty (has no vertex).
- Returns
- True if the polygon is empty.
◆ contains()
Checks whether the polygon contains a given point.
- Parameters
-
- Returns
- A
BoolInterval indicating possible containment.
◆ operator==()
| bool codac2::Polygon::operator== |
( |
const Polygon & | p | ) |
const |
Comparison operator.
Equality means that both polygons have the same edges, possibly in a different order (clockwise or counterclockwise).
- Parameters
-
- Returns
- True if both polygons are strictly equal.
◆ empty()
| static Polygon codac2::Polygon::empty |
( |
| ) |
|
|
static |
Provides an empty polygon.
- Returns
- An empty polygon without vertices.
The documentation for this class was generated from the following file: