[x3d-public] setUSE in X3DJSAIL

Roy Walmsley roy.walmsley at ntlworld.com
Thu Jul 20 06:13:22 PDT 2017


Hi Don,

 

I note that in X3DJSAIL you have a "setUSE" method defined in all node
classes. I don't see any point of having this method.

 

My thinking is as follows. Please correct it as necessary.

 

X3DJSAIL is meant to be an interface for an implementation of the Java
Language binding - ISO/IEC 19777-2.

 

The SAI 19775-2 has no service related to "USE". So it does not appear in
the Java language binding.

 

Consider that an instance of a node (say Material) has been  loaded into
memory and added into a scene. Then consider that further down in the scene
it is desirable to implement a "USE". What are the steps?

 

The first would be to call the Java implementation of the SAI execution
context service "getNode", with the SAIString parameter set to the DEF name,
and the SAIAction parameter set to DEFNode.  In the standard ISO/IEC 19777-2
V3.0, clause 6.4.6 getNode the defined method is getNamedNode. What is your
equivalent function in X3DJSAIL?

 

Having obtained a node reference for the DEF'd node, let's assume you also
have a node reference for the node that is to be the parent of the USE node,
which I will assume for this example will be Appearance. 

 

You now need to obtain a reference for the "material" field of the
Appearance node.  We need to  use the SAI service getField, defined in 6.6.4
getField in ISO/IEC 19775-2. The Java language binding lists this as
getField in clause 6.6.4 of ISO/IEC 19777-2. What is your equivalent
function in X3DJSAIL?

 

Now that we have the field reference, and the node reference to add, we can
finally make a call to the SAI service setValue, defined in 6.7.6 setValue
in ISO/IEC 19775-2. The Java language binding lists this as setValue in
6.7.6 of ISO/IEC 19777-2. What is your equivalent function in X3DJSAIL?

 

Final comments relate to garbage management. The implementation will
probably want some way to remember that the same node reference has been
used in multiple places. That is something internal to the implementation,
and not anything for the interface.

 

So, in conclusion, I don't see a need for your setUSE method. And it is not
in the SAI.

 

All the best,

 

Roy

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


More information about the x3d-public mailing list