38 double min[3];
double max[3];
40 std::vector< double > xaxis; xaxis.resize( 4 );
41 std::vector< double > yaxis; yaxis.resize( 4 );
42 std::vector< double > zaxis; zaxis.resize( 4 );
59 std::sort( xaxis.begin( ), xaxis.end( ) );
60 std::sort( yaxis.begin( ), yaxis.end( ) );
61 std::sort( zaxis.begin( ), zaxis.end( ) );
64 min[ 0 ] = xaxis[ 1 ];
65 max[ 0 ] = xaxis[ 2 ];
67 min[ 1 ] = yaxis[ 1 ];
68 max[ 1 ] = yaxis[ 2 ];
70 min[ 2 ] = zaxis[ 1 ];
71 max[ 2 ] = zaxis[ 2 ];
78 max[ 0 ], max[ 1 ], max[ 2 ] ) );
89 return( 6*
sizeof(
double ) );
102 const double x,
const double y,
const double z,
103 const double X,
const double Y,
const double Z )
118 this ->min[ 0 ] = 0.0;
119 this ->min[ 1 ] = 0.0;
120 this ->min[ 2 ] = 0.0;
121 this ->max[ 0 ] = 1.0;
122 this ->max[ 1 ] = 1.0;
123 this ->max[ 2 ] = 1.0;
136 const double X,
const double Y,
const double Z )
138 this ->setCoordinates( x,y,z, X,Y,Z );
152 inline double getMinX( ){
return this ->min[ 0 ]; };
157 inline double getMinY( ){
return this ->min[ 1 ]; };
162 inline double getMinZ( ){
return this ->min[ 2 ]; };
167 inline double getMaxX( ){
return this ->max[ 0 ]; };
172 inline double getMaxY( ){
return this ->max[ 1 ]; };
177 inline double getMaxZ( ){
return this ->max[ 2 ]; };
187 inline bool hasPoint(
const double x,
const double y,
const double z )
A concrete object that provides the functionality for representing a bounding box geometric primitive...
void int int REAL REAL * y
bool hasPoint(const double x, const double y, const double z)
Determines if a point is inside the bounding box.
static size_t Size()
Same as BoundingBox::getBytesize( ) but does not require a BoundingBox instance to be allocated...
void setCoordinates(const double x, const double y, const double z, const double X, const double Y, const double Z)
Sets the coordinates of this BoundingBox instance.
static BoundingBox intersection(BoundingBox &b1, BoundingBox &b2)
Computes the bounding box intersection between bounding box b1,b2.
BoundingBox()
Default Constructor.
void int int int REAL REAL REAL * z
BoundingBox(const double x, const double y, const double z, const double X, const double Y, const double Z)
Custom Constructor.
This library provides routines for comparing two floating numbers within a user-supplied tolerance...
~BoundingBox()
Destructor.
bool fpointequals(const double a, const double b, double TOL=1e-9)
Checks if two floating numbers are "nearly" equal.