> On Jul 11, 2017, at 10:13 PM, Geoffrey Hutchison <geoff.hutchi...@gmail.com>
> wrote:
>
>> I was thinking about the OBAtom level by defining a PartialCharge object
>> that has two attributes: the model of the charge and the value, then OBAtom
>> will have a vector of the PartialCharge object like this
>> std::vector<PartialCharge> _pcharge
>
> That seems a bit weird. Think about how someone would want to access the
> data. You'd want to query the OBAtom to find out if it has the particular
> attribute and then get it.
Actually, I did not implement it on OBAtom.
Based on my current implementation, one can write this to get the favorite
partial charge.
OpenBabel::OBPcharges *OBpc;
OBpc = (OpenBabel::OBPcharges *) mol.GetData(“Mulliken Charge”)
I need to write a few lines to read the Hirshfeld charges, too. Then I will
push them all and request pull and review.
Best,
Mohammad
>
> If you're trying to do key/value on the OBAtom, use OBPairData
> (http://openbabel.org/api/2.3/classOpenBabel_1_1OBPairData.shtml
> <http://openbabel.org/api/2.3/classOpenBabel_1_1OBPairData.shtml>) or
> OBPairFloatingPoint
>
> In that case, you can easily call OBAtom *atom ->HasData("MullikenCharge")
>
> http://openbabel.org/api/2.3/classOpenBabel_1_1OBGenericData.shtml
> <http://openbabel.org/api/2.3/classOpenBabel_1_1OBGenericData.shtml>
>
> Hope that helps,
> -Geoff
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
OpenBabel-Devel mailing list
OpenBabel-Devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-devel