ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/OOPSE-2.0/src/openbabel/oopseformat.cpp
(Generate patch)

Comparing trunk/OOPSE-2.0/src/openbabel/oopseformat.cpp (file contents):
Revision 2458 by tim, Fri Nov 18 20:17:38 2005 UTC vs.
Revision 2469 by tim, Fri Dec 2 15:38:03 2005 UTC

# Line 101 | Line 101 | bool OOPSEFormat::AreSameFragments(OBMol& mol, vector<
101          return false;
102      }
103  
104 <    //exact graph matching is a NP complete problem,
104 >    //exact graph matching is a NP complete problem
105 >    /** @todo using sparse matrix to store the connectivities*/
106      for (unsigned int i =0 ; i < frag1.size(); ++i)
107      {
108 <        if (strcmp(mol.GetAtom(frag1[i])->GetType(), mol.GetAtom(frag2[i])->GetType()) )
108 >        OBAtom* atom1 = mol.GetAtom(frag1[i]);
109 >        OBAtom* atom2 = mol.GetAtom(frag2[i]);
110 >        
111 >        if (atom1->GetAtomicNum() != atom2->GetAtomicNum())
112          {
113              return false;
114          }
# Line 198 | Line 202 | void OOPSEFormat::WriteMDFile(vector<OBMol*> mols, vec
202          int ai = 0;
203          FOR_ATOMS_OF_MOL(atom, *pmol ) {
204              os << identLevel1 << "atom[" << ai << "] {\n";
205 <            os << identLevel2 << "type = " << "\"" << atom->GetType() << "\"" << ";\n";
205 >            os << identLevel2 << "type = " << "\"" << etab.GetSymbol(atom->GetAtomicNum()) << "\"" << ";\n";
206              os << identLevel1 << "}\n";
207              atomMap[&(*atom)] = ai++;
208          }        
# Line 280 | Line 284 | void OOPSEFormat::WriteINFile(OBMol& mol, ostream& ofs
284      for(vector<int>::iterator i = indices.begin();i != indices.end(); ++i)
285      {
286          atom = mol.GetAtom(*i);
287 <        sprintf(buffer,"%15s%15.5f%15.5f%15.5f%15.5f%15.5f%15.5f%15.5f%15.5f%15.5f%15.5f%15.5f%15.5f%15.5f",
288 <                atom->GetType(),
287 >        sprintf(buffer,"%-10s%-15.5f%-15.5f%-15.5f%-15.5f%-15.5f%-15.5f%-15.5f%-15.5f%-15.5f%-15.5f%-15.5f%-15.5f%-15.5f",
288 >                etab.GetSymbol(atom->GetAtomicNum()),
289                  atom->GetX(), atom->GetY(), atom->GetZ(),
290                  0.0, 0.0, 0.0,
291                  0.0, 0.0, 0.0, 0.0,

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines