Loading...
Searching...
No Matches
tetrahedral.h
Go to the documentation of this file.
/**********************************************************************
tetrahedral.h - OBTetrahedralStereo
Copyright (C) 2009 by Tim Vandermeersch
This file is part of the Open Babel project.
For more information, see <http://openbabel.org/>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA.
**********************************************************************/
#ifndef OB_TETRAHEDRAL_H
#define OB_TETRAHEDRAL_H
#include <openbabel/stereo/tetranonplanar.h>
namespace OpenBabel {
class OBAPI OBTetrahedralStereo : public OBTetraNonPlanarStereo
{
public:
#ifndef SWIG
struct OBAPI Config
{
Config() : center(OBStereo::NoRef), from(OBStereo::NoRef),
winding(OBStereo::Clockwise), view(OBStereo::ViewFrom),
specified(true)
{ }
Config(unsigned long _center, unsigned long from_or_towards,
const OBStereo::Refs &_refs, OBStereo::Winding _winding = OBStereo::Clockwise,
OBStereo::View _view = OBStereo::ViewFrom) : center(_center),
from(from_or_towards), refs(_refs), winding(_winding), view(_view),
specified(true)
{ }
bool operator==(const Config &other) const;
bool operator!=(const Config &other) const
{
return !(*this == other);
}
unsigned long center; //<! The center (chiral) atom id.
union {
unsigned long from; //<! The viewing from atom id.
unsigned long towards; //<! The viewing towards id.
};
OBStereo::Refs refs;
OBStereo::Winding winding; //<! The winding for the 3 reference ids.
OBStereo::View view;
bool specified;
};
#endif
OBTetrahedralStereo(OBMol *mol);
virtual ~OBTetrahedralStereo();
OBStereo::Type GetType() const { return OBStereo::Tetrahedral; }
bool IsValid() const;
#ifndef SWIG
void SetConfig(const Config &config);
Config GetConfig(OBStereo::Winding winding = OBStereo::Clockwise,
OBStereo::View view = OBStereo::ViewFrom) const;
Config GetConfig(unsigned long from_or_towards,
OBStereo::Winding winding = OBStereo::Clockwise,
OBStereo::View view = OBStereo::ViewFrom) const;
#endif
bool operator==(const OBTetrahedralStereo &other) const;
bool operator!=(const OBTetrahedralStereo &other) const
{
return !(*this == other);
}
/*
* Implement OBGenericData::Clone().
*/
OBGenericData* Clone(OBBase *mol) const;
private:
Config m_cfg;
};
// end addtogroup doxygen
} // namespace OpenBabel
#ifndef SWIG
namespace std {
OBAPI ostream& operator<<(ostream &out, const OpenBabel::OBTetrahedralStereo &ts);
OBAPI ostream& operator<<(ostream &out, const OpenBabel::OBTetrahedralStereo::Config &cfg);
} // namespace std
#endif // SWIG
#endif
OpenBabel::OBBase
Base Class.
Definition base.h:240
OpenBabel::OBGenericData
Base class for generic data.
Definition base.h:189
OpenBabel::OBMol
Molecule Class.
Definition mol.h:121
OpenBabel::OBTetraNonPlanarStereo::OBTetraNonPlanarStereo
OBTetraNonPlanarStereo(OBMol *mol)
OpenBabel::OBTetrahedralStereo
Class for handling and storing tetrahedral atom stereochemistry.
Definition tetrahedral.h:59
OpenBabel::OBTetrahedralStereo::~OBTetrahedralStereo
virtual ~OBTetrahedralStereo()
OpenBabel::OBTetrahedralStereo::GetType
OBStereo::Type GetType() const
Definition tetrahedral.h:199
OpenBabel::OBTetrahedralStereo::GetConfig
Config GetConfig(OBStereo::Winding winding=OBStereo::Clockwise, OBStereo::View view=OBStereo::ViewFrom) const
OpenBabel::OBTetrahedralStereo::Clone
OBGenericData * Clone(OBBase *mol) const
OpenBabel::OBTetrahedralStereo::operator!=
bool operator!=(const OBTetrahedralStereo &other) const
Definition tetrahedral.h:234
OpenBabel::OBTetrahedralStereo::operator==
bool operator==(const OBTetrahedralStereo &other) const
OpenBabel::OBTetrahedralStereo::IsValid
bool IsValid() const
OpenBabel::OBTetrahedralStereo::SetConfig
void SetConfig(const Config &config)
OpenBabel::OBTetrahedralStereo::OBTetrahedralStereo
OBTetrahedralStereo(OBMol *mol)
OpenBabel::OBTetrahedralStereo::GetConfig
Config GetConfig(unsigned long from_or_towards, OBStereo::Winding winding=OBStereo::Clockwise, OBStereo::View view=OBStereo::ViewFrom) const
std::operator<<
ostream & operator<<(ostream &out, const OpenBabel::OBCisTransStereo &ct)
OpenBabel
Global namespace for all Open Babel code.
Definition alias.h:23
std
STL namespace.
OpenBabel::OBStereo
Placeholder for enums & Ref/Refs related functions.
Definition stereo.h:76
OpenBabel::OBStereo::Type
Type
Definition stereo.h:80
OpenBabel::OBStereo::Tetrahedral
@ Tetrahedral
tetrahedral
Definition stereo.h:84
OpenBabel::OBStereo::Refs
std::vector< Ref > Refs
Definition stereo.h:156
OpenBabel::OBStereo::Winding
Winding
Definition stereo.h:130
OpenBabel::OBStereo::Clockwise
@ Clockwise
Clockwise winding.
Definition stereo.h:131
OpenBabel::OBStereo::View
View
Definition stereo.h:120
OpenBabel::OBStereo::ViewFrom
@ ViewFrom
view from the atom (id parameter) towards the center atom
Definition stereo.h:121
OpenBabel::OBTetrahedralStereo::Config
Stereochemical configuration for tetrahedral stereocenters.
Definition tetrahedral.h:85
OpenBabel::OBTetrahedralStereo::Config::Config
Config(unsigned long _center, unsigned long from_or_towards, const OBStereo::Refs &_refs, OBStereo::Winding _winding=OBStereo::Clockwise, OBStereo::View _view=OBStereo::ViewFrom)
Definition tetrahedral.h:104
OpenBabel::OBTetrahedralStereo::Config::from
unsigned long from
Definition tetrahedral.h:173
OpenBabel::OBTetrahedralStereo::Config::view
OBStereo::View view
Specify viewing from or towards the atom with from/towards id.
Definition tetrahedral.h:178
OpenBabel::OBTetrahedralStereo::Config::refs
OBStereo::Refs refs
The 3 reference ids.
Definition tetrahedral.h:176
OpenBabel::OBTetrahedralStereo::Config::winding
OBStereo::Winding winding
Definition tetrahedral.h:177
OpenBabel::OBTetrahedralStereo::Config::Config
Config()
Definition tetrahedral.h:91
OpenBabel::OBTetrahedralStereo::Config::center
unsigned long center
Definition tetrahedral.h:164
OpenBabel::OBTetrahedralStereo::Config::operator==
bool operator==(const Config &other) const
OpenBabel::OBTetrahedralStereo::Config::operator!=
bool operator!=(const Config &other) const
Definition tetrahedral.h:155
OpenBabel::OBTetrahedralStereo::Config::towards
unsigned long towards
Definition tetrahedral.h:174
OpenBabel::OBTetrahedralStereo::Config::specified
bool specified
Definition tetrahedral.h:179
tetranonplanar.h
Base class for handling and storing non-planar stereochemistry with 4 reference atom ids.