Documentation


animal::BoundingBox3D< Point, Real > Class Template Reference

#include <boundingBox.h>

List of all members.


Detailed Description

template<class Point = Vec3, class Real = typename container_traits<Point>::value_type>
class animal::BoundingBox3D< Point, Real >

Axis-aligned bounding box in dimension 3.

Methods to insert points or boxes, translate and rotate, test intersection.

Examples:

boundingBox3D_test.cpp.

Definition at line 23 of file boundingBox.h.

Public Member Functions

Constructors
 BoundingBox3D (Real xm=INFINITY, Real ym=INFINITY, Real zm=INFINITY, Real xM=-INFINITY, Real yM=-INFINITY, Real zM=-INFINITY)
 Define min and max values.

 BoundingBox3D (const Point &v)
 Contains only one point.

 BoundingBox3D (const Point &v_min, const Point &v_max)
 Provide min and max points.

Access data
Point min () const
 Min point.

Point max () const
 Max point.

Geometry
void insert (const Point &v)
 Insert a point.

void insert (const BoundingBox3D &b)
 Insert a bounding box.

void shift (const Point &v)
 Shift the bounding box.

template<class RotationMatrix> BoundingBox3D move (const Point &p, const RotationMatrix &r)
 Rotate and translate the bounding box.


Private Attributes

Real _max [3]
 xMax, yMax, zMax

Real _min [3]
 xMin, yMin, zMin


Friends

Intersection
template<class P, class R> bool intersect (const BoundingBox3D< P, R > &b1, const BoundingBox3D< P, R > &b2)
 Test bounding box intersection.

Input-Output
template<class P, class R> std::ostream & operator<< (std::ostream &, const BoundingBox3D< P, R > &)
 Output.


Constructor & Destructor Documentation

template<class Point = Vec3, class Real = typename container_traits<Point>::value_type>
animal::BoundingBox3D< Point, Real >::BoundingBox3D Real  xm = INFINITY,
Real  ym = INFINITY,
Real  zm = INFINITY,
Real  xM = -INFINITY,
Real  yM = -INFINITY,
Real  zM = -INFINITY
[inline]
 

Define min and max values.

Default values guarantee that the intersection test returns always false.

Definition at line 33 of file boundingBox.h.

References animal::BoundingBox3D< Point, Real >::_max, and animal::BoundingBox3D< Point, Real >::_min.

Referenced by animal::BoundingBox3D< Point, Real >::move().

template<class Point = Vec3, class Real = typename container_traits<Point>::value_type>
animal::BoundingBox3D< Point, Real >::BoundingBox3D const Point &  v  )  [inline]
 

Contains only one point.

Definition at line 47 of file boundingBox.h.

References animal::BoundingBox3D< Point, Real >::_max, and animal::BoundingBox3D< Point, Real >::_min.

template<class Point = Vec3, class Real = typename container_traits<Point>::value_type>
animal::BoundingBox3D< Point, Real >::BoundingBox3D const Point &  v_min,
const Point &  v_max
[inline]
 

Provide min and max points.

Definition at line 55 of file boundingBox.h.

References animal::BoundingBox3D< Point, Real >::_max, and animal::BoundingBox3D< Point, Real >::_min.


Member Function Documentation

template<class Point = Vec3, class Real = typename container_traits<Point>::value_type>
void animal::BoundingBox3D< Point, Real >::insert const BoundingBox3D< Point, Real > &  b  )  [inline]
 

Insert a bounding box.

Definition at line 90 of file boundingBox.h.

References animal::BoundingBox3D< Point, Real >::_max, and animal::BoundingBox3D< Point, Real >::_min.

template<class Point = Vec3, class Real = typename container_traits<Point>::value_type>
void animal::BoundingBox3D< Point, Real >::insert const Point &  v  )  [inline]
 

Insert a point.

Definition at line 81 of file boundingBox.h.

References animal::BoundingBox3D< Point, Real >::_max, and animal::BoundingBox3D< Point, Real >::_min.

template<class Point = Vec3, class Real = typename container_traits<Point>::value_type>
Point animal::BoundingBox3D< Point, Real >::max  )  const [inline]
 

Max point.

Definition at line 72 of file boundingBox.h.

References animal::BoundingBox3D< Point, Real >::_max.

template<class Point = Vec3, class Real = typename container_traits<Point>::value_type>
Point animal::BoundingBox3D< Point, Real >::min  )  const [inline]
 

Min point.

Definition at line 69 of file boundingBox.h.

References animal::BoundingBox3D< Point, Real >::_min.

template<class Point = Vec3, class Real = typename container_traits<Point>::value_type>
template<class RotationMatrix>
BoundingBox3D animal::BoundingBox3D< Point, Real >::move const Point &  p,
const RotationMatrix &  r
[inline]
 

Rotate and translate the bounding box.

The result is an axis-aligned box wich fits the rotated and translated box.

Definition at line 112 of file boundingBox.h.

References animal::BoundingBox3D< Point, Real >::_max, animal::BoundingBox3D< Point, Real >::_min, and animal::BoundingBox3D< Point, Real >::BoundingBox3D().

template<class Point = Vec3, class Real = typename container_traits<Point>::value_type>
void animal::BoundingBox3D< Point, Real >::shift const Point &  v  )  [inline]
 

Shift the bounding box.

Definition at line 99 of file boundingBox.h.

References animal::BoundingBox3D< Point, Real >::_max, and animal::BoundingBox3D< Point, Real >::_min.


Friends And Related Function Documentation

template<class Point = Vec3, class Real = typename container_traits<Point>::value_type>
template<class P, class R>
bool intersect const BoundingBox3D< P, R > &  b1,
const BoundingBox3D< P, R > &  b2
[friend]
 

Test bounding box intersection.

Definition at line 209 of file boundingBox.h.

template<class Point = Vec3, class Real = typename container_traits<Point>::value_type>
template<class P, class R>
std::ostream& operator<< std::ostream &  os,
const BoundingBox3D< P, R > &  b
[friend]
 

Output.

Definition at line 200 of file boundingBox.h.


Member Data Documentation

template<class Point = Vec3, class Real = typename container_traits<Point>::value_type>
Real animal::BoundingBox3D< Point, Real >::_max[3] [private]
 

xMax, yMax, zMax

Definition at line 181 of file boundingBox.h.

Referenced by animal::BoundingBox3D< Point, Real >::BoundingBox3D(), animal::BoundingBox3D< Point, Real >::insert(), animal::intersect(), animal::BoundingBox3D< Point, Real >::max(), animal::BoundingBox3D< Point, Real >::move(), and animal::BoundingBox3D< Point, Real >::shift().

template<class Point = Vec3, class Real = typename container_traits<Point>::value_type>
Real animal::BoundingBox3D< Point, Real >::_min[3] [private]
 

xMin, yMin, zMin

Definition at line 182 of file boundingBox.h.

Referenced by animal::BoundingBox3D< Point, Real >::BoundingBox3D(), animal::BoundingBox3D< Point, Real >::insert(), animal::intersect(), animal::BoundingBox3D< Point, Real >::min(), animal::BoundingBox3D< Point, Real >::move(), and animal::BoundingBox3D< Point, Real >::shift().


The documentation for this class was generated from the following file:
Generated on Thu Dec 23 13:52:29 2004 by doxygen 1.3.6