codac 1.5.6
|
Represents a convex polygon defined by vertices enclosed in IntervalVector
s.
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) | |
Constructs a ConvexPolygon from a vector of Vector vertices. | |
ConvexPolygon (const std::vector< IntervalVector > &vertices) | |
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 . | |
![]() | |
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. | |
Static Public Member Functions | |
static ConvexPolygon | empty () |
Provides an empty convex polygon. | |
![]() | |
static Polygon | empty () |
Provides an empty polygon. | |
Protected Member Functions | |
ConvexPolygon () | |
Default protected constructor used internally. | |
![]() | |
Polygon () | |
Default protected constructor used internally. | |
Additional Inherited Members | |
![]() | |
const std::vector< Segment > | _edges |
Internal representation of the polygon as a list of edges. | |
Represents a convex polygon defined by vertices enclosed in IntervalVector
s.
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 | ) |
Constructs a ConvexPolygon
from a vector of Vector
vertices.
vertices | A vector of vertices defining the convex polygon. |
|
explicit |
Constructs a ConvexPolygon
from a vector of IntervalVector
vertices.
vertices | A vector of IntervalVector s enclosing the convex polygon vertices. |
codac2::ConvexPolygon::ConvexPolygon | ( | std::initializer_list< Segment > | edges | ) |
Constructs a ConvexPolygon
from an initializer list of Segment
edges.
edges | A list of Segment s 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 Segment s 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.