2D box class. More...
#include <Inventor/SbBox.h>
Public Member Functions | |
SbBox2s () | |
SbBox2s (short xmin, short ymin, short xmax, short ymax) | |
SbBox2s (const SbVec2s &_min, const SbVec2s &_max) | |
~SbBox2s () | |
const SbVec2s & | getMin () const |
const SbVec2s & | getMax () const |
void | extendBy (const SbVec2s &pt) |
void | extendBy (const SbBox2s &r) |
SbBool | intersect (const SbVec2s &pt) const |
SbBool | intersect (const SbBox2s &bb) const |
SbBox2s | intersection (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 |
SbVec2s | getSize () const |
float | getAspectRatio () const |
void | makeEmpty () |
SbBool | isEmpty () const |
SbBool | hasArea () const |
Friends | |
int | operator== (const SbBox2s &b1, const SbBox2s &b2) |
int | operator!= (const SbBox2s &b1, const SbBox2s &b2) |
2D box class.
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 Open Inventor datatype classes and is used as input and output to geometry operations.
SbBox3f, SbXfBox3f, SbBox2f, SbVec3f, SbVec2f, SbVec2s, SbMatrix
SbBox2s::SbBox2s | ( | ) | [inline] |
Constructor for a 2D integer box.
The box is initially empty.
SbBox2s::SbBox2s | ( | short | xmin, | |
short | ymin, | |||
short | xmax, | |||
short | ymax | |||
) | [inline] |
Constructor for a 2D integer box.
xmin , ymin , xmax , and ymax are the bounds of the box.
Constructor for a 2D integer box.
m_min and m_max are the corners of the diagonal that defines the box.
SbBox2s::~SbBox2s | ( | ) | [inline] |
Destructor.
void SbBox2s::extendBy | ( | const SbBox2s & | r | ) |
Extends this box (if necessary) to contain the specified box.
void SbBox2s::extendBy | ( | const SbVec2s & | pt | ) |
Extends this box (if necessary) to contain the specified point.
float SbBox2s::getAspectRatio | ( | ) | const [inline] |
Returns aspect ratio (ratio of width to height) of box.
Gets the corners of the box.
void SbBox2s::getBounds | ( | short & | xmin, | |
short & | ymin, | |||
short & | xmax, | |||
short & | ymax | |||
) | const [inline] |
Gets the corners of the box.
const SbVec2s& SbBox2s::getMax | ( | ) | const [inline] |
Returns the maximum point of the box.
const SbVec2s& SbBox2s::getMin | ( | ) | const [inline] |
Returns the minimum point of the box.
void SbBox2s::getOrigin | ( | short & | originX, | |
short & | originY | |||
) | const [inline] |
Returns origin (minimum point) of box.
SbVec2s SbBox2s::getSize | ( | ) | const [inline] |
Return box size.
void SbBox2s::getSize | ( | short & | sizeX, | |
short & | sizeY | |||
) | const [inline] |
Returns box size.
SbBool SbBox2s::hasArea | ( | ) | const [inline] |
Returns TRUE if both dimensions of the box have positive size, and FALSE otherwise.
Returns TRUE if the specified box intersects this box.
Returns TRUE if the specified point intersects this box.
Returns the intersection of the specified box with this box.
Returned box is empty if there is no intersection.
SbBool SbBox2s::isEmpty | ( | ) | const [inline] |
Returns TRUE if the box is empty, and FALSE otherwise. Note: Setting the box to all zeros does not make it "empty". Use the makeEmpty() method. (This method only returns true if the maximum X value is less than the minimum X value.)
void SbBox2s::makeEmpty | ( | ) |
Makes an empty box.
Sets the corners of the box.
void SbBox2s::setBounds | ( | short | xmin, | |
short | ymin, | |||
short | xmax, | |||
short | ymax | |||
) | [inline] |
Sets the corners of the box.