#include <UT_BoundingBox.h>
Public Member Functions | |
| UT_BoundingBox () | |
| UT_BoundingBox (fpreal axmin, fpreal aymin, fpreal azmin, fpreal axmax, fpreal aymax, fpreal azmax) | |
| UT_BoundingBox (const UT_Vector3 &lowerbound, const UT_Vector3 &upperbound) | |
| float | operator() (unsigned m, unsigned n) const |
| float & | operator() (unsigned m, unsigned n) |
| bool | operator== (const UT_BoundingBox &bbox) const |
| bool | operator!= (const UT_BoundingBox &bbox) const |
| bool | isEqual (const UT_BoundingBox &bbox, fpreal tol=UT_FTOLERANCE) const |
| fpreal | xmin () const |
| fpreal | xmax () const |
| fpreal | ymin () const |
| fpreal | ymax () const |
| fpreal | zmin () const |
| fpreal | zmax () const |
| UT_Vector3 | minvec () const |
| UT_Vector3 | maxvec () const |
| int | isInside (const UT_Vector3 &pt) const |
| int | isInside (const UT_Vector4 &pt) const |
| int | isInside (fpreal x, fpreal y, fpreal z) const |
| int | isInside (const UT_BoundingBox &bbox) const |
| int | isLineInside (const UT_Vector3 &v0, const UT_Vector3 &v1) const |
| Determine whether a line between v0 & v1 intersects the box. | |
| bool | isValid () const |
| Check whether the bounding box contains at least one point. | |
| void | makeInvalid () |
| void | setBounds (fpreal x_min, fpreal y_min, fpreal z_min, fpreal x_max, fpreal y_max, fpreal z_max) |
| void | initMaxBounds () |
| Initialize the box to the largest size. | |
| void | initBounds () |
| void | initBounds (const UT_Vector3 &min, const UT_Vector3 &max) |
| void | initBounds (const UT_Vector3 &pt) |
| void | initBounds (const UT_Vector4 &pt) |
| void | initBounds (fpreal x, fpreal y, fpreal z) |
| void | initBounds (const UT_BoundingBox &box) |
| void | enlargeBounds (const UT_Vector3 &min, const UT_Vector3 &max) |
| void | enlargeBounds (const UT_Vector3 &pt) |
| void | enlargeBounds (const UT_Vector4 &pt) |
| void | enlargeBounds (fpreal x, fpreal y, fpreal z) |
| void | enlargeBounds (const UT_BoundingBox &box) |
| void | enlargeBounds (fpreal percent=0.001F, fpreal min=0.001F) |
| void | expandBounds (fpreal dltx, fpreal dlty, fpreal dlyz) |
| void | enlargeFloats (int bits=1, fpreal min=1e-5F) |
| void | clipBounds (const UT_BoundingBox &box) |
| Find the intersections of two bounding boxes. | |
| void | splitLeft (UT_BoundingBox &box, int axis, fpreal split) |
| void | splitRight (UT_BoundingBox &box, int axis, fpreal split) |
| void | transform (const UT_Matrix4 &mat) |
| void | transform (const UT_Matrix4 &mat, UT_BoundingBox &newbbox) const |
| void | translate (const UT_Vector3 &delta) |
| Adds the given translate to each component of the bounding box. | |
| fpreal | xsize () const |
| fpreal | ysize () const |
| fpreal | zsize () const |
| fpreal | sizeX () const |
| fpreal | sizeY () const |
| fpreal | sizeZ () const |
| UT_Vector3 | size () const |
| fpreal | sizeAxis (int axis) const |
| fpreal | sizeMax () const |
| Return the size of the largest dimension. | |
| fpreal | sizeMax (int &axis) const |
| UT_Vector3 | minDistDelta (const UT_Vector3 &p) const |
| UT_Vector3 | minDistDelta (const UT_BoundingBox &box) const |
| fpreal | minDist2 (const UT_Vector3 &p) const |
| fpreal | minDist2 (const UT_BoundingBox &box) const |
| Minimum disance between two bboxes squared. | |
| int | getOutCode (const UT_Vector3 &pt) const |
| Finds the out code of the point relative to this box:. | |
| fpreal | xcenter () const |
| fpreal | ycenter () const |
| fpreal | zcenter () const |
| fpreal | centerX () const |
| fpreal | centerY () const |
| fpreal | centerZ () const |
| fpreal | centerAxis (int axis) const |
| UT_Vector3 | center () const |
| fpreal | area () const |
| fpreal | volume () const |
| void | addToMin (const UT_Vector3 &vec) |
| void | addToMax (const UT_Vector3 &vec) |
| void | scaleOffset (const UT_Vector3 &scale, const UT_Vector3 &offset) |
| Scale then offset a bounding box. | |
| int | maxAxis () const |
| int | minAxis () const |
| int | intersectRay (const UT_Vector3 &org, const UT_Vector3 &dir, fpreal tmax=1E17F, float *distance=0, UT_Vector3 *nml=0) const |
| int | intersectRange (const UT_Vector3 &org, const UT_Vector3 &dir, float &min, float &max) const |
| int | intersectTube (const UT_Vector3 &org, const UT_Vector3 &dir, fpreal radius, fpreal tmin=-1E17f, fpreal tmax=1E17f) const |
| int | intersects (const UT_BoundingBox &box) const |
| int | computeIntersection (const UT_BoundingBox &box) |
| void | getBBoxPoints (UT_Vector3(&ptarray)[8]) const |
| int | getBBoxPoints (UT_Vector3(&ptarray)[8], const UT_Matrix4 &transform_matrix) const |
| void | dump (const char *msg=0) const |
| Dump the bounding box to stderr. The msg is printed before the bounds. | |
| void | dumpGeo (FILE *fp) const |
| Dump the bounding box geometry to a draw file. | |
Public Attributes | |
| float | vals [3][2] |
| Here's the data for the bounding box. | |
Protected Member Functions | |
| void | outTo (ostream &os) const |
| void | enlargeBoundsByPtArray (UT_Vector3(&ptarray)[8], bool init=false) |
Friends | |
| ostream & | operator<< (ostream &os, const UT_BoundingBox &box) |
GR/GR_BoundingBox.C, SIM/SIM_SolverSNOW.C, SOP/SOP_Flatten.C, standalone/geoisosurface.C, standalone/i3dsphere.C, VRAY/VRAY_DemoBox.C, VRAY/VRAY_DemoBox.h, VRAY/VRAY_DemoFile.C, VRAY/VRAY_DemoFile.h, VRAY/VRAY_DemoMountain.C, VRAY/VRAY_DemoMountain.h, VRAY/VRAY_DemoStamp.C, VRAY/VRAY_DemoStamp.h, VRAY/VRAY_DemoVolumeSphere.C, and VRAY/VRAY_DemoVolumeSphere.h.
Definition at line 28 of file UT_BoundingBox.h.
| UT_BoundingBox::UT_BoundingBox | ( | ) | [inline] |
Definition at line 30 of file UT_BoundingBox.h.
| UT_BoundingBox::UT_BoundingBox | ( | fpreal | axmin, | |
| fpreal | aymin, | |||
| fpreal | azmin, | |||
| fpreal | axmax, | |||
| fpreal | aymax, | |||
| fpreal | azmax | |||
| ) | [inline] |
Definition at line 33 of file UT_BoundingBox.h.
| UT_BoundingBox::UT_BoundingBox | ( | const UT_Vector3 & | lowerbound, | |
| const UT_Vector3 & | upperbound | |||
| ) | [inline] |
Definition at line 39 of file UT_BoundingBox.h.
| void UT_BoundingBox::addToMax | ( | const UT_Vector3 & | vec | ) |
| void UT_BoundingBox::addToMin | ( | const UT_Vector3 & | vec | ) |
| fpreal UT_BoundingBox::area | ( | ) | const |
| UT_Vector3 UT_BoundingBox::center | ( | ) | const [inline] |
Definition at line 224 of file UT_BoundingBox.h.
| fpreal UT_BoundingBox::centerAxis | ( | int | axis | ) | const [inline] |
Definition at line 222 of file UT_BoundingBox.h.
| fpreal UT_BoundingBox::centerX | ( | ) | const [inline] |
Definition at line 219 of file UT_BoundingBox.h.
| fpreal UT_BoundingBox::centerY | ( | ) | const [inline] |
Definition at line 220 of file UT_BoundingBox.h.
| fpreal UT_BoundingBox::centerZ | ( | ) | const [inline] |
Definition at line 221 of file UT_BoundingBox.h.
| void UT_BoundingBox::clipBounds | ( | const UT_BoundingBox & | box | ) |
Find the intersections of two bounding boxes.
| int UT_BoundingBox::computeIntersection | ( | const UT_BoundingBox & | box | ) |
Changes the bounds to be those of the intersection of this box and the supplied BBox. Returns 1 if intersects, 0 otherwise.
| void UT_BoundingBox::dump | ( | const char * | msg = 0 |
) | const |
Dump the bounding box to stderr. The msg is printed before the bounds.
| void UT_BoundingBox::dumpGeo | ( | FILE * | fp | ) | const |
Dump the bounding box geometry to a draw file.
| void UT_BoundingBox::enlargeBounds | ( | const UT_BoundingBox & | box | ) |
| void UT_BoundingBox::enlargeBounds | ( | const UT_Vector4 & | pt | ) |
| void UT_BoundingBox::enlargeBounds | ( | const UT_Vector3 & | pt | ) |
| void UT_BoundingBox::enlargeBounds | ( | const UT_Vector3 & | min, | |
| const UT_Vector3 & | max | |||
| ) |
| void UT_BoundingBox::enlargeBoundsByPtArray | ( | UT_Vector3(&) | ptarray[8], | |
| bool | init = false | |||
| ) | [protected] |
| void UT_BoundingBox::enlargeFloats | ( | int | bits = 1, |
|
| fpreal | min = 1e-5F | |||
| ) |
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.
| int UT_BoundingBox::getBBoxPoints | ( | UT_Vector3(&) | ptarray[8], | |
| const UT_Matrix4 & | transform_matrix | |||
| ) | const |
| void UT_BoundingBox::getBBoxPoints | ( | UT_Vector3(&) | ptarray[8] | ) | const |
| int UT_BoundingBox::getOutCode | ( | const UT_Vector3 & | pt | ) | const |
Finds the out code of the point relative to this box:.
| void UT_BoundingBox::initBounds | ( | const UT_BoundingBox & | box | ) |
| void UT_BoundingBox::initBounds | ( | const UT_Vector4 & | pt | ) |
| void UT_BoundingBox::initBounds | ( | const UT_Vector3 & | pt | ) |
| void UT_BoundingBox::initBounds | ( | const UT_Vector3 & | min, | |
| const UT_Vector3 & | max | |||
| ) |
| void UT_BoundingBox::initBounds | ( | ) |
Initialize the box such that
| void UT_BoundingBox::initMaxBounds | ( | ) |
Initialize the box to the largest size.
| int UT_BoundingBox::intersectRange | ( | const UT_Vector3 & | org, | |
| const UT_Vector3 & | dir, | |||
| float & | min, | |||
| float & | max | |||
| ) | const |
| int UT_BoundingBox::intersectRay | ( | const UT_Vector3 & | org, | |
| const UT_Vector3 & | dir, | |||
| fpreal | tmax = 1E17F, |
|||
| float * | distance = 0, |
|||
| UT_Vector3 * | 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.
| int UT_BoundingBox::intersects | ( | const UT_BoundingBox & | box | ) | const |
| int UT_BoundingBox::intersectTube | ( | const UT_Vector3 & | org, | |
| const UT_Vector3 & | dir, | |||
| fpreal | radius, | |||
| fpreal | tmin = -1E17f, |
|||
| fpreal | tmax = 1E17f | |||
| ) | const |
This determines if the tube, capped at distances tmin & tmax, intersects this.
| bool UT_BoundingBox::isEqual | ( | const UT_BoundingBox & | bbox, | |
| fpreal | tol = UT_FTOLERANCE | |||
| ) | const [inline] |
Definition at line 76 of file UT_BoundingBox.h.
| int UT_BoundingBox::isInside | ( | const UT_BoundingBox & | bbox | ) | const |
Am I totally enclosed in the bounding box passed in ("intersects" method tests for partially inside)
| int UT_BoundingBox::isInside | ( | const UT_Vector4 & | pt | ) | const |
| int UT_BoundingBox::isInside | ( | const UT_Vector3 & | pt | ) | const |
| int UT_BoundingBox::isLineInside | ( | const UT_Vector3 & | v0, | |
| const UT_Vector3 & | v1 | |||
| ) | const |
Determine whether a line between v0 & v1 intersects the box.
| bool UT_BoundingBox::isValid | ( | ) | const |
Check whether the bounding box contains at least one point.
| void UT_BoundingBox::makeInvalid | ( | ) | [inline] |
Definition at line 112 of file UT_BoundingBox.h.
| int UT_BoundingBox::maxAxis | ( | ) | const |
| UT_Vector3 UT_BoundingBox::maxvec | ( | ) | const [inline] |
Definition at line 96 of file UT_BoundingBox.h.
| int UT_BoundingBox::minAxis | ( | ) | const |
| fpreal UT_BoundingBox::minDist2 | ( | const UT_BoundingBox & | box | ) | const [inline] |
| fpreal UT_BoundingBox::minDist2 | ( | const UT_Vector3 & | p | ) | const [inline] |
Returns minimum distance from point to bounding box squared. Returns 0 if point in bouding box.
Definition at line 207 of file UT_BoundingBox.h.
| UT_Vector3 UT_BoundingBox::minDistDelta | ( | const UT_BoundingBox & | box | ) | const |
| UT_Vector3 UT_BoundingBox::minDistDelta | ( | const UT_Vector3 & | p | ) | const |
Returns the minimum delta vector from the point to the bounding box or between two bounding boxes.
| UT_Vector3 UT_BoundingBox::minvec | ( | ) | const [inline] |
Definition at line 94 of file UT_BoundingBox.h.
| bool UT_BoundingBox::operator!= | ( | const UT_BoundingBox & | bbox | ) | const [inline] |
Definition at line 72 of file UT_BoundingBox.h.
| float& UT_BoundingBox::operator() | ( | unsigned | m, | |
| unsigned | n | |||
| ) | [inline] |
Definition at line 58 of file UT_BoundingBox.h.
| float UT_BoundingBox::operator() | ( | unsigned | m, | |
| unsigned | n | |||
| ) | const [inline] |
Definition at line 53 of file UT_BoundingBox.h.
| bool UT_BoundingBox::operator== | ( | const UT_BoundingBox & | bbox | ) | const [inline] |
Definition at line 63 of file UT_BoundingBox.h.
| void UT_BoundingBox::outTo | ( | ostream & | os | ) | const [protected] |
| void UT_BoundingBox::scaleOffset | ( | const UT_Vector3 & | scale, | |
| const UT_Vector3 & | offset | |||
| ) |
Scale then offset a bounding box.
| UT_Vector3 UT_BoundingBox::size | ( | ) | const [inline] |
Definition at line 186 of file UT_BoundingBox.h.
| fpreal UT_BoundingBox::sizeAxis | ( | int | axis | ) | const [inline] |
Definition at line 190 of file UT_BoundingBox.h.
| fpreal UT_BoundingBox::sizeMax | ( | int & | axis | ) | const |
Return the size of the largest dimension, and store the dimension index in "axis"
| fpreal UT_BoundingBox::sizeMax | ( | ) | const |
Return the size of the largest dimension.
| fpreal UT_BoundingBox::sizeX | ( | ) | const [inline] |
| fpreal UT_BoundingBox::sizeY | ( | ) | const [inline] |
| fpreal UT_BoundingBox::sizeZ | ( | ) | const [inline] |
| void UT_BoundingBox::splitLeft | ( | UT_BoundingBox & | box, | |
| int | axis, | |||
| fpreal | 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 159 of file UT_BoundingBox.h.
| void UT_BoundingBox::splitRight | ( | UT_BoundingBox & | box, | |
| int | axis, | |||
| fpreal | split | |||
| ) | [inline] |
Definition at line 165 of file UT_BoundingBox.h.
| void UT_BoundingBox::transform | ( | const UT_Matrix4 & | mat, | |
| UT_BoundingBox & | newbbox | |||
| ) | const |
| void UT_BoundingBox::transform | ( | const UT_Matrix4 & | mat | ) |
| void UT_BoundingBox::translate | ( | const UT_Vector3 & | delta | ) |
Adds the given translate to each component of the bounding box.
| fpreal UT_BoundingBox::volume | ( | ) | const [inline] |
Definition at line 230 of file UT_BoundingBox.h.
| fpreal UT_BoundingBox::xcenter | ( | ) | const [inline] |
Definition at line 216 of file UT_BoundingBox.h.
| fpreal UT_BoundingBox::xmax | ( | ) | const [inline] |
| fpreal UT_BoundingBox::xmin | ( | ) | const [inline] |
| fpreal UT_BoundingBox::xsize | ( | ) | const [inline] |
Definition at line 179 of file UT_BoundingBox.h.
| fpreal UT_BoundingBox::ycenter | ( | ) | const [inline] |
Definition at line 217 of file UT_BoundingBox.h.
| fpreal UT_BoundingBox::ymax | ( | ) | const [inline] |
| fpreal UT_BoundingBox::ymin | ( | ) | const [inline] |
| fpreal UT_BoundingBox::ysize | ( | ) | const [inline] |
Definition at line 180 of file UT_BoundingBox.h.
| fpreal UT_BoundingBox::zcenter | ( | ) | const [inline] |
Definition at line 218 of file UT_BoundingBox.h.
| fpreal UT_BoundingBox::zmax | ( | ) | const [inline] |
| fpreal UT_BoundingBox::zmin | ( | ) | const [inline] |
| fpreal UT_BoundingBox::zsize | ( | ) | const [inline] |
Definition at line 181 of file UT_BoundingBox.h.
| ostream& operator<< | ( | ostream & | os, | |
| const UT_BoundingBox & | box | |||
| ) | [friend] |
Definition at line 280 of file UT_BoundingBox.h.
| float UT_BoundingBox::vals[3][2] |
Here's the data for the bounding box.
Definition at line 267 of file UT_BoundingBox.h.
1.5.9