Enum values that control the adjustHydrogen function’s behavior.
Only add hydrogens to underbonded atoms.
Only remove hydrogens from overbonded atoms.
Add hydrogens to underbonded atoms and remove hydrogens from overbonded atoms.
Public Static Functions
adjustHydrogens(RWMolecule &molecule, Adjustment adjustment = AddAndRemove)¶
Add/remove hydrogens on molecule to satisfy valency.
adjustHydrogens(RWAtom &atom, Adjustment adjustment = AddAndRemove)¶
Add/remove hydrogens on atom to satisfy valency.
valencyAdjustment(const RWAtom &atom)¶
The number of bonds that need to be added or removed from atom to satisfy valency. A positive number indicates the number of bonds to add, a negative number indicates the number of bonds that need to be removed.
extraHydrogenIndices(const RWAtom &atom, int numberOfHydrogens, std::vector<size_t> &indices)¶
Obtain the indices of hydrogens that can be removed from atom.
This function modifies neither atom nor its parent molecule. It only pushes the indices of hydrogens to remove to the end of indices.
atom – The atom from which to prune hydrogens.
numberOfHydrogens – The maximum number of hydrogens to prune.
indices – A vector that will be appended with the indices of the hydrogens to remove.
The number of hydrogen indices appended to indices.
generateNewHydrogenPositions(const RWAtom &atom, int numberOfHydrogens, std::vector<Vector3> &positions)¶
Generate positions for numberOfHydrogens hydrogens bonded to atom.
There is nothing intelligent going on here. The new positions are randomly oriented and have a length that is the sum of atom’s and hydrogen’s covalent radii. Effort is made to prevent overlap with other bonded atoms, but this is not guaranteed.
positions – Vector of positions that will be appended with numberOfHydrogens hydrogen locations.
perceiveHybridization(const RWAtom &atom)¶
Perceive the geometry / hybridization bonded to atom. Ideally, the client should cache the hybridization number by calling setHybridization() later