SBBOX2F(3iv)

πŸ’– SbBox2f πŸ’–

okay so bestie, welcome to the SbBox2f page from the 3IV manual ✨ she's a 2D box class and honestly? main character energy, no notes.


🌈 INHERITS FROM

SbBox2f

Not me noticing it inherits from itself πŸ’€ that's literally what the page says, we're just reporting the facts fr fr πŸ™ˆ

✨ SYNOPSIS

#include <Inventor/SbBox.h>

Methods from class SbBox2f, in all their glory πŸ‘‘

                     SbBox2f()
                     SbBox2f(float xmin, float ymin, float xmax float ymax)
                     SbBox2f(const SbVec2f &min, const SbVec2f &max)
 void                ~SbBox2f()
 const SbVec2f &     getMin()
 const SbVec2f &     getMax()
 SbVec2f             getCenter()
 void                extendBy(const SbVec2f &point)
 void                extendBy(const SbBox2f &box)
 SbBool              intersect(const SbVec2f &point)
 SbBool              intersect(const SbBox2f &box)
 void                setBounds(float xmin, float ymin, float xmax, float
                          ymax)
 void                setBounds(const SbVec2f &min, const SbVec2f &max)
 void                getBounds(float &xmin, float &ymin, float &xmax, float
                          &ymax)
 void                getBounds(SbVec2f &min, SbVec2f &max)
 void                getOrigin(float &x0, float &y0)
 void                getSize(float &x, float &y)
 float               getAspectRatio()
 void                makeEmpty()
 SbBool              isEmpty()
 SbBool              hasArea()

πŸŽ€ DESCRIPTION

So. It's a 2D box πŸ“¦ with planes parallel to the major axes, and you define it with two points β€” both specified as floating point β€” sitting on a diagonal. That's it, that's the whole vibe.

She's part of the standard Inventor datatype classes, and she gets used as input and output to geometry operations. Lowkey essential, highkey underrated πŸ’…


πŸ’… METHODS

🫢 constructors + destructor

                     SbBox2f()
                     SbBox2f(float xmin, float ymin, float xmax float ymax)
                     SbBox2f(const SbVec2f &min, const SbVec2f &max)
 void                ~SbBox2f()

Constructors and destructor for a 2D float box, periodt. xmin, ymin, xmax, and ymax are the bounds of the box. And min and max? Those are the corners of the diagonal that define the box πŸ¦‹

πŸ” getMin() + getMax()

 const SbVec2f &     getMin()
 const SbVec2f &     getMax()

Returns the minimum and maximum points of the box. Short, sweet, slay πŸ’–

🎯 getCenter()

 SbVec2f             getCenter()

Returns the center of the box. Right in the middle, where she belongs ✨

🌱 extendBy()

 void                extendBy(const SbVec2f &point)
 void                extendBy(const SbBox2f &box)

Extends this box β€” only if necessary, bestie β€” so it contains the specified point or other box. Growth mindset 🌸

πŸ’₯ intersect()

 SbBool              intersect(const SbVec2f &point)
 SbBool              intersect(const SbBox2f &box)

Returns TRUE if the specified point or box intersects this box. Otherwise it's giving nothing and you get FALSE 🫢

πŸ“ setBounds()

 void                setBounds(float xmin, float ymin, float xmax, float
                          ymax)
 void                setBounds(const SbVec2f &min, const SbVec2f &max)

Sets the corners of the box. Two ways to do it, pick your fighter πŸ’…

πŸ“ getBounds()

 void                getBounds(float &xmin, float &ymin, float &xmax, float
                          &ymax)
 void                getBounds(SbVec2f &min, SbVec2f &max)

Gets the corners of the box. Same energy, opposite direction πŸ”

🌟 getOrigin()

 void                getOrigin(float &x0, float &y0)

Gets box origin. Where it all began πŸ₯Ή

πŸ“¦ getSize()

 void                getSize(float &x, float &y)

Gets box size. How much box, exactly πŸŽ€

πŸ¦‹ getAspectRatio()

 float               getAspectRatio()

Gets box aspect ratio. The proportions, the lewk 🌈

🧹 makeEmpty()

 void                makeEmpty()

Makes an empty box. Decluttering era 🧚

πŸ•³οΈ isEmpty()

 SbBool              isEmpty()

Returns TRUE if the box is empty, and FALSE otherwise. No in-between πŸ’€

πŸ“Š hasArea()

 SbBool              hasArea()

Returns TRUE if both dimensions of the box have positive size, and FALSE otherwise. Both of them. Not one. Both πŸ‘‘


πŸ¦‹ SEE ALSO

SbBox3f, SbXfBox3f, SbBox2s, SbVec3f, SbVec2f, SbVec2s, SbMatrix

Go read those next, bestie, they're all part of the same friend group 🫢


and that's the whole page πŸ’œ it's the SbBox2f(3IV) one, footer and all β€” literally just SbBox2f(3IV)() with no date attached, she's mysterious like that ✨ obsessed. mwah πŸŽ€