# OEGetSubtree¶

OESystem::OEIterBase<OEAtomBase> *
OEGetSubtree(const OEAtomBase *bgn,
const OEAtomBase *end)
OESystem::OEIterBase<OEAtomBase> *
OEGetSubtree(const OEBondBase *,
const OESystem::OEUnaryPredicate<OEAtomBase> &excludeAtoms)


Traverses the subgraph from the beginning atom of the bond passed as the first argument without crossing the bond itself. If the subgraph traversal does not cross any atoms which return true when tested with the ‘excludeAtoms’ predicate, then an iterator over the atoms contained in the subgraph is returned. If ‘excludeAtoms` are encountered in the subgraph traversal, the subgraph is discarded and a new traversal begins from the end atom of the bond. If the new traversal fails to encounter excluded atoms then an iterator over the atoms contained in the subgraph is returned. The iterator over atoms includes the atom of the bond from which the returned traversal originated. If both traversals fail then an iterator over an empty set of atoms is returned.