package Savage.ShipsMilitary.FFG7OliverHazardPerryUnitedStates; /* Copyright (c) 1995-2019 held by the author(s). All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the Web3D Consortium (http://www.web3D.org) nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ import java.util.*; import org.web3d.x3d.jsail.Core.*; import org.web3d.x3d.jsail.fields.*; import org.web3d.x3d.jsail.Grouping.*; import org.web3d.x3d.jsail.Navigation.*; import org.web3d.x3d.jsail.Networking.*; // Javadoc annotations follow, see below for source. /** *

Prototype for an Oliver Perry (FFG7) Class Navy Frigate. Proto allows weapon placements, hull number, and ship name markings.

Related links: OliverHazardPerryFFGPrototype.java source, OliverHazardPerryFFGPrototype catalog page, X3D Resources, X3D Scene Authoring Hints, and X3D Tooltips.

meta tags   Document Metadata
title OliverHazardPerryFFGPrototype.x3d
description Prototype for an Oliver Perry (FFG7) Class Navy Frigate. Proto allows weapon placements, hull number, and ship name markings
creator Patrick Sullivan
created 28 May 2006
modified 6 April 2012
TODO Add entry text that links to OliverHazardPerryFFGExample.x3d
subject Prototypes, FFG7, Oliver Perry Frigate
Image DSC_59.jpg
Image http://www.public.navy.mil/surflant/ffg28/PublishingImages/DSC_59.jpg
reference http://en.wikipedia.org/wiki/Oliver_Hazard_Perry_class_frigate
reference http://en.wikipedia.org/wiki/USS_Oliver_Hazard_Perry_(FFG-7)
reference http://www.navy.mil/navydata/fact_display.asp?cid=4200&tid=1300&ct=4
reference http://www.fas.org/programs/ssp/man/uswpns/navy/surfacewarfare/FFG7_oliverhazardperry.html
reference http://www.globalsecurity.org/military/systems/ship/ffg-7.htm
reference http://www.navsource.org/archives/07/0707.htm
reference FFG.x3d
reference OliverHazardPerryFFG.x3d
identifier https://savage.nps.edu/Savage/ShipsMilitary/FFG-7OliverHazardPerry-UnitedStates/OliverHazardPerryFFGPrototype.x3d
generator X3D-Edit 3.2, https://savage.nps.edu/X3D-Edit
license ../../license.html
 

This program uses the X3D Java Scene Access Interface Library (X3DJSAIL). It has been produced using the X3dToJava.xslt stylesheet to create Java source code from an .x3d model.

* @author Patrick Sullivan */ public class OliverHazardPerryFFGPrototype { /** Default constructor to create this object. */ public OliverHazardPerryFFGPrototype () { initialize(); } /** Create and initialize the X3D model for this object. */ public final void initialize() { x3dModel = new X3DObject().setProfile(X3DObject.PROFILE_IMMERSIVE).setVersion(X3DObject.VERSION_3_1) .setHead(new headObject() .addMeta(new metaObject().setName(metaObject.NAME_TITLE ).setContent("OliverHazardPerryFFGPrototype.x3d")) .addMeta(new metaObject().setName(metaObject.NAME_DESCRIPTION).setContent("Prototype for an Oliver Perry (FFG7) Class Navy Frigate. Proto allows weapon placements, hull number, and ship name markings")) .addMeta(new metaObject().setName(metaObject.NAME_CREATOR ).setContent("Patrick Sullivan")) .addMeta(new metaObject().setName(metaObject.NAME_CREATED ).setContent("28 May 2006")) .addMeta(new metaObject().setName(metaObject.NAME_MODIFIED ).setContent("6 April 2012")) .addMeta(new metaObject().setName(metaObject.NAME_TODO ).setContent("Add entry text that links to OliverHazardPerryFFGExample.x3d")) .addMeta(new metaObject().setName(metaObject.NAME_SUBJECT ).setContent("Prototypes, FFG7, Oliver Perry Frigate")) .addMeta(new metaObject().setName(metaObject.NAME_IMAGE ).setContent("DSC_59.jpg")) .addMeta(new metaObject().setName(metaObject.NAME_IMAGE ).setContent("http://www.public.navy.mil/surflant/ffg28/PublishingImages/DSC_59.jpg")) .addMeta(new metaObject().setName(metaObject.NAME_REFERENCE ).setContent("http://en.wikipedia.org/wiki/Oliver_Hazard_Perry_class_frigate")) .addMeta(new metaObject().setName(metaObject.NAME_REFERENCE ).setContent("http://en.wikipedia.org/wiki/USS_Oliver_Hazard_Perry_(FFG-7)")) .addMeta(new metaObject().setName(metaObject.NAME_REFERENCE ).setContent("http://www.navy.mil/navydata/fact_display.asp?cid=4200&tid=1300&ct=4")) .addMeta(new metaObject().setName(metaObject.NAME_REFERENCE ).setContent("http://www.fas.org/programs/ssp/man/uswpns/navy/surfacewarfare/FFG7_oliverhazardperry.html")) .addMeta(new metaObject().setName(metaObject.NAME_REFERENCE ).setContent("http://www.globalsecurity.org/military/systems/ship/ffg-7.htm")) .addMeta(new metaObject().setName(metaObject.NAME_REFERENCE ).setContent("http://www.navsource.org/archives/07/0707.htm")) .addMeta(new metaObject().setName(metaObject.NAME_REFERENCE ).setContent("FFG.x3d")) .addMeta(new metaObject().setName(metaObject.NAME_REFERENCE ).setContent("OliverHazardPerryFFG.x3d")) .addMeta(new metaObject().setName(metaObject.NAME_IDENTIFIER ).setContent("https://savage.nps.edu/Savage/ShipsMilitary/FFG-7OliverHazardPerry-UnitedStates/OliverHazardPerryFFGPrototype.x3d")) .addMeta(new metaObject().setName(metaObject.NAME_GENERATOR ).setContent("X3D-Edit 3.2, https://savage.nps.edu/X3D-Edit")) .addMeta(new metaObject().setName(metaObject.NAME_LICENSE ).setContent("../../license.html"))) .setScene(new SceneObject() .addChild(new ViewpointObject().setDescription("Oliver Hazard Perry FFG starboard side, 50m").setPosition(0.0f,0.0f,50.0f)) .addChild(new ViewpointObject().setDescription("Oliver Hazard Perry FFG from ahead, 50m").setOrientation(-0.09806f,0.99034f,0.09806f,1.58051f).setPosition(50.0f,10.0f,0.0f)) .addChild(new ViewpointObject().setDescription("Oliver Hazard Perry FFG port side, 50m").setOrientation(0.0f,1.0f,0.0f,3.14159f).setPosition(0.0f,0.0f,-50.0f)) .addChild(new ViewpointObject().setDescription("Oliver Hazard Perry FFG from behind, 50m").setOrientation(0.09806f,0.99034f,0.09806f,-1.58051f).setPosition(-50.0f,10.0f,0.0f)) .addChild(new TransformObject().setRotation(0.0f,1.0f,0.0f,-1.5708f) .addChild(new ViewpointObject().setDescription("Oliver Hazard Perry FFG from above, 100m").setOrientation(1.0f,0.0f,0.0f,-1.5708f).setPosition(0.0f,100.0f,0.0f))) .addChild(new ExternProtoDeclareObject("HullNumber").setName("HullNumber").setUrl(new String[] {"../../../Savage/ModelDetailing/HullNumbers/HullNumberPrototype.x3d#HullNumber","https://savage.nps.edu/Savage/ModelDetailing/HullNumbers/HullNumberPrototype.x3d#HullNumber","../../../Savage/ModelDetailing/HullNumbers/HullNumberPrototype.wrl#HullNumber","https://savage.nps.edu/Savage/ModelDetailing/HullNumbers/HullNumberPrototype.wrl#HullNumber"}) .addField(new fieldObject().setName("FirstNumber").setType(fieldObject.TYPE_SFINT32).setAccessType(fieldObject.ACCESSTYPE_INPUTOUTPUT).setAppinfo("[0-9] (-1 will prevent rendering)")) .addField(new fieldObject().setName("SecondNumber").setType(fieldObject.TYPE_SFINT32).setAccessType(fieldObject.ACCESSTYPE_INPUTOUTPUT).setAppinfo("[0-9] (-1 will prevent rendering)"))) .addChild(new ProtoDeclareObject("FFG").setName("FFG").setAppinfo("Prototype of a DDG51 Class Destroyer") .setProtoInterface(new ProtoInterfaceObject() .addField(new fieldObject().setName("ShipName").setType(fieldObject.TYPE_SFSTRING).setAccessType(fieldObject.ACCESSTYPE_INPUTOUTPUT).setAppinfo("The name of the ship (\"USS SHIP\")")) .addField(new fieldObject().setName("ISIC").setType(fieldObject.TYPE_MFSTRING).setAccessType(fieldObject.ACCESSTYPE_INPUTOUTPUT).setValue(new String[] {"none"}).setAppinfo("URL for the ISIC seal that is found on the side of most navy ships (e.g. \"../../ShipCrests/COMDESRON31/DESRON31.x3d\")")) .addField(new fieldObject().setName("HullNumber1").setType(fieldObject.TYPE_SFINT32).setAccessType(fieldObject.ACCESSTYPE_INPUTOUTPUT).setValue(-1).setAppinfo("The first (or only) digit of the ship hull number [0-9]. Note -1 for no number.")) .addField(new fieldObject().setName("HullNumber2").setType(fieldObject.TYPE_SFINT32).setAccessType(fieldObject.ACCESSTYPE_INPUTOUTPUT).setValue(-1).setAppinfo("The second digit of the ship hull number [0-9]. Note: -1 for no number.")) .addField(new fieldObject().setName("StarboardBowWeapon").setType(fieldObject.TYPE_MFSTRING).setAccessType(fieldObject.ACCESSTYPE_INPUTOUTPUT).setValue(new String[] {"none"}).setAppinfo("URL for the model that represents the weapon at this location. [example \"http://www.web3d.org/content/examples/Savage/Weapons/50Cal.x3d\")")) .addField(new fieldObject().setName("PortBowWeapon").setType(fieldObject.TYPE_MFSTRING).setAccessType(fieldObject.ACCESSTYPE_INPUTOUTPUT).setValue(new String[] {"none"}).setAppinfo("URL for the model that represents the weapon at this location. [example \"http://www.web3d.org/content/examples/Savage/Weapons/50Cal.x3d\")")) .addField(new fieldObject().setName("StarboardFlightDeckWeapon").setType(fieldObject.TYPE_MFSTRING).setAccessType(fieldObject.ACCESSTYPE_INPUTOUTPUT).setValue(new String[] {"none"}).setAppinfo("URL for the model that represents the weapon at this location. [example \"http://www.web3d.org/content/examples/Savage/Weapons/50Cal.x3d\")")) .addField(new fieldObject().setName("PortFlightDeckWeapon").setType(fieldObject.TYPE_MFSTRING).setAccessType(fieldObject.ACCESSTYPE_INPUTOUTPUT).setValue(new String[] {"none"}).setAppinfo("URL for the model that represents the weapon at this location. [example \"http://www.web3d.org/content/examples/Savage/Weapons/50Cal.x3d\")")) .addField(new fieldObject().setName("SternFlightDeckWeapon").setType(fieldObject.TYPE_MFSTRING).setAccessType(fieldObject.ACCESSTYPE_INPUTOUTPUT).setValue(new String[] {"none"}).setAppinfo("URL for the model that represents the weapon at this location. [example \"http://www.web3d.org/content/examples/Savage/Weapons/50Cal.x3d\")"))) .setProtoBody(new ProtoBodyObject() .addChild(new TransformObject().setScale(0.3048f,0.3048f,0.3048f).setTranslation(0.0f,1.0f,0.0f) .addComments(" Ship Model ") .addChild(new TransformObject("FFGShipModel") .addChild(new InlineObject().setUrl(new String[] {"OliverHazardPerryFFG.x3d","https://savage.nps.edu/Savage/ShipsMilitary/FFG-7OliverHazardPerry-UnitedStates/OliverHazardPerryFFG.x3d","OliverHazardPerryFFG.wrl","https://savage.nps.edu/Savage/ShipsMilitary/FFG-7OliverHazardPerry-UnitedStates/OliverHazardPerryFFG.wrl"}))) .addComments(" Hull Numbers ") .addChild(new TransformObject("StarboardBowHullNumber").setRotation(.721f,.678f,-.141f,.523f).setTranslation(53.802f,5.007f,2.192f) .addChild(new ProtoInstanceObject("HullNumber", "ShipNumber") .setIS(new ISObject() .addConnect(new connectObject().setNodeField("FirstNumber").setProtoField("HullNumber1")) .addConnect(new connectObject().setNodeField("SecondNumber").setProtoField("HullNumber2"))))) .addChild(new TransformObject("PortBowHullNumber").setRotation(.025f,.99f,-.139f,2.794f).setTranslation(53.802f,5.007f,-2.197f) .addChild(new ProtoInstanceObject("HullNumber") .setIS(new ISObject() .addConnect(new connectObject().setNodeField("FirstNumber").setProtoField("HullNumber1")) .addConnect(new connectObject().setNodeField("SecondNumber").setProtoField("HullNumber2"))))) .addComments(" ISIC Seals ") .addChild(new TransformObject("StarboardSeal").setTranslation(19.032f,7.152f,4.433f) .addChild(new TransformObject() .addChild(new InlineObject("ISICSeal") .setIS(new ISObject() .addConnect(new connectObject().setNodeField("url").setProtoField("ISIC")))))) .addChild(new TransformObject("PortSeal").setRotation(0.0f,1.0f,0.0f,3.14f).setTranslation(19.032f,7.152f,-4.395f) .addChild(new TransformObject() .addChild(new InlineObject().setUSE("ISICSeal")))) .addComments(" Weapon Placements ") .addChild(new TransformObject("StarboardBowWeapon").setRotation(0.0f,1.0f,0.0f,3.14f).setTranslation(24.02f,5.655f,5.807f) .addChild(new InlineObject() .setIS(new ISObject() .addConnect(new connectObject().setNodeField("url").setProtoField("StarboardBowWeapon"))))) .addChild(new TransformObject("PortBowWeapon").setTranslation(24.02f,5.681f,-5.794f) .addChild(new InlineObject() .setIS(new ISObject() .addConnect(new connectObject().setNodeField("url").setProtoField("PortBowWeapon"))))) .addChild(new TransformObject("StarboardFlightDeckWeapon").setRotation(0.0f,1.0f,0.0f,3.14f).setTranslation(-50.342f,4.213f,5.961f) .addChild(new InlineObject() .setIS(new ISObject() .addConnect(new connectObject().setNodeField("url").setProtoField("StarboardFlightDeckWeapon"))))) .addChild(new TransformObject("PortFlightDeckWeapon").setTranslation(-50.342f,4.232f,-5.631f) .addChild(new InlineObject() .setIS(new ISObject() .addConnect(new connectObject().setNodeField("url").setProtoField("PortFlightDeckWeapon"))))) .addChild(new TransformObject("SternFlightDeckWeapon").setRotation(0.0f,1.0f,0.0f,1.57f).setTranslation(-69.0f,3.922f,4.785f) .addChild(new InlineObject() .setIS(new ISObject() .addConnect(new connectObject().setNodeField("url").setProtoField("SternFlightDeckWeapon")))))))) .addChild(new ProtoInstanceObject("FFG", "FFG-7"))); } // end of initialize() method /** The initialized model object, created within initialize() method. */ private X3DObject x3dModel; /** Provide a * shallow copy * of the X3D model. * @see X3DObject * @return OliverHazardPerryFFGPrototype model */ public X3DObject getX3dModel() { return x3dModel; } /** Default main() method provided for test purposes, uses CommandLine to set global ConfigurationProperties for this object. * @param args array of input parameters, provided as arguments * @see X3DObject.handleArguments(args) * @see X3DObject.validationReport() * @see CommandLine * @see CommandLine.USAGE * @see ConfigurationProperties */ public static void main(String args[]) { X3DObject thisExampleX3dObject = new OliverHazardPerryFFGPrototype().getX3dModel(); boolean hasArguments = (args != null) && (args.length > 0); boolean validate = true; // default boolean argumentsLoadNewModel = false; String fileName = new String(); if (args != null) { for (String arg : args) { if (arg.toLowerCase().startsWith("-v") || arg.toLowerCase().contains("validate")) { validate = true; // making sure } if (arg.toLowerCase().endsWith(X3DObject.FILE_EXTENSION_X3D) || arg.toLowerCase().endsWith(X3DObject.FILE_EXTENSION_CLASSICVRML) || arg.toLowerCase().endsWith(X3DObject.FILE_EXTENSION_X3DB) || arg.toLowerCase().endsWith(X3DObject.FILE_EXTENSION_VRML97) || arg.toLowerCase().endsWith(X3DObject.FILE_EXTENSION_EXI) || arg.toLowerCase().endsWith(X3DObject.FILE_EXTENSION_GZIP) || arg.toLowerCase().endsWith(X3DObject.FILE_EXTENSION_ZIP) || arg.toLowerCase().endsWith(X3DObject.FILE_EXTENSION_HTML) || arg.toLowerCase().endsWith(X3DObject.FILE_EXTENSION_XHTML)) { argumentsLoadNewModel = true; fileName = arg; } } } if (argumentsLoadNewModel) System.out.println("WARNING: \"OliverHazardPerryFFGPrototype\" model invocation is attempting to load file \"" + fileName + "\" instead of simply validating itself... file loading ignored."); else if (hasArguments) // if no arguments provided, this method produces usage warning thisExampleX3dObject.handleArguments(args); if (validate) { System.out.print("Java program \"OliverHazardPerryFFGPrototype\" self-validation test results: "); String validationResults = thisExampleX3dObject.validationReport(); System.out.println(validationResults); } } }