Represents a polygon (convex or non-convex) defined by its vertices enclosed in IntervalVector
s.
More...
#include <codac2_Polygon.h>
|
| Polygon (std::initializer_list< Vector > vertices) |
| Constructs a Polygon from an initializer list of Vector vertices.
|
|
| Polygon (const std::vector< Vector > &vertices) |
| Constructs a Polygon from a vector of Vector vertices.
|
|
| Polygon (const std::vector< IntervalVector > &vertices) |
| Constructs a Polygon from a vector of IntervalVector vertices.
|
|
| Polygon (std::initializer_list< Segment > edges) |
| Constructs a Polygon from an initializer list of Segment edges.
|
|
| Polygon (const std::vector< Segment > &edges) |
| Constructs a Polygon from a vector of Segment edges.
|
|
| Polygon (const IntervalVector &x) |
| Constructs a box as a Polygon .
|
|
const std::vector< Segment > & | edges () const |
| Returns the list of edges of the polygon.
|
|
std::list< IntervalVector > | unsorted_vertices () const |
| Returns the list of unique vertices in no particular order.
|
|
std::vector< IntervalVector > | sorted_vertices () const |
| Returns the list of vertices sorted in polygonal order.
|
|
bool | is_empty () const |
| Checks whether the polygon is empty (has no vertex).
|
|
BoolInterval | contains (const IntervalVector &p) const |
| Checks whether the polygon contains a given point.
|
|
bool | operator== (const Polygon &p) const |
| Comparison operator.
|
|
|
| Polygon () |
| Default protected constructor used internally.
|
|
|
const std::vector< Segment > | _edges |
| Internal representation of the polygon as a list of edges.
|
|
Represents a polygon (convex or non-convex) defined by its vertices enclosed in IntervalVector
s.
A polygon can be constructed from a list of vertices (either Vector
or IntervalVector
) or from a list of edges (Segment
s). Internally, it stores a list of edges enclosed in Segment
s.
◆ 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 |
Constructs a Polygon
from a vector of IntervalVector
vertices.
- Parameters
-
vertices | A vector of IntervalVector s enclosing the polygon vertices. |
◆ 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 Segment s 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 Segment s forming the polygon. |
◆ Polygon() [6/6]
codac2::Polygon::Polygon |
( |
const IntervalVector & | x | ) |
|
|
explicit |
Constructs a box as a Polygon
.
Typically used to create a rectangular polygon.
- Parameters
-
x | An IntervalVector representing the bounds of the polygon. |
◆ 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
Segment
s.
◆ 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
IntervalVector
s 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
IntervalVector
s enclosing the ordered vertices.
◆ 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()
BoolInterval codac2::Polygon::contains |
( |
const IntervalVector & | p | ) |
const |
Checks whether the polygon contains a given point.
- Parameters
-
p | The point to check, enclosed in an IntervalVector . |
- 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: