50 int ilo,
int jlo,
int klo,
51 int ihi,
int jhi,
int khi);
58 vtkAMRBox(
const double* origin,
const int* dimensions,
const double*
spacing,
59 const double* globalOrigin,
int gridDescription=
VTK_XYZ_GRID);
63 vtkAMRBox(
const int lo[3],
const int hi[3]);
77 this->LoCorner[0]=this->LoCorner[1]=this->LoCorner[2]=0;
78 this->HiCorner[0]=this->HiCorner[1]=this->HiCorner[2]=-2;
89 int ilo,
int jlo,
int klo,
94 void SetDimensions(
const int lo[3],
const int hi[3],
int desc=
VTK_XYZ_GRID);
97 void SetDimensions(
const int dims[6],
int desc =
VTK_XYZ_GRID);
100 void GetDimensions(
int lo[3],
int hi[3])
const;
103 void GetDimensions(
int dims[6])
const;
108 void GetNumberOfCells(
int num[3])
const;
114 void GetNumberOfNodes(
int ext[3])
const;
121 int ComputeDimension()
const;
132 void GetValidHiCorner(
int hi[3])
const;
135 {
return this->IsInvalid();}
141 return ((this->HiCorner[0] < this->LoCorner[0]-1) ||
142 (this->HiCorner[1] < this->LoCorner[1]-1) ||
143 (this->HiCorner[2] < this->LoCorner[2]-1));
157 {
return( !(*
this == other) ); }
161 ostream &Print(ostream &os)
const;
169 void Serialize(
unsigned char*& buffer,
vtkIdType &bytesize );
170 void Serialize(
int* buffer)
const;
175 void Deserialize(
unsigned char* buffer,
const vtkIdType &bytesize );
181 bool DoesBoxIntersectAlongDimension(
const vtkAMRBox &other,
const int q)
const;
183 bool DoesIntersect(
const vtkAMRBox &other)
const;
194 void Shrink(
int byN);
199 void Shift(
int i,
int j,
int k);
200 void Shift(
const int I[3]);
210 bool Contains(
int i,
int j,
int k)
const;
211 bool Contains(
const int I[3])
const;
220 void GetGhostVector(
int r,
int nghost[6])
const;
223 void RemoveGhosts(
int r);
232 static int GetCellLinearIndex(
const vtkAMRBox& box,
const int i,
const int j,
const int k,
int imageDimension[3] );
235 static void GetBounds(
const vtkAMRBox& box,
const double origin[3],
const double spacing[3],
double bounds[6]) ;
239 static void GetBoxOrigin(
const vtkAMRBox& box,
const double X0[3],
const double spacing[3],
double x0[3]);
243 static bool HasPoint(
const vtkAMRBox& box,
const double origin[3],
const double spacing[3],
double x,
double y,
double z );
247 static int ComputeStructuredCoordinates(
const vtkAMRBox& box,
const double dataOrigin[3],
248 const double h[3],
const double x[3],
int ijk[3],
double pcoords[3]);
259 bool IntersectBoxAlongDimension(
const vtkAMRBox &other,
const int q);
270 const int ilo,
const int jlo,
const int klo,
271 const int ihi,
const int jhi,
const int khi );
280 template <
typename T>
294 arrayDims.
Shift(ofs);
298 if (!arrayRegion.
Contains(destRegion))
300 vtkGenericWarningMacro(
301 <<
"ERROR: Array must enclose the destination region. "
302 <<
"Aborting the fill.");
312 for (
int k=destLo[2]; k<=destHi[2]; ++k)
315 for (
int j=destLo[1]; j<=destHi[1]; ++j)
317 vtkIdType idx=kOfs+j*arrayHi[0]+destLo[0];
318 for (
int i=destLo[0]; i<=destHi[0]; ++i)
320 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