Rosetta 3.3
Public Types | Public Member Functions
numeric::geometry::BoundingBox< T > Class Template Reference

3d axis aligned bounding box class More...

#include <BoundingBox.hh>

Collaboration diagram for numeric::geometry::BoundingBox< T >:
Collaboration graph
[legend]

List of all members.

Public Types

typedefPointPosition
 3d point position

Public Member Functions

 BoundingBox ()
 default constructor
 BoundingBox (PointPosition const &pp)
 point constructor
 BoundingBox (PointPosition const &lower, PointPosition const &upper)
 corner constructor
 BoundingBox (BoundingBox const &bb)
 copy constructor
 ~BoundingBox ()
 default destructor
BoundingBoxoperator= (BoundingBox const &bb)
 copy assignment
void add (PointPosition const &pp)
 add a point, expands bounds if necessary
PointPosition const & lower () const
 get lower corner
PointPosition const & upper () const
 get upper corner
void set_lower (PointPosition const &p)
 set lower corner
void set_upper (PointPosition const &p)
 set upper corner
void reset (PointPosition const &p=PointPosition())
 reset corners
template<typename U >
void expand (U const &scalar)
 expand box corners (additive)
template<typename U >
void contract (U const &scalar)
void translate (PointPosition const &t)
 translate bounding box
bool intersects (BoundingBox const &bb) const
 intersects another bounding box?
template<typename U >
bool contains (U const &x, U const &y, U const &z) const
 is point contained within this bounding box?
bool contains (PointPosition const &p) const
 is point contained within this bounding box?

Detailed Description

template<typename T>
class numeric::geometry::BoundingBox< T >

3d axis aligned bounding box class

template type must be 3d and have .x(), .y(), .z() accessors


Member Typedef Documentation

template<typename T >
typedef T numeric::geometry::BoundingBox< T >::PointPosition

3d point position


Constructor & Destructor Documentation

template<typename T >
numeric::geometry::BoundingBox< T >::BoundingBox ( ) [inline]

default constructor

Warning:
no initialization of corners for speed, make sure you reset()
or otherwise set corners before adding points
template<typename T >
numeric::geometry::BoundingBox< T >::BoundingBox ( PointPosition const &  pp) [inline]

point constructor

template<typename T >
numeric::geometry::BoundingBox< T >::BoundingBox ( PointPosition const &  lower,
PointPosition const &  upper 
) [inline]

corner constructor

template<typename T >
numeric::geometry::BoundingBox< T >::BoundingBox ( BoundingBox< T > const &  bb) [inline]

copy constructor

template<typename T >
numeric::geometry::BoundingBox< T >::~BoundingBox ( ) [inline]

default destructor


Member Function Documentation

template<typename T >
void numeric::geometry::BoundingBox< T >::add ( PointPosition const &  pp) [inline]

add a point, expands bounds if necessary

template<typename T >
template<typename U >
bool numeric::geometry::BoundingBox< T >::contains ( U const &  x,
U const &  y,
U const &  z 
) const [inline]

is point contained within this bounding box?

Referenced by numeric::geometry::BoundingBox< T >::contains().

template<typename T >
bool numeric::geometry::BoundingBox< T >::contains ( PointPosition const &  p) const [inline]

is point contained within this bounding box?

References numeric::geometry::BoundingBox< T >::contains().

template<typename T >
template<typename U >
void numeric::geometry::BoundingBox< T >::contract ( U const &  scalar) [inline]
template<typename T >
template<typename U >
void numeric::geometry::BoundingBox< T >::expand ( U const &  scalar) [inline]

expand box corners (additive)

template<typename T >
bool numeric::geometry::BoundingBox< T >::intersects ( BoundingBox< T > const &  bb) const [inline]

intersects another bounding box?

template<typename T >
PointPosition const& numeric::geometry::BoundingBox< T >::lower ( ) const [inline]

get lower corner

template<typename T >
BoundingBox& numeric::geometry::BoundingBox< T >::operator= ( BoundingBox< T > const &  bb) [inline]

copy assignment

template<typename T >
void numeric::geometry::BoundingBox< T >::reset ( PointPosition const &  p = PointPosition()) [inline]

reset corners

References docking::p.

template<typename T >
void numeric::geometry::BoundingBox< T >::set_lower ( PointPosition const &  p) [inline]

set lower corner

References docking::p.

template<typename T >
void numeric::geometry::BoundingBox< T >::set_upper ( PointPosition const &  p) [inline]

set upper corner

References docking::p.

template<typename T >
void numeric::geometry::BoundingBox< T >::translate ( PointPosition const &  t) [inline]

translate bounding box

References sd::t.

template<typename T >
PointPosition const& numeric::geometry::BoundingBox< T >::upper ( ) const [inline]

get upper corner


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines