| 1 |
<?xml version="1.0" encoding="UTF-8"?>
|
| 2 |
<!DOCTYPE X3D PUBLIC "ISO//Web3D//DTD X3D 3.0//EN" "https://www.web3d.org/specifications/x3d-3.0.dtd">
|
| 3 | <X3D profile='Immersive' version='3.0' xmlns:xsd='http://www.w3.org/2001/XMLSchema-instance' xsd:noNamespaceSchemaLocation='https://www.web3d.org/specifications/x3d-3.0.xsd'> |
| 4 | <head> |
| 5 | <meta name='title' content='FilterPrototypes.x3d'/> |
| 6 | <meta name='description' content='Contains prototypes that filter multiple values/events to extract a single value/event.'/> |
| 7 | <meta name='creator' content='Don Brutzman, James Harney, Jane Wu'/> |
| 8 | <meta name='created' content='18 December 2001'/> |
| 9 | <meta name='modified' content='15 October 2023'/> |
| 10 | <meta name='subject' content='event filter'/> |
| 11 | <meta name='identifier' content='https://savage.nps.edu/Savage/Tools/Authoring/FilterPrototypes.x3d'/> |
| 12 | <meta name='generator' content='X3D-Edit 4.0, https://savage.nps.edu/X3D-Edit'/> |
| 13 | <meta name='license' content='../../license.html'/> |
| 14 | </head> |
| 15 | <Scene> |
| 16 | <WorldInfo title='FilterPrototypes.x3d'/> |
| 17 | <ProtoDeclare name='FilterBooleanPassTrueEvents'> |
| 18 | <ProtoInterface> |
| 19 | <field name='setBoolean' type='SFBool' accessType='inputOnly'/> |
| 20 | <field name='trueEventOut' type='SFBool' accessType='outputOnly'/> |
| 21 | <field name='trueEventTime' type='SFTime' accessType='outputOnly'/> |
| 22 | </ProtoInterface> |
| 23 | <ProtoBody> |
| 24 | <Script DEF='PassTrueScript'> |
| 25 | <field name='setBoolean' type='SFBool' accessType='inputOnly'/> |
| 26 | <field name='trueEventOut' type='SFBool' accessType='outputOnly'/> |
| 27 | <field name='trueEventTime' type='SFTime' accessType='outputOnly'/> |
| 28 | <IS> |
| 29 | <connect nodeField='setBoolean' protoField='setBoolean'/> |
| 30 | <connect nodeField='trueEventOut' protoField='trueEventOut'/> |
| 31 | <connect nodeField='trueEventTime' protoField='trueEventTime'/> |
| 32 | </IS> |
<![CDATA[
ecmascript:
function setBoolean (value, timeStamp)
{
if (value == true)
{
trueEventOut = value;
trueEventTime = timeStamp;
}
}
]]>
|
|
| 34 | </Script> |
| 35 | </ProtoBody> |
| 36 | </ProtoDeclare> |
| 37 | <ProtoDeclare name='FilterBooleanPassFalseEvents'> |
| 38 | <ProtoInterface> |
| 39 | <field name='setBoolean' type='SFBool' accessType='inputOnly'/> |
| 40 | <field name='falseEventOut' type='SFBool' accessType='outputOnly'/> |
| 41 | <field name='falseEventTime' type='SFTime' accessType='outputOnly'/> |
| 42 | </ProtoInterface> |
| 43 | <ProtoBody> |
| 44 | <Script DEF='PassFalseScript'> |
| 45 | <field name='setBoolean' type='SFBool' accessType='inputOnly'/> |
| 46 | <field name='falseEventOut' type='SFBool' accessType='outputOnly'/> |
| 47 | <field name='falseEventTime' type='SFTime' accessType='outputOnly'/> |
| 48 | <IS> |
| 49 | <connect nodeField='setBoolean' protoField='setBoolean'/> |
| 50 | <connect nodeField='falseEventOut' protoField='falseEventOut'/> |
| 51 | <connect nodeField='falseEventTime' protoField='falseEventTime'/> |
| 52 | </IS> |
<![CDATA[
ecmascript:
function setBoolean (value, timeStamp)
{
if (value == false)
{
falseEventOut = value;
falseEventTime = timeStamp;
}
}
]]>
|
|
| 54 | </Script> |
| 55 | </ProtoBody> |
| 56 | </ProtoDeclare> |
| 57 | <ProtoDeclare name='FilterIntegersPassSingleInteger'> |
| 58 | <ProtoInterface> |
| 59 |
<field name='integerIndex' type='SFInt32' value='0' accessType='initializeOnly'
appinfo='Index of the integer in the integer array to be extracted. Defaulted to 0.'/> |
| 60 | <field name='setIntegers' type='MFInt32' accessType='inputOnly'/> |
| 61 | <field name='integerOut' type='SFInt32' accessType='outputOnly'/> |
| 62 | <field name='integerOutTime' type='SFTime' accessType='outputOnly'/> |
| 63 | </ProtoInterface> |
| 64 | <ProtoBody> |
| 65 | <Script DEF='PassIntegerScript'> |
| 66 | <field name='integerIndex' type='SFInt32' accessType='initializeOnly'/> |
| 67 | <field name='setIntegers' type='MFInt32' accessType='inputOnly'/> |
| 68 | <field name='integerOut' type='SFInt32' accessType='outputOnly'/> |
| 69 | <field name='integerOutTime' type='SFTime' accessType='outputOnly'/> |
| 70 | <IS> |
| 71 | <connect nodeField='integerIndex' protoField='integerIndex'/> |
| 72 | <connect nodeField='setIntegers' protoField='setIntegers'/> |
| 73 | <connect nodeField='integerOut' protoField='integerOut'/> |
| 74 | <connect nodeField='integerOutTime' protoField='integerOutTime'/> |
| 75 | </IS> |
<![CDATA[
ecmascript:
function setIntegers (value, timeStamp)
{
if (integerIndex < 0)
return;
integerOut = value[integerIndex];
integerOutTime = timeStamp;
}
]]>
|
|
| 77 | </Script> |
| 78 | </ProtoBody> |
| 79 | </ProtoDeclare> |
| 80 | <ProtoDeclare name='FilterFloatsPassSingleFloat'> |
| 81 | <ProtoInterface> |
| 82 |
<field name='floatIndex' type='SFInt32' value='0' accessType='initializeOnly'
appinfo='Index of the float in the float array to be extracted. Defaulted to 0.'/> |
| 83 | <field name='setFloats' type='MFFloat' accessType='inputOnly'/> |
| 84 | <field name='floatOut' type='SFFloat' accessType='outputOnly'/> |
| 85 | <field name='floatOutTime' type='SFTime' accessType='outputOnly'/> |
| 86 | </ProtoInterface> |
| 87 | <ProtoBody> |
| 88 | <Script DEF='PassFloatScript'> |
| 89 | <field name='floatIndex' type='SFInt32' accessType='initializeOnly'/> |
| 90 | <field name='setFloats' type='MFFloat' accessType='inputOnly'/> |
| 91 | <field name='floatOut' type='SFFloat' accessType='outputOnly'/> |
| 92 | <field name='floatOutTime' type='SFTime' accessType='outputOnly'/> |
| 93 | <IS> |
| 94 | <connect nodeField='floatIndex' protoField='floatIndex'/> |
| 95 | <connect nodeField='setFloats' protoField='setFloats'/> |
| 96 | <connect nodeField='floatOut' protoField='floatOut'/> |
| 97 | <connect nodeField='floatOutTime' protoField='floatOutTime'/> |
| 98 | </IS> |
<![CDATA[
ecmascript:
function setFloats (value, timeStamp)
{
if (floatIndex < 0)
return;
floatOut = value[floatIndex];
floatOutTime = timeStamp;
}
]]>
|
|
| 100 | </Script> |
| 101 | </ProtoBody> |
| 102 | </ProtoDeclare> |
| 103 | <ProtoDeclare name='FilterStringsPassSingleString'> |
| 104 | <ProtoInterface> |
| 105 |
<field name='stringIndex' type='SFInt32' value='0' accessType='initializeOnly'
appinfo='Index of the string in the string array to be extracted. Defaulted to 0.'/> |
| 106 | <field name='setStrings' type='MFString' accessType='inputOnly'/> |
| 107 | <field name='stringOut' type='SFString' accessType='outputOnly'/> |
| 108 | <field name='stringOutTime' type='SFTime' accessType='outputOnly'/> |
| 109 | </ProtoInterface> |
| 110 | <ProtoBody> |
| 111 | <Script DEF='PassStringScript'> |
| 112 | <field name='stringIndex' type='SFInt32' accessType='initializeOnly'/> |
| 113 | <field name='setStrings' type='MFString' accessType='inputOnly'/> |
| 114 | <field name='stringOut' type='SFString' accessType='outputOnly'/> |
| 115 | <field name='stringOutTime' type='SFTime' accessType='outputOnly'/> |
| 116 | <IS> |
| 117 | <connect nodeField='stringIndex' protoField='stringIndex'/> |
| 118 | <connect nodeField='setStrings' protoField='setStrings'/> |
| 119 | <connect nodeField='stringOut' protoField='stringOut'/> |
| 120 | <connect nodeField='stringOutTime' protoField='stringOutTime'/> |
| 121 | </IS> |
<![CDATA[
ecmascript:
function setStrings (value, timeStamp)
{
if (stringIndex < 0)
return;
stringOut = value[stringIndex];
stringOutTime = timeStamp;
}
]]>
|
|
| 123 | </Script> |
| 124 | </ProtoBody> |
| 125 | </ProtoDeclare> |
| 126 | <!-- ==================== --> |
| 127 | <Anchor description='FilterExamples' parameter='"target=_blank"' url=' "FilterExamples.x3d" "https://savage.nps.edu/Savage/Tools/Authoring/FilterExamples.x3d" "FilterExamples.wrl" "https://savage.nps.edu/Savage/Tools/Authoring/FilterExamples.wrl" '> |
| 128 | <Shape> |
| 129 | <Appearance> |
| 130 | <Material diffuseColor='0 1 1' emissiveColor='0 1 1'/> |
| 131 | </Appearance> |
| 132 | <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"'> |
| 133 | <FontStyle justify='"MIDDLE" "MIDDLE"' size='0.8'/> |
| 134 | </Text> |
| 135 | </Shape> |
| 136 | </Anchor> |
| 137 | </Scene> |
| 138 | </X3D> |
<!--
Color-coding 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)
<ProtoDeclare name='ProtoName'>
<field
name='fieldName'/> </ProtoDeclare>
-->
<!--
For additional help information about X3D scenes, please see X3D Tooltips, X3D Resources, and X3D Scene Authoring Hints.
-->