VTK
9.4.20241123
|
Encloses a rectangular region of voxel like cells. More...
#include <vtkAMRBox.h>
Public Member Functions | |
vtkAMRBox () | |
Construct the empty box. | |
vtkAMRBox (const vtkAMRBox &other) | |
Copy construct this box from another. | |
vtkAMRBox (int ilo, int jlo, int klo, int ihi, int jhi, int khi) | |
Construct a specific 3D box. | |
vtkAMRBox (const double *origin, const int *dimensions, const double *spacing, const double *globalOrigin, int gridDescription=VTK_XYZ_GRID) | |
Construct an AMR box from the description a vtkUniformGrid Note that the dimensions specify the node dimensions, rather than the cell dimensions. | |
vtkAMRBox (const int lo[3], const int hi[3]) | |
Construct a specific box. | |
vtkAMRBox (const int dims[6]) | |
vtkAMRBox & | operator= (const vtkAMRBox &other) |
Copy the other box to this box. | |
virtual | ~vtkAMRBox ()=default |
bool | EmptyDimension (int i) const |
Whether dimension i is empty, e.g. | |
void | SetDimensions (int ilo, int jlo, int klo, int ihi, int jhi, int khi, int desc=VTK_XYZ_GRID) |
Set the dimensions of the box. | |
void | SetDimensions (const int lo[3], const int hi[3], int desc=VTK_XYZ_GRID) |
Set the dimensions of the box. | |
void | SetDimensions (const int dims[6], int desc=VTK_XYZ_GRID) |
Set the dimensions of the box. | |
void | GetDimensions (int lo[3], int hi[3]) const |
Get the dimensions of this box. | |
void | GetDimensions (int dims[6]) const |
Get the dimensions of this box. | |
int | ComputeDimension () const |
Determines the dimension of the AMR box given the box indices. | |
const int * | GetLoCorner () const |
Get the low corner index. | |
const int * | GetHiCorner () const |
void | GetValidHiCorner (int hi[3]) const |
Return a high corner. | |
bool | Empty () const |
bool | IsInvalid () const |
Check to see if the AMR box instance is invalid. | |
bool | operator== (const vtkAMRBox &other) const |
Test if this box is equal with the box instance on the rhs. | |
bool | operator!= (const vtkAMRBox &other) const |
Test if this box is NOT equal with the box instance on the rhs. | |
ostream & | Print (ostream &os) const |
Send the box to a stream. | |
void | Deserialize (unsigned char *buffer, const vtkIdType &bytesize) |
Deserializes this object instance from the given byte-stream. | |
bool | DoesBoxIntersectAlongDimension (const vtkAMRBox &other, int q) const |
Checks if this instance of vtkAMRBox intersects with the box passed through the argument list along the given dimension q. | |
bool | DoesIntersect (const vtkAMRBox &other) const |
void | Coarsen (int r) |
Coarsen the box. | |
void | Refine (int r) |
Refine the box. | |
bool | Intersect (const vtkAMRBox &other) |
Intersect this box with another box in place. | |
bool | Contains (const vtkAMRBox &) const |
Test to see if a given box is inside this box. | |
void | GetGhostVector (int r, int nghost[6]) const |
Given an AMR box and the refinement ratio, r, this method computes the number of ghost layers in each of the 6 directions, i.e., [imin,imax,jmin,jmax,kmin,kmax]. | |
void | RemoveGhosts (int r) |
Given an AMR box and the refinement ratio, r, this shrinks the AMRBox. | |
void | Invalidate () |
Set the box to be invalid;. | |
vtkIdType | GetNumberOfCells () const |
Gets the number of cells enclosed by the box. | |
void | GetNumberOfCells (int num[3]) const |
Gets the number of cells enclosed by the box. | |
void | GetNumberOfNodes (int ext[3]) const |
Gets the number of nodes required to construct a physical representation of the box. | |
vtkIdType | GetNumberOfNodes () const |
Gets the number of nodes required to construct a physical representation of the box. | |
void | Serialize (unsigned char *&buffer, vtkIdType &bytesize) |
Serializes this object instance into a byte-stream. | |
void | Serialize (int *buffer) const |
Serializes this object instance into a byte-stream. | |
void | Grow (int byN) |
Grows the box in all directions. | |
void | Shrink (int byN) |
Grows the box in all directions. | |
void | Shift (int i, int j, int k) |
Shifts the box in index space. | |
void | Shift (const int I[3]) |
Shifts the box in index space. | |
bool | Contains (int i, int j, int k) const |
Test to see if a given cell index is inside this box. | |
bool | Contains (const int I[3]) const |
Test to see if a given cell index is inside this box. | |
Static Public Member Functions | |
static vtkIdType | GetBytesize () |
Returns the number of bytes allocated by this instance. | |
static int | GetCellLinearIndex (const vtkAMRBox &box, int i, int j, int k, int imageDimension[3]) |
Returns the linear index of the given cell structured coordinates. | |
static void | GetBounds (const vtkAMRBox &box, const double origin[3], const double spacing[3], double bounds[6]) |
Get the bounds of this box. | |
static void | GetBoxOrigin (const vtkAMRBox &box, const double X0[3], const double spacing[3], double x0[3]) |
Get the world space origin of this box. | |
static bool | HasPoint (const vtkAMRBox &box, const double origin[3], const double spacing[3], double x, double y, double z) |
Checks if the point is inside this AMRBox instance. | |
static int | ComputeStructuredCoordinates (const vtkAMRBox &box, const double dataOrigin[3], const double h[3], const double x[3], int ijk[3], double pcoords[3]) |
Compute structured coordinates. | |
Protected Member Functions | |
void | Initialize () |
Initializes this box instance. | |
bool | IntersectBoxAlongDimension (const vtkAMRBox &other, int q) |
Intersects this instance of vtkAMRbox with box passed through the argument list along the given dimension q. | |
Encloses a rectangular region of voxel like cells.
vtkAMRBox stores information for an AMR block
Definition at line 67 of file vtkAMRBox.h.
vtkAMRBox::vtkAMRBox | ( | ) |
Construct the empty box.
vtkAMRBox::vtkAMRBox | ( | const vtkAMRBox & | other | ) |
Copy construct this box from another.
vtkAMRBox::vtkAMRBox | ( | int | ilo, |
int | jlo, | ||
int | klo, | ||
int | ihi, | ||
int | jhi, | ||
int | khi | ||
) |
Construct a specific 3D box.
vtkAMRBox::vtkAMRBox | ( | const double * | origin, |
const int * | dimensions, | ||
const double * | spacing, | ||
const double * | globalOrigin, | ||
int | gridDescription = VTK_XYZ_GRID |
||
) |
Construct an AMR box from the description a vtkUniformGrid Note that the dimensions specify the node dimensions, rather than the cell dimensions.
vtkAMRBox::vtkAMRBox | ( | const int | lo[3], |
const int | hi[3] | ||
) |
Construct a specific box.
(ilo,jlo,klo,)(ihi,jhi,khi)
vtkAMRBox::vtkAMRBox | ( | const int | dims[6] | ) |
|
virtualdefault |
|
inline |
Set the box to be invalid;.
Definition at line 110 of file vtkAMRBox.h.
|
inline |
Whether dimension i is empty, e.g.
if the data set is type VTK_XY_PLANE
Definition at line 120 of file vtkAMRBox.h.
void vtkAMRBox::SetDimensions | ( | int | ilo, |
int | jlo, | ||
int | klo, | ||
int | ihi, | ||
int | jhi, | ||
int | khi, | ||
int | desc = VTK_XYZ_GRID |
||
) |
Set the dimensions of the box.
ilo,jlo,klo,ihi,jhi,khi
void vtkAMRBox::SetDimensions | ( | const int | lo[3], |
const int | hi[3], | ||
int | desc = VTK_XYZ_GRID |
||
) |
Set the dimensions of the box.
(ilo,jlo,klo),(ihi,jhi,khi)
void vtkAMRBox::SetDimensions | ( | const int | dims[6], |
int | desc = VTK_XYZ_GRID |
||
) |
Set the dimensions of the box.
(ilo,ihi,jlo,jhi,klo,khi)
void vtkAMRBox::GetDimensions | ( | int | lo[3], |
int | hi[3] | ||
) | const |
Get the dimensions of this box.
(ilo,jlo,jhi),(ihi,jhi,khi)
void vtkAMRBox::GetDimensions | ( | int | dims[6] | ) | const |
Get the dimensions of this box.
(ilo,ihi, jlo,jhi, klo,khi)
vtkIdType vtkAMRBox::GetNumberOfCells | ( | ) | const |
Gets the number of cells enclosed by the box.
void vtkAMRBox::GetNumberOfCells | ( | int | num[3] | ) | const |
Gets the number of cells enclosed by the box.
void vtkAMRBox::GetNumberOfNodes | ( | int | ext[3] | ) | const |
Gets the number of nodes required to construct a physical representation of the box.
vtkIdType vtkAMRBox::GetNumberOfNodes | ( | ) | const |
Gets the number of nodes required to construct a physical representation of the box.
int vtkAMRBox::ComputeDimension | ( | ) | const |
Determines the dimension of the AMR box given the box indices.
Note, the AMR box can be on an arbitrary axis-aligned plane, i.e., XZ or YZ.
|
inline |
Get the low corner index.
Definition at line 174 of file vtkAMRBox.h.
|
inline |
Definition at line 175 of file vtkAMRBox.h.
void vtkAMRBox::GetValidHiCorner | ( | int | hi[3] | ) | const |
Return a high corner.
If dimension j is empty, then hi[j] is set from lo[j]. This is convenient For algorithm that must iterate over all cells
|
inline |
Definition at line 184 of file vtkAMRBox.h.
|
inline |
Check to see if the AMR box instance is invalid.
Definition at line 189 of file vtkAMRBox.h.
bool vtkAMRBox::operator== | ( | const vtkAMRBox & | other | ) | const |
Test if this box is equal with the box instance on the rhs.
Note: Two AMR boxes are equal if: (a) they have the same dimensionality (b) they are at the same level and (c) they occupy the same index space.
|
inline |
Test if this box is NOT equal with the box instance on the rhs.
Note: Two AMR boxes are equal if: (a) they have the same dimensionality (b) they are at the same level and (c) they occupy the same index space.
Definition at line 207 of file vtkAMRBox.h.
ostream & vtkAMRBox::Print | ( | ostream & | os | ) | const |
Send the box to a stream.
"(ilo,jlo,jhi),(ihi,jhi,khi)"
void vtkAMRBox::Serialize | ( | unsigned char *& | buffer, |
vtkIdType & | bytesize | ||
) |
Serializes this object instance into a byte-stream.
buffer – user-supplied pointer where the serialized object is stored. bytesize – number of bytes, i.e., the size of the buffer. NOTE: buffer is allocated internally by this method. Pre-conditions: buffer == nullptr Post-conditions: buffer != nullptr bytesize != 0
void vtkAMRBox::Serialize | ( | int * | buffer | ) | const |
Serializes this object instance into a byte-stream.
buffer – user-supplied pointer where the serialized object is stored. bytesize – number of bytes, i.e., the size of the buffer. NOTE: buffer is allocated internally by this method. Pre-conditions: buffer == nullptr Post-conditions: buffer != nullptr bytesize != 0
void vtkAMRBox::Deserialize | ( | unsigned char * | buffer, |
const vtkIdType & | bytesize | ||
) |
Deserializes this object instance from the given byte-stream.
Pre-conditions: buffer != nullptr bytesize != 0
bool vtkAMRBox::DoesBoxIntersectAlongDimension | ( | const vtkAMRBox & | other, |
int | q | ||
) | const |
Checks if this instance of vtkAMRBox intersects with the box passed through the argument list along the given dimension q.
True is returned iff the box intersects successfully. Otherwise, there is no intersection along the given dimension and false is returned.
bool vtkAMRBox::DoesIntersect | ( | const vtkAMRBox & | other | ) | const |
void vtkAMRBox::Coarsen | ( | int | r | ) |
Coarsen the box.
void vtkAMRBox::Refine | ( | int | r | ) |
Refine the box.
void vtkAMRBox::Grow | ( | int | byN | ) |
Grows the box in all directions.
void vtkAMRBox::Shrink | ( | int | byN | ) |
Grows the box in all directions.
void vtkAMRBox::Shift | ( | int | i, |
int | j, | ||
int | k | ||
) |
Shifts the box in index space.
void vtkAMRBox::Shift | ( | const int | I[3] | ) |
Shifts the box in index space.
bool vtkAMRBox::Intersect | ( | const vtkAMRBox & | other | ) |
Intersect this box with another box in place.
Returns true if the boxes do intersect. Note that the box is modified to be the intersection or is made invalid.
bool vtkAMRBox::Contains | ( | int | i, |
int | j, | ||
int | k | ||
) | const |
Test to see if a given cell index is inside this box.
bool vtkAMRBox::Contains | ( | const int | I[3] | ) | const |
Test to see if a given cell index is inside this box.
bool vtkAMRBox::Contains | ( | const vtkAMRBox & | ) | const |
Test to see if a given box is inside this box.
void vtkAMRBox::GetGhostVector | ( | int | r, |
int | nghost[6] | ||
) | const |
Given an AMR box and the refinement ratio, r, this method computes the number of ghost layers in each of the 6 directions, i.e., [imin,imax,jmin,jmax,kmin,kmax].
void vtkAMRBox::RemoveGhosts | ( | int | r | ) |
Given an AMR box and the refinement ratio, r, this shrinks the AMRBox.
|
inlinestatic |
Returns the number of bytes allocated by this instance.
In addition, this number of bytes corresponds to the buffer size required to serialize any vtkAMRBox instance.
Definition at line 312 of file vtkAMRBox.h.
|
static |
Returns the linear index of the given cell structured coordinates.
|
static |
Get the bounds of this box.
|
static |
Get the world space origin of this box.
The origin is the location of the lower corner cell's lower corner node,
|
static |
Checks if the point is inside this AMRBox instance.
x,y,z the world point
|
static |
Compute structured coordinates.
|
protected |
Initializes this box instance.
|
protected |
Intersects this instance of vtkAMRbox with box passed through the argument list along the given dimension q.
True is returned iff the box intersects successfully. Otherwise, false is returned if there is no intersection at the given dimension.