<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>Ah! Viewpoint inherits from X3DViewpointNode.</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>So it’s trying to find the interface on a middle interface and can’t find it.  It must be the returned interface I think.</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>This is making less and less sense.  Need more sleep.</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>Sunday, May 12, 2019 11:00 AM<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><br><b>Subject: </b>RE: X3DJSAIL updated support for setting withdoubles;pythonpyjniusmapping</p></div><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Not quite:<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>$ grep -w Viewpoint *|grep public<o:p></o:p></p><p class=MsoNormal>ViewpointObject.java:public class ViewpointObject extends org.web3d.x3d.jsail.X3DConcreteNode implements org.web3d.x3d.sai.Navigation.Viewpoint<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>$ grep setCenterOfRotation *<o:p></o:p></p><p class=MsoNormal>Viewpoint.java: public Viewpoint setCenterOfRotation(float[] newValue);<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>So, perhaps pyjjnius is going up the wrong inheritanace hierarchy with getSuperclass?   Seems logical.<o:p></o:p></p><p class=MsoNormal>This seems interesting in reflect.py:<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>    for iclass in c.getInterfaces():<o:p></o:p></p><p class=MsoNormal>        if iclass.getName() == 'java.util.List':<o:p></o:p></p><p class=MsoNormal>            classDict['__getitem__'] = _getitem<o:p></o:p></p><p class=MsoNormal>            classDict['__len__'] = lambda self: self.size()<o:p></o:p></p><p class=MsoNormal>            break<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>It doesn’t appear to be part of autoclass, but it really is!  But it only does something when the interface is List. Hmm.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Hmm. Still stumbling around in the dark!<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>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>Sunday, May 12, 2019 9:57 AM<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><br><b>Subject: </b>RE: X3DJSAIL updated support for setting with doubles;pythonpyjniusmapping<o:p></o:p></p></div><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Aha!  X3DViewpointNode has no setCenterOfRotation so when you call it on the X3DViewpointNode returned by setDEF, the fails.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>I think the SAI interface may need setCenterOfRotation?<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Good luck!<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>$ grep set X3DViewpointNode.java |grep public<o:p></o:p></p><p class=MsoNormal>        public X3DViewpointNode setDescription(String newValue);<o:p></o:p></p><p class=MsoNormal>        public X3DViewpointNode setJump(boolean newValue);<o:p></o:p></p><p class=MsoNormal>        public X3DViewpointNode setMetadata(X3DMetadataObject newValue); // acceptable node types #2: X3DMetadataObject<o:p></o:p></p><p class=MsoNormal>        public X3DViewpointNode setOrientation(float[] newValue);<o:p></o:p></p><p class=MsoNormal>        public boolean getRetainUserOffsets();<o:p></o:p></p><p class=MsoNormal>        public X3DViewpointNode setRetainUserOffsets(boolean newValue);<o:p></o:p></p><p class=MsoNormal>        public X3DViewpointNode setDEF(String newValue);<o:p></o:p></p><p class=MsoNormal>        public X3DViewpointNode setUSE(String newValue);<o:p></o:p></p><p class=MsoNormal>        public X3DViewpointNode setCssClass(String newValue);<o:p></o:p></p><p class=MsoNormal><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>Saturday, May 11, 2019 9:44 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><br><b>Subject: </b>RE: X3DJSAIL updated support for setting with doubles; pythonpyjniusmapping<o:p></o:p></p></div><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Navigation/ViewpointObject.java:        public final ViewpointObject setDEF(String newValue)<o:p></o:p></p><p class=MsoNormal>Navigation/ViewpointObject.java:        public ViewpointObject setDEF(SFStringObject newValue)<o:p></o:p></p><p class=MsoNormal>Navigation/X3DViewpointNode.java:       public X3DViewpointNode setDEF(String newValue);<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>The only thing I can conclude is that somehow, the setDEF in X3DViewpointNode.java overrides the one in ViewpointObject.java.  Since the interface contract for setDEF returns an interface or abstract class, the method can’t be found.  I “patched’ this by wrapping in a SFStringObject, and there’s no interface contract for that method, so it chooses the concrete class.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Reflect.py travels up the inheritance hierarchy doing this:<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal style='text-indent:.5in'>parent_class = parent_class.getSuperclass()<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>I think it’s overriding methods with one of these, but not sure:<o:p></o:p></p><p class=MsoNormal style='text-indent:.5in'>classDict[name] = cls(sig, varargs=varargs)<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal style='text-indent:.5in'>classDict[lowername] = (lambda n: property(lambda self: getattr(self, n)()))(name)<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal style='text-indent:.5in'>classDict[name] = JavaMultipleMethod(signatures)<o:p></o:p></p><p class=MsoNormal style='text-indent:.5in'><o:p> </o:p></p><p class=MsoNormal>My guess is it overrides with the first one, since there is only one method in the interface/abstract class.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>But it will require some experimentation.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>You can replace import jnius with import reflect in classpath.py, I think, or each individual org package .py file.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>I’ve tried disabling the getSuperclass line without success<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Next step might be figure out how to build pyjnius.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>==========================================<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>>5. we're still having trouble with pyjnius finding the appropriate method:<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>- - - - - -<o:p></o:p></p><p class=MsoNormal>Loading HelloWorld.py (pipeline syntax) with python, if successful then saving and validating as HelloWorld_RoundTrip2.x3d version:<o:p></o:p></p><p class=MsoNormal>Traceback (most recent call last):<o:p></o:p></p><p class=MsoNormal>   File "C:\x3d-code\www.web3d.org\x3d\content\examples\X3dForWebAuthors/Chapter01TechnicalOverview//HelloWorld.py", line 74, in <module><o:p></o:p></p><p class=MsoNormal>     .addChild(Viewpoint().setDEF("ViewUpClose").setCenterOfRotation([0,-1,0]).setDescription("Hello world!").setPosition([0,-1,7]) \<o:p></o:p></p><p class=MsoNormal>AttributeError: 'org.web3d.x3d.sai.Navigation.X3DViewpointNode' object has no attribute 'setCenterOfRotation'<o:p></o:p></p><p class=MsoNormal>- - - - - -<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>As before, not clear why parent X3DViewpointNode object gets tagged.   Suspect it is because pyjnius can't find the correct method signature in ViewpointObject, and so goes to parent abstract class.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>==========================================<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><o:p> </o:p></p></div></body></html>