x_ite 8.12.4 → 9.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. package/README.md +4 -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 +14 -14
  5. package/dist/assets/components/CADGeometry.min.js +1 -1
  6. package/dist/assets/components/CubeMapTexturing.js +359 -117
  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 +28 -26
  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 +23 -23
  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 +33 -31
  21. package/dist/assets/components/Layout.min.js +1 -1
  22. package/dist/assets/components/NURBS.js +24 -24
  23. package/dist/assets/components/NURBS.min.js +1 -1
  24. package/dist/assets/components/ParticleSystems.js +35 -49
  25. package/dist/assets/components/ParticleSystems.min.js +1 -1
  26. package/dist/assets/components/Picking.js +18 -18
  27. package/dist/assets/components/Picking.min.js +1 -1
  28. package/dist/assets/components/RigidBodyPhysics.js +17 -17
  29. package/dist/assets/components/RigidBodyPhysics.min.js +1 -1
  30. package/dist/assets/components/Scripting.js +39 -39
  31. package/dist/assets/components/Scripting.min.js +1 -1
  32. package/dist/assets/components/Text.js +27 -27
  33. package/dist/assets/components/Text.min.js +1 -1
  34. package/dist/assets/components/{TextureProjector.js → TextureProjection.js} +243 -193
  35. package/dist/assets/components/TextureProjection.min.js +1 -0
  36. package/dist/assets/components/Texturing3D.js +175 -136
  37. package/dist/assets/components/Texturing3D.min.js +1 -1
  38. package/dist/assets/components/VolumeRendering.js +46 -47
  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/assets/lib/README.md +16 -0
  43. package/dist/assets/lib/draco_decoder_gltf.js +1 -29
  44. package/dist/assets/lib/libktx.js +1 -0
  45. package/dist/assets/lib/libktx.wasm +0 -0
  46. package/dist/assets/lib/lut_ggx.png +0 -0
  47. package/dist/x_ite.css +1 -1
  48. package/dist/x_ite.js +3060 -2485
  49. package/dist/x_ite.min.js +1 -1
  50. package/dist/x_ite.min.mjs +1 -1
  51. package/dist/x_ite.mjs +3060 -2484
  52. package/dist/x_ite.zip +0 -0
  53. package/package.json +3 -3
  54. package/dist/assets/components/TextureProjector.min.js +0 -1
@@ -1,7 +1,7 @@
1
- /* X_ITE v8.12.4 */(() => { // webpackBootstrap
1
+ /* X_ITE v9.0.0 */(() => { // webpackBootstrap
2
2
  /******/ var __webpack_modules__ = ({
3
3
 
4
- /***/ 717:
4
+ /***/ 42:
5
5
  /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
6
6
 
7
7
  var __dirname = "/";
@@ -38,7 +38,7 @@ var Ib=[cx,_q,cr,Yr,as,fs,hs,Hu,Su,cx,cx,cx,cx,cx,cx,cx];var Jb=[dx,si,gi,Wh,Kh,
38
38
 
39
39
  /***/ }),
40
40
 
41
- /***/ 871:
41
+ /***/ 142:
42
42
  /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
43
43
 
44
44
  var __dirname = "/";
@@ -72,7 +72,7 @@ var _a=[yj,od,ef,yj];var $a=[zj,Li,di,bi,Kb,Lb,Mb,Nb,Rc,Sc,Uc,jd,xd,Ye,lf,yd,zd,
72
72
 
73
73
  /***/ }),
74
74
 
75
- /***/ 755:
75
+ /***/ 244:
76
76
  /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
77
77
 
78
78
  /*! dicom-parser - 1.8.12 - 2023-02-20 | (c) 2017 Chris Hafey | https://github.com/cornerstonejs/dicomParser */
@@ -4028,7 +4028,7 @@ module.exports = __WEBPACK_EXTERNAL_MODULE_zlib__;
4028
4028
 
4029
4029
  /***/ }),
4030
4030
 
4031
- /***/ 204:
4031
+ /***/ 935:
4032
4032
  /***/ ((module) => {
4033
4033
 
4034
4034
  /* -*- tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- /
@@ -5183,7 +5183,7 @@ function decode(jpegData, userOpts = {}) {
5183
5183
 
5184
5184
  /***/ }),
5185
5185
 
5186
- /***/ 144:
5186
+ /***/ 473:
5187
5187
  /***/ ((module) => {
5188
5188
 
5189
5189
  (function(f){if(true){module.exports=f()}else { var g; }})(function(){var define,module,exports;return (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c=undefined;if(!f&&c)return require(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u=undefined,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){
@@ -6952,7 +6952,7 @@ if ((moduleType !== 'undefined') && module.exports) {
6952
6952
  /***/ ((module) => {
6953
6953
 
6954
6954
  "use strict";
6955
- module.exports = window [Symbol .for ("X_ITE.X3D-8.12.4")] .require ("lib/jquery");
6955
+ module.exports = window [Symbol .for ("X_ITE.X3D-9.0.0")] .require ("lib/jquery");
6956
6956
 
6957
6957
  /***/ }),
6958
6958
 
@@ -7056,25 +7056,25 @@ var __webpack_exports__ = {};
7056
7056
  // UNUSED EXPORTS: default
7057
7057
 
7058
7058
  ;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"x_ite/Components\")"
7059
- const Components_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.12.4")] .require ("x_ite/Components");
7059
+ const Components_namespaceObject = window [Symbol .for ("X_ITE.X3D-9.0.0")] .require ("x_ite/Components");
7060
7060
  var Components_default = /*#__PURE__*/__webpack_require__.n(Components_namespaceObject);
7061
7061
  ;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"x_ite/Fields\")"
7062
- const Fields_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.12.4")] .require ("x_ite/Fields");
7062
+ const Fields_namespaceObject = window [Symbol .for ("X_ITE.X3D-9.0.0")] .require ("x_ite/Fields");
7063
7063
  var Fields_default = /*#__PURE__*/__webpack_require__.n(Fields_namespaceObject);
7064
7064
  ;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"x_ite/Base/X3DFieldDefinition\")"
7065
- const X3DFieldDefinition_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.12.4")] .require ("x_ite/Base/X3DFieldDefinition");
7065
+ const X3DFieldDefinition_namespaceObject = window [Symbol .for ("X_ITE.X3D-9.0.0")] .require ("x_ite/Base/X3DFieldDefinition");
7066
7066
  var X3DFieldDefinition_default = /*#__PURE__*/__webpack_require__.n(X3DFieldDefinition_namespaceObject);
7067
7067
  ;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"x_ite/Base/FieldDefinitionArray\")"
7068
- const FieldDefinitionArray_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.12.4")] .require ("x_ite/Base/FieldDefinitionArray");
7068
+ const FieldDefinitionArray_namespaceObject = window [Symbol .for ("X_ITE.X3D-9.0.0")] .require ("x_ite/Base/FieldDefinitionArray");
7069
7069
  var FieldDefinitionArray_default = /*#__PURE__*/__webpack_require__.n(FieldDefinitionArray_namespaceObject);
7070
7070
  ;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"x_ite/Components/Texturing/X3DSingleTextureNode\")"
7071
- const X3DSingleTextureNode_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.12.4")] .require ("x_ite/Components/Texturing/X3DSingleTextureNode");
7071
+ const X3DSingleTextureNode_namespaceObject = window [Symbol .for ("X_ITE.X3D-9.0.0")] .require ("x_ite/Components/Texturing/X3DSingleTextureNode");
7072
7072
  var X3DSingleTextureNode_default = /*#__PURE__*/__webpack_require__.n(X3DSingleTextureNode_namespaceObject);
7073
7073
  ;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"x_ite/Base/X3DConstants\")"
7074
- const X3DConstants_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.12.4")] .require ("x_ite/Base/X3DConstants");
7074
+ const X3DConstants_namespaceObject = window [Symbol .for ("X_ITE.X3D-9.0.0")] .require ("x_ite/Base/X3DConstants");
7075
7075
  var X3DConstants_default = /*#__PURE__*/__webpack_require__.n(X3DConstants_namespaceObject);
7076
7076
  ;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"x_ite/Namespace\")"
7077
- const Namespace_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.12.4")] .require ("x_ite/Namespace");
7077
+ const Namespace_namespaceObject = window [Symbol .for ("X_ITE.X3D-9.0.0")] .require ("x_ite/Namespace");
7078
7078
  var Namespace_default = /*#__PURE__*/__webpack_require__.n(Namespace_namespaceObject);
7079
7079
  ;// CONCATENATED MODULE: ./src/x_ite/Components/Texturing3D/X3DTexture3DNode.js
7080
7080
  /*******************************************************************************
@@ -7141,7 +7141,6 @@ function X3DTexture3DNode (executionContext)
7141
7141
  this .width = 0;
7142
7142
  this .height = 0;
7143
7143
  this .depth = 0;
7144
- this .data = null;
7145
7144
  }
7146
7145
 
7147
7146
  Object .assign (Object .setPrototypeOf (X3DTexture3DNode .prototype, (X3DSingleTextureNode_default()).prototype),
@@ -7170,36 +7169,41 @@ Object .assign (Object .setPrototypeOf (X3DTexture3DNode .prototype, (X3DSingleT
7170
7169
  {
7171
7170
  return 3;
7172
7171
  },
7173
- getTextureTypeString ()
7174
- {
7175
- return "3D";
7176
- },
7177
7172
  getWidth ()
7178
7173
  {
7179
7174
  return this .width;
7180
7175
  },
7176
+ setWidth (value)
7177
+ {
7178
+ this .width = value;
7179
+ },
7181
7180
  getHeight ()
7182
7181
  {
7183
7182
  return this .height;
7184
7183
  },
7184
+ setHeight (value)
7185
+ {
7186
+ this .height = value;
7187
+ },
7185
7188
  getDepth ()
7186
7189
  {
7187
7190
  return this .depth;
7188
7191
  },
7192
+ setDepth (value)
7193
+ {
7194
+ this .depth = value;
7195
+ },
7189
7196
  clearTexture ()
7190
7197
  {
7191
7198
  const gl = this .getBrowser () .getContext ();
7192
7199
 
7193
- this .setTexture (1, 1, 1, false, gl .RGBA, defaultData);
7194
-
7195
- this .data = null;
7200
+ this .setTextureFromData (1, 1, 1, false, gl .RGBA, defaultData);
7196
7201
  },
7197
- setTexture (width, height, depth, transparent, format, data)
7202
+ setTextureFromData (width, height, depth, transparent, format, data)
7198
7203
  {
7199
7204
  this .width = width;
7200
7205
  this .height = height;
7201
7206
  this .depth = depth;
7202
- this .data = data;
7203
7207
 
7204
7208
  const gl = this .getBrowser () .getContext ();
7205
7209
 
@@ -7255,7 +7259,7 @@ const __default__ = X3DTexture3DNode;
7255
7259
  Namespace_default().add ("X3DTexture3DNode", "x_ite/Components/Texturing3D/X3DTexture3DNode", __default__);
7256
7260
  /* harmony default export */ const Texturing3D_X3DTexture3DNode = (__default__);
7257
7261
  ;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"x_ite/Base/X3DCast\")"
7258
- const X3DCast_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.12.4")] .require ("x_ite/Base/X3DCast");
7262
+ const X3DCast_namespaceObject = window [Symbol .for ("X_ITE.X3D-9.0.0")] .require ("x_ite/Base/X3DCast");
7259
7263
  var X3DCast_default = /*#__PURE__*/__webpack_require__.n(X3DCast_namespaceObject);
7260
7264
  ;// CONCATENATED MODULE: ./src/x_ite/Components/Texturing3D/ComposedTexture3D.js
7261
7265
  /*******************************************************************************
@@ -7318,8 +7322,7 @@ function ComposedTexture3D (executionContext)
7318
7322
 
7319
7323
  this .addType ((X3DConstants_default()).ComposedTexture3D);
7320
7324
 
7321
- this .addChildObjects ((X3DConstants_default()).outputOnly, "loadState", new (Fields_default()).SFInt32 ((X3DConstants_default()).NOT_STARTED_STATE),
7322
- (X3DConstants_default()).inputOutput, "update", new (Fields_default()).SFTime ());
7325
+ this .addChildObjects ((X3DConstants_default()).inputOutput, "update", new (Fields_default()).SFTime ());
7323
7326
 
7324
7327
  this .textureNodes = [ ];
7325
7328
  }
@@ -7330,19 +7333,11 @@ Object .assign (Object .setPrototypeOf (ComposedTexture3D .prototype, Texturing3
7330
7333
  {
7331
7334
  Texturing3D_X3DTexture3DNode .prototype .initialize .call (this);
7332
7335
 
7333
- const gl = this .getBrowser () .getContext ();
7334
-
7335
- this .frameBuffer = gl .createFramebuffer ();
7336
-
7337
7336
  this ._texture .addInterest ("set_texture__", this);
7338
7337
  this ._update .addInterest ("update", this);
7339
7338
 
7340
7339
  this .set_texture__ ();
7341
7340
  },
7342
- checkLoadState ()
7343
- {
7344
- return this ._loadState .getValue ();
7345
- },
7346
7341
  set_texture__ ()
7347
7342
  {
7348
7343
  const textureNodes = this .textureNodes;
@@ -7371,7 +7366,7 @@ Object .assign (Object .setPrototypeOf (ComposedTexture3D .prototype, Texturing3
7371
7366
  },
7372
7367
  isComplete ()
7373
7368
  {
7374
- return this .textureNodes .every (textureNode => textureNode .checkLoadState () === (X3DConstants_default()).COMPLETE_STATE || textureNode .getWidth ());
7369
+ return this .textureNodes .every (textureNode => textureNode .checkLoadState () === (X3DConstants_default()).COMPLETE_STATE);
7375
7370
  },
7376
7371
  update ()
7377
7372
  {
@@ -7380,20 +7375,25 @@ Object .assign (Object .setPrototypeOf (ComposedTexture3D .prototype, Texturing3
7380
7375
  if (textureNodes .length === 0 || !this .isComplete ())
7381
7376
  {
7382
7377
  this .clearTexture ();
7383
-
7384
- this ._loadState = (X3DConstants_default()).FAILED_STATE;
7385
7378
  }
7386
7379
  else
7387
7380
  {
7388
7381
  const
7389
- gl = this .getBrowser () .getContext (),
7390
- width = textureNodes [0] .getWidth (),
7391
- height = textureNodes [0] .getHeight (),
7392
- depth = textureNodes .length,
7393
- lastBuffer = gl .getParameter (gl .FRAMEBUFFER_BINDING);
7382
+ gl = this .getBrowser () .getContext (),
7383
+ width = textureNodes [0] .getWidth (),
7384
+ height = textureNodes [0] .getHeight (),
7385
+ depth = textureNodes .length,
7386
+ frameBuffer = gl .createFramebuffer ();
7394
7387
 
7395
- gl .bindFramebuffer (gl .FRAMEBUFFER, this .frameBuffer);
7396
- gl .texImage3D (gl .TEXTURE_3D, 0, gl .RGBA, width, height, depth, 0, gl .RGBA, gl .UNSIGNED_BYTE, null);
7388
+ gl .bindFramebuffer (gl .FRAMEBUFFER, frameBuffer);
7389
+ gl .bindTexture (gl .TEXTURE_3D, this .getTexture ());
7390
+
7391
+ if (width !== this .getWidth () || height !== this .getHeight () || depth !== this .getDepth ())
7392
+ {
7393
+ const defaultData = new Uint8Array (width * height * depth * 4);
7394
+
7395
+ gl .texImage3D (gl .TEXTURE_3D, 0, gl .RGBA, width, height, depth, 0, gl .RGBA, gl .UNSIGNED_BYTE, defaultData);
7396
+ }
7397
7397
 
7398
7398
  for (const [i, textureNode] of this .textureNodes .entries ())
7399
7399
  {
@@ -7402,21 +7402,31 @@ Object .assign (Object .setPrototypeOf (ComposedTexture3D .prototype, Texturing3
7402
7402
  gl .bindTexture (gl .TEXTURE_2D, textureNode .getTexture ());
7403
7403
  gl .framebufferTexture2D (gl .FRAMEBUFFER, gl .COLOR_ATTACHMENT0, gl .TEXTURE_2D, textureNode .getTexture (), 0);
7404
7404
 
7405
- gl .bindTexture (gl .TEXTURE_3D, this .getTexture ());
7406
- gl .copyTexSubImage3D (gl .TEXTURE_3D, 0, 0, 0, i, 0, 0, width, height);
7405
+ if (textureNode .getTextureType () === 1)
7406
+ {
7407
+ // Copy and flip Y.
7408
+ for (let y = 0; y < height; ++ y)
7409
+ gl .copyTexSubImage3D (gl .TEXTURE_3D, 0, 0, height - y - 1, i, 0, y, width, 1);
7410
+ }
7411
+ else
7412
+ {
7413
+ gl .copyTexSubImage3D (gl .TEXTURE_3D, 0, 0, 0, i, 0, 0, width, height);
7414
+ }
7407
7415
  }
7408
7416
  else
7409
7417
  {
7410
- console .log ("ComposedTexture3D: all textures must have same size.");
7418
+ console .warn ("ComposedTexture3D: all textures must have same size.");
7411
7419
  }
7412
7420
  }
7413
7421
 
7414
- gl .bindFramebuffer (gl .FRAMEBUFFER, lastBuffer);
7422
+ gl .deleteFramebuffer (frameBuffer);
7415
7423
 
7424
+ this .setWidth (width);
7425
+ this .setHeight (height);
7426
+ this .setDepth (depth);
7416
7427
  this .setTransparent (textureNodes .some (textureNode => textureNode .isTransparent ()));
7428
+ this .setLinear (textureNodes .some (textureNode => textureNode .isLinear ()));
7417
7429
  this .updateTextureParameters ();
7418
-
7419
- this ._loadState = (X3DConstants_default()).COMPLETE_STATE;
7420
7430
  }
7421
7431
  },
7422
7432
  });
@@ -7464,10 +7474,10 @@ const ComposedTexture3D_default_ = ComposedTexture3D;
7464
7474
  Namespace_default().add ("ComposedTexture3D", "x_ite/Components/Texturing3D/ComposedTexture3D", ComposedTexture3D_default_);
7465
7475
  /* harmony default export */ const Texturing3D_ComposedTexture3D = (ComposedTexture3D_default_);
7466
7476
  ;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"x_ite/Components/Networking/X3DUrlObject\")"
7467
- const X3DUrlObject_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.12.4")] .require ("x_ite/Components/Networking/X3DUrlObject");
7477
+ const X3DUrlObject_namespaceObject = window [Symbol .for ("X_ITE.X3D-9.0.0")] .require ("x_ite/Components/Networking/X3DUrlObject");
7468
7478
  var X3DUrlObject_default = /*#__PURE__*/__webpack_require__.n(X3DUrlObject_namespaceObject);
7469
7479
  ;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"x_ite/Parser/Expressions\")"
7470
- const Expressions_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.12.4")] .require ("x_ite/Parser/Expressions");
7480
+ const Expressions_namespaceObject = window [Symbol .for ("X_ITE.X3D-9.0.0")] .require ("x_ite/Parser/Expressions");
7471
7481
  var Expressions_default = /*#__PURE__*/__webpack_require__.n(Expressions_namespaceObject);
7472
7482
  // EXTERNAL MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"lib/jquery\")"
7473
7483
  var jquery_ = __webpack_require__(355);
@@ -7936,11 +7946,11 @@ const NRRDParser_default_ = NRRDParser;
7936
7946
  Namespace_default().add ("NRRDParser", "x_ite/Browser/Texturing3D/NRRDParser", NRRDParser_default_);
7937
7947
  /* harmony default export */ const Texturing3D_NRRDParser = (NRRDParser_default_);
7938
7948
  ;// CONCATENATED MODULE: ./src/x_ite/Browser/Texturing3D/DICOMParser.js
7939
- /* provided dependency */ var dicomParser = __webpack_require__(755);
7940
- /* provided dependency */ var JpegImage = __webpack_require__(204);
7941
- /* provided dependency */ var jpeg = __webpack_require__(144);
7942
- /* provided dependency */ var CharLS = __webpack_require__(717);
7943
- /* provided dependency */ var OpenJPEG = __webpack_require__(871);
7949
+ /* provided dependency */ var dicomParser = __webpack_require__(244);
7950
+ /* provided dependency */ var JpegImage = __webpack_require__(935);
7951
+ /* provided dependency */ var jpeg = __webpack_require__(473);
7952
+ /* provided dependency */ var CharLS = __webpack_require__(42);
7953
+ /* provided dependency */ var OpenJPEG = __webpack_require__(142);
7944
7954
  /*******************************************************************************
7945
7955
  *
7946
7956
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -9043,8 +9053,11 @@ const DICOMParser_default_ = DicomParser;
9043
9053
  Namespace_default().add ("DICOMParser", "x_ite/Browser/Texturing3D/DICOMParser", DICOMParser_default_);
9044
9054
  /* harmony default export */ const DICOMParser = (DICOMParser_default_);
9045
9055
  ;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"x_ite/InputOutput/FileLoader\")"
9046
- const FileLoader_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.12.4")] .require ("x_ite/InputOutput/FileLoader");
9056
+ const FileLoader_namespaceObject = window [Symbol .for ("X_ITE.X3D-9.0.0")] .require ("x_ite/InputOutput/FileLoader");
9047
9057
  var FileLoader_default = /*#__PURE__*/__webpack_require__.n(FileLoader_namespaceObject);
9058
+ ;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"x_ite/DEVELOPMENT\")"
9059
+ const DEVELOPMENT_namespaceObject = window [Symbol .for ("X_ITE.X3D-9.0.0")] .require ("x_ite/DEVELOPMENT");
9060
+ var DEVELOPMENT_default = /*#__PURE__*/__webpack_require__.n(DEVELOPMENT_namespaceObject);
9048
9061
  ;// CONCATENATED MODULE: ./src/x_ite/Components/Texturing3D/ImageTexture3D.js
9049
9062
  /*******************************************************************************
9050
9063
  *
@@ -9103,6 +9116,7 @@ var FileLoader_default = /*#__PURE__*/__webpack_require__.n(FileLoader_namespace
9103
9116
 
9104
9117
 
9105
9118
 
9119
+
9106
9120
  function ImageTexture3D (executionContext)
9107
9121
  {
9108
9122
  Texturing3D_X3DTexture3DNode .call (this, executionContext);
@@ -9144,7 +9158,7 @@ Object .assign (Object .setPrototypeOf (ImageTexture3D .prototype, Texturing3D_X
9144
9158
  loadData ()
9145
9159
  {
9146
9160
  new (FileLoader_default()) (this) .loadDocument (this ._url,
9147
- function (data)
9161
+ function (data, URL)
9148
9162
  {
9149
9163
  if (data === null)
9150
9164
  {
@@ -9154,13 +9168,26 @@ Object .assign (Object .setPrototypeOf (ImageTexture3D .prototype, Texturing3D_X
9154
9168
  }
9155
9169
  else if (data instanceof ArrayBuffer)
9156
9170
  {
9171
+ if (URL .pathname .match (/\.ktx2?(?:\.gz)?$/))
9172
+ {
9173
+ this .setLinear (true);
9174
+
9175
+ return this .getBrowser () .getKTXDecoder ()
9176
+ .then (decoder => decoder .loadKTXFromBuffer (data))
9177
+ .then (texture => this .setKTXTexture (texture, URL));
9178
+ }
9179
+
9180
+ this .setLinear (false);
9181
+
9157
9182
  const nrrd = new Texturing3D_NRRDParser () .parse (data);
9158
9183
 
9159
9184
  if (nrrd .nrrd)
9160
9185
  {
9161
- const internalType = this .getInternalType (nrrd .components);
9186
+ const
9187
+ internalType = this .getInternalType (nrrd .components),
9188
+ transparent = !(nrrd .components & 1);
9162
9189
 
9163
- this .setTexture (nrrd .width, nrrd .height, nrrd .depth, false, internalType, nrrd .data);
9190
+ this .setTextureFromData (nrrd .width, nrrd .height, nrrd .depth, transparent, internalType, nrrd .data);
9164
9191
  this .setLoadState ((X3DConstants_default()).COMPLETE_STATE);
9165
9192
  return;
9166
9193
  }
@@ -9169,18 +9196,42 @@ Object .assign (Object .setPrototypeOf (ImageTexture3D .prototype, Texturing3D_X
9169
9196
 
9170
9197
  if (dicom .dicom)
9171
9198
  {
9172
- const internalType = this .getInternalType (dicom .components);
9199
+ const
9200
+ internalType = this .getInternalType (dicom .components),
9201
+ transparent = !(dicom .components & 1);
9173
9202
 
9174
- this .setTexture (dicom .width, dicom .height, dicom .depth, false, internalType, dicom .data);
9203
+ this .setTextureFromData (dicom .width, dicom .height, dicom .depth, transparent, internalType, dicom .data);
9175
9204
  this .setLoadState ((X3DConstants_default()).COMPLETE_STATE);
9176
9205
  return;
9177
9206
  }
9178
9207
 
9179
- throw new Error ("ImageTexture3D: no appropriate file type handler found.");
9208
+ throw new Error ("ImageTexture3D: no suitable file type handler found.");
9180
9209
  }
9181
9210
  }
9182
9211
  .bind (this));
9183
9212
  },
9213
+ setKTXTexture (texture, URL)
9214
+ {
9215
+ if (texture .target !== this .getTarget ())
9216
+ throw new Error ("Invalid KTX texture target, must be 'TEXTURE_3D'.");
9217
+
9218
+ if ((DEVELOPMENT_default()))
9219
+ {
9220
+ if (URL .protocol !== "data:")
9221
+ console .info (`Done loading image texture 3D '${decodeURI (URL .href)}'`);
9222
+ }
9223
+
9224
+ this .setTexture (texture);
9225
+ this .setTransparent (false);
9226
+ this .setLevels (texture .levels);
9227
+ this .setWidth (texture .baseWidth);
9228
+ this .setHeight (texture .baseHeight);
9229
+ this .setDepth (texture .baseDepth); // TODO: Always 1
9230
+ this .setGenerateMipMaps (false);
9231
+ this .updateTextureParameters ();
9232
+
9233
+ this .setLoadState ((X3DConstants_default()).COMPLETE_STATE);
9234
+ },
9184
9235
  dispose ()
9185
9236
  {
9186
9237
  X3DUrlObject_default().prototype .dispose .call (this);
@@ -9233,9 +9284,6 @@ const ImageTexture3D_default_ = ImageTexture3D;
9233
9284
 
9234
9285
  Namespace_default().add ("ImageTexture3D", "x_ite/Components/Texturing3D/ImageTexture3D", ImageTexture3D_default_);
9235
9286
  /* harmony default export */ const Texturing3D_ImageTexture3D = (ImageTexture3D_default_);
9236
- ;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"x_ite/DEVELOPMENT\")"
9237
- const DEVELOPMENT_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.12.4")] .require ("x_ite/DEVELOPMENT");
9238
- var DEVELOPMENT_default = /*#__PURE__*/__webpack_require__.n(DEVELOPMENT_namespaceObject);
9239
9287
  ;// CONCATENATED MODULE: ./src/x_ite/Components/Texturing3D/ImageTextureAtlas.js
9240
9288
  /* provided dependency */ var $ = __webpack_require__(355);
9241
9289
  /*******************************************************************************
@@ -9301,7 +9349,6 @@ function ImageTextureAtlas (executionContext)
9301
9349
  this .addType ((X3DConstants_default()).ImageTextureAtlas);
9302
9350
 
9303
9351
  this .image = $("<img></img>");
9304
- this .canvas = $("<canvas></canvas>");
9305
9352
  this .urlStack = new (Fields_default()).MFString ();
9306
9353
  }
9307
9354
 
@@ -9366,15 +9413,20 @@ Object .assign (Object .setPrototypeOf (ImageTextureAtlas .prototype, Texturing3
9366
9413
 
9367
9414
  try
9368
9415
  {
9369
- const
9370
- gl = this .getBrowser () .getContext (),
9371
- image = this .image [0],
9372
- canvas = this .canvas [0],
9373
- cx = canvas .getContext ("2d", { willReadFrequently: true });
9416
+ const gl = this .getBrowser () .getContext ();
9417
+
9418
+ if (gl .getVersion () === 1)
9419
+ {
9420
+ this .setLoadState ((X3DConstants_default()).COMPLETE_STATE);
9421
+ return;
9422
+ }
9374
9423
 
9375
9424
  const
9376
- width = image .width,
9377
- height = image .height;
9425
+ image = this .image [0],
9426
+ w = image .width,
9427
+ h = image .height,
9428
+ texture = gl .createTexture (),
9429
+ frameBuffer = gl .createFramebuffer ();
9378
9430
 
9379
9431
  // Slice me nice.
9380
9432
 
@@ -9382,45 +9434,49 @@ Object .assign (Object .setPrototypeOf (ImageTextureAtlas .prototype, Texturing3
9382
9434
  slicesOverX = this ._slicesOverX .getValue (),
9383
9435
  slicesOverY = this ._slicesOverY .getValue (),
9384
9436
  maxSlices = slicesOverX * slicesOverY,
9385
- numberOfSlices = Math .min (this ._numberOfSlices .getValue (), maxSlices),
9386
- w = Math .floor (width / slicesOverX),
9387
- h = Math .floor (height / slicesOverY),
9388
- data = new Uint8Array (w * h * numberOfSlices * 4);
9437
+ width = Math .floor (w / slicesOverX),
9438
+ height = Math .floor (h / slicesOverY),
9439
+ depth = Math .min (this ._numberOfSlices .getValue (), maxSlices),
9440
+ defaultData = new Uint8Array (w * h * 4),
9441
+ data = defaultData .subarray (0, width * height * depth * 4);
9442
+
9443
+ gl .bindTexture (gl .TEXTURE_3D, this .getTexture ());
9444
+ gl .texImage3D (gl .TEXTURE_3D, 0, gl .RGBA, width, height, depth, 0, gl .RGBA, gl .UNSIGNED_BYTE, defaultData);
9389
9445
 
9390
- canvas .width = w;
9391
- canvas .height = h;
9446
+ gl .bindFramebuffer (gl .FRAMEBUFFER, frameBuffer);
9447
+ gl .bindTexture (gl .TEXTURE_2D, texture);
9448
+ gl .texImage2D (gl .TEXTURE_2D, 0, gl .RGBA, w, h, 0, gl .RGBA, gl .UNSIGNED_BYTE, image);
9449
+ gl .framebufferTexture2D (gl .FRAMEBUFFER, gl .COLOR_ATTACHMENT0, gl .TEXTURE_2D, texture, 0);
9392
9450
 
9393
- for (let y = 0, i = 0; y < slicesOverY && i < numberOfSlices; ++ y)
9451
+ let transparent = false;
9452
+
9453
+ for (let y = 0, i = 0; y < slicesOverY && i < depth; ++ y)
9394
9454
  {
9395
- for (let x = 0; x < slicesOverX && i < numberOfSlices; ++ x, ++ i)
9455
+ for (let x = 0; x < slicesOverX && i < depth; ++ x, ++ i)
9396
9456
  {
9397
9457
  const
9398
- sx = Math .floor (x * width / slicesOverX),
9399
- sy = Math .floor (y * height / slicesOverY);
9458
+ sx = Math .floor (x * w / slicesOverX),
9459
+ sy = Math .floor (y * h / slicesOverY);
9400
9460
 
9401
- cx .clearRect (0, 0, w, h);
9402
- cx .drawImage (image, sx, sy, w, h, 0, 0, w, h);
9461
+ // gl .copyTexSubImage3D (gl .TEXTURE_3D, 0, 0, 0, i, sx, sy, width, height);
9403
9462
 
9404
- const d = cx .getImageData (0, 0, w, h) .data;
9463
+ gl .readPixels (sx, sy, width, height, gl .RGBA, gl .UNSIGNED_BYTE, data);
9464
+ gl .texSubImage3D (gl .TEXTURE_3D, 0, 0, 0, i, width, height, 1, gl .RGBA, gl. UNSIGNED_BYTE, data);
9405
9465
 
9406
- data .set (d, w * h * i * 4);
9466
+ transparent = transparent || this .isImageTransparent (data);
9407
9467
  }
9408
9468
  }
9409
9469
 
9410
- // Determine image alpha.
9411
-
9412
- let transparent = true;
9470
+ gl .deleteFramebuffer (frameBuffer);
9471
+ gl .deleteTexture (texture);
9413
9472
 
9414
- for (let i = 3, length = data .length; i < length; i += 4)
9415
- {
9416
- if (data [i] !== 255)
9417
- {
9418
- transparent = true;
9419
- break;
9420
- }
9421
- }
9473
+ // Determine image alpha.
9422
9474
 
9423
- this .setTexture (w, h, numberOfSlices, transparent, gl .RGBA, data);
9475
+ this .setTransparent (transparent);
9476
+ this .setWidth (width);
9477
+ this .setHeight (height);
9478
+ this .setDepth (depth);
9479
+ this .updateTextureParameters ();
9424
9480
  this .setLoadState ((X3DConstants_default()).COMPLETE_STATE);
9425
9481
  }
9426
9482
  catch (error)
@@ -9546,8 +9602,6 @@ function PixelTexture3D (executionContext)
9546
9602
  Texturing3D_X3DTexture3DNode .call (this, executionContext);
9547
9603
 
9548
9604
  this .addType ((X3DConstants_default()).PixelTexture3D);
9549
-
9550
- this .addChildObjects ((X3DConstants_default()).outputOnly, "loadState", new (Fields_default()).SFInt32 ((X3DConstants_default()).NOT_STARTED_STATE));
9551
9605
  }
9552
9606
 
9553
9607
  Object .assign (Object .setPrototypeOf (PixelTexture3D .prototype, Texturing3D_X3DTexture3DNode .prototype),
@@ -9560,10 +9614,6 @@ Object .assign (Object .setPrototypeOf (PixelTexture3D .prototype, Texturing3D_X
9560
9614
 
9561
9615
  this .set_image__ ();
9562
9616
  },
9563
- checkLoadState ()
9564
- {
9565
- return this ._loadState .getValue ();
9566
- },
9567
9617
  set_image__: (() =>
9568
9618
  {
9569
9619
  const
@@ -9580,7 +9630,6 @@ Object .assign (Object .setPrototypeOf (PixelTexture3D .prototype, Texturing3D_X
9580
9630
  if (image .length < OFFSET)
9581
9631
  {
9582
9632
  this .clearTexture ();
9583
- this ._loadState = (X3DConstants_default()).FAILED_STATE;
9584
9633
  return;
9585
9634
  }
9586
9635
 
@@ -9590,7 +9639,7 @@ Object .assign (Object .setPrototypeOf (PixelTexture3D .prototype, Texturing3D_X
9590
9639
  width = image [WIDTH],
9591
9640
  height = image [HEIGHT],
9592
9641
  depth = image [DEPTH],
9593
- transparent = ! (components & 1),
9642
+ transparent = !(components & 1),
9594
9643
  size3D = width * height * depth;
9595
9644
 
9596
9645
  let data, format;
@@ -9618,8 +9667,8 @@ Object .assign (Object .setPrototypeOf (PixelTexture3D .prototype, Texturing3D_X
9618
9667
  {
9619
9668
  const p = image [i];
9620
9669
 
9621
- data [d ++ ] = (p >>> 8) & 0xff;
9622
- data [d ++ ] = p & 0xff;
9670
+ data [d ++] = (p >>> 8) & 0xff;
9671
+ data [d ++] = p & 0xff;
9623
9672
  }
9624
9673
 
9625
9674
  break;
@@ -9633,9 +9682,9 @@ Object .assign (Object .setPrototypeOf (PixelTexture3D .prototype, Texturing3D_X
9633
9682
  {
9634
9683
  const p = image [i];
9635
9684
 
9636
- data [d ++ ] = (p >>> 16) & 0xff;
9637
- data [d ++ ] = (p >>> 8) & 0xff;
9638
- data [d ++ ] = p & 0xff;
9685
+ data [d ++] = (p >>> 16) & 0xff;
9686
+ data [d ++] = (p >>> 8) & 0xff;
9687
+ data [d ++] = p & 0xff;
9639
9688
  }
9640
9689
 
9641
9690
  break;
@@ -9649,10 +9698,10 @@ Object .assign (Object .setPrototypeOf (PixelTexture3D .prototype, Texturing3D_X
9649
9698
  {
9650
9699
  const p = image [i];
9651
9700
 
9652
- data [d ++ ] = (p >>> 24) & 0xff;
9653
- data [d ++ ] = (p >>> 16) & 0xff;
9654
- data [d ++ ] = (p >>> 8) & 0xff;
9655
- data [d ++ ] = p & 0xff;
9701
+ data [d ++] = (p >>> 24) & 0xff;
9702
+ data [d ++] = (p >>> 16) & 0xff;
9703
+ data [d ++] = (p >>> 8) & 0xff;
9704
+ data [d ++] = p & 0xff;
9656
9705
  }
9657
9706
 
9658
9707
  break;
@@ -9660,13 +9709,11 @@ Object .assign (Object .setPrototypeOf (PixelTexture3D .prototype, Texturing3D_X
9660
9709
  default:
9661
9710
  {
9662
9711
  this .clearTexture ();
9663
- this ._loadState = (X3DConstants_default()).FAILED_STATE;
9664
9712
  return;
9665
9713
  }
9666
9714
  }
9667
9715
 
9668
- this .setTexture (width, height, depth, transparent, format, data);
9669
- this ._loadState = (X3DConstants_default()).COMPLETE_STATE;
9716
+ this .setTextureFromData (width, height, depth, transparent, format, data);
9670
9717
  };
9671
9718
  })(),
9672
9719
  });
@@ -9714,10 +9761,10 @@ const PixelTexture3D_default_ = PixelTexture3D;
9714
9761
  Namespace_default().add ("PixelTexture3D", "x_ite/Components/Texturing3D/PixelTexture3D", PixelTexture3D_default_);
9715
9762
  /* harmony default export */ const Texturing3D_PixelTexture3D = (PixelTexture3D_default_);
9716
9763
  ;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"x_ite/Components/Texturing/X3DSingleTextureCoordinateNode\")"
9717
- const X3DSingleTextureCoordinateNode_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.12.4")] .require ("x_ite/Components/Texturing/X3DSingleTextureCoordinateNode");
9764
+ const X3DSingleTextureCoordinateNode_namespaceObject = window [Symbol .for ("X_ITE.X3D-9.0.0")] .require ("x_ite/Components/Texturing/X3DSingleTextureCoordinateNode");
9718
9765
  var X3DSingleTextureCoordinateNode_default = /*#__PURE__*/__webpack_require__.n(X3DSingleTextureCoordinateNode_namespaceObject);
9719
9766
  ;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"standard/Math/Numbers/Vector4\")"
9720
- const Vector4_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.12.4")] .require ("standard/Math/Numbers/Vector4");
9767
+ const Vector4_namespaceObject = window [Symbol .for ("X_ITE.X3D-9.0.0")] .require ("standard/Math/Numbers/Vector4");
9721
9768
  ;// CONCATENATED MODULE: ./src/x_ite/Components/Texturing3D/TextureCoordinate3D.js
9722
9769
  /*******************************************************************************
9723
9770
  *
@@ -10021,16 +10068,16 @@ const TextureCoordinate4D_default_ = TextureCoordinate4D;
10021
10068
  Namespace_default().add ("TextureCoordinate4D", "x_ite/Components/Texturing3D/TextureCoordinate4D", TextureCoordinate4D_default_);
10022
10069
  /* harmony default export */ const Texturing3D_TextureCoordinate4D = (TextureCoordinate4D_default_);
10023
10070
  ;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"x_ite/Components/Texturing/X3DSingleTextureTransformNode\")"
10024
- const X3DSingleTextureTransformNode_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.12.4")] .require ("x_ite/Components/Texturing/X3DSingleTextureTransformNode");
10071
+ const X3DSingleTextureTransformNode_namespaceObject = window [Symbol .for ("X_ITE.X3D-9.0.0")] .require ("x_ite/Components/Texturing/X3DSingleTextureTransformNode");
10025
10072
  var X3DSingleTextureTransformNode_default = /*#__PURE__*/__webpack_require__.n(X3DSingleTextureTransformNode_namespaceObject);
10026
10073
  ;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"standard/Math/Numbers/Vector3\")"
10027
- const Vector3_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.12.4")] .require ("standard/Math/Numbers/Vector3");
10074
+ const Vector3_namespaceObject = window [Symbol .for ("X_ITE.X3D-9.0.0")] .require ("standard/Math/Numbers/Vector3");
10028
10075
  var Vector3_default = /*#__PURE__*/__webpack_require__.n(Vector3_namespaceObject);
10029
10076
  ;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"standard/Math/Numbers/Rotation4\")"
10030
- const Rotation4_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.12.4")] .require ("standard/Math/Numbers/Rotation4");
10077
+ const Rotation4_namespaceObject = window [Symbol .for ("X_ITE.X3D-9.0.0")] .require ("standard/Math/Numbers/Rotation4");
10031
10078
  var Rotation4_default = /*#__PURE__*/__webpack_require__.n(Rotation4_namespaceObject);
10032
10079
  ;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"standard/Math/Numbers/Matrix4\")"
10033
- const Matrix4_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.12.4")] .require ("standard/Math/Numbers/Matrix4");
10080
+ const Matrix4_namespaceObject = window [Symbol .for ("X_ITE.X3D-9.0.0")] .require ("standard/Math/Numbers/Matrix4");
10034
10081
  var Matrix4_default = /*#__PURE__*/__webpack_require__.n(Matrix4_namespaceObject);
10035
10082
  ;// CONCATENATED MODULE: ./src/x_ite/Components/Texturing3D/TextureTransform3D.js
10036
10083
  /*******************************************************************************
@@ -10108,10 +10155,6 @@ Object .assign (Object .setPrototypeOf (TextureTransform3D .prototype, (X3DSingl
10108
10155
 
10109
10156
  this .eventsProcessed ();
10110
10157
  },
10111
- getMatrix ()
10112
- {
10113
- return this .matrix;
10114
- },
10115
10158
  eventsProcessed: (() =>
10116
10159
  {
10117
10160
  const vector = new (Vector3_default()) (0, 0, 0);
@@ -10259,10 +10302,6 @@ Object .assign (Object .setPrototypeOf (TextureTransformMatrix3D .prototype, (X3
10259
10302
 
10260
10303
  this .eventsProcessed ();
10261
10304
  },
10262
- getMatrix ()
10263
- {
10264
- return this ._matrix .getValue ();
10265
- },
10266
10305
  eventsProcessed ()
10267
10306
  {
10268
10307
  this .setMatrix (this ._matrix .getValue ());