>Hmmm....looking at the code (line 1364 at
>http://openbabel.svn.sourceforge.net/viewvc/openbabel/openbabel/trunk/src/mol.cpp?>revision=4677&view=markup&pathrev=4677)
> 
>I don't see generic data being copied. 
Looking at the source file from the link you provided it, on line 1385
function *AddAtom()* is called, which then on line 1741 (
http://openbabel.svn.sourceforge.net/viewvc/openbabel/openbabel/trunk/src/mol.cpp?revision=4677&view=markup&pathrev=4677)
<http://openbabel.svn.sourceforge.net/viewvc/openbabel/openbabel/trunk/src/mol.cpp?revision=4677&view=markup&pathrev=4677)
>  
looks like the atom from otherMol is assigned to new atom on the current
molecule (via operator=).  
Then if we look at the atom operator= on line 151 and 162 in atom.cpp (
http://openbabel.svn.sourceforge.net/viewvc/openbabel/openbabel/trunk/src/atom.cpp?revision=4576&view=markup&pathrev=4677
<http://openbabel.svn.sourceforge.net/viewvc/openbabel/openbabel/trunk/src/atom.cpp?revision=4576&view=markup&pathrev=4677>
 
), it shows the generic data being cloned. 
But then I looked in the base.h file line 210 at the link 
http://openbabel.svn.sourceforge.net/viewvc/openbabel/openbabel/trunk/include/openbabel/base.h?revision=4215&view=markup&pathrev=4677
<http://openbabel.svn.sourceforge.net/viewvc/openbabel/openbabel/trunk/include/openbabel/base.h?revision=4215&view=markup&pathrev=4677>
  
and this function just returns NULL and doesn't clone anything. So i guess
in the end, there is no cloning, even though the *Duplicate()* in the
atom.cpp looks like it does. Is this correct? 

(see image)
<http://forums.openbabel.org/file/n4655916/duplicate.png> 



>What specifically do you want copied? (i.e. what type of generic data?) 
At the moment, for our application we use OBPairTemplate class to attach
additional attributes that helps us match two atoms which then we can create
a bond between them.

So if generic data is not cloned, is there a way around this behavior other
than subclassing the mol and atom classes and overriding the operator+() and
clone() methods respectively in each of the classes.

Thanks,
-Andi





--
View this message in context: 
http://forums.openbabel.org/Find-Mol-atom-with-attribute-tp4655912p4655916.html
Sent from the General discussion mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_jan
_______________________________________________
OpenBabel-discuss mailing list
OpenBabel-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss

Reply via email to