00001 // 00002 // Copyright (C) 2004-2006 Rational Discovery LLC 00003 // 00004 // @@ All Rights Reserved @@ 00005 // 00006 #ifndef __MOLCHEMICALFEATURE_H_11012005_1404__ 00007 #define __MOLCHEMICALFEATURE_H_11012005_1404__ 00008 00009 #include <string> 00010 #include <vector> 00011 #include <map> 00012 #include <Geometry/point.h> 00013 #include <ChemicalFeatures/ChemicalFeature.h> 00014 00015 namespace RDKit { 00016 class ROMol; 00017 class Atom; 00018 class MolChemicalFeatureFactory; 00019 class MolChemicalFeatureDef; 00020 00021 00022 class MolChemicalFeature : public ChemicalFeatures::ChemicalFeature { 00023 00024 friend class MolChemicalFeatureFactory; 00025 public: 00026 typedef std::vector<const Atom *> AtomPtrContainer; 00027 typedef AtomPtrContainer::const_iterator AtomPtrContainer_CI; 00028 00029 //! Constructor 00030 MolChemicalFeature(const ROMol *mol, 00031 const MolChemicalFeatureFactory *factory, 00032 const MolChemicalFeatureDef *fdef) : 00033 dp_mol(mol), dp_factory(factory), dp_def(fdef), d_activeConf(-1) {}; 00034 00035 ~MolChemicalFeature() {} 00036 00037 //! \brief return the name of the feature's family 00038 const std::string &getFamily() const; 00039 //! \brief return the name of the feature's type 00040 const std::string &getType() const; 00041 //! \brief return the position of the feature (obtained from 00042 //! from the associated conformation 00043 RDGeom::Point3D getPos() const; 00044 00045 //! \brief return the position of the feature (obtained from 00046 //! from the requested conformation from the associated molecule) 00047 RDGeom::Point3D getPos(int confId) const; 00048 //! \brief return a pointer to our feature factory 00049 const MolChemicalFeatureFactory *getFactory() const { return dp_factory; }; 00050 //! \brief return a pointer to our associated molecule 00051 const ROMol *getMol() const { return dp_mol; }; 00052 //! \brief return a pointer to our feature definition 00053 const MolChemicalFeatureDef *getFeatDef() const { return dp_def; }; 00054 00055 //! \brief returns the number of atoms defining the feature 00056 inline unsigned int getNumAtoms() const { 00057 return d_atoms.size(); 00058 } 00059 00060 //! \brief sets the active conformer (in the associated molecule) 00061 void setActiveConformer(int confId); 00062 00063 //! \brief returns the active conformer (in the associated molecule) 00064 int getActiveConformer() const { return d_activeConf;}; 00065 00066 //! \brief clears out the internal position cache 00067 void clearCache() { d_locs.clear(); }; 00068 00069 //! \brief returns our atom container of 00070 const AtomPtrContainer &getAtoms() const { 00071 return d_atoms; 00072 } 00073 AtomPtrContainer::const_iterator beginAtoms() const { return d_atoms.begin(); }; 00074 AtomPtrContainer::const_iterator endAtoms() const { return d_atoms.end(); }; 00075 00076 private: 00077 typedef std::map<int,RDGeom::Point3D> PointCacheType; 00078 const ROMol *dp_mol; 00079 const MolChemicalFeatureFactory *dp_factory; 00080 const MolChemicalFeatureDef *dp_def; 00081 //std::string d_type; 00082 //std::string d_family; 00083 00084 int d_activeConf; 00085 AtomPtrContainer d_atoms; 00086 mutable PointCacheType d_locs; 00087 }; 00088 00089 } 00090 00091 #endif
1.5.3