Open Inventor Reference
SbBox2s Class Reference

2D box class. More...

#include <Inventor/SbBox.h>

List of all members.

Public Member Functions

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

Friends

INVENTOR_API int operator== (const SbBox2s &b1, const SbBox2s &b2)
 Equality comparisons.
INVENTOR_API int 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 470 of file SbBox.h.


Constructor & Destructor Documentation

SbBox2s::SbBox2s ( ) [inline]

Definition at line 474 of file SbBox.h.

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 478 of file SbBox.h.

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 483 of file SbBox.h.

SbBox2s::~SbBox2s ( ) [inline]

Definition at line 487 of file SbBox.h.


Member Function Documentation

void SbBox2s::extendBy ( const SbVec2s pt)
void SbBox2s::extendBy ( const SbBox2s r)
float SbBox2s::getAspectRatio ( ) const [inline]

Definition at line 530 of file SbBox.h.

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

Definition at line 514 of file SbBox.h.

References SbVec2s::getValue().

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

Definition at line 518 of file SbBox.h.

const SbVec2s& SbBox2s::getMax ( ) const [inline]

Definition at line 492 of file SbBox.h.

const SbVec2s& SbBox2s::getMin ( ) const [inline]

Definition at line 490 of file SbBox.h.

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

Definition at line 522 of file SbBox.h.

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

Definition at line 526 of file SbBox.h.

SbBool SbBox2s::intersect ( const SbBox2s bb) const
SbBool SbBox2s::intersect ( const SbVec2s pt) const
void SbBox2s::makeEmpty ( )
void SbBox2s::setBounds ( short  xmin,
short  ymin,
short  xmax,
short  ymax 
) [inline]

Definition at line 507 of file SbBox.h.

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

Definition at line 511 of file SbBox.h.


Friends And Related Function Documentation

INVENTOR_API int operator!= ( const SbBox2s b1,
const SbBox2s b2 
) [friend]

Definition at line 538 of file SbBox.h.

INVENTOR_API int operator== ( const SbBox2s b1,
const SbBox2s b2 
) [friend]

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