<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<div class="moz-cite-prefix">On 7/21/2017 1:33 PM, John Carlson
wrote:<br>
</div>
<blockquote type="cite"
cite="mid:59726517.45de240a.39dac.545a@mx.google.com">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered
medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:#954F72;
text-decoration:underline;}
.MsoChpDefault
{mso-style-type:export-only;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style>
<div class="WordSection1">
<p class="MsoNormal">Why do we need both DEF and USE? Why can’t
we combine them and just accept that the last
attribute/attribute value that gets set is the correct one?</p>
</div>
</blockquote>
<br>
John,<br>
<br>
Are you asking can there be a (new) attribute (say 'DU') that does a
'DEF' on the first occurrence of a value and a 'USE' on subsequent
occurrences?<br>
<br>
That means the parser would need to examine the value before
determining what to do. It would also be necessary to define what
happens if this is running in a browser and JavaScript code changes
the value of the DU attribute. If this is first in the scene graph
does every other node with matching DU value become a copy/reference
of it? What happens if the scene is serialized?<br>
<br>
At least with a separate DEF & USE certain operations become
errors or at least are ignored.<br>
<br>
<br>
Leonard Daly<br>
<br>
<br>
<br>
<blockquote type="cite"
cite="mid:59726517.45de240a.39dac.545a@mx.google.com">
<div class="WordSection1">
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Is it for human understanding?</p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">John</p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Sent from <a
href="https://go.microsoft.com/fwlink/?LinkId=550986"
moz-do-not-send="true">Mail</a> for Windows 10</p>
<p class="MsoNormal"><o:p> </o:p></p>
<div
style="mso-element:para-border-div;border:none;border-top:solid
#E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal" style="border:none;padding:0in"><b>From:
</b><a href="mailto:andreasplesch@gmail.com"
moz-do-not-send="true">Andreas Plesch</a><br>
<b>Sent: </b>Friday, July 21, 2017 4:08 PM<br>
<b>To: </b><a href="mailto:brutzman@nps.edu"
moz-do-not-send="true">Don Brutzman</a><br>
<b>Cc: </b><a href="mailto:yottzumm@gmail.com"
moz-do-not-send="true">John Carlson</a>; <a
href="mailto:x3d-public@web3d.org" moz-do-not-send="true">X3D
Graphics public mailing list</a><br>
<b>Subject: </b>Re: [x3d-public] setUSE in X3DJSAIL. Impact
on X3DJSONLD.</p>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal">Thanks. Not sure if importDocument would
be very relevant outside of a web browser but it could be,
especially if transpiled to JS.</p>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Looking back at setUSE, I do not think
one can modify an already existing USE reference with SAI.
Instead, get a node (with its DEF name), <a
href="http://www.web3d.org/documents/specifications/19777-2/V3.3/Part2/functions.html#getNode"
moz-do-not-send="true">http://www.web3d.org/documents/specifications/19777-2/V3.3/Part2/functions.html#getNode</a>,
and insert it with field.setValue, <a
href="http://www.web3d.org/documents/specifications/19777-2/V3.3/Part2/functions.html#setValue"
moz-do-not-send="true">http://www.web3d.org/documents/specifications/19777-2/V3.3/Part2/functions.html#setValue</a>,
overwriting an existing reference.</p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">One does the same for the initial
construction of the scene. First, create a node with a DEF
name, then use it to set the field values where ever it is
used:</p>
</div>
<div>
<p class="MsoNormal">Instead of </p>
</div>
<div>
<p class="MsoNormal">nodetype.setUSE('defName')</p>
</div>
<div>
<p class="MsoNormal">it becomes</p>
</div>
<div>
<p class="MsoNormal">field.setValue(scene.getNode('defName'))</p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">I think one could follow the same
procedure in case of root nodes but I am not sure if there
is a situation where you want duplicate (DEF and USE) root
nodes.</p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">So I seem to agree with Roy that setUSE
is not necessary and perhaps incompatible. One
complication it would introduce is that it becomes
necessary to check if the reference DEF name actually
exists and if the referenced node is of the same type as
the provided node type. Another complication is that now
setUSE is also responsible for checking namescopes.</p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">In order to serialize out USEd nodes,
one would first see if the node to serialize is a
reference to an existing node. If it is, look up the DEF
name and type and serialize as type USE=name.</p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">I feel I am missing something,</p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Andreas</p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal">On Fri, Jul 21, 2017 at 11:44 AM, Don
Brutzman <<a href="mailto:brutzman@nps.edu"
target="_blank" moz-do-not-send="true">brutzman@nps.edu</a>>
wrote:</p>
<blockquote style="border:none;border-left:solid #CCCCCC
1.0pt;padding:0in 0in 0in
6.0pt;margin-left:4.8pt;margin-right:0in">
<p class="MsoNormal">On 7/20/2017 3:02 PM, Andreas Plesch
wrote:</p>
<blockquote style="border:none;border-left:solid #CCCCCC
1.0pt;padding:0in 0in 0in
6.0pt;margin-left:4.8pt;margin-right:0in">
<p class="MsoNormal">SAI has importDocument<br>
<br>
<a
href="http://www.web3d.org/documents/specifications/19777-2/V3.3/Part2/functions.html#importDocument"
target="_blank" moz-do-not-send="true">http://www.web3d.org/documents/specifications/19777-2/V3.3/Part2/functions.html#importDocument</a><br>
<br>
where document is a DOM node org.w3c.dom.Node</p>
</blockquote>
<p class="MsoNormal" style="margin-bottom:12.0pt"><br>
added on the TODO list<br>
<a
href="http://www.web3d.org/specifications/java/X3DJSAIL.html#TODO"
target="_blank" moz-do-not-send="true">http://www.web3d.org/specifications/java/X3DJSAIL.html#TODO</a><br>
<br>
v/r Don</p>
</blockquote>
</div>
<p class="MsoNormal"><br>
<br clear="all">
</p>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<p class="MsoNormal">-- </p>
</div>
<p class="MsoNormal">Andreas Plesch<br>
39 Barbara Rd.<br>
Waltham, MA 02453</p>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<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>