[x3d-public] python pyjnius mapping

John Carlson yottzumm at gmail.com
Tue May 14 05:53:07 PDT 2019

 The return value from many methods has an abstract class type, would be my best guess.  I have found many instances in jsail.

I can provide help finding them if necessary.  I would suggest searching for “public X3D” initially.

When you point a finger, there’s three fingers pointing back at you.


Sent from Mail for Windows 10

From: Brutzman, Donald (Don) (CIV)
Sent: Monday, May 13, 2019 11:54 PM
To: John Carlson
Cc: X3D Graphics public mailing list
Subject: Re: python pyjnius mapping

On 5/13/2019 4:13 AM, John Carlson wrote:
> I see.  Great!  It’s like breaking the contract on purpose, but letting people know you did it.

yes, @Override annotation is useful

> I understand now.  Just took a few nights sleep.  I’m catching up!  I’m usually 5 years behind state of research :😉

far better than the international average...

> One think I did was verify all class names, abstract class names and interfaces had unique names.
> We could also tack Object back on the jsail names, if necessary.

Good thinking.  We definitely don't want pyjnius to be looking at the oversimplistic/insufficient org.web3d.x3d.sai interfaces.

Was thinking we should use fully qualified concrete class names for zero ambiguity, but it looks like you have that pattern correctly listed already:

import classpath
from org.web3d.x3d.jsail.Core.X3DObject import X3DObject as X3D
from org.web3d.x3d.jsail.fields.SFStringObject import SFStringObject as SFString
from org.web3d.x3d.jsail.Core.headObject import headObject as head

Is there another way we might be mistakenly triggering pyjnius to mistakenly look at abstract classes?

> Cool.
> John
> Sent from Mail <https://go.microsoft.com/fwlink/?LinkId=550986> for Windows 10
> *From: *Brutzman, Donald (Don) (CIV) <mailto:brutzman at nps.edu>
> *Sent: *Sunday, May 12, 2019 2:23 PM
> *To: *John Carlson <mailto:yottzumm at gmail.com>
> *Cc: *X3D Graphics public mailing list <mailto:x3d-public at web3d.org>
> *Subject: *Re: python pyjnius mapping
> agreed it is confusing... reflection can be very tricky.
> good observation that we should look hard at what setDEF() returns.
>                  .addChild(Viewpoint().setDEF("ViewUpClose").setCenterOfRotation(0,-1,0).setDescription("Hello world!").setPosition(0,-1,7))
>                  AttributeError: 'org.web3d.x3d.sai.Navigation.X3DViewpointNode' object has no attribute 'setCenterOfRotation'
> from ViewpointObject, the method is explicitly declared/customized to Override the parent abstract class.
>                  @Override
>                  public final ViewpointObject setDEF(String newValue)
> also available
>                  public ViewpointObject setCenterOfRotation(double x, double y, double z)
>                  public ViewpointObject setCenterOfRotation(float x, float y, float z)
>                  @Override
>                  public ViewpointObject setCenterOfRotation(float[] newValue)
> yes still confusing.  i think we need to throughly review logic in your classes first before making a conclusive claim against pyjnius...  make sure it always looks at classes, not abstract superclasses.
all the best, Don
Don Brutzman  Naval Postgraduate School, Code USW/Br       brutzman at nps.edu
Watkins 270,  MOVES Institute, Monterey CA 93943-5000 USA   +1.831.656.2149
X3D graphics, virtual worlds, navy robotics http://faculty.nps.edu/brutzman

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20190514/a76e44ba/attachment-0001.html>

More information about the x3d-public mailing list