Om  1.0.0
A universal framework for multimedia simulation
Public Member Functions | Public Attributes | List of all members
om::math::AABB1D< T > Class Template Reference

A class that represents a range of values in 1D space. More...

#include <omAABB1D.h>

Public Member Functions

 AABB1D ()
 Create a 1D axis-aligned bounding box with no extent centered about the origin. More...
 
 AABB1D (T center)
 Create a 1D axis-aligned bounding box with the minimum and maximum coordinates equal to the specified value. More...
 
 AABB1D (T newMin, T newMax)
 Create a 1D axis-aligned bounding box with the specified minimum and maximum coodinates. More...
 
 AABB1D (const T *points, Size numPoints)
 Create a 1D axis-aligned bounding box for the specified array of values. More...
 
template<typename U >
 operator AABB1D< U > () const
 Cast this bounding box to a bounding box with a different underlying primitive type. More...
 
Bool contains (const AABB1D &bounds) const
 Return whether or not this bounding box completely contains another. More...
 
Bool contains (T value) const
 Return whether or not this bounding box contains the specified value. More...
 
Bool intersects (const AABB1D &bounds) const
 Return whether or not this bounding box intersects another. More...
 
void set (T newMin, T newMax)
 Set the minimum and maximum values of the axis-aligned bounding box. More...
 
getWidth () const
 Get the difference between the maximum and minimum coordinates. More...
 
getSize () const
 Get the difference between the maximum and minimum coordinates. More...
 
getRadius () const
 Return the distance from the center to the farthest corner of the box. More...
 
getCenter () const
 Get the center of the bounding box. More...
 
getMinMax (Index i) const
 Return either the minimal or maximal vertex of this AABB. More...
 
void enlargeFor (T value)
 Modify the current bounding box such that it encloses the specified value. More...
 
void enlargeFor (const AABB1D &box)
 Modify the current bounding box such that it encloses the specified box. More...
 
AABB1D< T > & operator|= (T value)
 Modify the current bounding box such that it encloses the specified value. More...
 
AABB1D< T > operator| (T value) const
 Return the bounding box necessary to enclose a value and the current bounding box. More...
 
AABB1D< T > getUnion (const AABB1D< T > &bounds) const
 Return the union of this bounding box and another. More...
 
AABB1D< T > & operator|= (const AABB1D< T > &bounds)
 Modify this bounding box such that it contains the specified bounding box. More...
 
AABB1D< T > operator| (const AABB1D< T > &bounds) const
 Return the union of this bounding box and another. More...
 
AABB1D< T > getIntersection (const AABB1D< T > &bounds) const
 Return the intersection of this bounding box and another. More...
 
AABB1D< T > & operator&= (const AABB1D< T > &bounds)
 Return the intersection of this bounding box and another. More...
 
AABB1D< T > operator& (const AABB1D< T > &bounds) const
 Return the intersection of this bounding box and another. More...
 
Bool operator== (const AABB1D< T > &other) const
 Return whether or not this bounding box is exactly the same as another. More...
 
Bool operator!= (const AABB1D< T > &other) const
 Return whether or not this bounding box is different than another. More...
 
AABB1D< T > operator* (T scale) const
 Multiply the minimum and maximum coordinates of this bounding box by the specified scale factor. More...
 
AABB1D< T > operator/ (T scale) const
 Divide the minimum and maximum coordinates of this bounding box by the specified scale factor. More...
 
data::String toString () const
 Convert this 1D range into a human-readable string representation. More...
 
 operator data::String () const
 Convert this 1D range into a human-readable string representation. More...
 

Public Attributes

min
 The minumum coordinate of the bounding box. More...
 
max
 The maximum coordinate of the bounding box. More...
 

Detailed Description

template<typename T>
class om::math::AABB1D< T >

A class that represents a range of values in 1D space.

This class contains two data members: min and max. These indicate the minimum and maximum values that this axis-aligned bounding box represents. The class invariant is that min is less than max, though this is not enforced. The class supports union, containment, and intersection operations.

Constructor & Destructor Documentation

template<typename T>
om::math::AABB1D< T >::AABB1D ( )
inline

Create a 1D axis-aligned bounding box with no extent centered about the origin.

template<typename T>
om::math::AABB1D< T >::AABB1D ( center)
inline

Create a 1D axis-aligned bounding box with the minimum and maximum coordinates equal to the specified value.

template<typename T>
om::math::AABB1D< T >::AABB1D ( newMin,
newMax 
)
inline

Create a 1D axis-aligned bounding box with the specified minimum and maximum coodinates.

template<typename T>
om::math::AABB1D< T >::AABB1D ( const T *  points,
Size  numPoints 
)
inline

Create a 1D axis-aligned bounding box for the specified array of values.

Member Function Documentation

template<typename T>
template<typename U >
om::math::AABB1D< T >::operator AABB1D< U > ( ) const
inline

Cast this bounding box to a bounding box with a different underlying primitive type.

template<typename T>
Bool om::math::AABB1D< T >::contains ( const AABB1D< T > &  bounds) const
inline

Return whether or not this bounding box completely contains another.

template<typename T>
Bool om::math::AABB1D< T >::contains ( value) const
inline

Return whether or not this bounding box contains the specified value.

template<typename T>
Bool om::math::AABB1D< T >::intersects ( const AABB1D< T > &  bounds) const
inline

Return whether or not this bounding box intersects another.

template<typename T>
void om::math::AABB1D< T >::set ( newMin,
newMax 
)
inline

Set the minimum and maximum values of the axis-aligned bounding box.

template<typename T>
T om::math::AABB1D< T >::getWidth ( ) const
inline

Get the difference between the maximum and minimum coordinates.

template<typename T>
T om::math::AABB1D< T >::getSize ( ) const
inline

Get the difference between the maximum and minimum coordinates.

template<typename T>
T om::math::AABB1D< T >::getRadius ( ) const
inline

Return the distance from the center to the farthest corner of the box.

template<typename T>
T om::math::AABB1D< T >::getCenter ( ) const
inline

Get the center of the bounding box.

template<typename T>
T om::math::AABB1D< T >::getMinMax ( Index  i) const
inline

Return either the minimal or maximal vertex of this AABB.

If the index parameter is 0, the minimal vertex is returned, if the index parameter is 1, the maximal vertex is returned. Otherwise the result is undefined.

template<typename T>
void om::math::AABB1D< T >::enlargeFor ( value)
inline

Modify the current bounding box such that it encloses the specified value.

template<typename T>
void om::math::AABB1D< T >::enlargeFor ( const AABB1D< T > &  box)
inline

Modify the current bounding box such that it encloses the specified box.

template<typename T>
AABB1D<T>& om::math::AABB1D< T >::operator|= ( value)
inline

Modify the current bounding box such that it encloses the specified value.

template<typename T>
AABB1D<T> om::math::AABB1D< T >::operator| ( value) const
inline

Return the bounding box necessary to enclose a value and the current bounding box.

template<typename T>
AABB1D<T> om::math::AABB1D< T >::getUnion ( const AABB1D< T > &  bounds) const
inline

Return the union of this bounding box and another.

template<typename T>
AABB1D<T>& om::math::AABB1D< T >::operator|= ( const AABB1D< T > &  bounds)
inline

Modify this bounding box such that it contains the specified bounding box.

template<typename T>
AABB1D<T> om::math::AABB1D< T >::operator| ( const AABB1D< T > &  bounds) const
inline

Return the union of this bounding box and another.

template<typename T>
AABB1D<T> om::math::AABB1D< T >::getIntersection ( const AABB1D< T > &  bounds) const
inline

Return the intersection of this bounding box and another.

template<typename T>
AABB1D<T>& om::math::AABB1D< T >::operator&= ( const AABB1D< T > &  bounds)
inline

Return the intersection of this bounding box and another.

template<typename T>
AABB1D<T> om::math::AABB1D< T >::operator& ( const AABB1D< T > &  bounds) const
inline

Return the intersection of this bounding box and another.

template<typename T>
Bool om::math::AABB1D< T >::operator== ( const AABB1D< T > &  other) const
inline

Return whether or not this bounding box is exactly the same as another.

template<typename T>
Bool om::math::AABB1D< T >::operator!= ( const AABB1D< T > &  other) const
inline

Return whether or not this bounding box is different than another.

template<typename T>
AABB1D<T> om::math::AABB1D< T >::operator* ( scale) const
inline

Multiply the minimum and maximum coordinates of this bounding box by the specified scale factor.

template<typename T>
AABB1D<T> om::math::AABB1D< T >::operator/ ( scale) const
inline

Divide the minimum and maximum coordinates of this bounding box by the specified scale factor.

template<typename T>
data::String om::math::AABB1D< T >::toString ( ) const
inline

Convert this 1D range into a human-readable string representation.

template<typename T>
om::math::AABB1D< T >::operator data::String ( ) const
inline

Convert this 1D range into a human-readable string representation.

Member Data Documentation

template<typename T>
T om::math::AABB1D< T >::min

The minumum coordinate of the bounding box.

template<typename T>
T om::math::AABB1D< T >::max

The maximum coordinate of the bounding box.


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