IMP  2.0.0
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 >:

Public Member Functions

 BoundingBoxD ()
 Create an empty bounding box.
 
 BoundingBoxD (unsigned int d)
 Create an empty bounding box.
 
 BoundingBoxD (const VectorInputD< D > &lb, const VectorInputD< D > &ub)
 Make from the lower and upper corners.
 
 BoundingBoxD (const VectorInputD< D > &v)
 Creating a bounding box containing one point.
 
 BoundingBoxD (const base::Vector< VectorD< D > > &points)
 Creating a bounding box from a set of points.
 
bool get_contains (const VectorD< D > &o) const
 True if the point o is contained within this bounding box.
 
bool get_contains (const BoundingBoxD &bb) const
 True if the input bounding box is contained within this bounding box.
 
const VectorD< D > & get_corner (unsigned int i) const
 For 0 return lower corner and 1 upper corner.
 
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)
 
void show (std::ostream &out=std::cout) const
 

Related Functions

(Note that these are not member functions.)

algebra::BoundingBoxD< 3 > get_bounding_box (const Hierarchy &h)
 Get a bounding box for the Hierarchy. More...
 
template<unsigned int D>
BoundingBoxD< D > get_cube_d (double radius)
 Cube with radius of length radius. More...
 
BoundingBoxD<-1 > get_cube_kd (unsigned int d, double radius)
 Cube with radius of length side. More...
 
IntPairs get_edges (const BoundingBoxD< 3 > &)
 Return the edges of the box as indices into the vertices list. More...
 
template<int D>
bool get_interiors_intersect (const BoundingBoxD< D > &a, const BoundingBoxD< D > &b)
 Return true if they intersect. More...
 
template<int D>
BoundingBoxD< D > get_intersection (const BoundingBoxD< D > &a, const BoundingBoxD< D > &b)
 Return the intersecting bounding box. More...
 
template<int D>
double get_maximum_length (const BoundingBoxD< D > &a)
 Return the maximum axis aligned extent. More...
 
template<int D>
BoundingBoxD< D > get_union (BoundingBoxD< D > a, const BoundingBoxD< D > &b)
 Return the union bounding box. More...
 
template<unsigned int D>
BoundingBoxD< D > get_unit_bounding_box_d ()
 Box with radius one. More...
 
BoundingBoxD<-1 > get_unit_bounding_box_kd (unsigned int d)
 Box with radius one. More...
 
Vector3Ds get_vertices (const BoundingBoxD< 3 > &bb)
 Return a list of the 8 bounding points for the bounding box. More...
 
template<int D>
double get_volume (const BoundingBoxD< D > &bb)
 

Detailed Description

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

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 27 of file BoundingBoxD.h.

Member Function Documentation

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 104 of file BoundingBoxD.h.

Friends And Related Function Documentation

template<int D>
algebra::BoundingBoxD< 3 > get_bounding_box ( const Hierarchy &  h)
related

This bounding box is that of the highest (in the CS sense of a tree growing down from the root) cut through the tree where each node in the cut has x,y,z, and r. That is, if the root has x,y,z,r then it is the bounding box of that sphere. If only the leaves have radii, it is the bounding box of the leaves. If no such cut exists, the behavior is undefined.

template<unsigned int D>
BoundingBoxD< D > get_cube_d ( double  radius)
related

Definition at line 184 of file BoundingBoxD.h.

template<int D>
BoundingBoxD<-1 > get_cube_kd ( unsigned int  d,
double  radius 
)
related

Definition at line 191 of file BoundingBoxD.h.

+ Here is the call graph for this function:

template<int D>
IntPairs get_edges ( const BoundingBoxD< 3 > &  )
related

Definition at line 276 of file BoundingBoxD.h.

template<int D>
bool get_interiors_intersect ( const BoundingBoxD< D > &  a,
const BoundingBoxD< D > &  b 
)
related

Definition at line 200 of file BoundingBoxD.h.

+ Here is the call graph for this function:

template<int D>
BoundingBoxD< D > get_intersection ( const BoundingBoxD< D > &  a,
const BoundingBoxD< D > &  b 
)
related

Definition at line 214 of file BoundingBoxD.h.

+ Here is the call graph for this function:

template<int D>
double get_maximum_length ( const BoundingBoxD< D > &  a)
related

Definition at line 248 of file BoundingBoxD.h.

+ Here is the call graph for this function:

template<int D>
BoundingBoxD< D > get_union ( BoundingBoxD< D >  a,
const BoundingBoxD< D > &  b 
)
related

This is the same as doing a+b.

Definition at line 239 of file BoundingBoxD.h.

template<unsigned int D>
BoundingBoxD< D > get_unit_bounding_box_d ( )
related

Definition at line 171 of file BoundingBoxD.h.

template<int D>
BoundingBoxD<-1 > get_unit_bounding_box_kd ( unsigned int  d)
related

Definition at line 177 of file BoundingBoxD.h.

+ Here is the call graph for this function:

template<int D>
Vector3Ds get_vertices ( const BoundingBoxD< 3 > &  bb)
related

Definition at line 260 of file BoundingBoxD.h.

+ Here is the call graph for this function:

template<int D>
double get_volume ( const BoundingBoxD< D > &  bb)
related

Definition at line 152 of file BoundingBoxD.h.

+ Here is the call graph for this function:


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