[X3D-Public] X3D teleconference notes: Script field naming, etc.

Don Brutzman brutzman at nps.edu
Wed Apr 11 09:04:11 PDT 2012

Dick, Len and I discussed several topics today on a teleconference.

- We received some excellent detailed comments on the X3D Specifications
	from a faculty member at University of Saarland, who wrote a
	set of python tools to scan the specification documents.
	These are very helpful.  We will review them in detail during
	next weeks call.

- There will be direct bookmark links for each node in the X3D Node Index
	for the X3D v3.3 to facilitate help systems, tools and tooltips
	being able to provide advanced help.

- Dick continues to work and make good progress on disposition of comments
	for the X3D v3.3 draft international standard.

- Upcoming topic:  how can Web3D Consortium provide public credit to 
	individuals who have contributed to the X3D Specifications.
	(W3C does this but ISO apparently does not have a policy.)

- We did some more forensics on the naming of Ecmascript methods for
	fields in javascript for the Script node.

Problem statement:  field accessor methods need to have a different name than the field itself.  Some javascript implementions confound the field object and the method object when the names are the same.

Fix summary:
a. Set methods for a field should be called set_fieldName.
b. If an output event is sent, is is called fieldname_changed.
c. Within the script, current value is referred to as fieldName

-- This was a hot topic during and following Web3D 2009 Symposium in Darmstadt
-- Agreement diagram attached which listed options and priorities
-- No Mantis bug found
-- We searched mail archives but could not find the thread or the proposed change prose, will continue looking
-- If we can't find the prior change-proposal prose, we will regenerate it
-- Can anyone else find the email thread?
-- We will make plans for a new ISO project and amendment change document for 19777-1
-- We believe that Instant Reality and Xj3D have implemented this change but BS Contact has not, conformance reports welcome


> Receiving events
> Events sent to the containing node are passed to the corresponding ECMAScript function in the script. The function's name is the same as the field and is passed two arguments. If the function represents an inputOutput field, the name of the function shall be the same name as the field declaration, without the set_ or _changed modifiers. The value of the event is passed as the first argument and the timestamp of the event is passed as the second argument. The type of the value is the same as the type of the event and the type of the timestamp is SFTime. X3D field to ECMAScript variable conversion provides a description of how X3D types appear in ECMAScript. The values of the parameters have no visibility outside the function.
> If there is no corresponding ECMAScript function in the script, the browser's behaviour is to silently ignore the event.
> EXAMPLE  The following Script node has one writable field whose name is start:
> Script {
>     eventIn SFBool start
>     url "ecmascript: function start(value, timestamp) { ... }"
> }
> When the start event is received, the start() function is executed.

Comments welcome.

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 --------------
A non-text attachment was scrubbed...
Name: Web3d2009X3dJavascriptFieldNamingConventions.jpg
Type: image/jpeg
Size: 178904 bytes
Desc: not available
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20120411/5ff5619d/attachment-0001.jpg>

More information about the X3D-Public mailing list