<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE X3D PUBLIC "ISO//Web3D//DTD X3D 3.3//EN" "http://www.web3d.org/specifications/x3d-3.3.dtd">
<X3D profile='Immersive' version='3.3 xmlns:xsd='http://www.w3.org/2001/XMLSchema-instance' xsd:noNamespaceSchemaLocation =' http://www.web3d.org/specifications/x3d-3.3.xsd '>
<head>
<meta name='titlecontent='ReportedContactPrototype.x3d'/>
<meta name='descriptioncontent='Example instance of prototype for a reported mine-like contact.'/>
<meta name='creatorcontent='Don Brutzman, Jeff Weekley, Frederic Roussille and Jane Wu'/>
<meta name='createdcontent='15 October 2001'/>
<meta name='modifiedcontent='9 July 2018'/>
<meta name='referencecontent='/ads/src/mil/navy/nps/ads/x3dArchive/DataArchiver.java'/>
<meta name='referencecontent='/ads/doc/mil/navy/nps/ads/x3dArchive/DataArchiver.html'/>
<meta name='identifiercontent=' https://savage.nps.edu/Savage/Weapons/UnderwaterMines/ReportedContactPrototype.x3d '/>
<meta name='generatorcontent='X3D-Edit 3.3, https://savage.nps.edu/X3D-Edit'/>
<meta name='licensecontent=' ../../license.html'/>
</head>
<!-- -->
<Scene>
<ExternProtoDeclare name='Pdm1BottomMineappinfo='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" '>
<field name='viewpointDescriptiontype='SFStringaccessType='initializeOnly'
 appinfo='customize to match each instance'/>

<field name='mineColortype='SFColoraccessType='inputOutput'
 appinfo='useful for classification'/>
</ExternProtoDeclare>
<ExternProtoDeclare name='MantaMineappinfo='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" '>
<field name='MineColortype='SFColoraccessType='inputOutput'
 appinfo='useful for visual classification'/>

<field name='viewpointDescriptiontype='SFStringaccessType='initializeOnly'
 appinfo='describe each instance'/>
</ExternProtoDeclare>
<ExternProtoDeclare name='SphericalMineappinfo='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" '>
<field name='descriptiontype='SFStringaccessType='initializeOnly'
 appinfo='Description for each mine contact.'/>

<field name='colortype='SFColoraccessType='inputOutput'
 appinfo='Mine color can be used to indicate status (found/unknown/disabled/) tactic etc.'/>

<field name='translationtype='SFVec3faccessType='inputOutput'
 appinfo='Location of mine center in local world coordinates.'/>

<field name='scaletype='SFVec3faccessType='inputOutput'
 appinfo='Scale factor to change spherical mine size default diameter = 1m.'/>

<field name='bboxCentertype='SFVec3faccessType='initializeOnly'
 appinfo='Bounding box for collision detection of mine.'/>

<field name='tetherPointstype='MFVec3faccessType='inputOutput'
 appinfo='Top and bottom endpoints of line tether that anchors this mine to the bottom.'/>

<field name='proximityIsActivetype='SFBoolaccessType='outputOnly'
 appinfo='proximityIsActive can be used to activate information or interaction when the viewer nears the mine.'/>

<field name='proximitySizetype='SFVec3faccessType='inputOutput'
 appinfo='proximitySize provides overall box dimensions for proximity; thus (10 10 10) yields approximate radius 5 to 7 meters.'/>
</ExternProtoDeclare>
<ProtoDeclare name='ReportedContactappinfo='Provide icon and contact information for a reported contact. Position ProtoInstances using the depth and location where found.'>
<ProtoInterface>
<field name='nametype='MFStringaccessType='initializeOnly'/>
<field name='aboveViewpointLabeltype='SFStringvalue='Reported Contact (100m above)accessType='initializeOnly'/>
<field name='closeViewpointLabeltype='SFStringvalue='Reported Contact (10m closeup)accessType='initializeOnly'/>
<field name='descriptiontype='MFStringaccessType='inputOutput'/>
<field name='reportedPositiontype='MFStringaccessType='inputOutput'
 appinfo='Latitude and longitude (or local coordinates) for display purposes.'/>

<field name='classificationCodetype='SFInt32value='-1accessType='initializeOnly'/>
<field name='imageUrltype='MFStringaccessType='inputOutput'
 appinfo='"provide filename and url of contact image as separate quoted strings"'/>

<field name='imageScaletype='SFVec3fvalue='1.00 1.00 1accessType='inputOutput'
 appinfo='Aspect-ratio x-y scale of image icon (keep z=1)'/>

<field name='imageOffsettype='SFVec3fvalue='0 2.5 0accessType='inputOutput'
 appinfo='Relative position of image icon'/>

<field name='textColortype='SFColorvalue='0.4 0.4 0accessType='inputOutput'/>
<field name='textOffsettype='SFVec3fvalue='0 0 0accessType='inputOutput'
 appinfo='Relative position of image icon'/>
</ProtoInterface>
<ProtoBody>
<Group>
<Viewpoint DEF='SeenFromAboveViewpointdescription='100m above contact (overridden by field viewpointLabel)orientation='1 0 0 -1.57position='0 100 0'>
<IS>
<connect nodeField='descriptionprotoField='aboveViewpointLabel'/>
</IS>
</Viewpoint>
<!-- ROUTE information for ContactCloseupViewpoint node:  [from BindViewpointFilter.activate to set_bind ] -->
<Viewpoint DEF='ContactCloseupViewpointdescription='10m next to contact (overridden by closeViewpointLabel)'>
<IS>
<connect nodeField='descriptionprotoField='closeViewpointLabel'/>
</IS>
</Viewpoint>
<LOD range='150 10000'>
<!-- close range -->
<Group>
<Transform DEF='TextOffset'>
<IS>
<connect nodeField='translationprotoField='textOffset'/>
</IS>
<Billboard>
<Transform translation='0 -0.25 0'>
<Shape>
<Text DEF='PositionText'>
<IS>
<connect nodeField='stringprotoField='reportedPosition'/>
</IS>
<FontStyle DEF='SmallFontjustify='"MIDDLE" "MIDDLE"size='0.75'/>
</Text>
<Appearance DEF='IconAppearance'>
<Material DEF='IconMaterial'>
<IS>
<connect nodeField='diffuseColorprotoField='textColor'/>
</IS>
</Material>
</Appearance>
</Shape>
</Transform>
<Transform translation='0 -1.5 0'>
<Shape>
<Text DEF='DescriptionText'>
<IS>
<connect nodeField='stringprotoField='description'/>
</IS>
<FontStyle DEF='SmallerFontjustify='"MIDDLE" "MIDDLE"size='0.6'/>
</Text>
<Appearance USE='IconAppearance'/>
</Shape>
</Transform>
</Billboard>
</Transform>
<Transform DEF='ImageOffset'>
<IS>
<connect nodeField='translationprotoField='imageOffset'/>
</IS>
<Billboard axisOfRotation='0 0 0'>
<Anchor DEF='BillBoardAnchordescription='click image to popup image viewerparameter='"target=_blank"'>
<IS>
<connect nodeField='urlprotoField='imageUrl'/>
</IS>
<Transform DEF='ImageFit'>
<IS>
<connect nodeField='scaleprotoField='imageScale'/>
</IS>
<Shape>
<Appearance>
<Material USE='IconMaterial'/>
<ImageTexture DEF='ContactImage'>
<IS>
<connect nodeField='urlprotoField='imageUrl'/>
</IS>
</ImageTexture>
</Appearance>
<IndexedFaceSet coordIndex='0 1 2 3 0 -1'>
<Coordinate DEF='TwoByTwoSquarepoint='-1 -1 0 1 -1 0 1 1 0 -1 1 0'/>
</IndexedFaceSet>
</Shape>
</Transform>
</Anchor>
<!-- 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. -->
<Anchor DEF='ViewpointAnchordescription='click text for Contact Closeup Viewpoint'
  url=' "#ContactCloseupViewpoint" '>
<!-- TODO Add children nodes here -->
</Anchor>
<Group>
<Transform translation='0 -2 0'>
<Shape>
<Text DEF='NameText'>
<IS>
<connect nodeField='stringprotoField='name'/>
</IS>
<FontStyle DEF='LargeFontjustify='"MIDDLE" "MIDDLE"'/>
</Text>
<Appearance USE='IconAppearance'/>
</Shape>
</Transform>
<!-- ROUTE information for CloseUpTouchSensor node:  [from isActive to BindViewpointFilter.touched ] -->
<TouchSensor DEF='CloseUpTouchSensordescription='bind closeup Viewpoint'/>
</Group>
<!-- ROUTE information for BindViewpointFilter node:  [from CloseUpTouchSensor.isActive to touched ] [from activate to ContactCloseupViewpoint.set_bind ] -->
<Script DEF='BindViewpointFilter'>
<field name='touchedtype='SFBoolaccessType='inputOnly'/>
<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;
}

                  
]]>
</Script>
<ROUTE fromNode='CloseUpTouchSensorfromField='isActivetoNode='BindViewpointFiltertoField='touched'/>
<ROUTE fromNode='BindViewpointFilterfromField='activatetoNode='ContactCloseupViewpointtoField='set_bind'/>
</Billboard>
</Transform>
<Transform translation='0 -3 0'>
<Switch DEF='MineModelSwitchwhichChoice='-1'>
<IS>
<connect nodeField='whichChoiceprotoField='classificationCode'/>
</IS>
<!-- Mine code enumerations appear in ADS.src.mil.navy.nps.ads.x3dArchive.DataArchiver.java -->
<Shape DEF='UnknownContact'>
<Appearance>
<Material diffuseColor='0.3 0.8 0'/>
</Appearance>
<Box size='1 1 1'/>
</Shape>
<ProtoInstance name='Pdm1BottomMine'/>
<ProtoInstance name='MantaMine'>
<fieldValue name='viewpointDescriptionvalue='Manta mine 10m'/>
</ProtoInstance>
<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" '/>

<ProtoInstance name='SphericalMine'>
<fieldValue name='descriptionvalue='Spherical Mine'/>
<fieldValue name='tetherPointsvalue='0 0 0 0 -5 0'/>
</ProtoInstance>
<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" '/>
</Switch>
</Transform>
</Group>
<!-- intermediate range -->
<Transform USE='ImageOffset'/>
<!-- far range: might place a self-scaling icon billboard here for long-distance map-like appearance -->
<WorldInfo info='"null node"'/>
</LOD>
</Group>
</ProtoBody>
</ProtoDeclare>
<!-- ==================== -->
<!-- Example scene starts here, in case this prototype is examined. -->
<Anchor description='ReportedContactExampleparameter='"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" '>
<Shape>
<Text string='"ReportedContactPrototype" "is a prototype definition file" "" "Click this text to see" "ReportedContactExample"'>
<FontStyle justify='"MIDDLE" "MIDDLE"'/>
</Text>
<Appearance>
<Material diffuseColor='0.6 0.8 0.4'/>
</Appearance>
</Shape>
</Anchor>
</Scene>
</X3D>
<!--

Index for ExternProtoDeclare definitions : MantaMine, Pdm1BottomMine, SphericalMine

Index for ProtoDeclare definition : ReportedContact

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 images : ContactCloseupViewpoint, SeenFromAboveViewpoint
-->

<!-- Color key: <X3dNode DEF='idName' field='value'/> matches <XmlElement DEF='idName' attribute='value'/>
(Light blue background: behavior node) (Grey background: inserted documentation) (Magenta background: X3D Extensibility)
    <Prototype name='ProtoName'> <field name='fieldName'/> </Prototype> -->

<!-- Additional help information about X3D scenes: X3D Resources, X3D Scene Authoring Hints and X3D Tooltips -->