package Basic.ChemicalMarkupLanguage;
/*
Copyright (c) 1995-2023 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 (https://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 org.web3d.x3d.jsail.Core.*;
import org.web3d.x3d.jsail.EnvironmentalEffects.*;
import org.web3d.x3d.jsail.fields.*;
import org.web3d.x3d.jsail.Geometry3D.*;
import org.web3d.x3d.jsail.Grouping.*;
import org.web3d.x3d.jsail.Lighting.*;
import org.web3d.x3d.jsail.Navigation.*;
import org.web3d.x3d.jsail.Rendering.*;
import org.web3d.x3d.jsail.Shape.*;
import org.web3d.x3d.jsail.Text.*;
// Javadoc metadata annotations follow, see below for X3DJSAIL Java source code.
/**
*
Autogenerated version of _3-methyl-1h-indene.x3d scene produced from _3-methyl-1h-indene.xml Chemical Markup Language (CML) source file.
Related links: _3_Methy_1H_indene.java source, _3-methyl-1h-indene catalog page, X3D Resources, X3D Scene Authoring Hints, and X3D Tooltips.
This program uses the
X3D Java Scene Access Interface Library (X3DJSAIL).
It has been produced using the
X3dToJava.xslt
stylesheet
(version control)
is used to create Java source code from an original .x3d
model.
* @author Nicholas F. Polys
*/
public class _3_Methy_1H_indene
{
/** Default constructor to create this object. */
public _3_Methy_1H_indene ()
{
initialize();
}
/** Create and initialize the X3D model for this object. */
public final void initialize()
{
try { // catch-all
x3dModel = new X3D().setProfile(X3D.PROFILE_IMMERSIVE).setVersion(X3D.VERSION_3_0)
.setHead(new head()
.addMeta(new meta().setName(meta.NAME_TITLE ).setContent("_3-methyl-1h-indene.x3d"))
.addMeta(new meta().setName(meta.NAME_DESCRIPTION).setContent("Autogenerated version of _3-methyl-1h-indene.x3d scene produced from _3-methyl-1h-indene.xml Chemical Markup Language (CML) source file."))
.addMeta(new meta().setName(meta.NAME_CREATOR ).setContent("Nicholas F. Polys"))
.addMeta(new meta().setName(meta.NAME_CREATED ).setContent("24 November 2005"))
.addMeta(new meta().setName(meta.NAME_MODIFIED ).setContent("1 July 2023"))
.addMeta(new meta().setName(meta.NAME_REFERENCE ).setContent("_3-methyl-1h-indene.xml"))
.addMeta(new meta().setName("CML-version").setContent("1.0"))
.addMeta(new meta().setName("CML-version").setContent("1.0"))
.addMeta(new meta().setName(meta.NAME_REFERENCE ).setContent("CML sources http://www.xml-cml.org"))
.addMeta(new meta().setName(meta.NAME_REFERENCE ).setContent("JUMBO Chemical Format Conversion Tool"))
.addMeta(new meta().setName(meta.NAME_REFERENCE ).setContent("http://webbook.nist.gov/chemistry"))
.addMeta(new meta().setName(meta.NAME_REFERENCE ).setContent("Polys.StylesheetTransformationsInteractiveVisualization.Web3d2003Symposium.pdf"))
.addMeta(new meta().setName(meta.NAME_REFERENCE ).setContent("Originally Published in Proceedings of Web3D 2003, ACM Press"))
.addMeta(new meta().setName(meta.NAME_GENERATOR ).setContent("CmlToX3d.xslt"))
.addMeta(new meta().setName(meta.NAME_IDENTIFIER ).setContent("https://www.web3d.org/x3d/content/examples/Basic/ChemicalMarkupLanguage/_3-methyl-1h-indene.x3d"))
.addMeta(new meta().setName(meta.NAME_LICENSE ).setContent("../license.html")))
.setScene(new Scene()
.addChild(new WorldInfo().setTitle("_3-methyl-1h-indene.x3d"))
.addChild(new ProtoDeclare("Carbon").setName("Carbon")
.setProtoInterface(new ProtoInterface()
.addField(new field().setName("position").setType(field.TYPE_SFVEC3F).setAccessType(field.ACCESSTYPE_INPUTOUTPUT).setValue(new SFVec3f(0.0,0.0,0.0)))
.addField(new field().setName("Mat").setType(field.TYPE_SFFLOAT).setAccessType(field.ACCESSTYPE_INPUTOUTPUT).setValue(.6)))
.setProtoBody(new ProtoBody()
.addChild(new Group()
.addChild(new Transform("atoC")
.setIS(new IS()
.addConnect(new connect().setNodeField("translation").setProtoField("position")))
.addChild(new Shape()
.setAppearance(new Appearance()
.setMaterial(new Material("atoC_mat").setDiffuseColor(0.0,0.0,0.0).setShininess(.8).setSpecularColor(.29,.3,.29)
.setIS(new IS()
.addConnect(new connect().setNodeField("transparency").setProtoField("Mat")))))
.setGeometry(new Sphere().setRadius(.77)))
.addChild(new Shape()
.setAppearance(new Appearance()
.setMaterial(new Material().setDiffuseColor(0.9,0.9,0.9)))
.setGeometry(new Text().setString(new String[] {"C"})
.setFontStyle(new FontStyle().setSize(.8))))))))
.addChild(new ProtoDeclare("Hydrogen").setName("Hydrogen")
.setProtoInterface(new ProtoInterface()
.addField(new field().setName("position").setType(field.TYPE_SFVEC3F).setAccessType(field.ACCESSTYPE_INPUTOUTPUT).setValue(new SFVec3f(0.0,0.0,0.0)))
.addField(new field().setName("Mat").setType(field.TYPE_SFFLOAT).setAccessType(field.ACCESSTYPE_INPUTOUTPUT).setValue(.6)))
.setProtoBody(new ProtoBody()
.addChild(new Group()
.addChild(new Transform("atoH")
.setIS(new IS()
.addConnect(new connect().setNodeField("translation").setProtoField("position")))
.addChild(new Shape()
.setAppearance(new Appearance()
.setMaterial(new Material("atoH_mat").setAmbientIntensity(.0933).setDiffuseColor(.38,.38,.42).setShininess(0.5).setSpecularColor(.53,.53,.53)
.setIS(new IS()
.addConnect(new connect().setNodeField("transparency").setProtoField("Mat")))))
.setGeometry(new Sphere().setRadius(.32)))
.addChild(new Shape()
.setAppearance(new Appearance()
.setMaterial(new Material().setDiffuseColor(0.9,0.9,0.9)))
.setGeometry(new Text().setString(new String[] {"H"})
.setFontStyle(new FontStyle().setSize(.4))))))))
.addChild(new ProtoDeclare("Nitrogen").setName("Nitrogen")
.setProtoInterface(new ProtoInterface()
.addField(new field().setName("position").setType(field.TYPE_SFVEC3F).setAccessType(field.ACCESSTYPE_INPUTOUTPUT).setValue(new SFVec3f(0.0,0.0,0.0)))
.addField(new field().setName("Mat").setType(field.TYPE_SFFLOAT).setAccessType(field.ACCESSTYPE_INPUTOUTPUT).setValue(.6)))
.setProtoBody(new ProtoBody()
.addChild(new Group()
.addChild(new Transform("atoN")
.setIS(new IS()
.addConnect(new connect().setNodeField("translation").setProtoField("position")))
.addChild(new Shape()
.setAppearance(new Appearance()
.setMaterial(new Material("atoN_mat").setDiffuseColor(0.0,0.0,.72).setEmissiveColor(0.0,0.0,.13).setSpecularColor(.5,.5,.5)
.setIS(new IS()
.addConnect(new connect().setNodeField("transparency").setProtoField("Mat")))))
.setGeometry(new Sphere().setRadius(.75)))
.addChild(new Shape()
.setAppearance(new Appearance()
.setMaterial(new Material().setDiffuseColor(0.9,0.9,0.9)))
.setGeometry(new Text().setString(new String[] {"N"})
.setFontStyle(new FontStyle().setSize(.8))))))))
.addChild(new ProtoDeclare("Oxygen").setName("Oxygen")
.setProtoInterface(new ProtoInterface()
.addField(new field().setName("position").setType(field.TYPE_SFVEC3F).setAccessType(field.ACCESSTYPE_INPUTOUTPUT).setValue(new SFVec3f(0.0,0.0,0.0)))
.addField(new field().setName("Mat").setType(field.TYPE_SFFLOAT).setAccessType(field.ACCESSTYPE_INPUTOUTPUT).setValue(.6)))
.setProtoBody(new ProtoBody()
.addChild(new Group()
.addChild(new Transform("atoO")
.setIS(new IS()
.addConnect(new connect().setNodeField("translation").setProtoField("position")))
.addChild(new Shape()
.setAppearance(new Appearance()
.setMaterial(new Material("atoO_mat").setAmbientIntensity(.487).setDiffuseColor(.54,.05,.25).setShininess(.2).setSpecularColor(.81,.77,.75)
.setIS(new IS()
.addConnect(new connect().setNodeField("transparency").setProtoField("Mat")))))
.setGeometry(new Sphere().setRadius(.73)))
.addChild(new Shape()
.setAppearance(new Appearance()
.setMaterial(new Material().setDiffuseColor(0.9,0.9,0.9)))
.setGeometry(new Text().setString(new String[] {"O"})
.setFontStyle(new FontStyle().setSize(.8))))))))
.addChild(new ProtoDeclare("Fluorine").setName("Fluorine")
.setProtoInterface(new ProtoInterface()
.addField(new field().setName("position").setType(field.TYPE_SFVEC3F).setAccessType(field.ACCESSTYPE_INPUTOUTPUT).setValue(new SFVec3f(0.0,0.0,0.0)))
.addField(new field().setName("Mat").setType(field.TYPE_SFFLOAT).setAccessType(field.ACCESSTYPE_INPUTOUTPUT).setValue(.6)))
.setProtoBody(new ProtoBody()
.addChild(new Group()
.addChild(new Transform("atoF")
.setIS(new IS()
.addConnect(new connect().setNodeField("translation").setProtoField("position")))
.addChild(new Shape()
.setAppearance(new Appearance()
.setMaterial(new Material("atoF_mat").setDiffuseColor(1.0,.48,.79).setEmissiveColor(.09,.04,.07)
.setIS(new IS()
.addConnect(new connect().setNodeField("transparency").setProtoField("Mat")))))
.setGeometry(new Sphere().setRadius(.72)))
.addChild(new Shape()
.setAppearance(new Appearance()
.setMaterial(new Material().setDiffuseColor(0.9,0.9,0.9)))
.setGeometry(new Text().setString(new String[] {"F"})
.setFontStyle(new FontStyle().setSize(.8))))))))
.addChild(new ProtoDeclare("Silicon").setName("Silicon")
.setProtoInterface(new ProtoInterface()
.addField(new field().setName("position").setType(field.TYPE_SFVEC3F).setAccessType(field.ACCESSTYPE_INPUTOUTPUT).setValue(new SFVec3f(0.0,0.0,0.0)))
.addField(new field().setName("Mat").setType(field.TYPE_SFFLOAT).setAccessType(field.ACCESSTYPE_INPUTOUTPUT).setValue(.6)))
.setProtoBody(new ProtoBody()
.addChild(new Group()
.addChild(new Transform("atoSi")
.setIS(new IS()
.addConnect(new connect().setNodeField("translation").setProtoField("position")))
.addChild(new Shape()
.setAppearance(new Appearance()
.setMaterial(new Material("atoSi_mat").setDiffuseColor(.8,.8,.8)
.setIS(new IS()
.addConnect(new connect().setNodeField("transparency").setProtoField("Mat")))))
.setGeometry(new Sphere().setRadius(1.18)))
.addChild(new Shape()
.setAppearance(new Appearance()
.setMaterial(new Material().setDiffuseColor(0.9,0.9,0.9)))
.setGeometry(new Text().setString(new String[] {"Si"})
.setFontStyle(new FontStyle().setSize(.8))))))))
.addChild(new ProtoDeclare("Phosphorus").setName("Phosphorus")
.setProtoInterface(new ProtoInterface()
.addField(new field().setName("position").setType(field.TYPE_SFVEC3F).setAccessType(field.ACCESSTYPE_INPUTOUTPUT).setValue(new SFVec3f(0.0,0.0,0.0)))
.addField(new field().setName("Mat").setType(field.TYPE_SFFLOAT).setAccessType(field.ACCESSTYPE_INPUTOUTPUT).setValue(.6)))
.setProtoBody(new ProtoBody()
.addChild(new Group()
.addChild(new Transform("atoP")
.setIS(new IS()
.addConnect(new connect().setNodeField("translation").setProtoField("position")))
.addChild(new Shape()
.setAppearance(new Appearance()
.setMaterial(new Material("atoP_mat").setAmbientIntensity(.11).setDiffuseColor(.9,.41,0.0).setEmissiveColor(.1,.04,0.0).setShininess(0.8).setSpecularColor(.1,.1,.1)
.setIS(new IS()
.addConnect(new connect().setNodeField("transparency").setProtoField("Mat")))))
.setGeometry(new Sphere().setRadius(1.1)))
.addChild(new Shape()
.setAppearance(new Appearance()
.setMaterial(new Material().setDiffuseColor(0.9,0.9,0.9)))
.setGeometry(new Text().setString(new String[] {"P"})
.setFontStyle(new FontStyle().setSize(.8))))))))
.addChild(new ProtoDeclare("Sulphur").setName("Sulphur")
.setProtoInterface(new ProtoInterface()
.addField(new field().setName("position").setType(field.TYPE_SFVEC3F).setAccessType(field.ACCESSTYPE_INPUTOUTPUT).setValue(new SFVec3f(0.0,0.0,0.0)))
.addField(new field().setName("Mat").setType(field.TYPE_SFFLOAT).setAccessType(field.ACCESSTYPE_INPUTOUTPUT).setValue(.6)))
.setProtoBody(new ProtoBody()
.addChild(new Group()
.addChild(new Transform("atoS")
.setIS(new IS()
.addConnect(new connect().setNodeField("translation").setProtoField("position")))
.addChild(new Shape()
.setAppearance(new Appearance()
.setMaterial(new Material("atoS_mat").setAmbientIntensity(.0467).setDiffuseColor(.25,.39,.25).setEmissiveColor(.05,.08,.05).setShininess(0.6).setSpecularColor(.11,.12,.08)
.setIS(new IS()
.addConnect(new connect().setNodeField("transparency").setProtoField("Mat")))))
.setGeometry(new Sphere().setRadius(1.3)))
.addChild(new Shape()
.setAppearance(new Appearance()
.setMaterial(new Material().setDiffuseColor(0.9,0.9,0.9)))
.setGeometry(new Text().setString(new String[] {"S"})
.setFontStyle(new FontStyle().setSize(.8))))))))
.addChild(new ProtoDeclare("Chlorine").setName("Chlorine")
.setProtoInterface(new ProtoInterface()
.addField(new field().setName("position").setType(field.TYPE_SFVEC3F).setAccessType(field.ACCESSTYPE_INPUTOUTPUT).setValue(new SFVec3f(0.0,0.0,0.0)))
.addField(new field().setName("Mat").setType(field.TYPE_SFFLOAT).setAccessType(field.ACCESSTYPE_INPUTOUTPUT).setValue(.6)))
.setProtoBody(new ProtoBody()
.addChild(new Group()
.addChild(new Transform("atoCl")
.setIS(new IS()
.addConnect(new connect().setNodeField("translation").setProtoField("position")))
.addChild(new Shape()
.setAppearance(new Appearance()
.setMaterial(new Material("atoCl_mat").setDiffuseColor(.28,.7,0.0).setEmissiveColor(.06,.15,0.0).setShininess(0.8).setSpecularColor(.5,.5,.5)
.setIS(new IS()
.addConnect(new connect().setNodeField("transparency").setProtoField("Mat")))))
.setGeometry(new Sphere().setRadius(1.01)))
.addChild(new Shape()
.setAppearance(new Appearance()
.setMaterial(new Material().setDiffuseColor(0.9,0.9,0.9)))
.setGeometry(new Text().setString(new String[] {"Cl"})
.setFontStyle(new FontStyle().setSize(.8))))))))
.addChild(new ProtoDeclare("Bromine").setName("Bromine")
.setProtoInterface(new ProtoInterface()
.addField(new field().setName("position").setType(field.TYPE_SFVEC3F).setAccessType(field.ACCESSTYPE_INPUTOUTPUT).setValue(new SFVec3f(0.0,0.0,0.0)))
.addField(new field().setName("Mat").setType(field.TYPE_SFFLOAT).setAccessType(field.ACCESSTYPE_INPUTOUTPUT).setValue(.6)))
.setProtoBody(new ProtoBody()
.addChild(new Group()
.addChild(new Transform("atoBr")
.setIS(new IS()
.addConnect(new connect().setNodeField("translation").setProtoField("position")))
.addChild(new Shape()
.setAppearance(new Appearance()
.setMaterial(new Material("atoBr_mat").setAmbientIntensity(.0833).setDiffuseColor(.5,.3,.19).setEmissiveColor(.12,.13,.08).setShininess(0.17).setSpecularColor(.08,.08,.05)
.setIS(new IS()
.addConnect(new connect().setNodeField("transparency").setProtoField("Mat")))))
.setGeometry(new Sphere().setRadius(1.14)))
.addChild(new Shape()
.setAppearance(new Appearance()
.setMaterial(new Material().setDiffuseColor(0.9,0.9,0.9)))
.setGeometry(new Text().setString(new String[] {"Br"})
.setFontStyle(new FontStyle().setSize(.8))))))))
.addChild(new ProtoDeclare("Iodine").setName("Iodine")
.setProtoInterface(new ProtoInterface()
.addField(new field().setName("position").setType(field.TYPE_SFVEC3F).setAccessType(field.ACCESSTYPE_INPUTOUTPUT).setValue(new SFVec3f(0.0,0.0,0.0)))
.addField(new field().setName("Mat").setType(field.TYPE_SFFLOAT).setAccessType(field.ACCESSTYPE_INPUTOUTPUT).setValue(.6)))
.setProtoBody(new ProtoBody()
.addChild(new Group()
.addChild(new Transform("atoI")
.setIS(new IS()
.addConnect(new connect().setNodeField("translation").setProtoField("position")))
.addChild(new Shape()
.setAppearance(new Appearance()
.setMaterial(new Material("atoI_mat").setDiffuseColor(.56,.37,.74).setEmissiveColor(.15,.1,.2).setShininess(.09).setSpecularColor(.12,.12,.12)
.setIS(new IS()
.addConnect(new connect().setNodeField("transparency").setProtoField("Mat")))))
.setGeometry(new Sphere().setRadius(1.33)))
.addChild(new Shape()
.setAppearance(new Appearance()
.setMaterial(new Material().setDiffuseColor(0.9,0.9,0.9)))
.setGeometry(new Text().setString(new String[] {"I"})
.setFontStyle(new FontStyle().setSize(.8))))))))
.addChild(new ProtoDeclare("unknown").setName("unknown")
.setProtoInterface(new ProtoInterface()
.addField(new field().setName("position").setType(field.TYPE_SFVEC3F).setAccessType(field.ACCESSTYPE_INPUTOUTPUT).setValue(new SFVec3f(0.0,0.0,0.0)))
.addField(new field().setName("Mat").setType(field.TYPE_SFFLOAT).setAccessType(field.ACCESSTYPE_INPUTOUTPUT).setValue(.6)))
.setProtoBody(new ProtoBody()
.addChild(new Group()
.addChild(new Transform("ato_")
.setIS(new IS()
.addConnect(new connect().setNodeField("translation").setProtoField("position")))
.addChild(new Shape()
.setAppearance(new Appearance()
.setMaterial(new Material("ato__mat").setDiffuseColor(1.0,1.0,1.0).setEmissiveColor(.15,.1,.2).setShininess(.09).setSpecularColor(.12,.12,.12)
.setIS(new IS()
.addConnect(new connect().setNodeField("transparency").setProtoField("Mat")))))
.setGeometry(new Sphere().setRadius(1.001)))
.addChild(new Shape()
.setAppearance(new Appearance()
.setMaterial(new Material().setDiffuseColor(0.9,0.9,0.9)))
.setGeometry(new Text().setString(new String[] {"?"})
.setFontStyle(new FontStyle().setSize(.8))))))))
.addChild(new ProtoDeclare("line").setName("line")
.setProtoInterface(new ProtoInterface()
.addField(new field().setName("bond_set").setType(field.TYPE_MFVEC3F).setAccessType(field.ACCESSTYPE_INPUTOUTPUT).setValue(new MFVec3f(new MFVec3f(new double[] {-1.0,0.0,0.0,1.0,0.0,0.0})))))
.setProtoBody(new ProtoBody()
.addChild(new Group()
.addChild(new Shape()
.setAppearance(new Appearance()
.setMaterial(new Material().setDiffuseColor(1.0,1.0,1.0).setEmissiveColor(1.0,1.0,1.0)))
.setGeometry(new IndexedLineSet().setCoordIndex(new int[] {0,1,-1})
.setCoord(new Coordinate("bondo")
.setIS(new IS()
.addConnect(new connect().setNodeField("point").setProtoField("bond_set")))))))))
.addChild(new ProtoDeclare("title_text").setName("title_text")
.setProtoInterface(new ProtoInterface()
.addField(new field().setName("txt").setType(field.TYPE_MFSTRING).setAccessType(field.ACCESSTYPE_INPUTOUTPUT)))
.setProtoBody(new ProtoBody()
.addChild(new Transform()
.addChild(new Group()
.addChild(new Transform()
.addChild(new Shape()
.setAppearance(new Appearance()
.setMaterial(new Material().setDiffuseColor(0.9,0.9,0.9)))
.setGeometry(new Text("cmpd_name")
.setIS(new IS()
.addConnect(new connect().setNodeField("string").setProtoField("txt")))
.setFontStyle(new FontStyle()))))))))
.addChild(new ProtoDeclare("ano1_text").setName("ano1_text")
.setProtoInterface(new ProtoInterface()
.addField(new field().setName("txt").setType(field.TYPE_MFSTRING).setAccessType(field.ACCESSTYPE_INPUTOUTPUT)))
.setProtoBody(new ProtoBody()
.addChild(new Transform()
.addChild(new Group()
.addChild(new Transform()
.addChild(new Shape()
.setAppearance(new Appearance()
.setMaterial(new Material().setDiffuseColor(0.9,0.9,0.9)))
.setGeometry(new Text("cmpd_name1")
.setIS(new IS()
.addConnect(new connect().setNodeField("string").setProtoField("txt")))
.setFontStyle(new FontStyle().setSize(.8)))))))))
.addChild(new ProtoDeclare("ano2_text").setName("ano2_text")
.setProtoInterface(new ProtoInterface()
.addField(new field().setName("txt").setType(field.TYPE_MFSTRING).setAccessType(field.ACCESSTYPE_INPUTOUTPUT)))
.setProtoBody(new ProtoBody()
.addChild(new Transform()
.addChild(new Group()
.addChild(new Transform()
.addChild(new Shape()
.setAppearance(new Appearance()
.setMaterial(new Material().setDiffuseColor(0.9,0.9,0.9)))
.setGeometry(new Text("cmpd_name2")
.setIS(new IS()
.addConnect(new connect().setNodeField("string").setProtoField("txt")))
.setFontStyle(new FontStyle().setSize(.6)))))))))
.addChild(new Background().setGroundAngle(new double[] {1.309,1.570796}).setGroundColor(new MFColor(new double[] {0.0,0.5,0.7,0.0,0.4,0.7,0.6,0.5,0.7})).setSkyAngle(new double[] {1.309,1.570796}).setSkyColor(new MFColor(new double[] {0.0,0.5,0.8,0.0,0.6,.7,0.6,0.6,0.7})))
.addChild(new PointLight().setAmbientIntensity(1).setLocation(0.0,0.0,5.0).setRadius(30))
.addChild(new NavigationInfo().setType("\"EXAMINE\" \"FLY\" \"ANY\""))
.addChild(new Viewpoint().setDescription("Inspect _3-methyl-1h-indene").setPosition(0.0,2.0,20.0))
.addComments(" Copyright by the U.S. Sec. Commerce on behalf of U.S.A. All rights reserved. ")
.addComments(" type=\"3D\" ")
.addChild(new Transform("infogroupa").setTranslation(-8.0,2.0,-4.0)
.addChild(new Transform().setTranslation(0.0,6.0,0.0)
.addChild(new Viewpoint().setDescription("title billboard").setPosition(6.0,-2.0,10.0))
.addChild(new ProtoInstance("title_text").setContainerField("children")
.addFieldValue(new fieldValue().setName("txt").setValue(new String[] {"_3-methyl-1h-indene: C10 H10"}))))
.addChild(new Transform().setTranslation(0.0,5.0,0.0)
.addChild(new ProtoInstance("ano1_text").setContainerField("children")
.addFieldValue(new fieldValue().setName("txt").setValue(new String[] {"molecule weight: 130.19"}))))
.addChild(new Transform().setTranslation(0.0,4.0,0.0)
.addChild(new ProtoInstance("ano1_text").setContainerField("children")
.addFieldValue(new fieldValue().setName("txt").setValue(new String[] {"melting point: 94"}))))
.addChild(new Transform().setTranslation(0.0,3.0,0.0)
.addChild(new ProtoInstance("ano1_text").setContainerField("children")
.addFieldValue(new fieldValue().setName("txt").setValue(new String[] {"boiling point: 266"}))))
.addChild(new Transform().setTranslation(0.0,2.0,0.0)
.addChild(new ProtoInstance("ano1_text").setContainerField("children")
.addFieldValue(new fieldValue().setName("txt").setValue(new String[] {"specific gravity: 0.965"})))))
.addChild(new Group()
.addChild(new Transform()
.addChild(new ProtoInstance("Carbon", "_3-methyl-1h-indene_a1").setContainerField("children")
.addFieldValue(new fieldValue().setName("position").setValue(new SFVec3f(1.0802,4.4808,0.8224)))))
.addChild(new Transform()
.addChild(new ProtoInstance("Carbon", "_3-methyl-1h-indene_a2").setContainerField("children")
.addFieldValue(new fieldValue().setName("position").setValue(new SFVec3f(1.7105,3.1539,0.9211)))))
.addChild(new Transform()
.addChild(new ProtoInstance("Carbon", "_3-methyl-1h-indene_a3").setContainerField("children")
.addFieldValue(new fieldValue().setName("position").setValue(new SFVec3f(3.153,2.9519,1.1096)))))
.addChild(new Transform()
.addChild(new ProtoInstance("Carbon", "_3-methyl-1h-indene_a4").setContainerField("children")
.addFieldValue(new fieldValue().setName("position").setValue(new SFVec3f(1.1022,1.9458,0.8602)))))
.addChild(new Transform()
.addChild(new ProtoInstance("Carbon", "_3-methyl-1h-indene_a5").setContainerField("children")
.addFieldValue(new fieldValue().setName("position").setValue(new SFVec3f(3.4,1.5607,1.1621)))))
.addChild(new Transform()
.addChild(new ProtoInstance("Carbon", "_3-methyl-1h-indene_a6").setContainerField("children")
.addFieldValue(new fieldValue().setName("position").setValue(new SFVec3f(4.1914,3.8614,1.229)))))
.addChild(new Transform()
.addChild(new ProtoInstance("Carbon", "_3-methyl-1h-indene_a7").setContainerField("children")
.addFieldValue(new fieldValue().setName("position").setValue(new SFVec3f(2.1,0.8281,1.0059)))))
.addChild(new Transform()
.addChild(new ProtoInstance("Carbon", "_3-methyl-1h-indene_a8").setContainerField("children")
.addFieldValue(new fieldValue().setName("position").setValue(new SFVec3f(4.6834,1.076,1.3341)))))
.addChild(new Transform()
.addChild(new ProtoInstance("Carbon", "_3-methyl-1h-indene_a9").setContainerField("children")
.addFieldValue(new fieldValue().setName("position").setValue(new SFVec3f(5.4842,3.366,1.4022)))))
.addChild(new Transform()
.addChild(new ProtoInstance("Carbon", "_3-methyl-1h-indene_a10").setContainerField("children")
.addFieldValue(new fieldValue().setName("position").setValue(new SFVec3f(5.7263,1.9964,1.4539))))))
.addChild(new Group()
.addChild(new ProtoInstance("line", "_3-methyl-1h-indene_b1").setContainerField("children")
.addFieldValue(new fieldValue().setName("bond_set").setValue(new MFVec3f(new MFVec3f(new double[] {1.0802,4.4808,0.8224,1.7105,3.1539,0.9211})))))
.addChild(new ProtoInstance("line", "_3-methyl-1h-indene_b5").setContainerField("children")
.addFieldValue(new fieldValue().setName("bond_set").setValue(new MFVec3f(new MFVec3f(new double[] {1.7105,3.1539,0.9211,3.153,2.9519,1.1096})))))
.addChild(new ProtoInstance("line", "_3-methyl-1h-indene_b6").setContainerField("children")
.addFieldValue(new fieldValue().setName("bond_set").setValue(new MFVec3f(new MFVec3f(new double[] {1.0822,1.9458,0.8602,1.6905,3.1539,0.9211})))))
.addChild(new ProtoInstance("line", "_3-methyl-1h-indene_b6_2").setContainerField("children")
.addFieldValue(new fieldValue().setName("bond_set").setValue(new MFVec3f(new MFVec3f(new double[] {1.1222,1.9458,0.8602,1.7305,3.1539,0.9211})))))
.addChild(new ProtoInstance("line", "_3-methyl-1h-indene_b9").setContainerField("children")
.addFieldValue(new fieldValue().setName("bond_set").setValue(new MFVec3f(new MFVec3f(new double[] {2.1,0.8281,1.0059,1.1022,1.9458,0.8602})))))
.addChild(new ProtoInstance("line", "_3-methyl-1h-indene_b11").setContainerField("children")
.addFieldValue(new fieldValue().setName("bond_set").setValue(new MFVec3f(new MFVec3f(new double[] {3.4,1.5607,1.1621,2.1,0.8281,1.0059})))))));
}
catch (Exception ex)
{
System.err.println ("*** Further hints on X3DJSAIL errors and exceptions at");
System.err.println ("*** https://www.web3d.org/specifications/java/X3DJSAIL.html");
throw (ex);
}
}
// end of initialize() method
/** The initialized model object, created within initialize() method. */
private X3D x3dModel;
/**
* Provide a
* shallow copy
* of the X3D model.
* @see X3D
* @return _3_Methy_1H_indene model
*/
public X3D 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 X3D.handleArguments(args)
* @see X3D.validationReport()
* @see CommandLine
* @see CommandLine.USAGE
* @see ConfigurationProperties
*/
public static void main(String args[])
{
System.out.println("Build this X3D model, showing validation diagnostics...");
X3D thisExampleX3dModel = new _3_Methy_1H_indene().getX3dModel();
// System.out.println("X3D model construction complete.");
// next handle command line arguments
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(X3D.FILE_EXTENSION_X3D) ||
arg.toLowerCase().endsWith(X3D.FILE_EXTENSION_CLASSICVRML) ||
arg.toLowerCase().endsWith(X3D.FILE_EXTENSION_X3DB) ||
arg.toLowerCase().endsWith(X3D.FILE_EXTENSION_VRML97) ||
arg.toLowerCase().endsWith(X3D.FILE_EXTENSION_EXI) ||
arg.toLowerCase().endsWith(X3D.FILE_EXTENSION_GZIP) ||
arg.toLowerCase().endsWith(X3D.FILE_EXTENSION_ZIP) ||
arg.toLowerCase().endsWith(X3D.FILE_EXTENSION_HTML) ||
arg.toLowerCase().endsWith(X3D.FILE_EXTENSION_XHTML))
{
argumentsLoadNewModel = true;
fileName = arg;
}
}
}
if (argumentsLoadNewModel)
System.out.println("WARNING: \"Basic.ChemicalMarkupLanguage._3_Methy_1H_indene\" 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
thisExampleX3dModel.handleArguments(args);
if (validate)
{
// System.out.println("--- TODO fix duplicated outputs ---"); // omit when duplicated outputs problem is solved/refactored
String validationResults = thisExampleX3dModel.validationReport();
// System.out.println("-----------------------------------"); // omit when duplicated outputs problem is solved/refactored
System.out.print("Basic.ChemicalMarkupLanguage._3_Methy_1H_indene self-validation test results: ");
if (!validationResults.equals("success"))
System.out.println();
System.out.println(validationResults.trim());
}
}
}