VTK
|
Fast Simple Class for dealing with 3D bounds. More...
#include <vtkBoundingBox.h>
Public Member Functions | |
vtkBoundingBox () | |
Construct a bounding box with the min point set to VTK_DOUBLE_MAX and the max point set to VTK_DOUBLE_MIN. More... | |
vtkBoundingBox (const double bounds[6]) | |
vtkBoundingBox (double xMin, double xMax, double yMin, double yMax, double zMin, double zMax) | |
vtkBoundingBox (const vtkBoundingBox &bbox) | |
Copy Constructor. More... | |
vtkBoundingBox & | operator= (const vtkBoundingBox &bbox) |
Assignment Operator. More... | |
bool | operator== (const vtkBoundingBox &bbox) const |
Equality Operator. More... | |
bool | operator!= (const vtkBoundingBox &bbox) const |
void | SetBounds (const double bounds[6]) |
Set the bounds explicitly of the box (vtk Style) Returns 1 if the box was changed else 0. More... | |
void | SetBounds (double xMin, double xMax, double yMin, double yMax, double zMin, double zMax) |
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 max point will also be changed. More... | |
void | SetMinPoint (double p[3]) |
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 point will also be changed. More... | |
void | SetMaxPoint (double p[3]) |
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 bounds were just initialized. More... | |
void | AddPoint (double px, double py, double pz) |
void | AddBox (const vtkBoundingBox &bbox) |
Change the bouding box to be the union of itself and bbox. More... | |
void | AddBounds (const double bounds[]) |
Change the bounding box so it includes bounds (defined by vtk standard) More... | |
int | IntersectBox (const vtkBoundingBox &bbox) |
int | Intersects (const vtkBoundingBox &bbox) const |
Returns 1 if the boxes intersect else returns 0. More... | |
bool | IntersectPlane (double origin[3], double normal[3]) |
int | Contains (const vtkBoundingBox &bbox) const |
Returns 1 if the min and max points of bbox are contained within the bounds of this box, else returns 0. More... | |
void | GetBounds (double bounds[6]) const |
Get the bounds of the box (defined by vtk style) More... | |
void | GetBounds (double &xMin, double &xMax, double &yMin, double &yMax, double &zMin, double &zMax) const |
double | GetBound (int i) const |
Return the ith bounds of the box (defined by vtk style) More... | |
const double * | GetMinPoint () const |
Get the minimum point of the bounding box. More... | |
void | GetMinPoint (double &x, double &y, double &z) const |
const double * | GetMaxPoint () const |
Get the maximum point of the bounding box. More... | |
void | GetMaxPoint (double &x, double &y, double &z) const |
int | ContainsPoint (double p[3]) const |
Returns 1 if the point is contained in the box else 0;. More... | |
int | ContainsPoint (double px, double py, double pz) const |
void | GetCenter (double center[3]) const |
Get the center of the bounding box. More... | |
void | GetLengths (double lengths[3]) const |
Get the lengths of the box. More... | |
double | GetLength (int i) const |
Return the length in the ith direction. More... | |
double | GetMaxLength () const |
Return the Max Length of the box. More... | |
double | GetDiagonalLength () const |
Return the length of the diagonal. More... | |
void | Inflate (double delta) |
Expand the Box by delta on each side, the box will grow by 2*delta in x,y and z. More... | |
int | IsValid () const |
Returns 1 if the bounds have been set and 0 if the box is in its initialized state which is an inverted state. More... | |
void | Reset () |
Returns the box to its initialized state. More... | |
void | Scale (double s[3]) |
Scale each dimension of the box by some given factor. More... | |
void | Scale (double sx, double sy, double sz) |
Static Public Member Functions | |
static int | IsValid (const double bounds[6]) |
Protected Attributes | |
double | MinPnt [3] |
double | MaxPnt [3] |
Fast Simple Class for dealing with 3D bounds.
vtkBoundingBox maintains a 3D axis aligned bounding box. It is very lite weight and many of the member functions are in-lined so its very fast It is not derived from vtkObject so it can be allocated on the stack
Definition at line 35 of file vtkBoundingBox.h.
|
inline |
Construct a bounding box with the min point set to VTK_DOUBLE_MAX and the max point set to VTK_DOUBLE_MIN.
Definition at line 325 of file vtkBoundingBox.h.
|
inline |
Definition at line 330 of file vtkBoundingBox.h.
|
inline |
Definition at line 336 of file vtkBoundingBox.h.
|
inline |
Copy Constructor.
Definition at line 344 of file vtkBoundingBox.h.
|
inline |
Assignment Operator.
Definition at line 355 of file vtkBoundingBox.h.
|
inline |
Equality Operator.
Definition at line 367 of file vtkBoundingBox.h.
|
inline |
Definition at line 377 of file vtkBoundingBox.h.
|
inline |
Set the bounds explicitly of the box (vtk Style) Returns 1 if the box was changed else 0.
Definition at line 313 of file vtkBoundingBox.h.
void vtkBoundingBox::SetBounds | ( | double | xMin, |
double | xMax, | ||
double | yMin, | ||
double | yMax, | ||
double | zMin, | ||
double | zMax | ||
) |
Set the minimum point of the bounding box - if the min point is greater than the max point then the max point will also be changed.
|
inline |
Definition at line 382 of file vtkBoundingBox.h.
Set the maximum point of the bounding box - if the max point is less than the min point then the min point will also be changed.
|
inline |
Definition at line 387 of file vtkBoundingBox.h.
void vtkBoundingBox::AddPoint | ( | double | p[3] | ) |
Change bounding box so it includes the point p Note that the bounding box may have 0 volume if its bounds were just initialized.
void vtkBoundingBox::AddBox | ( | const vtkBoundingBox & | bbox | ) |
Change the bouding box to be the union of itself and bbox.
void vtkBoundingBox::AddBounds | ( | const double | bounds[] | ) |
Change the bounding box so it includes bounds (defined by vtk standard)
int vtkBoundingBox::IntersectBox | ( | const vtkBoundingBox & | bbox | ) |
int vtkBoundingBox::Intersects | ( | const vtkBoundingBox & | bbox | ) | const |
Returns 1 if the boxes intersect else returns 0.
int vtkBoundingBox::Contains | ( | const vtkBoundingBox & | bbox | ) | const |
Returns 1 if the min and max points of bbox are contained within the bounds of this box, else returns 0.
|
inline |
Get the bounds of the box (defined by vtk style)
Definition at line 319 of file vtkBoundingBox.h.
|
inline |
Definition at line 250 of file vtkBoundingBox.h.
Return the ith bounds of the box (defined by vtk style)
Definition at line 262 of file vtkBoundingBox.h.
|
inline |
Get the minimum point of the bounding box.
Definition at line 270 of file vtkBoundingBox.h.
Definition at line 392 of file vtkBoundingBox.h.
|
inline |
Get the maximum point of the bounding box.
Definition at line 275 of file vtkBoundingBox.h.
Definition at line 399 of file vtkBoundingBox.h.
Returns 1 if the point is contained in the box else 0;.
Definition at line 424 of file vtkBoundingBox.h.
Definition at line 406 of file vtkBoundingBox.h.
|
inline |
Get the center of the bounding box.
Definition at line 306 of file vtkBoundingBox.h.
|
inline |
Get the lengths of the box.
Definition at line 299 of file vtkBoundingBox.h.
Return the length in the ith direction.
Definition at line 294 of file vtkBoundingBox.h.
double vtkBoundingBox::GetMaxLength | ( | ) | const |
Return the Max Length of the box.
double vtkBoundingBox::GetDiagonalLength | ( | ) | const |
Return the length of the diagonal.
void vtkBoundingBox::Inflate | ( | double | delta | ) |
Expand the Box by delta on each side, the box will grow by 2*delta in x,y and z.
|
inline |
Returns 1 if the bounds have been set and 0 if the box is in its initialized state which is an inverted state.
Definition at line 280 of file vtkBoundingBox.h.
Definition at line 287 of file vtkBoundingBox.h.
|
inline |
Returns the box to its initialized state.
Definition at line 244 of file vtkBoundingBox.h.
void vtkBoundingBox::Scale | ( | double | s[3] | ) |
Scale each dimension of the box by some given factor.
If the box is not valid, it stays unchanged. If the scalar factor is negative, bounds are flipped: for example, if (xMin,xMax)=(-2,4) and sx=-3, (xMin,xMax) becomes (-12,6).
|
protected |
Definition at line 241 of file vtkBoundingBox.h.
|
protected |
Definition at line 241 of file vtkBoundingBox.h.