X3D Model Documentation: A3_GeoInline.x3d

  1  <?xml version="1.0" encoding="UTF-8"?>
  2  <!DOCTYPE X3D PUBLIC "ISO//Web3D//DTD X3D 3.3//EN" "https://www.web3d.org/specifications/x3d-3.3.dtd">
  3  <X3D profile='Immersive' version='3.3 xmlns:xsd='http://www.w3.org/2001/XMLSchema-instance' xsd:noNamespaceSchemaLocation='https://www.web3d.org/specifications/x3d-3.3.xsd'>
  4       <head>
  5            <meta name='titlecontent='A3_GeoInline.x3d'/>
  6            <meta name='creatorcontent='Martin Reddy SRI, original example'/>
  7            <meta name='creatorcontent='Don Brutzman NPS, X3D encoding'/>
  8            <meta name='createdcontent='26 June 2000'/>
  9            <meta name='modifiedcontent='17 June 2020'/>
 10            <meta name='descriptioncontent='Specification example: on-demand inlining via GeoInline for scene resource management.'/>
 11            <meta name=' warning content=' GeoVRML 1.1 GeoInline functionality is embedded in X3D Inline node, GeoInline no longer supported in X3D. '/>
 12            <meta name='referencecontent='http://www.geovrml.org/1.0/doc/examples.html'/>
 13            <meta name='referencecontent='originals/geoinlineTest.wrl'/>
 14            <meta name='referencecontent='VRML 97 encoding http://www.geovrml.org/1.0/doc/examples/geoinline.wrl'/>
 15            <meta name='identifiercontent='https://www.web3d.org/x3d/content/examples/Basic/Geospatial/A3_GeoInline.x3d'/>
 16            <meta name='generatorcontent='X3D-Edit 3.3, https://savage.nps.edu/X3D-Edit'/>
 17            <meta name='licensecontent='../license.html'/>
 18       </head>
<!--

<!--
Event Graph ROUTE Table shows event connections.
-->

<!-- to top Index for DEF nodes: LoadTrigger, ReturnFalse, ReturnTrue, TestInline, UnLoadTrigger
-->
 19       <Scene>
 20            <WorldInfo title='A3_GeoInline.x3d'/>
 21            <Group>
 22                 <!-- Original GeoVRML GeoInline node replaced by improved X3D Inline node -->
 23 
 24                 <!-- don't load TestInline until 'true' event sent -->
 25            </Group>
 26            <!-- Two cones that are used to load and unload the URL for the box -->
 27            <Transform scale='0.5 0.5 0.5translation='2 1.0 0'>
 28 
               <!-- ROUTE information for LoadTrigger node:  [from isActive to ReturnTrue.set_value ] -->
               <TouchSensor DEF='LoadTriggerdescription='click to load inlined Box'/>
 29                 <Shape>
 30                      <Appearance>
 31                           <Material diffuseColor='1 0 0'/>
 32                      </Appearance>
 33                      <Cone/>
 34                 </Shape>
 35            </Transform>
 36            <Transform scale='0.5 0.5 0.5translation='1.5 1.2 0.3'>
 37                 <Shape>
 38                      <Text length='0string='"Load Cube"'>
 39                           <FontStyle/>
 40                      </Text>
 41                      <Appearance>
 42                           <Material diffuseColor='0 0.6 0.3'/>
 43                      </Appearance>
 44                 </Shape>
 45            </Transform>
 46            <Transform rotation='1 0 0 3.1415scale='0.5 0.5 0.5translation='2 -1.0 0'>
 47 
               <!-- ROUTE information for UnLoadTrigger node:  [from isActive to ReturnFalse.set_value ] -->
               <TouchSensor DEF='UnLoadTriggerdescription='click to unload inlined Box'/>
 48                 <Shape>
 49                      <Appearance>
 50                           <Material diffuseColor='0 0 1'/>
 51                      </Appearance>
 52                      <Cone/>
 53                 </Shape>
 54            </Transform>
 55            <Transform scale='0.5 0.5 0.5translation='1.5 -1.5 0.3'>
 56                 <Shape>
 57                      <Text length='0string='"Unload Cube"'>
 58                           <FontStyle/>
 59                      </Text>
 60                      <Appearance>
 61                           <Material diffuseColor='0.6 0.3 0'/>
 62                      </Appearance>
 63                 </Shape>
 64            </Transform>
 65            <!-- a couple of scripts to process the events from clicking on the cones -->
 66 
          <!-- ROUTE information for ReturnTrue node:  [from LoadTrigger.isActive to set_value ] [from value_changed to TestInline.set_load ] -->
          <Script DEF='ReturnTrue'>
 67                 <field name='set_valuetype='SFBoolaccessType='inputOnly'/>
 68                 <field name='value_changedtype='SFBoolaccessType='outputOnly'/>
  <![CDATA[
      
ecmascript:

function set_value( value ) {
  if ( value == true ) value_changed = true;
}

    
]]>
 70            </Script>
 71 
          <!-- ROUTE information for ReturnFalse node:  [from UnLoadTrigger.isActive to set_value ] [from value_changed to TestInline.set_load ] -->
          <Script DEF='ReturnFalse'>
 72                 <field name='set_valuetype='SFBoolaccessType='inputOnly'/>
 73                 <field name='value_changedtype='SFBoolaccessType='outputOnly'/>
  <![CDATA[
      
ecmascript:

function set_value( value ) {
  if ( value == true ) value_changed = false;
}

    
]]>
 75            </Script>
 76            < ROUTE  fromNode='LoadTrigger' fromField='isActive' toNode='ReturnTrue' toField='set_value'/>
 77            < ROUTE  fromNode='ReturnTrue' fromField='value_changed' toNode='TestInline' toField='set_load'/>
 78            < ROUTE  fromNode='UnLoadTrigger' fromField='isActive' toNode='ReturnFalse' toField='set_value'/>
 79            < ROUTE  fromNode='ReturnFalse' fromField='value_changed' toNode='TestInline' toField='set_load'/>
 80       </Scene>
 81  </X3D>
<!--

<!--
Event Graph ROUTE Table shows event connections.
-->

<!-- to top Index for DEF nodes: LoadTrigger, ReturnFalse, ReturnTrue, TestInline, UnLoadTrigger
-->
X3D Tooltips element index: Appearance, Cone, field, FontStyle, Group, head, Inline, Material, meta, ROUTE, Scene, Script, Shape, Text, TouchSensor, Transform, WorldInfo, X3D, accessType and type, XML data types, field types

Event Graph ROUTE Table entries with 4 ROUTE connections total, showing X3D event-model relationships for this scene.

Each row shows an event cascade that may occur during a single timestamp interval between frame renderings, as part of the X3D execution model.

LoadTrigger
TouchSensor
isActive
SFBool

ROUTE
event to
(1)
ReturnTrue
Script
set_value
SFBool
then
 
 
 
ReturnTrue
Script
value_changed
SFBool

ROUTE
event to
(2)
TestInline
Inline
set_load
SFBool

UnLoadTrigger
TouchSensor
isActive
SFBool

ROUTE
event to
(1)
ReturnFalse
Script
set_value
SFBool
then
 
 
 
ReturnFalse
Script
value_changed
SFBool

ROUTE
event to
(2)
TestInline
Inline
set_load
SFBool

Additional guidance on X3D animation can be found in the 10-Step Animation Design Process and Event Tracing hint sheets. Have fun with X3D! 😀

-->
<!-- Online at
https://www.web3d.org/x3d/content/examples/Basic/Geospatial/A3_GeoInlineIndex.html -->
<!-- Version control at
https://sourceforge.net/p/x3d/code/HEAD/tree/www.web3d.org/x3d/content/examples/Basic/Geospatial/A3_GeoInline.x3d -->

<!-- Color 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)
-->

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