24 #include <openbabel/babelconfig.h> 47 double _xmin,_xmax,_ymin,_ymax,
_zmin,_zmax;
55 virtual void Init(
OBMol &box);
73 return (x>=_xmin) && (x<=_xmax) &&
74 (y>=_ymin) && (y<=_ymax) &&
75 (z>=_zmin) && (z<=_zmax);
80 return (c[0]>=_xmin) && (c[0]<=_xmax) &&
81 (c[1]>=_ymin) && (c[1]<=_ymax) &&
82 (c[2]>=_zmin) && (c[2]<=_zmax);
88 return (v.
x() >= _xmin) && (v.
x() <=_xmax) &&
89 (v.
y()>=_ymin) && (v.
y()<=_ymax) &&
90 (v.
z()>=_zmin) && (v.
z()<=_zmax);
110 vector3 _xAxis, _yAxis, _zAxis;
118 if (_ival)
delete [] _ival;
123 void Init(
OBMol &box,
double spacing,
double pad=0.0);
184 v.
Set(_midx,_midy,_midz);
207 void SetNumberOfPoints(
int nx,
int ny,
int nz);
224 void SetLimits(
const double origin[3],
const double x[3],
const double y[3],
228 std::vector<double> GetDataVector();
232 void SetVals(
const std::vector<double> & vals);
243 if (i*_ydim*_zdim + j*_zdim + k > _xdim*_ydim*_zdim)
246 return _values[i*_ydim*_zdim + j*_zdim + k];
253 for (
int i = 0; i < _xdim*_ydim*_zdim; ++i)
260 if (i*_ydim*_zdim + j*_zdim + k > _xdim*_ydim*_zdim)
263 _values[i*_ydim*_zdim + j*_zdim + k] = val;
270 return vector3(_midx,_midy,_midz);
277 double Inject(
double x,
double y,
double z);
278 void IndexToCoords(
int idx,
double &x,
double &y,
double &z);
279 void CoordsToIndex(
int*,
double*);
280 int CoordsToIndex(
double x,
double y,
double z);
282 double Interpolate(
double,
double,
double);
284 double InterpolateDerivatives(
double,
double,
double,
double *derivatives);
288 #define OBPolarGrid 0x01 292 #define OBLipoGrid 0x02 304 std::vector<std::vector<int> >
cell;
314 void Setup(
OBMol &mol,
OBMol &box,
double cutoff,
double resolution = 0.5);
315 void Setup(
OBMol &mol,
OBMol &box,
double cutoff,
316 std::vector<bool> &use,
double resolution = 0.5);
317 std::vector<int> *GetProxVector(
double,
double,
double);
318 std::vector<int> *GetProxVector(
double*);
322 return((_gridtype&
OBLipoGrid) ?
true :
false);
330 _gridtype = gridtype;
354 void SetType(score_t type) { gridtype = type; }
358 virtual double Eval(
double *) {
return -1; }
363 virtual void Setup(std::vector<int> &) {}
365 virtual bool Read(std::string) {
return false; }
366 virtual bool Write(std::string) {
return false; }
const vector3 VZero
The zero vector: <0.0, 0.0, 0.0>
double _halfSpace
Definition: grid.h:109
double score
Definition: grid.h:348
double GetHalfSpace() const
Definition: grid.h:163
double GetYmax() const
Definition: grid.h:66
virtual void Setup(OBMol &, std::vector< int > &)
Definition: grid.h:362
std::vector< std::vector< int > > cell
Definition: grid.h:304
double GetXmin() const
Definition: grid.h:58
double GetSpacing() const
Definition: grid.h:152
void GetMax(double *a)
Definition: grid.h:144
OBScoreGrid(void)
Definition: grid.h:350
A base grid class.
Definition: grid.h:44
~OBFloatGrid()
Definition: grid.h:116
vector3 GetMax()
Definition: grid.h:139
~OBProxGrid()
Definition: grid.h:312
Base classes to build a graph.
void Set(const double inX, const double inY, const double inZ)
Set x,y and z-component of a vector.
Definition: vector3.h:87
int GetYdim() const
Definition: grid.h:167
score_t gridtype
Definition: grid.h:343
virtual void Setup(OBMol &)
Definition: grid.h:361
double _midz
Definition: grid.h:106
int GetXdim() const
Definition: grid.h:165
vector3 GetXAxis() const
Definition: grid.h:189
virtual void Setup(std::vector< int > &)
Definition: grid.h:363
void GetSpacing(double &s)
Definition: grid.h:156
virtual void Config(std::string)
Definition: grid.h:364
double GetValue(int i, int j, int k)
Definition: grid.h:241
std::vector< double > _values
floating point values
Definition: grid.h:104
const double & x() const
Access function to get the x-coordinate of the vector.
Definition: vector3.h:237
Handle double precision floating point 3D grids (e.g., charge density around an OBMol) ...
Definition: grid.h:101
Molecule Class.
Definition: mol.h:118
virtual void Init(OBMol &, OBMol &, std::string &, double)
Definition: grid.h:360
void GetDim(int *a)
Definition: grid.h:173
int _gridtype
Definition: grid.h:301
int _zdim
grid dimensions
Definition: grid.h:107
score_t GetType(void)
Definition: grid.h:355
double _spacing
Definition: grid.h:108
Handle molecules. Declarations of OBMol, OBAtom, OBBond, OBResidue. (the main header for Open Babel) ...
bool SetValue(int i, int j, int k, double val)
Set the value at the grid point specified by i, j and k to val.
Definition: grid.h:258
virtual void Clear(void)
Definition: grid.h:357
void SetVals(double *ptr)
Definition: grid.h:251
int _nzinc
Definition: grid.h:302
virtual double Eval(double *)
Definition: grid.h:358
double * GetVals()
Definition: grid.h:238
virtual vector3 Center()
Definition: grid.h:367
bool LipoGrid()
Definition: grid.h:320
vector3 Center()
Definition: grid.h:268
int * _ival
for integer values (deprecated)
Definition: grid.h:105
vector3 GetYAxis() const
Definition: grid.h:195
bool PolarGrid()
Definition: grid.h:324
virtual bool Read(std::string)
Definition: grid.h:365
vector3 GetMidpointVector()
Definition: grid.h:181
const double & y() const
Access function to get the y-coordinate of the vector.
Definition: vector3.h:242
double GetScale() const
Definition: grid.h:161
virtual double Eval(OBMol &mol)
Definition: grid.h:359
void SetVerbose(bool v)
Definition: grid.h:353
Represents a vector in 3-dimensional real space.
Definition: vector3.h:44
virtual bool Write(std::string)
Definition: grid.h:366
vector3 GetZAxis() const
Definition: grid.h:201
bool PointIsInBox(double x, double y, double z)
Definition: grid.h:71
bool PointIsInBox(double *c)
Definition: grid.h:78
double _inc
Definition: grid.h:303
double GetXmax() const
Definition: grid.h:64
bool PointIsInBox(vector3 v)
Definition: grid.h:86
std::ostream & operator<<(std::ostream &, const vector3 &)
Prints a representation of the vector as a row vector of the form "<0.1,1,2>".
Definition: vector3.cpp:109
std::istream & operator>>(std::istream &is, OBBitVec &bv)
Definition: bitvec.cpp:592
void SetGridType(int gridtype)
Definition: grid.h:328
void GetMin(double *a)
Definition: grid.h:131
virtual vector3 CenterMol(OBMol &)
Definition: grid.h:368
double * GetCoordinates()
Definition: mol.h:325
virtual ~OBScoreGrid(void)
Definition: grid.h:351
void SetType(score_t type)
Definition: grid.h:354
score_t
Definition: grid.h:335
bool verbose
Definition: grid.h:344
double GetYmin() const
Definition: grid.h:60
A base class for scoring docking interactions between multiple molecules.
Definition: grid.h:340
const double & z() const
Access function to get the z-coordinate of the vector.
Definition: vector3.h:247
#define OBPolarGrid
Definition: grid.h:288
double GetZmax() const
Definition: grid.h:68
OBFloatGrid()
Definition: grid.h:115
double GetZmin() const
Definition: grid.h:62
#define OBLipoGrid
Definition: grid.h:292
Base Class.
Definition: base.h:239
double _zmin
Definition: grid.h:47
A grid for determining the proximity of a given point to atoms in an OBMol.
Definition: grid.h:298
OBGrid()
Definition: grid.h:50
vector3 GetMin()
Definition: grid.h:126
OBProxGrid(int gridtype=0)
Definition: grid.h:308
int GetZdim() const
Definition: grid.h:169
Global namespace for all Open Babel code.
Definition: alias.h:22