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='titlecontent=' ReportedContactPrototype.x3d '/>
  6            <meta name='descriptioncontent='Example instance of prototype for a reported mine-like contact.'/>
  7            <meta name='creatorcontent='Don Brutzman, Jeff Weekley, Frederic Roussille and Jane Wu'/>
  8            <meta name='createdcontent='15 October 2001'/>
  9            <meta name='modifiedcontent='28 November 2019'/>
 10            <meta name='referencecontent=' /ads/src/mil/navy/nps/ads/x3dArchive/DataArchiver.java '/>
 11            <meta name='referencecontent=' /ads/doc/mil/navy/nps/ads/x3dArchive/DataArchiver.html '/>
 12            <meta name='identifiercontent=' https://www.web3d.org/x3d/content/examples/Savage/Weapons/UnderwaterMines/ReportedContactPrototype.x3d '/>
 13            <meta name='generatorcontent='X3D-Edit 3.3, https://www.web3d.org/x3d/tools/X3D-Edit'/>
 14            <meta name='licensecontent='../../license.html'/>
 15       </head>
<!--

<!--
Event Graph ROUTE Table shows event connections.
-->
<!-- to top DEF nodes index: 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='Pdm1BottomMineappinfo='PDM-1 underwater mine'   url=' "Pdm1BottomMinePrototype.x3d#Pdm1BottomMine" "https://www.web3d.org/x3d/content/examples/Savage/Weapons/UnderwaterMines/Pdm1BottomMinePrototype.x3d#Pdm1BottomMine" "Pdm1BottomMinePrototype.wrl#Pdm1BottomMine" "https://www.web3d.org/x3d/content/examples/Savage/Weapons/UnderwaterMines/Pdm1BottomMinePrototype.wrl#Pdm1BottomMine" '>
 19                 <field name='viewpointDescriptiontype='SFStringaccessType='initializeOnly'
                appinfo='customize to match each instance'/>
 20                 <field name='mineColortype='SFColoraccessType='inputOutput'
                appinfo='useful for classification'/>
 21            </ExternProtoDeclare>
 22            <ExternProtoDeclare name='MantaMineappinfo='Manta underwater mine'   url=' "MantaMinePrototype.x3d#MantaMine" "https://www.web3d.org/x3d/content/examples/Savage/Weapons/UnderwaterMines/MantaMinePrototype.x3d#MantaMine" "MantaMinePrototype.wrl#MantaMine" "https://www.web3d.org/x3d/content/examples/Savage/Weapons/UnderwaterMines/MantaMinePrototype.wrl#MantaMine" '>
 23                 <field name='MineColortype='SFColoraccessType='inputOutput'
                appinfo='useful for visual classification'/>
 24                 <field name='viewpointDescriptiontype='SFStringaccessType='initializeOnly'
                appinfo='describe each instance'/>
 25            </ExternProtoDeclare>
 26            <ExternProtoDeclare name='SphericalMineappinfo='Spherical floating mine moored to bottom'   url=' "SphericalMinePrototype.x3d#SphericalMine" "https://www.web3d.org/x3d/content/examples/Savage/Weapons/UnderwaterMines/SphericalMinePrototype.x3d#SphericalMine" "SphericalMinePrototype.wrl#SphericalMine" "https://www.web3d.org/x3d/content/examples/Savage/Weapons/UnderwaterMines/SphericalMinePrototype.wrl#SphericalMine" '>
 27                 <field name='descriptiontype='SFStringaccessType='initializeOnly'
                appinfo='Description for each mine contact.'/>
 28                 <field name='colortype='SFColoraccessType='inputOutput'
                appinfo='Mine color can be used to indicate status (found/unknown/disabled/) tactic etc.'/>
 29                 <field name='translationtype='SFVec3faccessType='inputOutput'
                appinfo='Location of mine center in local world coordinates.'/>
 30                 <field name='scaletype='SFVec3faccessType='inputOutput'
                appinfo='Scale factor to change spherical mine size default diameter = 1m.'/>
 31                 <field name='bboxCentertype='SFVec3faccessType='initializeOnly'
                appinfo='Bounding box for collision detection of mine.'/>
 32                 <field name='tetherPointstype='MFVec3faccessType='inputOutput'
                appinfo='Top and bottom endpoints of line tether that anchors this mine to the bottom.'/>
 33                 <field name='proximityIsActivetype='SFBoolaccessType='outputOnly'
                appinfo='proximityIsActive can be used to activate information or interaction when the viewer nears the mine.'/>
 34                 <field name='proximitySizetype='SFVec3faccessType='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='ReportedContactappinfo='Provide icon and contact information for a reported contact. Position ProtoInstances using the depth and location where found.'>
 37                 <ProtoInterface>
 38                      <field name='nametype='MFStringaccessType='initializeOnly'/>
 39                      <field name='aboveViewpointLabeltype='SFStringvalue='Reported Contact (100m above)accessType='initializeOnly'/>
 40                      <field name='closeViewpointLabeltype='SFStringvalue='Reported Contact (10m closeup)accessType='initializeOnly'/>
 41                      <field name='descriptiontype='MFStringaccessType='inputOutput'/>
 42                      <field name='reportedPositiontype='MFStringaccessType='inputOutput'
                     appinfo='Latitude and longitude (or local coordinates) for display purposes.'/>
 43                      <field name='classificationCodetype='SFInt32value='-1accessType='initializeOnly'/>
 44                      <field name='imageUrltype='MFStringaccessType='inputOutput'
                     appinfo='provide filename and url of contact image as separate quoted strings'/>
 45                      <field name='imageScaletype='SFVec3fvalue='1.00 1.00 1accessType='inputOutput'
                     appinfo='Aspect-ratio x-y scale of image icon (keep z=1)'/>
 46                      <field name='imageOffsettype='SFVec3fvalue='0 2.5 0accessType='inputOutput'
                     appinfo='Relative position of image icon'/>
 47                      <field name='textColortype='SFColorvalue='0.4 0.4 0accessType='inputOutput'/>
 48                      <field name='textOffsettype='SFVec3fvalue='0 0 0accessType='inputOutput'
                     appinfo='Relative position of image icon'/>
 49                 </ProtoInterface>
 50                 <ProtoBody>
 51                      <Group>
 52                           <Viewpoint DEF='SeenFromAboveViewpointdescription='100m above contact (overridden by field viewpointLabel)orientation='1 0 0 -1.57position='0 100 0'>
 53                                <IS>
 54                                     <connect nodeField='descriptionprotoField='aboveViewpointLabel'/>
 55                                </IS>
 56                           </Viewpoint>
 57 
                         <!-- ROUTE information for ContactCloseupViewpoint node:  [from BindViewpointFilter.activate to set_bind ] -->
                         <Viewpoint DEF='ContactCloseupViewpointdescription='10m next to contact (overridden by closeViewpointLabel)'>
 58                                <IS>
 59                                     <connect nodeField='descriptionprotoField='closeViewpointLabel'/>
 60                                </IS>
 61                           </Viewpoint>
 62                           <LOD range='150 10000'>
 63                                <!-- close range -->
 64                                <Group>
 65                                     <Transform DEF='TextOffset'>
 66                                          <IS>
 67                                               <connect nodeField='translationprotoField='textOffset'/>
 68                                          </IS>
 69                                          <Billboard>
 70                                               <Transform translation='0 -0.25 0'>
 71                                                    <Shape>
 72                                                         <Text DEF='PositionText'>
 73                                                              <IS>
 74                                                                   <connect nodeField='stringprotoField='reportedPosition'/>
 75                                                              </IS>
 76                                                              <FontStyle DEF='SmallFontjustify='"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='diffuseColorprotoField='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='stringprotoField='description'/>
 92                                                              </IS>
 93                                                              <FontStyle DEF='SmallerFontjustify='"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='translationprotoField='imageOffset'/>
103                                          </IS>
104                                          <Billboard axisOfRotation='0 0 0'>
105                                               <Anchor DEF='BillBoardAnchordescription='click image to popup image viewerparameter='"target=_blank"'>
106                                                    <IS>
107                                                         <connect nodeField='urlprotoField='imageUrl'/>
108                                                    </IS>
109                                                    <Transform DEF='ImageFit'>
110                                                         <IS>
111                                                              <connect nodeField='scaleprotoField='imageScale'/>
112                                                         </IS>
113                                                         <Shape>
114                                                              <Appearance>
115                                                                   <Material USE='IconMaterial'/>
116                                                                   <ImageTexture DEF='ContactImage'>
117                                                                        <IS>
118                                                                             <connect nodeField='urlprotoField='imageUrl'/>
119                                                                        </IS>
120                                                                   </ImageTexture>
121                                                              </Appearance>
122                                                              <IndexedFaceSet coordIndex='0 1 2 3 0 -1'>
123                                                                   <Coordinate DEF='TwoByTwoSquarepoint='-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='ViewpointAnchordescription='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='stringprotoField='name'/>
138                                                                   </IS>
139                                                                   <FontStyle DEF='LargeFontjustify='"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='CloseUpTouchSensordescription='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='touchedtype='SFBoolaccessType='inputOnly'/>
148                                                    <field name='activatetype='SFBoolaccessType='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='MineModelSwitchwhichChoice='-1'>
157                                               <IS>
158                                                    <connect nodeField='whichChoiceprotoField='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='viewpointDescriptionvalue='Manta mine 10m'/>
170                                               </ProtoInstance>
171                                               <Inline DEF='RockanContact'   url=' "Rockan.x3d" "https://www.web3d.org/x3d/content/examples/Savage/Weapons/UnderwaterMines/Rockan.x3d" "Rockan.wrl" "https://www.web3d.org/x3d/content/examples/Savage/Weapons/UnderwaterMines/Rockan.wrl" '/>
172                                               <ProtoInstance name='SphericalMine'>
173                                                    <fieldValue name='descriptionvalue='Spherical Mine'/>
174                                                    <fieldValue name='tetherPointsvalue='0 0 0 0 -5 0'/>
175                                               </ProtoInstance>
176                                               <Inline DEF='SonarDeflectorDecoyBox'   url=' "SonarReflectorDecoyBox.x3d" "../../Weapons/UnderwaterMines/SonarReflectorDecoyBox.x3d" "https://www.web3d.org/x3d/content/examples/Savage/Weapons/UnderwaterMines/SonarReflectorDecoyBox.x3d" "../../Weapons/UnderwaterMines/SonarReflectorDecoyBox.wrl" "SonarReflectorDecoyBox.wrl" "https://www.web3d.org/x3d/content/examples/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='ReportedContactExampleparameter='"target=_blank"'   url=' "ReportedContactExample.x3d" "https://www.web3d.org/x3d/content/examples/Savage/Weapons/UnderwaterMines/ReportedContactExample.x3d" "ReportedContactExample.wrl" "https://www.web3d.org/x3d/content/examples/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 DEF nodes index: 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 direct ROUTE connection found for events to/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 direct ROUTE connection found for events to/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 direct ROUTE connection found for events to/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://www.web3d.org/x3d/content/examples/Savage/Weapons/UnderwaterMines/ReportedContactPrototypeIndex.html -->
<!-- Version control at
https://sourceforge.net/p/x3d/code/HEAD/tree/www.web3d.org/x3d/content/examples/Savage/Weapons/UnderwaterMines/ReportedContactPrototype.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. -->