HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Interval< T > Class Template Reference

#include <ImathInterval.h>

Public Member Functions

Constructors
IMATH_HOSTDEVICE IMATH_CONSTEXPR14 Interval () IMATH_NOEXCEPT
 Initialize to the empty interval. More...
 
IMATH_HOSTDEVICE IMATH_CONSTEXPR14 Interval (const T &point) IMATH_NOEXCEPT
 Intitialize to a single point. More...
 
IMATH_HOSTDEVICE IMATH_CONSTEXPR14 Interval (const T &minT, const T &maxT) IMATH_NOEXCEPT
 Intitialize to a given (min,max) More...
 
Comparison
IMATH_HOSTDEVICE constexpr bool operator== (const Interval< T > &src) const IMATH_NOEXCEPT
 Equality. More...
 
IMATH_HOSTDEVICE constexpr bool operator!= (const Interval< T > &src) const IMATH_NOEXCEPT
 Inequality. More...
 
Manipulation
IMATH_HOSTDEVICE void makeEmpty () IMATH_NOEXCEPT
 
IMATH_HOSTDEVICE void extendBy (const T &point) IMATH_NOEXCEPT
 Extend the interval to include the given point. More...
 
IMATH_HOSTDEVICE void extendBy (const Interval< T > &interval) IMATH_NOEXCEPT
 Extend the interval to include the given interval. More...
 
IMATH_HOSTDEVICE void makeInfinite () IMATH_NOEXCEPT
 Make the interval include the entire range of the base type. More...
 
Query
IMATH_HOSTDEVICE
IMATH_CONSTEXPR14 T 
size () const IMATH_NOEXCEPT
 Return the size of the interval. The size is (max-min). An empty box has a size of 0. More...
 
IMATH_HOSTDEVICE
IMATH_CONSTEXPR14 T 
center () const IMATH_NOEXCEPT
 
IMATH_HOSTDEVICE
IMATH_CONSTEXPR14 bool 
intersects (const T &point) const IMATH_NOEXCEPT
 Return true if the given point is inside the interval, false otherwise. More...
 
IMATH_HOSTDEVICE
IMATH_CONSTEXPR14 bool 
intersects (const Interval< T > &interval) const IMATH_NOEXCEPT
 Return true if the given interval is inside the interval, false otherwise. More...
 
IMATH_HOSTDEVICE
IMATH_CONSTEXPR14 bool 
isEmpty () const IMATH_NOEXCEPT
 
IMATH_HOSTDEVICE
IMATH_CONSTEXPR14 bool 
hasVolume () const IMATH_NOEXCEPT
 
IMATH_HOSTDEVICE
IMATH_CONSTEXPR14 bool 
isInfinite () const IMATH_NOEXCEPT
 

Public Attributes

Direct access to bounds
T min
 The minimum value of the interval. More...
 
T max
 The minimum value of the interval. More...
 

Detailed Description

template<class T>
class Interval< T >

An Interval has a min and a max and some miscellaneous functions. It is basically a Box<T> that allows T to be a scalar.

Definition at line 25 of file ImathInterval.h.

Constructor & Destructor Documentation

template<class T >
IMATH_HOSTDEVICE IMATH_CONSTEXPR14 Interval< T >::Interval ( )
inline

Initialize to the empty interval.

Definition at line 130 of file ImathInterval.h.

template<class T >
IMATH_HOSTDEVICE IMATH_CONSTEXPR14 Interval< T >::Interval ( const T point)
inline

Intitialize to a single point.

Definition at line 136 of file ImathInterval.h.

template<class T >
IMATH_HOSTDEVICE IMATH_CONSTEXPR14 Interval< T >::Interval ( const T minT,
const T maxT 
)
inline

Intitialize to a given (min,max)

Definition at line 143 of file ImathInterval.h.

Member Function Documentation

template<class T >
IMATH_HOSTDEVICE IMATH_CONSTEXPR14 T Interval< T >::center ( ) const
inline

Return the center of the interval. The center is defined as (max+min)/2. The center of an empty interval is undefined.

Definition at line 228 of file ImathInterval.h.

template<class T >
IMATH_HOSTDEVICE void Interval< T >::extendBy ( const T point)
inline

Extend the interval to include the given point.

Definition at line 182 of file ImathInterval.h.

template<class T >
IMATH_HOSTDEVICE void Interval< T >::extendBy ( const Interval< T > &  interval)
inline

Extend the interval to include the given interval.

Definition at line 193 of file ImathInterval.h.

template<class T >
IMATH_HOSTDEVICE IMATH_CONSTEXPR14 bool Interval< T >::hasVolume ( ) const
inline

Return true if the interval is larger than a single point, false otherwise.

Definition at line 242 of file ImathInterval.h.

template<class T >
IMATH_HOSTDEVICE IMATH_CONSTEXPR14 bool Interval< T >::intersects ( const T point) const
inline

Return true if the given point is inside the interval, false otherwise.

Definition at line 204 of file ImathInterval.h.

template<class T >
IMATH_HOSTDEVICE IMATH_CONSTEXPR14 bool Interval< T >::intersects ( const Interval< T > &  interval) const
inline

Return true if the given interval is inside the interval, false otherwise.

Definition at line 211 of file ImathInterval.h.

template<class T >
IMATH_HOSTDEVICE IMATH_CONSTEXPR14 bool Interval< T >::isEmpty ( ) const
inline

Return true if the interval is empty, false otherwise. An empty interval's minimum is greater than its maximum.

Definition at line 235 of file ImathInterval.h.

template<class T >
IMATH_HOSTDEVICE IMATH_CONSTEXPR14 bool Interval< T >::isInfinite ( ) const
inline

Return true if the interval contains all points, false otherwise. An infinite box has a mimimum of std::numeric_limits<T>::lowest() and a maximum of std::numeric_limits<T>::max()

Definition at line 249 of file ImathInterval.h.

template<class T >
IMATH_HOSTDEVICE void Interval< T >::makeEmpty ( )
inline

Set the interval to be empty. An interval is empty if the minimum is greater than the maximum.

Definition at line 165 of file ImathInterval.h.

template<class T >
IMATH_HOSTDEVICE void Interval< T >::makeInfinite ( )
inline

Make the interval include the entire range of the base type.

Definition at line 173 of file ImathInterval.h.

template<class T >
IMATH_HOSTDEVICE constexpr bool Interval< T >::operator!= ( const Interval< T > &  src) const
inline

Inequality.

Definition at line 158 of file ImathInterval.h.

template<class T >
IMATH_HOSTDEVICE constexpr bool Interval< T >::operator== ( const Interval< T > &  src) const
inline

Equality.

Definition at line 151 of file ImathInterval.h.

template<class T >
IMATH_HOSTDEVICE IMATH_CONSTEXPR14 T Interval< T >::size ( void  ) const
inline

Return the size of the interval. The size is (max-min). An empty box has a size of 0.

Definition at line 218 of file ImathInterval.h.

Member Data Documentation

template<class T>
T Interval< T >::max

The minimum value of the interval.

Definition at line 36 of file ImathInterval.h.

template<class T>
T Interval< T >::min

The minimum value of the interval.

Definition at line 33 of file ImathInterval.h.


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