Hi George, On Fri, Jul 24, 2009 at 5:11 PM, George Oakman<[email protected]> wrote: > > I wonder if someone would so kind as to explain very briefly the concept of > Bookmarks in the ROMol class. I am hoping this is something I can use to > identify the location of substructure after a SubstructMatch, but maybe I'm > completely off piste!
You certainly could use them to mark atoms that match substructures if you like -- bookmarks are a general purpose tool for associating atoms or bonds with integers. There's not a lot to explain beyond that. You can associate an atom with a bookmark by calling ROMol::setAtomBookmark with a pointer (or smart pointer) to the atom. The bookmark system takes no responsibility for memory allocation, so you don't need to worry about it deleteing atoms you might be using elsewhere (similarly, you should be careful not to delete an atom pointer that is bookmarked). Calling setAtomBookmark repeatedly with the same integer associates multiple atoms with the bookmark. getAtomWithBookmark() or getAllAtomsWithBookmark() returns the first atom (or all atoms) with the provided bookmark (or generates an error if no such bookmark exists, so be sure to call hasAtomBookmark() if you have any doubts). The various forms of clearAtomBookmark clear the bookmark for either a single atom or all associated atoms. All of the above also holds for bonds. That's all I can think of to say about the system... any questions left unanswered? -greg

