@xeokit/xeokit-sdk 2.6.31 → 2.6.33
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/README.md +17 -23
- package/dist/xeokit-sdk.cjs.js +312 -320
- package/dist/xeokit-sdk.es.js +312 -320
- package/dist/xeokit-sdk.es5.js +438 -414
- package/dist/xeokit-sdk.min.cjs.js +4 -4
- package/dist/xeokit-sdk.min.es.js +4 -4
- package/dist/xeokit-sdk.min.es5.js +3 -3
- package/package.json +1 -1
- package/src/extras/PointerLens/PointerLens.js +14 -6
- package/src/plugins/DistanceMeasurementsPlugin/DistanceMeasurement.js +59 -9
- package/src/plugins/XKTLoaderPlugin/XKTLoaderPlugin.js +5 -1
- package/src/plugins/ZonesPlugin/ZonesPlugin.js +97 -148
- package/src/plugins/lib/html/Dot.js +2 -2
- package/src/viewer/scene/math/MeshVolume.js +1 -1
- package/src/viewer/scene/model/vbo/instancing/lines/VBOInstancingLinesLayer.js +3 -1
- package/src/viewer/scene/model/vbo/instancing/triangles/VBOInstancingTrianglesLayer.js +9 -7
- package/src/viewer/scene/webgl/Renderer.js +126 -151
- package/types/extras/ContextMenu/ContextMenu.d.ts +2 -0
- package/types/extras/PointerLens/PointerLens.d.ts +47 -0
- package/types/plugins/DistanceMeasurementsPlugin/DistanceMeasurement.d.ts +18 -0
- package/types/plugins/DistanceMeasurementsPlugin/DistanceMeasurementsPlugin.d.ts +12 -0
- package/types/plugins/LASLoaderPlugin/LASLoaderPlugin.d.ts +4 -0
- package/types/plugins/NavCubePlugin/NavCubePlugin.d.ts +7 -7
- package/types/plugins/StoreyViewsPlugin/StoreyViewsPlugin.d.ts +19 -0
- package/types/viewer/scene/scene/Scene.d.ts +23 -0
|
@@ -32,6 +32,9 @@ const Renderer = function (scene, options) {
|
|
|
32
32
|
let drawableTypeInfo = {};
|
|
33
33
|
let drawables = {};
|
|
34
34
|
|
|
35
|
+
let postSortDrawableList = [];
|
|
36
|
+
let postCullDrawableList = [];
|
|
37
|
+
|
|
35
38
|
let drawableListDirty = true;
|
|
36
39
|
let stateSortDirty = true;
|
|
37
40
|
let imageDirty = true;
|
|
@@ -264,33 +267,33 @@ const Renderer = function (scene, options) {
|
|
|
264
267
|
}
|
|
265
268
|
|
|
266
269
|
function sortDrawableList() {
|
|
270
|
+
let lenDrawableList = 0;
|
|
267
271
|
for (let type in drawableTypeInfo) {
|
|
268
272
|
if (drawableTypeInfo.hasOwnProperty(type)) {
|
|
269
273
|
const drawableInfo = drawableTypeInfo[type];
|
|
270
|
-
|
|
271
|
-
|
|
274
|
+
const drawableListPreCull = drawableInfo.drawableListPreCull;
|
|
275
|
+
for (let i = 0, len = drawableListPreCull.length; i < len; i++) {
|
|
276
|
+
const drawable = drawableListPreCull[i];
|
|
277
|
+
postSortDrawableList[lenDrawableList++] = drawable;
|
|
272
278
|
}
|
|
273
279
|
}
|
|
274
280
|
}
|
|
281
|
+
postSortDrawableList.length = lenDrawableList;
|
|
282
|
+
postSortDrawableList.sort((a, b) => {
|
|
283
|
+
return a.renderOrder - b.renderOrder;
|
|
284
|
+
});
|
|
275
285
|
}
|
|
276
286
|
|
|
277
287
|
function cullDrawableList() {
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
for (let i = 0, len = drawableListPreCull.length; i < len; i++) {
|
|
285
|
-
const drawable = drawableListPreCull[i];
|
|
286
|
-
drawable.rebuildRenderFlags();
|
|
287
|
-
if (!drawable.renderFlags.culled) {
|
|
288
|
-
drawableList[lenDrawableList++] = drawable;
|
|
289
|
-
}
|
|
290
|
-
}
|
|
291
|
-
drawableList.length = lenDrawableList;
|
|
288
|
+
let lenDrawableList = 0;
|
|
289
|
+
for (let i = 0, len = postSortDrawableList.length; i < len; i++) {
|
|
290
|
+
const drawable = postSortDrawableList[i];
|
|
291
|
+
drawable.rebuildRenderFlags();
|
|
292
|
+
if (!drawable.renderFlags.culled) {
|
|
293
|
+
postCullDrawableList[lenDrawableList++] = drawable;
|
|
292
294
|
}
|
|
293
295
|
}
|
|
296
|
+
postCullDrawableList.length = lenDrawableList;
|
|
294
297
|
}
|
|
295
298
|
|
|
296
299
|
function draw(params) {
|
|
@@ -366,25 +369,16 @@ const Renderer = function (scene, options) {
|
|
|
366
369
|
if (params.clear !== false) {
|
|
367
370
|
gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);
|
|
368
371
|
}
|
|
372
|
+
for (let i = 0, len = postCullDrawableList.length; i < len; i++) {
|
|
369
373
|
|
|
370
|
-
|
|
371
|
-
if (drawableTypeInfo.hasOwnProperty(type)) {
|
|
372
|
-
|
|
373
|
-
const drawableInfo = drawableTypeInfo[type];
|
|
374
|
-
const drawableList = drawableInfo.drawableList;
|
|
375
|
-
|
|
376
|
-
for (let i = 0, len = drawableList.length; i < len; i++) {
|
|
377
|
-
|
|
378
|
-
const drawable = drawableList[i];
|
|
374
|
+
const drawable = postCullDrawableList[i];
|
|
379
375
|
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
376
|
+
if (drawable.culled === true || drawable.visible === false || !drawable.drawDepth || !drawable.saoEnabled) {
|
|
377
|
+
continue;
|
|
378
|
+
}
|
|
383
379
|
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
}
|
|
387
|
-
}
|
|
380
|
+
if (drawable.renderFlags.colorOpaque) {
|
|
381
|
+
drawable.drawDepth(frameCtx);
|
|
388
382
|
}
|
|
389
383
|
}
|
|
390
384
|
|
|
@@ -567,93 +561,85 @@ const Renderer = function (scene, options) {
|
|
|
567
561
|
// Render normal opaque solids, defer others to bins to render after
|
|
568
562
|
//------------------------------------------------------------------------------------------------------
|
|
569
563
|
|
|
570
|
-
for (let
|
|
571
|
-
if (drawableTypeInfo.hasOwnProperty(type)) {
|
|
572
|
-
|
|
573
|
-
const drawableInfo = drawableTypeInfo[type];
|
|
574
|
-
const drawableList = drawableInfo.drawableList;
|
|
575
|
-
|
|
576
|
-
for (i = 0, len = drawableList.length; i < len; i++) {
|
|
564
|
+
for (let i = 0, len = postCullDrawableList.length; i < len; i++) {
|
|
577
565
|
|
|
578
|
-
|
|
566
|
+
drawable = postCullDrawableList[i];
|
|
579
567
|
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
568
|
+
if (drawable.culled === true || drawable.visible === false) {
|
|
569
|
+
continue;
|
|
570
|
+
}
|
|
583
571
|
|
|
584
|
-
|
|
572
|
+
const renderFlags = drawable.renderFlags;
|
|
585
573
|
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
574
|
+
if (renderFlags.colorOpaque) {
|
|
575
|
+
if (saoEnabled && saoPossible && drawable.saoEnabled) {
|
|
576
|
+
normalDrawSAOBin[normalDrawSAOBinLen++] = drawable;
|
|
577
|
+
} else {
|
|
578
|
+
drawable.drawColorOpaque(frameCtx);
|
|
579
|
+
}
|
|
580
|
+
}
|
|
593
581
|
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
582
|
+
if (transparentEnabled) {
|
|
583
|
+
if (renderFlags.colorTransparent) {
|
|
584
|
+
normalFillTransparentBin[normalFillTransparentBinLen++] = drawable;
|
|
585
|
+
}
|
|
586
|
+
}
|
|
599
587
|
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
588
|
+
if (renderFlags.xrayedSilhouetteTransparent) {
|
|
589
|
+
xrayedFillTransparentBin[xrayedFillTransparentBinLen++] = drawable;
|
|
590
|
+
}
|
|
603
591
|
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
592
|
+
if (renderFlags.xrayedSilhouetteOpaque) {
|
|
593
|
+
xrayedFillOpaqueBin[xrayedFillOpaqueBinLen++] = drawable;
|
|
594
|
+
}
|
|
607
595
|
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
596
|
+
if (renderFlags.highlightedSilhouetteTransparent) {
|
|
597
|
+
highlightedFillTransparentBin[highlightedFillTransparentBinLen++] = drawable;
|
|
598
|
+
}
|
|
611
599
|
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
600
|
+
if (renderFlags.highlightedSilhouetteOpaque) {
|
|
601
|
+
highlightedFillOpaqueBin[highlightedFillOpaqueBinLen++] = drawable;
|
|
602
|
+
}
|
|
615
603
|
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
604
|
+
if (renderFlags.selectedSilhouetteTransparent) {
|
|
605
|
+
selectedFillTransparentBin[selectedFillTransparentBinLen++] = drawable;
|
|
606
|
+
}
|
|
619
607
|
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
608
|
+
if (renderFlags.selectedSilhouetteOpaque) {
|
|
609
|
+
selectedFillOpaqueBin[selectedFillOpaqueBinLen++] = drawable;
|
|
610
|
+
}
|
|
623
611
|
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
612
|
+
if (drawable.edges && edgesEnabled) {
|
|
613
|
+
if (renderFlags.edgesOpaque) {
|
|
614
|
+
normalEdgesOpaqueBin[normalEdgesOpaqueBinLen++] = drawable;
|
|
615
|
+
}
|
|
628
616
|
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
617
|
+
if (renderFlags.edgesTransparent) {
|
|
618
|
+
normalEdgesTransparentBin[normalEdgesTransparentBinLen++] = drawable;
|
|
619
|
+
}
|
|
632
620
|
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
621
|
+
if (renderFlags.selectedEdgesTransparent) {
|
|
622
|
+
selectedEdgesTransparentBin[selectedEdgesTransparentBinLen++] = drawable;
|
|
623
|
+
}
|
|
636
624
|
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
625
|
+
if (renderFlags.selectedEdgesOpaque) {
|
|
626
|
+
selectedEdgesOpaqueBin[selectedEdgesOpaqueBinLen++] = drawable;
|
|
627
|
+
}
|
|
640
628
|
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
629
|
+
if (renderFlags.xrayedEdgesTransparent) {
|
|
630
|
+
xrayEdgesTransparentBin[xrayEdgesTransparentBinLen++] = drawable;
|
|
631
|
+
}
|
|
644
632
|
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
633
|
+
if (renderFlags.xrayedEdgesOpaque) {
|
|
634
|
+
xrayEdgesOpaqueBin[xrayEdgesOpaqueBinLen++] = drawable;
|
|
635
|
+
}
|
|
648
636
|
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
637
|
+
if (renderFlags.highlightedEdgesTransparent) {
|
|
638
|
+
highlightedEdgesTransparentBin[highlightedEdgesTransparentBinLen++] = drawable;
|
|
639
|
+
}
|
|
652
640
|
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
}
|
|
656
|
-
}
|
|
641
|
+
if (renderFlags.highlightedEdgesOpaque) {
|
|
642
|
+
highlightedEdgesOpaqueBin[highlightedEdgesOpaqueBinLen++] = drawable;
|
|
657
643
|
}
|
|
658
644
|
}
|
|
659
645
|
}
|
|
@@ -1063,7 +1049,7 @@ const Renderer = function (scene, options) {
|
|
|
1063
1049
|
frameCtx.pickInvisible = !!params.pickInvisible;
|
|
1064
1050
|
frameCtx.pickClipPos = [
|
|
1065
1051
|
getClipPosX(canvasPos[0] * resolutionScale, gl.drawingBufferWidth),
|
|
1066
|
-
getClipPosY(canvasPos[1] * resolutionScale, gl.drawingBufferHeight)
|
|
1052
|
+
getClipPosY(canvasPos[1] * resolutionScale, gl.drawingBufferHeight)
|
|
1067
1053
|
];
|
|
1068
1054
|
|
|
1069
1055
|
gl.viewport(0, 0, 1, 1);
|
|
@@ -1076,30 +1062,23 @@ const Renderer = function (scene, options) {
|
|
|
1076
1062
|
const includeEntityIds = params.includeEntityIds;
|
|
1077
1063
|
const excludeEntityIds = params.excludeEntityIds;
|
|
1078
1064
|
|
|
1079
|
-
for (let
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
if (!drawable.drawPickMesh || (params.pickInvisible !== true && drawable.visible === false) || drawable.pickable === false) {
|
|
1090
|
-
continue;
|
|
1091
|
-
}
|
|
1092
|
-
if (includeEntityIds && !includeEntityIds[drawable.id]) { // TODO: push this logic into drawable
|
|
1093
|
-
continue;
|
|
1094
|
-
}
|
|
1095
|
-
if (excludeEntityIds && excludeEntityIds[drawable.id]) {
|
|
1096
|
-
continue;
|
|
1097
|
-
}
|
|
1098
|
-
|
|
1099
|
-
drawable.drawPickMesh(frameCtx);
|
|
1100
|
-
}
|
|
1065
|
+
for (let i = 0, len = postCullDrawableList.length; i < len; i++) {
|
|
1066
|
+
const drawable = postCullDrawableList[i];
|
|
1067
|
+
if (drawable.culled === true || drawable.visible === false) {
|
|
1068
|
+
continue;
|
|
1069
|
+
}
|
|
1070
|
+
if (!drawable.drawPickMesh || (params.pickInvisible !== true && drawable.visible === false) || drawable.pickable === false) {
|
|
1071
|
+
continue;
|
|
1072
|
+
}
|
|
1073
|
+
if (includeEntityIds && !includeEntityIds[drawable.id]) { // TODO: push this logic into drawable
|
|
1074
|
+
continue;
|
|
1101
1075
|
}
|
|
1076
|
+
if (excludeEntityIds && excludeEntityIds[drawable.id]) {
|
|
1077
|
+
continue;
|
|
1078
|
+
}
|
|
1079
|
+
drawable.drawPickMesh(frameCtx);
|
|
1102
1080
|
}
|
|
1081
|
+
|
|
1103
1082
|
const pix = pickBuffer.read(0, 0);
|
|
1104
1083
|
const pickID = pix[0] + (pix[1] << 8) + (pix[2] << 16) + (pix[3] << 24);
|
|
1105
1084
|
|
|
@@ -1129,7 +1108,7 @@ const Renderer = function (scene, options) {
|
|
|
1129
1108
|
// frameCtx.pickInvisible = !!params.pickInvisible;
|
|
1130
1109
|
frameCtx.pickClipPos = [
|
|
1131
1110
|
getClipPosX(canvasPos[0] * resolutionScale, gl.drawingBufferWidth),
|
|
1132
|
-
getClipPosY(canvasPos[1] * resolutionScale, gl.drawingBufferHeight)
|
|
1111
|
+
getClipPosY(canvasPos[1] * resolutionScale, gl.drawingBufferHeight)
|
|
1133
1112
|
];
|
|
1134
1113
|
|
|
1135
1114
|
gl.viewport(0, 0, 1, 1);
|
|
@@ -1178,7 +1157,7 @@ const Renderer = function (scene, options) {
|
|
|
1178
1157
|
frameCtx.pickElementsOffset = pickable.pickElementsOffset;
|
|
1179
1158
|
frameCtx.pickClipPos = [
|
|
1180
1159
|
getClipPosX(canvasPos[0] * resolutionScale, gl.drawingBufferWidth),
|
|
1181
|
-
getClipPosY(canvasPos[1] * resolutionScale, gl.drawingBufferHeight)
|
|
1160
|
+
getClipPosY(canvasPos[1] * resolutionScale, gl.drawingBufferHeight)
|
|
1182
1161
|
];
|
|
1183
1162
|
|
|
1184
1163
|
gl.viewport(0, 0, 1, 1);
|
|
@@ -1243,15 +1222,14 @@ const Renderer = function (scene, options) {
|
|
|
1243
1222
|
function drawSnapInit(frameCtx) {
|
|
1244
1223
|
frameCtx.snapPickLayerParams = [];
|
|
1245
1224
|
frameCtx.snapPickLayerNumber = 0;
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
}
|
|
1225
|
+
|
|
1226
|
+
for (let i = 0, len = postCullDrawableList.length; i < len; i++) {
|
|
1227
|
+
|
|
1228
|
+
const drawable = postCullDrawableList[i];
|
|
1229
|
+
|
|
1230
|
+
if (drawable.drawSnapInit) {
|
|
1231
|
+
if (!drawable.culled && drawable.visible && drawable.pickable) {
|
|
1232
|
+
drawable.drawSnapInit(frameCtx);
|
|
1255
1233
|
}
|
|
1256
1234
|
}
|
|
1257
1235
|
}
|
|
@@ -1261,11 +1239,11 @@ const Renderer = function (scene, options) {
|
|
|
1261
1239
|
function drawSnap(frameCtx) {
|
|
1262
1240
|
frameCtx.snapPickLayerParams = frameCtx.snapPickLayerParams || [];
|
|
1263
1241
|
frameCtx.snapPickLayerNumber = frameCtx.snapPickLayerParams.length;
|
|
1264
|
-
for (let
|
|
1265
|
-
|
|
1266
|
-
const
|
|
1267
|
-
|
|
1268
|
-
|
|
1242
|
+
for (let i = 0, len = postCullDrawableList.length; i < len; i++) {
|
|
1243
|
+
|
|
1244
|
+
const drawable = postCullDrawableList[i];
|
|
1245
|
+
|
|
1246
|
+
if (drawable.drawSnapInit) {
|
|
1269
1247
|
if (drawable.drawSnap) {
|
|
1270
1248
|
if (!drawable.culled && drawable.visible && drawable.pickable) {
|
|
1271
1249
|
drawable.drawSnap(frameCtx);
|
|
@@ -1655,19 +1633,16 @@ const Renderer = function (scene, options) {
|
|
|
1655
1633
|
gl.disable(gl.BLEND);
|
|
1656
1634
|
gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);
|
|
1657
1635
|
|
|
1658
|
-
for (let type in drawableTypeInfo) {
|
|
1659
|
-
if (drawableTypeInfo.hasOwnProperty(type)) {
|
|
1660
|
-
const drawableInfo = drawableTypeInfo[type];
|
|
1661
|
-
const drawableList = drawableInfo.drawableList;
|
|
1662
|
-
for (let i = 0, len = drawableList.length; i < len; i++) {
|
|
1663
|
-
const drawable = drawableList[i];
|
|
1664
|
-
if (!drawable.drawOcclusion || drawable.culled === true || drawable.visible === false || drawable.pickable === false) { // TODO: Option to exclude transparent?
|
|
1665
|
-
continue;
|
|
1666
|
-
}
|
|
1667
1636
|
|
|
1668
|
-
|
|
1669
|
-
|
|
1637
|
+
for (let i = 0, len = postCullDrawableList.length; i < len; i++) {
|
|
1638
|
+
|
|
1639
|
+
const drawable = postCullDrawableList[i];
|
|
1640
|
+
|
|
1641
|
+
if (!drawable.drawOcclusion || drawable.culled === true || drawable.visible === false || drawable.pickable === false) { // TODO: Option to exclude transparent?
|
|
1642
|
+
continue;
|
|
1670
1643
|
}
|
|
1644
|
+
|
|
1645
|
+
drawable.drawOcclusion(frameCtx);
|
|
1671
1646
|
}
|
|
1672
1647
|
|
|
1673
1648
|
this._occlusionTester.drawMarkers(frameCtx);
|
|
@@ -1794,4 +1769,4 @@ const Renderer = function (scene, options) {
|
|
|
1794
1769
|
};
|
|
1795
1770
|
};
|
|
1796
1771
|
|
|
1797
|
-
export {Renderer};
|
|
1772
|
+
export {Renderer};
|
|
@@ -7,6 +7,8 @@ export declare type ContextMenuConfiguration = {
|
|
|
7
7
|
enabled?: boolean;
|
|
8
8
|
/** Whether this ````ContextMenu```` automatically hides whenever we mouse-down or tap anywhere in the page. */
|
|
9
9
|
hideOnMouseDown?: boolean;
|
|
10
|
+
/** Whether this ````ContextMenu```` automatically hides whenever we call its action. */
|
|
11
|
+
hideOnAction?: boolean;
|
|
10
12
|
};
|
|
11
13
|
|
|
12
14
|
/**
|
|
@@ -47,6 +47,11 @@ export class PointerLens {
|
|
|
47
47
|
constructor(viewer: Viewer, cfg?: {
|
|
48
48
|
active?: boolean;
|
|
49
49
|
zoomFactor?: number;
|
|
50
|
+
containerId?: string;
|
|
51
|
+
lensPosToggle?: boolean,
|
|
52
|
+
lensPosToggleAmount?: number,
|
|
53
|
+
lensPosMarginLeft?: number,
|
|
54
|
+
lensPosMarginTop?: number;
|
|
50
55
|
});
|
|
51
56
|
|
|
52
57
|
/**
|
|
@@ -137,6 +142,48 @@ export class PointerLens {
|
|
|
137
142
|
*/
|
|
138
143
|
get visible(): boolean;
|
|
139
144
|
|
|
145
|
+
/**
|
|
146
|
+
* Sets whether the pointer lens container should toggle position when mouse is over it.
|
|
147
|
+
*
|
|
148
|
+
* @param {boolean} lensPosToggle Whether we should toggle position.
|
|
149
|
+
*/
|
|
150
|
+
set lensPosToggle(lensPosToggle: boolean);
|
|
151
|
+
|
|
152
|
+
/**
|
|
153
|
+
* Gets whether we should toggle position.
|
|
154
|
+
*
|
|
155
|
+
* @returns {boolean} Whether we should toggle position.
|
|
156
|
+
*/
|
|
157
|
+
get lensPosToggle(): boolean;
|
|
158
|
+
|
|
159
|
+
/**
|
|
160
|
+
* Sets whether we toggle position in vertical or horizontal.
|
|
161
|
+
*
|
|
162
|
+
* @param {boolean} lensPosToggleVertical Vertical or horizontal change.
|
|
163
|
+
*/
|
|
164
|
+
set lensPosToggleVertical(lensPosToggleVertical: boolean);
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* Gets whether we toggle position in vertical or horizontal.
|
|
168
|
+
*
|
|
169
|
+
* @returns {boolean} Vertical or horizontal change.
|
|
170
|
+
*/
|
|
171
|
+
get lensPosToggleVertical(): boolean;
|
|
172
|
+
|
|
173
|
+
/**
|
|
174
|
+
* Sets amount of pixels we toggle position.
|
|
175
|
+
*
|
|
176
|
+
* @param {number} lensPosToggleAmount Amount of pixels we toggle position.
|
|
177
|
+
*/
|
|
178
|
+
set lensPosToggleAmount(lensPosToggleAmount: number);
|
|
179
|
+
|
|
180
|
+
/**
|
|
181
|
+
* Gets amount of pixels we toggle position.
|
|
182
|
+
*
|
|
183
|
+
* @returns {number} Amount of pixels we toggle position.
|
|
184
|
+
*/
|
|
185
|
+
get lensPosToggleAmount(): number;
|
|
186
|
+
|
|
140
187
|
/**
|
|
141
188
|
* Destroys this PointerLens.
|
|
142
189
|
*/
|
|
@@ -12,6 +12,24 @@ export declare class DistanceMeasurement extends Component {
|
|
|
12
12
|
*/
|
|
13
13
|
plugin: DistanceMeasurementsPlugin;
|
|
14
14
|
|
|
15
|
+
/**
|
|
16
|
+
* Sets the axes basis for the measurement.
|
|
17
|
+
*
|
|
18
|
+
* The value is a 4x4 matrix where each column-vector defines an axis and must have unit length.
|
|
19
|
+
*
|
|
20
|
+
* This is the ```identity``` matrix by default, meaning the measurement axes are the same as the world axes.
|
|
21
|
+
*/
|
|
22
|
+
set axesBasis(value: number[]);
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Gets the axes basis for the measurement.
|
|
26
|
+
*
|
|
27
|
+
* The value is a 4x4 matrix where each column-vector defines an axis and must have unit length.
|
|
28
|
+
*
|
|
29
|
+
* This is the ```identity``` matrix by default, meaning the measurement axes are the same as the world axes.
|
|
30
|
+
*/
|
|
31
|
+
get axesBasis(): number[];
|
|
32
|
+
|
|
15
33
|
/**
|
|
16
34
|
* Sets whether this DistanceMeasurement indicates that its measurement is approximate.
|
|
17
35
|
*
|
|
@@ -200,6 +200,18 @@ export declare class DistanceMeasurementsPlugin extends Plugin {
|
|
|
200
200
|
labelsOnWires?: boolean;
|
|
201
201
|
}): DistanceMeasurement;
|
|
202
202
|
|
|
203
|
+
/**
|
|
204
|
+
* Gets whether the distance measurement axis are visible.
|
|
205
|
+
* @returns {Boolean}
|
|
206
|
+
*/
|
|
207
|
+
getAxisVisible(): boolean;
|
|
208
|
+
|
|
209
|
+
/**
|
|
210
|
+
* Sets whether the distance measurement axis are visible.
|
|
211
|
+
* @param {Boolean} axisVisible
|
|
212
|
+
*/
|
|
213
|
+
setAxisVisible(axisVisible: boolean): void;
|
|
214
|
+
|
|
203
215
|
/**
|
|
204
216
|
* Destroys a {@link DistanceMeasurement}.
|
|
205
217
|
*
|
|
@@ -32,6 +32,10 @@ export declare type LoadLASModel = {
|
|
|
32
32
|
src?: string;
|
|
33
33
|
/** The LAS file data, as an alternative to the ````src```` parameter. */
|
|
34
34
|
las?: ArrayBuffer;
|
|
35
|
+
/** Create entity with this id */
|
|
36
|
+
entityId?: string;
|
|
37
|
+
/** Creates a MetaModel from json */
|
|
38
|
+
metaModelJSON?: any;
|
|
35
39
|
/** Whether to load metadata for the LAS model. */
|
|
36
40
|
loadMetadata?: boolean;
|
|
37
41
|
/** The model's World-space double-precision 3D origin. Use this to position the model within xeokit's World coordinate system, using double-precision coordinates. */
|
|
@@ -13,11 +13,11 @@ export declare type NavCubePluginConfiguration = {
|
|
|
13
13
|
/** Whether the shadow of the cube is visible. */
|
|
14
14
|
shadowVisible?: boolean;
|
|
15
15
|
/** Whether the {@link Camera} flies or jumps to each selected axis or diagonal. */
|
|
16
|
-
cameraFly?:
|
|
16
|
+
cameraFly?: boolean;
|
|
17
17
|
/** How much of the field-of-view, in degrees, that the 3D scene should fill the {@link Canvas} when the {@link Camera} moves to an axis or diagonal. */
|
|
18
|
-
cameraFitFOV?:
|
|
18
|
+
cameraFitFOV?: number;
|
|
19
19
|
/** When flying the {@link Camera} to each new axis or diagonal, how long, in seconds, that the Camera takes to get there. */
|
|
20
|
-
cameraFlyDuration?:
|
|
20
|
+
cameraFlyDuration?: number;
|
|
21
21
|
/** Custom uniform color for the faces of the NavCube. */
|
|
22
22
|
color?: string;
|
|
23
23
|
/** Custom color for the front face of the NavCube. Overrides ````color````. */
|
|
@@ -131,18 +131,18 @@ export declare class NavCubePlugin extends Plugin {
|
|
|
131
131
|
*
|
|
132
132
|
* Default is ````0.5````.
|
|
133
133
|
*
|
|
134
|
-
* @param {
|
|
134
|
+
* @param {Number} value Camera flight duration in seconds.
|
|
135
135
|
*/
|
|
136
|
-
setCameraFlyDuration(value:
|
|
136
|
+
setCameraFlyDuration(value: number): void;
|
|
137
137
|
|
|
138
138
|
/**
|
|
139
139
|
* When flying the {@link Camera} to each new axis or diagonal, gets how long, in seconds, that the Camera takes to get there.
|
|
140
140
|
*
|
|
141
141
|
* Default is ````0.5````.
|
|
142
142
|
*
|
|
143
|
-
* @returns {
|
|
143
|
+
* @returns {Number} Camera flight duration in seconds.
|
|
144
144
|
*/
|
|
145
|
-
getCameraFlyDuration():
|
|
145
|
+
getCameraFlyDuration(): number;
|
|
146
146
|
|
|
147
147
|
/**
|
|
148
148
|
* Sets whether the NavCube switches between perspective and orthographic projections in synchrony with
|
|
@@ -6,6 +6,8 @@ import { StoreyMap } from "./StoreyMap";
|
|
|
6
6
|
export declare type StoreyViewsPluginConfiguration = {
|
|
7
7
|
/** Optional ID for this plugin, so that we can find it within {@link Viewer.plugins}. */
|
|
8
8
|
id?: string;
|
|
9
|
+
/** Optional configuration, if enabled, the elements of each floor map image will be proportionally resized to encompass the entire image. This leads to varying scales among different floor map images. If disabled, each floor map image will display the model's extents, ensuring a consistent scale across all images */
|
|
10
|
+
fitStoreyMaps? : Boolean;
|
|
9
11
|
};
|
|
10
12
|
|
|
11
13
|
/**
|
|
@@ -116,6 +118,23 @@ export declare class StoreyViewsPlugin extends Plugin {
|
|
|
116
118
|
*/
|
|
117
119
|
getStoreyContainingWorldPos(worldPos: number[]): string;
|
|
118
120
|
|
|
121
|
+
/**
|
|
122
|
+
* Gets the ID of the storey which's bounding box contains the y point of the world position
|
|
123
|
+
*
|
|
124
|
+
* @param {Number[]} worldPos 3D World-space position.
|
|
125
|
+
* @returns {String} ID of the storey containing the position, or null if the position falls outside all the storeys.
|
|
126
|
+
*/
|
|
127
|
+
getStoreyInVerticalRange(worldPos: number[]): string;
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* Gets the ID of the storey that contains the given 3D World-space position.
|
|
132
|
+
*.
|
|
133
|
+
* @param {Number[]} worldPos 3D World-space position.
|
|
134
|
+
* @returns {String} ID of the storey containing the position, or null if the position falls outside all the storeys.
|
|
135
|
+
*/
|
|
136
|
+
isPositionAboveOrBelowBuilding(worldPos: number[]): string;
|
|
137
|
+
|
|
119
138
|
/**
|
|
120
139
|
* Converts a 3D World-space position to a 2D position within a StoreyMap image.
|
|
121
140
|
*
|
|
@@ -10,6 +10,7 @@ import { VBOSceneModel } from "../models/VBOSceneModel/VBOSceneModel";
|
|
|
10
10
|
import { Mesh } from "../mesh";
|
|
11
11
|
import { Node } from "../nodes";
|
|
12
12
|
import { Input } from "../input/input";
|
|
13
|
+
import { SectionPlane } from "../sectionPlane/SectionPlane";
|
|
13
14
|
|
|
14
15
|
export declare type TickEvent = {
|
|
15
16
|
/** The ID of this Scene. */
|
|
@@ -74,6 +75,20 @@ export declare class Scene extends Component {
|
|
|
74
75
|
*/
|
|
75
76
|
on(event: "tick", callback: (tickEvent: TickEvent) => void, scope?: any): string;
|
|
76
77
|
|
|
78
|
+
/**
|
|
79
|
+
* Fires when a section plane is created.
|
|
80
|
+
* @param {String} event The sectionPlaneCreated event
|
|
81
|
+
* @param {Function} callback Callback fired on the event
|
|
82
|
+
*/
|
|
83
|
+
on(event: "sectionPlaneCreated", callback: (measurement: SectionPlane) => void): void;
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Fires when a measurement is destroyed.
|
|
87
|
+
* @param {String} event The sectionPlaneDestroyed event
|
|
88
|
+
* @param {Function} callback Callback fired on the event
|
|
89
|
+
*/
|
|
90
|
+
on(event: "sectionPlaneDestroyed", callback: (measurement: SectionPlane) => void): void;
|
|
91
|
+
|
|
77
92
|
/**
|
|
78
93
|
* The epoch time (in milliseconds since 1970) when this Scene was instantiated.
|
|
79
94
|
*/
|
|
@@ -96,6 +111,14 @@ export declare class Scene extends Component {
|
|
|
96
111
|
*/
|
|
97
112
|
get objects(): {[key: string]: Entity};
|
|
98
113
|
|
|
114
|
+
/**
|
|
115
|
+
* Map of {@link SectionPlane}s that represent sliced section planes.
|
|
116
|
+
*
|
|
117
|
+
* Each {@link SectionPlane} is mapped here by {@link SectionPlane.id}.
|
|
118
|
+
* @type {{String:SectionPlane}}
|
|
119
|
+
*/
|
|
120
|
+
get sectionPlanes(): { [key: string]: SectionPlane };
|
|
121
|
+
|
|
99
122
|
/**
|
|
100
123
|
* Map of currently visible {@link Entity}s that represent objects.
|
|
101
124
|
*
|