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