...one of the most highly
regarded and expertly designed C++ library projects in the
world. — Herb Sutter and Andrei
The Box Concept describes the requirements for a box type. All algorithms in Boost.Geometry will check any geometry arguments against the concept requirements.
A box is a geometry with (usually) two or three dimensions, having its axis aligned to the coordinate system.
The box is not one of the basic types in Boost.Geometry (point, linestring, polygon) but it is a helper type. The main reasons for the box existance are its usefulness for indexing (a spatial index, or splitting a geometry into monotonic sections) and it is the output of the envelope algorithm.
Therefore, a box is axis aligned (the envelope is also called aabb, axis aligned bounding box).
The Box Concept is defined as following:
traits::point_typeto define the underlying point type (even if it does not consist of points, it should define this type, to indicate the points it can work with)
traits::indexed_access, per index (
max_corner) and per dimension, with two functions:
getto get a coordinate value
setto set a coordinate value (this one is not checked for ConstBox)