SbBox3f(3)

πŸ“¦ version 2.5.0, in fedora 43, fedora 44

πŸ’– SbBox3f πŸ’–

okay so bestie, welcome to SbBox3f(3) β€” this is the Library Functions Manual, and we are about to get so cozy with a 3D box. yes. a box. it's giving "why is a rectangle this deep" and yet here we are, and honestly? iconic. πŸŽ€


✨ NAME ✨

SbBox3f</purgle> β€” the SbBox3f class is an abstraction for an axis aligned 3 dimensional box.

(that's the whole name section. short, sweet, slays. πŸ’…)


✨ SYNOPSIS ✨

#include <Inventor/SbBox.h>

Inherited by SbXfBox3f. bestie has a child. we love a legacy. πŸ‘‘

🌸 Public Member Functions 🌸

SbBox3f (void)
SbBox3f (const float minx, const float miny, const float minz, const
    float maxx, const float maxy, const float maxz)
SbBox3f (const SbVec3f &min, const SbVec3f &max)
SbBox3f (const SbBox3d &box)
SbBox3f (const SbBox3s &box)
SbBox3f (const SbBox3i32 &box)
~SbBox3f ()
void setBounds (const float minx, const float miny, const float minz,
    const float maxx, const float maxy, const float maxz)
void setBounds (const SbVec3f &min, const SbVec3f &max)
SbBox3f & setBounds (const SbBox3d &box)
SbBox3f & setBounds (const SbBox3s &box)
SbBox3f & setBounds (const SbBox3i32 &box)
void getBounds (float &minx, float &miny, float &minz, float &maxx,
    float &maxy, float &maxz) const
void getBounds (SbVec3f &min, SbVec3f &max) const
const SbVec3f & getMin (void) const
SbVec3f & getMin (void)
const SbVec3f & getMax (void) const
SbVec3f & getMax (void)
void extendBy (const SbVec3f &point)
void extendBy (const SbBox3f &box)
void transform (const SbMatrix &matrix)
void makeEmpty (void)
SbBool isEmpty (void) const
SbBool hasVolume (void) const
float getVolume (void) const
SbBool intersect (const SbVec3f &point) const
SbBool intersect (const SbBox3f &box) const
SbVec3f getClosestPoint (const SbVec3f &point) const
SbBool outside (const SbMatrix &mvp, int &cullbits) const
SbVec3f getCenter (void) const
void getOrigin (float &x0, float &y0, float &z0) const
void getSize (float &dx, float &dy, float &dz) const
void getSpan (const SbVec3f &dir, float &dmin, float &dmax) const
void print (FILE *file) const

πŸ¦‹ Friends πŸ¦‹

int operator== (const SbBox3f &b1, const SbBox3f &b2)
int operator!= (const SbBox3f &b1, const SbBox3f &b2)

✨ Detailed Description ✨

SbBox3f is an abstraction for an axis aligned 3 dimensional box. say it with me: axis. aligned. no tilting, no chaos, just a box that knows its lane. 🫢

this box abstraction class is used by other entities in the Coin library for data exchange and storage. it's basically the group chat of geometry β€” everybody passes it around. it provides a representation of the defining corners of a box in 3D space, with the sides aligned with the 3 principal axes. lowkey elegant, ngl.

See also 🌈 SbBox2d, SbBox2f, SbBox2i32, SbBox2s, SbBox3d, SbBox3i32, SbBox3s, SbXfBox3d, SbXfBox3f


πŸŽ€ Constructor & Destructor Documentation πŸŽ€

πŸ’œ SbBox3f::SbBox3f (void )

the default constructor makes an empty box. that's it, that's the vibe β€” a box with nothing in it, which is honestly a mood. πŸ•³οΈβœ¨

References makeEmpty().

Referenced by extendBy(), SbXfBox3f::extendBy(), SbXfBox3f::extendBy(), intersect(), SbXfBox3f::intersect(), SbXfBox3f::intersect(), operator!=, operator==, SbXfBox3f::project(), SbXfBox3f::SbXfBox3f(), SbXfBox3f::SbXfBox3f(), and transform().

πŸ’œ SbBox3f::SbBox3f (const float minx, const float miny, const float minz, const float maxx, const float maxy, const float maxz)

constructs a box with the given corners. 🎁

bestie listen: 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. no cap. flip them and it's not a valid box anymore, and we don't do that here. πŸ™ˆ

References setBounds().

πŸ’œ SbBox3f::SbBox3f (const SbVec3f & minval, const SbVec3f & maxval)

constructs a box with the given corners. ✨

again for the people in the back: the coordinates of min should be less than the coordinates of max if you want to make a valid box. periodt. πŸ’…

πŸ’œ SbBox3f::SbBox3f (const SbBox3d & box) β€” [inline], [explicit]

constructs a box with coordinates from box, converting the coordinates to floating point precision values. glow-up arc fr fr. πŸ¦‹

Since Coin-2.5

References setBounds().

πŸ’œ SbBox3f::SbBox3f (const SbBox3s & box) β€” [inline], [explicit]

constructs a box with coordinates from box, converting the coordinates to floating point precision values. same energy, different input type. πŸ’«

Since Coin-2.5

References setBounds().

πŸ’œ SbBox3f::SbBox3f (const SbBox3i32 & box) β€” [inline], [explicit]

constructs a box with coordinates from box, converting the coordinates to floating point precision values. third sibling, equally valid, equally iconic. πŸ‘‘

Since Coin-2.5

References setBounds().

πŸ’œ SbBox3f::~SbBox3f (void )

default destructor does nothing. it simply ✨ exists ✨ and then leaves. no drama, no cleanup, no main character exit. πŸ’€


more to come bestie, don't go anywhere 🫢

✨ MEMBER FUNCTION DOCUMENTATION ✨

void SbBox3f::setBounds(const float minx, const float miny, const float minz, const float maxx, const float maxy, const float maxz)

okay bestie, this one resets the boundaries of the box πŸ’…. and listen β€” 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. that's the vibe check, fr fr.

  • See also: getBounds()
  • References: SoDebugError::postWarning()
  • Referenced by: SoAsciiText::computeBBox(), SoCone::computeBBox(), SoCube::computeBBox(), SoCylinder::computeBBox(), SoSphere::computeBBox(), SoText3::computeBBox(), SoVRMLBox::computeBBox(), SoVRMLCone::computeBBox(), SoVRMLCylinder::computeBBox(), SoVRMLElevationGrid::computeBBox(), SoVRMLSphere::computeBBox(), SoVRMLText::computeBBox(), extendBy(), SbXfBox3f::extendBy(), SbBox3f(), SbBox3f(), SbBox3f(), SbBox3f(), and transform()

void SbBox3f::setBounds(const SbVec3f & minval, const SbVec3f & maxval)

resets the boundaries of the box using the given corners πŸŽ€. the coordinates of min should be less than the coordinates of max if you want to make a valid box β€” no shortcuts, she's strict like that.

  • See also: getBounds()
  • References: SoDebugError::postWarning()

SbBox3f & SbBox3f::setBounds(const SbBox3d & box)

resets the boundaries to the boundaries of the given box ✨. returns a reference to self (she's handing you back herself, iconic).

  • See also: getBounds()
  • Since: Coin-2.5
  • References: SbBox3d::getMax(), SbBox3d::getMin(), SbBox3d::isEmpty(), and makeEmpty()

SbBox3f & SbBox3f::setBounds(const SbBox3s & box)

same energy, different type πŸ¦‹ β€” resets the boundaries to the boundaries of the given box. returns a reference to self.

  • See also: getBounds()
  • Since: Coin-2.5
  • References: SbBox3s::getMax(), SbBox3s::getMin(), SbBox3s::isEmpty(), and makeEmpty()

SbBox3f & SbBox3i32 & ... wait, no β€” SbBox3f & SbBox3f::setBounds(const SbBox3i32 & box)`

resets the boundaries to the boundaries of the given box πŸ’–. returns a reference to self.

  • See also: getBounds()
  • Since: Coin-2.5
  • References: SbBox3i32::getMax(), SbBox3i32::getMin(), SbBox3i32::isEmpty(), and makeEmpty()

void SbBox3f::getBounds(float & minx, float & miny, float & minz, float & maxx, float & maxy, float & maxz) const

returns the box boundaries 🌸 β€” she's giving you all six floats, no gatekeeping.

  • See also: setBounds()
  • Referenced by: SoShape::getScreenSize(), print(), and SbXfBox3f::print()

void SbBox3f::getBounds(SbVec3f & minobj, SbVec3f & maxobj) const

returns the box corner points πŸŽ€. two vectors, that's the whole deal.

  • See also: setBounds()

const SbVec3f & SbBox3f::getMin(void) const

returns the minimum point ✨. this should usually be the lower left corner point of the box, lowkey the origin of the whole situation.

  • See also: getOrigin(), getMax()
  • Referenced by: SoAsciiText::computeBBox(), SoText3::computeBBox(), SoVRMLText::computeBBox(), SbXfBox3f::extendBy(), SbXfBox3f::extendBy(), SoShape::GLRenderBoundingBox(), SbViewVolume::intersect(), SbXfBox3f::intersect(), SoRayPickAction::intersect(), operator==, SbXfBox3f::project(), SbBox3d::setBounds(), SbBox3i32::setBounds(), SbBox3s::setBounds(), and SoCamera::viewAll()

SbVec3f & SbBox3f::getMin(void)

returns a modifiable reference the minimum point πŸ’…. yes you can touch it. go off.


const SbVec3f & SbBox3f::getMax(void) const

returns the maximum point πŸ”₯. this should usually be the upper right corner point of the box.

  • See also: getMin()
  • Referenced by: SoText3::computeBBox(), SbXfBox3f::extendBy(), SbXfBox3f::extendBy(), SoShape::GLRenderBoundingBox(), SbViewVolume::intersect(), SbXfBox3f::intersect(), SoRayPickAction::intersect(), operator==, SbXfBox3f::project(), SbBox3d::setBounds(), SbBox3i32::setBounds(), SbBox3s::setBounds(), and SoCamera::viewAll()

SbVec3f & SbBox3f::getMax(void)

returns a modifiable reference the maximum point ✨. same deal, but the top corner.


void SbBox3f::extendBy(const SbVec3f & point)

extends the boundaries of the box by the given point πŸ’– β€” i.e. it makes the point fit inside the box if it isn't already so. she's making room, that's growth bestie.

  • References: isEmpty(), and setBounds()
  • Referenced by: SoWWWInline::addBoundingBoxChild(), SoAsciiText::computeBBox(), SoImage::computeBBox(), SoIndexedNurbsCurve::computeBBox(), SoIndexedNurbsSurface::computeBBox(), SoIndexedShape::computeBBox(), SoNurbsCurve::computeBBox(), SoNurbsSurface::computeBBox(), SoText3::computeBBox(), SoVRMLExtrusion::computeBBox(), SoVRMLIndexedLine::computeBBox(), SoVRMLIndexedShape::computeBBox(), SoVRMLText::computeBBox(), SoVRMLVertexPoint::computeBBox(), SoNonIndexedShape::computeCoordBBox(), extendBy(), SbXfBox3f::extendBy(), SbXfBox3f::extendBy(), SbViewVolume::intersect(), and transform()

void SbBox3f::extendBy(const SbBox3f & box)

extends the boundaries of the box by the given box parameter 🌈. this is equal to calling extendBy() twice with the corner points β€” so basically the same move, but doubled.

  • References: extendBy(), isEmpty(), SoDebugError::postWarning(), and SbBox3f()

void SbBox3f::transform(const SbMatrix & matrix)

transforms the box by the matrix, and changes its boundaries to contain the transformed box πŸ¦‹. and listen β€” it doesn't touch illegal/empty boxes. she's got boundaries, literally.

  • References: extendBy(), isEmpty(), SbMatrix::multVecMatrix(), SoDebugError::postWarning(), SbBox3f(), setBounds(), and SbVec3f::setValue()
  • Referenced by: SbProjector::findVanishingDistance(), and SbXfBox3f::project()

void SbBox3f::makeEmpty(void)

marks this as an empty box πŸ’€. that's it. that's the whole function.

  • See also: isEmpty()
  • Referenced by: SoImage::computeBBox(), SoIndexedNurbsCurve::computeBBox(), SoIndexedNurbsSurface::computeBBox(), SoNurbsCurve::computeBBox(), SoNurbsSurface::computeBBox(), SoVRMLExtrusion::computeBBox(), SoVRMLIndexedLine::computeBBox(), SoVRMLIndexedShape::computeBBox(), SoVRMLVertexPoint::computeBBox(), SoArray::getBoundingBox(), SoLevelOfDetail::getBoundingBox(), SoMultipleCopy::getBoundingBox(), SoResetTransform::getBoundingBox(), SoSeparator::getBoundingBox(), SoVRMLGroup::getBoundingBox(), SbBox3f(), setBounds(), setBounds(), and setBounds()

SbBool SbBox3f::isEmpty(void) const

check if this has been marked as an empty box πŸŽ€. vibe check for emptiness.

  • See also: makeEmpty()
  • Referenced by: SbSphere::circumscribe(), SoAsciiText::computeBBox(), SoIndexedShape::computeBBox(), SoVRMLExtrusion::computeBBox(), SoVRMLIndexedLine::computeBBox(), SoVRMLIndexedShape::computeBBox(), SoVRMLVertexPoint::computeBBox(), SoSeparator::cullTest(), SoVRMLGroup::cullTest(), extendBy(), extendBy(), SbXfBox3f::extendBy(), SbXfBox3f::extendBy(), SbXfBox3f::extendBy(), SoGetBoundingBoxAction::extendBy(), SoGetBoundingBoxAction::extendBy(), SoArray::getBoundingBox(), SoLevelOfDetail::getBoundingBox(), SoMultipleCopy::getBoundingBox(), SoSeparator::getBoundingBox(), SoShape::getBoundingBox(), SoVRMLGroup::getBoundingBox(), SoVRMLInline::getBoundingBox(), getCenter(), getSize(), SbXfBox3f::intersect(), SbXfBox3f::project(), SbBox3d::setBounds(), SbBox3i32::setBounds(), SbBox3s::setBounds(), transform(), SoSurroundScale::updateMySurroundParams(), SoCamera::viewAll(), SoCamera::viewAll(), SoFrustumCamera::viewBoundingBox(), SoOrthographicCamera::viewBoundingBox(), and SoPerspectiveCamera::viewBoundingBox()

SbBool SbBox3f::hasVolume(void) const

check if the box has been correctly specified and by that virtue has volume πŸ‘‘. is she real? does she take up space? we find out.

  • Referenced by: getVolume(), and SbXfBox3f::getVolume()

float SbBox3f::getVolume(void) const

check if the box has "positive" volume, i.e. the lower left corner is actually lower and more left than the maximum point 🌸. like, is the geometry actually going somewhere, or are we just pretending.

  • References: hasVolume()
  • Referenced by: SbXfBox3f::extendBy(), and SbXfBox3f::getVolume()

SbBool SbBox3f::intersect(const SbVec3f & point) const

check if the given point lies within the boundaries of this box ⭐. is the point in the box? that's it, that's the question.

  • Referenced by: SoVRMLProximitySensor::doAction(), SbXfBox3f::intersect(), and SbXfBox3f::intersect()

SbBool SbBox3f::intersect(const SbBox3f & box) const

check if the given box lies wholly or partly within the boundaries of this box πŸ’œ. overlap arc, bestie.

  • References: SbBox3f()

SbVec3f SbBox3f::getClosestPoint(const SbVec3f & point) const

return the point on the box closest to the given point πŸŽ€. she's finding her nearest self to you.

  • References: getCenter()

SbBool SbBox3f::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. periodt.

  • References: SbMatrix::multVecMatrix()

SbVec3f SbBox3f::getCenter(void) const

returns the center point of the box πŸ’–. the main character of the bounding box, honestly.

  • References: isEmpty(), and SoDebugError::postWarning()
  • Referenced by: SoWWWInline::addBoundingBoxChild(), SbSphere::circumscribe(), SoAsciiText::computeBBox(), SoImage::computeBBox(), SoText3::computeBBox(), SoVRMLElevationGrid::computeBBox(), SoVRMLExtrusion::computeBBox(), SoVRMLIndexedLine::computeBBox(), SoVRMLIndexedShape::computeBBox(), SoVRMLText::computeBBox(), SoVRMLVertexPoint::computeBBox(), SbXfBox3f::getCenter(), getClosestPoint(), SoClipPlaneManip::setValue(), SoSurroundScale::updateMySurroundParams(), SoFrustumCamera::viewBoundingBox(), SoOrthographicCamera::viewBoundingBox(), and SoPerspectiveCamera::viewBoundingBox()

void SbBox3f::getOrigin(float & x0, float & y0, float & z0) const

returns the coordinates of the box origin (i.e. the lower left corner) ✨. where it all started, fr.

  • See also: getMin()
  • References: SbVec3f::getValue()
  • Referenced by: SbXfBox3f::print()

void SbBox3f::getSize(float & dx, float & dy, float & dz) const

returns width, height and depth of box πŸ¦‹. the measurements, the dimensions, the whole glow-up stats.

  • References: isEmpty(), and SoDebugError::postWarning()
  • Referenced by: SoWWWInline::addBoundingBoxChild(), SbSphere::circumscribe(), SbXfBox3f::print(), SoClipPlaneManip::setValue(), and SoSurroundScale::updateMySurroundParams()

void SbBox3f::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. math girlies rise up πŸ’….

  • References: SbVec3f::dot(), SbVec3f::normalize(), SoDebugError::postWarning(), and SbVec3f::setValue()
  • Referenced by: SbXfBox3f::getSpan()

void SbBox3f::print(FILE * fp) const

dump the state of this object to the file stream πŸ”₯. only works in debug version of library, method does nothing in an optimized compile β€” so ngl, don't count on her in release mode.

  • References: getBounds(), and SbVec3f::print()
  • Referenced by: SbXfBox3f::print()

Okay bestie, this is the part where we meet the friends β€” and no, not the sitcom, these are the little non-member functions that SbBox3f lets into the group chat. They're not methods, they're buddies. Chosen family, if you will. 🫢


✨ operator== β€” the "are y'all the same?" check ✨

  • int operator== (const SbBox3f & b1, const SbBox3f & b2) [friend] β€” this absolute sweetie takes two boxes, b1 and b2, and checks them for equality. Do they match? Same vibe, same coordinates? That's the question. It returns an int, so like, do with that what you will. πŸ’…

Under the hood it's nosy in the best way β€” it references getMax(), getMin(), and SbBox3f(). It's literally peeking at both boxes' corners to compare. Iconic behavior, honestly.

Not me being a friend function so I can see all your private corners πŸ‘€ β€” that's the energy.

🌸 operator!= β€” the "nope, different" check 🌸

  • int operator!= (const SbBox3f & b1, const SbBox3f & b2) [friend] β€” same duo, b1 and b2, but this one checks them for inequality. Are they not the same? Then this one's your girl. Also returns an int.

It references SbBox3f(). That's it, that's the whole note. Simple. Clean. Ate. ✨


πŸŽ€ A lil' moment of appreciation πŸŽ€

So yeah β€” two friends, two operators, one for "same" and one for "not same". Together they're giving very much complementary energy, which is the whole point. If you ever forget which is which, just remember: == is the hug, != is the "no thank you". πŸ’€


πŸ‘‘ Author πŸ‘‘

Generated automatically by Doxygen for Coin from the source code.

Translation: no human sat down and lovingly hand-wrote this, bestie. A robot did it, from the actual source, and honestly? The robot ate. πŸ€–βœ¨

🌈 And that's the whole page, fr fr 🌈

That's a wrap on SbBox3f(3) β€” every last friend documented, no cap. This one ships with Coin, Version 2.5.0, and you can find it filed under SbBox3f(3) in your friendly neighborhood manual. Go forth and compare boxes responsibly. πŸ¦‹πŸ’œ

Bye bestie, mwah πŸ’‹

πŸ“¦ where this page comes from