 |
RDKit
Open-source cheminformatics and machine learning.
|
Go to the documentation of this file.
11 #ifndef _UNIFORMGRID3D_H_20050124_1703
12 #define _UNIFORMGRID3D_H_20050124_1703
38 UniformGrid3D(
double dimX,
double dimY,
double dimZ,
double spacing = 0.5,
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);
62 int getGridPointIndex(
const Point3D &point)
const;
67 int getVal(
const Point3D &point)
const;
72 unsigned int getVal(
unsigned int pointId)
const;
77 void setVal(
const Point3D &point,
unsigned int val);
80 Point3D getGridPointLoc(
unsigned int pointId)
const;
83 void setVal(
unsigned int pointId,
unsigned int val);
86 unsigned int getSize()
const {
return d_numX * d_numY * d_numZ; };
104 void setSphereOccupancy(
const Point3D ¢er,
double radius,
double stepSize,
105 int maxNumLayers = -1,
bool ignoreOutOfBound =
true);
110 int getGridIndex(
unsigned int xi,
unsigned int yi,
unsigned int zi)
const;
114 void getGridIndices(
unsigned int idx,
unsigned int &xi,
unsigned int &yi,
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; };
139 virtual bool compareParams(
const UniformGrid3D &other)
const;
162 std::string toString()
const;
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,
191 unsigned int d_numX, d_numY,
199 void initFromText(
const char *pkl,
const unsigned int length);
207 std::ostream &outStrm);
214 const std::string &filename);
DiscreteValueType
used to define the possible range of the values
#define RDKIT_RDGEOMETRYLIB_EXPORT
a class for efficiently storing vectors of discrete values
Virtual base class for a grid object.
#define PRECONDITION(expr, mess)
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