<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=utf-8"><meta name=Generator content="Microsoft Word 15 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style></head><body lang=EN-US link=blue vlink="#954F72"><div class=WordSection1><p class=MsoNormal>I ran again with wrappers. Many of the errors are different.</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Distilled error report:</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>AttributeError: 'NoneType' object has no attribute 'addChild'</p><p class=MsoNormal>AttributeError: 'NoneType' object has no attribute 'setValue'</p><p class=MsoNormal>AttributeError: 'org.web3d.x3d.jsail.Core.ProtoBodyObject' object has no attribute 'addShaders'  (same as previous)</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Line number summary:</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>  File "abox.future.py", line 20, in <module></p><p class=MsoNormal>  File "jnius\jnius_export_class.pxi", line 760, in jnius.JavaMethod.__call__</p><p class=MsoNormal>  File "jnius\jnius_conversion.pxi", line 78, in jnius.populate_args</p><p class=MsoNormal>  File "jnius\jnius_utils.pxi", line 205, in jnius.check_assignable_from</p><p class=MsoNormal>  File "HelloWorldProgramOutput.future.py", line 83, in <module></p><p class=MsoNormal>  File "HelloWorldProgramOutput.py", line 907, in <module></p><p class=MsoNormal>  File "HelloWorldProgramOutput_CommandLine.future.py", line 83, in <module></p><p class=MsoNormal>  File "HelloWorldProgramOutput_CommandLine.py", line 907, in <module></p><p class=MsoNormal>  File "HelloWorldProgramOutput_CommandLineUnzipped.future.py", line 83, in <module></p><p class=MsoNormal>  File "HelloWorldProgramOutput_CommandLineUnzipped.py", line 907, in <module></p><p class=MsoNormal>  File "HelloWorldProgramOutput_ReloadedDOM.future.py", line 83, in <module></p><p class=MsoNormal>  File "HelloWorldProgramOutput_ReloadedDOM.py", line 907, in <module></p><p class=MsoNormal>  File "HelloWorldProgramOutputCanonical.future.py", line 78, in <module></p><p class=MsoNormal>  File "HelloWorldProgramOutputCanonical.py", line 881, in <module></p><p class=MsoNormal>  File "HelloWorldProgramOutputTidy.future.py", line 48, in <module></p><p class=MsoNormal>  File "HelloWorldProgramOutputTidy.py", line 903, in <module></p><p class=MsoNormal>  File "HelloWorldProgramOutputTidy_CommandLine.future.py", line 48, in <module></p><p class=MsoNormal>  File "HelloWorldProgramOutputTidy_CommandLine.py", line 903, in <module></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>When I removed a wrapper, the type got filled in, but with the SAI type, indicating a contract error:</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>python HelloWorldProgramOutput.future.py</p><p class=MsoNormal>Traceback (most recent call last):</p><p class=MsoNormal>  File "HelloWorldProgramOutput.future.py", line 82, in <module></p><p class=MsoNormal>    .setMetadata(x3dpsail.MetadataSet().setName("EscapedQuotationMarksMetadataSet")</p><p class=MsoNormal>AttributeError: 'org.web3d.x3d.sai.Core.X3DMetadataObject' object has no attribute 'setValue'</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>When I changed the name of the class in x3dpsail.py, I got the same error:</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>python HelloWorldProgramOutput.future.py</p><p class=MsoNormal>Traceback (most recent call last):</p><p class=MsoNormal>  File "HelloWorldProgramOutput.future.py", line 82, in <module></p><p class=MsoNormal>    .setMetadata(x3dpsail.MetadataSetObject().setName("EscapedQuotationMarksMetadataSet")</p><p class=MsoNormal>AttributeError: 'org.web3d.x3d.sai.Core.X3DMetadataObject' object has no attribute 'setValue'</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Please fix the below errors in next below message so we can remove wrappers for good (errors get caught soon sooner without wrappers). I agree that removing wrappers is good for debugging.</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Please stop chasing down errors in my code about concrete classes being used.  Use the GitHub x3dpsail repository if you want to convince yourself.</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>John</p><p class=MsoNormal>Sent from <a href="https://go.microsoft.com/fwlink/?LinkId=550986">Mail</a> for Windows 10</p><p class=MsoNormal><o:p> </o:p></p><div style='mso-element:para-border-div;border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in'><p class=MsoNormal style='border:none;padding:0in'><b>From: </b><a href="mailto:yottzumm@gmail.com">John Carlson</a><br><b>Sent: </b>Thursday, June 27, 2019 11:51 PM<br><b>To: </b><a href="mailto:brutzman@nps.edu">Brutzman, Donald (Don) (CIV)</a><br><b>Cc: </b><a href="mailto:x3d-public@web3d.org">X3D Graphics public mailing list</a>; <a href="mailto:lepeitso@nps.edu">Peitso, Loren (CIV)</a><br><b>Subject: </b>RE: updates toX3DJSAIL,pluspythonandjavaversionsofX3DExamples,X3DPSAIL; let Python bePython;missing from X3DUOM;</p></div><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>I have been working on this some, and the errors are now different.  We have an SAI problem crop up because primitive wrappers were not used (which forced the code to use the concrete object, as previously analyzed).<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>I have checked the python files in this report into<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><a href="https://github.com/carlsonsolutiondesign/x3dpsail">https://github.com/carlsonsolutiondesign/x3dpsail</a><o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Please checkout and debug.  I have also removed wrappers from primitives.  There are new errors because of it.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>.x3d files are under x3d/stylesheets/java/examples on sourceforge.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>(attached errs.txt)<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Distilled error report:<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>AttributeError: 'org.web3d.x3d.jsail.Core.ProtoBodyObject' object has no attribute 'addShaders' (missing, please add to X3DJSAIL or fix serializers—note this is a concrete object)<o:p></o:p></p><p class=MsoNormal>AttributeError: 'org.web3d.x3d.jsail.X3DConcreteNode' object has no attribute 'setCenterOfRotation' (used wrappers to fix)<o:p></o:p></p><p class=MsoNormal>AttributeError: 'org.web3d.x3d.sai.Navigation.ViewpointGroup' object has no attribute 'addChild' (used wrappers to fix)<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>I’m going to check in and then switch mine back to wrappers to see if I fixed the other error.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Still not fixed (previously reported):<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>abox.future.py ====================================<o:p></o:p></p><p class=MsoNormal>Traceback (most recent call last):^M<o:p></o:p></p><p class=MsoNormal>  File "abox.future.py", line 20, in <module>^M<o:p></o:p></p><p class=MsoNormal>    .addConnect(x3dpsail.connect().setNodeField("children").setProtoField("myShape"))))))^M<o:p></o:p></p><p class=MsoNormal>  File "jnius\jnius_export_class.pxi", line 760, in jnius.JavaMethod.__call__^M<o:p></o:p></p><p class=MsoNormal>  File "jnius\jnius_conversion.pxi", line 78, in jnius.populate_args^M<o:p></o:p></p><p class=MsoNormal>  File "jnius\jnius_utils.pxi", line 205, in jnius.check_assignable_from^M<o:p></o:p></p><p class=MsoNormal>jnius.JavaException: Invalid instance of 'org/web3d/x3d/jsail/X3DConcreteNode' passed for a 'org/web3d/x3d/sai/Core/X3DNode'^M<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>John<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Sent from <a href="https://go.microsoft.com/fwlink/?LinkId=550986">Mail</a> for Windows 10<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><div style='border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in'><p class=MsoNormal><b>From: </b><a href="mailto:yottzumm@gmail.com">John Carlson</a><br><b>Sent: </b>Thursday, June 27, 2019 8:01 PM<br><b>To: </b><a href="mailto:brutzman@nps.edu">Brutzman, Donald (Don) (CIV)</a><br><b>Cc: </b><a href="mailto:x3d-public@web3d.org">X3D Graphics public mailing list</a>; <a href="mailto:lepeitso@nps.edu">Peitso, Loren (CIV)</a><br><b>Subject: </b>RE: updates to X3DJSAIL,pluspythonandjavaversionsofX3DExamples,X3DPSAIL; let Python be Python;missing from X3DUOM;<o:p></o:p></p></div><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>PROGRESS! We need to upgrade SceneObject.java in X3DJSAIL! There are 3 tasks for Don’s keen coding here.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Don, did you just call from San Diego? I stepped away from my phone. Please spend a lot of time on this message, thanks.  Review MAJOR task, mine, first then review others to see if we can simplify the tasks.  They all appear to be related.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>I fully know that my serializers only work in some cases, because of a disconnect between X3DUOM and my serializers.  That’s one reason mapToMethod2.js was created. <b>The other reason was because of a possible “blindspot” in X3DUOM, namely, how can I find out what nodes can have an IS statement child?</b> In order to continue generating mapToMethod.js, I had to add additional method names in mapToMethod2.js (or alternatively, which I didn’t like, in all my serializers).  It is possible that mapToMethod2.js shows other failings of X3DUOM.  It’s the first place I’d go when looking for something that is missing from X3DUOM. Yes, the two mapToMethod*js files are complementary.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>I’m perfectly fine with abandoning the Pipelining style of API, if this solves our abstract classes problem, and we will be forced to do this if we choose a current pythonic way of doing things—assignment without a return value. Abandoning pipelining will fix our pyjnius problems too, I believe, but have not tested extensively recently<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>I’ve heard that there will be a new way of doing things in Python using := assignment expressions that will return the object the assignment is called on, which is what we want, right? Can Loren show us how to do that if’s it’s available? <a href="https://www.python.org/dev/peps/pep-0572/">https://www.python.org/dev/peps/pep-0572/</a>  Should we sign up for a python 3.8 beta?<o:p></o:p></p><p class=MsoNormal>===========================================================================================================<o:p></o:p></p><p class=MsoNormal>I am attaching the errors from python programs from java/examples/*.x3d.  I see many errors. Now I know why you are complaining, Re: HelloWorld.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>node ../src/python/pyjnius/xml2all.js *.x3d<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>So let’s do a quick search for AttributeError:<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>grep Attribute errs.txt<o:p></o:p></p><p class=MsoNormal>AttributeError: 'NoneType' object has no attribute 'addChild'<o:p></o:p></p><p class=MsoNormal>AttributeError: 'org.web3d.x3d.jsail.Core.SceneObject' object has no attribute 'setMetadata'<o:p></o:p></p><p class=MsoNormal>AttributeError: 'NoneType' object has no attribute 'addChild'<o:p></o:p></p><p class=MsoNormal>AttributeError: 'org.web3d.x3d.jsail.Core.SceneObject' object has no attribute 'setMetadata'<o:p></o:p></p><p class=MsoNormal>============================================================================================================<o:p></o:p></p><p class=MsoNormal>Don, task for you. Medium Priority. <b>Suggestion: adding setMetadata in SceneObject.java</b><o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>The next task, if accepted, will probably make this fix irrelevant.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>The setMetadata error is an error in the serializer (should have generated addMetadata or addChild) or the stylesheet (no setMetadata method in SceneObject.java in X3DJSAIL).  It’s likely I could replace addMetadata in mapToMethod2.js, but this will require testing. We’ve been using setMetadata for a long time in other places than Scene<o:p></o:p></p><p class=MsoNormal>Files that produce the setMetadata error:<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>$ python HelloWorldProgramOutputTidy.py<o:p></o:p></p><p class=MsoNormal>Traceback (most recent call last):<o:p></o:p></p><p class=MsoNormal>  File "HelloWorldProgramOutputTidy.py", line 200, in <module><o:p></o:p></p><p class=MsoNormal>    Scene31.setMetadata(MetadataString39)<o:p></o:p></p><p class=MsoNormal>AttributeError: 'org.web3d.x3d.jsail.Core.SceneObject' object has no attribute 'setMetadata'<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>coderextreme@DESKTOP-DOPK2VD MINGW64 /c/x3d-code/www.web3d.org/x3d/stylesheets/java/examples<o:p></o:p></p><p class=MsoNormal>$ python HelloWorldProgramOutputTidy_CommandLine.py<o:p></o:p></p><p class=MsoNormal>Traceback (most recent call last):<o:p></o:p></p><p class=MsoNormal>  File "HelloWorldProgramOutputTidy_CommandLine.py", line 200, in <module><o:p></o:p></p><p class=MsoNormal>    Scene31.setMetadata(MetadataString39)<o:p></o:p></p><p class=MsoNormal>AttributeError: 'org.web3d.x3d.jsail.Core.SceneObject' object has no attribute 'setMetadata'<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>coderextreme@DESKTOP-DOPK2VD MINGW64 /c/x3d-code/www.web3d.org/x3d/stylesheets/java/examples<o:p></o:p></p><p class=MsoNormal>==========================================================================================================<o:p></o:p></p><p class=MsoNormal>This is for John. MAJOR change.  High Priority.  Needs review.  <b>Suggestion:  Add additional test for Scene where number of children == 0 (no children added yet, first child).  Change first child’s method from set* to add* in Scene. In ALL serializers. This will mean that the first XML child of Scene will receive add instead of set in the Python code. Possible modifier:  add setChild to X3DJSAIL which returns SceneObject, and use that instead of setChildren.<o:p></o:p></b></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>The addChild issues appear to be from the serializer using setChildren, which returns a void.  The following script shows the issue.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>import x3dpsail<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>X3D0 = (x3dpsail.X3D()<o:p></o:p></p><p class=MsoNormal>      .setScene(x3dpsail.Scene()<o:p></o:p></p><p class=MsoNormal>        .setChildren(x3dpsail.ViewpointGroup())<o:p></o:p></p><p class=MsoNormal>        .addChild(x3dpsail.NavigationInfo())))<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Discovered by the following command:<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>$ find ../src/ -name SceneObject.java |xargs grep setChildren<o:p></o:p></p><p class=MsoNormal>        public SceneObject setChildren(ArrayList<X3DNode> newValue)<o:p></o:p></p><p class=MsoNormal>        public void setChildren(X3DNode newValue)<o:p></o:p></p><div style='border:none;border-bottom:double windowtext 2.25pt;padding:0in 0in 1.0pt 0in'><p class=MsoNormal>                setChildren(getChildren()); // also test getter/setter validation, which also includes checks for acceptableNodeTypes (if applicable)<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p></div><p class=MsoNormal>Don’s task.  Extremely low priority, except to look for a pyjnius problem. Suggestion: <b>Provide a way to pass multiple children to SceneObject.setChildren in python.</b><o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>I tried wrapping the passed argument in [] and got:<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Traceback (most recent call last):<o:p></o:p></p><p class=MsoNormal>  File "foo.py", line 5, in <module><o:p></o:p></p><p class=MsoNormal>    .setChildren([x3dpsail.ViewpointGroup()])<o:p></o:p></p><p class=MsoNormal>  File "jnius\jnius_export_class.pxi", line 1034, in jnius.JavaMultipleMethod.__call__<o:p></o:p></p><p class=MsoNormal>jnius.JavaException: No methods matching your arguments, available: ['(Ljava/util/ArrayList;)Lorg/web3d/x3d/jsail/Core/SceneObject;', '(Lorg/web3d/x3d/sai/Core/X3DNode;)V']<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>So I don’t know how to convert a python list to a Java ArrayList apparently?  Something’s missing from pyjnius here I think. Here’s the code I tried:<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>import x3dpsail<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>X3D0 = (x3dpsail.X3D()<o:p></o:p></p><p class=MsoNormal>      .setScene(x3dpsail.Scene()<o:p></o:p></p><p class=MsoNormal>        .setChildren([x3dpsail.ViewpointGroup()])<o:p></o:p></p><p class=MsoNormal>        .addChild(x3dpsail.NavigationInfo())))<o:p></o:p></p><p class=MsoNormal>============================================================================================================<o:p></o:p></p><p class=MsoNormal>Don and John’s task: Medium priority.  <b>Suggestion: Don: provide SceneObject.addChild(MetadataStringObject) we may want to use addMetadata instead. John:  Fix mapToMethod2.js to override addChild with addMetadata in Scene parent, MetadataString child—will this work with current X3DJSAIL?<o:p></o:p></b></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Other generated errors look like this:<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>jnius.JavaException: Invalid instance of 'org/web3d/x3d/jsail/Core/MetadataStringObject' passed for a 'org/web3d/x3d/sai/Core/X3DChildNode'<o:p></o:p></p><p class=MsoNormal>jnius.JavaException: Invalid instance of 'org/web3d/x3d/jsail/Core/MetadataStringObject' passed for a 'org/web3d/x3d/sai/Core/X3DChildNode'<o:p></o:p></p><p class=MsoNormal>jnius.JavaException: Invalid instance of 'org/web3d/x3d/jsail/Core/MetadataStringObject' passed for a 'org/web3d/x3d/sai/Core/X3DChildNode'<o:p></o:p></p><p class=MsoNormal>jnius.JavaException: Invalid instance of 'org/web3d/x3d/jsail/Core/MetadataStringObject' passed for a 'org/web3d/x3d/sai/Core/X3DChildNode'<o:p></o:p></p><p class=MsoNormal>jnius.JavaException: Invalid instance of 'org/web3d/x3d/jsail/Core/MetadataStringObject' passed for a 'org/web3d/x3d/sai/Core/X3DChildNode'<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Relevant code where error shows up:<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>import x3dpsail<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>X3D0 = (x3dpsail.X3D()<o:p></o:p></p><p class=MsoNormal>      .setScene(x3dpsail.Scene()<o:p></o:p></p><p class=MsoNormal>        .addChild(x3dpsail.MetadataString())))<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Which can be solved in the stylesheet by adding an<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>public SceneObject addChild(<b>MetadataStringObject</b> newValue)<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>in SceneObject.java. At least I think it would work.<o:p></o:p></p><p class=MsoNormal>===========================================================================================================<o:p></o:p></p><p class=MsoNormal>There is a LOT more Exceptions we can work with now! See attachment.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>I believe that once we complete these successfully, we will be a lot closer (with wrappers) to a Python/Java API. However, we will probably have a lot more crud to clean up.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>John<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><o:p> </o:p></p></div></body></html>