Go to the documentation of this file.
27 #ifndef vtkBoundingBox_h
28 #define vtkBoundingBox_h
29 #include "vtkCommonDataModelModule.h"
43 double yMin,
double yMax,
44 double zMin,
double zMax);
70 void SetBounds(
const double bounds[6]);
71 void SetBounds(
double xMin,
double xMax,
72 double yMin,
double yMax,
73 double zMin,
double zMax);
81 void SetMinPoint(
double x,
double y,
double z);
82 void SetMinPoint(
double p[3]);
90 void SetMaxPoint(
double x,
double y,
double z);
91 void SetMaxPoint(
double p[3]);
100 static int IsValid(
const double bounds[6]);
108 void AddPoint(
double p[3]);
109 void AddPoint(
double px,
double py,
double pz);
122 void AddBounds(
const double bounds[]);
141 bool IntersectPlane(
double origin[3],
double normal[3]);
153 void GetBounds(
double bounds[6])
const;
154 void GetBounds(
double &xMin,
double &xMax,
155 double &yMin,
double &yMax,
156 double &zMin,
double &zMax)
const;
162 double GetBound(
int i)
const;
169 void GetMinPoint(
double &x,
double &y,
double &z)
const;
170 void GetMinPoint(
double x[3]);
178 void GetMaxPoint(
double &x,
double &y,
double &z)
const;
179 void GetMaxPoint(
double x[3]);
186 void GetCorner(
int corner,
double p[3])
const;
192 int ContainsPoint(
double p[3])
const;
193 int ContainsPoint(
double px,
double py,
double pz)
const;
199 void GetCenter(
double center[3])
const;
204 void GetLengths(
double lengths[3])
const;
209 double GetLength(
int i)
const;
214 double GetMaxLength()
const;
220 double GetDiagonalLength()
const;
231 void Inflate(
double delta);
232 void Inflate(
double deltaX,
double deltaY,
double deltaZ);
243 void Scale(
double s[3]);
244 void Scale(
double sx,
double sy,
double sz);
253 void ScaleAboutCenter(
double s);
254 void ScaleAboutCenter(
double s[3]);
255 void ScaleAboutCenter(
double sx,
double sy,
double sz);
276 double MinPnt[3], MaxPnt[3];
286 double &yMin,
double &yMax,
287 double &zMin,
double &zMax)
const
302 return ((i & 0x1) ? this->
MaxPnt[i>>1] : this->
MinPnt[i>>1]);
338 return (bounds[0] <= bounds[1] &&
339 bounds[2] <= bounds[3] &&
340 bounds[4] <= bounds[5]);
364 this->
SetBounds(bounds[0], bounds[1], bounds[2],
365 bounds[3], bounds[4], bounds[5]);
370 this->
GetBounds(bounds[0], bounds[1], bounds[2],
371 bounds[3], bounds[4], bounds[5]);
386 double yMin,
double yMax,
387 double zMin,
double zMax)
390 this->
SetBounds(xMin, xMax, yMin, yMax, zMin, zMax);
419 (this->MinPnt[1] == bbox.
MinPnt[1]) &&
420 (this->MinPnt[2] == bbox.
MinPnt[2]) &&
421 (this->MaxPnt[0] == bbox.
MaxPnt[0]) &&
422 (this->MaxPnt[1] == bbox.
MaxPnt[1]) &&
423 (this->MaxPnt[2] == bbox.
MaxPnt[2]));
428 return !((*this) == bbox);
480 if ((corner < 0) || (corner > 7))
488 int ix = (corner & 1) ? 1 : 0;
489 int iy = ((corner >> 1) & 1) ? 1 : 0;
490 int iz = (corner >> 2) ? 1 : 0;
vtkBoundingBox & operator=(const vtkBoundingBox &bbox)
Assignment Operator.
const double * GetMaxPoint() const
Get the maximum point of the bounding box.
int IsValid() const
Returns 1 if the bounds have been set and 0 if the box is in its initialized state which is an invert...
void SetMinPoint(double x, double y, double z)
Set the minimum point of the bounding box - if the min point is greater than the max point then the m...
void GetLengths(double lengths[3]) const
Get the length of each sode of the box.
Fast Simple Class for dealing with 3D bounds.
void SetMaxPoint(double x, double y, double z)
Set the maximum point of the bounding box - if the max point is less than the min point then the min ...
#define VTK_SIZEHINT(...)
void SetBounds(const double bounds[6])
Set the bounds explicitly of the box (using the VTK convention for representing a bounding box).
void GetBounds(double bounds[6]) const
Get the bounds of the box (defined by VTK style).
bool operator!=(const vtkBoundingBox &bbox) const
const double * GetMinPoint() const
Get the minimum point of the bounding box.
bool operator==(const vtkBoundingBox &bbox) const
Equality operator.
void GetCenter(double center[3]) const
Get the center of the bounding box.
void Reset()
Returns the box to its initialized state.
double GetLength(int i) const
Return the length of the bounding box in the ith direction.
VTKCOMMONCORE_EXPORT bool operator==(const vtkUnicodeString &lhs, const vtkUnicodeString &rhs)
vtkBoundingBox()
Construct a bounding box with the min point set to VTK_DOUBLE_MAX and the max point set to VTK_DOUBLE...
void GetCorner(int corner, double p[3]) const
Get the ith corner of the bounding box.
int ContainsPoint(double p[3]) const
Returns 1 if the point is contained in the box else 0.
VTKCOMMONCORE_EXPORT bool operator!=(const vtkUnicodeString &lhs, const vtkUnicodeString &rhs)
double GetBound(int i) const
Return the ith bounds of the box (defined by VTK style).