[Smtk-developers] Using nlohmann json to serialize and deserialize attribute system

Haocheng Liu haocheng.liu at kitware.com
Fri Dec 15 22:21:53 EST 2017


Hi smtk developers,

Recently, I've been working on using nlohmann json to serialize and
deserialize smtk attribute system. So far except for items, all other
attribute system components(Collection, Definition, itemDefinitions and
attribute) have been* fully finished* and *roughly tested*.

So here is a simple Xml&Json comparison demo:
Xml:
[image: Inline image 1]
json:
[image: Inline image 2]
It works well actually. Also in this beta version, I choose to write out
hidden information(Unique status, version info) for serialization purpose.

Meanwhile, I've attached Basic2DFluid.sbt and Basic2DFluid.json for further
detail.
If you are more interested, my WIP branch is here: Add-nlohmann-support
<https://gitlab.kitware.com/cmb/smtk/merge_requests/1002/diffs>.

@Bob

The bug that a collection cannot show all category tags has been fixed.
It's simply because I map itemDefType to itemDef. It should be itemDefType
to itemDefs since a definition can have multiple itemDefs with the same
type.
No known bugs for now!

-- 
Best regards
Haocheng

Haocheng LIU
Kitware, Inc.
R&D Engineer
21 Corporate Drive
Clifton Park, NY 12065-8662
Phone: 518-881-4421 <(518)%20881-4421>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://smtk.org/pipermail/smtk-developers/attachments/20171215/1516840e/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 56060 bytes
Desc: not available
URL: <http://smtk.org/pipermail/smtk-developers/attachments/20171215/1516840e/attachment-0002.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 70631 bytes
Desc: not available
URL: <http://smtk.org/pipermail/smtk-developers/attachments/20171215/1516840e/attachment-0003.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Basic2DFluid.sbt
Type: application/octet-stream
Size: 1279 bytes
Desc: not available
URL: <http://smtk.org/pipermail/smtk-developers/attachments/20171215/1516840e/attachment-0001.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Basic2DFluid.json
Type: application/json
Size: 3587 bytes
Desc: not available
URL: <http://smtk.org/pipermail/smtk-developers/attachments/20171215/1516840e/attachment-0001.json>


More information about the Smtk-developers mailing list