Chemical Data Processing Library C++ API - Version 1.1.1
StereoDescriptor.hpp
Go to the documentation of this file.
1 /*
2  * StereoDescriptor.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_STEREODESCRIPTOR_HPP
30 #define CDPL_CHEM_STEREODESCRIPTOR_HPP
31 
32 #include <cstddef>
33 
34 #include "CDPL/Chem/APIPrefix.hpp"
35 
36 
37 namespace CDPL
38 {
39 
40  namespace Chem
41  {
42 
43  class Atom;
44  class Bond;
45 
102  {
103 
104  public:
110  StereoDescriptor(unsigned int config);
111 
117 
126  StereoDescriptor(unsigned int config, const Atom& atom1,
127  const Atom& atom2, const Atom& atom3);
128 
138  StereoDescriptor(unsigned int config, const Atom& atom1, const Atom& atom2,
139  const Atom& atom3, const Atom& atom4);
140 
145  std::size_t getNumReferenceAtoms() const;
146 
151  unsigned int getConfiguration() const;
152 
157  void setConfiguration(unsigned int config);
158 
163  const Atom* const* getReferenceAtoms() const;
164 
171 
181  bool isValid(const Atom& atom) const;
182 
193  bool isValid(const Bond& bond) const;
194 
204  unsigned int getPermutationParity(const Atom& atom1, const Atom& atom2,
205  const Atom& atom3) const;
206 
217  unsigned int getPermutationParity(const Atom& atom1, const Atom& atom2,
218  const Atom& atom3, const Atom& atom4) const;
219 
220  private:
221  const Atom* refAtoms[4];
222  std::size_t numRefAtoms;
223  unsigned int config;
224  };
225  } // namespace Chem
226 } // namespace CDPL
227 
228 #endif // CDPL_CHEM_STEREODESCRIPTOR_HPP
APIPrefix.hpp
Definition of the preprocessor macro CDPL_CHEM_API.
CDPL_CHEM_API
#define CDPL_CHEM_API
Tells the compiler/linker which classes, functions and variables are part of the library API.
CDPL::Chem::Bond
Bond.
Definition: Bond.hpp:50
CDPL::Chem::StereoDescriptor::isValid
bool isValid(const Atom &atom) const
Tells wheter this StereoDescriptor instance is valid for the specified center atom.
CDPL::Chem::StereoDescriptor::isValid
bool isValid(const Bond &bond) const
Tells wheter this StereoDescriptor instance is valid for the specified center bond.
CDPL::Chem::Atom
Atom.
Definition: Atom.hpp:52
CDPL::Chem::StereoDescriptor::getConfiguration
unsigned int getConfiguration() const
Returns the configuration of the reference atoms.
CDPL::Chem::StereoDescriptor::StereoDescriptor
StereoDescriptor(const StereoDescriptor &descr)
Constructs a copy of the StereoDescriptor instance descr.
CDPL::Chem::StereoDescriptor::getPermutationParity
unsigned int getPermutationParity(const Atom &atom1, const Atom &atom2, const Atom &atom3, const Atom &atom4) const
Tells if an odd or even number of atom transpositions is required to achieve the same ordering of ref...
CDPL::Chem::StereoDescriptor::getNumReferenceAtoms
std::size_t getNumReferenceAtoms() const
Returns the number of specified reference atoms.
CDPL::Chem::StereoDescriptor::getPermutationParity
unsigned int getPermutationParity(const Atom &atom1, const Atom &atom2, const Atom &atom3) const
Tells if an odd or even number of atom transpositions is required to achieve the same ordering of ref...
CDPL::Chem::StereoDescriptor::StereoDescriptor
StereoDescriptor(unsigned int config, const Atom &atom1, const Atom &atom2, const Atom &atom3, const Atom &atom4)
Constructs a StereoDescriptor instance that specifies a configuration of config for four reference at...
CDPL
The namespace of the Chemical Data Processing Library.
CDPL::Chem::StereoDescriptor::operator=
StereoDescriptor & operator=(const StereoDescriptor &descr)
Assignment operator.
CDPL::Chem::StereoDescriptor::StereoDescriptor
StereoDescriptor(unsigned int config)
Constructs a StereoDescriptor instance that specifies the configuration config but stores no referenc...
CDPL::Chem::StereoDescriptor
A data structure for the storage and retrieval of stereochemical information about atoms and bonds.
Definition: StereoDescriptor.hpp:102
CDPL::Chem::StereoDescriptor::setConfiguration
void setConfiguration(unsigned int config)
Sets the configuration of the reference atoms to config.
CDPL::Chem::StereoDescriptor::StereoDescriptor
StereoDescriptor(unsigned int config, const Atom &atom1, const Atom &atom2, const Atom &atom3)
Constructs a StereoDescriptor instance that specifies a configuration of config for three reference a...
CDPL::Chem::StereoDescriptor::getReferenceAtoms
const Atom *const * getReferenceAtoms() const
Returns an array of pointers to the stored reference atoms.