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_SQUAREPLANAR_H
00025 #define OB_SQUAREPLANAR_H
00026
00027 #include <openbabel/stereo/tetraplanar.h>
00028 #include <vector>
00029
00030 namespace OpenBabel {
00031
00034
00048 class OBAPI OBSquarePlanarStereo : public OBTetraPlanarStereo
00049 {
00050 public:
00070 #ifndef SWIG
00071 struct OBAPI Config
00072 {
00077 Config() : center(OBStereo::NoRef), shape(OBStereo::ShapeU),
00078 specified(true)
00079 { }
00087 Config(unsigned long _center, const OBStereo::Refs &_refs,
00088 OBStereo::Shape _shape = OBStereo::ShapeU) : center(_center),
00089 refs(_refs), shape(_shape), specified(true)
00090 { }
00155 bool operator==(const Config &other) const;
00161 bool operator!=(const Config &other) const
00162 {
00163 return !(*this == other);
00164 }
00165
00170 unsigned long center;
00171 OBStereo::Refs refs;
00172 OBStereo::Shape shape;
00173 bool specified;
00174
00175
00176 };
00177 #endif
00178
00181 OBSquarePlanarStereo(OBMol *mol);
00185 virtual ~OBSquarePlanarStereo();
00186
00189
00193 OBStereo::Type GetType() const { return OBStereo::SquarePlanar; }
00198 bool IsValid() const;
00199
00203 #ifndef SWIG
00204 void SetConfig(const Config &config);
00208 Config GetConfig(OBStereo::Shape shape = OBStereo::ShapeU) const;
00213 Config GetConfig(unsigned long start,
00214 OBStereo::Shape shape = OBStereo::ShapeU) const;
00215 #endif
00216
00222 bool operator==(const OBSquarePlanarStereo &other) const;
00228 bool operator!=(const OBSquarePlanarStereo &other) const
00229 {
00230 return !(*this == other);
00231 }
00233
00234
00235
00236
00237 OBGenericData* Clone(OBBase *mol) const;
00238
00240
00241
00244 bool IsTrans(unsigned long id1, unsigned long id2) const;
00248 bool IsCis(unsigned long id1, unsigned long id2) const;
00253 unsigned long GetTransRef(unsigned long id) const;
00257 std::vector<unsigned long> GetCisRefs(unsigned long id) const;
00259
00260 private:
00261 Config m_cfg;
00262
00263 unsigned long GetCisOrTransRef(unsigned long id, bool getcisref) const;
00264 };
00266
00267
00268 }
00269
00270 #ifndef SWIG
00271 namespace std {
00272
00275
00291 OBAPI ostream& operator<<(ostream &out, const OpenBabel::OBSquarePlanarStereo &ct);
00305 OBAPI ostream& operator<<(ostream &out, const OpenBabel::OBSquarePlanarStereo::Config &cfg);
00306
00308
00309 }
00310 #endif // Not SWIG
00311
00312 #endif
00313