OEAddMolsΒΆ

bool OEAddMols(OEMolBase &lhs, const OEMolBase &rhs,
               OEAtomBase **aa=(OEAtomBase **) 0,
               OEBondBase **bb=(OEBondBase **) 0)
bool OEAddMols(OEMolBase &lhs, const OEMolBase &rhs,
               const char *delim,
               OEAtomBase **aa=(OEAtomBase **) 0,
               OEBondBase **bb=(OEBondBase **) 0)

OEAddMols is a function used to add the data from the ‘rhs’ molecule to the ‘lhs’ molecule. For historical reasons, there are two API points, the function call without a ‘delim’ argument uses _ as the title delimiter. The function with a ‘delim’ concatenated the title of the ‘rhs’ molecule onto the ‘lhs’ molecules using the delimiter passed. The empty string (e.g. "") is a valid argument, and causes a direct concatenation of the two titles. If (char *)0 is passed as the argument, no concatenation of titles occurs.

In both functions, there are two arguments that default to 0. These arguments can be used to obtain mappings between the atoms and bonds in the original ‘rhs’ molecule and the newly created atoms and bonds in the ‘lhs’ molecule. It is assumed that arguments passed to ‘aa’ are arrays of atom pointers of at least rhs.GetMaxAtomIdx() in size and that arguments passed to ‘bb’ are arrays of bond pointers of at least rhs.GetMaxBondIdx() in size. After the function has been called, for any atom ‘rhsAtom’ from the ‘rhs’ molecule, the corresponding new atom in the ‘lhs’ molecule can be obtained by an atom index lookup into the array.

See also

Note

OEAddMols will not automatically perceive bonds between the molecules added. Bonds and bond orders can be re-perceived by OEDetermineConnectivity and OEPerceiveBondOrders after constructing a new molecule through OEAddMols.