Chemical Data Processing Library C++ API - Version 1.4.0
FragmentConformerGenerator.hpp
Go to the documentation of this file.
1 /*
2  * FragmentConformerGenerator.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_FRAGMENTCONFORMERGENERATOR_HPP
30 #define CDPL_CONFGEN_FRAGMENTCONFORMERGENERATOR_HPP
31 
32 #include <memory>
33 
34 #include <boost/iterator/indirect_iterator.hpp>
35 
41 
42 
43 namespace CDPL
44 {
45 
46  namespace Chem
47  {
48 
49  class MolecularGraph;
50  }
51 
52  namespace ConfGen
53  {
54 
55  class FragmentConformerGeneratorImpl;
56 
67  {
68 
69  public:
71  typedef boost::indirect_iterator<ConformerDataArray::const_iterator, const ConformerData> ConstConformerIterator;
73  typedef boost::indirect_iterator<ConformerDataArray::const_iterator, ConformerData> ConformerIterator;
74 
79 
81 
86 
88 
94 
100 
106 
112 
118 
124 
130 
136 
142  unsigned int generate(const Chem::MolecularGraph& molgraph);
143 
150  unsigned int generate(const Chem::MolecularGraph& molgraph, unsigned int frag_type);
151 
160  unsigned int generate(const Chem::MolecularGraph& molgraph, const Chem::MolecularGraph& fixed_substr,
161  const Math::Vector3DArray& fixed_substr_coords);
162 
173  unsigned int generate(const Chem::MolecularGraph& molgraph, unsigned int frag_type,
174  const Chem::MolecularGraph& fixed_substr,
175  const Math::Vector3DArray& fixed_substr_coords);
176 
186  void setConformers(Chem::MolecularGraph& molgraph) const;
187 
192  std::size_t getNumConformers() const;
193 
200  const ConformerData& getConformer(std::size_t idx) const;
201 
208  ConformerData& getConformer(std::size_t idx);
209 
215 
221 
227 
233 
239 
245 
251 
257 
258  private:
259  typedef std::unique_ptr<FragmentConformerGeneratorImpl> ImplementationPointer;
260 
261  ImplementationPointer impl;
262  };
263  } // namespace ConfGen
264 } // namespace CDPL
265 
266 #endif // CDPL_CONFGEN_FRAGMENTCONFORMERGENERATOR_HPP
Type definition of a generic wrapper class for storing user-defined callback functions.
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 type CDPL::ConfGen::ConformerDataArray.
Definition of class CDPL::ConfGen::FragmentConformerGeneratorSettings.
Type definition of a generic wrapper class for storing user-defined log message callback functions.
Abstract base class for representations of a chemical structure as a graph of bonded atoms.
Definition: MolecularGraph.hpp:57
Container for the 3D coordinates of a generated conformer plus its associated energy value.
Definition: ConformerData.hpp:51
Bundle of configuration parameters for fragment conformer ensemble generation via class ConfGen::Frag...
Definition: FragmentConformerGeneratorSettings.hpp:48
Driver for the generation of low-energy conformer ensembles for single molecular fragments (chain,...
Definition: FragmentConformerGenerator.hpp:67
ConformerIterator begin()
Returns a mutable iterator pointing to the first generated conformer (range-based for support).
ConformerData & getConformer(std::size_t idx)
Returns the conformer at index idx.
FragmentConformerGenerator(const FragmentConformerGenerator &)=delete
ConformerIterator getConformersBegin()
Returns a mutable iterator pointing to the first generated conformer.
const FragmentConformerGeneratorSettings & getSettings() const
Returns the current generator settings.
FragmentConformerGenerator()
Constructs the FragmentConformerGenerator instance.
unsigned int generate(const Chem::MolecularGraph &molgraph, const Chem::MolecularGraph &fixed_substr, const Math::Vector3DArray &fixed_substr_coords)
Generates a conformer ensemble for the fragment molgraph while keeping the substructure fixed_substr ...
ConstConformerIterator getConformersBegin() const
Returns a constant iterator pointing to the first generated conformer.
unsigned int generate(const Chem::MolecularGraph &molgraph)
Generates a conformer ensemble for the fragment molgraph (the fragment type is perceived automaticall...
void setTimeoutCallback(const CallbackFunction &func)
Sets the callback invoked periodically to check whether the configured timeout has elapsed.
ConformerIterator getConformersEnd()
Returns a mutable iterator pointing one past the last generated conformer.
ConstConformerIterator begin() const
Returns a constant iterator pointing to the first generated conformer (range-based for support).
FragmentConformerGenerator & operator=(const FragmentConformerGenerator &)=delete
FragmentConformerGeneratorSettings & getSettings()
Returns the current generator settings (mutable).
const CallbackFunction & getTimeoutCallback() const
Returns the currently configured timeout-check callback.
unsigned int generate(const Chem::MolecularGraph &molgraph, unsigned int frag_type)
Generates a conformer ensemble for the fragment molgraph using the fragment-type-specific settings se...
ConformerIterator end()
Returns a mutable iterator pointing one past the last generated conformer (range-based for support).
void setConformers(Chem::MolecularGraph &molgraph) const
Transfers the generated conformer ensemble onto molgraph.
const CallbackFunction & getAbortCallback() const
Returns the currently configured abort-check callback.
unsigned int generate(const Chem::MolecularGraph &molgraph, unsigned int frag_type, const Chem::MolecularGraph &fixed_substr, const Math::Vector3DArray &fixed_substr_coords)
Generates a conformer ensemble for the fragment molgraph using the fragment-type-specific settings se...
const ConformerData & getConformer(std::size_t idx) const
Returns the conformer at index idx.
ConstConformerIterator end() const
Returns a constant iterator pointing one past the last generated conformer (range-based for support).
void setAbortCallback(const CallbackFunction &func)
Sets the callback invoked periodically to allow conformer generation to be aborted by the user.
std::size_t getNumConformers() const
Returns the number of generated conformers.
boost::indirect_iterator< ConformerDataArray::const_iterator, const ConformerData > ConstConformerIterator
A constant iterator over the generated conformers.
Definition: FragmentConformerGenerator.hpp:71
const LogMessageCallbackFunction & getLogMessageCallback() const
Returns the currently configured log-message callback.
void setLogMessageCallback(const LogMessageCallbackFunction &func)
Sets the callback that receives log messages produced during conformer generation.
boost::indirect_iterator< ConformerDataArray::const_iterator, ConformerData > ConformerIterator
A mutable iterator over the generated conformers.
Definition: FragmentConformerGenerator.hpp:73
ConstConformerIterator getConformersEnd() const
Returns a constant iterator pointing one past the last generated conformer.
std::function< void(const std::string &)> LogMessageCallbackFunction
Generic wrapper for storing user-defined log message callback functions (see [FUNWRP]).
Definition: LogMessageCallbackFunction.hpp:48
std::function< bool()> CallbackFunction
Generic wrapper for storing user-defined callback functions returning a bool status flag (see [FUNWRP...
Definition: CallbackFunction.hpp:47
VectorArray< Vector3D > Vector3DArray
Array storing vectors of type Math::Vector3D.
Definition: VectorArray.hpp:85
The namespace of the Chemical Data Processing Library.