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);
61 int getGridPointIndex(
const Point3D &point)
const;
66 int getVal(
const Point3D &point)
const;
71 unsigned int getVal(
unsigned int pointId)
const;
76 void setVal(
const Point3D &point,
unsigned int val);
79 Point3D getGridPointLoc(
unsigned int pointId)
const;
82 void setVal(
unsigned int pointId,
unsigned int val);
85 unsigned int getSize()
const {
return d_numX * d_numY * d_numZ; };
103 void setSphereOccupancy(
const Point3D ¢er,
double radius,
double stepSize,
104 int maxNumLayers = -1,
bool ignoreOutOfBound =
true);
109 int getGridIndex(
unsigned int xi,
unsigned int yi,
unsigned int zi)
const;
113 void getGridIndices(
unsigned int idx,
unsigned int &xi,
unsigned int &yi,
114 unsigned int &zi)
const;
117 unsigned int getNumX()
const {
return d_numX; };
120 unsigned int getNumY()
const {
return d_numY; };
123 unsigned int getNumZ()
const {
return d_numZ; };
138 virtual bool compareParams(
const UniformGrid3D &other)
const;
161 std::string toString()
const;
165 PRECONDITION(compareParams(other),
"mismatched params");
167 d_numZ * d_spacing, d_spacing, dp_storage->getValueType(),
186 void initGrid(
double dimX,
double dimY,
double dimZ,
double spacing,
190 unsigned int d_numX, d_numY,
198 void initFromText(
const char *pkl,
const unsigned int length);
#define RDKIT_RDGEOMETRYLIB_EXPORT
DiscreteValueType
used to define the possible range of the values
RDKIT_RDGEOMETRYLIB_EXPORT void writeGridToFile(const UniformGrid3D &grid, const std::string &filename)
writes the contents of the grid to a named file
Virtual base class for a grid object.
a class for efficiently storing vectors of discrete values
RDKIT_RDGEOMETRYLIB_EXPORT void writeGridToStream(const UniformGrid3D &grid, std::ostream &outStrm)
writes the contents of the grid to a stream
#define PRECONDITION(expr, mess)