#X3D V3.0 utf8 PROFILE Immersive # [X3D] version=3.0 # [X3D] noNamespaceSchemaLocation=https://www.web3d.org/specifications/x3d-3.0.xsd # X3D-to-ClassicVRML XSL translation autogenerated by X3dToClassicVrmlEncoding.xslt and X3dToVrml97.xslt # https://www.web3d.org/x3d/content/X3dToClassicVrmlEncoding.xslt # https://www.web3d.org/x3d/content/X3dToVrml97.xslt # Transformation using XSLT processor: Saxonica # head META "title" "FilterPrototypes.x3d" META "description" "Contains prototypes that filter multiple values/events to extract a single value/event." META "creator" "Don Brutzman, James Harney, Jane Wu" META "created" "18 December 2001" META "modified" "15 October 2023" META "subject" "event filter" META "identifier" "https://savage.nps.edu/Savage/Tools/Authoring/FilterPrototypes.x3d" META "generator" "X3D-Edit 4.0, https://savage.nps.edu/X3D-Edit" META "license" "../../license.html" # [Scene] ========== ========== ========== WorldInfo { title "FilterPrototypes.x3d" } PROTO FilterBooleanPassTrueEvents [ inputOnly SFBool setBoolean outputOnly SFBool trueEventOut outputOnly SFTime trueEventTime ] { DEF PassTrueScript Script { inputOnly SFBool setBoolean IS setBoolean outputOnly SFBool trueEventOut IS trueEventOut outputOnly SFTime trueEventTime IS trueEventTime url [ "ecmascript: function setBoolean (value, timeStamp) { if (value == true) { trueEventOut = value; trueEventTime = timeStamp; } } " ] } } PROTO FilterBooleanPassFalseEvents [ inputOnly SFBool setBoolean outputOnly SFBool falseEventOut outputOnly SFTime falseEventTime ] { DEF PassFalseScript Script { inputOnly SFBool setBoolean IS setBoolean outputOnly SFBool falseEventOut IS falseEventOut outputOnly SFTime falseEventTime IS falseEventTime url [ "ecmascript: function setBoolean (value, timeStamp) { if (value == false) { falseEventOut = value; falseEventTime = timeStamp; } } " ] } } PROTO FilterIntegersPassSingleInteger [ initializeOnly SFInt32 integerIndex 0 # [appinfo] Index of the integer in the integer array to be extracted. Defaulted to 0. inputOnly MFInt32 setIntegers outputOnly SFInt32 integerOut outputOnly SFTime integerOutTime ] { DEF PassIntegerScript Script { initializeOnly SFInt32 integerIndex IS integerIndex inputOnly MFInt32 setIntegers IS setIntegers outputOnly SFInt32 integerOut IS integerOut outputOnly SFTime integerOutTime IS integerOutTime url [ "ecmascript: function setIntegers (value, timeStamp) { if (integerIndex < 0) return; integerOut = value[integerIndex]; integerOutTime = timeStamp; } " ] } } PROTO FilterFloatsPassSingleFloat [ initializeOnly SFInt32 floatIndex 0 # [appinfo] Index of the float in the float array to be extracted. Defaulted to 0. inputOnly MFFloat setFloats outputOnly SFFloat floatOut outputOnly SFTime floatOutTime ] { DEF PassFloatScript Script { initializeOnly SFInt32 floatIndex IS floatIndex inputOnly MFFloat setFloats IS setFloats outputOnly SFFloat floatOut IS floatOut outputOnly SFTime floatOutTime IS floatOutTime url [ "ecmascript: function setFloats (value, timeStamp) { if (floatIndex < 0) return; floatOut = value[floatIndex]; floatOutTime = timeStamp; } " ] } } PROTO FilterStringsPassSingleString [ initializeOnly SFInt32 stringIndex 0 # [appinfo] Index of the string in the string array to be extracted. Defaulted to 0. inputOnly MFString setStrings outputOnly SFString stringOut outputOnly SFTime stringOutTime ] { DEF PassStringScript Script { initializeOnly SFInt32 stringIndex IS stringIndex inputOnly MFString setStrings IS setStrings outputOnly SFString stringOut IS stringOut outputOnly SFTime stringOutTime IS stringOutTime url [ "ecmascript: function setStrings (value, timeStamp) { if (stringIndex < 0) return; stringOut = value[stringIndex]; stringOutTime = timeStamp; } " ] } } # ==================== 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" ] children [ Shape { appearance Appearance { material Material { diffuseColor 0 1 1 emissiveColor 0 1 1 } } geometry 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 FontStyle { justify [ "MIDDLE" "MIDDLE" ] size 0.8 } } } ] }