29 #include <Inventor/SbVec3f.h>
40 SbBox3f(
float xmin,
float ymin,
float zmin,
float xmax,
float ymax,
float zmax)
41 : minpt(xmin, ymin, zmin), maxpt(xmax, ymax, zmax) { }
43 : minpt(minpoint), maxpt(maxpoint) { }
46 explicit SbBox3f(
const SbBox3i32 & box) { setBounds(box); }
48 SbBox3f & setBounds(
float xmin,
float ymin,
float zmin,
float xmax,
float ymax,
float zmax)
49 { minpt.setValue(xmin, ymin, zmin); maxpt.setValue(xmax, ymax, zmax);
return *
this; }
51 { minpt = minpoint; maxpt = maxpoint;
return *
this; }
54 SbBox3f & setBounds(
const SbBox3i32 & box);
56 void getBounds(
float & xmin,
float & ymin,
float & zmin,
float & xmax,
float & ymax,
float & zmax)
const
57 { minpt.getValue(xmin, ymin, zmin); maxpt.getValue(xmax, ymax, zmax); }
59 { minpoint = minpt; maxpoint = maxpt; }
66 void extendBy(
const SbVec3f & pt);
67 void extendBy(
const SbBox3f & box);
68 void transform(
const SbMatrix & matrix);
70 SbBool
isEmpty(
void)
const {
return maxpt[0] < minpt[0]; }
71 SbBool hasVolume(
void)
const
72 {
return ((maxpt[0] > minpt[0]) && (maxpt[1] > minpt[1]) && (maxpt[2] > minpt[2])); }
73 float getVolume(
void)
const
74 {
float dx = 0.0f, dy = 0.0f, dz = 0.0f; getSize(dx, dy, dz);
return (dx * dy * dz); }
76 SbBool intersect(
const SbVec3f & pt)
const;
77 SbBool intersect(
const SbBox3f & box)
const;
79 SbBool outside(
const SbMatrix & mvp,
int & cullbits)
const;
82 void getOrigin(
float & originX,
float & originY,
float & originZ)
const
83 { minpt.
getValue(originX, originY, originZ); }
84 void getSize(
float & sizeX,
float & sizeY,
float & sizeZ)
const
85 {
if (isEmpty()) { sizeX = sizeY = sizeZ = 0; }
86 else { sizeX = maxpt[0] - minpt[0]; sizeY = maxpt[1] - minpt[1]; sizeZ = maxpt[2] - minpt[2]; } }
90 this->getSize(v[0], v[1], v[2]);
93 void getSpan(
const SbVec3f & dir,
float & dmin,
float & dmax)
const;
95 void print(FILE * file)
const;
110 #endif // !COIN_SBBOX3F_H