 |
VTK
9.0.1
|
Go to the documentation of this file.
29 #include "vtkCommonDataModelModule.h"
49 vtkAMRBox(
int ilo,
int jlo,
int klo,
int ihi,
int jhi,
int khi);
56 const double* globalOrigin,
int gridDescription =
VTK_XYZ_GRID);
78 this->LoCorner[0] = this->LoCorner[1] = this->LoCorner[2] = 0;
79 this->HiCorner[0] = this->HiCorner[1] = this->HiCorner[2] = -2;
150 bool Empty()
const {
return this->IsInvalid(); }
157 return ((this->HiCorner[0] < this->LoCorner[0] - 1) ||
158 (this->HiCorner[1] < this->LoCorner[1] - 1) || (this->HiCorner[2] < this->LoCorner[2] - 1));
285 const vtkAMRBox& box,
const int i,
const int j,
const int k,
int imageDimension[3]);
291 const vtkAMRBox& box,
const double origin[3],
const double spacing[3],
double bounds[6]);
298 const vtkAMRBox& box,
const double X0[3],
const double spacing[3],
double x0[3]);
305 double x,
double y,
double z);
311 const double h[3],
const double x[3],
int ijk[3],
double pcoords[3]);
338 const int ilo,
const int jlo,
const int klo,
const int ihi,
const int jhi,
const int khi);
348 template <
typename T>
358 arrayDims.
Shift(ofs);
362 if (!arrayRegion.
Contains(destRegion))
364 vtkGenericWarningMacro(<<
"ERROR: Array must enclose the destination region. "
365 <<
"Aborting the fill.");
375 for (
int k = destLo[2]; k <= destHi[2]; ++k)
377 vtkIdType kOfs = k * arrayHi[0] * arrayHi[1];
378 for (
int j = destLo[1]; j <= destHi[1]; ++j)
380 vtkIdType idx = kOfs + j * arrayHi[0] + destLo[0];
381 for (
int i = destLo[0]; i <= destHi[0]; ++i)
383 pArray[idx] = fillValue;
Encloses a rectangular region of voxel like cells.
void Coarsen(int r)
Coarsen the box.
bool Intersect(const vtkAMRBox &other)
Intersect this box with another box in place.
bool Contains(const int I[3]) const
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.
ostream & Print(ostream &os) const
Send the box to a stream.
bool DoesBoxIntersectAlongDimension(const vtkAMRBox &other, const int q) const
Checks if this instance of vtkAMRBox intersects with the box passed through the argument list along t...
static void GetBounds(const vtkAMRBox &box, const double origin[3], const double spacing[3], double bounds[6])
Get the bounds of this box.
void Deserialize(unsigned char *buffer, const vtkIdType &bytesize)
Deserializes this object instance from the given byte-stream.
void Shift(const int I[3])
bool EmptyDimension(int i) const
Whether dimension i is empty, e.g.
void Grow(int byN)
Grows the box in all directions.
vtkAMRBox()
Construct the empty box.
vtkAMRBox(int ilo, int jlo, int klo, int ihi, int jhi, int khi)
Construct a specific 3D box.
void Serialize(int *buffer) const
const int * GetHiCorner() const
vtkAMRBox(const int lo[3], const int hi[3])
Construct a specific box.
void FillRegion(T *pArray, const vtkAMRBox &arrayRegion, const vtkAMRBox &destRegion, T fillValue)
Fill the region of "pArray" enclosed by "destRegion" with "fillValue" "pArray" is defined on "arrayRe...
const int * GetLoCorner() const
Get the low corner index.
void GetNumberOfNodes(int ext[3]) const
Gets the number of nodes required to construct a physical representation of the box.
vtkIdType GetNumberOfNodes() const
vtkAMRBox(const int dims[6])
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 ...
void Shift(int i, int j, int k)
Shifts the box in index space.
bool Contains(const vtkAMRBox &) const
Test to see if a given box is inside this box.
bool operator==(const vtkAMRBox &other) const
Test if this box is equal with the box instance on the rhs.
void SetDimensions(const int dims[6], int desc=VTK_XYZ_GRID)
Set the dimensions of the box.
bool Contains(int i, int j, int k) const
Test to see if a given cell index is inside this box.
vtkIdType GetNumberOfCells() const
Gets the number of cells enclosed by the box.
void GetDimensions(int lo[3], int hi[3]) const
Get the dimensions of this box.
static vtkIdType GetBytesize()
Returns the number of bytes allocated by this instance.
vtkAMRBox(const vtkAMRBox &other)
Copy construct this box from another.
void RemoveGhosts(int r)
Given an AMR box and the refinement ratio, r, this shrinks the AMRBox.
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.
void GetDimensions(int dims[6]) const
Get the dimensions of this box.
void Refine(int r)
Refine the box.
void GetValidHiCorner(int hi[3]) const
Return a high corner.
bool IsInvalid() const
Check to see if the AMR box instance is invalid.
void Invalidate()
Set the box to be invalid;.
bool DoesIntersect(const vtkAMRBox &other) const
int ComputeDimension() const
Determines the dimension of the AMR box given the box indices.
void Serialize(unsigned char *&buffer, vtkIdType &bytesize)
Serializes this object instance into a byte-stream.
void GetNumberOfCells(int num[3]) const
void Initialize()
Initializes this box instance.
vtkAMRBox & operator=(const vtkAMRBox &other)
Copy the other box to 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.
void SetDimensions(const int lo[3], const int hi[3], int desc=VTK_XYZ_GRID)
Set the dimensions of the box.
bool operator!=(const vtkAMRBox &other) const
Test if this box is NOT equal with the box instance on the rhs.
vtkFrustumSelector is a vtkSelector that selects elements based on whether they are inside or interse...
bool IntersectBoxAlongDimension(const vtkAMRBox &other, const int q)
Intersects this instance of vtkAMRbox with box passed through the argument list along the given dimen...
static int GetCellLinearIndex(const vtkAMRBox &box, const int i, const int j, const int k, int imageDimension[3])
Returns the linear index of the given cell structured coordinates.
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.
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...