...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
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::tag
,
defining box_tag
as
type
traits::point_type
to 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 (min_corner
,
max_corner
) and per
dimension, with two functions:
get
to get a
coordinate value
set
to set a
coordinate value (this one is not checked for ConstBox)