<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>Was the setDEF case when we had to pass the DEF value to the constructor instead of a setter?  I think we can do that, if desired.</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>John</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</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:brutzman@nps.edu">Brutzman, Donald (Don) (CIV)</a><br><b>Sent: </b>Wednesday, May 15, 2019 12:48 AM<br><b>To: </b><a href="mailto:yottzumm@gmail.com">John Carlson</a><br><b>Cc: </b><a href="mailto:x3d-public@web3d.org">X3D Graphics public mailing list</a><br><b>Subject: </b>Re: python pyjnius mapping</p></div><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>1. [concept calibration, ensuring we are on the same sheet of music]</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>On 5/14/2019 4:58 AM, John Carlson wrote:</p><p class=MsoNormal>> My version of the pipeline serializer clears up 130 of your problems in the interfaces.  My abstract classes error almost seems trivial, with only 2 sources, that I could determine, potentially clearing up 10s of problems.</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Not sure what you mean here.  We are working with two mappings that your software creates, all designed cooperatively.</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>For the problem method, the first encoding is:</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>   Viewpoint27 = Viewpoint()</p><p class=MsoNormal>   Viewpoint27.setDEF("ViewUpClose")</p><p class=MsoNormal>   Viewpoint27.setCenterOfRotation([0,-1,0])</p><p class=MsoNormal>   Viewpoint27.setDescription("Hello world!")</p><p class=MsoNormal>   Viewpoint27.setPosition([0,-1,7])</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>while the second pipelined programming approach is:</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>   Viewpoint().setDEF("ViewUpClose").setCenterOfRotation(0,-1,0).setDescription("Hello world!").setPosition(0,-1,7)</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>These are equivalent, indeed we are compiling against the same X3DJSAIL in each case.</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>The first works with no complaint because the return values of each method invocation is ignored.  Thus the incorrect return type for setCenterOfRotation(0,-1,0) does not matter.</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>I think that the second fails because Python/pyjnius is finding an incorrect return type for setCenterOfRotation(0,-1,0) which the subsequent setDescription("Hello world!") can't be applied to.</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Traceback (most recent call last):</p><p class=MsoNormal>   File "HelloWorld.future.py", line 54, in <module></p><p class=MsoNormal>     .addChild(Viewpoint().setDEF("ViewUpClose").setCenterOfRotation(0,-1,0).setDescription("Hello world!").setPosition(0,-1,7))</p><p class=MsoNormal>AttributeError: 'org.web3d.x3d.sai.Navigation.X3DViewpointNode' object has no attribute 'setCenterOfRotation'</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>oh no, that is not correct!  it is the setDEF() method that returns the incorrect return type, which the subsequent setCenterOfRotation(0,-1,0) can't operate on.</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>OK so that gets me closer to understanding what you were saying about setDEF.</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Similar issue:  ViewpointObject setDEF() is an @Override method.</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>                @Override</p><p class=MsoNormal>                public final ViewpointObject setDEF(String newValue)</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>i'll take a deeper look at setDEF() lineage next time.</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>-----------------</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>2. meanwhile tonight, i mistakenly deleted the org/* tree from the pyjnius directory.</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>ran makeorg.sh to restore it. console attached.</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>not sure what happened next, it appeared to break classes.json:</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>================================================================================</p><p class=MsoNormal>create python:</p><p class=MsoNormal>node xml2all.js HelloWorld.x3d</p><p class=MsoNormal>================================================================================</p><p class=MsoNormal>File: HelloWorld.x3d</p><p class=MsoNormal>Error: SyntaxError: Unexpected token } in JSON at position 47595</p><p class=MsoNormal>     at JSON.parse (<anonymous>)</p><p class=MsoNormal>     at PythonSerializer.serializeToString (C:\x3d-code\www.web3d.org\x3d\stylesheets\java\src\python\pyjnius\PythonSerializer.js:43:23)</p><p class=MsoNormal>     at serializeXML (C:\x3d-code\www.web3d.org\x3d\stylesheets\java\src\python\pyjnius\convertXML.js:26:25)</p><p class=MsoNormal>     at convertXML (C:\x3d-code\www.web3d.org\x3d\stylesheets\java\src\python\pyjnius\convertXML.js:55:16)</p><p class=MsoNormal>     at Object.<anonymous> (C:\x3d-code\www.web3d.org\x3d\stylesheets\java\src\python\pyjnius\xml2all.js:10:1)</p><p class=MsoNormal>     at Module._compile (internal/modules/cjs/loader.js:701:30)</p><p class=MsoNormal>     at Object.Module._extensions..js (internal/modules/cjs/loader.js:712:10)</p><p class=MsoNormal>     at Module.load (internal/modules/cjs/loader.js:600:32)</p><p class=MsoNormal>     at tryModuleLoad (internal/modules/cjs/loader.js:539:12)</p><p class=MsoNormal>     at Function.Module._load (internal/modules/cjs/loader.js:531:3)</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>C:\x3d-code\www.web3d.org\x3d\stylesheets\java\src\python\pyjnius\convertXML.js:67</p><p class=MsoNormal>                                                                throw("Wrote nothing, serializer returned nothing");</p><p class=MsoNormal>                                                                ^</p><p class=MsoNormal>Wrote nothing, serializer returned nothing</p><p class=MsoNormal>Result: 1</p><p class=MsoNormal>================================================================================</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>i restored classes.json via subversion and that seemed to fix things again.  not sure why makeorg failed though.</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>all the best, Don</p><p class=MsoNormal>-- </p><p class=MsoNormal>Don Brutzman  Naval Postgraduate School, Code USW/Br       brutzman@nps.edu</p><p class=MsoNormal>Watkins 270,  MOVES Institute, Monterey CA 93943-5000 USA   +1.831.656.2149</p><p class=MsoNormal>X3D graphics, virtual worlds, navy robotics http://faculty.nps.edu/brutzman</p><p class=MsoNormal><o:p> </o:p></p></div></body></html>