8 #ifndef __UT_Interval_h__
9 #define __UT_Interval_h__
47 if (order_them &&
min >
max)
74 return ((
min>=-tol) && (
min <= tol) && (
max >=-tol) && (
max <= tol));
123 SYShashCombine(h,
max);
159 template <
typename T>
161 template <
typename T>
166 if (order_them &&
min >
max)
174 template <
typename T>
183 template <
typename T>
192 template <
typename T>
202 template <
typename T>
211 template <
typename T>
221 if (t1 < t2) { tmin =
t1; tmax = t2; }
222 else { tmin = t2; tmax =
t1; }
223 if (tmax < t3) { tmax = t3; }
224 if (tmin > t3) { tmin = t3; }
225 if (tmax < t4) { tmax = t4; }
226 if (tmin > t4) { tmin = t4; }
232 template <
typename T>
244 template <
typename T>
248 if (rhs >= 0.0F) {
min *= rhs;
max *= rhs; }
252 template <
typename T>
258 template <
typename T>
266 template <
typename T>
274 template <
typename T>
284 template <
typename T>
292 template <
typename T>
301 template <
typename T>
311 template <
typename T>
324 tmax = (tmin < tmax) ? tmax : tmin;
349 tmax = (tmin < tmax) ? tmax : tmin;
362 template <
typename T>
369 else if (
min < 0.0F) {
378 template <
typename T>
386 template <
typename T>
396 else if (dmax < 0.0F)
401 template <
typename T>
411 if (dmin < dmax - wrap)
416 else if (dmax < 0.0F)
418 if (dmin - wrap < dmax)
429 template <
typename T>
438 template <
typename T>
442 return ((arg >=
min) && (arg <=
max));
445 template <
typename T>
449 return SYSisLessOrEqual(
min,
max, tol);
452 template <
typename T>
466 template <
typename T>
473 template <
typename T>
481 template <
typename T>
488 template <
typename T>
495 template <
typename T>
502 template <
typename T>
509 template <
typename T>
516 template <
typename T>
526 if (t1 < t2) { tmin =
t1; tmax = t2; }
527 else { tmin = t2; tmax =
t1; }
528 if (tmax < t3) { tmax = t3; }
529 if (tmin > t3) { tmin = t3; }
530 if (tmax < t4) { tmax = t4; }
531 if (tmin > t4) { tmin = t4; }
535 template <
typename T>
540 if (lhs > 0.0F) { tmin = lhs*rhs.
min; tmax = lhs*rhs.
max; }
541 else { tmin = lhs*rhs.
max; tmax = lhs*rhs.
min; }
545 template <
typename T>
550 if (rhs > 0.0F) { tmin = rhs*lhs.
min; tmax = rhs*lhs.
max; }
551 else { tmin = rhs*lhs.
max; tmax = rhs*lhs.
min; }
555 template <
typename T>
564 template <
typename T>
572 template <
typename T>
581 template <
typename T>
591 template <
typename T>
595 if (!rhs) rhs += 0.00001f;
600 template <
typename T>
609 template <
typename T>
620 template <
typename T>
627 #endif // __UT_Interval_h__
Mat3< typename promote< S, T >::type > operator*(S scalar, const Mat3< T > &m)
Multiply each element of the given matrix by scalar and return the result.
GLboolean GLboolean GLboolean b
void maxWith(const UT_IntervalT &rhs)
UT_IntervalT & operator+=(const UT_IntervalT &rhs)
friend std::size_t hash_value(const this_type &t)
int isValid(T tol=0.f) const
GLuint GLdouble GLdouble GLint GLint order
int equalZero(T tol=0.00001f) const
UT_IntervalT pow(T arg) const
UT_IntervalT< T > minOf(const UT_IntervalT< T > &arg0, const UT_IntervalT< T > &arg1)
bool operator!=(const UT_IntervalT &rhs) const
Mat3< typename promote< T0, T1 >::type > operator+(const Mat3< T0 > &m0, const Mat3< T1 > &m1)
Add corresponding elements of m0 and m1 and return the result.
UT_IntervalT & operator-=(const UT_IntervalT &rhs)
SYS_HashType hash() const
std::size_t SYS_HashType
Define the type for hash values.
int isEqual(const UT_IntervalT &v, T tol=0.00001f) const
SYS_API float powf(float x, float y)
GLuint GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat t1
UT_IntervalT< T > operator&(const UT_IntervalT< T > &lhs, const UT_IntervalT< T > &rhs)
UT_IntervalT< fpreal64 > UT_IntervalD
bool operator==(const UT_IntervalT &rhs) const
UT_IntervalT & operator&=(const UT_IntervalT &rhs)
UT_IntervalT< T > operator|(const UT_IntervalT< T > &lhs, const UT_IntervalT< T > &rhs)
ImageBuf OIIO_API min(Image_or_Const A, Image_or_Const B, ROI roi={}, int nthreads=0)
Mat3< typename promote< T0, T1 >::type > operator-(const Mat3< T0 > &m0, const Mat3< T1 > &m1)
Subtract corresponding elements of m0 and m1 and return the result.
void minWith(const UT_IntervalT &rhs)
UT_IntervalT< T > maxOf(const UT_IntervalT< T > &arg0, const UT_IntervalT< T > &arg1)
GLboolean GLboolean GLboolean GLboolean a
ImageBuf OIIO_API max(Image_or_Const A, Image_or_Const B, ROI roi={}, int nthreads=0)
UT_IntervalT & operator*=(const UT_IntervalT &rhs)
UT_IntervalT< T > operator/(const UT_IntervalT< T > &lhs, const UT_IntervalT< T > &rhs)
UT_IntervalT & operator|=(const UT_IntervalT &rhs)
void clampZero(T tol=0.00001f)
detail::named_arg< Char, T > arg(const Char *name, const T &arg)
UT_IntervalT< T > this_type
FMT_DEPRECATED void printf(detail::buffer< Char > &buf, basic_string_view< Char > format, basic_format_args< Context > args)
GLfloat GLfloat GLfloat GLfloat h
UT_IntervalT< fpreal > UT_IntervalR
GLuint GLuint GLuint arg1
const Type & Min(const Type &a, const Type &b)
Return the minimum of two values.
UT_IntervalT & operator/=(const UT_IntervalT &rhs)
void assign(T Min, T Max, bool order_them=false)
UT_IntervalT< float > UT_Interval
UT_IntervalT< fpreal32 > UT_IntervalF
int contains(T arg) const
void invert(UT_IntervalT &v) const
const Type & Max(const Type &a, const Type &b)
Return the maximum of two values.
void extendToContain(T a)