Chemical Data Processing Library C++ API - Version 1.4.0
FragmentAssembler.hpp
Go to the documentation of this file.
1 /*
2  * FragmentAssembler.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_FRAGMENTASSEMBLER_HPP
30 #define CDPL_CONFGEN_FRAGMENTASSEMBLER_HPP
31 
32 #include <cstddef>
33 #include <memory>
34 
35 #include <boost/iterator/indirect_iterator.hpp>
36 
43 
44 
45 namespace CDPL
46 {
47 
48  namespace Chem
49  {
50 
51  class MolecularGraph;
52  }
53 
54  namespace ConfGen
55  {
56 
57  class FragmentAssemblerImpl;
58 
71  {
72 
73  public:
75  typedef boost::indirect_iterator<ConformerDataArray::const_iterator, const ConformerData> ConstConformerIterator;
77  typedef boost::indirect_iterator<ConformerDataArray::const_iterator, ConformerData> ConformerIterator;
78 
83 
85 
90 
92 
98 
104 
109 
115 
121 
127 
133 
139 
145 
151 
157  unsigned int assemble(const Chem::MolecularGraph& molgraph);
158 
167  unsigned int assemble(const Chem::MolecularGraph& molgraph, const Chem::MolecularGraph& fixed_substr,
168  const Math::Vector3DArray& fixed_substr_coords);
169 
174  std::size_t getNumConformers() const;
175 
182  const ConformerData& getConformer(std::size_t idx) const;
183 
190  ConformerData& getConformer(std::size_t idx);
191 
197 
203 
209 
215 
221 
227 
233 
239 
240  private:
241  typedef std::unique_ptr<FragmentAssemblerImpl> ImplementationPointer;
242 
243  ImplementationPointer impl;
244  };
245  } // namespace ConfGen
246 } // namespace CDPL
247 
248 #endif // CDPL_CONFGEN_FRAGMENTASSEMBLER_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::FragmentAssemblerSettings.
Definition of class CDPL::ConfGen::FragmentLibrary.
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 assembly via class ConfGen::FragmentAssembl...
Definition: FragmentAssemblerSettings.hpp:46
Driver for the fragment-based generation of 3D starting conformers.
Definition: FragmentAssembler.hpp:71
ConformerIterator end()
Returns a mutable iterator pointing one past the last conformer (range-based for support).
unsigned int assemble(const Chem::MolecularGraph &molgraph)
Assembles 3D conformer(s) for molgraph from fragment building blocks.
FragmentAssembler & operator=(const FragmentAssembler &)=delete
const FragmentAssemblerSettings & getSettings() const
Returns the current assembler settings.
boost::indirect_iterator< ConformerDataArray::const_iterator, ConformerData > ConformerIterator
A mutable iterator over the assembled conformers.
Definition: FragmentAssembler.hpp:77
const CallbackFunction & getAbortCallback() const
Returns the currently configured abort-check callback.
ConformerIterator begin()
Returns a mutable iterator pointing to the first conformer (range-based for support).
FragmentAssembler(const FragmentAssembler &)=delete
void clearFragmentLibraries()
Removes all configured fragment libraries.
const LogMessageCallbackFunction & getLogMessageCallback() const
Returns the currently configured log-message callback.
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 conformer (range-based for support).
FragmentAssembler()
Constructs the FragmentAssembler instance.
ConstConformerIterator getConformersBegin() const
Returns a constant iterator pointing to the first conformer.
ConstConformerIterator getConformersEnd() const
Returns a constant iterator pointing one past the last conformer.
void setTimeoutCallback(const CallbackFunction &func)
Sets the callback invoked periodically to check whether the configured timeout has elapsed.
ConstConformerIterator begin() const
Returns a constant iterator pointing to the first conformer (range-based for support).
boost::indirect_iterator< ConformerDataArray::const_iterator, const ConformerData > ConstConformerIterator
A constant iterator over the assembled conformers.
Definition: FragmentAssembler.hpp:75
void setLogMessageCallback(const LogMessageCallbackFunction &func)
Sets the callback receiving log messages emitted by the assembler.
ConformerIterator getConformersEnd()
Returns a mutable iterator pointing one past the last conformer.
FragmentAssemblerSettings & getSettings()
Returns the current assembler settings (mutable).
ConformerData & getConformer(std::size_t idx)
Returns the conformer at index idx.
void setAbortCallback(const CallbackFunction &func)
Sets the callback invoked periodically to allow the processing to be aborted by the user.
std::size_t getNumConformers() const
Returns the number of assembled conformers.
void addFragmentLibrary(const FragmentLibrary::SharedPointer &lib)
Adds lib to the list of fragment libraries consulted during assembly.
const CallbackFunction & getTimeoutCallback() const
Returns the currently configured timeout-check callback.
ConformerIterator getConformersBegin()
Returns a mutable iterator pointing to the first conformer.
unsigned int assemble(const Chem::MolecularGraph &molgraph, const Chem::MolecularGraph &fixed_substr, const Math::Vector3DArray &fixed_substr_coords)
Assembles 3D conformer(s) for molgraph while keeping the substructure fixed_substr at the supplied 3D...
std::shared_ptr< FragmentLibrary > SharedPointer
A reference-counted smart pointer [SHPTR] for dynamically allocated FragmentLibrary instances.
Definition: FragmentLibrary.hpp:68
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.