Chemical Data Processing Library C++ API - Version 1.1.1
TorsionRule.hpp
Go to the documentation of this file.
1 /*
2  * TorsionRule.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_TORSIONRULE_HPP
30 #define CDPL_CONFGEN_TORSIONRULE_HPP
31 
32 #include <vector>
33 #include <cstddef>
34 #include <string>
35 
38 
39 
40 namespace CDPL
41 {
42 
43  namespace ConfGen
44  {
45 
47  {
48 
49  public:
50  class AngleEntry;
51 
52  private:
53  typedef std::vector<AngleEntry> AngleEntryList;
54 
55  public:
56  class AngleEntry
57  {
58 
59  public:
60  AngleEntry(double ang, double tol1 = 0.0, double tol2 = 0.0, double score = 0.0):
61  angle(ang), tolerance1(tol1), tolerance2(tol2), score(score) {}
62 
63  double getAngle() const
64  {
65  return angle;
66  }
67 
68  double getTolerance1() const
69  {
70  return tolerance1;
71  }
72 
73  double getTolerance2() const
74  {
75  return tolerance2;
76  }
77 
78  double getScore() const
79  {
80  return score;
81  }
82 
83  private:
84  double angle;
85  double tolerance1;
86  double tolerance2;
87  double score;
88  };
89 
90  typedef AngleEntryList::iterator AngleEntryIterator;
91  typedef AngleEntryList::const_iterator ConstAngleEntryIterator;
92 
93  const std::string& getMatchPatternString() const;
94 
95  void setMatchPatternString(const std::string& ptn_str);
96 
98 
100 
101  void addAngle(const AngleEntry& ang_entry);
102 
103  void addAngle(double angle, double tol1 = 0.0, double tol2 = 0.0, double score = 0.0);
104 
105  std::size_t getNumAngles() const;
106 
107  const AngleEntry& getAngle(std::size_t idx) const;
108 
109  void removeAngle(std::size_t idx);
110 
112 
114 
116 
118 
120 
122 
124 
126 
128 
129  void swap(TorsionRule& rule);
130 
131  void clear();
132 
133  private:
134  void checkAngleIndex(std::size_t idx, bool it) const;
135 
136  std::string matchPatternStr;
138  AngleEntryList angles;
139  };
140  } // namespace ConfGen
141 } // namespace CDPL
142 
143 #endif // CDPL_CONFGEN_TORSIONRULE_HPP
CDPL::ConfGen::TorsionRule::getAnglesBegin
ConstAngleEntryIterator getAnglesBegin() const
CDPL::Chem::MolecularGraph::SharedPointer
std::shared_ptr< MolecularGraph > SharedPointer
A reference-counted smart pointer [SHPTR] for dynamically allocated MolecularGraph instances.
Definition: MolecularGraph.hpp:58
CDPL::ConfGen::TorsionRule::addAngle
void addAngle(double angle, double tol1=0.0, double tol2=0.0, double score=0.0)
CDPL::ConfGen::TorsionRule::getMatchPatternString
const std::string & getMatchPatternString() const
CDPL::ConfGen::TorsionRule::setMatchPatternString
void setMatchPatternString(const std::string &ptn_str)
CDPL::ConfGen::TorsionRule::setMatchPattern
void setMatchPattern(const Chem::MolecularGraph::SharedPointer &ptn)
CDPL::ConfGen::TorsionRule::AngleEntry::getTolerance2
double getTolerance2() const
Definition: TorsionRule.hpp:73
CDPL::ConfGen::TorsionRule
Definition: TorsionRule.hpp:47
CDPL::ConfGen::TorsionRule::AngleEntry::getTolerance1
double getTolerance1() const
Definition: TorsionRule.hpp:68
CDPL::ConfGen::TorsionRule::getAnglesEnd
AngleEntryIterator getAnglesEnd()
CDPL::ConfGen::TorsionRule::AngleEntry::getScore
double getScore() const
Definition: TorsionRule.hpp:78
CDPL::ConfGen::TorsionRule::begin
ConstAngleEntryIterator begin() const
CDPL::ConfGen::TorsionRule::getMatchPattern
const Chem::MolecularGraph::SharedPointer & getMatchPattern() const
CDPL::ConfGen::TorsionRule::getNumAngles
std::size_t getNumAngles() const
CDPL::ConfGen::TorsionRule::AngleEntry
Definition: TorsionRule.hpp:57
CDPL::ConfGen::TorsionRule::removeAngle
void removeAngle(const AngleEntryIterator &it)
CDPL::ConfGen::TorsionRule::getAnglesEnd
ConstAngleEntryIterator getAnglesEnd() const
CDPL::ConfGen::TorsionRule::swap
void swap(TorsionRule &rule)
CDPL::ConfGen::TorsionRule::addAngle
void addAngle(const AngleEntry &ang_entry)
CDPL::ConfGen::TorsionRule::clear
void clear()
CDPL::ConfGen::TorsionRule::getAngle
const AngleEntry & getAngle(std::size_t idx) const
APIPrefix.hpp
Definition of the preprocessor macro CDPL_CONFGEN_API.
MolecularGraph.hpp
Definition of the class CDPL::Chem::MolecularGraph.
CDPL_CONFGEN_API
#define CDPL_CONFGEN_API
Tells the compiler/linker which classes, functions and variables are part of the library API.
CDPL::ConfGen::TorsionRule::removeAngle
void removeAngle(std::size_t idx)
CDPL::ConfGen::TorsionRule::getAnglesBegin
AngleEntryIterator getAnglesBegin()
CDPL
The namespace of the Chemical Data Processing Library.
CDPL::ConfGen::TorsionRule::begin
AngleEntryIterator begin()
CDPL::ConfGen::TorsionRule::AngleEntry::getAngle
double getAngle() const
Definition: TorsionRule.hpp:63
CDPL::ConfGen::TorsionRule::end
ConstAngleEntryIterator end() const
CDPL::ConfGen::TorsionRule::AngleEntry::AngleEntry
AngleEntry(double ang, double tol1=0.0, double tol2=0.0, double score=0.0)
Definition: TorsionRule.hpp:60
CDPL::ConfGen::TorsionRule::end
AngleEntryIterator end()
CDPL::ConfGen::TorsionRule::ConstAngleEntryIterator
AngleEntryList::const_iterator ConstAngleEntryIterator
Definition: TorsionRule.hpp:91
CDPL::ConfGen::TorsionRule::AngleEntryIterator
AngleEntryList::iterator AngleEntryIterator
Definition: TorsionRule.hpp:90