Simbody  3.5
SimTK::Geo::AlignedBox_< P > Class Template Reference

A 3d box aligned with an unspecified frame F and centered at a given point measured from that frame's origin. More...

Public Member Functions

 AlignedBox_ ()
 Construct an uninitialized AlignedBox object; the dimensions and location will be garbage. More...
 
 AlignedBox_ (const Vec3P &center, const Geo::Box_< P > &box)
 Construct an AlignedBox with the given box shape with the center located as given. More...
 
 AlignedBox_ (const Vec3P &center, const Vec3P &halfLengths)
 Construct an AlignedBox with the given center location and half-dimensions. More...
 
AlignedBox_setCenter (const Vec3P &center)
 Change the center location of this box. More...
 
AlignedBox_setHalfLengths (const Vec3P &halfLengths)
 Change the dimensions of this box. More...
 
const Vec3PgetCenter () const
 Return the location of the center of this box (box frame origin). More...
 
Vec3PupdCenter ()
 Return a writable reference to the center location of this box. More...
 
const Vec3PgetHalfLengths () const
 Return the half-lengths of this box as a Vec3 from the center to the first quadrant vertex. More...
 
const Box_< P > & getBox () const
 
Box_< P > & updBox ()
 
bool containsPoint (const Vec3P &pt_F) const
 Given a point measured and expressed in the base frame F, determine whether it is strictly contained in the box (just touching doesn't count). More...
 
AlignedBox_stretchBoundary ()
 Stretch this box in place by a small amount to ensure that there will be no roundoff problems if this is used as a bounding box. More...
 

Detailed Description

template<class P>
class SimTK::Geo::AlignedBox_< P >

A 3d box aligned with an unspecified frame F and centered at a given point measured from that frame's origin.

The box frame B is aligned with F but the origin Bo is shifted from Fo.

Constructor & Destructor Documentation

template<class P>
SimTK::Geo::AlignedBox_< P >::AlignedBox_ ( )
inline

Construct an uninitialized AlignedBox object; the dimensions and location will be garbage.

template<class P>
SimTK::Geo::AlignedBox_< P >::AlignedBox_ ( const Vec3P center,
const Geo::Box_< P > &  box 
)
inline

Construct an AlignedBox with the given box shape with the center located as given.

template<class P>
SimTK::Geo::AlignedBox_< P >::AlignedBox_ ( const Vec3P center,
const Vec3P halfLengths 
)
inline

Construct an AlignedBox with the given center location and half-dimensions.

Member Function Documentation

template<class P>
AlignedBox_& SimTK::Geo::AlignedBox_< P >::setCenter ( const Vec3P center)
inline

Change the center location of this box.

template<class P>
AlignedBox_& SimTK::Geo::AlignedBox_< P >::setHalfLengths ( const Vec3P halfLengths)
inline

Change the dimensions of this box.

template<class P>
const Vec3P& SimTK::Geo::AlignedBox_< P >::getCenter ( ) const
inline

Return the location of the center of this box (box frame origin).

template<class P>
Vec3P& SimTK::Geo::AlignedBox_< P >::updCenter ( )
inline

Return a writable reference to the center location of this box.

template<class P>
const Vec3P& SimTK::Geo::AlignedBox_< P >::getHalfLengths ( ) const
inline

Return the half-lengths of this box as a Vec3 from the center to the first quadrant vertex.

template<class P>
const Box_<P>& SimTK::Geo::AlignedBox_< P >::getBox ( ) const
inline
template<class P>
Box_<P>& SimTK::Geo::AlignedBox_< P >::updBox ( )
inline
template<class P>
bool SimTK::Geo::AlignedBox_< P >::containsPoint ( const Vec3P pt_F) const
inline

Given a point measured and expressed in the base frame F, determine whether it is strictly contained in the box (just touching doesn't count).

Cost is about 8 flops.

template<class P>
AlignedBox_& SimTK::Geo::AlignedBox_< P >::stretchBoundary ( )
inline

Stretch this box in place by a small amount to ensure that there will be no roundoff problems if this is used as a bounding box.

The amount to stretch depends on the default tolerance for this precision, the dimensions, and the position of the box in space. A very large box, or a box that is very far from the origin, must be stretched more than a small one at the origin. Cost is 6 flops.

See also
Geo class for tolerance information.

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