Chemical Data Processing Library C++ API - Version 1.2.0
Chem/BondFunctions.hpp
Go to the documentation of this file.
1 /*
2  * BondFunctions.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_BONDFUNCTIONS_HPP
30 #define CDPL_CHEM_BONDFUNCTIONS_HPP
31 
32 #include <cstddef>
33 #include <string>
34 
35 #include "CDPL/Chem/APIPrefix.hpp"
40 
41 
42 namespace CDPL
43 {
44 
45  namespace Chem
46  {
47 
48  class StereoDescriptor;
49 
50  CDPL_CHEM_API std::size_t getOrder(const Bond& bond);
51 
52  CDPL_CHEM_API void setOrder(Bond& bond, std::size_t order);
53 
55 
56  CDPL_CHEM_API bool hasOrder(const Bond& bond);
57 
58 
59  CDPL_CHEM_API bool getRingFlag(const Bond& bond);
60 
61  CDPL_CHEM_API void setRingFlag(Bond& bond, bool in_ring);
62 
64 
65  CDPL_CHEM_API bool hasRingFlag(const Bond& bond);
66 
67 
68  CDPL_CHEM_API bool isInFragmentOfSize(const Bond& bond, const FragmentList& frag_list, std::size_t size);
69 
70  CDPL_CHEM_API std::size_t getSizeOfSmallestContainingFragment(const Bond& bond, const FragmentList& frag_list);
71 
72  CDPL_CHEM_API std::size_t getSizeOfLargestContainingFragment(const Bond& bond, const FragmentList& frag_list);
73 
74  CDPL_CHEM_API std::size_t getNumContainingFragments(const Bond& bond, const FragmentList& frag_list);
75 
76  CDPL_CHEM_API void getContainingFragments(const Bond& bond, const FragmentList& frag_list, FragmentList& cont_frag_list, bool append = false);
77 
78 
80 
81  CDPL_CHEM_API void setAromaticityFlag(Bond& bond, bool aromatic);
82 
84 
86 
87 
88  CDPL_CHEM_API unsigned int get2DStereoFlag(const Bond& bond);
89 
90  CDPL_CHEM_API void set2DStereoFlag(Bond& bond, unsigned int flag);
91 
93 
94  CDPL_CHEM_API bool has2DStereoFlag(const Bond& bond);
95 
96 
97  CDPL_CHEM_API unsigned int getCIPConfiguration(const Bond& bond);
98 
99  CDPL_CHEM_API void setCIPConfiguration(Bond& bond, unsigned int config);
100 
102 
104 
105 
107 
109 
111 
113 
114  CDPL_CHEM_API StereoDescriptor calcStereoDescriptor(const Bond& bond, const MolecularGraph& molgraph, std::size_t dim = 1);
115 
116  CDPL_CHEM_API unsigned int calcConfiguration(const Bond& bond, const MolecularGraph& molgraph, const StereoDescriptor& descr,
117  const Math::Vector3DArray& coords);
118 
119 
121 
122  CDPL_CHEM_API void setStereoCenterFlag(Bond& bond, bool is_center);
123 
125 
127 
128  CDPL_CHEM_API bool isStereoCenter(const Bond& bond, const MolecularGraph& molgraph, bool check_asym = true,
129  bool check_term_n = true, bool check_order = true, std::size_t min_ring_size = 8);
130 
131 
132  CDPL_CHEM_API unsigned int getDirection(const Bond& bond);
133 
134  CDPL_CHEM_API void setDirection(Bond& bond, unsigned int dir);
135 
137 
138  CDPL_CHEM_API bool hasDirection(const Bond& bond);
139 
140 
141  CDPL_CHEM_API unsigned int getReactionCenterStatus(const Bond& bond);
142 
143  CDPL_CHEM_API void setReactionCenterStatus(Bond& bond, unsigned int status);
144 
146 
148 
149 
151 
153 
155 
157 
158 
160 
162 
164 
166 
168 
169 
170  CDPL_CHEM_API const std::string& getMatchExpressionString(const Bond& bond);
171 
172  CDPL_CHEM_API void setMatchExpressionString(Bond& bond, const std::string& expr_str);
173 
175 
177 
178  CDPL_CHEM_API void generateMatchExpressionString(const Bond& bond, const MolecularGraph& molgraph, std::string& str);
179 
180 
181  CDPL_CHEM_API unsigned int getSybylType(const Bond& bond);
182 
183  CDPL_CHEM_API void setSybylType(Bond& bond, unsigned int type);
184 
186 
187  CDPL_CHEM_API bool hasSybylType(const Bond& bond);
188 
189  CDPL_CHEM_API unsigned int perceiveSybylType(const Bond& bond, const MolecularGraph& molgraph);
190  } // namespace Chem
191 } // namespace CDPL
192 
193 #endif // CDPL_CHEM_BONDFUNCTIONS_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 the class CDPL::Chem::FragmentList.
Definition of the class CDPL::Chem::MatchConstraintList.
Definition of the class CDPL::Chem::MatchExpression.
Definition of the class CDPL::Math::VectorArray.
Bond.
Definition: Bond.hpp:50
A data type for the storage of Chem::Fragment objects.
Definition: FragmentList.hpp:49
std::shared_ptr< MatchConstraintList > SharedPointer
A reference-counted smart pointer [SHPTR] for dynamically allocated MatchConstraintList instances.
Definition: MatchConstraintList.hpp:197
A generic boolean expression interface for the implementation of query/target object equivalence test...
Definition: MatchExpression.hpp:75
MolecularGraph.
Definition: MolecularGraph.hpp:52
A data structure for the storage and retrieval of stereochemical information about atoms and bonds.
Definition: StereoDescriptor.hpp:102
CDPL_CHEM_API void setOrder(Bond &bond, std::size_t order)
CDPL_CHEM_API std::size_t getSizeOfSmallestContainingFragment(const Atom &atom, const FragmentList &frag_list)
CDPL_CHEM_API bool has2DStereoFlag(const Bond &bond)
CDPL_CHEM_API void setRingFlag(Atom &atom, bool in_ring)
CDPL_CHEM_API void clear2DStereoFlag(Bond &bond)
CDPL_CHEM_API bool getAromaticityFlag(const Atom &atom)
CDPL_CHEM_API unsigned int getDirection(const Bond &bond)
CDPL_CHEM_API void clearRingFlag(Atom &atom)
CDPL_CHEM_API void clearMatchExpression(Atom &atom)
CDPL_CHEM_API void getContainingFragments(const Atom &atom, const FragmentList &frag_list, FragmentList &cont_frag_list, bool append=false)
CDPL_CHEM_API std::size_t getOrder(const Bond &bond)
CDPL_CHEM_API void clearOrder(Bond &bond)
CDPL_CHEM_API const MatchConstraintList::SharedPointer & getMatchConstraints(const Atom &atom)
CDPL_CHEM_API bool getRingFlag(const Atom &atom)
CDPL_CHEM_API bool hasDirection(const Bond &bond)
CDPL_CHEM_API unsigned int calcConfiguration(const Atom &atom, const MolecularGraph &molgraph, const StereoDescriptor &descr, const Math::Vector3DArray &coords)
CDPL_CHEM_API bool hasReactionCenterStatus(const Atom &atom)
CDPL_CHEM_API void setSybylType(Atom &atom, unsigned int type)
CDPL_CHEM_API void clearStereoCenterFlag(Atom &atom)
CDPL_CHEM_API void clearReactionCenterStatus(Atom &atom)
CDPL_CHEM_API void clearCIPConfiguration(Atom &atom)
CDPL_CHEM_API std::size_t getNumContainingFragments(const Atom &atom, const FragmentList &frag_list)
CDPL_CHEM_API void setMatchExpression(Atom &atom, const MatchExpression< Atom, MolecularGraph >::SharedPointer &expr)
CDPL_CHEM_API bool hasStereoCenterFlag(const Atom &atom)
CDPL_CHEM_API unsigned int perceiveSybylType(const Atom &atom, const MolecularGraph &molgraph)
CDPL_CHEM_API void clearStereoDescriptor(Atom &atom)
CDPL_CHEM_API unsigned int getSybylType(const Atom &atom)
CDPL_CHEM_API bool hasCIPConfiguration(const Atom &atom)
CDPL_CHEM_API std::size_t getSizeOfLargestContainingFragment(const Atom &atom, const FragmentList &frag_list)
CDPL_CHEM_API MatchExpression< Atom, MolecularGraph >::SharedPointer generateMatchExpression(const Atom &atom, const MolecularGraph &molgraph)
CDPL_CHEM_API const MatchExpression< Atom, MolecularGraph >::SharedPointer & getMatchExpression(const Atom &atom)
CDPL_CHEM_API void setAromaticityFlag(Atom &atom, bool aromatic)
CDPL_CHEM_API void setStereoCenterFlag(Atom &atom, bool is_center)
CDPL_CHEM_API void setCIPConfiguration(Atom &atom, unsigned int config)
CDPL_CHEM_API StereoDescriptor calcStereoDescriptor(const Atom &atom, const MolecularGraph &molgraph, std::size_t dim=1)
CDPL_CHEM_API void setReactionCenterStatus(Atom &atom, unsigned int status)
CDPL_CHEM_API const StereoDescriptor & getStereoDescriptor(const Atom &atom)
CDPL_CHEM_API void generateMatchExpressionString(const Atom &atom, const MolecularGraph &molgraph, std::string &expr_str)
CDPL_CHEM_API void clearAromaticityFlag(Atom &atom)
CDPL_CHEM_API void setDirection(Bond &bond, unsigned int dir)
CDPL_CHEM_API bool isStereoCenter(const Atom &atom, const MolecularGraph &molgraph, bool check_asym=true, bool check_inv_n=true, bool check_quart_n=true, bool check_plan_n=true, bool check_amide_n=true, bool check_res_ctrs=true)
CDPL_CHEM_API void clearSybylType(Atom &atom)
CDPL_CHEM_API void setMatchConstraints(Atom &atom, const MatchConstraintList::SharedPointer &constr)
CDPL_CHEM_API bool hasOrder(const Bond &bond)
CDPL_CHEM_API void setStereoDescriptor(Atom &atom, const StereoDescriptor &descr)
CDPL_CHEM_API const std::string & getMatchExpressionString(const Atom &atom)
CDPL_CHEM_API bool hasMatchExpressionString(const Atom &atom)
CDPL_CHEM_API bool hasRingFlag(const Atom &atom)
CDPL_CHEM_API bool hasMatchExpression(const Atom &atom)
CDPL_CHEM_API bool hasStereoDescriptor(const Atom &atom)
CDPL_CHEM_API void clearDirection(Bond &bond)
CDPL_CHEM_API void clearMatchConstraints(Atom &atom)
CDPL_CHEM_API bool hasMatchConstraints(const Atom &atom)
CDPL_CHEM_API bool getStereoCenterFlag(const Atom &atom)
CDPL_CHEM_API void set2DStereoFlag(Bond &bond, unsigned int flag)
CDPL_CHEM_API bool hasAromaticityFlag(const Atom &atom)
CDPL_CHEM_API unsigned int getReactionCenterStatus(const Atom &atom)
CDPL_CHEM_API void setMatchExpressionString(Atom &atom, const std::string &expr_str)
CDPL_CHEM_API bool isInFragmentOfSize(const Atom &atom, const FragmentList &frag_list, std::size_t size)
CDPL_CHEM_API void clearMatchExpressionString(Atom &atom)
CDPL_CHEM_API bool hasSybylType(const Atom &atom)
CDPL_CHEM_API unsigned int get2DStereoFlag(const Bond &bond)
CDPL_CHEM_API unsigned int getCIPConfiguration(const Atom &atom)
VectorArray< Vector3D > Vector3DArray
An array of Math::Vector3D objects.
Definition: VectorArray.hpp:84
The namespace of the Chemical Data Processing Library.