x_ite 10.1.0 → 10.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (95) hide show
  1. package/README.md +18 -18
  2. package/dist/LICENSE.md +4 -0
  3. package/dist/X3DUOM.xml +69 -11
  4. package/dist/assets/components/{Annotation.js → AnnotationComponent.js} +138 -260
  5. package/dist/assets/components/AnnotationComponent.min.js +2 -0
  6. package/dist/assets/components/{CADGeometry.js → CADGeometryComponent.js} +177 -299
  7. package/dist/assets/components/CADGeometryComponent.min.js +2 -0
  8. package/dist/assets/components/{CubeMapTexturing.js → CubeMapTexturingComponent.js} +218 -257
  9. package/dist/assets/components/CubeMapTexturingComponent.min.js +2 -0
  10. package/dist/assets/components/DISComponent.js +994 -0
  11. package/dist/assets/components/DISComponent.min.js +2 -0
  12. package/dist/assets/components/{EventUtilities.js → EventUtilitiesComponent.js} +121 -274
  13. package/dist/assets/components/EventUtilitiesComponent.min.js +2 -0
  14. package/dist/assets/components/{Geometry2D.js → Geometry2DComponent.js} +233 -371
  15. package/dist/assets/components/Geometry2DComponent.min.js +2 -0
  16. package/dist/assets/components/{Geospatial.js → GeospatialComponent.js} +449 -676
  17. package/dist/assets/components/GeospatialComponent.min.js +2 -0
  18. package/dist/assets/components/{HAnim.js → HAnimComponent.js} +277 -387
  19. package/dist/assets/components/HAnimComponent.min.js +2 -0
  20. package/dist/assets/components/{KeyDeviceSensor.js → KeyDeviceSensorComponent.js} +71 -114
  21. package/dist/assets/components/KeyDeviceSensorComponent.min.js +2 -0
  22. package/dist/assets/components/{Layout.js → LayoutComponent.js} +234 -339
  23. package/dist/assets/components/LayoutComponent.min.js +2 -0
  24. package/dist/assets/components/{NURBS.js → NURBSComponent.js} +351 -654
  25. package/dist/assets/components/NURBSComponent.min.js +2 -0
  26. package/dist/assets/components/{ParticleSystems.js → ParticleSystemsComponent.js} +345 -674
  27. package/dist/assets/components/ParticleSystemsComponent.min.js +2 -0
  28. package/dist/assets/components/{Picking.js → PickingComponent.js} +245 -472
  29. package/dist/assets/components/PickingComponent.min.js +2 -0
  30. package/dist/assets/components/{RigidBodyPhysics.js → RigidBodyPhysicsComponent.js} +496 -804
  31. package/dist/assets/components/RigidBodyPhysicsComponent.min.js +2 -0
  32. package/dist/assets/components/ScriptingComponent.js +899 -0
  33. package/dist/assets/components/ScriptingComponent.min.js +2 -0
  34. package/dist/assets/components/{Text.js → TextComponent.js} +199 -251
  35. package/dist/assets/components/TextComponent.min.js +2 -0
  36. package/dist/assets/components/{TextureProjection.js → TextureProjectionComponent.js} +144 -190
  37. package/dist/assets/components/TextureProjectionComponent.min.js +2 -0
  38. package/dist/assets/components/{Texturing3D.js → Texturing3DComponent.js} +224 -386
  39. package/dist/assets/components/Texturing3DComponent.min.js +2 -0
  40. package/dist/assets/components/{VolumeRendering.js → VolumeRenderingComponent.js} +316 -603
  41. package/dist/assets/components/VolumeRenderingComponent.min.js +2 -0
  42. package/dist/assets/components/{X_ITE.js → X_ITEComponent.js} +1250 -1347
  43. package/dist/assets/components/X_ITEComponent.min.js +2 -0
  44. package/dist/assets/fonts/PT_Sans/OFL.txt +94 -0
  45. package/dist/assets/fonts/PT_Sans/PTSans-Bold.ttf +0 -0
  46. package/dist/assets/fonts/PT_Sans/PTSans-BoldItalic.ttf +0 -0
  47. package/dist/assets/fonts/PT_Sans/PTSans-Italic.ttf +0 -0
  48. package/dist/assets/fonts/PT_Sans/PTSans-Regular.ttf +0 -0
  49. package/dist/assets/images/XR.svg +74 -0
  50. package/dist/assets/lib/mikktspace_bg.wasm +0 -0
  51. package/dist/example.html +1 -1
  52. package/dist/x_ite.css +1 -1
  53. package/dist/x_ite.d.ts +128 -22
  54. package/dist/x_ite.js +3575 -6278
  55. package/dist/x_ite.min.js +2 -1
  56. package/dist/x_ite.min.mjs +2 -1
  57. package/dist/x_ite.mjs +3575 -6278
  58. package/dist/x_ite.zip +0 -0
  59. package/package.json +7 -5
  60. package/dist/assets/components/Annotation.min.js +0 -1
  61. package/dist/assets/components/CADGeometry.min.js +0 -1
  62. package/dist/assets/components/CubeMapTexturing.min.js +0 -1
  63. package/dist/assets/components/DIS.js +0 -1104
  64. package/dist/assets/components/DIS.min.js +0 -1
  65. package/dist/assets/components/EventUtilities.min.js +0 -1
  66. package/dist/assets/components/Geometry2D.min.js +0 -1
  67. package/dist/assets/components/Geospatial.min.js +0 -1
  68. package/dist/assets/components/HAnim.min.js +0 -1
  69. package/dist/assets/components/KeyDeviceSensor.min.js +0 -1
  70. package/dist/assets/components/Layout.min.js +0 -1
  71. package/dist/assets/components/NURBS.min.js +0 -1
  72. package/dist/assets/components/ParticleSystems.min.js +0 -1
  73. package/dist/assets/components/Picking.min.js +0 -1
  74. package/dist/assets/components/RigidBodyPhysics.min.js +0 -1
  75. package/dist/assets/components/Scripting.js +0 -927
  76. package/dist/assets/components/Scripting.min.js +0 -1
  77. package/dist/assets/components/Text.min.js +0 -1
  78. package/dist/assets/components/TextureProjection.min.js +0 -1
  79. package/dist/assets/components/Texturing3D.min.js +0 -1
  80. package/dist/assets/components/VolumeRendering.min.js +0 -1
  81. package/dist/assets/components/X_ITE.min.js +0 -1
  82. /package/dist/assets/fonts/{DroidSerif Apache License.txt → Droid/DroidSerif Apache License.txt} +0 -0
  83. /package/dist/assets/fonts/{DroidSerif-Bold.ttf → Droid/DroidSerif-Bold.ttf} +0 -0
  84. /package/dist/assets/fonts/{DroidSerif-BoldItalic.ttf → Droid/DroidSerif-BoldItalic.ttf} +0 -0
  85. /package/dist/assets/fonts/{DroidSerif-Italic.ttf → Droid/DroidSerif-Italic.ttf} +0 -0
  86. /package/dist/assets/fonts/{DroidSerif-Regular.ttf → Droid/DroidSerif-Regular.ttf} +0 -0
  87. /package/dist/assets/fonts/{Ubuntu LICENCE.txt → Ubuntu/Ubuntu LICENCE.txt} +0 -0
  88. /package/dist/assets/fonts/{Ubuntu-B.ttf → Ubuntu/Ubuntu-B.ttf} +0 -0
  89. /package/dist/assets/fonts/{Ubuntu-BI.ttf → Ubuntu/Ubuntu-BI.ttf} +0 -0
  90. /package/dist/assets/fonts/{Ubuntu-R.ttf → Ubuntu/Ubuntu-R.ttf} +0 -0
  91. /package/dist/assets/fonts/{Ubuntu-RI.ttf → Ubuntu/Ubuntu-RI.ttf} +0 -0
  92. /package/dist/assets/fonts/{UbuntuMono-B.ttf → Ubuntu/UbuntuMono-B.ttf} +0 -0
  93. /package/dist/assets/fonts/{UbuntuMono-BI.ttf → Ubuntu/UbuntuMono-BI.ttf} +0 -0
  94. /package/dist/assets/fonts/{UbuntuMono-R.ttf → Ubuntu/UbuntuMono-R.ttf} +0 -0
  95. /package/dist/assets/fonts/{UbuntuMono-RI.ttf → Ubuntu/UbuntuMono-RI.ttf} +0 -0
@@ -1 +0,0 @@
1
- /* X_ITE v10.1.0 */(()=>{"use strict";var e={n:t=>{var n=t&&t.__esModule?()=>t.default:()=>t;return e.d(n,{a:n}),n},d:(t,n)=>{for(var o in n)e.o(n,o)&&!e.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:n[o]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)};const t=window[Symbol.for("X_ITE.X3D-10.1.0")].require("x_ite/Components");var n=e.n(t);const o=window[Symbol.for("X_ITE.X3D-10.1.0")].require("x_ite/Components/Texturing/PixelTexture");var r=e.n(o);const i=window[Symbol.for("X_ITE.X3D-10.1.0")].require("x_ite/Components/Texturing/TextureProperties");var s=e.n(i);const a=window[Symbol.for("X_ITE.X3D-10.1.0")].require("x_ite/Fields");var l=e.n(a);const d=window[Symbol.for("X_ITE.X3D-10.1.0")].require("x_ite/Base/X3DFieldDefinition");var u=e.n(d);const h=window[Symbol.for("X_ITE.X3D-10.1.0")].require("x_ite/Base/FieldDefinitionArray");var c=e.n(h);const m=window[Symbol.for("X_ITE.X3D-10.1.0")].require("x_ite/Components/Core/X3DNode");var p=e.n(m);const f=window[Symbol.for("X_ITE.X3D-10.1.0")].require("x_ite/Base/X3DConstants");var g=e.n(f);const _=window[Symbol.for("X_ITE.X3D-10.1.0")].require("x_ite/Namespace");var y=e.n(_);function S(e){p().call(this,e),this.addType(g().X3DVolumeRenderStyleNode),this.volumeDataNodes=new Set}Object.assign(Object.setPrototypeOf(S.prototype,p().prototype),{addShaderFields(e){},getUniformsText:()=>"",getFunctionsText:()=>"",getVolumeData(){return this.volumeDataNodes},addVolumeData(e){this.volumeDataNodes.add(e)},removeVolumeData(e){this.volumeDataNodes.delete(e)},getNormalText(e){let t="";return e?(t+="uniform sampler3D surfaceNormals_"+this.getId()+";\n",t+="\n",t+="vec4\n",t+="getNormal_"+this.getId()+" (in vec3 texCoord)\n",t+="{\n",t+=" vec3 n = texture (surfaceNormals_"+this.getId()+", texCoord) .xyz * 2.0 - 1.0;\n",t+="\n",t+=" return vec4 (normalize (x3d_TextureNormalMatrix * n), length (n));\n",t+="}\n"):(t+="\n",t+="vec4\n",t+="getNormal_"+this.getId()+" (in vec3 texCoord)\n",t+="{\n",t+=" vec4 offset = vec4 (1.0 / vec3 (textureSize (x3d_Texture3D [0], 0)), 0.0);\n",t+=" float i0 = texture (x3d_Texture3D [0], texCoord + offset .xww) .r;\n",t+=" float i1 = texture (x3d_Texture3D [0], texCoord - offset .xww) .r;\n",t+=" float i2 = texture (x3d_Texture3D [0], texCoord + offset .wyw) .r;\n",t+=" float i3 = texture (x3d_Texture3D [0], texCoord - offset .wyw) .r;\n",t+=" float i4 = texture (x3d_Texture3D [0], texCoord + offset .wwz) .r;\n",t+=" float i5 = texture (x3d_Texture3D [0], texCoord - offset .wwz) .r;\n",t+=" vec3 n = vec3 (i1 - i0, i3 - i2, i5 - i4);\n",t+="\n",t+=" return vec4 (normalize (x3d_TextureNormalMatrix * n), length (n));\n",t+="}\n"),t}}),Object.defineProperties(S,{typeName:{value:"X3DVolumeRenderStyleNode",enumerable:!0},componentInfo:{value:Object.freeze({name:"VolumeRendering",level:1}),enumerable:!0}});const x=S;y().add("X3DVolumeRenderStyleNode","x_ite/Components/VolumeRendering/X3DVolumeRenderStyleNode",x);const N=x;function v(e){N.call(this,e),this.addType(g().X3DComposableVolumeRenderStyleNode)}Object.setPrototypeOf(v.prototype,N.prototype),Object.defineProperties(v,{typeName:{value:"X3DComposableVolumeRenderStyleNode",enumerable:!0},componentInfo:{value:Object.freeze({name:"VolumeRendering",level:1}),enumerable:!0}});const w=v;y().add("X3DComposableVolumeRenderStyleNode","x_ite/Components/VolumeRendering/X3DComposableVolumeRenderStyleNode",w);const b=w,C=window[Symbol.for("X_ITE.X3D-10.1.0")].require("x_ite/Base/X3DCast");var I=e.n(C);function F(e){b.call(this,e),this.addType(g().OpacityMapVolumeStyle)}Object.assign(Object.setPrototypeOf(F.prototype,b.prototype),{initialize(){b.prototype.initialize.call(this);this.getBrowser().getContext().getVersion()<2||(this._transferFunction.addInterest("set_transferFunction__",this),this.set_transferFunction__())},set_transferFunction__(){this.transferFunctionNode=I()(g().X3DTexture2DNode,this._transferFunction),this.transferFunctionNode||(this.transferFunctionNode=I()(g().X3DTexture3DNode,this._transferFunction)),this.transferFunctionNode||(this.transferFunctionNode=this.getBrowser().getDefaultTransferFunction())},addShaderFields(e){this._enabled.getValue()&&e.addUserDefinedField(g().inputOutput,"transferFunction_"+this.getId(),new(l().SFNode)(this.transferFunctionNode))},getUniformsText(){if(!this._enabled.getValue())return"";let e="";return e+="\n",e+="// OpacityMapVolumeStyle\n",e+="\n",this.transferFunctionNode.getType().includes(g().X3DTexture2DNode)?(e+="uniform sampler2D transferFunction_"+this.getId()+";\n",e+="\n",e+="vec4\n",e+="getOpacityMapStyle_"+this.getId()+" (in vec4 originalColor)\n",e+="{\n",e+=" return texture (transferFunction_"+this.getId()+", originalColor .rg);\n",e+="}\n"):(e+="uniform sampler3D transferFunction_"+this.getId()+";\n",e+="\n",e+="vec4\n",e+="getOpacityMapStyle_"+this.getId()+" (in vec4 originalColor)\n",e+="{\n",e+=" return texture (transferFunction_"+this.getId()+", originalColor .rgb);\n",e+="}\n"),e},getFunctionsText(){if(!this._enabled.getValue())return"";let e="";return e+="\n",e+=" // OpacityMapVolumeStyle\n",e+="\n",e+=" textureColor = getOpacityMapStyle_"+this.getId()+" (textureColor);\n",e}}),Object.defineProperties(F,{typeName:{value:"OpacityMapVolumeStyle",enumerable:!0},componentInfo:{value:Object.freeze({name:"VolumeRendering",level:1}),enumerable:!0},containerField:{value:"renderStyle",enumerable:!0},specificationRange:{value:Object.freeze({from:"3.3",to:"Infinity"}),enumerable:!0},fieldDefinitions:{value:new(c())([new(u())(g().inputOutput,"enabled",new(l().SFBool)(!0)),new(u())(g().inputOutput,"metadata",new(l().SFNode)),new(u())(g().inputOutput,"transferFunction",new(l().SFNode))]),enumerable:!0}});const O=F;y().add("OpacityMapVolumeStyle","x_ite/Components/VolumeRendering/OpacityMapVolumeStyle",O);const V=O,D=Symbol(),T=Symbol(),P=Symbol(),E=Symbol();function j(){}Object.assign(j.prototype,{getDefaultVoxels(){return this[D]=this.getPrivateScene().createNode("PixelTexture3D",!1),this[D]._image=[1,1,1,1,255],this[D].repeatS=!0,this[D].repeatT=!0,this[D].repeatR=!0,this[D].setPrivate(!0),this[D].setup(),this.getDefaultVoxels=function(){return this[D]},Object.defineProperty(this,"getDefaultVoxels",{enumerable:!1}),this[D]},getDefaultVolumeStyle(){return this[T]=new V(this.getPrivateScene()),this[T].setPrivate(!0),this[T].setup(),this.getDefaultVolumeStyle=function(){return this[T]},Object.defineProperty(this,"getDefaultVolumeStyle",{enumerable:!1}),this[T]},getDefaultBlendedVolumeStyle(){return this[P]=new V(this.getPrivateScene()),this[P].setPrivate(!0),this[P].setup(),this.getDefaultBlendedVolumeStyle=function(){return this[P]},Object.defineProperty(this,"getDefaultBlendedVolumeStyle",{enumerable:!1}),this[P]},getDefaultTransferFunction(){const e=new(s())(this.getPrivateScene());return e._boundaryModeS="CLAMP_TO_EDGE",e._boundaryModeT="REPEAT",e._magnificationFilter="DEFAULT",e._minificationFilter="DEFAULT",e._generateMipMaps=!0,e._textureCompression="DEFAULT",e.setPrivate(!0),e.setup(),this[E]=new(r())(this.getPrivateScene()),this[E]._textureProperties=e,this[E]._image.width=256,this[E]._image.height=1,this[E]._image.comp=2,this[E]._image.array=Array.from({length:256},((e,t)=>t<<8|t)),this[E].setPrivate(!0),this[E].setup(),this.getDefaultTransferFunction=function(){return this[E]},Object.defineProperty(this,"getDefaultTransferFunction",{enumerable:!1}),this[E]}});const M=j;y().add("X3DVolumeRenderingContext","x_ite/Browser/VolumeRendering/X3DVolumeRenderingContext",M);const B=M;function z(e){b.call(this,e),this.addType(g().BlendedVolumeStyle)}Object.assign(Object.setPrototypeOf(z.prototype,b.prototype),{initialize(){b.prototype.initialize.call(this);this.getBrowser().getContext().getVersion()<2||(this._weightTransferFunction1.addInterest("set_weightTransferFunction1__",this),this._weightTransferFunction2.addInterest("set_weightTransferFunction2__",this),this._renderStyle.addInterest("set_renderStyle__",this),this._voxels.addInterest("set_voxels__",this),this.set_weightTransferFunction1__(),this.set_weightTransferFunction2__(),this.set_renderStyle__(),this.set_voxels__())},addVolumeData(e){b.prototype.addVolumeData.call(this,e),this.renderStyleNode&&this.renderStyleNode.addVolumeData(e)},removeVolumeData(e){b.prototype.removeVolumeData.call(this,e),this.renderStyleNode&&this.renderStyleNode.removeVolumeData(e)},set_weightTransferFunction1__(){this.weightTransferFunction1Node=I()(g().X3DTexture2DNode,this._weightTransferFunction1)},set_weightTransferFunction2__(){this.weightTransferFunction2Node=I()(g().X3DTexture2DNode,this._weightTransferFunction2)},set_renderStyle__(){if(this.renderStyleNode){this.renderStyleNode.removeInterest("addNodeEvent",this);for(const e of this.getVolumeData())this.renderStyleNode.removeVolumeData(e)}if(this.renderStyleNode=I()(g().X3DComposableVolumeRenderStyleNode,this._renderStyle),this.renderStyleNode){this.renderStyleNode.addInterest("addNodeEvent",this);for(const e of this.getVolumeData())this.renderStyleNode.addVolumeData(e)}},set_voxels__(){this.voxelsNode=I()(g().X3DTexture3DNode,this._voxels)},addShaderFields(e){this._enabled.getValue()&&(e.addUserDefinedField(g().inputOutput,"weightConstant1_"+this.getId(),this._weightConstant1.copy()),e.addUserDefinedField(g().inputOutput,"weightConstant2_"+this.getId(),this._weightConstant2.copy()),this.weightTransferFunction1Node&&e.addUserDefinedField(g().inputOutput,"weightTransferFunction1_"+this.getId(),new(l().SFNode)(this.weightTransferFunction1Node)),this.weightTransferFunction2Node&&e.addUserDefinedField(g().inputOutput,"weightTransferFunction2_"+this.getId(),new(l().SFNode)(this.weightTransferFunction2Node)),this.voxelsNode&&e.addUserDefinedField(g().inputOutput,"voxels_"+this.getId(),new(l().SFNode)(this.voxelsNode)),this.getBrowser().getDefaultBlendedVolumeStyle().addShaderFields(e),this.renderStyleNode&&this.renderStyleNode.addShaderFields(e))},getUniformsText(){if(!this._enabled.getValue())return"";if(!this.voxelsNode)return"";let e="";e+="\n",e+="// BlendedVolumeStyle\n",e+="\n",e+="uniform float weightConstant1_"+this.getId()+";\n",e+="uniform float weightConstant2_"+this.getId()+";\n",this.weightTransferFunction1Node&&(e+="uniform sampler2D weightTransferFunction1_"+this.getId()+";\n"),this.weightTransferFunction2Node&&(e+="uniform sampler2D weightTransferFunction2_"+this.getId()+";\n"),e+="uniform sampler3D voxels_"+this.getId()+";\n";let t=this.getBrowser().getDefaultBlendedVolumeStyle().getUniformsText();this.renderStyleNode&&(t+=this.renderStyleNode.getUniformsText()),t=t.replace(/x3d_Texture3D\s*\[0\]/g,"voxels_"+this.getId()),e+="\n",e+=t,e+="\n",e+="vec4\n",e+="getBlendedStyle_"+this.getId()+" (in vec4 originalColor, in vec3 texCoord)\n",e+="{\n",e+=" vec4 blendColor_"+this.getId()+" = texture (voxels_"+this.getId()+", texCoord);";let n=this.getBrowser().getDefaultBlendedVolumeStyle().getFunctionsText();switch(this.renderStyleNode&&(n+=this.renderStyleNode.getFunctionsText()),n=n.replace(/textureColor/g,"blendColor_"+this.getId()),e+="\n",e+=n,this._weightFunction1.getValue()){default:e+=" float w1_"+this.getId()+" = weightConstant1_"+this.getId()+";\n";break;case"ALPHA0":e+=" float w1_"+this.getId()+" = originalColor .a;\n";break;case"ALPHA1":e+=" float w1_"+this.getId()+" = blendColor_ "+this.getId()+" .a;\n";break;case"ONE_MINUS_ALPHA0":e+=" float w1_"+this.getId()+" = 1.0 - originalColor .a;\n";break;case"ONE_MINUS_ALPHA1":e+=" float w1_"+this.getId()+" = 1.0 - blendColor_ "+this.getId()+" .a;\n";break;case"TABLE":this.weightTransferFunction1Node?e+=" float w1_"+this.getId()+" = texture (weightTransferFunction1_"+this.getId()+", vec2 (originalColor .a, blendColor_"+this.getId()+" .a)) .r;\n":e+=" float w1_"+this.getId()+" = weightConstant1_"+this.getId()+";\n"}switch(this._weightFunction2.getValue()){default:e+=" float w2_"+this.getId()+" = weightConstant2_"+this.getId()+";\n";break;case"ALPHA0":e+=" float w2_"+this.getId()+" = originalColor .a;\n";break;case"ALPHA1":e+=" float w2_"+this.getId()+" = blendColor_ "+this.getId()+" .a;\n";break;case"ONE_MINUS_ALPHA0":e+=" float w2_"+this.getId()+" = 1.0 - originalColor .a;\n";break;case"ONE_MINUS_ALPHA1":e+=" float w2_"+this.getId()+" = 1.0 - blendColor_ "+this.getId()+" .a;\n";break;case"TABLE":this.weightTransferFunction2Node?e+=" float w2_"+this.getId()+" = texture (weightTransferFunction2_"+this.getId()+", vec2 (originalColor .a, blendColor_"+this.getId()+" .a)) .r;\n":e+=" float w2_"+this.getId()+" = weightConstant2_"+this.getId()+";\n"}return e+="\n",e+=" return clamp (originalColor * w1_"+this.getId()+" + blendColor_"+this.getId()+" * w2_"+this.getId()+", 0.0, 1.0);\n",e+="}\n",e},getFunctionsText(){if(!this._enabled.getValue())return"";if(!this.voxelsNode)return"";let e="";return e+="\n",e+=" // BlendedVolumeStyle\n",e+="\n",e+=" textureColor = getBlendedStyle_"+this.getId()+" (textureColor, texCoord);\n",e}}),Object.defineProperties(z,{typeName:{value:"BlendedVolumeStyle",enumerable:!0},componentInfo:{value:Object.freeze({name:"VolumeRendering",level:3}),enumerable:!0},containerField:{value:"renderStyle",enumerable:!0},specificationRange:{value:Object.freeze({from:"3.3",to:"Infinity"}),enumerable:!0},fieldDefinitions:{value:new(c())([new(u())(g().inputOutput,"metadata",new(l().SFNode)),new(u())(g().inputOutput,"enabled",new(l().SFBool)(!0)),new(u())(g().inputOutput,"weightConstant1",new(l().SFFloat)(.5)),new(u())(g().inputOutput,"weightConstant2",new(l().SFFloat)(.5)),new(u())(g().inputOutput,"weightFunction1",new(l().SFString)("CONSTANT")),new(u())(g().inputOutput,"weightFunction2",new(l().SFString)("CONSTANT")),new(u())(g().inputOutput,"weightTransferFunction1",new(l().SFNode)),new(u())(g().inputOutput,"weightTransferFunction2",new(l().SFNode)),new(u())(g().inputOutput,"renderStyle",new(l().SFNode)),new(u())(g().inputOutput,"voxels",new(l().SFNode))]),enumerable:!0}});const U=z;y().add("BlendedVolumeStyle","x_ite/Components/VolumeRendering/BlendedVolumeStyle",U);const R=U;function X(e){b.call(this,e),this.addType(g().BoundaryEnhancementVolumeStyle)}Object.assign(Object.setPrototypeOf(X.prototype,b.prototype),{addShaderFields(e){this._enabled.getValue()&&(e.addUserDefinedField(g().inputOutput,"retainedOpacity_"+this.getId(),this._retainedOpacity.copy()),e.addUserDefinedField(g().inputOutput,"boundaryOpacity_"+this.getId(),this._boundaryOpacity.copy()),e.addUserDefinedField(g().inputOutput,"opacityFactor_"+this.getId(),this._opacityFactor.copy()))},getUniformsText(){if(!this._enabled.getValue())return"";let e="";return e+="\n",e+="// BoundaryEnhancementVolumeStyle\n",e+="\n",e+="uniform float retainedOpacity_"+this.getId()+";\n",e+="uniform float boundaryOpacity_"+this.getId()+";\n",e+="uniform float opacityFactor_"+this.getId()+";\n",e+="\n",e+="vec4\n",e+="getBoundaryEnhancementStyle_"+this.getId()+" (in vec4 originalColor, in vec3 texCoord)\n",e+="{\n",e+=" float f0 = texture (x3d_Texture3D [0], texCoord) .r;\n",e+=" float f1 = texture (x3d_Texture3D [0], texCoord + vec3 (0.0, 0.0, 1.0 / float (textureSize (x3d_Texture3D [0], 0) .z))) .r;\n",e+=" float f = abs (f0 - f1);\n",e+="\n",e+=" float retainedOpacity = retainedOpacity_"+this.getId()+";\n",e+=" float boundaryOpacity = boundaryOpacity_"+this.getId()+";\n",e+=" float opacityFactor = opacityFactor_"+this.getId()+";\n",e+="\n",e+=" return vec4 (originalColor .rgb, originalColor .a * (retainedOpacity + boundaryOpacity * pow (f, opacityFactor)));\n",e+="}\n",e},getFunctionsText(){if(!this._enabled.getValue())return"";let e="";return e+="\n",e+=" // BoundaryEnhancementVolumeStyle\n",e+="\n",e+=" textureColor = getBoundaryEnhancementStyle_"+this.getId()+" (textureColor, texCoord);\n",e}}),Object.defineProperties(X,{typeName:{value:"BoundaryEnhancementVolumeStyle",enumerable:!0},componentInfo:{value:Object.freeze({name:"VolumeRendering",level:2}),enumerable:!0},containerField:{value:"renderStyle",enumerable:!0},specificationRange:{value:Object.freeze({from:"3.3",to:"Infinity"}),enumerable:!0},fieldDefinitions:{value:new(c())([new(u())(g().inputOutput,"metadata",new(l().SFNode)),new(u())(g().inputOutput,"enabled",new(l().SFBool)(!0)),new(u())(g().inputOutput,"retainedOpacity",new(l().SFFloat)(.2)),new(u())(g().inputOutput,"boundaryOpacity",new(l().SFFloat)(.9)),new(u())(g().inputOutput,"opacityFactor",new(l().SFFloat)(2))]),enumerable:!0}});const L=X;y().add("BoundaryEnhancementVolumeStyle","x_ite/Components/VolumeRendering/BoundaryEnhancementVolumeStyle",L);const A=L;function G(e){b.call(this,e),this.addType(g().CartoonVolumeStyle)}Object.assign(Object.setPrototypeOf(G.prototype,b.prototype),{initialize(){b.prototype.initialize.call(this);this.getBrowser().getContext().getVersion()<2||(this._surfaceNormals.addInterest("set_surfaceNormals__",this),this.set_surfaceNormals__())},set_surfaceNormals__(){this.surfaceNormalsNode=I()(g().X3DTexture3DNode,this._surfaceNormals)},addShaderFields(e){this._enabled.getValue()&&(e.addUserDefinedField(g().inputOutput,"colorSteps_"+this.getId(),this._colorSteps.copy()),e.addUserDefinedField(g().inputOutput,"orthogonalColor_"+this.getId(),this._orthogonalColor.copy()),e.addUserDefinedField(g().inputOutput,"parallelColor_"+this.getId(),this._parallelColor.copy()),this.surfaceNormalsNode&&e.addUserDefinedField(g().inputOutput,"surfaceNormals_"+this.getId(),new(l().SFNode)(this.surfaceNormalsNode)))},getUniformsText(){if(!this._enabled.getValue())return"";let e="";return e+="\n",e+="// CartoonVolumeStyle\n",e+="\n",e+="uniform int colorSteps_"+this.getId()+";\n",e+="uniform vec4 orthogonalColor_"+this.getId()+";\n",e+="uniform vec4 parallelColor_"+this.getId()+";\n",e+=this.getNormalText(this.surfaceNormalsNode),e+="\n",e+="vec3\n",e+="rgb2hsv_"+this.getId()+" (in vec3 color)\n",e+="{\n",e+=" float h = 0.0;\n",e+=" float s = 0.0;\n",e+=" float v = 0.0;\n",e+="\n",e+=" float min = min (min (color .r, color .g), color .b);\n",e+=" float max = max (max (color .r, color .g), color .b);\n",e+=" v = max; // value\n",e+="\n",e+=" float delta = max - min;\n",e+="\n",e+=" if (max != 0.0 && delta != 0.0)\n",e+=" {\n",e+=" s = delta / max; // s\n",e+="\n",e+=" if (color .r == max)\n",e+=" h = (color .g - color .b) / delta; // between yellow & magenta\n",e+=" else if (color .g == max)\n",e+=" h = 2.0 + (color .b - color .r) / delta; // between cyan & yellow\n",e+=" else\n",e+=" h = 4.0 + (color .r - color .g) / delta; // between magenta & cyan\n",e+="\n",e+=" h *= M_PI / 3.0; // radiants\n",e+=" if (h < 0.0)\n",e+=" h += M_PI * 2.0;\n",e+=" }\n",e+=" else\n",e+=" s = h = 0.0; // s = 0, h is undefined\n",e+="\n",e+=" return vec3 (h, s, v);\n",e+="}\n",e+="\n",e+="vec3\n",e+="hsv2rgb_"+this.getId()+" (in vec3 hsv)\n",e+="{\n",e+=" float h = hsv [0];\n",e+=" float s = clamp (hsv [1], 0.0, 1.0);\n",e+=" float v = clamp (hsv [2], 0.0, 1.0);\n",e+="\n",e+=" // H is given on [0, 2 * Pi]. S and V are given on [0, 1].\n",e+=" // RGB are each returned on [0, 1].\n",e+="\n",e+=" if (s == 0.0)\n",e+=" {\n",e+=" // achromatic (grey)\n",e+=" return vec3 (v, v, v);\n",e+=" }\n",e+=" else\n",e+=" {\n",e+=" float w = (h * (180.0 / M_PI)) / 60.0; // sector 0 to 5\n",e+="\n",e+=" float i = floor (w);\n",e+=" float f = w - i; // factorial part of h\n",e+=" float p = v * ( 1.0 - s );\n",e+=" float q = v * ( 1.0 - s * f );\n",e+=" float t = v * ( 1.0 - s * ( 1.0 - f ) );\n",e+="\n",e+=" switch (int (i) % 6)\n",e+=" {\n",e+=" case 0: return vec3 (v, t, p);\n",e+=" case 1: return vec3 (q, v, p);\n",e+=" case 2: return vec3 (p, v, t);\n",e+=" case 3: return vec3 (p, q, v);\n",e+=" case 4: return vec3 (t, p, v);\n",e+=" default: return vec3 (v, p, q);\n",e+=" }\n",e+=" }\n",e+="\n",e+=" return vec3 (0.0);\n",e+="}\n",e+="\n",e+="vec3\n",e+="mix_hsv_"+this.getId()+" (in vec3 a, in vec3 b, in float t)\n",e+="{\n",e+=" // Linearely interpolate in HSV space between source color @a a and destination color @a b by an amount of @a t.\n",e+=" // Source and destination color must be in HSV space.\n",e+="\n",e+=" float ha = a [0];\n",e+=" float sa = a [1];\n",e+=" float va = a [2];\n",e+="\n",e+=" float hb = b [0];\n",e+=" float sb = b [1];\n",e+=" float vb = b [2];\n",e+="\n",e+=" if (sa == 0.0)\n",e+=" ha = hb;\n",e+="\n",e+=" if (sb == 0.0)\n",e+=" hb = ha;\n",e+="\n",e+=" float range = abs (hb - ha);\n",e+="\n",e+=" if (range <= M_PI)\n",e+=" {\n",e+=" float h = ha + t * (hb - ha);\n",e+=" float s = sa + t * (sb - sa);\n",e+=" float v = va + t * (vb - va);\n",e+=" return vec3 (h, s, v);\n",e+=" }\n",e+="\n",e+=" float PI2 = M_PI * 2.0;\n",e+=" float step = (PI2 - range) * t;\n",e+=" float h = ha < hb ? ha - step : ha + step;\n",e+="\n",e+=" if (h < 0.0)\n",e+=" h += PI2;\n",e+="\n",e+=" else if (h > PI2)\n",e+=" h -= PI2;\n",e+="\n",e+=" float s = sa + t * (sb - sa);\n",e+=" float v = va + t * (vb - va);\n",e+=" return vec3 (h, s, v);\n",e+="}\n",e+="\n",e+="vec4\n",e+="getCartoonStyle_"+this.getId()+" (in vec4 originalColor, vec3 texCoord)\n",e+="{\n",e+=" vec4 surfaceNormal = getNormal_"+this.getId()+" (texCoord);\n",e+="\n",e+=" if (surfaceNormal .w == 0.0)\n",e+=" return vec4 (0.0);\n",e+="\n",e+=" vec4 orthogonalColor = orthogonalColor_"+this.getId()+";\n",e+=" vec4 parallelColor = parallelColor_"+this.getId()+";\n",e+=" int colorSteps = colorSteps_"+this.getId()+";\n",e+="\n",e+=" float steps = clamp (float (colorSteps), 1.0, 64.0);\n",e+=" float step = M_PI / 2.0 / steps;\n",e+=" float cosTheta = min (dot (surfaceNormal .xyz, normalize (vertex)), 1.0);\n",e+="\n",e+=" if (cosTheta < 0.0)\n",e+=" return vec4 (0.0);\n",e+="\n",e+=" float t = cos (min (floor (acos (cosTheta) / step) * (steps > 1.0 ? steps / (steps - 1.0) : 1.0), steps) * step);\n",e+=" vec3 orthogonalHSV = rgb2hsv_"+this.getId()+" (orthogonalColor .rgb);\n",e+=" vec3 parallelHSV = rgb2hsv_"+this.getId()+" (parallelColor .rgb);\n",e+="\n",e+=" return vec4 (hsv2rgb_"+this.getId()+" (mix_hsv_"+this.getId()+" (orthogonalHSV, parallelHSV, t)), originalColor .a);\n",e+="}\n",e},getFunctionsText(){if(!this._enabled.getValue())return"";let e="";return e+="\n",e+=" // CartoonVolumeStyle\n",e+="\n",e+=" textureColor = getCartoonStyle_"+this.getId()+" (textureColor, texCoord);\n",e}}),Object.defineProperties(G,{typeName:{value:"CartoonVolumeStyle",enumerable:!0},componentInfo:{value:Object.freeze({name:"VolumeRendering",level:3}),enumerable:!0},containerField:{value:"renderStyle",enumerable:!0},specificationRange:{value:Object.freeze({from:"3.3",to:"Infinity"}),enumerable:!0},fieldDefinitions:{value:new(c())([new(u())(g().inputOutput,"metadata",new(l().SFNode)),new(u())(g().inputOutput,"enabled",new(l().SFBool)(!0)),new(u())(g().inputOutput,"colorSteps",new(l().SFInt32)(4)),new(u())(g().inputOutput,"orthogonalColor",new(l().SFColorRGBA)(1,1,1,1)),new(u())(g().inputOutput,"parallelColor",new(l().SFColorRGBA)(0,0,0,1)),new(u())(g().inputOutput,"surfaceNormals",new(l().SFNode))]),enumerable:!0}});const q=G;y().add("CartoonVolumeStyle","x_ite/Components/VolumeRendering/CartoonVolumeStyle",q);const H=q;function k(e){b.call(this,e),this.addType(g().ComposedVolumeStyle),this.renderStyleNodes=[]}Object.assign(Object.setPrototypeOf(k.prototype,b.prototype),{initialize(){b.prototype.initialize.call(this);this.getBrowser().getContext().getVersion()<2||(this._renderStyle.addInterest("set_renderStyle__",this),this.set_renderStyle__())},addVolumeData(e){b.prototype.addVolumeData.call(this,e);for(const t of this.renderStyleNodes)t.addVolumeData(e)},removeVolumeData(e){b.prototype.removeVolumeData.call(this,e);for(const t of this.renderStyleNodes)t.removeVolumeData(e)},set_renderStyle__(){const e=this.renderStyleNodes;for(const t of e){t.removeInterest("addNodeEvent",this);for(const e of this.getVolumeData())t.removeVolumeData(e)}e.length=0;for(const t of this._renderStyle){const n=I()(g().X3DComposableVolumeRenderStyleNode,t);n&&e.push(n)}for(const t of e){t.addInterest("addNodeEvent",this);for(const e of this.getVolumeData())t.addVolumeData(e)}},addShaderFields(e){if(this._enabled.getValue())for(const t of this.renderStyleNodes)t.addShaderFields(e)},getUniformsText(){if(!this._enabled.getValue())return"";let e="";for(const t of this.renderStyleNodes)e+=t.getUniformsText();e+="\n",e+="vec4\n",e+="getComposedStyle_"+this.getId()+" (in vec4 textureColor, in vec3 texCoord)\n",e+="{\n";for(const t of this.renderStyleNodes)e+=t.getFunctionsText();return e+="\n",e+=" return textureColor;\n",e+="}\n",e},getFunctionsText(){if(!this._enabled.getValue())return"";let e="";return e+="\n",e+=" // ComposedVolumeStyle\n",e+="\n",e+=" textureColor = getComposedStyle_"+this.getId()+" (textureColor, texCoord);\n",e}}),Object.defineProperties(k,{typeName:{value:"ComposedVolumeStyle",enumerable:!0},componentInfo:{value:Object.freeze({name:"VolumeRendering",level:3}),enumerable:!0},containerField:{value:"renderStyle",enumerable:!0},specificationRange:{value:Object.freeze({from:"3.3",to:"Infinity"}),enumerable:!0},fieldDefinitions:{value:new(c())([new(u())(g().inputOutput,"metadata",new(l().SFNode)),new(u())(g().inputOutput,"enabled",new(l().SFBool)(!0)),new(u())(g().inputOutput,"renderStyle",new(l().MFNode))]),enumerable:!0}});const Y=k;y().add("ComposedVolumeStyle","x_ite/Components/VolumeRendering/ComposedVolumeStyle",Y);const Q=Y;function W(e){b.call(this,e),this.addType(g().EdgeEnhancementVolumeStyle)}Object.assign(Object.setPrototypeOf(W.prototype,b.prototype),{initialize(){b.prototype.initialize.call(this);this.getBrowser().getContext().getVersion()<2||(this._surfaceNormals.addInterest("set_surfaceNormals__",this),this.set_surfaceNormals__())},set_surfaceNormals__(){this.surfaceNormalsNode=I()(g().X3DTexture3DNode,this._surfaceNormals)},addShaderFields(e){this._enabled.getValue()&&(e.addUserDefinedField(g().inputOutput,"edgeColor_"+this.getId(),this._edgeColor.copy()),e.addUserDefinedField(g().inputOutput,"gradientThreshold_"+this.getId(),this._gradientThreshold.copy()),this.surfaceNormalsNode&&e.addUserDefinedField(g().inputOutput,"surfaceNormals_"+this.getId(),new(l().SFNode)(this.surfaceNormalsNode)))},getUniformsText(){if(!this._enabled.getValue())return"";let e="";return e+="\n",e+="// EdgeEnhancementVolumeStyle\n",e+="\n",e+="uniform vec4 edgeColor_"+this.getId()+";\n",e+="uniform float gradientThreshold_"+this.getId()+";\n",e+=this.getNormalText(this.surfaceNormalsNode),e+="\n",e+="vec4\n",e+="getEdgeEnhacementStyle_"+this.getId()+" (in vec4 originalColor, in vec3 texCoord)\n",e+="{\n",e+=" vec4 surfaceNormal = getNormal_"+this.getId()+" (texCoord);\n",e+="\n",e+=" if (surfaceNormal .w == 0.0)\n",e+=" return vec4 (0.0);\n",e+="\n",e+=" vec4 edgeColor = edgeColor_"+this.getId()+";\n",e+=" float gradientThreshold = gradientThreshold_"+this.getId()+";\n",e+="\n",e+=" float angle = abs (dot (surfaceNormal .xyz, normalize (vertex)));\n",e+="\n",e+=" if (angle >= cos (gradientThreshold))\n",e+=" return originalColor;\n",e+=" else\n",e+=" return vec4 (mix (edgeColor .rgb, originalColor.rgb, angle), originalColor .a);\n",e+="}\n",e},getFunctionsText(){if(!this._enabled.getValue())return"";let e="";return e+="\n",e+=" // EdgeEnhancementVolumeStyle\n",e+="\n",e+=" textureColor = getEdgeEnhacementStyle_"+this.getId()+" (textureColor, texCoord);\n",e}}),Object.defineProperties(W,{typeName:{value:"EdgeEnhancementVolumeStyle",enumerable:!0},componentInfo:{value:Object.freeze({name:"VolumeRendering",level:2}),enumerable:!0},containerField:{value:"renderStyle",enumerable:!0},specificationRange:{value:Object.freeze({from:"3.3",to:"Infinity"}),enumerable:!0},fieldDefinitions:{value:new(c())([new(u())(g().inputOutput,"metadata",new(l().SFNode)),new(u())(g().inputOutput,"enabled",new(l().SFBool)(!0)),new(u())(g().inputOutput,"edgeColor",new(l().SFColorRGBA)(0,0,0,1)),new(u())(g().inputOutput,"gradientThreshold",new(l().SFFloat)(.4)),new(u())(g().inputOutput,"surfaceNormals",new(l().SFNode))]),enumerable:!0}});const K=W;y().add("EdgeEnhancementVolumeStyle","x_ite/Components/VolumeRendering/EdgeEnhancementVolumeStyle",K);const $=K,Z=window[Symbol.for("X_ITE.X3D-10.1.0")].require("x_ite/Components/Core/X3DChildNode");var J=e.n(Z);const ee=window[Symbol.for("X_ITE.X3D-10.1.0")].require("x_ite/Components/Grouping/X3DBoundedObject");var te=e.n(ee);const ne=window[Symbol.for("X_ITE.X3D-10.1.0")].require("x_ite/Browser/Core/TextureQuality");var oe=e.n(ne);const re=window[Symbol.for("X_ITE.X3D-10.1.0")].require("x_ite/Components/Shape/UnlitMaterial");var ie=e.n(re);const se="#version 300 es\nprecision highp float;precision highp int;uniform mat4 x3d_ProjectionMatrix;uniform mat4 x3d_ModelViewMatrix;uniform mat4 x3d_TextureMatrix[1];in vec4 x3d_TexCoord0;in vec4 x3d_Vertex;out vec3 vertex;out vec4 texCoord;void main(){vec4 position=x3d_ModelViewMatrix*x3d_Vertex;vertex=position.xyz;texCoord=x3d_TextureMatrix[0]*x3d_TexCoord0;gl_Position=x3d_ProjectionMatrix*position;}";y().add("VolumeStyle.vs","x_ite/Browser/VolumeRendering/VolumeStyle.vs",se);const ae=se,le='#version 300 es\nprecision highp float;precision highp int;precision highp sampler3D;in vec3 vertex;in vec4 texCoord;uniform sampler3D x3d_Texture3D[1];uniform mat3 x3d_TextureNormalMatrix;uniform x3d_LightSourceParameters x3d_LightSource[x3d_MaxLights];const float M_PI=3.14159265359;\n#pragma X3D include "includes/ClipPlanes.glsl"\n#pragma X3D include "includes/Fog.glsl"\n__VOLUME_STYLES_UNIFORMS__ out vec4 x3d_FragColor;vec4 getTextureColor(in vec3 texCoord){if(any(greaterThan(abs(texCoord-0.5),vec3(0.5))))discard;vec4 textureColor=texture(x3d_Texture3D[0],texCoord);__VOLUME_STYLES_FUNCTIONS__ return textureColor;}void main(){\n#if defined(X3D_CLIP_PLANES)\nclip();\n#endif\nvec4 finalColor=getTextureColor(texCoord.stp/texCoord.q);\n#if defined(X3D_FOG)\nfinalColor.rgb=getFogColor(finalColor.rgb);\n#endif\nx3d_FragColor=finalColor;}';y().add("VolumeStyle.fs","x_ite/Browser/VolumeRendering/VolumeStyle.fs",le);const de=le;function ue(e,t){ie().call(this,e),this.volumeDataNode=t,this.volumeShaderNodes=new Map}Object.assign(Object.setPrototypeOf(ue.prototype,ie().prototype),{getVolumeShaders(){return this.volumeShaderNodes},getShader(e,t){const{renderObject:n,fogNode:o,localObjectsKeys:r}=t;let i="";return i+=n.getRenderAndGlobalLightsKey(),i+=o?.getFogType()??0,i+=".",i+=r.sort().join(""),this.volumeShaderNodes.get(i)??this.createShader(i,e,t)},createShader(e,t,n){const o=this.getBrowser(),r=[],{renderObject:i,fogNode:s,localObjectsKeys:a}=n,l=a.concat(i.getGlobalLightsKeys());switch(s?.getFogType()){case 1:r.push("X3D_FOG","X3D_FOG_LINEAR");break;case 2:r.push("X3D_FOG","X3D_FOG_EXPONENTIAL")}const d=l.reduce(((e,t)=>e+(0===t)),0),u=l.reduce(((e,t)=>e+(1===t)),0);d&&(r.push("X3D_CLIP_PLANES"),r.push(`X3D_NUM_CLIP_PLANES ${Math.min(d,o.getMaxClipPlanes())}`)),u&&(r.push("X3D_LIGHTING"),r.push(`X3D_NUM_LIGHTS ${Math.min(u,o.getMaxLights())}`));const h=this.volumeDataNode.createShader(r,ae,de);return this.volumeShaderNodes.set(e,h),h},setShaderUniforms(e,t,n,o,r){this.volumeDataNode.setShaderUniforms(e,t)}}),Object.defineProperties(ue,{typeName:{value:"VolumeMaterial",enumerable:!0},componentInfo:{value:Object.freeze({name:"Shape",level:1}),enumerable:!0},containerField:{value:"material",enumerable:!0},fieldDefinitions:{value:ie().fieldDefinitions}});const he=ue;y().add("VolumeMaterial","x_ite/Browser/VolumeRendering/VolumeMaterial",he);const ce=he,me=window[Symbol.for("X_ITE.X3D-10.1.0")].require("standard/Math/Numbers/Vector3");var pe=e.n(me);const fe=window[Symbol.for("X_ITE.X3D-10.1.0")].require("standard/Math/Numbers/Matrix4");var ge=e.n(fe);function _e(e){J().call(this,e),te().call(this,e),this.addType(g().X3DVolumeDataNode);const t=this.getBrowser();this.proximitySensorNode=t.getPrivateScene().createNode("ProximitySensor",!1),this.transformNode=t.getPrivateScene().createNode("Transform",!1),this.shapeNode=t.getPrivateScene().createNode("Shape",!1),this.appearanceNode=t.getPrivateScene().createNode("Appearance",!1),this.textureTransformNode=t.getPrivateScene().createNode("TextureTransform3D",!1),this.geometryNode=t.getPrivateScene().createNode("QuadSet",!1),this.textureCoordinateNode=t.getPrivateScene().createNode("TextureCoordinate3D",!1),this.coordinateNode=t.getPrivateScene().createNode("Coordinate",!1),this.volumeMaterialNode=new ce(t.getPrivateScene(),this),this.textureNormalMatrixArray=new Float32Array(9),this.setCameraObject(!0)}Object.assign(Object.setPrototypeOf(_e.prototype,J().prototype),te().prototype,{initialize(){J().prototype.initialize.call(this),te().prototype.initialize.call(this);const e=this.getBrowser().getContext();this._bboxDisplay.addFieldInterest(this.transformNode._bboxDisplay),this.proximitySensorNode._size=new(l().SFVec3f)(-1,-1,-1),this.transformNode._children=new(l().MFNode)(this.shapeNode),this.shapeNode._appearance=this.appearanceNode,this.shapeNode._geometry=this.geometryNode,this.appearanceNode._alphaMode="BLEND",this.appearanceNode._material=this.volumeMaterialNode,this.appearanceNode._textureTransform=this.textureTransformNode,this.textureTransformNode._translation=new(l().SFVec3f)(.5,.5,.5),this.textureTransformNode._center=new(l().SFVec3f)(-.5,-.5,-.5),this.geometryNode._texCoord=this.textureCoordinateNode,this.geometryNode._coord=this.coordinateNode,this.coordinateNode.setPrivate(!0),this.textureCoordinateNode.setPrivate(!0),this.geometryNode.setPrivate(!0),this.textureTransformNode.setPrivate(!0),this.volumeMaterialNode.setPrivate(!0),this.appearanceNode.setPrivate(!0),this.shapeNode.setPrivate(!0),this.transformNode.setPrivate(!0),this.proximitySensorNode.setPrivate(!0),this.coordinateNode.setup(),this.textureCoordinateNode.setup(),this.geometryNode.setup(),this.textureTransformNode.setup(),this.volumeMaterialNode.setup(),this.appearanceNode.setup(),this.shapeNode.setup(),this.transformNode.setup(),this.proximitySensorNode.setup(),this.proximitySensorNode._orientation_changed.addFieldInterest(this.transformNode._rotation),this.proximitySensorNode._orientation_changed.addFieldInterest(this.textureTransformNode._rotation),e.getVersion()<2||(this.getLive().addInterest("set_live__",this),this._dimensions.addInterest("set_dimensions__",this),this.textureTransformNode.addInterest("set_textureTransform__",this),this.set_live__(),this.set_dimensions__(),this.set_textureTransform__())},getBBox(e,t){return this._bboxSize.getValue().equals(this.getDefaultBBoxSize())?e.set(this._dimensions.getValue(),pe().Zero):e.set(this._bboxSize.getValue(),this._bboxCenter.getValue())},getAppearance(){return this.appearanceNode},updateShader(){this.volumeMaterialNode.getVolumeShaders().clear()},addShaderUniformNames(e){e.push("x3d_TextureNormalMatrix")},getNumPlanes(){switch(this.getBrowser().getBrowserOptions().getTextureQuality()){case oe().LOW:return 200;case oe().MEDIUM:return 400;case oe().HIGH:return 600}return 200},set_live__(){const e=this.isLive()&&this.getBrowser().getBrowserOption("AlwaysUpdateGeometries");this.getLive().getValue()||e?this.getBrowser().getBrowserOptions()._TextureQuality.addInterest("set_dimensions__",this):this.getBrowser().getBrowserOptions()._TextureQuality.removeInterest("set_dimensions__",this)},set_dimensions__(){const e=this.getNumPlanes(),t=this._dimensions.getValue().magnitude(),n=t/2,o=[];this.coordinateNode._point.length=0;for(let r=0;r<e;++r){const i=r/(e-1)-.5;o.push(n,n,t*i,-n,n,t*i,-n,-n,t*i,n,-n,t*i)}this.coordinateNode._point=o,this.textureCoordinateNode._point=o,this.textureTransformNode._scale=new(l().SFVec3f)(1/this._dimensions.x,1/this._dimensions.y,1/this._dimensions.z)},set_textureTransform__(){this.textureNormalMatrixArray.set(new(ge())(...this.textureTransformNode.getMatrix()).submatrix.inverse())},traverse(e,t){this.proximitySensorNode.traverse(e,t),this.transformNode.traverse(e,t)},setShaderUniforms(e,t){e.uniformMatrix3fv(t.x3d_TextureNormalMatrix,!0,this.textureNormalMatrixArray)},dispose(){te().prototype.dispose.call(this),J().prototype.dispose.call(this)}}),Object.defineProperties(_e,{typeName:{value:"X3DVolumeDataNode",enumerable:!0},componentInfo:{value:Object.freeze({name:"VolumeRendering",level:1}),enumerable:!0}});const ye=_e;y().add("X3DVolumeDataNode","x_ite/Components/VolumeRendering/X3DVolumeDataNode",ye);const Se=ye,xe=window[Symbol.for("X_ITE.X3D-10.1.0")].require("x_ite/Components/Shaders/ComposedShader");var Ne=e.n(xe);const ve=window[Symbol.for("X_ITE.X3D-10.1.0")].require("x_ite/Components/Shaders/ShaderPart");var we=e.n(ve);function be(e){Se.call(this,e),this.addType(g().IsoSurfaceVolumeData),this.renderStyleNodes=[]}Object.assign(Object.setPrototypeOf(be.prototype,Se.prototype),{initialize(){Se.prototype.initialize.call(this);this.getBrowser().getContext().getVersion()<2||(this._gradients.addInterest("set_gradients__",this),this._renderStyle.addInterest("set_renderStyle__",this),this._contourStepSize.addInterest("updateShader",this),this._surfaceValues.addInterest("updateShader",this),this._surfaceTolerance.addInterest("updateShader",this),this._renderStyle.addInterest("updateShader",this),this.set_gradients__(),this.set_renderStyle__(),this.set_voxels__(),this.updateShader())},set_gradients__(){this.gradientsNode=I()(g().X3DTexture3DNode,this._gradients)},set_renderStyle__(){const e=this.renderStyleNodes;for(const t of e)t.removeInterest("updateShader",this),t.removeVolumeData(this);e.length=0;for(const t of this._renderStyle){const n=I()(g().X3DComposableVolumeRenderStyleNode,t);n&&e.push(n)}for(const t of e)t.addInterest("updateShader",this),t.addVolumeData(this)},set_voxels__(){this.voxelsNode=I()(g().X3DTexture3DNode,this._voxels),this.voxelsNode?this.getAppearance()._texture=this._voxels:this.getAppearance()._texture=this.getBrowser().getDefaultVoxels()},createShader(e,t,n){const o=this.getBrowser().getDefaultVolumeStyle();let r=o.getUniformsText(),i=o.getFunctionsText();r+="\n",r+="uniform float surfaceValues ["+this._surfaceValues.length+"];\n",r+="uniform float surfaceTolerance;\n";for(const e of this.renderStyleNodes)r+=e.getUniformsText();if(i+="\n",i+=" // IsoSurfaceVolumeData\n",i+="\n",this.gradientsNode?(r+="\n",r+="uniform sampler3D gradients;\n",i+=" if (length (texture (gradients, texCoord) .xyz * 2.0 - 1.0) < surfaceTolerance)\n",i+=" discard;\n"):(r+="\n",r+="vec4\n",r+="getNormal (in vec3 texCoord)\n",r+="{\n",r+=" vec4 offset = vec4 (1.0 / vec3 (textureSize (x3d_Texture3D [0], 0)), 0.0);\n",r+=" float i0 = texture (x3d_Texture3D [0], texCoord + offset .xww) .r;\n",r+=" float i1 = texture (x3d_Texture3D [0], texCoord - offset .xww) .r;\n",r+=" float i2 = texture (x3d_Texture3D [0], texCoord + offset .wyw) .r;\n",r+=" float i3 = texture (x3d_Texture3D [0], texCoord - offset .wyw) .r;\n",r+=" float i4 = texture (x3d_Texture3D [0], texCoord + offset .wwz) .r;\n",r+=" float i5 = texture (x3d_Texture3D [0], texCoord - offset .wwz) .r;\n",r+=" vec3 n = vec3 (i1 - i0, i3 - i2, i5 - i4);\n",r+="\n",r+=" return vec4 (normalize (x3d_TextureNormalMatrix * n), length (n));\n",r+="}\n",i+=" if (getNormal (texCoord) .w < surfaceTolerance)\n",i+=" discard;\n"),i+="\n",i+=" float intensity = textureColor .r;\n",i+="\n",1===this._surfaceValues.length){const e=Math.abs(this._contourStepSize.getValue());if(0===e)i+=" if (intensity > surfaceValues [0])\n",i+=" {\n",i+=" textureColor = vec4 (vec3 (surfaceValues [0]), 1.0);\n",this.renderStyleNodes.length&&(i+=this.renderStyleNodes[0].getFunctionsText()),i+=" }\n",i+=" else\n",i+=" {\n",i+=" discard;\n",i+=" }\n",i+="\n";else{const t=[];for(let n=this._surfaceValues[0]-e;n>0;n-=e)t.unshift(n);t.push(this._surfaceValues[0]);for(let n=this._surfaceValues[0]+e;n<1;n+=e)t.push(n);i+=" if (false)\n",i+=" { }\n";for(let e=this._surfaceValues.length-1;e>=0;--e)i+=" else if (intensity > "+t[e]+")\n",i+=" {\n",i+=" textureColor = vec4 (vec3 ("+t[e]+"), 1.0);\n",this.renderStyleNodes.length&&(i+=this.renderStyleNodes[0].getFunctionsText()),i+=" }\n";i+=" else\n",i+=" {\n",i+=" discard;\n",i+=" }\n",i+="\n"}}else{i+=" if (false)\n",i+=" { }\n";for(let e=this._surfaceValues.length-1;e>=0;--e){if(i+=" else if (intensity > surfaceValues ["+e+"])\n",i+=" {\n",i+=" textureColor = vec4 (vec3 (surfaceValues ["+e+"]), 1.0);\n",this.renderStyleNodes.length){const t=Math.min(e,this.renderStyleNodes.length-1);i+=this.renderStyleNodes[t].getFunctionsText()}i+=" }\n"}i+=" else\n",i+=" {\n",i+=" discard;\n",i+=" }\n",i+="\n"}n=n.replace(/__VOLUME_STYLES_UNIFORMS__/,r).replace(/__VOLUME_STYLES_FUNCTIONS__/,i);const s=new(we())(this.getExecutionContext());s._url.push(encodeURI("data:x-shader/x-vertex,"+t)),s.setPrivate(!0),s.setName("VolumeDataVertexShader"),s.setOptions(e),s.setup();const a=new(we())(this.getExecutionContext());a._type="FRAGMENT",a._url.push(encodeURI("data:x-shader/x-fragment,"+n)),a.setPrivate(!0),a.setName("VolumeDataFragmentShader"),a.setOptions(e),a.setup();const d=new(Ne())(this.getExecutionContext());d._language="GLSL",d._parts.push(s),d._parts.push(a),d.setPrivate(!0),d.setName("VolumeDataShader"),d.addUserDefinedField(g().inputOutput,"surfaceValues",this._surfaceValues.copy()),d.addUserDefinedField(g().inputOutput,"surfaceTolerance",this._surfaceTolerance.copy()),this.gradientsNode&&d.addUserDefinedField(g().inputOutput,"gradients",new(l().SFNode)(this.gradientsNode)),o.addShaderFields(d);for(const e of this.renderStyleNodes)e.addShaderFields(d);const u=[];return this.addShaderUniformNames(u),d.setUniformNames(u),d.setup(),d}}),Object.defineProperties(be,{typeName:{value:"IsoSurfaceVolumeData",enumerable:!0},componentInfo:{value:Object.freeze({name:"VolumeRendering",level:2}),enumerable:!0},containerField:{value:"children",enumerable:!0},specificationRange:{value:Object.freeze({from:"3.3",to:"Infinity"}),enumerable:!0},fieldDefinitions:{value:new(c())([new(u())(g().inputOutput,"metadata",new(l().SFNode)),new(u())(g().inputOutput,"dimensions",new(l().SFVec3f)(1,1,1)),new(u())(g().inputOutput,"contourStepSize",new(l().SFFloat)),new(u())(g().inputOutput,"surfaceValues",new(l().MFFloat)),new(u())(g().inputOutput,"surfaceTolerance",new(l().SFFloat)),new(u())(g().inputOutput,"visible",new(l().SFBool)(!0)),new(u())(g().inputOutput,"bboxDisplay",new(l().SFBool)),new(u())(g().initializeOnly,"bboxSize",new(l().SFVec3f)(-1,-1,-1)),new(u())(g().initializeOnly,"bboxCenter",new(l().SFVec3f)),new(u())(g().inputOutput,"renderStyle",new(l().MFNode)),new(u())(g().inputOutput,"gradients",new(l().SFNode)),new(u())(g().inputOutput,"voxels",new(l().SFNode))]),enumerable:!0}});const Ce=be;y().add("IsoSurfaceVolumeData","x_ite/Components/VolumeRendering/IsoSurfaceVolumeData",Ce);const Ie=Ce;function Fe(e){N.call(this,e),this.addType(g().ProjectionVolumeStyle)}Object.assign(Object.setPrototypeOf(Fe.prototype,N.prototype),{addShaderFields(e){this._enabled.getValue()&&e.addUserDefinedField(g().inputOutput,"intensityThreshold_"+this.getId(),this._intensityThreshold.copy())},getUniformsText(){if(!this._enabled.getValue())return"";let e="";switch(e+="\n",e+="// ProjectionVolumeStyle\n",e+="\n",e+="uniform float intensityThreshold_"+this.getId()+";\n",e+="\n",e+="vec4\n",e+="getProjectionStyle_"+this.getId()+"(in vec4 originalColor, in vec3 texCoord)\n",e+="{\n",this._type.getValue()){default:case"MAX":case"AVERAGE":e+=" float projectionColor = 0.0;\n";break;case"MIN":e+=" float projectionColor = 1.0;\n"}switch(e+=" const int samples = 32;\n",e+=" vec3 step = normalize (x3d_TextureNormalMatrix * vec3 (0.0, 0.0, 1.0)) / float (samples);\n",e+=" vec3 ray = texCoord - step * float (samples) * 0.5;\n",e+=" bool first = false;\n",e+="\n",e+=" for (int i = 0; i < samples; ++ i, ray += step)\n",e+=" {\n",e+=" if (ray .s < 0.0 || ray .s > 1.0)\n",e+=" continue;\n",e+="\n",e+=" if (ray .t < 0.0 || ray .t > 1.0)\n",e+=" continue;\n",e+="\n",e+=" if (ray .p < 0.0 || ray .p > 1.0)\n",e+=" continue;\n",e+="\n",e+=" float intensity = texture (x3d_Texture3D [0], ray) .r;\n",e+="\n",this._type.getValue()){default:case"MAX":e+=" if (intensity < intensityThreshold_"+this.getId()+")\n",e+=" continue;\n",e+="\n",e+=" if (intensityThreshold_"+this.getId()+" > 0.0 && first)\n",e+=" break;\n",e+="\n",e+=" if (intensity <= projectionColor)\n",e+=" {\n",e+=" first = true;\n",e+=" continue;\n",e+=" }\n",e+="\n",e+=" projectionColor = intensity;\n";break;case"MIN":e+=" if (intensity < intensityThreshold_"+this.getId()+")\n",e+=" continue;\n",e+="\n",e+=" if (intensityThreshold_"+this.getId()+" > 0.0 && first)\n",e+=" break;\n",e+="\n",e+=" if (intensity >= projectionColor)\n",e+=" {\n",e+=" first = true;\n",e+=" continue;\n",e+=" }\n",e+="\n",e+=" projectionColor = intensity;\n";break;case"AVERAGE":e+=" projectionColor += intensity;\n"}return e+=" }\n",e+="\n","AVERAGE"===this._type.getValue()&&(e+=" projectionColor /= float (samples);\n"),e+=" return vec4 (vec3 (projectionColor), originalColor .a);\n",e+="}\n",e},getFunctionsText(){if(!this._enabled.getValue())return"";let e="";return e+="\n",e+=" // ProjectionVolumeStyle\n",e+="\n",e+=" textureColor = getProjectionStyle_"+this.getId()+" (textureColor, texCoord);\n",e}}),Object.defineProperties(Fe,{typeName:{value:"ProjectionVolumeStyle",enumerable:!0},componentInfo:{value:Object.freeze({name:"VolumeRendering",level:2}),enumerable:!0},containerField:{value:"renderStyle",enumerable:!0},specificationRange:{value:Object.freeze({from:"3.3",to:"Infinity"}),enumerable:!0},fieldDefinitions:{value:new(c())([new(u())(g().inputOutput,"metadata",new(l().SFNode)),new(u())(g().inputOutput,"enabled",new(l().SFBool)(!0)),new(u())(g().inputOutput,"type",new(l().SFString)("MAX")),new(u())(g().inputOutput,"intensityThreshold",new(l().SFFloat))]),enumerable:!0}});const Oe=Fe;y().add("ProjectionVolumeStyle","x_ite/Components/VolumeRendering/ProjectionVolumeStyle",Oe);const Ve=Oe;function De(e){Se.call(this,e),this.addType(g().SegmentedVolumeData),this.segmentIdentifiersNode=null,this.renderStyleNodes=[]}Object.assign(Object.setPrototypeOf(De.prototype,Se.prototype),{initialize(){Se.prototype.initialize.call(this);this.getBrowser().getContext().getVersion()<2||(this._segmentIdentifiers.addInterest("set_segmentIdentifiers__",this),this._renderStyle.addInterest("set_renderStyle__",this),this._segmentEnabled.addInterest("updateShader",this),this._segmentIdentifiers.addInterest("updateShader",this),this._renderStyle.addInterest("updateShader",this),this.set_segmentIdentifiers__(),this.set_renderStyle__(),this.set_voxels__(),this.updateShader())},getSegmentEnabled(e){return!(e<this._segmentEnabled.length)||this._segmentEnabled[e]},set_segmentIdentifiers__(){this.segmentIdentifiersNode=I()(g().X3DTexture3DNode,this._segmentIdentifiers)},set_renderStyle__(){const e=this.renderStyleNodes;for(const t of e)t.removeInterest("updateShader",this),t.removeVolumeData(this);e.length=0;for(const t of this._renderStyle){const n=I()(g().X3DComposableVolumeRenderStyleNode,t);n&&e.push(n)}for(const t of e)t.addInterest("updateShader",this),t.addVolumeData(this)},set_voxels__(){this.voxelsNode=I()(g().X3DTexture3DNode,this._voxels),this.voxelsNode?this.getAppearance()._texture=this._voxels:this.getAppearance()._texture=this.getBrowser().getDefaultVoxels()},createShader(e,t,n){const o=this.getBrowser().getDefaultVolumeStyle();let r=o.getUniformsText(),i=o.getFunctionsText();if(this.segmentIdentifiersNode?(r+="\n",r+="uniform sampler3D segmentIdentifiers;\n",r+="\n",i+="\n",i+=" int segment = int (texture (segmentIdentifiers, texCoord) .r * 255.0);\n"):i+=" int segment = 0;\n",this.renderStyleNodes.length){i+="\n",i+=" switch (segment)\n",i+=" {\n";for(const[e,t]of this.renderStyleNodes.entries())i+=" case "+e+":\n",i+=" {\n",this.getSegmentEnabled(e)?(r+=t.getUniformsText(),i+=t.getFunctionsText(),i+=" break;\n"):i+=" discard;\n",i+=" }\n";i+=" }\n"}n=n.replace(/__VOLUME_STYLES_UNIFORMS__/,r).replace(/__VOLUME_STYLES_FUNCTIONS__/,i);const s=new(we())(this.getExecutionContext());s._url.push(encodeURI("data:x-shader/x-vertex,"+t)),s.setPrivate(!0),s.setName("SegmentedVolumeDataVertexShader"),s.setOptions(e),s.setup();const a=new(we())(this.getExecutionContext());a._type="FRAGMENT",a._url.push(encodeURI("data:x-shader/x-fragment,"+n)),a.setPrivate(!0),a.setName("SegmentedVolumeDataFragmentShader"),a.setOptions(e),a.setup();const d=new(Ne())(this.getExecutionContext());d._language="GLSL",d._parts.push(s),d._parts.push(a),d.setPrivate(!0),d.setName("SegmentedVolumeDataShader"),this.segmentIdentifiersNode&&d.addUserDefinedField(g().inputOutput,"segmentIdentifiers",new(l().SFNode)(this.segmentIdentifiersNode)),o.addShaderFields(d);for(const[e,t]of this.renderStyleNodes.entries())this.getSegmentEnabled(e)&&t.addShaderFields(d);const u=[];return this.addShaderUniformNames(u),d.setUniformNames(u),d.setup(),d}}),Object.defineProperties(De,{typeName:{value:"SegmentedVolumeData",enumerable:!0},componentInfo:{value:Object.freeze({name:"VolumeRendering",level:2}),enumerable:!0},containerField:{value:"children",enumerable:!0},specificationRange:{value:Object.freeze({from:"3.3",to:"Infinity"}),enumerable:!0},fieldDefinitions:{value:new(c())([new(u())(g().inputOutput,"metadata",new(l().SFNode)),new(u())(g().inputOutput,"dimensions",new(l().SFVec3f)(1,1,1)),new(u())(g().inputOutput,"segmentEnabled",new(l().MFBool)),new(u())(g().inputOutput,"visible",new(l().SFBool)(!0)),new(u())(g().inputOutput,"bboxDisplay",new(l().SFBool)),new(u())(g().initializeOnly,"bboxSize",new(l().SFVec3f)(-1,-1,-1)),new(u())(g().initializeOnly,"bboxCenter",new(l().SFVec3f)),new(u())(g().inputOutput,"segmentIdentifiers",new(l().SFNode)),new(u())(g().inputOutput,"renderStyle",new(l().MFNode)),new(u())(g().inputOutput,"voxels",new(l().SFNode))]),enumerable:!0}});const Te=De;y().add("SegmentedVolumeData","x_ite/Components/VolumeRendering/SegmentedVolumeData",Te);const Pe=Te;function Ee(e){b.call(this,e),this.addType(g().ShadedVolumeStyle)}Object.assign(Object.setPrototypeOf(Ee.prototype,b.prototype),{initialize(){b.prototype.initialize.call(this);this.getBrowser().getContext().getVersion()<2||(this._material.addInterest("set_material__",this),this._surfaceNormals.addInterest("set_surfaceNormals__",this),this.set_material__(),this.set_surfaceNormals__())},set_material__(){this.materialNode&&this.materialNode.removeInterest("addNodeEvent",this),this.materialNode=I()(g().X3DMaterialNode,this._material),this.materialNode&&this.materialNode.addInterest("addNodeEvent",this)},set_surfaceNormals__(){this.surfaceNormalsNode=I()(g().X3DTexture3DNode,this._surfaceNormals)},addShaderFields(e){this._enabled.getValue()&&(this.materialNode&&(e.addUserDefinedField(g().inputOutput,"ambientIntensity_"+this.getId(),this.materialNode._ambientIntensity.copy()),e.addUserDefinedField(g().inputOutput,"diffuseColor_"+this.getId(),this.materialNode._diffuseColor.copy()),e.addUserDefinedField(g().inputOutput,"specularColor_"+this.getId(),this.materialNode._specularColor.copy()),e.addUserDefinedField(g().inputOutput,"emissiveColor_"+this.getId(),this.materialNode._emissiveColor.copy()),e.addUserDefinedField(g().inputOutput,"shininess_"+this.getId(),this.materialNode._shininess.copy()),e.addUserDefinedField(g().inputOutput,"transparency_"+this.getId(),this.materialNode._transparency.copy())),this.surfaceNormalsNode&&e.addUserDefinedField(g().inputOutput,"surfaceNormals_"+this.getId(),new(l().SFNode)(this.surfaceNormalsNode)))},getUniformsText(){if(!this._enabled.getValue())return"";let e="";return e+="\n",e+="// ShadedVolumeStyle\n",e+="\n",e+="uniform float ambientIntensity_"+this.getId()+";\n",e+="uniform vec3 diffuseColor_"+this.getId()+";\n",e+="uniform vec3 specularColor_"+this.getId()+";\n",e+="uniform vec3 emissiveColor_"+this.getId()+";\n",e+="uniform float shininess_"+this.getId()+";\n",e+="uniform float transparency_"+this.getId()+";\n",e+=this.getNormalText(this.surfaceNormalsNode),e+="\n",e+="float\n",e+="getSpotFactor_"+this.getId()+" (const in float cutOffAngle, const in float beamWidth, const in vec3 L, const in vec3 d)\n",e+="{\n",e+=" float spotAngle = acos (clamp (dot (-L, d), -1.0, 1.0));\n",e+="\n",e+=" if (spotAngle >= cutOffAngle)\n",e+=" return 0.0;\n",e+=" else if (spotAngle <= beamWidth)\n",e+=" return 1.0;\n",e+="\n",e+=" return (spotAngle - cutOffAngle) / (beamWidth - cutOffAngle);\n",e+="}\n",e+="\n",e+="vec4\n",e+="getShadedStyle_"+this.getId()+" (in vec4 originalColor, in vec3 texCoord)\n",e+="{\n",e+=" vec4 surfaceNormal = getNormal_"+this.getId()+" (texCoord);\n",e+="\n",e+=" if (surfaceNormal .w == 0.0)\n",e+=" return vec4 (0.0);\n",e+="\n",e+=" vec4 shadedColor = vec4 (0.0);\n",this._lighting.getValue()?(this.materialNode?(e+=" vec3 diffuseFactor = diffuseColor_"+this.getId()+";\n",e+=" vec3 ambientTerm = diffuseFactor * ambientIntensity_"+this.getId()+";\n",e+="\n",e+=" shadedColor .a = originalColor .a * (1.0 - transparency_"+this.getId()+");\n"):(e+=" vec3 diffuseFactor = originalColor .rgb;\n",e+=" vec3 ambientTerm = vec3 (0.0);\n",e+="\n",e+=" shadedColor .a = originalColor .a;\n"),e+="\n",e+=" vec3 N = surfaceNormal .xyz;\n",e+=" vec3 V = normalize (-vertex); // normalized vector from point on geometry to viewer's position\n",e+="\n",e+=" for (int i = 0; i < X3D_NUM_LIGHTS; ++ i)\n",e+=" {\n",e+=" x3d_LightSourceParameters light = x3d_LightSource [i];\n",e+="\n",e+=" vec3 vL = light .location - vertex; // Light to fragment\n",e+=" float dL = length (light .matrix * vL);\n",e+=" bool di = light .type == x3d_DirectionalLight;\n",e+="\n",e+=" if (di || dL <= light .radius)\n",e+=" {\n",e+=" vec3 d = light .direction;\n",e+=" vec3 c = light .attenuation;\n",e+=" vec3 L = di ? -d : normalize (vL); // Normalized vector from point on geometry to light source i position.\n",e+=" vec3 H = normalize (L + V); // Specular term\n",e+="\n",e+=" float lightAngle = max (dot (N, L), 0.0); // Angle between normal and light ray.\n",e+=" vec3 diffuseTerm = diffuseFactor * lightAngle;\n",e+=" float specularFactor = shininess_"+this.getId()+" > 0.0 ? pow (max (dot (N, H), 0.0), shininess_"+this.getId()+" * 128.0) : 1.0;\n",e+=" vec3 specularTerm = light .intensity * specularColor_"+this.getId()+" * specularFactor;\n",e+="\n",e+=" float attenuationFactor = di ? 1.0 : 1.0 / max (dot (c, vec3 (1.0, dL, dL * dL)), 1.0);\n",e+=" float spotFactor = light .type == x3d_SpotLight ? getSpotFactor_"+this.getId()+" (light .cutOffAngle, light .beamWidth, L, d) : 1.0;\n",e+=" float attenuationSpotFactor = attenuationFactor * spotFactor;\n",e+=" vec3 ambientColor = light .ambientIntensity * ambientTerm;\n",e+=" vec3 diffuseSpecularColor = light .intensity * (diffuseTerm + specularTerm);\n",e+="\n",e+=" shadedColor .rgb += attenuationSpotFactor * light .color * (ambientColor + diffuseSpecularColor);\n",e+=" }\n",e+="\n",e+=" shadedColor .rgb += emissiveColor_"+this.getId()+";\n",e+=" }\n"):this.materialNode?(e+=" shadedColor .rgb = diffuseColor_"+this.getId()+";\n",e+=" shadedColor .a = originalColor .a * (1.0 - transparency_"+this.getId()+");\n"):e+=" shadedColor = originalColor;\n",e+="\n",e+=" return shadedColor;\n",e+="}\n",e},getFunctionsText(){if(!this._enabled.getValue())return"";let e="";return e+="\n",e+=" // ShadedVolumeStyle\n",e+="\n",e+=" textureColor = getShadedStyle_"+this.getId()+" (textureColor, texCoord);\n",e}}),Object.defineProperties(Ee,{typeName:{value:"ShadedVolumeStyle",enumerable:!0},componentInfo:{value:Object.freeze({name:"VolumeRendering",level:3}),enumerable:!0},containerField:{value:"renderStyle",enumerable:!0},specificationRange:{value:Object.freeze({from:"3.3",to:"Infinity"}),enumerable:!0},fieldDefinitions:{value:new(c())([new(u())(g().inputOutput,"metadata",new(l().SFNode)),new(u())(g().inputOutput,"enabled",new(l().SFBool)(!0)),new(u())(g().inputOutput,"lighting",new(l().SFBool)),new(u())(g().inputOutput,"shadows",new(l().SFBool)),new(u())(g().initializeOnly,"phaseFunction",new(l().SFString)("Henyey-Greenstein")),new(u())(g().inputOutput,"material",new(l().SFNode)),new(u())(g().inputOutput,"surfaceNormals",new(l().SFNode))]),enumerable:!0}});const je=Ee;y().add("ShadedVolumeStyle","x_ite/Components/VolumeRendering/ShadedVolumeStyle",je);const Me=je;function Be(e){b.call(this,e),this.addType(g().SilhouetteEnhancementVolumeStyle)}Object.assign(Object.setPrototypeOf(Be.prototype,b.prototype),{initialize(){b.prototype.initialize.call(this);this.getBrowser().getContext().getVersion()<2||(this._surfaceNormals.addInterest("set_surfaceNormals__",this),this.set_surfaceNormals__())},set_surfaceNormals__(){this.surfaceNormalsNode=I()(g().X3DTexture3DNode,this._surfaceNormals)},addShaderFields(e){this._enabled.getValue()&&(e.addUserDefinedField(g().inputOutput,"silhouetteRetainedOpacity_"+this.getId(),this._silhouetteRetainedOpacity.copy()),e.addUserDefinedField(g().inputOutput,"silhouetteBoundaryOpacity_"+this.getId(),this._silhouetteBoundaryOpacity.copy()),e.addUserDefinedField(g().inputOutput,"silhouetteSharpness_"+this.getId(),this._silhouetteSharpness.copy()),this.surfaceNormalsNode&&e.addUserDefinedField(g().inputOutput,"surfaceNormals_"+this.getId(),new(l().SFNode)(this.surfaceNormalsNode)))},getUniformsText(){if(!this._enabled.getValue())return"";let e="";return e+="\n",e+="// SilhouetteEnhancementVolumeStyle\n",e+="\n",e+="uniform float silhouetteRetainedOpacity_"+this.getId()+";\n",e+="uniform float silhouetteBoundaryOpacity_"+this.getId()+";\n",e+="uniform float silhouetteSharpness_"+this.getId()+";\n",e+=this.getNormalText(this.surfaceNormalsNode),e+="\n",e+="vec4\n",e+="getSilhouetteEnhancementStyle_"+this.getId()+" (in vec4 originalColor, in vec3 texCoord)\n",e+="{\n",e+=" vec4 surfaceNormal = getNormal_"+this.getId()+" (texCoord);\n",e+="\n",e+=" if (surfaceNormal .w == 0.0)\n",e+=" return vec4 (0.0);\n",e+=" \n",e+=" float silhouetteRetainedOpacity = silhouetteRetainedOpacity_"+this.getId()+";\n",e+=" float silhouetteBoundaryOpacity = silhouetteBoundaryOpacity_"+this.getId()+";\n",e+=" float silhouetteSharpness = silhouetteSharpness_"+this.getId()+";\n",e+="\n",e+=" return vec4 (originalColor .rgb, originalColor .a * (silhouetteRetainedOpacity + silhouetteBoundaryOpacity * pow (1.0 - abs (dot (surfaceNormal .xyz, normalize (vertex))), silhouetteSharpness)));\n",e+="}\n",e},getFunctionsText(){if(!this._enabled.getValue())return"";let e="";return e+="\n",e+=" // SilhouetteEnhancementVolumeStyle\n",e+="\n",e+=" textureColor = getSilhouetteEnhancementStyle_"+this.getId()+" (textureColor, texCoord);\n",e}}),Object.defineProperties(Be,{typeName:{value:"SilhouetteEnhancementVolumeStyle",enumerable:!0},componentInfo:{value:Object.freeze({name:"VolumeRendering",level:2}),enumerable:!0},containerField:{value:"renderStyle",enumerable:!0},specificationRange:{value:Object.freeze({from:"3.3",to:"Infinity"}),enumerable:!0},fieldDefinitions:{value:new(c())([new(u())(g().inputOutput,"metadata",new(l().SFNode)),new(u())(g().inputOutput,"enabled",new(l().SFBool)(!0)),new(u())(g().inputOutput,"silhouetteRetainedOpacity",new(l().SFFloat)(1)),new(u())(g().inputOutput,"silhouetteBoundaryOpacity",new(l().SFFloat)),new(u())(g().inputOutput,"silhouetteSharpness",new(l().SFFloat)(.5)),new(u())(g().inputOutput,"surfaceNormals",new(l().SFNode))]),enumerable:!0}});const ze=Be;y().add("SilhouetteEnhancementVolumeStyle","x_ite/Components/VolumeRendering/SilhouetteEnhancementVolumeStyle",ze);const Ue=ze;function Re(e){b.call(this,e),this.addType(g().ToneMappedVolumeStyle)}Object.assign(Object.setPrototypeOf(Re.prototype,b.prototype),{initialize(){b.prototype.initialize.call(this);this.getBrowser().getContext().getVersion()<2||(this._surfaceNormals.addInterest("set_surfaceNormals__",this),this.set_surfaceNormals__())},set_surfaceNormals__(){this.surfaceNormalsNode=I()(g().X3DTexture3DNode,this._surfaceNormals)},addShaderFields(e){this._enabled.getValue()&&(e.addUserDefinedField(g().inputOutput,"coolColor_"+this.getId(),this._coolColor.copy()),e.addUserDefinedField(g().inputOutput,"warmColor_"+this.getId(),this._warmColor.copy()),this.surfaceNormalsNode&&e.addUserDefinedField(g().inputOutput,"surfaceNormals_"+this.getId(),new(l().SFNode)(this.surfaceNormalsNode)))},getUniformsText(){if(!this._enabled.getValue())return"";let e="";return e+="\n",e+="// ToneMappedVolumeStyle\n",e+="\n",e+="uniform vec4 coolColor_"+this.getId()+";\n",e+="uniform vec4 warmColor_"+this.getId()+";\n",e+=this.getNormalText(this.surfaceNormalsNode),e+="\n",e+="vec4\n",e+="getToneMappedStyle_"+this.getId()+" (in vec4 originalColor, in vec3 texCoord)\n",e+="{\n",e+=" vec4 surfaceNormal = getNormal_"+this.getId()+" (texCoord);\n",e+="\n",e+=" if (surfaceNormal .w == 0.0)\n",e+=" return vec4 (0.0);\n",e+="\n",e+=" vec3 toneColor = vec3 (0.0);\n",e+=" vec3 coolColor = coolColor_"+this.getId()+" .rgb;\n",e+=" vec3 warmColor = warmColor_"+this.getId()+" .rgb;\n",e+="\n",e+=" for (int i = 0; i < X3D_NUM_LIGHTS; ++ i)\n",e+=" {\n",e+=" x3d_LightSourceParameters light = x3d_LightSource [i];\n",e+="\n",e+=" vec3 L = light .type == x3d_DirectionalLight ? -light .direction : normalize (light .location - vertex);\n",e+=" float colorFactor = dot (L, surfaceNormal .xyz) * 0.5 + 0.5;\n",e+="\n",e+=" toneColor += mix (warmColor .rgb, coolColor .rgb, colorFactor);\n",e+=" }\n",e+="\n",e+=" return vec4 (toneColor, originalColor .a);\n",e+="}\n",e},getFunctionsText(){if(!this._enabled.getValue())return"";let e="";return e+="\n",e+=" // ToneMappedVolumeStyle\n",e+="\n",e+=" textureColor = getToneMappedStyle_"+this.getId()+" (textureColor, texCoord);\n",e}}),Object.defineProperties(Re,{typeName:{value:"ToneMappedVolumeStyle",enumerable:!0},componentInfo:{value:Object.freeze({name:"VolumeRendering",level:2}),enumerable:!0},containerField:{value:"renderStyle",enumerable:!0},specificationRange:{value:Object.freeze({from:"3.3",to:"Infinity"}),enumerable:!0},fieldDefinitions:{value:new(c())([new(u())(g().inputOutput,"metadata",new(l().SFNode)),new(u())(g().inputOutput,"enabled",new(l().SFBool)(!0)),new(u())(g().inputOutput,"coolColor",new(l().SFColorRGBA)(0,0,1,0)),new(u())(g().inputOutput,"warmColor",new(l().SFColorRGBA)(1,1,0,0)),new(u())(g().inputOutput,"surfaceNormals",new(l().SFNode))]),enumerable:!0}});const Xe=Re;y().add("ToneMappedVolumeStyle","x_ite/Components/VolumeRendering/ToneMappedVolumeStyle",Xe);const Le=Xe;function Ae(e){Se.call(this,e),this.addType(g().VolumeData),this.renderStyleNode=null}Object.assign(Object.setPrototypeOf(Ae.prototype,Se.prototype),{initialize(){Se.prototype.initialize.call(this);this.getBrowser().getContext().getVersion()<2||(this._renderStyle.addInterest("set_renderStyle__",this),this._voxels.addInterest("set_voxels__",this),this._renderStyle.addInterest("updateShader",this),this.set_renderStyle__(),this.set_voxels__(),this.updateShader())},set_renderStyle__(){this.renderStyleNode&&(this.renderStyleNode.removeInterest("updateShader",this),this.renderStyleNode.removeVolumeData(this)),this.renderStyleNode=I()(g().X3DVolumeRenderStyleNode,this._renderStyle),this.renderStyleNode&&(this.renderStyleNode.addInterest("updateShader",this),this.renderStyleNode.addVolumeData(this))},set_voxels__(){this.voxelsNode=I()(g().X3DTexture3DNode,this._voxels),this.voxelsNode?this.getAppearance()._texture=this._voxels:this.getAppearance()._texture=this.getBrowser().getDefaultVoxels()},createShader(e,t,n){const o=this.getBrowser().getDefaultVolumeStyle();let r=o.getUniformsText(),i=o.getFunctionsText();this.renderStyleNode&&(r+=this.renderStyleNode.getUniformsText(),i+=this.renderStyleNode.getFunctionsText()),n=n.replace(/__VOLUME_STYLES_UNIFORMS__/,r).replace(/__VOLUME_STYLES_FUNCTIONS__/,i);const s=new(we())(this.getExecutionContext());s._url.push(encodeURI("data:x-shader/x-vertex,"+t)),s.setPrivate(!0),s.setName("VolumeDataVertexShader"),s.setOptions(e),s.setup();const a=new(we())(this.getExecutionContext());a._type="FRAGMENT",a._url.push(encodeURI("data:x-shader/x-fragment,"+n)),a.setPrivate(!0),a.setName("VolumeDataFragmentShader"),a.setOptions(e),a.setup();const l=new(Ne())(this.getExecutionContext());l._language="GLSL",l._parts.push(s),l._parts.push(a),l.setPrivate(!0),l.setName("VolumeDataShader"),o.addShaderFields(l),this.renderStyleNode&&this.renderStyleNode.addShaderFields(l);const d=[];return this.addShaderUniformNames(d),l.setUniformNames(d),l.setup(),l}}),Object.defineProperties(Ae,{typeName:{value:"VolumeData",enumerable:!0},componentInfo:{value:Object.freeze({name:"VolumeRendering",level:1}),enumerable:!0},containerField:{value:"children",enumerable:!0},specificationRange:{value:Object.freeze({from:"3.3",to:"Infinity"}),enumerable:!0},fieldDefinitions:{value:new(c())([new(u())(g().inputOutput,"metadata",new(l().SFNode)),new(u())(g().inputOutput,"dimensions",new(l().SFVec3f)(1,1,1)),new(u())(g().inputOutput,"visible",new(l().SFBool)(!0)),new(u())(g().inputOutput,"bboxDisplay",new(l().SFBool)),new(u())(g().initializeOnly,"bboxSize",new(l().SFVec3f)(-1,-1,-1)),new(u())(g().initializeOnly,"bboxCenter",new(l().SFVec3f)),new(u())(g().inputOutput,"renderStyle",new(l().SFNode)),new(u())(g().inputOutput,"voxels",new(l().SFNode))]),enumerable:!0}});const Ge=Ae;y().add("VolumeData","x_ite/Components/VolumeRendering/VolumeData",Ge);const qe=Ge;n().add({name:"VolumeRendering",concreteNodes:[R,A,H,Q,$,Ie,V,Ve,Pe,Me,Ue,Le,qe],abstractNodes:[b,Se,N],browserContext:B});const He=void 0;y().add("VolumeRendering","assets/components/VolumeRendering",He)})();
@@ -1 +0,0 @@
1
- /* X_ITE v10.1.0 */(()=>{"use strict";var e={n:t=>{var s=t&&t.__esModule?()=>t.default:()=>t;return e.d(s,{a:s}),s},d:(t,s)=>{for(var i in s)e.o(s,i)&&!e.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:s[i]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)};const t=window[Symbol.for("X_ITE.X3D-10.1.0")].require("x_ite/Components");var s=e.n(t);const i=window[Symbol.for("X_ITE.X3D-10.1.0")].require("x_ite/Fields");var n=e.n(i);const r=window[Symbol.for("X_ITE.X3D-10.1.0")].require("x_ite/Base/X3DFieldDefinition");var o=e.n(r);const a=window[Symbol.for("X_ITE.X3D-10.1.0")].require("x_ite/Base/FieldDefinitionArray");var u=e.n(a);const _=window[Symbol.for("X_ITE.X3D-10.1.0")].require("x_ite/Components/Shape/X3DAppearanceChildNode");var l=e.n(_);const h=window[Symbol.for("X_ITE.X3D-10.1.0")].require("x_ite/Base/X3DConstants");var c=e.n(h);const p=window[Symbol.for("X_ITE.X3D-10.1.0")].require("x_ite/Namespace");var d=e.n(p);function T(e){l().call(this,e),this.addType(c().BlendMode),this.factorTypes=new Map,this.equationTypes=new Map}Object.assign(Object.setPrototypeOf(T.prototype,l().prototype),{initialize(){l().prototype.initialize.call(this);const e=this.getBrowser().getContext(),t=e.getExtension("EXT_blend_minmax");this.factorTypes.set("ZERO",e.ZERO),this.factorTypes.set("ONE",e.ONE),this.factorTypes.set("SRC_COLOR",e.SRC_COLOR),this.factorTypes.set("ONE_MINUS_SRC_COLOR",e.ONE_MINUS_SRC_COLOR),this.factorTypes.set("DST_COLOR",e.DST_COLOR),this.factorTypes.set("ONE_MINUS_DST_COLOR",e.ONE_MINUS_DST_COLOR),this.factorTypes.set("SRC_ALPHA",e.SRC_ALPHA),this.factorTypes.set("ONE_MINUS_SRC_ALPHA",e.ONE_MINUS_SRC_ALPHA),this.factorTypes.set("DST_ALPHA",e.DST_ALPHA),this.factorTypes.set("ONE_MINUS_DST_ALPHA",e.ONE_MINUS_DST_ALPHA),this.factorTypes.set("SRC_ALPHA_SATURATE",e.SRC_ALPHA_SATURATE),this.factorTypes.set("CONSTANT_COLOR",e.CONSTANT_COLOR),this.factorTypes.set("ONE_MINUS_CONSTANT_COLOR",e.ONE_MINUS_CONSTANT_COLOR),this.factorTypes.set("CONSTANT_ALPHA",e.CONSTANT_ALPHA),this.factorTypes.set("ONE_MINUS_CONSTANT_ALPHA",e.ONE_MINUS_CONSTANT_ALPHA),this.equationTypes.set("FUNC_ADD",e.FUNC_ADD),this.equationTypes.set("FUNC_SUBTRACT",e.FUNC_SUBTRACT),this.equationTypes.set("FUNC_REVERSE_SUBTRACT",e.FUNC_REVERSE_SUBTRACT),this.equationTypes.set("MIN",e.MIN||t&&t.MIN_EXT),this.equationTypes.set("MAX",e.MAX||t&&t.MAX_EXT),this._sourceColorFactor.addInterest("set_sourceColorFactor__",this),this._sourceAlphaFactor.addInterest("set_sourceAlphaFactor__",this),this._destinationColorFactor.addInterest("set_destinationColorFactor__",this),this._destinationAlphaFactor.addInterest("set_destinationAlphaFactor__",this),this._colorEquation.addInterest("set_colorEquation__",this),this._alphaEquation.addInterest("set_alphaEquation__",this),this.set_sourceColorFactor__(),this.set_sourceAlphaFactor__(),this.set_destinationColorFactor__(),this.set_destinationAlphaFactor__(),this.set_colorEquation__(),this.set_alphaEquation__()},set_sourceColorFactor__(){this.sourceColorFactorType=this.factorTypes.get(this._sourceColorFactor.getValue())??this.factorTypes.get("SRC_ALPHA")},set_sourceAlphaFactor__(){this.sourceAlphaFactorType=this.factorTypes.get(this._sourceAlphaFactor.getValue())??this.factorTypes.get("ONE")},set_destinationColorFactor__(){this.destinationColorFactorType=this.factorTypes.get(this._destinationColorFactor.getValue())??this.factorTypes.get("ONE_MINUS_SRC_ALPHA")},set_destinationAlphaFactor__(){this.destinationAlphaFactorType=this.factorTypes.get(this._destinationAlphaFactor.getValue())??this.factorTypes.get("ONE_MINUS_SRC_ALPHA")},set_colorEquation__(){this.colorEquationType=this.equationTypes.get(this._colorEquation.getValue())??this.equationTypes.get("FUNC_ADD")},set_alphaEquation__(){this.alphaEquationType=this.equationTypes.get(this._alphaEquation.getValue())??this.equationTypes.get("FUNC_ADD")},enable(e){const t=this._blendColor.getValue();e.blendColor(t.r,t.g,t.b,t.a),e.blendFuncSeparate(this.sourceColorFactorType,this.destinationColorFactorType,this.sourceAlphaFactorType,this.destinationAlphaFactorType),e.blendEquationSeparate(this.colorEquationType,this.alphaEquationType)},disable(e){e.blendFuncSeparate(e.SRC_ALPHA,e.ONE_MINUS_SRC_ALPHA,e.ONE,e.ONE_MINUS_SRC_ALPHA),e.blendEquationSeparate(e.FUNC_ADD,e.FUNC_ADD)}}),Object.defineProperties(T,{typeName:{value:"BlendMode",enumerable:!0},componentInfo:{value:Object.freeze({name:"X_ITE",level:1}),enumerable:!0},containerField:{value:"blendMode",enumerable:!0},specificationRange:{value:Object.freeze({from:"3.3",to:"Infinity"}),enumerable:!0},fieldDefinitions:{value:new(u())([new(o())(c().inputOutput,"metadata",new(n().SFNode)),new(o())(c().inputOutput,"blendColor",new(n().SFColorRGBA)),new(o())(c().inputOutput,"sourceColorFactor",new(n().SFString)("SRC_ALPHA")),new(o())(c().inputOutput,"sourceAlphaFactor",new(n().SFString)("ONE")),new(o())(c().inputOutput,"destinationColorFactor",new(n().SFString)("ONE_MINUS_SRC_ALPHA")),new(o())(c().inputOutput,"destinationAlphaFactor",new(n().SFString)("ONE_MINUS_SRC_ALPHA")),new(o())(c().inputOutput,"colorEquation",new(n().SFString)("FUNC_ADD")),new(o())(c().inputOutput,"alphaEquation",new(n().SFString)("FUNC_ADD"))]),enumerable:!0}});const x=T;d().add("BlendMode","x_ite/Components/X_ITE/BlendMode",x);const S=x;function E(e){l().call(this,e),this.addType(c().DepthMode),this.addAlias("depthFunc",this._depthFunction)}Object.assign(Object.setPrototypeOf(E.prototype,l().prototype),{initialize(){l().prototype.initialize.call(this),this._depthFunction.addInterest("set_depthFunction__",this),this.set_depthFunction__()},set_depthFunction__:function(){const e=new Map([["NEVER","NEVER"],["LESS","LESS"],["EQUAL","EQUAL"],["LESS_EQUAL","LEQUAL"],["GREATER","GREATER"],["NOT_EQUAL","NOTEQUAL"],["GREATER_EQUAL","GEQUAL"],["ALWAYS","ALWAYS"]]);return function(){const t=this.getBrowser().getContext();this.depthFunction=t[e.get(this._depthFunction.getValue())??"LEQUAL"]}}(),enable(e){this.depthTest=e.isEnabled(e.DEPTH_TEST),this.depthWriteMask=e.getParameter(e.DEPTH_WRITEMASK),e.enable(e.POLYGON_OFFSET_FILL),e.polygonOffset(...this._polygonOffset),this._depthTest.getValue()?e.enable(e.DEPTH_TEST):e.disable(e.DEPTH_TEST),e.depthFunc(this.depthFunction),e.depthRange(...this._depthRange.getValue()),e.depthMask(this._depthMask.getValue())},disable(e){e.disable(e.POLYGON_OFFSET_FILL),this.depthTest?e.enable(e.DEPTH_TEST):e.disable(e.DEPTH_TEST),e.depthFunc(e.LEQUAL),e.depthRange(0,1),e.depthMask(this.depthWriteMask)}}),Object.defineProperties(E,{typeName:{value:"DepthMode",enumerable:!0},componentInfo:{value:Object.freeze({name:"X_ITE",level:1}),enumerable:!0},containerField:{value:"depthMode",enumerable:!0},specificationRange:{value:Object.freeze({from:"4.0",to:"Infinity"}),enumerable:!0},fieldDefinitions:{value:new(u())([new(o())(c().inputOutput,"metadata",new(n().SFNode)),new(o())(c().inputOutput,"polygonOffset",new(n().SFVec2f)),new(o())(c().inputOutput,"depthRange",new(n().SFVec2f)(0,1)),new(o())(c().inputOutput,"depthTest",new(n().SFBool)(!0)),new(o())(c().inputOutput,"depthFunction",new(n().SFString)("LESS_EQUAL")),new(o())(c().inputOutput,"depthMask",new(n().SFBool)(!0))]),enumerable:!0}});const m=E;d().add("DepthMode","x_ite/Components/X_ITE/DepthMode",m);const f=m,g=window[Symbol.for("X_ITE.X3D-10.1.0")].require("x_ite/Components/Shape/X3DShapeNode");var O=e.n(g);const N=window[Symbol.for("X_ITE.X3D-10.1.0")].require("x_ite/Rendering/TraverseType");var I=e.n(N);const y=window[Symbol.for("X_ITE.X3D-10.1.0")].require("x_ite/Rendering/VertexArray");var w=e.n(y);const A=window[Symbol.for("X_ITE.X3D-10.1.0")].require("standard/Math/Numbers/Vector3");var R=e.n(A);const C=window[Symbol.for("X_ITE.X3D-10.1.0")].require("standard/Math/Numbers/Matrix4");var b=e.n(C);const M=window[Symbol.for("X_ITE.X3D-10.1.0")].require("standard/Math/Geometry/Box3");var F=e.n(M);function X(e){O().call(this,e),this.addType(c().InstancedShape),this.addChildObjects(c().outputOnly,"matrices",new(n().SFTime)),this.min=new(R()),this.max=new(R()),this.scale=new(R())(1,1,1),this.numInstances=0,this.instancesStride=25*Float32Array.BYTES_PER_ELEMENT,this.matrixOffset=0,this.normalMatrixOffset=16*Float32Array.BYTES_PER_ELEMENT}Object.assign(Object.setPrototypeOf(X.prototype,O().prototype),{initialize(){O().prototype.initialize.call(this);const e=this.getBrowser(),t=e.getContext();e.getContext().getVersion()<2||(this.instances=Object.assign(t.createBuffer(),{vertexArrayObject:new(w())(t),thickLinesVertexArrayObject:new(w())(t),lineTrianglesBuffer:t.createBuffer(),numLines:0}),this._translations.addInterest("set_transform__",this),this._rotations.addInterest("set_transform__",this),this._scales.addInterest("set_transform__",this),this._matrices.addInterest("set_matrices__",this),this.set_transform__())},getShapeKey:()=>3,getNumInstances(){return this.numInstances},getInstances(){return this.instances},set_bbox__:function(){const e=new(R()),t=new(R()),s=new(F());return function(){if(this.numInstances)if(this._bboxSize.getValue().equals(this.getDefaultBBoxSize())){this.getGeometry()?s.assign(this.getGeometry().getBBox()):s.set();const i=s.size.multiply(this.scale.magnitude()/2),n=s.center;e.assign(this.min).add(n).subtract(i),t.assign(this.max).add(n).add(i),this.bbox.setExtents(e,t)}else this.bbox.set(this._bboxSize.getValue(),this._bboxCenter.getValue());else this.bbox.set();this.getBBoxSize().assign(this.bbox.size),this.getBBoxCenter().assign(this.bbox.center)}}(),set_transform__(){this._matrices=this.getBrowser().getCurrentTime()},set_matrices__(){const e=this.getBrowser().getContext(),t=this._translations,s=this._rotations,i=this._scales,n=t.length,r=s.length,o=i.length,a=Math.max(n,r,o),u=this.instancesStride/Float32Array.BYTES_PER_ELEMENT,_=this.instancesStride*a,l=new Float32Array(_),h=new(b());this.numInstances=a;const c=this.min.set(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),p=this.max.set(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY),d=this.scale.assign(o?p:R().One);for(let e=0,_=0;e<a;++e,_+=u)h.set(n?t[Math.min(e,n-1)].getValue():null,r?s[Math.min(e,r-1)].getValue():null,o?i[Math.min(e,o-1)].getValue():null),o&&d.max(i[Math.min(e,o-1)].getValue()),l.set(h,_),l.set(h.submatrix.transpose().inverse(),_+16),c.min(h.origin),p.max(h.origin);e.bindBuffer(e.ARRAY_BUFFER,this.instances),e.bufferData(e.ARRAY_BUFFER,l,e.DYNAMIC_DRAW),this.set_bbox__()},set_geometry__(){O().prototype.set_geometry__.call(this),this.getGeometry()?delete this.traverse:this.traverse=Function.prototype,this.set_transform__()},intersectsBox(e,t,s){},traverse(e,t){if(this.numInstances){switch(e){case I().POINTER:this._pointerEvents.getValue()&&t.addPointingShape(this);break;case I().PICKING:break;case I().COLLISION:t.addCollisionShape(this);break;case I().SHADOW:this._castShadow.getValue()&&t.addShadowShape(this);break;case I().DISPLAY:t.addDisplayShape(this)&&this.getAppearance().traverse(e,t)}this.getGeometry().traverse(e,t)}},displaySimple(e,t,s){this.getGeometry().displaySimpleInstanced(e,s,this)},display(e,t){this.getGeometry().displayInstanced(e,t,this)}}),Object.defineProperties(X,{typeName:{value:"InstancedShape",enumerable:!0},componentInfo:{value:Object.freeze({name:"X_ITE",level:1}),enumerable:!0},containerField:{value:"children",enumerable:!0},specificationRange:{value:Object.freeze({from:"2.0",to:"Infinity"}),enumerable:!0},fieldDefinitions:{value:new(u())([new(o())(c().inputOutput,"metadata",new(n().SFNode)),new(o())(c().inputOutput,"translations",new(n().MFVec3f)),new(o())(c().inputOutput,"rotations",new(n().MFRotation)),new(o())(c().inputOutput,"scales",new(n().MFVec3f)),new(o())(c().inputOutput,"pointerEvents",new(n().SFBool)(!0)),new(o())(c().inputOutput,"castShadow",new(n().SFBool)(!0)),new(o())(c().inputOutput,"visible",new(n().SFBool)(!0)),new(o())(c().inputOutput,"bboxDisplay",new(n().SFBool)),new(o())(c().initializeOnly,"bboxSize",new(n().SFVec3f)(-1,-1,-1)),new(o())(c().initializeOnly,"bboxCenter",new(n().SFVec3f)),new(o())(c().inputOutput,"appearance",new(n().SFNode)),new(o())(c().inputOutput,"geometry",new(n().SFNode))]),enumerable:!0}});const D=X;d().add("InstancedShape","x_ite/Components/X_ITE/InstancedShape",D);const v=D,L=window[Symbol.for("X_ITE.X3D-10.1.0")].require("x_ite/Components/Shape/X3DOneSidedMaterialNode");var U=e.n(L);const P=window[Symbol.for("X_ITE.X3D-10.1.0")].require("x_ite/Base/X3DCast");var V=e.n(P);const j=window[Symbol.for("X_ITE.X3D-10.1.0")].require("standard/Math/Algorithm");var B=e.n(j);function z(e){console.warn("SpecularGlossinessMaterial is depreciated, please use PhysicalMaterial instead."),U().call(this,e),this.addType(c().SpecularGlossinessMaterial),this.materialKey="4/",this.diffuseColorArray=new Float32Array(3),this.specularColorArray=new Float32Array(3),this.extensionNodes=[]}Object.assign(Object.setPrototypeOf(z.prototype,U().prototype),{initialize(){U().prototype.initialize.call(this),this._diffuseColor.addInterest("set_diffuseColor__",this),this._diffuseTexture.addInterest("set_diffuseTexture__",this),this._diffuseTexture.addInterest("set_transparent__",this),this._specularColor.addInterest("set_specularColor__",this),this._glossiness.addInterest("set_glossiness__",this),this._specularGlossinessTexture.addInterest("set_specularGlossinessTexture__",this),this._occlusionStrength.addInterest("set_occlusionStrength__",this),this._occlusionTexture.addInterest("set_occlusionTexture__",this),this._extensions.addInterest("set_extensions__",this),this.set_diffuseColor__(),this.set_diffuseTexture__(),this.set_specularColor__(),this.set_glossiness__(),this.set_specularGlossinessTexture__(),this.set_occlusionStrength__(),this.set_occlusionTexture__(),this.set_extensions__(),this.set_transparent__()},getMaterialKey(){return this.materialKey},getTextureIndices:(()=>{let e=0;const t={DIFFUSE_TEXTURE:e++,SPECULAR_GLOSSINESS_TEXTURE:e++,EMISSIVE_TEXTURE:e++,OCCLUSION_TEXTURE:e++,NORMAL_TEXTURE:e++};return function(){return t}})(),getBaseTexture(){return this.diffuseTextureNode},set_diffuseColor__(){const e=this.diffuseColorArray,t=this._diffuseColor.getValue();e[0]=t.r,e[1]=t.g,e[2]=t.b},set_diffuseTexture__(){const e=this.getTextureIndices().DIFFUSE_TEXTURE;this.diffuseTextureNode&&(this.diffuseTextureNode._transparent.removeInterest("set_transparent__",this),this.diffuseTextureNode._linear.removeInterest(`setTexture${e}`,this)),this.diffuseTextureNode=V()(c().X3DSingleTextureNode,this._diffuseTexture),this.diffuseTextureNode&&(this.diffuseTextureNode._transparent.addInterest("set_transparent__",this),this.diffuseTextureNode._linear.addInterest(`setTexture${e}`,this,e,this.diffuseTextureNode)),this.setTexture(e,this.diffuseTextureNode)},set_specularColor__(){const e=this.specularColorArray,t=this._specularColor.getValue();e[0]=t.r,e[1]=t.g,e[2]=t.b},set_glossiness__(){this.glossiness=B().clamp(this._glossiness.getValue(),0,1)},set_specularGlossinessTexture__(){this.specularGlossinessTextureNode=V()(c().X3DSingleTextureNode,this._specularGlossinessTexture),this.setTexture(this.getTextureIndices().SPECULAR_GLOSSINESS_TEXTURE,this.specularGlossinessTextureNode)},set_occlusionStrength__(){this.occlusionStrength=B().clamp(this._occlusionStrength.getValue(),0,1)},set_occlusionTexture__(){this.occlusionTextureNode=V()(c().X3DSingleTextureNode,this._occlusionTexture),this.setTexture(this.getTextureIndices().OCCLUSION_TEXTURE,this.occlusionTextureNode)},set_transparent__(){this.setTransparent(this.getTransparency()||this.diffuseTextureNode?.isTransparent())},set_extensions__(){const e=this.extensionNodes;for(const t of e)t.removeInterest("set_extensionsKey__",this);e.length=0;for(const t of this._extensions){const s=V()(c().X3DMaterialExtensionNode,t);s&&e.push(s)}e.sort(((e,t)=>e.getExtensionKey()-t.getExtensionKey()));for(const t of e)t.addInterest("set_extensionsKey__",this);this.setTransmission(e.some((e=>e.getType().includes(c().TransmissionMaterialExtension)))),this.set_extensionsKey__()},set_extensionsKey__(){const e=this.extensionNodes.map((e=>`${e.getExtensionKey().toString(16)}${e.getTextureBits().toString(16)}`)).join("");this.materialKey=`[4.${e}]`},createShader(e,t,s){const i=this.getBrowser(),n=this.getShaderOptions(t,s);for(const e of this.extensionNodes)e.getShaderOptions(n);n.push("X3D_PHYSICAL_MATERIAL","X3D_MATERIAL_SPECULAR_GLOSSINESS"),+this.getTextureBits()&&(this.diffuseTextureNode?.getShaderOptions(n,"DIFFUSE"),this.specularGlossinessTextureNode?.getShaderOptions(n,"SPECULAR_GLOSSINESS"),this.occlusionTextureNode?.getShaderOptions(n,"OCCLUSION"));const r=i.createShader("SpecularGlossiness","Default","Physical",n);return i.getShaders().set(e,r),r},setShaderUniforms(e,t,s,i,n){U().prototype.setShaderUniforms.call(this,e,t,s,i,n);for(const r of this.extensionNodes)r.setShaderUniforms(e,t,s,i,n);e.uniform3fv(t.x3d_DiffuseColor,this.diffuseColorArray),e.uniform3fv(t.x3d_SpecularColor,this.specularColorArray),e.uniform1f(t.x3d_Glossiness,this.glossiness),+this.getTextureBits()&&(this.diffuseTextureNode?.setNamedShaderUniforms(e,t,s,t.x3d_DiffuseTexture,this._diffuseTextureMapping.getValue(),i,n),this.specularGlossinessTextureNode?.setNamedShaderUniforms(e,t,s,t.x3d_SpecularGlossinessTexture,this._specularGlossinessTextureMapping.getValue(),i,n),this.occlusionTextureNode&&e.uniform1f(t.x3d_OcclusionStrength,this.occlusionStrength),this.occlusionTextureNode?.setNamedShaderUniforms(e,t,s,t.x3d_OcclusionTexture,this._occlusionTextureMapping.getValue(),i,n))}}),Object.defineProperties(z,{typeName:{value:"SpecularGlossinessMaterial",enumerable:!0},componentInfo:{value:Object.freeze({name:"X_ITE",level:1}),enumerable:!0},containerField:{value:"material",enumerable:!0},specificationRange:{value:Object.freeze({from:"4.0",to:"Infinity"}),enumerable:!0},fieldDefinitions:{value:new(u())([new(o())(c().inputOutput,"metadata",new(n().SFNode)),new(o())(c().inputOutput,"diffuseColor",new(n().SFColor)(1,1,1)),new(o())(c().inputOutput,"diffuseTextureMapping",new(n().SFString)),new(o())(c().inputOutput,"diffuseTexture",new(n().SFNode)),new(o())(c().inputOutput,"specularColor",new(n().SFColor)(1,1,1)),new(o())(c().inputOutput,"glossiness",new(n().SFFloat)(1)),new(o())(c().inputOutput,"specularGlossinessTextureMapping",new(n().SFString)),new(o())(c().inputOutput,"specularGlossinessTexture",new(n().SFNode)),new(o())(c().inputOutput,"emissiveColor",new(n().SFColor)),new(o())(c().inputOutput,"emissiveTextureMapping",new(n().SFString)),new(o())(c().inputOutput,"emissiveTexture",new(n().SFNode)),new(o())(c().inputOutput,"occlusionStrength",new(n().SFFloat)(1)),new(o())(c().inputOutput,"occlusionTextureMapping",new(n().SFString)),new(o())(c().inputOutput,"occlusionTexture",new(n().SFNode)),new(o())(c().inputOutput,"normalScale",new(n().SFFloat)(1)),new(o())(c().inputOutput,"normalTextureMapping",new(n().SFString)),new(o())(c().inputOutput,"normalTexture",new(n().SFNode)),new(o())(c().inputOutput,"transparency",new(n().SFFloat)),new(o())(c().inputOutput,"extensions",new(n().MFNode))]),enumerable:!0}});for(const e of Object.values(z.prototype.getTextureIndices()))z.prototype[`setTexture${e}`]=function(e,t){this.setTexture(e,t)};const k=z;d().add("SpecularGlossinessMaterial","x_ite/Components/X_ITE/SpecularGlossinessMaterial",k);const q=k,G=window[Symbol.for("X_ITE.X3D-10.1.0")].require("x_ite/Components/Core/X3DNode");var H=e.n(G);const K=window[Symbol.for("X_ITE.X3D-10.1.0")].require("standard/Utility/BitSet");var Y=e.n(K);function Q(e){H().call(this,e),this.addType(c().X3DMaterialExtensionNode),this.textureBits=new(Y())}Object.assign(Object.setPrototypeOf(Q.prototype,H().prototype),{setTexture(e,t){e*=4,this.textureBits.remove(e,15),this.textureBits.add(e,t?.getTextureBits()??0)},getTextureBits(){return this.textureBits}}),Object.defineProperties(Q,{typeName:{value:"X3DMaterialExtensionNode",enumerable:!0},componentInfo:{value:Object.freeze({name:"X_ITE",level:1}),enumerable:!0}});const W=Q;d().add("X3DMaterialExtensionNode","x_ite/Components/X_ITE/X3DMaterialExtensionNode",W);const $=W;let Z=0;const J={ANISOTROPY_MATERIAL_EXTENSION:Z++,CLEARCOAT_MATERIAL_EXTENSION:Z++,DISPERSION_MATERIAL_EXTENSION:Z++,EMISSIVE_STRENGTH_MATERIAL_EXTENSION:Z++,IOR_MATERIAL_EXTENSION:Z++,IRIDESCENCE_MATERIAL_EXTENSION:Z++,SHEEN_MATERIAL_EXTENSION:Z++,SPECULAR_MATERIAL_EXTENSION:Z++,TRANSMISSION_MATERIAL_EXTENSION:Z++,UNLIT_MATERIAL_EXTENSION:Z++,VOLUME_MATERIAL_EXTENSION:Z++};d().add("ExtensionKeys","x_ite/Browser/X_ITE/ExtensionKeys",J);const ee=J;function te(e){$.call(this,e),this.addType(c().AnisotropyMaterialExtension),this.anisotropyArray=new Float32Array(3)}Object.assign(Object.setPrototypeOf(te.prototype,$.prototype),{initialize(){$.prototype.initialize.call(this),this._anisotropyStrength.addInterest("set_anisotropyStrength__",this),this._anisotropyRotation.addInterest("set_anisotropyRotation__",this),this._anisotropyTexture.addInterest("set_anisotropyTexture__",this),this.set_anisotropyStrength__(),this.set_anisotropyRotation__(),this.set_anisotropyTexture__()},set_anisotropyStrength__(){this.anisotropyArray[2]=Math.max(this._anisotropyStrength.getValue(),0)},set_anisotropyRotation__(){const e=this._anisotropyRotation.getValue();this.anisotropyArray[0]=Math.cos(e),this.anisotropyArray[1]=Math.sin(e)},set_anisotropyTexture__(){this.anisotropyTextureNode=V()(c().X3DSingleTextureNode,this._anisotropyTexture),this.setTexture(0,this.anisotropyTextureNode)},getExtensionKey:()=>ee.ANISOTROPY_MATERIAL_EXTENSION,getShaderOptions(e){e.push("X3D_ANISOTROPY_MATERIAL_EXT"),+this.getTextureBits()&&(e.push("X3D_MATERIAL_TEXTURES"),this.anisotropyTextureNode?.getShaderOptions(e,"ANISOTROPY",!0))},setShaderUniforms(e,t,s,i,n){e.uniform3fv(t.x3d_AnisotropyEXT,this.anisotropyArray),this.anisotropyTextureNode?.setNamedShaderUniforms(e,t,s,t.x3d_AnisotropyTextureEXT,this._anisotropyTextureMapping.getValue(),i,n)}}),Object.defineProperties(te,{typeName:{value:"AnisotropyMaterialExtension",enumerable:!0},componentInfo:{value:Object.freeze({name:"X_ITE",level:1}),enumerable:!0},containerField:{value:"extensions",enumerable:!0},specificationRange:{value:Object.freeze({from:"4.0",to:"Infinity"}),enumerable:!0},fieldDefinitions:{value:new(u())([new(o())(c().inputOutput,"metadata",new(n().SFNode)),new(o())(c().inputOutput,"anisotropyStrength",new(n().SFFloat)),new(o())(c().inputOutput,"anisotropyRotation",new(n().SFFloat)),new(o())(c().inputOutput,"anisotropyTextureMapping",new(n().SFString)),new(o())(c().inputOutput,"anisotropyTexture",new(n().SFNode))]),enumerable:!0}});const se=te;d().add("AnisotropyMaterialExtension","x_ite/Components/X_ITE/AnisotropyMaterialExtension",se);const ie=se;function ne(e){$.call(this,e),this.addType(c().ClearcoatMaterialExtension)}Object.assign(Object.setPrototypeOf(ne.prototype,$.prototype),{initialize(){$.prototype.initialize.call(this),this._clearcoat.addInterest("set_clearcoat__",this),this._clearcoatTexture.addInterest("set_clearcoatTexture__",this),this._clearcoatRoughness.addInterest("set_clearcoatRoughness__",this),this._clearcoatRoughnessTexture.addInterest("set_clearcoatRoughnessTexture__",this),this._clearcoatNormalTexture.addInterest("set_clearcoatNormalTexture__",this),this.set_clearcoat__(),this.set_clearcoatTexture__(),this.set_clearcoatRoughness__(),this.set_clearcoatRoughnessTexture__(),this.set_clearcoatNormalTexture__()},set_clearcoat__(){this.clearcoat=Math.max(this._clearcoat.getValue(),0)},set_clearcoatTexture__(){this.clearcoatTextureNode=V()(c().X3DSingleTextureNode,this._clearcoatTexture),this.setTexture(0,this.clearcoatTextureNode)},set_clearcoatRoughness__(){this.clearcoatRoughness=B().clamp(this._clearcoatRoughness.getValue(),0,1)},set_clearcoatRoughnessTexture__(){this.clearcoatRoughnessTextureNode=V()(c().X3DSingleTextureNode,this._clearcoatRoughnessTexture),this.setTexture(1,this.clearcoatRoughnessTextureNode)},set_clearcoatNormalTexture__(){this.clearcoatNormalTextureNode=V()(c().X3DSingleTextureNode,this._clearcoatNormalTexture),this.setTexture(2,this.clearcoatNormalTextureNode)},getExtensionKey:()=>ee.CLEARCOAT_MATERIAL_EXTENSION,getShaderOptions(e){e.push("X3D_CLEARCOAT_MATERIAL_EXT"),+this.getTextureBits()&&(e.push("X3D_MATERIAL_TEXTURES"),this.clearcoatTextureNode?.getShaderOptions(e,"CLEARCOAT",!0),this.clearcoatRoughnessTextureNode?.getShaderOptions(e,"CLEARCOAT_ROUGHNESS",!0),this.clearcoatNormalTextureNode?.getShaderOptions(e,"CLEARCOAT_NORMAL",!0))},setShaderUniforms(e,t,s,i,n){e.uniform1f(t.x3d_ClearcoatEXT,this.clearcoat),e.uniform1f(t.x3d_ClearcoatRoughnessEXT,this.clearcoatRoughness),+this.getTextureBits()&&(this.clearcoatTextureNode?.setNamedShaderUniforms(e,t,s,t.x3d_ClearcoatTextureEXT,this._clearcoatTextureMapping.getValue(),i,n),this.clearcoatRoughnessTextureNode?.setNamedShaderUniforms(e,t,s,t.x3d_ClearcoatRoughnessTextureEXT,this._clearcoatRoughnessTextureMapping.getValue(),i,n),this.clearcoatNormalTextureNode?.setNamedShaderUniforms(e,t,s,t.x3d_ClearcoatNormalTextureEXT,this._clearcoatNormalTextureMapping.getValue(),i,n))}}),Object.defineProperties(ne,{typeName:{value:"ClearcoatMaterialExtension",enumerable:!0},componentInfo:{value:Object.freeze({name:"X_ITE",level:1}),enumerable:!0},containerField:{value:"extensions",enumerable:!0},specificationRange:{value:Object.freeze({from:"4.0",to:"Infinity"}),enumerable:!0},fieldDefinitions:{value:new(u())([new(o())(c().inputOutput,"metadata",new(n().SFNode)),new(o())(c().inputOutput,"clearcoat",new(n().SFFloat)),new(o())(c().inputOutput,"clearcoatTextureMapping",new(n().SFString)),new(o())(c().inputOutput,"clearcoatTexture",new(n().SFNode)),new(o())(c().inputOutput,"clearcoatRoughness",new(n().SFFloat)),new(o())(c().inputOutput,"clearcoatRoughnessTextureMapping",new(n().SFString)),new(o())(c().inputOutput,"clearcoatRoughnessTexture",new(n().SFNode)),new(o())(c().inputOutput,"clearcoatNormalTextureMapping",new(n().SFString)),new(o())(c().inputOutput,"clearcoatNormalTexture",new(n().SFNode))]),enumerable:!0}});const re=ne;d().add("ClearcoatMaterialExtension","x_ite/Components/X_ITE/ClearcoatMaterialExtension",re);const oe=re;function ae(e){$.call(this,e),this.addType(c().DispersionMaterialExtension)}Object.assign(Object.setPrototypeOf(ae.prototype,$.prototype),{initialize(){$.prototype.initialize.call(this),this._dispersion.addInterest("set_dispersion__",this),this.set_dispersion__()},set_dispersion__(){this.dispersion=Math.max(this._dispersion.getValue(),0)},getExtensionKey:()=>ee.DISPERSION_MATERIAL_EXTENSION,getShaderOptions(e){e.push("X3D_DISPERSION_MATERIAL_EXT")},setShaderUniforms(e,t,s,i,n){e.uniform1f(t.x3d_DispersionEXT,this.dispersion)}}),Object.defineProperties(ae,{typeName:{value:"DispersionMaterialExtension",enumerable:!0},componentInfo:{value:Object.freeze({name:"X_ITE",level:1}),enumerable:!0},containerField:{value:"extensions",enumerable:!0},specificationRange:{value:Object.freeze({from:"4.0",to:"Infinity"}),enumerable:!0},fieldDefinitions:{value:new(u())([new(o())(c().inputOutput,"metadata",new(n().SFNode)),new(o())(c().inputOutput,"dispersion",new(n().SFFloat))]),enumerable:!0}});const ue=ae;d().add("DispersionMaterialExtension","x_ite/Components/X_ITE/DispersionMaterialExtension",ue);const _e=ue;function le(e){$.call(this,e),this.addType(c().EmissiveStrengthMaterialExtension)}Object.assign(Object.setPrototypeOf(le.prototype,$.prototype),{initialize(){$.prototype.initialize.call(this),this._emissiveStrength.addInterest("set_emissiveStrength__",this),this.set_emissiveStrength__()},set_emissiveStrength__(){this.emissiveStrength=Math.max(this._emissiveStrength.getValue(),0)},getExtensionKey:()=>ee.EMISSIVE_STRENGTH_MATERIAL_EXTENSION,getShaderOptions(e){e.push("X3D_EMISSIVE_STRENGTH_MATERIAL_EXT")},setShaderUniforms(e,t,s,i,n){e.uniform1f(t.x3d_EmissiveStrengthEXT,this.emissiveStrength)}}),Object.defineProperties(le,{typeName:{value:"EmissiveStrengthMaterialExtension",enumerable:!0},componentInfo:{value:Object.freeze({name:"X_ITE",level:1}),enumerable:!0},containerField:{value:"extensions",enumerable:!0},specificationRange:{value:Object.freeze({from:"4.0",to:"Infinity"}),enumerable:!0},fieldDefinitions:{value:new(u())([new(o())(c().inputOutput,"metadata",new(n().SFNode)),new(o())(c().inputOutput,"emissiveStrength",new(n().SFFloat)(1))]),enumerable:!0}});const he=le;d().add("EmissiveStrengthMaterialExtension","x_ite/Components/X_ITE/EmissiveStrengthMaterialExtension",he);const ce=he;function pe(e){$.call(this,e),this.addType(c().IORMaterialExtension)}Object.assign(Object.setPrototypeOf(pe.prototype,$.prototype),{initialize(){$.prototype.initialize.call(this),this._indexOfRefraction.addInterest("set_indexOfRefraction__",this),this.set_indexOfRefraction__()},set_indexOfRefraction__(){this.indexOfRefraction=Math.max(this._indexOfRefraction.getValue(),1)},getExtensionKey:()=>ee.IOR_MATERIAL_EXTENSION,getShaderOptions(e){e.push("X3D_IOR_MATERIAL_EXT")},setShaderUniforms(e,t,s,i,n){e.uniform1f(t.x3d_IorEXT,this.indexOfRefraction)}}),Object.defineProperties(pe,{typeName:{value:"IORMaterialExtension",enumerable:!0},componentInfo:{value:Object.freeze({name:"X_ITE",level:1}),enumerable:!0},containerField:{value:"extensions",enumerable:!0},specificationRange:{value:Object.freeze({from:"4.0",to:"Infinity"}),enumerable:!0},fieldDefinitions:{value:new(u())([new(o())(c().inputOutput,"metadata",new(n().SFNode)),new(o())(c().inputOutput,"indexOfRefraction",new(n().SFFloat)(1.5))]),enumerable:!0}});const de=pe;d().add("IORMaterialExtension","x_ite/Components/X_ITE/IORMaterialExtension",de);const Te=de;function xe(e){$.call(this,e),this.addType(c().IridescenceMaterialExtension)}Object.assign(Object.setPrototypeOf(xe.prototype,$.prototype),{initialize(){$.prototype.initialize.call(this),this._iridescence.addInterest("set_iridescence__",this),this._iridescenceTexture.addInterest("set_iridescenceTexture__",this),this._iridescenceIndexOfRefraction.addInterest("set_iridescenceIndexOfRefraction__",this),this._iridescenceThicknessMinimum.addInterest("set_iridescenceThicknessMinimum__",this),this._iridescenceThicknessMaximum.addInterest("set_iridescenceThicknessMaximum__",this),this._iridescenceThicknessTexture.addInterest("set_iridescenceThicknessTexture__",this),this.set_iridescence__(),this.set_iridescenceTexture__(),this.set_iridescenceIndexOfRefraction__(),this.set_iridescenceThicknessMinimum__(),this.set_iridescenceThicknessMaximum__(),this.set_iridescenceThicknessTexture__()},set_iridescence__(){this.iridescence=Math.max(this._iridescence.getValue(),0)},set_iridescenceTexture__(){this.iridescenceTextureNode=V()(c().X3DSingleTextureNode,this._iridescenceTexture),this.setTexture(0,this.iridescenceTextureNode)},set_iridescenceIndexOfRefraction__(){this.iridescenceIndexOfRefraction=Math.max(this._iridescenceIndexOfRefraction.getValue(),1)},set_iridescenceThicknessMinimum__(){this.iridescenceThicknessMinimum=Math.max(this._iridescenceThicknessMinimum.getValue(),0)},set_iridescenceThicknessMaximum__(){this.iridescenceThicknessMaximum=Math.max(this._iridescenceThicknessMaximum.getValue(),0)},set_iridescenceThicknessTexture__(){this.iridescenceThicknessTextureNode=V()(c().X3DSingleTextureNode,this._iridescenceThicknessTexture),this.setTexture(1,this.iridescenceThicknessTextureNode)},getExtensionKey:()=>ee.IRIDESCENCE_MATERIAL_EXTENSION,getShaderOptions(e){e.push("X3D_IRIDESCENCE_MATERIAL_EXT"),+this.getTextureBits()&&(e.push("X3D_MATERIAL_TEXTURES"),this.iridescenceTextureNode?.getShaderOptions(e,"IRIDESCENCE",!0),this.iridescenceThicknessTextureNode?.getShaderOptions(e,"IRIDESCENCE_THICKNESS",!0))},setShaderUniforms(e,t,s,i,n){e.uniform1f(t.x3d_IridescenceEXT,this.iridescence),e.uniform1f(t.x3d_IridescenceIndexOfRefractionEXT,this.iridescenceIndexOfRefraction),e.uniform1f(t.x3d_IridescenceThicknessMinimumEXT,this.iridescenceThicknessMinimum),e.uniform1f(t.x3d_IridescenceThicknessMaximumEXT,this.iridescenceThicknessMaximum),+this.getTextureBits()&&(this.iridescenceTextureNode?.setNamedShaderUniforms(e,t,s,t.x3d_IridescenceTextureEXT,this._iridescenceTextureMapping.getValue(),i,n),this.iridescenceThicknessTextureNode?.setNamedShaderUniforms(e,t,s,t.x3d_IridescenceThicknessTextureEXT,this._iridescenceThicknessTextureMapping.getValue(),i,n))}}),Object.defineProperties(xe,{typeName:{value:"IridescenceMaterialExtension",enumerable:!0},componentInfo:{value:Object.freeze({name:"X_ITE",level:1}),enumerable:!0},containerField:{value:"extensions",enumerable:!0},specificationRange:{value:Object.freeze({from:"4.0",to:"Infinity"}),enumerable:!0},fieldDefinitions:{value:new(u())([new(o())(c().inputOutput,"metadata",new(n().SFNode)),new(o())(c().inputOutput,"iridescence",new(n().SFFloat)),new(o())(c().inputOutput,"iridescenceTextureMapping",new(n().SFString)),new(o())(c().inputOutput,"iridescenceTexture",new(n().SFNode)),new(o())(c().inputOutput,"iridescenceIndexOfRefraction",new(n().SFFloat)(1.3)),new(o())(c().inputOutput,"iridescenceThicknessMinimum",new(n().SFFloat)(100)),new(o())(c().inputOutput,"iridescenceThicknessMaximum",new(n().SFFloat)(400)),new(o())(c().inputOutput,"iridescenceThicknessTextureMapping",new(n().SFString)),new(o())(c().inputOutput,"iridescenceThicknessTexture",new(n().SFNode))]),enumerable:!0}});const Se=xe;d().add("IridescenceMaterialExtension","x_ite/Components/X_ITE/IridescenceMaterialExtension",Se);const Ee=Se;function me(e){$.call(this,e),this.addType(c().SheenMaterialExtension),this.sheenColorArray=new Float32Array(3)}Object.assign(Object.setPrototypeOf(me.prototype,$.prototype),{initialize(){$.prototype.initialize.call(this),this._sheenColor.addInterest("set_sheenColor__",this),this._sheenColorTexture.addInterest("set_sheenColorTexture__",this),this._sheenRoughness.addInterest("set_sheenRoughness__",this),this._sheenRoughnessTexture.addInterest("set_sheenRoughnessTexture__",this),this.set_sheenColor__(),this.set_sheenColorTexture__(),this.set_sheenRoughness__(),this.set_sheenRoughnessTexture__()},set_sheenColor__(){const e=this.sheenColorArray,t=this._sheenColor.getValue();e[0]=t.r,e[1]=t.g,e[2]=t.b},set_sheenColorTexture__(){this.sheenColorTextureNode=V()(c().X3DSingleTextureNode,this._sheenColorTexture),this.setTexture(0,this.sheenColorTextureNode)},set_sheenRoughness__(){this.sheenRoughness=B().clamp(this._sheenRoughness.getValue(),0,1)},set_sheenRoughnessTexture__(){this.sheenRoughnessTextureNode=V()(c().X3DSingleTextureNode,this._sheenRoughnessTexture),this.setTexture(1,this.sheenRoughnessTextureNode)},getExtensionKey:()=>ee.SHEEN_MATERIAL_EXTENSION,getShaderOptions(e){e.push("X3D_SHEEN_MATERIAL_EXT"),+this.getTextureBits()&&(e.push("X3D_MATERIAL_TEXTURES"),this.sheenColorTextureNode?.getShaderOptions(e,"SHEEN_COLOR",!0),this.sheenRoughnessTextureNode?.getShaderOptions(e,"SHEEN_ROUGHNESS",!0))},setShaderUniforms(e,t,s,i,n){e.uniform3fv(t.x3d_SheenColorEXT,this.sheenColorArray),e.uniform1f(t.x3d_SheenRoughnessEXT,this.sheenRoughness);const r=this.getBrowser(),o=r.getLibraryTexture("lut_sheen_E.png"),a=r.getTexture2DUnit();e.activeTexture(e.TEXTURE0+a),e.bindTexture(e.TEXTURE_2D,o.getTexture()),e.uniform1i(t.x3d_SheenELUTTextureEXT,a),+this.getTextureBits()&&(this.sheenColorTextureNode?.setNamedShaderUniforms(e,t,s,t.x3d_SheenColorTextureEXT,this._sheenColorTextureMapping.getValue(),i,n),this.sheenRoughnessTextureNode?.setNamedShaderUniforms(e,t,s,t.x3d_SheenRoughnessTextureEXT,this._sheenRoughnessTextureMapping.getValue(),i,n))}}),Object.defineProperties(me,{typeName:{value:"SheenMaterialExtension",enumerable:!0},componentInfo:{value:Object.freeze({name:"X_ITE",level:1}),enumerable:!0},containerField:{value:"extensions",enumerable:!0},specificationRange:{value:Object.freeze({from:"4.0",to:"Infinity"}),enumerable:!0},fieldDefinitions:{value:new(u())([new(o())(c().inputOutput,"metadata",new(n().SFNode)),new(o())(c().inputOutput,"sheenColor",new(n().SFColor)),new(o())(c().inputOutput,"sheenColorTextureMapping",new(n().SFString)),new(o())(c().inputOutput,"sheenColorTexture",new(n().SFNode)),new(o())(c().inputOutput,"sheenRoughness",new(n().SFFloat)),new(o())(c().inputOutput,"sheenRoughnessTextureMapping",new(n().SFString)),new(o())(c().inputOutput,"sheenRoughnessTexture",new(n().SFNode))]),enumerable:!0}});const fe=me;d().add("SheenMaterialExtension","x_ite/Components/X_ITE/SheenMaterialExtension",fe);const ge=fe;function Oe(e){$.call(this,e),this.addType(c().SpecularMaterialExtension),this.specularColorArray=new Float32Array(3)}Object.assign(Object.setPrototypeOf(Oe.prototype,$.prototype),{initialize(){$.prototype.initialize.call(this),this._specular.addInterest("set_specular__",this),this._specularTexture.addInterest("set_specularTexture__",this),this._specularColor.addInterest("set_specularColor__",this),this._specularColorTexture.addInterest("set_specularColorTexture__",this),this.set_specular__(),this.set_specularTexture__(),this.set_specularColor__(),this.set_specularColorTexture__()},set_specular__(){this.specular=Math.max(this._specular.getValue(),0)},set_specularTexture__(){this.specularTextureNode=V()(c().X3DSingleTextureNode,this._specularTexture),this.setTexture(0,this.specularTextureNode)},set_specularColor__(){const e=this.specularColorArray,t=this._specularColor.getValue();e[0]=t.r,e[1]=t.g,e[2]=t.b},set_specularColorTexture__(){this.specularColorTextureNode=V()(c().X3DSingleTextureNode,this._specularColorTexture),this.setTexture(1,this.specularColorTextureNode)},getExtensionKey:()=>ee.SPECULAR_MATERIAL_EXTENSION,getShaderOptions(e){e.push("X3D_SPECULAR_MATERIAL_EXT"),+this.getTextureBits()&&(e.push("X3D_MATERIAL_TEXTURES"),this.specularTextureNode?.getShaderOptions(e,"SPECULAR",!0),this.specularColorTextureNode?.getShaderOptions(e,"SPECULAR_COLOR",!0))},setShaderUniforms(e,t,s,i,n){e.uniform1f(t.x3d_SpecularEXT,this.specular),e.uniform3fv(t.x3d_SpecularColorEXT,this.specularColorArray),+this.getTextureBits()&&(this.specularTextureNode?.setNamedShaderUniforms(e,t,s,t.x3d_SpecularTextureEXT,this._specularTextureMapping.getValue(),i,n),this.specularColorTextureNode?.setNamedShaderUniforms(e,t,s,t.x3d_SpecularColorTextureEXT,this._specularColorTextureMapping.getValue(),i,n))}}),Object.defineProperties(Oe,{typeName:{value:"SpecularMaterialExtension",enumerable:!0},componentInfo:{value:Object.freeze({name:"X_ITE",level:1}),enumerable:!0},containerField:{value:"extensions",enumerable:!0},specificationRange:{value:Object.freeze({from:"4.0",to:"Infinity"}),enumerable:!0},fieldDefinitions:{value:new(u())([new(o())(c().inputOutput,"metadata",new(n().SFNode)),new(o())(c().inputOutput,"specular",new(n().SFFloat)(1)),new(o())(c().inputOutput,"specularTextureMapping",new(n().SFString)),new(o())(c().inputOutput,"specularTexture",new(n().SFNode)),new(o())(c().inputOutput,"specularColor",new(n().SFColor)(1,1,1)),new(o())(c().inputOutput,"specularColorTextureMapping",new(n().SFString)),new(o())(c().inputOutput,"specularColorTexture",new(n().SFNode))]),enumerable:!0}});const Ne=Oe;d().add("SpecularMaterialExtension","x_ite/Components/X_ITE/SpecularMaterialExtension",Ne);const Ie=Ne;function ye(e){$.call(this,e),this.addType(c().TransmissionMaterialExtension)}Object.assign(Object.setPrototypeOf(ye.prototype,$.prototype),{initialize(){$.prototype.initialize.call(this),this._transmission.addInterest("set_transmission__",this),this._transmissionTexture.addInterest("set_transmissionTexture__",this),this.set_transmission__(),this.set_transmissionTexture__()},set_transmission__(){this.transmission=Math.max(this._transmission.getValue(),0)},set_transmissionTexture__(){this.transmissionTextureNode=V()(c().X3DSingleTextureNode,this._transmissionTexture),this.setTexture(0,this.transmissionTextureNode)},getExtensionKey:()=>ee.TRANSMISSION_MATERIAL_EXTENSION,getShaderOptions(e){e.push("X3D_TRANSMISSION_MATERIAL_EXT"),+this.getTextureBits()&&(e.push("X3D_MATERIAL_TEXTURES"),this.transmissionTextureNode?.getShaderOptions(e,"TRANSMISSION",!0))},setShaderUniforms(e,t,s,i,n){const r=this.getBrowser(),o=r.getTransmissionBuffer(),a=r.getTexture2DUnit();e.uniform1f(t.x3d_TransmissionEXT,this.transmission),e.activeTexture(e.TEXTURE0+a),e.bindTexture(e.TEXTURE_2D,o.getColorTexture()),e.uniform1i(t.x3d_TransmissionFramebufferSamplerEXT,a),e.uniform2i(t.x3d_TransmissionFramebufferSizeEXT,o.getWidth(),o.getHeight()),+this.getTextureBits()&&this.transmissionTextureNode?.setNamedShaderUniforms(e,t,s,t.x3d_TransmissionTextureEXT,this._transmissionTextureMapping.getValue(),i,n)}}),Object.defineProperties(ye,{typeName:{value:"TransmissionMaterialExtension",enumerable:!0},componentInfo:{value:Object.freeze({name:"X_ITE",level:1}),enumerable:!0},containerField:{value:"extensions",enumerable:!0},specificationRange:{value:Object.freeze({from:"4.0",to:"Infinity"}),enumerable:!0},fieldDefinitions:{value:new(u())([new(o())(c().inputOutput,"metadata",new(n().SFNode)),new(o())(c().inputOutput,"transmission",new(n().SFFloat)),new(o())(c().inputOutput,"transmissionTextureMapping",new(n().SFString)),new(o())(c().inputOutput,"transmissionTexture",new(n().SFNode))]),enumerable:!0}});const we=ye;d().add("TransmissionMaterialExtension","x_ite/Components/X_ITE/TransmissionMaterialExtension",we);const Ae=we;function Re(e){$.call(this,e),this.addType(c().VolumeMaterialExtension),this.attenuationColorArray=new Float32Array(3)}Object.assign(Object.setPrototypeOf(Re.prototype,$.prototype),{initialize(){$.prototype.initialize.call(this),this._thickness.addInterest("set_thickness__",this),this._thicknessTexture.addInterest("set_thicknessTexture__",this),this._attenuationDistance.addInterest("set_attenuationDistance__",this),this._attenuationColor.addInterest("set_attenuationColor__",this),this.set_thickness__(),this.set_thicknessTexture__(),this.set_attenuationDistance__(),this.set_attenuationColor__()},set_thickness__(){this.thickness=Math.max(this._thickness.getValue(),0)},set_thicknessTexture__(){this.thicknessTextureNode=V()(c().X3DSingleTextureNode,this._thicknessTexture),this.setTexture(0,this.thicknessTextureNode)},set_attenuationDistance__(){this.attenuationDistance=Math.max(this._attenuationDistance.getValue(),0)},set_attenuationColor__(){const e=this.attenuationColorArray,t=this._attenuationColor.getValue();e[0]=t.r,e[1]=t.g,e[2]=t.b},getExtensionKey:()=>ee.VOLUME_MATERIAL_EXTENSION,getShaderOptions(e){e.push("X3D_VOLUME_MATERIAL_EXT"),+this.getTextureBits()&&(e.push("X3D_MATERIAL_TEXTURES"),this.thicknessTextureNode?.getShaderOptions(e,"THICKNESS",!0))},setShaderUniforms(e,t,s,i,n){e.uniform1f(t.x3d_ThicknessEXT,this.thickness),e.uniform1f(t.x3d_AttenuationDistanceEXT,this.attenuationDistance),e.uniform3fv(t.x3d_AttenuationColorEXT,this.attenuationColorArray),+this.getTextureBits()&&this.thicknessTextureNode?.setNamedShaderUniforms(e,t,s,t.x3d_ThicknessTextureEXT,this._thicknessTextureMapping.getValue(),i,n)}}),Object.defineProperties(Re,{typeName:{value:"VolumeMaterialExtension",enumerable:!0},componentInfo:{value:Object.freeze({name:"X_ITE",level:1}),enumerable:!0},containerField:{value:"extensions",enumerable:!0},specificationRange:{value:Object.freeze({from:"4.0",to:"Infinity"}),enumerable:!0},fieldDefinitions:{value:new(u())([new(o())(c().inputOutput,"metadata",new(n().SFNode)),new(o())(c().inputOutput,"thickness",new(n().SFFloat)),new(o())(c().inputOutput,"thicknessTextureMapping",new(n().SFString)),new(o())(c().inputOutput,"thicknessTexture",new(n().SFNode)),new(o())(c().inputOutput,"attenuationDistance",new(n().SFFloat)(1e6)),new(o())(c().inputOutput,"attenuationColor",new(n().SFColor)(1,1,1))]),enumerable:!0}});const Ce=Re;d().add("VolumeMaterialExtension","x_ite/Components/X_ITE/VolumeMaterialExtension",Ce);const be=Ce;s().add({name:"X_ITE",concreteNodes:[S,f,v,q,ie,oe,_e,ce,Te,Ee,ge,Ie,Ae,be],abstractNodes:[$]});const Me=void 0;d().add("X_ITE","assets/components/X_ITE",Me)})();