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