[x3d-public] analysis of a WIP...X3DJSAIL XML/JSON output not there yet

John Carlson yottzumm at gmail.com
Thu Sep 16 21:48:26 PDT 2021


Can't compile Don's version of rubik2x2x2.java.  Java code attached. 
Updating everything now in hopes of a fix.

Thanks!

John

X3DJSONLD/src/main/java$ javac -cp 
.:/home/coderextreme/pythonSAI/X3DJSAIL.4.0.full.jar 
net/x3djsonld/data/rubik2x2x2.java
net/x3djsonld/data/rubik2x2x2.java:104: error: incompatible types: IS 
cannot be converted to X3DNode
                 .addConnect(new 
connect().setNodeField("diffuseColor").setProtoField("diffuseColor")))))
                            ^
net/x3djsonld/data/rubik2x2x2.java:109: error: incompatible types: IS 
cannot be converted to X3DNode
                 .addConnect(new 
connect().setNodeField("diffuseColor").setProtoField("diffuseColor"))))))))
                            ^
net/x3djsonld/data/rubik2x2x2.java:123: error: incompatible types: IS 
cannot be converted to X3DNode
                 .addConnect(new 
connect().setNodeField("diffuseColor").setProtoField("x1diffuseColor")))))
                            ^
net/x3djsonld/data/rubik2x2x2.java:128: error: incompatible types: IS 
cannot be converted to X3DNode
                 .addConnect(new 
connect().setNodeField("diffuseColor").setProtoField("x2diffuseColor"))))))))
                            ^
Note: Some messages have been simplified; recompile with -Xdiags:verbose 
to get full output
4 errors
coderextreme at coderextreme-Kubuntu20:~/X3DJSONLD/src/main/java$ ls -l !$
ls -l net/x3djsonld/data/rubik2x2x2.java
-rw-rw-r-- 1 coderextreme coderextreme 12004 Sep 16 01:21 
net/x3djsonld/data/rubik2x2x2.java

On 9/16/21 1:37 AM, John Carlson wrote:
> Note, I'm not sure how much I've checked in.  Let me know if you want 
> to work on this, and I'll create a branch.
>
> John
>
> On 9/16/21 1:16 AM, John Carlson wrote:
>> Where did the IS go in the Java generated JSON code for fieldValue?
>>
>> I did remove "IS" as a substatement of fieldValue, in X3DUDOM. AFAIK, 
>> this was not checked in.   This removed IS removes setIS, but Don did 
>> something to add setIS() method back.   What I see in the X3DJSAIL 
>> code is  failure to adequately output IS in XML or JSON.  I'm not 
>> quite sure what to do, maybe check next email.
>>
>> Path to file: 
>> https://github.com/coderextreme/X3DJSONLD/blob/master/src/main/data/rubik2x2x2.new.json
>>
>> comparing JSON to repository:
>>
>> +++ b/src/main/data/rubik2x2x2.new.json
>> @@ -28,7 +28,7 @@
>>            },
>>            {
>>              "@name":"translated",
>> -            "@content":"13 September 2021"
>> +            "@content":"16 September 2021"
>>            },
>>            {
>>              "@name":"generator",
>> @@ -161,15 +161,7 @@
>>                                    "@value":[0,0,0]
>>                                  },
>>                                  {
>> -                                  "@name":"diffuseColor",
>> -                                  "IS": {
>> -                                      "connect": [
>> -                                        {
>> - "@nodeField":"diffuseColor",
>> - "@protoField":"diffuseColor"
>> -                                        }
>> -                                      ]
>> -                                  }
>> +                                  "@name":"diffuseColor"
>>                                  }
>>                                ]
>>                              }
>> @@ -183,15 +175,7 @@
>>                                    "@value":[2,0,0]
>>                                  },
>>                                  {
>> -                                  "@name":"diffuseColor",
>> -                                  "IS": {
>> -                                      "connect": [
>> -                                        {
>> - "@nodeField":"diffuseColor",
>> - "@protoField":"diffuseColor"
>> -                                        }
>> -                                      ]
>> -                                  }
>> +                                  "@name":"diffuseColor"
>>                                  }
>>                                ]
>>                              }
>> @@ -250,15 +234,7 @@
>>                                    "@value":[0,0,0]
>>                                  },
>>                                  {
>> -                                  "@name":"diffuseColor",
>> :
>> =================================
>>
>> If you assume that this is merely a JSON problem, look at 
>> python-X3DJSAIL rubik2x2x2.new.x3d output: 
>> https://github.com/coderextreme/X3DJSONLD/blob/master/src/main/data/rubik2x2x2.new.x3d
>>
>>
>>       <ProtoBody>
>>         <Transform>
>>           <IS>
>>             <connect nodeField='translation' protoField='ztranslation'/>
>>           </IS>
>>           <ProtoInstance name='two'>
>>             <fieldValue name='ytranslation' value='0 0 0'/>
>>             <fieldValue name='diffuseColor'/>
>>           </ProtoInstance>
>>           <ProtoInstance name='two'>
>>             <fieldValue name='ytranslation' value='0 2 0'/>
>>             <fieldValue name='diffuseColor'/>
>>           </ProtoInstance>
>>         </Transform>
>>       </ProtoBody>
>>
>>
>> At this point, I am tempted to add an IS field to to fieldValue in 
>> X3DUOM, but i know it gets overwritten.
>>
>> Original file is here:
>>
>> https://github.com/coderextreme/X3DJSONLD/blob/master/src/main/data/rubik2x2x2.x3d 
>>
>>
>>
>> John
>>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: rubik2x2x2.java
Type: text/x-java
Size: 12004 bytes
Desc: not available
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20210916/efc2da50/attachment-0001.bin>


More information about the x3d-public mailing list