50 int ilo,
int jlo,
int klo,
51 int ihi,
int jhi,
int khi);
65 vtkAMRBox(
const double* origin,
const int* dimensions,
const double*
spacing,
66 const double* globalOrigin,
int gridDescription=
VTK_XYZ_GRID);
70 vtkAMRBox(
const int lo[3],
const int hi[3]);
84 this->LoCorner[0]=this->LoCorner[1]=this->LoCorner[2]=0;
85 this->HiCorner[0]=this->HiCorner[1]=this->HiCorner[2]=-2;
96 int ilo,
int jlo,
int klo,
101 void SetDimensions(
const int lo[3],
const int hi[3],
int desc=
VTK_XYZ_GRID);
104 void SetDimensions(
const int dims[6],
int desc =
VTK_XYZ_GRID);
107 void GetDimensions(
int lo[3],
int hi[3])
const;
110 void GetDimensions(
int dims[6])
const;
115 void GetNumberOfCells(
int num[3])
const;
121 void GetNumberOfNodes(
int ext[3])
const;
128 int ComputeDimension()
const;
139 void GetValidHiCorner(
int hi[3])
const;
142 {
return this->IsInvalid();}
148 return ((this->HiCorner[0] < this->LoCorner[0]-1) ||
149 (this->HiCorner[1] < this->LoCorner[1]-1) ||
150 (this->HiCorner[2] < this->LoCorner[2]-1));
164 {
return( !(*
this == other) ); }
168 ostream &Print(ostream &os)
const;
176 void Serialize(
unsigned char*& buffer,
vtkIdType &bytesize );
177 void Serialize(
int* buffer)
const;
182 void Deserialize(
unsigned char* buffer,
const vtkIdType &bytesize );
188 bool DoesBoxIntersectAlongDimension(
const vtkAMRBox &other,
const int q)
const;
190 bool DoesIntersect(
const vtkAMRBox &other)
const;
201 void Shrink(
int byN);
206 void Shift(
int i,
int j,
int k);
207 void Shift(
const int I[3]);
217 bool Contains(
int i,
int j,
int k)
const;
218 bool Contains(
const int I[3])
const;
227 void GetGhostVector(
int r,
int nghost[6])
const;
230 void RemoveGhosts(
int r);
239 static int GetCellLinearIndex(
const vtkAMRBox& box,
const int i,
const int j,
const int k,
int imageDimension[3] );
242 static void GetBounds(
const vtkAMRBox& box,
const double origin[3],
const double spacing[3],
double bounds[6]) ;
246 static void GetBoxOrigin(
const vtkAMRBox& box,
const double X0[3],
const double spacing[3],
double x0[3]);
250 static bool HasPoint(
const vtkAMRBox& box,
const double origin[3],
const double spacing[3],
double x,
double y,
double z );
254 static int ComputeStructuredCoordinates(
const vtkAMRBox& box,
const double dataOrigin[3],
255 const double h[3],
const double x[3],
int ijk[3],
double pcoords[3]);
266 bool IntersectBoxAlongDimension(
const vtkAMRBox &other,
const int q);
277 const int ilo,
const int jlo,
const int klo,
278 const int ihi,
const int jhi,
const int khi );
287 template <
typename T>
301 arrayDims.
Shift(ofs);
305 if (!arrayRegion.
Contains(destRegion))
307 vtkGenericWarningMacro(
308 <<
"ERROR: Array must enclose the destination region. "
309 <<
"Aborting the fill.");
319 for (
int k=destLo[2]; k<=destHi[2]; ++k)
322 for (
int j=destLo[1]; j<=destHi[1]; ++j)
324 vtkIdType idx=kOfs+j*arrayHi[0]+destLo[0];
325 for (
int i=destLo[0]; i<=destHi[0]; ++i)
327 pArray[idx]=fillValue;
Encloses a rectangular region of voxel like cells.
void FillRegion(T *pArray, const vtkAMRBox &arrayRegion, const vtkAMRBox &destRegion, T fillValue)
void GetValidHiCorner(int hi[3]) const
void Shift(int i, int j, int k)
vtkIdType GetNumberOfCells() const
const int * GetLoCorner() const
static vtkIdType GetBytesize()
bool EmptyDimension(int i) const
VTKCOMMONCORE_EXPORT bool operator==(const vtkUnicodeString &lhs, const vtkUnicodeString &rhs)
VTKWRAPPINGJAVA_EXPORT jlong q(JNIEnv *env, jobject obj)
const int * GetHiCorner() const
bool operator!=(const vtkAMRBox &other) const
#define VTKCOMMONDATAMODEL_EXPORT
bool Contains(int i, int j, int k) const