Coin Logo http://www.sim.no
http://www.coin3d.org

Public Member Functions | Protected Attributes | List of all members
SbBox3i32 Class Reference

#include <Inventor/SbBox.h>

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)
 
SbBox3i32setBounds (int32_t xmin, int32_t ymin, int32_t zmin, int32_t xmax, int32_t ymax, int32_t zmax)
 
SbBox3i32setBounds (const SbVec3i32 &minpoint, const SbVec3i32 &maxpoint)
 
SbBox3i32setBounds (const SbBox3s &box)
 
SbBox3i32setBounds (const SbBox3f &box)
 
SbBox3i32setBounds (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 SbVec3i32getMin (void) const
 
SbVec3i32getMin (void)
 
const SbVec3i32getMax (void) const
 
SbVec3i32getMax (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
 

Detailed Description

See also
SbBox2d, SbBox2f, SbBox2i32, SbBox2s, SbBox3d, SbBox3f, SbBox3s, SbXfBox3d, SbXfBox3f
Since
Coin-2.5

Constructor & Destructor Documentation

◆ SbBox3i32() [1/6]

SbBox3i32::SbBox3i32 ( void  )
inline

The default constructor makes an empty box.

◆ SbBox3i32() [2/6]

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() [3/6]

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() [4/6]

SbBox3i32::SbBox3i32 ( const SbBox3s box)
inlineexplicit

Constructs a box with the values from the box converting the values to 32-bit integers

◆ SbBox3i32() [5/6]

SbBox3i32::SbBox3i32 ( const SbBox3f box)
inlineexplicit

Constructs a box with the values from the box converting the values to 32-bit integers

◆ SbBox3i32() [6/6]

SbBox3i32::SbBox3i32 ( const SbBox3d box)
inlineexplicit

Constructs a box with the values from the box converting the values to 32-bit integers

Member Function Documentation

◆ setBounds() [1/5]

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().

◆ setBounds() [2/5]

SbBox3i32 & SbBox3i32::setBounds ( const SbVec3i32 minpoint,
const SbVec3i32 maxpoint 
)
inline

Reset the boundaries to the boundaries given. Returns reference to self.

See also
getBounds()

◆ setBounds() [3/5]

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().

◆ setBounds() [4/5]

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().

◆ setBounds() [5/5]

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().

◆ getBounds() [1/2]

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.

◆ getBounds() [2/2]

void SbBox3i32::getBounds ( SbVec3i32 minpoint,
SbVec3i32 maxpoint 
) const
inline

Returns the boundaries of the box.

◆ getMin() [1/2]

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().

◆ getMin() [2/2]

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().

◆ getMax() [1/2]

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().

◆ getMax() [2/2]

SbVec3i32 & SbBox3i32::getMax ( void  )
inline

Returns the maximum point. This should usually be the upper right corner point of the box.

See also
getMin().

◆ extendBy() [1/3]

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().

◆ extendBy() [2/3]

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().

◆ extendBy() [3/3]

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().

◆ transform()

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(), SbMatrix::multVecMatrix(), SoDebugError::postWarning(), setBounds(), and SbVec3f::setValue().

◆ makeEmpty()

void SbBox3i32::makeEmpty ( void  )

Marks this as an empty box.

See also
isEmpty().

References SbVec3i32::setValue().

Referenced by setBounds().

◆ isEmpty()

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().

◆ hasVolume()

SbBool SbBox3i32::hasVolume ( void  ) const
inline

Check if the box has been correctly specified and by that virtue has volume.

◆ getVolume()

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.

◆ intersect() [1/3]

SbBool SbBox3i32::intersect ( const SbVec3i32 pt) const

Check if the given point lies within the boundaries of this box.

◆ intersect() [2/3]

SbBool SbBox3i32::intersect ( const SbBox3i32 bb) const

Check if the given box lies wholly or partly within the boundaries of this box.

◆ intersect() [3/3]

SbBool SbBox3i32::intersect ( const SbVec3f pt) const

Check if the given point lies within the boundaries of this box.

◆ outside()

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().

◆ getClosestPoint()

SbVec3f SbBox3i32::getClosestPoint ( const SbVec3f pt) const

Return the point on the box closest to the given point.

References getCenter().

◆ getCenter()

SbVec3f SbBox3i32::getCenter ( void  ) const
inline

Returns the center point of the box.

Referenced by getClosestPoint().

◆ getOrigin()

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().

◆ getSize()

void SbBox3i32::getSize ( int32_t &  sizeX,
int32_t &  sizeY,
int32_t  sizeZ 
) const
inline

Returns width, height and depth of box.

◆ getSpan()

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().


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

Copyright © 1998-2007 by Systems in Motion AS. All rights reserved.

Generated on Fri Jul 20 2018 for Coin by Doxygen. 1.8.14