10 #ifndef INCLUDED_IMATHBOX_H
11 #define INCLUDED_IMATHBOX_H
18 IMATH_INTERNAL_NAMESPACE_HEADER_ENTER
118 IMATH_HOSTDEVICE IMATH_CONSTEXPR14
unsigned int majorAxis() const IMATH_NOEXCEPT;
207 min = V (V::baseTypeMax());
208 max = V (V::baseTypeLowest());
215 min = V (V::baseTypeLowest());
216 max = V (V::baseTypeMax());
223 for (
unsigned int i = 0; i <
min.dimensions(); i++)
225 if (point[i] <
min[i])
228 if (point[i] >
max[i])
237 for (
unsigned int i = 0; i <
min.dimensions(); i++)
239 if (box.min[i] <
min[i])
242 if (box.max[i] >
max[i])
251 for (
unsigned int i = 0; i <
min.dimensions(); i++)
253 if (point[i] <
min[i] || point[i] >
max[i])
264 for (
unsigned int i = 0; i <
min.dimensions(); i++)
266 if (box.max[i] <
min[i] || box.min[i] >
max[i])
294 for (
unsigned int i = 0; i <
min.dimensions(); i++)
307 for (
unsigned int i = 0; i <
min.dimensions(); i++)
309 if (
min[i] != V::baseTypeLowest() ||
max[i] != V::baseTypeMax())
320 for (
unsigned int i = 0; i <
min.dimensions(); i++)
333 unsigned int major = 0;
336 for (
unsigned int i = 1; i <
min.dimensions(); i++)
351 template <
typename V>
class Box;
438 IMATH_HOSTDEVICE IMATH_CONSTEXPR14
unsigned int majorAxis() const IMATH_NOEXCEPT;
511 if (point[0] <
min[0])
514 if (point[0] >
max[0])
517 if (point[1] <
min[1])
520 if (point[1] >
max[1])
528 if (box.min[0] <
min[0])
531 if (box.max[0] >
max[0])
534 if (box.min[1] <
min[1])
537 if (box.max[1] >
max[1])
545 if (point[0] <
min[0] || point[0] >
max[0] || point[1] <
min[1] || point[1] >
max[1])
555 if (box.max[0] <
min[0] || box.min[0] >
max[0] || box.max[1] <
min[1] || box.min[1] >
max[1])
592 if (
min[0] != std::numeric_limits<T>::lowest() ||
594 min[1] != std::numeric_limits<T>::lowest() ||
615 unsigned int major = 0;
694 IMATH_HOSTDEVICE IMATH_CONSTEXPR14
unsigned int majorAxis() const IMATH_NOEXCEPT;
765 if (point[0] <
min[0])
768 if (point[0] >
max[0])
771 if (point[1] <
min[1])
774 if (point[1] >
max[1])
777 if (point[2] <
min[2])
780 if (point[2] >
max[2])
788 if (box.min[0] <
min[0])
791 if (box.max[0] >
max[0])
794 if (box.min[1] <
min[1])
797 if (box.max[1] >
max[1])
800 if (box.min[2] <
min[2])
803 if (box.max[2] >
max[2])
811 if (point[0] <
min[0] || point[0] >
max[0] || point[1] <
min[1] || point[1] >
max[1] ||
812 point[2] <
min[2] || point[2] >
max[2])
822 if (box.max[0] <
min[0] || box.min[0] >
max[0] || box.max[1] <
min[1] || box.min[1] >
max[1] ||
823 box.max[2] <
min[2] || box.min[2] >
max[2])
860 if (
min[0] != std::numeric_limits<T>::lowest() ||
862 min[1] != std::numeric_limits<T>::lowest() ||
864 min[2] != std::numeric_limits<T>::lowest() ||
885 unsigned int major = 0;
897 IMATH_INTERNAL_NAMESPACE_HEADER_EXIT
899 #endif // INCLUDED_IMATHBOX_H
IMATH_HOSTDEVICE constexpr bool operator!=(const Box< V > &src) const IMATH_NOEXCEPT
Inequality.
Vec2< T > max
The maximum value of the box.
IMATH_HOSTDEVICE IMATH_CONSTEXPR14 V size() const IMATH_NOEXCEPT
IMATH_HOSTDEVICE IMATH_CONSTEXPR14 bool intersects(const V &point) const IMATH_NOEXCEPT
Return true if the given point is inside the box, false otherwise.
IMATH_HOSTDEVICE IMATH_CONSTEXPR14 Box() IMATH_NOEXCEPT
*get result *(waiting if necessary)*A common idiom is to fire a bunch of sub tasks at the and then *wait for them to all complete We provide a helper class
Vec2< T > min
The minimum value of the box.
IMATH_HOSTDEVICE void makeEmpty() IMATH_NOEXCEPT
IMATH_HOSTDEVICE IMATH_CONSTEXPR14 bool isEmpty() const IMATH_NOEXCEPT
IMATH_HOSTDEVICE IMATH_CONSTEXPR14 unsigned int majorAxis() const IMATH_NOEXCEPT
IMATH_HOSTDEVICE void extendBy(const V &point) IMATH_NOEXCEPT
Extend the box to include the given point.
ImageBuf OIIO_API min(Image_or_Const A, Image_or_Const B, ROI roi={}, int nthreads=0)
IMATH_HOSTDEVICE void makeInfinite() IMATH_NOEXCEPT
Make the box include the entire range of V.
IMATH_HOSTDEVICE IMATH_CONSTEXPR14 bool isInfinite() const IMATH_NOEXCEPT
V max
The maximum value of the box.
bool isInfinite(const float x)
Return true if x is an infinity value (either positive infinity or negative infinity).
Vec3< T > max
The maximum value of the box.
V min
The minimum value of the box.
Vec3< T > min
The minimum value of the box.
IMATH_HOSTDEVICE static constexpr T baseTypeMax() IMATH_NOEXCEPT
Largest possible positive value.
IMATH_HOSTDEVICE static constexpr T baseTypeMax() IMATH_NOEXCEPT
Largest possible positive value.
IMATH_HOSTDEVICE static constexpr T baseTypeLowest() IMATH_NOEXCEPT
Largest possible negative value.
IMATH_HOSTDEVICE constexpr bool operator==(const Box< V > &src) const IMATH_NOEXCEPT
Equality.
IMATH_HOSTDEVICE static constexpr T baseTypeLowest() IMATH_NOEXCEPT
Largest possible negative value.
#define IMATH_EXPORT_TEMPLATE_TYPE
ImageBuf OIIO_API max(Image_or_Const A, Image_or_Const B, ROI roi={}, int nthreads=0)
IMATH_HOSTDEVICE constexpr V center() const IMATH_NOEXCEPT
IMATH_HOSTDEVICE IMATH_CONSTEXPR14 bool hasVolume() const IMATH_NOEXCEPT
Return true if the box is larger than a single point, false otherwise.
IMATH_HOSTDEVICE IMATH_CONSTEXPR14 bool intersects(const Box< Vec3< T >> &b, const Line3< T > &r, Vec3< T > &ip) IMATH_NOEXCEPT