38 #include <Inventor/SbVec3f.h> 49 SbBox3f(
float xmin,
float ymin,
float zmin,
float xmax,
float ymax,
float zmax)
50 : minpt(xmin, ymin, zmin), maxpt(xmax, ymax, zmax) { }
52 : minpt(minpoint), maxpt(maxpoint) { }
57 SbBox3f &
setBounds(
float xmin,
float ymin,
float zmin,
float xmax,
float ymax,
float zmax)
58 { minpt.setValue(xmin, ymin, zmin); maxpt.setValue(xmax, ymax, zmax);
return *
this; }
60 { minpt = minpoint; maxpt = maxpoint;
return *
this; }
65 void getBounds(
float & xmin,
float & ymin,
float & zmin,
float & xmax,
float & ymax,
float & zmax)
const 66 { minpt.getValue(xmin, ymin, zmin); maxpt.getValue(xmax, ymax, zmax); }
68 { minpoint = minpt; maxpoint = maxpt; }
75 void extendBy(
const SbVec3f & pt);
76 void extendBy(
const SbBox3f & box);
77 void transform(
const SbMatrix & matrix);
79 SbBool
isEmpty(
void)
const {
return maxpt[0] < minpt[0]; }
81 {
return ((maxpt[0] > minpt[0]) && (maxpt[1] > minpt[1]) && (maxpt[2] > minpt[2])); }
83 {
float dx = 0.0f, dy = 0.0f, dz = 0.0f; getSize(dx, dy, dz);
return (dx * dy * dz); }
85 SbBool intersect(
const SbVec3f & pt)
const;
86 SbBool intersect(
const SbBox3f & box)
const;
88 SbBool outside(
const SbMatrix & mvp,
int & cullbits)
const;
91 void getOrigin(
float & originX,
float & originY,
float & originZ)
const 92 { minpt.getValue(originX, originY, originZ); }
93 void getSize(
float & sizeX,
float & sizeY,
float & sizeZ)
const 94 {
if (isEmpty()) { sizeX = sizeY = sizeZ = 0; }
95 else { sizeX = maxpt[0] - minpt[0]; sizeY = maxpt[1] - minpt[1]; sizeZ = maxpt[2] - minpt[2]; } }
99 this->getSize(v[0], v[1], v[2]);
102 void getSpan(
const SbVec3f & dir,
float & dmin,
float & dmax)
const;
104 void print(FILE * file)
const;
119 #endif // !COIN_SBBOX3F_H void getOrigin(float &originX, float &originY, float &originZ) const
Definition: SbBox3f.h:91
SbBox3f & setBounds(const SbVec3f &minpoint, const SbVec3f &maxpoint)
Definition: SbBox3f.h:59
The SbBox3s class is a 3 dimensional box with short integer coordinates.
Definition: SbBox3s.h:43
SbVec3f & getMin(void)
Definition: SbBox3f.h:71
The SbBox3f class is an abstraction for an axis aligned 3 dimensional box.
Definition: SbBox3f.h:46
float getVolume(void) const
Definition: SbBox3f.h:82
int operator==(const SbBox2s &b1, const SbBox2s &b2)
Definition: SbBox2s.h:102
void getSize(float &sizeX, float &sizeY, float &sizeZ) const
Definition: SbBox3f.h:93
SbBox3f(void)
Definition: SbBox3f.h:48
int operator!=(const SbBox2s &b1, const SbBox2s &b2)
Definition: SbBox2s.h:106
SbBox3f(float xmin, float ymin, float zmin, float xmax, float ymax, float zmax)
Definition: SbBox3f.h:49
SbBox3f & setBounds(float xmin, float ymin, float zmin, float xmax, float ymax, float zmax)
Definition: SbBox3f.h:57
The SbVec3f class is a 3 dimensional vector with floating point coordinates.
Definition: SbVec3f.h:51
void getBounds(SbVec3f &minpoint, SbVec3f &maxpoint) const
Definition: SbBox3f.h:67
const SbVec3f & getMax(void) const
Definition: SbBox3f.h:72
SbBox3f(const SbVec3f &minpoint, const SbVec3f &maxpoint)
Definition: SbBox3f.h:51
SbVec3f getSize(void) const
Definition: SbBox3f.h:97
The SbMatrix class is a 4x4 dimensional representation of a matrix.
Definition: SbMatrix.h:47
SbVec3f & getMax(void)
Definition: SbBox3f.h:73
The SbBox3d class is an abstraction for an axis aligned 3 dimensional box.
Definition: SbBox3d.h:46
const SbVec3f & getMin(void) const
Definition: SbBox3f.h:70
Definition: SbBox3i32.h:44
SbVec3f getCenter(void) const
Definition: SbBox3f.h:90
SbBool isEmpty(void) const
Definition: SbBox3f.h:79
void getBounds(float &xmin, float &ymin, float &zmin, float &xmax, float &ymax, float &zmax) const
Definition: SbBox3f.h:65
SbBool hasVolume(void) const
Definition: SbBox3f.h:80