Open Inventor Reference
SbBox2s Class Reference

2D box class. More...

#include <Inventor/SbBox.h>

Public Member Functions

 SbBox2s ()
 Constructs an empty box. More...
 
 SbBox2s (short xmin, short ymin, short xmax, short ymax)
 Constructor for a 2D integer box. More...
 
 SbBox2s (const SbVec2s &min, const SbVec2s &max)
 Constructor for a 2D integer box. More...
 
 ~SbBox2s ()
 Destructor. More...
 
const SbVec2sgetMin () const
 Returns the minimum and maximum points of the box. More...
 
const SbVec2sgetMax () const
 Returns the minimum and maximum points of the box. More...
 
void extendBy (const SbVec2s &pt)
 Extends Box2s (if necessary) to contain given 2D point. More...
 
void extendBy (const SbBox2s &r)
 Extends Box2s (if necessary) to contain given Box2s. More...
 
bool intersect (const SbVec2s &pt) const
 Returns TRUE if intersection of given point and Box2s is not empty. More...
 
bool intersect (const SbBox2s &bb) const
 Returns TRUE if intersection of given Box2s and Box2s is not empty. More...
 
void setBounds (short xmin, short ymin, short xmax, short ymax)
 Sets the corners of the box. More...
 
void setBounds (const SbVec2s &_min, const SbVec2s &_max)
 Sets the corners of the box. More...
 
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
 Returns origin (minimum point) of box. More...
 
void getSize (short &sizeX, short &sizeY) const
 Returns box size. More...
 
float getAspectRatio () const
 Returns aspect ratio (ratio of width to height) of box. More...
 
void makeEmpty ()
 Makes an empty box. More...
 

Friends

INVENTOR_API bool operator== (const SbBox2s &b1, const SbBox2s &b2)
 Equality comparisons. More...
 
INVENTOR_API bool operator!= (const SbBox2s &b1, const SbBox2s &b2)
 

Detailed Description

2D box which has planes parallel to the major axes and is specified by two points (specified with short integers) on a diagonal. This class is part of the standard Inventor datatype classes and is used as input and output to geometry operations.

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

Definition at line 479 of file SbBox.h.

Constructor & Destructor Documentation

◆ SbBox2s() [1/3]

SbBox2s::SbBox2s ( )
inline

Definition at line 483 of file SbBox.h.

◆ SbBox2s() [2/3]

SbBox2s::SbBox2s ( short  xmin,
short  ymin,
short  xmax,
short  ymax 
)
inline

xmin, ymin, xmax, and ymax are the bounds of the box.

Definition at line 487 of file SbBox.h.

◆ SbBox2s() [3/3]

SbBox2s::SbBox2s ( const SbVec2s min,
const SbVec2s max 
)
inline

min and max are the corners of the diagonal that define the box.

Definition at line 492 of file SbBox.h.

◆ ~SbBox2s()

SbBox2s::~SbBox2s ( )
inline

Definition at line 496 of file SbBox.h.

Member Function Documentation

◆ extendBy() [1/2]

void SbBox2s::extendBy ( const SbBox2s r)

◆ extendBy() [2/2]

void SbBox2s::extendBy ( const SbVec2s pt)

◆ getAspectRatio()

float SbBox2s::getAspectRatio ( ) const
inline

Definition at line 539 of file SbBox.h.

◆ getBounds() [1/2]

void SbBox2s::getBounds ( SbVec2s _min,
SbVec2s _max 
) const
inline

Definition at line 527 of file SbBox.h.

◆ getBounds() [2/2]

void SbBox2s::getBounds ( short &  xmin,
short &  ymin,
short &  xmax,
short &  ymax 
) const
inline

Definition at line 523 of file SbBox.h.

◆ getMax()

const SbVec2s& SbBox2s::getMax ( ) const
inline

Definition at line 501 of file SbBox.h.

◆ getMin()

const SbVec2s& SbBox2s::getMin ( ) const
inline

Definition at line 499 of file SbBox.h.

◆ getOrigin()

void SbBox2s::getOrigin ( short &  originX,
short &  originY 
) const
inline

Definition at line 531 of file SbBox.h.

◆ getSize()

void SbBox2s::getSize ( short &  sizeX,
short &  sizeY 
) const
inline

Definition at line 535 of file SbBox.h.

◆ intersect() [1/2]

bool SbBox2s::intersect ( const SbBox2s bb) const

◆ intersect() [2/2]

bool SbBox2s::intersect ( const SbVec2s pt) const

◆ makeEmpty()

void SbBox2s::makeEmpty ( )

◆ setBounds() [1/2]

void SbBox2s::setBounds ( const SbVec2s _min,
const SbVec2s _max 
)
inline

Definition at line 520 of file SbBox.h.

◆ setBounds() [2/2]

void SbBox2s::setBounds ( short  xmin,
short  ymin,
short  xmax,
short  ymax 
)
inline

Definition at line 516 of file SbBox.h.

Friends And Related Function Documentation

◆ operator!=

INVENTOR_API bool operator!= ( const SbBox2s b1,
const SbBox2s b2 
)
friend

Definition at line 555 of file SbBox.h.

◆ operator==

INVENTOR_API bool operator== ( const SbBox2s b1,
const SbBox2s b2 
)
friend

The documentation for this class was generated from the following file: