Atoms Crowd  7.0.0
Box< Vec2< T > > Class Template Reference

#include <ImathBox.h>

Public Member Functions

Constructors and Assignment
ATOMSMATH_HOSTDEVICE ATOMSMATH_CONSTEXPR14 Box () noexcept
 Empty by default.
 
ATOMSMATH_HOSTDEVICE ATOMSMATH_CONSTEXPR14 Box (const Vec2< T > &point) noexcept
 Construct a bounding box that contains a single point.
 
ATOMSMATH_HOSTDEVICE ATOMSMATH_CONSTEXPR14 Box (const Vec2< T > &minT, const Vec2< T > &maxT) noexcept
 Construct a bounding box with the given minimum and maximum points.
 
Comparison
constexpr ATOMSMATH_HOSTDEVICE bool operator== (const Box< Vec2< T >> &src) const noexcept
 Equality.
 
constexpr ATOMSMATH_HOSTDEVICE bool operator!= (const Box< Vec2< T >> &src) const noexcept
 Inequality.
 
Manipulation
ATOMSMATH_HOSTDEVICE void makeEmpty () noexcept
 
ATOMSMATH_HOSTDEVICE void extendBy (const Vec2< T > &point) noexcept
 Extend the Box to include the given point.
 
ATOMSMATH_HOSTDEVICE void extendBy (const Box< Vec2< T >> &box) noexcept
 Extend the Box to include the given box.
 
ATOMSMATH_HOSTDEVICE void makeInfinite () noexcept
 Make the box include the entire range of T.
 
Query
ATOMSMATH_HOSTDEVICE ATOMSMATH_CONSTEXPR14 Vec2< T > size () const noexcept
 
constexpr ATOMSMATH_HOSTDEVICE Vec2< T > center () const noexcept
 
ATOMSMATH_HOSTDEVICE ATOMSMATH_CONSTEXPR14 bool intersects (const Vec2< T > &point) const noexcept
 Return true if the given point is inside the box, false otherwise.
 
ATOMSMATH_HOSTDEVICE ATOMSMATH_CONSTEXPR14 bool intersects (const Box< Vec2< T >> &box) const noexcept
 Return true if the given box is inside the box, false otherwise.
 
ATOMSMATH_HOSTDEVICE ATOMSMATH_CONSTEXPR14 unsigned int majorAxis () const noexcept
 
ATOMSMATH_HOSTDEVICE ATOMSMATH_CONSTEXPR14 bool isEmpty () const noexcept
 
ATOMSMATH_HOSTDEVICE ATOMSMATH_CONSTEXPR14 bool hasVolume () const noexcept
 Return true if the box is larger than a single point, false otherwise.
 
ATOMSMATH_HOSTDEVICE ATOMSMATH_CONSTEXPR14 bool isInfinite () const noexcept
 

Public Attributes

Direct access to bounds
Vec2< T > min
 The minimum value of the box.
 
Vec2< T > max
 The maximum value of the box.
 

Detailed Description

template<class T>
class Box< Vec2< T > >

The Box<Vec2<T>> template represents a 2D bounding box defined by minimum and maximum values of type Vec2<T>. The min and max members are public.

Member Function Documentation

◆ center()

template<class T >
constexpr Vec2< T > Box< Vec2< T > >::center
inlineconstexprnoexcept

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

◆ isEmpty()

template<class T >
ATOMSMATH_CONSTEXPR14 bool Box< Vec2< T > >::isEmpty
inlinenoexcept

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

◆ isInfinite()

template<class T >
ATOMSMATH_CONSTEXPR14 bool Box< Vec2< T > >::isInfinite
inlinenoexcept

Return true if the box contains all points, false otherwise. An infinite box has a mimimum of V::baseTypeMin() and a maximum of V::baseTypeMax().

◆ majorAxis()

template<class T >
ATOMSMATH_CONSTEXPR14 unsigned int Box< Vec2< T > >::majorAxis
inlinenoexcept

Return the major axis of the box. The major axis is the dimension with the greatest difference between maximum and minimum.

◆ makeEmpty()

template<class T >
void Box< Vec2< T > >::makeEmpty
inlinenoexcept

Set the Box to be empty. A Box is empty if the mimimum is greater than the maximum. makeEmpty() sets the mimimum to ‘limits<T>::max()’ and the maximum to limits<T>::min().

◆ size()

template<class T >
ATOMSMATH_CONSTEXPR14 Vec2< T > Box< Vec2< T > >::size
inlinenoexcept

Return the size of the box. The size is of type V, defined as (max-min). An empty box has a size of V(0), i.e. 0 in each dimension.


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