[x3d-public] Possible error in X3dToNodeJS.xslt? LayerSet handling, multiple Mantis issues, class simplification for Java/Node SAI

Don Brutzman brutzman at nps.edu
Sat May 30 06:40:20 PDT 2020


1. Thanks for your notes John.  I've reset our calendar appointment on Mondays for weekly recurrence.

Note that Anita intends to consolidate Web3D zoom rooms starting next week.  Once that is in place we can switch our rendezvous coordinates and add this regular review event to the Web3D calendar.

2. Of note regarding LayerSet is that it has a special inheritance hierarchy, which leads to the special handling below.  We likely need to consider and apply your fix for each of the conversion stylesheets.

3. Meanwhile, it turns out that there are 9 active issues on LayerSet in Mantis!  I just connected them as related so that they can be addressed coherently, there is definitely some overlap in there.

* Mantis: View Issues, then apply search filter "LayerSet"
   https://www.web3d.org/member-only/mantis/view_all_bug_page.php

4. Wondering if you consider "autoclass" a temporary prefix while designing the library.  It will certainly simplify authoring if a programmer can simply say

    .addLayerSet((new LayerSet()).setDEF("scene.addChildLayerSetTest"))

5. Corresponding X3DJSAIL Java invocation looks like this:

  * Filename:     HelloWorldProgram.java
  * Description:  Example "smoke test" program to create an X3D model using the X3D Java Scene Access Interface Library (X3DJSAIL).
  * Identifier:   https://www.web3d.org/specifications/java/examples/HelloWorldProgram.java

	scene.addLayerSet (new LayerSetObject("scene.addChildLayerSetTest")); // string is DEF name

It would be a powerful improvement if the Java might become similarly simplified.  Non-trivial, will keep looking at it.

	scene.addLayerSet (new LayerSet      ("scene.addChildLayerSetTest")); // string is DEF name

v/r Don


On 5/29/2020 10:43 AM, John Carlson wrote:
> This line from my serialized code does the trick.  Let's revisit how to do this in X3dToNodeJS.xslt on Monday.
> 
>          .addLayerSet((new autoclass.LayerSet()).setDEF("scene.addChildLayerSetTest"))
> 
> Will now check in my "repairs."
> 
> John
> 
> On Fri, May 29, 2020 at 12:22 PM John Carlson <yottzumm at gmail.com <mailto:yottzumm at gmail.com>> wrote:
> 
>     java -cp ../jars/X3DJSAIL.4.0.full.jar org.web3d.x3d.jsail.CommandLine examples/HelloWorldProgramOutput.x3d -tojs -toFile examples/HelloWorldProgramOutput.Node.js
>     parameter: source file HelloWorldProgramOutput.x3d filesize 22317 bytes
>     CommandLine parameter: "-tojs" for conversion to X3DJSONLD JavaScript source
>     CommandLine parameter: "-toFile" "examples/HelloWorldProgramOutput.Node.js" for result file name root examples/HelloWorldProgramOutput.Node
>     Parsing using Document Object Model (DOM) based X3DLoaderDOM...
>     [X3DLoaderDOM] <meta name='info' content='continued development and testing in progress'/>
>     convert to JS JavaScript:
>     Warning: toFileStylesheetConversion(X3dToNodeJS.xslt) is overwriting prior file examples/HelloWorldProgramOutput.Node.js
>     className='HelloWorldProgramOutput.Node' has illegal character(s) ( -.,;) replaced with '_' underscore character. newClassName='HelloWorldProgramOutput_Node'
>     file conversion successful: HelloWorldProgramOutput.Node.js (37121 bytes)
> 
>     coderextreme at DESKTOP-DOPK2VD MINGW64 /c/x3d-code/www.web3d.org/x3d/stylesheets/java/node <http://www.web3d.org/x3d/stylesheets/java/node>
>     $ node examples/HelloWorldProgramOutput.Node.js
>     C:\x3d-code\www.web3d.org <http://www.web3d.org>\x3d\stylesheets\java\node\examples\HelloWorldProgramOu
>     tput.Node.js:176
>          .addChild((new autoclass.LayerSet("scene.addChildLayerSetTest")))
>           ^
> 
>     Error: Could not find method "addChild(org.web3d.x3d.jsail.Layering.LayerSetObje
>     ct)" on class "class org.web3d.x3d.jsail.Core.SceneObject". Possible matches:
>        public org.web3d.x3d.jsail.Core.SceneObject org.web3d.x3d.jsail.Core.SceneObje
>     ct.addChild(org.web3d.x3d.sai.Core.X3DChildNode)
> 
>          at HelloWorldProgramOutput_Node.initialize (C:\x3d-code\www.web3d.org <http://www.web3d.org>\x3d\st
>     ylesheets\java\node\examples\HelloWorldProgramOutput.Node.js:176:6)
>          at new HelloWorldProgramOutput_Node (C:\x3d-code\www.web3d.org <http://www.web3d.org>\x3d\styleshee
>     ts\java\node\examples\HelloWorldProgramOutput.Node.js:123:10)
>          at Object.<anonymous> (C:\x3d-code\www.web3d.org <http://www.web3d.org>\x3d\stylesheets\java\node\e
>     xamples\HelloWorldProgramOutput.Node.js:484:1)
>     ?[90m    at Module._compile (internal/modules/cjs/loader.js:1176:30)?[39m
>     ?[90m    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1196:1
>     0)?[39m
>     ?[90m    at Module.load (internal/modules/cjs/loader.js:1040:32)?[39m
>     ?[90m    at Function.Module._load (internal/modules/cjs/loader.js:929:14)?[39m
>     ?[90m    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_ma
>     in.js:71:12)?[39m
>     ?[90m    at internal/main/run_main_module.js:17:47?[39m
> 

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



More information about the x3d-public mailing list