11#ifndef _UNIFORMGRID3D_H_20050124_1703
12#define _UNIFORMGRID3D_H_20050124_1703
38 UniformGrid3D(
double dimX,
double dimY,
double dimZ,
double spacing = 0.5,
42 if (offset ==
nullptr) {
43 initGrid(dimX, dimY, dimZ, spacing, valType,
44 Point3D(-0.5 * dimX, -0.5 * dimY, -0.5 * dimZ));
46 initGrid(dimX, dimY, dimZ, spacing, valType, *offset);
72 unsigned int getVal(
unsigned int pointId)
const override;
83 void setVal(
unsigned int pointId,
unsigned int val)
override;
86 unsigned int getSize()
const override {
return d_numX * d_numY * d_numZ; }
105 int maxNumLayers = -1,
bool ignoreOutOfBound =
true);
110 int getGridIndex(
unsigned int xi,
unsigned int yi,
unsigned int zi)
const;
115 unsigned int &zi)
const;
118 unsigned int getNumX()
const {
return d_numX; }
121 unsigned int getNumY()
const {
return d_numY; }
124 unsigned int getNumZ()
const {
return d_numZ; }
166 PRECONDITION(compareParams(other),
"mismatched params");
168 d_numZ * d_spacing, d_spacing, dp_storage->getValueType(),
187 void initGrid(
double dimX,
double dimY,
double dimZ,
double spacing,
200 void initFromText(
const char *pkl,
const unsigned int length);
208 std::ostream &outStrm);
215 const std::string &filename);
#define PRECONDITION(expr, mess)
Virtual base class for a grid object.
a class for efficiently storing vectors of discrete values
DiscreteValueType
used to define the possible range of the values
#define RDKIT_RDGEOMETRYLIB_EXPORT
RDKIT_RDGEOMETRYLIB_EXPORT void writeGridToFile(const UniformGrid3D &grid, const std::string &filename)
writes the contents of the grid to a named file
RDKIT_RDGEOMETRYLIB_EXPORT void writeGridToStream(const UniformGrid3D &grid, std::ostream &outStrm)
writes the contents of the grid to a stream