RDKit
Open-source cheminformatics and machine learning.
Grid3D.h
Go to the documentation of this file.
1 //
2 // Copyright (C) 2005-2006 Rational Discovery LLC
3 //
4 // @@ All Rights Reserved @@
5 // This file is part of the RDKit.
6 // The contents are covered by the terms of the BSD license
7 // which is included in the file license.txt, found at the root
8 // of the RDKit source tree.
9 //
10 #ifndef _GRID3D_H_20050124_1113
11 #define _GRID3D_H_20050124_1113
12 #include <exception>
13 #include <string>
14 
15 namespace RDKit {
16  class DiscreteValueVect;
17 }
18 namespace RDGeom {
19  class Point3D;
20 
21  class GridException : public std::exception {
22  public:
23  //! construct with an error message
24  GridException(const char *msg) : _msg(msg) {};
25  //! construct with an error message
26  GridException(const std::string msg) : _msg(msg) {};
27  //! get the error message
28  const char *message () const { return _msg.c_str(); };
29  ~GridException () throw () {};
30  private:
31  std::string _msg;
32  };
33 
34  //! Virtual base class for a grid object
35  class Grid3D {
36  public:
37  virtual ~Grid3D() {};
38  virtual int getGridPointIndex(const Point3D &point) const = 0;
39  virtual int getVal(const Point3D &point) const = 0;
40  virtual void setVal(const Point3D &point, unsigned int val) = 0;
41 
42  virtual Point3D getGridPointLoc(unsigned int pointId) const = 0;
43  virtual unsigned int getVal(unsigned int pointId) const = 0;
44  virtual void setVal(unsigned int pointId, unsigned int val) = 0;
45 
46  virtual unsigned int getSize() const = 0;
47 
48  virtual const RDKit::DiscreteValueVect *getOccupancyVect() const = 0;
49  };
50 }
51 
52 #endif
const char * message() const
get the error message
Definition: Grid3D.h:28
GridException(const std::string msg)
construct with an error message
Definition: Grid3D.h:26
Virtual base class for a grid object.
Definition: Grid3D.h:35
a class for efficiently storing vectors of discrete values
virtual ~Grid3D()
Definition: Grid3D.h:37
Includes a bunch of functionality for handling Atom and Bond queries.
Definition: Atom.h:28
GridException(const char *msg)
construct with an error message
Definition: Grid3D.h:24