HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
UT_BoundingBox.h
Go to the documentation of this file.
1 /*
2  * PROPRIETARY INFORMATION. This software is proprietary to
3  * Side Effects Software Inc., and is not to be reproduced,
4  * transmitted, or disclosed in any way without written permission.
5  *
6  */
7 
8 #ifndef __UT_BoundingBox_h__
9 #define __UT_BoundingBox_h__
10 
11 #include "UT_API.h"
12 #include "UT_Assert.h"
13 #include "UT_Vector3.h"
14 #include "UT_VectorTypes.h"
15 #include <SYS/SYS_Hash.h>
16 #include <iosfwd>
17 
18 /// Axis-aligned bounding box (AABB).
19 template <typename T>
21 {
22 public:
24 
26  // Default copy constructor is fine.
27  // UT_BoundingBoxT(const UT_BoundingBoxT &);
28  UT_BoundingBoxT(T axmin, T aymin, T azmin,
29  T axmax, T aymax, T azmax)
30  {
31  setBounds(axmin, aymin, azmin, axmax, aymax, azmax);
32  }
33 
34  UT_BoundingBoxT(const UT_Vector3T<T> &lowerbound,
35  const UT_Vector3T<T> &upperbound)
36  {
37  vals[0][0] = lowerbound[0];
38  vals[0][1] = upperbound[0];
39  vals[1][0] = lowerbound[1];
40  vals[1][1] = upperbound[1];
41  vals[2][0] = lowerbound[2];
42  vals[2][1] = upperbound[2];
43  }
44 
45  template <typename S>
47  {
48  vals[0][0] = bbox.vals[0][0];
49  vals[0][1] = bbox.vals[0][1];
50  vals[1][0] = bbox.vals[1][0];
51  vals[1][1] = bbox.vals[1][1];
52  vals[2][0] = bbox.vals[2][0];
53  vals[2][1] = bbox.vals[2][1];
54  }
55 
56  template <typename S>
58  {
59  vals[0][0] = bbox.vals[0][0];
60  vals[0][1] = bbox.vals[0][1];
61  vals[1][0] = bbox.vals[1][0];
62  vals[1][1] = bbox.vals[1][1];
63  vals[2][0] = bbox.vals[2][0];
64  vals[2][1] = bbox.vals[2][1];
65  return *this;
66  }
67 
68  T operator()(unsigned m, unsigned n) const
69  {
70  UT_ASSERT_P( m < 3 && n < 2 );
71  return vals[m][n];
72  }
73  T &operator()(unsigned m, unsigned n)
74  {
75  UT_ASSERT_P( m < 3 && n < 2 );
76  return vals[m][n];
77  }
78  bool operator==(const UT_BoundingBoxT<T> &bbox) const
79  {
80  return vals[0][0] == bbox.vals[0][0] &&
81  vals[0][1] == bbox.vals[0][1] &&
82  vals[1][0] == bbox.vals[1][0] &&
83  vals[1][1] == bbox.vals[1][1] &&
84  vals[2][0] == bbox.vals[2][0] &&
85  vals[2][1] == bbox.vals[2][1];
86  }
87  bool operator!=(const UT_BoundingBoxT<T> &bbox) const
88  {
89  return !(*this == bbox);
90  }
91 
92  bool isEqual(const UT_BoundingBoxT<T> &bbox,
93  T tol = SYS_FTOLERANCE_R) const
94  {
95  return SYSisEqual(vals[0][0], bbox.vals[0][0], tol) &&
96  SYSisEqual(vals[0][1], bbox.vals[0][1], tol) &&
97  SYSisEqual(vals[1][0], bbox.vals[1][0], tol) &&
98  SYSisEqual(vals[1][1], bbox.vals[1][1], tol) &&
99  SYSisEqual(vals[2][0], bbox.vals[2][0], tol) &&
100  SYSisEqual(vals[2][1], bbox.vals[2][1], tol);
101  }
102 
103  T xmin() const { return vals[0][0]; }
104  T xmax() const { return vals[0][1]; }
105  T ymin() const { return vals[1][0]; }
106  T ymax() const { return vals[1][1]; }
107  T zmin() const { return vals[2][0]; }
108  T zmax() const { return vals[2][1]; }
109 
111  { return UT_Vector3T<T>(vals[0][0], vals[1][0], vals[2][0]); }
113  { return UT_Vector3T<T>(vals[0][1], vals[1][1], vals[2][1]); }
114 
115  int isInside(const UT_Vector3T<T> &pt) const;
116  int isInside(const UT_Vector4T<T> &pt) const;
117  int isInside(T x, T y, T z) const;
118 
119  /// Am I totally enclosed in the bounding box passed in
120  /// ("intersects" method tests for partially inside)
121  int isInside(const UT_BoundingBoxT<T> &bbox) const;
122 
123  /// Determine whether a line intersects the box. v0 is one end-point of
124  /// the line, and idir is the inverse direction vector along the line.
125  int isLineInside(const UT_Vector3T<T> &v0,
126  const UT_Vector3T<T> &idir) const;
127 
128  /// Determine the minimum distance of the box to a line segment, or 0
129  /// if the line segment overlaps the box. v0 is one end-point of the
130  /// line, and dir is the direction vector along the line. This method
131  /// conservatively underestimates the distance, so the true line/box
132  /// distance may be greater than the reported value.
133  T approxLineDist2(const UT_Vector3T<T> &v0,
134  const UT_Vector3T<T> &dir) const;
135 
136  /// Check whether the bounding box contains at least one point.
138  bool isValid() const;
140  void makeInvalid() { initBounds(); }
141 
142  /// Efficient test for an invalid bounding box (one comparison instead of
143  /// 3 for a valid bounding box). This only checks X, not Y or Z ranges, so
144  /// only works if the box is fully invalid.
146  bool isInvalidFast() const { return vals[0][0] > vals[0][1]; }
147 
148  void setBounds(T x_min, T y_min, T z_min,
149  T x_max, T y_max, T z_max)
150  {
151  vals[0][0] = x_min;
152  vals[1][0] = y_min;
153  vals[2][0] = z_min;
154  vals[0][1] = x_max;
155  vals[1][1] = y_max;
156  vals[2][1] = z_max;
157  }
158 
159  /// @{
160  /// Set/Get bounds in "serialized" fashion. The serialized order is
161  /// (xmin, xmax, ymin, ymax, zmin, zmax).
162  void setSerialized(const fpreal32 floats[6])
163  {
164  for (int i = 0; i < 6; ++i)
165  myFloats[i] = floats[i];
166  }
167  void setSerialized(const fpreal64 floats[6])
168  {
169  for (int i = 0; i < 6; ++i)
170  myFloats[i] = floats[i];
171  }
172  const T *getSerialized() const { return myFloats; }
173  /// @}
174 
175  /// @{
176  /// Access to the serialized data
177  const T *data() const { return myFloats; }
178  T *data() { return myFloats; }
179  /// @}
180 
181  /// @{
182  /// Iterate over the data serially
183  const T *begin() const { return &myFloats[0]; }
184  const T *end() const { return &myFloats[6]; }
185  T *begin() { return &myFloats[0]; }
186  T *end() { return &myFloats[6]; }
187  /// @}
188 
189  /// @{
190  /// Compute a hash
191  uint64 hash() const { return SYShashRange(begin(), end()); }
192  friend std::size_t hash_value(const this_type &t) { return t.hash(); }
193  /// @}
194 
195  /// Initialize the box to the largest size
196  void initMaxBounds();
197 
198  /// Initialize the box such that
199  /// - No points are contained in the box
200  /// - The box occupies no position in space
202  void initBounds();
203 
204  /// Initialize the bounds with the bounds given in min and max. No check
205  /// is made to ensure that min is smaller than max.
206  void initBounds(const UT_Vector3T<T> &min,
207  const UT_Vector3T<T> &max);
208 
209  /// Initialize zero-sized bounds at the location of the point given by pt.
211  void initBounds(const UT_Vector3T<T> &pt);
212 
213  /// Initialize zero-sized bounds at the location of the point given by pt.
214  void initBounds(const UT_Vector4T<T> &pt);
215 
216  /// Initialize zero-sized bounds at the location of the point defined by
217  /// x, y, and z;
219  void initBounds(T x, T y, T z);
220 
221  /// Initialize zero-sized bounds at the location of the point given by v.
222  void initBounds(const fpreal32 *v)
223  { initBounds(v[0], v[1], v[2]); }
224 
225  /// Initialize zero-sized bounds at the location of the point given by v.
226  void initBounds(const fpreal64 *v)
227  { initBounds(v[0], v[1], v[2]); }
228 
229  /// Initialize the bounds to the same as given by box.
230  void initBounds(const UT_BoundingBoxT<T> &box);
231 
232  /// Enlarge the existing bounds to encompass the bounds given by min and
233  /// max.
234  void enlargeBounds(const UT_Vector3T<T> &min,
235  const UT_Vector3T<T> &max);
236 
237  /// Enlarge the existing bounds to encompass the point given by pt.
239  void enlargeBounds(const UT_Vector3T<T> &pt);
240 
241  /// Enlarge the existing bounds to encompass the point given by pt.
242  void enlargeBounds(const UT_Vector4T<T> &pt);
243 
244  /// Enlarge the existing bounds to encompass the point defined by
245  /// x, y, and z.
247  void enlargeBounds(T x, T y, T z);
248 
249  /// Enlarge the existing bounds to encompass the point given in v.
250  void enlargeBounds(const fpreal32 *v)
251  { enlargeBounds(v[0], v[1], v[2]); }
252 
253  /// Enlarge the existing bounds to encompass the point given in v.
254  void enlargeBounds(const fpreal64 *v)
255  { enlargeBounds(v[0], v[1], v[2]); }
256 
257  /// Enlarge the existing bounds to encompass the bounds given by box.
259  void enlargeBounds(const UT_BoundingBoxT<T> &box);
260 
261  /// Expand the bounding box on all axes, as a relative fraction of the
262  /// current bbox dimensions, and/or using an absolute offset.
263  void expandBounds(T relative, T absolute);
264 
265  /// Expand the bounding box on all sides using separate absolute offsets
266  /// for each axis.
267  void expandBounds(T dltx, T dlty, T dlyz);
268 
269  /// Perform a minimal enlargement of the floating point values in this
270  /// bounding box. This enlargement guarantees that the new floating
271  /// point values are always different from the prior ones. The number
272  /// of mantissa bits to be changed can be adjusted using the bits
273  /// parameter, and a minimum enlargement amount can be specified in min.
274  void enlargeFloats(int bits = 1, T min = 1e-5);
275 
276  /// Find the intersections of two bounding boxes
277  void clipBounds(const UT_BoundingBoxT<T> &box);
278 
279  /// Splits a box into two disjoint subboxes at the given splitting
280  /// point. This box is set to the left subbox for splitLeft() and the
281  /// right subbox for splitRight().
282  void splitLeft(UT_BoundingBoxT<T> &box, int axis, T split)
283  {
284  box = *this;
285  box.vals[axis][0] = split;
286  vals[axis][1] = split;
287  }
288  void splitRight(UT_BoundingBoxT<T> &box, int axis, T split)
289  {
290  box = *this;
291  box.vals[axis][1] = split;
292  vals[axis][0] = split;
293  }
294 
295  template <typename MATRIX>
296  void transform(const MATRIX &mat);
297  template <typename MATRIX>
298  void transform(const MATRIX &mat,
299  UT_BoundingBoxT<T> &newbbox) const;
300 
301  /// Adds the given translate to each component of the bounding box.
302  void translate(const UT_Vector3T<T> &delta);
303 
304  T xsize() const { return sizeX(); }
305  T ysize() const { return sizeY(); }
306  T zsize() const { return sizeZ(); }
307  T sizeX() const { return vals[0][1] - vals[0][0]; }
308  T sizeY() const { return vals[1][1] - vals[1][0]; }
309  T sizeZ() const { return vals[2][1] - vals[2][0]; }
310 
312  { return UT_Vector3T<T>(vals[0][1] - vals[0][0],
313  vals[1][1] - vals[1][0],
314  vals[2][1] - vals[2][0]); }
315  T sizeAxis(int axis) const
316  {
317  UT_ASSERT(axis >= 0 && axis < 3);
318  return vals[axis][1] - vals[axis][0];
319  }
320 
321  /// Return the size of the largest dimension
322  T sizeMax() const;
323  /// Return the size of the largest dimension, and store the dimension
324  /// index in "axis"
325  T sizeMax(int &axis) const;
326  /// Returns the minimum delta vector from the point to the bounding
327  /// box or between two bounding boxes.
328  UT_Vector3T<T> minDistDelta(const UT_Vector3T<T> &p) const;
329  UT_Vector3T<T> minDistDelta(const UT_BoundingBoxT<T> &box) const;
330  /// Returns minimum distance from point to bounding box squared.
331  /// Returns 0 if point in bouding box.
332  T minDist2(const UT_Vector3T<T> &p) const
333  { return minDistDelta(p).length2(); }
334  /// Minimum disance between two bboxes squared.
335  T minDist2(const UT_BoundingBoxT<T> &box) const
336  { return minDistDelta(box).length2(); }
337 
338  /// Returns the smallest absolute translation from this to box that
339  /// produces the maximum overlap between the two boxes.
340  UT_Vector3T<T> minDistToMaxOverlap(const UT_BoundingBoxT<T> &box) const;
341 
342  /// Returns the radius of a sphere that would fully enclose the box.
343  T getRadius() const { return 0.5*size().length(); }
344 
345  /// Finds the out code of the point relative to this box:
346  int getOutCode(const UT_Vector3T<T> &pt) const;
347 
348  T xcenter() const { return centerX(); }
349  T ycenter() const { return centerY(); }
350  T zcenter() const { return centerZ(); }
351  T centerX() const { return (vals[0][0] + vals[0][1])*0.5; }
352  T centerY() const { return (vals[1][0] + vals[1][1])*0.5; }
353  T centerZ() const { return (vals[2][0] + vals[2][1])*0.5; }
354  T centerAxis(int axis) const
355  { return (vals[axis][0] + vals[axis][1])*0.5; }
357  { return UT_Vector3T<T>((vals[0][0] + vals[0][1])*0.5,
358  (vals[1][0] + vals[1][1])*0.5,
359  (vals[2][0] + vals[2][1])*0.5); }
360 
361  T area() const;
362  T volume() const { return xsize()*ysize()*zsize(); }
363  void addToMin(const UT_Vector3T<T> &vec);
364  void addToMax(const UT_Vector3T<T> &vec);
365 
366  /// Scale then offset a bounding box.
367  void scaleOffset(const UT_Vector3T<T> &scale,
368  const UT_Vector3T<T> &offset);
369  int maxAxis() const;
370  int minAxis() const;
371 
372  /// Intersect a ray with the box. Returns 0 if no intersection found.
373  /// distance will be set to the intersection distance (between 0 & tmax)
374  /// The normal will also be set. The direction of the normal is
375  /// indeterminant (to fix it, you might want to dot(dir, *nml) to check
376  /// the orientation.
377  int intersectRay(const UT_Vector3T<T> &org,
378  const UT_Vector3T<T> &dir,
379  T tmax=1E17F,
380  T *distance=0, UT_Vector3T<T> *nml=0) const;
381  int intersectRange(const UT_Vector3T<T> &org,
382  const UT_Vector3T<T> &dir,
383  T &min, T &max) const;
384 
385  /// This determines if the tube, capped at distances tmin & tmax,
386  /// intersects this.
387  int intersectTube(const UT_Vector3T<T> &org,
388  const UT_Vector3T<T> &dir,
389  T radius,
390  T tmin=-1E17f, T tmax=1E17f) const;
391 
392  int intersects(const UT_BoundingBoxT<T> &box) const;
393 
394  /// Changes the bounds to be those of the intersection of this box
395  /// and the supplied BBox. Returns 1 if intersects, 0 otherwise.
396  int computeIntersection(const UT_BoundingBoxT<T> &box);
397 
398  /// Here's the data for the bounding box
399  union {
400  T vals[3][2];
401  T myFloats[6];
402  };
403 
404  void getBBoxPoints(UT_Vector3T<T> (&ptarray)[8]) const;
405  void getBBoxPoints(UT_Vector4T<T> (&ptarray)[8]) const;
406  template <typename MATRIX>
407  int getBBoxPoints(UT_Vector3T<T> (&ptarray)[8],
408  const MATRIX &transform_matrix) const;
409 
410  /// Dump the bounding box to stderr. The msg is printed before the bounds
411  void dump(const char *msg=0) const;
412  /// Dump the bounding box geometry to a draw file
413  void dumpGeo(FILE *fp) const;
414 
415  /// @{
416  /// Methods to serialize to a JSON stream. The vector is stored as an
417  /// array of 6 reals (xmin, xmax, ymin, ymax, zmin, zmax)
418  bool save(UT_JSONWriter &w) const;
419  bool save(UT_JSONValue &v) const;
420  bool load(UT_JSONParser &p);
421  /// @}
422 
423 
424 protected:
425  friend
426  std::ostream &operator<<(std::ostream &os, const UT_BoundingBoxT<T> &box)
427  {
428  box.outTo(os);
429  return os;
430  }
431 
432  void outTo(std::ostream &os) const;
433  // Ugly helper function to allow instantation with int64.
434  static bool SYSisEqual(int64 a, int64 b, int64) { return a==b; }
435 };
436 
437 template <typename T>
438 UT_API size_t format(char *buf, size_t bufsize, const UT_BoundingBoxT<T> &v);
439 
440 template <typename T>
441 bool
443 {
444  return vals[0][0] <= vals[0][1] &&
445  vals[1][0] <= vals[1][1] &&
446  vals[2][0] <= vals[2][1];
447 }
448 
449 template <typename T>
450 void
452 {
453  // Initialize with min and max reversed, so that it's empty
454  const T maxv = 0.5*std::numeric_limits<T>::max();
455  const T minv = -maxv;
456  vals[0][0] = maxv;
457  vals[0][1] = minv;
458  vals[1][0] = maxv;
459  vals[1][1] = minv;
460  vals[2][0] = maxv;
461  vals[2][1] = minv;
462 }
463 
464 template <typename T>
465 void
467 {
468  vals[0][0] = pt.x();
469  vals[0][1] = pt.x();
470  vals[1][0] = pt.y();
471  vals[1][1] = pt.y();
472  vals[2][0] = pt.z();
473  vals[2][1] = pt.z();
474 }
475 
476 template <typename T>
477 void
479 {
480  vals[0][0] = x;
481  vals[0][1] = x;
482  vals[1][0] = y;
483  vals[1][1] = y;
484  vals[2][0] = z;
485  vals[2][1] = z;
486 }
487 
488 template <typename T>
489 void
491 {
492  vals[0][0] = SYSmin(vals[0][0], pt.x());
493  vals[0][1] = SYSmax(vals[0][1], pt.x());
494  vals[1][0] = SYSmin(vals[1][0], pt.y());
495  vals[1][1] = SYSmax(vals[1][1], pt.y());
496  vals[2][0] = SYSmin(vals[2][0], pt.z());
497  vals[2][1] = SYSmax(vals[2][1], pt.z());
498 }
499 
500 template <typename T>
501 void
503 {
504  vals[0][0] = SYSmin(vals[0][0], x);
505  vals[0][1] = SYSmax(vals[0][1], x);
506  vals[1][0] = SYSmin(vals[1][0], y);
507  vals[1][1] = SYSmax(vals[1][1], y);
508  vals[2][0] = SYSmin(vals[2][0], z);
509  vals[2][1] = SYSmax(vals[2][1], z);
510 }
511 
512 template <typename T>
513 void
515 {
516  vals[0][0] = SYSmin(vals[0][0], box(0, 0));
517  vals[0][1] = SYSmax(vals[0][1], box(0, 1));
518  vals[1][0] = SYSmin(vals[1][0], box(1, 0));
519  vals[1][1] = SYSmax(vals[1][1], box(1, 1));
520  vals[2][0] = SYSmin(vals[2][0], box(2, 0));
521  vals[2][1] = SYSmax(vals[2][1], box(2, 1));
522 }
523 
529 
530 #endif
#define SYSmax(a, b)
Definition: SYS_Math.h:1365
UT_BoundingBoxT< fpreal > UT_BoundingBoxR
bool operator==(const UT_BoundingBoxT< T > &bbox) const
GLenum GLuint GLsizei bufsize
Definition: glcorearb.h:1817
T zsize() const
UT_BoundingBoxT< float > UT_BoundingBox
T centerZ() const
T minDist2(const UT_Vector3T< T > &p) const
SYS_FORCE_INLINE void makeInvalid()
Axis-aligned bounding box (AABB).
Definition: GEO_Detail.h:43
const hboost::disable_if_c< VecTraits< T >::IsVec, T >::type & min(const T &a, const T &b)
Definition: Composite.h:128
const GLdouble * v
Definition: glcorearb.h:836
const T * end() const
T centerY() const
GLdouble GLdouble GLdouble z
Definition: glcorearb.h:847
UT_Vector3T< T > maxvec() const
GLboolean GLboolean GLboolean GLboolean a
Definition: glcorearb.h:1221
JSON reader class which handles parsing of JSON or bJSON files.
Definition: UT_JSONParser.h:72
#define UT_API
Definition: UT_API.h:12
void setBounds(T x_min, T y_min, T z_min, T x_max, T y_max, T z_max)
T ycenter() const
GLint y
Definition: glcorearb.h:102
Class which writes ASCII or binary JSON streams.
Definition: UT_JSONWriter.h:32
T ysize() const
SYS_FORCE_INLINE T & x(void)
Definition: UT_Vector3.h:581
3D Vector class.
4D Vector class.
Definition: UT_Vector4.h:152
SYS_FORCE_INLINE bool isInvalidFast() const
T sizeAxis(int axis) const
png_uint_32 i
Definition: png.h:2877
GLsizeiptr size
Definition: glcorearb.h:663
T sizeY() const
#define UT_ASSERT_P(ZZ)
Definition: UT_Assert.h:101
void initBounds(const fpreal64 *v)
Initialize zero-sized bounds at the location of the point given by v.
UT_BoundingBoxT & operator=(const UT_BoundingBoxT< S > &bbox)
const hboost::disable_if_c< VecTraits< T >::IsVec, T >::type & max(const T &a, const T &b)
Definition: Composite.h:132
SYS_FORCE_INLINE T & z(void)
Definition: UT_Vector3.h:585
long long int64
Definition: SYS_Types.h:106
GA_API const UT_StringHolder scale
T & operator()(unsigned m, unsigned n)
png_FILE_p fp
Definition: png.h:2028
GLdouble n
Definition: glcorearb.h:2007
void setSerialized(const fpreal64 floats[6])
const T * data() const
unsigned long long uint64
Definition: SYS_Types.h:107
bool operator!=(const UT_BoundingBoxT< T > &bbox) const
UT_Vector3T< T > center() const
#define UT_ASSERT(ZZ)
Definition: UT_Assert.h:102
UT_BoundingBoxT(const UT_Vector3T< T > &lowerbound, const UT_Vector3T< T > &upperbound)
T distance(const UT_Vector4T< T > &v1, const UT_Vector4T< T > &v2)
Definition: UT_Vector4.h:634
double fpreal64
Definition: SYS_Types.h:191
GLuint GLuint end
Definition: glcorearb.h:474
#define SYS_FORCE_INLINE
Definition: SYS_Inline.h:45
GLintptr offset
Definition: glcorearb.h:664
void enlargeBounds(const fpreal32 *v)
Enlarge the existing bounds to encompass the point given in v.
UT_API size_t format(char *buf, size_t bufsize, const UT_BoundingBoxT< T > &v)
T minDist2(const UT_BoundingBoxT< T > &box) const
Minimum disance between two bboxes squared.
GLboolean GLboolean GLboolean b
Definition: glcorearb.h:1221
void enlargeBounds(const UT_Vector3T< T > &min, const UT_Vector3T< T > &max)
GA_API const UT_StringHolder transform
T xsize() const
uint64 hash() const
UT_Vector3T< T > size() const
UT_BoundingBoxT< fpreal32 > UT_BoundingBoxF
const T * getSerialized() const
GLfloat v0
Definition: glcorearb.h:815
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glcorearb.h:2539
void setSerialized(const fpreal32 floats[6])
T volume() const
T zcenter() const
SYS_FORCE_INLINE T & y(void)
Definition: UT_Vector3.h:583
T getRadius() const
Returns the radius of a sphere that would fully enclose the box.
void enlargeBounds(const fpreal64 *v)
Enlarge the existing bounds to encompass the point given in v.
T operator()(unsigned m, unsigned n) const
SYS_FORCE_INLINE bool isValid() const
Check whether the bounding box contains at least one point.
UT_Vector3T< T > minvec() const
#define SYS_FTOLERANCE_R
Definition: SYS_Types.h:275
T sizeZ() const
bool intersects(const Box< Vec3< T > > &b, const Line3< T > &r, Vec3< T > &ip)
Definition: ImathBoxAlgo.h:728
UT_BoundingBoxT< fpreal64 > UT_BoundingBoxD
void splitRight(UT_BoundingBoxT< T > &box, int axis, T split)
GLint GLenum GLint x
Definition: glcorearb.h:408
SYS_FORCE_INLINE void initBounds()
T centerX() const
Class to store JSON objects as C++ objects.
Definition: UT_JSONValue.h:75
void splitLeft(UT_BoundingBoxT< T > &box, int axis, T split)
UT_BoundingBoxT(T axmin, T aymin, T azmin, T axmax, T aymax, T azmax)
GLubyte GLubyte GLubyte GLubyte w
Definition: glcorearb.h:856
T xcenter() const
friend std::size_t hash_value(const this_type &t)
UT_BoundingBoxT(const UT_BoundingBoxT< S > &bbox)
UT_BoundingBoxT< T > this_type
#define SYSmin(a, b)
Definition: SYS_Math.h:1366
void initBounds(const fpreal32 *v)
Initialize zero-sized bounds at the location of the point given by v.
static bool SYSisEqual(int64 a, int64 b, int64)
float fpreal32
Definition: SYS_Types.h:190
T centerAxis(int axis) const
const T * begin() const
UT_BoundingBoxT< int64 > UT_BoundingBoxI
T sizeX() const
GA_API const UT_StringHolder area
bool isEqual(const UT_BoundingBoxT< T > &bbox, T tol=SYS_FTOLERANCE_R) const