10 #ifndef _UNIFORMGRID3D_H_20050124_1703 11 #define _UNIFORMGRID3D_H_20050124_1703 38 UniformGrid3D(
double dimX,
double dimY,
double dimZ,
double spacing=0.5,
42 initGrid(dimX, dimY, dimZ, spacing, valType,
43 Point3D(-0.5*dimX, -0.5*dimY, -0.5*dimZ));
45 initGrid(dimX, dimY, dimZ, spacing, valType, *offset);
70 unsigned int getVal(
unsigned int pointId)
const;
81 void setVal(
unsigned int pointId,
unsigned int val);
84 unsigned int getSize()
const {
return d_numX*d_numY*d_numZ; };
99 double stepSize,
int maxNumLayers=-1,
100 bool ignoreOutOfBound=
true);
105 int getGridIndex(
unsigned int xi,
unsigned int yi,
unsigned int zi)
const;
109 void getGridIndices(
unsigned int idx,
unsigned int &xi,
unsigned int &yi,
unsigned int &zi)
const;
113 unsigned int getNumX()
const {
return d_numX; };
116 unsigned int getNumY()
const {
return d_numY; };
119 unsigned int getNumZ()
const {
return d_numZ; };
160 UniformGrid3D res(d_numX*d_spacing,d_numY*d_spacing,d_numZ*d_spacing,
178 void initGrid(
double dimX,
double dimY,
double dimZ,
double spacing,
181 unsigned int d_numX, d_numY, d_numZ;
187 void initFromText(
const char *pkl,
const unsigned int length);
void writeGridToStream(const UniformGrid3D &grid, std::ostream &outStrm)
writes the contents of the grid to a stream
DiscreteValueType
used to define the possible range of the values
Virtual base class for a grid object.
a class for efficiently storing vectors of discrete values
void writeGridToFile(const UniformGrid3D &grid, std::string filename)
writes the contents of the grid to a named file
#define PRECONDITION(expr, mess)
DiscreteValueType getValueType() const
return the type of value being stored