bimatter-viewer-react 0.6.8 → 0.6.10
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/lib/Viewer.d.ts +0 -1
- package/lib/api/ViewerApi.d.ts +18 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.js +307 -201
- package/package.json +1 -1
package/lib/Viewer.d.ts
CHANGED
package/lib/api/ViewerApi.d.ts
CHANGED
|
@@ -7,6 +7,8 @@ import type { ViewerDimensionsApi } from "../utils/DimentionsUtils";
|
|
|
7
7
|
import type { ViewerCameraGetIntersection } from "../Camera/useCameraUtils";
|
|
8
8
|
import type { BmtConversionResult, BmtConverterOptions, BmtConverterSource } from "../Loaders/BmtConverter";
|
|
9
9
|
import { FilteredElementsCollector } from "../Selector/FilteredElementsCollector";
|
|
10
|
+
import type { ViewerLoadedModels, ViewerLoadModelOptions, ViewerModelSource } from "./loader";
|
|
11
|
+
import type { WorkerProgressEvent } from "../workers";
|
|
10
12
|
export type { ViewerClippingApi } from "../utils/ClippingUtils";
|
|
11
13
|
export type { ViewerColorConfigByModel, ViewerModelColorConfig, } from "../utils/ColorsUtils/useElementColors";
|
|
12
14
|
export type { ViewerDimensionsApi } from "../utils/DimentionsUtils";
|
|
@@ -76,6 +78,20 @@ export type ViewerConverterApi = {
|
|
|
76
78
|
convertIfcFileToBmt: (sources: BmtConverterSource, options?: ViewerBmtConverterOptions) => Promise<BmtConversionResult>;
|
|
77
79
|
convertToBmt: (options?: ViewerBmtConverterOptions) => BmtConversionResult;
|
|
78
80
|
};
|
|
81
|
+
export type ViewerLoadModelsOptions = ViewerLoadModelOptions & {
|
|
82
|
+
clearViewer?: boolean;
|
|
83
|
+
fitToView?: boolean;
|
|
84
|
+
onModelLoadingChange?: (loading: boolean) => void;
|
|
85
|
+
onModelProgress?: (progress: WorkerProgressEvent | null) => void;
|
|
86
|
+
onModelsDataChange?: (modelsData: ViewerLoadedModels | undefined) => void;
|
|
87
|
+
};
|
|
88
|
+
export type ViewerModelsApi = {
|
|
89
|
+
getData: () => ViewerLoadedModels | undefined;
|
|
90
|
+
getLoading: () => boolean;
|
|
91
|
+
getProgress: () => WorkerProgressEvent | null;
|
|
92
|
+
loadModels: (sources: ViewerModelSource[], options?: ViewerLoadModelsOptions) => Promise<ViewerLoadedModels>;
|
|
93
|
+
reset: () => void;
|
|
94
|
+
};
|
|
79
95
|
export type ViewerApi = {
|
|
80
96
|
camera: ViewerCameraApi;
|
|
81
97
|
clipping: ViewerClippingApi;
|
|
@@ -83,6 +99,7 @@ export type ViewerApi = {
|
|
|
83
99
|
converter: ViewerConverterApi;
|
|
84
100
|
dimensions: ViewerDimensionsApi;
|
|
85
101
|
geometryUtils: ViewerGeometryUtilsApi;
|
|
102
|
+
models: ViewerModelsApi;
|
|
86
103
|
properties: ViewerPropertiesApi;
|
|
87
104
|
selector: ViewerSelectorApi;
|
|
88
105
|
utils: ViewerUtilsApi;
|
|
@@ -98,4 +115,4 @@ export type ViewerSceneApi = {
|
|
|
98
115
|
};
|
|
99
116
|
export declare function serializeSelected(selected: SelectedStore): ViewerSelection;
|
|
100
117
|
export declare function createSelectedStore(selection: ViewerSelection): SelectedStore;
|
|
101
|
-
export declare function createPublicViewerApi(viewerStore: ViewerStoreApi, getSceneApi: () => ViewerSceneApi | null): ViewerApi;
|
|
118
|
+
export declare function createPublicViewerApi(viewerStore: ViewerStoreApi, getSceneApi: () => ViewerSceneApi | null, getModelsApi: () => ViewerModelsApi | null): ViewerApi;
|
package/lib/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { default as Viewer } from "./Viewer";
|
|
2
2
|
export type { ViewerModelsData, ViewerProps } from "./Viewer";
|
|
3
3
|
export type { ViewerMaterialMode } from "./types";
|
|
4
|
-
export type { ViewerApi, ViewerCameraApi, ViewerCameraGetIntersection, ViewerClippingApi, ViewerColorsApi, ViewerBmtConverterOptions, ViewerConverterApi, ViewerDimensionsApi, ViewerGeometryUtilsApi, ViewerSelection, ViewerSelectorApi, ViewerUtilsApi, } from "./api/ViewerApi";
|
|
4
|
+
export type { ViewerApi, ViewerCameraApi, ViewerCameraGetIntersection, ViewerClippingApi, ViewerColorsApi, ViewerBmtConverterOptions, ViewerConverterApi, ViewerDimensionsApi, ViewerGeometryUtilsApi, ViewerLoadModelsOptions, ViewerModelsApi, ViewerSelection, ViewerSelectorApi, ViewerUtilsApi, } from "./api/ViewerApi";
|
|
5
5
|
export type { ViewerModelLevel, ViewerModelLevelsByModel, ViewerPropertiesApi, ViewerPropertiesExcelOptions, } from "./api/ViewerPropertiesApi";
|
|
6
6
|
export { BMTLoader } from "./Loaders/BmtLoader";
|
|
7
7
|
export type { BmtGeometryChunkData, BmtParseCallbacks, BmtParseProgressData, BmtModelGeometryData, BmtGeomData, BmtIndexArray, BmtMaterialData, BmtElementProps, BmtModelData, BmtModelProps, BmtModelStructure, BmtModelStructureNode, BmtPropertyRecord, BmtPropertySet, BmtPropertyValue, } from "./Loaders/BmtLoader";
|
package/lib/index.js
CHANGED
|
@@ -3,7 +3,7 @@ import { a as t, c as n, d as r, f as i, i as a, l as o, n as s, o as c, r as l,
|
|
|
3
3
|
import f, { Suspense as p, forwardRef as m, lazy as h, memo as g, useCallback as _, useEffect as v, useImperativeHandle as y, useMemo as b, useRef as x, useState as S } from "react";
|
|
4
4
|
import { Canvas as C, useFrame as w, useThree as T } from "@react-three/fiber";
|
|
5
5
|
import { CameraControls as E, Stats as ee } from "@react-three/drei";
|
|
6
|
-
import { Box3 as D, BoxGeometry as O, BufferAttribute as k, BufferGeometry as A, CanvasTexture as j, Color as M, ConeGeometry as N, DoubleSide as
|
|
6
|
+
import { Box3 as D, BoxGeometry as O, BufferAttribute as k, BufferGeometry as A, CanvasTexture as j, Color as M, ConeGeometry as N, DoubleSide as te, DynamicDrawUsage as ne, Float32BufferAttribute as P, Group as F, Line as I, Line3 as L, LineBasicMaterial as R, LineDashedMaterial as z, LineSegments as re, LinearFilter as B, LinearMipmapLinearFilter as ie, MathUtils as ae, Matrix4 as V, Mesh as H, MeshBasicMaterial as U, MeshLambertMaterial as oe, Object3D as W, OrthographicCamera as se, PerspectiveCamera as ce, Plane as le, RepeatWrapping as ue, SRGBColorSpace as de, ShapeUtils as fe, Sphere as pe, SphereGeometry as me, Sprite as he, SpriteMaterial as ge, Uint32BufferAttribute as _e, Vector2 as G, Vector3 as K } from "three";
|
|
7
7
|
import { CONTAINED as ve, INTERSECTED as ye, MeshBVH as be, NOT_INTERSECTED as xe, acceleratedRaycast as Se } from "three-mesh-bvh";
|
|
8
8
|
import { Fragment as Ce, jsx as q, jsxs as J } from "react/jsx-runtime";
|
|
9
9
|
import we from "pako";
|
|
@@ -21,7 +21,7 @@ var Te = 1 / 1.5, Ee = f.memo(function({ colorPaletteTexture: e, material: t, ma
|
|
|
21
21
|
opacity: t.opacity ?? 1
|
|
22
22
|
}, a = o ? {
|
|
23
23
|
...i,
|
|
24
|
-
side:
|
|
24
|
+
side: te
|
|
25
25
|
} : i, s = n === "performance" ? new U(a) : new oe(a), c = s;
|
|
26
26
|
return c.defaultAttributeValues = {
|
|
27
27
|
...c.defaultAttributeValues,
|
|
@@ -102,7 +102,7 @@ function Pe(e, t, n, r) {
|
|
|
102
102
|
let u = o.measureText(t), d = u.actualBoundingBoxAscent || r * .8, f = u.actualBoundingBoxDescent || r * .2, p = Math.max(1, Math.ceil(u.width + c * 2)), m = Math.max(1, Math.ceil(d + f + l * 2));
|
|
103
103
|
a.width = Math.ceil(p * i), a.height = Math.ceil(m * i), o.scale(i, i), o.clearRect(0, 0, p, m), o.font = s, o.fillStyle = n, o.textAlign = "left", o.textBaseline = "alphabetic", o.fillText(t, c, l + d);
|
|
104
104
|
let h = new j(a);
|
|
105
|
-
return h.colorSpace = de, h.generateMipmaps = !1, h.magFilter =
|
|
105
|
+
return h.colorSpace = de, h.generateMipmaps = !1, h.magFilter = B, h.minFilter = B, h.needsUpdate = !0, {
|
|
106
106
|
disposeTimer: null,
|
|
107
107
|
height: m,
|
|
108
108
|
key: e,
|
|
@@ -360,12 +360,12 @@ function $e({ color: e, floorY: t, fontSize: n = De, grids: r, labelOffset: i =
|
|
|
360
360
|
}
|
|
361
361
|
//#endregion
|
|
362
362
|
//#region src/viewer/Model.tsx
|
|
363
|
-
var et = new
|
|
363
|
+
var et = new V(), tt = h(() => import("./WebGpuSelectableMesh-s4XT_3wd.js").then((e) => ({ default: e.WebGpuSelectableMesh })));
|
|
364
364
|
function nt(e) {
|
|
365
365
|
if (!e) return null;
|
|
366
366
|
try {
|
|
367
367
|
let t = JSON.parse(e);
|
|
368
|
-
return !Array.isArray(t) || t.length !== 16 ? null : new
|
|
368
|
+
return !Array.isArray(t) || t.length !== 16 ? null : new V().fromArray(t);
|
|
369
369
|
} catch (e) {
|
|
370
370
|
return console.warn("Model matrix parsing error", e), null;
|
|
371
371
|
}
|
|
@@ -386,7 +386,7 @@ function at({ colorPaletteTexture: e, coordinationMatrix: t, modelID: n, data: r
|
|
|
386
386
|
let e = Object.values(r.data).some((e) => !!e.matrix) ? t?.clone() ?? rt(r) : null, i = Infinity, a = new K();
|
|
387
387
|
return {
|
|
388
388
|
data: Object.values(r.data).map((e) => {
|
|
389
|
-
let t = (nt(e.matrix) ?? new
|
|
389
|
+
let t = (nt(e.matrix) ?? new V()).clone().invert(), r = e.mat, o = e.pos;
|
|
390
390
|
for (let e = 0; e < o.length; e += 3) a.set(o[e], o[e + 1], o[e + 2]).applyMatrix4(t), Number.isFinite(a.y) && (i = Math.min(i, a.y));
|
|
391
391
|
return {
|
|
392
392
|
data: e,
|
|
@@ -770,7 +770,7 @@ function Qt(e) {
|
|
|
770
770
|
r.stroke();
|
|
771
771
|
}
|
|
772
772
|
let i = new j(n);
|
|
773
|
-
return i.anisotropy = Math.max(1, e), i.magFilter =
|
|
773
|
+
return i.anisotropy = Math.max(1, e), i.magFilter = B, i.minFilter = ie, i.wrapS = ue, i.wrapT = ue, i.needsUpdate = !0, i;
|
|
774
774
|
}
|
|
775
775
|
function $t(e, t) {
|
|
776
776
|
return new k(t ? new Uint32Array(e) : new Uint8Array(e), 1);
|
|
@@ -782,12 +782,12 @@ var en = class {
|
|
|
782
782
|
capMesh;
|
|
783
783
|
capTexture;
|
|
784
784
|
context;
|
|
785
|
-
root = new
|
|
785
|
+
root = new F();
|
|
786
786
|
box = new D();
|
|
787
787
|
meshBox = new D();
|
|
788
|
-
inverseMatrix = new
|
|
788
|
+
inverseMatrix = new V();
|
|
789
789
|
localPlane = new le();
|
|
790
|
-
tempLine = new
|
|
790
|
+
tempLine = new L();
|
|
791
791
|
tempVector = new K();
|
|
792
792
|
tempVector1 = new K();
|
|
793
793
|
tempAxisX = new K();
|
|
@@ -810,12 +810,12 @@ var en = class {
|
|
|
810
810
|
return this.context.getUseWebGPU() ? new e({
|
|
811
811
|
color: At,
|
|
812
812
|
depthWrite: !1,
|
|
813
|
-
side:
|
|
813
|
+
side: te
|
|
814
814
|
}) : new U({
|
|
815
815
|
color: At,
|
|
816
816
|
depthWrite: !1,
|
|
817
817
|
map: this.capTexture,
|
|
818
|
-
side:
|
|
818
|
+
side: te
|
|
819
819
|
});
|
|
820
820
|
}
|
|
821
821
|
dispose() {
|
|
@@ -895,7 +895,7 @@ var en = class {
|
|
|
895
895
|
let n = t.getSize(new K()).length();
|
|
896
896
|
this.tolerance = Math.max(Mt, n * Nt), this.closeGapTolerance = Math.max(this.tolerance * Ft, n * Pt);
|
|
897
897
|
let r = Jt(this.plane, this.getModelHatchReferenceDirection()), i = this.context.getEdgeSegmentsForPlane(this.plane), a = i ? this.getCapSegmentsFromEdgeSegments(i, r) : this.getCapSegments(r), o = this.getClosedContours(a), s = this.getHatchSpacing(n), { elementIDs: c, modelIDs: l, positions: u, uvs: d } = this.triangulateContours(o, r, s);
|
|
898
|
-
if (e.setAttribute("position", new
|
|
898
|
+
if (e.setAttribute("position", new P(u, 3)), e.setAttribute("uv", new P(d, 2)), e.setAttribute("ids", new _e(c, 1)), e.setAttribute("modelID", new _e(l, 1)), e.setAttribute("colorIndex", $t(c.length, this.context.getUseWebGPU())), c.length) {
|
|
899
899
|
let t = new Uint32Array(c.length);
|
|
900
900
|
for (let e = 0; e < t.length; e++) t[e] = e;
|
|
901
901
|
e.setIndex(new _e(t, 1));
|
|
@@ -1100,7 +1100,7 @@ var en = class {
|
|
|
1100
1100
|
}, tn = 1024, nn = 1;
|
|
1101
1101
|
function rn(e) {
|
|
1102
1102
|
let t = new k(new Float32Array(e * 3), 3, !1);
|
|
1103
|
-
return t.setUsage(
|
|
1103
|
+
return t.setUsage(ne), t;
|
|
1104
1104
|
}
|
|
1105
1105
|
function an(e) {
|
|
1106
1106
|
return Math.max(1, Math.ceil((e.geometry.index?.count ?? 0) / 3));
|
|
@@ -1108,7 +1108,7 @@ function an(e) {
|
|
|
1108
1108
|
function on(e, t) {
|
|
1109
1109
|
let n = new A(), r = Math.ceil(Math.min(Math.max(tn, an(t) * .05), 32768));
|
|
1110
1110
|
n.setAttribute("position", rn(r)), n.setDrawRange(0, 0);
|
|
1111
|
-
let i = new
|
|
1111
|
+
let i = new re(n, e);
|
|
1112
1112
|
return i.frustumCulled = !1, i.renderOrder = nn, i.visible = !1, i;
|
|
1113
1113
|
}
|
|
1114
1114
|
function sn(e, t) {
|
|
@@ -1126,9 +1126,9 @@ var ln = class {
|
|
|
1126
1126
|
plane;
|
|
1127
1127
|
context;
|
|
1128
1128
|
lines = /* @__PURE__ */ new Map();
|
|
1129
|
-
inverseMatrix = new
|
|
1129
|
+
inverseMatrix = new V();
|
|
1130
1130
|
localPlane = new le();
|
|
1131
|
-
tempLine = new
|
|
1131
|
+
tempLine = new L();
|
|
1132
1132
|
tempVector = new K();
|
|
1133
1133
|
tempVector1 = new K();
|
|
1134
1134
|
tempVector2 = new K();
|
|
@@ -1140,7 +1140,7 @@ var ln = class {
|
|
|
1140
1140
|
e.plane === t || n.includes(t) || (e.material.clippingPlanes = [...n, t], e.material.needsUpdate = !0);
|
|
1141
1141
|
});
|
|
1142
1142
|
let n = e.planes.filter((e) => e !== t);
|
|
1143
|
-
this.material = new
|
|
1143
|
+
this.material = new R({
|
|
1144
1144
|
clippingPlanes: n,
|
|
1145
1145
|
color: "black",
|
|
1146
1146
|
depthTest: !0,
|
|
@@ -1228,7 +1228,7 @@ function Dn(e) {
|
|
|
1228
1228
|
return Math.max(Sn, t.length() * hn);
|
|
1229
1229
|
}
|
|
1230
1230
|
var On = class extends W {
|
|
1231
|
-
helper = new
|
|
1231
|
+
helper = new F();
|
|
1232
1232
|
borderMaterial;
|
|
1233
1233
|
material;
|
|
1234
1234
|
plane;
|
|
@@ -1250,11 +1250,11 @@ var On = class extends W {
|
|
|
1250
1250
|
color: dn,
|
|
1251
1251
|
depthWrite: !1,
|
|
1252
1252
|
opacity: fn,
|
|
1253
|
-
side:
|
|
1253
|
+
side: te,
|
|
1254
1254
|
transparent: !0
|
|
1255
1255
|
}), this.helper.position.copy(this.location), this.applyPlaneOrientation(), this.layout = this.getHelperLayout();
|
|
1256
1256
|
let i = Math.max(bn, Math.min(this.layout.width, this.layout.height) * gn), a = Math.max(xn, Math.min(this.layout.width, this.layout.height) * _n);
|
|
1257
|
-
this.borderMaterial = new
|
|
1257
|
+
this.borderMaterial = new z({
|
|
1258
1258
|
color: un,
|
|
1259
1259
|
dashSize: i,
|
|
1260
1260
|
depthWrite: !1,
|
|
@@ -1424,7 +1424,7 @@ var On = class extends W {
|
|
|
1424
1424
|
return e.renderOrder = 2, e;
|
|
1425
1425
|
}
|
|
1426
1426
|
createBorder() {
|
|
1427
|
-
let e = new
|
|
1427
|
+
let e = new re(new A(), this.borderMaterial);
|
|
1428
1428
|
return e.renderOrder = 3, e;
|
|
1429
1429
|
}
|
|
1430
1430
|
replaceGeometry(e, t) {
|
|
@@ -1439,7 +1439,7 @@ var On = class extends W {
|
|
|
1439
1439
|
n.push(t.x, t.y, 0, i.x, i.y, 0, a.x, a.y, 0);
|
|
1440
1440
|
}
|
|
1441
1441
|
}
|
|
1442
|
-
return t.setAttribute("position", new
|
|
1442
|
+
return t.setAttribute("position", new P(n, 3)), n.length && t.computeBoundingSphere(), t;
|
|
1443
1443
|
}
|
|
1444
1444
|
createBorderGeometry(e) {
|
|
1445
1445
|
let t = new A(), n = [];
|
|
@@ -1447,7 +1447,7 @@ var On = class extends W {
|
|
|
1447
1447
|
let r = e[t], i = e[(t + 1) % e.length];
|
|
1448
1448
|
n.push(r.x, r.y, 0, i.x, i.y, 0);
|
|
1449
1449
|
}
|
|
1450
|
-
return t.setAttribute("position", new
|
|
1450
|
+
return t.setAttribute("position", new P(n, 3)), n.length && t.computeBoundingSphere(), t;
|
|
1451
1451
|
}
|
|
1452
1452
|
getClippedPolygon() {
|
|
1453
1453
|
let e = this.getPlaneBasis(), t = [
|
|
@@ -1531,7 +1531,7 @@ var On = class extends W {
|
|
|
1531
1531
|
};
|
|
1532
1532
|
}
|
|
1533
1533
|
applyPlaneOrientation() {
|
|
1534
|
-
let e = this.getPlaneBasis(), t = new
|
|
1534
|
+
let e = this.getPlaneBasis(), t = new V().makeBasis(e.u, e.v, this.normal);
|
|
1535
1535
|
this.helper.quaternion.setFromRotationMatrix(t);
|
|
1536
1536
|
}
|
|
1537
1537
|
getModelWorldBox() {
|
|
@@ -2021,7 +2021,7 @@ function qn(e) {
|
|
|
2021
2021
|
let a = r.measureText(e), o = a.actualBoundingBoxAscent || Hn * .8, s = a.actualBoundingBoxDescent || Hn * .2, c = Math.max(1, Math.ceil(a.width + Un * 2)), l = Math.max(1, Math.ceil(o + s + Wn * 2));
|
|
2022
2022
|
n.width = Math.ceil(c * t), n.height = Math.ceil(l * t), r.scale(t, t), r.clearRect(0, 0, c, l), r.fillStyle = "rgba(255, 255, 255, 0.86)", r.strokeStyle = "rgba(29, 39, 51, 0.22)", r.lineWidth = 1, r.beginPath(), r.roundRect(.5, .5, c - 1, l - 1, 4), r.fill(), r.stroke(), r.font = i, r.fillStyle = "#111827", r.textAlign = "center", r.textBaseline = "middle", r.fillText(e, c / 2, l / 2);
|
|
2023
2023
|
let u = new j(n);
|
|
2024
|
-
return u.colorSpace = de, u.generateMipmaps = !1, u.magFilter =
|
|
2024
|
+
return u.colorSpace = de, u.generateMipmaps = !1, u.magFilter = B, u.minFilter = B, u.needsUpdate = !0, {
|
|
2025
2025
|
height: l,
|
|
2026
2026
|
texture: u,
|
|
2027
2027
|
width: c
|
|
@@ -2031,7 +2031,7 @@ var Jn = class e {
|
|
|
2031
2031
|
static scale = 1;
|
|
2032
2032
|
static scaleFactor = .015;
|
|
2033
2033
|
static units = "m";
|
|
2034
|
-
root = new
|
|
2034
|
+
root = new F();
|
|
2035
2035
|
start;
|
|
2036
2036
|
endpointMeshes = [];
|
|
2037
2037
|
boundingMesh = null;
|
|
@@ -2050,14 +2050,14 @@ var Jn = class e {
|
|
|
2050
2050
|
labelTexture = null;
|
|
2051
2051
|
labelWidth = 1;
|
|
2052
2052
|
constructor({ boundingMaterial: e, endpointGeometry: t, endpointMaterial: n, endpointScale: r, lineMaterial: i, root: a, start: o, end: s }) {
|
|
2053
|
-
this.boundingMaterial = e, this.endpointGeometry = t, this.endpointMaterial = n, this.endpointBaseScale = r.clone(), this.lineMaterial = i, this.ownerRoot = a, this.start = o.clone(), this.end = s.clone(), this.root.renderOrder = 4, this.lineGeometry.setAttribute("position", new
|
|
2053
|
+
this.boundingMaterial = e, this.endpointGeometry = t, this.endpointMaterial = n, this.endpointBaseScale = r.clone(), this.lineMaterial = i, this.ownerRoot = a, this.start = o.clone(), this.end = s.clone(), this.root.renderOrder = 4, this.lineGeometry.setAttribute("position", new P([
|
|
2054
2054
|
this.start.x,
|
|
2055
2055
|
this.start.y,
|
|
2056
2056
|
this.start.z,
|
|
2057
2057
|
this.end.x,
|
|
2058
2058
|
this.end.y,
|
|
2059
2059
|
this.end.z
|
|
2060
|
-
], 3)), this.line = new
|
|
2060
|
+
], 3)), this.line = new I(this.lineGeometry, this.lineMaterial), this.line.renderOrder = 4, this.line.computeLineDistances(), this.root.add(this.line), this.addEndpointMeshes(), this.labelSprite = this.createLabelSprite(), this.root.add(this.labelSprite), this.updateLabel(), this.updatePositions(), this.ownerRoot.add(this.root);
|
|
2061
2061
|
}
|
|
2062
2062
|
get length() {
|
|
2063
2063
|
return this.start.distanceTo(this.end);
|
|
@@ -2180,7 +2180,7 @@ var tr = class e {
|
|
|
2180
2180
|
depthWrite: !1
|
|
2181
2181
|
});
|
|
2182
2182
|
endpointScale = new K(1, 1, 1);
|
|
2183
|
-
lineMaterial = new
|
|
2183
|
+
lineMaterial = new z({
|
|
2184
2184
|
color: Yn,
|
|
2185
2185
|
dashSize: .2,
|
|
2186
2186
|
depthTest: !1,
|
|
@@ -2194,7 +2194,7 @@ var tr = class e {
|
|
|
2194
2194
|
depthTest: !1,
|
|
2195
2195
|
depthWrite: !1
|
|
2196
2196
|
}));
|
|
2197
|
-
root = new
|
|
2197
|
+
root = new F();
|
|
2198
2198
|
snapDistance = Xn;
|
|
2199
2199
|
startPoint = new K();
|
|
2200
2200
|
unit = "m";
|
|
@@ -2828,7 +2828,7 @@ function Qr(e, t, n, i, a, o) {
|
|
|
2828
2828
|
});
|
|
2829
2829
|
}, N = () => {
|
|
2830
2830
|
o?.(null), M(D.current), D.current = null;
|
|
2831
|
-
},
|
|
2831
|
+
}, te = (e, t) => {
|
|
2832
2832
|
let n = D.current;
|
|
2833
2833
|
n?.modelID === e && n.elementID === t || (M(n), o?.({
|
|
2834
2834
|
elementID: t,
|
|
@@ -2839,9 +2839,9 @@ function Qr(e, t, n, i, a, o) {
|
|
|
2839
2839
|
elementID: t,
|
|
2840
2840
|
modelID: e
|
|
2841
2841
|
});
|
|
2842
|
-
},
|
|
2842
|
+
}, ne = () => {
|
|
2843
2843
|
h.current = null, _.current = !1, Hr(g), t.current && (t.current.enabled = !0);
|
|
2844
|
-
},
|
|
2844
|
+
}, P = (e) => {
|
|
2845
2845
|
if (k()) {
|
|
2846
2846
|
N();
|
|
2847
2847
|
return;
|
|
@@ -2859,40 +2859,40 @@ function Qr(e, t, n, i, a, o) {
|
|
|
2859
2859
|
N();
|
|
2860
2860
|
return;
|
|
2861
2861
|
}
|
|
2862
|
-
|
|
2862
|
+
te(t.modelID, t.elementID);
|
|
2863
2863
|
};
|
|
2864
|
-
function
|
|
2864
|
+
function F() {
|
|
2865
2865
|
return performance.now();
|
|
2866
2866
|
}
|
|
2867
|
-
let
|
|
2867
|
+
let I = (e) => {
|
|
2868
2868
|
if (k()) {
|
|
2869
2869
|
ee.current = null, E.current !== null && (window.clearTimeout(E.current), E.current = null), N();
|
|
2870
2870
|
return;
|
|
2871
2871
|
}
|
|
2872
2872
|
if (ee.current = e, E.current !== null) return;
|
|
2873
|
-
let t =
|
|
2873
|
+
let t = F() - w.current, n = Math.max(0, Ur - t);
|
|
2874
2874
|
E.current = window.setTimeout(() => {
|
|
2875
2875
|
E.current = null;
|
|
2876
2876
|
let e = ee.current;
|
|
2877
|
-
ee.current = null, e && (w.current = performance.now(),
|
|
2877
|
+
ee.current = null, e && (w.current = performance.now(), P(e));
|
|
2878
2878
|
}, n);
|
|
2879
|
-
},
|
|
2879
|
+
}, L = x(null);
|
|
2880
2880
|
v(() => {
|
|
2881
2881
|
let e = S.current;
|
|
2882
2882
|
if (e) {
|
|
2883
|
-
p &&
|
|
2883
|
+
p && L.current !== null && console.log(`selection ${e.action}:`, Date.now() - L.current, "ms"), S.current = null, L.current = null;
|
|
2884
2884
|
return;
|
|
2885
2885
|
}
|
|
2886
|
-
p &&
|
|
2886
|
+
p && L.current !== null && (console.log("selection spend:", Date.now() - L.current, "ms"), L.current = null);
|
|
2887
2887
|
}, [c, p]);
|
|
2888
|
-
let { camera:
|
|
2889
|
-
function
|
|
2888
|
+
let { camera: R, gl: z } = T();
|
|
2889
|
+
function re() {
|
|
2890
2890
|
return Date.now();
|
|
2891
2891
|
}
|
|
2892
|
-
let
|
|
2893
|
-
let t =
|
|
2892
|
+
let B = (e) => {
|
|
2893
|
+
let t = z.domElement.getBoundingClientRect();
|
|
2894
2894
|
return e.clientX >= t.left && e.clientX <= t.right && e.clientY >= t.top && e.clientY <= t.bottom;
|
|
2895
|
-
},
|
|
2895
|
+
}, ie = (t) => {
|
|
2896
2896
|
if (k()) {
|
|
2897
2897
|
C.current = !1, y.current = !1, N();
|
|
2898
2898
|
return;
|
|
@@ -2902,8 +2902,8 @@ function Qr(e, t, n, i, a, o) {
|
|
|
2902
2902
|
y.current = !1;
|
|
2903
2903
|
return;
|
|
2904
2904
|
}
|
|
2905
|
-
if (!
|
|
2906
|
-
if (
|
|
2905
|
+
if (!B(t)) return;
|
|
2906
|
+
if (L.current = re(), s.current !== "end" && s.current !== "start" && s.current > 15) {
|
|
2907
2907
|
s.current = "end";
|
|
2908
2908
|
return;
|
|
2909
2909
|
}
|
|
@@ -2916,11 +2916,11 @@ function Qr(e, t, n, i, a, o) {
|
|
|
2916
2916
|
return;
|
|
2917
2917
|
}
|
|
2918
2918
|
l(o, a === void 0 ? [] : [a], !0), d && A(d);
|
|
2919
|
-
}, ie = (e) => {
|
|
2920
|
-
k() || e.button !== 0 || !e.shiftKey && !e.ctrlKey || (h.current = new G(e.clientX, e.clientY), b.current = e.ctrlKey ? "remove" : "add", _.current = !1, t.current && (t.current.enabled = !1));
|
|
2921
2919
|
}, ae = (e) => {
|
|
2920
|
+
k() || e.button !== 0 || !e.shiftKey && !e.ctrlKey || (h.current = new G(e.clientX, e.clientY), b.current = e.ctrlKey ? "remove" : "add", _.current = !1, t.current && (t.current.enabled = !1));
|
|
2921
|
+
}, V = (e) => {
|
|
2922
2922
|
if (k()) {
|
|
2923
|
-
|
|
2923
|
+
ne();
|
|
2924
2924
|
return;
|
|
2925
2925
|
}
|
|
2926
2926
|
if (!h.current) return;
|
|
@@ -2928,11 +2928,11 @@ function Qr(e, t, n, i, a, o) {
|
|
|
2928
2928
|
n < 6 && r < 6 || (_.current ||= !0, e.preventDefault(), Vr(g, h.current, t));
|
|
2929
2929
|
}, U = (r) => {
|
|
2930
2930
|
if (k()) {
|
|
2931
|
-
|
|
2931
|
+
ne();
|
|
2932
2932
|
return;
|
|
2933
2933
|
}
|
|
2934
2934
|
if (!h.current) return;
|
|
2935
|
-
|
|
2935
|
+
L.current = re();
|
|
2936
2936
|
let i = _.current, a = new G(r.clientX, r.clientY), o = br(h.current, a), s = xr(h.current, a);
|
|
2937
2937
|
if (h.current = null, _.current = !1, Hr(g), t.current && setTimeout(() => {
|
|
2938
2938
|
t.current && (t.current.enabled = !0);
|
|
@@ -2940,9 +2940,9 @@ function Qr(e, t, n, i, a, o) {
|
|
|
2940
2940
|
y.current = !0, r.preventDefault();
|
|
2941
2941
|
let { ids: c, profile: l } = zr({
|
|
2942
2942
|
model: e.current,
|
|
2943
|
-
camera:
|
|
2943
|
+
camera: R,
|
|
2944
2944
|
clippingPlanes: n.getActiveClippingPlanes(),
|
|
2945
|
-
domElement:
|
|
2945
|
+
domElement: z.domElement,
|
|
2946
2946
|
rect: o,
|
|
2947
2947
|
mode: s
|
|
2948
2948
|
}), d = Array.from(c.values()).reduce((e, t) => e + t.size, 0), p = {
|
|
@@ -2974,7 +2974,7 @@ function Qr(e, t, n, i, a, o) {
|
|
|
2974
2974
|
v(() => {
|
|
2975
2975
|
let e = t.current;
|
|
2976
2976
|
if (!e) return;
|
|
2977
|
-
|
|
2977
|
+
z.domElement.addEventListener("pointerdown", ae), z.domElement.addEventListener("pointermove", V), window.addEventListener("pointerup", U), window.addEventListener("pointerup", ie), z.domElement.addEventListener("contextmenu", a), z.domElement.addEventListener("pointerup", i), z.domElement.addEventListener("pointermove", I), z.domElement.addEventListener("pointerleave", N), z.domElement.addEventListener("pointerdown", r), e.addEventListener("update", n);
|
|
2978
2978
|
function n() {
|
|
2979
2979
|
typeof s.current == "number" ? s.current += 1 : s.current === "start" && (s.current = 1);
|
|
2980
2980
|
}
|
|
@@ -2990,7 +2990,7 @@ function Qr(e, t, n, i, a, o) {
|
|
|
2990
2990
|
e.ctrlKey && e.preventDefault();
|
|
2991
2991
|
}
|
|
2992
2992
|
return () => {
|
|
2993
|
-
Hr(g), E.current !== null && (window.clearTimeout(E.current), E.current = null), ee.current = null, N(), e.removeEventListener("update", n),
|
|
2993
|
+
Hr(g), E.current !== null && (window.clearTimeout(E.current), E.current = null), ee.current = null, N(), e.removeEventListener("update", n), z.domElement.removeEventListener("pointerdown", ae), z.domElement.removeEventListener("pointermove", V), window.removeEventListener("pointerup", U), window.removeEventListener("pointerup", ie), z.domElement.removeEventListener("contextmenu", a), z.domElement.removeEventListener("pointerup", i), z.domElement.removeEventListener("pointerdown", r), z.domElement.removeEventListener("pointermove", I), z.domElement.removeEventListener("pointerleave", N);
|
|
2994
2994
|
};
|
|
2995
2995
|
});
|
|
2996
2996
|
}
|
|
@@ -3003,7 +3003,7 @@ function ti() {
|
|
|
3003
3003
|
if (!t.current || !(e instanceof ce)) return;
|
|
3004
3004
|
let i = new D().setFromObject(t.current);
|
|
3005
3005
|
if (i.isEmpty()) return;
|
|
3006
|
-
let a = i.getCenter(new K()), o = i.getBoundingSphere(new pe()), s =
|
|
3006
|
+
let a = i.getCenter(new K()), o = i.getBoundingSphere(new pe()), s = ae.degToRad(e.fov), c = 2 * Math.atan(Math.tan(s / 2) * e.aspect), l = Math.min(s, c), u = o.radius / Math.sin(l / 2) * ei;
|
|
3007
3007
|
e.position.copy(a).addScaledVector($r, u), e.up.set(0, 1, 0), e.lookAt(a), e.updateProjectionMatrix();
|
|
3008
3008
|
let d = n.current;
|
|
3009
3009
|
d && (d.cancel(), d.setFocalOffset(0, 0, 0, !1), d.setLookAt(e.position.x, e.position.y, e.position.z, a.x, a.y, a.z, !1)), r.current && (r.current.position.copy(a).addScaledVector($r, u * .8), r.current.lookAt(a));
|
|
@@ -4153,8 +4153,8 @@ function Ua(e) {
|
|
|
4153
4153
|
t[Number(e)] = new Set(n);
|
|
4154
4154
|
}), t;
|
|
4155
4155
|
}
|
|
4156
|
-
function Wa(e, t) {
|
|
4157
|
-
let
|
|
4156
|
+
function Wa(e, t, n) {
|
|
4157
|
+
let r = new Ea();
|
|
4158
4158
|
return {
|
|
4159
4159
|
camera: {
|
|
4160
4160
|
fitCamera: () => {
|
|
@@ -4219,9 +4219,9 @@ function Wa(e, t) {
|
|
|
4219
4219
|
}
|
|
4220
4220
|
},
|
|
4221
4221
|
converter: {
|
|
4222
|
-
convertIfcFileToBmt: (e,
|
|
4222
|
+
convertIfcFileToBmt: (e, n) => {
|
|
4223
4223
|
let i = t();
|
|
4224
|
-
return i ? i.converter.convertIfcFileToBmt(e,
|
|
4224
|
+
return i ? i.converter.convertIfcFileToBmt(e, n) : r.ConvertIfcFileToBmt(e, n);
|
|
4225
4225
|
},
|
|
4226
4226
|
convertToBmt: (e) => t()?.converter.convertToBmt(e) ?? {
|
|
4227
4227
|
files: [],
|
|
@@ -4300,6 +4300,18 @@ function Wa(e, t) {
|
|
|
4300
4300
|
t()?.geometryUtils.toggleIIfcSpacesVisibility();
|
|
4301
4301
|
}
|
|
4302
4302
|
},
|
|
4303
|
+
models: {
|
|
4304
|
+
getData: () => n()?.getData(),
|
|
4305
|
+
getLoading: () => n()?.getLoading() ?? !1,
|
|
4306
|
+
getProgress: () => n()?.getProgress() ?? null,
|
|
4307
|
+
loadModels: (e, t) => {
|
|
4308
|
+
let r = n();
|
|
4309
|
+
return r ? r.loadModels(e, t) : Promise.reject(/* @__PURE__ */ Error("Viewer model loader is not ready"));
|
|
4310
|
+
},
|
|
4311
|
+
reset: () => {
|
|
4312
|
+
n()?.reset();
|
|
4313
|
+
}
|
|
4314
|
+
},
|
|
4303
4315
|
properties: ya(e),
|
|
4304
4316
|
selector: {
|
|
4305
4317
|
addSelected: (n, r, i = !0, a = !1) => {
|
|
@@ -5231,7 +5243,7 @@ function ss(e, t) {
|
|
|
5231
5243
|
let a = r.measureText(e), o = a.actualBoundingBoxAscent || Jo * .8, s = a.actualBoundingBoxDescent || Jo * .2, c = Math.ceil(a.width + 36), l = Math.ceil(o + s + 20);
|
|
5232
5244
|
n.width = c, n.height = l, r.clearRect(0, 0, c, l), r.font = i, r.fillStyle = t, r.textAlign = "center", r.textBaseline = "alphabetic", r.fillText(e, c / 2, 10 + o);
|
|
5233
5245
|
let u = new j(n);
|
|
5234
|
-
return u.colorSpace = de, u.generateMipmaps = !1, u.magFilter =
|
|
5246
|
+
return u.colorSpace = de, u.generateMipmaps = !1, u.magFilter = B, u.minFilter = B, u.anisotropy = Xo, u.needsUpdate = !0, {
|
|
5235
5247
|
aspect: c / l,
|
|
5236
5248
|
texture: u
|
|
5237
5249
|
};
|
|
@@ -5370,7 +5382,13 @@ var gs = class {
|
|
|
5370
5382
|
set = (e) => {
|
|
5371
5383
|
this.sceneApi = e;
|
|
5372
5384
|
};
|
|
5373
|
-
}, _s = {
|
|
5385
|
+
}, _s = class {
|
|
5386
|
+
modelsApi = null;
|
|
5387
|
+
get = () => this.modelsApi;
|
|
5388
|
+
set = (e) => {
|
|
5389
|
+
this.modelsApi = e;
|
|
5390
|
+
};
|
|
5391
|
+
}, vs = {
|
|
5374
5392
|
bottom: 16,
|
|
5375
5393
|
height: 96,
|
|
5376
5394
|
pointerEvents: "auto",
|
|
@@ -5379,11 +5397,11 @@ var gs = class {
|
|
|
5379
5397
|
touchAction: "none",
|
|
5380
5398
|
width: 96,
|
|
5381
5399
|
zIndex: 2
|
|
5382
|
-
},
|
|
5400
|
+
}, ys = {
|
|
5383
5401
|
height: "100%",
|
|
5384
5402
|
position: "relative",
|
|
5385
5403
|
width: "100%"
|
|
5386
|
-
},
|
|
5404
|
+
}, bs = {
|
|
5387
5405
|
far: 50,
|
|
5388
5406
|
near: .1,
|
|
5389
5407
|
position: [
|
|
@@ -5392,18 +5410,18 @@ var gs = class {
|
|
|
5392
5410
|
10
|
|
5393
5411
|
],
|
|
5394
5412
|
zoom: 72
|
|
5395
|
-
},
|
|
5413
|
+
}, xs = {
|
|
5396
5414
|
alpha: !0,
|
|
5397
5415
|
antialias: !0
|
|
5398
|
-
},
|
|
5416
|
+
}, Ss = {
|
|
5399
5417
|
alpha: !0,
|
|
5400
5418
|
antialias: !1,
|
|
5401
5419
|
powerPreference: "high-performance"
|
|
5402
|
-
},
|
|
5420
|
+
}, Cs = {
|
|
5403
5421
|
antialias: !1,
|
|
5404
5422
|
powerPreference: "high-performance"
|
|
5405
|
-
},
|
|
5406
|
-
function
|
|
5423
|
+
}, ws = .1, Ts = .02, Es = 150, Ds = .75, Os = .6, ks = 1e3, As = 50, js = 30, Ms = 240, Ns = 2, Ps = 1.25, Fs = .08, Is = 1.2, Ls = 2, Rs = new D(), zs = new pe(), $ = new K(), Bs = new K(), Vs = new K();
|
|
5424
|
+
function Hs({ alpha: e = !0, performanceMode: t }) {
|
|
5407
5425
|
return async ({ canvas: n }) => {
|
|
5408
5426
|
let { WebGPURenderer: r } = await import("./three.webgpu-vPugBGTK.js").then((e) => e.i), i = new r({
|
|
5409
5427
|
alpha: e,
|
|
@@ -5413,7 +5431,7 @@ function Bs({ alpha: e = !0, performanceMode: t }) {
|
|
|
5413
5431
|
return await i.init?.(), i.setClearColor(0, 0), i;
|
|
5414
5432
|
};
|
|
5415
5433
|
}
|
|
5416
|
-
function
|
|
5434
|
+
function Us(e = !1) {
|
|
5417
5435
|
return {
|
|
5418
5436
|
active: e,
|
|
5419
5437
|
finalFitDone: !1,
|
|
@@ -5421,41 +5439,72 @@ function Vs(e = !1) {
|
|
|
5421
5439
|
userInteractedAfterFirstFit: !1
|
|
5422
5440
|
};
|
|
5423
5441
|
}
|
|
5424
|
-
function
|
|
5442
|
+
function Ws(e, t) {
|
|
5443
|
+
let n = e?.[t.modelID] ?? {
|
|
5444
|
+
data: {},
|
|
5445
|
+
name: t.modelName,
|
|
5446
|
+
props: {},
|
|
5447
|
+
structure: {}
|
|
5448
|
+
};
|
|
5449
|
+
return {
|
|
5450
|
+
...e ?? {},
|
|
5451
|
+
[t.modelID]: {
|
|
5452
|
+
...n,
|
|
5453
|
+
data: {
|
|
5454
|
+
...n.data,
|
|
5455
|
+
[t.geometryID]: t.geometry
|
|
5456
|
+
}
|
|
5457
|
+
}
|
|
5458
|
+
};
|
|
5459
|
+
}
|
|
5460
|
+
function Gs(e, t) {
|
|
5461
|
+
let n = { ...e ?? {} };
|
|
5462
|
+
return Object.entries(t).forEach(([t, r]) => {
|
|
5463
|
+
let i = Number(t);
|
|
5464
|
+
n[i] = {
|
|
5465
|
+
...r,
|
|
5466
|
+
data: {
|
|
5467
|
+
...e?.[i]?.data ?? {},
|
|
5468
|
+
...r.data
|
|
5469
|
+
}
|
|
5470
|
+
};
|
|
5471
|
+
}), n;
|
|
5472
|
+
}
|
|
5473
|
+
function Ks(e, t) {
|
|
5425
5474
|
return Array.isArray(e) ? [Math.min(e[0], t), Math.min(e[1], t)] : typeof e == "number" ? Math.min(e, t) : t;
|
|
5426
5475
|
}
|
|
5427
|
-
function
|
|
5428
|
-
return Array.isArray(e) ? [Math.max(e[0],
|
|
5476
|
+
function qs(e) {
|
|
5477
|
+
return Array.isArray(e) ? [Math.max(e[0], Ns), Math.max(e[1], Ns)] : typeof e == "number" ? Math.max(e, Ns) : Ns;
|
|
5429
5478
|
}
|
|
5430
|
-
function
|
|
5479
|
+
function Js() {
|
|
5431
5480
|
let e = navigator, t = navigator.userAgent.toLowerCase(), n = navigator.platform === "MacIntel" && navigator.maxTouchPoints > 1, r = window.matchMedia?.("(pointer: coarse)").matches ?? !1;
|
|
5432
5481
|
return e.userAgentData?.mobile || n || /android|iphone|ipad|ipod|mobile|tablet/.test(t) || navigator.maxTouchPoints > 1 && r ? "mobile" : "pc";
|
|
5433
5482
|
}
|
|
5434
|
-
function
|
|
5435
|
-
let t =
|
|
5436
|
-
return t ? Math.max(t.radius *
|
|
5483
|
+
function Ys(e) {
|
|
5484
|
+
let t = Xs(e);
|
|
5485
|
+
return t ? Math.max(t.radius * Ts, ws) : ws;
|
|
5437
5486
|
}
|
|
5438
|
-
function
|
|
5439
|
-
if (!e || (
|
|
5440
|
-
let t =
|
|
5487
|
+
function Xs(e) {
|
|
5488
|
+
if (!e || (Rs.setFromObject(e), Rs.isEmpty())) return null;
|
|
5489
|
+
let t = Rs.getBoundingSphere(zs);
|
|
5441
5490
|
return !Number.isFinite(t.radius) || t.radius <= 0 ? null : t;
|
|
5442
5491
|
}
|
|
5443
|
-
function
|
|
5492
|
+
function Zs(e) {
|
|
5444
5493
|
return e.type === "Group" && typeof e.userData.modelID == "number";
|
|
5445
5494
|
}
|
|
5446
|
-
function
|
|
5447
|
-
return e?.children.filter(
|
|
5495
|
+
function Qs(e) {
|
|
5496
|
+
return e?.children.filter(Zs) ?? [];
|
|
5448
5497
|
}
|
|
5449
|
-
function
|
|
5450
|
-
return
|
|
5498
|
+
function $s(e, t) {
|
|
5499
|
+
return Qs(e).find((e) => e.userData.modelID === t) ?? null;
|
|
5451
5500
|
}
|
|
5452
|
-
function
|
|
5453
|
-
let n =
|
|
5501
|
+
function ec(e, t) {
|
|
5502
|
+
let n = Xs(t);
|
|
5454
5503
|
if (!n) return;
|
|
5455
|
-
let r = Math.max(
|
|
5504
|
+
let r = Math.max(ks, n.radius * As, e.near + 1);
|
|
5456
5505
|
Math.abs(e.far - r) < 1 || (e.far = r, e.updateProjectionMatrix());
|
|
5457
5506
|
}
|
|
5458
|
-
function
|
|
5507
|
+
function tc(e, t) {
|
|
5459
5508
|
let n = new D();
|
|
5460
5509
|
return Object.entries(e).forEach(([e, r]) => {
|
|
5461
5510
|
let i = Number(e), a = t.elementBounds.get(i);
|
|
@@ -5465,16 +5514,16 @@ function Zs(e, t) {
|
|
|
5465
5514
|
});
|
|
5466
5515
|
}), n.isEmpty() ? null : n;
|
|
5467
5516
|
}
|
|
5468
|
-
function
|
|
5469
|
-
let t = e.getSize(
|
|
5470
|
-
return Number.isFinite(n) && n > 0 ? n *
|
|
5517
|
+
function nc(e) {
|
|
5518
|
+
let t = e.getSize(Vs), n = Math.max(t.x, t.y, t.z);
|
|
5519
|
+
return Number.isFinite(n) && n > 0 ? n * Fs : ws;
|
|
5471
5520
|
}
|
|
5472
|
-
function
|
|
5473
|
-
let r = Math.max(
|
|
5474
|
-
return Number.isFinite(i) && i >= r ? e : ($.copy(e).sub(t.position), (!Number.isFinite($.x + $.y + $.z) || $.lengthSq() === 0) && t.getWorldDirection($), $.lengthSq() === 0 && $.set(0, 0, -1), $.normalize(),
|
|
5521
|
+
function rc(e, t, n) {
|
|
5522
|
+
let r = Math.max(ws, (Number.isFinite(n) ? n : ws) * Ps), i = t.position.distanceTo(e);
|
|
5523
|
+
return Number.isFinite(i) && i >= r ? e : ($.copy(e).sub(t.position), (!Number.isFinite($.x + $.y + $.z) || $.lengthSq() === 0) && t.getWorldDirection($), $.lengthSq() === 0 && $.set(0, 0, -1), $.normalize(), Bs.copy(t.position).addScaledVector($, r));
|
|
5475
5524
|
}
|
|
5476
|
-
function
|
|
5477
|
-
let y = T((e) => e.camera), S = T((e) => e.gl), C = ht(s), w = kt(C), { colorPaletteTexture: D, colorUtils: O } = n(C), k = Vn(s), A = In(s, r, k, g), j = nr(s, r, k, A.getSelectableObjects), M = b(() => new Ea(), []), N = w.buildIndex,
|
|
5525
|
+
function ic({ autoFitCamera: e, cameraRef: t, controlRef: r, fitToView: i, lightRef: a, materialMode: o, modelRef: s, modelsData: c, modelsLoading: l, onReady: u, onCameraDprModeChange: f, publicApi: p, setSceneApi: m, usePerformanceMoving: h, useWebGPU: g }) {
|
|
5526
|
+
let y = T((e) => e.camera), S = T((e) => e.gl), C = ht(s), w = kt(C), { colorPaletteTexture: D, colorUtils: O } = n(C), k = Vn(s), A = In(s, r, k, g), j = nr(s, r, k, A.getSelectableObjects), M = b(() => new Ea(), []), N = w.buildIndex, te = C.resetIndex, ne = O.applyStoredColors, P = ti(), F = x(null), I = x(null), L = x(null), R = x(Us()), z = x(l), re = x(!1), B = d((e) => e.showStats), ie = _((e) => {
|
|
5478
5527
|
if (s.current = e, !e) return;
|
|
5479
5528
|
let t = e;
|
|
5480
5529
|
t.isClippingGroup = g, t.enabled = !1, t.clipIntersection = !1, t.clipShadows = !1, t.clippingPlanes = [];
|
|
@@ -5486,42 +5535,42 @@ function ec({ autoFitCamera: e, cameraRef: t, controlRef: r, fitToView: i, light
|
|
|
5486
5535
|
s,
|
|
5487
5536
|
g
|
|
5488
5537
|
]);
|
|
5489
|
-
let
|
|
5538
|
+
let ae = b(() => {
|
|
5490
5539
|
let e = Object.keys(c).sort((e, t) => Number(e) - Number(t));
|
|
5491
5540
|
for (let t of e) {
|
|
5492
5541
|
let e = it(c[Number(t)]);
|
|
5493
5542
|
if (e) return e;
|
|
5494
5543
|
}
|
|
5495
5544
|
return null;
|
|
5496
|
-
}, [c]),
|
|
5497
|
-
r.current && (r.current.minDistance =
|
|
5545
|
+
}, [c]), V = b(() => nt(ae ?? void 0), [ae]), H = b(() => Object.entries(c).map(([e, t]) => [Number(e), t]), [c]), U = o !== "performance", oe = _(() => {
|
|
5546
|
+
r.current && (r.current.minDistance = Ys(s.current));
|
|
5498
5547
|
}, [r, s]), W = _((e, t = !1) => {
|
|
5499
5548
|
let n = r.current;
|
|
5500
5549
|
if (!n) return !1;
|
|
5501
|
-
let i = t ?
|
|
5550
|
+
let i = t ? rc(e, y, n.minDistance) : e;
|
|
5502
5551
|
return n.cancel(), n.setOrbitPoint(i.x, i.y, i.z), !0;
|
|
5503
5552
|
}, [y, r]), le = _((e) => {
|
|
5504
|
-
|
|
5553
|
+
F.current = e.clone(), W(e, !0);
|
|
5505
5554
|
}, [W]), ue = _(() => {
|
|
5506
|
-
|
|
5555
|
+
F.current = null, P(s, r, a);
|
|
5507
5556
|
}, [
|
|
5508
5557
|
r,
|
|
5509
|
-
|
|
5558
|
+
P,
|
|
5510
5559
|
a,
|
|
5511
5560
|
s
|
|
5512
5561
|
]), de = _((t) => {
|
|
5513
5562
|
if (!t) return !1;
|
|
5514
|
-
if (!e || !i) return l || (
|
|
5515
|
-
let n =
|
|
5563
|
+
if (!e || !i) return l || (R.current = Us()), !1;
|
|
5564
|
+
let n = R.current;
|
|
5516
5565
|
if (l) {
|
|
5517
|
-
n.active || (
|
|
5518
|
-
let e =
|
|
5566
|
+
n.active || (R.current = Us(!0));
|
|
5567
|
+
let e = R.current;
|
|
5519
5568
|
return e.firstFitDone ? !1 : (e.firstFitDone = !0, !0);
|
|
5520
5569
|
}
|
|
5521
5570
|
if (n.active) {
|
|
5522
5571
|
if (n.finalFitDone) return !1;
|
|
5523
5572
|
let e = !n.firstFitDone || !n.userInteractedAfterFirstFit;
|
|
5524
|
-
return
|
|
5573
|
+
return R.current = Us(), e;
|
|
5525
5574
|
}
|
|
5526
5575
|
return !0;
|
|
5527
5576
|
}, [
|
|
@@ -5531,18 +5580,18 @@ function ec({ autoFitCamera: e, cameraRef: t, controlRef: r, fitToView: i, light
|
|
|
5531
5580
|
]), fe = _((e, t = !1) => {
|
|
5532
5581
|
let n = r.current;
|
|
5533
5582
|
if (!n) return;
|
|
5534
|
-
let i =
|
|
5583
|
+
let i = tc(e, C.buildIndex());
|
|
5535
5584
|
if (!i) return;
|
|
5536
5585
|
let a = i.getCenter(new K());
|
|
5537
|
-
if (
|
|
5538
|
-
let e =
|
|
5586
|
+
if (F.current = a.clone(), n.cancel(), t) {
|
|
5587
|
+
let e = nc(i);
|
|
5539
5588
|
n.fitToBox(i, !0, {
|
|
5540
5589
|
paddingBottom: e,
|
|
5541
5590
|
paddingLeft: e,
|
|
5542
5591
|
paddingRight: e,
|
|
5543
5592
|
paddingTop: e
|
|
5544
5593
|
}).then(() => {
|
|
5545
|
-
let e =
|
|
5594
|
+
let e = F.current;
|
|
5546
5595
|
e && W(e, !0);
|
|
5547
5596
|
});
|
|
5548
5597
|
return;
|
|
@@ -5568,10 +5617,10 @@ function ec({ autoFitCamera: e, cameraRef: t, controlRef: r, fitToView: i, light
|
|
|
5568
5617
|
]);
|
|
5569
5618
|
return v(() => {
|
|
5570
5619
|
let e = () => {
|
|
5571
|
-
|
|
5620
|
+
I.current !== null && (window.clearTimeout(I.current), I.current = null);
|
|
5572
5621
|
}, t = () => {
|
|
5573
|
-
let e =
|
|
5574
|
-
e !== null && (
|
|
5622
|
+
let e = L.current;
|
|
5623
|
+
e !== null && (L.current = null, A.setEdgesActive(e));
|
|
5575
5624
|
};
|
|
5576
5625
|
if (!h) {
|
|
5577
5626
|
e(), t(), f("sleep");
|
|
@@ -5580,9 +5629,9 @@ function ec({ autoFitCamera: e, cameraRef: t, controlRef: r, fitToView: i, light
|
|
|
5580
5629
|
let n = r.current;
|
|
5581
5630
|
if (!n) return;
|
|
5582
5631
|
let i = () => {
|
|
5583
|
-
e(), f("wake"),
|
|
5584
|
-
|
|
5585
|
-
},
|
|
5632
|
+
e(), f("wake"), I.current = window.setTimeout(() => {
|
|
5633
|
+
I.current = null, f("move"), L.current === null && (L.current = A.getEdgesActive()), L.current && A.setEdgesActive(!1);
|
|
5634
|
+
}, Es);
|
|
5586
5635
|
}, a = () => {
|
|
5587
5636
|
e(), t(), f("sleep");
|
|
5588
5637
|
};
|
|
@@ -5595,12 +5644,12 @@ function ec({ autoFitCamera: e, cameraRef: t, controlRef: r, fitToView: i, light
|
|
|
5595
5644
|
f,
|
|
5596
5645
|
h
|
|
5597
5646
|
]), v(() => {
|
|
5598
|
-
l && !
|
|
5647
|
+
l && !z.current && (R.current = Us(!0)), z.current = l;
|
|
5599
5648
|
}, [l]), v(() => {
|
|
5600
5649
|
let e = r.current;
|
|
5601
5650
|
if (!e) return;
|
|
5602
5651
|
let t = () => {
|
|
5603
|
-
let e =
|
|
5652
|
+
let e = R.current;
|
|
5604
5653
|
!e.active || !e.firstFitDone || (e.userInteractedAfterFirstFit = !0);
|
|
5605
5654
|
};
|
|
5606
5655
|
return e.addEventListener("controlstart", t), e.addEventListener("control", t), () => {
|
|
@@ -5608,7 +5657,7 @@ function ec({ autoFitCamera: e, cameraRef: t, controlRef: r, fitToView: i, light
|
|
|
5608
5657
|
};
|
|
5609
5658
|
}, [r]), Qr(s, r, k, le, A.getSelectableObjects, A.setCapsPreselection), ir(), v(() => {
|
|
5610
5659
|
let e = S.domElement, t = (e) => {
|
|
5611
|
-
let t =
|
|
5660
|
+
let t = F.current;
|
|
5612
5661
|
t && e.button === 0 && (e.ctrlKey || e.metaKey || e.shiftKey || W(t, !0));
|
|
5613
5662
|
};
|
|
5614
5663
|
return e.addEventListener("pointerdown", t, !0), () => {
|
|
@@ -5636,19 +5685,19 @@ function ec({ autoFitCamera: e, cameraRef: t, controlRef: r, fitToView: i, light
|
|
|
5636
5685
|
}
|
|
5637
5686
|
}, a = (e) => {
|
|
5638
5687
|
if (n || !s.current) return;
|
|
5639
|
-
s.current.updateMatrixWorld(!0), (y instanceof ce || y instanceof se) &&
|
|
5688
|
+
s.current.updateMatrixWorld(!0), (y instanceof ce || y instanceof se) && ec(y, s.current), oe(), te();
|
|
5640
5689
|
let r = N();
|
|
5641
5690
|
if (!r.records.size && e > 0) {
|
|
5642
5691
|
t = requestAnimationFrame(() => a(e - 1));
|
|
5643
5692
|
return;
|
|
5644
5693
|
}
|
|
5645
|
-
|
|
5694
|
+
ne(), A.syncWithModel(), j.syncWithModel(), de(r.records.size > 0) && i();
|
|
5646
5695
|
};
|
|
5647
|
-
return r(() => a(
|
|
5696
|
+
return r(() => a(g ? Ms : js)), () => {
|
|
5648
5697
|
n = !0, t !== null && cancelAnimationFrame(t);
|
|
5649
5698
|
};
|
|
5650
5699
|
}, [
|
|
5651
|
-
|
|
5700
|
+
ne,
|
|
5652
5701
|
e,
|
|
5653
5702
|
N,
|
|
5654
5703
|
y,
|
|
@@ -5659,7 +5708,7 @@ function ec({ autoFitCamera: e, cameraRef: t, controlRef: r, fitToView: i, light
|
|
|
5659
5708
|
a,
|
|
5660
5709
|
s,
|
|
5661
5710
|
c,
|
|
5662
|
-
|
|
5711
|
+
te,
|
|
5663
5712
|
de,
|
|
5664
5713
|
oe,
|
|
5665
5714
|
g
|
|
@@ -5720,8 +5769,8 @@ function ec({ autoFitCamera: e, cameraRef: t, controlRef: r, fitToView: i, light
|
|
|
5720
5769
|
geometryUtils: {
|
|
5721
5770
|
getAllIds: w.getAllIds,
|
|
5722
5771
|
getIfcSpacesVisibility: w.getIfcSpacesVisibility,
|
|
5723
|
-
getModelGeometry: (e) =>
|
|
5724
|
-
getModelsGeometry: () =>
|
|
5772
|
+
getModelGeometry: (e) => $s(s.current, e),
|
|
5773
|
+
getModelsGeometry: () => Qs(s.current),
|
|
5725
5774
|
hideByIds: (e) => t(() => w.hideByIds(e)),
|
|
5726
5775
|
hideSelected: () => t(w.hideSelected),
|
|
5727
5776
|
isolateByIds: (e) => t(() => w.isolateByIds(e)),
|
|
@@ -5733,7 +5782,7 @@ function ec({ autoFitCamera: e, cameraRef: t, controlRef: r, fitToView: i, light
|
|
|
5733
5782
|
toggleIIfcSpacesVisibility: () => t(w.toggleIIfcSpacesVisibility)
|
|
5734
5783
|
},
|
|
5735
5784
|
selector: { setTargetToSelection: fe }
|
|
5736
|
-
}),
|
|
5785
|
+
}), re.current || (re.current = !0, u?.(p)), () => m(null);
|
|
5737
5786
|
}, [
|
|
5738
5787
|
A,
|
|
5739
5788
|
k,
|
|
@@ -5751,7 +5800,7 @@ function ec({ autoFitCamera: e, cameraRef: t, controlRef: r, fitToView: i, light
|
|
|
5751
5800
|
fe
|
|
5752
5801
|
]), /* @__PURE__ */ J(Ce, { children: [
|
|
5753
5802
|
U && /* @__PURE__ */ J(Ce, { children: [/* @__PURE__ */ q("ambientLight", {
|
|
5754
|
-
intensity:
|
|
5803
|
+
intensity: Is,
|
|
5755
5804
|
color: "#ffffff"
|
|
5756
5805
|
}), /* @__PURE__ */ q("directionalLight", {
|
|
5757
5806
|
ref: a,
|
|
@@ -5761,14 +5810,14 @@ function ec({ autoFitCamera: e, cameraRef: t, controlRef: r, fitToView: i, light
|
|
|
5761
5810
|
10
|
|
5762
5811
|
],
|
|
5763
5812
|
color: "#ffffff",
|
|
5764
|
-
intensity:
|
|
5813
|
+
intensity: Ls
|
|
5765
5814
|
})] }),
|
|
5766
|
-
|
|
5815
|
+
B && /* @__PURE__ */ q(ee, {}),
|
|
5767
5816
|
/* @__PURE__ */ q("group", {
|
|
5768
|
-
ref:
|
|
5817
|
+
ref: ie,
|
|
5769
5818
|
children: H.map(([e, t]) => /* @__PURE__ */ q(ot, {
|
|
5770
5819
|
colorPaletteTexture: D,
|
|
5771
|
-
coordinationMatrix:
|
|
5820
|
+
coordinationMatrix: V,
|
|
5772
5821
|
data: t,
|
|
5773
5822
|
materialMode: o,
|
|
5774
5823
|
modelID: e,
|
|
@@ -5778,103 +5827,159 @@ function ec({ autoFitCamera: e, cameraRef: t, controlRef: r, fitToView: i, light
|
|
|
5778
5827
|
/* @__PURE__ */ q(E, {
|
|
5779
5828
|
dollyToCursor: !0,
|
|
5780
5829
|
infinityDolly: !0,
|
|
5781
|
-
minDistance:
|
|
5830
|
+
minDistance: ws,
|
|
5782
5831
|
ref: r,
|
|
5783
5832
|
draggingSmoothTime: .03,
|
|
5784
5833
|
smoothTime: .05
|
|
5785
5834
|
})
|
|
5786
5835
|
] });
|
|
5787
5836
|
}
|
|
5788
|
-
function
|
|
5837
|
+
function ac({ autoFitCamera: e = !0, camera: t = {
|
|
5789
5838
|
position: [
|
|
5790
5839
|
10,
|
|
5791
5840
|
10,
|
|
5792
5841
|
10
|
|
5793
5842
|
],
|
|
5794
5843
|
fov: 50
|
|
5795
|
-
}, dpr: n = window.devicePixelRatio, fitToView: i, modelUrls: a, modelSources: o,
|
|
5796
|
-
let
|
|
5797
|
-
|
|
5798
|
-
|
|
5799
|
-
}, [
|
|
5800
|
-
|
|
5801
|
-
}, [
|
|
5802
|
-
|
|
5803
|
-
}, [
|
|
5844
|
+
}, dpr: n = window.devicePixelRatio, fitToView: i, modelUrls: a, modelSources: o, modelsData: s, materialMode: c, onReady: l, performanceMode: u = !1, publicApi: f, setModelsApi: p, setSceneApi: m, showNavCube: h, showStats: g, usePerformanceMoving: y = !1, useWebGPU: w = !1 }) {
|
|
5845
|
+
let T = x(null), E = x(null), ee = x(null), D = x(null), [O, k] = S(), [A, j] = S(!1), [M, N] = S(!0), [te, ne] = S(null), P = x(void 0), F = x(!1), I = x(null), L = x(0), R = r(), z = d((e) => e.setModelNames), re = d((e) => e.setModelProps), B = d((e) => e.setModelStructure), ie = d((e) => e.setShowNavCube), ae = d((e) => e.setShowStats), V = d((e) => e.setUserDevice), H = d((e) => e.showNavCube), U = s ?? O, oe = A, W = i ?? M, se = u ? Ks(n, 1) : n, ce = Ks(se, u ? Os : Ds), le = c ?? (u ? "performance" : void 0), [ue, de] = S("sleep"), fe = qs(se), pe = b(() => w ? Hs({ performanceMode: u }) : u ? Cs : void 0, [u, w]), me = u ? Ss : xs;
|
|
5846
|
+
v(() => {
|
|
5847
|
+
P.current = U;
|
|
5848
|
+
}, [U]), v(() => {
|
|
5849
|
+
F.current = oe;
|
|
5850
|
+
}, [oe]), v(() => {
|
|
5851
|
+
I.current = te;
|
|
5852
|
+
}, [te]);
|
|
5853
|
+
let he = _(() => {
|
|
5854
|
+
L.current += 1, j(!1), ne(null), k(void 0), R.getState().setSelection({});
|
|
5855
|
+
}, [R]), ge = _((e, t) => {
|
|
5856
|
+
k((n) => {
|
|
5857
|
+
let r = e(n);
|
|
5858
|
+
return t?.(r), r;
|
|
5859
|
+
});
|
|
5860
|
+
}, []), _e = _((e, t) => {
|
|
5861
|
+
ge((t) => Ws(t, e), t);
|
|
5862
|
+
}, [ge]), G = _(async (e, t = {}) => {
|
|
5863
|
+
let { clearViewer: n = !1, fitToView: r = !0, onChunk: i, onModelLoadingChange: a, onModelProgress: o, onModelsDataChange: s, onProgress: c, ...l } = t, u = L.current + 1;
|
|
5864
|
+
L.current = u, ne(null), N(r), j(!0), o?.(null), a?.(!0), R.getState().setSelection({}), n && (k({}), s?.({}));
|
|
5865
|
+
let d = (e) => {
|
|
5866
|
+
L.current === u && ne(e), o?.(e), c?.(e);
|
|
5867
|
+
};
|
|
5868
|
+
try {
|
|
5869
|
+
let t = !!l.useWorker, n = await Ro.loadModel(e, {
|
|
5870
|
+
...l,
|
|
5871
|
+
...t ? {
|
|
5872
|
+
collectWorkerChunks: l.collectWorkerChunks ?? !1,
|
|
5873
|
+
onChunk: (e) => {
|
|
5874
|
+
L.current === u && _e(e, s), i?.(e);
|
|
5875
|
+
},
|
|
5876
|
+
onProgress: d
|
|
5877
|
+
} : { onProgress: d }
|
|
5878
|
+
});
|
|
5879
|
+
return L.current === u && ge((e) => t ? Gs(e, n) : {
|
|
5880
|
+
...e ?? {},
|
|
5881
|
+
...n
|
|
5882
|
+
}, s), n;
|
|
5883
|
+
} finally {
|
|
5884
|
+
L.current === u && (j(!1), a?.(!1));
|
|
5885
|
+
}
|
|
5886
|
+
}, [
|
|
5887
|
+
_e,
|
|
5888
|
+
ge,
|
|
5889
|
+
R
|
|
5890
|
+
]), K = b(() => ({
|
|
5891
|
+
getData: () => P.current,
|
|
5892
|
+
getLoading: () => F.current,
|
|
5893
|
+
getProgress: () => I.current,
|
|
5894
|
+
loadModels: G,
|
|
5895
|
+
reset: he
|
|
5896
|
+
}), [G, he]);
|
|
5897
|
+
return v(() => (p(K), () => p(null)), [K, p]), v(() => {
|
|
5898
|
+
V(Js());
|
|
5899
|
+
}, [V]), v(() => {
|
|
5900
|
+
ae(!!g);
|
|
5901
|
+
}, [ae, g]), v(() => {
|
|
5902
|
+
h !== void 0 && ie(h);
|
|
5903
|
+
}, [ie, h]), v(() => {
|
|
5804
5904
|
let e = {}, t = {}, n = {};
|
|
5805
|
-
|
|
5905
|
+
U && Object.entries(U).forEach(([r, i]) => {
|
|
5806
5906
|
let a = Number(r);
|
|
5807
5907
|
i.name !== void 0 && (e[a] = i.name), i.props !== void 0 && (t[a] = i.props), i.structure !== void 0 && (n[a] = i.structure);
|
|
5808
|
-
}),
|
|
5908
|
+
}), z(e), re(t), B(n);
|
|
5809
5909
|
}, [
|
|
5810
|
-
|
|
5811
|
-
|
|
5812
|
-
|
|
5813
|
-
|
|
5910
|
+
U,
|
|
5911
|
+
z,
|
|
5912
|
+
re,
|
|
5913
|
+
B
|
|
5814
5914
|
]), v(() => {
|
|
5815
|
-
if (
|
|
5816
|
-
let
|
|
5817
|
-
|
|
5818
|
-
|
|
5819
|
-
|
|
5820
|
-
|
|
5821
|
-
}), () => {
|
|
5822
|
-
t = !1;
|
|
5823
|
-
};
|
|
5915
|
+
if (s) return;
|
|
5916
|
+
let t = o ?? a;
|
|
5917
|
+
t?.length && G(t, {
|
|
5918
|
+
clearViewer: !0,
|
|
5919
|
+
fitToView: e
|
|
5920
|
+
});
|
|
5824
5921
|
}, [
|
|
5825
|
-
|
|
5922
|
+
e,
|
|
5923
|
+
s,
|
|
5924
|
+
G,
|
|
5826
5925
|
o,
|
|
5827
5926
|
a
|
|
5828
|
-
]),
|
|
5829
|
-
style:
|
|
5927
|
+
]), U ? /* @__PURE__ */ J("div", {
|
|
5928
|
+
style: ys,
|
|
5830
5929
|
children: [/* @__PURE__ */ q(C, {
|
|
5831
5930
|
camera: t,
|
|
5832
|
-
dpr:
|
|
5833
|
-
gl:
|
|
5931
|
+
dpr: y && ue === "move" ? ce : se,
|
|
5932
|
+
gl: pe,
|
|
5834
5933
|
children: /* @__PURE__ */ q(ni, {
|
|
5835
|
-
store:
|
|
5836
|
-
children: /* @__PURE__ */ q(
|
|
5934
|
+
store: R,
|
|
5935
|
+
children: /* @__PURE__ */ q(ic, {
|
|
5837
5936
|
autoFitCamera: e,
|
|
5838
|
-
cameraRef:
|
|
5839
|
-
controlRef:
|
|
5840
|
-
fitToView:
|
|
5841
|
-
lightRef:
|
|
5842
|
-
materialMode:
|
|
5843
|
-
modelRef:
|
|
5844
|
-
modelsData:
|
|
5845
|
-
modelsLoading:
|
|
5846
|
-
onReady:
|
|
5847
|
-
onCameraDprModeChange:
|
|
5848
|
-
publicApi:
|
|
5937
|
+
cameraRef: T,
|
|
5938
|
+
controlRef: E,
|
|
5939
|
+
fitToView: W,
|
|
5940
|
+
lightRef: D,
|
|
5941
|
+
materialMode: le,
|
|
5942
|
+
modelRef: ee,
|
|
5943
|
+
modelsData: U,
|
|
5944
|
+
modelsLoading: oe,
|
|
5945
|
+
onReady: l,
|
|
5946
|
+
onCameraDprModeChange: de,
|
|
5947
|
+
publicApi: f,
|
|
5849
5948
|
setSceneApi: m,
|
|
5850
|
-
usePerformanceMoving:
|
|
5851
|
-
useWebGPU:
|
|
5949
|
+
usePerformanceMoving: y,
|
|
5950
|
+
useWebGPU: w
|
|
5852
5951
|
})
|
|
5853
5952
|
})
|
|
5854
|
-
},
|
|
5855
|
-
style:
|
|
5953
|
+
}, w ? "viewer-webgpu" : "viewer-webgl"), H && /* @__PURE__ */ q("div", {
|
|
5954
|
+
style: vs,
|
|
5856
5955
|
children: /* @__PURE__ */ q(C, {
|
|
5857
|
-
camera:
|
|
5858
|
-
dpr:
|
|
5859
|
-
gl:
|
|
5956
|
+
camera: bs,
|
|
5957
|
+
dpr: fe,
|
|
5958
|
+
gl: me,
|
|
5860
5959
|
orthographic: !0,
|
|
5861
5960
|
children: /* @__PURE__ */ q(hs, {
|
|
5862
5961
|
active: !0,
|
|
5863
|
-
cameraRef:
|
|
5864
|
-
controlRef:
|
|
5865
|
-
modelRef:
|
|
5962
|
+
cameraRef: T,
|
|
5963
|
+
controlRef: E,
|
|
5964
|
+
modelRef: ee
|
|
5866
5965
|
})
|
|
5867
5966
|
}, "nav-cube-webgl")
|
|
5868
5967
|
})]
|
|
5869
5968
|
}) : /* @__PURE__ */ q(Ce, {});
|
|
5870
5969
|
}
|
|
5871
|
-
var
|
|
5970
|
+
var oc = m(function(e, t) {
|
|
5872
5971
|
let [n] = S(o), r = x(!1), i = x(!1), a = b(() => new gs(), []), { defaultSelected: s, onSelectedChange: c, selected: l } = e, u = _((e) => {
|
|
5873
5972
|
a.set(e);
|
|
5874
|
-
}, [a]), d = b(() =>
|
|
5875
|
-
|
|
5876
|
-
|
|
5877
|
-
|
|
5973
|
+
}, [a]), d = b(() => new _s(), []), f = _((e) => {
|
|
5974
|
+
d.set(e);
|
|
5975
|
+
}, [d]), p = b(() => Wa(n, a.get, d.get), [
|
|
5976
|
+
d,
|
|
5977
|
+
a,
|
|
5978
|
+
n
|
|
5979
|
+
]);
|
|
5980
|
+
return y(t, () => p, [p]), v(() => (n.getState().setApi(p), () => {
|
|
5981
|
+
n.getState().api === p && n.getState().setApi(null);
|
|
5982
|
+
}), [p, n]), v(() => {
|
|
5878
5983
|
r.current || !s || l !== void 0 || (r.current = !0, n.getState().setSelection(Ua(s)));
|
|
5879
5984
|
}, [
|
|
5880
5985
|
l,
|
|
@@ -5888,13 +5993,14 @@ var nc = m(function(e, t) {
|
|
|
5888
5993
|
});
|
|
5889
5994
|
}, [c, n]), /* @__PURE__ */ q(ni, {
|
|
5890
5995
|
store: n,
|
|
5891
|
-
children: /* @__PURE__ */ q(
|
|
5996
|
+
children: /* @__PURE__ */ q(ac, {
|
|
5892
5997
|
...e,
|
|
5893
|
-
publicApi:
|
|
5998
|
+
publicApi: p,
|
|
5999
|
+
setModelsApi: f,
|
|
5894
6000
|
setSceneApi: u
|
|
5895
6001
|
})
|
|
5896
6002
|
});
|
|
5897
6003
|
});
|
|
5898
|
-
|
|
6004
|
+
oc.displayName = "Viewer";
|
|
5899
6005
|
//#endregion
|
|
5900
|
-
export { Ka as BMTLoader, Ea as BmtConverter, Oa as ConvertIfcFileToBmt, ka as ConvertToBmt, Jn as DimensionLine, tr as DimensionsUtils, Va as FilteredElementsCollector, $e as ModelGrids, hs as NavigationCube,
|
|
6006
|
+
export { Ka as BMTLoader, Ea as BmtConverter, Oa as ConvertIfcFileToBmt, ka as ConvertToBmt, Jn as DimensionLine, tr as DimensionsUtils, Va as FilteredElementsCollector, $e as ModelGrids, hs as NavigationCube, oc as Viewer, ni as ViewerStoreProvider, Da as bmtConverter, vo as convertIfcFilesToBmtInWorker, yo as createBmtConverterWorker, no as createBmtWorker, jo as createIfcWorker, o as createViewerStore, Gi as exportExcel, Hi as exportModelPropertiesToExcel, to as loadBmtModelsInWorker, Ao as loadIfcModelsInWorker, Ro as loader, nr as useDimensionsUtils, d as useViewerStore, r as useViewerStoreApi };
|