AGX Dynamics 2.40.0.0
Loading...
Searching...
No Matches
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.
 
 BoundT (const BoundT &other)
 
 BoundT (const T &min, const T &max)
 
BoundT calculateOverlap (const BoundT &other) const
 
bool contains (const T &value) const
 
bool hasOverlap (const BoundT &other) const
 
bool isValid () const
 
T & max ()
 
const T & max () const
 
mid () const
 
T & min ()
 
const T & min () const
 
template<typename T2 >
 operator BoundT< T2 > () const
 Convert the bound to a bound with a different underlying type.
 
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.
 
template<typename T2 >
BoundT< T > operator* (T2 scale)
 
template<typename T2 >
BoundToperator*= (T2 scale)
 Scale the bound so that is size is changed according to the given scale, but the midpoint remains unchanged.
 
template<typename T2 >
BoundT< T > & operator*= (T2 scale)
 
BoundToperator= (const BoundT &other)
 
bool operator== (const BoundT &other) const
 
void set (const T &min, const T &max)
 Relocate the bound to the new location.
 
size () const
 
BoundT translate (const T &offset) const
 Move the bound's midpoint without altering its size.
 

Protected Attributes

m_max
 
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 306 of file Bound.h.

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

◆ 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 303 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 312 of file Bound.h.

References agxAbort1.

◆ isValid()

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

Definition at line 281 of file Bound.h.

◆ max() [1/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.

◆ max() [2/2]

template<typename T >
const T & agx::BoundT< T >::max

◆ mid()

template<typename T >
T agx::BoundT< T >::mid
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 >
T & agx::BoundT< T >::min
Returns
A reference to the lower end of the bound.

Definition at line 258 of file Bound.h.

◆ min() [2/2]

template<typename T >
const T & agx::BoundT< T >::min

◆ operator BoundT< T2 >()

template<typename T >
template<typename T2 >
agx::BoundT< T >::operator BoundT< T2 >

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 341 of file Bound.h.

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

◆ 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 295 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 285 of file Bound.h.

◆ operator=()

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

Definition at line 332 of file Bound.h.

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

◆ operator==()

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

Definition at line 325 of file Bound.h.

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

◆ 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.

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

◆ size()

template<typename T >
T agx::BoundT< T >::size
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 319 of file Bound.h.

Member Data Documentation

◆ m_max

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

◆ m_min

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

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