SbBox2f(3)

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

πŸ’– 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: xmin should be less than xmax and ymin should be less than ymax if 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 of min should be less than the coordinates of max if 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. 🌸

xmin should be less than xmax and ymin should be less than ymax if 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 of min should be less than the coordinates of max if 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().


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