AGXDynamics  2.31.1.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
agx::BoundT< T > Class Template Reference

A BoundT represents a range defined by a minimum and a maximum value. More...

#include <Bound.h>

Public Types

typedef T Type
 

Public Member Functions

 BoundT ()
 Create a bound initialized to the empty range located at the type's default value. More...
 
 BoundT (const T &min, const T &max)
 
 BoundT (const BoundT &other)
 
BoundT calculateOverlap (const BoundT &other) const
 
bool contains (const T &value) const
 
bool hasOverlap (const BoundT &other) const
 
bool isValid () const
 
const T & max () const
 
T & max ()
 
T mid () const
 
const T & min () const
 
T & min ()
 
template<typename T2 >
 operator BoundT< T2 > () const
 Convert the bound to a bound with a different underlying type. More...
 
bool operator!= (const BoundT &other) const
 
template<typename T2 >
BoundT operator* (T2 scale)
 Create a new bound that has the same midpoint as the current bound, but with a size that is scaled according to the given scale. More...
 
template<typename T2 >
BoundT< T > operator* (T2 scale)
 
template<typename T2 >
BoundT & operator*= (T2 scale)
 Scale the bound so that is size is changed according to the given scale, but the midpoint remains unchanged. More...
 
template<typename T2 >
BoundT< T > & operator*= (T2 scale)
 
BoundT & operator= (const BoundT &other)
 
bool operator== (const BoundT &other) const
 
void set (const T &min, const T &max)
 Relocate the bound to the new location. More...
 
T size () const
 
BoundT translate (const T &offset) const
 Move the bound's midpoint without altering its size. More...
 

Protected Attributes

T m_max
 
T m_min
 

Detailed Description

template<typename T>
class agx::BoundT< T >

A BoundT represents a range defined by a minimum and a maximum value.

Template specializations are provided for various VecNt types so that axis aligned bounds in space can be represented.

Definition at line 36 of file Bound.h.

Member Typedef Documentation

template<typename T>
typedef T agx::BoundT< T >::Type

Definition at line 39 of file Bound.h.

Constructor & Destructor Documentation

template<typename T >
agx::BoundT< T >::BoundT ( )

Create a bound initialized to the empty range located at the type's default value.

Definition at line 243 of file Bound.h.

template<typename T>
agx::BoundT< T >::BoundT ( const T &  min,
const T &  max 
)
Parameters
minThe lower bound of the range.
maxThe upper bound of the range.

Definition at line 246 of file Bound.h.

template<typename T>
agx::BoundT< T >::BoundT ( const BoundT< T > &  other)

Definition at line 249 of file Bound.h.

Member Function Documentation

template<typename T >
BoundT< T > agx::BoundT< T >::calculateOverlap ( const BoundT< T > &  other) const
Returns
A new bound that is the intersection of the current and the given bound.

Definition at line 298 of file Bound.h.

References agx::BoundT< T >::m_max, agx::BoundT< T >::m_min, agx::max(), and agx::min().

template<typename T>
bool agx::BoundT< T >::contains ( const T &  value) const
Returns
True if the given value lies within the bound. False otherwise.

Definition at line 295 of file Bound.h.

template<typename T >
bool agx::BoundT< T >::hasOverlap ( const BoundT< T > &  other) const
Returns
True if the given bound overlaps with the current bound.

Definition at line 304 of file Bound.h.

References agxAbort1.

template<typename T >
bool agx::BoundT< T >::isValid ( ) const
Returns
True if the lower bound is less than or equal to the upper bound.

Definition at line 273 of file Bound.h.

template<typename T >
const T & agx::BoundT< T >::max ( ) const
template<typename T >
T & agx::BoundT< T >::max ( )
Returns
A reference to the upper end of the bound.

Definition at line 261 of file Bound.h.

template<typename T >
T agx::BoundT< T >::mid ( ) const
Returns
The midpoint between the lower bound and the upper bound.

Definition at line 270 of file Bound.h.

template<typename T >
const T & agx::BoundT< T >::min ( ) const
template<typename T >
T & agx::BoundT< T >::min ( )
Returns
A reference to the lower end of the bound.

Definition at line 258 of file Bound.h.

template<typename T >
template<typename T2 >
agx::BoundT< T >::operator BoundT< T2 > ( ) const

Convert the bound to a bound with a different underlying type.

Definition at line 240 of file Bound.h.

template<typename T >
bool agx::BoundT< T >::operator!= ( const BoundT< T > &  other) const

Definition at line 333 of file Bound.h.

References agx::BoundT< T >::m_max, and agx::BoundT< T >::m_min.

template<typename T>
template<typename T2 >
BoundT agx::BoundT< T >::operator* ( T2  scale)

Create a new bound that has the same midpoint as the current bound, but with a size that is scaled according to the given scale.

template<typename T>
template<typename T2 >
BoundT<T> agx::BoundT< T >::operator* ( T2  scale)

Definition at line 287 of file Bound.h.

template<typename T>
template<typename T2 >
BoundT& agx::BoundT< T >::operator*= ( T2  scale)

Scale the bound so that is size is changed according to the given scale, but the midpoint remains unchanged.

template<typename T>
template<typename T2 >
BoundT<T>& agx::BoundT< T >::operator*= ( T2  scale)

Definition at line 277 of file Bound.h.

template<typename T >
BoundT< T > & agx::BoundT< T >::operator= ( const BoundT< T > &  other)

Definition at line 324 of file Bound.h.

References agx::BoundT< T >::m_max, and agx::BoundT< T >::m_min.

template<typename T >
bool agx::BoundT< T >::operator== ( const BoundT< T > &  other) const

Definition at line 317 of file Bound.h.

References agx::BoundT< T >::m_max, and agx::BoundT< T >::m_min.

template<typename T>
void agx::BoundT< T >::set ( const T &  min,
const T &  max 
)

Relocate the bound to the new location.

Definition at line 264 of file Bound.h.

References agx::max(), and agx::min().

template<typename T >
T agx::BoundT< T >::size ( ) const
Returns
The distance from the lower bound to the upper bound.

Definition at line 267 of file Bound.h.

template<typename T>
BoundT< T > agx::BoundT< T >::translate ( const T &  offset) const

Move the bound's midpoint without altering its size.

Definition at line 311 of file Bound.h.

Member Data Documentation

template<typename T>
T agx::BoundT< T >::m_max
protected
template<typename T>
T agx::BoundT< T >::m_min
protected

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