00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef OB_GENERIC_H
00021 #define OB_GENERIC_H
00022
00023 #include <openbabel/babelconfig.h>
00024
00025 #include <string>
00026 #include <vector>
00027 #include <map>
00028
00029 #include <openbabel/math/spacegroup.h>
00030 #include <openbabel/obutil.h>
00031 #include <openbabel/base.h>
00032
00033 namespace OpenBabel
00034 {
00035
00036
00037 class OBBase;
00038 class OBAtom;
00039 class OBBond;
00040 class OBMol;
00041 class OBRing;
00042
00045 class OBAPI OBCommentData : public OBGenericData
00046 {
00047 protected:
00048 std::string _data;
00049 public:
00050 OBCommentData();
00051 OBCommentData(const OBCommentData&);
00052 virtual OBGenericData* Clone(OBBase* ) const{return new OBCommentData(*this);}
00053
00054 OBCommentData& operator=(const OBCommentData &src);
00055
00056 void SetData(const std::string &data)
00057 { _data = data; Trim(_data); }
00058 void SetData(const char *d)
00059 {_data = d; Trim(_data); }
00060 const std::string &GetData() const
00061 { return(_data); }
00062 virtual const std::string &GetValue() const
00063 { return(_data); }
00064 };
00065
00069 class OBAPI OBExternalBond
00070 {
00071 int _idx;
00072 OBAtom *_atom;
00073 OBBond *_bond;
00074 public:
00075 OBExternalBond(): _idx(0), _atom(NULL), _bond(NULL) {}
00076 OBExternalBond(OBAtom *,OBBond *,int);
00077 OBExternalBond(const OBExternalBond &);
00078 ~OBExternalBond() {}
00079
00080 int GetIdx() const { return(_idx); }
00081 OBAtom *GetAtom() const { return(_atom); }
00082 OBBond *GetBond() const { return(_bond); }
00083 void SetIdx(int idx) { _idx = idx; }
00084 void SetAtom(OBAtom *atom) { _atom = atom; }
00085 void SetBond(OBBond *bond) { _bond = bond; }
00086 };
00087
00090 class OBAPI OBExternalBondData : public OBGenericData
00091 {
00092 protected:
00093 std::vector<OBExternalBond> _vexbnd;
00094 public:
00095 OBExternalBondData();
00096
00097
00098 virtual OBGenericData* Clone(OBBase* ) const{return NULL;}
00099
00100 void SetData(OBAtom*,OBBond*,int);
00101 std::vector<OBExternalBond> *GetData()
00102 {
00103 return(&_vexbnd);
00104 }
00105 };
00106
00112 class OBAPI OBPairData : public OBGenericData
00113 {
00114 protected:
00115 std::string _value;
00116 public:
00117 OBPairData();
00118 virtual OBGenericData* Clone(OBBase* ) const
00119 {return new OBPairData(*this);}
00120 void SetValue(const char *v) { _value = v; }
00121 void SetValue(const std::string &v) { _value = v; }
00122 virtual const std::string &GetValue() const
00123 { return(_value); }
00124 };
00125
00128
00129 template <class ValueT>
00130 class OBAPI OBPairTemplate : public OBGenericData
00131 {
00132 protected:
00133 ValueT _value;
00134 public:
00135 OBPairTemplate():
00136 OBGenericData("PairData", OBGenericDataType::PairData) {};
00137 void SetValue(const ValueT t) { _value = t; }
00138 virtual const ValueT &GetGenericValue() const { return(_value); }
00139 };
00140
00142 typedef OBPairTemplate<int> OBPairInteger;
00144 typedef OBPairTemplate<double> OBPairFloatingPoint;
00145
00149 class OBAPI OBSetData : public OBGenericData
00150 {
00151 protected:
00152 std::vector<OBGenericData *> _vdata;
00153 public:
00154 OBSetData() : OBGenericData("SetData", OBGenericDataType::SetData) {}
00155 virtual OBGenericData* Clone(OBBase* ) const{return new OBSetData(*this);}
00156
00158 void AddData(OBGenericData *d)
00159 {
00160 if(d)
00161 {
00162 _vdata.push_back(d);
00163 }
00164 }
00165
00167 void SetData(std::vector<OBGenericData *> &vdata)
00168 {
00169 _vdata = vdata;
00170 }
00171
00173 OBGenericData *GetData(const char *s)
00174 {
00175 std::vector<OBGenericData*>::iterator i;
00176
00177 for (i = _vdata.begin();i != _vdata.end();++i)
00178 if ((*i)->GetAttribute() == s)
00179 return(*i);
00180
00181 return(NULL);
00182 }
00183
00185 OBGenericData *GetData(const std::string &s)
00186 {
00187 std::vector<OBGenericData*>::iterator i;
00188
00189 for (i = _vdata.begin();i != _vdata.end();++i)
00190 if ((*i)->GetAttribute() == s)
00191 return(*i);
00192
00193 return(NULL);
00194 }
00195
00197 virtual const std::vector<OBGenericData *> &GetData() const
00198 {
00199 return(_vdata);
00200 }
00201
00203 std::vector<OBGenericData*>::iterator GetBegin()
00204 {
00205 return _vdata.begin();
00206 }
00207
00209 std::vector<OBGenericData*>::iterator GetEnd()
00210 {
00211 return _vdata.end();
00212 }
00213
00215 void DeleteData(OBGenericData *gd)
00216 {
00217 std::vector<OBGenericData*>::iterator i;
00218 for (i = _vdata.begin();i != _vdata.end();++i)
00219 if (*i == gd)
00220 {
00221 delete *i;
00222 _vdata.erase(i);
00223 break;
00224 }
00225 }
00226
00227 };
00228
00232 class OBAPI OBVirtualBond : public OBGenericData
00233 {
00234 protected:
00235 int _bgn;
00236 int _end;
00237 int _ord;
00238 int _stereo;
00239 public:
00240 OBVirtualBond();
00241 virtual OBGenericData* Clone(OBBase* ) const{return new OBVirtualBond(*this);}
00242 OBVirtualBond(int,int,int,int stereo=0);
00243 int GetBgn() { return(_bgn); }
00244 int GetEnd() { return(_end); }
00245 int GetOrder() { return(_ord); }
00246 int GetStereo() { return(_stereo); }
00247 };
00248
00251 class OBAPI OBRingData : public OBGenericData
00252 {
00253 protected:
00254 std::vector<OBRing*> _vr;
00255 public:
00256 OBRingData();
00257 OBRingData(const OBRingData &);
00258 virtual OBGenericData* Clone(OBBase* ) const{return new OBRingData(*this);}
00259 ~OBRingData();
00260
00261 OBRingData &operator=(const OBRingData &);
00262
00263 void SetData(std::vector<OBRing*> &vr)
00264 {
00265 _vr = vr;
00266 }
00267 void PushBack(OBRing *r)
00268 {
00269 _vr.push_back(r);
00270 }
00271 std::vector<OBRing*> &GetData()
00272 {
00273 return(_vr);
00274 }
00275
00276 std::vector<OBRing*>::iterator BeginRings()
00277 { return(_vr.begin()); }
00278 std::vector<OBRing*>::iterator EndRings()
00279 { return(_vr.end()); }
00280 OBRing *BeginRing(std::vector<OBRing*>::iterator &i);
00281 OBRing *NextRing(std::vector<OBRing*>::iterator &i);
00282 };
00283
00288 class OBAPI OBUnitCell: public OBGenericData
00289 {
00290 public:
00291 enum LatticeType { Undefined,
00292 Triclinic,
00293 Monoclinic,
00294 Orthorhombic,
00295 Tetragonal,
00296 Rhombohedral ,
00297 Hexagonal,
00298 Cubic};
00299
00300
00301 protected:
00302 matrix3x3 _mOrtho;
00303 matrix3x3 _mOrient;
00304 vector3 _offset;
00305 std::string _spaceGroupName;
00306 const SpaceGroup* _spaceGroup;
00307 LatticeType _lattice;
00308 public:
00310 OBUnitCell();
00311 OBUnitCell(const OBUnitCell &);
00312 virtual OBGenericData* Clone(OBBase* ) const
00313 {return new OBUnitCell(*this);}
00314 ~OBUnitCell() {}
00315
00316 OBUnitCell &operator=(const OBUnitCell &);
00317
00327 void SetData(const double a, const double b, const double c,
00328 const double alpha, const double beta, const double gamma);
00336 void SetData(const vector3 v1, const vector3 v2, const vector3 v3);
00337
00343 void SetData(const matrix3x3 m);
00344
00346 void SetOffset(const vector3 v1);
00347
00350 void SetSpaceGroup(const SpaceGroup* sg) { _spaceGroup = sg; }
00351
00355 void SetSpaceGroup(const std::string sg) { _spaceGroup = SpaceGroup::GetSpaceGroup (sg);
00356 _spaceGroupName = sg; }
00357
00363 void SetSpaceGroup(const int sg) { _spaceGroup = SpaceGroup::GetSpaceGroup (sg); }
00364
00366 void SetLatticeType(const LatticeType lt) { _lattice = lt; }
00367
00370 void FillUnitCell(OBMol *);
00371
00373 double GetA();
00375 double GetB();
00377 double GetC();
00379 double GetAlpha();
00381 double GetBeta();
00383 double GetGamma();
00385 vector3 GetOffset();
00386
00388 const SpaceGroup* GetSpaceGroup() { return(_spaceGroup); }
00389
00391 const std::string GetSpaceGroupName() { return(_spaceGroupName); }
00392
00394 LatticeType GetLatticeType( int spacegroup );
00395
00397 LatticeType GetLatticeType();
00398
00400 std::vector<vector3> GetCellVectors();
00409 matrix3x3 GetCellMatrix();
00416 matrix3x3 GetOrthoMatrix();
00426 matrix3x3 GetOrientationMatrix();
00433 matrix3x3 GetFractionalMatrix();
00434
00441 vector3 FractionalToCartesian(vector3 frac);
00448 vector3 CartesianToFractional(vector3 cart);
00449
00453 vector3 WrapCartesianCoordinate(vector3 cart);
00457 vector3 WrapFractionalCoordinate(vector3 frac);
00458
00460 int GetSpaceGroupNumber( std::string name = "" );
00462 double GetCellVolume();
00463 };
00464
00470 class OBAPI OBConformerData: public OBGenericData
00471 {
00472 protected:
00474 std::vector<unsigned short> _vDimension;
00476 std::vector<double> _vEnergies;
00478 std::vector< std::vector< vector3 > > _vForces;
00480 std::vector< std::vector< vector3 > > _vVelocity;
00482 std::vector< std::vector< vector3 > > _vDisplace;
00484 std::vector<std::string> _vData;
00485
00486 public:
00487 OBConformerData();
00488 OBConformerData(const OBConformerData &);
00489 virtual OBGenericData* Clone(OBBase* ) const{return new OBConformerData(*this);}
00490 ~OBConformerData() {}
00491
00492 OBConformerData &operator=(const OBConformerData &);
00493
00494 void SetDimension(std::vector<unsigned short> vd) { _vDimension = vd; }
00495 void SetEnergies(std::vector<double> ve) { _vEnergies = ve; }
00496 void SetForces(std::vector< std::vector< vector3 > > vf) {_vForces = vf;}
00497 void SetVelocities(std::vector< std::vector< vector3 > > vv)
00498 { _vVelocity = vv; }
00499 void SetDisplacements(std::vector< std::vector< vector3 > > vd)
00500 { _vDisplace = vd; }
00501 void SetData(std::vector<std::string> vdat) { _vData = vdat; }
00502
00503 std::vector<unsigned short> GetDimension() { return _vDimension; }
00504 std::vector<double> GetEnergies() { return _vEnergies; }
00505 std::vector< std::vector< vector3 > > GetForces() {return _vForces; }
00506 std::vector< std::vector< vector3 > > GetVelocities()
00507 {return _vVelocity;}
00508 std::vector< std::vector< vector3 > > GetDisplacements()
00509 {return _vDisplace;}
00510 std::vector<std::string> GetData() { return _vData; }
00511
00512 };
00513
00518 class OBAPI OBSymmetryData: public OBGenericData
00519 {
00520 protected:
00521 std::string _spaceGroup;
00522 std::string _pointGroup;
00523 public:
00524 OBSymmetryData();
00525 OBSymmetryData(const OBSymmetryData &);
00526 virtual OBGenericData* Clone(OBBase* ) const{return new OBSymmetryData(*this);}
00527 ~OBSymmetryData() {}
00528
00529 OBSymmetryData &operator=(const OBSymmetryData &);
00530
00531 void SetData(std::string pg, std::string sg = "")
00532 { _pointGroup = pg; _spaceGroup = sg; }
00533 void SetPointGroup(std::string pg) { _pointGroup = pg; }
00534 void SetSpaceGroup(std::string sg) { _spaceGroup = sg; }
00535
00536 std::string GetPointGroup() { return _pointGroup; }
00537 std::string GetSpaceGroup() { return _spaceGroup; }
00538 };
00539
00543 class OBAPI OBTorsion
00544 {
00545 friend class OBMol;
00546 friend class OBTorsionData;
00547
00548 protected:
00549 std::pair<OBAtom*,OBAtom*> _bc;
00551 std::vector<triple<OBAtom*,OBAtom*,double> > _ads;
00552
00553 OBTorsion(): _bc(NULL, NULL) { }
00554
00555 OBTorsion(OBAtom *, OBAtom *, OBAtom *, OBAtom *);
00556
00557 std::vector<quad<OBAtom*,OBAtom*,OBAtom*,OBAtom*> > GetTorsions();
00558
00559 public:
00560 OBTorsion(const OBTorsion &);
00561 ~OBTorsion() {}
00562
00563 OBTorsion& operator=(const OBTorsion &);
00564
00565 void Clear();
00566 bool Empty() { return(_bc.first == 0 && _bc.second == 0); }
00567
00568 bool AddTorsion(OBAtom *a,OBAtom *b, OBAtom *c,OBAtom *d);
00569 bool AddTorsion(quad<OBAtom*,OBAtom*,OBAtom*,OBAtom*> &atoms);
00570
00571 bool SetAngle(double radians, unsigned int index = 0);
00572 bool SetData(OBBond * ) { return false; }
00573
00574 bool GetAngle(double &radians, unsigned int index =0);
00577 unsigned int GetBondIdx();
00578 size_t GetSize() const { return _ads.size(); }
00579
00582 std::pair<OBAtom*,OBAtom*> GetBC()
00583 {
00584 return(_bc);
00585 }
00588 std::vector<triple<OBAtom*,OBAtom*,double> > GetADs()
00589 {
00590 return(_ads) ;
00591 }
00592
00593 bool IsProtonRotor();
00594 };
00595
00600 class OBAPI OBTorsionData : public OBGenericData
00601 {
00602 friend class OBMol;
00603
00604 protected:
00605 std::vector<OBTorsion> _torsions;
00606
00607 OBTorsionData();
00608 OBTorsionData(const OBTorsionData &);
00609
00610 public:
00611 OBTorsionData &operator=(const OBTorsionData &);
00612
00614 virtual OBGenericData* Clone(OBBase* ) const
00615 {return new OBTorsionData(*this);}
00616
00617 void Clear();
00618
00621 std::vector<OBTorsion> GetData() const
00622 {
00623 return _torsions;
00624 }
00625
00628 size_t GetSize() const
00629 {
00630 return _torsions.size();
00631 }
00632
00633 void SetData(OBTorsion &torsion);
00634
00635 bool FillTorsionArray(std::vector<std::vector<unsigned int> > &torsions);
00636 };
00637
00640 class OBAPI OBAngle
00641 {
00642 friend class OBMol;
00643 friend class OBAngleData;
00644
00645 protected:
00646
00647
00648
00649 OBAtom *_vertex;
00650 std::pair<OBAtom*,OBAtom*> _termini;
00651 double _radians;
00652
00653
00654
00655 OBAngle();
00656 OBAngle(OBAtom *vertex,OBAtom *a,OBAtom *b);
00657
00658 triple<OBAtom*,OBAtom*,OBAtom*> GetAtoms();
00659 void SortByIndex();
00660
00661 public:
00662
00663 OBAngle(const OBAngle &);
00664 ~OBAngle()
00665 {
00666 _vertex = NULL;
00667 }
00668
00669 OBAngle &operator = (const OBAngle &);
00670 bool operator ==(const OBAngle &);
00671
00672 void Clear();
00673
00676 double GetAngle() const
00677 {
00678 return(_radians);
00679 }
00682 void SetAngle(double angle)
00683 {
00684 _radians = angle;
00685 }
00686 void SetAtoms(OBAtom *vertex,OBAtom *a,OBAtom *b);
00687 void SetAtoms(triple<OBAtom*,OBAtom*,OBAtom*> &atoms);
00688
00689 };
00690
00693 class OBAPI OBAngleData : public OBGenericData
00694 {
00695 friend class OBMol;
00696
00697 protected:
00698 std::vector<OBAngle> _angles;
00699
00700 OBAngleData();
00701 OBAngleData(const OBAngleData &);
00703
00704 std::vector<OBAngle> GetData() const
00705 {
00706 return(_angles);
00707 }
00708
00709 public:
00710 OBAngleData &operator =(const OBAngleData &);
00711 virtual OBGenericData* Clone(OBBase* ) const
00712 {return new OBAngleData(*this);}
00713
00714 void Clear();
00715 unsigned int FillAngleArray(int **angles, unsigned int &size);
00716 bool FillAngleArray(std::vector<std::vector<unsigned int> > &angles);
00717
00718 void SetData(OBAngle &);
00721 size_t GetSize() const
00722 {
00723 return _angles.size();
00724 }
00725 };
00726
00727 enum atomreftype{
00728 output,
00729 input,
00730 calcvolume
00731 };
00732
00735 class OBAPI OBChiralData : public OBGenericData
00736 {
00737 friend class OBMol;
00738 friend class OBAtom;
00739
00740 protected:
00741 std::vector<unsigned int> _atom4refs;
00742 std::vector<unsigned int> _atom4refo;
00743 std::vector<unsigned int> _atom4refc;
00744
00747 int parity;
00748
00749 public:
00750
00751 OBChiralData();
00752 OBChiralData(const OBChiralData &src);
00753 virtual OBGenericData* Clone(OBBase* ) const
00754 { return new OBChiralData(*this); }
00755 OBChiralData &operator =(const OBChiralData &);
00756 ~OBChiralData(){}
00757
00758 void Clear();
00759
00761 std::vector<unsigned int> GetAtom4Refs(atomreftype t) const;
00763 unsigned int GetAtomRef(int a,atomreftype t);
00764
00765 bool SetAtom4Refs(std::vector<unsigned int> atom4refs, atomreftype t);
00766 int AddAtomRef(unsigned int atomref, atomreftype t);
00767
00769 unsigned int GetSize(atomreftype t) const;
00770 };
00771
00774 class OBSerialNums : public OBGenericData
00775 {
00776 protected:
00777 std::map<int, OBAtom*> _serialMap;
00778
00779 public:
00780
00781 OBSerialNums() :
00782 OBGenericData("obSerialNums", OBGenericDataType::SerialNums)
00783 {}
00784
00785 OBSerialNums(const OBSerialNums &cp) : OBGenericData(cp)
00786 {
00787 _serialMap = cp._serialMap;
00788 }
00791 virtual OBGenericData* Clone(OBBase* ) const
00792 {return new OBSerialNums(*this);}
00793
00794 std::map<int,OBAtom*> &GetData() { return _serialMap; }
00795 void SetData(std::map<int,OBAtom*> &sm) { _serialMap = sm; }
00796
00797 };
00798
00801 class OBAPI OBVibrationData: public OBGenericData
00802 {
00803 protected:
00805 std::vector< std::vector< vector3 > > _vLx;
00806
00808 std::vector<double> _vFrequencies;
00809
00811 std::vector<double> _vIntensities;
00812
00814 std::vector<double> _vRamanActivities;
00815
00816 public:
00817 OBVibrationData(): OBGenericData("VibrationData", OBGenericDataType::VibrationData){};
00818 virtual ~OBVibrationData() {}
00819 virtual OBGenericData* Clone(OBBase*) const
00820 {return new OBVibrationData(*this);}
00821
00822 OBVibrationData & operator=(const OBVibrationData &);
00823
00824 void SetData(const std::vector< std::vector< vector3 > > & lx,
00825 const std::vector<double> & frequencies,
00826 const std::vector<double> & intensities);
00827 void SetData(const std::vector< std::vector< vector3 > > &,
00828 const std::vector<double> &,
00829 const std::vector<double> &,
00830 const std::vector<double> &);
00831
00832 std::vector< std::vector< vector3 > > GetLx() const
00833 { return this->_vLx; }
00834 std::vector<double> GetFrequencies() const
00835 { return this->_vFrequencies; }
00836 std::vector<double> GetIntensities() const
00837 { return this->_vIntensities; }
00838 std::vector<double> GetRamanActivities() const
00839 { return this->_vRamanActivities; }
00840
00841 unsigned int GetNumberOfFrequencies() const;
00842 };
00843
00846 class OBAPI OBDOSData: public OBGenericData
00847 {
00848 protected:
00850 double _fermi;
00851
00853 std::vector<double> _vEnergies;
00854
00856 std::vector<double> _vDensities;
00857
00859 std::vector<double> _vIntegration;
00860
00861 public:
00862 OBDOSData(): OBGenericData("DOSData", OBGenericDataType::DOSData){};
00863 virtual ~OBDOSData() {}
00864 virtual OBGenericData* Clone(OBBase*) const
00865 {return new OBDOSData(*this);}
00866
00867 OBDOSData & operator=(const OBDOSData &);
00868
00869 void SetData(double,
00870 const std::vector<double> &,
00871 const std::vector<double> &,
00872 const std::vector<double> &);
00873
00874 double GetFermiEnergy() const
00875 { return this->_fermi; }
00876 std::vector<double> GetEnergies() const
00877 { return this->_vEnergies; }
00878 std::vector<double> GetDensities() const
00879 { return this->_vDensities; }
00880 std::vector<double> GetIntegration() const
00881 { return this->_vIntegration; }
00882 };
00883
00886 class OBAPI OBOrbitalEnergyData: public OBGenericData
00887 {
00888 protected:
00889 std::vector<double> _alphaEigenvalues;
00890 std::vector<double> _betaEigenvalues;
00891 std::vector<std::string> _alphaMullikenSymbols;
00892 std::vector<std::string> _betaMullikenSymbols;
00893 };
00894
00897 class OBAPI OBElectronicTransitionData: public OBGenericData
00898 {
00899 protected:
00901 std::vector<double> _vWavelengths;
00902
00904 std::vector<double> _vForces;
00905
00907 std::vector<double> _vEDipole;
00908
00910 std::vector<double> _vRotatoryStrengthsVelocity;
00911
00913 std::vector<double> _vRotatoryStrengthsLength;
00914
00915 public:
00916 OBElectronicTransitionData(): OBGenericData("ElectronicTransitionData", OBGenericDataType::ElectronicTransitionData) {}
00917 virtual ~OBElectronicTransitionData() {}
00918 virtual OBGenericData* Clone(OBBase*) const
00919 {return new OBElectronicTransitionData(*this);}
00920
00921 OBElectronicTransitionData & operator=(const OBElectronicTransitionData &);
00922
00923 void SetData(const std::vector<double> & wavelengths,
00924 const std::vector<double> & forces);
00925
00926 void SetEDipole(const std::vector<double> &);
00927 void SetRotatoryStrengthsVelocity(const std::vector<double> &);
00928 void SetRotatoryStrengthsLength(const std::vector<double> &);
00929
00930 std::vector<double> GetWavelengths() const
00931 { return this->_vWavelengths; }
00932 std::vector<double> GetForces() const
00933 { return this->_vForces; }
00934 std::vector<double> GetEDipole() const
00935 { return this->_vEDipole; }
00936 std::vector<double> GetRotatoryStrengthsVelocity() const
00937 { return this->_vRotatoryStrengthsVelocity; }
00938 std::vector<double> GetRotatoryStrengthsLength() const
00939 { return this->_vRotatoryStrengthsLength; }
00940 };
00941
00944 class OBAPI OBRotationData: public OBGenericData
00945 {
00946 public:
00947 enum RType{UNKNOWN, ASYMMETRIC, SYMMETRIC, LINEAR};
00948 OBRotationData(): OBGenericData("RotationData", OBGenericDataType::RotationData){}
00949 virtual ~OBRotationData(){};
00950 virtual OBGenericData* Clone(OBBase*) const
00951 {return new OBRotationData(*this);}
00952 void SetData(RType RotorType, std::vector<double> RotationalConstants, int SymmetryNumber)
00953 {
00954 RotConsts = RotationalConstants;
00955 type = RotorType;
00956 SymNum = SymmetryNumber;
00957 }
00958
00960 std::vector<double> GetRotConsts()const{ return RotConsts; }
00961
00962 int GetSymmetryNumber()const{ return SymNum; }
00963 RType GetRotorType()const { return type; }
00964
00965 protected:
00966 std::vector<double> RotConsts;
00967 int SymNum;
00968 RType type;
00969 };
00970
00974 class OBAPI OBVectorData: public OBGenericData
00975 {
00976 public:
00977 OBVectorData(): OBGenericData("VectorData", OBGenericDataType::VectorData){}
00978 virtual ~OBVectorData(){};
00979 virtual OBGenericData* Clone(OBBase*) const
00980 {return new OBVectorData(*this);}
00981 void SetData(double x, double y, double z)
00982 { _vec = vector3(x, y, z); }
00983 void SetData(vector3 data)
00984 { _vec = data; }
00985 vector3 GetData() const
00986 { return _vec; }
00987
00988 protected:
00989 vector3 _vec;
00990 };
00991
00995 class OBAPI OBMatrixData: public OBGenericData
00996 {
00997 public:
00998 OBMatrixData(): OBGenericData("MatrixData", OBGenericDataType::MatrixData){}
00999 virtual ~OBMatrixData(){};
01000 virtual OBGenericData* Clone(OBBase*) const
01001 {return new OBMatrixData(*this);}
01002 void SetData(matrix3x3 data)
01003 { _matrix = data; }
01004 matrix3x3 GetData() const
01005 { return _matrix; }
01006
01007 protected:
01008 matrix3x3 _matrix;
01009 };
01010
01012 typedef std::vector<OBGenericData*>::iterator OBDataIterator;
01013
01014 }
01015
01016 #endif // OB_GENERIC_H
01017