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 
31  private:
32  std::string _msg;
33 };
34 
35 //! Virtual base class for a grid object
36 class Grid3D {
37  public:
38  virtual ~Grid3D(){};
39  virtual int getGridPointIndex(const Point3D &point) const = 0;
40  virtual int getVal(const Point3D &point) const = 0;
41  virtual void setVal(const Point3D &point, unsigned int val) = 0;
42 
43  virtual Point3D getGridPointLoc(unsigned int pointId) const = 0;
44  virtual unsigned int getVal(unsigned int pointId) const = 0;
45  virtual void setVal(unsigned int pointId, unsigned int val) = 0;
46 
47  virtual unsigned int getSize() const = 0;
48 
49  virtual const RDKit::DiscreteValueVect *getOccupancyVect() const = 0;
50 };
51 }
52 
53 #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:36
a class for efficiently storing vectors of discrete values
virtual ~Grid3D()
Definition: Grid3D.h:38
Includes a bunch of functionality for handling Atom and Bond queries.
Definition: Atom.h:29
GridException(const char *msg)
construct with an error message
Definition: Grid3D.h:24