<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE X3D PUBLIC "ISO//Web3D//DTD X3D 3.0//EN" "http://www.web3d.org/specifications/x3d-3.0.dtd">
<X3D profile='Immersiveversion='3.0xmlns:xsd='http://www.w3.org/2001/XMLSchema-instance' xsd:noNamespaceSchemaLocation=' http://www.web3d.org/specifications/x3d-3.0.xsd '>
<head>
<meta name='titlecontent='NetworkReroutingAlternateRoutes.x3d'/>
<meta name='descriptioncontent='This scene demonstrates that even though a minimal interference secondary route has been identified in case of link failure, (a) both routes may be invalid due to an overlap at a critical link, and (b) some reasonable third path may exist to route packets. Note that the hop count is larger (by 1) for each successive route. By pushing the right rear button, the critical link that overlaps the primary and secondary route will turn red opaque.'/>
<meta name='creatorcontent='Bill Fischer'/>
<meta name='translatorcontent='Xeena'/>
<meta name='createdcontent='22 March 2001'/>
<meta name='modifiedcontent='22 December 2011'/>
<meta name='identifiercontent=' http://www.web3d.org/x3d/content/examples/Basic/StudentProjects/NetworkReroutingAlternateRoutes.x3d '/>
<meta name='referencecontent='NetworkReroutingRoutes.x3d'/>
<meta name='referencecontent='NetworkReroutingNetwork.x3d'/>
<meta name='generatorcontent='X3D-Edit 3.2, https://savage.nps.edu/X3D-Edit'/>
<meta name='licensecontent=' ../license.html'/>
</head>
<!-- -->
<Scene>
<Viewpoint DEF='defaultdescription='Network Rerouting Alternate Routesorientation='1 0 0 -.5position='0 6 10'/>
<Group DEF='default_network'> </Group>
<Group> </Group>
<Group>
<Transform rotation='0 1 0 -.785translation='-3 -.5 1'>
<Transform rotation='0 0 1 1.57'>
<Shape>
<Appearance>
<!-- pipe_material ROUTEs:  [from linkFailure.toggleValue to transparency ] [from linkFailure.transparency to transparency ] -->
<Material DEF='pipe_materialdiffuseColor='.8 0 0transparency='1'/>
</Appearance>
<Cylinder radius='.1'/>
</Shape>
</Transform>
</Transform>
<Transform rotation='0 1 0 .785translation='-1 -.5 1'>
<Transform rotation='0 0 1 1.57'>
<Shape>
<Appearance>
<!-- pipe_material2 ROUTEs:  [from nodeFailure.toggleValue to transparency ] [from nodeFailure.transparency to transparency ] -->
<Material DEF='pipe_material2diffuseColor='.8 0 0transparency='1'/>
</Appearance>
<Cylinder radius='.1'/>
</Shape>
</Transform>
</Transform>
<Transform rotation='0 1 0 .785translation='-3 -.5 3'>
<Transform rotation='0 0 1 1.57'>
<Shape>
<Appearance>
<Material USE='pipe_material2'/>
</Appearance>
<Cylinder radius='.1'/>
</Shape>
</Transform>
</Transform>
<Transform rotation='0 1 0 -.785translation='-3 -.5 1'>
<Transform rotation='0 0 1 1.57'>
<Shape>
<Appearance>
<Material USE='pipe_material2'/>
</Appearance>
<Cylinder radius='.1'/>
</Shape>
</Transform>
</Transform>
<Transform/>
<Transform scale='.4 .4 .4translation='4 -.5 -6'>
<Group>
<Transform scale='1 1.5 1translation='0 -.5 0'>
<Shape>
<Appearance>
<Material diffuseColor='.5 .5 .5'/>
</Appearance>
<Box/>
</Shape>
</Transform>
<Shape>
<Appearance>
<Material emissiveColor='1 0 0'/>
</Appearance>
<Cylinder height='2.5radius='.5'/>
</Shape>
<!-- red_pipe ROUTE:  [from isActive to linkFailure.toggle ] -->
<TouchSensor DEF='red_pipedescription='#1 red pipe touchsensor'/>
<Transform translation='0 11 0'>
<Billboard>
<Shape>
<Text string='"Link Error"solid='false'>
<FontStyle horizontal='falsestyle='BOLD'/>
</Text>
<Appearance>
<Material emissiveColor='1 0 0'/>
</Appearance>
</Shape>
</Billboard>
</Transform>
</Group>
<Group>
<Transform scale='1 1.5 1translation='3 -.5 0'>
<Shape>
<Appearance>
<Material diffuseColor='.5 .5 .5'/>
</Appearance>
<Box/>
</Shape>
</Transform>
<Transform translation='3 0 0'>
<Shape>
<Appearance>
<Material emissiveColor='1 0 0'/>
</Appearance>
<Cylinder height='2.5radius='.5'/>
</Shape>
<!-- red_pipe2 ROUTE:  [from isActive to nodeFailure.toggle ] -->
<TouchSensor DEF='red_pipe2description='#2 red pipe touchsensor'/>
</Transform>
<Transform translation='3 11 0'>
<Billboard>
<Shape>
<Text string='"Node Error"solid='false'>
<FontStyle horizontal='falsestyle='BOLD'/>
</Text>
<Appearance>
<Material emissiveColor='1 0 0'/>
</Appearance>
</Shape>
</Billboard>
</Transform>
</Group>
</Transform>
<!-- linkFailure ROUTEs:  [from red_pipe.isActive to toggle ] [from toggleValue to pipe_material.transparency ] [from transparency to pipe_material.transparency ] -->
<Script DEF='linkFailure'>
<field name='toggletype='SFBoolaccessType='inputOnly'/>
<field name='statetype='SFBoolvalue='falseaccessType='initializeOnly'/>
<field name='toggleValuetype='SFFloataccessType='outputOnly'/>
<field name='transStatetype='SFFloatvalue='1accessType='initializeOnly'/>
<field name='transparencytype='SFFloataccessType='outputOnly'/>
<![CDATA[
        ecmascript:

function toggle ( value, ts ) {
 if(value == true){
   state = !state;
   toggleValue = state;
   }
  if(state){
      transState = 0;
      transparency = transState;
   }
   else{
      transState = 1;
      transparency = transState;
   }
}
      
]]>
</Script>
<!-- nodeFailure ROUTEs:  [from red_pipe2.isActive to toggle ] [from toggleValue to pipe_material2.transparency ] [from transparency to pipe_material2.transparency ] -->
<Script DEF='nodeFailure'>
<field name='toggletype='SFBoolaccessType='inputOnly'/>
<field name='statetype='SFBoolvalue='falseaccessType='initializeOnly'/>
<field name='toggleValuetype='SFFloataccessType='outputOnly'/>
<field name='transStatetype='SFFloatvalue='1accessType='initializeOnly'/>
<field name='transparencytype='SFFloataccessType='outputOnly'/>
<![CDATA[
        ecmascript:

function toggle ( value, ts ) {
 if(value == true){
   state = !state;
   toggleValue = state;
   }
  if(state){
      transState = 0;
      transparency = transState;
   }
   else{
      transState = 1;
      transparency = transState;
   }
}
      
]]>
</Script>
</Group>
<ROUTE fromNode='red_pipefromField='isActivetoNode='linkFailuretoField='toggle'/>
<ROUTE fromNode='linkFailurefromField='toggleValuetoNode='pipe_materialtoField='transparency'/>
<ROUTE fromNode='linkFailurefromField='transparencytoNode='pipe_materialtoField='transparency'/>
<ROUTE fromNode='red_pipe2fromField='isActivetoNode='nodeFailuretoField='toggle'/>
<ROUTE fromNode='nodeFailurefromField='toggleValuetoNode='pipe_material2toField='transparency'/>
<ROUTE fromNode='nodeFailurefromField='transparencytoNode='pipe_material2toField='transparency'/>
</Scene>
</X3D>
<!--

Index for DEF nodes: default, default_network, linkFailure, network, nodeFailure, pipe_material, pipe_material2, red_pipe, red_pipe2, routes
Index for Viewpoint image: default
-->

<!-- Color key: <X3dNode DEF='idName' field='value'/> matches <XmlElement DEF='idName' attribute='value'/> -->