29 #ifndef __vtkBoundingBox_h
30 #define __vtkBoundingBox_h
42 double yMin,
double yMax,
43 double zMin,
double zMax);
61 void SetBounds(
double bounds[6]);
62 void SetBounds(
double xMin,
double xMax,
63 double yMin,
double yMax,
64 double zMin,
double zMax);
70 void SetMinPoint(
double x,
double y,
double z);
71 void SetMinPoint(
double p[3]);
77 void SetMaxPoint(
double x,
double y,
double z);
78 void SetMaxPoint(
double p[3]);
84 void AddPoint(
double p[3]);
85 void AddPoint(
double px,
double py,
double pz);
93 void AddBounds(
double bounds[6]);
109 bool IntersectPlane(
double origin[3],
double normal[3]);
118 void GetBounds(
double bounds[6])
const;
119 void GetBounds(
double &xMin,
double &xMax,
120 double &yMin,
double &yMax,
121 double &zMin,
double &zMax)
const;
125 double GetBound(
int i)
const;
129 const double *GetMinPoint()
const;
130 void GetMinPoint(
double &x,
double &y,
double &z)
const;
135 const double *GetMaxPoint()
const;
136 void GetMaxPoint(
double &x,
double &y,
double &z)
const;
141 int ContainsPoint(
double p[3])
const;
142 int ContainsPoint(
double px,
double py,
double pz)
const;
146 void GetCenter(
double center[3])
const;
149 void GetLengths(
double lengths[3])
const;
152 double GetLength(
int i)
const;
155 double GetMaxLength()
const;
158 double GetDiagonalLength()
const;
162 void Inflate(
double delta);
168 static int IsValid(
double bounds[6]);
179 void Scale(
double s[3]);
180 void Scale(
double sx,
186 double MinPnt[3], MaxPnt[3];
196 double &yMin,
double &yMax,
197 double &zMin,
double &zMax)
const
212 return ((i & 0x1) ? this->
MaxPnt[i>>1] : this->
MinPnt[i>>1]);
234 return (bounds[0] <= bounds[1] &&
235 bounds[2] <= bounds[3] &&
236 bounds[4] <= bounds[5]);
260 this->
SetBounds(bounds[0], bounds[1], bounds[2],
261 bounds[3], bounds[4], bounds[5]);
266 this->
GetBounds(bounds[0], bounds[1], bounds[2],
267 bounds[3], bounds[4], bounds[5]);
282 double yMin,
double yMax,
283 double zMin,
double zMax)
286 this->
SetBounds(xMin, xMax, yMin, yMax, zMin, zMax);
315 (this->MinPnt[1] == bbox.
MinPnt[1]) &&
316 (this->MinPnt[2] == bbox.
MinPnt[2]) &&
317 (this->MaxPnt[0] == bbox.
MaxPnt[0]) &&
318 (this->MaxPnt[1] == bbox.
MaxPnt[1]) &&
319 (this->MaxPnt[2] == bbox.
MaxPnt[2]));
324 return !((*this) == bbox);
358 if ((py < this->MinPnt[1]) || (py > this->
MaxPnt[1]))
362 if ((pz < this->MinPnt[2]) || (pz > this->
MaxPnt[2]))