89 SbBox3d(
double xmin,
double ymin,
double zmin,
90 double xmax,
double ymax,
double zmax)
91 { min.setValue(xmin, ymin, zmin); max.setValue(xmax, ymax, zmax); }
96 { this->min = min; this->max = max; }
144 double xmax,
double ymax,
double zmax)
145 { min.setValue(xmin, ymin, zmin); max.setValue(xmax, ymax, zmax); }
148 { min = _min; max = _max; }
150 void getBounds(
double &xmin,
double &ymin,
double &zmin,
151 double &xmax,
double &ymax,
double &zmax)
const
152 { min.getValue(xmin, ymin, zmin); max.getValue(xmax, ymax, zmax); }
155 { _min = min; _max = max; }
164 double &originZ)
const
165 { originX = min[0]; originY = min[1]; originZ = min[2]; }
168 void getSize(
double &sizeX,
double &sizeY,
double &sizeZ)
const
169 { sizeX = max[0] - min[0];
170 sizeY = max[1] - min[1];
171 sizeZ = max[2] - min[2]; }
177 bool isEmpty()
const {
return max[0] < min[0]; }
182 {
return (max[0] > min[0] && max[1] > min[1] && max[2] > min[2] ); }
190 double &dMin,
double &dMax)
const;
209{
return !(b1 == b2); }
284 {
return project().intersect(bb); }
288 double xmax,
double ymax,
double zmax)
295 void getBounds(
double &xmin,
double &ymin,
double &zmin,
296 double &xmax,
double &ymax,
double &zmax)
const
309 void getSize(
double &sizeX,
double &sizeY,
double &sizeZ)
330 double &dMin,
double &dMax)
const
331 { project().getSpan(direction, dMin, dMax); }
355{
return !(b1 == b2); }
380 SbBox2d(
double xmin,
double ymin,
double xmax,
double ymax)
381 { min.setValue(xmin, ymin); max.setValue(xmax, ymax); }
385 { min = _min; max = _max; }
411 void setBounds(
double xmin,
double ymin,
double xmax,
double ymax)
412 { min.setValue(xmin, ymin); max.setValue(xmax, ymax); }
415 { min = _min; max = _max; }
418 double &xmax,
double &ymax)
const
419 { min.getValue(xmin, ymin); max.getValue(xmax, ymax); }
422 { _min = min; _max = max; }
430 { originX = min[0]; originY = min[1]; }
433 void getSize(
double &sizeX,
double &sizeY)
const
434 { sizeX = max[0] - min[0]; sizeY = max[1] - min[1]; }
438 {
return (max[0] - min[0]) / (max[1] - min[1]); }
444 bool isEmpty()
const {
return max[0] < min[0]; }
449 {
return (max[0] > min[0] && max[1] > min[1]); }
462{
return !(b1 == b2); }
INVENTOR_API bool operator!=(const SbBox3f &b1, const SbBox3f &b2)
INVENTOR_API bool operator==(const SbBox3f &b1, const SbBox3f &b2)
INVENTOR_API bool operator==(const SbBox3d &b1, const SbBox3d &b2)
INVENTOR_API bool operator!=(const SbBox3d &b1, const SbBox3d &b2)
#define INVENTOR_API
Disable some annoying warnings on MSVC 6.
void setBounds(const SbVec2d &_min, const SbVec2d &_max)
void getBounds(SbVec2d &_min, SbVec2d &_max) const
bool intersect(const SbBox2d &bb) const
Returns TRUE if intersection of given Box2d and Box2d is not empty.
void setBounds(double xmin, double ymin, double xmax, double ymax)
Sets the corners of the box.
void extendBy(const SbVec2d &pt)
Extends Box2d (if necessary) to contain given 2D point.
bool hasArea() const
Returns TRUE if both dimensions of the box have positive size, and FALSE otherwise.
SbVec2d getClosestPoint(const SbVec2d &point)
Returns the closest point on the box to the given point.
void getSize(double &sizeX, double &sizeY) const
Gets box size.
void getBounds(double &xmin, double &ymin, double &xmax, double &ymax) const
void getOrigin(double &originX, double &originY) const
Gets box origin.
void extendBy(const SbBox2d &r)
Extends Box2d (if necessary) to contain given Box2d.
bool intersect(const SbVec2d &pt) const
Returns TRUE if intersection of given point and Box2d is not empty.
SbVec2d getCenter() const
Returns the center of the box.
const SbVec2d & getMin() const
Returns the minimum and maximum points of the box.
SbBox2d(double xmin, double ymin, double xmax, double ymax)
Constructor given bounds.
SbBox2d(const SbVec2d &_min, const SbVec2d &_max)
Constructor given minimum and maximum points.
const SbVec2d & getMax() const
Returns the minimum and maximum points of the box.
bool isEmpty() const
Returns TRUE if the box is empty, and FALSE otherwise.
SbBox2d()
Constructs an empty box.
double getAspectRatio() const
Gets box aspect ratio.
void makeEmpty()
Makes an empty box.
SbBox3d(const SbVec3d &min, const SbVec3d &max)
Constructor given minimum and maximum points min and max are the corners of the diagonal that define ...
const SbVec3d & getMax() const
Returns the maximum point of the box.
void setBounds(double xmin, double ymin, double zmin, double xmax, double ymax, double zmax)
Common get and set functions.
void makeEmpty()
Makes an empty box.
SbVec3d & getMax()
Returns the maximum point of the box.
bool outside(const SbMatrixd &MVP, int &cullBits) const
Returns TRUE if bounding box is completely outside the view-volume defined by the model+view+projecti...
void setBounds(const SbVec3d &_min, const SbVec3d &_max)
void getBounds(double &xmin, double &ymin, double &zmin, double &xmax, double &ymax, double &zmax) const
void getOrigin(double &originX, double &originY, double &originZ) const
Gets box origin which is the same as the minimum corner of the box.
void getBounds(SbVec3d &_min, SbVec3d &_max) const
SbBox3d()
Empty box constructor.
bool hasVolume() const
Returns TRUE if all three dimensions of the box have positive size, and FALSE otherwise.
void getSize(double &sizeX, double &sizeY, double &sizeZ) const
Gets box size.
bool isEmpty() const
Returns TRUE if the box is empty, and FALSE otherwise.
const SbVec3d & getMin() const
Returns the minimum point of the box.
SbVec3d & getMin()
Returns the minimum point of the box.
bool intersect(const SbVec3d &pt) const
Returns TRUE if intersection of given point and Box3d is not empty.
SbBox3d(double xmin, double ymin, double zmin, double xmax, double ymax, double zmax)
Constructor given bounds.
SbVec3d getCenter() const
Returns the center of the box.
void transform(const SbMatrixd &m)
Transforms box by matrix, enlarging box to contain result.
void extendBy(const SbVec3d &pt)
Extends Box3d (if necessary) to contain given 3D point.
bool intersect(const SbBox3d &bb) const
Returns TRUE if intersection of given Box3d and Box3d is not empty.
void extendBy(const SbBox3d &bb)
Extends Box3d (if necessary) to contain given Box3d.
SbVec3d getClosestPoint(const SbVec3d &point)
Returns the closest point on the box to the given point.
void getSpan(const SbVec3d &direction, double &dMin, double &dMax) const
Finds the span of a box along a specified direction.
double getVolume() const
Returns the volume of the box.
4x4 matrix class with double values.
2D vector class with double members.
3D vector class with double values.
3D box with an associated transformation matrix.
void setBounds(const SbVec3d &_min, const SbVec3d &_max)
Set and get the bounds of the box.
void extendBy(const SbXfBox3d &bb)
Extends the box (if necessary) to contain the given SbXfBox3d.
void makeEmpty()
Sets Box3d to contain nothing.
void getSize(double &sizeX, double &sizeY, double &sizeZ)
Returns size of the box.
~SbXfBox3d()
Constructors and destructor.
void setBounds(double xmin, double ymin, double zmin, double xmax, double ymax, double zmax)
Common get and set functions.
bool hasVolume() const
Checks if the box has volume; i.e., all three dimensions have positive size.
const SbMatrixd & getTransform() const
Gets the transformation on the box, and its inverse.
bool isEmpty() const
Checks if the box is empty (degenerate) note that this relies on boxes being completely degenerate if...
void transform(const SbMatrixd &m)
Transforms the box by the given matrix.
void setTransform(const SbMatrixd &m)
Sets the transformation on the box.
void extendBy(const SbBox3d &bb)
Extends the box (if necessary) to contain the given SbBox3d.
double getVolume() const
Gives the volume of the box (0 for an empty box).
SbXfBox3d()
Constructors and destructor.
SbXfBox3d(const SbBox3d &box)
Constructors and destructor.
void extendBy(const SbVec3d &pt)
Extends the box (if necessary) to contain the given 3D point.
const SbMatrixd & getInverse() const
Gets the transformation on the box, and its inverse.
SbBox3d project() const
Projects an SbXfBox3d to an SbBox3d.
void getSpan(const SbVec3d &direction, double &dMin, double &dMax) const
Finds the extent of the box along a particular direction.
bool intersect(const SbBox3d &bb) const
Returns TRUE if intersection of given XfBox3d and Box3d is not empty.
SbVec3d getCenter() const
Returns the center of the box.
void getBounds(double &xmin, double &ymin, double &zmin, double &xmax, double &ymax, double &zmax) const
SbXfBox3d(const SbVec3d &_min, const SbVec3d &_max)
Constructors and destructor.
void getOrigin(double &originX, double &originY, double &originZ)
Returns origin (minimum point) of the box.
bool intersect(const SbVec3d &pt) const
Returns TRUE if intersection of given point and Box3d is not empty.
void getBounds(SbVec3d &_min, SbVec3d &_max) const