x_ite 8.10.1 → 8.11.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 (137) hide show
  1. package/Makefile +3 -0
  2. package/build/bin/version.pl +28 -20
  3. package/build/docs/glTF-samples.pl +151 -0
  4. package/build/docs/nodes.pl +1 -1
  5. package/build/src/nodes.pl +41 -0
  6. package/dist/assets/components/Annotation.js +13 -13
  7. package/dist/assets/components/Annotation.min.js +1 -1
  8. package/dist/assets/components/CADGeometry.js +13 -13
  9. package/dist/assets/components/CADGeometry.min.js +1 -1
  10. package/dist/assets/components/CubeMapTexturing.js +30 -26
  11. package/dist/assets/components/CubeMapTexturing.min.js +1 -1
  12. package/dist/assets/components/DIS.js +14 -14
  13. package/dist/assets/components/DIS.min.js +1 -1
  14. package/dist/assets/components/EventUtilities.js +9 -9
  15. package/dist/assets/components/EventUtilities.min.js +1 -1
  16. package/dist/assets/components/Geometry2D.js +19 -19
  17. package/dist/assets/components/Geometry2D.min.js +1 -1
  18. package/dist/assets/components/Geospatial.js +33 -33
  19. package/dist/assets/components/Geospatial.min.js +1 -1
  20. package/dist/assets/components/HAnim.js +394 -30
  21. package/dist/assets/components/HAnim.min.js +1 -1
  22. package/dist/assets/components/KeyDeviceSensor.js +8 -8
  23. package/dist/assets/components/KeyDeviceSensor.min.js +1 -1
  24. package/dist/assets/components/Layout.js +26 -26
  25. package/dist/assets/components/Layout.min.js +1 -1
  26. package/dist/assets/components/NURBS.js +24 -24
  27. package/dist/assets/components/NURBS.min.js +1 -1
  28. package/dist/assets/components/ParticleSystems.js +73 -74
  29. package/dist/assets/components/ParticleSystems.min.js +1 -1
  30. package/dist/assets/components/Picking.js +18 -18
  31. package/dist/assets/components/Picking.min.js +1 -1
  32. package/dist/assets/components/RigidBodyPhysics.js +18 -18
  33. package/dist/assets/components/RigidBodyPhysics.min.js +1 -1
  34. package/dist/assets/components/Scripting.js +37 -37
  35. package/dist/assets/components/Scripting.min.js +1 -1
  36. package/dist/assets/components/Text.js +55 -63
  37. package/dist/assets/components/Text.min.js +1 -1
  38. package/dist/assets/components/TextureProjector.js +14 -14
  39. package/dist/assets/components/TextureProjector.min.js +1 -1
  40. package/dist/assets/components/Texturing3D.js +35 -31
  41. package/dist/assets/components/Texturing3D.min.js +1 -1
  42. package/dist/assets/components/VolumeRendering.js +20 -20
  43. package/dist/assets/components/VolumeRendering.min.js +1 -1
  44. package/dist/assets/components/X_ITE.js +9 -9
  45. package/dist/assets/components/X_ITE.min.js +1 -1
  46. package/dist/x_ite.css +1 -1
  47. package/dist/x_ite.js +1456 -844
  48. package/dist/x_ite.min.js +1 -1
  49. package/dist/x_ite.zip +0 -0
  50. package/docs/_config.yml +2 -2
  51. package/docs/_posts/components/Core/MetadataBoolean.md +6 -4
  52. package/docs/_posts/components/Core/MetadataDouble.md +6 -4
  53. package/docs/_posts/components/Core/MetadataFloat.md +6 -4
  54. package/docs/_posts/components/Core/MetadataInteger.md +6 -4
  55. package/docs/_posts/components/Core/MetadataSet.md +6 -4
  56. package/docs/_posts/components/Core/MetadataString.md +6 -4
  57. package/docs/_posts/components/DIS/DISEntityTypeMapping.md +1 -1
  58. package/docs/_posts/components/HAnim/HAnimMotion.md +48 -48
  59. package/docs/_posts/components/RigidBodyPhysics/Contact.md +1 -1
  60. package/docs/_posts/getting-started.md +45 -35
  61. package/docs/_posts/reference/browser-services.md +6 -0
  62. package/docs/_tabs/playground.html +215 -15
  63. package/docs/assets/css/style.scss +35 -2
  64. package/docs/assets/js/example.js +95 -3
  65. package/docs/laboratory/gltf-sample-viewer.html +603 -235
  66. package/package.json +2 -2
  67. package/src/assets/shaders/Types.glsl.js +4 -0
  68. package/src/assets/shaders/webgl1/include/Hatch.glsl.js +2 -3
  69. package/src/assets/shaders/webgl2/Compose.fs.js +29 -0
  70. package/src/assets/shaders/webgl2/Compose.vs.js +14 -0
  71. package/src/assets/shaders/webgl2/include/Fragment.glsl.js +24 -2
  72. package/src/assets/shaders/webgl2/include/Hatch.glsl.js +2 -3
  73. package/src/assets/shaders/webgl2/include/Stipple.glsl.js +5 -3
  74. package/src/bookmarks.js +92 -5
  75. package/src/examples.js +1 -0
  76. package/src/standard/Math/Numbers/Quaternion.js +191 -13
  77. package/src/standard/Math/Numbers/Rotation4.js +23 -0
  78. package/src/standard/Time/{MicroTime.js → Time.js} +21 -28
  79. package/src/x_ite/Base/X3DChildObject.js +5 -4
  80. package/src/x_ite/Browser/Core/BrowserOptions.js +71 -60
  81. package/src/x_ite/Browser/Core/Context.js +2 -2
  82. package/src/x_ite/Browser/Core/X3DCoreContext.js +6 -0
  83. package/src/x_ite/Browser/DOMIntegration.js +0 -17
  84. package/src/x_ite/Browser/Navigation/ExamineViewer.js +5 -4
  85. package/src/x_ite/Browser/Navigation/X3DFlyViewer.js +7 -4
  86. package/src/x_ite/Browser/Rendering/X3DRenderingContext.js +20 -15
  87. package/src/x_ite/Browser/Shaders/Shaders.js +19 -15
  88. package/src/x_ite/Browser/Text/X3DTextContext.js +16 -16
  89. package/src/x_ite/Browser/Time/X3DTimeContext.js +3 -2
  90. package/src/x_ite/Browser/VERSION.js +1 -1
  91. package/src/x_ite/Browser/VolumeRendering/VolumeMaterial.js +2 -2
  92. package/src/x_ite/Browser/X3DBrowser.js +1 -2
  93. package/src/x_ite/Browser/X3DBrowserContext.js +0 -5
  94. package/src/x_ite/Components/Core/MetadataBoolean.js +8 -1
  95. package/src/x_ite/Components/Core/MetadataDouble.js +8 -1
  96. package/src/x_ite/Components/Core/MetadataFloat.js +8 -1
  97. package/src/x_ite/Components/Core/MetadataInteger.js +8 -1
  98. package/src/x_ite/Components/Core/MetadataSet.js +8 -1
  99. package/src/x_ite/Components/Core/MetadataString.js +8 -1
  100. package/src/x_ite/Components/Core/X3DPrototypeInstance.js +9 -6
  101. package/src/x_ite/Components/CubeMapTexturing/ImageCubeMapTexture.js +2 -1
  102. package/src/x_ite/Components/DIS/DISEntityTypeMapping.js +1 -1
  103. package/src/x_ite/Components/EnvironmentalEffects/X3DBackgroundNode.js +5 -1
  104. package/src/x_ite/Components/Grouping/X3DGroupingNode.js +2 -0
  105. package/src/x_ite/Components/HAnim/HAnimHumanoid.js +34 -2
  106. package/src/x_ite/Components/HAnim/HAnimMotion.js +331 -15
  107. package/src/x_ite/Components/Lighting/DirectionalLight.js +1 -3
  108. package/src/x_ite/Components/Lighting/PointLight.js +1 -3
  109. package/src/x_ite/Components/Lighting/SpotLight.js +1 -3
  110. package/src/x_ite/Components/Networking/X3DUrlObject.js +5 -4
  111. package/src/x_ite/Components/ParticleSystems/ParticleSystem.js +47 -51
  112. package/src/x_ite/Components/Rendering/X3DGeometryNode.js +4 -2
  113. package/src/x_ite/Components/RigidBodyPhysics/Contact.js +1 -1
  114. package/src/x_ite/Components/Shaders/X3DProgrammableShaderObject.js +1 -1
  115. package/src/x_ite/Components/Shape/FillProperties.js +4 -0
  116. package/src/x_ite/Components/Shape/LineProperties.js +4 -0
  117. package/src/x_ite/Components/Shape/PointProperties.js +4 -0
  118. package/src/x_ite/Components/Shape/X3DMaterialNode.js +44 -20
  119. package/src/x_ite/Components/Sound/AudioClip.js +2 -1
  120. package/src/x_ite/Components/Text/X3DFontStyleNode.js +13 -23
  121. package/src/x_ite/Components/Texturing/ImageTexture.js +2 -1
  122. package/src/x_ite/Components/Texturing/MovieTexture.js +2 -1
  123. package/src/x_ite/Components/Texturing3D/ImageTextureAtlas.js +2 -1
  124. package/src/x_ite/Components/Time/TimeSensor.js +25 -24
  125. package/src/x_ite/Components/Time/X3DTimeDependentNode.js +5 -4
  126. package/src/x_ite/Execution/BindableList.js +3 -3
  127. package/src/x_ite/Execution/X3DScene.js +2 -0
  128. package/src/x_ite/Parser/XMLParser.js +12 -2
  129. package/src/x_ite/Rendering/MultiSampleFrameBuffer.js +264 -26
  130. package/src/x_ite/Rendering/PointingBuffer.js +5 -7
  131. package/src/x_ite/Rendering/TextureBuffer.js +6 -14
  132. package/src/x_ite/Rendering/X3DRenderObject.js +28 -28
  133. package/src/x_ite/X3D.js +0 -1
  134. package/src/x_ite/X3DCanvasElement.js +2 -0
  135. package/src/x_ite.html +23 -24
  136. package/x_ite.min.html +23 -24
  137. /package/build/{bin → docs}/tags.pl +0 -0
@@ -1,4 +1,4 @@
1
- /* X_ITE v8.10.1 */(() => { // webpackBootstrap
1
+ /* X_ITE v8.11.0 */(() => { // webpackBootstrap
2
2
  /******/ "use strict";
3
3
  /******/ // The require scope
4
4
  /******/ var __webpack_require__ = {};
@@ -39,31 +39,31 @@ var __webpack_exports__ = {};
39
39
  // UNUSED EXPORTS: default
40
40
 
41
41
  ;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"x_ite/Components\")"
42
- const Components_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.10.1")] .require ("x_ite/Components");
42
+ const Components_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.11.0")] .require ("x_ite/Components");
43
43
  var Components_default = /*#__PURE__*/__webpack_require__.n(Components_namespaceObject);
44
44
  ;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"x_ite/Components/Texturing/PixelTexture\")"
45
- const PixelTexture_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.10.1")] .require ("x_ite/Components/Texturing/PixelTexture");
45
+ const PixelTexture_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.11.0")] .require ("x_ite/Components/Texturing/PixelTexture");
46
46
  var PixelTexture_default = /*#__PURE__*/__webpack_require__.n(PixelTexture_namespaceObject);
47
47
  ;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"x_ite/Components/Texturing/TextureProperties\")"
48
- const TextureProperties_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.10.1")] .require ("x_ite/Components/Texturing/TextureProperties");
48
+ const TextureProperties_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.11.0")] .require ("x_ite/Components/Texturing/TextureProperties");
49
49
  var TextureProperties_default = /*#__PURE__*/__webpack_require__.n(TextureProperties_namespaceObject);
50
50
  ;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"x_ite/Fields\")"
51
- const Fields_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.10.1")] .require ("x_ite/Fields");
51
+ const Fields_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.11.0")] .require ("x_ite/Fields");
52
52
  var Fields_default = /*#__PURE__*/__webpack_require__.n(Fields_namespaceObject);
53
53
  ;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"x_ite/Base/X3DFieldDefinition\")"
54
- const X3DFieldDefinition_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.10.1")] .require ("x_ite/Base/X3DFieldDefinition");
54
+ const X3DFieldDefinition_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.11.0")] .require ("x_ite/Base/X3DFieldDefinition");
55
55
  var X3DFieldDefinition_default = /*#__PURE__*/__webpack_require__.n(X3DFieldDefinition_namespaceObject);
56
56
  ;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"x_ite/Base/FieldDefinitionArray\")"
57
- const FieldDefinitionArray_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.10.1")] .require ("x_ite/Base/FieldDefinitionArray");
57
+ const FieldDefinitionArray_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.11.0")] .require ("x_ite/Base/FieldDefinitionArray");
58
58
  var FieldDefinitionArray_default = /*#__PURE__*/__webpack_require__.n(FieldDefinitionArray_namespaceObject);
59
59
  ;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"x_ite/Components/Core/X3DNode\")"
60
- const X3DNode_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.10.1")] .require ("x_ite/Components/Core/X3DNode");
60
+ const X3DNode_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.11.0")] .require ("x_ite/Components/Core/X3DNode");
61
61
  var X3DNode_default = /*#__PURE__*/__webpack_require__.n(X3DNode_namespaceObject);
62
62
  ;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"x_ite/Base/X3DConstants\")"
63
- const X3DConstants_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.10.1")] .require ("x_ite/Base/X3DConstants");
63
+ const X3DConstants_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.11.0")] .require ("x_ite/Base/X3DConstants");
64
64
  var X3DConstants_default = /*#__PURE__*/__webpack_require__.n(X3DConstants_namespaceObject);
65
65
  ;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"x_ite/Namespace\")"
66
- const Namespace_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.10.1")] .require ("x_ite/Namespace");
66
+ const Namespace_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.11.0")] .require ("x_ite/Namespace");
67
67
  var Namespace_default = /*#__PURE__*/__webpack_require__.n(Namespace_namespaceObject);
68
68
  ;// CONCATENATED MODULE: ./src/x_ite/Components/VolumeRendering/X3DVolumeRenderStyleNode.js
69
69
  /*******************************************************************************
@@ -288,7 +288,7 @@ const X3DComposableVolumeRenderStyleNode_default_ = X3DComposableVolumeRenderSty
288
288
  Namespace_default().set ("x_ite/Components/VolumeRendering/X3DComposableVolumeRenderStyleNode", X3DComposableVolumeRenderStyleNode_default_);
289
289
  /* harmony default export */ const VolumeRendering_X3DComposableVolumeRenderStyleNode = (X3DComposableVolumeRenderStyleNode_default_);
290
290
  ;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"x_ite/Base/X3DCast\")"
291
- const X3DCast_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.10.1")] .require ("x_ite/Base/X3DCast");
291
+ const X3DCast_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.11.0")] .require ("x_ite/Base/X3DCast");
292
292
  var X3DCast_default = /*#__PURE__*/__webpack_require__.n(X3DCast_namespaceObject);
293
293
  ;// CONCATENATED MODULE: ./src/x_ite/Components/VolumeRendering/OpacityMapVolumeStyle.js
294
294
  /*******************************************************************************
@@ -1840,16 +1840,16 @@ const EdgeEnhancementVolumeStyle_default_ = EdgeEnhancementVolumeStyle;
1840
1840
  Namespace_default().set ("x_ite/Components/VolumeRendering/EdgeEnhancementVolumeStyle", EdgeEnhancementVolumeStyle_default_);
1841
1841
  /* harmony default export */ const VolumeRendering_EdgeEnhancementVolumeStyle = (EdgeEnhancementVolumeStyle_default_);
1842
1842
  ;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"x_ite/Components/Core/X3DChildNode\")"
1843
- const X3DChildNode_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.10.1")] .require ("x_ite/Components/Core/X3DChildNode");
1843
+ const X3DChildNode_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.11.0")] .require ("x_ite/Components/Core/X3DChildNode");
1844
1844
  var X3DChildNode_default = /*#__PURE__*/__webpack_require__.n(X3DChildNode_namespaceObject);
1845
1845
  ;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"x_ite/Components/Grouping/X3DBoundedObject\")"
1846
- const X3DBoundedObject_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.10.1")] .require ("x_ite/Components/Grouping/X3DBoundedObject");
1846
+ const X3DBoundedObject_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.11.0")] .require ("x_ite/Components/Grouping/X3DBoundedObject");
1847
1847
  var X3DBoundedObject_default = /*#__PURE__*/__webpack_require__.n(X3DBoundedObject_namespaceObject);
1848
1848
  ;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"x_ite/Browser/Core/TextureQuality\")"
1849
- const TextureQuality_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.10.1")] .require ("x_ite/Browser/Core/TextureQuality");
1849
+ const TextureQuality_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.11.0")] .require ("x_ite/Browser/Core/TextureQuality");
1850
1850
  var TextureQuality_default = /*#__PURE__*/__webpack_require__.n(TextureQuality_namespaceObject);
1851
1851
  ;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"x_ite/Components/Shape/UnlitMaterial\")"
1852
- const UnlitMaterial_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.10.1")] .require ("x_ite/Components/Shape/UnlitMaterial");
1852
+ const UnlitMaterial_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.11.0")] .require ("x_ite/Components/Shape/UnlitMaterial");
1853
1853
  var UnlitMaterial_default = /*#__PURE__*/__webpack_require__.n(UnlitMaterial_namespaceObject);
1854
1854
  ;// CONCATENATED MODULE: ./src/x_ite/Browser/VolumeRendering/VolumeStyle.vs.js
1855
1855
  const VolumeStyle_vs_default_ = /* glsl */ `#version 300 es
@@ -2019,13 +2019,13 @@ Object .assign (Object .setPrototypeOf (VolumeMaterial .prototype, (UnlitMateria
2019
2019
 
2020
2020
  let key = "";
2021
2021
 
2022
- key += fogNode ? fogNode .getFogType () : 0;
2022
+ key += fogNode ?.getFogType () ?? 0;
2023
2023
  key += ".";
2024
2024
  key += objectsCount [0]; // Clip planes
2025
2025
  key += ".";
2026
2026
  key += objectsCount [1]; // Lights
2027
2027
 
2028
- return this .volumeShaderNodes .get (key) || this .createShader (key, geometryContext, renderContext);
2028
+ return this .volumeShaderNodes .get (key) ?? this .createShader (key, geometryContext, renderContext);
2029
2029
  },
2030
2030
  createShader (key, geometryContext, renderContext)
2031
2031
  {
@@ -2098,7 +2098,7 @@ const VolumeMaterial_default_ = VolumeMaterial;
2098
2098
  Namespace_default().set ("x_ite/Browser/VolumeRendering/VolumeMaterial", VolumeMaterial_default_);
2099
2099
  /* harmony default export */ const VolumeRendering_VolumeMaterial = (VolumeMaterial_default_);
2100
2100
  ;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"standard/Math/Numbers/Vector3\")"
2101
- const Vector3_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.10.1")] .require ("standard/Math/Numbers/Vector3");
2101
+ const Vector3_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.11.0")] .require ("standard/Math/Numbers/Vector3");
2102
2102
  var Vector3_default = /*#__PURE__*/__webpack_require__.n(Vector3_namespaceObject);
2103
2103
  ;// CONCATENATED MODULE: ./src/x_ite/Components/VolumeRendering/X3DVolumeDataNode.js
2104
2104
  /*******************************************************************************
@@ -2347,10 +2347,10 @@ const X3DVolumeDataNode_default_ = X3DVolumeDataNode;
2347
2347
  Namespace_default().set ("x_ite/Components/VolumeRendering/X3DVolumeDataNode", X3DVolumeDataNode_default_);
2348
2348
  /* harmony default export */ const VolumeRendering_X3DVolumeDataNode = (X3DVolumeDataNode_default_);
2349
2349
  ;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"x_ite/Components/Shaders/ComposedShader\")"
2350
- const ComposedShader_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.10.1")] .require ("x_ite/Components/Shaders/ComposedShader");
2350
+ const ComposedShader_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.11.0")] .require ("x_ite/Components/Shaders/ComposedShader");
2351
2351
  var ComposedShader_default = /*#__PURE__*/__webpack_require__.n(ComposedShader_namespaceObject);
2352
2352
  ;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"x_ite/Components/Shaders/ShaderPart\")"
2353
- const ShaderPart_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.10.1")] .require ("x_ite/Components/Shaders/ShaderPart");
2353
+ const ShaderPart_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.11.0")] .require ("x_ite/Components/Shaders/ShaderPart");
2354
2354
  var ShaderPart_default = /*#__PURE__*/__webpack_require__.n(ShaderPart_namespaceObject);
2355
2355
  ;// CONCATENATED MODULE: ./src/x_ite/Components/VolumeRendering/IsoSurfaceVolumeData.js
2356
2356
  /*******************************************************************************
@@ -1 +1 @@
1
- /* X_ITE v8.10.1 */(()=>{"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-8.10.1")].require("x_ite/Components");var n=e.n(t);const o=window[Symbol.for("X_ITE.X3D-8.10.1")].require("x_ite/Components/Texturing/PixelTexture");var r=e.n(o);const i=window[Symbol.for("X_ITE.X3D-8.10.1")].require("x_ite/Components/Texturing/TextureProperties");var s=e.n(i);const a=window[Symbol.for("X_ITE.X3D-8.10.1")].require("x_ite/Fields");var l=e.n(a);const d=window[Symbol.for("X_ITE.X3D-8.10.1")].require("x_ite/Base/X3DFieldDefinition");var u=e.n(d);const h=window[Symbol.for("X_ITE.X3D-8.10.1")].require("x_ite/Base/FieldDefinitionArray");var c=e.n(h);const p=window[Symbol.for("X_ITE.X3D-8.10.1")].require("x_ite/Components/Core/X3DNode");var m=e.n(p);const f=window[Symbol.for("X_ITE.X3D-8.10.1")].require("x_ite/Base/X3DConstants");var g=e.n(f);const _=window[Symbol.for("X_ITE.X3D-8.10.1")].require("x_ite/Namespace");var y=e.n(_);function x(e){m().call(this,e),this.addType(g().X3DVolumeRenderStyleNode),this.volumeDataNodes=new Set}Object.assign(Object.setPrototypeOf(x.prototype,m().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(x,{typeName:{value:"X3DVolumeRenderStyleNode",enumerable:!0},componentName:{value:"VolumeRendering",enumerable:!0}});const S=x;y().set("x_ite/Components/VolumeRendering/X3DVolumeRenderStyleNode",S);const N=S;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},componentName:{value:"VolumeRendering",enumerable:!0}});const w=v;y().set("x_ite/Components/VolumeRendering/X3DComposableVolumeRenderStyleNode",w);const b=w,C=window[Symbol.for("X_ITE.X3D-8.10.1")].require("x_ite/Base/X3DCast");var F=e.n(C);function I(e){b.call(this,e),this.addType(g().OpacityMapVolumeStyle)}Object.assign(Object.setPrototypeOf(I.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=F()(g().X3DTexture2DNode,this._transferFunction),this.transferFunctionNode||(this.transferFunctionNode=F()(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(I,{typeName:{value:"OpacityMapVolumeStyle",enumerable:!0},componentName:{value:"VolumeRendering",enumerable:!0},containerField:{value:"renderStyle",enumerable:!0},specificationRange:{value:Object.freeze(["3.3","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=I;y().set("x_ite/Components/VolumeRendering/OpacityMapVolumeStyle",O);const V=O,D=Symbol(),T=Symbol(),P=Symbol(),E=Symbol();function M(){}Object.assign(M.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 U=M;y().set("x_ite/Browser/VolumeRendering/X3DVolumeRenderingContext",U);const B=U;function R(e){b.call(this,e),this.addType(g().BlendedVolumeStyle)}Object.assign(Object.setPrototypeOf(R.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=F()(g().X3DTexture2DNode,this._weightTransferFunction1)},set_weightTransferFunction2__(){this.weightTransferFunction2Node=F()(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=F()(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=F()(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(R,{typeName:{value:"BlendedVolumeStyle",enumerable:!0},componentName:{value:"VolumeRendering",enumerable:!0},containerField:{value:"renderStyle",enumerable:!0},specificationRange:{value:Object.freeze(["3.3","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 j=R;y().set("x_ite/Components/VolumeRendering/BlendedVolumeStyle",j);const X=j;function z(e){b.call(this,e),this.addType(g().BoundaryEnhancementVolumeStyle)}Object.assign(Object.setPrototypeOf(z.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(z,{typeName:{value:"BoundaryEnhancementVolumeStyle",enumerable:!0},componentName:{value:"VolumeRendering",enumerable:!0},containerField:{value:"renderStyle",enumerable:!0},specificationRange:{value:Object.freeze(["3.3","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=z;y().set("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=F()(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},componentName:{value:"VolumeRendering",enumerable:!0},containerField:{value:"renderStyle",enumerable:!0},specificationRange:{value:Object.freeze(["3.3","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 H=G;y().set("x_ite/Components/VolumeRendering/CartoonVolumeStyle",H);const q=H;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=F()(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},componentName:{value:"VolumeRendering",enumerable:!0},containerField:{value:"renderStyle",enumerable:!0},specificationRange:{value:Object.freeze(["3.3","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().set("x_ite/Components/VolumeRendering/ComposedVolumeStyle",Y);const W=Y;function Q(e){b.call(this,e),this.addType(g().EdgeEnhancementVolumeStyle)}Object.assign(Object.setPrototypeOf(Q.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=F()(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(Q,{typeName:{value:"EdgeEnhancementVolumeStyle",enumerable:!0},componentName:{value:"VolumeRendering",enumerable:!0},containerField:{value:"renderStyle",enumerable:!0},specificationRange:{value:Object.freeze(["3.3","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 $=Q;y().set("x_ite/Components/VolumeRendering/EdgeEnhancementVolumeStyle",$);const Z=$,J=window[Symbol.for("X_ITE.X3D-8.10.1")].require("x_ite/Components/Core/X3DChildNode");var K=e.n(J);const ee=window[Symbol.for("X_ITE.X3D-8.10.1")].require("x_ite/Components/Grouping/X3DBoundedObject");var te=e.n(ee);const ne=window[Symbol.for("X_ITE.X3D-8.10.1")].require("x_ite/Browser/Core/TextureQuality");var oe=e.n(ne);const re=window[Symbol.for("X_ITE.X3D-8.10.1")].require("x_ite/Components/Shape/UnlitMaterial");var ie=e.n(re);const se="#version 300 es\n\nprecision highp float;\nprecision highp int;\n\nuniform mat4 x3d_ProjectionMatrix;\nuniform mat4 x3d_ModelViewMatrix;\nuniform mat4 x3d_TextureMatrix [1];\n\nin vec4 x3d_TexCoord0;\nin vec4 x3d_Vertex;\n\nout vec3 vertex;\nout vec4 texCoord;\n\nvoid\nmain ()\n{\n vec4 position = x3d_ModelViewMatrix * x3d_Vertex;\n\n vertex = position .xyz;\n texCoord = x3d_TextureMatrix [0] * x3d_TexCoord0;\n\n gl_Position = x3d_ProjectionMatrix * position;\n}\n";y().set("x_ite/Browser/VolumeRendering/VolumeStyle.vs",se);const ae=se,le='#version 300 es\n\nprecision highp float;\nprecision highp int;\nprecision highp sampler3D;\n\nin vec3 vertex;\nin vec4 texCoord;\n\nuniform sampler3D x3d_Texture3D [1];\nuniform mat3 x3d_TextureNormalMatrix;\n\nuniform x3d_LightSourceParameters x3d_LightSource [x3d_MaxLights];\n\nconst float M_PI = 3.14159265359;\n\n#pragma X3D include "includes/ClipPlanes.glsl"\n#pragma X3D include "includes/Fog.glsl"\n\n// VOLUME_STYLES_UNIFORMS\n\nout vec4 x3d_FragColor;\n\nvec4\ngetTextureColor (in vec3 texCoord)\n{\n if (texCoord .s < 0.0 || texCoord .s > 1.0)\n discard;\n\n if (texCoord .t < 0.0 || texCoord .t > 1.0)\n discard;\n\n if (texCoord .p < 0.0 || texCoord .p > 1.0)\n discard;\n\n vec4 textureColor = texture (x3d_Texture3D [0], texCoord);\n\n // Apply volume styles.\n\n// VOLUME_STYLES_FUNCTIONS\n\n return textureColor;\n}\n\nvoid\nmain ()\n{\n #if defined (X3D_CLIP_PLANES)\n clip ();\n #endif\n\n vec4 finalColor = getTextureColor (texCoord .stp / texCoord .q);\n\n #if defined (X3D_FOG)\n finalColor .rgb = getFogColor (finalColor .rgb);\n #endif\n\n x3d_FragColor = finalColor;\n}\n';y().set("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{fogNode:n,objectsCount:o}=t;let r="";return r+=n?n.getFogType():0,r+=".",r+=o[0],r+=".",r+=o[1],this.volumeShaderNodes.get(r)||this.createShader(r,e,t)},createShader(e,t,n){const o=this.getBrowser(),r=[],{fogNode:i,objectsCount:s}=n;switch(i?.getFogType()){case 1:r.push("X3D_FOG","X3D_FOG_LINEAR");break;case 2:r.push("X3D_FOG","X3D_FOG_EXPONENTIAL")}s[0]&&(r.push("X3D_CLIP_PLANES"),r.push(`X3D_NUM_CLIP_PLANES ${Math.min(s[0],o.getMaxClipPlanes())}`)),s[1]&&(r.push("X3D_LIGHTING"),r.push(`X3D_NUM_LIGHTS ${Math.min(s[1],o.getMaxLights())}`));const a=this.volumeDataNode.createShader(r,ae,de);return this.volumeShaderNodes.set(e,a),a},setShaderUniforms(e,t,n,o,r){this.volumeDataNode.setShaderUniforms(e,t)}}),Object.defineProperties(ue,{typeName:{value:"VolumeMaterial",enumerable:!0},componentName:{value:"Shape",enumerable:!0},containerField:{value:"material",enumerable:!0},fieldDefinitions:{value:ie().fieldDefinitions}});const he=ue;y().set("x_ite/Browser/VolumeRendering/VolumeMaterial",he);const ce=he,pe=window[Symbol.for("X_ITE.X3D-8.10.1")].require("standard/Math/Numbers/Vector3");var me=e.n(pe);function fe(e){K().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(fe.prototype,K().prototype),te().prototype,{initialize(){K().prototype.initialize.call(this),te().prototype.initialize.call(this);const e=this.getBrowser(),t=e.getContext();e.getBrowserOptions()._TextureQuality.addInterest("set_dimensions__",this),t.getVersion()>=2&&(this._dimensions.addInterest("set_dimensions__",this),this.set_dimensions__()),this._visible.addFieldInterest(this.transformNode._visible),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),this.textureTransformNode.addInterest("set_textureTransform__",this),this.set_textureTransform__()},getBBox(e,t){return this._bboxSize.getValue().equals(this.getDefaultBBoxSize())?e.set(this._dimensions.getValue(),me().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_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(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),K().prototype.dispose.call(this)}}),Object.defineProperties(fe,{typeName:{value:"X3DVolumeDataNode",enumerable:!0},componentName:{value:"VolumeRendering",enumerable:!0}});const ge=fe;y().set("x_ite/Components/VolumeRendering/X3DVolumeDataNode",ge);const _e=ge,ye=window[Symbol.for("X_ITE.X3D-8.10.1")].require("x_ite/Components/Shaders/ComposedShader");var xe=e.n(ye);const Se=window[Symbol.for("X_ITE.X3D-8.10.1")].require("x_ite/Components/Shaders/ShaderPart");var Ne=e.n(Se);function ve(e){_e.call(this,e),this.addType(g().IsoSurfaceVolumeData),this.renderStyleNodes=[]}Object.assign(Object.setPrototypeOf(ve.prototype,_e.prototype),{initialize(){_e.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.getAppearance()._texture=this._voxels,this.set_gradients__(),this.set_renderStyle__(),this.set_voxels__(),this.updateShader())},set_gradients__(){this.gradientsNode=F()(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=F()(g().X3DComposableVolumeRenderStyleNode,t);n&&e.push(n)}for(const t of e)t.addInterest("updateShader",this),t.addVolumeData(this)},set_voxels__(){this.voxelsNode=F()(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=n.replace(/\/\/ VOLUME_STYLES_UNIFORMS\n/,r)).replace(/\/\/ VOLUME_STYLES_FUNCTIONS\n/,i);const s=new(Ne())(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(Ne())(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(xe())(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(ve,{typeName:{value:"IsoSurfaceVolumeData",enumerable:!0},componentName:{value:"VolumeRendering",enumerable:!0},containerField:{value:"children",enumerable:!0},specificationRange:{value:Object.freeze(["3.3","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)(0)),new(u())(g().inputOutput,"surfaceValues",new(l().MFFloat)),new(u())(g().inputOutput,"surfaceTolerance",new(l().SFFloat)(0)),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)(0,0,0)),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 we=ve;y().set("x_ite/Components/VolumeRendering/IsoSurfaceVolumeData",we);const be=we;function Ce(e){N.call(this,e),this.addType(g().ProjectionVolumeStyle)}Object.assign(Object.setPrototypeOf(Ce.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(Ce,{typeName:{value:"ProjectionVolumeStyle",enumerable:!0},componentName:{value:"VolumeRendering",enumerable:!0},containerField:{value:"renderStyle",enumerable:!0},specificationRange:{value:Object.freeze(["3.3","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)(0))]),enumerable:!0}});const Fe=Ce;y().set("x_ite/Components/VolumeRendering/ProjectionVolumeStyle",Fe);const Ie=Fe;function Oe(e){_e.call(this,e),this.addType(g().SegmentedVolumeData),this.segmentIdentifiersNode=null,this.renderStyleNodes=[]}Object.assign(Object.setPrototypeOf(Oe.prototype,_e.prototype),{initialize(){_e.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.getAppearance()._texture=this._voxels,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=F()(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=F()(g().X3DComposableVolumeRenderStyleNode,t);n&&e.push(n)}for(const t of e)t.addInterest("updateShader",this),t.addVolumeData(this)},set_voxels__(){this.voxelsNode=F()(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=n.replace(/\/\/ VOLUME_STYLES_UNIFORMS\n/,r)).replace(/\/\/ VOLUME_STYLES_FUNCTIONS\n/,i);const s=new(Ne())(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(Ne())(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(xe())(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(Oe,{typeName:{value:"SegmentedVolumeData",enumerable:!0},componentName:{value:"VolumeRendering",enumerable:!0},containerField:{value:"children",enumerable:!0},specificationRange:{value:Object.freeze(["3.3","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)(0,0,0)),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 Ve=Oe;y().set("x_ite/Components/VolumeRendering/SegmentedVolumeData",Ve);const De=Ve;function Te(e){b.call(this,e),this.addType(g().ShadedVolumeStyle)}Object.assign(Object.setPrototypeOf(Te.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=F()(g().X3DMaterialNode,this._material),this.materialNode&&this.materialNode.addInterest("addNodeEvent",this)},set_surfaceNormals__(){this.surfaceNormalsNode=F()(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(Te,{typeName:{value:"ShadedVolumeStyle",enumerable:!0},componentName:{value:"VolumeRendering",enumerable:!0},containerField:{value:"renderStyle",enumerable:!0},specificationRange:{value:Object.freeze(["3.3","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 Pe=Te;y().set("x_ite/Components/VolumeRendering/ShadedVolumeStyle",Pe);const Ee=Pe;function Me(e){b.call(this,e),this.addType(g().SilhouetteEnhancementVolumeStyle)}Object.assign(Object.setPrototypeOf(Me.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=F()(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(Me,{typeName:{value:"SilhouetteEnhancementVolumeStyle",enumerable:!0},componentName:{value:"VolumeRendering",enumerable:!0},containerField:{value:"renderStyle",enumerable:!0},specificationRange:{value:Object.freeze(["3.3","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)(0)),new(u())(g().inputOutput,"silhouetteSharpness",new(l().SFFloat)(.5)),new(u())(g().inputOutput,"surfaceNormals",new(l().SFNode))]),enumerable:!0}});const Ue=Me;y().set("x_ite/Components/VolumeRendering/SilhouetteEnhancementVolumeStyle",Ue);const Be=Ue;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=F()(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},componentName:{value:"VolumeRendering",enumerable:!0},containerField:{value:"renderStyle",enumerable:!0},specificationRange:{value:Object.freeze(["3.3","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 je=Re;y().set("x_ite/Components/VolumeRendering/ToneMappedVolumeStyle",je);const Xe=je;function ze(e){_e.call(this,e),this.addType(g().VolumeData),this.renderStyleNode=null}Object.assign(Object.setPrototypeOf(ze.prototype,_e.prototype),{initialize(){_e.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.getAppearance()._texture=this._voxels,this.set_renderStyle__(),this.set_voxels__(),this.updateShader())},set_renderStyle__(){this.renderStyleNode&&(this.renderStyleNode.removeInterest("updateShader",this),this.renderStyleNode.removeVolumeData(this)),this.renderStyleNode=F()(g().X3DVolumeRenderStyleNode,this._renderStyle),this.renderStyleNode&&(this.renderStyleNode.addInterest("updateShader",this),this.renderStyleNode.addVolumeData(this))},set_voxels__(){this.voxelsNode=F()(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=n.replace(/\/\/ VOLUME_STYLES_UNIFORMS\n/,r)).replace(/\/\/ VOLUME_STYLES_FUNCTIONS\n/,i);const s=new(Ne())(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(Ne())(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(xe())(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(ze,{typeName:{value:"VolumeData",enumerable:!0},componentName:{value:"VolumeRendering",enumerable:!0},containerField:{value:"children",enumerable:!0},specificationRange:{value:Object.freeze(["3.3","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)(0,0,0)),new(u())(g().inputOutput,"renderStyle",new(l().SFNode)),new(u())(g().inputOutput,"voxels",new(l().SFNode))]),enumerable:!0}});const Le=ze;y().set("x_ite/Components/VolumeRendering/VolumeData",Le);const Ae=Le;n().add({name:"VolumeRendering",concreteNodes:[X,A,q,W,Z,be,V,Ie,De,Ee,Be,Xe,Ae],abstractNodes:[b,_e,N],browserContext:B});const Ge=void 0;y().set("assets/components/VolumeRendering",Ge)})();
1
+ /* X_ITE v8.11.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-8.11.0")].require("x_ite/Components");var n=e.n(t);const o=window[Symbol.for("X_ITE.X3D-8.11.0")].require("x_ite/Components/Texturing/PixelTexture");var r=e.n(o);const i=window[Symbol.for("X_ITE.X3D-8.11.0")].require("x_ite/Components/Texturing/TextureProperties");var s=e.n(i);const a=window[Symbol.for("X_ITE.X3D-8.11.0")].require("x_ite/Fields");var l=e.n(a);const d=window[Symbol.for("X_ITE.X3D-8.11.0")].require("x_ite/Base/X3DFieldDefinition");var u=e.n(d);const h=window[Symbol.for("X_ITE.X3D-8.11.0")].require("x_ite/Base/FieldDefinitionArray");var c=e.n(h);const p=window[Symbol.for("X_ITE.X3D-8.11.0")].require("x_ite/Components/Core/X3DNode");var m=e.n(p);const f=window[Symbol.for("X_ITE.X3D-8.11.0")].require("x_ite/Base/X3DConstants");var g=e.n(f);const _=window[Symbol.for("X_ITE.X3D-8.11.0")].require("x_ite/Namespace");var y=e.n(_);function x(e){m().call(this,e),this.addType(g().X3DVolumeRenderStyleNode),this.volumeDataNodes=new Set}Object.assign(Object.setPrototypeOf(x.prototype,m().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(x,{typeName:{value:"X3DVolumeRenderStyleNode",enumerable:!0},componentName:{value:"VolumeRendering",enumerable:!0}});const S=x;y().set("x_ite/Components/VolumeRendering/X3DVolumeRenderStyleNode",S);const N=S;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},componentName:{value:"VolumeRendering",enumerable:!0}});const w=v;y().set("x_ite/Components/VolumeRendering/X3DComposableVolumeRenderStyleNode",w);const b=w,C=window[Symbol.for("X_ITE.X3D-8.11.0")].require("x_ite/Base/X3DCast");var F=e.n(C);function I(e){b.call(this,e),this.addType(g().OpacityMapVolumeStyle)}Object.assign(Object.setPrototypeOf(I.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=F()(g().X3DTexture2DNode,this._transferFunction),this.transferFunctionNode||(this.transferFunctionNode=F()(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(I,{typeName:{value:"OpacityMapVolumeStyle",enumerable:!0},componentName:{value:"VolumeRendering",enumerable:!0},containerField:{value:"renderStyle",enumerable:!0},specificationRange:{value:Object.freeze(["3.3","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=I;y().set("x_ite/Components/VolumeRendering/OpacityMapVolumeStyle",O);const V=O,D=Symbol(),T=Symbol(),P=Symbol(),E=Symbol();function M(){}Object.assign(M.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 U=M;y().set("x_ite/Browser/VolumeRendering/X3DVolumeRenderingContext",U);const B=U;function R(e){b.call(this,e),this.addType(g().BlendedVolumeStyle)}Object.assign(Object.setPrototypeOf(R.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=F()(g().X3DTexture2DNode,this._weightTransferFunction1)},set_weightTransferFunction2__(){this.weightTransferFunction2Node=F()(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=F()(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=F()(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(R,{typeName:{value:"BlendedVolumeStyle",enumerable:!0},componentName:{value:"VolumeRendering",enumerable:!0},containerField:{value:"renderStyle",enumerable:!0},specificationRange:{value:Object.freeze(["3.3","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 j=R;y().set("x_ite/Components/VolumeRendering/BlendedVolumeStyle",j);const X=j;function z(e){b.call(this,e),this.addType(g().BoundaryEnhancementVolumeStyle)}Object.assign(Object.setPrototypeOf(z.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(z,{typeName:{value:"BoundaryEnhancementVolumeStyle",enumerable:!0},componentName:{value:"VolumeRendering",enumerable:!0},containerField:{value:"renderStyle",enumerable:!0},specificationRange:{value:Object.freeze(["3.3","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=z;y().set("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=F()(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},componentName:{value:"VolumeRendering",enumerable:!0},containerField:{value:"renderStyle",enumerable:!0},specificationRange:{value:Object.freeze(["3.3","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 H=G;y().set("x_ite/Components/VolumeRendering/CartoonVolumeStyle",H);const q=H;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=F()(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},componentName:{value:"VolumeRendering",enumerable:!0},containerField:{value:"renderStyle",enumerable:!0},specificationRange:{value:Object.freeze(["3.3","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().set("x_ite/Components/VolumeRendering/ComposedVolumeStyle",Y);const W=Y;function Q(e){b.call(this,e),this.addType(g().EdgeEnhancementVolumeStyle)}Object.assign(Object.setPrototypeOf(Q.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=F()(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(Q,{typeName:{value:"EdgeEnhancementVolumeStyle",enumerable:!0},componentName:{value:"VolumeRendering",enumerable:!0},containerField:{value:"renderStyle",enumerable:!0},specificationRange:{value:Object.freeze(["3.3","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 $=Q;y().set("x_ite/Components/VolumeRendering/EdgeEnhancementVolumeStyle",$);const Z=$,J=window[Symbol.for("X_ITE.X3D-8.11.0")].require("x_ite/Components/Core/X3DChildNode");var K=e.n(J);const ee=window[Symbol.for("X_ITE.X3D-8.11.0")].require("x_ite/Components/Grouping/X3DBoundedObject");var te=e.n(ee);const ne=window[Symbol.for("X_ITE.X3D-8.11.0")].require("x_ite/Browser/Core/TextureQuality");var oe=e.n(ne);const re=window[Symbol.for("X_ITE.X3D-8.11.0")].require("x_ite/Components/Shape/UnlitMaterial");var ie=e.n(re);const se="#version 300 es\n\nprecision highp float;\nprecision highp int;\n\nuniform mat4 x3d_ProjectionMatrix;\nuniform mat4 x3d_ModelViewMatrix;\nuniform mat4 x3d_TextureMatrix [1];\n\nin vec4 x3d_TexCoord0;\nin vec4 x3d_Vertex;\n\nout vec3 vertex;\nout vec4 texCoord;\n\nvoid\nmain ()\n{\n vec4 position = x3d_ModelViewMatrix * x3d_Vertex;\n\n vertex = position .xyz;\n texCoord = x3d_TextureMatrix [0] * x3d_TexCoord0;\n\n gl_Position = x3d_ProjectionMatrix * position;\n}\n";y().set("x_ite/Browser/VolumeRendering/VolumeStyle.vs",se);const ae=se,le='#version 300 es\n\nprecision highp float;\nprecision highp int;\nprecision highp sampler3D;\n\nin vec3 vertex;\nin vec4 texCoord;\n\nuniform sampler3D x3d_Texture3D [1];\nuniform mat3 x3d_TextureNormalMatrix;\n\nuniform x3d_LightSourceParameters x3d_LightSource [x3d_MaxLights];\n\nconst float M_PI = 3.14159265359;\n\n#pragma X3D include "includes/ClipPlanes.glsl"\n#pragma X3D include "includes/Fog.glsl"\n\n// VOLUME_STYLES_UNIFORMS\n\nout vec4 x3d_FragColor;\n\nvec4\ngetTextureColor (in vec3 texCoord)\n{\n if (texCoord .s < 0.0 || texCoord .s > 1.0)\n discard;\n\n if (texCoord .t < 0.0 || texCoord .t > 1.0)\n discard;\n\n if (texCoord .p < 0.0 || texCoord .p > 1.0)\n discard;\n\n vec4 textureColor = texture (x3d_Texture3D [0], texCoord);\n\n // Apply volume styles.\n\n// VOLUME_STYLES_FUNCTIONS\n\n return textureColor;\n}\n\nvoid\nmain ()\n{\n #if defined (X3D_CLIP_PLANES)\n clip ();\n #endif\n\n vec4 finalColor = getTextureColor (texCoord .stp / texCoord .q);\n\n #if defined (X3D_FOG)\n finalColor .rgb = getFogColor (finalColor .rgb);\n #endif\n\n x3d_FragColor = finalColor;\n}\n';y().set("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{fogNode:n,objectsCount:o}=t;let r="";return r+=n?.getFogType()??0,r+=".",r+=o[0],r+=".",r+=o[1],this.volumeShaderNodes.get(r)??this.createShader(r,e,t)},createShader(e,t,n){const o=this.getBrowser(),r=[],{fogNode:i,objectsCount:s}=n;switch(i?.getFogType()){case 1:r.push("X3D_FOG","X3D_FOG_LINEAR");break;case 2:r.push("X3D_FOG","X3D_FOG_EXPONENTIAL")}s[0]&&(r.push("X3D_CLIP_PLANES"),r.push(`X3D_NUM_CLIP_PLANES ${Math.min(s[0],o.getMaxClipPlanes())}`)),s[1]&&(r.push("X3D_LIGHTING"),r.push(`X3D_NUM_LIGHTS ${Math.min(s[1],o.getMaxLights())}`));const a=this.volumeDataNode.createShader(r,ae,de);return this.volumeShaderNodes.set(e,a),a},setShaderUniforms(e,t,n,o,r){this.volumeDataNode.setShaderUniforms(e,t)}}),Object.defineProperties(ue,{typeName:{value:"VolumeMaterial",enumerable:!0},componentName:{value:"Shape",enumerable:!0},containerField:{value:"material",enumerable:!0},fieldDefinitions:{value:ie().fieldDefinitions}});const he=ue;y().set("x_ite/Browser/VolumeRendering/VolumeMaterial",he);const ce=he,pe=window[Symbol.for("X_ITE.X3D-8.11.0")].require("standard/Math/Numbers/Vector3");var me=e.n(pe);function fe(e){K().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(fe.prototype,K().prototype),te().prototype,{initialize(){K().prototype.initialize.call(this),te().prototype.initialize.call(this);const e=this.getBrowser(),t=e.getContext();e.getBrowserOptions()._TextureQuality.addInterest("set_dimensions__",this),t.getVersion()>=2&&(this._dimensions.addInterest("set_dimensions__",this),this.set_dimensions__()),this._visible.addFieldInterest(this.transformNode._visible),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),this.textureTransformNode.addInterest("set_textureTransform__",this),this.set_textureTransform__()},getBBox(e,t){return this._bboxSize.getValue().equals(this.getDefaultBBoxSize())?e.set(this._dimensions.getValue(),me().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_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(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),K().prototype.dispose.call(this)}}),Object.defineProperties(fe,{typeName:{value:"X3DVolumeDataNode",enumerable:!0},componentName:{value:"VolumeRendering",enumerable:!0}});const ge=fe;y().set("x_ite/Components/VolumeRendering/X3DVolumeDataNode",ge);const _e=ge,ye=window[Symbol.for("X_ITE.X3D-8.11.0")].require("x_ite/Components/Shaders/ComposedShader");var xe=e.n(ye);const Se=window[Symbol.for("X_ITE.X3D-8.11.0")].require("x_ite/Components/Shaders/ShaderPart");var Ne=e.n(Se);function ve(e){_e.call(this,e),this.addType(g().IsoSurfaceVolumeData),this.renderStyleNodes=[]}Object.assign(Object.setPrototypeOf(ve.prototype,_e.prototype),{initialize(){_e.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.getAppearance()._texture=this._voxels,this.set_gradients__(),this.set_renderStyle__(),this.set_voxels__(),this.updateShader())},set_gradients__(){this.gradientsNode=F()(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=F()(g().X3DComposableVolumeRenderStyleNode,t);n&&e.push(n)}for(const t of e)t.addInterest("updateShader",this),t.addVolumeData(this)},set_voxels__(){this.voxelsNode=F()(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=n.replace(/\/\/ VOLUME_STYLES_UNIFORMS\n/,r)).replace(/\/\/ VOLUME_STYLES_FUNCTIONS\n/,i);const s=new(Ne())(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(Ne())(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(xe())(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(ve,{typeName:{value:"IsoSurfaceVolumeData",enumerable:!0},componentName:{value:"VolumeRendering",enumerable:!0},containerField:{value:"children",enumerable:!0},specificationRange:{value:Object.freeze(["3.3","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)(0)),new(u())(g().inputOutput,"surfaceValues",new(l().MFFloat)),new(u())(g().inputOutput,"surfaceTolerance",new(l().SFFloat)(0)),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)(0,0,0)),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 we=ve;y().set("x_ite/Components/VolumeRendering/IsoSurfaceVolumeData",we);const be=we;function Ce(e){N.call(this,e),this.addType(g().ProjectionVolumeStyle)}Object.assign(Object.setPrototypeOf(Ce.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(Ce,{typeName:{value:"ProjectionVolumeStyle",enumerable:!0},componentName:{value:"VolumeRendering",enumerable:!0},containerField:{value:"renderStyle",enumerable:!0},specificationRange:{value:Object.freeze(["3.3","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)(0))]),enumerable:!0}});const Fe=Ce;y().set("x_ite/Components/VolumeRendering/ProjectionVolumeStyle",Fe);const Ie=Fe;function Oe(e){_e.call(this,e),this.addType(g().SegmentedVolumeData),this.segmentIdentifiersNode=null,this.renderStyleNodes=[]}Object.assign(Object.setPrototypeOf(Oe.prototype,_e.prototype),{initialize(){_e.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.getAppearance()._texture=this._voxels,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=F()(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=F()(g().X3DComposableVolumeRenderStyleNode,t);n&&e.push(n)}for(const t of e)t.addInterest("updateShader",this),t.addVolumeData(this)},set_voxels__(){this.voxelsNode=F()(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=n.replace(/\/\/ VOLUME_STYLES_UNIFORMS\n/,r)).replace(/\/\/ VOLUME_STYLES_FUNCTIONS\n/,i);const s=new(Ne())(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(Ne())(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(xe())(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(Oe,{typeName:{value:"SegmentedVolumeData",enumerable:!0},componentName:{value:"VolumeRendering",enumerable:!0},containerField:{value:"children",enumerable:!0},specificationRange:{value:Object.freeze(["3.3","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)(0,0,0)),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 Ve=Oe;y().set("x_ite/Components/VolumeRendering/SegmentedVolumeData",Ve);const De=Ve;function Te(e){b.call(this,e),this.addType(g().ShadedVolumeStyle)}Object.assign(Object.setPrototypeOf(Te.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=F()(g().X3DMaterialNode,this._material),this.materialNode&&this.materialNode.addInterest("addNodeEvent",this)},set_surfaceNormals__(){this.surfaceNormalsNode=F()(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(Te,{typeName:{value:"ShadedVolumeStyle",enumerable:!0},componentName:{value:"VolumeRendering",enumerable:!0},containerField:{value:"renderStyle",enumerable:!0},specificationRange:{value:Object.freeze(["3.3","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 Pe=Te;y().set("x_ite/Components/VolumeRendering/ShadedVolumeStyle",Pe);const Ee=Pe;function Me(e){b.call(this,e),this.addType(g().SilhouetteEnhancementVolumeStyle)}Object.assign(Object.setPrototypeOf(Me.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=F()(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(Me,{typeName:{value:"SilhouetteEnhancementVolumeStyle",enumerable:!0},componentName:{value:"VolumeRendering",enumerable:!0},containerField:{value:"renderStyle",enumerable:!0},specificationRange:{value:Object.freeze(["3.3","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)(0)),new(u())(g().inputOutput,"silhouetteSharpness",new(l().SFFloat)(.5)),new(u())(g().inputOutput,"surfaceNormals",new(l().SFNode))]),enumerable:!0}});const Ue=Me;y().set("x_ite/Components/VolumeRendering/SilhouetteEnhancementVolumeStyle",Ue);const Be=Ue;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=F()(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},componentName:{value:"VolumeRendering",enumerable:!0},containerField:{value:"renderStyle",enumerable:!0},specificationRange:{value:Object.freeze(["3.3","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 je=Re;y().set("x_ite/Components/VolumeRendering/ToneMappedVolumeStyle",je);const Xe=je;function ze(e){_e.call(this,e),this.addType(g().VolumeData),this.renderStyleNode=null}Object.assign(Object.setPrototypeOf(ze.prototype,_e.prototype),{initialize(){_e.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.getAppearance()._texture=this._voxels,this.set_renderStyle__(),this.set_voxels__(),this.updateShader())},set_renderStyle__(){this.renderStyleNode&&(this.renderStyleNode.removeInterest("updateShader",this),this.renderStyleNode.removeVolumeData(this)),this.renderStyleNode=F()(g().X3DVolumeRenderStyleNode,this._renderStyle),this.renderStyleNode&&(this.renderStyleNode.addInterest("updateShader",this),this.renderStyleNode.addVolumeData(this))},set_voxels__(){this.voxelsNode=F()(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=n.replace(/\/\/ VOLUME_STYLES_UNIFORMS\n/,r)).replace(/\/\/ VOLUME_STYLES_FUNCTIONS\n/,i);const s=new(Ne())(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(Ne())(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(xe())(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(ze,{typeName:{value:"VolumeData",enumerable:!0},componentName:{value:"VolumeRendering",enumerable:!0},containerField:{value:"children",enumerable:!0},specificationRange:{value:Object.freeze(["3.3","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)(0,0,0)),new(u())(g().inputOutput,"renderStyle",new(l().SFNode)),new(u())(g().inputOutput,"voxels",new(l().SFNode))]),enumerable:!0}});const Le=ze;y().set("x_ite/Components/VolumeRendering/VolumeData",Le);const Ae=Le;n().add({name:"VolumeRendering",concreteNodes:[X,A,q,W,Z,be,V,Ie,De,Ee,Be,Xe,Ae],abstractNodes:[b,_e,N],browserContext:B});const Ge=void 0;y().set("assets/components/VolumeRendering",Ge)})();
@@ -1,4 +1,4 @@
1
- /* X_ITE v8.10.1 */(() => { // webpackBootstrap
1
+ /* X_ITE v8.11.0 */(() => { // webpackBootstrap
2
2
  /******/ "use strict";
3
3
  /******/ // The require scope
4
4
  /******/ var __webpack_require__ = {};
@@ -39,27 +39,27 @@ var __webpack_exports__ = {};
39
39
  // UNUSED EXPORTS: default
40
40
 
41
41
  ;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"x_ite/Components\")"
42
- const Components_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.10.1")] .require ("x_ite/Components");
42
+ const Components_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.11.0")] .require ("x_ite/Components");
43
43
  var Components_default = /*#__PURE__*/__webpack_require__.n(Components_namespaceObject);
44
44
  ;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"x_ite/Fields\")"
45
- const Fields_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.10.1")] .require ("x_ite/Fields");
45
+ const Fields_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.11.0")] .require ("x_ite/Fields");
46
46
  var Fields_default = /*#__PURE__*/__webpack_require__.n(Fields_namespaceObject);
47
47
  ;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"x_ite/Base/X3DFieldDefinition\")"
48
- const X3DFieldDefinition_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.10.1")] .require ("x_ite/Base/X3DFieldDefinition");
48
+ const X3DFieldDefinition_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.11.0")] .require ("x_ite/Base/X3DFieldDefinition");
49
49
  var X3DFieldDefinition_default = /*#__PURE__*/__webpack_require__.n(X3DFieldDefinition_namespaceObject);
50
50
  ;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"x_ite/Base/FieldDefinitionArray\")"
51
- const FieldDefinitionArray_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.10.1")] .require ("x_ite/Base/FieldDefinitionArray");
51
+ const FieldDefinitionArray_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.11.0")] .require ("x_ite/Base/FieldDefinitionArray");
52
52
  var FieldDefinitionArray_default = /*#__PURE__*/__webpack_require__.n(FieldDefinitionArray_namespaceObject);
53
53
  ;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"x_ite/Components/Shape/X3DAppearanceChildNode\")"
54
- const X3DAppearanceChildNode_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.10.1")] .require ("x_ite/Components/Shape/X3DAppearanceChildNode");
54
+ const X3DAppearanceChildNode_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.11.0")] .require ("x_ite/Components/Shape/X3DAppearanceChildNode");
55
55
  var X3DAppearanceChildNode_default = /*#__PURE__*/__webpack_require__.n(X3DAppearanceChildNode_namespaceObject);
56
56
  ;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"x_ite/Rendering/TraverseType\")"
57
- const TraverseType_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.10.1")] .require ("x_ite/Rendering/TraverseType");
57
+ const TraverseType_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.11.0")] .require ("x_ite/Rendering/TraverseType");
58
58
  ;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"x_ite/Base/X3DConstants\")"
59
- const X3DConstants_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.10.1")] .require ("x_ite/Base/X3DConstants");
59
+ const X3DConstants_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.11.0")] .require ("x_ite/Base/X3DConstants");
60
60
  var X3DConstants_default = /*#__PURE__*/__webpack_require__.n(X3DConstants_namespaceObject);
61
61
  ;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"x_ite/Namespace\")"
62
- const Namespace_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.10.1")] .require ("x_ite/Namespace");
62
+ const Namespace_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.11.0")] .require ("x_ite/Namespace");
63
63
  var Namespace_default = /*#__PURE__*/__webpack_require__.n(Namespace_namespaceObject);
64
64
  ;// CONCATENATED MODULE: ./src/x_ite/Components/X_ITE/BlendMode.js
65
65
  /*******************************************************************************
@@ -1 +1 @@
1
- /* X_ITE v8.10.1 */(()=>{"use strict";var t={n:e=>{var o=e&&e.__esModule?()=>e.default:()=>e;return t.d(o,{a:o}),o},d:(e,o)=>{for(var s in o)t.o(o,s)&&!t.o(e,s)&&Object.defineProperty(e,s,{enumerable:!0,get:o[s]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)};const e=window[Symbol.for("X_ITE.X3D-8.10.1")].require("x_ite/Components");var o=t.n(e);const s=window[Symbol.for("X_ITE.X3D-8.10.1")].require("x_ite/Fields");var i=t.n(s);const a=window[Symbol.for("X_ITE.X3D-8.10.1")].require("x_ite/Base/X3DFieldDefinition");var n=t.n(a);const r=window[Symbol.for("X_ITE.X3D-8.10.1")].require("x_ite/Base/FieldDefinitionArray");var _=t.n(r);const p=window[Symbol.for("X_ITE.X3D-8.10.1")].require("x_ite/Components/Shape/X3DAppearanceChildNode");var c=t.n(p);window[Symbol.for("X_ITE.X3D-8.10.1")].require("x_ite/Rendering/TraverseType");const h=window[Symbol.for("X_ITE.X3D-8.10.1")].require("x_ite/Base/X3DConstants");var l=t.n(h);const T=window[Symbol.for("X_ITE.X3D-8.10.1")].require("x_ite/Namespace");var u=t.n(T);function A(t){c().call(this,t),this.addType(l().BlendMode),this.factorTypes=new Map,this.equationTypes=new Map}Object.assign(Object.setPrototypeOf(A.prototype,c().prototype),{initialize(){c().prototype.initialize.call(this);const t=this.getBrowser().getContext(),e=t.getExtension("EXT_blend_minmax");this.factorTypes.set("ZERO",t.ZERO),this.factorTypes.set("ONE",t.ONE),this.factorTypes.set("SRC_COLOR",t.SRC_COLOR),this.factorTypes.set("ONE_MINUS_SRC_COLOR",t.ONE_MINUS_SRC_COLOR),this.factorTypes.set("DST_COLOR",t.DST_COLOR),this.factorTypes.set("ONE_MINUS_DST_COLOR",t.ONE_MINUS_DST_COLOR),this.factorTypes.set("SRC_ALPHA",t.SRC_ALPHA),this.factorTypes.set("ONE_MINUS_SRC_ALPHA",t.ONE_MINUS_SRC_ALPHA),this.factorTypes.set("DST_ALPHA",t.DST_ALPHA),this.factorTypes.set("ONE_MINUS_DST_ALPHA",t.ONE_MINUS_DST_ALPHA),this.factorTypes.set("SRC_ALPHA_SATURATE",t.SRC_ALPHA_SATURATE),this.factorTypes.set("CONSTANT_COLOR",t.CONSTANT_COLOR),this.factorTypes.set("ONE_MINUS_CONSTANT_COLOR",t.ONE_MINUS_CONSTANT_COLOR),this.factorTypes.set("CONSTANT_ALPHA",t.CONSTANT_ALPHA),this.factorTypes.set("ONE_MINUS_CONSTANT_ALPHA",t.ONE_MINUS_CONSTANT_ALPHA),this.equationTypes.set("FUNC_ADD",t.FUNC_ADD),this.equationTypes.set("FUNC_SUBTRACT",t.FUNC_SUBTRACT),this.equationTypes.set("FUNC_REVERSE_SUBTRACT",t.FUNC_REVERSE_SUBTRACT),this.equationTypes.set("MIN",t.MIN||e&&e.MIN_EXT),this.equationTypes.set("MAX",t.MAX||e&&e.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()),void 0===this.sourceColorFactorType&&(this.sourceColorFactorType=this.factorTypes.get("SRC_ALPHA"))},set_sourceAlphaFactor__(){this.sourceAlphaFactorType=this.factorTypes.get(this._sourceAlphaFactor.getValue()),void 0===this.sourceAlphaFactorType&&(this.sourceAlphaFactorType=this.factorTypes.get("ONE"))},set_destinationColorFactor__(){this.destinationColorFactorType=this.factorTypes.get(this._destinationColorFactor.getValue()),void 0===this.destinationColorFactorType&&(this.destinationColorFactorType=this.factorTypes.get("ONE_MINUS_SRC_ALPHA"))},set_destinationAlphaFactor__(){this.destinationAlphaFactorType=this.factorTypes.get(this._destinationAlphaFactor.getValue()),void 0===this.destinationAlphaFactorType&&(this.destinationAlphaFactorType=this.factorTypes.get("ONE_MINUS_SRC_ALPHA"))},set_colorEquation__(){this.colorEquationType=this.equationTypes.get(this._colorEquation.getValue()),void 0===this.colorEquationType&&(this.colorEquationType=this.equationTypes.get("FUNC_ADD"))},set_alphaEquation__(){this.alphaEquationType=this.equationTypes.get(this._alphaEquation.getValue()),void 0===this.alphaEquationType&&(this.alphaEquationType=this.equationTypes.get("FUNC_ADD"))},enable(t){const e=this._blendColor.getValue();t.blendColor(e.r,e.g,e.b,e.a),t.blendFuncSeparate(this.sourceColorFactorType,this.destinationColorFactorType,this.sourceAlphaFactorType,this.destinationAlphaFactorType),t.blendEquationSeparate(this.colorEquationType,this.alphaEquationType)},disable(t){t.blendFuncSeparate(t.SRC_ALPHA,t.ONE_MINUS_SRC_ALPHA,t.ONE,t.ONE_MINUS_SRC_ALPHA),t.blendEquationSeparate(t.FUNC_ADD,t.FUNC_ADD)}}),Object.defineProperties(A,{typeName:{value:"BlendMode",enumerable:!0},componentName:{value:"X_ITE",enumerable:!0},containerField:{value:"blendMode",enumerable:!0},specificationRange:{value:Object.freeze(["3.3","Infinity"]),enumerable:!0},fieldDefinitions:{value:new(_())([new(n())(l().inputOutput,"metadata",new(i().SFNode)),new(n())(l().inputOutput,"blendColor",new(i().SFColorRGBA)),new(n())(l().inputOutput,"sourceColorFactor",new(i().SFString)("SRC_ALPHA")),new(n())(l().inputOutput,"sourceAlphaFactor",new(i().SFString)("ONE")),new(n())(l().inputOutput,"destinationColorFactor",new(i().SFString)("ONE_MINUS_SRC_ALPHA")),new(n())(l().inputOutput,"destinationAlphaFactor",new(i().SFString)("ONE_MINUS_SRC_ALPHA")),new(n())(l().inputOutput,"colorEquation",new(i().SFString)("FUNC_ADD")),new(n())(l().inputOutput,"alphaEquation",new(i().SFString)("FUNC_ADD"))]),enumerable:!0}});const S=A;u().set("x_ite/Components/X_ITE/BlendMode",S);const d=S;o().add({name:"X_ITE",concreteNodes:[d],abstractNodes:[]});const C=void 0;u().set("assets/components/X_ITE",C)})();
1
+ /* X_ITE v8.11.0 */(()=>{"use strict";var t={n:e=>{var o=e&&e.__esModule?()=>e.default:()=>e;return t.d(o,{a:o}),o},d:(e,o)=>{for(var s in o)t.o(o,s)&&!t.o(e,s)&&Object.defineProperty(e,s,{enumerable:!0,get:o[s]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)};const e=window[Symbol.for("X_ITE.X3D-8.11.0")].require("x_ite/Components");var o=t.n(e);const s=window[Symbol.for("X_ITE.X3D-8.11.0")].require("x_ite/Fields");var i=t.n(s);const a=window[Symbol.for("X_ITE.X3D-8.11.0")].require("x_ite/Base/X3DFieldDefinition");var n=t.n(a);const r=window[Symbol.for("X_ITE.X3D-8.11.0")].require("x_ite/Base/FieldDefinitionArray");var _=t.n(r);const p=window[Symbol.for("X_ITE.X3D-8.11.0")].require("x_ite/Components/Shape/X3DAppearanceChildNode");var c=t.n(p);window[Symbol.for("X_ITE.X3D-8.11.0")].require("x_ite/Rendering/TraverseType");const h=window[Symbol.for("X_ITE.X3D-8.11.0")].require("x_ite/Base/X3DConstants");var l=t.n(h);const T=window[Symbol.for("X_ITE.X3D-8.11.0")].require("x_ite/Namespace");var u=t.n(T);function A(t){c().call(this,t),this.addType(l().BlendMode),this.factorTypes=new Map,this.equationTypes=new Map}Object.assign(Object.setPrototypeOf(A.prototype,c().prototype),{initialize(){c().prototype.initialize.call(this);const t=this.getBrowser().getContext(),e=t.getExtension("EXT_blend_minmax");this.factorTypes.set("ZERO",t.ZERO),this.factorTypes.set("ONE",t.ONE),this.factorTypes.set("SRC_COLOR",t.SRC_COLOR),this.factorTypes.set("ONE_MINUS_SRC_COLOR",t.ONE_MINUS_SRC_COLOR),this.factorTypes.set("DST_COLOR",t.DST_COLOR),this.factorTypes.set("ONE_MINUS_DST_COLOR",t.ONE_MINUS_DST_COLOR),this.factorTypes.set("SRC_ALPHA",t.SRC_ALPHA),this.factorTypes.set("ONE_MINUS_SRC_ALPHA",t.ONE_MINUS_SRC_ALPHA),this.factorTypes.set("DST_ALPHA",t.DST_ALPHA),this.factorTypes.set("ONE_MINUS_DST_ALPHA",t.ONE_MINUS_DST_ALPHA),this.factorTypes.set("SRC_ALPHA_SATURATE",t.SRC_ALPHA_SATURATE),this.factorTypes.set("CONSTANT_COLOR",t.CONSTANT_COLOR),this.factorTypes.set("ONE_MINUS_CONSTANT_COLOR",t.ONE_MINUS_CONSTANT_COLOR),this.factorTypes.set("CONSTANT_ALPHA",t.CONSTANT_ALPHA),this.factorTypes.set("ONE_MINUS_CONSTANT_ALPHA",t.ONE_MINUS_CONSTANT_ALPHA),this.equationTypes.set("FUNC_ADD",t.FUNC_ADD),this.equationTypes.set("FUNC_SUBTRACT",t.FUNC_SUBTRACT),this.equationTypes.set("FUNC_REVERSE_SUBTRACT",t.FUNC_REVERSE_SUBTRACT),this.equationTypes.set("MIN",t.MIN||e&&e.MIN_EXT),this.equationTypes.set("MAX",t.MAX||e&&e.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()),void 0===this.sourceColorFactorType&&(this.sourceColorFactorType=this.factorTypes.get("SRC_ALPHA"))},set_sourceAlphaFactor__(){this.sourceAlphaFactorType=this.factorTypes.get(this._sourceAlphaFactor.getValue()),void 0===this.sourceAlphaFactorType&&(this.sourceAlphaFactorType=this.factorTypes.get("ONE"))},set_destinationColorFactor__(){this.destinationColorFactorType=this.factorTypes.get(this._destinationColorFactor.getValue()),void 0===this.destinationColorFactorType&&(this.destinationColorFactorType=this.factorTypes.get("ONE_MINUS_SRC_ALPHA"))},set_destinationAlphaFactor__(){this.destinationAlphaFactorType=this.factorTypes.get(this._destinationAlphaFactor.getValue()),void 0===this.destinationAlphaFactorType&&(this.destinationAlphaFactorType=this.factorTypes.get("ONE_MINUS_SRC_ALPHA"))},set_colorEquation__(){this.colorEquationType=this.equationTypes.get(this._colorEquation.getValue()),void 0===this.colorEquationType&&(this.colorEquationType=this.equationTypes.get("FUNC_ADD"))},set_alphaEquation__(){this.alphaEquationType=this.equationTypes.get(this._alphaEquation.getValue()),void 0===this.alphaEquationType&&(this.alphaEquationType=this.equationTypes.get("FUNC_ADD"))},enable(t){const e=this._blendColor.getValue();t.blendColor(e.r,e.g,e.b,e.a),t.blendFuncSeparate(this.sourceColorFactorType,this.destinationColorFactorType,this.sourceAlphaFactorType,this.destinationAlphaFactorType),t.blendEquationSeparate(this.colorEquationType,this.alphaEquationType)},disable(t){t.blendFuncSeparate(t.SRC_ALPHA,t.ONE_MINUS_SRC_ALPHA,t.ONE,t.ONE_MINUS_SRC_ALPHA),t.blendEquationSeparate(t.FUNC_ADD,t.FUNC_ADD)}}),Object.defineProperties(A,{typeName:{value:"BlendMode",enumerable:!0},componentName:{value:"X_ITE",enumerable:!0},containerField:{value:"blendMode",enumerable:!0},specificationRange:{value:Object.freeze(["3.3","Infinity"]),enumerable:!0},fieldDefinitions:{value:new(_())([new(n())(l().inputOutput,"metadata",new(i().SFNode)),new(n())(l().inputOutput,"blendColor",new(i().SFColorRGBA)),new(n())(l().inputOutput,"sourceColorFactor",new(i().SFString)("SRC_ALPHA")),new(n())(l().inputOutput,"sourceAlphaFactor",new(i().SFString)("ONE")),new(n())(l().inputOutput,"destinationColorFactor",new(i().SFString)("ONE_MINUS_SRC_ALPHA")),new(n())(l().inputOutput,"destinationAlphaFactor",new(i().SFString)("ONE_MINUS_SRC_ALPHA")),new(n())(l().inputOutput,"colorEquation",new(i().SFString)("FUNC_ADD")),new(n())(l().inputOutput,"alphaEquation",new(i().SFString)("FUNC_ADD"))]),enumerable:!0}});const S=A;u().set("x_ite/Components/X_ITE/BlendMode",S);const d=S;o().add({name:"X_ITE",concreteNodes:[d],abstractNodes:[]});const C=void 0;u().set("assets/components/X_ITE",C)})();