@xeokit/xeokit-sdk 2.5.2-beta-28 → 2.5.2-beta-32

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xeokit/xeokit-sdk",
3
- "version": "2.5.2-beta-28",
3
+ "version": "2.5.2-beta-32",
4
4
  "description": "Web Programming Toolkit for 3D/2D BIM and AEC Graphics",
5
5
  "module": "./dist/xeokit-sdk.es.js",
6
6
  "main": "./dist/xeokit-sdk.cjs.js",
@@ -53,7 +53,7 @@
53
53
  "@loaders.gl/gltf": "^3.2.6",
54
54
  "@loaders.gl/las": "^3.2.6",
55
55
  "html2canvas": "^1.4.1",
56
- "web-ifc": "^0.0.41"
56
+ "web-ifc": "^0.0.51"
57
57
  },
58
58
  "devDependencies": {
59
59
  "@babel/core": "^7.18.6",
@@ -89,7 +89,9 @@ export class AngleMeasurementsMouseControl extends AngleMeasurementsControl {
89
89
  markerDiv.style.borderRadius = "10px";
90
90
  markerDiv.style.width = "5px";
91
91
  markerDiv.style.height = "5px";
92
- markerDiv.style.margin = "-200px -200px";
92
+ markerDiv.style.top = "-200px";
93
+ markerDiv.style.left = "-200px";
94
+ markerDiv.style.margin = "0 0";
93
95
  markerDiv.style.zIndex = "100";
94
96
  markerDiv.style.position = "absolute";
95
97
  markerDiv.style.pointerEvents = "none";
@@ -223,8 +225,8 @@ export class AngleMeasurementsMouseControl extends AngleMeasurementsControl {
223
225
  const scrollTop = window.pageYOffset || document.documentElement.scrollTop;
224
226
  const canvasLeftEdge = canvasBoundRect.left + scrollLeft;
225
227
  const canvasTopEdge = canvasBoundRect.top + scrollTop;
226
- this.markerDiv.style.marginLeft = `${canvasLeftEdge + canvasPos[0] - 5}px`;
227
- this.markerDiv.style.marginTop = `${canvasTopEdge + canvasPos[1] - 5}px`;
228
+ this.markerDiv.style.left = `${canvasLeftEdge + canvasPos[0] - 5}px`;
229
+ this.markerDiv.style.top = `${canvasTopEdge + canvasPos[1] - 5}px`;
228
230
  break;
229
231
  case MOUSE_FINDING_CORNER:
230
232
  if (this._currentAngleMeasurement) {
@@ -235,8 +237,8 @@ export class AngleMeasurementsMouseControl extends AngleMeasurementsControl {
235
237
  this._currentAngleMeasurement.corner.worldPos = event.worldPos;
236
238
  this._currentAngleMeasurement.corner.entity = event.entity;
237
239
  }
238
- this.markerDiv.style.marginLeft = `-10000px`;
239
- this.markerDiv.style.marginTop = `-10000px`;
240
+ this.markerDiv.style.left = `-10000px`;
241
+ this.markerDiv.style.top = `-10000px`;
240
242
  canvas.style.cursor = "pointer";
241
243
  break;
242
244
  case MOUSE_FINDING_TARGET:
@@ -247,8 +249,8 @@ export class AngleMeasurementsMouseControl extends AngleMeasurementsControl {
247
249
  this._currentAngleMeasurement.target.worldPos = event.worldPos;
248
250
  this._currentAngleMeasurement.target.entity = event.entity;
249
251
  }
250
- this.markerDiv.style.marginLeft = `-10000px`;
251
- this.markerDiv.style.marginTop = `-10000px`;
252
+ this.markerDiv.style.left = `-10000px`;
253
+ this.markerDiv.style.top = `-10000px`;
252
254
  canvas.style.cursor = "pointer";
253
255
  break;
254
256
  }
@@ -349,8 +351,8 @@ export class AngleMeasurementsMouseControl extends AngleMeasurementsControl {
349
351
  pointerLens.snappedCanvasPos = event.snappedCanvasPos || event.canvasPos;
350
352
  pointerLens.snapped = false;
351
353
  }
352
- this.markerDiv.style.marginLeft = `-100px`;
353
- this.markerDiv.style.marginTop = `-100px`;
354
+ this.markerDiv.style.left = `-100px`;
355
+ this.markerDiv.style.top = `-100px`;
354
356
  if (this._currentAngleMeasurement) {
355
357
  switch (this._mouseState) {
356
358
  case MOUSE_FINDING_ORIGIN:
@@ -93,7 +93,9 @@ export class DistanceMeasurementsMouseControl extends DistanceMeasurementsContro
93
93
  markerDiv.style.borderRadius = "10px";
94
94
  markerDiv.style.width = "5px";
95
95
  markerDiv.style.height = "5px";
96
- markerDiv.style.margin = "-200px -200px";
96
+ markerDiv.style.top = "-200px";
97
+ markerDiv.style.left = "-200px";
98
+ markerDiv.style.margin = "0 0";
97
99
  markerDiv.style.zIndex = "100";
98
100
  markerDiv.style.position = "absolute";
99
101
  markerDiv.style.pointerEvents = "none";
@@ -199,20 +201,23 @@ export class DistanceMeasurementsMouseControl extends DistanceMeasurementsContro
199
201
  this._snapping
200
202
  ? "hoverSnapOrSurface"
201
203
  : "hoverSurface", event => {
202
- const canvasPos = event.snappedCanvasPos || event.canvasPos;
204
+ const canvasPos = event.snappedCanvasPos ||event.canvasPos;
203
205
  mouseHovering = true;
204
206
  pointerWorldPos.set(event.worldPos);
205
207
  pointerCanvasPos.set(event.canvasPos);
206
208
  if (this._mouseState === MOUSE_FIRST_CLICK_EXPECTED) {
207
-
209
+
210
+ // const canvasBoundary = getCanvasBoundary();
211
+
208
212
  const canvasBoundRect = canvas.getBoundingClientRect();
209
213
  const scrollLeft = window.pageXOffset || document.documentElement.scrollLeft;
210
214
  const scrollTop = window.pageYOffset || document.documentElement.scrollTop;
211
215
  const canvasLeftEdge = canvasBoundRect.left + scrollLeft;
212
216
  const canvasTopEdge = canvasBoundRect.top + scrollTop;
213
-
214
- this._markerDiv.style.marginLeft = `${canvasLeftEdge + canvasPos[0] - 5}px`;
215
- this._markerDiv.style.marginTop = `${canvasTopEdge + canvasPos[1] - 5}px`;
217
+
218
+ this._markerDiv.style.left = `${canvasLeftEdge + canvasPos[0] - 5}px`;
219
+ this._markerDiv.style.top = `${canvasTopEdge + canvasPos[1] - 5}px`;
220
+
216
221
  this._markerDiv.style.background = "pink";
217
222
  if (event.snappedToVertex || event.snappedToEdge) {
218
223
  if (this.pointerLens) {
@@ -235,8 +240,8 @@ export class DistanceMeasurementsMouseControl extends DistanceMeasurementsContro
235
240
  }
236
241
  hoveredEntity = event.entity;
237
242
  } else {
238
- this._markerDiv.style.marginLeft = `-10000px`;
239
- this._markerDiv.style.marginTop = `-10000px`;
243
+ this._markerDiv.style.left = `-10000px`;
244
+ this._markerDiv.style.top = `-10000px`;
240
245
  }
241
246
  canvas.style.cursor = "pointer";
242
247
  if (this._currentDistanceMeasurement) {
@@ -247,8 +252,8 @@ export class DistanceMeasurementsMouseControl extends DistanceMeasurementsContro
247
252
  this._currentDistanceMeasurement.zAxisVisible = this._currentDistanceMeasurementInitState.zAxisVisible && this.distanceMeasurementsPlugin.defaultZAxisVisible;
248
253
  this._currentDistanceMeasurement.targetVisible = this._currentDistanceMeasurementInitState.targetVisible;
249
254
  this._currentDistanceMeasurement.target.worldPos = pointerWorldPos.slice();
250
- this._markerDiv.style.marginLeft = `-10000px`;
251
- this._markerDiv.style.marginTop = `-10000px`;
255
+ this._markerDiv.style.left = `-10000px`;
256
+ this._markerDiv.style.top = `-10000px`;
252
257
  }
253
258
  });
254
259
 
@@ -319,8 +324,8 @@ export class DistanceMeasurementsMouseControl extends DistanceMeasurementsContro
319
324
  this.pointerLens.snappedCanvasPos = event.snappedCanvasPos || event.canvasPos;
320
325
  }
321
326
  mouseHovering = false;
322
- this._markerDiv.style.marginLeft = `-100px`;
323
- this._markerDiv.style.marginTop = `-100px`;
327
+ this._markerDiv.style.left = `-100px`;
328
+ this._markerDiv.style.top = `-100px`;
324
329
  if (this._currentDistanceMeasurement) {
325
330
  this._currentDistanceMeasurement.wireVisible = false;
326
331
  this._currentDistanceMeasurement.targetVisible = false;
@@ -750,7 +750,7 @@ class WebIFCLoaderPlugin extends Plugin {
750
750
  }
751
751
 
752
752
  _parseSpatialChildren(ctx, ifcElement, parentMetaObjectId) {
753
- const metaObjectType = ifcElement.__proto__.constructor.name;
753
+ const metaObjectType = this._ifcAPI.GetNameFromTypeCode(ifcElement.type);
754
754
  if (ctx.includeTypes && (!ctx.includeTypes[metaObjectType])) {
755
755
  return;
756
756
  }
@@ -765,7 +765,7 @@ class WebIFCLoaderPlugin extends Plugin {
765
765
 
766
766
  _createMetaObject(ctx, ifcElement, parentMetaObjectId) {
767
767
  const id = ifcElement.GlobalId.value;
768
- const metaObjectType = ifcElement.__proto__.constructor.name;
768
+ const metaObjectType = this._ifcAPI.GetNameFromTypeCode(ifcElement.type);
769
769
  const metaObjectName = (ifcElement.Name && ifcElement.Name.value !== "") ? ifcElement.Name.value : metaObjectType;
770
770
  const metaObject = {
771
771
  id: id,
@@ -58,9 +58,9 @@ function getCanvasPosFromEvent(event, canvas, canvasPos) {
58
58
  canvasPos[0] = event.x;
59
59
  canvasPos[1] = event.y;
60
60
  } else {
61
- const { x, y } = canvas.getBoundingClientRect();
62
- canvasPos[0] = event.clientX - x;
63
- canvasPos[1] = event.clientY - y;
61
+ const { left, top } = canvas.getBoundingClientRect();
62
+ canvasPos[0] = event.clientX - left - window.scrollX;
63
+ canvasPos[1] = event.clientY - top - window.scrollY;
64
64
  }
65
65
  return canvasPos;
66
66
  }