SBBOX2S(3iv)

SbBox2s πŸ’–

okay bestie, welcome to the 2D box class page from the 3IV manual β€” yes the title is literally SbBox2s(3IV)(), and we're gonna have a whole moment with it. pull up a chair, hydrate, and let's talk rectangles. ✨


✨ INHERITS FROM ✨

SbBox2s

(yes. it inherits from itself. iconique behavior honestly, we don't question it πŸ’…)


🌸 SYNOPSIS 🌸

#include <Inventor/SbBox.h>

Methods from class SbBox2s:

                     SbBox2s()
                     SbBox2s(short xmin, short ymin, short xmax, short
                          ymax)
                     SbBox2s(const SbVec2s &_min, const SbVec2s &_max)
 void                ~SbBox2s()
 const SbVec2s &     getMin() const
 const SbVec2s &     getMax() const
 void                extendBy(const SbVec2s &point)
 void                extendBy(const SbBox2s &box)
 SbBool              intersect(const SbVec2s &point) const
 SbBool              intersect(const SbBox2s &box) const
 void                setBounds(short xmin, short ymin, short xmax, short
                          ymax)
 void                setBounds(const SbVec2s &_min, const SbVec2s &_max)
 void                getBounds(short &xmin, short &ymin, short &xmax, short
                          &ymax) const
 void                getBounds(SbVec2s &_min, SbVec2s &_max) const
 void                getOrigin(short &originX, short &originY) const
 void                getSize(short &sizeX, short &sizeY) const
 float               getAspectRatio() const
 void                makeEmpty()
 int                 operator ==(const SbBox2s &b1, const SbBox2s &b2)
 int                 operator !=(const SbBox2s &b1, const SbBox2s &b2)

πŸ¦‹ DESCRIPTION πŸ¦‹

so picture this: it's a 2D box, right, and all its planes are parallel to the major axes. you define it with two points on a diagonal β€” and those points are specified with short integers, no cap. πŸ“

this class is part of the standard Inventor datatype classes and it gets used as input and output to geometry operations. she's a workhorse, she's everywhere, she's booked and busy. πŸ‘‘


πŸ’… METHODS πŸ’…

πŸŽ€ Constructors & destructor

                     SbBox2s()
                     SbBox2s(short xmin, short ymin, short xmax, short
                          ymax)
                     SbBox2s(const SbVec2s &_min, const SbVec2s &_max)
 void                ~SbBox2s()

Constructors and destructor for a 2D integer box, bestie. xmin, ymin, xmax, and ymax are the bounds of the box. min and max are the corners of the diagonal that define the box. 🫢


🌈 Getting the corners

 const SbVec2s &     getMin() const
 const SbVec2s &     getMax() const

Returns the minimum and maximum points of the box. the little corner and the big corner, a duo, a dynamic. ⭐


πŸ”₯ Growing the box

 void                extendBy(const SbVec2s &point)
 void                extendBy(const SbBox2s &box)

Extends this box (if necessary) to contain the specified point or other box. she's expanding her horizons, we love a glow-up. ✨


πŸ‘‘ Overlap check

 SbBool              intersect(const SbVec2s &point) const
 SbBool              intersect(const SbBox2s &box) const

Returns TRUE if the specified point or box intersects this box. vibe check: passed or not passed. πŸ’–


🧚 Setting the corners

 void                setBounds(short xmin, short ymin, short xmax, short
                          ymax)
 void                setBounds(const SbVec2s &_min, const SbVec2s &_max)

Sets the corners of the box. tell her who she is. πŸŽ€


πŸ“ Getting the corners (the other way)

 void                getBounds(short &xmin, short &ymin, short &xmax, short
                          &ymax) const
 void                getBounds(SbVec2s &_min, SbVec2s &_max) const

Gets the corners of the box. same energy, different signature. πŸ¦‹


🌸 Origin

 void                getOrigin(short &originX, short &originY) const

Returns origin (minimum point) of box. her humble beginnings. πŸ₯Ί


⭐ Size

 void                getSize(short &sizeX, short &sizeY) const

Returns box size. how big is she? now you know. πŸ“


πŸ’œ Aspect ratio

 float               getAspectRatio() const

Returns aspect ratio (ratio of width to height) of box. math but make it fashion. πŸ”₯


πŸ™ˆ Empty box

 void                makeEmpty()

Makes an empty box. sometimes you just gotta clear the cache, bestie. πŸ’€


✨ Equality comparisons

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

Equality comparisons. are they the same? are they not? the drama. πŸ‘€


🌈 SEE ALSO 🌈

SbBox3f, SbXfBox3f, SbBox2f, SbVec3f, SbVec2f, SbVec2s, SbMatrix

go read those too, they're all in the same friend group. πŸ’–


okay and that's the whole page!! this one's the SbBox2s(3IV)() manual, sourced straight from SbBox2s(3IV)(), so that's the version-and-date energy we're closing out with. go forth and box, queen. 🫢✨πŸ’