Go to the documentation of this file.
30 #ifndef vtkBoundingBox_h
31 #define vtkBoundingBox_h
32 #include "vtkCommonDataModelModule.h"
46 double yMin,
double yMax,
47 double zMin,
double zMax);
73 void SetBounds(
const double bounds[6]);
74 void SetBounds(
double xMin,
double xMax,
75 double yMin,
double yMax,
76 double zMin,
double zMax);
84 void SetMinPoint(
double x,
double y,
double z);
85 void SetMinPoint(
double p[3]);
93 void SetMaxPoint(
double x,
double y,
double z);
94 void SetMaxPoint(
double p[3]);
103 static int IsValid(
const double bounds[6]);
111 void AddPoint(
double p[3]);
112 void AddPoint(
double px,
double py,
double pz);
125 void AddBounds(
const double bounds[]);
144 bool IntersectPlane(
double origin[3],
double normal[3]);
156 void GetBounds(
double bounds[6])
const;
157 void GetBounds(
double &xMin,
double &xMax,
158 double &yMin,
double &yMax,
159 double &zMin,
double &zMax)
const;
165 double GetBound(
int i)
const;
172 void GetMinPoint(
double &x,
double &y,
double &z)
const;
173 void GetMinPoint(
double x[3]);
181 void GetMaxPoint(
double &x,
double &y,
double &z)
const;
182 void GetMaxPoint(
double x[3]);
189 void GetCorner(
int corner,
double p[3])
const;
196 vtkTypeBool ContainsPoint(
double px,
double py,
double pz)
const;
202 void GetCenter(
double center[3])
const;
207 void GetLengths(
double lengths[3])
const;
212 double GetLength(
int i)
const;
217 double GetMaxLength()
const;
223 double GetDiagonalLength()
const;
234 void Inflate(
double delta);
235 void Inflate(
double deltaX,
double deltaY,
double deltaZ);
246 void Scale(
double s[3]);
247 void Scale(
double sx,
double sy,
double sz);
256 void ScaleAboutCenter(
double s);
257 void ScaleAboutCenter(
double s[3]);
258 void ScaleAboutCenter(
double sx,
double sy,
double sz);
279 double MinPnt[3], MaxPnt[3];
289 double &yMin,
double &yMax,
290 double &zMin,
double &zMax)
const
305 return ((i & 0x1) ? this->
MaxPnt[i>>1] : this->
MinPnt[i>>1]);
341 return (bounds[0] <= bounds[1] &&
342 bounds[2] <= bounds[3] &&
343 bounds[4] <= bounds[5]);
367 this->
SetBounds(bounds[0], bounds[1], bounds[2],
368 bounds[3], bounds[4], bounds[5]);
373 this->
GetBounds(bounds[0], bounds[1], bounds[2],
374 bounds[3], bounds[4], bounds[5]);
389 double yMin,
double yMax,
390 double zMin,
double zMax)
393 this->
SetBounds(xMin, xMax, yMin, yMax, zMin, zMax);
422 (this->MinPnt[1] == bbox.
MinPnt[1]) &&
423 (this->MinPnt[2] == bbox.
MinPnt[2]) &&
424 (this->MaxPnt[0] == bbox.
MaxPnt[0]) &&
425 (this->MaxPnt[1] == bbox.
MaxPnt[1]) &&
426 (this->MaxPnt[2] == bbox.
MaxPnt[2]));
431 return !((*this) == bbox);
483 if ((corner < 0) || (corner > 7))
491 int ix = (corner & 1) ? 1 : 0;
492 int iy = ((corner >> 1) & 1) ? 1 : 0;
493 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.
vtkTypeBool ContainsPoint(double p[3]) const
Returns 1 if the point is contained in the box else 0.
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.
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).