28 #ifndef PXR_BASE_GF_RANGE3F_H
29 #define PXR_BASE_GF_RANGE3F_H
76 _min[0] = _min[1] = _min[2] = FLT_MAX;
77 _max[0] = _max[1] = _max[2] = -FLT_MAX;
87 : _min(min), _max(max)
121 return _min[0] > _max[0] || _min[1] > _max[1] || _min[2] > _max[2];
135 return (point[0] >= _min[0] && point[0] <= _max[0]
136 && point[1] >= _min[1] && point[1] <= _max[1]
137 && point[2] >= _min[2] && point[2] <= _max[2]);
166 return ((range._max[0] < _min[0] || range._min[0] > _max[0])
167 || (range._max[1] < _min[1] || range._min[1] > _max[1])
168 || (range._max[2] < _min[2] || range._min[2] > _max[2]));
174 _FindMin(res._min,b._min);
175 _FindMax(res._max,b._max);
181 _FindMin(_min,b._min);
182 _FindMax(_max,b._max);
214 _FindMax(res._min,b._min);
215 _FindMin(res._max,b._max);
228 _FindMax(_min,b._min);
229 _FindMin(_max,b._max);
269 return *
this *= (1.0 / m);
274 return GfRange3f(_min + b._min, _max + b._max);
280 return GfRange3f(_min - b._max, _max - b._min);
299 return r * (1.0 / m);
309 return (_min == b._min && _max == b._max);
313 return !(*
this ==
b);
349 if (point[0] < dest[0]) dest[0] = point[0];
350 if (point[1] < dest[1]) dest[1] = point[1];
351 if (point[2] < dest[2]) dest[2] = point[2];
356 if (point[0] > dest[0]) dest[0] = point[0];
357 if (point[1] > dest[1]) dest[1] = point[1];
358 if (point[2] > dest[2]) dest[2] = point[2];
378 return !(*
this == other);
384 #endif // PXR_BASE_GF_RANGE3F_H
const GfRange3f & Intersection(const GfRange3f &b)
GfRange3f & operator/=(double m)
unary division.
static GfRange3f GetUnion(const GfRange3f &a, const GfRange3f &b)
Returns the smallest GfRange3f which contains both a and b.
*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
const GfRange3f & UnionWith(const GfRange3f &b)
Extend this to include b.
GfVec3f MinMaxType
Helper typedef.
static GfRange3f Intersection(const GfRange3f &a, const GfRange3f &b)
GfRange3f & operator+=(const GfRange3f &b)
unary sum.
static const size_t dimension
bool operator!=(const GfRange3f &b) const
const GfRange3f & Union(const GfVec3f &b)
const GfVec3d & GetMin() const
Returns the minimum value of the range.
GLboolean GLboolean GLboolean GLboolean a
ImageBuf OIIO_API min(Image_or_Const A, Image_or_Const B, ROI roi={}, int nthreads=0)
bool IsEmpty() const
Returns whether the range is empty (max < min).
const GfRange3f & Union(const GfRange3f &b)
const GfVec3f & GetMin() const
Returns the minimum value of the range.
bool IsInside(const GfVec3f &point) const
friend GfRange3f operator*(double m, const GfRange3f &r)
scalar multiply.
GfRange3f(const GfVec3f &min, const GfVec3f &max)
This constructor initializes the minimum and maximum points.
bool Contains(const GfVec3f &point) const
GfRange3f operator+(const GfRange3f &b) const
binary sum.
void SetMax(const GfVec3f &max)
Sets the maximum value of the range.
void ExtendBy(const GfRange3f &range)
GfRange3f & operator-=(const GfRange3f &b)
unary difference.
GF_API std::ostream & operator<<(std::ostream &, GfRange3f const &)
bool IsInside(const GfRange3f &range) const
static GF_API const GfRange3f UnitCube
The unit cube.
void SetMin(const GfVec3f &min)
Sets the minimum value of the range.
GF_API GfVec3f GetCorner(size_t i) const
const GfRange3f & IntersectWith(const GfRange3f &b)
static GfRange3f GetIntersection(const GfRange3f &a, const GfRange3f &b)
Returns a GfRange3f that describes the intersection of a and b.
float ScalarType
Scalar element type and dimension.
static GfRange3f Union(const GfRange3f &a, const GfRange3f &b)
GfRange3f & operator*=(double m)
unary multiply.
friend size_t hash_value(const GfRange3f &r)
hash.
void ExtendBy(const GfVec3f &point)
GLboolean GLboolean GLboolean b
bool Contains(const GfRange3f &range) const
const GfVec3f & GetMax() const
Returns the maximum value of the range.
static size_t Combine(Args &&...args)
Produce a hash code by combining the hash codes of several objects.
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
GfVec3f GetMidpoint() const
bool IsOutside(const GfRange3f &range) const
bool operator==(const GfRange3f &b) const
The min and max points must match exactly for equality.
GF_API GfRange3f GetOctant(size_t i) const
ImageBuf OIIO_API max(Image_or_Const A, Image_or_Const B, ROI roi={}, int nthreads=0)
#define PXR_NAMESPACE_CLOSE_SCOPE
GfVec3f::ScalarType ScalarType
GfRange3f()
The default constructor creates an empty range.
const GfVec3d & GetMax() const
Returns the maximum value of the range.
void SetEmpty()
Sets the range to an empty interval.
GF_API double GetDistanceSquared(const GfVec3f &p) const
Compute the squared distance from a point to the range.
GfRange3f operator-(const GfRange3f &b) const
binary difference.
GfVec3f GetSize() const
Returns the size of the range.
friend GfRange3f operator/(const GfRange3f &r, double m)
scalar divide.
static const size_t dimension
const GfRange3f & UnionWith(const GfVec3f &b)
Extend this to include b.