X3D Model Documentation: PushButtonExample.x3d

  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='titlecontent='PushButtonExample.x3d'/>
  6            <meta name='descriptioncontent='PushButton widget example use, inner button and outer shape can be round or square'/>
  7            <meta name='creatorcontent='Don Brutzman, Murat Onder and MV4205 class, Spring 2004 Quarter'/>
  8            <meta name='createdcontent='12 May 2004'/>
  9            <meta name='modifiedcontent='28 November 2019'/>
 10            <meta name='referencecontent='PushButtonPrototype.x3d'/>
 11            <meta name='identifiercontent='https://savage.nps.edu/Savage/Tools/Animation/PushButtonExample.x3d'/>
 12            <meta name='generatorcontent='X3D-Edit 3.2, https://savage.nps.edu/X3D-Edit'/>
 13            <meta name='licensecontent='../../license.html'/>
 14       </head>
<!--

<!--
Event Graph ROUTE Table shows event connections.
-->
<!-- to top Index for DEF nodes: RoundRound, RoundSquare

Index for Viewpoint node: Viewpoint_1

Index for ExternProtoDeclare definition: PushButton
-->
 15       <Scene>
 16            <WorldInfo title='PushButtonExample.x3d'/>
 17            <Viewpoint description='Initial Viewpointorientation='0.123 -0.991 0.05 0.7741position='-2 -0.1 2'/>
 18            <Background skyColor='0.8 0.6 0.1'/>
 19            <ExternProtoDeclare name='PushButtonappinfo='PushButton widget, inner button and outer shape can be round or square'   url=' "PushButtonPrototype.x3d#PushButton" "../../Tools/Animation/PushButtonPrototype.x3d#PushButton" "https://savage.nps.edu/Savage/Tools/Animation/PushButtonPrototype.x3d#PushButton" "../../Tools/Animation/PushButtonPrototype.wrl#PushButton" "PushButtonPrototype.wrl#PushButton" "https://savage.nps.edu/Savage/Tools/Animation/PushButtonPrototype.wrl#PushButton" '>
 20                 <field name='traceEnabledtype='SFBoolaccessType='initializeOnly'
                appinfo='enables the console print-out in case of assigning wrong values default is true'/>
 21                 <field name='outerShapeMaterialtype='SFNodeaccessType='initializeOnly'/>
 22                 <field name='defaultMaterialtype='SFNodeaccessType='initializeOnly'
                appinfo='defaultMaterial for inner pushbutton'/>
 23                 <field name='toggleMaterialtype='SFNodeaccessType='initializeOnly'
                appinfo='toggleMaterial for inner pushbutton'/>
 24                 <field name='value_changedtype='SFBoolaccessType='outputOnly'
                appinfo='boolean output of button selection'/>
 25                 <field name='outerSwitchStyletype='SFStringaccessType='initializeOnly'
                appinfo='allowed values: round or square default is round'/>
 26                 <field name='set_outerSwitchStyletype='SFStringaccessType='inputOnly'
                appinfo='allowed values: round or square default is round'/>
 27                 <field name='innerSwitchStyletype='SFStringaccessType='initializeOnly'
                appinfo='allowed values: round square. default is round'/>
 28                 <field name='set_innerSwitchStyletype='SFStringaccessType='inputOnly'
                appinfo='allowed values: round square. default is round'/>
 29                 <field name='delayIntervaltype='SFTimeaccessType='initializeOnly'
                appinfo='time delay for button movement so for color change default is 0.5 sec.'/>
 30            </ExternProtoDeclare>
 31            <Transform DEF='RoundRoundtranslation='-.7 0 0'>
 32                 <ProtoInstance name='PushButton'>
 33                      <fieldValue name='outerSwitchStylevalue='square'/>
 34                      <fieldValue name='innerSwitchStylevalue='round'/>
 35                      <fieldValue name='outerShapeMaterial'>
 36                           <Material ambientIntensity='0.25diffuseColor='0.029158 0.026292 0.026964shininess='0.06specularColor='0.641609 0.651044 0.979592'>
 37                                <!-- Universal Media Library: Metals 17 -->
 38                           </Material>
 39                      </fieldValue>
 40                      <fieldValue name='defaultMaterial'>
 41                           <Material diffuseColor='0 0.8 0shininess='0.35'/>
 42                      </fieldValue>
 43                      <fieldValue name='toggleMaterial'>
 44                           <Material diffuseColor='0.8 0 0shininess='0.35'/>
 45                      </fieldValue>
 46                 </ProtoInstance>
 47            </Transform>
 48            <Transform DEF='RoundSquaretranslation='.7 0 0'>
 49                 <ProtoInstance name='PushButton'>
 50                      <fieldValue name='traceEnabledvalue='true'/>
 51                      <fieldValue name='outerSwitchStylevalue='round'/>
 52                      <fieldValue name='innerSwitchStylevalue='square'/>
 53                      <fieldValue name='outerShapeMaterial'>
 54                           <Material ambientIntensity='0.25diffuseColor='0.029158 0.026292 0.026964shininess='0.06specularColor='0.641609 0.651044 0.979592'>
 55                                <!-- Universal Media Library: Metals 17 -->
 56                           </Material>
 57                      </fieldValue>
 58                      <fieldValue name='defaultMaterial'>
 59                           <Material ambientIntensity='0diffuseColor='0 0 0emissiveColor='0 1 0.168349shininess='0.05102specularColor='0.622449 0.622449 0.622449'>
 60                                <!-- Universal Media Library: Neon 5 -->
 61                           </Material>
 62                      </fieldValue>
 63                      <fieldValue name='toggleMaterial'>
 64                           <Material ambientIntensity='0diffuseColor='0 0 0emissiveColor='1 0 0.080733shininess='0.05102specularColor='0.622449 0.622449 0.622449'>
 65                                <!-- Universal Media Library: Neon 17 -->
 66                           </Material>
 67                      </fieldValue>
 68                      <fieldValue name='delayIntervalvalue='1'/>
 69                 </ProtoInstance>
 70            </Transform>
 71       </Scene>
 72  </X3D>
<!--

<!--
Event Graph ROUTE Table shows event connections.
-->
<!-- to top Index for DEF nodes: RoundRound, RoundSquare

Index for Viewpoint node: Viewpoint_1

Index for ExternProtoDeclare definition: PushButton
-->
X3D Tooltips element index: Background, ExternProtoDeclare, field, fieldValue, head, Material, meta, ProtoInstance, Scene, Transform, Viewpoint, WorldInfo, X3D, plus documentation for accessType definitions, type definitions, XML data types, and field types

-->
<!-- Online at
https://savage.nps.edu/Savage/Tools/Animation/PushButtonExampleIndex.html -->
<!-- Version control at
https://gitlab.nps.edu/Savage/Savage/Tools/Animation/PushButtonExample.x3d -->

<!-- Color-coding legend: X3D terminology <X3dNode  DEF='idNamefield='value'/> matches XML terminology <XmlElement  DEF='idNameattribute='value'/>
(Light-blue background: event-based behavior node or statement) (Grey background inside box: inserted documentation) (Magenta background: X3D Extensibility)
    <ProtoInstance name='ProtoName'> <field name='fieldName'/> </ProtoInstance> -->

to top <!-- For additional help information about X3D scenes, please see X3D Tooltips, X3D Resources, and X3D Scene Authoring Hints. -->