Chemical Data Processing Library C++ API - Version 1.0.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"
41 
42 
43 namespace CDPL
44 {
45 
46  namespace Chem
47  {
48 
49  class StereoDescriptor;
50 
51  CDPL_CHEM_API std::size_t getOrder(const Bond& bond);
52 
53  CDPL_CHEM_API void setOrder(Bond& bond, std::size_t order);
54 
56 
57  CDPL_CHEM_API bool hasOrder(const Bond& bond);
58 
59 
60  CDPL_CHEM_API bool getRingFlag(const Bond& bond);
61 
62  CDPL_CHEM_API void setRingFlag(Bond& bond, bool in_ring);
63 
65 
66  CDPL_CHEM_API bool hasRingFlag(const Bond& bond);
67 
68 
69  CDPL_CHEM_API bool isInFragmentOfSize(const Bond& bond, const FragmentList& frag_list, std::size_t size);
70 
71  CDPL_CHEM_API std::size_t getSizeOfSmallestContainingFragment(const Bond& bond, const FragmentList& frag_list);
72 
73  CDPL_CHEM_API std::size_t getSizeOfLargestContainingFragment(const Bond& bond, const FragmentList& frag_list);
74 
75  CDPL_CHEM_API std::size_t getNumContainingFragments(const Bond& bond, const FragmentList& frag_list);
76 
77  CDPL_CHEM_API void getContainingFragments(const Bond& bond, const FragmentList& frag_list, FragmentList& cont_frag_list, bool append = false);
78 
79 
81 
82  CDPL_CHEM_API void setAromaticityFlag(Bond& bond, bool aromatic);
83 
85 
87 
88 
89  CDPL_CHEM_API unsigned int get2DStereoFlag(const Bond& bond);
90 
91  CDPL_CHEM_API void set2DStereoFlag(Bond& bond, unsigned int flag);
92 
94 
95  CDPL_CHEM_API bool has2DStereoFlag(const Bond& bond);
96 
97 
98  CDPL_CHEM_API unsigned int getCIPConfiguration(const Bond& bond);
99 
100  CDPL_CHEM_API void setCIPConfiguration(Bond& bond, unsigned int config);
101 
103 
105 
106  CDPL_CHEM_API unsigned int calcCIPConfiguration(const Bond& bond, const MolecularGraph& molgraph);
107 
108  CDPL_CHEM_API unsigned int calcCIPConfiguration(const Bond& bond, const MolecularGraph& molgraph, const AtomPriorityFunction& cip_pri_func);
109 
110 
112 
114 
116 
118 
119  CDPL_CHEM_API StereoDescriptor calcStereoDescriptor(const Bond& bond, const MolecularGraph& molgraph, std::size_t dim = 1,
120  std::size_t min_ring_size = 8, bool check_order = true);
121 
122  CDPL_CHEM_API unsigned int calcBondConfiguration(const Bond& bond, const MolecularGraph& molgraph, const StereoDescriptor& descr,
123  const Math::Vector3DArray& coords);
124 
125 
127 
128  CDPL_CHEM_API void setStereoCenterFlag(Bond& bond, bool is_center);
129 
131 
133 
134  CDPL_CHEM_API bool isStereoCenter(const Bond& bond, const MolecularGraph& molgraph, bool check_cip_sym = true, std::size_t min_ring_size = 8);
135 
136 
137  CDPL_CHEM_API unsigned int getDirection(const Bond& bond);
138 
139  CDPL_CHEM_API void setDirection(Bond& bond, unsigned int dir);
140 
142 
143  CDPL_CHEM_API bool hasDirection(const Bond& bond);
144 
145 
146  CDPL_CHEM_API unsigned int getReactionCenterStatus(const Bond& bond);
147 
148  CDPL_CHEM_API void setReactionCenterStatus(Bond& bond, unsigned int status);
149 
151 
153 
154 
156 
158 
160 
162 
163 
165 
167 
169 
171 
173 
174 
175  CDPL_CHEM_API const std::string& getMatchExpressionString(const Bond& bond);
176 
177  CDPL_CHEM_API void setMatchExpressionString(Bond& bond, const std::string& expr_str);
178 
180 
182 
183  CDPL_CHEM_API void generateMatchExpressionString(const Bond& bond, const MolecularGraph& molgraph, std::string& str);
184 
185 
186  CDPL_CHEM_API unsigned int getSybylType(const Bond& bond);
187 
188  CDPL_CHEM_API void setSybylType(Bond& bond, unsigned int type);
189 
191 
192  CDPL_CHEM_API bool hasSybylType(const Bond& bond);
193 
194  CDPL_CHEM_API unsigned int perceiveSybylType(const Bond& bond, const MolecularGraph& molgraph);
195  } // namespace Chem
196 } // namespace CDPL
197 
198 #endif // CDPL_CHEM_BONDFUNCTIONS_HPP
CDPL::Chem::getStereoDescriptor
CDPL_CHEM_API const StereoDescriptor & getStereoDescriptor(const Atom &atom)
CDPL::Chem::getRingFlag
CDPL_CHEM_API bool getRingFlag(const Atom &atom)
CDPL::Chem::clearStereoDescriptor
CDPL_CHEM_API void clearStereoDescriptor(Atom &atom)
APIPrefix.hpp
Definition of the preprocessor macro CDPL_CHEM_API.
VectorArray.hpp
Definition of the class CDPL::Math::VectorArray.
CDPL::Chem::setReactionCenterStatus
CDPL_CHEM_API void setReactionCenterStatus(Atom &atom, unsigned int status)
CDPL::Chem::set2DStereoFlag
CDPL_CHEM_API void set2DStereoFlag(Bond &bond, unsigned int flag)
CDPL::Chem::clearStereoCenterFlag
CDPL_CHEM_API void clearStereoCenterFlag(Atom &atom)
CDPL_CHEM_API
#define CDPL_CHEM_API
Tells the compiler/linker which classes, functions and variables are part of the library API.
CDPL::Chem::Bond
Bond.
Definition: Bond.hpp:50
CDPL::Chem::calcCIPConfiguration
CDPL_CHEM_API unsigned int calcCIPConfiguration(const Atom &atom, const MolecularGraph &molgraph)
CDPL::Chem::isStereoCenter
CDPL_CHEM_API bool isStereoCenter(const Atom &atom, const MolecularGraph &molgraph, bool check_cip_sym=true, bool check_acyclic_subst_sym_only=false)
CDPL::Chem::AtomPriorityFunction
std::function< std::size_t(const Chem::Atom &)> AtomPriorityFunction
A generic wrapper class used to store a user-defined atom priority function.
Definition: AtomPriorityFunction.hpp:42
CDPL::Chem::setMatchExpression
CDPL_CHEM_API void setMatchExpression(Atom &atom, const MatchExpression< Atom, MolecularGraph >::SharedPointer &expr)
CDPL::Chem::has2DStereoFlag
CDPL_CHEM_API bool has2DStereoFlag(const Bond &bond)
CDPL::Chem::perceiveSybylType
CDPL_CHEM_API unsigned int perceiveSybylType(const Atom &atom, const MolecularGraph &molgraph)
CDPL::Chem::getContainingFragments
CDPL_CHEM_API void getContainingFragments(const Atom &atom, const FragmentList &frag_list, FragmentList &cont_frag_list, bool append=false)
CDPL::Chem::MatchConstraintList::SharedPointer
std::shared_ptr< MatchConstraintList > SharedPointer
A reference-counted smart pointer [SHPTR] for dynamically allocated MatchConstraintList instances.
Definition: MatchConstraintList.hpp:197
CDPL::Chem::clearMatchExpression
CDPL_CHEM_API void clearMatchExpression(Atom &atom)
CDPL::Chem::hasStereoCenterFlag
CDPL_CHEM_API bool hasStereoCenterFlag(const Atom &atom)
CDPL::Chem::hasMatchExpression
CDPL_CHEM_API bool hasMatchExpression(const Atom &atom)
CDPL::Chem::hasReactionCenterStatus
CDPL_CHEM_API bool hasReactionCenterStatus(const Atom &atom)
CDPL::Chem::getMatchExpressionString
CDPL_CHEM_API const std::string & getMatchExpressionString(const Atom &atom)
CDPL::Chem::hasDirection
CDPL_CHEM_API bool hasDirection(const Bond &bond)
CDPL::Chem::generateMatchExpression
CDPL_CHEM_API MatchExpression< Atom, MolecularGraph >::SharedPointer generateMatchExpression(const Atom &atom, const MolecularGraph &molgraph)
CDPL::Chem::setSybylType
CDPL_CHEM_API void setSybylType(Atom &atom, unsigned int type)
VectorArray< Vector3D >
CDPL::Chem::MolecularGraph
MolecularGraph.
Definition: MolecularGraph.hpp:52
CDPL::Chem::clearSybylType
CDPL_CHEM_API void clearSybylType(Atom &atom)
CDPL::Chem::setRingFlag
CDPL_CHEM_API void setRingFlag(Atom &atom, bool in_ring)
CDPL::Chem::getOrder
CDPL_CHEM_API std::size_t getOrder(const Bond &bond)
CDPL::Chem::getSybylType
CDPL_CHEM_API unsigned int getSybylType(const Atom &atom)
CDPL::Chem::hasRingFlag
CDPL_CHEM_API bool hasRingFlag(const Atom &atom)
CDPL::Chem::clearMatchExpressionString
CDPL_CHEM_API void clearMatchExpressionString(Atom &atom)
CDPL::Chem::getCIPConfiguration
CDPL_CHEM_API unsigned int getCIPConfiguration(const Atom &atom)
CDPL::Chem::clearDirection
CDPL_CHEM_API void clearDirection(Bond &bond)
CDPL::Chem::hasSybylType
CDPL_CHEM_API bool hasSybylType(const Atom &atom)
CDPL::Chem::hasMatchExpressionString
CDPL_CHEM_API bool hasMatchExpressionString(const Atom &atom)
CDPL::Chem::calcBondConfiguration
CDPL_CHEM_API unsigned int calcBondConfiguration(const Bond &bond, const MolecularGraph &molgraph, const StereoDescriptor &descr, const Math::Vector3DArray &coords)
CDPL::Chem::getStereoCenterFlag
CDPL_CHEM_API bool getStereoCenterFlag(const Atom &atom)
CDPL::Chem::clearMatchConstraints
CDPL_CHEM_API void clearMatchConstraints(Atom &atom)
AtomPriorityFunction.hpp
Type definition of a generic wrapper class for storing user-defined Chem::Atom 3D-coordinates functio...
CDPL::Chem::getDirection
CDPL_CHEM_API unsigned int getDirection(const Bond &bond)
CDPL::Chem::clearReactionCenterStatus
CDPL_CHEM_API void clearReactionCenterStatus(Atom &atom)
CDPL::Chem::clearAromaticityFlag
CDPL_CHEM_API void clearAromaticityFlag(Atom &atom)
CDPL::Chem::setStereoCenterFlag
CDPL_CHEM_API void setStereoCenterFlag(Atom &atom, bool is_center)
CDPL::Chem::FragmentList
A data type for the storage of Chem::Fragment objects.
Definition: FragmentList.hpp:49
CDPL::Chem::getNumContainingFragments
CDPL_CHEM_API std::size_t getNumContainingFragments(const Atom &atom, const FragmentList &frag_list)
CDPL::Chem::hasCIPConfiguration
CDPL_CHEM_API bool hasCIPConfiguration(const Atom &atom)
CDPL::Chem::MatchExpression
A generic boolean expression interface for the implementation of query/target object equivalence test...
Definition: MatchExpression.hpp:75
CDPL::Chem::generateMatchExpressionString
CDPL_CHEM_API void generateMatchExpressionString(const Atom &atom, const MolecularGraph &molgraph, std::string &expr_str)
CDPL::Chem::setMatchExpressionString
CDPL_CHEM_API void setMatchExpressionString(Atom &atom, const std::string &expr_str)
CDPL::Chem::isInFragmentOfSize
CDPL_CHEM_API bool isInFragmentOfSize(const Atom &atom, const FragmentList &frag_list, std::size_t size)
MatchExpression.hpp
Definition of the class CDPL::Chem::MatchExpression.
CDPL
The namespace of the Chemical Data Processing Library.
CDPL::Chem::getAromaticityFlag
CDPL_CHEM_API bool getAromaticityFlag(const Atom &atom)
CDPL::Chem::get2DStereoFlag
CDPL_CHEM_API unsigned int get2DStereoFlag(const Bond &bond)
CDPL::Chem::clear2DStereoFlag
CDPL_CHEM_API void clear2DStereoFlag(Bond &bond)
CDPL::Chem::getMatchExpression
CDPL_CHEM_API const MatchExpression< Atom, MolecularGraph >::SharedPointer & getMatchExpression(const Atom &atom)
CDPL::Chem::hasStereoDescriptor
CDPL_CHEM_API bool hasStereoDescriptor(const Atom &atom)
CDPL::Chem::hasOrder
CDPL_CHEM_API bool hasOrder(const Bond &bond)
CDPL::Chem::setAromaticityFlag
CDPL_CHEM_API void setAromaticityFlag(Atom &atom, bool aromatic)
CDPL::Chem::getReactionCenterStatus
CDPL_CHEM_API unsigned int getReactionCenterStatus(const Atom &atom)
CDPL::Chem::hasAromaticityFlag
CDPL_CHEM_API bool hasAromaticityFlag(const Atom &atom)
CDPL::Chem::StereoDescriptor
A data structure for the storage and retrieval of stereochemical information about atoms and bonds.
Definition: StereoDescriptor.hpp:102
CDPL::Chem::clearRingFlag
CDPL_CHEM_API void clearRingFlag(Atom &atom)
CDPL::Chem::clearOrder
CDPL_CHEM_API void clearOrder(Bond &bond)
CDPL::Chem::setMatchConstraints
CDPL_CHEM_API void setMatchConstraints(Atom &atom, const MatchConstraintList::SharedPointer &constr)
CDPL::Chem::setCIPConfiguration
CDPL_CHEM_API void setCIPConfiguration(Atom &atom, unsigned int config)
CDPL::Chem::clearCIPConfiguration
CDPL_CHEM_API void clearCIPConfiguration(Atom &atom)
CDPL::Chem::setStereoDescriptor
CDPL_CHEM_API void setStereoDescriptor(Atom &atom, const StereoDescriptor &descr)
CDPL::Chem::hasMatchConstraints
CDPL_CHEM_API bool hasMatchConstraints(const Atom &atom)
MatchConstraintList.hpp
Definition of the class CDPL::Chem::MatchConstraintList.
FragmentList.hpp
Definition of the class CDPL::Chem::FragmentList.
CDPL::Chem::calcStereoDescriptor
CDPL_CHEM_API StereoDescriptor calcStereoDescriptor(const Atom &atom, const MolecularGraph &molgraph, std::size_t dim=1)
CDPL::Chem::setDirection
CDPL_CHEM_API void setDirection(Bond &bond, unsigned int dir)
CDPL::Chem::setOrder
CDPL_CHEM_API void setOrder(Bond &bond, std::size_t order)
CDPL::Chem::getMatchConstraints
CDPL_CHEM_API const MatchConstraintList::SharedPointer & getMatchConstraints(const Atom &atom)
CDPL::Chem::getSizeOfLargestContainingFragment
CDPL_CHEM_API std::size_t getSizeOfLargestContainingFragment(const Atom &atom, const FragmentList &frag_list)
CDPL::Chem::getSizeOfSmallestContainingFragment
CDPL_CHEM_API std::size_t getSizeOfSmallestContainingFragment(const Atom &atom, const FragmentList &frag_list)