class MBoundingBox

Jump to documentation

Implementation of a 3D bounding box. (OpenMaya) (OpenMaya.py)

public members:

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 )

Documentation

This class implements a 3D bounding box
Description

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.

Functions

MBoundingBox:: MBoundingBox ()

Description

Default constructor. Creates an empty bounding box.

MBoundingBox:: MBoundingBox ( const MBoundingBox & src )

Description

Copy constructor.

Arguments

  • src bounding box to copy

MBoundingBox:: MBoundingBox ( const MPoint &corner1, const MPoint &corner2 )

Description

Constructor that creates a bounding box which contains the given points. Each point will represent one corner of the box.

Arguments

  • corner1 first corner point
  • corner2 second corner point

MBoundingBox:: ~MBoundingBox ()

Description

Class destructor.

void MBoundingBox:: clear ()

Description

Empties the current bounding box.

void MBoundingBox:: transformUsing ( const MMatrix &matrix )

Description

Apply the given transformation to this bounding box.

Arguments

  • matrix transformation matrix

void MBoundingBox:: expand ( const MPoint & point )

Description

Expand the bounding box to include the given point.

Arguments

  • point new point to include in the bounding box.

void MBoundingBox:: expand ( const MBoundingBox & box )

Description

Expand the bounding box to include a second bounding box.

Arguments

  • box bounding box to include in this bounding box.

bool MBoundingBox:: contains ( const MPoint & point ) const

Description

Returns true if the bounding box contains the given point.

Arguments

  • point point to check for inclusion in this bounding box

Return Value

  • true if the point is contained in this bounding box

bool MBoundingBox:: intersects ( const MBoundingBox & box, double tol ) const

Description

Returns true if the bounding box intersects another given bounding box

Arguments

  • box bounding box to check for intersection
  • tol tolerance of the intersection check

Return Value

  • true if the bounding boxes intersect

double MBoundingBox:: width () const

Description

Returns the width of the bounding box.

Return Value

  • the width of the bounding box

double MBoundingBox:: height () const

Description

Returns the height of the bounding box.

Return Value

  • the height of the bounding box

double MBoundingBox:: depth () const

Description

Returns the depth of the bounding box.

Return Value

  • the depth of the bounding box

MPoint MBoundingBox:: center () const

Description

Returns the center of the bounding box.

Return Value

  • the center of the bounding box

MPoint MBoundingBox:: min () const

Description

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.

Return Value

  • the minimum point of the bounding box

MPoint MBoundingBox:: max () const

Description

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.

Return Value

  • the maximum point of the bounding box

MBoundingBox & MBoundingBox:: operator= ( const MBoundingBox & other )

Description

Assignment operator.

Arguments

  • other bounding box to take value from

Return Value

  • reference to this bounding box

This class has no child classes.


Autodesk® Maya® 2008 © 1997-2007 Autodesk, Inc. All rights reserved. doc++ Copyright