SbBox3i32 Class Reference
[Basics]

VSG extension 3D box class. More...

#include <Inventor/SbBox.h>

List of all members.

Public Member Functions

 SbBox3i32 ()
 SbBox3i32 (int xmin, int ymin, int zmin, int xmax, int ymax, int zmax)
 SbBox3i32 (const SbVec3i32 &_min, const SbVec3i32 &_max)
 SbBox3i32 (const SbBox3s &box)
 ~SbBox3i32 ()
const SbVec3i32getMin () const
const SbVec3i32getMax () const
SbVec3i32getMin ()
SbVec3i32getMax ()
SbVec3f getCenter () const
void extendBy (const SbVec3f &pt)
void extendBy (const SbBox3i32 &bb)
SbBool intersect (const SbVec3f &pt) const
SbBool intersect (const SbBox3i32 &bb) const
SbBool intersect (const SbVec3i32 &pt) const
SbBox3i32 intersection (const SbBox3i32 &box) const
SbBool contains (const SbBox3i32 &bb) const
SbBool outside (const SbMatrix &MVP, int &cullBits) const
void setBounds (int xmin, int ymin, int zmin, int xmax, int ymax, int zmax)
void setBounds (const SbVec3i32 &_min, const SbVec3i32 &_max)
void getBounds (int &xmin, int &ymin, int &zmin, int &xmax, int &ymax, int &zmax) const
void getBounds (SbVec3i32 &_min, SbVec3i32 &_max) const
SbVec3f getClosestPoint (const SbVec3f &point) const
void getOrigin (int &originX, int &originY, int &originZ) const
void getSize (int &sizeX, int &sizeY, int &sizeZ) const
SbVec3i32 getSize () const
void makeEmpty ()
SbBool isEmpty () const
SbBool hasVolume () const
void getSpan (const SbVec3f &direction, float &dMin, float &dMax) const
void transform (const SbMatrix &m)
float getVolume () const
SbBox3i32 operator= (const SbBox3s &box)

Friends

std::ostream & operator<< (std::ostream &os, const SbBox3i32 &b)
int operator== (const SbBox3i32 &b1, const SbBox3i32 &b2)
int operator!= (const SbBox3i32 &b1, const SbBox3i32 &b2)

Detailed Description

VSG extension 3D box class.

3D box which has planes parallel to the major axes and is specified by two points on a diagonal. This class is part of the standard Open Inventor datatype classes and is used as input and output to geometry operations (see SoGetBoundingBoxAction).

SEE ALSO

SbXfBox3f, SbBox2f, SbBox3s, SbBox2i32, SbBox2s, SbVec3i32, SbVec3s, SbVec2f, SbVec2i32, SbVec2s, SbMatrix, SoGetBoundingBoxAction


Constructor & Destructor Documentation

SbBox3i32::SbBox3i32 (  )  [inline]

Constructor for a 3D integer32 box.

The box is initially empty.

SbBox3i32::SbBox3i32 ( int  xmin,
int  ymin,
int  zmin,
int  xmax,
int  ymax,
int  zmax 
) [inline]

Constructor for a 3D integer32 box.

xmin , ymin , zmin , xmax , ymax and zmax are the bounds of the box.

SbBox3i32::SbBox3i32 ( const SbVec3i32 _min,
const SbVec3i32 _max 
) [inline]

Constructor for a 3D integer32 box.

m_min and m_max are the corners of the diagonal that define the box.

SbBox3i32::SbBox3i32 ( const SbBox3s box  ) 

Constructor given an SbBox3s (adapter).

SbBox3i32::~SbBox3i32 (  )  [inline]

Destructor.


Member Function Documentation

SbBool SbBox3i32::contains ( const SbBox3i32 bb  )  const [inline]

Returns TRUE if the specified box is fully contained inside this box.

void SbBox3i32::extendBy ( const SbBox3i32 bb  ) 

Extends this box (if necessary) to contain the specified box.

void SbBox3i32::extendBy ( const SbVec3f pt  ) 

Extends this box (if necessary) to contain the specified point.

void SbBox3i32::getBounds ( SbVec3i32 _min,
SbVec3i32 _max 
) const [inline]

Gets the corners of the box.

void SbBox3i32::getBounds ( int &  xmin,
int &  ymin,
int &  zmin,
int &  xmax,
int &  ymax,
int &  zmax 
) const [inline]

Gets the corners of the box.

SbVec3f SbBox3i32::getCenter (  )  const

Returns the center of the box.

SbVec3f SbBox3i32::getClosestPoint ( const SbVec3f point  )  const

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

(Returns the point on the center of the Z face if passed the center.)

SbVec3i32& SbBox3i32::getMax (  )  [inline]

Returns the maximum point of the box.

The maximum point is the corner of the box with the highest X, Y, and Z values.

const SbVec3i32& SbBox3i32::getMax (  )  const [inline]

Returns the maximum point of the box.

The maximum point is the corner of the box with the highest X, Y, and Z values.

SbVec3i32& SbBox3i32::getMin (  )  [inline]

Returns the minimum point of the box.

The minimum point is the corner of the box with the lowest X, Y, and Z values.

const SbVec3i32& SbBox3i32::getMin (  )  const [inline]

Returns the minimum point of the box.

The minimum point is the corner of the box with the lowest X, Y, and Z values.

void SbBox3i32::getOrigin ( int &  originX,
int &  originY,
int &  originZ 
) const [inline]

Gets box origin which is the same as the minimum corner of the box.

SbVec3i32 SbBox3i32::getSize (  )  const [inline]

Gets box size.

void SbBox3i32::getSize ( int &  sizeX,
int &  sizeY,
int &  sizeZ 
) const [inline]

Gets box size.

void SbBox3i32::getSpan ( const SbVec3f direction,
float &  dMin,
float &  dMax 
) const

Finds the span of a box along a specified direction.

The span is the total distance the box occupies along a given direction. The total distance is returned in the form of a minimum and maximum distance from the origin of each of the corners of the box along the given direction. The difference between these two values is the span.

float SbBox3i32::getVolume (  )  const

Returns the volume of the box.

SbBool SbBox3i32::hasVolume (  )  const [inline]

Returns TRUE if all three dimensions of the box have positive size, and FALSE otherwise.

SbBool SbBox3i32::intersect ( const SbVec3i32 pt  )  const

Returns TRUE if the specified point intersects this box.

SbBool SbBox3i32::intersect ( const SbBox3i32 bb  )  const

Returns TRUE if the specified box intersects this box.

SbBool SbBox3i32::intersect ( const SbVec3f pt  )  const

Returns TRUE if the specified point intersects this box.

SbBox3i32 SbBox3i32::intersection ( const SbBox3i32 box  )  const

Returns the intersection of the specified box with this box.

Returned box is empty if there is no intersection.

SbBool SbBox3i32::isEmpty (  )  const [inline]

Returns TRUE if the box is empty, and FALSE otherwise.

Note: Setting the box to all zeros does not make it "empty". Use the makeEmpty() method. (This method only returns true if the maximum X value is less than the minimum X value.)

void SbBox3i32::makeEmpty (  ) 

Makes an empty box.

SbBox3i32 SbBox3i32::operator= ( const SbBox3s box  ) 

Assignment operator given an SbBox3s (adapter).

SbBool SbBox3i32::outside ( const SbMatrix MVP,
int &  cullBits 
) const

Returns TRUE if bounding box is completely outside the view-volume defined by the model+view+projection matrix given.

"cullBits" keeps track of which view-volume clipping planes the box is completely inside of; if a 'parent' bounding box of this bounding box was found to be completely inside the left/right clipping planes, the low bit of cullBits will be set to zero, and this routine will not test this box against those planes. When cullBits is zero, it is a waste of time to call this function! Before calling this the first time, set cullBits to 7 (SoGLRenderAction and SoSeparator will handle this automatically for render culling).

void SbBox3i32::setBounds ( const SbVec3i32 _min,
const SbVec3i32 _max 
) [inline]

Sets the corners of the box.

void SbBox3i32::setBounds ( int  xmin,
int  ymin,
int  zmin,
int  xmax,
int  ymax,
int  zmax 
) [inline]

Sets the corners of the box.

void SbBox3i32::transform ( const SbMatrix m  ) 

Transforms box by matrix, enlarging box to contain result.


Friends And Related Function Documentation

int operator!= ( const SbBox3i32 b1,
const SbBox3i32 b2 
) [friend]

Inequality comparison.

std::ostream& operator<< ( std::ostream &  os,
const SbBox3i32 b 
) [friend]

Writes the box to the specified output stream.

int operator== ( const SbBox3i32 b1,
const SbBox3i32 b2 
) [friend]

Equality comparison.


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

Open Inventor Toolkit reference manual, generated on 4 Sep 2023
Copyright © Thermo Fisher Scientific All rights reserved.
https://www.openinventor.com/