88 SbBox3f(
float xmin,
float ymin,
float zmin,
89 float xmax,
float ymax,
float zmax)
90 { min.setValue(xmin, ymin, zmin); max.setValue(xmax, ymax, zmax); }
95 { this->min = min; this->max = max; }
143 float xmax,
float ymax,
float zmax)
144 { min.setValue(xmin, ymin, zmin); max.setValue(xmax, ymax, zmax); }
147 { min = _min; max = _max; }
150 float &xmax,
float &ymax,
float &zmax)
const
151 { min.getValue(xmin, ymin, zmin); max.getValue(xmax, ymax, zmax); }
154 { _min = min; _max = max; }
163 float &originZ)
const
164 { originX = min[0]; originY = min[1]; originZ = min[2]; }
167 void getSize(
float &sizeX,
float &sizeY,
float &sizeZ)
const
168 { sizeX = max[0] - min[0];
169 sizeY = max[1] - min[1];
170 sizeZ = max[2] - min[2]; }
176 bool isEmpty()
const {
return max[0] < min[0]; }
181 {
return (max[0] > min[0] && max[1] > min[1] && max[2] > min[2] ); }
189 float &dMin,
float &dMax)
const;
208{
return !(b1 == b2); }
283 {
return project().intersect(bb); }
287 float xmax,
float ymax,
float zmax)
295 float &xmax,
float &ymax,
float &zmax)
const
308 void getSize(
float &sizeX,
float &sizeY,
float &sizeZ)
329 float &dMin,
float &dMax)
const
330 { project().getSpan(direction, dMin, dMax); }
354{
return !(b1 == b2); }
379 SbBox2f(
float xmin,
float ymin,
float xmax,
float ymax)
380 { min.setValue(xmin, ymin); max.setValue(xmax, ymax); }
384 { min = _min; max = _max; }
410 void setBounds(
float xmin,
float ymin,
float xmax,
float ymax)
411 { min.setValue(xmin, ymin); max.setValue(xmax, ymax); }
414 { min = _min; max = _max; }
417 float &xmax,
float &ymax)
const
418 { min.getValue(xmin, ymin); max.getValue(xmax, ymax); }
421 { _min = min; _max = max; }
429 { originX = min[0]; originY = min[1]; }
432 void getSize(
float &sizeX,
float &sizeY)
const
433 { sizeX = max[0] - min[0]; sizeY = max[1] - min[1]; }
437 {
return (max[0] - min[0]) / (max[1] - min[1]); }
443 bool isEmpty()
const {
return max[0] < min[0]; }
448 {
return (max[0] > min[0] && max[1] > min[1]); }
461{
return !(b1 == b2); }
487 SbBox2s(
short xmin,
short ymin,
short xmax,
short ymax)
488 { min.setValue(xmin, ymin); max.setValue(xmax, ymax); }
493 { this->min = min; this->max = max; }
516 void setBounds(
short xmin,
short ymin,
short xmax,
short ymax)
517 { min.setValue(xmin, ymin); max.setValue(xmax, ymax); }
521 { min = _min; max = _max; }
524 short &xmax,
short &ymax)
const
525 { min.getValue(xmin, ymin); max.getValue(xmax, ymax); }
528 { _min = min; _max = max; }
532 { originX = min[0]; originY = min[1]; }
535 void getSize(
short &sizeX,
short &sizeY)
const
536 { sizeX = max[0] - min[0]; sizeY = max[1] - min[1]; }
540 {
return float(max[0] - min[0]) / float(max[1] - min[1]); }
556{
return !(b1 == b2); }
INVENTOR_API bool operator!=(const SbBox3f &b1, const SbBox3f &b2)
INVENTOR_API bool operator==(const SbBox3f &b1, const SbBox3f &b2)
#define INVENTOR_API
Disable some annoying warnings on MSVC 6.
float getAspectRatio() const
Gets box aspect ratio.
SbBox2f()
Constructs an empty box.
void setBounds(const SbVec2f &_min, const SbVec2f &_max)
void getSize(float &sizeX, float &sizeY) const
Gets box size.
const SbVec2f & getMax() const
Returns the minimum and maximum points of the box.
SbVec2f getCenter() const
Returns the center of the box.
bool intersect(const SbVec2f &pt) const
Returns TRUE if intersection of given point and Box2f is not empty.
SbBox2f(float xmin, float ymin, float xmax, float ymax)
Constructor given bounds.
SbBox2f(const SbVec2f &_min, const SbVec2f &_max)
Constructor given minimum and maximum points.
const SbVec2f & getMin() const
Returns the minimum and maximum points of the box.
bool intersect(const SbBox2f &bb) const
Returns TRUE if intersection of given Box2f and Box2f is not empty.
void setBounds(float xmin, float ymin, float xmax, float ymax)
Sets the corners of the box.
void getBounds(SbVec2f &_min, SbVec2f &_max) const
void getOrigin(float &originX, float &originY) const
Gets box origin.
void getBounds(float &xmin, float &ymin, float &xmax, float &ymax) const
bool hasArea() const
Returns TRUE if both dimensions of the box have positive size, and FALSE otherwise.
void makeEmpty()
Makes an empty box.
void extendBy(const SbVec2f &pt)
Extends Box2f (if necessary) to contain given 2D point.
SbVec2f getClosestPoint(const SbVec2f &point)
Returns the closest point on the box to the given point.
void extendBy(const SbBox2f &r)
Extends Box2f (if necessary) to contain given Box2f.
bool isEmpty() const
Returns TRUE if the box is empty, and FALSE otherwise.
void getBounds(short &xmin, short &ymin, short &xmax, short &ymax) const
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 extendBy(const SbBox2s &r)
Extends Box2s (if necessary) to contain given Box2s.
void getOrigin(short &originX, short &originY) const
Returns origin (minimum point) of box.
float getAspectRatio() const
Returns aspect ratio (ratio of width to height) of box.
void getSize(short &sizeX, short &sizeY) const
Returns box size.
SbBox2s()
Constructs an empty box.
SbBox2s(const SbVec2s &min, const SbVec2s &max)
Constructor for a 2D integer box.
void makeEmpty()
Makes an empty box.
void getBounds(SbVec2s &_min, SbVec2s &_max) const
const SbVec2s & getMax() const
Returns the minimum and maximum points of the box.
SbBox2s(short xmin, short ymin, short xmax, short ymax)
Constructor for a 2D integer box.
void extendBy(const SbVec2s &pt)
Extends Box2s (if necessary) to contain given 2D point.
bool intersect(const SbVec2s &pt) const
Returns TRUE if intersection of given point and Box2s is not empty.
const SbVec2s & getMin() const
Returns the minimum and maximum points of the box.
bool intersect(const SbBox2s &bb) const
Returns TRUE if intersection of given Box2s and Box2s is not empty.
bool intersect(const SbVec3f &pt) const
Returns TRUE if intersection of given point and Box3f is not empty.
float getVolume() const
Returns the volume of the box.
void getOrigin(float &originX, float &originY, float &originZ) const
Gets box origin which is the same as the minimum corner of the box.
void makeEmpty()
Makes an empty box.
void setBounds(float xmin, float ymin, float zmin, float xmax, float ymax, float zmax)
Common get and set functions.
void getSpan(const SbVec3f &direction, float &dMin, float &dMax) const
Finds the span of a box along a specified direction.
void setBounds(const SbVec3f &_min, const SbVec3f &_max)
const SbVec3f & getMin() const
Returns the minimum point of the box.
void getBounds(float &xmin, float &ymin, float &zmin, float &xmax, float &ymax, float &zmax) const
SbVec3f & getMax()
Returns the maximum point of the box.
void getSize(float &sizeX, float &sizeY, float &sizeZ) const
Gets box size.
void getBounds(SbVec3f &_min, SbVec3f &_max) const
void extendBy(const SbBox3f &bb)
Extends Box3f (if necessary) to contain given Box3f.
bool outside(const SbMatrix &MVP, int &cullBits) const
Returns TRUE if bounding box is completely outside the view-volume defined by the model+view+projecti...
bool hasVolume() const
Returns TRUE if all three dimensions of the box have positive size, and FALSE otherwise.
bool isEmpty() const
Returns TRUE if the box is empty, and FALSE otherwise.
bool intersect(const SbBox3f &bb) const
Returns TRUE if intersection of given Box3f and Box3f is not empty.
SbVec3f getCenter() const
Returns the center of the box.
SbBox3f(const SbVec3f &min, const SbVec3f &max)
Constructor given minimum and maximum points min and max are the corners of the diagonal that define ...
SbVec3f getClosestPoint(const SbVec3f &point)
Returns the closest point on the box to the given point.
SbBox3f(float xmin, float ymin, float zmin, float xmax, float ymax, float zmax)
Constructor given bounds.
SbVec3f & getMin()
Returns the minimum point of the box.
void transform(const SbMatrix &m)
Transforms box by matrix, enlarging box to contain result.
void extendBy(const SbVec3f &pt)
Extends Box3f (if necessary) to contain given 3D point.
SbBox3f()
Empty box constructor.
const SbVec3f & getMax() const
Returns the maximum point of the box.
3D box with an associated transformation matrix.
void transform(const SbMatrix &m)
Transforms the box by the given matrix.
const SbMatrix & getInverse() const
Gets the transformation on the box, and its inverse.
SbXfBox3f(const SbBox3f &box)
Constructors and destructor.
void extendBy(const SbXfBox3f &bb)
Extends the box (if necessary) to contain the given SbXfBox3f.
float getVolume() const
Gives the volume of the box (0 for an empty box).
SbXfBox3f(const SbVec3f &_min, const SbVec3f &_max)
Constructors and destructor.
bool isEmpty() const
Checks if the box is empty (degenerate) note that this relies on boxes being completely degenerate if...
SbBox3f project() const
Projects an SbXfBox3f to an SbBox3f.
void getOrigin(float &originX, float &originY, float &originZ)
Returns origin (minimum point) of the box.
SbXfBox3f()
Constructors and destructor.
SbVec3f getCenter() const
Returns the center of the box.
~SbXfBox3f()
Constructors and destructor.
void getBounds(float &xmin, float &ymin, float &zmin, float &xmax, float &ymax, float &zmax) const
void getSpan(const SbVec3f &direction, float &dMin, float &dMax) const
Finds the extent of the box along a particular direction.
void setBounds(const SbVec3f &_min, const SbVec3f &_max)
Set and get the bounds of the box.
bool intersect(const SbBox3f &bb) const
Returns TRUE if intersection of given XfBox3f and Box3f is not empty.
void getSize(float &sizeX, float &sizeY, float &sizeZ)
Returns size of the box.
void setTransform(const SbMatrix &m)
Sets the transformation on the box.
void getBounds(SbVec3f &_min, SbVec3f &_max) const
void makeEmpty()
Sets Box3f to contain nothing.
void setBounds(float xmin, float ymin, float zmin, float xmax, float ymax, float zmax)
Common get and set functions.
bool intersect(const SbVec3f &pt) const
Returns TRUE if intersection of given point and Box3f is not empty.
void extendBy(const SbBox3f &bb)
Extends the box (if necessary) to contain the given SbBox3f.
const SbMatrix & getTransform() const
Gets the transformation on the box, and its inverse.
void extendBy(const SbVec3f &pt)
Extends the box (if necessary) to contain the given 3D point.
bool hasVolume() const
Checks if the box has volume; i.e., all three dimensions have positive size.