Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef OB_TETRAHEDRAL_H
00025 #define OB_TETRAHEDRAL_H
00026
00027 #include <openbabel/stereo/tetranonplanar.h>
00028
00029 namespace OpenBabel {
00030
00033
00058 class OBAPI OBTetrahedralStereo : public OBTetraNonPlanarStereo
00059 {
00060 public:
00061 #ifndef SWIG
00062
00084 struct OBAPI Config
00085 {
00091 Config() : center(OBStereo::NoRef), from(OBStereo::NoRef),
00092 winding(OBStereo::Clockwise), view(OBStereo::ViewFrom),
00093 specified(true)
00094 { }
00104 Config(unsigned long _center, unsigned long from_or_towards,
00105 const OBStereo::Refs &_refs, OBStereo::Winding _winding = OBStereo::Clockwise,
00106 OBStereo::View _view = OBStereo::ViewFrom) : center(_center),
00107 from(from_or_towards), refs(_refs), winding(_winding), view(_view),
00108 specified(true)
00109 { }
00149 bool operator==(const Config &other) const;
00155 bool operator!=(const Config &other) const
00156 {
00157 return !(*this == other);
00158 }
00159
00164 unsigned long center;
00172 union {
00173 unsigned long from;
00174 unsigned long towards;
00175 };
00176 OBStereo::Refs refs;
00177 OBStereo::Winding winding;
00178 OBStereo::View view;
00179 bool specified;
00180
00181
00182 };
00183 #endif
00184
00187 OBTetrahedralStereo(OBMol *mol);
00191 virtual ~OBTetrahedralStereo();
00192
00195
00199 OBStereo::Type GetType() const { return OBStereo::Tetrahedral; }
00204 bool IsValid() const;
00205 #ifndef SWIG
00206
00209 void SetConfig(const Config &config);
00213 Config GetConfig(OBStereo::Winding winding = OBStereo::Clockwise,
00214 OBStereo::View view = OBStereo::ViewFrom) const;
00218 Config GetConfig(unsigned long from_or_towards,
00219 OBStereo::Winding winding = OBStereo::Clockwise,
00220 OBStereo::View view = OBStereo::ViewFrom) const;
00221 #endif
00222
00228 bool operator==(const OBTetrahedralStereo &other) const;
00234 bool operator!=(const OBTetrahedralStereo &other) const
00235 {
00236 return !(*this == other);
00237 }
00239
00240
00241
00242
00243 OBGenericData* Clone(OBBase *mol) const;
00244 private:
00245 Config m_cfg;
00246 };
00248
00249
00250 }
00251
00252 #ifndef SWIG
00253 namespace std {
00254
00257
00275 OBAPI ostream& operator<<(ostream &out, const OpenBabel::OBTetrahedralStereo &ts);
00291 OBAPI ostream& operator<<(ostream &out, const OpenBabel::OBTetrahedralStereo::Config &cfg);
00292
00294
00295 }
00296 #endif // SWIG
00297
00298 #endif
00299