template <typename T>
compact_iterator_type begin_compact(const T& polygon) |
Expects a model of polygon_90.
Returns the begin iterator over the range of coordinates that correspond
to horizontal and vertical edges. |
template <typename T>
compact_iterator_type end_compact(const T& polygon) |
Expects a model of polygon_90.
Returns the end iterator over the range of coordinates that correspond
to horizontal and vertical edges. |
template <typename T>
point_iterator_type begin_points(const T& polygon) |
Expects a model of polygon_90.
Returns the begin iterator over the range of points that correspond to
vertices of the polygon. |
template <typename T>
point_iterator_type end_points(const T& polygon) |
Expects a model of polygon_90.
Returns the end iterator over the range of points that correspond to
vertices of the polygon. |
template <typename T, typename
iterator>
void set_compact(T& polygon, iterator b, iterator e) |
Expects a model of polygon_90.
Sets the polygon to the coordinate data range [b,e) that corresponds to
.horizontal and vertical edges. |
template <typename T, typename
iterator>
void set_points(T& polygon, iterator b, iterator e) |
Expects a model of polygon_90.
Sets the polygon to the point data range [b,e) that corresponds to
vertices of a manhattan polygon. Non-manhattan edges between
successive input points results in undefined behavior. |
template <typename T>
unsigned int size(const T& polygon) |
Returns the number of edges in the
polygon. |
template <typename T1, typename
T2>
T1& assign(T1& left, const T2& right) |
Copies data from right object that models polygon_90 into left object
that models polygon_90. |
template <typename T,
typename point_type>
bool contains(const T&, const point_type& point,
bool consider_touch=true) |
Given an object that models polygon_90 and an object that models
point, returns true
if the polygon contains the point. If the consider_touch
flag is true will return true if the point lies along the boundary of
the polygon. Linear wrt. vertices. |
// get the center coordinate
template <typename T, typename point_type>
void center(point_type& p, const T& polygon) |
Sets object that models point to the center point of the bounding
box of an object that models polygon_90. Linear wrt. vertices. |
template <typename T,
typename rectangle_type>
bool extents(rectangle_type& bbox, const T& polygon) |
Sets object that models rectangle to the bounding box of an object
that models polygon_90 and returns true. Returns false and leaves
bbox unchanged if polygon is empty. Linear wrt. vertices. |
template <typename T>
manhattan_area_type area(const T& polygon) |
Returns the area of an object
that models polygon_90. Linear wrt. vertices. |
template <typename T>
direction_1d winding(const T& polygon) |
Returns the winding direction of an object
that models polygon_90, LOW == CLOCKWISE, HIGH = COUNTERCLOCKWISE.
Complexity depends upon winding trait. |
template <typename T>
coordinate_difference perimeter(const T& polygon) |
Returns the perimeter length of an object
that models polygon_90. Linear wrt. vertices. |
template <typename T,
typename transform_type>
T& transform(T& polygon, const transform_type&) |
Applies transform() on the vertices of polygon and sets the polygon to that described by the result of
transforming its vertices. Linear wrt. vertices. |
template <typename T>
T& scale_up(T& polygon, unsigned_area_type factor) |
Scales up coordinate of an object that models
polygon_90 by unsigned factor. Linear wrt. vertices. |
template <typename T>
T& scale_down(T& polygon, unsigned_area_type factor) |
Scales down coordinates of an object that models
polygon_90 by unsigned factor. Linear wrt. vertices. |
template <typename T, scaling_type>
T& scale(T& rectangle, double scaling) |
Scales coordinates of an object that models polygon_90 by floating
point factor. Linear wrt. vertices. |
template <typename T>
T& move(T& polygon, orientation_2d,
coordinate_difference displacement) |
Adds displacement value to coordinate indicated by orientation_2d of
vertices of an object that models polygon_90 . Linear wrt.
vertices. |
template <typename polygon_type, typename point_type>
polygon_type& convolve(polygon_type& polygon,
const point_type& point) |
Convolves coordinate values of point with vertices of an
object that models polygon_90. Linear wrt. vertices. |
This data type is used internally when a Manhattan polygon is needed and is
available to the library user who finds it convenient to use a library polygon
data type instead of providing their own. The data type is implemented to
be convenient to use with the library traits.
geometry_type |
polygon_90_concept |
coordinate_type |
T |
iterator_type |
Iterator over vertices point_data<T> vertices of polygon |
compact_iterator_type |
Iterator over non-redundant coordinates
of the polygon, alternating x, y, x, y starting with an x, where each x
corresponds to a vertical edge and each y corresponds to a horizontal
edge. |
polygon_90_data() |
Default constructs the polygon. |
polygon_90_data(const
polygon_90_data& that) |
Copy construct |
polygon_90_data& operator=(const
polygon_90_data& that) |
Assignment operator. |
template <typename T2>
polygon_90_data& operator=(const T2& that) const |
Assign from an object that is a model of polygon 90. |
iterator_type begin()
const |
Get the begin iterator over vertices of the polygon. |
iterator_type end()
const |
Get the end iterator over vertices of the polygon. |
compact_iterator_type
begin_compact() const |
Get the begin compact iterator over non-redundant coordinates of the
polygon. |
compact_iterator_type
end_compact() const |
Get the end compact iterator over non-redundant coordinates of the
polygon. |
std::size_t size() const |
Get the number of elements in the sequence stored to the polygon,
usually equal to the number of edges of the polygon. |
template <typename iT>
void set(iT begin_points, iT end_points) |
Sets the polygon to the iterator range of points. No check is
performed to ensure the points describe a Manhattan figure, every other
x and y value of the points is used to initialize the polygon. |
template <typename iT>
void set_compact(iT begin_coords, iT end_coords) |
Sets the polygon to the iterator range of coordinates. These
coordinates correspond to the x values of vertical edges and y values of
horizontal edges. It is expected that the sequence start with an x
value and proceed x then y then x then y. |