Hi All,
    I wanted to double check with you guys if what I am doing is compatible.
I add one obmol to another, and then set some generic data to the newly just
added atoms. 

>From what I have seen the usage of form :
/for(int i = 1; i <= otherMol->NumAtoms(); ++i) 
    currMol->GetAtom(prevatms + otherMol->GetAtom(i)->GetIdx()/


Instead I am using the following (including for accessing the bonds).
/
OBAtomIterator i = molecule->BeginAtoms();
std::advance(i, numAtoms);
for (OBAtom* atom = molecule->NextAtom(i) ; atom ; atom =
molecule->NextAtom(i)) {
         .....
}
/

I think this assumes the order of atoms in the vector corresponding with
their indices. Is this a safe assumption for future?


Much appreciated,
-Andi





--
View this message in context: 
http://forums.openbabel.org/Accessing-newly-added-atoms-bonds-when-combining-two-molecules-tp4655937.html
Sent from the General discussion mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Free Next-Gen Firewall Hardware Offer
Buy your Sophos next-gen firewall before the end March 2013 
and get the hardware for free! Learn more.
http://p.sf.net/sfu/sophos-d2d-feb
_______________________________________________
OpenBabel-discuss mailing list
OpenBabel-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss

Reply via email to