SbXfBox3f(3)

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

✨ SbXfBox3f(3) β€” the manual page bestie ✨

okay so welcome to the SbXfBox3f(3) page, you're gonna eat this up πŸ’…


πŸŽ€ NAME πŸŽ€

SbXfBox3f β€” the class that's literally a 3 dimensional box with floating point coordinates and an attached transformation. like a box but it also has a whole vibe (the matrix) riding along with it πŸ¦‹


🌸 SYNOPSIS 🌸

#include <Inventor/SbBox.h>

Inherits SbBox3f (yes she's a nepo baby, and we love her for it πŸ‘‘).

πŸ’– Public Member Functions πŸ’–

  • SbXfBox3f(void)
  • SbXfBox3f(const SbVec3f &boxmin, const SbVec3f &boxmax)
  • SbXfBox3f(const SbBox3f &box)
  • ~SbXfBox3f()
  • void setTransform(const SbMatrix &m)
  • const SbMatrix & getTransform(void) const
  • const SbMatrix & getInverse(void) const
  • SbVec3f getCenter(void) const
  • void extendBy(const SbVec3f &pt)
  • void extendBy(const SbBox3f &bb)
  • void extendBy(const SbXfBox3f &bb)
  • SbBool intersect(const SbVec3f &pt) const
  • SbBool intersect(const SbBox3f &bb) const
  • SbBool intersect(const SbXfBox3f &bb) const
  • void getSpan(const SbVec3f &direction, float &dMin, float &dMax) const
  • SbBox3f project(void) const
  • void transform(const SbMatrix &m)
  • float getVolume(void) const
  • void print(FILE *file) const

🌈 Public Member Functions inherited from SbBox3f 🌈

  • 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 SbXfBox3f &b1, const SbXfBox3f &b2)
  • int operator!=(const SbXfBox3f &b1, const SbXfBox3f &b2)

πŸ¦‹ Detailed Description πŸ¦‹

The SbXfBox3f class is a 3 dimensional box with floating point coordinates and an attached transformation. periodt.

This box class is used by many other classes in Coin for data exchange. It provides storage for two box corners with floating point coordinates, and for a floating point 4x4 transformation matrix. so it's basically the social butterfly of Coin's data types, always getting passed around πŸ’…

See also

SbBox2d, SbBox2f, SbBox2i32, SbBox2s, SbBox3d, SbBox3f, SbBox3i32, SbBox3s, SbXfBox3d, SbMatrix. the whole box family reunion fr fr πŸŽ€


πŸ“ Constructor & Destructor Documentation πŸ“

SbXfBox3f::SbXfBox3f(void)

The default constructor makes an empty box and identity matrix. no thoughts, head empty, matrix identity ✨

Referenced by extendBy(), extendBy(), intersect(), operator!=, and operator==.

SbXfBox3f::SbXfBox3f(const SbVec3f & boxmin, const SbVec3f & boxmax)

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. like pls respect the ordering bestie πŸ™ˆ

References SbBox3f::SbBox3f().

SbXfBox3f::SbXfBox3f(const SbBox3f & box)

Constructs a box from the given SbBox3f.

The transformation is set to the identity matrix. fresh start energy πŸ’–

References SbBox3f::SbBox3f().

SbXfBox3f::~SbXfBox3f()

Default destructor does nothing. she simply leaves. iconic, no notes πŸ’€


πŸ’œ Member Function Documentation πŸ’œ

void SbXfBox3f::setTransform(const SbMatrix & m)

Sets the transformation to the given SbMatrix.

Referenced by extendBy(), SoArray::getBoundingBox(), SoLevelOfDetail::getBoundingBox(), SoMultipleCopy::getBoundingBox(), SoVRMLGroup::getBoundingBox(), and transform().

const SbMatrix & SbXfBox3f::getTransform(void) const

Returns the current transformation matrix.

Referenced by extendBy(), and print().

const SbMatrix & SbXfBox3f::getInverse(void) const

Returns the inverse of the current transformation matrix.

Referenced by extendBy(), extendBy(), extendBy(), and intersect().

SbVec3f SbXfBox3f::getCenter(void) const

Return the transformed center point of the box.

References SbBox3f::getCenter().

Referenced by SoMultipleCopy::getBoundingBox(), and print().

void SbXfBox3f::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.

The point is assumed to be in transformed space.

References SbBox3f::extendBy(), getInverse(), SbBox3f::isEmpty(), and SbMatrix::multVecMatrix().

Referenced by SoArray::getBoundingBox(), and SoMultipleCopy::getBoundingBox().

void SbXfBox3f::extendBy(const SbBox3f & bb)

Extend the boundaries of the box by the given bb parameter. The given box is assumed to be in transformed space.

The two given boxes will be combined in such a way so that the resultant bounding box always has the smallest possible volume. To accomplish this, the transformation on this SbXfBox3f will sometimes be flattened before it's combined with bb. she'll fold herself flat if that's what it takes, that's dedication πŸ’…

References SbBox3f::extendBy(), getInverse(), SbBox3f::getMax(), SbBox3f::getMin(), SbBox3f::getVolume(), getVolume(), SbBox3f::isEmpty(), SbMatrix::multVecMatrix(), SoDebugError::postInfo(), SoDebugError::postWarning(), project(), SbBox3f::SbBox3f(), SbXfBox3f(), SbBox3f::setBounds(), setTransform(), and SbVec3f::setValue().

void SbXfBox3f::extendBy(const SbXfBox3f & bb)

Extend the boundaries of the box by the given bb parameter.

The given box is assumed to be in transformed space.

Note: is not guaranteed to give an optimal result if used for bbox calculation since the transformation matrix might change. See documentation in SoGetBoundingBoxAction for more details. ngl this one's a little sus, don't expect perfection 😭

References getInverse(), SbBox3f::getMax(), SbBox3f::getMin(), getTransform(), getVolume(), SbBox3f::isEmpty(), SbMatrix::multRight(), SbMatrix::multVecMatrix(), SoDebugError::postInfo(), SoDebugError::postWarning(), SbBox3f::SbBox3f(), SbXfBox3f(), and SbVec3f::setValue().

SbBool SbXfBox3f::intersect(const SbVec3f & pt) const

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

The point is assumed to be in transformed space.

References SbBox3f::intersect().

Referenced by intersect().

SbBool SbXfBox3f::intersect(const SbBox3f & bb) const

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

The given box is assumed to be in transformed space.

References SbBox3f::getMax(), SbBox3f::getMin(), SbMatrix::identity(), SbBox3f::intersect(), SbBox3f::isEmpty(), SoDebugError::postWarning(), and SbBox3f::SbBox3f().

SbBool SbXfBox3f::intersect(const SbXfBox3f & xfbb) const

Check if two transformed boxes intersect.

This function is an extension for Coin, and it is not available in the original SGI Open Inventor v2.1 API. Coin said "I can do it better" and honestly? she did πŸ”₯

Since

Coin 2.0

References getInverse(), intersect(), SbBox3f::SbBox3f(), SbXfBox3f(), and transform().

void SbXfBox3f::getSpan(const SbVec3f & direction, 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 SbBox3f::getSpan(), and project().

SbBox3f SbXfBox3f::project(void) const

Project the SbXfBox3f into a SbBox3f.

This gives the same resulting SbBox3f as doing a SbBox3f::transform() with this transformation matrix as parameter.

References SbBox3f::getMax(), SbBox3f::getMin(), SbBox3f::isEmpty(), SbBox3f::SbBox3f(), and SbBox3f::transform().

Referenced by extendBy(), getSpan(), and print().

void SbXfBox3f::transform(const SbMatrix & m)

Overridden from SbBox3f, as the transformations are to be kept separate from the box in the SbXfBox3f class. boundaries bestie, we keep our transformation separate πŸ’…

References setTransform().

Referenced by SoGetBoundingBoxAction::extendBy(), SoGetBoundingBoxAction::extendBy(), SoArray::getBoundingBox(), SoMultipleCopy::getBoundingBox(), and intersect().

float SbXfBox3f::getVolume(void) const

Return box volume. Overridden from parent class to take into account the possibility of scaling in the transformation matrix.

References SbMatrix::det3(), SbBox3f::getVolume(), and SbBox3f::hasVolume().

Referenced by extendBy(), extendBy(), and print().

void SbXfBox3f::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 if you're on an optimized build and you get nothing, that's not a bug, that's just the vibe check failing 🫢

References SbBox3f::getBounds(), getCenter(), SbBox3f::getOrigin(), SbBox3f::getSize(), getTransform(), getVolume(), SbBox3f::print(), SbMatrix::print(), SbVec3f::print(), and project().


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

Check if b1 and b2 are equal. Return 1 if they are equal, or 0 if they are unequal. Note that the method will do a dumb component by component comparison. yes bestie, dumb. she's not doing the smart thing here, she's doing the simple thing. no cap.

References SbXfBox3f().

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

Check if b1 and b2 are unequal. Return 0 if they are equal, or 1 if they are unequal. See the note on operator==(). (the dumb component by component one, you remember πŸ™ˆ)

References SbXfBox3f().


🌟 Author 🌟

Generated automatically by Doxygen for Coin from the source code. the robots wrote this one, I just gave it a makeover πŸ’–


and that's the whole page bestie!! this was Coin, Version 2.5.0, SbXfBox3f(3) β€” k bye, go build something cute with your boxes πŸŽ€βœ¨

πŸ“¦ where this page comes from