3es  0.7
tes::Bounds< T > Class Template Reference

A simple bounding box structure. More...

#include <3esbounds.h>

Public Member Functions

 Bounds ()
 Initialises bounds where max < min at using the limits of the type T.
 
 Bounds (const Bounds< T > &other)
 Copy constructor. More...
 
template<typename Q >
 Bounds (const Bounds< Q > &other)
 Copy constructor from a different numeric type. More...
 
 Bounds (const Vector3< T > &minExt, const Vector3< T > maxExt)
 Initialise a bounding box with the given extents. More...
 
const Vector3< T > & minimum () const
 Access the minimum extents. More...
 
const Vector3< T > & maximum () const
 Access the maximum extents. More...
 
void expand (const Vector3< T > &point)
 Expand the bounding box to include point. More...
 
void expand (const Bounds< T > &other)
 Expand the bounding box to include other. More...
 
bool isValid () const
 Returns true if the bounds are valid, with minimum extents less than or equal to the maximum. More...
 
bool operator== (const Bounds< T > &other) const
 Precise equality operator. More...
 
bool operator!= (const Bounds< T > &other) const
 Precise inequality operator. More...
 
Bounds< T > & operator= (const Bounds< T > &other)
 Assignment operator. More...
 

Detailed Description

template<typename T>
class tes::Bounds< T >

A simple bounding box structure.

Constructor & Destructor Documentation

◆ Bounds() [1/3]

template<typename T >
tes::Bounds< T >::Bounds ( const Bounds< T > &  other)
inline

Copy constructor.

Parameters
otherThe bounds to copy.

◆ Bounds() [2/3]

template<typename T >
template<typename Q >
tes::Bounds< T >::Bounds ( const Bounds< Q > &  other)
inline

Copy constructor from a different numeric type.

The type Q must be compatible with T. Generally used to convert between single and double precision.

Parameters
otherThe bounds to copy.

◆ Bounds() [3/3]

template<typename T >
tes::Bounds< T >::Bounds ( const Vector3< T > &  minExt,
const Vector3< T >  maxExt 
)
inline

Initialise a bounding box with the given extents.

Parameters
minExtThe bounding box minimum. All components must be less than or equal to
maxExtents.
maxExtThe bounding box maximum. All components must be greater than or equal to
minExtents.

Member Function Documentation

◆ expand() [1/2]

template<typename T >
void tes::Bounds< T >::expand ( const Vector3< T > &  point)
inline

Expand the bounding box to include point.

Parameters
pointThe point to include.

References tes::Vector3< T >::x.

Referenced by tes::Bounds< T >::expand().

◆ expand() [2/2]

template<typename T >
void tes::Bounds< T >::expand ( const Bounds< T > &  other)
inline

Expand the bounding box to include other.

Parameters
pointThe point to include.

References tes::Bounds< T >::expand(), tes::Bounds< T >::maximum(), and tes::Bounds< T >::minimum().

◆ isValid()

template<typename T >
bool tes::Bounds< T >::isValid ( ) const
inline

Returns true if the bounds are valid, with minimum extents less than or equal to the maximum.

Returns
True when valid.

◆ maximum()

template<typename T >
const Vector3< T > & tes::Bounds< T >::maximum ( ) const
inline

Access the maximum extents.

Returns
The maximal corder of the bounding box.

Referenced by tes::Bounds< T >::expand().

◆ minimum()

template<typename T >
const Vector3< T > & tes::Bounds< T >::minimum ( ) const
inline

Access the minimum extents.

Returns
The minimal corder of the bounding box.

Referenced by tes::Bounds< T >::expand().

◆ operator!=()

template<typename T >
bool tes::Bounds< T >::operator!= ( const Bounds< T > &  other) const
inline

Precise inequality operator.

Parameters
otherThe object to compare to.
Returns
True if this is no precisely equal to other.

References tes::Bounds< T >::operator==().

◆ operator=()

template<typename T >
Bounds< T > & tes::Bounds< T >::operator= ( const Bounds< T > &  other)
inline

Assignment operator.

Parameters
otherThe bounds to copy.
Returns
this.

◆ operator==()

template<typename T >
bool tes::Bounds< T >::operator== ( const Bounds< T > &  other) const
inline

Precise equality operator.

Parameters
otherThe object to compare to.
Returns
True if this is precisely equal to other.

Referenced by tes::Bounds< T >::operator!=().


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