@prefix :        <https://www.web3d.org/x3d/content/examples/Savage/CommunicationsAndSensors/Sonar/SideScanSonarPrototype.ttl#> .
@prefix owl:     <http://www.w3.org/2002/07/owl#> .
@prefix rdf:     <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs:    <http://www.w3.org/2000/01/rdf-schema#> .
@prefix schema:  <http://schema.org/> .
@prefix dcterms: <http://purl.org/dc/terms/> .
@prefix xsd:     <http://www.w3.org/2001/XMLSchema#> .
@prefix x3d:     <https://www.web3d.org/specifications/x3d-4.0.xsd#> .
@prefix x3do:    <https://www.web3d.org/specifications/X3dOntology4.0#> .

:X3D a owl:NamedIndividual, x3do:X3D ;
  x3do:hasHead :head ;
  x3do:hasScene :Scene ;
  x3do:profile 'Immersive' ;
  x3do:version '3.3' ;
  x3do:noNamespaceSchemaLocation 'https://www.web3d.org/specifications/x3d-3.3.xsd' .
:head a owl:NamedIndividual, x3do:head ;
  x3do:hasParent :X3D ;
  x3do:hasMeta :meta_1_1, :meta_1_2, :meta_1_3, :meta_1_4, :meta_1_5, :meta_1_6, :meta_1_7, :meta_1_8 .
:meta_1_1 a owl:NamedIndividual, x3do:meta ;
  x3do:hasParent :head ;
  x3do:content 'SideScanSonarPrototype.x3d' ;
  x3do:name 'title' .
:meta_1_2 a owl:NamedIndividual, x3do:meta ;
  x3do:hasParent :head ;
  x3do:content 'Produce wireframe or transparent sidescan sonar beams.' ;
  x3do:name 'description' .
:meta_1_3 a owl:NamedIndividual, x3do:meta ;
  x3do:hasParent :head ;
  x3do:content 'Don Brutzman' ;
  x3do:name 'creator' .
:meta_1_4 a owl:NamedIndividual, x3do:meta ;
  x3do:hasParent :head ;
  x3do:content '15 March 2001' ;
  x3do:name 'created' .
:meta_1_5 a owl:NamedIndividual, x3do:meta ;
  x3do:hasParent :head ;
  x3do:content '20 October 2019' ;
  x3do:name 'modified' .
:meta_1_6 a owl:NamedIndividual, x3do:meta ;
  x3do:hasParent :head ;
  x3do:content 'https://www.web3d.org/x3d/content/examples/Savage/CommunicationsAndSensors/Sonar/SideScanSonarPrototype.x3d' ;
  x3do:name 'identifier' .
:meta_1_7 a owl:NamedIndividual, x3do:meta ;
  x3do:hasParent :head ;
  x3do:content 'X3D-Edit 3.3, https://www.web3d.org/x3d/tools/X3D-Edit' ;
  x3do:name 'generator' .
:meta_1_8 a owl:NamedIndividual, x3do:meta ;
  x3do:hasParent :head ;
  x3do:content '../../license.html' ;
  x3do:name 'license' .
:meta dcterms:title "SideScanSonarPrototype.x3d" .
:meta dcterms:description "Produce wireframe or transparent sidescan sonar beams." .
:meta dcterms:creator "Don Brutzman" .
:meta dcterms:created "15 March 2001" .
:meta dcterms:modified "20 October 2019" .
:meta dcterms:identifier "https://www.web3d.org/x3d/content/examples/Savage/CommunicationsAndSensors/Sonar/SideScanSonarPrototype.x3d" .
:meta dcterms:generator "X3D-Edit 3.3, https://www.web3d.org/x3d/tools/X3D-Edit" .
:meta dcterms:license "../../license.html" .
:Scene a owl:NamedIndividual, x3do:Scene ;
  x3do:hasParent :X3D ;
  x3do:hasChildren :LockedDownInterface2D, :Background_2_2, :WorldInfo_2_3, :Viewpoint_2_4, :Anchor_2_6 ;
  x3do:hasProtoDeclare :ProtoDeclare_2_5 .
:LockedDownInterface2D a owl:NamedIndividual, x3do:NavigationInfo ;
  x3do:hasParent :Scene ;
  x3do:DEF 'LockedDownInterface2D' ;
  x3do:type '"NONE"' .
:Background_2_2 a owl:NamedIndividual, x3do:Background ;
  x3do:hasParent :Scene ;
  x3do:skyColor ( 0 0.3 0.5 ) .
:WorldInfo_2_3 a owl:NamedIndividual, x3do:WorldInfo ;
  x3do:hasParent :Scene ;
  x3do:info '"Produce wireframe or transparent beam cones."' ;
  x3do:title 'BeamCone Prototyupe' .
:Viewpoint_2_4 a owl:NamedIndividual, x3do:Viewpoint ;
  x3do:hasParent :Scene ;
  x3do:description 'SideScanSonar Prototype' ;
  x3do:position ( 0 0 15 ) .
:ProtoDeclare_2_5 a owl:NamedIndividual, x3do:ProtoDeclare ;
  x3do:hasParent :Scene ;
  x3do:hasProtoInterface :ProtoInterface_2_5_1 ;
  x3do:hasProtoBody :ProtoBody_2_5_2 ;
  x3do:appinfo 'Produce wireframe or semi-transparent sonar sidescan beams' ;
  x3do:name 'SideScanSonar' .
:ProtoInterface_2_5_1 a owl:NamedIndividual, x3do:ProtoInterface ;
  x3do:hasParent :ProtoDeclare_2_5 ;
  x3do:hasField :field_2_5_1_1, :field_2_5_1_2, :field_2_5_1_3, :field_2_5_1_4, :field_2_5_1_5, :field_2_5_1_6, :field_2_5_1_7, :field_2_5_1_8, :field_2_5_1_9, :field_2_5_1_10, :field_2_5_1_11, :field_2_5_1_12 .
:field_2_5_1_1 a owl:NamedIndividual, x3do:field ;
  x3do:hasParent :ProtoInterface_2_5_1 ;
  x3do:accessType 'inputOnly' ;
  x3do:appinfo 'vertical distance above bottom in meters along y axis' ;
  x3do:name 'altitude' ;
  x3do:type 'SFFloat' .
:field_2_5_1_2 a owl:NamedIndividual, x3do:field ;
  x3do:hasParent :ProtoInterface_2_5_1 ;
  x3do:accessType 'initializeOnly' ;
  x3do:appinfo 'default vertical distance above bottom in meters along y axis' ;
  x3do:name 'defaultAltitude' ;
  x3do:type 'SFFloat' ;
  x3do:value 3 .
:field_2_5_1_3 a owl:NamedIndividual, x3do:field ;
  x3do:hasParent :ProtoInterface_2_5_1 ;
  x3do:accessType 'initializeOnly' ;
  x3do:appinfo 'maximum effective altitude of sidescan sonar above bottom' ;
  x3do:name 'maxAltitude' ;
  x3do:type 'SFFloat' ;
  x3do:value 3 .
:field_2_5_1_4 a owl:NamedIndividual, x3do:field ;
  x3do:hasParent :ProtoInterface_2_5_1 ;
  x3do:accessType 'initializeOnly' ;
  x3do:appinfo 'distance in meters from nadir to rightmost/leftmost edge when operating at defaultAltitude above the bottom' ;
  x3do:name 'defaultCrossTrackHalfRange' ;
  x3do:type 'SFFloat' ;
  x3do:value 30 .
:field_2_5_1_5 a owl:NamedIndividual, x3do:field ;
  x3do:hasParent :ProtoInterface_2_5_1 ;
  x3do:accessType 'initializeOnly' ;
  x3do:appinfo 'longitudinal width of a single return' ;
  x3do:name 'defaultTrackWidthMeters' ;
  x3do:type 'SFFloat' ;
  x3do:value 0.30 .
:field_2_5_1_6 a owl:NamedIndividual, x3do:field ;
  x3do:hasParent :ProtoInterface_2_5_1 ;
  x3do:accessType 'initializeOnly' ;
  x3do:appinfo 'width (or diameter) of vehicle carrying port/starboard sidescan sonar transducers' ;
  x3do:name 'vehicleWidthMeters' ;
  x3do:type 'SFFloat' ;
  x3do:value 0.178 .
:field_2_5_1_7 a owl:NamedIndividual, x3do:field ;
  x3do:hasParent :ProtoInterface_2_5_1 ;
  x3do:accessType 'inputOnly' ;
  x3do:appinfo '(communications) whether transmitted signal is in contact with receiver or (sensor) is a target return detected?' ;
  x3do:name 'contact' ;
  x3do:type 'SFBool' .
:field_2_5_1_8 a owl:NamedIndividual, x3do:field ;
  x3do:hasParent :ProtoInterface_2_5_1 ;
  x3do:accessType 'initializeOnly' ;
  x3do:appinfo 'draw lines for tracking shape?' ;
  x3do:name 'wireframe' ;
  x3do:type 'SFBool' ;
  x3do:value true .
:field_2_5_1_9 a owl:NamedIndividual, x3do:field ;
  x3do:hasParent :ProtoInterface_2_5_1 ;
  x3do:accessType 'initializeOnly' ;
  x3do:appinfo 'draw solid tracking shape?' ;
  x3do:name 'solid' ;
  x3do:type 'SFBool' ;
  x3do:value true .
:field_2_5_1_10 a owl:NamedIndividual, x3do:field ;
  x3do:hasParent :ProtoInterface_2_5_1 ;
  x3do:accessType 'initializeOnly' ;
  x3do:appinfo 'rendering color when contact=true' ;
  x3do:name 'contactColor' ;
  x3do:type 'SFColor' ;
  x3do:value ( .8 .1 .1 ) .
:field_2_5_1_11 a owl:NamedIndividual, x3do:field ;
  x3do:hasParent :ProtoInterface_2_5_1 ;
  x3do:accessType 'initializeOnly' ;
  x3do:appinfo 'rendering color when contact=false' ;
  x3do:name 'noContactColor' ;
  x3do:type 'SFColor' ;
  x3do:value ( .3 .5 .5 ) .
:field_2_5_1_12 a owl:NamedIndividual, x3do:field ;
  x3do:hasParent :ProtoInterface_2_5_1 ;
  x3do:accessType 'inputOutput' ;
  x3do:appinfo '1 = fully transparent wireframe only' ;
  x3do:name 'transparency' ;
  x3do:type 'SFFloat' ;
  x3do:value 0 .
:ProtoBody_2_5_2 a owl:NamedIndividual, x3do:ProtoBody ;
  x3do:hasParent :ProtoDeclare_2_5 ;
  x3do:hasChildren :BEAM_CONTROL, :BEAM_CALCULATE, :DETECTION ;
  x3do:hasROUTE :ROUTE_2_5_2_4, :ROUTE_2_5_2_5, :ROUTE_2_5_2_6, :ROUTE_2_5_2_7, :ROUTE_2_5_2_8, :ROUTE_2_5_2_9 .
:BEAM_CONTROL a owl:NamedIndividual, x3do:Transform ;
  x3do:hasParent :ProtoBody_2_5_2 ;
  x3do:hasChildren :WIREFRAME_SWITCH, :SOLID_SWITCH ;
  x3do:DEF 'BEAM_CONTROL' .
:WIREFRAME_SWITCH a owl:NamedIndividual, x3do:Switch ;
  x3do:hasParent :BEAM_CONTROL ;
  x3do:hasChildren :WorldInfo_2_5_2_1_1_1, :Shape_2_5_2_1_1_2 ;
  x3do:DEF 'WIREFRAME_SWITCH' ;
  x3do:whichChoice 1 .
:WorldInfo_2_5_2_1_1_1 a owl:NamedIndividual, x3do:WorldInfo ;
  x3do:hasParent :WIREFRAME_SWITCH ;
  x3do:info '"initial choice is null node (WorldInfo), meaning no wireframe beam"' .
:Shape_2_5_2_1_1_2 a owl:NamedIndividual, x3do:Shape ;
  x3do:hasParent :WIREFRAME_SWITCH ;
  x3do:hasAppearance :Appearance_2_5_2_1_1_2_1 ;
  x3do:hasGeometry :ILS .
:Appearance_2_5_2_1_1_2_1 a owl:NamedIndividual, x3do:Appearance ;
  x3do:hasParent :Shape_2_5_2_1_1_2 ;
  x3do:hasMaterial :WireMaterial .
:WireMaterial a owl:NamedIndividual, x3do:Material ;
  x3do:hasParent :Appearance_2_5_2_1_1_2_1 ;
  x3do:hasIS :IS_2_5_2_1_1_2_1_1_1 ;
  x3do:DEF 'WireMaterial' ;
  x3do:diffuseColor ( .1 .1 .1 ) ;
  x3do:emissiveColor ( .1 .1 .1 ) .
:IS_2_5_2_1_1_2_1_1_1 a owl:NamedIndividual, x3do:IS ;
  x3do:hasParent :WireMaterial ;
  x3do:hasConnect :connect_2_5_2_1_1_2_1_1_1_1 .
:connect_2_5_2_1_1_2_1_1_1_1 a owl:NamedIndividual, x3do:connect ;
  x3do:hasParent :IS_2_5_2_1_1_2_1_1_1 ;
  x3do:nodeField 'transparency' ;
  x3do:protoField 'transparency' .
:ILS a owl:NamedIndividual, x3do:IndexedLineSet ;
  x3do:hasParent :Shape_2_5_2_1_1_2 ;
  x3do:hasCoord :BeamPatternCoordinatePoints ;
  x3do:DEF 'ILS' ;
  x3do:coordIndex ( 1 2 3 1 -1 5 3 4 5 -1 6 8 7 6 -1 10 9 8 10 -1 6 7 2 1 6 -1 10 5 4 9 10 -1 ) .
:BeamPatternCoordinatePoints a owl:NamedIndividual, x3do:Coordinate ;
  x3do:hasParent :ILS ;
  x3do:DEF 'BeamPatternCoordinatePoints' ;
  x3do:point ( 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ) .
:SOLID_SWITCH a owl:NamedIndividual, x3do:Switch ;
  x3do:hasParent :BEAM_CONTROL ;
  x3do:hasChildren :WorldInfo_2_5_2_1_2_1, :Shape_2_5_2_1_2_2 ;
  x3do:DEF 'SOLID_SWITCH' ;
  x3do:whichChoice 0 .
:WorldInfo_2_5_2_1_2_1 a owl:NamedIndividual, x3do:WorldInfo ;
  x3do:hasParent :SOLID_SWITCH ;
  x3do:info '"initial choice is null node (WorldInfo), meaning no solid beam"' .
:Shape_2_5_2_1_2_2 a owl:NamedIndividual, x3do:Shape ;
  x3do:hasParent :SOLID_SWITCH ;
  x3do:hasAppearance :Appearance_2_5_2_1_2_2_1 ;
  x3do:hasGeometry :IFS .
:Appearance_2_5_2_1_2_2_1 a owl:NamedIndividual, x3do:Appearance ;
  x3do:hasParent :Shape_2_5_2_1_2_2 ;
  x3do:hasMaterial :FaceMaterial .
:FaceMaterial a owl:NamedIndividual, x3do:Material ;
  x3do:hasParent :Appearance_2_5_2_1_2_2_1 ;
  x3do:hasIS :IS_2_5_2_1_2_2_1_1_1 ;
  x3do:DEF 'FaceMaterial' ;
  x3do:diffuseColor ( .1 .1 .1 ) .
:IS_2_5_2_1_2_2_1_1_1 a owl:NamedIndividual, x3do:IS ;
  x3do:hasParent :FaceMaterial ;
  x3do:hasConnect :connect_2_5_2_1_2_2_1_1_1_1 .
:connect_2_5_2_1_2_2_1_1_1_1 a owl:NamedIndividual, x3do:connect ;
  x3do:hasParent :IS_2_5_2_1_2_2_1_1_1 ;
  x3do:nodeField 'transparency' ;
  x3do:protoField 'transparency' .
:IFS a owl:NamedIndividual, x3do:IndexedFaceSet ;
  x3do:hasParent :Shape_2_5_2_1_2_2 ;
  x3do:hasCoord :BeamPatternCoordinatePoints-USE-1 ;
  x3do:DEF 'IFS' ;
  x3do:coordIndex ( 1 2 3 1 -1 5 3 4 5 -1 6 8 7 6 -1 10 9 8 10 -1 6 7 2 1 6 -1 10 5 4 9 10 -1 ) ;
  x3do:solid false .
:BeamPatternCoordinatePoints-USE-1 a owl:NamedIndividual, x3do:Coordinate ;
  x3do:hasParent :IFS ;
  owl:sameAs :BeamPatternCoordinatePoints . # DEF matching this USE
:BEAM_CALCULATE a owl:NamedIndividual, x3do:Script ;
  x3do:hasParent :ProtoBody_2_5_2 ;
  x3do:hasField :field_2_5_2_2_1, :field_2_5_2_2_2, :field_2_5_2_2_3, :field_2_5_2_2_4, :field_2_5_2_2_5, :field_2_5_2_2_6, :field_2_5_2_2_7, :field_2_5_2_2_8, :field_2_5_2_2_9 ;
  x3do:hasIS :IS_2_5_2_2_10 ;
  x3do:DEF 'BEAM_CALCULATE' ;
  x3do:sourceCode """
ecmascript:

function tracePrint (value)
{
	if (traceEnabled) Browser.println ('[SideScanSonar BEAM_CALCULATE] ' + value);
}

function initialize () {
 beamScale = new SFVec3f (1, 1, 1);
 dt2 = defaultTrackWidthMeters/2;

 origin = new SFVec3f (0, 0, 0);
 a  = new SFVec3f (-dt2,  0,               -vehicleWidthMeters/2);
 b  = new SFVec3f (-dt2, -defaultAltitude, -defaultCrossTrackHalfRange);
 c  = new SFVec3f (-dt2, -defaultAltitude,  0);
 d  = new SFVec3f (-dt2, -defaultAltitude,  defaultCrossTrackHalfRange);
 e  = new SFVec3f (-dt2,  0,                vehicleWidthMeters/2);
 aa = new SFVec3f ( dt2,  0,               -vehicleWidthMeters/2);
 bb = new SFVec3f ( dt2, -defaultAltitude, -defaultCrossTrackHalfRange);
 cc = new SFVec3f ( dt2, -defaultAltitude,  0);
 dd = new SFVec3f ( dt2, -defaultAltitude,  defaultCrossTrackHalfRange);
 ee = new SFVec3f ( dt2,  0,                vehicleWidthMeters/2);

 coordinatePoints = new MFVec3f (origin, a, b, c, d, e, aa, bb, cc, dd, ee);

 tracePrint ('coordinatePoints =' + coordinatePoints);
}
function altitude (newAltitude, timeStamp) {
 if (newAltitude <= 0)
 {
   beamHeightFactor= 0.001;
   beamScale = new SFVec3f (1, beamHeightFactor, beamHeightFactor);
 }
 else if (newAltitude < maxAltitude)
 {
   beamHeightFactor= newAltitude / defaultAltitude;
   beamScale = new SFVec3f (1, beamHeightFactor, beamHeightFactor);
 }
 else
 {
   beamHeightFactor= maxAltitude / defaultAltitude;
   beamScale = new SFVec3f (1, beamHeightFactor, beamHeightFactor);
 }
 tracePrint ('newAltitude      =' + newAltitude);
 tracePrint ('beamHeightFactor =' + beamHeightFactor);
 tracePrint ('beamScale        =' + beamScale);
}
""" .
:field_2_5_2_2_1 a owl:NamedIndividual, x3do:field ;
  x3do:hasParent :BEAM_CALCULATE ;
  x3do:accessType 'inputOnly' ;
  x3do:name 'altitude' ;
  x3do:type 'SFFloat' .
:field_2_5_2_2_2 a owl:NamedIndividual, x3do:field ;
  x3do:hasParent :BEAM_CALCULATE ;
  x3do:accessType 'initializeOnly' ;
  x3do:name 'defaultAltitude' ;
  x3do:type 'SFFloat' .
:field_2_5_2_2_3 a owl:NamedIndividual, x3do:field ;
  x3do:hasParent :BEAM_CALCULATE ;
  x3do:accessType 'initializeOnly' ;
  x3do:name 'maxAltitude' ;
  x3do:type 'SFFloat' .
:field_2_5_2_2_4 a owl:NamedIndividual, x3do:field ;
  x3do:hasParent :BEAM_CALCULATE ;
  x3do:accessType 'initializeOnly' ;
  x3do:name 'defaultCrossTrackHalfRange' ;
  x3do:type 'SFFloat' .
:field_2_5_2_2_5 a owl:NamedIndividual, x3do:field ;
  x3do:hasParent :BEAM_CALCULATE ;
  x3do:accessType 'initializeOnly' ;
  x3do:name 'defaultTrackWidthMeters' ;
  x3do:type 'SFFloat' .
:field_2_5_2_2_6 a owl:NamedIndividual, x3do:field ;
  x3do:hasParent :BEAM_CALCULATE ;
  x3do:accessType 'initializeOnly' ;
  x3do:name 'vehicleWidthMeters' ;
  x3do:type 'SFFloat' .
:field_2_5_2_2_7 a owl:NamedIndividual, x3do:field ;
  x3do:hasParent :BEAM_CALCULATE ;
  x3do:accessType 'outputOnly' ;
  x3do:name 'beamScale' ;
  x3do:type 'SFVec3f' .
:field_2_5_2_2_8 a owl:NamedIndividual, x3do:field ;
  x3do:hasParent :BEAM_CALCULATE ;
  x3do:accessType 'outputOnly' ;
  x3do:name 'coordinatePoints' ;
  x3do:type 'MFVec3f' .
:field_2_5_2_2_9 a owl:NamedIndividual, x3do:field ;
  x3do:hasParent :BEAM_CALCULATE ;
  x3do:accessType 'initializeOnly' ;
  x3do:appinfo 'internal flag to turn on Script tracing' ;
  x3do:name 'traceEnabled' ;
  x3do:type 'SFBool' ;
  x3do:value false .
:IS_2_5_2_2_10 a owl:NamedIndividual, x3do:IS ;
  x3do:hasParent :BEAM_CALCULATE ;
  x3do:hasConnect :connect_2_5_2_2_10_1, :connect_2_5_2_2_10_2, :connect_2_5_2_2_10_3, :connect_2_5_2_2_10_4, :connect_2_5_2_2_10_5, :connect_2_5_2_2_10_6 .
:connect_2_5_2_2_10_1 a owl:NamedIndividual, x3do:connect ;
  x3do:hasParent :IS_2_5_2_2_10 ;
  x3do:nodeField 'altitude' ;
  x3do:protoField 'altitude' .
:connect_2_5_2_2_10_2 a owl:NamedIndividual, x3do:connect ;
  x3do:hasParent :IS_2_5_2_2_10 ;
  x3do:nodeField 'defaultAltitude' ;
  x3do:protoField 'defaultAltitude' .
:connect_2_5_2_2_10_3 a owl:NamedIndividual, x3do:connect ;
  x3do:hasParent :IS_2_5_2_2_10 ;
  x3do:nodeField 'maxAltitude' ;
  x3do:protoField 'maxAltitude' .
:connect_2_5_2_2_10_4 a owl:NamedIndividual, x3do:connect ;
  x3do:hasParent :IS_2_5_2_2_10 ;
  x3do:nodeField 'defaultCrossTrackHalfRange' ;
  x3do:protoField 'defaultCrossTrackHalfRange' .
:connect_2_5_2_2_10_5 a owl:NamedIndividual, x3do:connect ;
  x3do:hasParent :IS_2_5_2_2_10 ;
  x3do:nodeField 'defaultTrackWidthMeters' ;
  x3do:protoField 'defaultTrackWidthMeters' .
:connect_2_5_2_2_10_6 a owl:NamedIndividual, x3do:connect ;
  x3do:hasParent :IS_2_5_2_2_10 ;
  x3do:nodeField 'vehicleWidthMeters' ;
  x3do:protoField 'vehicleWidthMeters' .
:DETECTION a owl:NamedIndividual, x3do:Script ;
  x3do:hasParent :ProtoBody_2_5_2 ;
  x3do:hasField :field_2_5_2_3_1, :field_2_5_2_3_2, :field_2_5_2_3_3, :field_2_5_2_3_4, :field_2_5_2_3_5, :field_2_5_2_3_6, :field_2_5_2_3_7, :field_2_5_2_3_8, :field_2_5_2_3_9, :field_2_5_2_3_10 ;
  x3do:hasIS :IS_2_5_2_3_11 ;
  x3do:DEF 'DETECTION' ;
  x3do:directOutput true ;
  x3do:sourceCode """
ecmascript:

function tracePrint (value)
{
	if (traceEnabled) Browser.println ('[SideScanSonar DETECTION] ' + value);
}

function initialize ()
{
	beamColor = noContactColor;
	if (wireframe == true) wireframeChoice = 1;
	if (solid     == true) solidChoice     = 1;

	// Debug  statements
	tracePrint ('  wireframe       =' + wireframe);
	tracePrint ('  solid           =' + solid);
	tracePrint ('  contactColor    =' + contactColor);
	tracePrint ('  noContactColor  =' + noContactColor);
	tracePrint ('  beamColor       =' + beamColor);
	tracePrint ('  wireframeChoice =' + wireframeChoice);
	tracePrint ('  solidChoice     =' + solidChoice);
	tracePrint ('  transparency    =' + MaterialNodeHolder.transparency);
}
function contact (newDetect, timeStamp)
{
	tracePrint ('  newDetect       =' + newDetect);
	if (newDetect) beamColor = contactColor;
	else           beamColor = noContactColor;
}
""" .
:field_2_5_2_3_1 a owl:NamedIndividual, x3do:field ;
  x3do:hasParent :DETECTION ;
  x3do:accessType 'inputOnly' ;
  x3do:name 'contact' ;
  x3do:type 'SFBool' .
:field_2_5_2_3_2 a owl:NamedIndividual, x3do:field ;
  x3do:hasParent :DETECTION ;
  x3do:accessType 'initializeOnly' ;
  x3do:name 'wireframe' ;
  x3do:type 'SFBool' .
:field_2_5_2_3_3 a owl:NamedIndividual, x3do:field ;
  x3do:hasParent :DETECTION ;
  x3do:accessType 'initializeOnly' ;
  x3do:name 'solid' ;
  x3do:type 'SFBool' .
:field_2_5_2_3_4 a owl:NamedIndividual, x3do:field ;
  x3do:hasParent :DETECTION ;
  x3do:accessType 'initializeOnly' ;
  x3do:name 'contactColor' ;
  x3do:type 'SFColor' .
:field_2_5_2_3_5 a owl:NamedIndividual, x3do:field ;
  x3do:hasParent :DETECTION ;
  x3do:accessType 'initializeOnly' ;
  x3do:name 'noContactColor' ;
  x3do:type 'SFColor' .
:field_2_5_2_3_6 a owl:NamedIndividual, x3do:field ;
  x3do:hasParent :DETECTION ;
  x3do:accessType 'outputOnly' ;
  x3do:name 'beamColor' ;
  x3do:type 'SFColor' .
:field_2_5_2_3_7 a owl:NamedIndividual, x3do:field ;
  x3do:hasParent :DETECTION ;
  x3do:accessType 'outputOnly' ;
  x3do:name 'wireframeChoice' ;
  x3do:type 'SFInt32' .
:field_2_5_2_3_8 a owl:NamedIndividual, x3do:field ;
  x3do:hasParent :DETECTION ;
  x3do:accessType 'outputOnly' ;
  x3do:name 'solidChoice' ;
  x3do:type 'SFInt32' .
:field_2_5_2_3_9 a owl:NamedIndividual, x3do:field ;
  x3do:hasParent :DETECTION ;
  x3do:hasMaterial :FaceMaterial-USE-1 ;
  x3do:accessType 'initializeOnly' ;
  x3do:name 'MaterialNodeHolder' ;
  x3do:type 'SFNode' .
:FaceMaterial-USE-1 a owl:NamedIndividual, x3do:Material ;
  x3do:hasParent :field_2_5_2_3_9 ;
  owl:sameAs :FaceMaterial . # DEF matching this USE
:field_2_5_2_3_10 a owl:NamedIndividual, x3do:field ;
  x3do:hasParent :DETECTION ;
  x3do:accessType 'initializeOnly' ;
  x3do:appinfo 'internal flag to turn on Script tracing' ;
  x3do:name 'traceEnabled' ;
  x3do:type 'SFBool' ;
  x3do:value false .
:IS_2_5_2_3_11 a owl:NamedIndividual, x3do:IS ;
  x3do:hasParent :DETECTION ;
  x3do:hasConnect :connect_2_5_2_3_11_1, :connect_2_5_2_3_11_2, :connect_2_5_2_3_11_3, :connect_2_5_2_3_11_4, :connect_2_5_2_3_11_5 .
:connect_2_5_2_3_11_1 a owl:NamedIndividual, x3do:connect ;
  x3do:hasParent :IS_2_5_2_3_11 ;
  x3do:nodeField 'contact' ;
  x3do:protoField 'contact' .
:connect_2_5_2_3_11_2 a owl:NamedIndividual, x3do:connect ;
  x3do:hasParent :IS_2_5_2_3_11 ;
  x3do:nodeField 'wireframe' ;
  x3do:protoField 'wireframe' .
:connect_2_5_2_3_11_3 a owl:NamedIndividual, x3do:connect ;
  x3do:hasParent :IS_2_5_2_3_11 ;
  x3do:nodeField 'solid' ;
  x3do:protoField 'solid' .
:connect_2_5_2_3_11_4 a owl:NamedIndividual, x3do:connect ;
  x3do:hasParent :IS_2_5_2_3_11 ;
  x3do:nodeField 'contactColor' ;
  x3do:protoField 'contactColor' .
:connect_2_5_2_3_11_5 a owl:NamedIndividual, x3do:connect ;
  x3do:hasParent :IS_2_5_2_3_11 ;
  x3do:nodeField 'noContactColor' ;
  x3do:protoField 'noContactColor' .
:ROUTE_2_5_2_4 a owl:NamedIndividual, x3do:ROUTE ;
  x3do:hasParent :ProtoBody_2_5_2 ;
  x3do:fromField 'beamScale' ;
  x3do:fromNode 'BEAM_CALCULATE' ;
  x3do:toField 'scale' ;
  x3do:toNode 'BEAM_CONTROL' .
:ROUTE_2_5_2_5 a owl:NamedIndividual, x3do:ROUTE ;
  x3do:hasParent :ProtoBody_2_5_2 ;
  x3do:fromField 'coordinatePoints' ;
  x3do:fromNode 'BEAM_CALCULATE' ;
  x3do:toField 'point' ;
  x3do:toNode 'BeamPatternCoordinatePoints' .
:ROUTE_2_5_2_6 a owl:NamedIndividual, x3do:ROUTE ;
  x3do:hasParent :ProtoBody_2_5_2 ;
  x3do:fromField 'beamColor' ;
  x3do:fromNode 'DETECTION' ;
  x3do:toField 'emissiveColor' ;
  x3do:toNode 'WireMaterial' .
:ROUTE_2_5_2_7 a owl:NamedIndividual, x3do:ROUTE ;
  x3do:hasParent :ProtoBody_2_5_2 ;
  x3do:fromField 'beamColor' ;
  x3do:fromNode 'DETECTION' ;
  x3do:toField 'emissiveColor' ;
  x3do:toNode 'FaceMaterial' .
:ROUTE_2_5_2_8 a owl:NamedIndividual, x3do:ROUTE ;
  x3do:hasParent :ProtoBody_2_5_2 ;
  x3do:fromField 'wireframeChoice' ;
  x3do:fromNode 'DETECTION' ;
  x3do:toField 'whichChoice' ;
  x3do:toNode 'WIREFRAME_SWITCH' .
:ROUTE_2_5_2_9 a owl:NamedIndividual, x3do:ROUTE ;
  x3do:hasParent :ProtoBody_2_5_2 ;
  x3do:fromField 'solidChoice' ;
  x3do:fromNode 'DETECTION' ;
  x3do:toField 'whichChoice' ;
  x3do:toNode 'SOLID_SWITCH' .
:Anchor_2_6 a owl:NamedIndividual, x3do:Anchor ;
  x3do:hasParent :Scene ;
  x3do:hasChildren :Shape_2_6_1, :Shape_2_6_2 ;
  x3do:description 'SideScanSonar Example' ;
  x3do:parameter '"target=_blank"' ;
  x3do:url '"SideScanSonarExample.x3d" "https://www.web3d.org/x3d/content/examples/Savage/CommunicationsAndSensors/Sonar/SideScanSonarExample.x3d" "SideScanSonarExample.wrl" "https://www.web3d.org/x3d/content/examples/Savage/CommunicationsAndSensors/Sonar/SideScanSonarExample.wrl"' .
:Shape_2_6_1 a owl:NamedIndividual, x3do:Shape ;
  x3do:hasParent :Anchor_2_6 ;
  x3do:hasAppearance :Appearance_2_6_1_1 ;
  x3do:hasGeometry :Text_2_6_1_2 .
:Appearance_2_6_1_1 a owl:NamedIndividual, x3do:Appearance ;
  x3do:hasParent :Shape_2_6_1 ;
  x3do:hasMaterial :Material_2_6_1_1_1 .
:Material_2_6_1_1_1 a owl:NamedIndividual, x3do:Material ;
  x3do:hasParent :Appearance_2_6_1_1 ;
  x3do:diffuseColor ( 0 1 1 ) ;
  x3do:emissiveColor ( 0 1 1 ) .
:Text_2_6_1_2 a owl:NamedIndividual, x3do:Text ;
  x3do:hasParent :Shape_2_6_1 ;
  x3do:hasFontStyle :FontStyle_2_6_1_2_1 ;
  x3do:string '"SideScanSonarPrototype" "is a Prototype definition file." "" "To see an example scene" "click this text and view" "SideScanSonarExample."' .
:FontStyle_2_6_1_2_1 a owl:NamedIndividual, x3do:FontStyle ;
  x3do:hasParent :Text_2_6_1_2 ;
  x3do:justify '"MIDDLE" "MIDDLE"' .
:Shape_2_6_2 a owl:NamedIndividual, x3do:Shape ;
  x3do:hasParent :Anchor_2_6 ;
  x3do:hasGeometry :Box_2_6_2_1 ;
  x3do:hasAppearance :Appearance_2_6_2_2 .
:Box_2_6_2_1 a owl:NamedIndividual, x3do:Box ;
  x3do:hasParent :Shape_2_6_2 ;
  x3do:size ( 10.5 6 .001 ) .
:Appearance_2_6_2_2 a owl:NamedIndividual, x3do:Appearance ;
  x3do:hasParent :Shape_2_6_2 ;
  x3do:hasMaterial :Material_2_6_2_2_1 .
:Material_2_6_2_2_1 a owl:NamedIndividual, x3do:Material ;
  x3do:hasParent :Appearance_2_6_2_2 ;
  x3do:transparency 1 .
