Atoms Crowd  7.0.0
Interval< T > Class Template Reference

#include <ImathInterval.h>

Public Member Functions

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

Public Attributes

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

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.

Member Function Documentation

◆ center()

template<class T >
ATOMSMATH_CONSTEXPR14 T Interval< T >::center
inlinenoexcept

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

◆ hasVolume()

template<class T >
ATOMSMATH_CONSTEXPR14 bool Interval< T >::hasVolume
inlinenoexcept

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

◆ isEmpty()

template<class T >
ATOMSMATH_CONSTEXPR14 bool Interval< T >::isEmpty
inlinenoexcept

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

◆ isInfinite()

template<class T >
ATOMSMATH_CONSTEXPR14 bool Interval< T >::isInfinite
inlinenoexcept

Return true if the interval contains all points, false otherwise. An infinite box has a mimimum of limits<t>::min and a maximum of limits<T>::max

◆ makeEmpty()

template<class T >
void Interval< T >::makeEmpty
inlinenoexcept

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


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