11#ifndef UNIFORMGRID3D_H_20050124_1703
12#define UNIFORMGRID3D_H_20050124_1703
21 :
public Grid3D<RDKit::DiscreteValueVect, int, unsigned int> {
39 UniformGrid3D(
double dimX,
double dimY,
double dimZ,
double spacing = 0.5,
43 if (offset ==
nullptr) {
44 initGrid(dimX, dimY, dimZ, spacing, valType,
45 Point3D(-0.5 * dimX, -0.5 * dimY, -0.5 * dimZ));
47 initGrid(dimX, dimY, dimZ, spacing, valType, *offset);
73 unsigned int getVal(
unsigned int pointId)
const override;
84 void setVal(
unsigned int pointId,
unsigned int val)
override;
87 unsigned int getSize()
const override {
return d_numX * d_numY * d_numZ; }
106 int maxNumLayers = -1,
bool ignoreOutOfBound =
true);
111 int getGridIndex(
unsigned int xi,
unsigned int yi,
unsigned int zi)
const;
116 unsigned int &zi)
const;
119 unsigned int getNumX()
const {
return d_numX; }
122 unsigned int getNumY()
const {
return d_numY; }
125 unsigned int getNumZ()
const {
return d_numZ; }
167 PRECONDITION(compareParams(other),
"mismatched params");
169 d_numZ * d_spacing, d_spacing, dp_storage->getValueType(),
188 void initGrid(
double dimX,
double dimY,
double dimZ,
double spacing,
201 void initFromText(
const char *pkl,
const unsigned int length);
209 std::ostream &outStrm);
216 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