Chemical Data Processing Library C++ API - Version 1.4.0
StructureGenerator.hpp
Go to the documentation of this file.
1 /*
2  * StructureGenerator.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_STRUCTUREGENERATOR_HPP
30 #define CDPL_CONFGEN_STRUCTUREGENERATOR_HPP
31 
32 #include <memory>
33 
41 
42 
43 namespace CDPL
44 {
45 
46  namespace Chem
47  {
48 
49  class MolecularGraph;
50  }
51 
52  namespace ConfGen
53  {
54 
55  class ConformerGeneratorImpl;
56 
64  {
65 
66  public:
71 
73 
78 
80 
86 
92 
97 
103 
108 
114 
120 
126 
132 
138 
144 
150 
156  unsigned int generate(const Chem::MolecularGraph& molgraph);
157 
165  unsigned int generate(const Chem::MolecularGraph& molgraph, const Chem::MolecularGraph& fixed_substr);
166 
175  unsigned int generate(const Chem::MolecularGraph& molgraph, const Chem::MolecularGraph& fixed_substr,
176  const Math::Vector3DArray& fixed_substr_coords);
177 
182  void setCoordinates(Chem::MolecularGraph& molgraph) const;
183 
189 
190  private:
191  unsigned int generate(const Chem::MolecularGraph& molgraph, const Chem::MolecularGraph* fixed_substr,
192  const Math::Vector3DArray* fixed_substr_coords);
193 
194  typedef std::unique_ptr<ConformerGeneratorImpl> ImplementationPointer;
195 
196  ImplementationPointer impl;
198  ConformerData coordinates;
199  };
200  } // namespace ConfGen
201 } // namespace CDPL
202 
203 #endif // CDPL_CONFGEN_STRUCTUREGENERATOR_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 class CDPL::ConfGen::ConformerData.
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::StructureGeneratorSettings.
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
std::shared_ptr< FragmentLibrary > SharedPointer
A reference-counted smart pointer [SHPTR] for dynamically allocated FragmentLibrary instances.
Definition: FragmentLibrary.hpp:68
Bundle of configuration parameters for single 3D structure generation via class ConfGen::StructureGen...
Definition: StructureGeneratorSettings.hpp:48
High-level driver for the generation of a single low-energy 3D structure from a molecular graph.
Definition: StructureGenerator.hpp:64
const CallbackFunction & getAbortCallback() const
Returns the currently configured abort-check callback.
StructureGenerator()
Constructs the StructureGenerator instance.
const StructureGeneratorSettings & getSettings() const
Returns the current generator settings.
unsigned int generate(const Chem::MolecularGraph &molgraph)
Generates a single 3D structure for molgraph.
void setTimeoutCallback(const CallbackFunction &func)
Sets the callback invoked periodically to check whether the configured timeout has elapsed.
void addFragmentLibrary(const FragmentLibrary::SharedPointer &lib)
Adds lib to the list of fragment libraries consulted during fragment-based 3D structure generation.
void clearTorsionLibraries()
Removes all configured torsion libraries.
StructureGeneratorSettings & getSettings()
Returns the current generator settings (mutable).
StructureGenerator & operator=(const StructureGenerator &)=delete
void setCoordinates(Chem::MolecularGraph &molgraph) const
Transfers the generated 3D coordinates onto the atoms of molgraph (via Chem::set3DCoordinates).
const CallbackFunction & getTimeoutCallback() const
Returns the currently configured timeout-check callback.
void addTorsionLibrary(const TorsionLibrary::SharedPointer &lib)
Adds lib to the list of torsion libraries consulted during torsion driving.
void setAbortCallback(const CallbackFunction &func)
Sets the callback invoked periodically to allow the generation to be aborted by the user.
void setLogMessageCallback(const LogMessageCallbackFunction &func)
Sets the callback receiving log messages emitted by the generator.
const LogMessageCallbackFunction & getLogMessageCallback() const
Returns the currently configured log-message callback.
unsigned int generate(const Chem::MolecularGraph &molgraph, const Chem::MolecularGraph &fixed_substr)
Generates a single 3D structure for molgraph while keeping the substructure fixed_substr at its curre...
const ConformerData & getCoordinates() const
Returns the conformer data produced by the most recent generate() call.
unsigned int generate(const Chem::MolecularGraph &molgraph, const Chem::MolecularGraph &fixed_substr, const Math::Vector3DArray &fixed_substr_coords)
Generates a single 3D structure for molgraph while keeping the substructure fixed_substr at the suppl...
StructureGenerator(const StructureGenerator &)=delete
void clearFragmentLibraries()
Removes all configured fragment libraries.
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.