Box Concept

| Home | Libraries | People | FAQ | More

#### Box Concept

###### Description

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).

###### Concept Definition

The Box Concept is defined as following:

- there must be a specialization of `traits::tag`, defining `box_tag` as type
- there must be a specialization of `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)
- there must be a specialization of `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)

###### Available Models

- model::box