SbBox2f(3)
π SbBox2f β the SbBox2f(3) page, bestie edition π
Library Functions Manual energy, but make it cute. Yes we're doing a whole 2D box today. She's small but she's mighty.
β¨ NAME β¨
SbBox2f β the class that's a 2 dimensional box with floating point corner coordinates. That's it. That's her. π
πΈ SYNOPSIS πΈ
#include <Inventor/SbBox.h>
π¦ Public Member Functions
SbBox2f (void)
SbBox2f (float xmin, float ymin, float xmax, float ymax)
SbBox2f (const SbVec2f &min, const SbVec2f &max)
SbBox2f (const SbBox2d &box)
SbBox2f (const SbBox2s &box)
SbBox2f (const SbBox2i32 &box)
~SbBox2f (void)
void setBounds (float xmin, float ymin, float xmax, float ymax)
void setBounds (const SbVec2f &min, const SbVec2f &max)
SbBox2f & setBounds (const SbBox2d &box)
SbBox2f & setBounds (const SbBox2s &box)
SbBox2f & setBounds (const SbBox2i32 &box)
void getBounds (float &xmin, float &ymin, float &xmax, float &ymax)
const
void getBounds (SbVec2f &min, SbVec2f &max) const
const SbVec2f & getMin (void) const
SbVec2f & getMin (void)
const SbVec2f & getMax (void) const
SbVec2f & getMax (void)
void extendBy (const SbVec2f &point)
void extendBy (const SbBox2f &box)
void makeEmpty (void)
SbBool isEmpty (void) const
SbBool hasArea (void) const
SbBool intersect (const SbVec2f &point) const
SbBool intersect (const SbBox2f &box) const
SbVec2f getClosestPoint (const SbVec2f &p) const
SbVec2f getCenter (void) const
void getOrigin (float &x0, float &y0) const
void getSize (float &w, float &h) const
float getAspectRatio (void) const
π«Ά Friends
int operator== (const SbBox2f &b1, const SbBox2f &b2)
int operator!= (const SbBox2f &b1, const SbBox2f &b2)
π Detailed Description
The SbBox2f class is a 2 dimensional box with floating point corner coordinates. π
Okay so this box class is literally used by so many other classes in Coin for data exchange and storage. She's the friend everyone borrows a hoodie from. She provides two box corners with floating point coordinates, which β among other things β is useful for representing screen or canvas dimensions in normalized coordinates. Slay.
See also
SbBox2d,SbBox2i32,SbBox2s,SbBox3d,SbBox3f,SbBox3i32,SbBox3s,SbXfBox3d,SbXfBox3f
The whole box family, together. Family reunion. π§
π Constructor & Destructor Documentation
SbBox2f::SbBox2f (void )
The default constructor makes an empty box. Nothing in it. Aesthetic of a blank canvas. β¨
References makeEmpty().
Referenced by extendBy(), intersect(), operator!=, and operator==.
SbBox2f::SbBox2f (float xmin, float ymin, float xmax, float ymax)
Constructs a box with the given corners.
Heads up bestie:xminshould be less thanxmaxandyminshould be less thanymaxif you want to make a valid box. Otherwise it's giving chaos.
References setBounds().
SbBox2f::SbBox2f (const SbVec2f & min, const SbVec2f & max)
Constructs a box with the given lower left and upper right corners.
Same deal: the coordinates ofminshould be less than the coordinates ofmaxif you want to make a valid box.
References setBounds().
SbBox2f::SbBox2f (const SbBox2d & box) β [inline], [explicit]
Constructs a box with coordinates from box, converting the coordinates to floating point values.
Since: Coin-2.5
References setBounds().
SbBox2f::SbBox2f (const SbBox2s & box) β [inline], [explicit]
Constructs a box with coordinates from box, converting the coordinates to floating point values.
Since: Coin-2.5
References setBounds().
SbBox2f::SbBox2f (const SbBox2i32 & box) β [inline], [explicit]
Constructs a box with coordinates from box, converting the coordinates to floating point values.
Since: Coin-2.5
References setBounds().
SbBox2f::~SbBox2f (void )
Destructor. She's done. Closing the tab. π¦
π Member Function Documentation
void SbBox2f::setBounds (float xmin, float ymin, float xmax, float ymax)
Reset the boundaries of the box. Fresh start, new you. πΈ
xminshould be less thanxmaxandyminshould be less thanymaxif you want to make a valid box.
See also: getBounds().
References SoDebugError::postWarning().
Referenced by SbBox2f(), SbBox2f(), SbBox2f(), SbBox2f(), and SbBox2f().
void SbBox2f::setBounds (const SbVec2f & min, const SbVec2f & max)
Reset the boundaries of the box with the given corners.
The coordinates ofminshould be less than the coordinates ofmaxif you want to make a valid box.
See also: getBounds().
References SoDebugError::postWarning().
SbBox2f & SbBox2f::setBounds (const SbBox2d & box)
Reset the boundaries of the box to the boundaries of the given box.
Returns reference to self. Main character returns herself. π
See also: getBounds()
Since: Coin-2.5
References SbBox2d::getMax(), SbBox2d::getMin(), SbBox2d::isEmpty(), and makeEmpty().
SbBox2f & SbBox2f::setBounds (const SbBox2s & box)
Reset the boundaries of the box to the boundaries of the given box.
Returns reference to self.
See also: getBounds()
Since: Coin-2.5
References SbBox2s::getMax(), SbBox2s::getMin(), SbBox2s::isEmpty(), and makeEmpty().
SbBox2f & SbBox2f::setBounds (const SbBox2i32 & box)
Reset the boundaries of the box to the boundaries of the given box.
Returns reference to self.
See also: getBounds()
Since: Coin-2.5
References SbBox2i32::getMax(), SbBox2i32::getMin(), SbBox2i32::isEmpty(), and makeEmpty().
void SbBox2f::getBounds (float & xmin, float & ymin, float & xmax, float & ymax) const
Returns the box boundaries. Giving you the receipts. π§Ύ
See also: setBounds(), getMin(), getMax().
void SbBox2f::getBounds (SbVec2f & min, SbVec2f & max) const
Returns the box corner points.
See also: setBounds(), getMin(), getMax().
const SbVec2f & SbBox2f::getMin (void ) const
Returns the lower left corner of the box.
See also: getOrigin(), getMax().
Referenced by extendBy(), SoGlyph::getWidth(), intersect(), operator==, SbBox2d::setBounds(), SbBox2i32::setBounds(), and SbBox2s::setBounds().
SbVec2f & SbBox2f::getMin (void ) β [inline]
Returns the lower left corner of the box.
See also: getOrigin(), getMax().
Since: Coin-2.5
const SbVec2f & SbBox2f::getMax (void ) const
Returns the upper right corner of the box.
See also: getMin().
Referenced by extendBy(), SoGlyph::getWidth(), intersect(), operator==, SbBox2d::setBounds(), SbBox2i32::setBounds(), and SbBox2s::setBounds().
SbVec2f & SbBox2f::getMax (void ) β [inline]
Returns the upper right corner of the box.
See also: getMin().
Since: Coin-2.5
void SbBox2f::extendBy (const SbVec2f & point)
Extend the boundaries of the box by the given point β like, make the box fit around the point if it isn't already situated within it. Growth mindset fr fr. π±
Referenced by extendBy(), and SoShape::getScreenSize().
void SbBox2f::extendBy (const SbBox2f & box)
Extend the boundaries of the box by the given box parameter. This is equal to calling the above method twice with the corner points. Twice the effort, one function call. πͺ
References extendBy(), getMax(), getMin(), SoDebugError::postWarning(), and SbBox2f().
void SbBox2f::makeEmpty (void )
Marks this as an empty box.
See also: isEmpty().
Referenced by SoShape::getScreenSize(), SbBox2f(), setBounds(), setBounds(), and setBounds().
SbBool SbBox2f::isEmpty (void ) const
Check if this has been marked as an empty box.
See also: makeEmpty().
Referenced by SbBox2d::setBounds(), SbBox2i32::setBounds(), and SbBox2s::setBounds().
SbBool SbBox2f::hasArea (void ) const
Check if the box has "positive" area β i.e. the lower left corner is actually lower and more to the left than the other corner point. Geometry said be honest. π
SbBool SbBox2f::intersect (const SbVec2f & point) const
Check if point lies within the boundaries of this box. Are you in or are you out? πͺ
SbBool SbBox2f::intersect (const SbBox2f & box) const
Check if box lies wholly or partly within the boundaries of this box.
References getMax(), getMin(), and SbBox2f().
SbVec2f SbBox2f::getClosestPoint (const SbVec2f & p) const
Return the point on the box closest to the given point p. Come here, bestie. π«
References getCenter().
SbVec2f SbBox2f::getCenter (void ) const
Returns the center point of the box. Dead center. The moment. β¨
Referenced by getClosestPoint().
void SbBox2f::getOrigin (float & x0, float & y0) const
Returns the coordinates of the box origin (i.e. the lower left corner).
See also: getMin().
void SbBox2f::getSize (float & w, float & h) const
Returns width and height of box. w and h, the duo. π
References SoDebugError::postWarning().
Referenced by SoShape::getScreenSize().
float SbBox2f::getAspectRatio (void ) const
Returns aspect ratio of box, which is defined as box width divided on box height.
References SoDebugError::postWarning().
π Friends And Related Symbol Documentation
int operator== (const SbBox2f & b1, const SbBox2f & b2) β [friend]
Check b1 and b2 for equality. Twin flames? Maybe. π
References getMax(), getMin(), and SbBox2f().
int operator!= (const SbBox2f & b1, const SbBox2f & b2) β [friend]
Check b1 and b2 for inequality. It's not you, it's the coordinates. π
References SbBox2f().
π¦ Author
Generated automatically by Doxygen for Coin from the source code. (So if the vibes are immaculate but the prose is slightly unhinged, that's why. π)
And that's the whole page, bestie! This one came from Coin, Version 2.5.0 β SbBox2f(3), manual section 3, and she ate. Go forth and make valid boxes (remember: min < max, or else). Periodt. π
β¨π
π¦ where this page comes from
- fedora 43: Coin2-devel 2.5.0-52.fc43 Β· GPL-2.0-only
- fedora 43: Coin2-devel 2.5.0-52.fc43 Β· GPL-2.0-only
- fedora 44: Coin2-devel 2.5.0-54.fc44 Β· GPL-2.0-only
- fedora 44: Coin2-devel 2.5.0-54.fc44 Β· GPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms