man SbXfBox3f () - 3D box with an associated transformation matrix

NAME

SbXfBox3f - 3D box with an associated transformation matrix

INHERITS FROM

SbBox3f > SbXfBox3f

SYNOPSIS

#include <Inventor/SbBox.h> Methods from class SbXfBox3f: c } c } SbXfBox3f()

c } c } SbXfBox3f(const SbVec3f &_min, const SbVec3f &_max)

c } c } SbXfBox3f(const SbBox3f &box)

c } c } ~SbXfBox3f()

c } c } setTransform(const SbMatrix &m)

c } c } getTransform() const

c } c } getInverse() const

c } c } getCenter() const

c } c } extendBy(const SbVec3f &pt)

c } c } extendBy(const SbBox3f &bb)

c } c } extendBy(const SbXfBox3f &bb)

c } c } intersect(const SbVec3f &pt) const

c } c } intersect(const SbBox3f &bb) const

c } c } setBounds(float xmin, float ymin, float zmin, float xmax, float ymax, float zmax)

c } c } setBounds(const SbVec3f &_min, const SbVec3f &_max)

c } c } getBounds(float &xmin, float &ymin, float &zmin, float &xmax, float &ymax, float &zmax) const

c } c } getBounds(SbVec3f &_min, SbVec3f &_max) const

c } c } getOrigin(float &originX, float &originY, float &originZ)

c } c } getSize(float &sizeX, float &sizeY, float &sizeZ)

c } c } getVolume() const

c } c } makeEmpty()

c } c } isEmpty() const

c } c } hasVolume() const

c } c } getSpan(const SbVec3f &direction, float &dMin, float &dMax) const

c } c } transform(const SbMatrix &m)

c } c } project() const

c } c } operator ==(const SbXfBox3f &b1, const SbXfBox3f &b2)

c } c } operator !=(const SbXfBox3f &b1, const SbXfBox3f &b2) Methods from class SbBox3f: c } c } getMin()

c } c } getMax()

DESCRIPTION

A 3D box with an arbitrary transformation applied. This class is useful when a box will be transformed frequently; if an SbBox3f is used for this purpose it will expand each time it is transformed in order to keep itself axis-aligned. Transformations can be accumulated on an SbXfBox3f without expanding the box, and after all transformations have been done, the box can be expanded to an axis-aligned box if necessary.

METHODS

c } c } SbXfBox3f()

c } c } SbXfBox3f(const SbVec3f &_min, const SbVec3f &_max)

c } c } SbXfBox3f(const SbBox3f &box)

c } c } ~SbXfBox3f()

Constructors and destructor. c } c } setTransform(const SbMatrix &m)

Sets the transformation on the box. c } c } getTransform() const

c } c } getInverse() const

Gets the transformation on the box, and its inverse. c } c } getCenter() const

Returns the center of the box. c } c } extendBy(const SbVec3f &pt)

Extends the box (if necessary) to contain the given 3D point. If the box has had a non-identity transformation applied using the setTransform() method, the point is assumed to be in the transformed space. For example, the following code sequence:

SbXfBox3f bbox; bbox.extendBy(SbVec3f(0,0,0));
SbMatrix trans; trans.setTranslate(SbVec3f(1,1,1));
bbox.setTransform(trans);
bbox.extendBy(SbVec3f(0,0,0));

will result in a bounding box extending from (-1,-1,-1) to (0,0,0) in bbox'es local (untransformed) space. c } c } extendBy(const SbBox3f &bb)

Extends the box (if necessary) to contain the given SbBox3f. If the box has had a non-identity transformation applied using the setTransform() method, the given SbBox3f is assumed to be in the transformed space. c } c } extendBy(const SbXfBox3f &bb)

Extends the box (if necessary) to contain the given SbXfBox3f. c } c } intersect(const SbVec3f &pt) const

Returns TRUE if intersection of given point and this box is not empty. c } c } intersect(const SbBox3f &bb) const

Returns TRUE if intersection of given box and this box is not empty. c } c } setBounds(float xmin, float ymin, float zmin, float xmax, float ymax, float zmax)

c } c } setBounds(const SbVec3f &_min, const SbVec3f &_max)

c } c } getBounds(float &xmin, float &ymin, float &zmin, float &xmax, float &ymax, float &zmax) const

c } c } getBounds(SbVec3f &_min, SbVec3f &_max) const

Set and get the bounds of the box. c } c } getOrigin(float &originX, float &originY, float &originZ)

Returns origin (minimum point) of the box. c } c } getSize(float &sizeX, float &sizeY, float &sizeZ)

Returns size of the box. c } c } getVolume() const

Gives the volume of the box (0 for an empty box). c } c } makeEmpty()

Sets the box to contain nothing. c } c } isEmpty() const

Checks if the box is empty (degenerate). c } c } hasVolume() const

Checks if the box has volume; i.e., all three dimensions have positive size. c } c } getSpan(const SbVec3f &direction, float &dMin, float &dMax) const

Finds the extent of the box along a particular direction. c } c } transform(const SbMatrix &m)

Transforms the box by the given matrix. c } c } project() const

Projects an SbXfBox3f to an SbBox3f c } c } operator ==(const SbXfBox3f &b1, const SbXfBox3f &b2)

c } c } operator !=(const SbXfBox3f &b1, const SbXfBox3f &b2)

Equality comparisons.

SEE ALSO

SbBox3f, SbBox2f, SbBox2s, SbVec3f, SbVec2f, SbVec2s, SbMatrix, SoGetBoundingBoxAction