CGAL 6.3 - dD Geometry Kernel
Loading...
Searching...
No Matches
CGAL::Bbox_d< DimensionTag > Class Template Reference

#include <CGAL/Bbox_d.h>

Definition

template<typename DimensionTag>
class CGAL::Bbox_d< DimensionTag >

An object b of the class Bbox_d is a bounding box in the d-dimensional Euclidean space \( \E^d\).

Template Parameters
DimensionTagmust be an instance of CGAL::Dimension_tag.
Is model of
Hashable
See also
CGAL::Bbox_2
CGAL::Bbox_3

Types

An iterator for enumerating the Cartesian coordinates of the point with the lexicographically

typedef unspecified_type Cartesian_const_iterator

Creation

 Bbox_d ()
 constructs an empty bounding box with lower left corner coordinates at \( \infty \) and with upper right corner coordinates at \( -\infty \), where \( \infty \) means std::numeric_limits<double>::infinity().
 Bbox_d (const Bbox_2 &b)
 constructs a d-dimensional bounding box from a 2D bounding box.
template<typename InputIterator>
 Bbox_d (InputIterator b, InputIterator e)
 constructs a d-dimensional bounding box from a range of coordinates
 Bbox_d (const Bbox_3 &b)
 constructs a d-dimensional bounding box from a 3D bounding box.

Operations

bool operator== (const Bbox_d &c) const
 tests for equality.
bool operator!= (const Bbox_d &q) const
 tests for inequality.
int dimension () const
 returns the dimension.
double min (int i) const
 returns the i-th Cartesian coordinate of the "lower left" corner.
double max (int i) const
 returns the i-th Cartesian coordinate of the "upper right" corner.
Cartesian_const_iterator cartesian_begin () const
 returns an iterator for the Cartesian coordinates of the "lower left" and the "upper right" corner.
Cartesian_const_iterator cartesian_end () const
 returns the past-the-end iterator for the Cartesian coordinates of the "lower left" and the "upper right" corner.
Bbox_d operator+ (const Bbox_d &c) const
 returns a bounding box of b and c.
Bbox_doperator+= (const Bbox_d &c)
 updates b to be the bounding box of b and c and returns itself.
void dilate (int dist)
 dilates the bounding box by a specified number of ULP.
void scale (double factor)
 scales the bounding box by factor, while keeping its center fixed.
template<typename DimensionTag>
bool do_overlap (const Bbox_d< DimensionTag > &bb1, const Bbox_d< DimensionTag > &bb2)
 returns true, iff bb1 and bb2 overlap, i.e., iff their intersection is non-empty.

Constructor & Destructor Documentation

◆ Bbox_d() [1/3]

template<typename DimensionTag>
CGAL::Bbox_d< DimensionTag >::Bbox_d ( const Bbox_2 & b)

constructs a d-dimensional bounding box from a 2D bounding box.

Precondition
the dimension must be 2D

◆ Bbox_d() [2/3]

template<typename DimensionTag>
template<typename InputIterator>
CGAL::Bbox_d< DimensionTag >::Bbox_d ( InputIterator b,
InputIterator e )

constructs a d-dimensional bounding box from a range of coordinates

Precondition
the range must have the size of the dimension.
Template Parameters
InputIteratoran input iterator with value type double

◆ Bbox_d() [3/3]

template<typename DimensionTag>
CGAL::Bbox_d< DimensionTag >::Bbox_d ( const Bbox_3 & b)

constructs a d-dimensional bounding box from a 3D bounding box.

Precondition
the dimension must be 3D

Member Function Documentation

◆ scale()

template<typename DimensionTag>
void CGAL::Bbox_d< DimensionTag >::scale ( double factor)

scales the bounding box by factor, while keeping its center fixed.

Precondition
factor > 0