cistrans.h Source File

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files
- Examples

- File List
- File Members

cistrans.h
Go to the documentation of this file.

    00001 /**********************************************************************
    00002   cistrans.h - Class for handling and storing cis/trans stereochemistry.
    00003
    00004   Copyright (C) 2009-2010 by Tim Vandermeersch
    00005
    00006   This file is part of the Open Babel project.
    00007   For more information, see <http://openbabel.org/>
    00008
    00009   This program is free software; you can redistribute it and/or modify
    00010   it under the terms of the GNU General Public License as published by
    00011   the Free Software Foundation; either version 2 of the License, or
    00012   (at your option) any later version.
    00013
    00014   This program is distributed in the hope that it will be useful,
    00015   but WITHOUT ANY WARRANTY; without even the implied warranty of
    00016   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    00017   GNU General Public License for more details.
    00018
    00019   You should have received a copy of the GNU General Public License
    00020   along with this program; if not, write to the Free Software
    00021   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
    00022   02110-1301, USA.
    00023  **********************************************************************/
    00024 #ifndef OB_CISTRANS_H
    00025 #define OB_CISTRANS_H
    00026
    00027 #include <openbabel/stereo/tetraplanar.h>
    00028 #include <vector>
    00029
    00030 namespace OpenBabel {
    00031
    00034
    00075 class OBAPI OBCisTransStereo : public OBTetraPlanarStereo
    00076 {
    00077   public:
    00098 #ifndef SWIG
    00099     struct OBAPI Config
    00100     {
    00105       Config() : begin(OBStereo::NoRef), end(OBStereo::NoRef), shape(OBStereo::ShapeU),
    00106           specified(true)
    00107       {  }
    00116       Config(unsigned long _begin, unsigned long _end, const OBStereo::Refs &_refs,
    00117           OBStereo::Shape _shape = OBStereo::ShapeU) : begin(_begin), end(_end),
    00118           refs(_refs), shape(_shape), specified(true)
    00119       {  }
    00184       bool operator==(const Config &other) const;
    00190       bool operator!=(const Config &other) const
    00191       {
    00192         return !(*this == other);
    00193       }
    00194
    00199       unsigned long begin, end; //<! The double bond begin and end ids.
    00200       OBStereo::Refs refs;
    00201       OBStereo::Shape shape;
    00202       bool specified;
    00203
    00204
    00205     };
    00206 #endif
    00207
    00210     OBCisTransStereo(OBMol *mol);
    00214     virtual ~OBCisTransStereo();
    00215
    00218
    00222     OBStereo::Type GetType() const { return OBStereo::CisTrans; }
    00230     bool IsValid() const;
    00231
    00235 #ifndef SWIG
    00236     void SetConfig(const Config &config);
    00240     Config GetConfig(OBStereo::Shape shape = OBStereo::ShapeU) const;
    00245     Config GetConfig(unsigned long start,
    00246         OBStereo::Shape shape = OBStereo::ShapeU) const;
    00247 #endif
    00248
    00254     bool operator==(const OBCisTransStereo &other) const;
    00260     bool operator!=(const OBCisTransStereo &other) const
    00261     {
    00262       return !(*this == other);
    00263     }
    00265
    00266     /*
    00267      * Implement OBGenericData::Clone().
    00268      */
    00269     OBGenericData* Clone(OBBase *mol) const;
    00270
    00271
    00273
    00274
    00301     bool IsOnSameAtom(unsigned long id1, unsigned long id2) const;
    00305     bool IsTrans(unsigned long id1, unsigned long id2) const;
    00309     bool IsCis(unsigned long id1, unsigned long id2) const;
    00314     unsigned long GetTransRef(unsigned long id) const;
    00319     unsigned long GetCisRef(unsigned long id) const;
    00321
    00322   private:
    00323     Config m_cfg;
    00324     // The following function sits behind GetCisRef and GetTransRef
    00325     unsigned long GetCisOrTransRef(unsigned long id, bool getcisref) const;
    00326 };
    00328
    00329 } // namespace OpenBabel
    00330
    00331 #ifndef SWIG
    00332 namespace std {
    00333
    00336
    00353 OBAPI ostream& operator<<(ostream &out, const OpenBabel::OBCisTransStereo &ct);
    00368 OBAPI ostream& operator<<(ostream &out, const OpenBabel::OBCisTransStereo::Config &cfg);
    00369
    00371
    00372 } // namespace std
    00373 #endif // Not SWIG
    00374
    00375 #endif
    00376

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines