Index: model.cpp =================================================================== RCS file: /cvsroot/libghemical/src/model.cpp,v retrieving revision 1.70 diff -c -5 -p -b -d -w -r1.70 model.cpp *** model.cpp 23 Mar 2006 11:42:05 -0000 1.70 --- model.cpp 27 Mar 2006 18:23:26 -0000 *************** void model::AddHydrogens(void) *** 1725,1736 **** --- 1725,1753 ---- else { PrintToLog("Using default rules in AddHydrogens().\n"); } + // first check to see if the user selected anything + // if so, only add hydrogens to the selected atoms + iter_al it1 = atom_list.begin(); + bool atoms_selected = false; // is anything selected by the user? + while (it1 != atom_list.end()) + if ((* it1++).flags & ATOMFLAG_USER_SELECTED) + { + atoms_selected = true; + break; + } + + for (iter_al it1 = atom_list.begin();it1 != atom_list.end();it1++) { + + // if the user selected atoms, only do this if the atom is selected + if (atoms_selected && (! (* it1).flags & ATOMFLAG_USER_SELECTED) ) + continue; + bool skip = true; fGL valence = NOT_DEFINED; int an = (* it1).el.GetAtomicNumber(); switch (an)