<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE X3D PUBLIC "ISO//Web3D//DTD X3D 3.0//EN" "https://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='https://www.web3d.org/specifications/x3d-3.0.xsd'>
  <head>
    <meta content='SliderPrototype.x3d' name='title'/>
    <meta content='Mike Hunsberger' name='creator'/>
    <meta content='12 February 2001' name='created'/>
    <meta content='28 November 2019' name='modified'/>
    <meta content='External prototype of a slider to be used to control scenes where integer values are needed. This file is a combination of a slider prototype and a conversion program.' name='description'/>
    <meta content='needs troubleshooting.' name='warning'/>
    <meta content='https://www.web3d.org/x3d/content/examples/Savage/Tools/ExerciseClock/SliderPrototype.x3d' name='identifier'/>
    <meta content='X3D-Edit 3.2, https://www.web3d.org/x3d/tools/X3D-Edit' name='generator'/>
    <meta content='../../license.html' name='license'/>
  </head>
  <Scene>
    <WorldInfo title='SliderPrototype.x3d'/>
    <ProtoDeclare name='ScaledSFFloat'>
      <ProtoInterface>
        <field accessType='initializeOnly' name='oldMin' type='SFFloat' value='0'/>
        <field accessType='initializeOnly' name='oldMax' type='SFFloat' value='1'/>
        <field accessType='initializeOnly' name='newMin' type='SFFloat' value='0'/>
        <field accessType='initializeOnly' name='newMax' type='SFFloat' value='1'/>
        <field accessType='inputOnly' name='set_oldMin' type='SFFloat'/>
        <field accessType='inputOnly' name='set_oldMax' type='SFFloat'/>
        <field accessType='inputOnly' name='set_newMin' type='SFFloat'/>
        <field accessType='inputOnly' name='set_newMax' type='SFFloat'/>
        <field accessType='inputOnly' name='set_value' type='SFFloat'/>
        <field accessType='outputOnly' name='value_changed' type='SFFloat'/>
      </ProtoInterface>
      <ProtoBody>
        <!-- Warning: VRML97-style scripting, not X3D Scene Authoring Interface (SAI) -->
        <Script DEF='ScaledSFFloatScriptNode' url='"ScaledSFFloatScript.class" "https://www.web3d.org/x3d/content/examples/Savage/Tools/ExerciseClock/ScaledSFFloatScript.class"'>
          <field accessType='initializeOnly' name='oldMin' type='SFFloat'/>
          <field accessType='initializeOnly' name='oldMax' type='SFFloat'/>
          <field accessType='initializeOnly' name='newMin' type='SFFloat'/>
          <field accessType='initializeOnly' name='newMax' type='SFFloat'/>
          <field accessType='inputOnly' name='set_oldMin' type='SFFloat'/>
          <field accessType='inputOnly' name='set_oldMax' type='SFFloat'/>
          <field accessType='inputOnly' name='set_newMin' type='SFFloat'/>
          <field accessType='inputOnly' name='set_newMax' type='SFFloat'/>
          <field accessType='inputOnly' name='set_value' type='SFFloat'/>
          <field accessType='outputOnly' name='value_changed' type='SFFloat'/>
          <IS>
            <connect nodeField='oldMin' protoField='oldMin'/>
            <connect nodeField='oldMax' protoField='oldMax'/>
            <connect nodeField='newMin' protoField='newMin'/>
            <connect nodeField='newMax' protoField='newMax'/>
            <connect nodeField='set_oldMin' protoField='set_oldMin'/>
            <connect nodeField='set_oldMax' protoField='set_oldMax'/>
            <connect nodeField='set_newMin' protoField='set_newMin'/>
            <connect nodeField='set_newMax' protoField='set_newMax'/>
            <connect nodeField='set_value' protoField='set_value'/>
            <connect nodeField='value_changed' protoField='value_changed'/>
          </IS>
        </Script>
      </ProtoBody>
    </ProtoDeclare>
    <ProtoDeclare name='SingleTypeConversion'>
      <ProtoInterface>
        <field accessType='inputOnly' name='SFBoolValue' type='SFBool'/>
        <field accessType='inputOnly' name='SFFloatValue' type='SFFloat'/>
        <field accessType='inputOnly' name='SFInt32Value' type='SFInt32'/>
        <field accessType='inputOnly' name='SFStringValue' type='SFString'/>
        <field accessType='outputOnly' name='SFBoolResult' type='SFBool'/>
        <field accessType='outputOnly' name='SFFloatResult' type='SFFloat'/>
        <field accessType='outputOnly' name='SFInt32Result' type='SFInt32'/>
        <field accessType='outputOnly' name='SFStringResult' type='SFString'/>
        <field accessType='outputOnly' name='MFStringResult' type='MFString'/>
      </ProtoInterface>
      <ProtoBody>
        <!-- Warning: VRML97-style scripting, not X3D Scene Authoring Interface (SAI) -->
        <Script DEF='SingleTypeConversionScriptNode' url='"SingleTypeConversionScript.class" "https://www.web3d.org/x3d/content/examples/Savage/Tools/ExerciseClock/SingleTypeConversionScript.class"'>
          <field accessType='inputOnly' name='SFBoolValue' type='SFBool'/>
          <field accessType='inputOnly' name='SFFloatValue' type='SFFloat'/>
          <field accessType='inputOnly' name='SFInt32Value' type='SFInt32'/>
          <field accessType='inputOnly' name='SFStringValue' type='SFString'/>
          <field accessType='outputOnly' name='SFBoolResult' type='SFBool'/>
          <field accessType='outputOnly' name='SFFloatResult' type='SFFloat'/>
          <field accessType='outputOnly' name='SFInt32Result' type='SFInt32'/>
          <field accessType='outputOnly' name='SFStringResult' type='SFString'/>
          <field accessType='outputOnly' name='MFStringResult' type='MFString'/>
          <IS>
            <connect nodeField='SFBoolValue' protoField='SFBoolValue'/>
            <connect nodeField='SFFloatValue' protoField='SFFloatValue'/>
            <connect nodeField='SFInt32Value' protoField='SFInt32Value'/>
            <connect nodeField='SFStringValue' protoField='SFStringValue'/>
            <connect nodeField='SFBoolResult' protoField='SFBoolResult'/>
            <connect nodeField='SFFloatResult' protoField='SFFloatResult'/>
            <connect nodeField='SFInt32Result' protoField='SFInt32Result'/>
            <connect nodeField='SFStringResult' protoField='SFStringResult'/>
            <connect nodeField='MFStringResult' protoField='MFStringResult'/>
          </IS>
        </Script>
      </ProtoBody>
    </ProtoDeclare>
    <ProtoDeclare name='Slider'>
      <ProtoInterface>
        <field accessType='initializeOnly' name='height' type='SFFloat' value='1'/>
        <field accessType='initializeOnly' name='radius' type='SFFloat' value='.1'/>
        <field accessType='initializeOnly' name='min' type='SFInt32' value='0'/>
        <field accessType='initializeOnly' name='max' type='SFInt32' value='10'/>
        <field accessType='initializeOnly' name='value' type='SFInt32' value='0'/>
        <field accessType='inputOnly' name='set_min' type='SFInt32'/>
        <field accessType='inputOnly' name='set_max' type='SFInt32'/>
        <field accessType='outputOnly' name='set_value' type='SFInt32'/>
        <field accessType='outputOnly' name='value_changed' type='SFInt32'/>
      </ProtoInterface>
      <ProtoBody>
        <Group>
          <Transform DEF='CONNECTOR_TRANS'>
            <Shape>
              <Cylinder radius='.02'/>
              <Appearance>
                <Material diffuseColor='.8 .4 .8'/>
              </Appearance>
            </Shape>
          </Transform>
          <Transform DEF='BALL_TRANS'>
            <TouchSensor DEF='BALL_TOUCH'/>
            <Shape>
              <Sphere radius='.1'/>
              <Appearance>
                <Material diffuseColor='.3 .4 .8'/>
              </Appearance>
            </Shape>
            <PlaneSensor DEF='BALL_PLANE'/>
          </Transform>
          <Transform DEF='BOTTOM_DISK_TRANS'>
            <TouchSensor DEF='BOTTOM_DISK_TOUCH'/>
            <Shape>
              <Cylinder height='.05' radius='.1'/>
              <Appearance>
                <Material diffuseColor='.2 .3 .9'/>
              </Appearance>
            </Shape>
          </Transform>
          <Transform DEF='TOP_DISK_TRANS'>
            <TouchSensor DEF='TOP_DISK_TOUCH'/>
            <Shape>
              <Cylinder height='.05' radius='.1'/>
              <Appearance>
                <Material diffuseColor='.2 .3 .9'/>
              </Appearance>
            </Shape>
          </Transform>
        </Group>
        <!-- Warning: VRML97-style scripting, not X3D Scene Authoring Interface (SAI) -->
        <Script DEF='SLIDER_SCRIPT' url='"SliderScript.class" "https://www.web3d.org/x3d/content/examples/Savage/Tools/ExerciseClock/SliderScript.class"'>
          <field accessType='initializeOnly' name='height' type='SFFloat'/>
          <field accessType='initializeOnly' name='radius' type='SFFloat'/>
          <field accessType='initializeOnly' name='min' type='SFInt32'/>
          <field accessType='initializeOnly' name='max' type='SFInt32'/>
          <field accessType='initializeOnly' name='value' type='SFInt32'/>
          <field accessType='inputOnly' name='set_min' type='SFInt32'/>
          <field accessType='inputOnly' name='set_max' type='SFInt32'/>
          <field accessType='outputOnly' name='set_value' type='SFInt32'/>
          <field accessType='outputOnly' name='value_changed' type='SFInt32'/>
          <field accessType='inputOnly' name='bottomDiskTouched' type='SFBool'/>
          <field accessType='inputOnly' name='topDiskTouched' type='SFBool'/>
          <field accessType='inputOnly' name='set_ballTrans' type='SFVec3f'/>
          <field accessType='inputOnly' name='set_dragActive' type='SFBool'/>
          <field accessType='outputOnly' name='topDiskTrans_changed' type='SFVec3f'/>
          <field accessType='outputOnly' name='bottomDiskTrans_changed' type='SFVec3f'/>
          <field accessType='outputOnly' name='connectorTrans_changed' type='SFVec3f'/>
          <field accessType='outputOnly' name='ballTrans_changed' type='SFVec3f'/>
          <field accessType='outputOnly' name='maxBallPosition_changed' type='SFVec2f'/>
          <field accessType='outputOnly' name='minBallPosition_changed' type='SFVec2f'/>
          <IS>
            <connect nodeField='height' protoField='height'/>
            <connect nodeField='radius' protoField='radius'/>
            <connect nodeField='min' protoField='min'/>
            <connect nodeField='max' protoField='max'/>
            <connect nodeField='value' protoField='value'/>
            <connect nodeField='set_min' protoField='set_min'/>
            <connect nodeField='set_max' protoField='set_max'/>
            <connect nodeField='set_value' protoField='set_value'/>
            <connect nodeField='value_changed' protoField='value_changed'/>
          </IS>
        </Script>
        <ROUTE fromField='bottomDiskTrans_changed' fromNode='SLIDER_SCRIPT' toField='set_translation' toNode='BOTTOM_DISK_TRANS'/>
        <ROUTE fromField='topDiskTrans_changed' fromNode='SLIDER_SCRIPT' toField='set_translation' toNode='TOP_DISK_TRANS'/>
        <ROUTE fromField='connectorTrans_changed' fromNode='SLIDER_SCRIPT' toField='set_translation' toNode='CONNECTOR_TRANS'/>
        <ROUTE fromField='ballTrans_changed' fromNode='SLIDER_SCRIPT' toField='set_translation' toNode='BALL_TRANS'/>
        <ROUTE fromField='maxBallPosition_changed' fromNode='SLIDER_SCRIPT' toField='set_maxPosition' toNode='BALL_PLANE'/>
        <ROUTE fromField='minBallPosition_changed' fromNode='SLIDER_SCRIPT' toField='set_minPosition' toNode='BALL_PLANE'/>
        <ROUTE fromField='isActive' fromNode='BALL_PLANE' toField='set_dragActive' toNode='SLIDER_SCRIPT'/>
        <ROUTE fromField='translation_changed' fromNode='BALL_PLANE' toField='set_ballTrans' toNode='SLIDER_SCRIPT'/>
        <ROUTE fromField='isActive' fromNode='BOTTOM_DISK_TOUCH' toField='bottomDiskTouched' toNode='SLIDER_SCRIPT'/>
        <ROUTE fromField='isActive' fromNode='TOP_DISK_TOUCH' toField='topDiskTouched' toNode='SLIDER_SCRIPT'/>
      </ProtoBody>
    </ProtoDeclare>
    <Anchor description='SliderExample' url='"SliderExample.x3d" "https://www.web3d.org/x3d/content/examples/Savage/Tools/ExerciseClock/SliderExample.x3d" "SliderExample.wrl" "https://www.web3d.org/x3d/content/examples/Savage/Tools/ExerciseClock/SliderExample.wrl"'>
      <Shape>
        <Text string='"SliderPrototype" "holds prototype declarations" "" "Select text to view" "SliderTest.x3d"'>
          <FontStyle justify='"MIDDLE" "MIDDLE"'/>
        </Text>
        <Appearance>
          <Material diffuseColor='0 0.6 0.6'/>
        </Appearance>
      </Shape>
    </Anchor>
  </Scene>
</X3D>