<?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=' BooleanSequencerIntegerSequencer.x3d '/>
<meta name='descriptioncontent='Show synchronized use of BooleanSequencer and IntegerSequencer nodes for SpotLight enabled and Switch whichChoice control, respectively'/>
<meta name='creatorcontent='Don Brutzman'/>
<meta name='createdcontent='6 September 2006'/>
<meta name='modifiedcontent='20 October 2019'/>
<meta name='identifiercontent=' https://www.web3d.org/x3d/content/examples/X3dForWebAuthors/Chapter09EventUtilitiesScripting/BooleanSequencerIntegerSequencer.x3d '/>
<meta name='generatorcontent='X3D-Edit 3.3, https://savage.nps.edu/X3D-Edit'/>
<meta name='licensecontent=' ../license.html'/>
</head>
<!--

to top <!-- Event Graph ROUTE Table shows event connections -->
 
<!-- Index for DEF nodes: Child0, Child1, Child2, Child3, ChildSequencer, Clock, GreyAppearance, OnOffSequencer, RedSpotLight, ShapeSwitcher
-->
<Scene>
<WorldInfo title='BooleanSequencerIntegerSequencer.x3d'/>
<NavigationInfo/>
<!-- ROUTE information for Clock node:  [from fraction_changed to OnOffSequencer.set_fraction ] [from fraction_changed to ChildSequencer.set_fraction ] -->
<TimeSensor DEF='ClockcycleInterval='10loop='true'/>

<!-- ROUTE information for OnOffSequencer node:  [from Clock.fraction_changed to set_fraction ] [from value_changed to RedSpotLight.on ] -->
<BooleanSequencer DEF='OnOffSequencerkey='0 0.2 0.4 0.6 0.8 1keyValue='true false true false true true'/>

<!-- ROUTE information for RedSpotLight node:  [from OnOffSequencer.value_changed to on ] -->
<SpotLight DEF='RedSpotLightcolor='1 0.0 0.0location='0 0 10'/>

<!-- Note no red or pink materials, only grey -->
< ROUTE  fromNode=' Clock' fromField='fraction_changed' toNode=' OnOffSequencer' toField='set_fraction'/>
< ROUTE  fromNode=' OnOffSequencer' fromField='value_changed' toNode=' RedSpotLight' toField='on'/>
<!-- ROUTE information for ChildSequencer node:  [from Clock.fraction_changed to set_fraction ] [from value_changed to ShapeSwitcher.whichChoice ] -->
<IntegerSequencer DEF='ChildSequencerkey='0 0.2 0.4 0.6 0.8 1keyValue='0 1 2 3 -1 0'/>

<Transform translation='-3.5 1 0'>
<!-- ROUTE information for ShapeSwitcher node:  [from ChildSequencer.value_changed to whichChoice ] -->
<Switch DEF='ShapeSwitcherwhichChoice='-1'>
<Shape DEF='Child0'>
<Text string='"Grey child 0" "headlight plus red light"'/>
<Appearance DEF='GreyAppearance'>
<Material diffuseColor='0.7 0.7 0.7'/>
</Appearance>
</Shape>
<Shape DEF='Child1'>
<Text string='"Grey child 1" "headlight only"'/>
<Appearance USE=' GreyAppearance'/>
</Shape>
<Shape DEF='Child2'>
<Text string='"Grey child 2" "headlight plus red light"'/>
<Appearance USE=' GreyAppearance'/>
</Shape>
<Shape DEF='Child3'>
<Text string='"Grey child 3" "headlight only"'/>
<Appearance USE=' GreyAppearance'/>
</Shape>
</Switch>
</Transform>
< ROUTE  fromNode=' Clock' fromField='fraction_changed' toNode=' ChildSequencer' toField='set_fraction'/>
< ROUTE  fromNode=' ChildSequencer' fromField='value_changed' toNode=' ShapeSwitcher' toField='whichChoice'/>
</Scene>
</X3D>
<!--

to top <!-- Event Graph ROUTE Table shows event connections -->
 
<!-- Index for DEF nodes: Child0, Child1, Child2, Child3, ChildSequencer, Clock, GreyAppearance, OnOffSequencer, RedSpotLight, ShapeSwitcher
-->

Event Graph ROUTE Table 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.

Clock
TimeSensor
fraction_changed
SFFloat

ROUTE
event to
(1)
OnOffSequencer
BooleanSequencer
set_fraction
SFFloat

 
 
then
OnOffSequencer
BooleanSequencer
value_changed
SFBool

ROUTE
event to
(2)
RedSpotLight
SpotLight
on
SFBool
Clock
TimeSensor
fraction_changed
SFFloat

ROUTE
event to
(1)
ChildSequencer
IntegerSequencer
set_fraction
SFFloat

 
 
then
ChildSequencer
IntegerSequencer
value_changed
SFInt32

ROUTE
event to
(2)
ShapeSwitcher
Switch
whichChoice
SFInt32


-->

<!-- Online at
https://www.web3d.org/x3d/content/examples/X3dForWebAuthors/Chapter09EventUtilitiesScripting/BooleanSequencerIntegerSequencerIndex.html -->
<!-- Version control at
https://sourceforge.net/p/x3d/code/HEAD/tree/www.web3d.org/x3d/content/examples/X3dForWebAuthors/Chapter09EventUtilitiesScripting/BooleanSequencerIntegerSequencer.x3d -->

<!-- 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)
-->

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