29 #ifndef vtkBoundingBox_h
30 #define vtkBoundingBox_h
43 double yMin,
double yMax,
44 double zMin,
double zMax);
62 void SetBounds(
const double bounds[6]);
63 void SetBounds(
double xMin,
double xMax,
64 double yMin,
double yMax,
65 double zMin,
double zMax);
71 void SetMinPoint(
double x,
double y,
double z);
72 void SetMinPoint(
double p[3]);
78 void SetMaxPoint(
double x,
double y,
double z);
79 void SetMaxPoint(
double p[3]);
85 void AddPoint(
double p[3]);
86 void AddPoint(
double px,
double py,
double pz);
94 void AddBounds(
const double bounds[]);
110 bool IntersectPlane(
double origin[3],
double normal[3]);
119 void GetBounds(
double bounds[6])
const;
120 void GetBounds(
double &xMin,
double &xMax,
121 double &yMin,
double &yMax,
122 double &zMin,
double &zMax)
const;
126 double GetBound(
int i)
const;
130 const double *GetMinPoint()
const;
131 void GetMinPoint(
double &x,
double &y,
double &z)
const;
136 const double *GetMaxPoint()
const;
137 void GetMaxPoint(
double &x,
double &y,
double &z)
const;
142 int ContainsPoint(
double p[3])
const;
143 int ContainsPoint(
double px,
double py,
double pz)
const;
147 void GetCenter(
double center[3])
const;
150 void GetLengths(
double lengths[3])
const;
153 double GetLength(
int i)
const;
156 double GetMaxLength()
const;
159 double GetDiagonalLength()
const;
163 void Inflate(
double delta);
169 static int IsValid(
const double bounds[6]);
180 void Scale(
double s[3]);
181 void Scale(
double sx,
187 double MinPnt[3], MaxPnt[3];
197 double &yMin,
double &yMax,
198 double &zMin,
double &zMax)
const
213 return ((i & 0x1) ? this->
MaxPnt[i>>1] : this->
MinPnt[i>>1]);
235 return (bounds[0] <= bounds[1] &&
236 bounds[2] <= bounds[3] &&
237 bounds[4] <= bounds[5]);
261 this->
SetBounds(bounds[0], bounds[1], bounds[2],
262 bounds[3], bounds[4], bounds[5]);
267 this->
GetBounds(bounds[0], bounds[1], bounds[2],
268 bounds[3], bounds[4], bounds[5]);
283 double yMin,
double yMax,
284 double zMin,
double zMax)
287 this->
SetBounds(xMin, xMax, yMin, yMax, zMin, zMax);
316 (this->MinPnt[1] == bbox.
MinPnt[1]) &&
317 (this->MinPnt[2] == bbox.
MinPnt[2]) &&
318 (this->MaxPnt[0] == bbox.
MaxPnt[0]) &&
319 (this->MaxPnt[1] == bbox.
MaxPnt[1]) &&
320 (this->MaxPnt[2] == bbox.
MaxPnt[2]));
325 return !((*this) == bbox);
359 if ((py < this->MinPnt[1]) || (py > this->
MaxPnt[1]))
363 if ((pz < this->MinPnt[2]) || (pz > this->
MaxPnt[2]))
void GetBounds(double bounds[6]) const
const double * GetMinPoint() const
void SetMaxPoint(double x, double y, double z)
int operator!=(const vtkBoundingBox &bbox) const
int ContainsPoint(double p[3]) const
int operator==(const vtkBoundingBox &bbox) const
void GetCenter(double center[3]) const
double GetBound(int i) const
void GetLengths(double lengths[3]) const
vtkBoundingBox & operator=(const vtkBoundingBox &bbox)
void SetMinPoint(double x, double y, double z)
double GetLength(int i) const
void SetBounds(const double bounds[6])
VTKCOMMONCORE_EXPORT bool operator!=(const vtkUnicodeString &lhs, const vtkUnicodeString &rhs)
VTKCOMMONCORE_EXPORT bool operator==(const vtkUnicodeString &lhs, const vtkUnicodeString &rhs)
const double * GetMaxPoint() const
#define VTKCOMMONDATAMODEL_EXPORT
Fast Simple Class for dealing with 3D bounds.