00001
00002
00003
00004
00005
00006 #ifndef _RD_RINGINFO_H
00007 #define _RD_RINGINFO_H
00008
00009 #include <map>
00010 #include <vector>
00011
00012 namespace RDKit {
00013
00014
00015
00016
00017 class RingInfo {
00018 public:
00019 typedef std::vector<int> MemberType;
00020 typedef std::vector<MemberType > DataType;
00021 typedef std::vector<int> INT_VECT;
00022 typedef std::vector< INT_VECT > VECT_INT_VECT;
00023
00024 RingInfo() : df_init(false) {};
00025 RingInfo(const RingInfo &other) : df_init(other.df_init),
00026 d_atomMembers(other.d_atomMembers),
00027 d_bondMembers(other.d_bondMembers),
00028 d_atomRings(other.d_atomRings),
00029 d_bondRings(other.d_bondRings) {};
00030
00031
00032
00033
00034
00035
00036
00037 bool isAtomInRingOfSize(unsigned int idx,unsigned int size) const;
00038
00039
00040
00041
00042
00043 unsigned int numAtomRings(unsigned int idx) const;
00044
00045
00046
00047
00048
00049 unsigned int minAtomRingSize(unsigned int idx) const;
00050
00051
00052
00053
00054
00055
00056
00057 bool isBondInRingOfSize(unsigned int idx,unsigned int size) const;
00058
00059
00060
00061
00062
00063 unsigned int numBondRings(unsigned int idx) const;
00064
00065
00066
00067
00068
00069 unsigned int minBondRingSize(unsigned int idx) const;
00070
00071
00072
00073
00074
00075
00076 unsigned int numRings() const;
00077
00078
00079
00080
00081
00082
00083 const VECT_INT_VECT &atomRings() const { return d_atomRings; };
00084
00085
00086
00087
00088
00089 const VECT_INT_VECT &bondRings() const { return d_bondRings; };
00090
00091
00092 bool isInitialized() const { return df_init; };
00093
00094 void initialize();
00095
00096
00097
00098
00099
00100
00101
00102
00103
00104
00105
00106
00107
00108 unsigned int addRing(const INT_VECT &atomIndices,const INT_VECT &bondIndices);
00109
00110
00111 void reset();
00112
00113
00114 void preallocate(unsigned int numAtoms,unsigned int numBonds);
00115
00116 private:
00117 bool df_init;
00118 DataType d_atomMembers,d_bondMembers;
00119 VECT_INT_VECT d_atomRings,d_bondRings;
00120 };
00121 }
00122
00123 #endif