Chemical Data Processing Library C++ API - Version 1.2.0
TorsionRuleMatcher.hpp
Go to the documentation of this file.
1 /*
2  * TorsionRuleMatcher.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_CONFGEN_TORSIONRULEMATCHER_HPP
30 #define CDPL_CONFGEN_TORSIONRULEMATCHER_HPP
31 
32 #include <vector>
33 
38 
39 
40 namespace CDPL
41 {
42 
43  namespace ConfGen
44  {
45 
47  {
48 
49  typedef std::vector<TorsionRuleMatch> RuleMatchList;
50 
51  public:
52  typedef RuleMatchList::const_iterator ConstMatchIterator;
53 
55 
57 
58  void findUniqueMappingsOnly(bool unique);
59 
60  bool findUniqueMappingsOnly() const;
61 
62  void findAllRuleMappings(bool all);
63 
64  bool findAllRuleMappings() const;
65 
66  void stopAtFirstMatchingRule(bool stop);
67 
69 
71 
73 
78  std::size_t getNumMatches() const;
79 
86  const TorsionRuleMatch& getMatch(std::size_t idx) const;
87 
93 
99 
105 
111 
112  bool findMatches(const Chem::Bond& bond, const Chem::MolecularGraph& molgraph, bool append = false);
113 
114  private:
115  bool findMatchingRules(const TorsionCategory& tor_cat, const Chem::Bond& bond, const Chem::MolecularGraph& molgraph);
116  bool getRuleMatches(const TorsionRule& rule, const Chem::Bond& bond, const Chem::MolecularGraph& molgraph);
117  bool matchesCategory(const TorsionCategory& tor_cat, const Chem::Bond& bond, const Chem::MolecularGraph& molgraph);
118 
119  void outputMatch(const Chem::AtomBondMapping& ab_mapping, const Chem::Bond& bond, const TorsionRule& rule);
120 
121  std::size_t getCentralBondIndex(const Chem::MolecularGraph& ptn) const;
122 
124  Chem::SubstructureSearch subSearch;
125  bool uniqueMappingsOnly;
126  bool stopAtFirstRule;
127  RuleMatchList matches;
128  };
129  } // namespace ConfGen
130 } // namespace CDPL
131 
132 #endif // CDPL_CONFGEN_TORSIONRULEMATCHER_HPP
Definition of the preprocessor macro CDPL_CONFGEN_API.
#define CDPL_CONFGEN_API
Tells the compiler/linker which classes, functions and variables are part of the library API.
Definition of the class CDPL::Chem::SubstructureSearch.
Definition of the class CDPL::ConfGen::TorsionLibrary.
Definition of the class CDPL::ConfGen::TorsionRuleMatch.
A data structure for the common storage of related atom to atom and bond to bond mappings.
Definition: AtomBondMapping.hpp:55
Bond.
Definition: Bond.hpp:50
MolecularGraph.
Definition: MolecularGraph.hpp:52
SubstructureSearch.
Definition: SubstructureSearch.hpp:64
Definition: TorsionCategory.hpp:49
std::shared_ptr< TorsionLibrary > SharedPointer
Definition: TorsionLibrary.hpp:49
Definition: TorsionRuleMatch.hpp:55
Definition: TorsionRuleMatcher.hpp:47
ConstMatchIterator getMatchesBegin() const
Returns a constant iterator pointing to the beginning of the stored torsion rule matches.
ConstMatchIterator getMatchesEnd() const
Returns a constant iterator pointing to the end of the stored torsion rule matches.
const TorsionRuleMatch & getMatch(std::size_t idx) const
Returns a const reference to the stored torsion rule match object at index idx.
bool findMatches(const Chem::Bond &bond, const Chem::MolecularGraph &molgraph, bool append=false)
void findUniqueMappingsOnly(bool unique)
void setTorsionLibrary(const TorsionLibrary::SharedPointer &lib)
void stopAtFirstMatchingRule(bool stop)
RuleMatchList::const_iterator ConstMatchIterator
Definition: TorsionRuleMatcher.hpp:52
ConstMatchIterator end() const
Returns a constant iterator pointing to the end of the stored torsion rule matches.
TorsionRuleMatcher(const TorsionLibrary::SharedPointer &lib)
ConstMatchIterator begin() const
Returns a constant iterator pointing to the beginning of the stored torsion rule matches.
const TorsionLibrary::SharedPointer & getTorsionLibrary() const
std::size_t getNumMatches() const
Returns the number of stored torsion rule matches found by calls to findMatches().
Definition: TorsionRule.hpp:47
The namespace of the Chemical Data Processing Library.