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]);
75 double yMin,
double yMax,
76 double zMin,
double zMax);
85 void SetMinPoint(
double p[3]);
94 void SetMaxPoint(
double p[3]);
146 void GetBounds(
double bounds[6])
const;
147 void GetBounds(
double &xMin,
double &xMax,
148 double &yMin,
double &yMax,
149 double &zMin,
double &zMax)
const;
155 double GetBound(
int i)
const;
161 const double *GetMinPoint()
const;
162 void GetMinPoint(
double &x,
double &y,
double &z)
const;
169 const double *GetMaxPoint()
const;
170 void GetMaxPoint(
double &x,
double &y,
double &z)
const;
177 int ContainsPoint(
double p[3])
const;
178 int ContainsPoint(
double px,
double py,
double pz)
const;
184 void GetCenter(
double center[3])
const;
189 void GetLengths(
double lengths[3])
const;
194 double GetLength(
int i)
const;
219 static int IsValid(
const double bounds[6]);
241 double MinPnt[3], MaxPnt[3];
251 double &yMin,
double &yMax,
252 double &zMin,
double &zMax)
const
267 return ((i & 0x1) ? this->
MaxPnt[i>>1] : this->
MinPnt[i>>1]);
289 return (bounds[0] <= bounds[1] &&
290 bounds[2] <= bounds[3] &&
291 bounds[4] <= bounds[5]);
315 this->
SetBounds(bounds[0], bounds[1], bounds[2],
316 bounds[3], bounds[4], bounds[5]);
321 this->
GetBounds(bounds[0], bounds[1], bounds[2],
322 bounds[3], bounds[4], bounds[5]);
337 double yMin,
double yMax,
338 double zMin,
double zMax)
341 this->
SetBounds(xMin, xMax, yMin, yMax, zMin, zMax);
370 (this->MinPnt[1] == bbox.
MinPnt[1]) &&
371 (this->MinPnt[2] == bbox.
MinPnt[2]) &&
372 (this->MaxPnt[0] == bbox.
MaxPnt[0]) &&
373 (this->MaxPnt[1] == bbox.
MaxPnt[1]) &&
374 (this->MaxPnt[2] == bbox.
MaxPnt[2]));
379 return !((*this) == bbox);
Fast Simple Class for dealing with 3D bounds.
void Scale(double s[3])
Scale each dimension of the box by some given factor.
int IntersectBox(const vtkBoundingBox &bbox)
const double * GetMinPoint() const
Get the minimum point of the bounding box.
double GetDiagonalLength() const
Return the length of the diagonal.
void SetBounds(double xMin, double xMax, double yMin, double yMax, double zMin, double zMax)
void AddBox(const vtkBoundingBox &bbox)
Change the bouding box to be the union of itself and bbox.
void AddBounds(const double bounds[])
Change the bounding box so it includes bounds (defined by vtk standard)
int Contains(const vtkBoundingBox &bbox) const
Returns 1 if the min and max points of bbox are contained within the bounds of this 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...
int Intersects(const vtkBoundingBox &bbox) const
Returns 1 if the boxes intersect else returns 0.
double GetMaxLength() const
Return the Max Length of the box.
bool operator!=(const vtkBoundingBox &bbox) const
void AddPoint(double px, double py, double pz)
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 ...
void Reset()
Returns the box to its initialized state.
bool IntersectPlane(double origin[3], double normal[3])
void GetCenter(double center[3]) const
Get the center of the bounding box.
void AddPoint(double p[3])
Change bounding box so it includes the point p Note that the bounding box may have 0 volume if its bo...
double GetLength(int i) const
Return the length in the ith direction.
bool operator==(const vtkBoundingBox &bbox) const
Equality Operator.
vtkBoundingBox()
Construct a bounding box with the min point set to VTK_DOUBLE_MAX and the max point set to VTK_DOUBLE...
void Scale(double sx, double sy, double sz)
int ContainsPoint(double p[3]) const
Returns 1 if the point is contained in the box else 0;.
void GetLengths(double lengths[3]) const
Get the lengths of the box.
void Inflate(double delta)
Expand the Box by delta on each side, the box will grow by 2*delta in x,y and z.
void SetBounds(const double bounds[6])
Set the bounds explicitly of the box (vtk Style) Returns 1 if the box was changed else 0.
const double * GetMaxPoint() const
Get the maximum point of the bounding box.
double GetBound(int i) const
Return the ith bounds of the box (defined by vtk style)
void GetBounds(double bounds[6]) const
Get the bounds of the box (defined by vtk style)
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...
vtkBoundingBox & operator=(const vtkBoundingBox &bbox)
Assignment Operator.
VTKCOMMONCORE_EXPORT bool operator!=(const vtkUnicodeString &lhs, const vtkUnicodeString &rhs)
VTKCOMMONCORE_EXPORT bool operator==(const vtkUnicodeString &lhs, const vtkUnicodeString &rhs)