Chemical Data Processing Library C++ API - Version 1.4.0
ConformerGenerator.hpp
Go to the documentation of this file.
1 /*
2  * ConformerGenerator.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_CONFORMERGENERATOR_HPP
30 #define CDPL_CONFGEN_CONFORMERGENERATOR_HPP
31 
32 #include <memory>
33 
34 #include <boost/iterator/indirect_iterator.hpp>
35 
43 
44 
45 namespace CDPL
46 {
47 
48  namespace Chem
49  {
50 
51  class MolecularGraph;
52  }
53 
54  namespace ConfGen
55  {
56 
57  class ConformerGeneratorImpl;
58 
76  {
77 
78  public:
80  typedef boost::indirect_iterator<ConformerDataArray::const_iterator, const ConformerData> ConstConformerIterator;
82  typedef boost::indirect_iterator<ConformerDataArray::const_iterator, ConformerData> ConformerIterator;
83 
88 
90 
95 
97 
103 
109 
114 
120 
125 
131 
137 
143 
149 
155 
161 
167 
173  unsigned int generate(const Chem::MolecularGraph& molgraph);
174 
182  unsigned int generate(const Chem::MolecularGraph& molgraph, const Chem::MolecularGraph& fixed_substr);
183 
192  unsigned int generate(const Chem::MolecularGraph& molgraph, const Chem::MolecularGraph& fixed_substr,
193  const Math::Vector3DArray& fixed_substr_coords);
194 
204  void setConformers(Chem::MolecularGraph& molgraph) const;
205 
210  std::size_t getNumConformers() const;
211 
218  const ConformerData& getConformer(std::size_t idx) const;
219 
226  ConformerData& getConformer(std::size_t idx);
227 
233 
239 
245 
251 
257 
263 
269 
275 
276  private:
277  typedef std::unique_ptr<ConformerGeneratorImpl> ImplementationPointer;
278 
279  ImplementationPointer impl;
280  };
281  } // namespace ConfGen
282 } // namespace CDPL
283 
284 #endif // CDPL_CONFGEN_CONFORMERGENERATOR_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::ConformerGeneratorSettings.
Definition of class CDPL::ConfGen::FragmentLibrary.
Type definition of a generic wrapper class for storing user-defined log message callback functions.
Definition of class CDPL::ConfGen::TorsionLibrary.
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 conformer ensemble generation via class ConfGen::ConformerGene...
Definition: ConformerGeneratorSettings.hpp:50
High-level driver for the generation of low-energy conformer ensembles of molecular graphs.
Definition: ConformerGenerator.hpp:76
const ConformerGeneratorSettings & getSettings() const
Returns the current generator settings.
ConformerGeneratorSettings & getSettings()
Returns the current generator settings (mutable).
ConstConformerIterator getConformersEnd() const
Returns a constant iterator pointing one past the last conformer.
const LogMessageCallbackFunction & getLogMessageCallback() const
Returns the currently configured log-message callback.
void addFragmentLibrary(const FragmentLibrary::SharedPointer &lib)
Adds lib to the list of fragment libraries consulted during fragment-based 3D structure generation.
void clearFragmentLibraries()
Removes all configured fragment libraries.
std::size_t getNumConformers() const
Returns the number of generated conformers.
const CallbackFunction & getTimeoutCallback() const
Returns the currently configured timeout-check callback.
ConformerGenerator & operator=(const ConformerGenerator &)=delete
boost::indirect_iterator< ConformerDataArray::const_iterator, ConformerData > ConformerIterator
A mutable iterator over the generated conformers.
Definition: ConformerGenerator.hpp:82
unsigned int generate(const Chem::MolecularGraph &molgraph, const Chem::MolecularGraph &fixed_substr, const Math::Vector3DArray &fixed_substr_coords)
Generates a conformer ensemble for molgraph while keeping the substructure fixed_substr at the suppli...
void setLogMessageCallback(const LogMessageCallbackFunction &func)
Sets the callback receiving log messages emitted by the generator.
unsigned int generate(const Chem::MolecularGraph &molgraph)
Generates a conformer ensemble for molgraph.
ConstConformerIterator getConformersBegin() const
Returns a constant iterator pointing to the first conformer.
void clearTorsionLibraries()
Removes all configured torsion libraries.
ConformerIterator getConformersBegin()
Returns a mutable iterator pointing to the first conformer.
ConformerIterator end()
Returns a mutable iterator pointing one past the last conformer (range-based for support).
const ConformerData & getConformer(std::size_t idx) const
Returns the conformer at index idx.
void addTorsionLibrary(const TorsionLibrary::SharedPointer &lib)
Adds lib to the list of torsion libraries consulted during torsion driving.
void setTimeoutCallback(const CallbackFunction &func)
Sets the callback invoked periodically to check whether the configured timeout has elapsed.
boost::indirect_iterator< ConformerDataArray::const_iterator, const ConformerData > ConstConformerIterator
A constant iterator over the generated conformers.
Definition: ConformerGenerator.hpp:80
void setAbortCallback(const CallbackFunction &func)
Sets the callback invoked periodically to allow the generation to be aborted by the user.
ConformerGenerator()
Constructs the ConformerGenerator instance.
ConformerIterator begin()
Returns a mutable iterator pointing to the first conformer (range-based for support).
ConformerData & getConformer(std::size_t idx)
Returns the conformer at index idx.
ConformerGenerator(const ConformerGenerator &)=delete
ConformerIterator getConformersEnd()
Returns a mutable iterator pointing one past the last conformer.
ConstConformerIterator begin() const
Returns a constant iterator pointing to the first conformer (range-based for support).
unsigned int generate(const Chem::MolecularGraph &molgraph, const Chem::MolecularGraph &fixed_substr)
Generates a conformer ensemble for molgraph while keeping the substructure fixed_substr at its curren...
void setConformers(Chem::MolecularGraph &molgraph) const
Transfers the generated conformer ensemble onto molgraph.
ConstConformerIterator end() const
Returns a constant iterator pointing one past the last conformer (range-based for support).
const CallbackFunction & getAbortCallback() const
Returns the currently configured abort-check callback.
std::shared_ptr< FragmentLibrary > SharedPointer
A reference-counted smart pointer [SHPTR] for dynamically allocated FragmentLibrary instances.
Definition: FragmentLibrary.hpp:68
std::shared_ptr< TorsionLibrary > SharedPointer
A reference-counted smart pointer [SHPTR] for dynamically allocated TorsionLibrary instances.
Definition: TorsionLibrary.hpp:56
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.