Loading...
Searching...
No Matches
cistrans.h
Go to the documentation of this file.
/**********************************************************************
cistrans.h - Class for handling and storing cis/trans stereochemistry.
Copyright (C) 2009-2010 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_CISTRANS_H
#define OB_CISTRANS_H
#include <openbabel/stereo/tetraplanar.h>
#include <vector>
namespace OpenBabel {
class OBAPI OBCisTransStereo : public OBTetraPlanarStereo
{
public:
#ifndef SWIG
struct OBAPI Config
{
Config() : begin(OBStereo::NoRef), end(OBStereo::NoRef), shape(OBStereo::ShapeU),
specified(true)
{ }
Config(unsigned long _begin, unsigned long _end, const OBStereo::Refs &_refs,
OBStereo::Shape _shape = OBStereo::ShapeU) : begin(_begin), end(_end),
refs(_refs), shape(_shape), specified(true)
{ }
bool operator==(const Config &other) const;
bool operator!=(const Config &other) const
{
return !(*this == other);
}
unsigned long begin, end; //<! The double bond begin and end ids.
OBStereo::Refs refs;
OBStereo::Shape shape;
bool specified;
};
#endif
OBCisTransStereo(OBMol *mol);
virtual ~OBCisTransStereo();
OBStereo::Type GetType() const { return OBStereo::CisTrans; }
bool IsValid() const;
#ifndef SWIG
void SetConfig(const Config &config);
Config GetConfig(OBStereo::Shape shape = OBStereo::ShapeU) const;
Config GetConfig(unsigned long start,
OBStereo::Shape shape = OBStereo::ShapeU) const;
#endif
bool operator==(const OBCisTransStereo &other) const;
bool operator!=(const OBCisTransStereo &other) const
{
return !(*this == other);
}
/*
* Implement OBGenericData::Clone().
*/
OBGenericData* Clone(OBBase *mol) const;
bool IsOnSameAtom(unsigned long id1, unsigned long id2) const;
bool IsTrans(unsigned long id1, unsigned long id2) const;
bool IsCis(unsigned long id1, unsigned long id2) const;
unsigned long GetTransRef(unsigned long id) const;
unsigned long GetCisRef(unsigned long id) const;
private:
Config m_cfg;
// The following function sits behind GetCisRef and GetTransRef
unsigned long GetCisOrTransRef(unsigned long id, bool getcisref) const;
};
} // namespace OpenBabel
#ifndef SWIG
namespace std {
OBAPI ostream& operator<<(ostream &out, const OpenBabel::OBCisTransStereo &ct);
OBAPI ostream& operator<<(ostream &out, const OpenBabel::OBCisTransStereo::Config &cfg);
} // namespace std
#endif // Not SWIG
#endif
OpenBabel::OBBase
Base Class.
Definition base.h:240
OpenBabel::OBCisTransStereo
Class for handling and storing cis/trans stereochemistry.
Definition cistrans.h:76
OpenBabel::OBCisTransStereo::operator!=
bool operator!=(const OBCisTransStereo &other) const
Definition cistrans.h:260
OpenBabel::OBCisTransStereo::operator==
bool operator==(const OBCisTransStereo &other) const
OpenBabel::OBCisTransStereo::IsTrans
bool IsTrans(unsigned long id1, unsigned long id2) const
OpenBabel::OBCisTransStereo::GetType
OBStereo::Type GetType() const
Definition cistrans.h:222
OpenBabel::OBCisTransStereo::IsCis
bool IsCis(unsigned long id1, unsigned long id2) const
OpenBabel::OBCisTransStereo::~OBCisTransStereo
virtual ~OBCisTransStereo()
OpenBabel::OBCisTransStereo::IsOnSameAtom
bool IsOnSameAtom(unsigned long id1, unsigned long id2) const
OpenBabel::OBCisTransStereo::Clone
OBGenericData * Clone(OBBase *mol) const
OpenBabel::OBCisTransStereo::GetCisRef
unsigned long GetCisRef(unsigned long id) const
OpenBabel::OBCisTransStereo::OBCisTransStereo
OBCisTransStereo(OBMol *mol)
OpenBabel::OBCisTransStereo::GetConfig
Config GetConfig(unsigned long start, OBStereo::Shape shape=OBStereo::ShapeU) const
OpenBabel::OBCisTransStereo::GetConfig
Config GetConfig(OBStereo::Shape shape=OBStereo::ShapeU) const
OpenBabel::OBCisTransStereo::IsValid
bool IsValid() const
OpenBabel::OBCisTransStereo::GetTransRef
unsigned long GetTransRef(unsigned long id) const
OpenBabel::OBCisTransStereo::SetConfig
void SetConfig(const Config &config)
OpenBabel::OBGenericData
Base class for generic data.
Definition base.h:189
OpenBabel::OBMol
Molecule Class.
Definition mol.h:121
OpenBabel::OBTetraPlanarStereo::OBTetraPlanarStereo
OBTetraPlanarStereo(OBMol *mol)
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::OBCisTransStereo::Config
Stereochemical configuration for double-bond cis/trans stereochemistry.
Definition cistrans.h:100
OpenBabel::OBCisTransStereo::Config::refs
OBStereo::Refs refs
The 4 reference ids.
Definition cistrans.h:200
OpenBabel::OBCisTransStereo::Config::begin
unsigned long begin
Definition cistrans.h:199
OpenBabel::OBCisTransStereo::Config::Config
Config()
Definition cistrans.h:105
OpenBabel::OBCisTransStereo::Config::shape
OBStereo::Shape shape
The shape of the 4 reference ids.
Definition cistrans.h:201
OpenBabel::OBCisTransStereo::Config::operator==
bool operator==(const Config &other) const
OpenBabel::OBCisTransStereo::Config::operator!=
bool operator!=(const Config &other) const
Definition cistrans.h:190
OpenBabel::OBCisTransStereo::Config::end
unsigned long end
Definition cistrans.h:199
OpenBabel::OBCisTransStereo::Config::Config
Config(unsigned long _begin, unsigned long _end, const OBStereo::Refs &_refs, OBStereo::Shape _shape=OBStereo::ShapeU)
Definition cistrans.h:116
OpenBabel::OBCisTransStereo::Config::specified
bool specified
Definition cistrans.h:202
OpenBabel::OBStereo
Placeholder for enums & Ref/Refs related functions.
Definition stereo.h:76
OpenBabel::OBStereo::Type
Type
Definition stereo.h:80
OpenBabel::OBStereo::CisTrans
@ CisTrans
cis/trans double bond
Definition stereo.h:81
OpenBabel::OBStereo::Shape
Shape
Definition stereo.h:108
OpenBabel::OBStereo::ShapeU
@ ShapeU
Definition stereo.h:109
OpenBabel::OBStereo::Refs
std::vector< Ref > Refs
Definition stereo.h:156
tetraplanar.h
Base class for handling and storing planar stereochemistry with 4 reference atoms.