#include <MBoundingBox.h>
This class provides an implementation of a bounding box. A bounding box describes a volume in space that bounds a piece of geometry. The box is defined by two points which describe the minimum and maximum corners of the box.
Public Member Functions | |
MBoundingBox () | |
MBoundingBox (const MBoundingBox &src) | |
MBoundingBox (const MPoint &corner1, const MPoint &corner2) | |
~MBoundingBox () | |
void | clear () |
void | transformUsing (const MMatrix &matrix) |
void | expand (const MPoint &point) |
void | expand (const MBoundingBox &box) |
bool | contains (const MPoint &point) const |
bool | intersects (const MBoundingBox &box, double tol=0.0) const |
double | width () const |
double | height () const |
double | depth () const |
MPoint | center () const |
MPoint | min () const |
MPoint | max () const |
MBoundingBox & | operator= (const MBoundingBox &other) |
MBoundingBox::MBoundingBox | ( | ) |
Default constructor. Creates an empty bounding box.
MBoundingBox::MBoundingBox | ( | const MBoundingBox & | src | ) |
Copy constructor.
[in] | src | bounding box to copy |
Constructor that creates a bounding box which contains the given points. Each point will represent one corner of the box.
[in] | corner1 | first corner point |
[in] | corner2 | second corner point |
MBoundingBox::~MBoundingBox | ( | ) |
Class destructor.
void MBoundingBox::clear | ( | ) |
Empties the current bounding box.
void MBoundingBox::transformUsing | ( | const MMatrix & | matrix | ) |
Apply the given transformation to this bounding box.
[in] | matrix | transformation matrix |
void MBoundingBox::expand | ( | const MPoint & | point | ) |
Expand the bounding box to include the given point.
[in] | point | new point to include in the bounding box. |
void MBoundingBox::expand | ( | const MBoundingBox & | box | ) |
Expand the bounding box to include a second bounding box.
[in] | box | bounding box to include in this bounding box. |
bool MBoundingBox::contains | ( | const MPoint & | point | ) | const |
Returns true if the bounding box contains the given point.
[in] | point | point to check for inclusion in this bounding box |
bool MBoundingBox::intersects | ( | const MBoundingBox & | box, | |
double | tol = 0.0 | |||
) | const |
Returns true if the bounding box intersects another given bounding box
[in] | box | bounding box to check for intersection |
[in] | tol | tolerance of the intersection check |
double MBoundingBox::width | ( | ) | const |
Returns the width of the bounding box.
double MBoundingBox::height | ( | ) | const |
Returns the height of the bounding box.
double MBoundingBox::depth | ( | ) | const |
Returns the depth of the bounding box.
MPoint MBoundingBox::center | ( | ) | const |
Returns the center of the bounding box.
MPoint MBoundingBox::min | ( | ) | const |
Returns the minimum point for the bounding box. That is the point whose x, y, and z components represent the bounding box's minimum value in each dimension.
MPoint MBoundingBox::max | ( | ) | const |
Returns the maximum point for the bounding box. That is the point whose x, y, and z components represent the bounding box's maximum value in each dimension.
MBoundingBox & MBoundingBox::operator= | ( | const MBoundingBox & | other | ) |
Assignment operator.
[in] | other | bounding box to take value from |
Autodesk® Maya® 2009 © 1997-2008 Autodesk, Inc. All rights reserved. | Generated with 1.5.6 |