VTK  9.3.20240318
Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
vtkBoundingBox Class Reference

Fast, simple class for representing and operating on 3D bounds. More...

#include <vtkBoundingBox.h>

Public Member Functions

 vtkBoundingBox (const vtkBoundingBox &bbox)
 Copy constructor. More...
 
vtkBoundingBoxoperator= (const vtkBoundingBox &bbox)
 Assignment Operator. More...
 
void AddBox (const vtkBoundingBox &bbox)
 Change the bounding box to be the union of itself and the specified bbox. More...
 
void AddBounds (const double bounds[6])
 Adjust the bounding box so it contains the specified bounds (defined by the VTK representation (xmin,xmax, ymin,ymax, zmin,zmax). More...
 
bool IsSubsetOf (const vtkBoundingBox &bbox) const
 Returns true if this instance is entirely contained by bbox. More...
 
int IntersectBox (const vtkBoundingBox &bbox)
 Intersect this box with bbox. More...
 
int Intersects (const vtkBoundingBox &bbox) const
 Returns 1 if the boxes intersect else returns 0. More...
 
bool IntersectPlane (double origin[3], double normal[3])
 Intersect this box with the half space defined by plane. More...
 
bool IntersectsSphere (double center[3], double squaredRadius) const
 Intersect this box with a sphere. More...
 
bool IntersectsLine (const double p1[3], const double p2[3]) const
 Returns true if any part of segment [p1,p2] lies inside the bounding box, as well as on its boundaries. More...
 
int ComputeInnerDimension () const
 Returns the inner dimension of the bounding box. More...
 
int Contains (const vtkBoundingBox &bbox) const
 Returns 1 if the min and max points of bbox are contained within the bounds of the specified box, else returns 0. More...
 
double GetBound (int i) const
 Return the ith bounds of the box (defined by VTK style). More...
 
void GetCorner (int corner, double p[3]) const
 Get the ith corner of the bounding box. More...
 
void GetCenter (double center[3]) const
 Get the center of the bounding box. More...
 
void GetLengths (double lengths[3]) const
 Get the length of each side of the box. More...
 
double GetLength (int i) const
 Return the length of the bounding box in the ith direction. More...
 
double GetMaxLength () const
 Return the maximum length of the box. More...
 
vtkIdType ComputeDivisions (vtkIdType totalBins, double bounds[6], int divs[3]) const
 Compute the number of divisions in the x-y-z directions given a psoitive, target number of total bins (i.e., product of divisions in the x-y-z directions). More...
 
void Reset ()
 Returns the box to its initialized state. More...
 
 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])
 Construct a bounding box with the min point set to VTK_DOUBLE_MAX and the max point set to VTK_DOUBLE_MIN. More...
 
 vtkBoundingBox (double xMin, double xMax, double yMin, double yMax, double zMin, double zMax)
 Construct a bounding box with the min point set to VTK_DOUBLE_MAX and the max point set to VTK_DOUBLE_MIN. More...
 
bool operator== (const vtkBoundingBox &bbox) const
 Equality operator. More...
 
bool operator!= (const vtkBoundingBox &bbox) const
 Equality operator. More...
 
void SetBounds (const double bounds[6])
 Set the bounds explicitly of the box (using the VTK convention for representing a bounding box). More...
 
void SetBounds (double xMin, double xMax, double yMin, double yMax, double zMin, double zMax)
 Set the bounds explicitly of the box (using the VTK convention for representing a bounding box). More...
 
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])
 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 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])
 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 AddPoint (double p[3])
 Change bounding box so it includes the point p. More...
 
void AddPoint (double px, double py, double pz)
 Change bounding box so it includes the point p. 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
 Get the 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
 Get the minimum point of the bounding box. More...
 
void GetMinPoint (double x[3]) const
 Get the minimum point of the bounding box. More...
 
const double * GetMaxPoint () const
 Get the maximum point of the bounding box. More...
 
void GetMaxPoint (double &x, double &y, double &z) const
 Get the maximum point of the bounding box. More...
 
void GetMaxPoint (double x[3]) const
 Get the maximum point of the bounding box. More...
 
vtkTypeBool ContainsPoint (const double p[3]) const
 Returns 1 if the point is contained in the box else 0. More...
 
vtkTypeBool ContainsPoint (double px, double py, double pz) const
 Returns 1 if the point is contained in the box else 0. More...
 
template<class PointT >
bool ContainsPoint (const PointT &p) const
 Returns 1 if the point is contained in the box else 0. More...
 
double GetDiagonalLength2 () const
 Return the length of the diagonal. More...
 
double GetDiagonalLength () const
 Return the length of the diagonal. More...
 
void Inflate (double delta)
 Expand the bounding box. More...
 
void Inflate (double deltaX, double deltaY, double deltaZ)
 Expand the bounding box. More...
 
void Inflate ()
 Expand the bounding box. More...
 
void InflateSlice (double delta)
 Expand the bounding box. 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)
 Scale each dimension of the box by some given factor. More...
 
void ScaleAboutCenter (double s)
 Scale each dimension of the box by some given factor, with the origin of the bounding box the center of the scaling. More...
 
void ScaleAboutCenter (double s[3])
 Scale each dimension of the box by some given factor, with the origin of the bounding box the center of the scaling. More...
 
void ScaleAboutCenter (double sx, double sy, double sz)
 Scale each dimension of the box by some given factor, with the origin of the bounding box the center of the scaling. More...
 

Static Public Member Functions

static bool ContainsLine (const double x[3], const double s[3], const double lineEnd[3], double &t, double xInt[3], int &plane)
 A specialized, performant method to compute the containment of a finite line emanating from the center of a bounding box. More...
 
static void ClampDivisions (vtkIdType targetBins, int divs[3])
 Clamp the number of divisions to be less than or equal to a target number of bins, and the divs[i] >= 1. More...
 
static void ComputeLocalBounds (vtkPoints *points, double u[3], double v[3], double w[3], double outputBounds[6])
 Compute local bounds. More...
 

Protected Attributes

double MinPnt [3]
 
double MaxPnt [3]
 
void ComputeBounds (vtkPoints *pts)
 Compute the bounding box from an array of vtkPoints. More...
 
void ComputeBounds (vtkPoints *pts, unsigned char *ptUses)
 Compute the bounding box from an array of vtkPoints. More...
 
static void ComputeBounds (vtkPoints *pts, double bounds[6])
 Compute the bounding box from an array of vtkPoints. More...
 
static void ComputeBounds (vtkPoints *pts, const unsigned char *ptUses, double bounds[6])
 Compute the bounding box from an array of vtkPoints. More...
 
static void ComputeBounds (vtkPoints *pts, const std::atomic< unsigned char > *ptUses, double bounds[6])
 Compute the bounding box from an array of vtkPoints. More...
 
static void ComputeBounds (vtkPoints *pts, const long long *ptIds, long long numPointIds, double bounds[6])
 Compute the bounding box from an array of vtkPoints. More...
 
static void ComputeBounds (vtkPoints *pts, const long *ptIds, long numPointIds, double bounds[6])
 Compute the bounding box from an array of vtkPoints. More...
 
static void ComputeBounds (vtkPoints *pts, const int *ptIds, int numPointIds, double bounds[6])
 Compute the bounding box from an array of vtkPoints. 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...
 
static int IsValid (const double bounds[6])
 Returns 1 if the bounds have been set and 0 if the box is in its initialized state which is an inverted state. More...
 

Detailed Description

Fast, simple class for representing and operating on 3D bounds.

vtkBoundingBox maintains and performs operations on a 3D axis aligned bounding box. It is very light weight and many of the member functions are in-lined so it is very fast. It is not derived from vtkObject so it can be allocated on the stack.

See also
vtkBox
Online Examples:

Tests:
vtkBoundingBox (Tests)

Definition at line 57 of file vtkBoundingBox.h.

Constructor & Destructor Documentation

◆ vtkBoundingBox() [1/4]

vtkBoundingBox::vtkBoundingBox ( )
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 502 of file vtkBoundingBox.h.

◆ vtkBoundingBox() [2/4]

vtkBoundingBox::vtkBoundingBox ( const double  bounds[6])
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 507 of file vtkBoundingBox.h.

◆ vtkBoundingBox() [3/4]

vtkBoundingBox::vtkBoundingBox ( double  xMin,
double  xMax,
double  yMin,
double  yMax,
double  zMin,
double  zMax 
)
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 513 of file vtkBoundingBox.h.

◆ vtkBoundingBox() [4/4]

vtkBoundingBox::vtkBoundingBox ( const vtkBoundingBox bbox)
inline

Copy constructor.

Definition at line 520 of file vtkBoundingBox.h.

Member Function Documentation

◆ operator=()

vtkBoundingBox & vtkBoundingBox::operator= ( const vtkBoundingBox bbox)
inline

Assignment Operator.

Definition at line 531 of file vtkBoundingBox.h.

◆ operator==()

bool vtkBoundingBox::operator== ( const vtkBoundingBox bbox) const
inline

Equality operator.

Definition at line 543 of file vtkBoundingBox.h.

◆ operator!=()

bool vtkBoundingBox::operator!= ( const vtkBoundingBox bbox) const
inline

Equality operator.

Definition at line 550 of file vtkBoundingBox.h.

◆ SetBounds() [1/2]

void vtkBoundingBox::SetBounds ( const double  bounds[6])
inline

Set the bounds explicitly of the box (using the VTK convention for representing a bounding box).

Returns 1 if the box was changed else 0.

Definition at line 492 of file vtkBoundingBox.h.

◆ SetBounds() [2/2]

void vtkBoundingBox::SetBounds ( double  xMin,
double  xMax,
double  yMin,
double  yMax,
double  zMin,
double  zMax 
)

Set the bounds explicitly of the box (using the VTK convention for representing a bounding box).

Returns 1 if the box was changed else 0.

◆ ComputeBounds() [1/8]

static void vtkBoundingBox::ComputeBounds ( vtkPoints pts,
double  bounds[6] 
)
static

Compute the bounding box from an array of vtkPoints.

It uses a fast (i.e., threaded) path when possible. The second signature (with point uses) only considers points with ptUses[i] != 0 in the bounds calculation. The third signature uses point ids. The non-static ComputeBounds() methods update the current bounds of an instance of this class.

◆ ComputeBounds() [2/8]

static void vtkBoundingBox::ComputeBounds ( vtkPoints pts,
const unsigned char *  ptUses,
double  bounds[6] 
)
static

Compute the bounding box from an array of vtkPoints.

It uses a fast (i.e., threaded) path when possible. The second signature (with point uses) only considers points with ptUses[i] != 0 in the bounds calculation. The third signature uses point ids. The non-static ComputeBounds() methods update the current bounds of an instance of this class.

◆ ComputeBounds() [3/8]

static void vtkBoundingBox::ComputeBounds ( vtkPoints pts,
const std::atomic< unsigned char > *  ptUses,
double  bounds[6] 
)
static

Compute the bounding box from an array of vtkPoints.

It uses a fast (i.e., threaded) path when possible. The second signature (with point uses) only considers points with ptUses[i] != 0 in the bounds calculation. The third signature uses point ids. The non-static ComputeBounds() methods update the current bounds of an instance of this class.

◆ ComputeBounds() [4/8]

static void vtkBoundingBox::ComputeBounds ( vtkPoints pts,
const long long *  ptIds,
long long  numPointIds,
double  bounds[6] 
)
static

Compute the bounding box from an array of vtkPoints.

It uses a fast (i.e., threaded) path when possible. The second signature (with point uses) only considers points with ptUses[i] != 0 in the bounds calculation. The third signature uses point ids. The non-static ComputeBounds() methods update the current bounds of an instance of this class.

◆ ComputeBounds() [5/8]

static void vtkBoundingBox::ComputeBounds ( vtkPoints pts,
const long *  ptIds,
long  numPointIds,
double  bounds[6] 
)
static

Compute the bounding box from an array of vtkPoints.

It uses a fast (i.e., threaded) path when possible. The second signature (with point uses) only considers points with ptUses[i] != 0 in the bounds calculation. The third signature uses point ids. The non-static ComputeBounds() methods update the current bounds of an instance of this class.

◆ ComputeBounds() [6/8]

static void vtkBoundingBox::ComputeBounds ( vtkPoints pts,
const int *  ptIds,
int  numPointIds,
double  bounds[6] 
)
static

Compute the bounding box from an array of vtkPoints.

It uses a fast (i.e., threaded) path when possible. The second signature (with point uses) only considers points with ptUses[i] != 0 in the bounds calculation. The third signature uses point ids. The non-static ComputeBounds() methods update the current bounds of an instance of this class.

◆ ComputeBounds() [7/8]

void vtkBoundingBox::ComputeBounds ( vtkPoints pts)
inline

Compute the bounding box from an array of vtkPoints.

It uses a fast (i.e., threaded) path when possible. The second signature (with point uses) only considers points with ptUses[i] != 0 in the bounds calculation. The third signature uses point ids. The non-static ComputeBounds() methods update the current bounds of an instance of this class.

Definition at line 113 of file vtkBoundingBox.h.

◆ ComputeBounds() [8/8]

void vtkBoundingBox::ComputeBounds ( vtkPoints pts,
unsigned char *  ptUses 
)
inline

Compute the bounding box from an array of vtkPoints.

It uses a fast (i.e., threaded) path when possible. The second signature (with point uses) only considers points with ptUses[i] != 0 in the bounds calculation. The third signature uses point ids. The non-static ComputeBounds() methods update the current bounds of an instance of this class.

Definition at line 124 of file vtkBoundingBox.h.

◆ ComputeLocalBounds()

static void vtkBoundingBox::ComputeLocalBounds ( vtkPoints points,
double  u[3],
double  v[3],
double  w[3],
double  outputBounds[6] 
)
static

Compute local bounds.

Not as fast as vtkPoints.getBounds() if u, v, w form a natural basis.

◆ SetMinPoint() [1/2]

void vtkBoundingBox::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.

◆ SetMinPoint() [2/2]

void vtkBoundingBox::SetMinPoint ( double  p[3])
inline

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.

Definition at line 555 of file vtkBoundingBox.h.

◆ SetMaxPoint() [1/2]

void vtkBoundingBox::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.

◆ SetMaxPoint() [2/2]

void vtkBoundingBox::SetMaxPoint ( double  p[3])
inline

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.

Definition at line 560 of file vtkBoundingBox.h.

◆ IsValid() [1/2]

int vtkBoundingBox::IsValid ( ) const
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 453 of file vtkBoundingBox.h.

◆ IsValid() [2/2]

int vtkBoundingBox::IsValid ( const double  bounds[6])
inlinestatic

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 459 of file vtkBoundingBox.h.

◆ AddPoint() [1/2]

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.

◆ AddPoint() [2/2]

void vtkBoundingBox::AddPoint ( double  px,
double  py,
double  pz 
)

Change bounding box so it includes the point p.

Note that the bounding box may have 0 volume if its bounds were just initialized.

◆ AddBox()

void vtkBoundingBox::AddBox ( const vtkBoundingBox bbox)

Change the bounding box to be the union of itself and the specified bbox.

◆ AddBounds()

void vtkBoundingBox::AddBounds ( const double  bounds[6])

Adjust the bounding box so it contains the specified bounds (defined by the VTK representation (xmin,xmax, ymin,ymax, zmin,zmax).

◆ IsSubsetOf()

bool vtkBoundingBox::IsSubsetOf ( const vtkBoundingBox bbox) const
inline

Returns true if this instance is entirely contained by bbox.

Definition at line 483 of file vtkBoundingBox.h.

◆ IntersectBox()

int vtkBoundingBox::IntersectBox ( const vtkBoundingBox bbox)

Intersect this box with bbox.

The method returns 1 if both boxes are valid and they do have overlap else it will return 0. If 0 is returned the box has not been modified.

◆ Intersects()

int vtkBoundingBox::Intersects ( const vtkBoundingBox bbox) const

Returns 1 if the boxes intersect else returns 0.

◆ IntersectPlane()

bool vtkBoundingBox::IntersectPlane ( double  origin[3],
double  normal[3] 
)

Intersect this box with the half space defined by plane.

Returns true if there is intersection—which implies that the box has been modified Returns false otherwise.

◆ IntersectsSphere()

bool vtkBoundingBox::IntersectsSphere ( double  center[3],
double  squaredRadius 
) const

Intersect this box with a sphere.

Parameters involve the center of the sphere and the squared radius.

◆ IntersectsLine()

bool vtkBoundingBox::IntersectsLine ( const double  p1[3],
const double  p2[3] 
) const

Returns true if any part of segment [p1,p2] lies inside the bounding box, as well as on its boundaries.

It returns false otherwise.

◆ ComputeInnerDimension()

int vtkBoundingBox::ComputeInnerDimension ( ) const

Returns the inner dimension of the bounding box.

◆ Contains()

int vtkBoundingBox::Contains ( const vtkBoundingBox bbox) const

Returns 1 if the min and max points of bbox are contained within the bounds of the specified box, else returns 0.

◆ ContainsLine()

static bool vtkBoundingBox::ContainsLine ( const double  x[3],
const double  s[3],
const double  lineEnd[3],
double &  t,
double  xInt[3],
int &  plane 
)
static

A specialized, performant method to compute the containment of a finite line emanating from the center of a bounding box.

The method returns true if the box contains the line defined by (x,lineEnd); and false if the line intersects the box (i.e., the line passes through the boundary of the box). The box is defined by specifying a point at the center of the box x[3] with sides lengths s[3] (in the x-y-z directions). If an intersection occurs (i.e., the containment return value is false), then the function returns the parametric coordinate of intersection t, the position of intersection xInt[3], and the plane of intersection where integers (0, 1, 2, 3, 4, 5) stand for the (xmin, xmax, ymin, ymax, zmin, zmax) box planes respectively. (If no intersection occurs, i.e., the line is contained, then the line (x,lineEnd) is contained within the box with x-y-z lengths s[3] centered around the point x, and the values of t, xInt, and plane are undefined.)

◆ GetBounds() [1/2]

void vtkBoundingBox::GetBounds ( double  bounds[6]) const
inline

Get the bounds of the box (defined by VTK style).

Definition at line 497 of file vtkBoundingBox.h.

◆ GetBounds() [2/2]

void vtkBoundingBox::GetBounds ( double &  xMin,
double &  xMax,
double &  yMin,
double &  yMax,
double &  zMin,
double &  zMax 
) const
inline

Get the bounds of the box (defined by VTK style).

Definition at line 410 of file vtkBoundingBox.h.

◆ GetBound()

double vtkBoundingBox::GetBound ( int  i) const
inline

Return the ith bounds of the box (defined by VTK style).

Definition at line 421 of file vtkBoundingBox.h.

◆ GetMinPoint() [1/3]

const double * vtkBoundingBox::GetMinPoint ( ) const
inline

Get the minimum point of the bounding box.

Definition at line 429 of file vtkBoundingBox.h.

◆ GetMinPoint() [2/3]

void vtkBoundingBox::GetMinPoint ( double &  x,
double &  y,
double &  z 
) const
inline

Get the minimum point of the bounding box.

Definition at line 565 of file vtkBoundingBox.h.

◆ GetMinPoint() [3/3]

void vtkBoundingBox::GetMinPoint ( double  x[3]) const
inline

Get the minimum point of the bounding box.

Definition at line 434 of file vtkBoundingBox.h.

◆ GetMaxPoint() [1/3]

const double * vtkBoundingBox::GetMaxPoint ( ) const
inline

Get the maximum point of the bounding box.

Definition at line 441 of file vtkBoundingBox.h.

◆ GetMaxPoint() [2/3]

void vtkBoundingBox::GetMaxPoint ( double &  x,
double &  y,
double &  z 
) const
inline

Get the maximum point of the bounding box.

Definition at line 572 of file vtkBoundingBox.h.

◆ GetMaxPoint() [3/3]

void vtkBoundingBox::GetMaxPoint ( double  x[3]) const
inline

Get the maximum point of the bounding box.

Definition at line 446 of file vtkBoundingBox.h.

◆ GetCorner()

void vtkBoundingBox::GetCorner ( int  corner,
double  p[3] 
) const
inline

Get the ith corner of the bounding box.

The points are ordered with i, then j, then k increasing.

Definition at line 607 of file vtkBoundingBox.h.

◆ ContainsPoint() [1/3]

vtkTypeBool vtkBoundingBox::ContainsPoint ( const double  p[3]) const
inline

Returns 1 if the point is contained in the box else 0.

Definition at line 596 of file vtkBoundingBox.h.

◆ ContainsPoint() [2/3]

vtkTypeBool vtkBoundingBox::ContainsPoint ( double  px,
double  py,
double  pz 
) const
inline

Returns 1 if the point is contained in the box else 0.

Definition at line 579 of file vtkBoundingBox.h.

◆ ContainsPoint() [3/3]

template<class PointT >
bool vtkBoundingBox::ContainsPoint ( const PointT &  p) const
inline

Returns 1 if the point is contained in the box else 0.

Definition at line 602 of file vtkBoundingBox.h.

◆ GetCenter()

void vtkBoundingBox::GetCenter ( double  center[3]) const
inline

Get the center of the bounding box.

Definition at line 476 of file vtkBoundingBox.h.

◆ GetLengths()

void vtkBoundingBox::GetLengths ( double  lengths[3]) const
inline

Get the length of each side of the box.

Definition at line 469 of file vtkBoundingBox.h.

◆ GetLength()

double vtkBoundingBox::GetLength ( int  i) const
inline

Return the length of the bounding box in the ith direction.

Definition at line 464 of file vtkBoundingBox.h.

◆ GetMaxLength()

double vtkBoundingBox::GetMaxLength ( ) const

Return the maximum length of the box.

◆ GetDiagonalLength2()

double vtkBoundingBox::GetDiagonalLength2 ( ) const

Return the length of the diagonal.

Precondition
not_empty: this->IsValid()

◆ GetDiagonalLength()

double vtkBoundingBox::GetDiagonalLength ( ) const

Return the length of the diagonal.

Precondition
not_empty: this->IsValid()

◆ Inflate() [1/3]

void vtkBoundingBox::Inflate ( double  delta)

Expand the bounding box.

Inflate(delta) expands by delta on each side, the box will grow by 2*delta in x, y, and z. Inflate(dx,dy,dz) expands by the given amounts in each of the x, y, z directions. Inflate() expands the bounds so that it has non-zero volume. Sides that are inflated are adjusted by 1% of the longest edge. Or if an edge is zero length, the bounding box is inflated by 1 unit in that direction. Finally, InflateSlice(delta) will expand any side of the bounding box by +/- delta if that side has length <2*delta (i.e., it is a slice as measured by the user-specified delta)).

◆ Inflate() [2/3]

void vtkBoundingBox::Inflate ( double  deltaX,
double  deltaY,
double  deltaZ 
)

Expand the bounding box.

Inflate(delta) expands by delta on each side, the box will grow by 2*delta in x, y, and z. Inflate(dx,dy,dz) expands by the given amounts in each of the x, y, z directions. Inflate() expands the bounds so that it has non-zero volume. Sides that are inflated are adjusted by 1% of the longest edge. Or if an edge is zero length, the bounding box is inflated by 1 unit in that direction. Finally, InflateSlice(delta) will expand any side of the bounding box by +/- delta if that side has length <2*delta (i.e., it is a slice as measured by the user-specified delta)).

◆ Inflate() [3/3]

void vtkBoundingBox::Inflate ( )

Expand the bounding box.

Inflate(delta) expands by delta on each side, the box will grow by 2*delta in x, y, and z. Inflate(dx,dy,dz) expands by the given amounts in each of the x, y, z directions. Inflate() expands the bounds so that it has non-zero volume. Sides that are inflated are adjusted by 1% of the longest edge. Or if an edge is zero length, the bounding box is inflated by 1 unit in that direction. Finally, InflateSlice(delta) will expand any side of the bounding box by +/- delta if that side has length <2*delta (i.e., it is a slice as measured by the user-specified delta)).

◆ InflateSlice()

void vtkBoundingBox::InflateSlice ( double  delta)

Expand the bounding box.

Inflate(delta) expands by delta on each side, the box will grow by 2*delta in x, y, and z. Inflate(dx,dy,dz) expands by the given amounts in each of the x, y, z directions. Inflate() expands the bounds so that it has non-zero volume. Sides that are inflated are adjusted by 1% of the longest edge. Or if an edge is zero length, the bounding box is inflated by 1 unit in that direction. Finally, InflateSlice(delta) will expand any side of the bounding box by +/- delta if that side has length <2*delta (i.e., it is a slice as measured by the user-specified delta)).

◆ Scale() [1/2]

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).

◆ Scale() [2/2]

void vtkBoundingBox::Scale ( double  sx,
double  sy,
double  sz 
)

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).

◆ ScaleAboutCenter() [1/3]

void vtkBoundingBox::ScaleAboutCenter ( double  s)

Scale each dimension of the box by some given factor, with the origin of the bounding box the center of the scaling.

If the box is not valid, it is not changed.

◆ ScaleAboutCenter() [2/3]

void vtkBoundingBox::ScaleAboutCenter ( double  s[3])

Scale each dimension of the box by some given factor, with the origin of the bounding box the center of the scaling.

If the box is not valid, it is not changed.

◆ ScaleAboutCenter() [3/3]

void vtkBoundingBox::ScaleAboutCenter ( double  sx,
double  sy,
double  sz 
)

Scale each dimension of the box by some given factor, with the origin of the bounding box the center of the scaling.

If the box is not valid, it is not changed.

◆ ComputeDivisions()

vtkIdType vtkBoundingBox::ComputeDivisions ( vtkIdType  totalBins,
double  bounds[6],
int  divs[3] 
) const

Compute the number of divisions in the x-y-z directions given a psoitive, target number of total bins (i.e., product of divisions in the x-y-z directions).

The computation is done in such a way as to create near cuboid bins. Also note that the returned bounds may be different than the bounds defined in this class, as the bounds in the x-y-z directions can never be <= 0. Note that the total number of divisions (divs[0]*divs[1]*divs[2]) will be less than or equal to the target number of bins (as long as totalBins>=1).

◆ ClampDivisions()

static void vtkBoundingBox::ClampDivisions ( vtkIdType  targetBins,
int  divs[3] 
)
static

Clamp the number of divisions to be less than or equal to a target number of bins, and the divs[i] >= 1.

◆ Reset()

void vtkBoundingBox::Reset ( )
inline

Returns the box to its initialized state.

Definition at line 404 of file vtkBoundingBox.h.

Member Data Documentation

◆ MinPnt

double vtkBoundingBox::MinPnt[3]
protected

Definition at line 401 of file vtkBoundingBox.h.

◆ MaxPnt

double vtkBoundingBox::MaxPnt[3]
protected

Definition at line 401 of file vtkBoundingBox.h.


The documentation for this class was generated from the following file: