1 #ifndef COIN_SBBOX3I32_H 2 #define COIN_SBBOX3I32_H 36 #include <Inventor/SbVec3i32.h> 37 #include <Inventor/SbVec3f.h> 47 SbBox3i32(int32_t xmin, int32_t ymin, int32_t zmin, int32_t xmax, int32_t ymax, int32_t zmax)
48 : minpt(xmin, ymin, zmin), maxpt(xmax, ymax, zmax) { }
50 : minpt(minpoint), maxpt(maxpoint) { }
55 SbBox3i32 & setBounds(int32_t xmin, int32_t ymin, int32_t zmin, int32_t xmax, int32_t ymax, int32_t zmax)
56 { minpt.setValue(xmin, ymin, zmin); maxpt.setValue(xmax, ymax, zmax);
return *
this; }
58 { minpt = minpoint; maxpt = maxpoint;
return *
this; }
63 void getBounds(int32_t & xmin, int32_t & ymin, int32_t & zmin, int32_t & xmax, int32_t & ymax, int32_t & zmax)
const 64 { minpt.getValue(xmin, ymin, zmin); maxpt.getValue(xmax, ymax, zmax); }
66 { minpoint = minpt; maxpoint = maxpt; }
68 const SbVec3i32 & getMin(
void)
const {
return minpt; }
69 SbVec3i32 & getMin(
void) {
return minpt; }
70 const SbVec3i32 & getMax(
void)
const {
return maxpt; }
71 SbVec3i32 & getMax(
void) {
return maxpt; }
75 void extendBy(
const SbVec3f & pt);
78 SbBool isEmpty(
void)
const {
return (maxpt[0] < minpt[0]); }
79 SbBool hasVolume(
void)
const 80 {
return ((maxpt[0] > minpt[0]) && (maxpt[1] > minpt[1]) && (maxpt[2] > minpt[2])); }
81 float getVolume(
void)
const 82 { int32_t dx = 0, dy = 0, dz = 0; getSize(dx, dy, dz);
return (
float(dx) *
float(dy) *
float(dz)); }
84 SbBool intersect(
const SbVec3i32 & pt)
const;
85 SbBool intersect(
const SbBox3i32 & bb)
const;
86 SbBool intersect(
const SbVec3f & pt)
const;
88 SbBool outside(
const SbMatrix & MVP,
int & cullBits)
const;
91 SbVec3f getCenter(
void)
const {
return SbVec3f(minpt + maxpt) * 0.5f; }
92 void getOrigin(int32_t & originX, int32_t & originY, int32_t & originZ)
const 93 { minpt.
getValue(originX, originY, originZ); }
94 void getSize(int32_t & sizeX, int32_t & sizeY, int32_t & sizeZ)
const 95 {
if (isEmpty()) { sizeX = sizeY = sizeZ = 0; }
96 else { sizeX = maxpt[0] - minpt[0]; sizeY = maxpt[1] - minpt[1]; sizeZ = maxpt[2] - minpt[2]; } }
100 this->getSize(v[0], v[1], v[2]);
104 void getSpan(
const SbVec3f & direction,
float & dmin,
float & dmax)
const;
113 return ((b1.getMin() == b2.getMin()) && (b1.getMax() == b2.getMax()));
121 #endif // !COIN_SBBOX3I32_H The SbBox3s class is a 3 dimensional box with short integer coordinates.
Definition: SbBox3s.h:43
The SbBox3f class is an abstraction for an axis aligned 3 dimensional box.
Definition: SbBox3f.h:46
int operator==(const SbBox2s &b1, const SbBox2s &b2)
Definition: SbBox2s.h:102
const float * getValue(void) const
Definition: SbVec3f.h:73
int operator!=(const SbBox2s &b1, const SbBox2s &b2)
Definition: SbBox2s.h:106
The SbVec3f class is a 3 dimensional vector with floating point coordinates.
Definition: SbVec3f.h:51
The SbMatrix class is a 4x4 dimensional representation of a matrix.
Definition: SbMatrix.h:47
Definition: SbVec3i32.h:48
The SbBox3d class is an abstraction for an axis aligned 3 dimensional box.
Definition: SbBox3d.h:46
Definition: SbBox3i32.h:44