IMP logo
IMP Reference Guide  develop.7482b7c7af, 2026/12/05
The Integrative Modeling Platform
IMP::algebra::BoundingBoxD< D > Class Template Reference

An axis-aligned bounding box. More...

#include <IMP/algebra/BoundingBoxD.h>

Inheritance diagram for IMP::algebra::BoundingBoxD< D >:

Detailed Description

template<int D>
class IMP::algebra::BoundingBoxD< D >

An axis-aligned bounding box.

The BoundingBoxD class provides a unified representation for bounding boxes in IMP. Geometric objects should have an associated namespace method like get_bounding_box() which returns the bounding boxes of objects.

Note
This class is a geometric primitive.

Definition at line 28 of file BoundingBoxD.h.

Public Member Functions

 BoundingBoxD ()
 Create an empty bounding box.
 BoundingBoxD (const Vector< VectorD< D > > &points)
 Creating a bounding box from a set of points.
 BoundingBoxD (const VectorD< D > &lb, const VectorD< D > &ub)
 Make from the lower and upper corners.
 BoundingBoxD (const VectorD< D > &v)
 Creating a bounding box containing one point.
 BoundingBoxD (unsigned int d)
 Create an empty bounding box.
bool get_contains (const BoundingBoxD &bb) const
 True if the input bounding box is completely contained within this one.
bool get_contains (const VectorD< D > &o) const
 True if the point o is contained within this bounding box.
const VectorD< D > & get_corner (unsigned int i) const
 For 0 return lower corner and for 1, the upper corner.
const VectorD< D > & get_corner_0 () const
 Get the lower corner of the box.
const VectorD< D > & get_corner_1 () const
 Get the upper corner of the box.
unsigned int get_dimension () const
template<class O>
const BoundingBoxD< D > operator+ (const BoundingBoxD< D > &o) const
 Returning a bounding box containing both.
template<class O>
const BoundingBoxD< D > operator+ (const O &o) const
 Return a bounding box grown by o on all sides.
const BoundingBoxD< D > & operator+= (const BoundingBoxD< D > &o)
 Extend the current bounding box to include the other.
const BoundingBoxD< D > & operator+= (const VectorD< D > &o)
 Extend the current bounding box to include the point.
const BoundingBoxD< D > & operator+= (double o)
 Grow the bounding box by o on all sizes.
void show (std::ostream &out=std::cout) const

Constructor & Destructor Documentation

◆ BoundingBoxD() [1/5]

template<int D>
IMP::algebra::BoundingBoxD< D >::BoundingBoxD ( )

Create an empty bounding box.

Definition at line 38 of file BoundingBoxD.h.

◆ BoundingBoxD() [2/5]

template<int D>
IMP::algebra::BoundingBoxD< D >::BoundingBoxD ( unsigned int d)
explicit

Create an empty bounding box.

Definition at line 61 of file BoundingBoxD.h.

◆ BoundingBoxD() [3/5]

template<int D>
IMP::algebra::BoundingBoxD< D >::BoundingBoxD ( const VectorD< D > & lb,
const VectorD< D > & ub )

Make from the lower and upper corners.

Definition at line 73 of file BoundingBoxD.h.

◆ BoundingBoxD() [4/5]

template<int D>
IMP::algebra::BoundingBoxD< D >::BoundingBoxD ( const VectorD< D > & v)
explicit

Creating a bounding box containing one point.

Definition at line 83 of file BoundingBoxD.h.

◆ BoundingBoxD() [5/5]

template<int D>
IMP::algebra::BoundingBoxD< D >::BoundingBoxD ( const Vector< VectorD< D > > & points)

Creating a bounding box from a set of points.

Definition at line 89 of file BoundingBoxD.h.

Member Function Documentation

◆ get_contains() [1/2]

template<int D>
bool IMP::algebra::BoundingBoxD< D >::get_contains ( const BoundingBoxD< D > & bb) const

True if the input bounding box is completely contained within this one.

Definition at line 171 of file BoundingBoxD.h.

◆ get_contains() [2/2]

template<int D>
bool IMP::algebra::BoundingBoxD< D >::get_contains ( const VectorD< D > & o) const

True if the point o is contained within this bounding box.

Definition at line 162 of file BoundingBoxD.h.

◆ get_corner()

template<int D>
const VectorD< D > & IMP::algebra::BoundingBoxD< D >::get_corner ( unsigned int i) const

For 0 return lower corner and for 1, the upper corner.

Definition at line 142 of file BoundingBoxD.h.

◆ get_corner_0()

template<int D>
const VectorD< D > & IMP::algebra::BoundingBoxD< D >::get_corner_0 ( ) const

Get the lower corner of the box.

This should be a litle faster than get_corner(0) since it skips the bounds check.

Definition at line 150 of file BoundingBoxD.h.

◆ get_corner_1()

template<int D>
const VectorD< D > & IMP::algebra::BoundingBoxD< D >::get_corner_1 ( ) const

Get the upper corner of the box.

This should be a litle faster than get_corner(1) since it skips the bounds check.

Definition at line 157 of file BoundingBoxD.h.

◆ get_dimension()

template<int D>
unsigned int IMP::algebra::BoundingBoxD< D >::get_dimension ( ) const

Definition at line 96 of file BoundingBoxD.h.

◆ operator+() [1/2]

template<int D>
template<class O>
const BoundingBoxD< D > IMP::algebra::BoundingBoxD< D >::operator+ ( const BoundingBoxD< D > & o) const

Returning a bounding box containing both.

Definition at line 128 of file BoundingBoxD.h.

◆ operator+() [2/2]

template<int D>
template<class O>
const BoundingBoxD< D > IMP::algebra::BoundingBoxD< D >::operator+ ( const O & o) const

Return a bounding box grown by o on all sides.

Definition at line 135 of file BoundingBoxD.h.

◆ operator+=() [1/3]

template<int D>
const BoundingBoxD< D > & IMP::algebra::BoundingBoxD< D >::operator+= ( const BoundingBoxD< D > & o)

Extend the current bounding box to include the other.

Definition at line 101 of file BoundingBoxD.h.

◆ operator+=() [2/3]

template<int D>
const BoundingBoxD< D > & IMP::algebra::BoundingBoxD< D >::operator+= ( const VectorD< D > & o)

Extend the current bounding box to include the point.

Definition at line 110 of file BoundingBoxD.h.

◆ operator+=() [3/3]

template<int D>
const BoundingBoxD< D > & IMP::algebra::BoundingBoxD< D >::operator+= ( double o)

Grow the bounding box by o on all sizes.

Definition at line 119 of file BoundingBoxD.h.


The documentation for this class was generated from the following file: