@xeokit/xeokit-sdk 2.6.77-slim-rc5 → 2.6.77

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.
@@ -1,7 +1,7 @@
1
1
  /**
2
- * xeokit-sdk v2.6.77-slim-rc5
3
- * Commit: c82f011311ec1e79c79ebb96850b7eb2e0c8d17f
4
- * Built: 2025-05-27T12:38:00.541Z
2
+ * xeokit-sdk v2.6.77
3
+ * Commit: dc4203217f3d582aa27f898cc28df7c4ff10effb
4
+ * Built: 2025-06-10T12:09:01.541Z
5
5
  */
6
6
 
7
7
  /** @private */
@@ -1582,6 +1582,16 @@ const math = {
1582
1582
  return (v1[0] === v2[0] && v1[1] === v2[1] && v1[2] === v2[2]);
1583
1583
  },
1584
1584
 
1585
+ /**
1586
+ * Returns true if the two 4-element vectors are the same.
1587
+ * @param v1
1588
+ * @param v2
1589
+ * @returns {Boolean}
1590
+ */
1591
+ compareVec4(v1, v2) {
1592
+ return (v1[0] === v2[0] && v1[1] === v2[1] && v1[2] === v2[2] && v1[3] === v2[3]);
1593
+ },
1594
+
1585
1595
  /**
1586
1596
  * Negates a three-element vector.
1587
1597
  * @method negateVec3
@@ -25269,7 +25279,8 @@ class Mesh extends Component {
25269
25279
  pickHash: "",
25270
25280
  offset: math.vec3(),
25271
25281
  origin: null,
25272
- originHash: null
25282
+ originHash: null,
25283
+ isUI: cfg.isUI
25273
25284
  });
25274
25285
 
25275
25286
  this._drawRenderer = null;
@@ -25621,6 +25632,15 @@ class Mesh extends Component {
25621
25632
  return this._isObject;
25622
25633
  }
25623
25634
 
25635
+ /**
25636
+ * Returns ````true```` if this Mesh is an UI object.
25637
+ *
25638
+ * @type {Boolean}
25639
+ */
25640
+ get isUI() {
25641
+ return this._state.isUI;
25642
+ }
25643
+
25624
25644
  /**
25625
25645
  * Gets the Mesh's World-space 3D axis-aligned bounding box.
25626
25646
  *
@@ -77422,6 +77442,7 @@ const Renderer$1 = function (scene, options) {
77422
77442
 
77423
77443
  let postSortDrawableList = [];
77424
77444
  let postCullDrawableList = [];
77445
+ let uiDrawableList = [];
77425
77446
 
77426
77447
  let drawableListDirty = true;
77427
77448
  let stateSortDirty = true;
@@ -77662,14 +77683,20 @@ const Renderer$1 = function (scene, options) {
77662
77683
 
77663
77684
  function cullDrawableList() {
77664
77685
  let lenDrawableList = 0;
77686
+ let lenUiList = 0;
77665
77687
  for (let i = 0, len = postSortDrawableList.length; i < len; i++) {
77666
77688
  const drawable = postSortDrawableList[i];
77667
77689
  drawable.rebuildRenderFlags();
77668
77690
  if (!drawable.renderFlags.culled) {
77669
- postCullDrawableList[lenDrawableList++] = drawable;
77691
+ if (drawable.isUI) {
77692
+ uiDrawableList[lenUiList++] = drawable;
77693
+ } else {
77694
+ postCullDrawableList[lenDrawableList++] = drawable;
77695
+ }
77670
77696
  }
77671
77697
  }
77672
77698
  postCullDrawableList.length = lenDrawableList;
77699
+ uiDrawableList.length = lenUiList;
77673
77700
  }
77674
77701
 
77675
77702
  function draw(params) {
@@ -77901,6 +77928,8 @@ const Renderer$1 = function (scene, options) {
77901
77928
  gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);
77902
77929
  }
77903
77930
 
77931
+ const renderDrawables = function(drawables) {
77932
+
77904
77933
  let normalDrawSAOBinLen = 0;
77905
77934
  let normalEdgesOpaqueBinLen = 0;
77906
77935
  let normalFillTransparentBinLen = 0;
@@ -77924,10 +77953,9 @@ const Renderer$1 = function (scene, options) {
77924
77953
  //------------------------------------------------------------------------------------------------------
77925
77954
  // Render normal opaque solids, defer others to bins to render after
77926
77955
  //------------------------------------------------------------------------------------------------------
77956
+ for (let i = 0, len = drawables.length; i < len; i++) {
77927
77957
 
77928
- for (let i = 0, len = postCullDrawableList.length; i < len; i++) {
77929
-
77930
- drawable = postCullDrawableList[i];
77958
+ drawable = drawables[i];
77931
77959
 
77932
77960
  if (drawable.culled === true || drawable.visible === false) {
77933
77961
  continue;
@@ -78225,6 +78253,14 @@ const Renderer$1 = function (scene, options) {
78225
78253
  gl.disable(gl.BLEND);
78226
78254
  }
78227
78255
 
78256
+ };
78257
+
78258
+ renderDrawables(postCullDrawableList);
78259
+ if (uiDrawableList.length > 0) {
78260
+ gl.clear(gl.DEPTH_BUFFER_BIT);
78261
+ renderDrawables(uiDrawableList);
78262
+ }
78263
+
78228
78264
  const endTime = Date.now();
78229
78265
  const frameStats = stats.frame;
78230
78266
 
@@ -78430,8 +78466,9 @@ const Renderer$1 = function (scene, options) {
78430
78466
  const includeEntityIds = params.includeEntityIds;
78431
78467
  const excludeEntityIds = params.excludeEntityIds;
78432
78468
 
78433
- for (let i = 0, len = postCullDrawableList.length; i < len; i++) {
78434
- const drawable = postCullDrawableList[i];
78469
+ const renderDrawables = function(drawables) {
78470
+ for (let i = 0, len = drawables.length; i < len; i++) {
78471
+ const drawable = drawables[i];
78435
78472
  if (drawable.culled === true || drawable.visible === false) {
78436
78473
  continue;
78437
78474
  }
@@ -78446,6 +78483,13 @@ const Renderer$1 = function (scene, options) {
78446
78483
  }
78447
78484
  drawable.drawPickMesh(frameCtx);
78448
78485
  }
78486
+ };
78487
+
78488
+ renderDrawables(postCullDrawableList);
78489
+ if (uiDrawableList.length > 0) {
78490
+ gl.clear(gl.DEPTH_BUFFER_BIT);
78491
+ renderDrawables(uiDrawableList);
78492
+ }
78449
78493
 
78450
78494
  const pix = pickBuffer.read(0, 0);
78451
78495
  const pickID = pix[0] + (pix[1] << 8) + (pix[2] << 16) + (pix[3] << 24);
@@ -81993,6 +82037,7 @@ class Camera extends Component {
81993
82037
  super(owner, cfg);
81994
82038
 
81995
82039
  this._state = new RenderState({
82040
+ offsetEyeFromLook: true, // TODO: treat as legacy and get rid of at some later point
81996
82041
  deviceMatrix: math.mat4(),
81997
82042
  hasDeviceMatrix: false, // True when deviceMatrix set to other than identity
81998
82043
  matrix: math.mat4(),
@@ -82053,7 +82098,7 @@ class Camera extends Component {
82053
82098
  // the front off the view (not a problem with perspective, since objects close enough
82054
82099
  // to be clipped by the front plane are usually too big to see anything of their cross-sections).
82055
82100
  let eye;
82056
- if (this.projection === "ortho") {
82101
+ if (this.projection === "ortho" && this._state.offsetEyeFromLook) {
82057
82102
  math.subVec3(this._eye, this._look, eyeLookVec);
82058
82103
  math.normalizeVec3(eyeLookVec, eyeLookVecNorm);
82059
82104
  math.mulVec3Scalar(eyeLookVecNorm, 1000.0, eyeLookOffset);
@@ -82635,6 +82680,25 @@ class Camera extends Component {
82635
82680
  return this._project;
82636
82681
  }
82637
82682
 
82683
+ /**
82684
+ * Gets whether to offset the ortho camera's effective eye from its look
82685
+ *
82686
+ * Default value for legacy reasons is ````true````.
82687
+ */
82688
+ get offsetEyeFromLook() {
82689
+ return this._state.offsetEyeFromLook;
82690
+ }
82691
+
82692
+ /**
82693
+ * Offsets the ortho camera's effective eye from its look
82694
+ *
82695
+ * Default value for legacy reasons is ````true````.
82696
+ */
82697
+ set offsetEyeFromLook(v) {
82698
+ this._state.offsetEyeFromLook = v;
82699
+ this._needUpdate(0); // Ensure matrix built on next "tick"
82700
+ }
82701
+
82638
82702
  /**
82639
82703
  * Get the 2D canvas position of a 3D world position.
82640
82704
  *
@@ -98230,7 +98294,7 @@ for (var i = 0; i < chars.length; i++) {
98230
98294
  var Prepend = 1;
98231
98295
  var CR = 2;
98232
98296
  var LF = 3;
98233
- var Control$1 = 4;
98297
+ var Control = 4;
98234
98298
  var Extend = 5;
98235
98299
  var SpacingMark = 7;
98236
98300
  var L = 8;
@@ -98308,11 +98372,11 @@ var _graphemeBreakAtIndex = function (_codePoints, classTypes, index) {
98308
98372
  return BREAK_NOT_ALLOWED;
98309
98373
  }
98310
98374
  // GB4 Otherwise, break before and after controls.
98311
- if (current === CR || current === LF || current === Control$1) {
98375
+ if (current === CR || current === LF || current === Control) {
98312
98376
  return BREAK_ALLOWED;
98313
98377
  }
98314
98378
  // GB5
98315
- if (next === CR || next === LF || next === Control$1) {
98379
+ if (next === CR || next === LF || next === Control) {
98316
98380
  return BREAK_ALLOWED;
98317
98381
  }
98318
98382
  // Do not break Hangul syllable sequences.
@@ -104709,6 +104773,42 @@ function createSkyboxMesh(scene, texture) {
104709
104773
  });
104710
104774
  }
104711
104775
 
104776
+ /**
104777
+ *
104778
+ * @param {*} scene
104779
+ * @param {Texture} [texture] Texture to be used on the material for SphereMap
104780
+ * @returns {Mesh}
104781
+ */
104782
+
104783
+ function createSphereMapMesh(scene, texture) {
104784
+ const sphereMapGeometry = new ReadableGeometry(scene, buildSphereGeometry({
104785
+ center: [0, 0, 0],
104786
+ radius: 1,
104787
+ heightSegments: 60,
104788
+ widthSegments: 60
104789
+ }));
104790
+
104791
+ const sphereMapMaterial = new PhongMaterial(scene, {
104792
+ ambient: [0, 0, 0],
104793
+ diffuse: [0, 0, 0],
104794
+ specular: [0, 0, 0],
104795
+ emissive: [1, 1, 1],
104796
+ emissiveMap: texture,
104797
+ backfaces: true
104798
+ });
104799
+
104800
+ return new Mesh(scene, {
104801
+ geometry: sphereMapGeometry,
104802
+ background: true,
104803
+ rotation: [0, 0, 180],
104804
+ material: sphereMapMaterial,
104805
+ visible: true,
104806
+ pickable: false,
104807
+ clippable: false,
104808
+ collidable: false
104809
+ });
104810
+ }
104811
+
104712
104812
  const tmpVec3a$1 = math.vec3();
104713
104813
  const tmpVec3b$1 = math.vec3();
104714
104814
 
@@ -123300,6 +123400,13 @@ class GLTFSceneModelLoader {
123300
123400
  if (ok) {
123301
123401
  ok();
123302
123402
  }
123403
+ },
123404
+ function (msg) {
123405
+ sceneModel.error(msg);
123406
+ sceneModel.fire("error", msg);
123407
+ if (error) {
123408
+ error(msg);
123409
+ }
123303
123410
  });
123304
123411
  }
123305
123412
  }
@@ -123311,7 +123418,7 @@ function loadGLTF(plugin, src, metaModelJSON, options, sceneModel, ok, error) {
123311
123418
  if (isGLB) {
123312
123419
  plugin.dataSource.getGLB(src, (arrayBuffer) => { // OK
123313
123420
  options.basePath = getBasePath(src);
123314
- parseGLTF(plugin, src, arrayBuffer, metaModelJSON, options, sceneModel, ok);
123421
+ parseGLTF(plugin, src, arrayBuffer, metaModelJSON, options, sceneModel, ok, error);
123315
123422
  spinner.processes--;
123316
123423
  },
123317
123424
  (err) => {
@@ -123321,7 +123428,7 @@ function loadGLTF(plugin, src, metaModelJSON, options, sceneModel, ok, error) {
123321
123428
  } else {
123322
123429
  plugin.dataSource.getGLTF(src, (gltf) => { // OK
123323
123430
  options.basePath = getBasePath(src);
123324
- parseGLTF(plugin, src, gltf, metaModelJSON, options, sceneModel, ok);
123431
+ parseGLTF(plugin, src, gltf, metaModelJSON, options, sceneModel, ok, error);
123325
123432
  spinner.processes--;
123326
123433
  },
123327
123434
  (err) => {
@@ -123336,7 +123443,7 @@ function getBasePath(src) {
123336
123443
  return (i !== 0) ? src.substring(0, i + 1) : "";
123337
123444
  }
123338
123445
 
123339
- function parseGLTF(plugin, src, gltf, metaModelJSON, options, sceneModel, ok) {
123446
+ function parseGLTF(plugin, src, gltf, metaModelJSON, options, sceneModel, ok, error) {
123340
123447
  const spinner = plugin.viewer.scene.canvas.spinner;
123341
123448
  spinner.processes++;
123342
123449
  parse$3(gltf, GLTFLoader, {
@@ -123384,6 +123491,8 @@ function parseGLTF(plugin, src, gltf, metaModelJSON, options, sceneModel, ok) {
123384
123491
  }
123385
123492
  spinner.processes--;
123386
123493
  ok();
123494
+ }).catch((err) => {
123495
+ if (error) error(err);
123387
123496
  });
123388
123497
  }
123389
123498
 
@@ -126149,35 +126258,18 @@ class OBJLoaderPlugin extends Plugin {
126149
126258
  }
126150
126259
 
126151
126260
  /**
126152
- * Controls a {@link SectionPlane} with mouse and touch input.
126261
+ * Controls a transformation with mouse and touch input.
126153
126262
  *
126154
126263
  * @private
126155
126264
  */
126156
- class Control {
126265
+ class TransformControl {
126157
126266
 
126158
126267
  /** @private */
126159
- constructor(plugin) {
126160
-
126161
- /**
126162
- * ID of this Control.
126163
- *
126164
- * SectionPlaneControls are mapped by this ID in {@link SectionPlanesPlugin#sectionPlaneControls}.
126165
- *
126166
- * @property id
126167
- * @type {String|Number}
126168
- */
126169
- this.id = null;
126170
-
126171
- const viewer = plugin.viewer;
126172
- const camera = viewer.camera;
126268
+ constructor(viewer) {
126173
126269
  const cameraControl = viewer.cameraControl;
126174
126270
  const scene = viewer.scene;
126175
126271
  const canvas = scene.canvas.canvas;
126176
126272
 
126177
- this._visible = false;
126178
-
126179
- let ignoreNextSectionPlaneDirUpdate = false;
126180
-
126181
126273
  // Builds the Entities that represent this Control.
126182
126274
  const NO_STATE_INHERIT = false;
126183
126275
  const arrowLength = 1.0;
@@ -126191,7 +126283,7 @@ class Control {
126191
126283
  });
126192
126284
 
126193
126285
  const pos = math.vec3();
126194
- const setPos = (function() {
126286
+ this._setPosition = (function() {
126195
126287
  const origin = math.vec3();
126196
126288
  const rtcPos = math.vec3();
126197
126289
  return function(p) {
@@ -126202,6 +126294,8 @@ class Control {
126202
126294
  };
126203
126295
  })();
126204
126296
 
126297
+ this._setQuaternion = q => { rootNode.quaternion = q; };
126298
+
126205
126299
  const arrowGeometry = (radiusBottom, height) => new ReadableGeometry(rootNode, buildCylinderGeometry({
126206
126300
  radiusTop: 0.001,
126207
126301
  radiusBottom: radiusBottom,
@@ -126289,6 +126383,7 @@ class Control {
126289
126383
  clippable: false,
126290
126384
  backfaces: true,
126291
126385
  visible: false,
126386
+ isUI: true,
126292
126387
  isObject: false
126293
126388
  }), NO_STATE_INHERIT);
126294
126389
 
@@ -126301,6 +126396,7 @@ class Control {
126301
126396
  clippable: false,
126302
126397
  backfaces: true,
126303
126398
  visible: false,
126399
+ isUI: true,
126304
126400
  isObject: false
126305
126401
  }), NO_STATE_INHERIT);
126306
126402
 
@@ -126312,6 +126408,7 @@ class Control {
126312
126408
  collidable: true,
126313
126409
  clippable: false,
126314
126410
  visible: false,
126411
+ isUI: true,
126315
126412
  isObject: false
126316
126413
  }), NO_STATE_INHERIT);
126317
126414
 
@@ -126323,6 +126420,7 @@ class Control {
126323
126420
  collidable: true,
126324
126421
  clippable: false,
126325
126422
  visible: false,
126423
+ isUI: true,
126326
126424
  isObject: false
126327
126425
  }), NO_STATE_INHERIT);
126328
126426
 
@@ -126336,6 +126434,7 @@ class Control {
126336
126434
  collidable: true,
126337
126435
  clippable: false,
126338
126436
  visible: false,
126437
+ isUI: true,
126339
126438
  isObject: false
126340
126439
  }), NO_STATE_INHERIT);
126341
126440
 
@@ -126355,6 +126454,7 @@ class Control {
126355
126454
  collidable: true,
126356
126455
  clippable: false,
126357
126456
  visible: false,
126457
+ isUI: true,
126358
126458
  isObject: false
126359
126459
  }), NO_STATE_INHERIT);
126360
126460
 
@@ -126366,6 +126466,7 @@ class Control {
126366
126466
  collidable: true,
126367
126467
  clippable: false,
126368
126468
  visible: false,
126469
+ isUI: true,
126369
126470
  isObject: false
126370
126471
  }), NO_STATE_INHERIT);
126371
126472
 
@@ -126377,6 +126478,7 @@ class Control {
126377
126478
  collidable: true,
126378
126479
  clippable: false,
126379
126480
  visible: false,
126481
+ isUI: true,
126380
126482
  isObject: false
126381
126483
  }), NO_STATE_INHERIT);
126382
126484
 
@@ -126388,6 +126490,7 @@ class Control {
126388
126490
  collidable: true,
126389
126491
  clippable: false,
126390
126492
  visible: false,
126493
+ isUI: true,
126391
126494
  isObject: false
126392
126495
  }), NO_STATE_INHERIT);
126393
126496
 
@@ -126399,6 +126502,7 @@ class Control {
126399
126502
  collidable: true,
126400
126503
  clippable: false,
126401
126504
  visible: false,
126505
+ isUI: true,
126402
126506
  isObject: false
126403
126507
  }), NO_STATE_INHERIT);
126404
126508
 
@@ -126439,9 +126543,9 @@ class Control {
126439
126543
  return closestPointOnAxis(initCanvasPos, initOffset) && math.subVec3(initOffset, pos, initOffset) && ((canvasPos) => {
126440
126544
  if (closestPointOnAxis(canvasPos, tempVec3)) {
126441
126545
  math.subVec3(tempVec3, initOffset, tempVec3);
126442
- setPos(tempVec3);
126443
- if (this._sectionPlane) {
126444
- this._sectionPlane.pos = tempVec3;
126546
+ this._setPosition(tempVec3);
126547
+ if (this._handlers) {
126548
+ this._handlers.onPosition(tempVec3);
126445
126549
  }
126446
126550
  }
126447
126551
  });
@@ -126452,9 +126556,9 @@ class Control {
126452
126556
  setActivated: a => hoop.visible = a,
126453
126557
  initDragAction: (initCanvasPos) => {
126454
126558
  const rotationFromCanvasPos = (function() {
126455
- const planeCanvasPos = camera.projectWorldPos(pos);
126559
+ const planeCanvasPos = scene.camera.projectWorldPos(pos);
126456
126560
  localToWorldVec(rgb, tempVec3);
126457
- math.transformVec3(camera.normalMatrix, tempVec3, tempVec3);
126561
+ math.transformVec3(scene.camera.normalMatrix, tempVec3, tempVec3);
126458
126562
  const axisCoeff = Math.sign(tempVec3[2]);
126459
126563
  return (canvasPos) => {
126460
126564
  const dx = canvasPos[0] - planeCanvasPos[0];
@@ -126468,101 +126572,46 @@ class Control {
126468
126572
  return canvasPos => {
126469
126573
  const rotation = rotationFromCanvasPos(canvasPos);
126470
126574
  rootNode.rotate(rgb, (rotation - lastRotation) * 180 / Math.PI);
126471
- if (this._sectionPlane) {
126472
- ignoreNextSectionPlaneDirUpdate = true;
126473
- this._sectionPlane.quaternion = rootNode.quaternion;
126575
+ if (this._handlers) {
126576
+ this._handlers.onQuaternion(rootNode.quaternion);
126474
126577
  }
126475
126578
  lastRotation = rotation;
126476
126579
  };
126477
126580
  }
126478
126581
  };
126479
126582
 
126583
+ let positionActive = false;
126584
+ let rotationActive = false;
126585
+ let visible = false;
126586
+
126587
+ const updatePositionHandle = () => {
126588
+ const v = visible && positionActive;
126589
+ arrowHandle.visible = shaftHandle.visible = arrow.visible = shaft.visible = !!v;
126590
+ if (! v) {
126591
+ bigArrowHead.visible = false;
126592
+ }
126593
+ };
126594
+ const updateRotationHandle = () => {
126595
+ const v = visible && rotationActive;
126596
+ rotateHandle.visible = curve.visible = arrow1.visible = arrow2.visible = !!v;
126597
+ if (! v) {
126598
+ hoop.visible = false;
126599
+ }
126600
+ };
126601
+
126480
126602
  return {
126603
+ setPositionActive: (a) => { positionActive = a; updatePositionHandle(); },
126604
+ setRotationActive: (a) => { rotationActive = a; updateRotationHandle(); },
126481
126605
  set visible(v) {
126482
- arrow.visible = arrowHandle.visible = shaft.visible = shaftHandle.visible = curve.visible = rotateHandle.visible = arrow1.visible = arrow2.visible = v;
126483
- if (! v) {
126484
- bigArrowHead.visible = v;
126485
- hoop.visible = v;
126486
- }
126487
- },
126488
- set culled(c) {
126489
- arrow.culled = arrowHandle.culled = shaft.culled = shaftHandle.culled = curve.culled = rotateHandle.culled = arrow1.culled = arrow2.culled = c;
126490
- if (! c) {
126491
- bigArrowHead.culled = c;
126492
- hoop.culled = c;
126493
- }
126606
+ visible = v;
126607
+ updatePositionHandle();
126608
+ updateRotationHandle();
126494
126609
  }
126495
126610
  };
126496
126611
  };
126497
126612
 
126498
- this._displayMeshes = [ // Meshes that are always visible
126499
- rootNode.addChild(new Mesh(rootNode, { // plane
126500
- geometry: new ReadableGeometry(rootNode, {
126501
- primitive: "triangles",
126502
- positions: [
126503
- 0.5, 0.5, 0.0, 0.5, -0.5, 0.0, // 0
126504
- -0.5, -0.5, 0.0, -0.5, 0.5, 0.0, // 1
126505
- 0.5, 0.5, -0.0, 0.5, -0.5, -0.0, // 2
126506
- -0.5, -0.5, -0.0, -0.5, 0.5, -0.0 // 3
126507
- ],
126508
- indices: [0, 1, 2, 2, 3, 0]
126509
- }),
126510
- material: new PhongMaterial(rootNode, {
126511
- emissive: [0, 0.0, 0],
126512
- diffuse: [0, 0, 0],
126513
- backfaces: true
126514
- }),
126515
- opacity: 0.6,
126516
- ghosted: true,
126517
- ghostMaterial: new EmphasisMaterial(rootNode, {
126518
- edges: false,
126519
- filled: true,
126520
- fillColor: [1, 1, 0],
126521
- edgeColor: [0, 0, 0],
126522
- fillAlpha: 0.1,
126523
- backfaces: true
126524
- }),
126525
- pickable: false,
126526
- collidable: true,
126527
- clippable: false,
126528
- visible: false,
126529
- scale: [2.4, 2.4, 1],
126530
- isObject: false
126531
- }), NO_STATE_INHERIT),
126532
-
126533
- rootNode.addChild(new Mesh(rootNode, { // Visible frame
126534
- geometry: new ReadableGeometry(rootNode, buildTorusGeometry({
126535
- center: [0, 0, 0],
126536
- radius: 1.7,
126537
- tube: tubeRadius * 2,
126538
- radialSegments: 4,
126539
- tubeSegments: 4,
126540
- arc: Math.PI * 2.0
126541
- })),
126542
- material: new PhongMaterial(rootNode, {
126543
- emissive: [0, 0, 0],
126544
- diffuse: [0, 0, 0],
126545
- specular: [0, 0, 0],
126546
- shininess: 0
126547
- }),
126548
- //highlighted: true,
126549
- highlightMaterial: new EmphasisMaterial(rootNode, {
126550
- edges: false,
126551
- edgeColor: [0.0, 0.0, 0.0],
126552
- filled: true,
126553
- fillColor: [0.8, 0.8, 0.8],
126554
- fillAlpha: 1.0
126555
- }),
126556
- pickable: false,
126557
- collidable: false,
126558
- clippable: false,
126559
- visible: false,
126560
- scale: [1, 1, .1],
126561
- rotation: [0, 0, 45],
126562
- isObject: false
126563
- }), NO_STATE_INHERIT),
126564
-
126565
- rootNode.addChild(new Mesh(rootNode, { // center
126613
+ this._displayMeshes = {
126614
+ center: rootNode.addChild(new Mesh(rootNode, { // center
126566
126615
  geometry: new ReadableGeometry(rootNode, buildSphereGeometry({
126567
126616
  radius: 0.05
126568
126617
  })),
@@ -126580,21 +126629,25 @@ class Control {
126580
126629
  isObject: false
126581
126630
  }), NO_STATE_INHERIT),
126582
126631
 
126583
- //----------------------------------------------------------------------------------------------------------
126584
- //
126585
- //----------------------------------------------------------------------------------------------------------
126586
-
126587
- addAxis([1,0,0], math.vec3PairToQuaternion([1,0,0], [0,0,1])),
126588
- addAxis([0,1,0], math.eulerToQuaternion([90,0,0], "XYZ")),
126589
- addAxis([0,0,1], math.identityQuaternion())
126590
- ];
126632
+ x: addAxis([1,0,0], math.vec3PairToQuaternion([1,0,0], [0,0,1])),
126633
+ y: addAxis([0,1,0], math.eulerToQuaternion([90,0,0], "XYZ")),
126634
+ z: addAxis([0,0,1], math.identityQuaternion())
126635
+ };
126591
126636
 
126592
126637
  const cleanups = [ ];
126593
126638
 
126594
126639
  { // Keep gizmo screen size constant
126595
126640
  let lastDist = -1;
126596
- const setRootNodeScale = size => { if (size !== rootNode.scale[0]) { rootNode.scale = [size, size, size]; } };
126641
+ const setRootNodeScale = size => {
126642
+ if (rootNode.scale[0] !== size) {
126643
+ rootNode.scale = [size, size, size];
126644
+ if (this._handlers && this._handlers.onScreenScale) {
126645
+ this._handlers.onScreenScale(rootNode.scale);
126646
+ }
126647
+ }
126648
+ };
126597
126649
  const onSceneTick = scene.on("tick", () => {
126650
+ const camera = scene.camera;
126598
126651
  const dist = Math.abs(math.distVec3(camera.eye, pos));
126599
126652
  if (camera.projection === "perspective") {
126600
126653
  if (dist !== lastDist) {
@@ -126619,10 +126672,10 @@ class Control {
126619
126672
  vec2[1] = event.pageY;
126620
126673
  transformToNode(canvas.ownerDocument.documentElement, canvas, vec2);
126621
126674
  };
126622
-
126623
126675
  const pickHandler = (e) => {
126624
126676
  copyCanvasPos(e, canvasPos);
126625
- const pickResult = viewer.scene.pick({ canvasPos: canvasPos });
126677
+ // This doesn't guarantee the gizmo is prioritized (as it should be) by other Scene::pick calls
126678
+ const pickResult = scene.pick({ canvasPos: canvasPos });//, includeEntities: pickIds });
126626
126679
  const pickEntity = pickResult && pickResult.entity;
126627
126680
  const pickId = pickEntity && pickEntity.id;
126628
126681
  return (pickId in handlers) && handlers[pickId];
@@ -126655,6 +126708,9 @@ class Control {
126655
126708
  }
126656
126709
  };
126657
126710
  }
126711
+ return !!dragAction;
126712
+ } else {
126713
+ return false;
126658
126714
  }
126659
126715
  };
126660
126716
 
@@ -126663,16 +126719,22 @@ class Control {
126663
126719
  cleanups.push(() => canvas.removeEventListener(type, listener));
126664
126720
  };
126665
126721
 
126666
- addCanvasEventListener("mousedown", (e) => {
126722
+ const preventDefaultStopPropagation = e => {
126667
126723
  e.preventDefault();
126668
- if (e.which === 1) {
126669
- startDrag(e, event => (event.which === 1) && event);
126724
+ e.stopPropagation();
126725
+ e.stopImmediatePropagation();
126726
+ };
126727
+
126728
+ addCanvasEventListener("mousedown", (e) => {
126729
+ if ((e.which === 1) && startDrag(e, event => (event.which === 1) && event)) {
126730
+ preventDefaultStopPropagation(e);
126670
126731
  }
126671
126732
  });
126672
126733
 
126673
126734
  addCanvasEventListener("mousemove", (e) => {
126674
126735
  if (currentDrag) {
126675
126736
  currentDrag.onChange(e);
126737
+ preventDefaultStopPropagation(e);
126676
126738
  } else {
126677
126739
  if (deactivateActive) {
126678
126740
  deactivateActive();
@@ -126691,6 +126753,9 @@ class Control {
126691
126753
  if (currentDrag) {
126692
126754
  currentDrag.onChange(e);
126693
126755
  currentDrag.cleanup();
126756
+ // Calling preventDefaultStopPropagation would interfere with cameraControl
126757
+ // by making it follow the pointer until next click
126758
+ // preventDefaultStopPropagation(e);
126694
126759
  }
126695
126760
  });
126696
126761
 
@@ -126700,115 +126765,74 @@ class Control {
126700
126765
  if (event.touches.length === 1)
126701
126766
  {
126702
126767
  const touchStartId = event.touches[0].identifier;
126703
- startDrag(event, event => [...event.changedTouches].find(e => e.identifier === touchStartId));
126768
+ if (startDrag(event, event => [...event.changedTouches].find(e => e.identifier === touchStartId))) {
126769
+ preventDefaultStopPropagation(event);
126770
+ }
126704
126771
  }
126705
126772
  });
126706
126773
 
126707
126774
  addCanvasEventListener("touchmove", event => {
126708
- event.preventDefault();
126709
- currentDrag && currentDrag.onChange(event);
126775
+ if (currentDrag) {
126776
+ currentDrag.onChange(event);
126777
+ preventDefaultStopPropagation(event);
126778
+ }
126710
126779
  });
126711
126780
 
126712
126781
  addCanvasEventListener("touchend", event => {
126713
- event.preventDefault();
126714
126782
  if (currentDrag) {
126715
126783
  currentDrag.onChange(event);
126716
126784
  currentDrag.cleanup();
126785
+ // See the comment in mouseup listener
126786
+ // preventDefaultStopPropagation(e);
126717
126787
  }
126718
126788
  });
126719
126789
  }
126720
126790
 
126721
- this._unbindSectionPlane = () => { };
126722
-
126723
- this.__setSectionPlane = sectionPlane => {
126724
- this.id = sectionPlane.id;
126725
- this._sectionPlane = sectionPlane;
126726
- const setPosFromSectionPlane = () => setPos(sectionPlane.pos);
126727
- const setDirFromSectionPlane = () => rootNode.quaternion = sectionPlane.quaternion;
126728
- setPosFromSectionPlane();
126729
- setDirFromSectionPlane();
126730
- const onSectionPlanePos = sectionPlane.on("pos", setPosFromSectionPlane);
126731
- const onSectionPlaneDir = sectionPlane.on("dir", () => {
126732
- if (!ignoreNextSectionPlaneDirUpdate) {
126733
- setDirFromSectionPlane();
126734
- } else {
126735
- ignoreNextSectionPlaneDirUpdate = false;
126736
- }
126737
- });
126738
-
126739
- this._unbindSectionPlane = () => {
126740
- this.id = null;
126741
- this._sectionPlane = null;
126742
- sectionPlane.off(onSectionPlanePos);
126743
- sectionPlane.off(onSectionPlaneDir);
126744
- this._unbindSectionPlane = () => { };
126745
- };
126746
- };
126747
-
126748
126791
  this.__destroy = () => {
126749
126792
  cleanups.forEach(c => c());
126750
- this._unbindSectionPlane();
126751
126793
  rootNode.destroy();
126752
- this._displayMeshes = [ ];
126753
126794
  for (let id in handlers) {
126754
126795
  delete handlers[id];
126755
126796
  }
126756
126797
  };
126757
126798
  }
126758
126799
 
126759
- _destroy() {
126800
+ destroy() {
126760
126801
  this.__destroy();
126761
126802
  }
126762
126803
 
126763
126804
  /**
126764
- * Called by SectionPlanesPlugin to assign this Control to a SectionPlane.
126765
- * SectionPlanesPlugin keeps SectionPlaneControls in a reuse pool.
126766
- * Call with a null or undefined value to disconnect the Control ffrom whatever SectionPlane it was assigned to.
126805
+ * Called to assign this Control to Handlers.
126806
+ * Call with a null or undefined value to disconnect the Control from whatever Handlers it was assigned to.
126767
126807
  * @private
126768
126808
  */
126769
- _setSectionPlane(sectionPlane) {
126770
- this._unbindSectionPlane();
126771
- if (sectionPlane) {
126772
- this.__setSectionPlane(sectionPlane);
126773
- }
126774
- }
126775
-
126776
- /**
126777
- * Gets the {@link SectionPlane} controlled by this Control.
126778
- * @returns {SectionPlane} The SectionPlane.
126779
- */
126780
- get sectionPlane() {
126781
- return this._sectionPlane;
126809
+ setHandlers(handlers) {
126810
+ Object.values(this._displayMeshes).forEach(m => m.visible = !!handlers);
126811
+ this._handlers = handlers;
126812
+ this._displayMeshes.x.setPositionActive(handlers && handlers.onPosition);
126813
+ this._displayMeshes.y.setPositionActive(handlers && handlers.onPosition);
126814
+ this._displayMeshes.z.setPositionActive(handlers && handlers.onPosition);
126815
+ this._displayMeshes.x.setRotationActive(handlers && handlers.onQuaternion);
126816
+ this._displayMeshes.y.setRotationActive(handlers && handlers.onQuaternion);
126817
+ this._displayMeshes.z.setRotationActive(handlers && handlers.onQuaternion);
126782
126818
  }
126783
126819
 
126784
126820
  /**
126785
- * Sets if this Control is visible.
126821
+ * Sets the World-space position of this Control.
126786
126822
  *
126787
- * @type {Boolean}
126823
+ * @param {Number[]} value New position.
126788
126824
  */
126789
- setVisible(visible = true) {
126790
- if (this._visible !== visible) {
126791
- this._visible = visible;
126792
- this._displayMeshes.forEach(m => m.visible = visible);
126793
- }
126825
+ setPosition(p) {
126826
+ this._setPosition(p);
126794
126827
  }
126795
126828
 
126796
126829
  /**
126797
- * Gets if this Control is visible.
126830
+ * Sets the quaternion of this Control.
126798
126831
  *
126799
- * @type {Boolean}
126800
- */
126801
- getVisible() {
126802
- return this._visible;
126803
- }
126804
-
126805
- /**
126806
- * Sets if this Control is culled. This is called by SectionPlanesPlugin to
126807
- * temporarily hide the Control while a snapshot is being taken by Viewer#getSnapshot().
126808
- * @param culled
126832
+ * @param {Number[]} value New quaternion.
126809
126833
  */
126810
- setCulled(culled) {
126811
- this._displayMeshes.forEach(m => m.culled = culled);
126834
+ setQuaternion(q) {
126835
+ this._setQuaternion(q);
126812
126836
  }
126813
126837
  }
126814
126838
 
@@ -127443,7 +127467,160 @@ class SectionPlanesPlugin extends Plugin {
127443
127467
  }
127444
127468
 
127445
127469
  _sectionPlaneCreated(sectionPlane) {
127446
- const control = (this._freeControls.length > 0) ? this._freeControls.pop() : new Control(this);
127470
+ const control = ((this._freeControls.length > 0)
127471
+ ? this._freeControls.pop()
127472
+ : (() => {
127473
+ const scene = this.viewer.scene;
127474
+ const planeRoot = (function() {
127475
+ const rootNode = new Node$1(scene, { isObject: false });
127476
+
127477
+ rootNode.addChild(new Mesh(rootNode, { // plane
127478
+ geometry: new ReadableGeometry(rootNode, {
127479
+ primitive: "triangles",
127480
+ positions: [
127481
+ 0.5, 0.5, 0.0, 0.5, -0.5, 0.0, // 0
127482
+ -0.5, -0.5, 0.0, -0.5, 0.5, 0.0, // 1
127483
+ 0.5, 0.5, -0.0, 0.5, -0.5, -0.0, // 2
127484
+ -0.5, -0.5, -0.0, -0.5, 0.5, -0.0 // 3
127485
+ ],
127486
+ indices: [0, 1, 2, 2, 3, 0]
127487
+ }),
127488
+ material: new PhongMaterial(rootNode, {
127489
+ emissive: [0, 0.0, 0],
127490
+ diffuse: [0, 0, 0],
127491
+ backfaces: true
127492
+ }),
127493
+ opacity: 0.6,
127494
+ ghosted: true,
127495
+ ghostMaterial: new EmphasisMaterial(rootNode, {
127496
+ edges: false,
127497
+ filled: true,
127498
+ fillColor: [1, 1, 0],
127499
+ edgeColor: [0, 0, 0],
127500
+ fillAlpha: 0.1,
127501
+ backfaces: true
127502
+ }),
127503
+ pickable: false,
127504
+ collidable: true,
127505
+ clippable: false,
127506
+ visible: false,
127507
+ scale: [2.4, 2.4, 1],
127508
+ isObject: false
127509
+ }));
127510
+
127511
+ rootNode.addChild(new Mesh(rootNode, { // Visible frame
127512
+ geometry: new ReadableGeometry(rootNode, buildTorusGeometry({
127513
+ center: [0, 0, 0],
127514
+ radius: 1.7,
127515
+ tube: 0.02,
127516
+ radialSegments: 4,
127517
+ tubeSegments: 4,
127518
+ arc: Math.PI * 2.0
127519
+ })),
127520
+ material: new PhongMaterial(rootNode, {
127521
+ emissive: [0, 0, 0],
127522
+ diffuse: [0, 0, 0],
127523
+ specular: [0, 0, 0],
127524
+ shininess: 0
127525
+ }),
127526
+ //highlighted: true,
127527
+ highlightMaterial: new EmphasisMaterial(rootNode, {
127528
+ edges: false,
127529
+ edgeColor: [0.0, 0.0, 0.0],
127530
+ filled: true,
127531
+ fillColor: [0.8, 0.8, 0.8],
127532
+ fillAlpha: 1.0
127533
+ }),
127534
+ pickable: false,
127535
+ collidable: false,
127536
+ clippable: false,
127537
+ visible: false,
127538
+ scale: [1, 1, .1],
127539
+ rotation: [0, 0, 45],
127540
+ isObject: false
127541
+ }));
127542
+
127543
+ return {
127544
+ setPosition: (function() {
127545
+ const origin = math.vec3();
127546
+ const rtcPos = math.vec3();
127547
+ return function(p) {
127548
+ worldToRTCPos(p, origin, rtcPos);
127549
+ rootNode.origin = origin;
127550
+ rootNode.position = rtcPos;
127551
+ };
127552
+ })(),
127553
+ setQuaternion: q => { rootNode.quaternion = q; },
127554
+ setScale: s => { rootNode.scale = s; },
127555
+ setVisible: v => { rootNode.visible = v; }
127556
+ };
127557
+ })();
127558
+ let unbindSectionPlane = () => { };
127559
+ const ctrl = new TransformControl(this.viewer);
127560
+
127561
+ let culled = false;
127562
+ let visible = false;
127563
+ let handlers = null;
127564
+ const updateVisible = () => {
127565
+ const vis = visible && (! culled);
127566
+ planeRoot.setVisible(vis);
127567
+ ctrl.setHandlers(vis && handlers);
127568
+ };
127569
+
127570
+ return {
127571
+ _destroy: () => {
127572
+ unbindSectionPlane();
127573
+ ctrl.destroy();
127574
+ },
127575
+ setCulled: c => { culled = c; updateVisible(); },
127576
+ setVisible: v => { visible = v; updateVisible(); },
127577
+ _setSectionPlane: sectionPlane => {
127578
+ unbindSectionPlane();
127579
+ if (sectionPlane) {
127580
+ let ignoreNextSectionPlaneDirUpdate = false;
127581
+ handlers = {
127582
+ onPosition: p => {
127583
+ planeRoot.setPosition(p);
127584
+ sectionPlane.pos = p;
127585
+ },
127586
+ onQuaternion: q => {
127587
+ planeRoot.setQuaternion(q);
127588
+ ignoreNextSectionPlaneDirUpdate = true;
127589
+ sectionPlane.quaternion = q;
127590
+ },
127591
+ onScreenScale: s => {
127592
+ planeRoot.setScale(s);
127593
+ }
127594
+ };
127595
+
127596
+ const setPosFromSectionPlane = () => {
127597
+ planeRoot.setPosition(sectionPlane.pos);
127598
+ ctrl.setPosition(sectionPlane.pos);
127599
+ };
127600
+ const setDirFromSectionPlane = () => {
127601
+ planeRoot.setQuaternion(sectionPlane.quaternion);
127602
+ ctrl.setQuaternion(sectionPlane.quaternion);
127603
+ };
127604
+ setPosFromSectionPlane();
127605
+ setDirFromSectionPlane();
127606
+ const onSectionPlanePos = sectionPlane.on("pos", setPosFromSectionPlane);
127607
+ const onSectionPlaneDir = sectionPlane.on("dir", () => {
127608
+ if (!ignoreNextSectionPlaneDirUpdate) {
127609
+ setDirFromSectionPlane();
127610
+ } else {
127611
+ ignoreNextSectionPlaneDirUpdate = false;
127612
+ }
127613
+ });
127614
+
127615
+ unbindSectionPlane = () => {
127616
+ sectionPlane.off(onSectionPlanePos);
127617
+ sectionPlane.off(onSectionPlaneDir);
127618
+ unbindSectionPlane = () => { };
127619
+ };
127620
+ }
127621
+ }
127622
+ };
127623
+ })());
127447
127624
  control._setSectionPlane(sectionPlane);
127448
127625
  control.setVisible(false);
127449
127626
  this._controls[sectionPlane.id] = control;
@@ -142876,8 +143053,8 @@ class WebIFCLoaderPlugin extends Plugin {
142876
143053
  }
142877
143054
  }
142878
143055
 
142879
- const name = "@creooxag/cx-converter";
142880
- const version = "0.0.12-alpha";
143056
+ const name = "@creooxag/cxconverter";
143057
+ const version = "0.0.3-alpha";
142881
143058
  const description = "";
142882
143059
  const exports$1 = {
142883
143060
  ".": {
@@ -142953,8 +143130,7 @@ var __publicField$2 = (obj, key, value) => {
142953
143130
  __defNormalProp$2(obj, typeof key !== "symbol" ? key + "" : key, value);
142954
143131
  return value;
142955
143132
  };
142956
- var IfcDbWasm = (() => {
142957
- var _scriptName = typeof document === "undefined" ? "" : document.currentScript.src;
143133
+ var IfcDbWasm = /* @__PURE__ */ (() => {
142958
143134
  return async function(moduleArg = {}) {
142959
143135
  var moduleRtn;
142960
143136
  var Module = moduleArg;
@@ -142963,12 +143139,12 @@ var IfcDbWasm = (() => {
142963
143139
  readyPromiseResolve = resolve;
142964
143140
  readyPromiseReject = reject;
142965
143141
  });
142966
- var moduleOverrides = Object.assign({}, Module);
142967
143142
  var arguments_ = [];
142968
143143
  var thisProgram = "./this.program";
142969
143144
  var quit_ = (status, toThrow) => {
142970
143145
  throw toThrow;
142971
143146
  };
143147
+ var _scriptName = import.meta.url;
142972
143148
  var scriptDirectory = "";
142973
143149
  function locateFile(path) {
142974
143150
  if (Module["locateFile"]) {
@@ -142978,16 +143154,9 @@ var IfcDbWasm = (() => {
142978
143154
  }
142979
143155
  var readAsync, readBinary;
142980
143156
  {
142981
- if (typeof document != "undefined" && document.currentScript) {
142982
- scriptDirectory = document.currentScript.src;
142983
- }
142984
- if (_scriptName) {
142985
- scriptDirectory = _scriptName;
142986
- }
142987
- if (scriptDirectory.startsWith("blob:")) {
142988
- scriptDirectory = "";
142989
- } else {
142990
- scriptDirectory = scriptDirectory.slice(0, scriptDirectory.replace(/[?#].*/, "").lastIndexOf("/") + 1);
143157
+ try {
143158
+ scriptDirectory = new URL(".", _scriptName).href;
143159
+ } catch {
142991
143160
  }
142992
143161
  {
142993
143162
  readAsync = async (url) => {
@@ -142999,31 +143168,25 @@ var IfcDbWasm = (() => {
142999
143168
  };
143000
143169
  }
143001
143170
  }
143002
- var out = Module["print"] || console.log.bind(console);
143003
- var err = Module["printErr"] || console.error.bind(console);
143004
- Object.assign(Module, moduleOverrides);
143005
- moduleOverrides = null;
143006
- if (Module["arguments"])
143007
- arguments_ = Module["arguments"];
143008
- if (Module["thisProgram"])
143009
- thisProgram = Module["thisProgram"];
143010
- var wasmBinary = Module["wasmBinary"];
143171
+ var out = console.log.bind(console);
143172
+ var err = console.error.bind(console);
143173
+ var wasmBinary;
143011
143174
  var wasmMemory;
143012
143175
  var ABORT = false;
143013
143176
  var EXITSTATUS;
143014
143177
  var HEAP8, HEAPU8, HEAP16, HEAPU16, HEAP32, HEAPU32, HEAPF32, HEAP64, HEAPU64, HEAPF64;
143015
143178
  function updateMemoryViews() {
143016
143179
  var b = wasmMemory.buffer;
143017
- Module["HEAP8"] = HEAP8 = new Int8Array(b);
143018
- Module["HEAP16"] = HEAP16 = new Int16Array(b);
143019
- Module["HEAPU8"] = HEAPU8 = new Uint8Array(b);
143020
- Module["HEAPU16"] = HEAPU16 = new Uint16Array(b);
143021
- Module["HEAP32"] = HEAP32 = new Int32Array(b);
143022
- Module["HEAPU32"] = HEAPU32 = new Uint32Array(b);
143023
- Module["HEAPF32"] = HEAPF32 = new Float32Array(b);
143024
- Module["HEAPF64"] = HEAPF64 = new Float64Array(b);
143025
- Module["HEAP64"] = HEAP64 = new BigInt64Array(b);
143026
- Module["HEAPU64"] = HEAPU64 = new BigUint64Array(b);
143180
+ HEAP8 = new Int8Array(b);
143181
+ HEAP16 = new Int16Array(b);
143182
+ HEAPU8 = new Uint8Array(b);
143183
+ HEAPU16 = new Uint16Array(b);
143184
+ HEAP32 = new Int32Array(b);
143185
+ HEAPU32 = new Uint32Array(b);
143186
+ HEAPF32 = new Float32Array(b);
143187
+ HEAPF64 = new Float64Array(b);
143188
+ HEAP64 = new BigInt64Array(b);
143189
+ HEAPU64 = new BigUint64Array(b);
143027
143190
  }
143028
143191
  function preRun() {
143029
143192
  if (Module["preRun"]) {
@@ -143083,7 +143246,7 @@ var IfcDbWasm = (() => {
143083
143246
  if (Module["locateFile"]) {
143084
143247
  return locateFile("ifcdb.wasm");
143085
143248
  }
143086
- return new URL("ifcdb.wasm", typeof document === "undefined" ? "" : document.currentScript.src).href;
143249
+ return new URL("ifcdb.wasm", import.meta.url).href;
143087
143250
  }
143088
143251
  function getBinarySync(file) {
143089
143252
  if (file == wasmBinaryFile && wasmBinary) {
@@ -143133,7 +143296,6 @@ var IfcDbWasm = (() => {
143133
143296
  wasmExports = Asyncify.instrumentWasmExports(wasmExports);
143134
143297
  wasmMemory = wasmExports["U"];
143135
143298
  updateMemoryViews();
143136
- wasmExports["X"];
143137
143299
  removeRunDependency();
143138
143300
  return wasmExports;
143139
143301
  }
@@ -143145,8 +143307,7 @@ var IfcDbWasm = (() => {
143145
143307
  if (Module["instantiateWasm"]) {
143146
143308
  return new Promise((resolve, reject) => {
143147
143309
  Module["instantiateWasm"](info, (mod, inst) => {
143148
- receiveInstance(mod);
143149
- resolve(mod.exports);
143310
+ resolve(receiveInstance(mod));
143150
143311
  });
143151
143312
  });
143152
143313
  }
@@ -143160,9 +143321,6 @@ var IfcDbWasm = (() => {
143160
143321
  return Promise.reject(e);
143161
143322
  }
143162
143323
  }
143163
- var ASM_CONSTS = { 191520: () => {
143164
- console.error("progress callback is not set.");
143165
- } };
143166
143324
  class ExitStatus {
143167
143325
  constructor(status) {
143168
143326
  __publicField$2(this, "name", "ExitStatus");
@@ -143176,10 +143334,22 @@ var IfcDbWasm = (() => {
143176
143334
  }
143177
143335
  };
143178
143336
  var onPostRuns = [];
143179
- var addOnPostRun = (cb) => onPostRuns.unshift(cb);
143337
+ var addOnPostRun = (cb) => onPostRuns.push(cb);
143180
143338
  var onPreRuns = [];
143181
- var addOnPreRun = (cb) => onPreRuns.unshift(cb);
143182
- var noExitRuntime = Module["noExitRuntime"] || true;
143339
+ var addOnPreRun = (cb) => onPreRuns.push(cb);
143340
+ var dynCallLegacy = (sig, ptr, args) => {
143341
+ sig = sig.replace(/p/g, "i");
143342
+ var f = Module["dynCall_" + sig];
143343
+ return f(ptr, ...args);
143344
+ };
143345
+ var dynCall = (sig, ptr, args = [], promising = false) => {
143346
+ var rtn = dynCallLegacy(sig, ptr, args);
143347
+ function convert(rtn2) {
143348
+ return rtn2;
143349
+ }
143350
+ return convert(rtn);
143351
+ };
143352
+ var noExitRuntime = true;
143183
143353
  class ExceptionInfo {
143184
143354
  constructor(excPtr) {
143185
143355
  this.excPtr = excPtr;
@@ -143538,7 +143708,6 @@ var IfcDbWasm = (() => {
143538
143708
  tty.output = [];
143539
143709
  }
143540
143710
  } } };
143541
- var alignMemory = (size, alignment) => Math.ceil(size / alignment) * alignment;
143542
143711
  var mmapAlloc = (size) => {
143543
143712
  abort();
143544
143713
  };
@@ -143548,7 +143717,7 @@ var IfcDbWasm = (() => {
143548
143717
  if (FS.isBlkdev(mode) || FS.isFIFO(mode)) {
143549
143718
  throw new FS.ErrnoError(63);
143550
143719
  }
143551
- MEMFS.ops_table || (MEMFS.ops_table = { dir: { node: { getattr: MEMFS.node_ops.getattr, setattr: MEMFS.node_ops.setattr, lookup: MEMFS.node_ops.lookup, mknod: MEMFS.node_ops.mknod, rename: MEMFS.node_ops.rename, unlink: MEMFS.node_ops.unlink, rmdir: MEMFS.node_ops.rmdir, readdir: MEMFS.node_ops.readdir, symlink: MEMFS.node_ops.symlink }, stream: { llseek: MEMFS.stream_ops.llseek } }, file: { node: { getattr: MEMFS.node_ops.getattr, setattr: MEMFS.node_ops.setattr }, stream: { llseek: MEMFS.stream_ops.llseek, read: MEMFS.stream_ops.read, write: MEMFS.stream_ops.write, allocate: MEMFS.stream_ops.allocate, mmap: MEMFS.stream_ops.mmap, msync: MEMFS.stream_ops.msync } }, link: { node: { getattr: MEMFS.node_ops.getattr, setattr: MEMFS.node_ops.setattr, readlink: MEMFS.node_ops.readlink }, stream: {} }, chrdev: { node: { getattr: MEMFS.node_ops.getattr, setattr: MEMFS.node_ops.setattr }, stream: FS.chrdev_stream_ops } });
143720
+ MEMFS.ops_table || (MEMFS.ops_table = { dir: { node: { getattr: MEMFS.node_ops.getattr, setattr: MEMFS.node_ops.setattr, lookup: MEMFS.node_ops.lookup, mknod: MEMFS.node_ops.mknod, rename: MEMFS.node_ops.rename, unlink: MEMFS.node_ops.unlink, rmdir: MEMFS.node_ops.rmdir, readdir: MEMFS.node_ops.readdir, symlink: MEMFS.node_ops.symlink }, stream: { llseek: MEMFS.stream_ops.llseek } }, file: { node: { getattr: MEMFS.node_ops.getattr, setattr: MEMFS.node_ops.setattr }, stream: { llseek: MEMFS.stream_ops.llseek, read: MEMFS.stream_ops.read, write: MEMFS.stream_ops.write, mmap: MEMFS.stream_ops.mmap, msync: MEMFS.stream_ops.msync } }, link: { node: { getattr: MEMFS.node_ops.getattr, setattr: MEMFS.node_ops.setattr, readlink: MEMFS.node_ops.readlink }, stream: {} }, chrdev: { node: { getattr: MEMFS.node_ops.getattr, setattr: MEMFS.node_ops.setattr }, stream: FS.chrdev_stream_ops } });
143552
143721
  var node = FS.createNode(parent, name, mode, dev);
143553
143722
  if (FS.isDir(node.mode)) {
143554
143723
  node.node_ops = MEMFS.ops_table.dir.node;
@@ -143737,9 +143906,6 @@ var IfcDbWasm = (() => {
143737
143906
  throw new FS.ErrnoError(28);
143738
143907
  }
143739
143908
  return position;
143740
- }, allocate(stream, offset, length) {
143741
- MEMFS.expandFileStorage(stream.node, offset + length);
143742
- stream.node.usedBytes = Math.max(stream.node.usedBytes, offset + length);
143743
143909
  }, mmap(stream, length, position, prot, flags) {
143744
143910
  if (!FS.isFile(stream.node.mode)) {
143745
143911
  throw new FS.ErrnoError(43);
@@ -143777,10 +143943,8 @@ var IfcDbWasm = (() => {
143777
143943
  return new Uint8Array(arrayBuffer);
143778
143944
  };
143779
143945
  asyncLoad.isAsync = true;
143780
- var FS_createDataFile = (parent, name, fileData, canRead, canWrite, canOwn) => {
143781
- FS.createDataFile(parent, name, fileData, canRead, canWrite, canOwn);
143782
- };
143783
- var preloadPlugins = Module["preloadPlugins"] || [];
143946
+ var FS_createDataFile = (...args) => FS.createDataFile(...args);
143947
+ var preloadPlugins = [];
143784
143948
  var FS_handledByPreloadPlugin = (byteArray, fullname, finish, onerror) => {
143785
143949
  if (typeof Browser != "undefined")
143786
143950
  Browser.init();
@@ -143837,12 +144001,12 @@ var IfcDbWasm = (() => {
143837
144001
  mode |= 146;
143838
144002
  return mode;
143839
144003
  };
143840
- var FS = { root: null, mounts: [], devices: {}, streams: [], nextInode: 1, nameTable: null, currentPath: "/", initialized: false, ignorePermissions: true, ErrnoError: class {
144004
+ var FS = { root: null, mounts: [], devices: {}, streams: [], nextInode: 1, nameTable: null, currentPath: "/", initialized: false, ignorePermissions: true, filesystems: null, syncFSRequests: 0, readFiles: {}, ErrnoError: class {
143841
144005
  constructor(errno) {
143842
144006
  __publicField$2(this, "name", "ErrnoError");
143843
144007
  this.errno = errno;
143844
144008
  }
143845
- }, filesystems: null, syncFSRequests: 0, readFiles: {}, FSStream: class {
144009
+ }, FSStream: class {
143846
144010
  constructor() {
143847
144011
  __publicField$2(this, "shared", {});
143848
144012
  }
@@ -143932,7 +144096,12 @@ var IfcDbWasm = (() => {
143932
144096
  }
143933
144097
  if (parts[i] === "..") {
143934
144098
  current_path = PATH.dirname(current_path);
143935
- current = current.parent;
144099
+ if (FS.isRoot(current)) {
144100
+ path = current_path + "/" + parts.slice(i + 1).join("/");
144101
+ continue linkloop;
144102
+ } else {
144103
+ current = current.parent;
144104
+ }
143936
144105
  continue;
143937
144106
  }
143938
144107
  current_path = PATH.join2(current_path, parts[i]);
@@ -144288,10 +144457,12 @@ var IfcDbWasm = (() => {
144288
144457
  }, mkdirTree(path, mode) {
144289
144458
  var dirs = path.split("/");
144290
144459
  var d = "";
144291
- for (var i = 0; i < dirs.length; ++i) {
144292
- if (!dirs[i])
144460
+ for (var dir of dirs) {
144461
+ if (!dir)
144293
144462
  continue;
144294
- d += "/" + dirs[i];
144463
+ if (d || PATH.isAbs(path))
144464
+ d += "/";
144465
+ d += dir;
144295
144466
  try {
144296
144467
  FS.mkdir(d, mode);
144297
144468
  } catch (e) {
@@ -144671,23 +144842,6 @@ var IfcDbWasm = (() => {
144671
144842
  if (!seeking)
144672
144843
  stream.position += bytesWritten;
144673
144844
  return bytesWritten;
144674
- }, allocate(stream, offset, length) {
144675
- if (FS.isClosed(stream)) {
144676
- throw new FS.ErrnoError(8);
144677
- }
144678
- if (offset < 0 || length <= 0) {
144679
- throw new FS.ErrnoError(28);
144680
- }
144681
- if ((stream.flags & 2097155) === 0) {
144682
- throw new FS.ErrnoError(8);
144683
- }
144684
- if (!FS.isFile(stream.node.mode) && !FS.isDir(stream.node.mode)) {
144685
- throw new FS.ErrnoError(43);
144686
- }
144687
- if (!stream.stream_ops.allocate) {
144688
- throw new FS.ErrnoError(138);
144689
- }
144690
- stream.stream_ops.allocate(stream, offset, length);
144691
144845
  }, mmap(stream, length, position, prot, flags) {
144692
144846
  if ((prot & 2) !== 0 && (flags & 2) === 0 && (stream.flags & 2097155) !== 2) {
144693
144847
  throw new FS.ErrnoError(2);
@@ -144833,12 +144987,10 @@ var IfcDbWasm = (() => {
144833
144987
  FS.createStandardStreams(input, output, error);
144834
144988
  }, quit() {
144835
144989
  FS.initialized = false;
144836
- for (var i = 0; i < FS.streams.length; i++) {
144837
- var stream = FS.streams[i];
144838
- if (!stream) {
144839
- continue;
144990
+ for (var stream of FS.streams) {
144991
+ if (stream) {
144992
+ FS.close(stream);
144840
144993
  }
144841
- FS.close(stream);
144842
144994
  }
144843
144995
  }, findObject(path, dontResolveLastLink) {
144844
144996
  var ret = FS.analyzePath(path, dontResolveLastLink);
@@ -144880,6 +145032,8 @@ var IfcDbWasm = (() => {
144880
145032
  try {
144881
145033
  FS.mkdir(current);
144882
145034
  } catch (e) {
145035
+ if (e.errno != 20)
145036
+ throw e;
144883
145037
  }
144884
145038
  parent = current;
144885
145039
  }
@@ -145375,12 +145529,12 @@ var IfcDbWasm = (() => {
145375
145529
  try {
145376
145530
  path = SYSCALLS.getStr(path);
145377
145531
  path = SYSCALLS.calculateAt(dirfd, path);
145378
- if (flags === 0) {
145532
+ if (!flags) {
145379
145533
  FS.unlink(path);
145380
145534
  } else if (flags === 512) {
145381
145535
  FS.rmdir(path);
145382
145536
  } else {
145383
- abort("Invalid flags passed to unlinkat");
145537
+ return -28;
145384
145538
  }
145385
145539
  return 0;
145386
145540
  } catch (e) {
@@ -145404,7 +145558,12 @@ var IfcDbWasm = (() => {
145404
145558
  var awaitingDependencies = {};
145405
145559
  var registeredTypes = {};
145406
145560
  var typeDependencies = {};
145407
- var InternalError;
145561
+ var InternalError = class InternalError extends Error {
145562
+ constructor(message) {
145563
+ super(message);
145564
+ this.name = "InternalError";
145565
+ }
145566
+ };
145408
145567
  var throwInternalError = (message) => {
145409
145568
  throw new InternalError(message);
145410
145569
  };
@@ -145455,6 +145614,7 @@ var IfcDbWasm = (() => {
145455
145614
  fieldRecords.forEach((field, i) => {
145456
145615
  var fieldName = field.fieldName;
145457
145616
  var getterReturnType = fieldTypes2[i];
145617
+ var optional = fieldTypes2[i].optional;
145458
145618
  var getter = field.getter;
145459
145619
  var getterContext = field.getterContext;
145460
145620
  var setterArgumentType = fieldTypes2[i + fieldRecords.length];
@@ -145464,7 +145624,7 @@ var IfcDbWasm = (() => {
145464
145624
  var destructors = [];
145465
145625
  setter(setterContext, ptr, setterArgumentType["toWireType"](destructors, o));
145466
145626
  runDestructors(destructors);
145467
- } };
145627
+ }, optional };
145468
145628
  });
145469
145629
  return [{ name: reg.name, fromWireType: (ptr) => {
145470
145630
  var rv = {};
@@ -145475,7 +145635,7 @@ var IfcDbWasm = (() => {
145475
145635
  return rv;
145476
145636
  }, toWireType: (destructors, o) => {
145477
145637
  for (var fieldName in fields) {
145478
- if (!(fieldName in o)) {
145638
+ if (!(fieldName in o) && !fields[fieldName].optional) {
145479
145639
  throw new TypeError(`Missing field: "${fieldName}"`);
145480
145640
  }
145481
145641
  }
@@ -145490,17 +145650,6 @@ var IfcDbWasm = (() => {
145490
145650
  }, argPackAdvance: GenericWireTypeSize, readValueFromPointer: readPointer, destructorFunction: rawDestructor }];
145491
145651
  });
145492
145652
  };
145493
- var embindRepr = (v) => {
145494
- if (v === null) {
145495
- return "null";
145496
- }
145497
- var t = typeof v;
145498
- if (t === "object" || t === "array" || t === "function") {
145499
- return v.toString();
145500
- } else {
145501
- return "" + v;
145502
- }
145503
- };
145504
145653
  var embind_init_charCodes = () => {
145505
145654
  var codes = new Array(256);
145506
145655
  for (var i = 0; i < 256; ++i) {
@@ -145517,7 +145666,12 @@ var IfcDbWasm = (() => {
145517
145666
  }
145518
145667
  return ret;
145519
145668
  };
145520
- var BindingError;
145669
+ var BindingError = class BindingError extends Error {
145670
+ constructor(message) {
145671
+ super(message);
145672
+ this.name = "BindingError";
145673
+ }
145674
+ };
145521
145675
  var throwBindingError = (message) => {
145522
145676
  throw new BindingError(message);
145523
145677
  };
@@ -145560,11 +145714,14 @@ var IfcDbWasm = (() => {
145560
145714
  };
145561
145715
  var __embind_register_bigint = (primitiveType, name, size, minRange, maxRange) => {
145562
145716
  name = readLatin1String(name);
145563
- var isUnsignedType = name.indexOf("u") != -1;
145564
- registerType(primitiveType, { name, fromWireType: (value) => value, toWireType: function(destructors, value) {
145565
- if (typeof value != "bigint" && typeof value != "number") {
145566
- throw new TypeError(`Cannot convert "${embindRepr(value)}" to ${this.name}`);
145567
- }
145717
+ const isUnsignedType = minRange === 0n;
145718
+ let fromWireType = (value) => value;
145719
+ if (isUnsignedType) {
145720
+ const bitSize = size * 8;
145721
+ fromWireType = (value) => BigInt.asUintN(bitSize, value);
145722
+ maxRange = fromWireType(maxRange);
145723
+ }
145724
+ registerType(primitiveType, { name, fromWireType, toWireType: (destructors, value) => {
145568
145725
  if (typeof value == "number") {
145569
145726
  value = BigInt(value);
145570
145727
  }
@@ -145583,21 +145740,16 @@ var IfcDbWasm = (() => {
145583
145740
  }, destructorFunction: null });
145584
145741
  };
145585
145742
  var emval_freelist = [];
145586
- var emval_handles = [];
145743
+ var emval_handles = [0, 1, , 1, null, 1, true, 1, false, 1];
145587
145744
  var __emval_decref = (handle) => {
145588
145745
  if (handle > 9 && 0 === --emval_handles[handle + 1]) {
145589
145746
  emval_handles[handle] = void 0;
145590
145747
  emval_freelist.push(handle);
145591
145748
  }
145592
145749
  };
145593
- var count_emval_handles = () => emval_handles.length / 2 - 5 - emval_freelist.length;
145594
- var init_emval = () => {
145595
- emval_handles.push(0, 1, void 0, 1, null, 1, true, 1, false, 1);
145596
- Module["count_emval_handles"] = count_emval_handles;
145597
- };
145598
145750
  var Emval = { toValue: (handle) => {
145599
145751
  if (!handle) {
145600
- throwBindingError("Cannot use deleted val. handle = " + handle);
145752
+ throwBindingError(`Cannot use deleted val. handle = ${handle}`);
145601
145753
  }
145602
145754
  return emval_handles[handle];
145603
145755
  }, toHandle: (value) => {
@@ -145642,7 +145794,7 @@ var IfcDbWasm = (() => {
145642
145794
  name = readLatin1String(name);
145643
145795
  registerType(rawType, { name, fromWireType: (value) => value, toWireType: (destructors, value) => value, argPackAdvance: GenericWireTypeSize, readValueFromPointer: floatReadValueFromPointer(name, size), destructorFunction: null });
145644
145796
  };
145645
- var createNamedFunction = (name, body) => Object.defineProperty(body, "name", { value: name });
145797
+ var createNamedFunction = (name, func) => Object.defineProperty(func, "name", { value: name });
145646
145798
  function usesDestructorStack(argTypes) {
145647
145799
  for (var i = 1; i < argTypes.length; ++i) {
145648
145800
  if (argTypes[i] !== null && argTypes[i].destructorFunction === void 0) {
@@ -145651,17 +145803,6 @@ var IfcDbWasm = (() => {
145651
145803
  }
145652
145804
  return false;
145653
145805
  }
145654
- function newFunc(constructor, argumentList) {
145655
- if (!(constructor instanceof Function)) {
145656
- throw new TypeError(`new_ called with constructor type ${typeof constructor} which is not a function`);
145657
- }
145658
- var dummy = createNamedFunction(constructor.name || "unknownFunctionName", function() {
145659
- });
145660
- dummy.prototype = constructor.prototype;
145661
- var obj = new dummy();
145662
- var r = constructor.apply(obj, argumentList);
145663
- return r instanceof Object ? r : obj;
145664
- }
145665
145806
  function createJsInvoker(argTypes, isClassMethodFunc, returns, isAsync) {
145666
145807
  var needsDestructorStack = usesDestructorStack(argTypes);
145667
145808
  var argCount = argTypes.length - 2;
@@ -145895,11 +146036,9 @@ var IfcDbWasm = (() => {
145895
146036
  abort(`invalid state: ${Asyncify.state}`);
145896
146037
  }
145897
146038
  return Asyncify.handleSleepReturnValue;
145898
- }, handleAsync(startAsync) {
145899
- return Asyncify.handleSleep((wakeUp) => {
145900
- startAsync().then(wakeUp);
145901
- });
145902
- } };
146039
+ }, handleAsync: (startAsync) => Asyncify.handleSleep((wakeUp) => {
146040
+ startAsync().then(wakeUp);
146041
+ }) };
145903
146042
  function craftInvokerFunction(humanName, argTypes, classType, cppInvokerFunc, cppTargetFunc, isAsync) {
145904
146043
  var argCount = argTypes.length;
145905
146044
  if (argCount < 2) {
@@ -145921,8 +146060,7 @@ var IfcDbWasm = (() => {
145921
146060
  }
145922
146061
  }
145923
146062
  let [args, invokerFnBody] = createJsInvoker(argTypes, isClassMethodFunc, returns, isAsync);
145924
- args.push(invokerFnBody);
145925
- var invokerFn = newFunc(Function, args)(...closureArgs);
146063
+ var invokerFn = new Function(...args, invokerFnBody)(...closureArgs);
145926
146064
  return createNamedFunction(humanName, invokerFn);
145927
146065
  }
145928
146066
  var ensureOverloadTable = (proto, methodName, humanName) => {
@@ -145971,17 +146109,8 @@ var IfcDbWasm = (() => {
145971
146109
  Module[name].argCount = numArguments;
145972
146110
  }
145973
146111
  };
145974
- var dynCallLegacy = (sig, ptr, args) => {
145975
- sig = sig.replace(/p/g, "i");
145976
- var f = Module["dynCall_" + sig];
145977
- return f(ptr, ...args);
145978
- };
145979
- var dynCall = (sig, ptr, args = []) => {
145980
- var rtn = dynCallLegacy(sig, ptr, args);
145981
- return rtn;
145982
- };
145983
- var getDynCaller = (sig, ptr) => (...args) => dynCall(sig, ptr, args);
145984
- var embind__requireFunction = (signature, rawFunction) => {
146112
+ var getDynCaller = (sig, ptr, promising = false) => (...args) => dynCall(sig, ptr, args, promising);
146113
+ var embind__requireFunction = (signature, rawFunction, isAsync = false) => {
145985
146114
  signature = readLatin1String(signature);
145986
146115
  function makeDynCaller() {
145987
146116
  return getDynCaller(signature, rawFunction);
@@ -145992,27 +146121,8 @@ var IfcDbWasm = (() => {
145992
146121
  }
145993
146122
  return fp;
145994
146123
  };
145995
- var extendError = (baseErrorType, errorName) => {
145996
- var errorClass = createNamedFunction(errorName, function(message) {
145997
- this.name = errorName;
145998
- this.message = message;
145999
- var stack = new Error(message).stack;
146000
- if (stack !== void 0) {
146001
- this.stack = this.toString() + "\n" + stack.replace(/^Error(:[^\n]*)?\n/, "");
146002
- }
146003
- });
146004
- errorClass.prototype = Object.create(baseErrorType.prototype);
146005
- errorClass.prototype.constructor = errorClass;
146006
- errorClass.prototype.toString = function() {
146007
- if (this.message === void 0) {
146008
- return this.name;
146009
- } else {
146010
- return `${this.name}: ${this.message}`;
146011
- }
146012
- };
146013
- return errorClass;
146014
- };
146015
- var UnboundTypeError;
146124
+ class UnboundTypeError extends Error {
146125
+ }
146016
146126
  var getTypeName = (type) => {
146017
146127
  var ptr = ___getTypeName(type);
146018
146128
  var rv = readLatin1String(ptr);
@@ -146050,7 +146160,7 @@ var IfcDbWasm = (() => {
146050
146160
  var argTypes = heap32VectorToArray(argCount, rawArgTypesAddr);
146051
146161
  name = readLatin1String(name);
146052
146162
  name = getFunctionName(name);
146053
- rawInvoker = embind__requireFunction(signature, rawInvoker);
146163
+ rawInvoker = embind__requireFunction(signature, rawInvoker, isAsync);
146054
146164
  exposePublicSymbol(name, function() {
146055
146165
  throwUnboundTypeError(`Cannot call ${name} due to unbound types`, argTypes);
146056
146166
  }, argCount - 1);
@@ -146062,27 +146172,14 @@ var IfcDbWasm = (() => {
146062
146172
  };
146063
146173
  var __embind_register_integer = (primitiveType, name, size, minRange, maxRange) => {
146064
146174
  name = readLatin1String(name);
146065
- var fromWireType = (value) => value;
146066
- if (minRange === 0) {
146175
+ const isUnsignedType = minRange === 0;
146176
+ let fromWireType = (value) => value;
146177
+ if (isUnsignedType) {
146067
146178
  var bitshift = 32 - 8 * size;
146068
146179
  fromWireType = (value) => value << bitshift >>> bitshift;
146180
+ maxRange = fromWireType(maxRange);
146069
146181
  }
146070
- var isUnsignedType = name.includes("unsigned");
146071
- var checkAssertions = (value, toTypeName) => {
146072
- };
146073
- var toWireType;
146074
- if (isUnsignedType) {
146075
- toWireType = function(destructors, value) {
146076
- checkAssertions(value, this.name);
146077
- return value >>> 0;
146078
- };
146079
- } else {
146080
- toWireType = function(destructors, value) {
146081
- checkAssertions(value, this.name);
146082
- return value;
146083
- };
146084
- }
146085
- registerType(primitiveType, { name, fromWireType, toWireType, argPackAdvance: GenericWireTypeSize, readValueFromPointer: integerReadValueFromPointer(name, size, minRange !== 0), destructorFunction: null });
146182
+ registerType(primitiveType, { name, fromWireType, toWireType: (destructors, value) => value, argPackAdvance: GenericWireTypeSize, readValueFromPointer: integerReadValueFromPointer(name, size, minRange !== 0), destructorFunction: null });
146086
146183
  };
146087
146184
  var __embind_register_memory_view = (rawType, dataTypeIndex, name) => {
146088
146185
  var typeMapping = [Int8Array, Uint8Array, Int16Array, Uint16Array, Int32Array, Uint32Array, Float32Array, Float64Array, BigInt64Array, BigUint64Array];
@@ -146127,7 +146224,7 @@ var IfcDbWasm = (() => {
146127
146224
  }
146128
146225
  var length;
146129
146226
  var valueIsOfTypeString = typeof value == "string";
146130
- if (!(valueIsOfTypeString || value instanceof Uint8Array || value instanceof Uint8ClampedArray || value instanceof Int8Array)) {
146227
+ if (!(valueIsOfTypeString || ArrayBuffer.isView(value) && value.BYTES_PER_ELEMENT == 1)) {
146131
146228
  throwBindingError("Cannot pass non-string to std::string");
146132
146229
  }
146133
146230
  if (valueIsOfTypeString) {
@@ -146139,22 +146236,11 @@ var IfcDbWasm = (() => {
146139
146236
  var ptr = base + 4;
146140
146237
  HEAPU32[base >> 2] = length;
146141
146238
  if (valueIsOfTypeString) {
146142
- stringToUTF8(value, ptr, length + 1);
146143
- } else {
146144
- if (valueIsOfTypeString) {
146145
- for (var i = 0; i < length; ++i) {
146146
- var charCode = value.charCodeAt(i);
146147
- if (charCode > 255) {
146148
- _free(base);
146149
- throwBindingError("String has UTF-16 code units that do not fit in 8 bits");
146150
- }
146151
- HEAPU8[ptr + i] = charCode;
146152
- }
146153
- } else {
146154
- for (var i = 0; i < length; ++i) {
146155
- HEAPU8[ptr + i] = value[i];
146156
- }
146239
+ {
146240
+ stringToUTF8(value, ptr, length + 1);
146157
146241
  }
146242
+ } else {
146243
+ HEAPU8.set(value, ptr);
146158
146244
  }
146159
146245
  if (destructors !== null) {
146160
146246
  destructors.push(_free, base);
@@ -146166,17 +146252,16 @@ var IfcDbWasm = (() => {
146166
146252
  };
146167
146253
  var UTF16Decoder = typeof TextDecoder != "undefined" ? new TextDecoder("utf-16le") : void 0;
146168
146254
  var UTF16ToString = (ptr, maxBytesToRead) => {
146169
- var endPtr = ptr;
146170
- var idx = endPtr >> 1;
146255
+ var idx = ptr >> 1;
146171
146256
  var maxIdx = idx + maxBytesToRead / 2;
146172
- while (!(idx >= maxIdx) && HEAPU16[idx])
146173
- ++idx;
146174
- endPtr = idx << 1;
146175
- if (endPtr - ptr > 32 && UTF16Decoder)
146176
- return UTF16Decoder.decode(HEAPU8.subarray(ptr, endPtr));
146257
+ var endIdx = idx;
146258
+ while (!(endIdx >= maxIdx) && HEAPU16[endIdx])
146259
+ ++endIdx;
146260
+ if (endIdx - idx > 16 && UTF16Decoder)
146261
+ return UTF16Decoder.decode(HEAPU16.subarray(idx, endIdx));
146177
146262
  var str = "";
146178
- for (var i = 0; !(i >= maxBytesToRead / 2); ++i) {
146179
- var codeUnit = HEAP16[ptr + i * 2 >> 1];
146263
+ for (var i = idx; !(i >= maxIdx); ++i) {
146264
+ var codeUnit = HEAPU16[i];
146180
146265
  if (codeUnit == 0)
146181
146266
  break;
146182
146267
  str += String.fromCharCode(codeUnit);
@@ -146364,7 +146449,7 @@ var IfcDbWasm = (() => {
146364
146449
  var emval_lookupTypes = (argCount, argTypes) => {
146365
146450
  var a = new Array(argCount);
146366
146451
  for (var i = 0; i < argCount; ++i) {
146367
- a[i] = requireRegisteredType(HEAPU32[argTypes + i * 4 >> 2], "parameter " + i);
146452
+ a[i] = requireRegisteredType(HEAPU32[argTypes + i * 4 >> 2], `parameter ${i}`);
146368
146453
  }
146369
146454
  return a;
146370
146455
  };
@@ -146382,8 +146467,8 @@ var IfcDbWasm = (() => {
146382
146467
  var params = ["retType"];
146383
146468
  var args = [retType];
146384
146469
  for (var i = 0; i < argCount; ++i) {
146385
- argsList.push("arg" + i);
146386
- params.push("argType" + i);
146470
+ argsList.push(`arg${i}`);
146471
+ params.push(`argType${i}`);
146387
146472
  args.push(types[i]);
146388
146473
  functionBody += ` var arg${i} = argType${i}.readValueFromPointer(args${offset ? "+" + offset : ""});
146389
146474
  `;
@@ -146398,8 +146483,7 @@ var IfcDbWasm = (() => {
146398
146483
  functionBody += " return emval_returnValue(retType, destructorsRef, rv);\n";
146399
146484
  }
146400
146485
  functionBody += "};\n";
146401
- params.push(functionBody);
146402
- var invokerFunction = newFunc(Function, params)(...args);
146486
+ var invokerFunction = new Function(...params, functionBody)(...args);
146403
146487
  var functionName = `methodCaller<(${types.map((t) => t.name).join(", ")}) => ${retType.name}>`;
146404
146488
  return emval_addMethodCaller(createNamedFunction(functionName, invokerFunction));
146405
146489
  };
@@ -146422,6 +146506,23 @@ var IfcDbWasm = (() => {
146422
146506
  var v = type["readValueFromPointer"](arg);
146423
146507
  return Emval.toHandle(v);
146424
146508
  };
146509
+ var INT53_MAX = 9007199254740992;
146510
+ var INT53_MIN = -9007199254740992;
146511
+ var bigintToI53Checked = (num) => num < INT53_MIN || num > INT53_MAX ? NaN : Number(num);
146512
+ function __gmtime_js(time, tmPtr) {
146513
+ time = bigintToI53Checked(time);
146514
+ var date = new Date(time * 1e3);
146515
+ HEAP32[tmPtr >> 2] = date.getUTCSeconds();
146516
+ HEAP32[tmPtr + 4 >> 2] = date.getUTCMinutes();
146517
+ HEAP32[tmPtr + 8 >> 2] = date.getUTCHours();
146518
+ HEAP32[tmPtr + 12 >> 2] = date.getUTCDate();
146519
+ HEAP32[tmPtr + 16 >> 2] = date.getUTCMonth();
146520
+ HEAP32[tmPtr + 20 >> 2] = date.getUTCFullYear() - 1900;
146521
+ HEAP32[tmPtr + 24 >> 2] = date.getUTCDay();
146522
+ var start = Date.UTC(date.getUTCFullYear(), 0, 1, 0, 0, 0, 0);
146523
+ var yday = (date.getTime() - start) / (1e3 * 60 * 60 * 24) | 0;
146524
+ HEAP32[tmPtr + 28 >> 2] = yday;
146525
+ }
146425
146526
  var isLeapYear = (year) => year % 4 === 0 && (year % 100 !== 0 || year % 400 === 0);
146426
146527
  var MONTH_DAYS_LEAP_CUMULATIVE = [0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335];
146427
146528
  var MONTH_DAYS_REGULAR_CUMULATIVE = [0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334];
@@ -146431,9 +146532,6 @@ var IfcDbWasm = (() => {
146431
146532
  var yday = monthDaysCumulative[date.getMonth()] + date.getDate() - 1;
146432
146533
  return yday;
146433
146534
  };
146434
- var INT53_MAX = 9007199254740992;
146435
- var INT53_MIN = -9007199254740992;
146436
- var bigintToI53Checked = (num) => num < INT53_MIN || num > INT53_MAX ? NaN : Number(num);
146437
146535
  function __localtime_js(time, tmPtr) {
146438
146536
  time = bigintToI53Checked(time);
146439
146537
  var date = new Date(time * 1e3);
@@ -146453,39 +146551,6 @@ var IfcDbWasm = (() => {
146453
146551
  var dst = (summerOffset != winterOffset && date.getTimezoneOffset() == Math.min(winterOffset, summerOffset)) | 0;
146454
146552
  HEAP32[tmPtr + 32 >> 2] = dst;
146455
146553
  }
146456
- var __mktime_js = function(tmPtr) {
146457
- var ret = (() => {
146458
- var date = new Date(HEAP32[tmPtr + 20 >> 2] + 1900, HEAP32[tmPtr + 16 >> 2], HEAP32[tmPtr + 12 >> 2], HEAP32[tmPtr + 8 >> 2], HEAP32[tmPtr + 4 >> 2], HEAP32[tmPtr >> 2], 0);
146459
- var dst = HEAP32[tmPtr + 32 >> 2];
146460
- var guessedOffset = date.getTimezoneOffset();
146461
- var start = new Date(date.getFullYear(), 0, 1);
146462
- var summerOffset = new Date(date.getFullYear(), 6, 1).getTimezoneOffset();
146463
- var winterOffset = start.getTimezoneOffset();
146464
- var dstOffset = Math.min(winterOffset, summerOffset);
146465
- if (dst < 0) {
146466
- HEAP32[tmPtr + 32 >> 2] = Number(summerOffset != winterOffset && dstOffset == guessedOffset);
146467
- } else if (dst > 0 != (dstOffset == guessedOffset)) {
146468
- var nonDstOffset = Math.max(winterOffset, summerOffset);
146469
- var trueOffset = dst > 0 ? dstOffset : nonDstOffset;
146470
- date.setTime(date.getTime() + (trueOffset - guessedOffset) * 6e4);
146471
- }
146472
- HEAP32[tmPtr + 24 >> 2] = date.getDay();
146473
- var yday = ydayFromDate(date) | 0;
146474
- HEAP32[tmPtr + 28 >> 2] = yday;
146475
- HEAP32[tmPtr >> 2] = date.getSeconds();
146476
- HEAP32[tmPtr + 4 >> 2] = date.getMinutes();
146477
- HEAP32[tmPtr + 8 >> 2] = date.getHours();
146478
- HEAP32[tmPtr + 12 >> 2] = date.getDate();
146479
- HEAP32[tmPtr + 16 >> 2] = date.getMonth();
146480
- HEAP32[tmPtr + 20 >> 2] = date.getYear();
146481
- var timeMs = date.getTime();
146482
- if (isNaN(timeMs)) {
146483
- return -1;
146484
- }
146485
- return timeMs / 1e3;
146486
- })();
146487
- return BigInt(ret);
146488
- };
146489
146554
  var __tzset_js = (timezone, daylight, std_name, dst_name) => {
146490
146555
  var currentYear = (/* @__PURE__ */ new Date()).getFullYear();
146491
146556
  var winter = new Date(currentYear, 0, 1);
@@ -146548,7 +146613,7 @@ var IfcDbWasm = (() => {
146548
146613
  };
146549
146614
  var _emscripten_asm_const_int = (code, sigPtr, argbuf) => runEmAsmFunction(code, sigPtr, argbuf);
146550
146615
  var getHeapMax = () => 2147483648;
146551
- var _emscripten_get_heap_max = () => getHeapMax();
146616
+ var alignMemory = (size, alignment) => Math.ceil(size / alignment) * alignment;
146552
146617
  var growMemory = (size) => {
146553
146618
  var b = wasmMemory.buffer;
146554
146619
  var pages = (size - b.byteLength + 65535) / 65536 | 0;
@@ -146602,27 +146667,24 @@ var IfcDbWasm = (() => {
146602
146667
  }
146603
146668
  return getEnvStrings.strings;
146604
146669
  };
146605
- var stringToAscii = (str, buffer) => {
146606
- for (var i = 0; i < str.length; ++i) {
146607
- HEAP8[buffer++] = str.charCodeAt(i);
146608
- }
146609
- HEAP8[buffer] = 0;
146610
- };
146611
146670
  var _environ_get = (__environ, environ_buf) => {
146612
146671
  var bufSize = 0;
146613
- getEnvStrings().forEach((string, i) => {
146672
+ var envp = 0;
146673
+ for (var string of getEnvStrings()) {
146614
146674
  var ptr = environ_buf + bufSize;
146615
- HEAPU32[__environ + i * 4 >> 2] = ptr;
146616
- stringToAscii(string, ptr);
146617
- bufSize += string.length + 1;
146618
- });
146675
+ HEAPU32[__environ + envp >> 2] = ptr;
146676
+ bufSize += stringToUTF8(string, ptr, Infinity) + 1;
146677
+ envp += 4;
146678
+ }
146619
146679
  return 0;
146620
146680
  };
146621
146681
  var _environ_sizes_get = (penviron_count, penviron_buf_size) => {
146622
146682
  var strings = getEnvStrings();
146623
146683
  HEAPU32[penviron_count >> 2] = strings.length;
146624
146684
  var bufSize = 0;
146625
- strings.forEach((string) => bufSize += string.length + 1);
146685
+ for (var string of strings) {
146686
+ bufSize += lengthBytesUTF8(string) + 1;
146687
+ }
146626
146688
  HEAPU32[penviron_buf_size >> 2] = bufSize;
146627
146689
  return 0;
146628
146690
  };
@@ -146637,6 +146699,26 @@ var IfcDbWasm = (() => {
146637
146699
  return e.errno;
146638
146700
  }
146639
146701
  }
146702
+ function _fd_fdstat_get(fd, pbuf) {
146703
+ try {
146704
+ var rightsBase = 0;
146705
+ var rightsInheriting = 0;
146706
+ var flags = 0;
146707
+ {
146708
+ var stream = SYSCALLS.getStreamFromFD(fd);
146709
+ var type = stream.tty ? 2 : FS.isDir(stream.mode) ? 3 : FS.isLink(stream.mode) ? 7 : 4;
146710
+ }
146711
+ HEAP8[pbuf] = type;
146712
+ HEAP16[pbuf + 2 >> 1] = flags;
146713
+ HEAP64[pbuf + 8 >> 3] = BigInt(rightsBase);
146714
+ HEAP64[pbuf + 16 >> 3] = BigInt(rightsInheriting);
146715
+ return 0;
146716
+ } catch (e) {
146717
+ if (typeof FS == "undefined" || !(e.name === "ErrnoError"))
146718
+ throw e;
146719
+ return e.errno;
146720
+ }
146721
+ }
146640
146722
  var doReadv = (stream, iov, iovcnt, offset) => {
146641
146723
  var ret = 0;
146642
146724
  for (var i = 0; i < iovcnt; i++) {
@@ -146726,61 +146808,66 @@ var IfcDbWasm = (() => {
146726
146808
  FS.staticInit();
146727
146809
  MEMFS.doesNotExistError = new FS.ErrnoError(44);
146728
146810
  MEMFS.doesNotExistError.stack = "<generic error, no stack>";
146729
- InternalError = Module["InternalError"] = class InternalError extends Error {
146730
- constructor(message) {
146731
- super(message);
146732
- this.name = "InternalError";
146733
- }
146734
- };
146735
146811
  embind_init_charCodes();
146736
- BindingError = Module["BindingError"] = class BindingError extends Error {
146737
- constructor(message) {
146738
- super(message);
146739
- this.name = "BindingError";
146740
- }
146741
- };
146742
- init_emval();
146743
- UnboundTypeError = Module["UnboundTypeError"] = extendError(Error, "UnboundTypeError");
146744
- var wasmImports = { a: ___cxa_throw, j: ___syscall_fcntl64, G: ___syscall_ioctl, H: ___syscall_openat, s: ___syscall_renameat, y: ___syscall_rmdir, v: ___syscall_stat64, z: ___syscall_unlinkat, t: __abort_js, L: __embind_finalize_value_object, m: __embind_register_bigint, R: __embind_register_bool, P: __embind_register_emval, l: __embind_register_float, f: __embind_register_function, c: __embind_register_integer, b: __embind_register_memory_view, Q: __embind_register_std_string, g: __embind_register_std_wstring, O: __embind_register_value_object, M: __embind_register_value_object_field, S: __embind_register_void, N: __emval_as, d: __emval_call, q: __emval_decref, F: __emval_get_global, e: __emval_get_method_caller, o: __emval_incref, T: __emval_is_string, n: __emval_run_destructors, p: __emval_take_value, A: __localtime_js, B: __mktime_js, C: __tzset_js, J: _clock_time_get, K: _emscripten_asm_const_int, I: _emscripten_date_now, r: _emscripten_get_heap_max, u: _emscripten_resize_heap, k: _emscripten_sleep, w: _environ_get, x: _environ_sizes_get, h: _fd_close, E: _fd_read, D: _fd_seek, i: _fd_write };
146812
+ {
146813
+ if (Module["noExitRuntime"])
146814
+ noExitRuntime = Module["noExitRuntime"];
146815
+ if (Module["preloadPlugins"])
146816
+ preloadPlugins = Module["preloadPlugins"];
146817
+ if (Module["print"])
146818
+ out = Module["print"];
146819
+ if (Module["printErr"])
146820
+ err = Module["printErr"];
146821
+ if (Module["wasmBinary"])
146822
+ wasmBinary = Module["wasmBinary"];
146823
+ if (Module["arguments"])
146824
+ arguments_ = Module["arguments"];
146825
+ if (Module["thisProgram"])
146826
+ thisProgram = Module["thisProgram"];
146827
+ }
146828
+ var ASM_CONSTS = { 1473352: () => {
146829
+ console.error("progress callback is not set.");
146830
+ } };
146831
+ var wasmImports = { a: ___cxa_throw, j: ___syscall_fcntl64, G: ___syscall_ioctl, H: ___syscall_openat, r: ___syscall_renameat, s: ___syscall_rmdir, w: ___syscall_stat64, t: ___syscall_unlinkat, u: __abort_js, L: __embind_finalize_value_object, m: __embind_register_bigint, R: __embind_register_bool, P: __embind_register_emval, l: __embind_register_float, f: __embind_register_function, c: __embind_register_integer, b: __embind_register_memory_view, Q: __embind_register_std_string, g: __embind_register_std_wstring, O: __embind_register_value_object, M: __embind_register_value_object_field, S: __embind_register_void, N: __emval_as, d: __emval_call, q: __emval_decref, F: __emval_get_global, e: __emval_get_method_caller, o: __emval_incref, T: __emval_is_string, n: __emval_run_destructors, p: __emval_take_value, x: __gmtime_js, y: __localtime_js, z: __tzset_js, J: _clock_time_get, K: _emscripten_asm_const_int, I: _emscripten_date_now, v: _emscripten_resize_heap, k: _emscripten_sleep, C: _environ_get, D: _environ_sizes_get, h: _fd_close, B: _fd_fdstat_get, E: _fd_read, A: _fd_seek, i: _fd_write };
146745
146832
  var wasmExports = await createWasm();
146746
146833
  wasmExports["V"];
146747
146834
  var ___getTypeName = wasmExports["W"];
146748
- var _malloc = wasmExports["Y"];
146749
- var _free = wasmExports["Z"];
146750
- var _main = Module["_main"] = wasmExports["_"];
146751
- var __emscripten_stack_alloc = wasmExports["$"];
146835
+ var _malloc = wasmExports["X"];
146836
+ var _free = wasmExports["Y"];
146837
+ var _main = Module["_main"] = wasmExports["Z"];
146838
+ var __emscripten_stack_alloc = wasmExports["_"];
146839
+ Module["dynCall_ii"] = wasmExports["$"];
146752
146840
  Module["dynCall_vi"] = wasmExports["aa"];
146753
- Module["dynCall_ii"] = wasmExports["ba"];
146754
- Module["dynCall_viiii"] = wasmExports["ca"];
146755
- Module["dynCall_vii"] = wasmExports["da"];
146756
- Module["dynCall_iii"] = wasmExports["ea"];
146757
- Module["dynCall_iijii"] = wasmExports["fa"];
146758
- Module["dynCall_iiii"] = wasmExports["ga"];
146841
+ Module["dynCall_vii"] = wasmExports["ba"];
146842
+ Module["dynCall_iii"] = wasmExports["ca"];
146843
+ Module["dynCall_viii"] = wasmExports["da"];
146844
+ Module["dynCall_v"] = wasmExports["ea"];
146845
+ Module["dynCall_diiii"] = wasmExports["fa"];
146846
+ Module["dynCall_viif"] = wasmExports["ga"];
146759
146847
  Module["dynCall_iiiii"] = wasmExports["ha"];
146760
- Module["dynCall_iiiiiiiii"] = wasmExports["ia"];
146761
- Module["dynCall_iiiiii"] = wasmExports["ja"];
146762
- Module["dynCall_v"] = wasmExports["ka"];
146763
- Module["dynCall_viii"] = wasmExports["la"];
146764
- Module["dynCall_viiiiiii"] = wasmExports["ma"];
146765
- Module["dynCall_diiii"] = wasmExports["na"];
146766
- Module["dynCall_viif"] = wasmExports["oa"];
146767
- Module["dynCall_i"] = wasmExports["pa"];
146768
- Module["dynCall_fii"] = wasmExports["qa"];
146769
- Module["dynCall_jiji"] = wasmExports["ra"];
146770
- Module["dynCall_iidiiii"] = wasmExports["sa"];
146771
- Module["dynCall_viijii"] = wasmExports["ta"];
146772
- Module["dynCall_iiiiiii"] = wasmExports["ua"];
146773
- Module["dynCall_iiiiij"] = wasmExports["va"];
146774
- Module["dynCall_iiiiid"] = wasmExports["wa"];
146775
- Module["dynCall_iiiiijj"] = wasmExports["xa"];
146776
- Module["dynCall_iiiiiiii"] = wasmExports["ya"];
146777
- Module["dynCall_iiiiiijj"] = wasmExports["za"];
146778
- Module["dynCall_viiiiii"] = wasmExports["Aa"];
146779
- Module["dynCall_viiiii"] = wasmExports["Ba"];
146780
- var _asyncify_start_unwind = wasmExports["Ca"];
146781
- var _asyncify_stop_unwind = wasmExports["Da"];
146782
- var _asyncify_start_rewind = wasmExports["Ea"];
146783
- var _asyncify_stop_rewind = wasmExports["Fa"];
146848
+ Module["dynCall_iiii"] = wasmExports["ia"];
146849
+ Module["dynCall_ddd"] = wasmExports["ja"];
146850
+ Module["dynCall_i"] = wasmExports["ka"];
146851
+ Module["dynCall_fii"] = wasmExports["la"];
146852
+ Module["dynCall_viiii"] = wasmExports["ma"];
146853
+ Module["dynCall_iiiiii"] = wasmExports["na"];
146854
+ Module["dynCall_idd"] = wasmExports["oa"];
146855
+ Module["dynCall_jiji"] = wasmExports["pa"];
146856
+ Module["dynCall_iidiiii"] = wasmExports["qa"];
146857
+ Module["dynCall_viijii"] = wasmExports["ra"];
146858
+ Module["dynCall_iiiiiiiii"] = wasmExports["sa"];
146859
+ Module["dynCall_iiiiiii"] = wasmExports["ta"];
146860
+ Module["dynCall_iiiiij"] = wasmExports["ua"];
146861
+ Module["dynCall_iiiiid"] = wasmExports["va"];
146862
+ Module["dynCall_iiiiijj"] = wasmExports["wa"];
146863
+ Module["dynCall_iiiiiiii"] = wasmExports["xa"];
146864
+ Module["dynCall_iiiiiijj"] = wasmExports["ya"];
146865
+ Module["dynCall_viiiiii"] = wasmExports["za"];
146866
+ Module["dynCall_viiiii"] = wasmExports["Aa"];
146867
+ var _asyncify_start_unwind = wasmExports["Ba"];
146868
+ var _asyncify_stop_unwind = wasmExports["Ca"];
146869
+ var _asyncify_start_rewind = wasmExports["Da"];
146870
+ var _asyncify_stop_rewind = wasmExports["Ea"];
146784
146871
  function callMain(args = []) {
146785
146872
  var entryFunction = _main;
146786
146873
  args.unshift(thisProgram);
@@ -146832,13 +146919,16 @@ var IfcDbWasm = (() => {
146832
146919
  doRun();
146833
146920
  }
146834
146921
  }
146835
- if (Module["preInit"]) {
146836
- if (typeof Module["preInit"] == "function")
146837
- Module["preInit"] = [Module["preInit"]];
146838
- while (Module["preInit"].length > 0) {
146839
- Module["preInit"].pop()();
146922
+ function preInit() {
146923
+ if (Module["preInit"]) {
146924
+ if (typeof Module["preInit"] == "function")
146925
+ Module["preInit"] = [Module["preInit"]];
146926
+ while (Module["preInit"].length > 0) {
146927
+ Module["preInit"].shift()();
146928
+ }
146840
146929
  }
146841
146930
  }
146931
+ preInit();
146842
146932
  run();
146843
146933
  moduleRtn = readyPromise;
146844
146934
  return moduleRtn;
@@ -146851,20 +146941,20 @@ var __publicField$1 = (obj, key, value) => {
146851
146941
  __defNormalProp$1(obj, typeof key !== "symbol" ? key + "" : key, value);
146852
146942
  return value;
146853
146943
  };
146854
- const cdnUrl = `https://cdn.jsdelivr.net/npm/@creooxag/cx-converter@${packageJSON.version}/dist/`;
146944
+ const cdnUrl = `https://cdn.jsdelivr.net/npm/@creooxag/cxconverter@${packageJSON.version}/dist/`;
146855
146945
  const defaultUrlPrefix = "./";
146856
146946
  const _IfcWasmConverterLoader = class _IfcWasmConverterLoader {
146857
146947
  constructor() {
146858
146948
  __publicField$1(this, "module");
146859
146949
  }
146860
- static async getInstance(userUrlPrefix) {
146950
+ static async getInstance(userUrlPrefix = "remote") {
146861
146951
  let urlPrefix = defaultUrlPrefix;
146862
146952
  if (userUrlPrefix) {
146863
146953
  urlPrefix = userUrlPrefix == "remote" ? cdnUrl : userUrlPrefix;
146864
146954
  }
146865
146955
  if (!_IfcWasmConverterLoader.instance) {
146866
146956
  _IfcWasmConverterLoader.instance = new _IfcWasmConverterLoader();
146867
- var Module = {
146957
+ const Module = {
146868
146958
  locateFile: function(path) {
146869
146959
  const fullPath = urlPrefix + path;
146870
146960
  if (path.endsWith(".wasm")) {
@@ -146889,7 +146979,9 @@ const _IfcWasmConverterLoader = class _IfcWasmConverterLoader {
146889
146979
  __publicField$1(_IfcWasmConverterLoader, "instance");
146890
146980
  let IfcWasmConverterLoader = _IfcWasmConverterLoader;
146891
146981
 
146892
- async function ifc2gltf(ifcData, params) {
146982
+ async function ifc2gltf(ifcData, params = { remote: true }) {
146983
+ if (params.remote == void 0)
146984
+ params.remote = true;
146893
146985
  const inputOptionsString = params.inputOptions ? params.inputOptions : JSON.stringify(inputOptionsDefault);
146894
146986
  const loadOptions = {
146895
146987
  "maxFileSizeInMegaBytes": 1e3
@@ -146972,17 +147064,17 @@ async function fetchFile(url) {
146972
147064
  }
146973
147065
 
146974
147066
  /**
146975
- * {@link Viewer} plugin that uses [CxConverter](https://github.com/Creoox/cxconverter) to load BIM models directly from IFC files, using its WebAssembly buid from [npm package](https://www.npmjs.com/package/@creooxag/cx-converter).
147067
+ * {@link Viewer} plugin that uses [CxConverter](https://github.com/Creoox/cxconverter) to load BIM models directly from IFC files, using its WebAssembly buid from [npm package](https://www.npmjs.com/package/@creooxag/cxconverter).
146976
147068
  *
146977
147069
  * ## Overview
146978
147070
  * The WebAssembly build of CxConverter is still in alfa stage, so it may not work as expected. This documentation will be updated as the library and the plugin evolve. The example below shows how to use the plugin:
146979
147071
  * ````javascript
146980
147072
  * import { CxConverterIFCLoaderPlugin, Viewer } from "../../dist/xeokit-sdk.es.js";
146981
147073
  * const cxConverterIFCLoaderPlugin = new CxConverterIFCLoaderPlugin(viewer);
146982
- *
147074
+ *
146983
147075
  * const sceneModel = await cxConverterIFCLoaderPlugin.load({
146984
147076
  * src: "../../assets/models/ifc/Duplex.ifc"
146985
- * });
147077
+ * });
146986
147078
  * ````
146987
147079
  See the code in action [here](https://xeokit.github.io/xeokit-sdk/examples/buildings/#cxConverterIFC_vbo_Duplex).
146988
147080
  */
@@ -170502,4 +170594,4 @@ class ZoneTranslateTouchControl extends ZoneTranslateControl {
170502
170594
  }
170503
170595
  }
170504
170596
 
170505
- export { AlphaFormat, AmbientLight, AngleMeasurementEditMouseControl, AngleMeasurementEditTouchControl, AngleMeasurementsControl, AngleMeasurementsMouseControl, AngleMeasurementsPlugin, AngleMeasurementsTouchControl, AnnotationsPlugin, AxisGizmoPlugin, BCFViewpointsPlugin, Bitmap, ByteType, CameraMemento, CameraPath, CameraPathAnimation, CityJSONLoaderPlugin, ClampToEdgeWrapping, Component, CompressedMediaType, Configs, ContextMenu, CubicBezierCurve, Curve, CxConverterIFCLoaderPlugin, DefaultLoadingManager, DepthFormat, DepthStencilFormat, DirLight, DistanceMeasurementEditControl, DistanceMeasurementEditMouseControl, DistanceMeasurementEditTouchControl, DistanceMeasurementsControl, DistanceMeasurementsMouseControl, DistanceMeasurementsPlugin, DistanceMeasurementsTouchControl, Dot3D, DotBIMDefaultDataSource, DotBIMLoaderPlugin, EdgeMaterial, EmphasisMaterial, FaceAlignedSectionPlanesPlugin, FastNavPlugin, FloatType, Fresnel, Frustum$1 as Frustum, FrustumPlane, GIFMediaType, GLTFDefaultDataSource, GLTFLoaderPlugin, HalfFloatType, ImagePlane, IntType, JPEGMediaType, KTX2TextureTranscoder, LASLoaderPlugin, Label3D, LambertMaterial, LightMap, LineSet, LinearEncoding, LinearFilter, LinearMipMapLinearFilter, LinearMipMapNearestFilter, LinearMipmapLinearFilter, LinearMipmapNearestFilter, Loader, LoadingManager, LocaleService, LuminanceAlphaFormat, LuminanceFormat, Map$1 as Map, Marker, MarqueePicker, MarqueePickerMouseControl, Mesh, MeshSurfaceArea, MeshVolume, MetallicMaterial, MirroredRepeatWrapping, ModelMemento, NavCubePlugin, NearestFilter, NearestMipMapLinearFilter, NearestMipMapNearestFilter, NearestMipmapLinearFilter, NearestMipmapNearestFilter, Node$1 as Node, OBJLoaderPlugin, ObjectsKdTree3, ObjectsMemento, PNGMediaType, Path, PerformanceModel, PhongMaterial, PickResult, Plugin, PointLight, PointerCircle, PointerLens, QuadraticBezierCurve, Queue, RGBAFormat, RGBAIntegerFormat, RGBA_ASTC_10x10_Format, RGBA_ASTC_10x5_Format, RGBA_ASTC_10x6_Format, RGBA_ASTC_10x8_Format, RGBA_ASTC_12x10_Format, RGBA_ASTC_12x12_Format, RGBA_ASTC_4x4_Format, RGBA_ASTC_5x4_Format, RGBA_ASTC_5x5_Format, RGBA_ASTC_6x5_Format, RGBA_ASTC_6x6_Format, RGBA_ASTC_8x5_Format, RGBA_ASTC_8x6_Format, RGBA_ASTC_8x8_Format, RGBA_BPTC_Format, RGBA_ETC2_EAC_Format, RGBA_PVRTC_2BPPV1_Format, RGBA_PVRTC_4BPPV1_Format, RGBA_S3TC_DXT1_Format, RGBA_S3TC_DXT3_Format, RGBA_S3TC_DXT5_Format, RGBFormat, RGB_ETC1_Format, RGB_ETC2_Format, RGB_PVRTC_2BPPV1_Format, RGB_PVRTC_4BPPV1_Format, RGB_S3TC_DXT1_Format, RGFormat, RGIntegerFormat, ReadableGeometry, RedFormat, RedIntegerFormat, ReflectionMap, RepeatWrapping, STLDefaultDataSource, STLLoaderPlugin, SceneModel, SceneModelMesh, SceneModelTransform, SectionPlane, SectionPlanesPlugin, ShortType, SpecularMaterial, SplineCurve, SpriteMarker, StoreyViewsPlugin, Texture, TextureTranscoder, TreeViewPlugin, UnsignedByteType, UnsignedInt248Type, UnsignedIntType, UnsignedShort4444Type, UnsignedShort5551Type, UnsignedShortType, VBOGeometry, ViewCullPlugin, Viewer, WebIFCLoaderPlugin, Wire3D, WorkerPool$1 as WorkerPool, XKTDefaultDataSource, XKTLoaderPlugin, XML3DLoaderPlugin, ZoneEditControl, ZoneEditMouseControl, ZoneEditTouchControl, ZoneTranslateControl, ZoneTranslateMouseControl, ZoneTranslateTouchControl, ZonesMouseControl, ZonesPlugin, ZonesPolysurfaceMouseControl, ZonesPolysurfaceTouchControl, ZonesTouchControl, activateDraggableDot, activateDraggableDots, addMousePressListener, addTouchPressListener, buildBoxGeometry, buildBoxLinesGeometry, buildBoxLinesGeometryFromAABB, buildCylinderGeometry, buildGridGeometry, buildLineGeometry, buildPlaneGeometry, buildPolylineGeometry, buildPolylineGeometryFromCurve, buildSphereGeometry, buildTorusGeometry, buildVectorTextGeometry, createCombinedTexture, createRTCViewMat, createSkyboxMesh, frustumIntersectsAABB3, getKTX2TextureTranscoder, getPlaneRTCPos, isTriangleMeshSolid, load3DSGeometry, loadOBJGeometry, marker3D, math, meshSurfaceArea, meshVolume, os, rtcToWorldPos, sRGBEncoding, setFrustum, startPolygonCreate, stats, touchPointSelector, transformToNode, triangulateEarClipping, utils, wire3D, worldToRTCPos, worldToRTCPositions };
170597
+ export { AlphaFormat, AmbientLight, AngleMeasurementEditMouseControl, AngleMeasurementEditTouchControl, AngleMeasurementsControl, AngleMeasurementsMouseControl, AngleMeasurementsPlugin, AngleMeasurementsTouchControl, AnnotationsPlugin, AxisGizmoPlugin, BCFViewpointsPlugin, Bitmap, ByteType, CameraMemento, CameraPath, CameraPathAnimation, CityJSONLoaderPlugin, ClampToEdgeWrapping, Component, CompressedMediaType, Configs, ContextMenu, CubicBezierCurve, Curve, CxConverterIFCLoaderPlugin, DefaultLoadingManager, DepthFormat, DepthStencilFormat, DirLight, DistanceMeasurementEditControl, DistanceMeasurementEditMouseControl, DistanceMeasurementEditTouchControl, DistanceMeasurementsControl, DistanceMeasurementsMouseControl, DistanceMeasurementsPlugin, DistanceMeasurementsTouchControl, Dot3D, DotBIMDefaultDataSource, DotBIMLoaderPlugin, EdgeMaterial, EmphasisMaterial, FaceAlignedSectionPlanesPlugin, FastNavPlugin, FloatType, Fresnel, Frustum$1 as Frustum, FrustumPlane, GIFMediaType, GLTFDefaultDataSource, GLTFLoaderPlugin, HalfFloatType, ImagePlane, IntType, JPEGMediaType, KTX2TextureTranscoder, LASLoaderPlugin, Label3D, LambertMaterial, LightMap, LineSet, LinearEncoding, LinearFilter, LinearMipMapLinearFilter, LinearMipMapNearestFilter, LinearMipmapLinearFilter, LinearMipmapNearestFilter, Loader, LoadingManager, LocaleService, LuminanceAlphaFormat, LuminanceFormat, Map$1 as Map, Marker, MarqueePicker, MarqueePickerMouseControl, Mesh, MeshSurfaceArea, MeshVolume, MetallicMaterial, MirroredRepeatWrapping, ModelMemento, NavCubePlugin, NearestFilter, NearestMipMapLinearFilter, NearestMipMapNearestFilter, NearestMipmapLinearFilter, NearestMipmapNearestFilter, Node$1 as Node, OBJLoaderPlugin, ObjectsKdTree3, ObjectsMemento, PNGMediaType, Path, PerformanceModel, PhongMaterial, PickResult, Plugin, PointLight, PointerCircle, PointerLens, QuadraticBezierCurve, Queue, RGBAFormat, RGBAIntegerFormat, RGBA_ASTC_10x10_Format, RGBA_ASTC_10x5_Format, RGBA_ASTC_10x6_Format, RGBA_ASTC_10x8_Format, RGBA_ASTC_12x10_Format, RGBA_ASTC_12x12_Format, RGBA_ASTC_4x4_Format, RGBA_ASTC_5x4_Format, RGBA_ASTC_5x5_Format, RGBA_ASTC_6x5_Format, RGBA_ASTC_6x6_Format, RGBA_ASTC_8x5_Format, RGBA_ASTC_8x6_Format, RGBA_ASTC_8x8_Format, RGBA_BPTC_Format, RGBA_ETC2_EAC_Format, RGBA_PVRTC_2BPPV1_Format, RGBA_PVRTC_4BPPV1_Format, RGBA_S3TC_DXT1_Format, RGBA_S3TC_DXT3_Format, RGBA_S3TC_DXT5_Format, RGBFormat, RGB_ETC1_Format, RGB_ETC2_Format, RGB_PVRTC_2BPPV1_Format, RGB_PVRTC_4BPPV1_Format, RGB_S3TC_DXT1_Format, RGFormat, RGIntegerFormat, ReadableGeometry, RedFormat, RedIntegerFormat, ReflectionMap, RepeatWrapping, STLDefaultDataSource, STLLoaderPlugin, SceneModel, SceneModelMesh, SceneModelTransform, SectionPlane, SectionPlanesPlugin, ShortType, SpecularMaterial, SplineCurve, SpriteMarker, StoreyViewsPlugin, Texture, TextureTranscoder, TransformControl, TreeViewPlugin, UnsignedByteType, UnsignedInt248Type, UnsignedIntType, UnsignedShort4444Type, UnsignedShort5551Type, UnsignedShortType, VBOGeometry, ViewCullPlugin, Viewer, WebIFCLoaderPlugin, Wire3D, WorkerPool$1 as WorkerPool, XKTDefaultDataSource, XKTLoaderPlugin, XML3DLoaderPlugin, ZoneEditControl, ZoneEditMouseControl, ZoneEditTouchControl, ZoneTranslateControl, ZoneTranslateMouseControl, ZoneTranslateTouchControl, ZonesMouseControl, ZonesPlugin, ZonesPolysurfaceMouseControl, ZonesPolysurfaceTouchControl, ZonesTouchControl, activateDraggableDot, activateDraggableDots, addMousePressListener, addTouchPressListener, buildBoxGeometry, buildBoxLinesGeometry, buildBoxLinesGeometryFromAABB, buildCylinderGeometry, buildGridGeometry, buildLineGeometry, buildPlaneGeometry, buildPolylineGeometry, buildPolylineGeometryFromCurve, buildSphereGeometry, buildTorusGeometry, buildVectorTextGeometry, createCombinedTexture, createRTCViewMat, createSkyboxMesh, createSphereMapMesh, frustumIntersectsAABB3, getKTX2TextureTranscoder, getPlaneRTCPos, isTriangleMeshSolid, load3DSGeometry, loadOBJGeometry, marker3D, math, meshSurfaceArea, meshVolume, os, rtcToWorldPos, sRGBEncoding, setFrustum, startPolygonCreate, stats, touchPointSelector, transformToNode, triangulateEarClipping, utils, wire3D, worldToRTCPos, worldToRTCPositions };