<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<div class="moz-cite-prefix">I am going to attempt to provide some
historical perspective to set_ and _changed event names.
Unfortunately, my memory has a few holes. This is just a (partial)
recounting of history and not a claim that the language in the
document was correctly provided to fully capture the intent of the
participants.<br>
<br>
Way back when working on X3D V3[.0] there was a long discussion on
this topic. The concern was trying to be really clear in the
language definition so that an unambiguous DTD could be written
and the user create valid XML. The particular concern was
inputOutput fields in Script nodes.<br>
<br>
Using Michalis' example of the 'on' inputOutput field in a light
node. If the user code is:<br>
<br>
<blockquote><tt><Script DEF='Foo' ></tt><br>
<tt> <field name='on' type='SFBool'
accessType='inputOutput'/></tt><br>
<tt>
<field name='bar' type='SFInt32'
accessType='inputOnly'/></tt><br>
<tt>![CDATA[ecmascript:</tt><br>
<br>
<tt>function on (value, time) {</tt><br>
<tt> ... do something...</tt><br>
<tt> on = !on; // !!!</tt><br>
<tt>}</tt><br>
<br>
<tt>function bar (value) {</tt><br>
<tt> on = (value == 2);</tt><br>
<tt> return on;</tt><br>
<tt>}</tt><br>
<tt>]]></tt><br>
<tt></Script></tt><br>
</blockquote>
<br>
You can ROUTE events to Foo.on, store a value in it, and ROUTE
events from Foo.on. It is not clear what to do with each
occurrence of 'on' and how that might be valid XML and ECMAScript.<br>
<br>
This makes a true mess of code. I think a similar thing happens
with PROTO.<br>
<br>
The solution was to require set_ and _changed for certain
conditions (like Scripts) and maintain some flexibility in dealing
with existing inputOuput fields (e.g., on from DirectionalLight).
The above example should be written as:<br>
<br>
<blockquote><tt><Script DEF='Foo' ></tt><br>
<tt> <field name='set_on' type='SFBool'
accessType='inputOnly'/></tt><br>
<tt> <field name='on_changed' type='SFBool'
accessType='outputOnly'/></tt><br>
<tt>
</tt> <tt> <field name='on' type='SFBool'
accessType=''/></tt><br>
<tt>
</tt><tt>
<field name='bar' type='SFInt32'
accessType='inputOnly'/></tt><br>
<tt>![CDATA[ecmascript:</tt><br>
<br>
<tt>function set_on (value, time) {</tt><br>
<tt> ... do something...</tt><br>
<tt> on = value; // !!!</tt><br>
<tt>}</tt><br>
<br>
<tt>function bar (value) {</tt><br>
<tt><tt> on = (value == 2);</tt><br>
</tt> <tt><tt> on_changed = on;</tt><br>
</tt><tt> r</tt><tt>eturn on_changed;</tt><br>
<tt>}</tt><br>
<tt>]]></tt><br>
<tt></Script></tt><br>
</blockquote>
<br>
In this example the meaning and operation of each occurrence if
'*on*' is clear and there is no problem with the ECMAScript.
'*on*' is either a function ('set_on'), an internal variable
('on'), or an output ('on_changed').<br>
<br>
<br>
Leonard Daly<br>
<br>
<br>
<br>
<br>
</div>
<blockquote type="cite"
cite="mid:CAKzBGZMGE42bL++3Nvg+AA+h_6azgNPoPkZPYHMnoFn47ABGDg@mail.gmail.com">
<pre wrap="">2017-04-24 15:38 GMT+02:00 Andreas Plesch <a class="moz-txt-link-rfc2396E" href="mailto:andreasplesch@gmail.com"><andreasplesch@gmail.com></a>:
</pre>
<blockquote type="cite">
<pre wrap="">But these are input_only and output_only fields, not inputoutput fields.
Here is the spec. follows (satisfyingly) its own recommendation from 4.4.2.2
Field Semantics, items h) and j).
</pre>
</blockquote>
<pre wrap="">
Reading the Andreas mail, I realized that my testing
ROUTE MyTimeSensor.fraction TO MyPositionInterpolator.fraction
vs
ROUTE MyTimeSensor.fraction_changed TO MyPositionInterpolator.set_fraction
was not very useful: there is no inputOutput called "fraction" here,
so it's normal that the 1st form doesn't work.
The correct testcase of the question "is set_/_changed required to
refer to inputOutput fields as events" is to compare:
ROUTE MyTimeSensor.isActive TO MyLight.on
vs
ROUTE MyTimeSensor.isActive TO MyLight.set_on
Here, we test X3DLightNode.on (inputOutput field). A simple testcase
using this is attached.
Testing on my own view3dscene, we support both forms. So it looks like
I was wrong (two times!):
1. "Me from the past" understood the specification to mean "the
set_/_changed are *optional* if you want to refer to inputOutput field
as event". Just like it is more sensible to Andreas.
2. "Me from the past" implemented view3dscene to make them optional.
Sorry for the confusion:)
Regards,
Michalis
</pre>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
x3d-public mailing list
<a class="moz-txt-link-abbreviated" href="mailto:x3d-public@web3d.org">x3d-public@web3d.org</a>
<a class="moz-txt-link-freetext" href="http://web3d.org/mailman/listinfo/x3d-public_web3d.org">http://web3d.org/mailman/listinfo/x3d-public_web3d.org</a>
</pre>
</blockquote>
<p><br>
</p>
<div class="moz-signature">-- <br>
<font class="tahoma,arial,helvetica san serif" color="#333366">
<font size="+1"><b>Leonard Daly</b></font><br>
3D Systems & Cloud Consultant<br>
LA ACM SIGGRAPH Chair<br>
President, Daly Realism - <i>Creating the Future</i>
</font></div>
</body>
</html>