27 #ifndef vtkBoundingBox_h 28 #define vtkBoundingBox_h 29 #include "vtkCommonDataModelModule.h" 44 vtkBoundingBox(
double xMin,
double xMax,
double yMin,
double yMax,
double zMin,
double zMax);
70 void SetBounds(
const double bounds[6]);
71 void SetBounds(
double xMin,
double xMax,
double yMin,
double yMax,
double zMin,
double zMax);
80 static void ComputeBounds(
vtkPoints* pts,
double bounds[6]);
81 static void ComputeBounds(
vtkPoints* pts,
const unsigned char* ptUses,
double bounds[6]);
89 void SetMinPoint(
double x,
double y,
double z);
90 void SetMinPoint(
double p[3]);
98 void SetMaxPoint(
double x,
double y,
double z);
99 void SetMaxPoint(
double p[3]);
108 static int IsValid(
const double bounds[6]);
116 void AddPoint(
double p[3]);
117 void AddPoint(
double px,
double py,
double pz);
130 void AddBounds(
const double bounds[]);
149 bool IntersectPlane(
double origin[3],
double normal[3]);
161 void GetBounds(
double bounds[6])
const;
163 double& xMin,
double& xMax,
double& yMin,
double& yMax,
double& zMin,
double& zMax)
const;
169 double GetBound(
int i)
const;
176 void GetMinPoint(
double& x,
double& y,
double& z)
const;
177 void GetMinPoint(
double x[3])
const;
185 void GetMaxPoint(
double& x,
double& y,
double& z)
const;
186 void GetMaxPoint(
double x[3])
const;
193 void GetCorner(
int corner,
double p[3])
const;
200 vtkTypeBool ContainsPoint(
double px,
double py,
double pz)
const;
206 void GetCenter(
double center[3])
const;
211 void GetLengths(
double lengths[3])
const;
216 double GetLength(
int i)
const;
221 double GetMaxLength()
const;
227 double GetDiagonalLength()
const;
238 void Inflate(
double delta);
239 void Inflate(
double deltaX,
double deltaY,
double deltaZ);
250 void Scale(
double s[3]);
251 void Scale(
double sx,
double sy,
double sz);
260 void ScaleAboutCenter(
double s);
261 void ScaleAboutCenter(
double s[3]);
262 void ScaleAboutCenter(
double sx,
double sy,
double sz);
283 double MinPnt[3], MaxPnt[3];
293 double& xMin,
double& xMax,
double& yMin,
double& yMax,
double& zMin,
double& zMax)
const 308 return ((i & 0x1) ? this->
MaxPnt[i >> 1] : this->
MinPnt[i >> 1]);
343 return (bounds[0] <= bounds[1] && bounds[2] <= bounds[3] && bounds[4] <= bounds[5]);
367 this->
SetBounds(bounds[0], bounds[1], bounds[2], bounds[3], bounds[4], bounds[5]);
372 this->
GetBounds(bounds[0], bounds[1], bounds[2], bounds[3], bounds[4], bounds[5]);
387 double xMin,
double xMax,
double yMin,
double yMax,
double zMin,
double zMax)
390 this->
SetBounds(xMin, xMax, yMin, yMax, zMin, zMax);
419 (this->MinPnt[2] == bbox.
MinPnt[2]) && (this->MaxPnt[0] == bbox.
MaxPnt[0]) &&
420 (this->MaxPnt[1] == bbox.
MaxPnt[1]) && (this->MaxPnt[2] == bbox.
MaxPnt[2]));
425 return !((*this) == bbox);
476 if ((corner < 0) || (corner > 7))
484 int ix = (corner & 1) ? 1 : 0;
485 int iy = ((corner >> 1) & 1) ? 1 : 0;
486 int iz = (corner >> 2) ? 1 : 0;
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.
vtkTypeBool 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 GetCorner(int corner, double p[3]) const
Get the ith corner of the bounding box.
#define VTK_SIZEHINT(...)
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 of the bounding box in the ith direction.
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).
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 length of each sode of the box.
represent and manipulate 3D points
Fast, simple class for dealing with 3D bounds.