24 #ifndef PXR_BASE_GF_BBOX3D_H 25 #define PXR_BASE_GF_BBOX3D_H 33 #include "pxr/base/gf/api.h" 37 PXR_NAMESPACE_OPEN_SCOPE
94 _isDegenerate =
false;
95 _hasZeroAreaPrimitives =
false;
101 _matrix = rhs._matrix;
102 _inverse = rhs._inverse;
103 _isDegenerate = rhs._isDegenerate;
104 _hasZeroAreaPrimitives = rhs._hasZeroAreaPrimitives;
112 _isDegenerate =
false;
113 _hasZeroAreaPrimitives =
false;
119 _hasZeroAreaPrimitives =
false;
125 _SetMatrices(matrix);
131 _SetMatrices(matrix);
165 _hasZeroAreaPrimitives = hasThem;
171 return _hasZeroAreaPrimitives;
182 _SetMatrices(_matrix * matrix);
224 return (_box == b._box &&
225 _matrix == b._matrix);
233 return !(*
this == that);
246 bool _hasZeroAreaPrimitives;
267 PXR_NAMESPACE_CLOSE_SCOPE
269 #endif // PXR_BASE_GF_BBOX3D_H Basic type: 3-dimensional floating point range.
const GfRange3d & GetRange() const
Returns the range of the axis-aligned untransformed box.
bool operator==(const GfBBox3d &b) const
Component-wise equality test.
const GfRange3d & GetBox() const
Returns the range of the axis-aligned untransformed box.
friend size_t hash_value(const GfBBox3d &b)
Hash.
void Set(const GfRange3d &box, const GfMatrix4d &matrix)
Sets the axis-aligned box and transformation matrix.
GfBBox3d(const GfBBox3d &rhs)
Copy constructor.
static size_t Combine(Args &&... args)
Produce a hash code by combining the hash codes of several objects.
const GfMatrix4d & GetInverseMatrix() const
Returns the inverse of the transformation matrix.
GF_API GfRange3d ComputeAlignedRange() const
Returns the axis-aligned range (as a GfRange3d) that results from applying the transformation matrix ...
void SetHasZeroAreaPrimitives(bool hasThem)
Sets the zero-area primitives flag to the given value.
Stores a 4x4 matrix of double elements.
bool HasZeroAreaPrimitives() const
Returns the current state of the zero-areaprimitives flag".
GfBBox3d()
The default constructor leaves the box empty, the transformation matrix identity, and the zero-areapr...
GfMatrix4d & SetIdentity()
Sets the matrix to the identity matrix.
GfRange3d ComputeAlignedBox() const
Returns the axis-aligned range (as a GfRange3d) that results from applying the transformation matrix ...
void SetRange(const GfRange3d &box)
Sets the range of the axis-aligned box only.
bool operator !=(const GfBBox3d &that) const
Component-wise inequality test.
GF_API std::ostream & operator<<(std::ostream &, const GfBBox3d &)
Output a GfBBox3d using the format [(range) matrix zeroArea].
GfBBox3d(const GfRange3d &box, const GfMatrix4d &matrix)
This constructor takes a box and a transformation matrix.
GF_API GfVec3d ComputeCentroid() const
Returns the centroid of the bounding box.
Basic type for a vector of 3 double components.
void SetMatrix(const GfMatrix4d &matrix)
Sets the transformation matrix only.
void Transform(const GfMatrix4d &matrix)
Transforms the bounding box by the given matrix, which is assumed to be a global transformation to ap...
GF_API double GetVolume() const
Returns the volume of the box (0 for an empty box).
GfBBox3d(const GfRange3d &box)
This constructor takes a box and sets the matrix to identity.
Basic type: arbitrarily oriented 3D bounding box.
static GF_API GfBBox3d Combine(const GfBBox3d &b1, const GfBBox3d &b2)
Combines two bboxes, returning a new bbox that contains both.
const GfMatrix4d & GetMatrix() const
Returns the transformation matrix.