Chemical Data Processing Library C++ API - Version 1.1.1
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
CDPL::ConfGen::TorsionRuleMatcher::TorsionRuleMatcher
TorsionRuleMatcher()
CDPL::ConfGen::TorsionRuleMatcher::findAllRuleMappings
void findAllRuleMappings(bool all)
CDPL::Chem::Bond
Bond.
Definition: Bond.hpp:50
CDPL::Chem::SubstructureSearch
SubstructureSearch.
Definition: SubstructureSearch.hpp:64
CDPL::ConfGen::TorsionRuleMatcher::findAllRuleMappings
bool findAllRuleMappings() const
CDPL::ConfGen::TorsionRuleMatcher
Definition: TorsionRuleMatcher.hpp:47
CDPL::ConfGen::TorsionRule
Definition: TorsionRule.hpp:47
CDPL::ConfGen::TorsionRuleMatcher::TorsionRuleMatcher
TorsionRuleMatcher(const TorsionLibrary::SharedPointer &lib)
CDPL::ConfGen::TorsionRuleMatcher::findMatches
bool findMatches(const Chem::Bond &bond, const Chem::MolecularGraph &molgraph, bool append=false)
CDPL::Chem::MolecularGraph
MolecularGraph.
Definition: MolecularGraph.hpp:52
CDPL::ConfGen::TorsionLibrary::SharedPointer
std::shared_ptr< TorsionLibrary > SharedPointer
Definition: TorsionLibrary.hpp:49
CDPL::ConfGen::TorsionRuleMatcher::stopAtFirstMatchingRule
void stopAtFirstMatchingRule(bool stop)
CDPL::ConfGen::TorsionRuleMatcher::stopAtFirstMatchingRule
bool stopAtFirstMatchingRule() const
CDPL::ConfGen::TorsionRuleMatch
Definition: TorsionRuleMatch.hpp:55
CDPL::ConfGen::TorsionRuleMatcher::findUniqueMappingsOnly
void findUniqueMappingsOnly(bool unique)
CDPL::ConfGen::TorsionRuleMatcher::ConstMatchIterator
RuleMatchList::const_iterator ConstMatchIterator
Definition: TorsionRuleMatcher.hpp:52
APIPrefix.hpp
Definition of the preprocessor macro CDPL_CONFGEN_API.
TorsionRuleMatch.hpp
Definition of the class CDPL::ConfGen::TorsionRuleMatch.
CDPL::ConfGen::TorsionRuleMatcher::begin
ConstMatchIterator begin() const
Returns a constant iterator pointing to the beginning of the stored torsion rule matches.
CDPL_CONFGEN_API
#define CDPL_CONFGEN_API
Tells the compiler/linker which classes, functions and variables are part of the library API.
CDPL::ConfGen::TorsionCategory
Definition: TorsionCategory.hpp:48
CDPL::ConfGen::TorsionRuleMatcher::getNumMatches
std::size_t getNumMatches() const
Returns the number of stored torsion rule matches found by calls to findMatches().
CDPL
The namespace of the Chemical Data Processing Library.
CDPL::ConfGen::TorsionRuleMatcher::getMatchesEnd
ConstMatchIterator getMatchesEnd() const
Returns a constant iterator pointing to the end of the stored torsion rule matches.
CDPL::Chem::AtomBondMapping
A data structure for the common storage of related atom to atom and bond to bond mappings.
Definition: AtomBondMapping.hpp:55
SubstructureSearch.hpp
Definition of the class CDPL::Chem::SubstructureSearch.
CDPL::ConfGen::TorsionRuleMatcher::end
ConstMatchIterator end() const
Returns a constant iterator pointing to the end of the stored torsion rule matches.
TorsionLibrary.hpp
Definition of the class CDPL::ConfGen::TorsionLibrary.
CDPL::ConfGen::TorsionRuleMatcher::setTorsionLibrary
void setTorsionLibrary(const TorsionLibrary::SharedPointer &lib)
CDPL::ConfGen::TorsionRuleMatcher::findUniqueMappingsOnly
bool findUniqueMappingsOnly() const
CDPL::ConfGen::TorsionRuleMatcher::getMatchesBegin
ConstMatchIterator getMatchesBegin() const
Returns a constant iterator pointing to the beginning of the stored torsion rule matches.
CDPL::ConfGen::TorsionRuleMatcher::getTorsionLibrary
const TorsionLibrary::SharedPointer & getTorsionLibrary() const
CDPL::ConfGen::TorsionRuleMatcher::getMatch
const TorsionRuleMatch & getMatch(std::size_t idx) const
Returns a const reference to the stored torsion rule match object at index idx.