@xeokit/xeokit-sdk 2.6.38 → 2.6.41
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/dist/web-ifc.wasm +0 -0
- package/dist/xeokit-sdk.cjs.js +215 -188
- package/dist/xeokit-sdk.es.js +211 -189
- package/dist/xeokit-sdk.es5.js +38 -31
- package/dist/xeokit-sdk.min.cjs.js +4 -4
- package/dist/xeokit-sdk.min.es.js +5 -5
- package/dist/xeokit-sdk.min.es5.js +4 -4
- package/package.json +1 -1
- package/src/extras/ContextMenu/ContextMenu.js +4 -6
- package/src/plugins/DistanceMeasurementsPlugin/DistanceMeasurement.js +10 -10
- package/src/plugins/DotBIMLoaderPlugin/DotBIMLoaderPlugin.js +38 -45
- package/src/plugins/GLTFLoaderPlugin/GLTFDefaultDataSource.js +6 -0
- package/src/plugins/TreeViewPlugin/RenderService.js +4 -1
- package/src/plugins/TreeViewPlugin/TreeViewPlugin.js +14 -6
- package/src/plugins/ZonesPlugin/ZonesPlugin.js +0 -116
- package/src/plugins/index.js +1 -0
- package/src/plugins/lib/ui/index.js +116 -0
- package/src/viewer/scene/model/SceneModel.js +15 -1
- package/src/viewer/scene/model/vbo/batching/triangles/VBOBatchingTrianglesBuffer.js +3 -3
- package/types/plugins/FastNavPlugin/FastNavPlugin.d.ts +2 -0
- package/types/plugins/TreeViewPlugin/TreeViewPlugin.d.ts +2 -0
package/dist/xeokit-sdk.es.js
CHANGED
|
@@ -684,7 +684,7 @@ class ContextMenu {
|
|
|
684
684
|
'</li>');
|
|
685
685
|
if (!((groupIdx === groupLen - 1) || (j < lenj - 1))) {
|
|
686
686
|
html.push(
|
|
687
|
-
'<li id="' + item.id + '" class="xeokit-context-menu-item-
|
|
687
|
+
'<li id="' + item.id + '" class="xeokit-context-menu-item-separator"></li>'
|
|
688
688
|
);
|
|
689
689
|
}
|
|
690
690
|
|
|
@@ -696,7 +696,7 @@ class ContextMenu {
|
|
|
696
696
|
'</li>');
|
|
697
697
|
if (!((groupIdx === groupLen - 1) || (j < lenj - 1))) {
|
|
698
698
|
html.push(
|
|
699
|
-
'<li id="' + item.id + '" class="xeokit-context-menu-item-
|
|
699
|
+
'<li id="' + item.id + '" class="xeokit-context-menu-item-separator"></li>'
|
|
700
700
|
);
|
|
701
701
|
}
|
|
702
702
|
}
|
|
@@ -896,12 +896,10 @@ class ContextMenu {
|
|
|
896
896
|
const shown = getShown(this._context);
|
|
897
897
|
item.shown = shown;
|
|
898
898
|
if (!shown) {
|
|
899
|
-
itemElement.
|
|
900
|
-
itemElement.classList.add("xeokit-context-menu-item-hidden");
|
|
899
|
+
itemElement.style.display = "none";
|
|
901
900
|
continue;
|
|
902
901
|
} else {
|
|
903
|
-
itemElement.
|
|
904
|
-
itemElement.classList.add("xeokit-context-menu-item-visible");
|
|
902
|
+
itemElement.style.display = "";
|
|
905
903
|
|
|
906
904
|
}
|
|
907
905
|
const enabled = getEnabled(this._context);
|
|
@@ -11351,6 +11349,122 @@ function activateDraggableDots(cfg) {
|
|
|
11351
11349
|
};
|
|
11352
11350
|
}
|
|
11353
11351
|
|
|
11352
|
+
const touchPointSelector$1 = function(viewer, pointerCircle, ray2WorldPos) {
|
|
11353
|
+
return function(onCancel, onChange, onCommit) {
|
|
11354
|
+
const scene = viewer.scene;
|
|
11355
|
+
const canvas = scene.canvas.canvas;
|
|
11356
|
+
const longTouchTimeoutMs = 300;
|
|
11357
|
+
const moveTolerance = 20;
|
|
11358
|
+
|
|
11359
|
+
const copyCanvasPos = (event, vec2) => {
|
|
11360
|
+
vec2[0] = event.clientX;
|
|
11361
|
+
vec2[1] = event.clientY;
|
|
11362
|
+
transformToNode(canvas.ownerDocument.documentElement, canvas, vec2);
|
|
11363
|
+
return vec2;
|
|
11364
|
+
};
|
|
11365
|
+
|
|
11366
|
+
const pickWorldPos = canvasPos => {
|
|
11367
|
+
const origin = math.vec3();
|
|
11368
|
+
const direction = math.vec3();
|
|
11369
|
+
math.canvasPosToWorldRay(canvas, scene.camera.viewMatrix, scene.camera.projMatrix, scene.camera.projection, canvasPos, origin, direction);
|
|
11370
|
+
return ray2WorldPos(origin, direction);
|
|
11371
|
+
};
|
|
11372
|
+
|
|
11373
|
+
let longTouchTimeout = null;
|
|
11374
|
+
const nop = () => { };
|
|
11375
|
+
let onSingleTouchMove = nop;
|
|
11376
|
+
let startTouchIdentifier;
|
|
11377
|
+
|
|
11378
|
+
const resetAction = function() {
|
|
11379
|
+
pointerCircle.stop();
|
|
11380
|
+
clearTimeout(longTouchTimeout);
|
|
11381
|
+
viewer.cameraControl.active = true;
|
|
11382
|
+
onSingleTouchMove = nop;
|
|
11383
|
+
startTouchIdentifier = null;
|
|
11384
|
+
};
|
|
11385
|
+
|
|
11386
|
+
const cleanup = function() {
|
|
11387
|
+
resetAction();
|
|
11388
|
+
canvas.removeEventListener("touchstart", onCanvasTouchStart);
|
|
11389
|
+
canvas.removeEventListener("touchmove", onCanvasTouchMove);
|
|
11390
|
+
canvas.removeEventListener("touchend", onCanvasTouchEnd);
|
|
11391
|
+
};
|
|
11392
|
+
|
|
11393
|
+
const onCanvasTouchStart = function(event) {
|
|
11394
|
+
const touches = event.touches;
|
|
11395
|
+
|
|
11396
|
+
if (touches.length !== 1)
|
|
11397
|
+
{
|
|
11398
|
+
resetAction();
|
|
11399
|
+
onCancel();
|
|
11400
|
+
}
|
|
11401
|
+
else
|
|
11402
|
+
{
|
|
11403
|
+
const startTouch = touches[0];
|
|
11404
|
+
const startCanvasPos = copyCanvasPos(startTouch, math.vec2());
|
|
11405
|
+
|
|
11406
|
+
const startWorldPos = pickWorldPos(startCanvasPos);
|
|
11407
|
+
if (startWorldPos)
|
|
11408
|
+
{
|
|
11409
|
+
startTouchIdentifier = startTouch.identifier;
|
|
11410
|
+
|
|
11411
|
+
onSingleTouchMove = canvasPos => {
|
|
11412
|
+
if (math.distVec2(startCanvasPos, canvasPos) > moveTolerance)
|
|
11413
|
+
{
|
|
11414
|
+
resetAction();
|
|
11415
|
+
}
|
|
11416
|
+
};
|
|
11417
|
+
|
|
11418
|
+
longTouchTimeout = setTimeout(
|
|
11419
|
+
function() {
|
|
11420
|
+
pointerCircle.start(startCanvasPos);
|
|
11421
|
+
|
|
11422
|
+
longTouchTimeout = setTimeout(
|
|
11423
|
+
function() {
|
|
11424
|
+
pointerCircle.stop();
|
|
11425
|
+
|
|
11426
|
+
viewer.cameraControl.active = false;
|
|
11427
|
+
|
|
11428
|
+
onSingleTouchMove = canvasPos => {
|
|
11429
|
+
onChange(canvasPos, pickWorldPos(canvasPos));
|
|
11430
|
+
};
|
|
11431
|
+
|
|
11432
|
+
onSingleTouchMove(startCanvasPos);
|
|
11433
|
+
},
|
|
11434
|
+
longTouchTimeoutMs);
|
|
11435
|
+
},
|
|
11436
|
+
250);
|
|
11437
|
+
}
|
|
11438
|
+
}
|
|
11439
|
+
};
|
|
11440
|
+
canvas.addEventListener("touchstart", onCanvasTouchStart, {passive: true});
|
|
11441
|
+
|
|
11442
|
+
// canvas.addEventListener("touchcancel", e => console.log("touchcancel", e), {passive: true});
|
|
11443
|
+
|
|
11444
|
+
const onCanvasTouchMove = function(event) {
|
|
11445
|
+
const touch = [...event.changedTouches].find(e => e.identifier === startTouchIdentifier);
|
|
11446
|
+
if (touch)
|
|
11447
|
+
{
|
|
11448
|
+
onSingleTouchMove(copyCanvasPos(touch, math.vec2()));
|
|
11449
|
+
}
|
|
11450
|
+
};
|
|
11451
|
+
canvas.addEventListener("touchmove", onCanvasTouchMove, {passive: true});
|
|
11452
|
+
|
|
11453
|
+
const onCanvasTouchEnd = function(event) {
|
|
11454
|
+
const touch = [...event.changedTouches].find(e => e.identifier === startTouchIdentifier);
|
|
11455
|
+
if (touch)
|
|
11456
|
+
{
|
|
11457
|
+
cleanup();
|
|
11458
|
+
const canvasPos = copyCanvasPos(touch, math.vec2());
|
|
11459
|
+
onCommit(canvasPos, pickWorldPos(canvasPos));
|
|
11460
|
+
}
|
|
11461
|
+
};
|
|
11462
|
+
canvas.addEventListener("touchend", onCanvasTouchEnd, {passive: true});
|
|
11463
|
+
|
|
11464
|
+
return cleanup;
|
|
11465
|
+
};
|
|
11466
|
+
};
|
|
11467
|
+
|
|
11354
11468
|
/** @private */
|
|
11355
11469
|
class Wire {
|
|
11356
11470
|
|
|
@@ -56016,9 +56130,9 @@ const configs$2 = new Configs();
|
|
|
56016
56130
|
*/
|
|
56017
56131
|
class VBOBatchingTrianglesBuffer {
|
|
56018
56132
|
|
|
56019
|
-
constructor() {
|
|
56020
|
-
this.maxVerts =
|
|
56021
|
-
this.maxIndices =
|
|
56133
|
+
constructor(maxBatchSize = configs$2.maxGeometryBatchSize) {
|
|
56134
|
+
this.maxVerts = maxBatchSize;
|
|
56135
|
+
this.maxIndices = maxBatchSize * 3; // Rough rule-of-thumb
|
|
56022
56136
|
this.positions = [];
|
|
56023
56137
|
this.colors = [];
|
|
56024
56138
|
this.uv = [];
|
|
@@ -85118,7 +85232,21 @@ class SceneModel extends Component {
|
|
|
85118
85232
|
if (cfg.image) { // Ignore transcoder for Images
|
|
85119
85233
|
const image = cfg.image;
|
|
85120
85234
|
image.crossOrigin = "Anonymous";
|
|
85121
|
-
|
|
85235
|
+
if (image.compressed) {
|
|
85236
|
+
// see `parsedImage` in @loaders.gl/gltf/src/lib/parsers/parse-gltf.ts
|
|
85237
|
+
// NOTE: @loaders.gl in its current version discards potential mipmaps, leaving only a single one
|
|
85238
|
+
const data = image.data;
|
|
85239
|
+
texture.setCompressedData({
|
|
85240
|
+
mipmaps: data,
|
|
85241
|
+
props: {
|
|
85242
|
+
format: data[0].format,
|
|
85243
|
+
minFilter: minFilter,
|
|
85244
|
+
magFilter: magFilter
|
|
85245
|
+
}
|
|
85246
|
+
});
|
|
85247
|
+
} else {
|
|
85248
|
+
texture.setImage(image, {minFilter, magFilter, wrapS, wrapT, wrapR, flipY: cfg.flipY, encoding});
|
|
85249
|
+
}
|
|
85122
85250
|
} else if (cfg.src) {
|
|
85123
85251
|
const ext = cfg.src.split('.').pop();
|
|
85124
85252
|
switch (ext) { // Don't transcode recognized image file types
|
|
@@ -88168,6 +88296,16 @@ class DistanceMeasurement extends Component {
|
|
|
88168
88296
|
const scene = this.plugin.viewer.scene;
|
|
88169
88297
|
|
|
88170
88298
|
if (this._wpDirty) {
|
|
88299
|
+
const delta = math.subVec3(
|
|
88300
|
+
this._targetWorld,
|
|
88301
|
+
this._originWorld,
|
|
88302
|
+
tmpVec3
|
|
88303
|
+
);
|
|
88304
|
+
|
|
88305
|
+
/**
|
|
88306
|
+
* The length detected for each measurement axis.
|
|
88307
|
+
*/
|
|
88308
|
+
this._factors = math.transformVec3(this._axesBasis, delta);
|
|
88171
88309
|
|
|
88172
88310
|
this._measurementOrientation = determineMeasurementOrientation(this._originWorld, this._targetWorld, 0);
|
|
88173
88311
|
if(this._measurementOrientation === 'Vertical' && this.useRotationAdjustment){
|
|
@@ -88192,16 +88330,6 @@ class DistanceMeasurement extends Component {
|
|
|
88192
88330
|
this._wp[15] = 1.0;
|
|
88193
88331
|
}
|
|
88194
88332
|
else {
|
|
88195
|
-
const delta = math.subVec3(
|
|
88196
|
-
this._targetWorld,
|
|
88197
|
-
this._originWorld,
|
|
88198
|
-
tmpVec3
|
|
88199
|
-
);
|
|
88200
|
-
|
|
88201
|
-
/**
|
|
88202
|
-
* The length detected for each measurement axis.
|
|
88203
|
-
*/
|
|
88204
|
-
this._factors = math.transformVec3(this._axesBasis, delta);
|
|
88205
88333
|
|
|
88206
88334
|
this._wp[0] = this._originWorld[0];
|
|
88207
88335
|
this._wp[1] = this._originWorld[1];
|
|
@@ -91354,6 +91482,12 @@ class FastNavPlugin extends Plugin {
|
|
|
91354
91482
|
class GLTFDefaultDataSource {
|
|
91355
91483
|
|
|
91356
91484
|
constructor(cfg = {}) {
|
|
91485
|
+
|
|
91486
|
+
/**
|
|
91487
|
+
* Set `true` to enable cache busting for HTTP GETs.
|
|
91488
|
+
* This is `true` by default.
|
|
91489
|
+
* @type {boolean}
|
|
91490
|
+
*/
|
|
91357
91491
|
this.cacheBuster = (cfg.cacheBuster !== false);
|
|
91358
91492
|
}
|
|
91359
91493
|
|
|
@@ -126035,12 +126169,15 @@ class RenderService {
|
|
|
126035
126169
|
return element.checked;
|
|
126036
126170
|
}
|
|
126037
126171
|
|
|
126038
|
-
setCheckbox(nodeId, checked) {
|
|
126172
|
+
setCheckbox(nodeId, checked, indeterminate = false) {
|
|
126039
126173
|
const checkbox = document.getElementById(`checkbox-${nodeId}`);
|
|
126040
126174
|
if (checkbox) {
|
|
126041
126175
|
if (checked !== checkbox.checked) {
|
|
126042
126176
|
checkbox.checked = checked;
|
|
126043
126177
|
}
|
|
126178
|
+
if (indeterminate !== checkbox.indeterminate) {
|
|
126179
|
+
checkbox.indeterminate = indeterminate;
|
|
126180
|
+
}
|
|
126044
126181
|
}
|
|
126045
126182
|
}
|
|
126046
126183
|
|
|
@@ -126428,6 +126565,7 @@ class TreeViewPlugin extends Plugin {
|
|
|
126428
126565
|
* vertical World axis. For all hierarchy types, other node types will be ordered in the ascending alphanumeric order of their titles.
|
|
126429
126566
|
* @param {Boolean} [cfg.pruneEmptyNodes=true] When true, will not contain nodes that don't have content in the {@link Scene}. These are nodes whose {@link MetaObject}s don't have {@link Entity}s.
|
|
126430
126567
|
* @param {RenderService} [cfg.renderService] Optional {@link RenderService} to use. Defaults to the {@link TreeViewPlugin}'s default {@link RenderService}.
|
|
126568
|
+
* @param {Boolean} [cfg.showIndeterminate=false] When true, will show indeterminate state for checkboxes when some but not all child nodes are checked
|
|
126431
126569
|
*/
|
|
126432
126570
|
constructor(viewer, cfg = {}) {
|
|
126433
126571
|
|
|
@@ -126479,6 +126617,7 @@ class TreeViewPlugin extends Plugin {
|
|
|
126479
126617
|
this._pruneEmptyNodes = cfg.pruneEmptyNodes;
|
|
126480
126618
|
this._showListItemElementId = null;
|
|
126481
126619
|
this._renderService = cfg.renderService || new RenderService();
|
|
126620
|
+
this._showIndeterminate = cfg.showIndeterminate ?? false;
|
|
126482
126621
|
|
|
126483
126622
|
if (!this._renderService) {
|
|
126484
126623
|
throw new Error('TreeViewPlugin: no render service set');
|
|
@@ -126520,8 +126659,10 @@ class TreeViewPlugin extends Plugin {
|
|
|
126520
126659
|
} else {
|
|
126521
126660
|
parent.numVisibleEntities--;
|
|
126522
126661
|
}
|
|
126523
|
-
|
|
126524
|
-
|
|
126662
|
+
const indeterminate = this._showIndeterminate
|
|
126663
|
+
&& parent.numVisibleEntities > 0
|
|
126664
|
+
&& parent.numVisibleEntities < parent.numEntities;
|
|
126665
|
+
this._renderService.setCheckbox(parent.nodeId, (parent.numVisibleEntities > 0), indeterminate);
|
|
126525
126666
|
|
|
126526
126667
|
parent = parent.parent;
|
|
126527
126668
|
}
|
|
@@ -126603,8 +126744,10 @@ class TreeViewPlugin extends Plugin {
|
|
|
126603
126744
|
} else {
|
|
126604
126745
|
parent.numVisibleEntities -= numUpdated;
|
|
126605
126746
|
}
|
|
126606
|
-
|
|
126607
|
-
|
|
126747
|
+
const indeterminate = this._showIndeterminate
|
|
126748
|
+
&& parent.numVisibleEntities > 0
|
|
126749
|
+
&& parent.numVisibleEntities < parent.numEntities;
|
|
126750
|
+
this._renderService.setCheckbox(parent.nodeId, (parent.numVisibleEntities > 0), indeterminate);
|
|
126608
126751
|
|
|
126609
126752
|
parent = parent.parent;
|
|
126610
126753
|
}
|
|
@@ -126762,6 +126905,8 @@ class TreeViewPlugin extends Plugin {
|
|
|
126762
126905
|
return; // Node may not exist for the given object if (this._pruneEmptyNodes == true)
|
|
126763
126906
|
}
|
|
126764
126907
|
|
|
126908
|
+
this.collapse();
|
|
126909
|
+
|
|
126765
126910
|
const nodeId = node.nodeId;
|
|
126766
126911
|
|
|
126767
126912
|
const switchElement = this._renderService.getSwitchElement(nodeId);
|
|
@@ -126844,8 +126989,8 @@ class TreeViewPlugin extends Plugin {
|
|
|
126844
126989
|
collapse() {
|
|
126845
126990
|
for (let i = 0, len = this._rootNodes.length; i < len; i++) {
|
|
126846
126991
|
const rootNode = this._rootNodes[i];
|
|
126847
|
-
const
|
|
126848
|
-
this._collapseNode(
|
|
126992
|
+
const nodeId = rootNode.nodeId;
|
|
126993
|
+
this._collapseNode(nodeId);
|
|
126849
126994
|
}
|
|
126850
126995
|
}
|
|
126851
126996
|
|
|
@@ -139491,8 +139636,8 @@ class DotBIMDefaultDataSource {
|
|
|
139491
139636
|
* set ````true```` and will be registered by {@link Entity#id} in {@link Scene#objects}.
|
|
139492
139637
|
* * When loading, can set the World-space position, scale and rotation of each model within World space,
|
|
139493
139638
|
* along with initial properties for all the model's {@link Entity}s.
|
|
139494
|
-
* * Allows to mask which
|
|
139495
|
-
* * Allows to configure initial viewer state for specified
|
|
139639
|
+
* * Allows to mask which types we want to load.
|
|
139640
|
+
* * Allows to configure initial viewer state for specified types (color, visibility, selection, highlighted, X-rayed, pickable, etc).
|
|
139496
139641
|
*
|
|
139497
139642
|
* ## Usage
|
|
139498
139643
|
*
|
|
@@ -139562,9 +139707,9 @@ class DotBIMDefaultDataSource {
|
|
|
139562
139707
|
* });
|
|
139563
139708
|
* ````
|
|
139564
139709
|
*
|
|
139565
|
-
* ## Including and excluding
|
|
139710
|
+
* ## Including and excluding types
|
|
139566
139711
|
*
|
|
139567
|
-
* We can also load only those objects that have the specified
|
|
139712
|
+
* We can also load only those objects that have the specified types. In the example below, we'll load only the
|
|
139568
139713
|
* objects that represent walls.
|
|
139569
139714
|
*
|
|
139570
139715
|
* ````javascript
|
|
@@ -139575,7 +139720,7 @@ class DotBIMDefaultDataSource {
|
|
|
139575
139720
|
* });
|
|
139576
139721
|
* ````
|
|
139577
139722
|
*
|
|
139578
|
-
* We can also load only those objects that **don't** have the specified
|
|
139723
|
+
* We can also load only those objects that **don't** have the specified types. In the example below, we'll load only the
|
|
139579
139724
|
* objects that do not represent empty space.
|
|
139580
139725
|
*
|
|
139581
139726
|
* ````javascript
|
|
@@ -139586,13 +139731,13 @@ class DotBIMDefaultDataSource {
|
|
|
139586
139731
|
* });
|
|
139587
139732
|
* ````
|
|
139588
139733
|
*
|
|
139589
|
-
* # Configuring initial
|
|
139734
|
+
* # Configuring initial object appearances
|
|
139590
139735
|
*
|
|
139591
|
-
* We can specify the custom initial appearance of loaded objects according to their
|
|
139736
|
+
* We can specify the custom initial appearance of loaded objects according to their types.
|
|
139592
139737
|
*
|
|
139593
139738
|
* This is useful for things like:
|
|
139594
139739
|
*
|
|
139595
|
-
* * setting the colors to our objects according to their
|
|
139740
|
+
* * setting the colors to our objects according to their types,
|
|
139596
139741
|
* * automatically hiding ````IfcSpace```` objects, and
|
|
139597
139742
|
* * ensuring that ````IfcWindow```` objects are always transparent.
|
|
139598
139743
|
* <br>
|
|
@@ -139624,7 +139769,7 @@ class DotBIMDefaultDataSource {
|
|
|
139624
139769
|
* });
|
|
139625
139770
|
* ````
|
|
139626
139771
|
*
|
|
139627
|
-
* When we don't customize the appearance of
|
|
139772
|
+
* When we don't customize the appearance of types, as just above, then IfcSpace elements tend to obscure other
|
|
139628
139773
|
* elements, which can be confusing.
|
|
139629
139774
|
*
|
|
139630
139775
|
* It's often helpful to make IfcSpaces transparent and unpickable, like this:
|
|
@@ -139824,36 +139969,36 @@ class DotBIMLoaderPlugin extends Plugin {
|
|
|
139824
139969
|
|
|
139825
139970
|
const dbMeshLoaded = {};
|
|
139826
139971
|
|
|
139827
|
-
const
|
|
139828
|
-
const
|
|
139829
|
-
const
|
|
139830
|
-
const
|
|
139972
|
+
const projectId = math.createUUID();
|
|
139973
|
+
const siteId = math.createUUID();
|
|
139974
|
+
const buildingId = math.createUUID();
|
|
139975
|
+
const buildingStoryId = math.createUUID();
|
|
139831
139976
|
|
|
139832
139977
|
const metaModelData = {
|
|
139833
139978
|
metaObjects: [
|
|
139834
139979
|
{
|
|
139835
|
-
id:
|
|
139836
|
-
name: "
|
|
139837
|
-
type: "
|
|
139980
|
+
id: projectId,
|
|
139981
|
+
name: "Project",
|
|
139982
|
+
type: "Project",
|
|
139838
139983
|
parent: null
|
|
139839
139984
|
},
|
|
139840
139985
|
{
|
|
139841
|
-
id:
|
|
139842
|
-
name: "
|
|
139843
|
-
type: "
|
|
139844
|
-
parent:
|
|
139986
|
+
id: siteId,
|
|
139987
|
+
name: "Site",
|
|
139988
|
+
type: "Site",
|
|
139989
|
+
parent: projectId
|
|
139845
139990
|
},
|
|
139846
139991
|
{
|
|
139847
|
-
id:
|
|
139848
|
-
name: "
|
|
139849
|
-
type: "
|
|
139850
|
-
parent:
|
|
139992
|
+
id: buildingId,
|
|
139993
|
+
name: "Building",
|
|
139994
|
+
type: "Building",
|
|
139995
|
+
parent: siteId
|
|
139851
139996
|
},
|
|
139852
139997
|
{
|
|
139853
|
-
id:
|
|
139854
|
-
name: "
|
|
139855
|
-
type: "
|
|
139856
|
-
parent:
|
|
139998
|
+
id: buildingStoryId,
|
|
139999
|
+
name: "BuildingStorey",
|
|
140000
|
+
type: "BuildingStorey",
|
|
140001
|
+
parent: buildingId
|
|
139857
140002
|
}
|
|
139858
140003
|
],
|
|
139859
140004
|
propertySets: []
|
|
@@ -140020,30 +140165,23 @@ class DotBIMLoaderPlugin extends Plugin {
|
|
|
140020
140165
|
});
|
|
140021
140166
|
}
|
|
140022
140167
|
|
|
140168
|
+
let properties = [];
|
|
140023
140169
|
for (let infoKey in info) {
|
|
140024
|
-
|
|
140025
|
-
|
|
140026
|
-
|
|
140027
|
-
|
|
140028
|
-
}
|
|
140029
|
-
properties.push({
|
|
140030
|
-
name: infoKey,
|
|
140031
|
-
value: info[infoKey]
|
|
140032
|
-
});
|
|
140033
|
-
}
|
|
140034
|
-
if (properties) {
|
|
140035
|
-
metaModelData.propertySets.push({
|
|
140036
|
-
id: objectId,
|
|
140037
|
-
properties
|
|
140038
|
-
});
|
|
140039
|
-
}
|
|
140170
|
+
properties.push({
|
|
140171
|
+
name: infoKey,
|
|
140172
|
+
value: info[infoKey]
|
|
140173
|
+
});
|
|
140040
140174
|
}
|
|
140175
|
+
metaModelData.propertySets.push({
|
|
140176
|
+
id: objectId,
|
|
140177
|
+
properties
|
|
140178
|
+
});
|
|
140041
140179
|
|
|
140042
140180
|
metaModelData.metaObjects.push({
|
|
140043
140181
|
id: objectId,
|
|
140044
140182
|
name: info && info.Name && info.Name !== "None" ? info.Name : `${element.type} ${objectId}`,
|
|
140045
140183
|
type: element.type,
|
|
140046
|
-
parent:
|
|
140184
|
+
parent: buildingStoryId,
|
|
140047
140185
|
propertySetIds: [objectId]
|
|
140048
140186
|
});
|
|
140049
140187
|
}
|
|
@@ -140501,122 +140639,6 @@ const mousePointSelector = function(viewer, ray2WorldPos) {
|
|
|
140501
140639
|
};
|
|
140502
140640
|
};
|
|
140503
140641
|
|
|
140504
|
-
const touchPointSelector = function(viewer, pointerCircle, ray2WorldPos) {
|
|
140505
|
-
return function(onCancel, onChange, onCommit) {
|
|
140506
|
-
const scene = viewer.scene;
|
|
140507
|
-
const canvas = scene.canvas.canvas;
|
|
140508
|
-
const longTouchTimeoutMs = 300;
|
|
140509
|
-
const moveTolerance = 20;
|
|
140510
|
-
|
|
140511
|
-
const copyCanvasPos = (event, vec2) => {
|
|
140512
|
-
vec2[0] = event.clientX;
|
|
140513
|
-
vec2[1] = event.clientY;
|
|
140514
|
-
transformToNode(canvas.ownerDocument.documentElement, canvas, vec2);
|
|
140515
|
-
return vec2;
|
|
140516
|
-
};
|
|
140517
|
-
|
|
140518
|
-
const pickWorldPos = canvasPos => {
|
|
140519
|
-
const origin = math.vec3();
|
|
140520
|
-
const direction = math.vec3();
|
|
140521
|
-
math.canvasPosToWorldRay(canvas, scene.camera.viewMatrix, scene.camera.projMatrix, scene.camera.projection, canvasPos, origin, direction);
|
|
140522
|
-
return ray2WorldPos(origin, direction);
|
|
140523
|
-
};
|
|
140524
|
-
|
|
140525
|
-
let longTouchTimeout = null;
|
|
140526
|
-
const nop = () => { };
|
|
140527
|
-
let onSingleTouchMove = nop;
|
|
140528
|
-
let startTouchIdentifier;
|
|
140529
|
-
|
|
140530
|
-
const resetAction = function() {
|
|
140531
|
-
pointerCircle.stop();
|
|
140532
|
-
clearTimeout(longTouchTimeout);
|
|
140533
|
-
viewer.cameraControl.active = true;
|
|
140534
|
-
onSingleTouchMove = nop;
|
|
140535
|
-
startTouchIdentifier = null;
|
|
140536
|
-
};
|
|
140537
|
-
|
|
140538
|
-
const cleanup = function() {
|
|
140539
|
-
resetAction();
|
|
140540
|
-
canvas.removeEventListener("touchstart", onCanvasTouchStart);
|
|
140541
|
-
canvas.removeEventListener("touchmove", onCanvasTouchMove);
|
|
140542
|
-
canvas.removeEventListener("touchend", onCanvasTouchEnd);
|
|
140543
|
-
};
|
|
140544
|
-
|
|
140545
|
-
const onCanvasTouchStart = function(event) {
|
|
140546
|
-
const touches = event.touches;
|
|
140547
|
-
|
|
140548
|
-
if (touches.length !== 1)
|
|
140549
|
-
{
|
|
140550
|
-
resetAction();
|
|
140551
|
-
onCancel();
|
|
140552
|
-
}
|
|
140553
|
-
else
|
|
140554
|
-
{
|
|
140555
|
-
const startTouch = touches[0];
|
|
140556
|
-
const startCanvasPos = copyCanvasPos(startTouch, math.vec2());
|
|
140557
|
-
|
|
140558
|
-
const startWorldPos = pickWorldPos(startCanvasPos);
|
|
140559
|
-
if (startWorldPos)
|
|
140560
|
-
{
|
|
140561
|
-
startTouchIdentifier = startTouch.identifier;
|
|
140562
|
-
|
|
140563
|
-
onSingleTouchMove = canvasPos => {
|
|
140564
|
-
if (math.distVec2(startCanvasPos, canvasPos) > moveTolerance)
|
|
140565
|
-
{
|
|
140566
|
-
resetAction();
|
|
140567
|
-
}
|
|
140568
|
-
};
|
|
140569
|
-
|
|
140570
|
-
longTouchTimeout = setTimeout(
|
|
140571
|
-
function() {
|
|
140572
|
-
pointerCircle.start(startCanvasPos);
|
|
140573
|
-
|
|
140574
|
-
longTouchTimeout = setTimeout(
|
|
140575
|
-
function() {
|
|
140576
|
-
pointerCircle.stop();
|
|
140577
|
-
|
|
140578
|
-
viewer.cameraControl.active = false;
|
|
140579
|
-
|
|
140580
|
-
onSingleTouchMove = canvasPos => {
|
|
140581
|
-
onChange(canvasPos, pickWorldPos(canvasPos));
|
|
140582
|
-
};
|
|
140583
|
-
|
|
140584
|
-
onSingleTouchMove(startCanvasPos);
|
|
140585
|
-
},
|
|
140586
|
-
longTouchTimeoutMs);
|
|
140587
|
-
},
|
|
140588
|
-
250);
|
|
140589
|
-
}
|
|
140590
|
-
}
|
|
140591
|
-
};
|
|
140592
|
-
canvas.addEventListener("touchstart", onCanvasTouchStart, {passive: true});
|
|
140593
|
-
|
|
140594
|
-
// canvas.addEventListener("touchcancel", e => console.log("touchcancel", e), {passive: true});
|
|
140595
|
-
|
|
140596
|
-
const onCanvasTouchMove = function(event) {
|
|
140597
|
-
const touch = [...event.changedTouches].find(e => e.identifier === startTouchIdentifier);
|
|
140598
|
-
if (touch)
|
|
140599
|
-
{
|
|
140600
|
-
onSingleTouchMove(copyCanvasPos(touch, math.vec2()));
|
|
140601
|
-
}
|
|
140602
|
-
};
|
|
140603
|
-
canvas.addEventListener("touchmove", onCanvasTouchMove, {passive: true});
|
|
140604
|
-
|
|
140605
|
-
const onCanvasTouchEnd = function(event) {
|
|
140606
|
-
const touch = [...event.changedTouches].find(e => e.identifier === startTouchIdentifier);
|
|
140607
|
-
if (touch)
|
|
140608
|
-
{
|
|
140609
|
-
cleanup();
|
|
140610
|
-
const canvasPos = copyCanvasPos(touch, math.vec2());
|
|
140611
|
-
onCommit(canvasPos, pickWorldPos(canvasPos));
|
|
140612
|
-
}
|
|
140613
|
-
};
|
|
140614
|
-
canvas.addEventListener("touchend", onCanvasTouchEnd, {passive: true});
|
|
140615
|
-
|
|
140616
|
-
return cleanup;
|
|
140617
|
-
};
|
|
140618
|
-
};
|
|
140619
|
-
|
|
140620
140642
|
const planeIntersect = function(p0, n, origin, direction) {
|
|
140621
140643
|
const t = - (math.dotVec3(origin, n) - p0) / math.dotVec3(direction, n);
|
|
140622
140644
|
{
|
|
@@ -141957,4 +141979,4 @@ class ZoneTranslateTouchControl extends ZoneTranslateControl {
|
|
|
141957
141979
|
}
|
|
141958
141980
|
}
|
|
141959
141981
|
|
|
141960
|
-
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, DefaultLoadingManager, DepthFormat, DepthStencilFormat, DirLight, DistanceMeasurementEditControl, DistanceMeasurementEditMouseControl, DistanceMeasurementEditTouchControl, DistanceMeasurementsControl, DistanceMeasurementsMouseControl, DistanceMeasurementsPlugin, DistanceMeasurementsTouchControl, DotBIMDefaultDataSource, DotBIMLoaderPlugin, EdgeMaterial, EmphasisMaterial, FaceAlignedSectionPlanesPlugin, FastNavPlugin, FloatType, Fresnel, Frustum$1 as Frustum, FrustumPlane, GIFMediaType, GLTFDefaultDataSource, GLTFLoaderPlugin, HalfFloatType, ImagePlane, IntType, JPEGMediaType, KTX2TextureTranscoder, LASLoaderPlugin, 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$2 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, Skybox, SkyboxesPlugin, SpecularMaterial, SplineCurve, SpriteMarker, StoreyViewsPlugin, Texture, TextureTranscoder, TreeViewPlugin, UnsignedByteType, UnsignedInt248Type, UnsignedIntType, UnsignedShort4444Type, UnsignedShort5551Type, UnsignedShortType, VBOGeometry, ViewCullPlugin, Viewer, WebIFCLoaderPlugin, WorkerPool$1 as WorkerPool, XKTDefaultDataSource, XKTLoaderPlugin, XML3DLoaderPlugin, ZoneEditControl, ZoneEditMouseControl, ZoneEditTouchControl, ZoneTranslateControl, ZoneTranslateMouseControl, ZoneTranslateTouchControl, ZonesMouseControl, ZonesPlugin, ZonesPolysurfaceMouseControl, ZonesPolysurfaceTouchControl, ZonesTouchControl, buildBoxGeometry, buildBoxLinesGeometry, buildBoxLinesGeometryFromAABB, buildCylinderGeometry, buildGridGeometry, buildLineGeometry, buildPlaneGeometry, buildPolylineGeometry, buildPolylineGeometryFromCurve, buildSphereGeometry, buildTorusGeometry, buildVectorTextGeometry, createRTCViewMat, frustumIntersectsAABB3, getKTX2TextureTranscoder, getPlaneRTCPos, isTriangleMeshSolid, load3DSGeometry, loadOBJGeometry, math, meshSurfaceArea, meshVolume, rtcToWorldPos, sRGBEncoding, setFrustum, stats, utils, worldToRTCPos, worldToRTCPositions };
|
|
141982
|
+
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, 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, 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$2 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, Skybox, SkyboxesPlugin, SpecularMaterial, SplineCurve, SpriteMarker, StoreyViewsPlugin, Texture, TextureTranscoder, TreeViewPlugin, UnsignedByteType, UnsignedInt248Type, UnsignedIntType, UnsignedShort4444Type, UnsignedShort5551Type, UnsignedShortType, VBOGeometry, ViewCullPlugin, Viewer, WebIFCLoaderPlugin, WorkerPool$1 as WorkerPool, XKTDefaultDataSource, XKTLoaderPlugin, XML3DLoaderPlugin, ZoneEditControl, ZoneEditMouseControl, ZoneEditTouchControl, ZoneTranslateControl, ZoneTranslateMouseControl, ZoneTranslateTouchControl, ZonesMouseControl, ZonesPlugin, ZonesPolysurfaceMouseControl, ZonesPolysurfaceTouchControl, ZonesTouchControl, activateDraggableDot, activateDraggableDots, buildBoxGeometry, buildBoxLinesGeometry, buildBoxLinesGeometryFromAABB, buildCylinderGeometry, buildGridGeometry, buildLineGeometry, buildPlaneGeometry, buildPolylineGeometry, buildPolylineGeometryFromCurve, buildSphereGeometry, buildTorusGeometry, buildVectorTextGeometry, createRTCViewMat, frustumIntersectsAABB3, getKTX2TextureTranscoder, getPlaneRTCPos, isTriangleMeshSolid, load3DSGeometry, loadOBJGeometry, math, meshSurfaceArea, meshVolume, rtcToWorldPos, sRGBEncoding, setFrustum, stats, touchPointSelector$1 as touchPointSelector, transformToNode, utils, worldToRTCPos, worldToRTCPositions };
|