1
/**********************************************************************
2
Copyright (C) 2000 by OpenEye Scientific Software, Inc.
4
This program is free software; you can redistribute it and/or modify
5
it under the terms of the GNU General Public License as published by
6
the Free Software Foundation version 2 of the License.
8
This program is distributed in the hope that it will be useful,
9
but WITHOUT ANY WARRANTY; without even the implied warranty of
10
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
GNU General Public License for more details.
12
***********************************************************************/
19
bool ReadAmberPrep(istream &ifs,OBMol &mol,char *title)
21
char buffer[BUFF_SIZE];
24
OBInternalCoord *coord;
26
vector<OBInternalCoord*> internals;
28
ttab.SetFromType("XYZ");
31
while (ifs.getline(buffer,BUFF_SIZE))
37
coord = new OBInternalCoord();
38
if (mol.NumAtoms() > 1)
39
coord->_a = mol.GetAtom(atoi(vs[4].c_str()));
40
if (mol.NumAtoms() > 2)
41
coord->_b = mol.GetAtom(atoi(vs[5].c_str()));
42
if (mol.NumAtoms() > 3)
43
coord->_c = mol.GetAtom(atoi(vs[6].c_str()));
44
coord->_dst = atof(vs[7].c_str());
45
coord->_ang = atof(vs[8].c_str());
46
coord->_tor = atof(vs[9].c_str());
47
internals.push_back(coord);
49
atom->SetAtomicNum(etab.GetAtomicNum(vs[1].c_str()));
50
ttab.SetToType("INT"); ttab.Translate(str,vs[1]);
53
if (!ifs.getline(buffer,BUFF_SIZE)) break;
57
InternalToCartesian(internals,mol);