<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE X3D PUBLIC "ISO//Web3D//DTD X3D 3.3//EN" "https://www.web3d.org/specifications/x3d-3.3.dtd">
<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 '>
<head>
<meta name='titlecontent='TimeTriggerTest.x3d'/>
<meta name='descriptioncontent='Test of TimeTrigger node.'/>
<meta name='createdcontent='8 October 2007'/>
<meta name='modifiedcontent='20 October 2019'/>
<meta name='creatorcontent='Leonard Daly and Don Brutzman'/>
<meta name='identifiercontent=' https://X3dGraphics.com/examples/X3dForWebAuthors/Chapter09EventUtilitiesScripting/TimeTriggerTest.x3d '/>
<meta name='generatorcontent='X3D-Edit 3.3, https://savage.nps.edu/X3D-Edit'/>
<meta name='licensecontent=' ../license.html'/>
</head>
<!--

Index for DEF nodes : Filter, TextTouched, TraceScript, Trigger

Index for Viewpoint image : Viewpoint_1
-->
<Scene>
<WorldInfo title='TimeTriggerTest.x3d'/>
<Background skyColor='1 1 1'/>
<Viewpoint description='TimeTrigger testposition='0 0 7'/>
<Transform>
<Shape>
<Appearance>
<Material diffuseColor='.6 0 .8'/>
</Appearance>
<Text string='"Touch text to print" "output values on console"'>
<FontStyle justify='"MIDDLE" "MIDDLE"'/>
</Text>
</Shape>
<!-- Selectable Text design pattern has transparent Box and TouchSensor description as a tooltip -->
<Shape>
<Box size='9 2 .001'/>
<Appearance>
<Material transparency='1'/>
</Appearance>
</Shape>
<!-- This TouchSensor only reacts to user clicking on the sibling Shape and Text, because it is under a parent Transform grouping node -->
<!-- ROUTE information for TextTouched node:  [from isActive to Filter.set_boolean ] [from isActive to TraceScript.printBoolean ] -->
<TouchSensor DEF='TextToucheddescription='touch to activate'/>
</Transform>
<!-- ROUTE information for Filter node:  [from TextTouched.isActive to set_boolean ] [from inputTrue to Trigger.set_boolean ] -->
<BooleanFilter DEF='FiltercontainerField='children'/>
<ROUTE fromNode='TextTouchedfromField='isActivetoNode='FiltertoField='set_boolean'/>
<!-- ROUTE information for Trigger node:  [from Filter.inputTrue to set_boolean ] [from triggerTime to TraceScript.printTimestamp ] -->
<TimeTrigger DEF='TriggercontainerField='children'/>
<ROUTE fromNode='FilterfromField='inputTruetoNode='TriggertoField='set_boolean'/>
<!-- ROUTE information for TraceScript node:  [from Trigger.triggerTime to printTimestamp ] [from TextTouched.isActive to printBoolean ] -->
<Script DEF='TraceScript'>
<field name='printBooleantype='SFBoolaccessType='inputOnly'/>
<field name='printTimestamptype='SFTimeaccessType='inputOnly'/>
<![CDATA[
      
ecmascript:
    function printBoolean (value) {
      Browser.print ('TouchSensor isActive="' + value + '"\n');
    }
    function printTimestamp (value) {
      Browser.print ('====================================' +  '\n');
      Browser.print ('Trigger triggerTime="' + value + '"\n');
    }

    
]]>
</Script>
<ROUTE fromNode='TriggerfromField='triggerTimetoNode='TraceScripttoField='printTimestamp'/>
<ROUTE fromNode='TextTouchedfromField='isActivetoNode='TraceScripttoField='printBoolean'/>
</Scene>
</X3D>
<!--

Index for DEF nodes : Filter, TextTouched, TraceScript, Trigger

Index for Viewpoint image : Viewpoint_1
-->

<!-- Color key: <X3dNode DEF='idName' field='value'/> matches <XmlElement DEF='idName' attribute='value'/>
(Light blue background: behavior node) (Grey background: inserted documentation) (Magenta background: X3D Extensibility)
-->

<!-- For additional help information about X3D scenes, please see X3D Tooltips, X3D Resources and X3D Scene Authoring Hints. -->