C++ API Reference
MBoundingBox Class Reference

Implementation of a 3D bounding box. More...

#include <MBoundingBox.h>

Public Member Functions

 MBoundingBox ()
 Default constructor. More...
 
 MBoundingBox (const MBoundingBox &src)
 Copy constructor. More...
 
 MBoundingBox (const MPoint &corner1, const MPoint &corner2)
 Constructor that creates a bounding box which contains the given points. More...
 
 ~MBoundingBox ()
 Class destructor.
 
void clear ()
 Empties the current bounding box.
 
void transformUsing (const MMatrix &matrix)
 Apply the given transformation to this bounding box. More...
 
void expand (const MPoint &point)
 Expand the bounding box to include the given point. More...
 
void expand (const MBoundingBox &box)
 Expand the bounding box to include a second bounding box. More...
 
bool contains (const MPoint &point) const
 Returns true if the bounding box contains the given point. More...
 
bool intersects (const MBoundingBox &box, double tol=0.0) const
 Returns true if the bounding box intersects another given bounding box. More...
 
double width () const
 Returns the width of the bounding box. More...
 
double height () const
 Returns the height of the bounding box. More...
 
double depth () const
 Returns the depth of the bounding box. More...
 
MPoint center () const
 Returns the center of the bounding box. More...
 
MPoint min () const
 Returns the minimum point for the bounding box. More...
 
MPoint max () const
 Returns the maximum point for the bounding box. More...
 
MBoundingBoxoperator= (const MBoundingBox &other)
 Assignment operator. More...
 

Detailed Description

Implementation of a 3D bounding box.

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.

Examples:
AbcBullet/AbcWriteJob.cpp, AbcExport/AbcWriteJob.cpp, AbcExport/AbcWriteJob.h, apiDirectionalLightShape/apiDirectionalLightShape.cpp, apiDirectionalLightShape/apiDirectionalLightShape.h, apiMeshShape/apiMeshShape.cpp, apiMeshShape/apiMeshShape.h, apiMeshShape/apiMeshShapeUI.cpp, apiMeshShape/apiMeshSubSceneOverride.cpp, footPrintManip/footPrintManip.cpp, footPrintNode/footPrintNode.cpp, footPrintNode_GeometryOverride/footPrintNode_GeometryOverride.cpp, footPrintNode_GeometryOverride_AnimatedMaterial/footPrintNode_GeometryOverride_AnimatedMaterial.cpp, footPrintNode_SubSceneOverride/footPrintNode_SubSceneOverride.cpp, geometryOverrideExample1/geometryOverrideExample1.cpp, geometryOverrideExample1/geometryOverrideExample1.h, geometryOverrideExample2/geometryOverrideExample2.cpp, geometryOverrideExample2/geometryOverrideExample2.h, geometryReplicator/geometryReplicator.cpp, gpuCache/CacheReaderAlembic.cpp, gpuCache/CacheReaderAlembic.h, gpuCache/CacheWriter.cpp, gpuCache/CacheWriter.h, gpuCache/CacheWriterAlembic.cpp, gpuCache/gpuCacheCmd.cpp, gpuCache/gpuCacheDrawOverride.cpp, gpuCache/gpuCacheDrawOverride.h, gpuCache/gpuCacheFrustum.h, gpuCache/gpuCacheGLPickingSelect.cpp, gpuCache/gpuCacheIsectUtil.cpp, gpuCache/gpuCacheIsectUtil.h, gpuCache/gpuCacheSample.cpp, gpuCache/gpuCacheSample.h, gpuCache/gpuCacheShapeNode.cpp, gpuCache/gpuCacheShapeNode.h, gpuCache/gpuCacheSpatialGrid.cpp, gpuCache/gpuCacheSpatialGrid.h, gpuCache/gpuCacheSpatialSubdivision.cpp, gpuCache/gpuCacheSpatialSubdivision.h, gpuCache/gpuCacheSubSceneOverride.cpp, gpuCache/gpuCacheUnitBoundingBox.cpp, gpuCache/gpuCacheUnitBoundingBox.h, gpuCache/gpuCacheUtil.h, gpuCache/gpuCacheVBOProxy.cpp, gpuCache/gpuCacheVBOProxy.h, hwPhongShader/hwPhongShader.cpp, MayaPluginForSpreticle/spReticleLoc.cpp, MayaPluginForSpreticle/spReticleLoc.h, rawfootPrintNode/rawfootPrintNode.cpp, simpleEvaluationDraw/simpleEvaluationDraw.cpp, simpleFluidEmitter/simpleFluidEmitter.cpp, squaresNode_noDepthTest/squaresNode_noDepthTest.cpp, swissArmyManip/swissArmyManip.cpp, tessellatedQuad/TessellatedQuadNode.cpp, tessellatedQuad/TessellatedQuadNode.h, uiDrawManager/uiDrawManager.cpp, viewDX11DeviceAccess/viewDX11DeviceAccess.cpp, viewRenderOverride/viewRenderOverride.h, and viewRenderOverride/viewRenderOverrideUserOperation.cpp.

Constructor & Destructor Documentation

Default constructor.

Creates an empty bounding box.

MBoundingBox ( const MBoundingBox src)

Copy constructor.

Parameters
[in]srcbounding box to copy
MBoundingBox ( const MPoint corner1,
const MPoint corner2 
)

Constructor that creates a bounding box which contains the given points.

Each point will represent one corner of the box.

Parameters
[in]corner1first corner point
[in]corner2second corner point

Member Function Documentation

void transformUsing ( const MMatrix matrix)

Apply the given transformation to this bounding box.

Parameters
[in]matrixtransformation matrix
Examples:
AbcExport/AbcWriteJob.cpp, gpuCache/gpuCacheShapeNode.cpp, and simpleFluidEmitter/simpleFluidEmitter.cpp.
void expand ( const MPoint point)

Expand the bounding box to include the given point.

Parameters
[in]pointnew point to include in the bounding box.
Examples:
AbcExport/AbcWriteJob.cpp, gpuCache/CacheReaderAlembic.cpp, gpuCache/gpuCacheCmd.cpp, gpuCache/gpuCacheSpatialGrid.cpp, gpuCache/gpuCacheSpatialSubdivision.cpp, and tessellatedQuad/TessellatedQuadNode.cpp.
void expand ( const MBoundingBox box)

Expand the bounding box to include a second bounding box.

Parameters
[in]boxbounding box to include in this bounding box.
bool contains ( const MPoint point) const

Returns true if the bounding box contains the given point.

Parameters
[in]pointpoint to check for inclusion in this bounding box
Returns
true if the point is contained in this bounding box
bool intersects ( const MBoundingBox box,
double  tol = 0.0 
) const

Returns true if the bounding box intersects another given bounding box.

Parameters
[in]boxbounding box to check for intersection
[in]toltolerance of the intersection check
Returns
true if the bounding boxes intersect
MPoint center ( ) const
MBoundingBox & operator= ( const MBoundingBox other)

Assignment operator.

Parameters
[in]otherbounding box to take value from
Returns
Reference to this bounding box

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