59#include <Inventor/STL/iostream>
118 { m_min = _min; m_max = _max; }
203 for(
int i = 0; i < 3 && contained; i++ )
205 contained &= bb.m_min[i] >= m_min[i] &&
206 bb.m_min[i] <= m_max[i] &&
207 bb.m_max[i] <= m_max[i];
239 { m_min = _min; m_max = _max; }
253 { _min = m_min; _max = m_max; }
264 void getOrigin(
int &originX,
int &originY,
int &originZ)
const
265 { originX = m_min[0]; originY = m_min[1]; originZ = m_min[2]; }
271 void getSize(
int &sizeX,
int &sizeY,
int &sizeZ)
const {
272 if ( m_max[0] < m_min[0] ) {
278 sizeX = m_max[0] - m_min[0];
279 sizeY = m_max[1] - m_min[1];
280 sizeZ = m_max[2] - m_min[2];
289 if ( m_max[0] < m_min[0] )
306 {
return m_max[0] < m_min[0]; }
313 {
return (m_max[0] > m_min[0] && m_max[1] > m_min[1] && m_max[2] > m_min[2]); }
353 {
return !(b1 == b2); }
405 { m_min = _min; m_max = _max; }
487 for(
int i = 0; i < 3 && contained; i++ )
489 contained &= bb.m_min[i] >= m_min[i] &&
490 bb.m_min[i] <= m_max[i] &&
491 bb.m_max[i] <= m_max[i];
523 { m_min = _min; m_max = _max; }
537 { _min = m_min; _max = m_max; }
548 void getOrigin(
short &originX,
short &originY,
short &originZ)
const
549 { originX = m_min[0]; originY = m_min[1]; originZ = m_min[2]; }
554 void getSize(
short &sizeX,
short &sizeY,
short &sizeZ)
const {
555 if ( m_max[0] < m_min[0] ) {
561 sizeX = m_max[0] - m_min[0];
562 sizeY = m_max[1] - m_min[1];
563 sizeZ = m_max[2] - m_min[2];
576 {
return m_max[0] < m_min[0]; }
583 {
return (m_max[0] > m_min[0] && m_max[1] > m_min[1] && m_max[2] > m_min[2]); }
619 {
return !(b1 == b2); }
671 { m_min = _min; m_max = _max; }
719 if (pt[0] < m_min[0]) m_min[0] = pt[0];
720 if (pt[1] < m_min[1]) m_min[1] = pt[1];
721 if (pt[2] < m_min[2]) m_min[2] = pt[2];
722 if (pt[0] > m_max[0]) m_max[0] = pt[0];
723 if (pt[1] > m_max[1]) m_max[1] = pt[1];
724 if (pt[2] > m_max[2]) m_max[2] = pt[2];
742 return ((bb.m_max[0] >= m_min[0]) && (bb.m_min[0] <= m_max[0]) &&
743 (bb.m_max[1] >= m_min[1]) && (bb.m_min[1] <= m_max[1]) &&
744 (bb.m_max[2] >= m_min[2]) && (bb.m_min[2] <= m_max[2]));
760 for(
int i = 0; i < 3 && contained; i++ )
762 contained &= bb.m_min[i] >= m_min[i] &&
763 bb.m_min[i] <= m_max[i] &&
764 bb.m_max[i] <= m_max[i];
797 { m_min = _min; m_max = _max; }
811 { _min = m_min; _max = m_max; }
822 void getOrigin(
float &originX,
float &originY,
float &originZ)
const
823 { originX = m_min[0]; originY = m_min[1]; originZ = m_min[2]; }
829 void getSize(
float &sizeX,
float &sizeY,
float &sizeZ)
const {
830 if ( m_max[0] < m_min[0] ) {
836 sizeX = m_max[0] - m_min[0];
837 sizeY = m_max[1] - m_min[1];
838 sizeZ = m_max[2] - m_min[2];
847 if ( m_max[0] < m_min[0] )
858 m_min.
setValue(FLT_MAX, FLT_MAX, FLT_MAX);
859 m_max.
setValue(- FLT_MAX, - FLT_MAX, - FLT_MAX);
866 {
return m_max[0] < m_min[0]; }
873 {
return (m_max[0] > m_min[0] && m_max[1] > m_min[1] && m_max[2] > m_min[2] ); }
903 {
return !(b1 == b2); }
994 { m_min = _min; m_max = _max; }
1070 for(
int i = 0; i < 3 && contained; i++ )
1072 contained &= bb.m_min[i] >= m_min[i] &&
1073 bb.m_min[i] <= m_max[i] &&
1074 bb.m_max[i] <= m_max[i];
1106 { m_min = _min; m_max = _max; }
1120 { _min = m_min; _max = m_max; }
1131 void getOrigin(
double &originX,
double &originY,
double &originZ)
const
1132 { originX = m_min[0]; originY = m_min[1]; originZ = m_min[2]; }
1137 void getSize(
double &sizeX,
double &sizeY,
double &sizeZ)
const {
1138 if ( m_max[0] < m_min[0] ) {
1144 sizeX = m_max[0] - m_min[0];
1145 sizeY = m_max[1] - m_min[1];
1146 sizeZ = m_max[2] - m_min[2];
1156 if ( m_max[0] < m_min[0] )
1171 {
return m_max[0] < m_min[0]; }
1178 {
return (m_max[0] > m_min[0] && m_max[1] > m_min[1] && m_max[2] > m_min[2] ); }
1208 {
return !(b1 == b2); }
1213 template<
typename T>
1289 {
return xformInv; }
1395 void getOrigin(
float &originX,
float &originY,
float &originZ)
1402 void getSize(
float &sizeX,
float &sizeY,
float &sizeZ)
1461 {
return !(b1 == b2); }
1468 inline bool isXFormDegenerate()
const
1471 return xformInv[0][0] != xformInv[0][0];
1552 {
return xformInv; }
1656 void getOrigin(
double &originX,
double &originY,
double &originZ)
const
1662 void getSize(
double &sizeX,
double &sizeY,
double &sizeZ)
const
1710 {
return !(b1 == b2); }
1716 inline bool isXFormDegenerate()
const
1719 return xformInv[0][0] != xformInv[0][0];
1724 const SbVec3d & getMin()
const
1727 const SbVec3d & getMax()
const
1819 { m_min = _min; m_max = _max; }
1880 { m_min = _min; m_max = _max; }
1894 { _min = m_min; _max = m_max; }
1906 { originX = m_min[0]; originY = m_min[1]; }
1913 if ( m_max[0] < m_min[0] ) {
1918 sizeX = m_max[0] - m_min[0];
1919 sizeY = m_max[1] - m_min[1];
1929 if ( m_max[0] < m_min[0] )
1939 {
return (m_max[0] - m_min[0]) / (m_max[1] - m_min[1]); }
1956 {
return (m_max[0] > m_min[0] && m_max[1] > m_min[1]); }
1967 {
return !(b1 == b2); }
2017 { m_min = _min; m_max = _max; }
2078 { m_min = _min; m_max = _max; }
2092 { _min = m_min; _max = m_max; }
2104 { originX = m_min[0]; originY = m_min[1]; }
2111 if ( m_max[0] < m_min[0] ) {
2116 sizeX = m_max[0] - m_min[0];
2117 sizeY = m_max[1] - m_min[1];
2127 if ( m_max[0] < m_min[0] )
2137 {
return (m_max[0] - m_min[0]) / (m_max[1] - m_min[1]); }
2154 {
return (m_max[0] > m_min[0] && m_max[1] > m_min[1]); }
2165 {
return !(b1 == b2); }
2215 { m_min = _min; m_max = _max; }
2271 { m_min = _min; m_max = _max; }
2285 { _min = m_min; _max = m_max; }
2291 { originX = m_min[0]; originY = m_min[1]; }
2298 if ( m_max[0] < m_min[0] ) {
2303 sizeX = m_max[0] - m_min[0];
2304 sizeY = m_max[1] - m_min[1];
2314 if ( m_max[0] < m_min[0] )
2324 {
return float(m_max[0] - m_min[0]) / float(m_max[1] - m_min[1]); }
2341 {
return (m_max[0] > m_min[0] && m_max[1] > m_min[1]); }
2353 {
return !(b1 == b2); }
2404 { m_min = _min; m_max = _max; }
2460 { m_min = _min; m_max = _max; }
2474 { _min = m_min; _max = m_max; }
2480 { originX = m_min[0]; originY = m_min[1]; }
2487 if ( m_max[0] < m_min[0] ) {
2492 sizeX = m_max[0] - m_min[0];
2493 sizeY = m_max[1] - m_min[1];
2503 if ( m_max[0] < m_min[0] )
2513 {
return float(m_max[0] - m_min[0]) / float(m_max[1] - m_min[1]); }
2529 {
return !(b1 == b2); }
2602 { m_min = _min; m_max = _max; }
2645 for (
int i = 0; i < 4; i++ )
2647 if (pt[i] < m_min[i])
2649 if (pt[i] > m_max[i])
2659 return ((pt[0] >= m_min[0]) &&
2660 (pt[1] >= m_min[1]) &&
2661 (pt[2] >= m_min[2]) &&
2662 (pt[3] >= m_min[3]) &&
2663 (pt[0] <= m_max[0]) &&
2664 (pt[1] <= m_max[1]) &&
2665 (pt[2] <= m_max[2]) &&
2666 (pt[3] <= m_max[3]));
2674 if ( m_max[0] < m_min[0] )
2677 return m_max-m_min +
SbVec4i32(1, 1, 1, 1);
2689 {
return m_max[0] < m_min[0]; }
2704 return ( (b1.m_min == b2.m_min) && (b1.m_max == b2.m_max ) );
2711 {
return !(b1 == b2); }
std::ostream & operator<<(std::ostream &os, const SbBox3f &b)
Writes the box to the specified output stream.
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> 2D box class.
void setBounds(const SbVec2d &_min, const SbVec2d &_max)
Sets the corners of the box.
void getBounds(SbVec2d &_min, SbVec2d &_max) const
Gets the corners of the box.
void setBounds(double xmin, double ymin, double xmax, double ymax)
Sets the corners of the box.
void extendBy(const SbVec2d &pt)
Extends this box (if necessary) to contain the specified point .
friend int operator!=(const SbBox2d &b1, const SbBox2d &b2)
Inequality comparison.
SbBox2d intersection(const SbBox2d &box) const
Returns the intersection of the specified box with this box.
void getSize(double &sizeX, double &sizeY) const
Gets box size.
SbBool hasArea() const
Returns TRUE if both dimensions of the box have positive size, and FALSE otherwise.
void getBounds(double &xmin, double &ymin, double &xmax, double &ymax) const
Gets the corners of the box.
void getOrigin(double &originX, double &originY) const
Gets box origin.
SbBool intersect(const SbBox2d &bb) const
Returns TRUE if the specified box intersects this box.
void extendBy(const SbBox2d &r)
Extends this box (if necessary) to contain the specified box.
SbVec2d getSize() const
Return box size.
SbBool intersect(const SbVec2d &pt) const
Returns TRUE if the specified point intersects this box.
SbVec2d getCenter() const
Returns the center of the box.
const SbVec2d & getMin() const
Returns the minimum point of the box.
SbBox2d(double xmin, double ymin, double xmax, double ymax)
Constructor for a 2D double box.
SbBox2d(const SbVec2d &_min, const SbVec2d &_max)
Constructor for a 2D double box.
friend int operator==(const SbBox2d &b1, const SbBox2d &b2)
Equality comparison.
const SbVec2d & getMax() const
Returns the maximum point of the box.
SbBox2d()
Constructor for a 2D double box.
SbBool isEmpty() const
Returns TRUE if the box is empty, and FALSE otherwise.
double getAspectRatio() const
Gets box aspect ratio.
void makeEmpty()
Makes an empty box.
SbVec2d getClosestPoint(const SbVec2d &point) const
Returns the closest point on the box to the given point.
float getAspectRatio() const
Gets box aspect ratio.
SbBox2f()
Constructor for a 2D float box.
void setBounds(const SbVec2f &_min, const SbVec2f &_max)
Sets the corners of the box.
void getSize(float &sizeX, float &sizeY) const
Gets box size.
const SbVec2f & getMax() const
Returns the maximum point of the box.
SbVec2f getCenter() const
Returns the center of the box.
friend int operator==(const SbBox2f &b1, const SbBox2f &b2)
Equality comparison.
SbVec2f getSize() const
Return box size.
SbBox2f(float xmin, float ymin, float xmax, float ymax)
Constructor for a 2D float box.
SbBox2f(const SbVec2f &_min, const SbVec2f &_max)
Constructor for a 2D float box.
const SbVec2f & getMin() const
Returns the minimum point of the box.
SbVec2f getClosestPoint(const SbVec2f &point) const
Returns the closest point on the box to the given point.
SbBool isEmpty() const
Returns TRUE if the box is empty, and FALSE otherwise.
void setBounds(float xmin, float ymin, float xmax, float ymax)
Sets the corners of the box.
SbBool intersect(const SbBox2f &bb) const
Returns TRUE if the specified box intersects this box.
void getBounds(SbVec2f &_min, SbVec2f &_max) const
Gets the corners of the box.
void getOrigin(float &originX, float &originY) const
Gets box origin.
SbBox2f intersection(const SbBox2f &box) const
Returns the intersection of the specified box with this box.
void getBounds(float &xmin, float &ymin, float &xmax, float &ymax) const
Gets the corners of the box.
friend int operator!=(const SbBox2f &b1, const SbBox2f &b2)
Inequality comparison.
void makeEmpty()
Makes an empty box.
void extendBy(const SbVec2f &pt)
Extends this box (if necessary) to contain the specified point.
SbBool hasArea() const
Returns TRUE if both dimensions of the box have positive size, and FALSE otherwise.
void extendBy(const SbBox2f &r)
Extends this box (if necessary) to contain the specified box.
SbBool intersect(const SbVec2f &pt) const
Returns TRUE if the specified point intersects this box.
void extendBy(const SbBox2i32 &r)
Extends this box (if necessary) to contain the specified box.
SbBool intersect(const SbBox2i32 &bb) const
Returns TRUE if the specified box intersects this box.
void extendBy(const SbVec2i32 &pt)
Extends this box (if necessary) to contain the specified point.
void getSize(int &sizeX, int &sizeY) const
Returns box size.
SbBox2i32()
Constructor for a 2D integer box.
void setBounds(const SbVec2i32 &_min, const SbVec2i32 &_max)
Sets the corners of the box.
const SbVec2i32 & getMax() const
Returns the maximum point of the box.
void setBounds(int xmin, int ymin, int xmax, int ymax)
Sets the corners of the box.
SbBox2i32 intersection(const SbBox2i32 &box) const
Returns the intersection of the specified box with this box.
void getOrigin(int &originX, int &originY) const
Returns origin (minimum point) of box.
void getBounds(SbVec2i32 &_min, SbVec2i32 &_max) const
Gets the corners of the box.
SbBool intersect(const SbVec2i32 &pt) const
Returns TRUE if the specified point intersects this box.
friend int operator==(const SbBox2i32 &b1, const SbBox2i32 &b2)
Equality comparison.
void makeEmpty()
Makes an empty box.
friend int operator!=(const SbBox2i32 &b1, const SbBox2i32 &b2)
Inequality comparison.
SbBox2i32(const SbVec2i32 &_min, const SbVec2i32 &_max)
Constructor for a 2D integer box.
const SbVec2i32 & getMin() const
Returns the minimum point of the box.
float getAspectRatio() const
Returns aspect ratio (ratio of width to height) of box.
void getBounds(int &xmin, int &ymin, int &xmax, int &ymax) const
Gets the corners of the box.
SbVec2i32 getSize() const
Return box size.
SbBox2i32(int xmin, int ymin, int xmax, int ymax)
Constructor for a 2D integer box.
friend int operator==(const SbBox2s &b1, const SbBox2s &b2)
Equality comparison.
SbBool intersect(const SbVec2s &pt) const
Returns TRUE if the specified point intersects this box.
SbBox2s intersection(const SbBox2s &box) const
Returns the intersection of the specified box with this box.
friend int operator!=(const SbBox2s &b1, const SbBox2s &b2)
Inequality comparison.
SbVec2s getSize() const
Return box size.
void getBounds(short &xmin, short &ymin, short &xmax, short &ymax) const
Gets the corners of the box.
SbBool hasArea() const
Returns TRUE if both dimensions of the box have positive size, and FALSE otherwise.
void setBounds(short xmin, short ymin, short xmax, short ymax)
Sets the corners of the box.
SbBool intersect(const SbBox2s &bb) const
Returns TRUE if the specified box intersects this box.
void setBounds(const SbVec2s &_min, const SbVec2s &_max)
Sets the corners of the box.
void extendBy(const SbBox2s &r)
Extends this box (if necessary) to contain the specified box.
void getOrigin(short &originX, short &originY) const
Returns origin (minimum point) of box.
SbBox2s(const SbVec2s &_min, const SbVec2s &_max)
Constructor for a 2D integer 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()
Constructor for a 2D integer box.
void makeEmpty()
Makes an empty box.
SbBool isEmpty() const
Returns TRUE if the box is empty, and FALSE otherwise.
void getBounds(SbVec2s &_min, SbVec2s &_max) const
Gets the corners of the box.
const SbVec2s & getMax() const
Returns the maximum point of the box.
SbBox2s(short xmin, short ymin, short xmax, short ymax)
Constructor for a 2D integer box.
void extendBy(const SbVec2s &pt)
Extends this box (if necessary) to contain the specified point.
const SbVec2s & getMin() const
Returns the minimum point of the box.
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> 3D box class.
SbBox3d(const T &b)
Constructor that converts an arbitrary SbBox3 to an SbBox3f.
SbBox3d intersection(const SbBox3d &box) const
Returns the intersection of the specified box with this box.
SbBool intersect(const SbVec3d &pt) const
Returns TRUE if the specified point intersects this box.
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)
Sets the corners of the box.
void makeEmpty()
Makes an empty box.
SbBool contains(const SbBox3d &bb) const
Returns TRUE if the specified box is fully contained inside this box.
SbVec3d & getMax()
Returns the maximum point of the box.
SbBox3d(const SbVec3d &_min, const SbVec3d &_max)
Constructor for a 3D double box.
void setBounds(const SbVec3d &_min, const SbVec3d &_max)
Sets the corners of the box.
void getBounds(double &xmin, double &ymin, double &zmin, double &xmax, double &ymax, double &zmax) const
Gets the corners of the box.
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
Gets the corners of the box.
SbBox3d()
Constructor for a 3D double box.
void getSize(double &sizeX, double &sizeY, double &sizeZ) const
Gets box size.
SbVec3d getClosestPoint(const SbVec3d &point) const
Returns the closest point on the box to the given point.
const SbVec3d & getMin() const
Returns the minimum point of the box.
SbVec3d getSize() const
Gets box size.
SbVec3d & getMin()
Returns the minimum point of the box.
SbBool isEmpty() const
Returns TRUE if the box is empty, and FALSE otherwise.
friend int operator==(const SbBox3d &b1, const SbBox3d &b2)
Equality comparison.
SbBox3d(double xmin, double ymin, double zmin, double xmax, double ymax, double zmax)
Constructor for a 3D double box.
SbBool outside(const SbMatrixd &MVP, int &cullBits) const
Returns TRUE if bounding box is completely outside the view-volume defined by the model+view+projecti...
SbVec3d getCenter() const
Returns the center of the box.
void transform(const SbMatrixd &m)
Transforms box by matrix, enlarging box to contain result.
friend int operator!=(const SbBox3d &b1, const SbBox3d &b2)
Inequality comparison.
void extendBy(const SbVec3d &pt)
Extends this box (if necessary) to contain the specified point.
SbBool intersect(const SbBox3d &bb) const
Returns TRUE if the specified box intersects this box.
SbBool hasVolume() const
Returns TRUE if all three dimensions of the box have positive size, and FALSE otherwise.
void extendBy(const SbBox3d &bb)
Extends this box (if necessary) to contain the specified box.
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.
SbBool isEmpty() const
Returns TRUE if the box is empty, and FALSE otherwise.
float computeMaxDistance2(const SbVec3f &p) const
Returns the squared maximum distance between a point and the 8 bounding box's vertices.
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.
SbBool intersect(const SbBox3f &bb) const
Returns TRUE if the specified box intersects this box.
void makeEmpty()
Makes an empty box.
void setBounds(float xmin, float ymin, float zmin, float xmax, float ymax, float zmax)
Sets the corners of the box.
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)
Sets the corners of the box.
const SbVec3f & getMin() const
Returns the minimum point of the box.
friend int operator!=(const SbBox3f &b1, const SbBox3f &b2)
Inequality comparison.
SbBox3f intersection(const SbBox3f &box) const
Returns the intersection of the specified box with this box.
friend std::ostream & operator<<(std::ostream &os, const SbBox3f &b)
Writes the box to the specified output stream.
void getBounds(float &xmin, float &ymin, float &zmin, float &xmax, float &ymax, float &zmax) const
Gets the corners of the box.
SbVec3f getClosestPoint(const SbVec3f &point) const
Returns the closest point on the box to the given point.
SbBool triangleBoxOverlap(const SbVec3f &u0, const SbVec3f &u1, const SbVec3f &u2) const
Return true if the given triangle intersects the bounding box.
SbBox3f(const T &b)
Constructor that converts an arbitrary SbBox3 to an SbBox3f.
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
Gets the corners of the box.
void extendBy(const SbBox3f &bb)
Extends this box (if necessary) to contain the specified box.
SbBox3f(const SbVec3f &_min, const SbVec3f &_max)
Constructor for a 3D float box.
SbVec3f getCenter() const
Returns the center of the box.
friend int operator==(const SbBox3f &b1, const SbBox3f &b2)
Equality comparison.
SbBool intersect(const SbVec3f &pt) const
Returns TRUE if the specified point intersects this box.
SbBool hasVolume() const
Returns TRUE if all three dimensions of the box have positive size, and FALSE otherwise.
SbBox3f(float xmin, float ymin, float zmin, float xmax, float ymax, float zmax)
Constructor for a 3D float box.
SbVec3f & getMin()
Returns the minimum point of the box.
void transform(const SbMatrix &m)
Transforms box by matrix, enlarging box to contain result.
SbBool contains(const SbBox3f &bb) const
Returns TRUE if the specified box is fully contained inside this box.
SbVec3f getSize() const
Gets box size.
void extendBy(const SbVec3f &pt)
Extends this box (if necessary) to contain the specified point.
SbBox3f()
Constructor for a 3D float box.
const SbVec3f & getMax() const
Returns the maximum point of the box.
SbBool outside(const SbMatrix &MVP, int &cullBits) const
Returns TRUE if bounding box is completely outside the view-volume defined by the model+view+projecti...
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> 3D box class.
friend std::ostream & operator<<(std::ostream &os, const SbBox3i32 &b)
Writes the box to the specified output stream.
void extendBy(const SbVec3f &pt)
Extends this box (if necessary) to contain the specified point.
void getBounds(SbVec3i32 &_min, SbVec3i32 &_max) const
Gets the corners of the box.
SbBool intersect(const SbBox3i32 &bb) const
Returns TRUE if the specified box intersects this box.
SbVec3i32 & getMin()
Returns the minimum point of the box.
void makeEmpty()
Makes an empty box.
void getSize(int &sizeX, int &sizeY, int &sizeZ) const
Gets box size.
SbBox3i32(const SbVec3i32 &_min, const SbVec3i32 &_max)
Constructor for a 3D integer32 box.
SbBool outside(const SbMatrix &MVP, int &cullBits) const
Returns TRUE if bounding box is completely outside the view-volume defined by the model+view+projecti...
SbBox3i32 intersection(const SbBox3i32 &box) const
Returns the intersection of the specified box with this box.
SbBool isEmpty() const
Returns TRUE if the box is empty, and FALSE otherwise.
SbVec3i32 & getMax()
Returns the maximum point of the box.
SbBox3i32(const SbBox3s &box)
Constructor given an SbBox3s (adapter).
friend int operator==(const SbBox3i32 &b1, const SbBox3i32 &b2)
Equality comparison.
SbVec3f getCenter() const
Returns the center of the box.
SbVec3i32 getSize() const
Gets box size.
SbBox3i32 operator=(const SbBox3s &box)
Assignment operator given an SbBox3s (adapter).
SbBool contains(const SbBox3i32 &bb) const
Returns TRUE if the specified box is fully contained inside this box.
void getOrigin(int &originX, int &originY, int &originZ) const
Gets box origin which is the same as the minimum corner of the box.
float getVolume() const
Returns the volume of the box.
friend int operator!=(const SbBox3i32 &b1, const SbBox3i32 &b2)
Inequality comparison.
SbBox3i32()
Constructor for a 3D integer32 box.
void transform(const SbMatrix &m)
Transforms box by matrix, enlarging box to contain result.
SbBool intersect(const SbVec3f &pt) const
Returns TRUE if the specified point intersects this box.
SbBool intersect(const SbVec3i32 &pt) const
Returns TRUE if the specified point intersects this box.
const SbVec3i32 & getMin() const
Returns the minimum point of the box.
void getBounds(int &xmin, int &ymin, int &zmin, int &xmax, int &ymax, int &zmax) const
Gets the corners of the box.
SbBool hasVolume() const
Returns TRUE if all three dimensions of the box have positive size, and FALSE otherwise.
SbBox3i32(int xmin, int ymin, int zmin, int xmax, int ymax, int zmax)
Constructor for a 3D integer32 box.
void getSpan(const SbVec3f &direction, float &dMin, float &dMax) const
Finds the span of a box along a specified direction.
void setBounds(int xmin, int ymin, int zmin, int xmax, int ymax, int zmax)
Sets the corners of the box.
void setBounds(const SbVec3i32 &_min, const SbVec3i32 &_max)
Sets the corners of the box.
const SbVec3i32 & getMax() const
Returns the maximum point of the box.
void extendBy(const SbBox3i32 &bb)
Extends this box (if necessary) to contain the specified box.
SbVec3f getClosestPoint(const SbVec3f &point) const
Returns the closest point on the box to the given point.
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> 3D box class.
const SbVec3s & getMin() const
Returns the minimum point of the box.
void getBounds(short &xmin, short &ymin, short &zmin, short &xmax, short &ymax, short &zmax) const
Gets the corners of the box.
SbVec3f getCenter() const
Returns the center of the box.
SbBool contains(const SbBox3s &bb) const
Returns TRUE if the specified box is fully contained inside this box.
SbBool intersect(const SbVec3f &pt) const
Returns TRUE if the specified point intersects this box.
SbBox3s(const SbBox3i32 &box)
Constructor given an SbBox3i32 (adapter).
void getBounds(SbVec3s &_min, SbVec3s &_max) const
Gets the corners of the box.
SbVec3s & getMax()
Returns the maximum point of the box.
void getSpan(const SbVec3f &direction, float &dMin, float &dMax) const
Finds the span of a box along a specified direction.
SbVec3s & getMin()
Returns the minimum point of the box.
SbBox3s operator=(const SbBox3i32 &box)
Assignment operator given an SbBox3i32 (adapter).
void transform(const SbMatrix &m)
Transforms box by matrix, enlarging box to contain result.
void setBounds(short xmin, short ymin, short zmin, short xmax, short ymax, short zmax)
Sets the corners of the box.
SbBox3s()
Constructor for a 3D short box.
float getVolume() const
Returns the volume of the box.
friend int operator==(const SbBox3s &b1, const SbBox3s &b2)
Equality comparison.
SbVec3f getClosestPoint(const SbVec3f &point) const
Returns the closest point on the box to the given point.
friend int operator!=(const SbBox3s &b1, const SbBox3s &b2)
Inequality comparison.
SbBool outside(const SbMatrix &MVP, int &cullBits) const
Returns TRUE if bounding box is completely outside the view-volume defined by the model+view+projecti...
void extendBy(const SbBox3s &bb)
Extends this box (if necessary) to contain the specified box.
SbBool intersect(const SbBox3s &bb) const
Returns TRUE if the specified box intersects this box.
SbBool isEmpty() const
Returns TRUE if the box is empty, and FALSE otherwise.
void setBounds(const SbVec3s &_min, const SbVec3s &_max)
Sets the corners of the box.
SbBox3s intersection(const SbBox3s &box) const
Returns the intersection of the specified box with this box.
void extendBy(const SbVec3f &pt)
Extends this box (if necessary) to contain the specified point.
void getOrigin(short &originX, short &originY, short &originZ) const
Gets box origin which is the same as the minimum corner of the box.
SbBox3s(const SbVec3s &_min, const SbVec3s &_max)
Constructor for a 3D short box.
const SbVec3s & getMax() const
Returns the maximum point of the box.
SbBool hasVolume() const
Returns TRUE if all three dimensions of the box have positive size, and FALSE otherwise.
SbBox3s(short xmin, short ymin, short zmin, short xmax, short ymax, short zmax)
Constructor for a 3D short box.
void makeEmpty()
Makes an empty box.
void getSize(short &sizeX, short &sizeY, short &sizeZ) const
Gets box size.
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> 4D box class.
SbVec4i32 & getMin()
Returns the minimum point of the box.
SbBox4i32(const SbVec4i32 &_min, const SbVec4i32 &_max)
Constructor for a 4D integer32 box.
friend std::ostream & operator<<(std::ostream &os, const SbBox4i32 &b)
Writes the box to the specified output stream.
void makeEmpty()
Makes an empty box.
const SbVec4i32 & getMin() const
Returns the minimum point of the box.
const SbVec4i32 & getMax() const
Returns the maximum point of the box.
SbBox4i32()
Constructor for a 4D integer32 box.
SbBool isEmpty() const
Returns TRUE if the box is empty, and FALSE otherwise.
SbVec4i32 & getMax()
Returns the maximum point of the box.
SbBool intersect(const SbVec4i32 &pt) const
Returns TRUE if the specified point intersects this box.
void extendBy(const SbVec4i32 &pt)
Extends this box (if necessary) to contain the specified point.
SbVec4i32 getSize() const
Gets box size.
friend int operator==(const SbBox4i32 &b1, const SbBox4i32 &b2)
Equality comparison.
friend int operator!=(const SbBox4i32 &b1, const SbBox4i32 &b2)
Inequality comparison.
void setValue(const SbMat &m)
Sets matrix from a 4x4 array of elements.
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> 4x4 matrix class...
void setValue(const SbMatd &m)
Sets value from 4x4 array of elements.
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> 2D vector class ...
SbVec2d & setValue(const double v[2])
Sets the vector components.
const double * getValue() const
Returns vector components.
const float * getValue() const
Returns vector components.
SbVec2f & setValue(const float v[2])
Sets the vector components.
SbVec2i32 & setValue(const int32_t v[2])
Sets value of vector from array of 2 components.
const int32_t * getValue() const
Returns pointer to array of 2 components.
SbVec2s & setValue(const short v[2])
Sets vector components.
const short * getValue() const
Returns vector components.
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> 3D vector class ...
SbVec3d & setValue(const double v[3])
Sets the vector components.
const double * getValue() const
Returns vector components.
SbVec3f & setValue(const float v[3])
Sets the vector components.
const float * getValue() const
Returns vector components.
const int32_t * getValue() const
Returns pointer to array of 3 components.
SbVec3i32 & setValue(const int32_t v[3])
Sets value of vector from array of 3 components.
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> 3D vector class.
SbVec3s & setValue(const short v[3])
Sets vector components.
const short * getValue() const
Returns vector components.
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> 3D box with an a...
void setBounds(const SbVec3d &_min, const SbVec3d &_max)
Sets the bounds of the box.
void extendBy(const SbXfBox3d &bb)
Extends the box (if necessary) to contain the given box.
void makeEmpty()
Sets the box to contain nothing.
SbBool isEmpty() const
Returns TRUE if the box is empty, and FALSE otherwise.
friend int operator==(const SbXfBox3d &b1, const SbXfBox3d &b2)
Equality comparison.
SbBool hasVolume() const
Checks if the box has volume; i.e., all three dimensions have positive size.
void setBounds(double xmin, double ymin, double zmin, double xmax, double ymax, double zmax)
Sets the bounds of the box.
const SbMatrixd & getTransform() const
Gets the transformation on the box.
void getOrigin(double &originX, double &originY, double &originZ) const
Returns origin (minimum point) of the box.
void transform(const SbMatrixd &m)
Transforms the box by the given matrix.
void setTransform(const SbMatrixd &m)
Sets the transformation on the box.
friend int operator!=(const SbXfBox3d &b1, const SbXfBox3d &b2)
Inequality comparison.
void extendBy(const SbBox3d &bb)
Extends the box (if necessary) to contain the given box.
double getVolume() const
Gives the volume of the box (0 for an empty box).
SbXfBox3d(const SbBox3d &box)
Constructor.
SbBool intersect(const SbBox3d &bb) const
Returns TRUE if intersection of this XfBox3d and the given Box3d is not empty.
void extendBy(const SbVec3d &pt)
Extends the box (if necessary) to contain the given 3D point.
const SbMatrixd & getInverse() const
Gets the inverse of the transformation on the box.
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.
SbBool intersect(const SbVec3d &pt) const
Returns TRUE if intersection of given point and this box 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
Gets the bounds of the box.
SbXfBox3d(const SbVec3d &_min, const SbVec3d &_max)
Constructor.
SbXfBox3d & setValue(const SbXfBox3f &xfbox3f)
Sets value of the box from a single precision box.
void getSize(double &sizeX, double &sizeY, double &sizeZ) const
Returns size of the box.
void getBounds(SbVec3d &_min, SbVec3d &_max) const
Gets the bounds 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 inverse of the transformation on the box.
SbXfBox3f(const SbBox3f &box)
Constructor.
void extendBy(const SbXfBox3f &bb)
Extends the box (if necessary) to contain the given box.
float getVolume() const
Gives the volume of the box (0 for an empty box).
float computeMaxDistance2(const SbVec3f &p) const
Returns the squared maximum distance between a point and the 8 bounding box's vertices.
SbXfBox3f(const SbVec3f &_min, const SbVec3f &_max)
Constructor.
SbBool isEmpty() const
Returns TRUE if the box is empty, and FALSE otherwise.
SbBox3f project() const
Projects an SbXfBox3f to an SbBox3f.
void getOrigin(float &originX, float &originY, float &originZ)
Returns origin (minimum point) of the box.
SbBool intersect(const SbBox3f &bb) const
Returns TRUE if intersection of given box and this box is not empty.
friend int operator!=(const SbXfBox3f &b1, const SbXfBox3f &b2)
Inequality comparison.
SbVec3f getCenter() const
Returns the center of the box.
void getBounds(float &xmin, float &ymin, float &zmin, float &xmax, float &ymax, float &zmax) const
Gets the bounds of the box.
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)
Sets the bounds of the box.
SbXfBox3f & setValue(const SbXfBox3d &xfbox3d)
Sets value of the box from a double precision box.
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
Gets the bounds of the box.
void makeEmpty()
Sets the box to contain nothing.
void setBounds(float xmin, float ymin, float zmin, float xmax, float ymax, float zmax)
Sets the bounds of the box.
friend int operator==(const SbXfBox3f &b1, const SbXfBox3f &b2)
Equality comparison.
SbVec3f getClosestPoint(const SbVec3f &point) const
Returns the closest point on the box to the given point.
SbBool intersect(const SbVec3f &pt) const
Returns TRUE if intersection of given point and this box is not empty.
void extendBy(const SbBox3f &bb)
Extends the box (if necessary) to contain the given box.
const SbMatrix & getTransform() const
Gets the transformation on the box.
SbBool hasVolume() const
Checks if the box has volume; i.e., all three dimensions have positive size.
void extendBy(const SbVec3f &pt)
Extends the box (if necessary) to contain the given 3D point.