1 #ifndef COIN_SBBOX3I32_H
2 #define COIN_SBBOX3I32_H
27 #include <Inventor/SbVec3i32.h>
28 #include <Inventor/SbVec3f.h>
38 SbBox3i32(int32_t xmin, int32_t ymin, int32_t zmin, int32_t xmax, int32_t ymax, int32_t zmax)
39 : minpt(xmin, ymin, zmin), maxpt(xmax, ymax, zmax) { }
41 : minpt(minpoint), maxpt(maxpoint) { }
46 SbBox3i32 &
setBounds(int32_t xmin, int32_t ymin, int32_t zmin, int32_t xmax, int32_t ymax, int32_t zmax)
47 { minpt.setValue(xmin, ymin, zmin); maxpt.setValue(xmax, ymax, zmax);
return *
this; }
49 { minpt = minpoint; maxpt = maxpoint;
return *
this; }
54 void getBounds(int32_t & xmin, int32_t & ymin, int32_t & zmin, int32_t & xmax, int32_t & ymax, int32_t & zmax)
const
55 { minpt.getValue(xmin, ymin, zmin); maxpt.getValue(xmax, ymax, zmax); }
57 { minpoint = minpt; maxpoint = maxpt; }
66 void extendBy(
const SbVec3f & pt);
69 SbBool
isEmpty(
void)
const {
return (maxpt[0] < minpt[0]); }
71 {
return ((maxpt[0] > minpt[0]) && (maxpt[1] > minpt[1]) && (maxpt[2] > minpt[2])); }
73 { int32_t dx = 0, dy = 0, dz = 0; getSize(dx, dy, dz);
return (
float(dx) *
float(dy) *
float(dz)); }
75 SbBool intersect(
const SbVec3i32 & pt)
const;
76 SbBool intersect(
const SbBox3i32 & bb)
const;
77 SbBool intersect(
const SbVec3f & pt)
const;
79 SbBool outside(
const SbMatrix & MVP,
int & cullBits)
const;
83 void getOrigin(int32_t & originX, int32_t & originY, int32_t & originZ)
const
84 { minpt.getValue(originX, originY, originZ); }
85 void getSize(int32_t & sizeX, int32_t & sizeY, int32_t sizeZ)
const
86 {
if (isEmpty()) { sizeX = sizeY = sizeZ = 0; }
87 else { sizeX = maxpt[0] - minpt[0]; sizeY = maxpt[1] - minpt[1]; sizeZ = maxpt[2] - minpt[2]; } }
89 void getSpan(
const SbVec3f & direction,
float & dmin,
float & dmax)
const;
106 #endif // !COIN_SBBOX3I32_H
SbBool intersect(const SbVec3i32 &pt) const
Definition: SbBox3i32.cpp:329
SbBool isEmpty(void) const
Definition: SbBox3d.h:70
The SbMatrix class is a 4x4 dimensional representation of a matrix.
Definition: SbMatrix.h:37
SbBox3i32(void)
Definition: SbBox3i32.h:37
void getOrigin(int32_t &originX, int32_t &originY, int32_t &originZ) const
Definition: SbBox3i32.h:83
void getBounds(SbVec3i32 &minpoint, SbVec3i32 &maxpoint) const
Definition: SbBox3i32.h:56
void multVecMatrix(const SbVec3f &src, SbVec3f &dst) const
Definition: SbMatrix.cpp:1357
const SbVec3f & getMin(void) const
Definition: SbBox3f.cpp:122
The SbBox3f class is an abstraction for an axis aligned 3 dimensional box.
Definition: SbBox3f.h:37
static void postWarning(const char *const source, const char *const format,...)
Definition: SoDebugError.cpp:324
void getBounds(int32_t &xmin, int32_t &ymin, int32_t &zmin, int32_t &xmax, int32_t &ymax, int32_t &zmax) const
Definition: SbBox3i32.h:54
void extendBy(const SbVec3i32 &pt)
Definition: SbBox3i32.cpp:219
const SbVec3d & getMin(void) const
Definition: SbBox3d.h:61
SbBox3i32 & setBounds(const SbVec3i32 &minpoint, const SbVec3i32 &maxpoint)
Definition: SbBox3i32.h:48
void getSize(int32_t &sizeX, int32_t &sizeY, int32_t sizeZ) const
Definition: SbBox3i32.h:85
const SbVec3s & getMin(void) const
Definition: SbBox3s.cpp:168
float getVolume(void) const
Definition: SbBox3i32.h:72
const SbVec3i32 & getMin(void) const
Definition: SbBox3i32.h:59
The SbBox3s class is a 3 dimensional box with short integer coordinates.
Definition: SbBox3s.h:34
SbBox3i32(const SbVec3i32 &minpoint, const SbVec3i32 &maxpoint)
Definition: SbBox3i32.h:40
const SbVec3f & getMax(void) const
Definition: SbBox3f.cpp:134
void getSpan(const SbVec3f &direction, float &dmin, float &dmax) const
Definition: SbBox3i32.cpp:468
SbBool hasVolume(void) const
Definition: SbBox3i32.h:70
SbVec3i32 & setValue(const int32_t v[3])
Definition: SbVec3i32.h:50
const SbVec3s & getMax(void) const
Definition: SbBox3s.cpp:189
SbVec3f & setValue(const float v[3])
Definition: SbVec3f.cpp:461
int operator!=(const SbBox2i32 &b1, const SbBox2i32 &b2)
Definition: SbBox2i32.h:91
SbBool isEmpty(void) const
Definition: SbBox3s.h:58
The SbVec3f class is a 3 dimensional vector with floating point coordinates.
Definition: SbVec3f.h:37
SbVec3i32 & getMin(void)
Definition: SbBox3i32.h:60
float dot(const SbVec3f &v) const
Definition: SbVec3f.cpp:282
SbVec3f getCenter(void) const
Definition: SbBox3i32.h:82
SbBox3i32 & setBounds(int32_t xmin, int32_t ymin, int32_t zmin, int32_t xmax, int32_t ymax, int32_t zmax)
Definition: SbBox3i32.h:46
void transform(const SbMatrix &m)
Definition: SbBox3i32.cpp:268
SbBool outside(const SbMatrix &MVP, int &cullBits) const
Definition: SbBox3i32.cpp:375
The SbVec3i32 class is a 3 dimensional vector with 32-bit integer coordinates.
Definition: SbVec3i32.h:39
float normalize(void)
Definition: SbVec3f.cpp:436
SbBox3i32(const SbBox3s &box)
Definition: SbBox3i32.h:42
void makeEmpty(void)
Definition: SbBox3i32.cpp:299
SbBox3i32(const SbBox3f &box)
Definition: SbBox3i32.h:43
SbVec3f getClosestPoint(const SbVec3f &pt) const
Definition: SbBox3i32.cpp:412
Definition: SbBox3i32.h:35
const SbVec3i32 & getMax(void) const
Definition: SbBox3i32.h:61
The SbBox3d class is an abstraction for an axis aligned 3 dimensional box.
Definition: SbBox3d.h:37
SbBool isEmpty(void) const
Definition: SbBox3i32.h:69
SbBox3i32(const SbBox3d &box)
Definition: SbBox3i32.h:44
const SbVec3d & getMax(void) const
Definition: SbBox3d.h:63
SbBox3i32(int32_t xmin, int32_t ymin, int32_t zmin, int32_t xmax, int32_t ymax, int32_t zmax)
Definition: SbBox3i32.h:38
int operator==(const SbBox2i32 &b1, const SbBox2i32 &b2)
Definition: SbBox2i32.h:87
SbBool isEmpty(void) const
Definition: SbBox3f.cpp:436
SbVec3i32 & getMax(void)
Definition: SbBox3i32.h:62
Copyright © 1998-2007 by Systems in Motion AS. All rights reserved.
Generated on Wed Jul 24 2019 for Coin by Doxygen. 1.8.17