NAME
SbBox3i32 -
SYNOPSIS
#include <Inventor/SbBox.h>
Detailed Description
See also:
SbBox2d, SbBox2f, SbBox2i32, SbBox2s, SbBox3d, SbBox3f, SbBox3s,
SbXfBox3d, SbXfBox3f
Since:
Coin-2.5
Public Member Functions
SbBox3i32 (void)
SbBox3i32 (int32_t xmin, int32_t ymin, int32_t zmin, int32_t xmax,
int32_t ymax, int32_t zmax)
SbBox3i32 (const SbVec3i32 &minpoint, const SbVec3i32 &maxpoint)
SbBox3i32 (const SbBox3s &box)
SbBox3i32 (const SbBox3f &box)
SbBox3i32 (const SbBox3d &box)
SbBox3i32 & setBounds (int32_t xmin, int32_t ymin, int32_t zmin,
int32_t xmax, int32_t ymax, int32_t zmax)
SbBox3i32 & setBounds (const SbVec3i32 &minpoint, const SbVec3i32
&maxpoint)
SbBox3i32 & setBounds (const SbBox3s &box)
SbBox3i32 & setBounds (const SbBox3f &box)
SbBox3i32 & setBounds (const SbBox3d &box)
void getBounds (int32_t &xmin, int32_t &ymin, int32_t &zmin, int32_t
&xmax, int32_t &ymax, int32_t &zmax) const
void getBounds (SbVec3i32 &minpoint, SbVec3i32 &maxpoint) const
const SbVec3i32 & getMin (void) const
SbVec3i32 & getMin (void)
const SbVec3i32 & getMax (void) const
SbVec3i32 & getMax (void)
void extendBy (const SbVec3i32 &pt)
void extendBy (const SbBox3i32 &bb)
void extendBy (const SbVec3f &pt)
void transform (const SbMatrix &m)
void makeEmpty (void)
SbBool isEmpty (void) const
SbBool hasVolume (void) const
float getVolume (void) const
SbBool intersect (const SbVec3i32 &pt) const
SbBool intersect (const SbBox3i32 &bb) const
SbBool intersect (const SbVec3f &pt) const
SbBool outside (const SbMatrix &MVP, int &cullBits) const
SbVec3f getClosestPoint (const SbVec3f &pt) const
SbVec3f getCenter (void) const
void getOrigin (int32_t &originX, int32_t &originY, int32_t &originZ)
const
void getSize (int32_t &sizeX, int32_t &sizeY, int32_t sizeZ) const
void getSpan (const SbVec3f &direction, float &dmin, float &dmax) const
Protected Attributes
SbVec3i32 minpt
SbVec3i32 maxpt
Constructor & Destructor Documentation
SbBox3i32::SbBox3i32 (void) [inline]
The default constructor makes an empty box.
SbBox3i32::SbBox3i32 (int32_t xmin, int32_t ymin, int32_t zmin, int32_t
xmax, int32_t ymax, int32_t zmax) [inline]
Constructs a box with the given corners.
minx should be less than maxx, miny should be less than maxy and minz
should be less than maxz if you want to make a valid box.
SbBox3i32::SbBox3i32 (const SbVec3i32 & minpoint, const SbVec3i32 &
maxpoint) [inline]
Constructs a box with the given corners.
The coordinates of min should be less than the coordinates of max if
you want to make a valid box.
SbBox3i32::SbBox3i32 (const SbBox3s & box) [inline, explicit]
Constructs a box with the values from the box converting the values to
32-bit integers
SbBox3i32::SbBox3i32 (const SbBox3f & box) [inline, explicit]
Constructs a box with the values from the box converting the values to
32-bit integers
SbBox3i32::SbBox3i32 (const SbBox3d & box) [inline, explicit]
Constructs a box with the values from the box converting the values to
32-bit integers
Member Function Documentation
SbBox3i32 & SbBox3i32::setBounds (int32_t xmin, int32_t ymin, int32_t zmin,
int32_t xmax, int32_t ymax, int32_t zmax) [inline]
Reset the boundaries to the boundaries given. Returns reference to
self.
See also:
getBounds()
Referenced by transform().
SbBox3i32 & SbBox3i32::setBounds (const SbVec3i32 & minpoint, const
SbVec3i32 & maxpoint) [inline]
Reset the boundaries to the boundaries given. Returns reference to
self.
See also:
getBounds()
SbBox3i32 & SbBox3i32::setBounds (const SbBox3s & box)
Reset the boundaries to the boundaries of the given box.
Returns reference to self.
See also:
getBounds()
References SbBox3s::getMax(), SbBox3s::getMin(), SbBox3s::isEmpty(),
makeEmpty(), and SbVec3i32::setValue().
SbBox3i32 & SbBox3i32::setBounds (const SbBox3f & box)
Reset the boundaries to the boundaries of the given box.
Returns reference to self.
See also:
getBounds()
References SbBox3f::getMax(), SbBox3f::getMin(), SbBox3f::isEmpty(),
makeEmpty(), and SbVec3i32::setValue().
SbBox3i32 & SbBox3i32::setBounds (const SbBox3d & box)
Reset the boundaries to the boundaries of the given box.
Returns reference to self.
See also:
getBounds()
References SbBox3d::getMax(), SbBox3d::getMin(), SbBox3d::isEmpty(),
makeEmpty(), and SbVec3i32::setValue().
void SbBox3i32::getBounds (int32_t & xmin, int32_t & ymin, int32_t & zmin,
int32_t & xmax, int32_t & ymax, int32_t & zmax) const [inline]
Returns the boundaries of the box.
void SbBox3i32::getBounds (SbVec3i32 & minpoint, SbVec3i32 & maxpoint)
const [inline]
Returns the boundaries of the box.
const SbVec3i32 & SbBox3i32::getMin (void) const [inline]
Returns the minimum point. This should usually be the lower left corner
point of the box.
See also:
getOrigin(), getMax().
Referenced by extendBy(), SbBox3s::setBounds(), SbBox3f::setBounds(),
and SbBox3d::setBounds().
SbVec3i32 & SbBox3i32::getMin (void) [inline]
Returns the minimum point. This should usually be the lower left corner
point of the box.
See also:
getOrigin(), getMax().
const SbVec3i32 & SbBox3i32::getMax (void) const [inline]
Returns the maximum point. This should usually be the upper right
corner point of the box.
See also:
getMin().
Referenced by extendBy(), SbBox3s::setBounds(), SbBox3f::setBounds(),
and SbBox3d::setBounds().
SbVec3i32 & SbBox3i32::getMax (void) [inline]
Returns the maximum point. This should usually be the upper right
corner point of the box.
See also:
getMin().
void SbBox3i32::extendBy (const SbVec3i32 & pt)
Extend the boundaries of the box by the given point, i.e. make the
point fit inside the box if it isn’t already so.
References isEmpty(), and SbVec3i32::setValue().
Referenced by extendBy(), and transform().
void SbBox3i32::extendBy (const SbBox3i32 & bb)
Extend the boundaries of the box by the given box parameter. This is
equal to calling extendBy() twice with the corner points.
References extendBy(), getMax(), getMin(), and isEmpty().
void SbBox3i32::extendBy (const SbVec3f & pt)
Extend the boundaries of the box by the given point, i.e. make the
point fit inside the box if it isn’t already so.
References extendBy().
void SbBox3i32::transform (const SbMatrix & m)
Transform the box by the matrix, and change its boundaries to contain
the transformed box.
Doesn’t touch illegal/empty boxes.
References extendBy(), isEmpty(), maxpt, minpt,
SbMatrix::multVecMatrix(), SoDebugError::postWarning(), setBounds(),
and SbVec3f::setValue().
void SbBox3i32::makeEmpty (void)
Marks this as an empty box.
See also:
isEmpty().
References SbVec3i32::setValue().
Referenced by setBounds().
SbBool SbBox3i32::isEmpty (void) const [inline]
Check if this has been marked as an empty box.
Referenced by extendBy(), SbBox3s::setBounds(), SbBox3f::setBounds(),
SbBox3d::setBounds(), and transform().
SbBool SbBox3i32::hasVolume (void) const [inline]
Check if the box has been correctly specified and by that virtue has
volume.
float SbBox3i32::getVolume (void) const [inline]
Check if the box has ’positive’ volume, i.e. the lower left corner is
actually lower and more left than the maximum point.
SbBool SbBox3i32::intersect (const SbVec3i32 & pt) const
Check if the given point lies within the boundaries of this box.
SbBool SbBox3i32::intersect (const SbBox3i32 & bb) const
Check if the given box lies wholly or partly within the boundaries of
this box.
References maxpt, and minpt.
SbBool SbBox3i32::intersect (const SbVec3f & pt) const
Check if the given point lies within the boundaries of this box.
SbBool SbBox3i32::outside (const SbMatrix & MVP, int & cullbits) const
Check if the box is outside the view volume defined by the mvp matrix.
Sets cullbits according to which planes we’re inside or outside. Bit 0
(0x1) is cleared when box is completely inside left and right clipping
planes. Bit 1 (0x2) is cleared when box is inside top and bottom
clipping planes. Bit 2 (0x4) is cleared when box is inside near and far
clipping planes.
Returns TRUE if box is completely outside one of the clipping planes.
FALSE otherwise.
References SbMatrix::multVecMatrix().
SbVec3f SbBox3i32::getClosestPoint (const SbVec3f & pt) const
Return the point on the box closest to the given point.
References getCenter().
SbVec3f SbBox3i32::getCenter (void) const [inline]
Returns the center point of the box.
Referenced by getClosestPoint().
void SbBox3i32::getOrigin (int32_t & originX, int32_t & originY, int32_t &
originZ) const [inline]
Returns the coordinates of the box origin (i.e. the lower left corner).
See also:
getMin().
void SbBox3i32::getSize (int32_t & sizeX, int32_t & sizeY, int32_t sizeZ)
const [inline]
Returns width, height and depth of box.
void SbBox3i32::getSpan (const SbVec3f & dir, float & dmin, float & dmax)
const
Find the span of the box in the given direction (i.e. how much room in
the given direction the box needs). The distance is returned as the
minimum and maximum distance from origo to the closest and furthest
plane defined by the direction vector and each of the box’ corners. The
difference between these values gives the span.
References SbVec3f::dot(), SbVec3f::normalize(),
SoDebugError::postWarning(), and SbVec3f::setValue().
Author
Generated automatically by Doxygen for Coin from the source code.