Chemical Data Processing Library C++ API - Version 1.2.0
Chem/AtomContainerFunctions.hpp
Go to the documentation of this file.
1 /*
2  * AtomContainerFunctions.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_ATOMCONTAINERFUNCTIONS_HPP
30 #define CDPL_CHEM_ATOMCONTAINERFUNCTIONS_HPP
31 
32 #include <cstddef>
33 
34 #include "CDPL/Chem/APIPrefix.hpp"
37 #include "CDPL/Math/Matrix.hpp"
39 #include "CDPL/Util/BitSet.hpp"
40 
41 
42 namespace CDPL
43 {
44 
45  namespace Chem
46  {
47 
48  class AtomContainer;
49  class Fragment;
50  class Molecule;
51 
52 
53  CDPL_CHEM_API bool hasCoordinates(const AtomContainer& cntnr, std::size_t dim);
54 
55 
56  CDPL_CHEM_API void get2DCoordinates(const AtomContainer& cntnr, Math::Vector2DArray& coords, bool append = false);
57 
59 
61 
62 
63  CDPL_CHEM_API void get3DCoordinates(const AtomContainer& cntnr, Math::Vector3DArray& coords, const Atom3DCoordinatesFunction& coords_func, bool append = false);
64 
65 
67 
68  CDPL_CHEM_API std::size_t getNumConformations(const AtomContainer& cntnr);
69 
70  CDPL_CHEM_API void applyConformation(AtomContainer& cntnr, std::size_t conf_idx);
71 
72  CDPL_CHEM_API void getConformation(const AtomContainer& cntnr, std::size_t conf_idx, Math::Vector3DArray& coords, bool append = false);
73 
74  CDPL_CHEM_API void setConformation(AtomContainer& cntnr, std::size_t conf_idx, const Math::Vector3DArray& coords);
75 
77 
78  CDPL_CHEM_API void transformConformation(AtomContainer& cntnr, std::size_t conf_idx, const Math::Matrix4D& mtx);
79 
81 
82  /*
83  * \since 1.1
84  */
85  CDPL_CHEM_API bool alignConformations(AtomContainer& cntnr, const Util::BitSet& ref_atoms, const Math::Vector3DArray& ref_coords);
86 
87  /*
88  * \since 1.1
89  */
90  CDPL_CHEM_API bool alignConformations(AtomContainer& cntnr, const AtomContainer& ref_atoms, const Math::Vector3DArray& ref_coords);
91 
92  /*
93  * \since 1.1
94  */
96 
97  /*
98  * \since 1.1
99  */
101 
102 
104 
106 
107 
108  CDPL_CHEM_API std::size_t createAtomTypeMask(const AtomContainer& cntnr, Util::BitSet& mask, unsigned int type, bool reset = true, bool strict = true);
109 
110 
111  CDPL_CHEM_API void copyAtomsIf(const AtomContainer& cntnr, Molecule& mol, const AtomPredicate& pred, bool append = false);
112 
113  CDPL_CHEM_API void copyAtomsIf(const AtomContainer& cntnr, Fragment& frag, const AtomPredicate& pred, bool append = false);
114 
115  CDPL_CHEM_API void copyAtomsIfNot(const AtomContainer& cntnr, Molecule& mol, const AtomPredicate& pred, bool append = false);
116 
117  CDPL_CHEM_API void copyAtomsIfNot(const AtomContainer& cntnr, Fragment& frag, const AtomPredicate& pred, bool append = false);
118 
119 
121 
123 
124  CDPL_CHEM_API void calcBoundingBox(const AtomContainer& cntnr, Math::Vector3D& min, Math::Vector3D& max, const Atom3DCoordinatesFunction& coords_func, bool reset = true);
125 
126  CDPL_CHEM_API bool insideBoundingBox(const AtomContainer& cntnr, const Math::Vector3D& min, const Math::Vector3D& max, const Atom3DCoordinatesFunction& coords_func);
127 
128  CDPL_CHEM_API bool intersectsBoundingBox(const AtomContainer& cntnr, const Math::Vector3D& min, const Math::Vector3D& max, const Atom3DCoordinatesFunction& coords_func);
129  } // namespace Chem
130 } // namespace CDPL
131 
132 #endif // CDPL_CHEM_ATOMCONTAINERFUNCTIONS_HPP
Type definition of a generic wrapper class for storing user-defined Chem::Atom 3D-coordinates functio...
Type definition of a generic wrapper class for storing user-defined Chem::Atom predicates.
Definition of the type CDPL::Util::BitSet.
Definition of the preprocessor macro CDPL_CHEM_API.
#define CDPL_CHEM_API
Tells the compiler/linker which classes, functions and variables are part of the library API.
Definition of matrix data types.
Definition of the class CDPL::Math::VectorArray.
A common interface for data-structures that support a random access to stored Chem::Atom instances.
Definition: AtomContainer.hpp:55
Fragment.
Definition: Fragment.hpp:52
Molecule.
Definition: Molecule.hpp:49
CDPL_CHEM_API void setConformation(AtomContainer &cntnr, std::size_t conf_idx, const Math::Vector3DArray &coords)
CDPL_CHEM_API bool alignConformations(AtomContainer &cntnr, const Util::BitSet &ref_atoms, const Math::Vector3DArray &ref_coords)
CDPL_CHEM_API std::size_t getNumConformations(const AtomContainer &cntnr)
CDPL_CHEM_API void transformConformation(AtomContainer &cntnr, std::size_t conf_idx, const Math::Matrix4D &mtx)
std::function< bool(const Chem::Atom &)> AtomPredicate
A generic wrapper class used to store a user-defined atom predicate.
Definition: AtomPredicate.hpp:41
CDPL_CHEM_API bool insideBoundingBox(const AtomContainer &cntnr, const Math::Vector3D &min, const Math::Vector3D &max, const Atom3DCoordinatesFunction &coords_func)
CDPL_CHEM_API void addConformation(AtomContainer &cntnr, const Math::Vector3DArray &coords)
CDPL_CHEM_API void copyAtomsIfNot(const AtomContainer &cntnr, Molecule &mol, const AtomPredicate &pred, bool append=false)
CDPL_CHEM_API void applyConformation(AtomContainer &cntnr, std::size_t conf_idx)
CDPL_CHEM_API void get2DCoordinates(const AtomContainer &cntnr, Math::Vector2DArray &coords, bool append=false)
CDPL_CHEM_API void getConformation(const AtomContainer &cntnr, std::size_t conf_idx, Math::Vector3DArray &coords, bool append=false)
CDPL_CHEM_API void calcBoundingBox(const AtomContainer &cntnr, Math::Vector3D &min, Math::Vector3D &max, const Atom3DCoordinatesFunction &coords_func, bool reset=true)
CDPL_CHEM_API void transform2DCoordinates(AtomContainer &cntnr, const Math::Matrix3D &mtx)
CDPL_CHEM_API void transformConformations(AtomContainer &cntnr, const Math::Matrix4D &mtx)
CDPL_CHEM_API void copyAtomsIf(const AtomContainer &cntnr, Molecule &mol, const AtomPredicate &pred, bool append=false)
CDPL_CHEM_API std::size_t createAtomTypeMask(const AtomContainer &cntnr, Util::BitSet &mask, unsigned int type, bool reset=true, bool strict=true)
CDPL_CHEM_API void clearConformations(AtomContainer &cntnr)
CDPL_CHEM_API std::size_t getMaxComponentGroupID(const AtomContainer &cntnr)
CDPL_CHEM_API bool hasCoordinates(const AtomContainer &cntnr, std::size_t dim)
CDPL_CHEM_API bool calcCenterOfMass(const AtomContainer &cntnr, const Atom3DCoordinatesFunction &coords_func, Math::Vector3D &ctr)
CDPL_CHEM_API void set2DCoordinates(AtomContainer &cntnr, const Math::Vector2DArray &coords)
CDPL_CHEM_API std::size_t getMaxAtomMappingID(const AtomContainer &cntnr)
std::function< const Math::Vector3D &(const Chem::Atom &)> Atom3DCoordinatesFunction
A generic wrapper class used to store a user-defined Chem::Atom 3D-coordinates function.
Definition: Atom3DCoordinatesFunction.hpp:43
CDPL_CHEM_API bool intersectsBoundingBox(const AtomContainer &cntnr, const Math::Vector3D &min, const Math::Vector3D &max, const Atom3DCoordinatesFunction &coords_func)
CDPL_CHEM_API void get3DCoordinates(const AtomContainer &cntnr, Math::Vector3DArray &coords, const Atom3DCoordinatesFunction &coords_func, bool append=false)
CDPL_CHEM_API bool calcCentroid(const AtomContainer &cntnr, const Atom3DCoordinatesFunction &coords_func, Math::Vector3D &ctr)
VectorArray< Vector3D > Vector3DArray
An array of Math::Vector3D objects.
Definition: VectorArray.hpp:84
CVector< double, 3 > Vector3D
A bounded 3 element vector holding floating point values of type double.
Definition: Vector.hpp:1637
VectorArray< Vector2D > Vector2DArray
An array of Math::Vector2D objects.
Definition: VectorArray.hpp:79
CMatrix< double, 3, 3 > Matrix3D
A bounded 3x3 matrix holding floating point values of type double.
Definition: Matrix.hpp:1849
boost::dynamic_bitset BitSet
A dynamic bitset class.
Definition: BitSet.hpp:46
The namespace of the Chemical Data Processing Library.