Chemical Data Processing Library C++ API - Version 1.2.0
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
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::MolecularGraph.
std::shared_ptr< MolecularGraph > SharedPointer
A reference-counted smart pointer [SHPTR] for dynamically allocated MolecularGraph instances.
Definition: MolecularGraph.hpp:58
Definition: TorsionRule.hpp:57
double getTolerance2() const
Definition: TorsionRule.hpp:73
double getTolerance1() const
Definition: TorsionRule.hpp:68
double getScore() const
Definition: TorsionRule.hpp:78
double getAngle() const
Definition: TorsionRule.hpp:63
AngleEntry(double ang, double tol1=0.0, double tol2=0.0, double score=0.0)
Definition: TorsionRule.hpp:60
Definition: TorsionRule.hpp:47
AngleEntryList::iterator AngleEntryIterator
Definition: TorsionRule.hpp:90
AngleEntryIterator begin()
void setMatchPatternString(const std::string &ptn_str)
void setMatchPattern(const Chem::MolecularGraph::SharedPointer &ptn)
ConstAngleEntryIterator getAnglesBegin() const
const std::string & getMatchPatternString() const
ConstAngleEntryIterator end() const
ConstAngleEntryIterator begin() const
AngleEntryList::const_iterator ConstAngleEntryIterator
Definition: TorsionRule.hpp:91
const Chem::MolecularGraph::SharedPointer & getMatchPattern() const
const AngleEntry & getAngle(std::size_t idx) const
AngleEntryIterator end()
AngleEntryIterator getAnglesBegin()
void removeAngle(const AngleEntryIterator &it)
void addAngle(double angle, double tol1=0.0, double tol2=0.0, double score=0.0)
void addAngle(const AngleEntry &ang_entry)
void removeAngle(std::size_t idx)
ConstAngleEntryIterator getAnglesEnd() const
void swap(TorsionRule &rule)
std::size_t getNumAngles() const
AngleEntryIterator getAnglesEnd()
The namespace of the Chemical Data Processing Library.