From haocheng.liu at kitware.com Fri Dec 8 13:35:48 2017 From: haocheng.liu at kitware.com (Haocheng Liu) Date: Fri, 8 Dec 2017 13:35:48 -0500 Subject: [Smtk-developers] Looking for V2 attribute template files Message-ID: Hi, For now, I'm searching for a SMTK V2 template file so that I can test my Json parser and writer with it. A quick grep shows that all attribute files in smtk test data are V1. Would anyone please kindly point me to some V2 attribute template files for testing purpose? Thanks! -- 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: From david.thompson at kitware.com Fri Dec 8 13:45:19 2017 From: david.thompson at kitware.com (David Thompson) Date: Fri, 8 Dec 2017 13:45:19 -0500 Subject: [Smtk-developers] Looking for V2 attribute template files In-Reply-To: References: Message-ID: <1D1F7C49-4179-45BC-A8AA-D9D5974D2EBB@kitware.com> Hi Haocheng, > > For now, I'm searching for a SMTK V2 template file so that I can test my Json parser and writer with it. A quick grep shows that all attribute files in smtk test data are V1. > > Would anyone please kindly point me to some V2 attribute template files for testing purpose? It looks like: data/attribute/attribute_collection/Basic2DFluid.sbt is a v2 file (at least Version="2" appears in the file. David From haocheng.liu at kitware.com Fri Dec 8 13:50:55 2017 From: haocheng.liu at kitware.com (Haocheng Liu) Date: Fri, 8 Dec 2017 13:50:55 -0500 Subject: [Smtk-developers] Looking for V2 attribute template files In-Reply-To: <1D1F7C49-4179-45BC-A8AA-D9D5974D2EBB@kitware.com> References: <1D1F7C49-4179-45BC-A8AA-D9D5974D2EBB@kitware.com> Message-ID: Thanks David! On Fri, Dec 8, 2017 at 1:45 PM, David Thompson wrote: > Hi Haocheng, > > > > > For now, I'm searching for a SMTK V2 template file so that I can test my > Json parser and writer with it. A quick grep shows that all attribute files > in smtk test data are V1. > > > > Would anyone please kindly point me to some V2 attribute template files > for testing purpose? > > It looks like: data/attribute/attribute_collection/Basic2DFluid.sbt is a > v2 file (at least Version="2" appears in the file. > > David -- 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: From haocheng.liu at kitware.com Fri Dec 15 22:21:53 2017 From: haocheng.liu at kitware.com (Haocheng Liu) Date: Fri, 15 Dec 2017 22:21:53 -0500 Subject: [Smtk-developers] Using nlohmann json to serialize and deserialize attribute system Message-ID: 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 . @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: -------------- next part -------------- A non-text attachment was scrubbed... Name: image.png Type: image/png Size: 56060 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image.png Type: image/png Size: 70631 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Basic2DFluid.sbt Type: application/octet-stream Size: 1279 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Basic2DFluid.json Type: application/json Size: 3587 bytes Desc: not available URL: From haocheng.liu at kitware.com Thu Dec 21 15:34:30 2017 From: haocheng.liu at kitware.com (Haocheng Liu) Date: Thu, 21 Dec 2017 15:34:30 -0500 Subject: [Smtk-developers] Propose to change the serialization logic of numberOfValues/Items in attribute system Message-ID: Hi, In the past when we serialize items between client and server, we serialize "NumberOfValues" info and we also serialize data for each item as(Ex. componentItem) [ { "Val": { "Resource": "uuid-1", "Component": "uuid-2" } },{"UnsetVal": True} ... ] which is pretty verbose as David has pointed out. Actually since we serialize the values in the ComponentItem as a array, the array size would be naturally equal to the NumberOfValues. There is no need to repeat this info. Meanwhile, it would be better to serialize the data as: [ [ "uuid-1", "uuid-2"], ... ] which is cleaner and easier. Ideas? -- 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: From tj.corona at kitware.com Thu Dec 21 15:40:59 2017 From: tj.corona at kitware.com (TJ Corona) Date: Thu, 21 Dec 2017 15:40:59 -0500 Subject: [Smtk-developers] Propose to change the serialization logic of numberOfValues/Items in attribute system In-Reply-To: References: Message-ID: <47A4F501-5748-46F4-BC61-B5BAA0549D41@kitware.com> If ?NumberOfValues? is simply reading the length of a vector that the json stream is going to populate anyway, I would omit it from the serialization. If NumberOfValues is pointing to a unique field in a class, though, I would keep it in. I think we only need the minimal set of info to reproduce a class?s state. > On Dec 21, 2017, at 3:34 PM, Haocheng Liu wrote: > > Hi, > > In the past when we serialize items between client and server, > > we serialize "NumberOfValues" info and we also serialize data for each item as(Ex. componentItem) > [ { "Val": { "Resource": "uuid-1", "Component": "uuid-2" } },{"UnsetVal": True} ... ] > which is pretty verbose as David has pointed out. > > Actually since we serialize the values in the ComponentItem as a array, the array size would be naturally equal to the NumberOfValues. There is no need to repeat this info. > > Meanwhile, it would be better to serialize the data as: > [ [ "uuid-1", "uuid-2"], ... ] > which is cleaner and easier. > > Ideas? > -- > Best regards > Haocheng > > Haocheng LIU > Kitware, Inc. > R&D Engineer > 21 Corporate Drive > Clifton Park, NY 12065-8662 > Phone: 518-881-4421 > _______________________________________________ > Smtk-developers mailing list > Smtk-developers at smtk.org > https://smtk.org/mailman/listinfo/smtk-developers -------------- next part -------------- An HTML attachment was scrubbed... URL: From haocheng.liu at kitware.com Thu Dec 21 16:01:59 2017 From: haocheng.liu at kitware.com (Haocheng Liu) Date: Thu, 21 Dec 2017 16:01:59 -0500 Subject: [Smtk-developers] Propose to change the serialization logic of numberOfValues/Items in attribute system In-Reply-To: <47A4F501-5748-46F4-BC61-B5BAA0549D41@kitware.com> References: <47A4F501-5748-46F4-BC61-B5BAA0549D41@kitware.com> Message-ID: On Thu, Dec 21, 2017 at 3:40 PM, TJ Corona wrote: > If ?NumberOfValues? is simply reading the length of a vector that the json > stream is going to populate anyway, I would omit it from the serialization. > If NumberOfValues is pointing to a unique field in a class, though, I would > keep it in. I think we only need the minimal set of info to reproduce a > class?s state. > > It's the first case. I would put an issue in SMTK so that we would revisit it when I have time. > On Dec 21, 2017, at 3:34 PM, Haocheng Liu > wrote: > > Hi, > > In the past when we serialize items between client and server, > > we serialize "NumberOfValues" info and we also serialize data for each > item as(Ex. componentItem) > > [ { "Val": { "Resource": "uuid-1", "Component": "uuid-2" } },{"UnsetVal": True} ... ] > > which is pretty verbose as David has pointed out. > > Actually since we serialize the values in the ComponentItem as a array, > the array size would be naturally equal to the NumberOfValues. There is no > need to repeat this info. > > Meanwhile, it would be better to serialize the data as: > > [ [ "uuid-1", "uuid-2"], ... ] > > which is cleaner and easier. > > Ideas? > -- > 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> > _______________________________________________ > Smtk-developers mailing list > Smtk-developers at smtk.org > https://smtk.org/mailman/listinfo/smtk-developers > > > -- 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: