2D box class. More...
#include <Inventor/SbBox.h>
Public Member Functions | |
SbBox2f () | |
SbBox2f (float xmin, float ymin, float xmax, float ymax) | |
SbBox2f (const SbVec2f &_min, const SbVec2f &_max) | |
~SbBox2f () | |
const SbVec2f & | getMin () const |
const SbVec2f & | getMax () const |
SbVec2f | getCenter () const |
void | extendBy (const SbVec2f &pt) |
void | extendBy (const SbBox2f &r) |
SbBool | intersect (const SbVec2f &pt) const |
SbBool | intersect (const SbBox2f &bb) const |
SbBox2f | intersection (const SbBox2f &box) const |
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) const |
void | getBounds (SbVec2f &_min, SbVec2f &_max) const |
SbVec2f | getClosestPoint (const SbVec2f &point) const |
void | getOrigin (float &originX, float &originY) const |
void | getSize (float &sizeX, float &sizeY) const |
SbVec2f | getSize () const |
float | getAspectRatio () const |
void | makeEmpty () |
SbBool | isEmpty () const |
SbBool | hasArea () const |
Friends | |
int | operator== (const SbBox2f &b1, const SbBox2f &b2) |
int | operator!= (const SbBox2f &b1, const SbBox2f &b2) |
2D box class.
2D box which has planes parallel to the major axes and is specified by two points (specified as floating point) 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, SbBox2s, SbVec3f, SbVec2f, SbVec2s, SbMatrix
SbBox2f::SbBox2f | ( | ) | [inline] |
Constructor for a 2D float box.
The box is initially empty.
SbBox2f::SbBox2f | ( | float | xmin, | |
float | ymin, | |||
float | xmax, | |||
float | ymax | |||
) | [inline] |
Constructor for a 2D float box.
xmin , ymin , xmax , and ymax are the bounds of the box.
Constructor for a 2D float box.
m_min and m_max are the corners of the diagonal that defines the box.
SbBox2f::~SbBox2f | ( | ) | [inline] |
Destructor.
void SbBox2f::extendBy | ( | const SbBox2f & | r | ) |
Extends this box (if necessary) to contain the specified box.
void SbBox2f::extendBy | ( | const SbVec2f & | pt | ) |
Extends this box (if necessary) to contain the specified point.
float SbBox2f::getAspectRatio | ( | ) | const [inline] |
Gets box aspect ratio.
Gets the corners of the box.
void SbBox2f::getBounds | ( | float & | xmin, | |
float & | ymin, | |||
float & | xmax, | |||
float & | ymax | |||
) | const [inline] |
Gets the corners of the box.
SbVec2f SbBox2f::getCenter | ( | ) | const |
Returns the center of the box.
Returns the closest point on the box to the given point.
(Returns the point on the center of the Z face if passed the center.)
const SbVec2f& SbBox2f::getMax | ( | ) | const [inline] |
Returns the maximum point of the box.
const SbVec2f& SbBox2f::getMin | ( | ) | const [inline] |
Returns the minimum point of the box.
void SbBox2f::getOrigin | ( | float & | originX, | |
float & | originY | |||
) | const [inline] |
Gets box origin.
SbVec2f SbBox2f::getSize | ( | ) | const [inline] |
Return box size.
void SbBox2f::getSize | ( | float & | sizeX, | |
float & | sizeY | |||
) | const [inline] |
Gets box size.
SbBool SbBox2f::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 SbBox2f::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 SbBox2f::makeEmpty | ( | ) |
Makes an empty box.
Sets the corners of the box.
void SbBox2f::setBounds | ( | float | xmin, | |
float | ymin, | |||
float | xmax, | |||
float | ymax | |||
) | [inline] |
Sets the corners of the box.