Grid3D.h

Go to the documentation of this file.
00001 // 
00002 //   Copyright (C) 2005-2006 Rational Discovery LLC
00003 //
00004 //   @@ All Rights Reserved @@
00005 //  This file is part of the RDKit.
00006 //  The contents are covered by the terms of the BSD license
00007 //  which is included in the file license.txt, found at the root
00008 //  of the RDKit source tree.
00009 //
00010 #ifndef _GRID3D_H_20050124_1113
00011 #define _GRID3D_H_20050124_1113
00012 #include <exception>
00013 #include <string>
00014 
00015 namespace RDKit {
00016   class DiscreteValueVect;
00017 }
00018 namespace RDGeom {
00019   class Point3D;
00020   
00021   class GridException : public std::exception {
00022   public:
00023     //! construct with an error message
00024     GridException(const char *msg) : _msg(msg) {};
00025     //! construct with an error message
00026     GridException(const std::string msg) : _msg(msg) {};
00027     //! get the error message
00028     const char *message () const { return _msg.c_str(); };
00029     ~GridException () throw () {};
00030   private:
00031     std::string _msg;
00032   };
00033   
00034   //! Virtual base class for a grid object
00035   class Grid3D {
00036   public:
00037     virtual ~Grid3D() {};
00038     virtual int getGridPointIndex(const Point3D &point) const = 0;
00039     virtual int getVal(const Point3D &point) const = 0;
00040     virtual void setVal(const Point3D &point, unsigned int val) = 0;
00041   
00042     virtual Point3D getGridPointLoc(unsigned int pointId) const = 0;
00043     virtual unsigned int getVal(unsigned int pointId) const = 0;
00044     virtual void setVal(unsigned int pointId, unsigned int val) = 0;
00045 
00046     virtual bool compareParams(const Grid3D &other) const {
00047       return false;
00048     };
00049 
00050     virtual unsigned int getSize() const = 0;
00051 
00052     virtual const RDKit::DiscreteValueVect *getOccupancyVect() const = 0;
00053   };
00054 }
00055 
00056 #endif