[x3d-public] setUSE in X3DJSAIL (@since)

John Carlson yottzumm at gmail.com
Thu Jul 20 13:23:56 PDT 2017


Don, it would be good to mark out in code when the various methods were introduced into Java SAI, so we know what is compatible with older versions. I think the annotation is @since.

Thanks,

John

Sent from Mail for Windows 10

From: Don Brutzman
Sent: Thursday, July 20, 2017 4:11 PM
To: John Carlson
Subject: Re: setUSE in X3DJSAIL

On 7/20/2017 8:53 AM, John Carlson wrote:
> I think the resetting of values is if you change the USE attribute to another DEF value.  Is that possible?

A good way to confirm the answer to such questions is by testing code.  The HelloWorldProgram.java test program (excerpted/linked in prior email response) does that.

In theory that can be certainly be tricky... so design patterns and best practices can help.  X3DJSAIL methods will clear a DEF value if setting a USE value, and vice versa.  Validation methods are further strict in order to detect problems.

This approach (explicitly treating DEF and USE similarly to other fields) copes with an omission in the original Java SAI where DEF/USE did not seem to be explicitly supported, preventing serialization.

Because some X3D scene problems are best prevented at compile time (via careful construction of library interfaces), while other problems can only be detected at run time (e.g. validation testing to confirm whether there a DEF node of same node type in the connected scene subgraph), this can be a tricky business.  Getting the right patterns is really helpful because then all of the classes are autogenerated consistently, enabling best practices.

Meanwhile, for DOM as a different object model, is is interesting to note that either DEF or USE attributes (or both) might be set on an X3D node via the DOM interface as well.

X3DJSAIL currently appears to get the job done effectively, with a further balance to simplify authoring and then confirm correctness using validation.  Once again, these design choices are intended to simplify creation of good X3D models while making creation of incorrect X3D models difficult.

Further problem and solution reports will always be welcome.

	X3D Java Scene Access Interface Library (X3DJSAIL)
	supports programmers with standards-based X3D Java interfaces and objects, all as open source.
	http://www.web3d.org/specifications/java/X3DJSAIL.html

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/20170720/c344393e/attachment.html>


More information about the x3d-public mailing list