template<typename
NT, typename int D, typename IdPolicy>
class CGAL::Box_intersection_d::Box_d< NT, D, IdPolicy >
Box_d is a generic iso-oriented bounding box in dimension \( D\).
It provides in each dimension an interval with lower and upper endpoints represented with the number type NT. This class is designed to work smoothly with the algorithms for intersecting sequences of iso-oriented boxes. For degeneracy handling, the boxes need to provide a unique id-number. The policy parameter IdPolicy offers several choices. The template parameters have to comply with the following requirements:
- Template Parameters
-
| NT | is the number type for the box boundaries. It must meet the requirements of the concepts Assignable and LessThanComparable. |
| D | is an integer and the dimension of the box. |
| IdPolicy | specifies how the id-number will be provided and can be one of the following types, where ID_EXPLICIT is the default for this parameter:
-
ID_NONE: no id-number is provided. This can be useful if Box_d is used as a base class for a different implementation of id-numbers than the ones provided here.
-
ID_EXPLICIT: the id-number is stored explicitly in the box and automatically created and assigned at construction time of the box. Note that copying a box (copy-constructor and assignment) does not create a new id-number but keeps the old one, which is the behavior needed by the box_self_intersection_d() algorithm. This is therefore the safe default implementation.
-
ID_FROM_BOX_ADDRESS: casts the address of the box into a std::ptrdiff_t to create the id-number. This works fine if the intersection algorithms work effectively with pointers to boxes, but not in the case where the algorithms work with box values, because the algorithms modify the order of the boxes, and the box_self_intersection_d() algorithm creates copies of the boxes that would not have identical id-numbers.
|
- Is model of
BoxIntersectionBox_d
- See also
- CGAL::box_intersection_d()
-
CGAL::box_self_intersection_d()
-
CGAL::box_intersection_all_pairs_d()
-
CGAL::box_self_intersection_all_pairs_d()
-
CGAL::Box_intersection_d::Box_with_info_d<NT, int D, Info, IdPolicy>
-
CGAL::Box_intersection_d::Box_with_handle_d<NT, int D, Handle, IdPolicy>
-
CGAL::Box_intersection_d::Box_traits_d<BoxHandle>
-
BoxIntersectionTraits_d
- Examples
- Box_intersection_d/box_grid.cpp, Box_intersection_d/minimal.cpp, Box_intersection_d/minimal_self.cpp, and Box_intersection_d/progress.cpp.
|
| std::size_t | id () |
| | returns a unique box id, see the IdPolicy template parameter above for the different choices.
|
| NT | min_coord (int d) const |
| | returns the lower boundary in dimension d
|
| NT | max_coord (int d) const |
| | returns the upper boundary in dimension d
|
|
const Bbox_2 & | bbox () const |
| | returns the bounding box Requirements: \( D=2\) and NT \( \equiv\)double
|
|
const Bbox_3 & | bbox () const |
| | returns the bounding box Requirements: \( D=3\) and NT \( \equiv\)double
|
|
void | extend (NT p[N]) |
| | extends box to the smallest box that additionally contains the point represented by coordinates in p.
|
|
void | extend (std::pair< NT, NT > p[N]) |
| | extends box to the smallest box that additionally contains the point represented by coordinate intervals in p.
|