HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
UT_BoundingBoxT< T > Class Template Reference

Axis-aligned bounding box (AABB). More...

#include <GEO_Detail.h>

Public Types

using this_type = UT_BoundingBoxT< T >
 

Public Member Functions

 UT_BoundingBoxT ()
 
 UT_BoundingBoxT (T axmin, T aymin, T azmin, T axmax, T aymax, T azmax)
 
 UT_BoundingBoxT (const UT_Vector3T< T > &lowerbound, const UT_Vector3T< T > &upperbound)
 
template<typename S >
 UT_BoundingBoxT (const UT_BoundingBoxT< S > &bbox)
 
template<typename S >
UT_BoundingBoxToperator= (const UT_BoundingBoxT< S > &bbox)
 
T operator() (unsigned m, unsigned n) const
 
Toperator() (unsigned m, unsigned n)
 
bool operator== (const UT_BoundingBoxT< T > &bbox) const
 
bool operator!= (const UT_BoundingBoxT< T > &bbox) const
 
bool isEqual (const UT_BoundingBoxT< T > &bbox, T tol=SYS_FTOLERANCE_R) const
 
T xmin () const
 
T xmax () const
 
T ymin () const
 
T ymax () const
 
T zmin () const
 
T zmax () const
 
UT_Vector3T< Tminvec () const
 
UT_Vector3T< Tmaxvec () const
 
int isInside (const UT_Vector3T< T > &pt) const
 
int isInside (const UT_Vector4T< T > &pt) const
 
int isInside (T x, T y, T z) const
 
int isInside (const UT_BoundingBoxT< T > &bbox) const
 
int isLineInside (const UT_Vector3T< T > &v0, const UT_Vector3T< T > &idir) const
 
T approxLineDist2 (const UT_Vector3T< T > &v0, const UT_Vector3T< T > &dir) const
 
SYS_FORCE_INLINE bool isValid () const
 Check whether the bounding box contains at least one point. More...
 
SYS_FORCE_INLINE void makeInvalid ()
 
SYS_FORCE_INLINE bool isInvalidFast () const
 
void setBounds (T x_min, T y_min, T z_min, T x_max, T y_max, T z_max)
 
SYS_FORCE_INLINE bool hasVolume () const
 
void initMaxBounds ()
 Initialize the box to the largest size. More...
 
SYS_FORCE_INLINE void initBounds ()
 
void initBounds (const UT_Vector3T< T > &min, const UT_Vector3T< T > &max)
 
SYS_FORCE_INLINE void initBounds (const UT_Vector3T< T > &pt)
 Initialize zero-sized bounds at the location of the point given by pt. More...
 
void initBounds (const UT_Vector4T< T > &pt)
 Initialize zero-sized bounds at the location of the point given by pt. More...
 
SYS_FORCE_INLINE void initBounds (T x, T y, T z)
 
void initBounds (const fpreal32 *v)
 Initialize zero-sized bounds at the location of the point given by v. More...
 
void initBounds (const fpreal64 *v)
 Initialize zero-sized bounds at the location of the point given by v. More...
 
void initBounds (const UT_BoundingBoxT< T > &box)
 Initialize the bounds to the same as given by box. More...
 
void enlargeBounds (const UT_Vector3T< T > &min, const UT_Vector3T< T > &max)
 
SYS_FORCE_INLINE void enlargeBounds (const UT_Vector3T< T > &pt)
 Enlarge the existing bounds to encompass the point given by pt. More...
 
void enlargeBounds (const UT_Vector4T< T > &pt)
 Enlarge the existing bounds to encompass the point given by pt. More...
 
SYS_FORCE_INLINE void enlargeBounds (T x, T y, T z)
 
void enlargeBounds (const fpreal32 *v)
 Enlarge the existing bounds to encompass the point given in v. More...
 
void enlargeBounds (const fpreal64 *v)
 Enlarge the existing bounds to encompass the point given in v. More...
 
SYS_FORCE_INLINE void enlargeBounds (const UT_BoundingBoxT< T > &box)
 Enlarge the existing bounds to encompass the bounds given by box. More...
 
SYS_FORCE_INLINE void expandBounds (T relative, T absolute)
 
SYS_FORCE_INLINE void expandBounds (T dltx, T dlty, T dlyz)
 
void enlargeFloats (int bits=1, T min=1e-5)
 
void clipBounds (const UT_BoundingBoxT< T > &box)
 Find the intersections of two bounding boxes. More...
 
void splitLeft (UT_BoundingBoxT< T > &box, int axis, T split)
 
void splitRight (UT_BoundingBoxT< T > &box, int axis, T split)
 
template<typename MATRIX >
void transform (const MATRIX &mat)
 
template<typename MATRIX >
void transform (const MATRIX &mat, UT_BoundingBoxT< T > &newbbox) const
 
void translate (const UT_Vector3T< T > &delta)
 Adds the given translate to each component of the bounding box. More...
 
T xsize () const
 
T ysize () const
 
T zsize () const
 
T sizeX () const
 
T sizeY () const
 
T sizeZ () const
 
UT_Vector3T< Tsize () const
 
T sizeAxis (int axis) const
 
T sizeMax () const
 Return the size of the largest dimension. More...
 
T sizeMax (int &axis) const
 
UT_Vector3T< TminDistDelta (const UT_Vector3T< T > &p) const
 
UT_Vector3T< TminDistDelta (const UT_BoundingBoxT< T > &box) const
 
UT_Vector3T< TmaxDistDelta (const UT_Vector3T< T > &p) const
 Returns the maximum delta vector from the bounding box to the point. More...
 
T minDist2 (const UT_Vector3T< T > &p) const
 
T minDist2 (const UT_BoundingBoxT< T > &box) const
 Minimum disance between two bboxes squared. More...
 
T maxDist2 (const UT_Vector3T< T > &p) const
 Returns maximum distance between point and bounding box squared. More...
 
UT_Vector3T< TminDistToMaxOverlap (const UT_BoundingBoxT< T > &box) const
 
T getRadius () const
 Returns the radius of a sphere that would fully enclose the box. More...
 
int getOutCode (const UT_Vector3T< T > &pt) const
 Finds the out code of the point relative to this box: More...
 
T xcenter () const
 
T ycenter () const
 
T zcenter () const
 
T centerX () const
 
T centerY () const
 
T centerZ () const
 
T centerAxis (int axis) const
 
UT_Vector3T< Tcenter () const
 
T area () const
 
T volume () const
 
void addToMin (const UT_Vector3T< T > &vec)
 
void addToMax (const UT_Vector3T< T > &vec)
 
void scaleOffset (const UT_Vector3T< T > &scale, const UT_Vector3T< T > &offset)
 Scale then offset a bounding box. More...
 
int maxAxis () const
 
int minAxis () const
 
int intersectRay (const UT_Vector3T< T > &org, const UT_Vector3T< T > &dir, T tmax=1E17F, T *distance=0, UT_Vector3T< T > *nml=0) const
 
int intersectRange (const UT_Vector3T< T > &org, const UT_Vector3T< T > &dir, T &min, T &max) const
 
int intersectTube (const UT_Vector3T< T > &org, const UT_Vector3T< T > &dir, T radius, T tmin=-1E17f, T tmax=1E17f) const
 
int intersects (const UT_BoundingBoxT< T > &box) const
 
int computeIntersection (const UT_BoundingBoxT< T > &box)
 
void getBBoxPoints (UT_Vector3T< T >(&ptarray)[8]) const
 
void getBBoxPoints (UT_Vector4T< T >(&ptarray)[8]) const
 
template<typename MATRIX >
int getBBoxPoints (UT_Vector3T< T >(&ptarray)[8], const MATRIX &transform_matrix) const
 
UT_API bool triangleIntersects (const UT_Vector3T< T > &v0, const UT_Vector3T< T > &v1, const UT_Vector3T< T > &v2) const
 
UT_API void dump (const char *msg=0) const
 Dump the bounding box to stderr. The msg is printed before the bounds. More...
 
UT_API void dumpGeo (FILE *fp) const
 Dump the bounding box geometry to a draw file. More...
 
template<>
void enlargeFloats (int bits, int64 min)
 
void setSerialized (const fpreal32 floats[6])
 
void setSerialized (const fpreal64 floats[6])
 
const TgetSerialized () const
 
const Tdata () const
 
Tdata ()
 
const Tbegin () const
 
const Tend () const
 
Tbegin ()
 
Tend ()
 
UT_API bool save (UT_JSONWriter &w) const
 
UT_API bool save (UT_JSONValue &v) const
 
UT_API bool load (UT_JSONParser &p)
 

Public Attributes

union {
   T   vals [3][2]
 
   T   myFloats [6]
 
}; 
 Here's the data for the bounding box. More...
 

Protected Member Functions

UT_API void outTo (std::ostream &os) const
 

Static Protected Member Functions

static bool SYSisEqual (int64 a, int64 b, int64)
 

Friends

std::ostream & operator<< (std::ostream &os, const UT_BoundingBoxT< T > &box)
 
uint64 hash () const
 Compute UT_BoundingBox hash. More...
 
std::size_t hash_value (const this_type &t)
 Compute UT_BoundingBox hash. More...
 

Detailed Description

template<typename T>
class UT_BoundingBoxT< T >

Axis-aligned bounding box (AABB).

Definition at line 41 of file GEO_Detail.h.

Member Typedef Documentation

template<typename T>
using UT_BoundingBoxT< T >::this_type = UT_BoundingBoxT<T>

Definition at line 31 of file UT_BoundingBox.h.

Constructor & Destructor Documentation

template<typename T>
UT_BoundingBoxT< T >::UT_BoundingBoxT ( )
inline

Definition at line 33 of file UT_BoundingBox.h.

template<typename T>
UT_BoundingBoxT< T >::UT_BoundingBoxT ( T  axmin,
T  aymin,
T  azmin,
T  axmax,
T  aymax,
T  azmax 
)
inline

Definition at line 36 of file UT_BoundingBox.h.

template<typename T>
UT_BoundingBoxT< T >::UT_BoundingBoxT ( const UT_Vector3T< T > &  lowerbound,
const UT_Vector3T< T > &  upperbound 
)
inline

Definition at line 42 of file UT_BoundingBox.h.

template<typename T>
template<typename S >
UT_BoundingBoxT< T >::UT_BoundingBoxT ( const UT_BoundingBoxT< S > &  bbox)
inline

Definition at line 54 of file UT_BoundingBox.h.

Member Function Documentation

template<typename T>
void UT_BoundingBoxT< T >::addToMax ( const UT_Vector3T< T > &  vec)
inline

Definition at line 1174 of file UT_BoundingBox.h.

template<typename T>
void UT_BoundingBoxT< T >::addToMin ( const UT_Vector3T< T > &  vec)
inline

Definition at line 1165 of file UT_BoundingBox.h.

template<typename T>
T UT_BoundingBoxT< T >::approxLineDist2 ( const UT_Vector3T< T > &  v0,
const UT_Vector3T< T > &  dir 
) const
inline

Determine the minimum distance of the box to a line segment, or 0 if the line segment overlaps the box. v0 is one end-point of the line, and dir is the direction vector along the line. This method conservatively underestimates the distance, so the true line/box distance may be greater than the reported value.

Definition at line 702 of file UT_BoundingBox.h.

template<typename T >
T UT_BoundingBoxT< T >::area ( ) const
inline

Definition at line 1155 of file UT_BoundingBox.h.

template<typename T>
const T* UT_BoundingBoxT< T >::begin ( void  ) const
inline

Iterate over the data serially

Definition at line 199 of file UT_BoundingBox.h.

template<typename T>
T* UT_BoundingBoxT< T >::begin ( void  )
inline

Iterate over the data serially

Definition at line 201 of file UT_BoundingBox.h.

template<typename T>
UT_Vector3T<T> UT_BoundingBoxT< T >::center ( ) const
inline

Definition at line 379 of file UT_BoundingBox.h.

template<typename T>
T UT_BoundingBoxT< T >::centerAxis ( int  axis) const
inline

Definition at line 377 of file UT_BoundingBox.h.

template<typename T>
T UT_BoundingBoxT< T >::centerX ( ) const
inline

Definition at line 374 of file UT_BoundingBox.h.

template<typename T>
T UT_BoundingBoxT< T >::centerY ( ) const
inline

Definition at line 375 of file UT_BoundingBox.h.

template<typename T>
T UT_BoundingBoxT< T >::centerZ ( ) const
inline

Definition at line 376 of file UT_BoundingBox.h.

template<typename T>
void UT_BoundingBoxT< T >::clipBounds ( const UT_BoundingBoxT< T > &  box)
inline

Find the intersections of two bounding boxes.

Definition at line 831 of file UT_BoundingBox.h.

template<typename T>
int UT_BoundingBoxT< T >::computeIntersection ( const UT_BoundingBoxT< T > &  box)
inline

Changes the bounds to be those of the intersection of this box and the supplied BBox. Returns 1 if intersects, 0 otherwise.

Definition at line 654 of file UT_BoundingBox.h.

template<typename T>
const T* UT_BoundingBoxT< T >::data ( ) const
inline

Access to the serialized data

Definition at line 193 of file UT_BoundingBox.h.

template<typename T>
T* UT_BoundingBoxT< T >::data ( )
inline

Access to the serialized data

Definition at line 194 of file UT_BoundingBox.h.

template<typename T>
UT_API void UT_BoundingBoxT< T >::dump ( const char *  msg = 0) const

Dump the bounding box to stderr. The msg is printed before the bounds.

template<typename T>
UT_API void UT_BoundingBoxT< T >::dumpGeo ( FILE *  fp) const

Dump the bounding box geometry to a draw file.

template<typename T>
const T* UT_BoundingBoxT< T >::end ( void  ) const
inline

Iterate over the data serially

Definition at line 200 of file UT_BoundingBox.h.

template<typename T>
T* UT_BoundingBoxT< T >::end ( void  )
inline

Iterate over the data serially

Definition at line 202 of file UT_BoundingBox.h.

template<typename T>
void UT_BoundingBoxT< T >::enlargeBounds ( const UT_Vector3T< T > &  min,
const UT_Vector3T< T > &  max 
)
inline

Enlarge the existing bounds to encompass the bounds given by min and max.

Definition at line 756 of file UT_BoundingBox.h.

template<typename T>
void UT_BoundingBoxT< T >::enlargeBounds ( const UT_Vector3T< T > &  pt)
inline

Enlarge the existing bounds to encompass the point given by pt.

Definition at line 543 of file UT_BoundingBox.h.

template<typename T>
void UT_BoundingBoxT< T >::enlargeBounds ( const UT_Vector4T< T > &  pt)
inline

Enlarge the existing bounds to encompass the point given by pt.

Definition at line 769 of file UT_BoundingBox.h.

template<typename T>
void UT_BoundingBoxT< T >::enlargeBounds ( T  x,
T  y,
T  z 
)
inline

Enlarge the existing bounds to encompass the point defined by x, y, and z.

Definition at line 555 of file UT_BoundingBox.h.

template<typename T>
void UT_BoundingBoxT< T >::enlargeBounds ( const fpreal32 v)
inline

Enlarge the existing bounds to encompass the point given in v.

Definition at line 266 of file UT_BoundingBox.h.

template<typename T>
void UT_BoundingBoxT< T >::enlargeBounds ( const fpreal64 v)
inline

Enlarge the existing bounds to encompass the point given in v.

Definition at line 270 of file UT_BoundingBox.h.

template<typename T>
void UT_BoundingBoxT< T >::enlargeBounds ( const UT_BoundingBoxT< T > &  box)
inline

Enlarge the existing bounds to encompass the bounds given by box.

Definition at line 567 of file UT_BoundingBox.h.

template<typename T>
void UT_BoundingBoxT< T >::enlargeFloats ( int  bits = 1,
T  min = 1e-5 
)
inline

Perform a minimal enlargement of the floating point values in this bounding box. This enlargement guarantees that the new floating point values are always different from the prior ones. The number of mantissa bits to be changed can be adjusted using the bits parameter, and a minimum enlargement amount can be specified in min.

Definition at line 804 of file UT_BoundingBox.h.

template<>
void UT_BoundingBoxT< int64 >::enlargeFloats ( int  bits,
int64  min 
)
inline

Definition at line 823 of file UT_BoundingBox.h.

template<typename T>
void UT_BoundingBoxT< T >::expandBounds ( T  relative,
T  absolute 
)
inline

Expand the bounding box on all axes, as a relative fraction of the current bbox dimensions, and/or using an absolute offset.

Definition at line 579 of file UT_BoundingBox.h.

template<typename T>
void UT_BoundingBoxT< T >::expandBounds ( T  dltx,
T  dlty,
T  dlyz 
)
inline

Expand the bounding box on all sides using separate absolute offsets for each axis.

Definition at line 595 of file UT_BoundingBox.h.

template<typename T>
void UT_BoundingBoxT< T >::getBBoxPoints ( UT_Vector3T< T >(&)  ptarray[8]) const
inline

Definition at line 1212 of file UT_BoundingBox.h.

template<typename T>
void UT_BoundingBoxT< T >::getBBoxPoints ( UT_Vector4T< T >(&)  ptarray[8]) const
inline

Definition at line 1226 of file UT_BoundingBox.h.

template<typename T>
template<typename MATRIX >
int UT_BoundingBoxT< T >::getBBoxPoints ( UT_Vector3T< T >(&)  ptarray[8],
const MATRIX &  transform_matrix 
) const
inline

Definition at line 1241 of file UT_BoundingBox.h.

template<typename T>
int UT_BoundingBoxT< T >::getOutCode ( const UT_Vector3T< T > &  pt) const
inline

Finds the out code of the point relative to this box:

Definition at line 1139 of file UT_BoundingBox.h.

template<typename T>
T UT_BoundingBoxT< T >::getRadius ( ) const
inline

Returns the radius of a sphere that would fully enclose the box.

Definition at line 366 of file UT_BoundingBox.h.

template<typename T>
const T* UT_BoundingBoxT< T >::getSerialized ( ) const
inline

Set/Get bounds in "serialized" fashion. The serialized order is (xmin, xmax, ymin, ymax, zmin, zmax).

Definition at line 188 of file UT_BoundingBox.h.

template<typename T >
uint64 UT_BoundingBoxT< T >::hash ( void  ) const
inline

Compute UT_BoundingBox hash.

Compute a hash

Definition at line 24 of file UT_BoundingBoxHash.h.

template<typename T>
SYS_FORCE_INLINE bool UT_BoundingBoxT< T >::hasVolume ( ) const
inline

Definition at line 168 of file UT_BoundingBox.h.

template<typename T >
void UT_BoundingBoxT< T >::initBounds ( )
inline

Initialize the box such that

  • No points are contained in the box
  • The box occupies no position in space

Definition at line 504 of file UT_BoundingBox.h.

template<typename T>
void UT_BoundingBoxT< T >::initBounds ( const UT_Vector3T< T > &  min,
const UT_Vector3T< T > &  max 
)
inline

Initialize the bounds with the bounds given in min and max. No check is made to ensure that min is smaller than max.

Definition at line 725 of file UT_BoundingBox.h.

template<typename T>
void UT_BoundingBoxT< T >::initBounds ( const UT_Vector3T< T > &  pt)
inline

Initialize zero-sized bounds at the location of the point given by pt.

Definition at line 519 of file UT_BoundingBox.h.

template<typename T>
void UT_BoundingBoxT< T >::initBounds ( const UT_Vector4T< T > &  pt)
inline

Initialize zero-sized bounds at the location of the point given by pt.

Definition at line 735 of file UT_BoundingBox.h.

template<typename T>
void UT_BoundingBoxT< T >::initBounds ( T  x,
T  y,
T  z 
)
inline

Initialize zero-sized bounds at the location of the point defined by x, y, and z;

Definition at line 531 of file UT_BoundingBox.h.

template<typename T>
void UT_BoundingBoxT< T >::initBounds ( const fpreal32 v)
inline

Initialize zero-sized bounds at the location of the point given by v.

Definition at line 238 of file UT_BoundingBox.h.

template<typename T>
void UT_BoundingBoxT< T >::initBounds ( const fpreal64 v)
inline

Initialize zero-sized bounds at the location of the point given by v.

Definition at line 242 of file UT_BoundingBox.h.

template<typename T>
void UT_BoundingBoxT< T >::initBounds ( const UT_BoundingBoxT< T > &  box)
inline

Initialize the bounds to the same as given by box.

Definition at line 744 of file UT_BoundingBox.h.

template<typename T >
void UT_BoundingBoxT< T >::initMaxBounds ( )
inline

Initialize the box to the largest size.

Definition at line 717 of file UT_BoundingBox.h.

template<typename T>
int UT_BoundingBoxT< T >::intersectRange ( const UT_Vector3T< T > &  org,
const UT_Vector3T< T > &  dir,
T min,
T max 
) const
inline

Definition at line 962 of file UT_BoundingBox.h.

template<typename T>
int UT_BoundingBoxT< T >::intersectRay ( const UT_Vector3T< T > &  org,
const UT_Vector3T< T > &  dir,
T  tmax = 1E17F,
T distance = 0,
UT_Vector3T< T > *  nml = 0 
) const

Intersect a ray with the box. Returns 0 if no intersection found. distance will be set to the intersection distance (between 0 & tmax) The normal will also be set. The direction of the normal is indeterminant (to fix it, you might want to dot(dir, *nml) to check the orientation.

Definition at line 898 of file UT_BoundingBox.h.

template<typename T>
int UT_BoundingBoxT< T >::intersects ( const UT_BoundingBoxT< T > &  box) const
inline

Definition at line 644 of file UT_BoundingBox.h.

template<typename T>
int UT_BoundingBoxT< T >::intersectTube ( const UT_Vector3T< T > &  org,
const UT_Vector3T< T > &  dir,
T  radius,
T  tmin = -1E17f,
T  tmax = 1E17f 
) const
inline

This determines if the tube, capped at distances tmin & tmax, intersects this.

Definition at line 986 of file UT_BoundingBox.h.

template<typename T>
bool UT_BoundingBoxT< T >::isEqual ( const UT_BoundingBoxT< T > &  bbox,
T  tol = SYS_FTOLERANCE_R 
) const
inline

Definition at line 100 of file UT_BoundingBox.h.

template<typename T>
int UT_BoundingBoxT< T >::isInside ( const UT_Vector3T< T > &  pt) const
inline

Definition at line 604 of file UT_BoundingBox.h.

template<typename T>
int UT_BoundingBoxT< T >::isInside ( const UT_Vector4T< T > &  pt) const
inline

Definition at line 614 of file UT_BoundingBox.h.

template<typename T>
int UT_BoundingBoxT< T >::isInside ( T  x,
T  y,
T  z 
) const
inline

Definition at line 624 of file UT_BoundingBox.h.

template<typename T>
int UT_BoundingBoxT< T >::isInside ( const UT_BoundingBoxT< T > &  bbox) const
inline

Am I totally enclosed in the bounding box passed in ("intersects" method tests for partially inside)

Definition at line 634 of file UT_BoundingBox.h.

template<typename T>
SYS_FORCE_INLINE bool UT_BoundingBoxT< T >::isInvalidFast ( ) const
inline

Efficient test for an invalid bounding box (one comparison instead of 3 for a valid bounding box). This only checks X, not Y or Z ranges, so only works if the box is fully invalid.

Definition at line 154 of file UT_BoundingBox.h.

template<typename T>
int UT_BoundingBoxT< T >::isLineInside ( const UT_Vector3T< T > &  v0,
const UT_Vector3T< T > &  idir 
) const
inline

Determine whether a line intersects the box. v0 is one end-point of the line, and idir is the inverse direction vector along the line.

Definition at line 679 of file UT_BoundingBox.h.

template<typename T >
bool UT_BoundingBoxT< T >::isValid ( ) const
inline

Check whether the bounding box contains at least one point.

Definition at line 495 of file UT_BoundingBox.h.

template<typename T>
UT_API bool UT_BoundingBoxT< T >::load ( UT_JSONParser p)

Methods to serialize to a JSON stream. The vector is stored as an array of 6 reals (xmin, xmax, ymin, ymax, zmin, zmax)

template<typename T>
SYS_FORCE_INLINE void UT_BoundingBoxT< T >::makeInvalid ( )
inline

Definition at line 148 of file UT_BoundingBox.h.

template<typename T >
int UT_BoundingBoxT< T >::maxAxis ( ) const
inline

Definition at line 1196 of file UT_BoundingBox.h.

template<typename T>
T UT_BoundingBoxT< T >::maxDist2 ( const UT_Vector3T< T > &  p) const
inline

Returns maximum distance between point and bounding box squared.

Definition at line 358 of file UT_BoundingBox.h.

template<typename T>
UT_Vector3T< T > UT_BoundingBoxT< T >::maxDistDelta ( const UT_Vector3T< T > &  p) const
inline

Returns the maximum delta vector from the bounding box to the point.

Definition at line 1097 of file UT_BoundingBox.h.

template<typename T>
UT_Vector3T<T> UT_BoundingBoxT< T >::maxvec ( ) const
inline

Definition at line 120 of file UT_BoundingBox.h.

template<typename T >
int UT_BoundingBoxT< T >::minAxis ( ) const
inline

Definition at line 1204 of file UT_BoundingBox.h.

template<typename T>
T UT_BoundingBoxT< T >::minDist2 ( const UT_Vector3T< T > &  p) const
inline

Returns minimum distance from point to bounding box squared. Returns 0 if point in bouding box.

Definition at line 352 of file UT_BoundingBox.h.

template<typename T>
T UT_BoundingBoxT< T >::minDist2 ( const UT_BoundingBoxT< T > &  box) const
inline

Minimum disance between two bboxes squared.

Definition at line 355 of file UT_BoundingBox.h.

template<typename T>
UT_Vector3T< T > UT_BoundingBoxT< T >::minDistDelta ( const UT_Vector3T< T > &  p) const
inline

Returns the minimum delta vector from the point to the bounding box or between two bounding boxes.

Definition at line 1047 of file UT_BoundingBox.h.

template<typename T>
UT_Vector3T< T > UT_BoundingBoxT< T >::minDistDelta ( const UT_BoundingBoxT< T > &  box) const
inline

Definition at line 1071 of file UT_BoundingBox.h.

template<typename T>
UT_Vector3T< T > UT_BoundingBoxT< T >::minDistToMaxOverlap ( const UT_BoundingBoxT< T > &  box) const
inline

Returns the smallest absolute translation from this to box that produces the maximum overlap between the two boxes.

Definition at line 1123 of file UT_BoundingBox.h.

template<typename T>
UT_Vector3T<T> UT_BoundingBoxT< T >::minvec ( ) const
inline

Definition at line 118 of file UT_BoundingBox.h.

template<typename T>
bool UT_BoundingBoxT< T >::operator!= ( const UT_BoundingBoxT< T > &  bbox) const
inline

Definition at line 95 of file UT_BoundingBox.h.

template<typename T>
T UT_BoundingBoxT< T >::operator() ( unsigned  m,
unsigned  n 
) const
inline

Definition at line 76 of file UT_BoundingBox.h.

template<typename T>
T& UT_BoundingBoxT< T >::operator() ( unsigned  m,
unsigned  n 
)
inline

Definition at line 81 of file UT_BoundingBox.h.

template<typename T>
template<typename S >
UT_BoundingBoxT& UT_BoundingBoxT< T >::operator= ( const UT_BoundingBoxT< S > &  bbox)
inline

Definition at line 65 of file UT_BoundingBox.h.

template<typename T>
bool UT_BoundingBoxT< T >::operator== ( const UT_BoundingBoxT< T > &  bbox) const
inline

Definition at line 86 of file UT_BoundingBox.h.

template<typename T>
UT_API void UT_BoundingBoxT< T >::outTo ( std::ostream &  os) const
protected
template<typename T>
UT_API bool UT_BoundingBoxT< T >::save ( UT_JSONWriter w) const

Methods to serialize to a JSON stream. The vector is stored as an array of 6 reals (xmin, xmax, ymin, ymax, zmin, zmax)

template<typename T>
UT_API bool UT_BoundingBoxT< T >::save ( UT_JSONValue v) const

Methods to serialize to a JSON stream. The vector is stored as an array of 6 reals (xmin, xmax, ymin, ymax, zmin, zmax)

template<typename T>
void UT_BoundingBoxT< T >::scaleOffset ( const UT_Vector3T< T > &  scale,
const UT_Vector3T< T > &  offset 
)
inline

Scale then offset a bounding box.

Definition at line 1183 of file UT_BoundingBox.h.

template<typename T>
void UT_BoundingBoxT< T >::setBounds ( T  x_min,
T  y_min,
T  z_min,
T  x_max,
T  y_max,
T  z_max 
)
inline

Definition at line 156 of file UT_BoundingBox.h.

template<typename T>
void UT_BoundingBoxT< T >::setSerialized ( const fpreal32  floats[6])
inline

Set/Get bounds in "serialized" fashion. The serialized order is (xmin, xmax, ymin, ymax, zmin, zmax).

Definition at line 178 of file UT_BoundingBox.h.

template<typename T>
void UT_BoundingBoxT< T >::setSerialized ( const fpreal64  floats[6])
inline

Set/Get bounds in "serialized" fashion. The serialized order is (xmin, xmax, ymin, ymax, zmin, zmax).

Definition at line 183 of file UT_BoundingBox.h.

template<typename T>
UT_Vector3T<T> UT_BoundingBoxT< T >::size ( void  ) const
inline

Definition at line 329 of file UT_BoundingBox.h.

template<typename T>
T UT_BoundingBoxT< T >::sizeAxis ( int  axis) const
inline

Definition at line 333 of file UT_BoundingBox.h.

template<typename T >
T UT_BoundingBoxT< T >::sizeMax ( ) const
inline

Return the size of the largest dimension.

Definition at line 1013 of file UT_BoundingBox.h.

template<typename T >
T UT_BoundingBoxT< T >::sizeMax ( int axis) const
inline

Return the size of the largest dimension, and store the dimension index in "axis"

Definition at line 1026 of file UT_BoundingBox.h.

template<typename T>
T UT_BoundingBoxT< T >::sizeX ( ) const
inline

Definition at line 325 of file UT_BoundingBox.h.

template<typename T>
T UT_BoundingBoxT< T >::sizeY ( ) const
inline

Definition at line 326 of file UT_BoundingBox.h.

template<typename T>
T UT_BoundingBoxT< T >::sizeZ ( ) const
inline

Definition at line 327 of file UT_BoundingBox.h.

template<typename T>
void UT_BoundingBoxT< T >::splitLeft ( UT_BoundingBoxT< T > &  box,
int  axis,
T  split 
)
inline

Splits a box into two disjoint subboxes at the given splitting point. This box is set to the left subbox for splitLeft() and the right subbox for splitRight().

Definition at line 300 of file UT_BoundingBox.h.

template<typename T>
void UT_BoundingBoxT< T >::splitRight ( UT_BoundingBoxT< T > &  box,
int  axis,
T  split 
)
inline

Definition at line 306 of file UT_BoundingBox.h.

template<typename T>
static bool UT_BoundingBoxT< T >::SYSisEqual ( int64  a,
int64  b,
int64   
)
inlinestaticprotected

Definition at line 463 of file UT_BoundingBox.h.

template<typename T >
template<typename MATRIX >
void UT_BoundingBoxT< T >::transform ( const MATRIX &  mat)
inline

Definition at line 844 of file UT_BoundingBox.h.

template<typename T>
template<typename MATRIX >
void UT_BoundingBoxT< T >::transform ( const MATRIX &  mat,
UT_BoundingBoxT< T > &  newbbox 
) const
inline

Definition at line 854 of file UT_BoundingBox.h.

template<typename T>
void UT_BoundingBoxT< T >::translate ( const UT_Vector3T< T > &  delta)
inline

Adds the given translate to each component of the bounding box.

Definition at line 869 of file UT_BoundingBox.h.

template<typename T>
UT_API bool UT_BoundingBoxT< T >::triangleIntersects ( const UT_Vector3T< T > &  v0,
const UT_Vector3T< T > &  v1,
const UT_Vector3T< T > &  v2 
) const

Returns whether the triangle defined by the supplied points intersects the bounding box.

template<typename T>
T UT_BoundingBoxT< T >::volume ( ) const
inline

Definition at line 385 of file UT_BoundingBox.h.

template<typename T>
T UT_BoundingBoxT< T >::xcenter ( ) const
inline

Definition at line 371 of file UT_BoundingBox.h.

template<typename T>
T UT_BoundingBoxT< T >::xmax ( ) const
inline

Definition at line 112 of file UT_BoundingBox.h.

template<typename T>
T UT_BoundingBoxT< T >::xmin ( ) const
inline

Definition at line 111 of file UT_BoundingBox.h.

template<typename T>
T UT_BoundingBoxT< T >::xsize ( ) const
inline

Definition at line 322 of file UT_BoundingBox.h.

template<typename T>
T UT_BoundingBoxT< T >::ycenter ( ) const
inline

Definition at line 372 of file UT_BoundingBox.h.

template<typename T>
T UT_BoundingBoxT< T >::ymax ( ) const
inline

Definition at line 114 of file UT_BoundingBox.h.

template<typename T>
T UT_BoundingBoxT< T >::ymin ( ) const
inline

Definition at line 113 of file UT_BoundingBox.h.

template<typename T>
T UT_BoundingBoxT< T >::ysize ( ) const
inline

Definition at line 323 of file UT_BoundingBox.h.

template<typename T>
T UT_BoundingBoxT< T >::zcenter ( ) const
inline

Definition at line 373 of file UT_BoundingBox.h.

template<typename T>
T UT_BoundingBoxT< T >::zmax ( ) const
inline

Definition at line 116 of file UT_BoundingBox.h.

template<typename T>
T UT_BoundingBoxT< T >::zmin ( ) const
inline

Definition at line 115 of file UT_BoundingBox.h.

template<typename T>
T UT_BoundingBoxT< T >::zsize ( ) const
inline

Definition at line 324 of file UT_BoundingBox.h.

Friends And Related Function Documentation

template<typename T>
std::size_t hash_value ( const this_type t)
friend

Compute UT_BoundingBox hash.

Compute a hash

Definition at line 208 of file UT_BoundingBox.h.

template<typename T>
std::ostream& operator<< ( std::ostream &  os,
const UT_BoundingBoxT< T > &  box 
)
friend

Definition at line 455 of file UT_BoundingBox.h.

Member Data Documentation

union { ... }

Here's the data for the bounding box.

template<typename T>
T UT_BoundingBoxT< T >::myFloats[6]

Definition at line 424 of file UT_BoundingBox.h.

template<typename T>
T UT_BoundingBoxT< T >::vals[3][2]

Definition at line 423 of file UT_BoundingBox.h.


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