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 void AddPoint(
double p[3]);
101 void AddPoint(
double px,
double py,
double pz);
112 void AddBounds(
const double bounds[]);
131 bool IntersectPlane(
double origin[3],
double normal[3]);
143 void GetBounds(
double bounds[6])
const;
144 void GetBounds(
double &xMin,
double &xMax,
145 double &yMin,
double &yMax,
146 double &zMin,
double &zMax)
const;
152 double GetBound(
int i)
const;
158 const double *GetMinPoint()
const;
159 void GetMinPoint(
double &x,
double &y,
double &z)
const;
166 const double *GetMaxPoint()
const;
167 void GetMaxPoint(
double &x,
double &y,
double &z)
const;
174 int ContainsPoint(
double p[3])
const;
175 int ContainsPoint(
double px,
double py,
double pz)
const;
181 void GetCenter(
double center[3])
const;
186 void GetLengths(
double lengths[3])
const;
191 double GetLength(
int i)
const;
196 double GetMaxLength()
const;
202 double GetDiagonalLength()
const;
208 void Inflate(
double delta);
216 static int IsValid(
const double bounds[6]);
231 void Scale(
double s[3]);
232 void Scale(
double sx,
238 double MinPnt[3], MaxPnt[3];
248 double &yMin,
double &yMax,
249 double &zMin,
double &zMax)
const 264 return ((i & 0x1) ? this->
MaxPnt[i>>1] : this->
MinPnt[i>>1]);
286 return (bounds[0] <= bounds[1] &&
287 bounds[2] <= bounds[3] &&
288 bounds[4] <= bounds[5]);
312 this->
SetBounds(bounds[0], bounds[1], bounds[2],
313 bounds[3], bounds[4], bounds[5]);
318 this->
GetBounds(bounds[0], bounds[1], bounds[2],
319 bounds[3], bounds[4], bounds[5]);
334 double yMin,
double yMax,
335 double zMin,
double zMax)
338 this->
SetBounds(xMin, xMax, yMin, yMax, zMin, zMax);
367 (this->MinPnt[1] == bbox.
MinPnt[1]) &&
368 (this->MinPnt[2] == bbox.
MinPnt[2]) &&
369 (this->MaxPnt[0] == bbox.
MaxPnt[0]) &&
370 (this->MaxPnt[1] == bbox.
MaxPnt[1]) &&
371 (this->MaxPnt[2] == bbox.
MaxPnt[2]));
376 return !((*this) == bbox);
double GetBound(int i) const
Return the ith bounds of the box (defined by vtk style)
void GetCenter(double center[3]) const
Get the center of the bounding box.
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 ...
const double * GetMaxPoint() const
Get the maximum point of the bounding box.
void Reset()
Returns the box to its initialized state.
int ContainsPoint(double p[3]) const
Returns 1 if the point is contained in the box else 0;.
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...
vtkBoundingBox & operator=(const vtkBoundingBox &bbox)
Assignment Operator.
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...
const double * GetMinPoint() const
Get the minimum point of the bounding box.
bool operator!=(const vtkBoundingBox &bbox) const
Equality Operator.
double GetLength(int i) const
Return the length in the ith direction.
void SetBounds(const double bounds[6])
Set the bounds explicitly of the box (vtk Style) Returns 1 if the box was changed else 0...
void GetBounds(double bounds[6]) const
Get the bounds of the box (defined by vtk style)
vtkBoundingBox()
Construct a bounding box with the min point set to VTK_DOUBLE_MAX and the max point set to VTK_DOUBLE...
bool operator==(const vtkBoundingBox &bbox) const
Equality Operator.
VTKCOMMONCORE_EXPORT bool operator!=(const vtkUnicodeString &lhs, const vtkUnicodeString &rhs)
VTKCOMMONCORE_EXPORT bool operator==(const vtkUnicodeString &lhs, const vtkUnicodeString &rhs)
void GetLengths(double lengths[3]) const
Get the lengths of the box.
Fast Simple Class for dealing with 3D bounds.