|
codac 2.0.0
|
Represents a convex polygon defined by vertices enclosed in IntervalVectors.
More...
#include <codac2_ConvexPolygon.h>


Public Member Functions | |
| ConvexPolygon (std::initializer_list< Vector > vertices) | |
Constructs a ConvexPolygon from an initializer list of Vector vertices. | |
| ConvexPolygon (const std::vector< Vector > &vertices, bool compute_convex_hull=true) | |
Constructs a ConvexPolygon from a vector of Vector vertices. | |
| ConvexPolygon (const std::vector< IntervalVector > &vertices, bool compute_convex_hull=true) | |
Constructs a ConvexPolygon from a vector of IntervalVector vertices. | |
| ConvexPolygon (std::initializer_list< Segment > edges) | |
Constructs a ConvexPolygon from an initializer list of Segment edges. | |
| ConvexPolygon (const std::vector< Segment > &edges) | |
Constructs a ConvexPolygon from a vector of Segment edges. | |
| ConvexPolygon (const IntervalVector &x) | |
Constructs a box as a ConvexPolygon. | |
Public Member Functions inherited from codac2::Polygon | |
| 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. | |
| IntervalVector | box () const |
| Computes the bounding box of the polygon. | |
| 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. | |
Static Public Member Functions | |
| static ConvexPolygon | empty () |
| Provides an empty convex polygon. | |
Static Public Member Functions inherited from codac2::Polygon | |
| static Polygon | empty () |
| Provides an empty polygon. | |
Protected Member Functions | |
| ConvexPolygon () | |
| Default protected constructor used internally. | |
Protected Member Functions inherited from codac2::Polygon | |
| Polygon () | |
| Default protected constructor used internally. | |
Represents a convex polygon defined by vertices enclosed in IntervalVectors.
A convex polygon is a special case of polygon where all internal angles are less than 180°, and every line segment between any two points in the polygon lies entirely within it. It inherits all functionality from Polygon and ensures convexity of the structure.
| codac2::ConvexPolygon::ConvexPolygon | ( | std::initializer_list< Vector > | vertices | ) |
Constructs a ConvexPolygon from an initializer list of Vector vertices.
| vertices | A list of vertices defining the convex polygon. |
| codac2::ConvexPolygon::ConvexPolygon | ( | const std::vector< Vector > & | vertices, |
| bool | compute_convex_hull = true ) |
Constructs a ConvexPolygon from a vector of Vector vertices.
| vertices | A vector of vertices defining the convex polygon. |
| compute_convex_hull | if true, will create the shape as the convex hull of the provided points. This option may be set to false when one can ensure that the points are already convex and provided in counterclockwise order. This would speed up computations, avoiding a Graham scan procedure. |
|
explicit |
Constructs a ConvexPolygon from a vector of IntervalVector vertices.
| vertices | A vector of IntervalVectors enclosing the convex polygon vertices. |
| compute_convex_hull | if true, will create the shape as the convex hull of the provided points. This option may be set to false when one can ensure that the points are already convex and provided in counterclockwise order. This would speed up computations, avoiding a Graham scan procedure. |
| codac2::ConvexPolygon::ConvexPolygon | ( | std::initializer_list< Segment > | edges | ) |
Constructs a ConvexPolygon from an initializer list of Segment edges.
| edges | A list of Segments forming the convex polygon. |
| codac2::ConvexPolygon::ConvexPolygon | ( | const std::vector< Segment > & | edges | ) |
Constructs a ConvexPolygon from a vector of Segment edges.
| edges | A vector of Segments forming the convex polygon. |
|
explicit |
Constructs a box as a ConvexPolygon.
Typically used to create a rectangular convex polygon.
| x | An IntervalVector representing the bounds of the convex polygon. |
|
static |
Provides an empty convex polygon.