Chemical Data Processing Library C++ API - Version 1.4.0
ConjugatedRingBondPatternSwitching.hpp
Go to the documentation of this file.
1 /*
2  * ConjugatedRingBondPatternSwitching.hpp
3  *
4  * This file is part of the Chemical Data Processing Toolkit
5  *
6  * Copyright (C) 2003 Thomas Seidel <thomas.seidel@univie.ac.at>
7  *
8  * This library is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Lesser General Public
10  * License as published by the Free Software Foundation; either
11  * version 2 of the License, or (at your option) any later version.
12  *
13  * This library is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16  * Lesser General Public License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public License
19  * along with this library; see the file COPYING. If not, write to
20  * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
21  * Boston, MA 02111-1307, USA.
22  */
23 
29 #ifndef CDPL_CHEM_CONJUGATEDRINGBONDPATTERNSWITCHING_HPP
30 #define CDPL_CHEM_CONJUGATEDRINGBONDPATTERNSWITCHING_HPP
31 
32 #include <memory>
33 #include <vector>
34 #include <cstddef>
35 
36 #include "CDPL/Chem/APIPrefix.hpp"
38 #include "CDPL/Chem/Fragment.hpp"
39 
40 
41 namespace CDPL
42 {
43 
44  namespace Chem
45  {
46 
53  {
54 
55  public:
57  typedef std::shared_ptr<ConjugatedRingBondPatternSwitching> SharedPointer;
58 
64  bool setup(MolecularGraph& parent_molgraph);
65 
70  unsigned int getID() const;
71 
77  bool generate(Molecule& tautomer);
78 
84 
85  private:
86  typedef std::vector<Fragment::SharedPointer> RingList;
87 
88  bool isConjugated(const Fragment& ring) const;
89  bool hasHeteroSubstituent(const Atom& atom, const Fragment& ring) const;
90 
91  void flipBondOrders(Molecule& tautomer, const Fragment& ring) const;
92 
93  const MolecularGraph* parentMolGraph;
94  RingList conjRings;
95  std::size_t currRingIdx;
96  };
97  } // namespace Chem
98 } // namespace CDPL
99 
100 #endif // CDPL_CHEM_CONJUGATEDRINGBONDPATTERNSWITCHING_HPP
Definition of the preprocessor macro CDPL_CHEM_API.
#define CDPL_CHEM_API
Tells the compiler/linker which classes, functions and variables are part of the library API.
Definition of class CDPL::Chem::Fragment.
Definition of class CDPL::Chem::TautomerizationRule.
Abstract base class representing a chemical atom and its bonded neighborhood.
Definition: Atom.hpp:57
Chem::TautomerizationRule implementation that enumerates tautomers obtained by switching the single/d...
Definition: ConjugatedRingBondPatternSwitching.hpp:53
bool setup(MolecularGraph &parent_molgraph)
Sets the parent molecular graph and identifies its conjugated rings for tautomer enumeration.
std::shared_ptr< ConjugatedRingBondPatternSwitching > SharedPointer
A reference-counted smart pointer [SHPTR] for dynamically allocated ConjugatedRingBondPatternSwitchin...
Definition: ConjugatedRingBondPatternSwitching.hpp:57
unsigned int getID() const
Returns the rule's identifier (Chem::TautomerizationType::CONJ_RING_BOND_SWITCH).
bool generate(Molecule &tautomer)
Generates the next bond-pattern-switched tautomer.
TautomerizationRule::SharedPointer clone() const
Returns a deep copy of this rule instance.
Concrete Chem::MolecularGraph implementation that stores references to a selectable subset of atoms a...
Definition: Fragment.hpp:57
Abstract base class for representations of a chemical structure as a graph of bonded atoms.
Definition: MolecularGraph.hpp:57
Abstract base class representing a mutable molecular graph that owns its atoms and bonds.
Definition: Molecule.hpp:53
Abstract base class for all tautomerization rule implementations used by the Chem::TautomerGenerator.
Definition: TautomerizationRule.hpp:50
std::shared_ptr< TautomerizationRule > SharedPointer
A reference-counted smart pointer [SHPTR] for dynamically allocated TautomerizationRule instances.
Definition: TautomerizationRule.hpp:54
The namespace of the Chemical Data Processing Library.