1 |
<?xml version="1.0" encoding="UTF-8"?>
|
2 |
<!DOCTYPE X3D PUBLIC "ISO//Web3D//DTD X3D 3.3//EN" "https://www.web3d.org/specifications/x3d-3.3.dtd">
|
3 | <X3D profile='Immersive' version='3.3' xmlns:xsd='http://www.w3.org/2001/XMLSchema-instance' xsd:noNamespaceSchemaLocation='https://www.web3d.org/specifications/x3d-3.3.xsd'> |
4 | <head> |
5 | <meta name='title' content='ExecutionModel.x3d'/> |
6 | <meta name='description' content='X3D encodings example: execution model demonstrated. Click ball to see script-generated text appear.'/> |
7 | <meta name='creator' content='Don Brutzman and Joe Williams'/> |
8 | <meta name='created' content='1 June 2002'/> |
9 | <meta name='modified' content='28 October 2019'/> |
10 | <meta name='specificationSection' content='X3D encodings, ISO/IEC 19776-1.3, Part 1: XML encoding, Annex C.19 Execution model'/> |
11 | <meta name='specificationUrl' content='https://www.web3d.org/documents/specifications/19776-1/V3.3/Part01/examples.html#ExecutionModel'/> |
12 | <meta name='identifier' content='https://www.web3d.org/x3d/content/examples/Basic/X3dSpecifications/ExecutionModel.x3d'/> |
13 | <meta name='generator' content='X3D-Edit 3.3, https://savage.nps.edu/X3D-Edit'/> |
14 | <meta name='license' content='../license.html'/> |
15 | </head> |
16 | <Scene> |
17 | <WorldInfo title='ExecutionModel.x3d'/> |
18 |
<!-- ROUTE information for TS node:
[from touchTime to Script1.touchTime
]
-->
<TouchSensor DEF='TS' description='click to animate'/> |
19 |
<!-- ROUTE information for Script1 node:
[from TS.touchTime to touchTime
]
[from toScript2 to Script2.fromScript1
]
[from toScript3 to Script3.fromScript1
]
[from string to Collector.fromString
]
-->
<Script DEF='Script1'> |
20 | <field name='touchTime' type='SFTime' accessType='inputOnly'/> |
21 | <field name='toScript2' type='SFBool' accessType='outputOnly'/> |
22 | <field name='toScript3' type='SFBool' accessType='outputOnly'/> |
23 | <field name='string' type='SFString' accessType='outputOnly'/> |
<![CDATA[
ecmascript: function touchTime() { toScript2 = true; } function eventsProcessed() { string = 'Script1.eventsProcessed'; toScript3 = true; }
]]>
|
|
25 | </Script> |
26 |
<!-- ROUTE information for Script2 node:
[from Script1.toScript2 to fromScript1
]
[from toScript4 to Script4.fromScript2
]
[from string to Collector.fromString
]
-->
<Script DEF='Script2'> |
27 | <field name='fromScript1' type='SFBool' accessType='inputOnly'/> |
28 | <field name='toScript4' type='SFBool' accessType='outputOnly'/> |
29 | <field name='string' type='SFString' accessType='outputOnly'/> |
<![CDATA[
ecmascript: function fromScript1() { } function eventsProcessed() { string = 'Script2.eventsProcessed'; toScript4 = true; }
]]>
|
|
31 | </Script> |
32 |
<!-- ROUTE information for Script3 node:
[from Script1.toScript3 to fromScript1
]
[from toScript5 to Script5.fromScript3
]
[from toScript6 to Script6.fromScript3
]
[from string to Collector.fromString
]
-->
<Script DEF='Script3'> |
33 | <field name='fromScript1' type='SFBool' accessType='inputOnly'/> |
34 | <field name='toScript5' type='SFBool' accessType='outputOnly'/> |
35 | <field name='toScript6' type='SFBool' accessType='outputOnly'/> |
36 | <field name='string' type='SFString' accessType='outputOnly'/> |
<![CDATA[
ecmascript: function fromScript1() { toScript5 = true; } function eventsProcessed() { string = 'Script3.eventsProcessed'; toScript6 = true; }
]]>
|
|
38 | </Script> |
39 |
<!-- ROUTE information for Script4 node:
[from Script2.toScript4 to fromScript2
]
-->
<Script DEF='Script4'> |
40 | <field name='fromScript2' type='SFBool' accessType='inputOnly'/> |
<![CDATA[
ecmascript: function fromScript2() { }
]]>
|
|
42 | </Script> |
43 |
<!-- ROUTE information for Script5 node:
[from Script3.toScript5 to fromScript3
]
-->
<Script DEF='Script5'> |
44 | <field name='fromScript3' type='SFBool' accessType='inputOnly'/> |
<![CDATA[
ecmascript: function fromScript3() { }
]]>
|
|
46 | </Script> |
47 |
<!-- ROUTE information for Script6 node:
[from Script3.toScript6 to fromScript3
]
[from toScript7 to Script7.fromScript6
]
[from string to Collector.fromString
]
-->
<Script DEF='Script6'> |
48 | <field name='fromScript3' type='SFBool' accessType='inputOnly'/> |
49 | <field name='toScript7' type='SFBool' accessType='outputOnly'/> |
50 | <field name='string' type='SFString' accessType='outputOnly'/> |
<![CDATA[
ecmascript: function fromScript3() { toScript7 = true; } function eventsProcessed() { string = 'Script6.eventsProcessed'; }
]]>
|
|
52 | </Script> |
53 |
<!-- ROUTE information for Script7 node:
[from Script6.toScript7 to fromScript6
]
-->
<Script DEF='Script7'> |
54 | <field name='fromScript6' type='SFBool' accessType='inputOnly'/> |
<![CDATA[
ecmascript: function fromScript6 () { }
]]>
|
|
56 | </Script> |
57 | <!-- Display the results --> |
58 |
<!-- ROUTE information for Collector node:
[from Script1.string to fromString
]
[from Script2.string to fromString
]
[from Script3.string to fromString
]
[from Script6.string to fromString
]
[from string to Result.string
]
-->
<Script DEF='Collector'> |
59 | <field name='string' type='MFString' accessType='outputOnly'/> |
60 | <field name='fromString' type='SFString' accessType='inputOnly'/> |
<![CDATA[
ecmascript: function initialize() { string[0] = 'Event Sequence:'; } function fromString(s) { i = string.length; string[i] = ' ( ' + i + ' ) ' + s + ' occurred'; }
]]>
|
|
62 | </Script> |
63 | <Transform translation='0 2 0'> |
64 | <Shape> |
65 | <Appearance> |
66 | <Material diffuseColor='0 0.6 0'/> |
67 | </Appearance> |
68 | <Sphere/> |
69 | </Shape> |
70 | </Transform> |
71 | <Shape> |
72 |
<!-- ROUTE information for Result node:
[from Collector.string to string
]
-->
<Text DEF='Result'/> |
73 | <Appearance> |
74 | <Material diffuseColor='0.101961 0.839216 1'/> |
75 | </Appearance> |
76 | </Shape> |
77 | <Viewpoint description='Execution model example' position='7 -1 18'/> |
78 | < ROUTE fromNode='TS' fromField='touchTime' toNode='Script1' toField='touchTime'/> |
79 | < ROUTE fromNode='Script1' fromField='toScript2' toNode='Script2' toField='fromScript1'/> |
80 | < ROUTE fromNode='Script1' fromField='toScript3' toNode='Script3' toField='fromScript1'/> |
81 | < ROUTE fromNode='Script2' fromField='toScript4' toNode='Script4' toField='fromScript2'/> |
82 | < ROUTE fromNode='Script3' fromField='toScript5' toNode='Script5' toField='fromScript3'/> |
83 | < ROUTE fromNode='Script3' fromField='toScript6' toNode='Script6' toField='fromScript3'/> |
84 | < ROUTE fromNode='Script6' fromField='toScript7' toNode='Script7' toField='fromScript6'/> |
85 | < ROUTE fromNode='Script1' fromField='string' toNode='Collector' toField='fromString'/> |
86 | < ROUTE fromNode='Script2' fromField='string' toNode='Collector' toField='fromString'/> |
87 | < ROUTE fromNode='Script3' fromField='string' toNode='Collector' toField='fromString'/> |
88 | < ROUTE fromNode='Script6' fromField='string' toNode='Collector' toField='fromString'/> |
89 | < ROUTE fromNode='Collector' fromField='string' toNode='Result' toField='string'/> |
90 | </Scene> |
91 | </X3D> |
Event Graph ROUTE Table entries with 12 ROUTE connections total, showing X3D event-model relationships for this scene.
Each row shows an event cascade that may occur during a single timestamp interval between frame renderings, as part of the X3D execution model.
Collector
Script string MFString |
Result
Text string MFString |
<!--
Color legend: X3D terminology
<X3dNode
DEF='idName' field='value'/>
matches XML terminology
<XmlElement
DEF='idName' attribute='value'/>
(Light-blue background: event-based behavior node or statement)
(Grey background inside box: inserted documentation)
(Magenta background: X3D Extensibility)
-->
<!-- For additional help information about X3D scenes, please see X3D Tooltips, X3D Resources, and X3D Scene Authoring Hints. -->