ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/OpenMD/trunk/src/openbabel/kekulize.cpp
(Generate patch)

Comparing trunk/src/openbabel/kekulize.cpp (file contents):
Revision 819 by tim, Fri Dec 16 21:52:50 2005 UTC vs.
Revision 1081 by gezelter, Thu Oct 19 20:49:05 2006 UTC

# Line 59 | Line 59 | void OBMol::NewPerceiveKekuleBonds()
59    OBBond *bond;
60    std::vector<OBEdgeBase*>::iterator bi;
61    std::vector<int> electron;
62 <  int BO;
63 <  int sume, orden, bestorden, bestatom;
62 >  int sume, orden, bestatom;
63 >  int bestorden = 99;
64    // Init the kekulized bonds
65    unsigned i;
66 <        for(i=0; i< NumBonds(); i++ ) {
67 <    bond = GetBond(i);
68 <    BO = bond->GetBO();
69 <    switch (BO)
66 >  FOR_BONDS_OF_MOL(bond, *this)
67      {
68 <    case 1: bond->SetKSingle(); break;
69 <    case 2: bond->SetKDouble(); break;
70 <    case 3: bond->SetKTriple(); break;
68 >      switch (bond->GetBO())
69 >        {
70 >        case 1: bond->SetKSingle(); break;
71 >        case 2: bond->SetKDouble(); break;
72 >        case 3: bond->SetKTriple(); break;
73 >        }
74      }
75  }
75  
76    // Find all the groups of aromatic cycle
77    for(i=1; i<= NumAtoms(); i++ ) {
# Line 347 | Line 346 | void OBMol::start_kekulize( std::vector <OBAtom*> &cyc
346      bond = GetBond(i);    
347      // std::cout << "bond " << bond->GetBeginAtomIdx() << " " << bond->GetEndAtomIdx() << " ";
348      if (bond->GetBO()==5 && bcurrentState[i] == DOUBLE) {
349 +      if ( (bond->GetBeginAtom())->IsSulfur()
350 +           && bond->GetEndAtom()->IsSulfur() ) {
351 +        // no double bonds between aromatic sulfur atoms -- PR#1504089
352 +        continue;
353 +      }
354 +
355        bond->SetKDouble();
356        bond->SetBO(2);
357        //std::cout << "double\n";

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines