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

Comparing trunk/src/openbabel/rotor.cpp (file contents):
Revision 751 by gezelter, Thu Nov 17 20:38:45 2005 UTC vs.
Revision 1081 by gezelter, Thu Oct 19 20:49:05 2006 UTC

# Line 2 | Line 2 | Copyright (C) 1998-2000 by OpenEye Scientific Software
2   rotor.cpp - Rotate dihedral angles according to rotor rules.
3  
4   Copyright (C) 1998-2000 by OpenEye Scientific Software, Inc.
5 < Some portions Copyright (C) 2001-2005 by Geoffrey R. Hutchison
5 > Some portions Copyright (C) 2001-2006 by Geoffrey R. Hutchison
6  
7   This file is part of the Open Babel project.
8   For more information, see <http://openbabel.sourceforge.net/>
# Line 54 | Line 54 | bool OBRotorList::Setup(OBMol &mol)
54              char buffer[BUFF_SIZE];
55              sprintf(buffer,"The rotor has no associated torsion values -> %d %d %d %d",ref[0],ref[1],ref[2],ref[3]);
56  
57 <            obErrorLog.ThrowError(__FUNCTION__, buffer, obDebug);
57 >            obErrorLog.ThrowError(__func__, buffer, obDebug);
58          }
59  
60      return(true);
# Line 66 | Line 66 | bool OBRotorList::FindRotors(OBMol &mol)
66      vector<int> gtd;
67      mol.GetGTDVector(gtd);
68  
69 <    obErrorLog.ThrowError(__FUNCTION__,
69 >    obErrorLog.ThrowError(__func__,
70                            "Ran OpenBabel::FindRotors", obAuditMsg);
71  
72      OBBond *bond;
# Line 226 | Line 226 | void OBRotorList::RemoveSymVals(OBMol &mol)
226                errorMsg << bond->GetBeginAtomIdx() << ' ' << bond->GetEndAtomIdx() << ' ' ;
227                errorMsg << "rms = " << ' ';
228                errorMsg << MinimumPairRMS(mol,c1,c2,one2one) << endl;
229 <              obErrorLog.ThrowError(__FUNCTION__, errorMsg.str(), obDebug);
229 >              obErrorLog.ThrowError(__func__, errorMsg.str(), obDebug);
230              }
231              continue;
232          }
# Line 253 | Line 253 | void OBRotorList::RemoveSymVals(OBMol &mol)
253                errorMsg << bond->GetBeginAtomIdx() << ' ' << bond->GetEndAtomIdx() << ' ' ;
254                errorMsg << "rms = " << ' ';
255                errorMsg << MinimumPairRMS(mol,c1,c2,one2one) << endl;
256 <              obErrorLog.ThrowError(__FUNCTION__, errorMsg.str(), obDebug);
256 >              obErrorLog.ThrowError(__func__, errorMsg.str(), obDebug);
257              }
258          }
259      }
# Line 288 | Line 288 | void OBRotorList::RemoveSymVals(OBMol &mol)
288   #endif
289                errorMsg << "2-fold pattern-based symmetry found = " << ' ';
290                errorMsg << ref[1] << ' ' << ref[2] << endl;
291 <              obErrorLog.ThrowError(__FUNCTION__, errorMsg.str(), obDebug);
291 >              obErrorLog.ThrowError(__func__, errorMsg.str(), obDebug);
292                          }
293                      }
294                  }
# Line 316 | Line 316 | void OBRotorList::RemoveSymVals(OBMol &mol)
316   #endif
317                            errorMsg << "3-fold pattern-based symmetry found = " << ' ';
318                            errorMsg << ref[1] << ' ' << ref[2] << endl;
319 <                          obErrorLog.ThrowError(__FUNCTION__, errorMsg.str(), obDebug);
319 >                          obErrorLog.ThrowError(__func__, errorMsg.str(), obDebug);
320                          }
321                      }
322                  }
# Line 870 | Line 870 | OBRotorRules::OBRotorRules()
870   {
871      _quiet=false;
872      _init = false;
873 <    STR_DEFINE(_dir, FRC_PATH);
873 >    STR_DEFINE(_dir, FRC_PATH );
874      _envvar = "FORCE_PARAM_PATH";
875      _filename = "torlib.txt";
876      _subdir = "data";
# Line 919 | Line 919 | void OBRotorRules::ParseLine(const char *buffer)
919  
920      if (!vs.empty() && vs.size() > 5)
921      {
922 <        strcpy(temp_buffer,vs[0].c_str());
922 >        strncpy(temp_buffer,vs[0].c_str(), sizeof(temp_buffer) - 1);
923 >        temp_buffer[sizeof(temp_buffer) - 1] = '\0';
924          //reference atoms
925          for (i = 0;i < 4;i++)
926              ref[i] = atoi(vs[i+1].c_str())-1;
# Line 941 | Line 942 | void OBRotorRules::ParseLine(const char *buffer)
942          {
943              string err = "The following rule has no associated torsions: ";
944              err += vs[0];
945 <            obErrorLog.ThrowError(__FUNCTION__, err, obDebug);
945 >            obErrorLog.ThrowError(__func__, err, obDebug);
946          }
947          OBRotorRule *rr = new OBRotorRule (temp_buffer,ref,vals,delta);
948          if (rr->IsValid())
# Line 1047 | Line 1048 | void OBRotorRules::GetRotorIncrements(OBMol &mol,OBBon
1048          char buffer[BUFF_SIZE];
1049          if (!_quiet)
1050          {
1051 <            sprintf(buffer,"%3d%3d%3d%3d %s",
1051 >            snprintf(buffer, BUFF_SIZE, "%3d%3d%3d%3d %s",
1052                      ref[0],ref[1],ref[2],ref[3],
1053                      ((*i)->GetSmartsString()).c_str());
1054 <            obErrorLog.ThrowError(__FUNCTION__, buffer, obDebug);
1054 >            obErrorLog.ThrowError(__func__, buffer, obDebug);
1055          }
1056          return;
1057      }
# Line 1080 | Line 1081 | void OBRotorRules::GetRotorIncrements(OBMol &mol,OBBon
1081          if (!_quiet)
1082          {
1083              char buffer[BUFF_SIZE];
1084 <            sprintf(buffer,"%3d%3d%3d%3d %s",
1084 >            snprintf(buffer,BUFF_SIZE,"%3d%3d%3d%3d %s",
1085                      ref[0],ref[1],ref[2],ref[3],"sp3-sp3");
1086 <            obErrorLog.ThrowError(__FUNCTION__, buffer, obDebug);
1086 >            obErrorLog.ThrowError(__func__, buffer, obDebug);
1087          }
1088      }
1089      else
# Line 1093 | Line 1094 | void OBRotorRules::GetRotorIncrements(OBMol &mol,OBBon
1094              if (!_quiet)
1095              {
1096                  char buffer[BUFF_SIZE];
1097 <                sprintf(buffer,"%3d%3d%3d%3d %s",
1097 >                snprintf(buffer,BUFF_SIZE,"%3d%3d%3d%3d %s",
1098                          ref[0],ref[1],ref[2],ref[3],"sp2-sp2");
1099 <                obErrorLog.ThrowError(__FUNCTION__, buffer, obDebug);
1099 >                obErrorLog.ThrowError(__func__, buffer, obDebug);
1100              }
1101          }
1102          else //must be sp2-sp3
# Line 1105 | Line 1106 | void OBRotorRules::GetRotorIncrements(OBMol &mol,OBBon
1106              if (!_quiet)
1107              {
1108                  char buffer[BUFF_SIZE];
1109 <                sprintf(buffer,"%3d%3d%3d%3d %s",
1109 >                snprintf(buffer,BUFF_SIZE,"%3d%3d%3d%3d %s",
1110                          ref[0],ref[1],ref[2],ref[3],"sp2-sp3");
1111 <                obErrorLog.ThrowError(__FUNCTION__, buffer, obDebug);
1111 >                obErrorLog.ThrowError(__func__, buffer, obDebug);
1112              }
1113          }
1114   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines