AGX Dynamics  2.37.2.0
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

◆ Type

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

Definition at line 39 of file Bound.h.

Constructor & Destructor Documentation

◆ BoundT() [1/3]

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.

◆ BoundT() [2/3]

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.

◆ BoundT() [3/3]

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

Definition at line 249 of file Bound.h.

Member Function Documentation

◆ calculateOverlap()

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.

◆ contains()

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.

◆ hasOverlap()

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.

◆ isValid()

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.

◆ max() [1/2]

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

Definition at line 255 of file Bound.h.

Referenced by agxCollide::Plane::calculateBound(), agxCollide::Line::calculateBound(), agxCollide::BoundingAABB::expand(), and agxCollide::operator<<().

◆ max() [2/2]

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.

◆ mid()

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.

◆ min() [1/2]

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

Definition at line 252 of file Bound.h.

Referenced by agxCollide::Plane::calculateBound(), agxCollide::Line::calculateBound(), agxCollide::BoundingAABB::expand(), and agxCollide::operator<<().

◆ min() [2/2]

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.

◆ operator BoundT< T2 >()

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.

◆ operator!=()

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

Definition at line 333 of file Bound.h.

◆ operator*() [1/2]

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.

◆ operator*() [2/2]

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

Definition at line 287 of file Bound.h.

◆ operator*=() [1/2]

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.

◆ operator*=() [2/2]

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

Definition at line 277 of file Bound.h.

◆ operator=()

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

Definition at line 324 of file Bound.h.

◆ operator==()

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

Definition at line 317 of file Bound.h.

◆ set()

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.

◆ size()

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.

◆ translate()

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

◆ m_max

◆ m_min


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