
Basic type: arbitrarily oriented 3D bounding box. More...
Public Member Functions  
GfBBox3d ()  
The default constructor leaves the box empty, the transformation matrix identity, and the zeroareaprimitives flag" false . More...  
GfBBox3d (const GfBBox3d &rhs)  
Copy constructor. More...  
GfBBox3d (const GfRange3d &box)  
This constructor takes a box and sets the matrix to identity. More...  
GfBBox3d (const GfRange3d &box, const GfMatrix4d &matrix)  
This constructor takes a box and a transformation matrix. More...  
void  Set (const GfRange3d &box, const GfMatrix4d &matrix) 
Sets the axisaligned box and transformation matrix. More...  
void  SetMatrix (const GfMatrix4d &matrix) 
Sets the transformation matrix only. More...  
void  SetRange (const GfRange3d &box) 
Sets the range of the axisaligned box only. More...  
const GfRange3d &  GetRange () const 
Returns the range of the axisaligned untransformed box. More...  
const GfRange3d &  GetBox () const 
Returns the range of the axisaligned untransformed box. More...  
const GfMatrix4d &  GetMatrix () const 
Returns the transformation matrix. More...  
const GfMatrix4d &  GetInverseMatrix () const 
Returns the inverse of the transformation matrix. More...  
void  SetHasZeroAreaPrimitives (bool hasThem) 
Sets the zeroarea primitives flag to the given value. More...  
bool  HasZeroAreaPrimitives () const 
Returns the current state of the zeroareaprimitives flag". More...  
GF_API double  GetVolume () const 
Returns the volume of the box (0 for an empty box). More...  
void  Transform (const GfMatrix4d &matrix) 
Transforms the bounding box by the given matrix, which is assumed to be a global transformation to apply to the box. More...  
GF_API GfRange3d  ComputeAlignedRange () const 
Returns the axisaligned range (as a GfRange3d ) that results from applying the transformation matrix to the wxisaligned box and aligning the result. More...  
GfRange3d  ComputeAlignedBox () const 
Returns the axisaligned range (as a GfRange3d ) that results from applying the transformation matrix to the axisaligned box and aligning the result. More...  
GF_API GfVec3d  ComputeCentroid () const 
Returns the centroid of the bounding box. More...  
bool  operator== (const GfBBox3d &b) const 
Componentwise equality test. More...  
bool  operator != (const GfBBox3d &that) const 
Componentwise inequality test. More...  
Static Public Member Functions  
static GF_API GfBBox3d  Combine (const GfBBox3d &b1, const GfBBox3d &b2) 
Combines two bboxes, returning a new bbox that contains both. More...  
Friends  
size_t  hash_value (const GfBBox3d &b) 
Hash. More...  
Basic type: arbitrarily oriented 3D bounding box.
This class represents a threedimensional bounding box as an axisaligned box (GfRange3d
) and a matrix (GfMatrix4d
) to transform it into the correct space.
A GfBBox3d
is more useful than using just GfRange3d
instances (which are always axisaligned) for these reasons:
GfBBox3d
is generally much smaller than the GfRange3d
computed by transforming the box at each level.When bounding boxes are used in intersection test culling, it is sometimes useful to extend them a little bit to allow lowerdimensional objects with zero area, such as lines and points, to be intersected. For example, consider a cube constructed of line segments. The bounding box for this shape fits the cube exactly. If an application wants to allow a nearmiss of the silhouette edges of the cube to be considered an intersection, it has to loosen the bbox culling test a little bit.
To distinguish when this loosening is necessary, each GfBBox3d
instance maintains a flag indicating whether any zeroarea primitives are contained within it. The application is responsible for setting this flag correctly by calling SetHasZeroAreaPrimitives()
. The flag can be accessed during intersection tests by calling HasZeroAreaPrimitives()
. This flag is set by default in all constructors to false
.

inline 

inline 
Combines two bboxes, returning a new bbox that contains both.
This uses the coordinate space of one of the two original boxes as the space of the result; it uses the one that produces whe smaller of the two resulting boxes.

inline 
GF_API GfRange3d ComputeAlignedRange  (  )  const 
Returns the axisaligned range (as a GfRange3d
) that results from applying the transformation matrix to the wxisaligned box and aligning the result.
GF_API GfVec3d ComputeCentroid  (  )  const 
Returns the centroid of the bounding box.
The centroid is computed as the transformed centroid of the range.

inline 

inline 

inline 

inline 
GF_API double GetVolume  (  )  const 
Returns the volume of the box (0 for an empty box).

inline 

inline 

inline 

inline 

inline 
Sets the zeroarea primitives flag to the given value.

inline 

inline 

inline 