00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef OC_ATOMS_H
00019
00020 #define OC_ATOMS_H
00021
00022 #include <string>
00023 #include <fstream>
00024 #include <sstream>
00025 #include <vector>
00026 #include "atomsElement.h"
00027
00028 class setOfAtoms {
00029 public:
00030
00031 typedef atomElement TelementBase ;
00032
00033
00034 setOfAtoms() ;
00035 setOfAtoms(const int size) ;
00036 ~setOfAtoms() ;
00037
00038 int getNumberOfAtoms() const
00039 { return _numberOfAtoms ;}
00040
00041 int numberOfAtoms() const
00042 { return _numberOfAtoms ;}
00043 void setNumberOfAtoms(const int size) ;
00044
00045 std::string getName(const int i) const
00046 {return _atoms[i]._name ;}
00047
00048 std::string getAtomName(const int i) const
00049 {return _atoms[i]._name ;}
00050
00051 std::string fragmentName(const int i) const
00052 {return _atoms[i]._fragName ;}
00053
00054 std::string& fragmentName(const int i)
00055 {return _atoms[i]._fragName ;}
00056
00057
00058
00059
00060 std::string & atomName(const int i)
00061 {return _atoms[i]._name ;}
00062
00063 atomElement getElement(const int i) const
00064 { return this->_atoms[i] ; }
00065
00066 atomElement& getElement(const int i)
00067 { return this->_atoms[i] ; }
00068
00069 atomElement & setElement(const int i)
00070 { return this->_atoms[i] ; }
00071
00072 int findNumberOfAtoms(std::ifstream & data) ;
00073
00074 int numberOfFragments() const
00075 {return _numberOfFragments ;}
00076
00077 int numberOfAA() const
00078 {return _numberOfAA ;}
00079
00080 int numberOfFragements() const
00081 {return _numberOfFragments ;}
00082
00083 void reset() ;
00084
00085 void copyFrom(const int beginAtom, const int EndAtom, const setOfAtoms & atoms) ;
00086
00087 void swap(const int i, const int j) ;
00088
00089 bool readQCIFile(std::ifstream & data) ;
00090 void readXYZFile(std::ifstream & data) ;
00091
00092 void writeQCIFile(std::ofstream & out, std::vector<int>& index) ;
00093 void writeXYZFile(std::ofstream & out, std::vector<int>& index) ;
00094 void writeQCIFile(std::ofstream & out) ;
00095 void writeXYZFile(std::ofstream & out) ;
00096 void writeXYZFile(std::ofstream & out, double *H) ;
00097 void writeXYZPosition(std::ofstream & out,double *H);
00098 void writeXYZFile(std::ofstream & out, double *H, const std::vector<int>& index) ;
00099 void writeVMDFile(std::ofstream & out, const std::vector< std::string > &color ) ;
00100
00101 void findMinMax(double *atomMin , double * atomMax ) ;
00102 void buildGravityCenter(double *G ) ;
00103 bool buildIinertialMatrix(double *coordG) ;
00104 void fixConnectivity(const std::vector<int> & reOrder) ;
00105
00106
00107 int getNumberOfFragments() ;
00108
00109
00110
00111
00112
00113 protected:
00114 int _numberOfAtoms ;
00115 int _numberOfAA ;
00116 int _numberOfFragments ;
00117 atomElement *_atoms ;
00118
00119 } ;
00120
00121 #endif