X3D Model Documentation: ReportedContactPrototype.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='title' content='ReportedContactPrototype.x3d'/>
  6            <meta name='description' content='Example instance of prototype for a reported mine-like contact.'/>
  7            <meta name='creator' content='Don Brutzman, Jeff Weekley, Frederic Roussille and Jane Wu'/>
  8            <meta name='created' content='15 October 2001'/>
  9            <meta name='modified' content='28 November 2019'/>
 10            <meta name='reference' content='/ads/src/mil/navy/nps/ads/x3dArchive/DataArchiver.java'/>
 11            <meta name='reference' content='/ads/doc/mil/navy/nps/ads/x3dArchive/DataArchiver.html'/>
 12            <meta name='identifier' content='https://savage.nps.edu/Savage/Weapons/UnderwaterMines/ReportedContactPrototype.x3d'/>
 13            <meta name='generator' content='X3D-Edit 3.3, https://savage.nps.edu/X3D-Edit'/>
 14            <meta name='license' content='../../license.html'/>
 15       </head>
<!--

<!--
Event Graph ROUTE Table shows event connections.
-->
<!-- to top Index for DEF nodes: BillBoardAnchor, BindViewpointFilter, CloseUpTouchSensor, ContactCloseupViewpoint, ContactImage, DescriptionText, IconAppearance, IconMaterial, ImageFit, ImageOffset, LargeFont, MineModelSwitch, NameText, PositionText, RockanContact, SeenFromAboveViewpoint, SmallerFont, SmallFont, SonarDeflectorDecoyBox, TextOffset, TwoByTwoSquare, UnknownContact, ViewpointAnchor

Index for Viewpoint nodes: ContactCloseupViewpoint, SeenFromAboveViewpoint

Index for ExternProtoDeclare definitions: MantaMine, Pdm1BottomMine, SphericalMine

Index for ProtoDeclare definition: ReportedContact
-->
 16       <Scene>
 17            <WorldInfo title='ReportedContactPrototype.x3d'/>
 18            <ExternProtoDeclare name='Pdm1BottomMine' appinfo='PDM-1 underwater mine'   url=' "Pdm1BottomMinePrototype.x3d#Pdm1BottomMine" "https://savage.nps.edu/Savage/Weapons/UnderwaterMines/Pdm1BottomMinePrototype.x3d#Pdm1BottomMine" "Pdm1BottomMinePrototype.wrl#Pdm1BottomMine" "https://savage.nps.edu/Savage/Weapons/UnderwaterMines/Pdm1BottomMinePrototype.wrl#Pdm1BottomMine" '>
 19                 <field name='viewpointDescription' type='SFString' accessType='initializeOnly'
                appinfo='customize to match each instance'/>
 20                 <field name='mineColor' type='SFColor' accessType='inputOutput'
                appinfo='useful for classification'/>
 21            </ExternProtoDeclare>
 22            <ExternProtoDeclare name='MantaMine' appinfo='Manta underwater mine'   url=' "MantaMinePrototype.x3d#MantaMine" "https://savage.nps.edu/Savage/Weapons/UnderwaterMines/MantaMinePrototype.x3d#MantaMine" "MantaMinePrototype.wrl#MantaMine" "https://savage.nps.edu/Savage/Weapons/UnderwaterMines/MantaMinePrototype.wrl#MantaMine" '>
 23                 <field name='MineColor' type='SFColor' accessType='inputOutput'
                appinfo='useful for visual classification'/>
 24                 <field name='viewpointDescription' type='SFString' accessType='initializeOnly'
                appinfo='describe each instance'/>
 25            </ExternProtoDeclare>
 26            <ExternProtoDeclare name='SphericalMine' appinfo='Spherical floating mine moored to bottom'   url=' "SphericalMinePrototype.x3d#SphericalMine" "https://savage.nps.edu/Savage/Weapons/UnderwaterMines/SphericalMinePrototype.x3d#SphericalMine" "SphericalMinePrototype.wrl#SphericalMine" "https://savage.nps.edu/Savage/Weapons/UnderwaterMines/SphericalMinePrototype.wrl#SphericalMine" '>
 27                 <field name='description' type='SFString' accessType='initializeOnly'
                appinfo='Description for each mine contact.'/>
 28                 <field name='color' type='SFColor' accessType='inputOutput'
                appinfo='Mine color can be used to indicate status (found/unknown/disabled/) tactic etc.'/>
 29                 <field name='translation' type='SFVec3f' accessType='inputOutput'
                appinfo='Location of mine center in local world coordinates.'/>
 30                 <field name='scale' type='SFVec3f' accessType='inputOutput'
                appinfo='Scale factor to change spherical mine size default diameter = 1m.'/>
 31                 <field name='bboxCenter' type='SFVec3f' accessType='initializeOnly'
                appinfo='Bounding box for collision detection of mine.'/>
 32                 <field name='tetherPoints' type='MFVec3f' accessType='inputOutput'
                appinfo='Top and bottom endpoints of line tether that anchors this mine to the bottom.'/>
 33                 <field name='proximityIsActive' type='SFBool' accessType='outputOnly'
                appinfo='proximityIsActive can be used to activate information or interaction when the viewer nears the mine.'/>
 34                 <field name='proximitySize' type='SFVec3f' accessType='inputOutput'
                appinfo='proximitySize provides overall box dimensions for proximity; thus (10 10 10) yields approximate radius 5 to 7 meters.'/>
 35            </ExternProtoDeclare>
 36            <ProtoDeclare name='ReportedContact' appinfo='Provide icon and contact information for a reported contact. Position ProtoInstances using the depth and location where found.'>
 37                 <ProtoInterface>
 38                      <field name='name' type='MFString' accessType='initializeOnly'/>
 39                      <field name='aboveViewpointLabel' type='SFString' value='Reported Contact (100m above)' accessType='initializeOnly'/>
 40                      <field name='closeViewpointLabel' type='SFString' value='Reported Contact (10m closeup)' accessType='initializeOnly'/>
 41                      <field name='description' type='MFString' accessType='inputOutput'/>
 42                      <field name='reportedPosition' type='MFString' accessType='inputOutput'
                     appinfo='Latitude and longitude (or local coordinates) for display purposes.'/>
 43                      <field name='classificationCode' type='SFInt32' value='-1' accessType='initializeOnly'/>
 44                      <field name='imageUrl' type='MFString' accessType='inputOutput'
                     appinfo='provide filename and url of contact image as separate quoted strings'/>
 45                      <field name='imageScale' type='SFVec3f' value='1.00 1.00 1' accessType='inputOutput'
                     appinfo='Aspect-ratio x-y scale of image icon (keep z=1)'/>
 46                      <field name='imageOffset' type='SFVec3f' value='0 2.5 0' accessType='inputOutput'
                     appinfo='Relative position of image icon'/>
 47                      <field name='textColor' type='SFColor' value='0.4 0.4 0' accessType='inputOutput'/>
 48                      <field name='textOffset' type='SFVec3f' value='0 0 0' accessType='inputOutput'
                     appinfo='Relative position of image icon'/>
 49                 </ProtoInterface>
 50                 <ProtoBody>
 51                      <Group>
 52                           <Viewpoint DEF='SeenFromAboveViewpoint' description='100m above contact (overridden by field viewpointLabel)' orientation='1 0 0 -1.57' position='0 100 0'>
 53                                <IS>
 54                                     <connect nodeField='description' protoField='aboveViewpointLabel'/>
 55                                </IS>
 56                           </Viewpoint>
 57 
                         <!-- ROUTE information for ContactCloseupViewpoint node:  [from BindViewpointFilter.activate to set_bind ] -->
                         <Viewpoint DEF='ContactCloseupViewpoint' description='10m next to contact (overridden by closeViewpointLabel)'>
 58                                <IS>
 59                                     <connect nodeField='description' protoField='closeViewpointLabel'/>
 60                                </IS>
 61                           </Viewpoint>
 62                           <LOD range='150 10000'>
 63                                <!-- close range -->
 64                                <Group>
 65                                     <Transform DEF='TextOffset'>
 66                                          <IS>
 67                                               <connect nodeField='translation' protoField='textOffset'/>
 68                                          </IS>
 69                                          <Billboard>
 70                                               <Transform translation='0 -0.25 0'>
 71                                                    <Shape>
 72                                                         <Text DEF='PositionText'>
 73                                                              <IS>
 74                                                                   <connect nodeField='string' protoField='reportedPosition'/>
 75                                                              </IS>
 76                                                              <FontStyle DEF='SmallFont' justify='"MIDDLE" "MIDDLE"' size='0.75'/>
 77                                                         </Text>
 78 
                                                       <!-- Appearance IconAppearance is a DEF node that has 2 USE nodes: USE_1, USE_2 -->
                                                       <Appearance DEF='IconAppearance'>
 79 
                                                            <!-- Material IconMaterial is a DEF node that has 1 USE node: USE_1 -->
                                                            <Material DEF='IconMaterial'>
 80                                                                   <IS>
 81                                                                        <connect nodeField='diffuseColor' protoField='textColor'/>
 82                                                                   </IS>
 83                                                              </Material>
 84                                                         </Appearance>
 85                                                    </Shape>
 86                                               </Transform>
 87                                               <Transform translation='0 -1.5 0'>
 88                                                    <Shape>
 89                                                         <Text DEF='DescriptionText'>
 90                                                              <IS>
 91                                                                   <connect nodeField='string' protoField='description'/>
 92                                                              </IS>
 93                                                              <FontStyle DEF='SmallerFont' justify='"MIDDLE" "MIDDLE"' size='0.6'/>
 94                                                         </Text>
 95                                                         <Appearance USE='IconAppearance'/>
 96                                                    </Shape>
 97                                               </Transform>
 98                                          </Billboard>
 99                                     </Transform>
100 
                                   <!-- Transform ImageOffset is a DEF node that has 1 USE node: USE_1 -->
                                   <Transform DEF='ImageOffset'>
101                                          <IS>
102                                               <connect nodeField='translation' protoField='imageOffset'/>
103                                          </IS>
104                                          <Billboard axisOfRotation='0 0 0'>
105                                               <Anchor DEF='BillBoardAnchor' description='click image to popup image viewer' parameter='"target=_blank"'>
106                                                    <IS>
107                                                         <connect nodeField='url' protoField='imageUrl'/>
108                                                    </IS>
109                                                    <Transform DEF='ImageFit'>
110                                                         <IS>
111                                                              <connect nodeField='scale' protoField='imageScale'/>
112                                                         </IS>
113                                                         <Shape>
114                                                              <Appearance>
115                                                                   <Material USE='IconMaterial'/>
116                                                                   <ImageTexture DEF='ContactImage'>
117                                                                        <IS>
118                                                                             <connect nodeField='url' protoField='imageUrl'/>
119                                                                        </IS>
120                                                                   </ImageTexture>
121                                                              </Appearance>
122                                                              <IndexedFaceSet coordIndex='0 1 2 3 0 -1'>
123                                                                   <Coordinate DEF='TwoByTwoSquare' point='-1 -1 0 1 -1 0 1 1 0 -1 1 0'/>
124                                                              </IndexedFaceSet>
125                                                         </Shape>
126                                                    </Transform>
127                                               </Anchor>
128                                               <!-- Unfortunately the anchor link connects to the viewpoint DEF name, which can't be overridden at runtime. This means that multiple use of the prototype will not resolve properly. -->
129                                               <Anchor DEF='ViewpointAnchor' description='click text for Contact Closeup Viewpoint'   url=' "#ContactCloseupViewpoint" '>
130                                                    <!-- TODO Add children nodes here -->
131                                               </Anchor>
132                                               <Group>
133                                                    <Transform translation='0 -2 0'>
134                                                         <Shape>
135                                                              <Text DEF='NameText'>
136                                                                   <IS>
137                                                                        <connect nodeField='string' protoField='name'/>
138                                                                   </IS>
139                                                                   <FontStyle DEF='LargeFont' justify='"MIDDLE" "MIDDLE"'/>
140                                                              </Text>
141                                                              <Appearance USE='IconAppearance'/>
142                                                         </Shape>
143                                                    </Transform>
144 
                                                  <!-- ROUTE information for CloseUpTouchSensor node:  [from isActive to BindViewpointFilter.touched ] -->
                                                  <TouchSensor DEF='CloseUpTouchSensor' description='bind closeup Viewpoint'/>
145                                               </Group>
146 
                                             <!-- ROUTE information for BindViewpointFilter node:  [from CloseUpTouchSensor.isActive to touched ] [from activate to ContactCloseupViewpoint.set_bind ] -->
                                             <Script DEF='BindViewpointFilter'>
147                                                    <field name='touched' type='SFBool' accessType='inputOnly'/>
148                                                    <field name='activate' type='SFBool' accessType='outputOnly'/>
  <![CDATA[
                    
ecmascript:

// only activate viewpoint when touched is true, do not unbind when false
function touched (value, timestamp)
{
	if (value == true) activate = true;
}

                  
]]>
150                                               </Script>
151                                               < ROUTE  fromNode='CloseUpTouchSensor' fromField='isActive' toNode='BindViewpointFilter' toField='touched'/>
152                                               < ROUTE  fromNode='BindViewpointFilter' fromField='activate' toNode='ContactCloseupViewpoint' toField='set_bind'/>
153                                          </Billboard>
154                                     </Transform>
155                                     <Transform translation='0 -3 0'>
156                                          <Switch DEF='MineModelSwitch' whichChoice='-1'>
157                                               <IS>
158                                                    <connect nodeField='whichChoice' protoField='classificationCode'/>
159                                               </IS>
160                                               <!-- Mine code enumerations appear in ADS.src.mil.navy.nps.ads.x3dArchive.DataArchiver.java -->
161                                               <Shape DEF='UnknownContact'>
162                                                    <Appearance>
163                                                         <Material diffuseColor='0.3 0.8 0'/>
164                                                    </Appearance>
165                                                    <Box size='1 1 1'/>
166                                               </Shape>
167                                               <ProtoInstance name='Pdm1BottomMine'/>
168                                               <ProtoInstance name='MantaMine'>
169                                                    <fieldValue name='viewpointDescription' value='Manta mine 10m'/>
170                                               </ProtoInstance>
171                                               <Inline DEF='RockanContact'   url=' "Rockan.x3d" "https://savage.nps.edu/Savage/Weapons/UnderwaterMines/Rockan.x3d" "Rockan.wrl" "https://savage.nps.edu/Savage/Weapons/UnderwaterMines/Rockan.wrl" '/>
172                                               <ProtoInstance name='SphericalMine'>
173                                                    <fieldValue name='description' value='Spherical Mine'/>
174                                                    <fieldValue name='tetherPoints' value='0 0 0 0 -5 0'/>
175                                               </ProtoInstance>
176                                               <Inline DEF='SonarDeflectorDecoyBox'   url=' "SonarReflectorDecoyBox.x3d" "../../Weapons/UnderwaterMines/SonarReflectorDecoyBox.x3d" "https://savage.nps.edu/Savage/Weapons/UnderwaterMines/SonarReflectorDecoyBox.x3d" "../../Weapons/UnderwaterMines/SonarReflectorDecoyBox.wrl" "SonarReflectorDecoyBox.wrl" "https://savage.nps.edu/Savage/Weapons/UnderwaterMines/SonarReflectorDecoyBox.wrl" '/>
177                                          </Switch>
178                                     </Transform>
179                                </Group>
180                                <!-- intermediate range -->
181                                <Transform USE='ImageOffset'/>
182                                <!-- far range: might place a self-scaling icon billboard here for long-distance map-like appearance -->
183                                <WorldInfo info='"null node"'/>
184                           </LOD>
185                      </Group>
186                 </ProtoBody>
187            </ProtoDeclare>
188            <!-- ==================== -->
189            <!-- Example scene starts here, in case this prototype is examined. -->
190            <Anchor description='ReportedContactExample' parameter='"target=_blank"'   url=' "ReportedContactExample.x3d" "https://savage.nps.edu/Savage/Weapons/UnderwaterMines/ReportedContactExample.x3d" "ReportedContactExample.wrl" "https://savage.nps.edu/Savage/Weapons/UnderwaterMines/ReportedContactExample.wrl" '>
191                 <Shape>
192                      <Text string='"ReportedContactPrototype" "is a prototype definition file" "" "Click this text to see" "ReportedContactExample"'>
193                           <FontStyle justify='"MIDDLE" "MIDDLE"'/>
194                      </Text>
195                      <Appearance>
196                           <Material diffuseColor='0.6 0.8 0.4'/>
197                      </Appearance>
198                 </Shape>
199            </Anchor>
200       </Scene>
201  </X3D>
<!--

<!--
Event Graph ROUTE Table shows event connections.
-->
<!-- to top Index for DEF nodes: BillBoardAnchor, BindViewpointFilter, CloseUpTouchSensor, ContactCloseupViewpoint, ContactImage, DescriptionText, IconAppearance, IconMaterial, ImageFit, ImageOffset, LargeFont, MineModelSwitch, NameText, PositionText, RockanContact, SeenFromAboveViewpoint, SmallerFont, SmallFont, SonarDeflectorDecoyBox, TextOffset, TwoByTwoSquare, UnknownContact, ViewpointAnchor

Index for Viewpoint nodes: ContactCloseupViewpoint, SeenFromAboveViewpoint

Index for ExternProtoDeclare definitions: MantaMine, Pdm1BottomMine, SphericalMine

Index for ProtoDeclare definition: ReportedContact
-->
X3D Tooltips element index: Anchor, Appearance, Billboard, Box, connect, Coordinate, ExternProtoDeclare, field, fieldValue, FontStyle, Group, head, ImageTexture, IndexedFaceSet, Inline, IS, LOD, Material, meta, ProtoBody, ProtoDeclare, ProtoInstance, ProtoInterface, ROUTE, Scene, Script, Shape, Switch, Text, TouchSensor, Transform, Viewpoint, WorldInfo, X3D, plus documentation for accessType definitions, type definitions, XML data types, and field types

Event Graph ROUTE Table entries with 2 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.

CloseUpTouchSensor
TouchSensor
isActive
SFBool
→
ROUTE
event to
(1)
BindViewpointFilter
Script
touched
SFBool
then
 
 
 
BindViewpointFilter
Script
activate
SFBool
→
ROUTE
event to
(2)
ContactCloseupViewpoint
Viewpoint
set_bind
SFBool

line 167
ProtoInstance
Pdm1BottomMine
No ROUTE connection found for output events from this node.
This ProtoInstance contains SFNode/MFNode fieldValue declarations with
direct access to other nodes, and thus has potential to produce run-time animation. 

line 168
ProtoInstance
MantaMine
No ROUTE connection found for output events from this node.
This ProtoInstance contains SFNode/MFNode fieldValue declarations with
direct access to other nodes, and thus has potential to produce run-time animation. 

line 172
ProtoInstance
SphericalMine
No ROUTE connection found for output events from this node.
This ProtoInstance contains SFNode/MFNode fieldValue declarations with
direct access to other nodes, and thus has potential to produce run-time animation. 

line 190
Anchor
description='ReportedContactExample' 
User-interaction hint for this node. 

BillBoardAnchor
Anchor
description='click image to popup image viewer' 
User-interaction hint for this node. 

ViewpointAnchor
Anchor
description='click text for Contact Closeup Viewpoint' 
User-interaction hint for this node. 

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://savage.nps.edu/Savage/Weapons/UnderwaterMines/ReportedContactPrototypeIndex.html -->
<!-- Version control at
https://gitlab.nps.edu/Savage/Savage/Weapons/UnderwaterMines/ReportedContactPrototype.x3d -->

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