x_ite 8.6.24 → 8.7.1

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 (110) hide show
  1. package/README.md +2 -0
  2. package/dist/assets/components/Annotation.js +13 -13
  3. package/dist/assets/components/Annotation.min.js +1 -1
  4. package/dist/assets/components/CADGeometry.js +13 -13
  5. package/dist/assets/components/CADGeometry.min.js +1 -1
  6. package/dist/assets/components/CubeMapTexturing.js +34 -39
  7. package/dist/assets/components/CubeMapTexturing.min.js +1 -1
  8. package/dist/assets/components/DIS.js +13 -13
  9. package/dist/assets/components/DIS.min.js +1 -1
  10. package/dist/assets/components/EventUtilities.js +9 -9
  11. package/dist/assets/components/EventUtilities.min.js +1 -1
  12. package/dist/assets/components/Geometry2D.js +19 -19
  13. package/dist/assets/components/Geometry2D.min.js +1 -1
  14. package/dist/assets/components/Geospatial.js +33 -33
  15. package/dist/assets/components/Geospatial.min.js +1 -1
  16. package/dist/assets/components/HAnim.js +18 -18
  17. package/dist/assets/components/HAnim.min.js +1 -1
  18. package/dist/assets/components/KeyDeviceSensor.js +8 -8
  19. package/dist/assets/components/KeyDeviceSensor.min.js +1 -1
  20. package/dist/assets/components/Layout.js +27 -27
  21. package/dist/assets/components/Layout.min.js +1 -1
  22. package/dist/assets/components/NURBS.js +32 -32
  23. package/dist/assets/components/NURBS.min.js +1 -1
  24. package/dist/assets/components/ParticleSystems.js +22 -22
  25. package/dist/assets/components/ParticleSystems.min.js +1 -1
  26. package/dist/assets/components/Picking.js +26 -26
  27. package/dist/assets/components/Picking.min.js +1 -1
  28. package/dist/assets/components/RigidBodyPhysics.js +20 -20
  29. package/dist/assets/components/RigidBodyPhysics.min.js +1 -1
  30. package/dist/assets/components/Scripting.js +28 -28
  31. package/dist/assets/components/Scripting.min.js +1 -1
  32. package/dist/assets/components/Text.js +24 -24
  33. package/dist/assets/components/Text.min.js +1 -1
  34. package/dist/assets/components/TextureProjector.js +14 -14
  35. package/dist/assets/components/TextureProjector.min.js +1 -1
  36. package/dist/assets/components/Texturing3D.js +30 -30
  37. package/dist/assets/components/Texturing3D.min.js +1 -1
  38. package/dist/assets/components/VolumeRendering.js +25 -25
  39. package/dist/assets/components/VolumeRendering.min.js +1 -1
  40. package/dist/assets/components/X_ITE.js +9 -9
  41. package/dist/assets/components/X_ITE.min.js +1 -1
  42. package/dist/x_ite.css +1 -1
  43. package/dist/x_ite.js +297 -257
  44. package/dist/x_ite.min.js +1 -1
  45. package/dist/x_ite.zip +0 -0
  46. package/docs/_config.yml +1 -1
  47. package/docs/_posts/accessing-the-external-browser.md +1 -1
  48. package/docs/_posts/components/Geospatial/GeoViewpoint.md +41 -0
  49. package/docs/_posts/components/Navigation/OrthoViewpoint.md +41 -0
  50. package/docs/_posts/components/Navigation/Viewpoint.md +41 -0
  51. package/docs/_posts/components/Networking/Inline.md +1 -1
  52. package/docs/_posts/components/X_ITE/BlendMode.md +1 -1
  53. package/docs/_posts/getting-started.md +4 -1
  54. package/docs/_posts/glossary.md +3 -3
  55. package/docs/_posts/laboratory/x3d-file-converter.md +1 -1
  56. package/docs/_posts/reference/browser-services.md +48 -20
  57. package/docs/_posts/reference/field-services-and-objects.md +23 -23
  58. package/docs/_posts/reference/scene-services.md +1 -1
  59. package/docs/_posts/supported-nodes.md +1 -1
  60. package/docs/_posts/tutorials/basic-nodes.md +1 -1
  61. package/docs/_posts/tutorials/building-a-x3d-world.md +1 -1
  62. package/docs/_posts/tutorials/building-primitive-shapes.md +1 -1
  63. package/docs/_posts/tutorials/increasing-rendering-speed.md +1 -1
  64. package/docs/_posts/tutorials/introducing-x3d.md +1 -1
  65. package/docs/_posts/tutorials/overview.md +1 -1
  66. package/docs/_posts/what's-new.md +11 -1
  67. package/package.json +4 -4
  68. package/src/x_ite/Base/X3DBaseNode.js +2 -2
  69. package/src/x_ite/Base/X3DField.js +4 -4
  70. package/src/x_ite/Browser/Core/BrowserOptions.js +12 -4
  71. package/src/x_ite/Browser/Core/X3DCoreContext.js +79 -31
  72. package/src/x_ite/Browser/Legacy.js +1 -1
  73. package/src/x_ite/Browser/NURBS/NURBS.js +3 -3
  74. package/src/x_ite/Browser/Shaders/X3DShadersContext.js +2 -2
  75. package/src/x_ite/Browser/Texturing/X3DTexturingContext.js +10 -11
  76. package/src/x_ite/Browser/VERSION.js +1 -1
  77. package/src/x_ite/Browser/X3DBrowser.js +52 -28
  78. package/src/x_ite/Components/CubeMapTexturing/ComposedCubeMapTexture.js +9 -14
  79. package/src/x_ite/Components/EnvironmentalEffects/Background.js +6 -6
  80. package/src/x_ite/Components/EnvironmentalEffects/TextureBackground.js +14 -34
  81. package/src/x_ite/Components/EnvironmentalEffects/X3DBackgroundNode.js +9 -36
  82. package/src/x_ite/Components/NURBS/NurbsCurve.js +1 -1
  83. package/src/x_ite/Components/NURBS/NurbsCurve2D.js +1 -1
  84. package/src/x_ite/Components/NURBS/NurbsOrientationInterpolator.js +1 -1
  85. package/src/x_ite/Components/NURBS/NurbsPositionInterpolator.js +1 -1
  86. package/src/x_ite/Components/NURBS/X3DNurbsSurfaceGeometryNode.js +1 -1
  87. package/src/x_ite/Components/Picking/LinePickSensor.js +2 -2
  88. package/src/x_ite/Components/Picking/PointPickSensor.js +2 -2
  89. package/src/x_ite/Components/Picking/PrimitivePickSensor.js +2 -2
  90. package/src/x_ite/Components/Picking/VolumePickSensor.js +2 -2
  91. package/src/x_ite/Components/RigidBodyPhysics/CollisionSensor.js +1 -1
  92. package/src/x_ite/Components/RigidBodyPhysics/MotorJoint.js +1 -1
  93. package/src/x_ite/Components/Shape/Material.js +10 -10
  94. package/src/x_ite/Components/Shape/PhysicalMaterial.js +6 -6
  95. package/src/x_ite/Components/Shape/X3DMaterialNode.js +1 -1
  96. package/src/x_ite/Components/Shape/X3DOneSidedMaterialNode.js +5 -5
  97. package/src/x_ite/Components/Sound/ListenerPointSource.js +2 -1
  98. package/src/x_ite/Components/Sound/MicrophoneSource.js +2 -1
  99. package/src/x_ite/Components/Sound/OscillatorSource.js +2 -1
  100. package/src/x_ite/Components/Sound/StreamAudioSource.js +2 -1
  101. package/src/x_ite/Components/Sound/X3DSoundProcessingNode.js +3 -0
  102. package/src/x_ite/Components/VolumeRendering/IsoSurfaceVolumeData.js +2 -2
  103. package/src/x_ite/Components/VolumeRendering/SegmentedVolumeData.js +2 -2
  104. package/src/x_ite/Components/VolumeRendering/VolumeData.js +2 -2
  105. package/src/x_ite/Fields/SFNode.js +5 -5
  106. package/src/x_ite/Fields.js +5 -4
  107. package/src/x_ite/Parser/X3DParser.js +1 -1
  108. package/src/x_ite/X3DCanvasElement.js +4 -4
  109. package/src/x_ite.html +1 -1
  110. package/x_ite.min.html +1 -1
@@ -1,4 +1,4 @@
1
- /* X_ITE v8.6.24 */(() => { // webpackBootstrap
1
+ /* X_ITE v8.7.1 */(() => { // 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.6.24")] .require ("x_ite/Components");
42
+ const Components_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.7.1")] .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.6.24")] .require ("x_ite/Components/Texturing/PixelTexture");
45
+ const PixelTexture_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.7.1")] .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.6.24")] .require ("x_ite/Components/Texturing/TextureProperties");
48
+ const TextureProperties_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.7.1")] .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.6.24")] .require ("x_ite/Fields");
51
+ const Fields_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.7.1")] .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.6.24")] .require ("x_ite/Base/X3DFieldDefinition");
54
+ const X3DFieldDefinition_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.7.1")] .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.6.24")] .require ("x_ite/Base/FieldDefinitionArray");
57
+ const FieldDefinitionArray_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.7.1")] .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.6.24")] .require ("x_ite/Components/Core/X3DNode");
60
+ const X3DNode_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.7.1")] .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.6.24")] .require ("x_ite/Base/X3DConstants");
63
+ const X3DConstants_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.7.1")] .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.6.24")] .require ("x_ite/Namespace");
66
+ const Namespace_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.7.1")] .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
  /*******************************************************************************
@@ -264,7 +264,7 @@ const X3DComposableVolumeRenderStyleNode_default_ = X3DComposableVolumeRenderSty
264
264
  Namespace_default().set ("x_ite/Components/VolumeRendering/X3DComposableVolumeRenderStyleNode", X3DComposableVolumeRenderStyleNode_default_);
265
265
  /* harmony default export */ const VolumeRendering_X3DComposableVolumeRenderStyleNode = (X3DComposableVolumeRenderStyleNode_default_);
266
266
  ;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"x_ite/Base/X3DCast\")"
267
- const X3DCast_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.6.24")] .require ("x_ite/Base/X3DCast");
267
+ const X3DCast_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.7.1")] .require ("x_ite/Base/X3DCast");
268
268
  var X3DCast_default = /*#__PURE__*/__webpack_require__.n(X3DCast_namespaceObject);
269
269
  ;// CONCATENATED MODULE: ./src/x_ite/Components/VolumeRendering/OpacityMapVolumeStyle.js
270
270
  /*******************************************************************************
@@ -576,7 +576,7 @@ const X3DVolumeRenderingContext_default_ = X3DVolumeRenderingContext;
576
576
  Namespace_default().set ("x_ite/Browser/VolumeRendering/X3DVolumeRenderingContext", X3DVolumeRenderingContext_default_);
577
577
  /* harmony default export */ const VolumeRendering_X3DVolumeRenderingContext = (X3DVolumeRenderingContext_default_);
578
578
  ;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"x_ite/DEBUG\")"
579
- const DEBUG_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.6.24")] .require ("x_ite/DEBUG");
579
+ const DEBUG_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.7.1")] .require ("x_ite/DEBUG");
580
580
  ;// CONCATENATED MODULE: ./src/x_ite/Components/VolumeRendering/BlendedVolumeStyle.js
581
581
  /*******************************************************************************
582
582
  *
@@ -1753,16 +1753,16 @@ const EdgeEnhancementVolumeStyle_default_ = EdgeEnhancementVolumeStyle;
1753
1753
  Namespace_default().set ("x_ite/Components/VolumeRendering/EdgeEnhancementVolumeStyle", EdgeEnhancementVolumeStyle_default_);
1754
1754
  /* harmony default export */ const VolumeRendering_EdgeEnhancementVolumeStyle = (EdgeEnhancementVolumeStyle_default_);
1755
1755
  ;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"x_ite/Components/Core/X3DChildNode\")"
1756
- const X3DChildNode_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.6.24")] .require ("x_ite/Components/Core/X3DChildNode");
1756
+ const X3DChildNode_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.7.1")] .require ("x_ite/Components/Core/X3DChildNode");
1757
1757
  var X3DChildNode_default = /*#__PURE__*/__webpack_require__.n(X3DChildNode_namespaceObject);
1758
1758
  ;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"x_ite/Components/Grouping/X3DBoundedObject\")"
1759
- const X3DBoundedObject_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.6.24")] .require ("x_ite/Components/Grouping/X3DBoundedObject");
1759
+ const X3DBoundedObject_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.7.1")] .require ("x_ite/Components/Grouping/X3DBoundedObject");
1760
1760
  var X3DBoundedObject_default = /*#__PURE__*/__webpack_require__.n(X3DBoundedObject_namespaceObject);
1761
1761
  ;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"x_ite/Browser/Core/TextureQuality\")"
1762
- const TextureQuality_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.6.24")] .require ("x_ite/Browser/Core/TextureQuality");
1762
+ const TextureQuality_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.7.1")] .require ("x_ite/Browser/Core/TextureQuality");
1763
1763
  var TextureQuality_default = /*#__PURE__*/__webpack_require__.n(TextureQuality_namespaceObject);
1764
1764
  ;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"x_ite/Components/Shape/UnlitMaterial\")"
1765
- const UnlitMaterial_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.6.24")] .require ("x_ite/Components/Shape/UnlitMaterial");
1765
+ const UnlitMaterial_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.7.1")] .require ("x_ite/Components/Shape/UnlitMaterial");
1766
1766
  var UnlitMaterial_default = /*#__PURE__*/__webpack_require__.n(UnlitMaterial_namespaceObject);
1767
1767
  ;// CONCATENATED MODULE: ./src/x_ite/Browser/VolumeRendering/VolumeStyle.vs.js
1768
1768
  const VolumeStyle_vs_default_ = /* glsl */ `#version 300 es
@@ -1994,7 +1994,7 @@ const VolumeMaterial_default_ = VolumeMaterial;
1994
1994
  Namespace_default().set ("x_ite/Browser/VolumeRendering/VolumeMaterial", VolumeMaterial_default_);
1995
1995
  /* harmony default export */ const VolumeRendering_VolumeMaterial = (VolumeMaterial_default_);
1996
1996
  ;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"standard/Math/Numbers/Vector3\")"
1997
- const Vector3_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.6.24")] .require ("standard/Math/Numbers/Vector3");
1997
+ const Vector3_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.7.1")] .require ("standard/Math/Numbers/Vector3");
1998
1998
  var Vector3_default = /*#__PURE__*/__webpack_require__.n(Vector3_namespaceObject);
1999
1999
  ;// CONCATENATED MODULE: ./src/x_ite/Components/VolumeRendering/X3DVolumeDataNode.js
2000
2000
  /*******************************************************************************
@@ -2230,10 +2230,10 @@ const X3DVolumeDataNode_default_ = X3DVolumeDataNode;
2230
2230
  Namespace_default().set ("x_ite/Components/VolumeRendering/X3DVolumeDataNode", X3DVolumeDataNode_default_);
2231
2231
  /* harmony default export */ const VolumeRendering_X3DVolumeDataNode = (X3DVolumeDataNode_default_);
2232
2232
  ;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"x_ite/Components/Shaders/ComposedShader\")"
2233
- const ComposedShader_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.6.24")] .require ("x_ite/Components/Shaders/ComposedShader");
2233
+ const ComposedShader_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.7.1")] .require ("x_ite/Components/Shaders/ComposedShader");
2234
2234
  var ComposedShader_default = /*#__PURE__*/__webpack_require__.n(ComposedShader_namespaceObject);
2235
2235
  ;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"x_ite/Components/Shaders/ShaderPart\")"
2236
- const ShaderPart_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.6.24")] .require ("x_ite/Components/Shaders/ShaderPart");
2236
+ const ShaderPart_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.7.1")] .require ("x_ite/Components/Shaders/ShaderPart");
2237
2237
  var ShaderPart_default = /*#__PURE__*/__webpack_require__.n(ShaderPart_namespaceObject);
2238
2238
  ;// CONCATENATED MODULE: ./src/x_ite/Components/VolumeRendering/IsoSurfaceVolumeData.js
2239
2239
  /*******************************************************************************
@@ -2547,7 +2547,7 @@ IsoSurfaceVolumeData .prototype = Object .assign (Object .create (VolumeRenderin
2547
2547
  // this .getBrowser () .print (fs);
2548
2548
 
2549
2549
  const vertexShader = new (ShaderPart_default()) (this .getExecutionContext ());
2550
- vertexShader ._url .push ("data:x-shader/x-vertex," + vs);
2550
+ vertexShader ._url .push (encodeURI ("data:x-shader/x-vertex," + vs));
2551
2551
  vertexShader .setPrivate (true);
2552
2552
  vertexShader .setName ("VolumeDataVertexShader");
2553
2553
  vertexShader .setOptions (options);
@@ -2555,7 +2555,7 @@ IsoSurfaceVolumeData .prototype = Object .assign (Object .create (VolumeRenderin
2555
2555
 
2556
2556
  const fragmentShader = new (ShaderPart_default()) (this .getExecutionContext ());
2557
2557
  fragmentShader ._type = "FRAGMENT";
2558
- fragmentShader ._url .push ("data:x-shader/x-fragment," + fs);
2558
+ fragmentShader ._url .push (encodeURI ("data:x-shader/x-fragment," + fs));
2559
2559
  fragmentShader .setPrivate (true);
2560
2560
  fragmentShader .setName ("VolumeDataFragmentShader");
2561
2561
  fragmentShader .setOptions (options);
@@ -3044,7 +3044,7 @@ SegmentedVolumeData .prototype = Object .assign (Object .create (VolumeRendering
3044
3044
  // this .getBrowser () .print (fs);
3045
3045
 
3046
3046
  const vertexShader = new (ShaderPart_default()) (this .getExecutionContext ());
3047
- vertexShader ._url .push ("data:x-shader/x-vertex," + vs);
3047
+ vertexShader ._url .push (encodeURI ("data:x-shader/x-vertex," + vs));
3048
3048
  vertexShader .setPrivate (true);
3049
3049
  vertexShader .setName ("SegmentedVolumeDataVertexShader");
3050
3050
  vertexShader .setOptions (options);
@@ -3052,7 +3052,7 @@ SegmentedVolumeData .prototype = Object .assign (Object .create (VolumeRendering
3052
3052
 
3053
3053
  const fragmentShader = new (ShaderPart_default()) (this .getExecutionContext ());
3054
3054
  fragmentShader ._type = "FRAGMENT";
3055
- fragmentShader ._url .push ("data:x-shader/x-fragment," + fs);
3055
+ fragmentShader ._url .push (encodeURI ("data:x-shader/x-fragment," + fs));
3056
3056
  fragmentShader .setPrivate (true);
3057
3057
  fragmentShader .setName ("SegmentedVolumeDataFragmentShader");
3058
3058
  fragmentShader .setOptions (options);
@@ -3884,7 +3884,7 @@ VolumeData .prototype = Object .assign (Object .create (VolumeRendering_X3DVolum
3884
3884
  // this .getBrowser () .print (fs);
3885
3885
 
3886
3886
  const vertexShader = new (ShaderPart_default()) (this .getExecutionContext ());
3887
- vertexShader ._url .push ("data:x-shader/x-vertex," + vs);
3887
+ vertexShader ._url .push (encodeURI ("data:x-shader/x-vertex," + vs));
3888
3888
  vertexShader .setPrivate (true);
3889
3889
  vertexShader .setName ("VolumeDataVertexShader");
3890
3890
  vertexShader .setOptions (options);
@@ -3892,7 +3892,7 @@ VolumeData .prototype = Object .assign (Object .create (VolumeRendering_X3DVolum
3892
3892
 
3893
3893
  const fragmentShader = new (ShaderPart_default()) (this .getExecutionContext ());
3894
3894
  fragmentShader ._type = "FRAGMENT";
3895
- fragmentShader ._url .push ("data:x-shader/x-fragment," + fs);
3895
+ fragmentShader ._url .push (encodeURI ("data:x-shader/x-fragment," + fs));
3896
3896
  fragmentShader .setPrivate (true);
3897
3897
  fragmentShader .setName ("VolumeDataFragmentShader");
3898
3898
  fragmentShader .setOptions (options);
@@ -1 +1 @@
1
- /* X_ITE v8.6.24 */(()=>{"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.6.24")].require("x_ite/Components");var n=e.n(t);const o=window[Symbol.for("X_ITE.X3D-8.6.24")].require("x_ite/Components/Texturing/PixelTexture");var i=e.n(o);const r=window[Symbol.for("X_ITE.X3D-8.6.24")].require("x_ite/Components/Texturing/TextureProperties");var s=e.n(r);const a=window[Symbol.for("X_ITE.X3D-8.6.24")].require("x_ite/Fields");var l=e.n(a);const d=window[Symbol.for("X_ITE.X3D-8.6.24")].require("x_ite/Base/X3DFieldDefinition");var u=e.n(d);const c=window[Symbol.for("X_ITE.X3D-8.6.24")].require("x_ite/Base/FieldDefinitionArray");var h=e.n(c);const f=window[Symbol.for("X_ITE.X3D-8.6.24")].require("x_ite/Components/Core/X3DNode");var p=e.n(f);const g=window[Symbol.for("X_ITE.X3D-8.6.24")].require("x_ite/Base/X3DConstants");var m=e.n(g);const _=window[Symbol.for("X_ITE.X3D-8.6.24")].require("x_ite/Namespace");var S=e.n(_);function y(e){p().call(this,e),this.addType(m().X3DVolumeRenderStyleNode),this.volumeDataNodes=new Set}y.prototype=Object.assign(Object.create(p().prototype),{constructor:y,addShaderFields:function(e){},getUniformsText:function(){return""},getFunctionsText:function(){return""},getVolumeData:function(){return this.volumeDataNodes},addVolumeData:function(e){this.volumeDataNodes.add(e)},removeVolumeData:function(e){this.volumeDataNodes.delete(e)},getNormalText:function(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}});const x=y;S().set("x_ite/Components/VolumeRendering/X3DVolumeRenderStyleNode",x);const N=x;function w(e){N.call(this,e),this.addType(m().X3DComposableVolumeRenderStyleNode)}w.prototype=Object.assign(Object.create(N.prototype),{constructor:w});const v=w;S().set("x_ite/Components/VolumeRendering/X3DComposableVolumeRenderStyleNode",v);const C=v,F=window[Symbol.for("X_ITE.X3D-8.6.24")].require("x_ite/Base/X3DCast");var I=e.n(F);function V(e){C.call(this,e),this.addType(m().OpacityMapVolumeStyle)}V.prototype=Object.assign(Object.create(C.prototype),{constructor:V,[Symbol.for("X_ITE.X3DBaseNode.fieldDefinitions")]:new(h())([new(u())(m().inputOutput,"enabled",new(l().SFBool)(!0)),new(u())(m().inputOutput,"metadata",new(l().SFNode)),new(u())(m().inputOutput,"transferFunction",new(l().SFNode))]),getTypeName:function(){return"OpacityMapVolumeStyle"},getComponentName:function(){return"VolumeRendering"},getContainerField:function(){return"renderStyle"},getSpecificationRange:function(){return["3.3","Infinity"]},initialize:function(){C.prototype.initialize.call(this);this.getBrowser().getContext().getVersion()<2||(this._transferFunction.addInterest("set_transferFunction__",this),this.set_transferFunction__())},set_transferFunction__:function(){this.transferFunctionNode=I()(m().X3DTexture2DNode,this._transferFunction),this.transferFunctionNode||(this.transferFunctionNode=I()(m().X3DTexture3DNode,this._transferFunction)),this.transferFunctionNode||(this.transferFunctionNode=this.getBrowser().getDefaultTransferFunction())},addShaderFields:function(e){this._enabled.getValue()&&e.addUserDefinedField(m().inputOutput,"transferFunction_"+this.getId(),new(l().SFNode)(this.transferFunctionNode))},getUniformsText:function(){if(!this._enabled.getValue())return"";let e="";return e+="\n",e+="// OpacityMapVolumeStyle\n",e+="\n",this.transferFunctionNode.getType().includes(m().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:function(){if(!this._enabled.getValue())return"";let e="";return e+="\n",e+=" // OpacityMapVolumeStyle\n",e+="\n",e+=" textureColor = getOpacityMapStyle_"+this.getId()+" (textureColor);\n",e}});const T=V;S().set("x_ite/Components/VolumeRendering/OpacityMapVolumeStyle",T);const b=T,D=Symbol(),O=Symbol(),E=Symbol(),X=Symbol();function B(){}B.prototype={getDefaultVoxels:function(){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:function(){return this[O]=new b(this.getPrivateScene()),this[O].setPrivate(!0),this[O].setup(),this.getDefaultVolumeStyle=function(){return this[O]},Object.defineProperty(this,"getDefaultVolumeStyle",{enumerable:!1}),this[O]},getDefaultBlendedVolumeStyle:function(){return this[E]=new b(this.getPrivateScene()),this[E].setPrivate(!0),this[E].setup(),this.getDefaultBlendedVolumeStyle=function(){return this[E]},Object.defineProperty(this,"getDefaultBlendedVolumeStyle",{enumerable:!1}),this[E]},getDefaultTransferFunction:function(){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[X]=new(i())(this.getPrivateScene()),this[X]._textureProperties=e,this[X]._image.width=256,this[X]._image.height=1,this[X]._image.comp=2,this[X]._image.array=Array.from({length:256},((e,t)=>t<<8|t)),this[X].setPrivate(!0),this[X].setup(),this.getDefaultTransferFunction=function(){return this[X]},Object.defineProperty(this,"getDefaultTransferFunction",{enumerable:!1}),this[X]}};const M=B;S().set("x_ite/Browser/VolumeRendering/X3DVolumeRenderingContext",M);const P=M;window[Symbol.for("X_ITE.X3D-8.6.24")].require("x_ite/DEBUG");function U(e){C.call(this,e),this.addType(m().BlendedVolumeStyle)}U.prototype=Object.assign(Object.create(C.prototype),{constructor:U,[Symbol.for("X_ITE.X3DBaseNode.fieldDefinitions")]:new(h())([new(u())(m().inputOutput,"metadata",new(l().SFNode)),new(u())(m().inputOutput,"enabled",new(l().SFBool)(!0)),new(u())(m().inputOutput,"weightConstant1",new(l().SFFloat)(.5)),new(u())(m().inputOutput,"weightConstant2",new(l().SFFloat)(.5)),new(u())(m().inputOutput,"weightFunction1",new(l().SFString)("CONSTANT")),new(u())(m().inputOutput,"weightFunction2",new(l().SFString)("CONSTANT")),new(u())(m().inputOutput,"weightTransferFunction1",new(l().SFNode)),new(u())(m().inputOutput,"weightTransferFunction2",new(l().SFNode)),new(u())(m().inputOutput,"renderStyle",new(l().SFNode)),new(u())(m().inputOutput,"voxels",new(l().SFNode))]),getTypeName:function(){return"BlendedVolumeStyle"},getComponentName:function(){return"VolumeRendering"},getContainerField:function(){return"renderStyle"},getSpecificationRange:function(){return["3.3","Infinity"]},initialize:function(){C.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:function(e){C.prototype.addVolumeData.call(this,e),this.renderStyleNode&&this.renderStyleNode.addVolumeData(e)},removeVolumeData:function(e){C.prototype.removeVolumeData.call(this,e),this.renderStyleNode&&this.renderStyleNode.removeVolumeData(e)},set_weightTransferFunction1__:function(){this.weightTransferFunction1Node=I()(m().X3DTexture2DNode,this._weightTransferFunction1)},set_weightTransferFunction2__:function(){this.weightTransferFunction2Node=I()(m().X3DTexture2DNode,this._weightTransferFunction2)},set_renderStyle__:function(){if(this.renderStyleNode){this.renderStyleNode.removeInterest("addNodeEvent",this);for(const e of this.getVolumeData())this.renderStyleNode.removeVolumeData(e)}if(this.renderStyleNode=I()(m().X3DComposableVolumeRenderStyleNode,this._renderStyle),this.renderStyleNode){this.renderStyleNode.addInterest("addNodeEvent",this);for(const e of this.getVolumeData())this.renderStyleNode.addVolumeData(e)}},set_voxels__:function(){this.voxelsNode=I()(m().X3DTexture3DNode,this._voxels)},addShaderFields:function(e){this._enabled.getValue()&&(e.addUserDefinedField(m().inputOutput,"weightConstant1_"+this.getId(),this._weightConstant1.copy()),e.addUserDefinedField(m().inputOutput,"weightConstant2_"+this.getId(),this._weightConstant2.copy()),this.weightTransferFunction1Node&&e.addUserDefinedField(m().inputOutput,"weightTransferFunction1_"+this.getId(),new(l().SFNode)(this.weightTransferFunction1Node)),this.weightTransferFunction2Node&&e.addUserDefinedField(m().inputOutput,"weightTransferFunction2_"+this.getId(),new(l().SFNode)(this.weightTransferFunction2Node)),this.voxelsNode&&e.addUserDefinedField(m().inputOutput,"voxels_"+this.getId(),new(l().SFNode)(this.voxelsNode)),this.getBrowser().getDefaultBlendedVolumeStyle().addShaderFields(e),this.renderStyleNode&&this.renderStyleNode.addShaderFields(e))},getUniformsText:function(){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:function(){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}});const R=U;S().set("x_ite/Components/VolumeRendering/BlendedVolumeStyle",R);const L=R;function A(e){C.call(this,e),this.addType(m().BoundaryEnhancementVolumeStyle)}A.prototype=Object.assign(Object.create(C.prototype),{constructor:A,[Symbol.for("X_ITE.X3DBaseNode.fieldDefinitions")]:new(h())([new(u())(m().inputOutput,"metadata",new(l().SFNode)),new(u())(m().inputOutput,"enabled",new(l().SFBool)(!0)),new(u())(m().inputOutput,"retainedOpacity",new(l().SFFloat)(.2)),new(u())(m().inputOutput,"boundaryOpacity",new(l().SFFloat)(.9)),new(u())(m().inputOutput,"opacityFactor",new(l().SFFloat)(2))]),getTypeName:function(){return"BoundaryEnhancementVolumeStyle"},getComponentName:function(){return"VolumeRendering"},getContainerField:function(){return"renderStyle"},getSpecificationRange:function(){return["3.3","Infinity"]},addShaderFields:function(e){this._enabled.getValue()&&(e.addUserDefinedField(m().inputOutput,"retainedOpacity_"+this.getId(),this._retainedOpacity.copy()),e.addUserDefinedField(m().inputOutput,"boundaryOpacity_"+this.getId(),this._boundaryOpacity.copy()),e.addUserDefinedField(m().inputOutput,"opacityFactor_"+this.getId(),this._opacityFactor.copy()))},getUniformsText:function(){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:function(){if(!this._enabled.getValue())return"";let e="";return e+="\n",e+=" // BoundaryEnhancementVolumeStyle\n",e+="\n",e+=" textureColor = getBoundaryEnhancementStyle_"+this.getId()+" (textureColor, texCoord);\n",e}});const z=A;S().set("x_ite/Components/VolumeRendering/BoundaryEnhancementVolumeStyle",z);const j=z;function G(e){C.call(this,e),this.addType(m().CartoonVolumeStyle)}G.prototype=Object.assign(Object.create(C.prototype),{constructor:G,[Symbol.for("X_ITE.X3DBaseNode.fieldDefinitions")]:new(h())([new(u())(m().inputOutput,"metadata",new(l().SFNode)),new(u())(m().inputOutput,"enabled",new(l().SFBool)(!0)),new(u())(m().inputOutput,"colorSteps",new(l().SFInt32)(4)),new(u())(m().inputOutput,"orthogonalColor",new(l().SFColorRGBA)(1,1,1,1)),new(u())(m().inputOutput,"parallelColor",new(l().SFColorRGBA)(0,0,0,1)),new(u())(m().inputOutput,"surfaceNormals",new(l().SFNode))]),getTypeName:function(){return"CartoonVolumeStyle"},getComponentName:function(){return"VolumeRendering"},getContainerField:function(){return"renderStyle"},getSpecificationRange:function(){return["3.3","Infinity"]},initialize:function(){C.prototype.initialize.call(this);this.getBrowser().getContext().getVersion()<2||(this._surfaceNormals.addInterest("set_surfaceNormals__",this),this.set_surfaceNormals__())},set_surfaceNormals__:function(){this.surfaceNormalsNode=I()(m().X3DTexture3DNode,this._surfaceNormals)},addShaderFields:function(e){this._enabled.getValue()&&(e.addUserDefinedField(m().inputOutput,"colorSteps_"+this.getId(),this._colorSteps.copy()),e.addUserDefinedField(m().inputOutput,"orthogonalColor_"+this.getId(),this._orthogonalColor.copy()),e.addUserDefinedField(m().inputOutput,"parallelColor_"+this.getId(),this._parallelColor.copy()),this.surfaceNormalsNode&&e.addUserDefinedField(m().inputOutput,"surfaceNormals_"+this.getId(),new(l().SFNode)(this.surfaceNormalsNode)))},getUniformsText:function(){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:function(){if(!this._enabled.getValue())return"";let e="";return e+="\n",e+=" // CartoonVolumeStyle\n",e+="\n",e+=" textureColor = getCartoonStyle_"+this.getId()+" (textureColor, texCoord);\n",e}});const q=G;S().set("x_ite/Components/VolumeRendering/CartoonVolumeStyle",q);const H=q;function k(e){C.call(this,e),this.addType(m().ComposedVolumeStyle),this.renderStyleNodes=[]}k.prototype=Object.assign(Object.create(C.prototype),{constructor:k,[Symbol.for("X_ITE.X3DBaseNode.fieldDefinitions")]:new(h())([new(u())(m().inputOutput,"metadata",new(l().SFNode)),new(u())(m().inputOutput,"enabled",new(l().SFBool)(!0)),new(u())(m().inputOutput,"renderStyle",new(l().MFNode))]),getTypeName:function(){return"ComposedVolumeStyle"},getComponentName:function(){return"VolumeRendering"},getContainerField:function(){return"renderStyle"},getSpecificationRange:function(){return["3.3","Infinity"]},initialize:function(){C.prototype.initialize.call(this);this.getBrowser().getContext().getVersion()<2||(this._renderStyle.addInterest("set_renderStyle__",this),this.set_renderStyle__())},addVolumeData:function(e){C.prototype.addVolumeData.call(this,e);for(const t of this.renderStyleNodes)t.addVolumeData(e)},removeVolumeData:function(e){C.prototype.removeVolumeData.call(this,e);for(const t of this.renderStyleNodes)t.removeVolumeData(e)},set_renderStyle__:function(){const e=this.renderStyleNodes;for(const t of e){t.removeInterest("addNodeEvent",this);for(const e of this.getVolumeData())t.removeVolumeData(e)}e.length=0;for(const t of this._renderStyle){const n=I()(m().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:function(e){if(this._enabled.getValue())for(const t of this.renderStyleNodes)t.addShaderFields(e)},getUniformsText:function(){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:function(){if(!this._enabled.getValue())return"";let e="";return e+="\n",e+=" // ComposedVolumeStyle\n",e+="\n",e+=" textureColor = getComposedStyle_"+this.getId()+" (textureColor, texCoord);\n",e}});const Y=k;S().set("x_ite/Components/VolumeRendering/ComposedVolumeStyle",Y);const W=Y;function Q(e){C.call(this,e),this.addType(m().EdgeEnhancementVolumeStyle)}Q.prototype=Object.assign(Object.create(C.prototype),{constructor:Q,[Symbol.for("X_ITE.X3DBaseNode.fieldDefinitions")]:new(h())([new(u())(m().inputOutput,"metadata",new(l().SFNode)),new(u())(m().inputOutput,"enabled",new(l().SFBool)(!0)),new(u())(m().inputOutput,"edgeColor",new(l().SFColorRGBA)(0,0,0,1)),new(u())(m().inputOutput,"gradientThreshold",new(l().SFFloat)(.4)),new(u())(m().inputOutput,"surfaceNormals",new(l().SFNode))]),getTypeName:function(){return"EdgeEnhancementVolumeStyle"},getComponentName:function(){return"VolumeRendering"},getContainerField:function(){return"renderStyle"},getSpecificationRange:function(){return["3.3","Infinity"]},initialize:function(){C.prototype.initialize.call(this);this.getBrowser().getContext().getVersion()<2||(this._surfaceNormals.addInterest("set_surfaceNormals__",this),this.set_surfaceNormals__())},set_surfaceNormals__:function(){this.surfaceNormalsNode=I()(m().X3DTexture3DNode,this._surfaceNormals)},addShaderFields:function(e){this._enabled.getValue()&&(e.addUserDefinedField(m().inputOutput,"edgeColor_"+this.getId(),this._edgeColor.copy()),e.addUserDefinedField(m().inputOutput,"gradientThreshold_"+this.getId(),this._gradientThreshold.copy()),this.surfaceNormalsNode&&e.addUserDefinedField(m().inputOutput,"surfaceNormals_"+this.getId(),new(l().SFNode)(this.surfaceNormalsNode)))},getUniformsText:function(){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:function(){if(!this._enabled.getValue())return"";let e="";return e+="\n",e+=" // EdgeEnhancementVolumeStyle\n",e+="\n",e+=" textureColor = getEdgeEnhacementStyle_"+this.getId()+" (textureColor, texCoord);\n",e}});const Z=Q;S().set("x_ite/Components/VolumeRendering/EdgeEnhancementVolumeStyle",Z);const J=Z,K=window[Symbol.for("X_ITE.X3D-8.6.24")].require("x_ite/Components/Core/X3DChildNode");var $=e.n(K);const ee=window[Symbol.for("X_ITE.X3D-8.6.24")].require("x_ite/Components/Grouping/X3DBoundedObject");var te=e.n(ee);const ne=window[Symbol.for("X_ITE.X3D-8.6.24")].require("x_ite/Browser/Core/TextureQuality");var oe=e.n(ne);const ie=window[Symbol.for("X_ITE.X3D-8.6.24")].require("x_ite/Components/Shape/UnlitMaterial");var re=e.n(ie);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";S().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';S().set("x_ite/Browser/VolumeRendering/VolumeStyle.fs",le);const de=le;function ue(e,t){re().call(this,e),this.volumeDataNode=t,this.volumeShaderNodes=new Map}ue.prototype=Object.assign(Object.create(re().prototype),{constructor:ue,getTypeName:function(){return"VolumeMaterial"},getComponentName:function(){return"Shape"},getContainerField:function(){return"material"},getVolumeShaders:function(){return this.volumeShaderNodes},getShader:function(e,t){const{fogNode:n,objectsCount:o}=t;let i="";return i+=n?n.getFogType():0,i+=".",i+=o[0],i+=".",i+=o[1],this.volumeShaderNodes.get(i)||this.createShader(i,e,t)},createShader:function(e,t,n){const o=this.getBrowser(),i=[],{fogNode:r,objectsCount:s}=n;r&&i.push("X3D_FOG"),s[0]&&(i.push("X3D_CLIP_PLANES"),i.push("X3D_NUM_CLIP_PLANES "+Math.min(s[0],o.getMaxClipPlanes()))),s[1]&&(i.push("X3D_LIGHTING"),i.push("X3D_NUM_LIGHTS "+Math.min(s[1],o.getMaxLights())));const a=this.volumeDataNode.createShader(i,ae,de);return this.volumeShaderNodes.set(e,a),a},setShaderUniforms:function(e,t,n,o,i){this.volumeDataNode.setShaderUniforms(e,t)}});const ce=ue;S().set("x_ite/Browser/VolumeRendering/VolumeMaterial",ce);const he=ce,fe=window[Symbol.for("X_ITE.X3D-8.6.24")].require("standard/Math/Numbers/Vector3");var pe=e.n(fe);function ge(e){$().call(this,e),te().call(this,e),this.addType(m().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 he(t.getPrivateScene(),this),this.textureNormalMatrixArray=new Float32Array(9),this.setCameraObject(!0)}ge.prototype=Object.assign(Object.create($().prototype),te().prototype,{constructor:ge,initialize:function(){$().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:function(e,t){return this._bboxSize.getValue().equals(this.getDefaultBBoxSize())?e.set(this._dimensions.getValue(),pe().Zero):e.set(this._bboxSize.getValue(),this._bboxCenter.getValue())},getAppearance:function(){return this.appearanceNode},updateShader:function(){this.volumeMaterialNode.getVolumeShaders().clear()},addShaderUniformNames:function(e){e.push("x3d_TextureNormalMatrix")},getNumPlanes:function(){switch(this.getBrowser().getBrowserOptions().getTextureQuality()){case oe().LOW:return 200;case oe().MEDIUM:return 400;case oe().HIGH:return 600}return 200},set_dimensions__:function(){const e=this.getNumPlanes(),t=this._dimensions.getValue().magnitude(),n=t/2,o=[];this.coordinateNode._point.length=0;for(let i=0;i<e;++i){const r=i/(e-1)-.5;o.push(n,n,t*r,-n,n,t*r,-n,-n,t*r,n,-n,t*r)}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__:function(){this.textureNormalMatrixArray.set(this.textureTransformNode.getMatrix().submatrix.inverse())},traverse:function(e,t){this.proximitySensorNode.traverse(e,t),this.transformNode.traverse(e,t)},setShaderUniforms(e,t){e.uniformMatrix3fv(t.x3d_TextureNormalMatrix,!0,this.textureNormalMatrixArray)},dispose:function(){te().prototype.dispose.call(this),$().prototype.dispose.call(this)}});const me=ge;S().set("x_ite/Components/VolumeRendering/X3DVolumeDataNode",me);const _e=me,Se=window[Symbol.for("X_ITE.X3D-8.6.24")].require("x_ite/Components/Shaders/ComposedShader");var ye=e.n(Se);const xe=window[Symbol.for("X_ITE.X3D-8.6.24")].require("x_ite/Components/Shaders/ShaderPart");var Ne=e.n(xe);function we(e){_e.call(this,e),this.addType(m().IsoSurfaceVolumeData),this.renderStyleNodes=[]}we.prototype=Object.assign(Object.create(_e.prototype),{constructor:we,[Symbol.for("X_ITE.X3DBaseNode.fieldDefinitions")]:new(h())([new(u())(m().inputOutput,"metadata",new(l().SFNode)),new(u())(m().inputOutput,"dimensions",new(l().SFVec3f)(1,1,1)),new(u())(m().inputOutput,"contourStepSize",new(l().SFFloat)(0)),new(u())(m().inputOutput,"surfaceValues",new(l().MFFloat)),new(u())(m().inputOutput,"surfaceTolerance",new(l().SFFloat)(0)),new(u())(m().inputOutput,"visible",new(l().SFBool)(!0)),new(u())(m().inputOutput,"bboxDisplay",new(l().SFBool)),new(u())(m().initializeOnly,"bboxCenter",new(l().SFVec3f)(0,0,0)),new(u())(m().initializeOnly,"bboxSize",new(l().SFVec3f)(-1,-1,-1)),new(u())(m().inputOutput,"renderStyle",new(l().MFNode)),new(u())(m().inputOutput,"gradients",new(l().SFNode)),new(u())(m().inputOutput,"voxels",new(l().SFNode))]),getTypeName:function(){return"IsoSurfaceVolumeData"},getComponentName:function(){return"VolumeRendering"},getContainerField:function(){return"children"},getSpecificationRange:function(){return["3.3","Infinity"]},initialize:function(){_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__:function(){this.gradientsNode=I()(m().X3DTexture3DNode,this._gradients)},set_renderStyle__:function(){const e=this.renderStyleNodes;for(const t of e)t.removeInterest("updateShader",this),t.removeVolumeData(this);e.length=0;for(const t of this._renderStyle){const n=I()(m().X3DComposableVolumeRenderStyleNode,t);n&&e.push(n)}for(const t of e)t.addInterest("updateShader",this),t.addVolumeData(this)},set_voxels__:function(){this.voxelsNode=I()(m().X3DTexture3DNode,this._voxels),this.voxelsNode?this.getAppearance()._texture=this._voxels:this.getAppearance()._texture=this.getBrowser().getDefaultVoxels()},createShader:function(e,t,n){const o=this.getBrowser().getDefaultVolumeStyle();let i=o.getUniformsText(),r=o.getFunctionsText();i+="\n",i+="uniform float surfaceValues ["+this._surfaceValues.length+"];\n",i+="uniform float surfaceTolerance;\n";for(const e of this.renderStyleNodes)i+=e.getUniformsText();if(r+="\n",r+=" // IsoSurfaceVolumeData\n",r+="\n",this.gradientsNode?(i+="\n",i+="uniform sampler3D gradients;\n",r+=" if (length (texture (gradients, texCoord) .xyz * 2.0 - 1.0) < surfaceTolerance)\n",r+=" discard;\n"):(i+="\n",i+="vec4\n",i+="getNormal (in vec3 texCoord)\n",i+="{\n",i+=" vec4 offset = vec4 (1.0 / vec3 (textureSize (x3d_Texture3D [0], 0)), 0.0);\n",i+=" float i0 = texture (x3d_Texture3D [0], texCoord + offset .xww) .r;\n",i+=" float i1 = texture (x3d_Texture3D [0], texCoord - offset .xww) .r;\n",i+=" float i2 = texture (x3d_Texture3D [0], texCoord + offset .wyw) .r;\n",i+=" float i3 = texture (x3d_Texture3D [0], texCoord - offset .wyw) .r;\n",i+=" float i4 = texture (x3d_Texture3D [0], texCoord + offset .wwz) .r;\n",i+=" float i5 = texture (x3d_Texture3D [0], texCoord - offset .wwz) .r;\n",i+=" vec3 n = vec3 (i1 - i0, i3 - i2, i5 - i4);\n",i+="\n",i+=" return vec4 (normalize (x3d_TextureNormalMatrix * n), length (n));\n",i+="}\n",r+=" if (getNormal (texCoord) .w < surfaceTolerance)\n",r+=" discard;\n"),r+="\n",r+=" float intensity = textureColor .r;\n",r+="\n",1===this._surfaceValues.length){const e=Math.abs(this._contourStepSize.getValue());if(0===e)r+=" if (intensity > surfaceValues [0])\n",r+=" {\n",r+=" textureColor = vec4 (vec3 (surfaceValues [0]), 1.0);\n",this.renderStyleNodes.length&&(r+=this.renderStyleNodes[0].getFunctionsText()),r+=" }\n",r+=" else\n",r+=" {\n",r+=" discard;\n",r+=" }\n",r+="\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);r+=" if (false)\n",r+=" { }\n";for(let e=this._surfaceValues.length-1;e>=0;--e)r+=" else if (intensity > "+t[e]+")\n",r+=" {\n",r+=" textureColor = vec4 (vec3 ("+t[e]+"), 1.0);\n",this.renderStyleNodes.length&&(r+=this.renderStyleNodes[0].getFunctionsText()),r+=" }\n";r+=" else\n",r+=" {\n",r+=" discard;\n",r+=" }\n",r+="\n"}}else{r+=" if (false)\n",r+=" { }\n";for(let e=this._surfaceValues.length-1;e>=0;--e){if(r+=" else if (intensity > surfaceValues ["+e+"])\n",r+=" {\n",r+=" textureColor = vec4 (vec3 (surfaceValues ["+e+"]), 1.0);\n",this.renderStyleNodes.length){const t=Math.min(e,this.renderStyleNodes.length-1);r+=this.renderStyleNodes[t].getFunctionsText()}r+=" }\n"}r+=" else\n",r+=" {\n",r+=" discard;\n",r+=" }\n",r+="\n"}n=(n=n.replace(/\/\/ VOLUME_STYLES_UNIFORMS\n/,i)).replace(/\/\/ VOLUME_STYLES_FUNCTIONS\n/,r);const s=new(Ne())(this.getExecutionContext());s._url.push("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("data:x-shader/x-fragment,"+n),a.setPrivate(!0),a.setName("VolumeDataFragmentShader"),a.setOptions(e),a.setup();const d=new(ye())(this.getExecutionContext());d._language="GLSL",d._parts.push(s),d._parts.push(a),d.setPrivate(!0),d.setName("VolumeDataShader"),d.addUserDefinedField(m().inputOutput,"surfaceValues",this._surfaceValues.copy()),d.addUserDefinedField(m().inputOutput,"surfaceTolerance",this._surfaceTolerance.copy()),this.gradientsNode&&d.addUserDefinedField(m().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}});const ve=we;S().set("x_ite/Components/VolumeRendering/IsoSurfaceVolumeData",ve);const Ce=ve;function Fe(e){N.call(this,e),this.addType(m().ProjectionVolumeStyle)}Fe.prototype=Object.assign(Object.create(N.prototype),{constructor:Fe,[Symbol.for("X_ITE.X3DBaseNode.fieldDefinitions")]:new(h())([new(u())(m().inputOutput,"metadata",new(l().SFNode)),new(u())(m().inputOutput,"enabled",new(l().SFBool)(!0)),new(u())(m().inputOutput,"type",new(l().SFString)("MAX")),new(u())(m().inputOutput,"intensityThreshold",new(l().SFFloat)(0))]),getTypeName:function(){return"ProjectionVolumeStyle"},getComponentName:function(){return"VolumeRendering"},getContainerField:function(){return"renderStyle"},getSpecificationRange:function(){return["3.3","Infinity"]},addShaderFields:function(e){this._enabled.getValue()&&e.addUserDefinedField(m().inputOutput,"intensityThreshold_"+this.getId(),this._intensityThreshold.copy())},getUniformsText:function(){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:function(){if(!this._enabled.getValue())return"";let e="";return e+="\n",e+=" // ProjectionVolumeStyle\n",e+="\n",e+=" textureColor = getProjectionStyle_"+this.getId()+" (textureColor, texCoord);\n",e}});const Ie=Fe;S().set("x_ite/Components/VolumeRendering/ProjectionVolumeStyle",Ie);const Ve=Ie;function Te(e){_e.call(this,e),this.addType(m().SegmentedVolumeData),this.segmentIdentifiersNode=null,this.renderStyleNodes=[]}Te.prototype=Object.assign(Object.create(_e.prototype),{constructor:Te,[Symbol.for("X_ITE.X3DBaseNode.fieldDefinitions")]:new(h())([new(u())(m().inputOutput,"metadata",new(l().SFNode)),new(u())(m().inputOutput,"dimensions",new(l().SFVec3f)(1,1,1)),new(u())(m().inputOutput,"segmentEnabled",new(l().MFBool)),new(u())(m().inputOutput,"visible",new(l().SFBool)(!0)),new(u())(m().inputOutput,"bboxDisplay",new(l().SFBool)),new(u())(m().initializeOnly,"bboxCenter",new(l().SFVec3f)(0,0,0)),new(u())(m().initializeOnly,"bboxSize",new(l().SFVec3f)(-1,-1,-1)),new(u())(m().inputOutput,"segmentIdentifiers",new(l().SFNode)),new(u())(m().inputOutput,"renderStyle",new(l().MFNode)),new(u())(m().inputOutput,"voxels",new(l().SFNode))]),getTypeName:function(){return"SegmentedVolumeData"},getComponentName:function(){return"VolumeRendering"},getContainerField:function(){return"children"},getSpecificationRange:function(){return["3.3","Infinity"]},initialize:function(){_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:function(e){return!(e<this._segmentEnabled.length)||this._segmentEnabled[e]},set_segmentIdentifiers__:function(){this.segmentIdentifiersNode=I()(m().X3DTexture3DNode,this._segmentIdentifiers)},set_renderStyle__:function(){const e=this.renderStyleNodes;for(const t of e)t.removeInterest("updateShader",this),t.removeVolumeData(this);e.length=0;for(const t of this._renderStyle){const n=I()(m().X3DComposableVolumeRenderStyleNode,t);n&&e.push(n)}for(const t of e)t.addInterest("updateShader",this),t.addVolumeData(this)},set_voxels__:function(){this.voxelsNode=I()(m().X3DTexture3DNode,this._voxels),this.voxelsNode?this.getAppearance()._texture=this._voxels:this.getAppearance()._texture=this.getBrowser().getDefaultVoxels()},createShader:function(e,t,n){const o=this.getBrowser().getDefaultVolumeStyle();let i=o.getUniformsText(),r=o.getFunctionsText();if(this.segmentIdentifiersNode?(i+="\n",i+="uniform sampler3D segmentIdentifiers;\n",i+="\n",r+="\n",r+=" int segment = int (texture (segmentIdentifiers, texCoord) .r * 255.0);\n"):r+=" int segment = 0;\n",this.renderStyleNodes.length){r+="\n",r+=" switch (segment)\n",r+=" {\n";for(const[e,t]of this.renderStyleNodes.entries())r+=" case "+e+":\n",r+=" {\n",this.getSegmentEnabled(e)?(i+=t.getUniformsText(),r+=t.getFunctionsText(),r+=" break;\n"):r+=" discard;\n",r+=" }\n";r+=" }\n"}n=(n=n.replace(/\/\/ VOLUME_STYLES_UNIFORMS\n/,i)).replace(/\/\/ VOLUME_STYLES_FUNCTIONS\n/,r);const s=new(Ne())(this.getExecutionContext());s._url.push("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("data:x-shader/x-fragment,"+n),a.setPrivate(!0),a.setName("SegmentedVolumeDataFragmentShader"),a.setOptions(e),a.setup();const d=new(ye())(this.getExecutionContext());d._language="GLSL",d._parts.push(s),d._parts.push(a),d.setPrivate(!0),d.setName("SegmentedVolumeDataShader"),this.segmentIdentifiersNode&&d.addUserDefinedField(m().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}});const be=Te;S().set("x_ite/Components/VolumeRendering/SegmentedVolumeData",be);const De=be;function Oe(e){C.call(this,e),this.addType(m().ShadedVolumeStyle)}Oe.prototype=Object.assign(Object.create(C.prototype),{constructor:Oe,[Symbol.for("X_ITE.X3DBaseNode.fieldDefinitions")]:new(h())([new(u())(m().inputOutput,"metadata",new(l().SFNode)),new(u())(m().inputOutput,"enabled",new(l().SFBool)(!0)),new(u())(m().inputOutput,"lighting",new(l().SFBool)),new(u())(m().inputOutput,"shadows",new(l().SFBool)),new(u())(m().initializeOnly,"phaseFunction",new(l().SFString)("Henyey-Greenstein")),new(u())(m().inputOutput,"material",new(l().SFNode)),new(u())(m().inputOutput,"surfaceNormals",new(l().SFNode))]),getTypeName:function(){return"ShadedVolumeStyle"},getComponentName:function(){return"VolumeRendering"},getContainerField:function(){return"renderStyle"},getSpecificationRange:function(){return["3.3","Infinity"]},initialize:function(){C.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__:function(){this.materialNode&&this.materialNode.removeInterest("addNodeEvent",this),this.materialNode=I()(m().X3DMaterialNode,this._material),this.materialNode&&this.materialNode.addInterest("addNodeEvent",this)},set_surfaceNormals__:function(){this.surfaceNormalsNode=I()(m().X3DTexture3DNode,this._surfaceNormals)},addShaderFields:function(e){this._enabled.getValue()&&(this.materialNode&&(e.addUserDefinedField(m().inputOutput,"ambientIntensity_"+this.getId(),this.materialNode._ambientIntensity.copy()),e.addUserDefinedField(m().inputOutput,"diffuseColor_"+this.getId(),this.materialNode._diffuseColor.copy()),e.addUserDefinedField(m().inputOutput,"specularColor_"+this.getId(),this.materialNode._specularColor.copy()),e.addUserDefinedField(m().inputOutput,"emissiveColor_"+this.getId(),this.materialNode._emissiveColor.copy()),e.addUserDefinedField(m().inputOutput,"shininess_"+this.getId(),this.materialNode._shininess.copy()),e.addUserDefinedField(m().inputOutput,"transparency_"+this.getId(),this.materialNode._transparency.copy())),this.surfaceNormalsNode&&e.addUserDefinedField(m().inputOutput,"surfaceNormals_"+this.getId(),new(l().SFNode)(this.surfaceNormalsNode)))},getUniformsText:function(){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:function(){if(!this._enabled.getValue())return"";let e="";return e+="\n",e+=" // ShadedVolumeStyle\n",e+="\n",e+=" textureColor = getShadedStyle_"+this.getId()+" (textureColor, texCoord);\n",e}});const Ee=Oe;S().set("x_ite/Components/VolumeRendering/ShadedVolumeStyle",Ee);const Xe=Ee;function Be(e){C.call(this,e),this.addType(m().SilhouetteEnhancementVolumeStyle)}Be.prototype=Object.assign(Object.create(C.prototype),{constructor:Be,[Symbol.for("X_ITE.X3DBaseNode.fieldDefinitions")]:new(h())([new(u())(m().inputOutput,"metadata",new(l().SFNode)),new(u())(m().inputOutput,"enabled",new(l().SFBool)(!0)),new(u())(m().inputOutput,"silhouetteRetainedOpacity",new(l().SFFloat)(1)),new(u())(m().inputOutput,"silhouetteBoundaryOpacity",new(l().SFFloat)(0)),new(u())(m().inputOutput,"silhouetteSharpness",new(l().SFFloat)(.5)),new(u())(m().inputOutput,"surfaceNormals",new(l().SFNode))]),getTypeName:function(){return"SilhouetteEnhancementVolumeStyle"},getComponentName:function(){return"VolumeRendering"},getContainerField:function(){return"renderStyle"},getSpecificationRange:function(){return["3.3","Infinity"]},initialize:function(){C.prototype.initialize.call(this);this.getBrowser().getContext().getVersion()<2||(this._surfaceNormals.addInterest("set_surfaceNormals__",this),this.set_surfaceNormals__())},set_surfaceNormals__:function(){this.surfaceNormalsNode=I()(m().X3DTexture3DNode,this._surfaceNormals)},addShaderFields:function(e){this._enabled.getValue()&&(e.addUserDefinedField(m().inputOutput,"silhouetteRetainedOpacity_"+this.getId(),this._silhouetteRetainedOpacity.copy()),e.addUserDefinedField(m().inputOutput,"silhouetteBoundaryOpacity_"+this.getId(),this._silhouetteBoundaryOpacity.copy()),e.addUserDefinedField(m().inputOutput,"silhouetteSharpness_"+this.getId(),this._silhouetteSharpness.copy()),this.surfaceNormalsNode&&e.addUserDefinedField(m().inputOutput,"surfaceNormals_"+this.getId(),new(l().SFNode)(this.surfaceNormalsNode)))},getUniformsText:function(){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:function(){if(!this._enabled.getValue())return"";let e="";return e+="\n",e+=" // SilhouetteEnhancementVolumeStyle\n",e+="\n",e+=" textureColor = getSilhouetteEnhancementStyle_"+this.getId()+" (textureColor, texCoord);\n",e}});const Me=Be;S().set("x_ite/Components/VolumeRendering/SilhouetteEnhancementVolumeStyle",Me);const Pe=Me;function Ue(e){C.call(this,e),this.addType(m().ToneMappedVolumeStyle)}Ue.prototype=Object.assign(Object.create(C.prototype),{constructor:Ue,[Symbol.for("X_ITE.X3DBaseNode.fieldDefinitions")]:new(h())([new(u())(m().inputOutput,"metadata",new(l().SFNode)),new(u())(m().inputOutput,"enabled",new(l().SFBool)(!0)),new(u())(m().inputOutput,"coolColor",new(l().SFColorRGBA)(0,0,1,0)),new(u())(m().inputOutput,"warmColor",new(l().SFColorRGBA)(1,1,0,0)),new(u())(m().inputOutput,"surfaceNormals",new(l().SFNode))]),getTypeName:function(){return"ToneMappedVolumeStyle"},getComponentName:function(){return"VolumeRendering"},getContainerField:function(){return"renderStyle"},getSpecificationRange:function(){return["3.3","Infinity"]},initialize:function(){C.prototype.initialize.call(this);this.getBrowser().getContext().getVersion()<2||(this._surfaceNormals.addInterest("set_surfaceNormals__",this),this.set_surfaceNormals__())},set_surfaceNormals__:function(){this.surfaceNormalsNode=I()(m().X3DTexture3DNode,this._surfaceNormals)},addShaderFields:function(e){this._enabled.getValue()&&(e.addUserDefinedField(m().inputOutput,"coolColor_"+this.getId(),this._coolColor.copy()),e.addUserDefinedField(m().inputOutput,"warmColor_"+this.getId(),this._warmColor.copy()),this.surfaceNormalsNode&&e.addUserDefinedField(m().inputOutput,"surfaceNormals_"+this.getId(),new(l().SFNode)(this.surfaceNormalsNode)))},getUniformsText:function(){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:function(){if(!this._enabled.getValue())return"";let e="";return e+="\n",e+=" // ToneMappedVolumeStyle\n",e+="\n",e+=" textureColor = getToneMappedStyle_"+this.getId()+" (textureColor, texCoord);\n",e}});const Re=Ue;S().set("x_ite/Components/VolumeRendering/ToneMappedVolumeStyle",Re);const Le=Re;function Ae(e){_e.call(this,e),this.addType(m().VolumeData),this.renderStyleNode=null}Ae.prototype=Object.assign(Object.create(_e.prototype),{constructor:Ae,[Symbol.for("X_ITE.X3DBaseNode.fieldDefinitions")]:new(h())([new(u())(m().inputOutput,"metadata",new(l().SFNode)),new(u())(m().inputOutput,"dimensions",new(l().SFVec3f)(1,1,1)),new(u())(m().inputOutput,"visible",new(l().SFBool)(!0)),new(u())(m().inputOutput,"bboxDisplay",new(l().SFBool)),new(u())(m().initializeOnly,"bboxCenter",new(l().SFVec3f)(0,0,0)),new(u())(m().initializeOnly,"bboxSize",new(l().SFVec3f)(-1,-1,-1)),new(u())(m().inputOutput,"renderStyle",new(l().SFNode)),new(u())(m().inputOutput,"voxels",new(l().SFNode))]),getTypeName:function(){return"VolumeData"},getComponentName:function(){return"VolumeRendering"},getContainerField:function(){return"children"},getSpecificationRange:function(){return["3.3","Infinity"]},initialize:function(){_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__:function(){this.renderStyleNode&&(this.renderStyleNode.removeInterest("updateShader",this),this.renderStyleNode.removeVolumeData(this)),this.renderStyleNode=I()(m().X3DVolumeRenderStyleNode,this._renderStyle),this.renderStyleNode&&(this.renderStyleNode.addInterest("updateShader",this),this.renderStyleNode.addVolumeData(this))},set_voxels__:function(){this.voxelsNode=I()(m().X3DTexture3DNode,this._voxels),this.voxelsNode?this.getAppearance()._texture=this._voxels:this.getAppearance()._texture=this.getBrowser().getDefaultVoxels()},createShader:function(e,t,n){const o=this.getBrowser().getDefaultVolumeStyle();let i=o.getUniformsText(),r=o.getFunctionsText();this.renderStyleNode&&(i+=this.renderStyleNode.getUniformsText(),r+=this.renderStyleNode.getFunctionsText()),n=(n=n.replace(/\/\/ VOLUME_STYLES_UNIFORMS\n/,i)).replace(/\/\/ VOLUME_STYLES_FUNCTIONS\n/,r);const s=new(Ne())(this.getExecutionContext());s._url.push("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("data:x-shader/x-fragment,"+n),a.setPrivate(!0),a.setName("VolumeDataFragmentShader"),a.setOptions(e),a.setup();const l=new(ye())(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}});const ze=Ae;S().set("x_ite/Components/VolumeRendering/VolumeData",ze);const je=ze;n().addComponent({name:"VolumeRendering",types:{BlendedVolumeStyle:L,BoundaryEnhancementVolumeStyle:j,CartoonVolumeStyle:H,ComposedVolumeStyle:W,EdgeEnhancementVolumeStyle:J,IsoSurfaceVolumeData:Ce,OpacityMapVolumeStyle:b,ProjectionVolumeStyle:Ve,SegmentedVolumeData:De,ShadedVolumeStyle:Xe,SilhouetteEnhancementVolumeStyle:Pe,ToneMappedVolumeStyle:Le,VolumeData:je},abstractTypes:{X3DComposableVolumeRenderStyleNode:C,X3DVolumeDataNode:_e,X3DVolumeRenderStyleNode:N},browserContext:P});const Ge=void 0;S().set("assets/components/VolumeRendering",Ge)})();
1
+ /* X_ITE v8.7.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.7.1")].require("x_ite/Components");var n=e.n(t);const o=window[Symbol.for("X_ITE.X3D-8.7.1")].require("x_ite/Components/Texturing/PixelTexture");var i=e.n(o);const r=window[Symbol.for("X_ITE.X3D-8.7.1")].require("x_ite/Components/Texturing/TextureProperties");var s=e.n(r);const a=window[Symbol.for("X_ITE.X3D-8.7.1")].require("x_ite/Fields");var l=e.n(a);const d=window[Symbol.for("X_ITE.X3D-8.7.1")].require("x_ite/Base/X3DFieldDefinition");var u=e.n(d);const c=window[Symbol.for("X_ITE.X3D-8.7.1")].require("x_ite/Base/FieldDefinitionArray");var h=e.n(c);const f=window[Symbol.for("X_ITE.X3D-8.7.1")].require("x_ite/Components/Core/X3DNode");var p=e.n(f);const g=window[Symbol.for("X_ITE.X3D-8.7.1")].require("x_ite/Base/X3DConstants");var m=e.n(g);const _=window[Symbol.for("X_ITE.X3D-8.7.1")].require("x_ite/Namespace");var S=e.n(_);function y(e){p().call(this,e),this.addType(m().X3DVolumeRenderStyleNode),this.volumeDataNodes=new Set}y.prototype=Object.assign(Object.create(p().prototype),{constructor:y,addShaderFields:function(e){},getUniformsText:function(){return""},getFunctionsText:function(){return""},getVolumeData:function(){return this.volumeDataNodes},addVolumeData:function(e){this.volumeDataNodes.add(e)},removeVolumeData:function(e){this.volumeDataNodes.delete(e)},getNormalText:function(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}});const x=y;S().set("x_ite/Components/VolumeRendering/X3DVolumeRenderStyleNode",x);const N=x;function w(e){N.call(this,e),this.addType(m().X3DComposableVolumeRenderStyleNode)}w.prototype=Object.assign(Object.create(N.prototype),{constructor:w});const v=w;S().set("x_ite/Components/VolumeRendering/X3DComposableVolumeRenderStyleNode",v);const C=v,F=window[Symbol.for("X_ITE.X3D-8.7.1")].require("x_ite/Base/X3DCast");var I=e.n(F);function V(e){C.call(this,e),this.addType(m().OpacityMapVolumeStyle)}V.prototype=Object.assign(Object.create(C.prototype),{constructor:V,[Symbol.for("X_ITE.X3DBaseNode.fieldDefinitions")]:new(h())([new(u())(m().inputOutput,"enabled",new(l().SFBool)(!0)),new(u())(m().inputOutput,"metadata",new(l().SFNode)),new(u())(m().inputOutput,"transferFunction",new(l().SFNode))]),getTypeName:function(){return"OpacityMapVolumeStyle"},getComponentName:function(){return"VolumeRendering"},getContainerField:function(){return"renderStyle"},getSpecificationRange:function(){return["3.3","Infinity"]},initialize:function(){C.prototype.initialize.call(this);this.getBrowser().getContext().getVersion()<2||(this._transferFunction.addInterest("set_transferFunction__",this),this.set_transferFunction__())},set_transferFunction__:function(){this.transferFunctionNode=I()(m().X3DTexture2DNode,this._transferFunction),this.transferFunctionNode||(this.transferFunctionNode=I()(m().X3DTexture3DNode,this._transferFunction)),this.transferFunctionNode||(this.transferFunctionNode=this.getBrowser().getDefaultTransferFunction())},addShaderFields:function(e){this._enabled.getValue()&&e.addUserDefinedField(m().inputOutput,"transferFunction_"+this.getId(),new(l().SFNode)(this.transferFunctionNode))},getUniformsText:function(){if(!this._enabled.getValue())return"";let e="";return e+="\n",e+="// OpacityMapVolumeStyle\n",e+="\n",this.transferFunctionNode.getType().includes(m().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:function(){if(!this._enabled.getValue())return"";let e="";return e+="\n",e+=" // OpacityMapVolumeStyle\n",e+="\n",e+=" textureColor = getOpacityMapStyle_"+this.getId()+" (textureColor);\n",e}});const T=V;S().set("x_ite/Components/VolumeRendering/OpacityMapVolumeStyle",T);const b=T,D=Symbol(),O=Symbol(),E=Symbol(),X=Symbol();function B(){}B.prototype={getDefaultVoxels:function(){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:function(){return this[O]=new b(this.getPrivateScene()),this[O].setPrivate(!0),this[O].setup(),this.getDefaultVolumeStyle=function(){return this[O]},Object.defineProperty(this,"getDefaultVolumeStyle",{enumerable:!1}),this[O]},getDefaultBlendedVolumeStyle:function(){return this[E]=new b(this.getPrivateScene()),this[E].setPrivate(!0),this[E].setup(),this.getDefaultBlendedVolumeStyle=function(){return this[E]},Object.defineProperty(this,"getDefaultBlendedVolumeStyle",{enumerable:!1}),this[E]},getDefaultTransferFunction:function(){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[X]=new(i())(this.getPrivateScene()),this[X]._textureProperties=e,this[X]._image.width=256,this[X]._image.height=1,this[X]._image.comp=2,this[X]._image.array=Array.from({length:256},((e,t)=>t<<8|t)),this[X].setPrivate(!0),this[X].setup(),this.getDefaultTransferFunction=function(){return this[X]},Object.defineProperty(this,"getDefaultTransferFunction",{enumerable:!1}),this[X]}};const M=B;S().set("x_ite/Browser/VolumeRendering/X3DVolumeRenderingContext",M);const U=M;window[Symbol.for("X_ITE.X3D-8.7.1")].require("x_ite/DEBUG");function P(e){C.call(this,e),this.addType(m().BlendedVolumeStyle)}P.prototype=Object.assign(Object.create(C.prototype),{constructor:P,[Symbol.for("X_ITE.X3DBaseNode.fieldDefinitions")]:new(h())([new(u())(m().inputOutput,"metadata",new(l().SFNode)),new(u())(m().inputOutput,"enabled",new(l().SFBool)(!0)),new(u())(m().inputOutput,"weightConstant1",new(l().SFFloat)(.5)),new(u())(m().inputOutput,"weightConstant2",new(l().SFFloat)(.5)),new(u())(m().inputOutput,"weightFunction1",new(l().SFString)("CONSTANT")),new(u())(m().inputOutput,"weightFunction2",new(l().SFString)("CONSTANT")),new(u())(m().inputOutput,"weightTransferFunction1",new(l().SFNode)),new(u())(m().inputOutput,"weightTransferFunction2",new(l().SFNode)),new(u())(m().inputOutput,"renderStyle",new(l().SFNode)),new(u())(m().inputOutput,"voxels",new(l().SFNode))]),getTypeName:function(){return"BlendedVolumeStyle"},getComponentName:function(){return"VolumeRendering"},getContainerField:function(){return"renderStyle"},getSpecificationRange:function(){return["3.3","Infinity"]},initialize:function(){C.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:function(e){C.prototype.addVolumeData.call(this,e),this.renderStyleNode&&this.renderStyleNode.addVolumeData(e)},removeVolumeData:function(e){C.prototype.removeVolumeData.call(this,e),this.renderStyleNode&&this.renderStyleNode.removeVolumeData(e)},set_weightTransferFunction1__:function(){this.weightTransferFunction1Node=I()(m().X3DTexture2DNode,this._weightTransferFunction1)},set_weightTransferFunction2__:function(){this.weightTransferFunction2Node=I()(m().X3DTexture2DNode,this._weightTransferFunction2)},set_renderStyle__:function(){if(this.renderStyleNode){this.renderStyleNode.removeInterest("addNodeEvent",this);for(const e of this.getVolumeData())this.renderStyleNode.removeVolumeData(e)}if(this.renderStyleNode=I()(m().X3DComposableVolumeRenderStyleNode,this._renderStyle),this.renderStyleNode){this.renderStyleNode.addInterest("addNodeEvent",this);for(const e of this.getVolumeData())this.renderStyleNode.addVolumeData(e)}},set_voxels__:function(){this.voxelsNode=I()(m().X3DTexture3DNode,this._voxels)},addShaderFields:function(e){this._enabled.getValue()&&(e.addUserDefinedField(m().inputOutput,"weightConstant1_"+this.getId(),this._weightConstant1.copy()),e.addUserDefinedField(m().inputOutput,"weightConstant2_"+this.getId(),this._weightConstant2.copy()),this.weightTransferFunction1Node&&e.addUserDefinedField(m().inputOutput,"weightTransferFunction1_"+this.getId(),new(l().SFNode)(this.weightTransferFunction1Node)),this.weightTransferFunction2Node&&e.addUserDefinedField(m().inputOutput,"weightTransferFunction2_"+this.getId(),new(l().SFNode)(this.weightTransferFunction2Node)),this.voxelsNode&&e.addUserDefinedField(m().inputOutput,"voxels_"+this.getId(),new(l().SFNode)(this.voxelsNode)),this.getBrowser().getDefaultBlendedVolumeStyle().addShaderFields(e),this.renderStyleNode&&this.renderStyleNode.addShaderFields(e))},getUniformsText:function(){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:function(){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}});const R=P;S().set("x_ite/Components/VolumeRendering/BlendedVolumeStyle",R);const L=R;function A(e){C.call(this,e),this.addType(m().BoundaryEnhancementVolumeStyle)}A.prototype=Object.assign(Object.create(C.prototype),{constructor:A,[Symbol.for("X_ITE.X3DBaseNode.fieldDefinitions")]:new(h())([new(u())(m().inputOutput,"metadata",new(l().SFNode)),new(u())(m().inputOutput,"enabled",new(l().SFBool)(!0)),new(u())(m().inputOutput,"retainedOpacity",new(l().SFFloat)(.2)),new(u())(m().inputOutput,"boundaryOpacity",new(l().SFFloat)(.9)),new(u())(m().inputOutput,"opacityFactor",new(l().SFFloat)(2))]),getTypeName:function(){return"BoundaryEnhancementVolumeStyle"},getComponentName:function(){return"VolumeRendering"},getContainerField:function(){return"renderStyle"},getSpecificationRange:function(){return["3.3","Infinity"]},addShaderFields:function(e){this._enabled.getValue()&&(e.addUserDefinedField(m().inputOutput,"retainedOpacity_"+this.getId(),this._retainedOpacity.copy()),e.addUserDefinedField(m().inputOutput,"boundaryOpacity_"+this.getId(),this._boundaryOpacity.copy()),e.addUserDefinedField(m().inputOutput,"opacityFactor_"+this.getId(),this._opacityFactor.copy()))},getUniformsText:function(){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:function(){if(!this._enabled.getValue())return"";let e="";return e+="\n",e+=" // BoundaryEnhancementVolumeStyle\n",e+="\n",e+=" textureColor = getBoundaryEnhancementStyle_"+this.getId()+" (textureColor, texCoord);\n",e}});const z=A;S().set("x_ite/Components/VolumeRendering/BoundaryEnhancementVolumeStyle",z);const j=z;function G(e){C.call(this,e),this.addType(m().CartoonVolumeStyle)}G.prototype=Object.assign(Object.create(C.prototype),{constructor:G,[Symbol.for("X_ITE.X3DBaseNode.fieldDefinitions")]:new(h())([new(u())(m().inputOutput,"metadata",new(l().SFNode)),new(u())(m().inputOutput,"enabled",new(l().SFBool)(!0)),new(u())(m().inputOutput,"colorSteps",new(l().SFInt32)(4)),new(u())(m().inputOutput,"orthogonalColor",new(l().SFColorRGBA)(1,1,1,1)),new(u())(m().inputOutput,"parallelColor",new(l().SFColorRGBA)(0,0,0,1)),new(u())(m().inputOutput,"surfaceNormals",new(l().SFNode))]),getTypeName:function(){return"CartoonVolumeStyle"},getComponentName:function(){return"VolumeRendering"},getContainerField:function(){return"renderStyle"},getSpecificationRange:function(){return["3.3","Infinity"]},initialize:function(){C.prototype.initialize.call(this);this.getBrowser().getContext().getVersion()<2||(this._surfaceNormals.addInterest("set_surfaceNormals__",this),this.set_surfaceNormals__())},set_surfaceNormals__:function(){this.surfaceNormalsNode=I()(m().X3DTexture3DNode,this._surfaceNormals)},addShaderFields:function(e){this._enabled.getValue()&&(e.addUserDefinedField(m().inputOutput,"colorSteps_"+this.getId(),this._colorSteps.copy()),e.addUserDefinedField(m().inputOutput,"orthogonalColor_"+this.getId(),this._orthogonalColor.copy()),e.addUserDefinedField(m().inputOutput,"parallelColor_"+this.getId(),this._parallelColor.copy()),this.surfaceNormalsNode&&e.addUserDefinedField(m().inputOutput,"surfaceNormals_"+this.getId(),new(l().SFNode)(this.surfaceNormalsNode)))},getUniformsText:function(){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:function(){if(!this._enabled.getValue())return"";let e="";return e+="\n",e+=" // CartoonVolumeStyle\n",e+="\n",e+=" textureColor = getCartoonStyle_"+this.getId()+" (textureColor, texCoord);\n",e}});const q=G;S().set("x_ite/Components/VolumeRendering/CartoonVolumeStyle",q);const H=q;function k(e){C.call(this,e),this.addType(m().ComposedVolumeStyle),this.renderStyleNodes=[]}k.prototype=Object.assign(Object.create(C.prototype),{constructor:k,[Symbol.for("X_ITE.X3DBaseNode.fieldDefinitions")]:new(h())([new(u())(m().inputOutput,"metadata",new(l().SFNode)),new(u())(m().inputOutput,"enabled",new(l().SFBool)(!0)),new(u())(m().inputOutput,"renderStyle",new(l().MFNode))]),getTypeName:function(){return"ComposedVolumeStyle"},getComponentName:function(){return"VolumeRendering"},getContainerField:function(){return"renderStyle"},getSpecificationRange:function(){return["3.3","Infinity"]},initialize:function(){C.prototype.initialize.call(this);this.getBrowser().getContext().getVersion()<2||(this._renderStyle.addInterest("set_renderStyle__",this),this.set_renderStyle__())},addVolumeData:function(e){C.prototype.addVolumeData.call(this,e);for(const t of this.renderStyleNodes)t.addVolumeData(e)},removeVolumeData:function(e){C.prototype.removeVolumeData.call(this,e);for(const t of this.renderStyleNodes)t.removeVolumeData(e)},set_renderStyle__:function(){const e=this.renderStyleNodes;for(const t of e){t.removeInterest("addNodeEvent",this);for(const e of this.getVolumeData())t.removeVolumeData(e)}e.length=0;for(const t of this._renderStyle){const n=I()(m().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:function(e){if(this._enabled.getValue())for(const t of this.renderStyleNodes)t.addShaderFields(e)},getUniformsText:function(){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:function(){if(!this._enabled.getValue())return"";let e="";return e+="\n",e+=" // ComposedVolumeStyle\n",e+="\n",e+=" textureColor = getComposedStyle_"+this.getId()+" (textureColor, texCoord);\n",e}});const Y=k;S().set("x_ite/Components/VolumeRendering/ComposedVolumeStyle",Y);const W=Y;function Q(e){C.call(this,e),this.addType(m().EdgeEnhancementVolumeStyle)}Q.prototype=Object.assign(Object.create(C.prototype),{constructor:Q,[Symbol.for("X_ITE.X3DBaseNode.fieldDefinitions")]:new(h())([new(u())(m().inputOutput,"metadata",new(l().SFNode)),new(u())(m().inputOutput,"enabled",new(l().SFBool)(!0)),new(u())(m().inputOutput,"edgeColor",new(l().SFColorRGBA)(0,0,0,1)),new(u())(m().inputOutput,"gradientThreshold",new(l().SFFloat)(.4)),new(u())(m().inputOutput,"surfaceNormals",new(l().SFNode))]),getTypeName:function(){return"EdgeEnhancementVolumeStyle"},getComponentName:function(){return"VolumeRendering"},getContainerField:function(){return"renderStyle"},getSpecificationRange:function(){return["3.3","Infinity"]},initialize:function(){C.prototype.initialize.call(this);this.getBrowser().getContext().getVersion()<2||(this._surfaceNormals.addInterest("set_surfaceNormals__",this),this.set_surfaceNormals__())},set_surfaceNormals__:function(){this.surfaceNormalsNode=I()(m().X3DTexture3DNode,this._surfaceNormals)},addShaderFields:function(e){this._enabled.getValue()&&(e.addUserDefinedField(m().inputOutput,"edgeColor_"+this.getId(),this._edgeColor.copy()),e.addUserDefinedField(m().inputOutput,"gradientThreshold_"+this.getId(),this._gradientThreshold.copy()),this.surfaceNormalsNode&&e.addUserDefinedField(m().inputOutput,"surfaceNormals_"+this.getId(),new(l().SFNode)(this.surfaceNormalsNode)))},getUniformsText:function(){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:function(){if(!this._enabled.getValue())return"";let e="";return e+="\n",e+=" // EdgeEnhancementVolumeStyle\n",e+="\n",e+=" textureColor = getEdgeEnhacementStyle_"+this.getId()+" (textureColor, texCoord);\n",e}});const Z=Q;S().set("x_ite/Components/VolumeRendering/EdgeEnhancementVolumeStyle",Z);const J=Z,K=window[Symbol.for("X_ITE.X3D-8.7.1")].require("x_ite/Components/Core/X3DChildNode");var $=e.n(K);const ee=window[Symbol.for("X_ITE.X3D-8.7.1")].require("x_ite/Components/Grouping/X3DBoundedObject");var te=e.n(ee);const ne=window[Symbol.for("X_ITE.X3D-8.7.1")].require("x_ite/Browser/Core/TextureQuality");var oe=e.n(ne);const ie=window[Symbol.for("X_ITE.X3D-8.7.1")].require("x_ite/Components/Shape/UnlitMaterial");var re=e.n(ie);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";S().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';S().set("x_ite/Browser/VolumeRendering/VolumeStyle.fs",le);const de=le;function ue(e,t){re().call(this,e),this.volumeDataNode=t,this.volumeShaderNodes=new Map}ue.prototype=Object.assign(Object.create(re().prototype),{constructor:ue,getTypeName:function(){return"VolumeMaterial"},getComponentName:function(){return"Shape"},getContainerField:function(){return"material"},getVolumeShaders:function(){return this.volumeShaderNodes},getShader:function(e,t){const{fogNode:n,objectsCount:o}=t;let i="";return i+=n?n.getFogType():0,i+=".",i+=o[0],i+=".",i+=o[1],this.volumeShaderNodes.get(i)||this.createShader(i,e,t)},createShader:function(e,t,n){const o=this.getBrowser(),i=[],{fogNode:r,objectsCount:s}=n;r&&i.push("X3D_FOG"),s[0]&&(i.push("X3D_CLIP_PLANES"),i.push("X3D_NUM_CLIP_PLANES "+Math.min(s[0],o.getMaxClipPlanes()))),s[1]&&(i.push("X3D_LIGHTING"),i.push("X3D_NUM_LIGHTS "+Math.min(s[1],o.getMaxLights())));const a=this.volumeDataNode.createShader(i,ae,de);return this.volumeShaderNodes.set(e,a),a},setShaderUniforms:function(e,t,n,o,i){this.volumeDataNode.setShaderUniforms(e,t)}});const ce=ue;S().set("x_ite/Browser/VolumeRendering/VolumeMaterial",ce);const he=ce,fe=window[Symbol.for("X_ITE.X3D-8.7.1")].require("standard/Math/Numbers/Vector3");var pe=e.n(fe);function ge(e){$().call(this,e),te().call(this,e),this.addType(m().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 he(t.getPrivateScene(),this),this.textureNormalMatrixArray=new Float32Array(9),this.setCameraObject(!0)}ge.prototype=Object.assign(Object.create($().prototype),te().prototype,{constructor:ge,initialize:function(){$().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:function(e,t){return this._bboxSize.getValue().equals(this.getDefaultBBoxSize())?e.set(this._dimensions.getValue(),pe().Zero):e.set(this._bboxSize.getValue(),this._bboxCenter.getValue())},getAppearance:function(){return this.appearanceNode},updateShader:function(){this.volumeMaterialNode.getVolumeShaders().clear()},addShaderUniformNames:function(e){e.push("x3d_TextureNormalMatrix")},getNumPlanes:function(){switch(this.getBrowser().getBrowserOptions().getTextureQuality()){case oe().LOW:return 200;case oe().MEDIUM:return 400;case oe().HIGH:return 600}return 200},set_dimensions__:function(){const e=this.getNumPlanes(),t=this._dimensions.getValue().magnitude(),n=t/2,o=[];this.coordinateNode._point.length=0;for(let i=0;i<e;++i){const r=i/(e-1)-.5;o.push(n,n,t*r,-n,n,t*r,-n,-n,t*r,n,-n,t*r)}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__:function(){this.textureNormalMatrixArray.set(this.textureTransformNode.getMatrix().submatrix.inverse())},traverse:function(e,t){this.proximitySensorNode.traverse(e,t),this.transformNode.traverse(e,t)},setShaderUniforms(e,t){e.uniformMatrix3fv(t.x3d_TextureNormalMatrix,!0,this.textureNormalMatrixArray)},dispose:function(){te().prototype.dispose.call(this),$().prototype.dispose.call(this)}});const me=ge;S().set("x_ite/Components/VolumeRendering/X3DVolumeDataNode",me);const _e=me,Se=window[Symbol.for("X_ITE.X3D-8.7.1")].require("x_ite/Components/Shaders/ComposedShader");var ye=e.n(Se);const xe=window[Symbol.for("X_ITE.X3D-8.7.1")].require("x_ite/Components/Shaders/ShaderPart");var Ne=e.n(xe);function we(e){_e.call(this,e),this.addType(m().IsoSurfaceVolumeData),this.renderStyleNodes=[]}we.prototype=Object.assign(Object.create(_e.prototype),{constructor:we,[Symbol.for("X_ITE.X3DBaseNode.fieldDefinitions")]:new(h())([new(u())(m().inputOutput,"metadata",new(l().SFNode)),new(u())(m().inputOutput,"dimensions",new(l().SFVec3f)(1,1,1)),new(u())(m().inputOutput,"contourStepSize",new(l().SFFloat)(0)),new(u())(m().inputOutput,"surfaceValues",new(l().MFFloat)),new(u())(m().inputOutput,"surfaceTolerance",new(l().SFFloat)(0)),new(u())(m().inputOutput,"visible",new(l().SFBool)(!0)),new(u())(m().inputOutput,"bboxDisplay",new(l().SFBool)),new(u())(m().initializeOnly,"bboxCenter",new(l().SFVec3f)(0,0,0)),new(u())(m().initializeOnly,"bboxSize",new(l().SFVec3f)(-1,-1,-1)),new(u())(m().inputOutput,"renderStyle",new(l().MFNode)),new(u())(m().inputOutput,"gradients",new(l().SFNode)),new(u())(m().inputOutput,"voxels",new(l().SFNode))]),getTypeName:function(){return"IsoSurfaceVolumeData"},getComponentName:function(){return"VolumeRendering"},getContainerField:function(){return"children"},getSpecificationRange:function(){return["3.3","Infinity"]},initialize:function(){_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__:function(){this.gradientsNode=I()(m().X3DTexture3DNode,this._gradients)},set_renderStyle__:function(){const e=this.renderStyleNodes;for(const t of e)t.removeInterest("updateShader",this),t.removeVolumeData(this);e.length=0;for(const t of this._renderStyle){const n=I()(m().X3DComposableVolumeRenderStyleNode,t);n&&e.push(n)}for(const t of e)t.addInterest("updateShader",this),t.addVolumeData(this)},set_voxels__:function(){this.voxelsNode=I()(m().X3DTexture3DNode,this._voxels),this.voxelsNode?this.getAppearance()._texture=this._voxels:this.getAppearance()._texture=this.getBrowser().getDefaultVoxels()},createShader:function(e,t,n){const o=this.getBrowser().getDefaultVolumeStyle();let i=o.getUniformsText(),r=o.getFunctionsText();i+="\n",i+="uniform float surfaceValues ["+this._surfaceValues.length+"];\n",i+="uniform float surfaceTolerance;\n";for(const e of this.renderStyleNodes)i+=e.getUniformsText();if(r+="\n",r+=" // IsoSurfaceVolumeData\n",r+="\n",this.gradientsNode?(i+="\n",i+="uniform sampler3D gradients;\n",r+=" if (length (texture (gradients, texCoord) .xyz * 2.0 - 1.0) < surfaceTolerance)\n",r+=" discard;\n"):(i+="\n",i+="vec4\n",i+="getNormal (in vec3 texCoord)\n",i+="{\n",i+=" vec4 offset = vec4 (1.0 / vec3 (textureSize (x3d_Texture3D [0], 0)), 0.0);\n",i+=" float i0 = texture (x3d_Texture3D [0], texCoord + offset .xww) .r;\n",i+=" float i1 = texture (x3d_Texture3D [0], texCoord - offset .xww) .r;\n",i+=" float i2 = texture (x3d_Texture3D [0], texCoord + offset .wyw) .r;\n",i+=" float i3 = texture (x3d_Texture3D [0], texCoord - offset .wyw) .r;\n",i+=" float i4 = texture (x3d_Texture3D [0], texCoord + offset .wwz) .r;\n",i+=" float i5 = texture (x3d_Texture3D [0], texCoord - offset .wwz) .r;\n",i+=" vec3 n = vec3 (i1 - i0, i3 - i2, i5 - i4);\n",i+="\n",i+=" return vec4 (normalize (x3d_TextureNormalMatrix * n), length (n));\n",i+="}\n",r+=" if (getNormal (texCoord) .w < surfaceTolerance)\n",r+=" discard;\n"),r+="\n",r+=" float intensity = textureColor .r;\n",r+="\n",1===this._surfaceValues.length){const e=Math.abs(this._contourStepSize.getValue());if(0===e)r+=" if (intensity > surfaceValues [0])\n",r+=" {\n",r+=" textureColor = vec4 (vec3 (surfaceValues [0]), 1.0);\n",this.renderStyleNodes.length&&(r+=this.renderStyleNodes[0].getFunctionsText()),r+=" }\n",r+=" else\n",r+=" {\n",r+=" discard;\n",r+=" }\n",r+="\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);r+=" if (false)\n",r+=" { }\n";for(let e=this._surfaceValues.length-1;e>=0;--e)r+=" else if (intensity > "+t[e]+")\n",r+=" {\n",r+=" textureColor = vec4 (vec3 ("+t[e]+"), 1.0);\n",this.renderStyleNodes.length&&(r+=this.renderStyleNodes[0].getFunctionsText()),r+=" }\n";r+=" else\n",r+=" {\n",r+=" discard;\n",r+=" }\n",r+="\n"}}else{r+=" if (false)\n",r+=" { }\n";for(let e=this._surfaceValues.length-1;e>=0;--e){if(r+=" else if (intensity > surfaceValues ["+e+"])\n",r+=" {\n",r+=" textureColor = vec4 (vec3 (surfaceValues ["+e+"]), 1.0);\n",this.renderStyleNodes.length){const t=Math.min(e,this.renderStyleNodes.length-1);r+=this.renderStyleNodes[t].getFunctionsText()}r+=" }\n"}r+=" else\n",r+=" {\n",r+=" discard;\n",r+=" }\n",r+="\n"}n=(n=n.replace(/\/\/ VOLUME_STYLES_UNIFORMS\n/,i)).replace(/\/\/ VOLUME_STYLES_FUNCTIONS\n/,r);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(ye())(this.getExecutionContext());d._language="GLSL",d._parts.push(s),d._parts.push(a),d.setPrivate(!0),d.setName("VolumeDataShader"),d.addUserDefinedField(m().inputOutput,"surfaceValues",this._surfaceValues.copy()),d.addUserDefinedField(m().inputOutput,"surfaceTolerance",this._surfaceTolerance.copy()),this.gradientsNode&&d.addUserDefinedField(m().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}});const ve=we;S().set("x_ite/Components/VolumeRendering/IsoSurfaceVolumeData",ve);const Ce=ve;function Fe(e){N.call(this,e),this.addType(m().ProjectionVolumeStyle)}Fe.prototype=Object.assign(Object.create(N.prototype),{constructor:Fe,[Symbol.for("X_ITE.X3DBaseNode.fieldDefinitions")]:new(h())([new(u())(m().inputOutput,"metadata",new(l().SFNode)),new(u())(m().inputOutput,"enabled",new(l().SFBool)(!0)),new(u())(m().inputOutput,"type",new(l().SFString)("MAX")),new(u())(m().inputOutput,"intensityThreshold",new(l().SFFloat)(0))]),getTypeName:function(){return"ProjectionVolumeStyle"},getComponentName:function(){return"VolumeRendering"},getContainerField:function(){return"renderStyle"},getSpecificationRange:function(){return["3.3","Infinity"]},addShaderFields:function(e){this._enabled.getValue()&&e.addUserDefinedField(m().inputOutput,"intensityThreshold_"+this.getId(),this._intensityThreshold.copy())},getUniformsText:function(){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:function(){if(!this._enabled.getValue())return"";let e="";return e+="\n",e+=" // ProjectionVolumeStyle\n",e+="\n",e+=" textureColor = getProjectionStyle_"+this.getId()+" (textureColor, texCoord);\n",e}});const Ie=Fe;S().set("x_ite/Components/VolumeRendering/ProjectionVolumeStyle",Ie);const Ve=Ie;function Te(e){_e.call(this,e),this.addType(m().SegmentedVolumeData),this.segmentIdentifiersNode=null,this.renderStyleNodes=[]}Te.prototype=Object.assign(Object.create(_e.prototype),{constructor:Te,[Symbol.for("X_ITE.X3DBaseNode.fieldDefinitions")]:new(h())([new(u())(m().inputOutput,"metadata",new(l().SFNode)),new(u())(m().inputOutput,"dimensions",new(l().SFVec3f)(1,1,1)),new(u())(m().inputOutput,"segmentEnabled",new(l().MFBool)),new(u())(m().inputOutput,"visible",new(l().SFBool)(!0)),new(u())(m().inputOutput,"bboxDisplay",new(l().SFBool)),new(u())(m().initializeOnly,"bboxCenter",new(l().SFVec3f)(0,0,0)),new(u())(m().initializeOnly,"bboxSize",new(l().SFVec3f)(-1,-1,-1)),new(u())(m().inputOutput,"segmentIdentifiers",new(l().SFNode)),new(u())(m().inputOutput,"renderStyle",new(l().MFNode)),new(u())(m().inputOutput,"voxels",new(l().SFNode))]),getTypeName:function(){return"SegmentedVolumeData"},getComponentName:function(){return"VolumeRendering"},getContainerField:function(){return"children"},getSpecificationRange:function(){return["3.3","Infinity"]},initialize:function(){_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:function(e){return!(e<this._segmentEnabled.length)||this._segmentEnabled[e]},set_segmentIdentifiers__:function(){this.segmentIdentifiersNode=I()(m().X3DTexture3DNode,this._segmentIdentifiers)},set_renderStyle__:function(){const e=this.renderStyleNodes;for(const t of e)t.removeInterest("updateShader",this),t.removeVolumeData(this);e.length=0;for(const t of this._renderStyle){const n=I()(m().X3DComposableVolumeRenderStyleNode,t);n&&e.push(n)}for(const t of e)t.addInterest("updateShader",this),t.addVolumeData(this)},set_voxels__:function(){this.voxelsNode=I()(m().X3DTexture3DNode,this._voxels),this.voxelsNode?this.getAppearance()._texture=this._voxels:this.getAppearance()._texture=this.getBrowser().getDefaultVoxels()},createShader:function(e,t,n){const o=this.getBrowser().getDefaultVolumeStyle();let i=o.getUniformsText(),r=o.getFunctionsText();if(this.segmentIdentifiersNode?(i+="\n",i+="uniform sampler3D segmentIdentifiers;\n",i+="\n",r+="\n",r+=" int segment = int (texture (segmentIdentifiers, texCoord) .r * 255.0);\n"):r+=" int segment = 0;\n",this.renderStyleNodes.length){r+="\n",r+=" switch (segment)\n",r+=" {\n";for(const[e,t]of this.renderStyleNodes.entries())r+=" case "+e+":\n",r+=" {\n",this.getSegmentEnabled(e)?(i+=t.getUniformsText(),r+=t.getFunctionsText(),r+=" break;\n"):r+=" discard;\n",r+=" }\n";r+=" }\n"}n=(n=n.replace(/\/\/ VOLUME_STYLES_UNIFORMS\n/,i)).replace(/\/\/ VOLUME_STYLES_FUNCTIONS\n/,r);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(ye())(this.getExecutionContext());d._language="GLSL",d._parts.push(s),d._parts.push(a),d.setPrivate(!0),d.setName("SegmentedVolumeDataShader"),this.segmentIdentifiersNode&&d.addUserDefinedField(m().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}});const be=Te;S().set("x_ite/Components/VolumeRendering/SegmentedVolumeData",be);const De=be;function Oe(e){C.call(this,e),this.addType(m().ShadedVolumeStyle)}Oe.prototype=Object.assign(Object.create(C.prototype),{constructor:Oe,[Symbol.for("X_ITE.X3DBaseNode.fieldDefinitions")]:new(h())([new(u())(m().inputOutput,"metadata",new(l().SFNode)),new(u())(m().inputOutput,"enabled",new(l().SFBool)(!0)),new(u())(m().inputOutput,"lighting",new(l().SFBool)),new(u())(m().inputOutput,"shadows",new(l().SFBool)),new(u())(m().initializeOnly,"phaseFunction",new(l().SFString)("Henyey-Greenstein")),new(u())(m().inputOutput,"material",new(l().SFNode)),new(u())(m().inputOutput,"surfaceNormals",new(l().SFNode))]),getTypeName:function(){return"ShadedVolumeStyle"},getComponentName:function(){return"VolumeRendering"},getContainerField:function(){return"renderStyle"},getSpecificationRange:function(){return["3.3","Infinity"]},initialize:function(){C.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__:function(){this.materialNode&&this.materialNode.removeInterest("addNodeEvent",this),this.materialNode=I()(m().X3DMaterialNode,this._material),this.materialNode&&this.materialNode.addInterest("addNodeEvent",this)},set_surfaceNormals__:function(){this.surfaceNormalsNode=I()(m().X3DTexture3DNode,this._surfaceNormals)},addShaderFields:function(e){this._enabled.getValue()&&(this.materialNode&&(e.addUserDefinedField(m().inputOutput,"ambientIntensity_"+this.getId(),this.materialNode._ambientIntensity.copy()),e.addUserDefinedField(m().inputOutput,"diffuseColor_"+this.getId(),this.materialNode._diffuseColor.copy()),e.addUserDefinedField(m().inputOutput,"specularColor_"+this.getId(),this.materialNode._specularColor.copy()),e.addUserDefinedField(m().inputOutput,"emissiveColor_"+this.getId(),this.materialNode._emissiveColor.copy()),e.addUserDefinedField(m().inputOutput,"shininess_"+this.getId(),this.materialNode._shininess.copy()),e.addUserDefinedField(m().inputOutput,"transparency_"+this.getId(),this.materialNode._transparency.copy())),this.surfaceNormalsNode&&e.addUserDefinedField(m().inputOutput,"surfaceNormals_"+this.getId(),new(l().SFNode)(this.surfaceNormalsNode)))},getUniformsText:function(){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:function(){if(!this._enabled.getValue())return"";let e="";return e+="\n",e+=" // ShadedVolumeStyle\n",e+="\n",e+=" textureColor = getShadedStyle_"+this.getId()+" (textureColor, texCoord);\n",e}});const Ee=Oe;S().set("x_ite/Components/VolumeRendering/ShadedVolumeStyle",Ee);const Xe=Ee;function Be(e){C.call(this,e),this.addType(m().SilhouetteEnhancementVolumeStyle)}Be.prototype=Object.assign(Object.create(C.prototype),{constructor:Be,[Symbol.for("X_ITE.X3DBaseNode.fieldDefinitions")]:new(h())([new(u())(m().inputOutput,"metadata",new(l().SFNode)),new(u())(m().inputOutput,"enabled",new(l().SFBool)(!0)),new(u())(m().inputOutput,"silhouetteRetainedOpacity",new(l().SFFloat)(1)),new(u())(m().inputOutput,"silhouetteBoundaryOpacity",new(l().SFFloat)(0)),new(u())(m().inputOutput,"silhouetteSharpness",new(l().SFFloat)(.5)),new(u())(m().inputOutput,"surfaceNormals",new(l().SFNode))]),getTypeName:function(){return"SilhouetteEnhancementVolumeStyle"},getComponentName:function(){return"VolumeRendering"},getContainerField:function(){return"renderStyle"},getSpecificationRange:function(){return["3.3","Infinity"]},initialize:function(){C.prototype.initialize.call(this);this.getBrowser().getContext().getVersion()<2||(this._surfaceNormals.addInterest("set_surfaceNormals__",this),this.set_surfaceNormals__())},set_surfaceNormals__:function(){this.surfaceNormalsNode=I()(m().X3DTexture3DNode,this._surfaceNormals)},addShaderFields:function(e){this._enabled.getValue()&&(e.addUserDefinedField(m().inputOutput,"silhouetteRetainedOpacity_"+this.getId(),this._silhouetteRetainedOpacity.copy()),e.addUserDefinedField(m().inputOutput,"silhouetteBoundaryOpacity_"+this.getId(),this._silhouetteBoundaryOpacity.copy()),e.addUserDefinedField(m().inputOutput,"silhouetteSharpness_"+this.getId(),this._silhouetteSharpness.copy()),this.surfaceNormalsNode&&e.addUserDefinedField(m().inputOutput,"surfaceNormals_"+this.getId(),new(l().SFNode)(this.surfaceNormalsNode)))},getUniformsText:function(){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:function(){if(!this._enabled.getValue())return"";let e="";return e+="\n",e+=" // SilhouetteEnhancementVolumeStyle\n",e+="\n",e+=" textureColor = getSilhouetteEnhancementStyle_"+this.getId()+" (textureColor, texCoord);\n",e}});const Me=Be;S().set("x_ite/Components/VolumeRendering/SilhouetteEnhancementVolumeStyle",Me);const Ue=Me;function Pe(e){C.call(this,e),this.addType(m().ToneMappedVolumeStyle)}Pe.prototype=Object.assign(Object.create(C.prototype),{constructor:Pe,[Symbol.for("X_ITE.X3DBaseNode.fieldDefinitions")]:new(h())([new(u())(m().inputOutput,"metadata",new(l().SFNode)),new(u())(m().inputOutput,"enabled",new(l().SFBool)(!0)),new(u())(m().inputOutput,"coolColor",new(l().SFColorRGBA)(0,0,1,0)),new(u())(m().inputOutput,"warmColor",new(l().SFColorRGBA)(1,1,0,0)),new(u())(m().inputOutput,"surfaceNormals",new(l().SFNode))]),getTypeName:function(){return"ToneMappedVolumeStyle"},getComponentName:function(){return"VolumeRendering"},getContainerField:function(){return"renderStyle"},getSpecificationRange:function(){return["3.3","Infinity"]},initialize:function(){C.prototype.initialize.call(this);this.getBrowser().getContext().getVersion()<2||(this._surfaceNormals.addInterest("set_surfaceNormals__",this),this.set_surfaceNormals__())},set_surfaceNormals__:function(){this.surfaceNormalsNode=I()(m().X3DTexture3DNode,this._surfaceNormals)},addShaderFields:function(e){this._enabled.getValue()&&(e.addUserDefinedField(m().inputOutput,"coolColor_"+this.getId(),this._coolColor.copy()),e.addUserDefinedField(m().inputOutput,"warmColor_"+this.getId(),this._warmColor.copy()),this.surfaceNormalsNode&&e.addUserDefinedField(m().inputOutput,"surfaceNormals_"+this.getId(),new(l().SFNode)(this.surfaceNormalsNode)))},getUniformsText:function(){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:function(){if(!this._enabled.getValue())return"";let e="";return e+="\n",e+=" // ToneMappedVolumeStyle\n",e+="\n",e+=" textureColor = getToneMappedStyle_"+this.getId()+" (textureColor, texCoord);\n",e}});const Re=Pe;S().set("x_ite/Components/VolumeRendering/ToneMappedVolumeStyle",Re);const Le=Re;function Ae(e){_e.call(this,e),this.addType(m().VolumeData),this.renderStyleNode=null}Ae.prototype=Object.assign(Object.create(_e.prototype),{constructor:Ae,[Symbol.for("X_ITE.X3DBaseNode.fieldDefinitions")]:new(h())([new(u())(m().inputOutput,"metadata",new(l().SFNode)),new(u())(m().inputOutput,"dimensions",new(l().SFVec3f)(1,1,1)),new(u())(m().inputOutput,"visible",new(l().SFBool)(!0)),new(u())(m().inputOutput,"bboxDisplay",new(l().SFBool)),new(u())(m().initializeOnly,"bboxCenter",new(l().SFVec3f)(0,0,0)),new(u())(m().initializeOnly,"bboxSize",new(l().SFVec3f)(-1,-1,-1)),new(u())(m().inputOutput,"renderStyle",new(l().SFNode)),new(u())(m().inputOutput,"voxels",new(l().SFNode))]),getTypeName:function(){return"VolumeData"},getComponentName:function(){return"VolumeRendering"},getContainerField:function(){return"children"},getSpecificationRange:function(){return["3.3","Infinity"]},initialize:function(){_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__:function(){this.renderStyleNode&&(this.renderStyleNode.removeInterest("updateShader",this),this.renderStyleNode.removeVolumeData(this)),this.renderStyleNode=I()(m().X3DVolumeRenderStyleNode,this._renderStyle),this.renderStyleNode&&(this.renderStyleNode.addInterest("updateShader",this),this.renderStyleNode.addVolumeData(this))},set_voxels__:function(){this.voxelsNode=I()(m().X3DTexture3DNode,this._voxels),this.voxelsNode?this.getAppearance()._texture=this._voxels:this.getAppearance()._texture=this.getBrowser().getDefaultVoxels()},createShader:function(e,t,n){const o=this.getBrowser().getDefaultVolumeStyle();let i=o.getUniformsText(),r=o.getFunctionsText();this.renderStyleNode&&(i+=this.renderStyleNode.getUniformsText(),r+=this.renderStyleNode.getFunctionsText()),n=(n=n.replace(/\/\/ VOLUME_STYLES_UNIFORMS\n/,i)).replace(/\/\/ VOLUME_STYLES_FUNCTIONS\n/,r);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(ye())(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}});const ze=Ae;S().set("x_ite/Components/VolumeRendering/VolumeData",ze);const je=ze;n().addComponent({name:"VolumeRendering",types:{BlendedVolumeStyle:L,BoundaryEnhancementVolumeStyle:j,CartoonVolumeStyle:H,ComposedVolumeStyle:W,EdgeEnhancementVolumeStyle:J,IsoSurfaceVolumeData:Ce,OpacityMapVolumeStyle:b,ProjectionVolumeStyle:Ve,SegmentedVolumeData:De,ShadedVolumeStyle:Xe,SilhouetteEnhancementVolumeStyle:Ue,ToneMappedVolumeStyle:Le,VolumeData:je},abstractTypes:{X3DComposableVolumeRenderStyleNode:C,X3DVolumeDataNode:_e,X3DVolumeRenderStyleNode:N},browserContext:U});const Ge=void 0;S().set("assets/components/VolumeRendering",Ge)})();
@@ -1,4 +1,4 @@
1
- /* X_ITE v8.6.24 */(() => { // webpackBootstrap
1
+ /* X_ITE v8.7.1 */(() => { // 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.6.24")] .require ("x_ite/Components");
42
+ const Components_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.7.1")] .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.6.24")] .require ("x_ite/Fields");
45
+ const Fields_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.7.1")] .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.6.24")] .require ("x_ite/Base/X3DFieldDefinition");
48
+ const X3DFieldDefinition_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.7.1")] .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.6.24")] .require ("x_ite/Base/FieldDefinitionArray");
51
+ const FieldDefinitionArray_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.7.1")] .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.6.24")] .require ("x_ite/Components/Shape/X3DAppearanceChildNode");
54
+ const X3DAppearanceChildNode_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.7.1")] .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.6.24")] .require ("x_ite/Rendering/TraverseType");
57
+ const TraverseType_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.7.1")] .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.6.24")] .require ("x_ite/Base/X3DConstants");
59
+ const X3DConstants_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.7.1")] .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.6.24")] .require ("x_ite/Namespace");
62
+ const Namespace_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.7.1")] .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
  /*******************************************************************************