<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE X3D PUBLIC "ISO//Web3D//DTD X3D 3.0//EN" "http://www.web3d.org/specifications/x3d-3.0.dtd">
<X3D profile='Immersive' version='3.0 xmlns:xsd='http://www.w3.org/2001/XMLSchema-instance' xsd:noNamespaceSchemaLocation =' http://www.web3d.org/specifications/x3d-3.0.xsd '>
<head>
<meta name='titlecontent='FilterPrototypes.x3d'/>
<meta name='descriptioncontent='Contains prototypes that filter multiple values/events to extract a single value/event.'/>
<meta name='creatorcontent='Don Brutzman, James Harney, Jane Wu'/>
<meta name='createdcontent='18 December 2001'/>
<meta name='modifiedcontent='14 January 2014'/>
<meta name='versioncontent='1.0'/>
<meta name='subjectcontent='event filter'/>
<meta name='identifiercontent=' https://savage.nps.edu/Savage/Tools/Authoring/FilterPrototypes.x3d '/>
<meta name='generatorcontent='X3D-Edit 3.2, https://savage.nps.edu/X3D-Edit'/>
<meta name='licensecontent=' ../../license.html'/>
</head>
<!-- -->
<Scene>
<ProtoDeclare name='FilterBooleanPassTrueEvents'>
<ProtoInterface>
<field name='setBooleantype='SFBoolaccessType='inputOnly'/>
<field name='trueEventOuttype='SFBoolaccessType='outputOnly'/>
<field name='trueEventTimetype='SFTimeaccessType='outputOnly'/>
</ProtoInterface>
<ProtoBody>
<Script DEF='PassTrueScript'>
<field name='setBooleantype='SFBoolaccessType='inputOnly'/>
<field name='trueEventOuttype='SFBoolaccessType='outputOnly'/>
<field name='trueEventTimetype='SFTimeaccessType='outputOnly'/>
<IS>
<connect nodeField='setBooleanprotoField='setBoolean'/>
<connect nodeField='trueEventOutprotoField='trueEventOut'/>
<connect nodeField='trueEventTimeprotoField='trueEventTime'/>
</IS>
<![CDATA[
          
ecmascript:

function setBoolean (value, timeStamp)
{
	if (value == true)
	{
		trueEventOut = value;
		trueEventTime = timeStamp;
	}
}

        
]]>
</Script>
</ProtoBody>
</ProtoDeclare>
<ProtoDeclare name='FilterBooleanPassFalseEvents'>
<ProtoInterface>
<field name='setBooleantype='SFBoolaccessType='inputOnly'/>
<field name='falseEventOuttype='SFBoolaccessType='outputOnly'/>
<field name='falseEventTimetype='SFTimeaccessType='outputOnly'/>
</ProtoInterface>
<ProtoBody>
<Script DEF='PassFalseScript'>
<field name='setBooleantype='SFBoolaccessType='inputOnly'/>
<field name='falseEventOuttype='SFBoolaccessType='outputOnly'/>
<field name='falseEventTimetype='SFTimeaccessType='outputOnly'/>
<IS>
<connect nodeField='setBooleanprotoField='setBoolean'/>
<connect nodeField='falseEventOutprotoField='falseEventOut'/>
<connect nodeField='falseEventTimeprotoField='falseEventTime'/>
</IS>
<![CDATA[
          
ecmascript:

function setBoolean (value, timeStamp)
{
	if (value == false)
	{
		falseEventOut = value;
		falseEventTime = timeStamp;
	}
}

        
]]>
</Script>
</ProtoBody>
</ProtoDeclare>
<ProtoDeclare name='FilterIntegersPassSingleInteger'>
<ProtoInterface>
<field name='integerIndextype='SFInt32value='0accessType='initializeOnly'
 appinfo='Index of the integer in the integer array to be extracted. Defaulted to 0.'/>

<field name='setIntegerstype='MFInt32accessType='inputOnly'/>
<field name='integerOuttype='SFInt32accessType='outputOnly'/>
<field name='integerOutTimetype='SFTimeaccessType='outputOnly'/>
</ProtoInterface>
<ProtoBody>
<Script DEF='PassIntegerScript'>
<field name='integerIndextype='SFInt32accessType='initializeOnly'/>
<field name='setIntegerstype='MFInt32accessType='inputOnly'/>
<field name='integerOuttype='SFInt32accessType='outputOnly'/>
<field name='integerOutTimetype='SFTimeaccessType='outputOnly'/>
<IS>
<connect nodeField='integerIndexprotoField='integerIndex'/>
<connect nodeField='setIntegersprotoField='setIntegers'/>
<connect nodeField='integerOutprotoField='integerOut'/>
<connect nodeField='integerOutTimeprotoField='integerOutTime'/>
</IS>
<![CDATA[
          
ecmascript:

function setIntegers (value, timeStamp)
{
	if (integerIndex < 0)
		return;

	integerOut = value[integerIndex];
	integerOutTime = timeStamp;
}

        
]]>
</Script>
</ProtoBody>
</ProtoDeclare>
<ProtoDeclare name='FilterFloatsPassSingleFloat'>
<ProtoInterface>
<field name='floatIndextype='SFInt32value='0accessType='initializeOnly'
 appinfo='Index of the float in the float array to be extracted. Defaulted to 0.'/>

<field name='setFloatstype='MFFloataccessType='inputOnly'/>
<field name='floatOuttype='SFFloataccessType='outputOnly'/>
<field name='floatOutTimetype='SFTimeaccessType='outputOnly'/>
</ProtoInterface>
<ProtoBody>
<Script DEF='PassFloatScript'>
<field name='floatIndextype='SFInt32accessType='initializeOnly'/>
<field name='setFloatstype='MFFloataccessType='inputOnly'/>
<field name='floatOuttype='SFFloataccessType='outputOnly'/>
<field name='floatOutTimetype='SFTimeaccessType='outputOnly'/>
<IS>
<connect nodeField='floatIndexprotoField='floatIndex'/>
<connect nodeField='setFloatsprotoField='setFloats'/>
<connect nodeField='floatOutprotoField='floatOut'/>
<connect nodeField='floatOutTimeprotoField='floatOutTime'/>
</IS>
<![CDATA[
          
ecmascript:

function setFloats (value, timeStamp)
{
	if (floatIndex < 0)
		return;

	floatOut = value[floatIndex];
	floatOutTime = timeStamp;
}

        
]]>
</Script>
</ProtoBody>
</ProtoDeclare>
<ProtoDeclare name='FilterStringsPassSingleString'>
<ProtoInterface>
<field name='stringIndextype='SFInt32value='0accessType='initializeOnly'
 appinfo='Index of the string in the string array to be extracted. Defaulted to 0.'/>

<field name='setStringstype='MFStringaccessType='inputOnly'/>
<field name='stringOuttype='SFStringaccessType='outputOnly'/>
<field name='stringOutTimetype='SFTimeaccessType='outputOnly'/>
</ProtoInterface>
<ProtoBody>
<Script DEF='PassStringScript'>
<field name='stringIndextype='SFInt32accessType='initializeOnly'/>
<field name='setStringstype='MFStringaccessType='inputOnly'/>
<field name='stringOuttype='SFStringaccessType='outputOnly'/>
<field name='stringOutTimetype='SFTimeaccessType='outputOnly'/>
<IS>
<connect nodeField='stringIndexprotoField='stringIndex'/>
<connect nodeField='setStringsprotoField='setStrings'/>
<connect nodeField='stringOutprotoField='stringOut'/>
<connect nodeField='stringOutTimeprotoField='stringOutTime'/>
</IS>
<![CDATA[
          
ecmascript:

function setStrings (value, timeStamp)
{
	if (stringIndex < 0)
		return;

	stringOut = value[stringIndex];
	stringOutTime = timeStamp;
}

        
]]>
</Script>
</ProtoBody>
</ProtoDeclare>
<!-- ==================== -->
<Anchor description='FilterExamplesparameter='"target=_blank"'
  url=' "FilterExamples.wrl" "https://savage.nps.edu/Savage/Tools/Authoring/FilterExamples.wrl" "FilterExamples.x3d" "https://savage.nps.edu/Savage/Tools/Authoring/FilterExamples.x3d" '>
<Shape>
<Appearance>
<Material diffuseColor='0 1 1emissiveColor='0 1 1'/>
</Appearance>
<Text string='"FilterPrototypes.wrl" "is a Prototype definition file." "" "To see an example scene" "using these new nodes" "click this text and view" "FilterExamples.wrl"'>
<FontStyle justify='"MIDDLE" "MIDDLE"size='0.8'/>
</Text>
</Shape>
</Anchor>
</Scene>
</X3D>
<!--

Index for ProtoDeclare definitions : FilterBooleanPassFalseEvents, FilterBooleanPassTrueEvents, FilterFloatsPassSingleFloat, FilterIntegersPassSingleInteger, FilterStringsPassSingleString

Index for DEF nodes : PassFalseScript, PassFloatScript, PassIntegerScript, PassStringScript, PassTrueScript
-->

<!-- 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)
    <Prototype name='ProtoName'> <field name='fieldName'/> </Prototype> -->

<!-- Additional help information about X3D scenes: X3D Resources, X3D Scene Authoring Hints and X3D Tooltips -->