import jnius_config
jnius_config.add_options('-Xss1024m')
jnius_config.set_classpath('.', '../../../jars/X3DJSAIL.3.3.full.jar')
from jnius import autoclass
from X3Dautoclass import *
X3D0 = X3D()
X3D0.setProfile("Immersive")
X3D0.setVersion("3.3")
head1 = head()
component2 = component()
component2.setLevel(3)
component2.setName("EnvironmentalEffects")

head1.addComponent(component2)
meta3 = meta()
meta3.setContent("TextureBackgroundCube.x3d")
meta3.setName("title")

head1.addMeta(meta3)
meta4 = meta()
meta4.setContent("TextureBackground containing ImageTexture nodes, with labeled side images and wide field-of-view (FOV) Viewpoints, suitable for scene-orientation testing. Includes transparency interpolator test and also LoadSensor Script console to log events of interest.")
meta4.setName("description")

head1.addMeta(meta4)
meta5 = meta()
meta5.setContent("1 May 2017")
meta5.setName("created")

head1.addMeta(meta5)
meta6 = meta()
meta6.setContent("1 May 2017")
meta6.setName("modified")

head1.addMeta(meta6)
meta7 = meta()
meta7.setContent("Don Brutzman")
meta7.setName("creator")

head1.addMeta(meta7)
meta8 = meta()
meta8.setContent("BackgroundCube.x3d.")
meta8.setName("reference")

head1.addMeta(meta8)
meta9 = meta()
meta9.setContent("../GeometricShapes/CubeWithLabeledSides.x3d")
meta9.setName("reference")

head1.addMeta(meta9)
meta10 = meta()
meta10.setContent("../Animation/CubeWithLabeledSidesViewpointSequencer.x3d")
meta10.setName("reference")

head1.addMeta(meta10)
meta11 = meta()
meta11.setContent("../Animation/CubeWithLabeledSidesViewpointSequencer.png")
meta11.setName("Image")

head1.addMeta(meta11)
meta12 = meta()
meta12.setContent("http://x3dGraphics.com/examples/X3dForAdvancedModeling/Visualization/BackgroundCube.x3d")
meta12.setName("identifier")

head1.addMeta(meta12)
meta13 = meta()
meta13.setContent("http://www.web3d.org/x3d/content/examples/license.html")
meta13.setName("license")

head1.addMeta(meta13)
meta14 = meta()
meta14.setContent("X3D-Edit 3.3, https://savage.nps.edu/X3D-Edit")
meta14.setName("generator")

head1.addMeta(meta14)

X3D0.setHead(head1)
Scene15 = Scene()
TextureBackground16 = TextureBackground()
TextureBackground16.setDEF("TransparentBackground")
ImageTexture17 = ImageTexture()
ImageTexture17.setDEF("backTexture")
ImageTexture17.setUrl(["../GeometricShapes/images/back.png","http://x3dGraphics.com/examples/X3dForAdvancedModeling/GeometricShapes/images/back.png"])

TextureBackground16.setBackTexture(ImageTexture17)
ImageTexture18 = ImageTexture()
ImageTexture18.setDEF("bottomTexture")
ImageTexture18.setUrl(["../GeometricShapes/images/bottom.png","http://x3dGraphics.com/examples/X3dForAdvancedModeling/GeometricShapes/images/bottom.png"])

TextureBackground16.setBottomTexture(ImageTexture18)
ImageTexture19 = ImageTexture()
ImageTexture19.setDEF("frontTexture")
ImageTexture19.setUrl(["../GeometricShapes/images/front.png","http://x3dGraphics.com/examples/X3dForAdvancedModeling/GeometricShapes/images/front.png"])

TextureBackground16.setFrontTexture(ImageTexture19)
ImageTexture20 = ImageTexture()
ImageTexture20.setDEF("leftTexture")
ImageTexture20.setUrl(["../GeometricShapes/images/left.png","http://x3dGraphics.com/examples/X3dForAdvancedModeling/GeometricShapes/images/left.png"])

TextureBackground16.setLeftTexture(ImageTexture20)
ImageTexture21 = ImageTexture()
ImageTexture21.setDEF("rightTexture")
ImageTexture21.setUrl(["../GeometricShapes/images/right.png","http://x3dGraphics.com/examples/X3dForAdvancedModeling/GeometricShapes/images/right.png"])

TextureBackground16.setRightTexture(ImageTexture21)
ImageTexture22 = ImageTexture()
ImageTexture22.setDEF("topTexture")
ImageTexture22.setUrl(["../GeometricShapes/images/top.png","http://x3dGraphics.com/examples/X3dForAdvancedModeling/GeometricShapes/images/top.png"])

TextureBackground16.setTopTexture(ImageTexture22)

Scene15.addChildren(TextureBackground16)
ScalarInterpolator23 = ScalarInterpolator()
ScalarInterpolator23.setDEF("TransparencyAnimator")
ScalarInterpolator23.setKey([0,0.5,1])
ScalarInterpolator23.setKeyValue([0,1,0])

Scene15.addChildren(ScalarInterpolator23)
ROUTE24 = ROUTE()
ROUTE24.setFromField("value_changed")
ROUTE24.setFromNode("TransparencyAnimator")
ROUTE24.setToField("transparency")
ROUTE24.setToNode("TransparentBackground")

Scene15.addChildren(ROUTE24)
TimeSensor25 = TimeSensor()
TimeSensor25.setDEF("Clock")
TimeSensor25.setCycleInterval(6)
TimeSensor25.setLoop(True)

Scene15.addChildren(TimeSensor25)
ROUTE26 = ROUTE()
ROUTE26.setFromField("fraction_changed")
ROUTE26.setFromNode("Clock")
ROUTE26.setToField("set_fraction")
ROUTE26.setToNode("TransparencyAnimator")

Scene15.addChildren(ROUTE26)
LoadSensor27 = LoadSensor()
LoadSensor27.setDEF("ImageLoadSensor")
ImageTexture28 = ImageTexture()
ImageTexture28.setUSE("backTexture")

LoadSensor27.setWatchList(ImageTexture28)
ImageTexture29 = ImageTexture()
ImageTexture29.setUSE("bottomTexture")

LoadSensor27.setWatchList(ImageTexture29)
ImageTexture30 = ImageTexture()
ImageTexture30.setUSE("frontTexture")

LoadSensor27.setWatchList(ImageTexture30)
ImageTexture31 = ImageTexture()
ImageTexture31.setUSE("leftTexture")

LoadSensor27.setWatchList(ImageTexture31)
ImageTexture32 = ImageTexture()
ImageTexture32.setUSE("rightTexture")

LoadSensor27.setWatchList(ImageTexture32)
ImageTexture33 = ImageTexture()
ImageTexture33.setUSE("topTexture")

LoadSensor27.setWatchList(ImageTexture33)

Scene15.addChildren(LoadSensor27)
Script34 = Script()
Script34.setDEF("LoadSensorReportScript")
field35 = field()
field35.setAccessType("inputOnly")
field35.setName("isActiveUpdate")
field35.setType("SFBool")

Script34.addField(field35)
field36 = field()
field36.setAccessType("inputOnly")
field36.setName("isLoadedUpdate")
field36.setType("SFBool")

Script34.addField(field36)
field37 = field()
field37.setAccessType("inputOnly")
field37.setName("progressUpdate")
field37.setType("SFFloat")

Script34.addField(field37)
field38 = field()
field38.setAccessType("inputOnly")
field38.setName("loadTimeUpdate")
field38.setType("SFTime")

Script34.addField(field38)
field39 = field()
field39.setAccessType("inputOnly")
field39.setName("transparencyUpdate")
field39.setType("SFFloat")

Script34.addField(field39)

Script34.setSourceCode('''\n"+
"ecmascript:\n"+
"\n"+
"function isActiveUpdate (eventValue)\n"+
"{\n"+
"   Browser.println('TextureBackgroundCube LoadSensorReportScript: isActiveUpdate=' + eventValue);\n"+
"}\n"+
"\n"+
"function isLoadedUpdate (eventValue)\n"+
"{\n"+
"   Browser.println('TextureBackgroundCube LoadSensorReportScript: isLoadedUpdate=' + eventValue);\n"+
"}\n"+
"\n"+
"function loadTimeUpdate (eventValue)\n"+
"{\n"+
"   Browser.println('TextureBackgroundCube LoadSensorReportScript: loadTimeUpdate=' + eventValue);\n"+
"}\n"+
"\n"+
"function progressUpdate (eventValue)\n"+
"{\n"+
"   Browser.println('TextureBackgroundCube LoadSensorReportScript: progressUpdate=' + eventValue);\n"+
"}\n"+
"\n"+
"function transparencyUpdate (eventValue)\n"+
"{\n"+
"// pretty busy interpolator\n"+
"// Browser.println('TextureBackgroundCube LoadSensorReportScript: transparencyUpdate=' + eventValue);\n"+
"}\n"+
"''')

Scene15.addChildren(Script34)
ROUTE40 = ROUTE()
ROUTE40.setFromField("isActive")
ROUTE40.setFromNode("ImageLoadSensor")
ROUTE40.setToField("isActiveUpdate")
ROUTE40.setToNode("LoadSensorReportScript")

Scene15.addChildren(ROUTE40)
ROUTE41 = ROUTE()
ROUTE41.setFromField("isLoaded")
ROUTE41.setFromNode("ImageLoadSensor")
ROUTE41.setToField("isLoadedUpdate")
ROUTE41.setToNode("LoadSensorReportScript")

Scene15.addChildren(ROUTE41)
ROUTE42 = ROUTE()
ROUTE42.setFromField("loadTime")
ROUTE42.setFromNode("ImageLoadSensor")
ROUTE42.setToField("loadTimeUpdate")
ROUTE42.setToNode("LoadSensorReportScript")

Scene15.addChildren(ROUTE42)
ROUTE43 = ROUTE()
ROUTE43.setFromField("progress")
ROUTE43.setFromNode("ImageLoadSensor")
ROUTE43.setToField("progressUpdate")
ROUTE43.setToNode("LoadSensorReportScript")

Scene15.addChildren(ROUTE43)
ROUTE44 = ROUTE()
ROUTE44.setFromField("value_changed")
ROUTE44.setFromNode("TransparencyAnimator")
ROUTE44.setToField("transparencyUpdate")
ROUTE44.setToNode("LoadSensorReportScript")

Scene15.addChildren(ROUTE44)
Viewpoint45 = Viewpoint()
Viewpoint45.setDescription("Front image of TextureBackground seen from origin")
Viewpoint45.setFieldOfView(1.570796)
Viewpoint45.setPosition([0,0,0])

Scene15.addChildren(Viewpoint45)
Viewpoint46 = Viewpoint()
Viewpoint46.setDescription("Left image of TextureBackground seen from origin")
Viewpoint46.setFieldOfView(1.570796)
Viewpoint46.setOrientation([0,1,0,-1.570796])
Viewpoint46.setPosition([0,0,0])

Scene15.addChildren(Viewpoint46)
Viewpoint47 = Viewpoint()
Viewpoint47.setDescription("Top image of TextureBackground seen from origin")
Viewpoint47.setFieldOfView(1.570796)
Viewpoint47.setOrientation([1,0,0,1.570796])
Viewpoint47.setPosition([0,0,0])

Scene15.addChildren(Viewpoint47)
Viewpoint48 = Viewpoint()
Viewpoint48.setDescription("Back image of TextureBackground seen from origin")
Viewpoint48.setFieldOfView(1.570796)
Viewpoint48.setOrientation([0,1,0,3.141593])
Viewpoint48.setPosition([0,0,0])

Scene15.addChildren(Viewpoint48)
Viewpoint49 = Viewpoint()
Viewpoint49.setDescription("Right image of TextureBackground seen from origin")
Viewpoint49.setFieldOfView(1.570796)
Viewpoint49.setOrientation([0,1,0,1.570796])
Viewpoint49.setPosition([0,0,0])

Scene15.addChildren(Viewpoint49)
Viewpoint50 = Viewpoint()
Viewpoint50.setDescription("Bottom image of TextureBackground seen from origin")
Viewpoint50.setFieldOfView(1.570796)
Viewpoint50.setOrientation([1,0,0,-1.570796])
Viewpoint50.setPosition([0,0,0])

Scene15.addChildren(Viewpoint50)

X3D0.setScene(Scene15)
X3D0.toFileX3D("/x3d-code/www.web3d.org/x3d/content/examples/X3dForAdvancedModeling/Visualization//TextureBackgroundCube.new.x3d")
