<?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='MoodSelector.x3d'/>
<meta name='descriptioncontent='Design pattern demonstrating multiple TouchSensor, IntegerTrigger, Shape and ROUTE combinations for selecting a Switch'/>
<meta name='creatorcontent='Jason Nelson and MV4205 class'/>
<meta name='createdcontent='6 April 2009'/>
<meta name='modifiedcontent='20 October 2019'/>
<meta name='licensecontent='smiley images are open source'/>
<meta name='referencecontent=' http://openclipart.org/media/tags/smiley '/>
<meta name='identifiercontent=' https://X3dGraphics.com/examples/X3dForWebAuthors/Chapter09EventUtilitiesScripting/MoodSelector.x3d '/>
<meta name='generatorcontent='X3D-Edit 3.3, https://savage.nps.edu/X3D-Edit'/>
<meta name='licensecontent=' ../license.html'/>
</head>
<!-- -->
<Scene>
<WorldInfo title='MoodSelector.x3d'/>
<Viewpoint description='How do you feel today?position='0 0 15'/>
<Transform translation='0 3 0'>
<!-- ROUTE information for howFeelText node:  [from isActive to nodisplay.set_boolean ] -->
<TouchSensor DEF='howFeelTextdescription='Touch to select your mood face'/>
<Shape>
<Text string='"How do you feel today?"'>
<FontStyle justify='"MIDDLE" "MIDDLE"'/>
</Text>
<Appearance>
<Material/>
</Appearance>
</Shape>
</Transform>
<Transform translation='-5 0 0'>
<!-- ROUTE information for happyText node:  [from isActive to happydisplay.set_boolean ] -->
<TouchSensor DEF='happyTextdescription='I feel happy I feel happy...'/>
<Shape>
<Text string='"Happy"'>
<FontStyle justify='"MIDDLE" "MIDDLE"'/>
</Text>
<Appearance>
<Material diffuseColor='0.129412 1 0.019608'/>
</Appearance>
</Shape>
<Shape>
<Box size='2.5 1 0.1'/>
<Appearance DEF='TransparentAppearance'>
<Material transparency='1'/>
</Appearance>
</Shape>
</Transform>
<Transform translation='-1.3 0 0'>
<!-- ROUTE information for notBadText node:  [from isActive to nbdisplay.set_boolean ] -->
<TouchSensor DEF='notBadTextdescription='OK mediocre just plain average no comment'/>
<Shape>
<Text string='"Average"'>
<FontStyle justify='"MIDDLE" "MIDDLE"'/>
</Text>
<Appearance>
<Material diffuseColor='1 0.960784 0.019608'/>
</Appearance>
</Shape>
<Shape>
<Box size='3 1 0.1'/>
<Appearance USE='TransparentAppearance'/>
</Shape>
</Transform>
<Transform translation='2.2 0 0'>
<!-- ROUTE information for sadText node:  [from isActive to saddisplay.set_boolean ] -->
<TouchSensor DEF='sadTextdescription='Poor poor pitiful me'/>
<Shape>
<Text string='"Sad"'>
<FontStyle justify='"MIDDLE" "MIDDLE"'/>
</Text>
<Appearance>
<Material diffuseColor='0.180392 0.705882 1'/>
</Appearance>
</Shape>
<Shape>
<Box size='2 1 0.1'/>
<Appearance USE='TransparentAppearance'/>
</Shape>
</Transform>
<Transform translation='5 0 0'>
<!-- ROUTE information for badText node:  [from isActive to bulldisplay.set_boolean ] -->
<TouchSensor DEF='badTextdescription='Look out below!'/>
<Shape>
<Text string='"Bad"'>
<FontStyle justify='"MIDDLE" "MIDDLE"'/>
</Text>
<Appearance>
<Material diffuseColor='1 0.019608 0.05098'/>
</Appearance>
</Shape>
<Shape>
<Box size='4.5 1 0.1'/>
<Appearance USE='TransparentAppearance'/>
</Shape>
</Transform>
<!-- ROUTE information for display node:  [from nodisplay.triggerValue to whichChoice ] [from happydisplay.triggerValue to whichChoice ] [from nbdisplay.triggerValue to whichChoice ] [from saddisplay.triggerValue to whichChoice ] [from bulldisplay.triggerValue to whichChoice ] -->
<Switch DEF='displaywhichChoice='-1'>
<Transform translation='-5 -3 0'>
<Shape DEF='happyimg'>
<Box/>
<Appearance> </Appearance>
</Shape>
</Transform>
<Transform translation='-1.3 -3 0'>
<Shape DEF='nbimg'>
<Box/>
<Appearance> </Appearance>
</Shape>
</Transform>
<Transform translation='2.2 -3 0'>
<Shape DEF='sadimg'>
<Box/>
<Appearance> </Appearance>
</Shape>
</Transform>
<Transform translation='4.7 -3 0'>
<Shape DEF='bullimg'>
<Box/>
<Appearance> </Appearance>
</Shape>
</Transform>
</Switch>
<!-- ROUTE information for nodisplay node:  [from howFeelText.isActive to set_boolean ] [from triggerValue to display.whichChoice ] -->
<IntegerTrigger DEF='nodisplaycontainerField='children'/>
<!-- ROUTE information for happydisplay node:  [from happyText.isActive to set_boolean ] [from triggerValue to display.whichChoice ] -->
<IntegerTrigger DEF='happydisplayintegerKey='0containerField='children'/>
<!-- ROUTE information for nbdisplay node:  [from notBadText.isActive to set_boolean ] [from triggerValue to display.whichChoice ] -->
<IntegerTrigger DEF='nbdisplayintegerKey='1containerField='children'/>
<!-- ROUTE information for saddisplay node:  [from sadText.isActive to set_boolean ] [from triggerValue to display.whichChoice ] -->
<IntegerTrigger DEF='saddisplayintegerKey='2containerField='children'/>
<!-- ROUTE information for bulldisplay node:  [from badText.isActive to set_boolean ] [from triggerValue to display.whichChoice ] -->
<IntegerTrigger DEF='bulldisplayintegerKey='3containerField='children'/>
<ROUTE fromNode='howFeelTextfromField='isActivetoNode='nodisplaytoField='set_boolean'/>
<ROUTE fromNode='happyTextfromField='isActivetoNode='happydisplaytoField='set_boolean'/>
<ROUTE fromNode='notBadTextfromField='isActivetoNode='nbdisplaytoField='set_boolean'/>
<ROUTE fromNode='sadTextfromField='isActivetoNode='saddisplaytoField='set_boolean'/>
<ROUTE fromNode='badTextfromField='isActivetoNode='bulldisplaytoField='set_boolean'/>
<!-- Note that Switch "which choice"
has FAN IN -->

<ROUTE fromNode='nodisplayfromField='triggerValuetoNode='displaytoField='whichChoice'/>
<ROUTE fromNode='happydisplayfromField='triggerValuetoNode='displaytoField='whichChoice'/>
<ROUTE fromNode='nbdisplayfromField='triggerValuetoNode='displaytoField='whichChoice'/>
<ROUTE fromNode='saddisplayfromField='triggerValuetoNode='displaytoField='whichChoice'/>
<ROUTE fromNode='bulldisplayfromField='triggerValuetoNode='displaytoField='whichChoice'/>
</Scene>
</X3D>
<!--

Index for DEF nodes : badText, bulldisplay, bullimg, display, happydisplay, happyimg, happyText, howFeelText, nbdisplay, nbimg, nodisplay, notBadText, saddisplay, sadimg, sadText, TransparentAppearance

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. -->