Other Resources

Polygon Sponsor

Polygon 90 Concept

The polygon_90 concept tag is
polygon_90_concept

To register a user defined type as a model of polygon_90 concept, specialize the
geometry concept meta-function for that type. In the example
below CPolygon90 is registered as a model of polygon_90 concept.

The semantic of a polygon_90 is
that it can provide iterators over the x and y coordinates that
correspond to its horizontal and vertical sides, starting with an x
coordinate. A mutable polygon_90 must also be able to set its
geometry based on an interator range over such coordinates. Since
most polygons use vertex points in internal storage iterator adaptors
for converting to and from point sequences are provided in
iterator_points_to_compact.hpp and iterator_compact_to_points.hpp to
aid in the specialization of polygon_90_traits. A
std::vector<int> or std::list<int> could be made models of
polygon_90_concept by simply providing access to their iterators
through traits. Library functions that create polygon objects
require that those objects provide a default constructor.

Below is shown the default
polygon traits. Specialization of these traits is required for
types that don't conform to the default behavior. Note that these
traits are also used by the polygon_90_with_holes concept.

An object that is a model of
polygon_90_concept can be viewed as a model of any of its
refinements if it is determined at runtime to conform to the
restriction of those concepts. This concept casting is
accomplished through the
view_as<>() function.

view_as<rectangle_concept>(polygon_90_object)

The return value of view_as<>()
can be passed into any interface that expects an object of the
conceptual type specified in its template parameter.

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.

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.

Convolves coordinate values of point with vertices of
an object that models polygon_90. Linear wrt. vertices.

Polygon 90 Data

The library provides a model of polygon 90 concept declared
template<typename T>
polygon_90_data where T is the coordinate type.

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.

Members

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.

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.