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='TimeTriggerTest.x3d'/> |
6 | <meta name='description' content='Test of TimeTrigger node.'/> |
7 | <meta name='created' content='8 October 2007'/> |
8 | <meta name='modified' content='20 October 2019'/> |
9 | <meta name='creator' content='Leonard Daly and Don Brutzman'/> |
10 | <meta name='identifier' content='https://www.web3d.org/x3d/content/examples/X3dForWebAuthors/Chapter09EventUtilitiesScripting/TimeTriggerTest.x3d'/> |
11 | <meta name='generator' content='X3D-Edit 3.3, https://savage.nps.edu/X3D-Edit'/> |
12 | <meta name='license' content='../license.html'/> |
13 | </head> |
14 | <Scene> |
15 | <WorldInfo title='TimeTriggerTest.x3d'/> |
16 | <Background skyColor='1 1 1'/> |
17 | <Viewpoint description='TimeTrigger test' position='0 0 7'/> |
18 | <Transform> |
19 | <Shape> |
20 | <Appearance> |
21 | <Material diffuseColor='.6 0 .8'/> |
22 | </Appearance> |
23 | <Text string='"Touch text to print" "output values on console"'> |
24 | <FontStyle justify='"MIDDLE" "MIDDLE"'/> |
25 | </Text> |
26 | </Shape> |
27 | <!-- Selectable Text design pattern has transparent Box and TouchSensor description as a tooltip --> |
28 | <Shape> |
29 | <Box size='9 2 .001'/> |
30 | <Appearance> |
31 | <Material transparency='1'/> |
32 | </Appearance> |
33 | </Shape> |
34 | <!-- This TouchSensor only reacts to user clicking on the sibling Shape and Text, because it is under a parent Transform grouping node --> |
35 |
<!-- ROUTE information for TextTouched node:
[from isActive to Filter.set_boolean
]
[from isActive to TraceScript.printBoolean
]
-->
<TouchSensor DEF='TextTouched' description='touch to activate'/> |
36 | </Transform> |
37 |
<!-- ROUTE information for Filter node:
[from TextTouched.isActive to set_boolean
]
[from inputTrue to Trigger.set_boolean
]
-->
<BooleanFilter DEF='Filter'/> |
38 | < ROUTE fromNode='TextTouched' fromField='isActive' toNode='Filter' toField='set_boolean'/> |
39 |
<!-- ROUTE information for Trigger node:
[from Filter.inputTrue to set_boolean
]
[from triggerTime to TraceScript.printTimestamp
]
-->
<TimeTrigger DEF='Trigger'/> |
40 | < ROUTE fromNode='Filter' fromField='inputTrue' toNode='Trigger' toField='set_boolean'/> |
41 |
<!-- ROUTE information for TraceScript node:
[from Trigger.triggerTime to printTimestamp
]
[from TextTouched.isActive to printBoolean
]
-->
<Script DEF='TraceScript'> |
42 | <field name='printBoolean' type='SFBool' accessType='inputOnly'/> |
43 | <field name='printTimestamp' type='SFTime' accessType='inputOnly'/> |
<![CDATA[
ecmascript: function printBoolean (value) { Browser.println ('TouchSensor isActive="' + value + '"'); } function printTimestamp (value) { Browser.println ('====================================' + ''); Browser.println ('Trigger triggerTime="' + value + '"'); }
]]>
|
|
45 | </Script> |
46 | < ROUTE fromNode='Trigger' fromField='triggerTime' toNode='TraceScript' toField='printTimestamp'/> |
47 | < ROUTE fromNode='TextTouched' fromField='isActive' toNode='TraceScript' toField='printBoolean'/> |
48 | </Scene> |
49 | </X3D> |
Event Graph ROUTE Table entries with 4 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.
TextTouched
TouchSensor isActive SFBool |
Filter
BooleanFilter set_boolean SFBool |
then
|
Filter
BooleanFilter inputTrue SFBool |
Trigger
TimeTrigger set_boolean SFBool |
then
|
Trigger
TimeTrigger triggerTime SFTime |
TraceScript
Script printTimestamp SFTime |
|||
TextTouched
TouchSensor isActive SFBool |
TraceScript
Script printBoolean SFBool |
<!--
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. -->