bimatter-viewer-react 0.11.2 → 0.11.4
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/{IFCLoader-N1C1bJ4O.js → IFCLoader-CQYQx4TL.js} +64 -41
- package/lib/Loaders/IFCLoader/PropertySerializer.d.ts +3 -0
- package/lib/api/ViewerApi.d.ts +1 -0
- package/lib/assets/{BmtConverterWorker-C90sCwAT.js → BmtConverterWorker-D6_8Zn9y.js} +1 -1
- package/lib/assets/{IFCWorker-pZu61wpO.js → IFCWorker-CfepOBoh.js} +1 -1
- package/lib/index.js +317 -279
- package/lib/store/ViewerStore.d.ts +1 -0
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -124,6 +124,17 @@ function Ct() {
|
|
|
124
124
|
setModelNames: (t) => e({ modelNames: t }),
|
|
125
125
|
setModelProps: (t) => e({ modelProps: t }),
|
|
126
126
|
setModelStructure: (t) => e({ modelStructure: t }),
|
|
127
|
+
removeModelState: (t) => {
|
|
128
|
+
e((e) => {
|
|
129
|
+
let n = { ...e.modelNames }, r = { ...e.modelProps }, i = { ...e.modelStructure }, a = { ...e.selected };
|
|
130
|
+
return delete n[t], delete r[t], delete i[t], delete a[t], {
|
|
131
|
+
modelNames: n,
|
|
132
|
+
modelProps: r,
|
|
133
|
+
modelStructure: i,
|
|
134
|
+
selected: a
|
|
135
|
+
};
|
|
136
|
+
});
|
|
137
|
+
},
|
|
127
138
|
setPerformanceMovingFactor: (t) => e({ performanceMovingFactor: Number.isFinite(t) ? Math.max(0, Math.min(1, t)) : xt }),
|
|
128
139
|
setPreselectionColor: (t) => e({ preselectionColor: t }),
|
|
129
140
|
setPreselectionEnabled: (t) => e({ preselectionEnabled: t }),
|
|
@@ -857,7 +868,7 @@ var qn = "BMT", Jn = 1, Yn = {
|
|
|
857
868
|
}
|
|
858
869
|
async getIfcLoader(e) {
|
|
859
870
|
if (!this.ifcLoader) {
|
|
860
|
-
let { IFCLoader: e } = await import("./IFCLoader-
|
|
871
|
+
let { IFCLoader: e } = await import("./IFCLoader-CQYQx4TL.js");
|
|
861
872
|
this.ifcLoader = new e();
|
|
862
873
|
}
|
|
863
874
|
return this.configureIfcLoader(this.ifcLoader, e), this.ifcLoader;
|
|
@@ -1665,6 +1676,9 @@ function Or(e, t, n, r) {
|
|
|
1665
1676
|
},
|
|
1666
1677
|
reset: () => {
|
|
1667
1678
|
n()?.reset();
|
|
1679
|
+
},
|
|
1680
|
+
unloadModel: (e) => {
|
|
1681
|
+
n()?.unloadModel(e);
|
|
1668
1682
|
}
|
|
1669
1683
|
},
|
|
1670
1684
|
notes: {
|
|
@@ -2103,7 +2117,7 @@ function Br() {
|
|
|
2103
2117
|
//#endregion
|
|
2104
2118
|
//#region src/viewer/workers/BmtConverterWorker.ts?worker
|
|
2105
2119
|
function Vr(e) {
|
|
2106
|
-
return new Worker("" + new URL("assets/BmtConverterWorker-
|
|
2120
|
+
return new Worker("" + new URL("assets/BmtConverterWorker-D6_8Zn9y.js", import.meta.url).href, { name: e?.name });
|
|
2107
2121
|
}
|
|
2108
2122
|
//#endregion
|
|
2109
2123
|
//#region src/viewer/workers/BmtConverterWorkerClient.ts
|
|
@@ -2221,7 +2235,7 @@ function ni() {
|
|
|
2221
2235
|
//#endregion
|
|
2222
2236
|
//#region src/viewer/workers/IFCWorker.ts?worker
|
|
2223
2237
|
function ri(e) {
|
|
2224
|
-
return new Worker("" + new URL("assets/IFCWorker-
|
|
2238
|
+
return new Worker("" + new URL("assets/IFCWorker-CfepOBoh.js", import.meta.url).href, { name: e?.name });
|
|
2225
2239
|
}
|
|
2226
2240
|
//#endregion
|
|
2227
2241
|
//#region src/viewer/workers/IFCWorkerClient.ts
|
|
@@ -2356,7 +2370,7 @@ var xi = new class {
|
|
|
2356
2370
|
}
|
|
2357
2371
|
async getIfcLoader(e = {}) {
|
|
2358
2372
|
if (!this.ifcLoader) {
|
|
2359
|
-
let { IFCLoader: e } = await import("./IFCLoader-
|
|
2373
|
+
let { IFCLoader: e } = await import("./IFCLoader-CQYQx4TL.js");
|
|
2360
2374
|
this.ifcLoader = new e();
|
|
2361
2375
|
}
|
|
2362
2376
|
return this.ifcLoader.useIfcSpace = e.useIfcSpace ?? this.useIfcSpace, e.chunk !== void 0 && (this.ifcLoader.chunk = e.chunk), e.maxMeshBytes !== void 0 && (this.ifcLoader.maxMeshBytes = e.maxMeshBytes), this.ifcLoader.mergeVertices = e.mergeVertices ?? !0, e.wasmPath !== void 0 && (this.ifcLoader.wasmPath = e.wasmPath), this.ifcLoader;
|
|
@@ -11764,53 +11778,60 @@ function Wm({ autoFitCamera: e, cameraRef: t, controlRef: n, fitToView: r, loadG
|
|
|
11764
11778
|
I,
|
|
11765
11779
|
me,
|
|
11766
11780
|
he
|
|
11767
|
-
]), _e = b(() => new $n(), []), ve = oe.buildIndex, ye = M.resetIndex, L = ce.applyStoredColors, be = gp(), xe = x(null), R = x(null), z = x(null), Ce = x(null), we = x(null), Te = x(null), B = x(vm()), Ee = x([]), De = x(/* @__PURE__ */ new Map()), Oe = x(
|
|
11768
|
-
|
|
11769
|
-
|
|
11770
|
-
|
|
11771
|
-
|
|
11772
|
-
|
|
11781
|
+
]), _e = b(() => new $n(), []), ve = oe.buildIndex, ye = M.resetIndex, L = ce.applyStoredColors, be = gp(), xe = x(null), R = x(null), z = x(null), Ce = x(null), we = x(null), Te = x(null), B = x(vm()), Ee = x([]), De = x(/* @__PURE__ */ new Map()), Oe = x(/* @__PURE__ */ new Set()), ke = x(l), Me = x(null), Ne = x(null), Pe = x(null), Fe = x(0), Ie = x(!1), Le = x(l), Re = x(!1), ze = x(!1), Be = x(i), Ve = x(/* @__PURE__ */ new Map()), [He, Ue] = S(0), [We, Ge] = S(0);
|
|
11782
|
+
_(() => {
|
|
11783
|
+
let e = new Set(Object.keys(c).map((e) => Number(e)));
|
|
11784
|
+
Oe.current.forEach((t) => {
|
|
11785
|
+
e.has(t) || ce.clearModelColors(t);
|
|
11786
|
+
}), Oe.current = e;
|
|
11787
|
+
}, [ce, c]);
|
|
11788
|
+
let [Ke, qe] = S(!1), [Je, Ye] = S({}), Xe = x(!1), V = G((e) => e.showStats), Ze = G((e) => e.lighting), Qe = G((e) => e.performanceMovingFactor);
|
|
11789
|
+
Be.current !== i && (Be.current = i, Ve.current.clear(), B.current = vm(), Me.current = null);
|
|
11790
|
+
let $e = h((e, t, n) => {
|
|
11791
|
+
let r = Ve.current.get(e) ?? 0;
|
|
11792
|
+
Ve.current.set(e, t), n > 0 && t >= n && r < n && Ue((e) => e + 1);
|
|
11793
|
+
}, []), H = h((e) => {
|
|
11773
11794
|
if (s.current = e, !e) return;
|
|
11774
11795
|
let t = e;
|
|
11775
11796
|
t.isClippingGroup = k, t.enabled = !1, t.clipIntersection = !1, t.clipShadows = !1, t.clippingPlanes = [];
|
|
11776
|
-
}, [s, k]),
|
|
11777
|
-
let t =
|
|
11797
|
+
}, [s, k]), et = h((e) => {
|
|
11798
|
+
let t = Ne.current;
|
|
11778
11799
|
if (!t || e.camera.uuid !== t.cameraUuid) return !1;
|
|
11779
|
-
|
|
11800
|
+
Ne.current = null, e.cancel(), e.updateCameraUp();
|
|
11780
11801
|
let n = e;
|
|
11781
11802
|
return e.zoomTo(t.zoom, !1), e.setFocalOffset(0, 0, 0, !1), e.setLookAt(t.position.x, t.position.y, t.position.z, t.target.x, t.target.y, t.target.z, !1), Om(e), e.minDistance = Dm(s.current), e.stop(), e.update(0), n.saveState?.(), j(), !0;
|
|
11782
|
-
}, [j, s]),
|
|
11803
|
+
}, [j, s]), tt = h((e) => {
|
|
11783
11804
|
let t = n;
|
|
11784
|
-
t.current !== e && (t.current = e, e && (e.minDistance = Dm(s.current), Om(e),
|
|
11805
|
+
t.current !== e && (t.current = e, e && (e.minDistance = Dm(s.current), Om(e), et(e)), Ge((e) => e + 1));
|
|
11785
11806
|
}, [
|
|
11786
11807
|
n,
|
|
11787
11808
|
s,
|
|
11788
|
-
|
|
11789
|
-
]),
|
|
11790
|
-
|
|
11809
|
+
et
|
|
11810
|
+
]), it = h((e) => {
|
|
11811
|
+
Xe.current = e, qe(e);
|
|
11791
11812
|
let t = n.current;
|
|
11792
11813
|
t && (t.enabled = !e, e && (t.cancel(), t.stop()));
|
|
11793
|
-
}, [n]),
|
|
11794
|
-
|
|
11814
|
+
}, [n]), at = h((e) => {
|
|
11815
|
+
Ye((t) => ({
|
|
11795
11816
|
...t,
|
|
11796
11817
|
...e
|
|
11797
11818
|
}));
|
|
11798
|
-
}, []),
|
|
11819
|
+
}, []), st = h(() => {
|
|
11799
11820
|
R.current !== null && (window.clearTimeout(R.current), R.current = null), z.current !== null && (window.clearTimeout(z.current), z.current = null), Ce.current !== null && (window.clearTimeout(Ce.current), Ce.current = null), Em(Te.current), Te.current = null, we.current = null, N.setCapsCameraMotionActive(!1), N.setEdgesCameraMotionActive?.(!1), v("sleep"), j();
|
|
11800
11821
|
}, [
|
|
11801
11822
|
N,
|
|
11802
11823
|
j,
|
|
11803
11824
|
v
|
|
11804
|
-
]),
|
|
11825
|
+
]), lt = h((e) => {
|
|
11805
11826
|
let t = n.current;
|
|
11806
11827
|
if (t) {
|
|
11807
11828
|
if (!e) {
|
|
11808
|
-
let e =
|
|
11809
|
-
if (!e || (
|
|
11829
|
+
let e = Pe.current;
|
|
11830
|
+
if (!e || (Pe.current = null, e.controls !== t)) return;
|
|
11810
11831
|
t.mouseButtons.left = e.mouseButtons.left, t.mouseButtons.middle = e.mouseButtons.middle, t.mouseButtons.right = e.mouseButtons.right, t.mouseButtons.wheel = e.mouseButtons.wheel, t.touches.one = e.touches.one, t.touches.two = e.touches.two, t.touches.three = e.touches.three, t.dollyToCursor = e.dollyToCursor, t.infinityDolly = e.infinityDolly;
|
|
11811
11832
|
return;
|
|
11812
11833
|
}
|
|
11813
|
-
|
|
11834
|
+
Pe.current?.controls !== t && (Pe.current = {
|
|
11814
11835
|
controls: t,
|
|
11815
11836
|
dollyToCursor: t.dollyToCursor,
|
|
11816
11837
|
infinityDolly: t.infinityDolly,
|
|
@@ -11818,16 +11839,16 @@ function Wm({ autoFitCamera: e, cameraRef: t, controlRef: n, fitToView: r, loadG
|
|
|
11818
11839
|
touches: { ...t.touches }
|
|
11819
11840
|
}, t.mouseButtons.left = Fs.ACTION.TRUCK, t.mouseButtons.middle = Fs.ACTION.ZOOM, t.mouseButtons.right = Fs.ACTION.TRUCK, t.mouseButtons.wheel = Fs.ACTION.ZOOM, t.touches.one = Fs.ACTION.TOUCH_TRUCK, t.touches.two = Fs.ACTION.TOUCH_ZOOM_TRUCK, t.touches.three = Fs.ACTION.TOUCH_TRUCK, t.dollyToCursor = !0, t.infinityDolly = !1);
|
|
11820
11841
|
}
|
|
11821
|
-
}, [n]),
|
|
11822
|
-
if (
|
|
11823
|
-
|
|
11842
|
+
}, [n]), ut = h((e) => {
|
|
11843
|
+
if (Ie.current = e, e) {
|
|
11844
|
+
st(), lt(!0);
|
|
11824
11845
|
return;
|
|
11825
11846
|
}
|
|
11826
|
-
|
|
11827
|
-
}, [
|
|
11847
|
+
lt(!1);
|
|
11848
|
+
}, [lt, st]);
|
|
11828
11849
|
_(() => {
|
|
11829
|
-
|
|
11830
|
-
}, [
|
|
11850
|
+
Ie.current && lt(!0);
|
|
11851
|
+
}, [We, lt]), _(() => {
|
|
11831
11852
|
s.current && N.updateMaterials();
|
|
11832
11853
|
}, [
|
|
11833
11854
|
N,
|
|
@@ -11842,44 +11863,44 @@ function Wm({ autoFitCamera: e, cameraRef: t, controlRef: n, fitToView: r, loadG
|
|
|
11842
11863
|
ae.width
|
|
11843
11864
|
]), y(() => {
|
|
11844
11865
|
let e = n.current;
|
|
11845
|
-
e &&
|
|
11866
|
+
e && et(e);
|
|
11846
11867
|
}, [
|
|
11847
11868
|
A,
|
|
11848
11869
|
n,
|
|
11849
|
-
|
|
11850
|
-
|
|
11870
|
+
We,
|
|
11871
|
+
et
|
|
11851
11872
|
]);
|
|
11852
|
-
let
|
|
11873
|
+
let dt = b(() => {
|
|
11853
11874
|
let e = Object.keys(c).sort((e, t) => Number(e) - Number(t));
|
|
11854
11875
|
for (let t of e) {
|
|
11855
11876
|
let e = $u(c[Number(t)]);
|
|
11856
11877
|
if (e) return e;
|
|
11857
11878
|
}
|
|
11858
11879
|
return null;
|
|
11859
|
-
}, [c]),
|
|
11860
|
-
Ee.current =
|
|
11861
|
-
let e = new Set(
|
|
11862
|
-
|
|
11863
|
-
e.has(n) ||
|
|
11880
|
+
}, [c]), ft = b(() => Zu(dt ?? void 0), [dt]), pt = b(() => Object.entries(c).map(([e, t]) => [Number(e), t]), [c]), mt = b(() => pt.map(([e]) => e), [pt]), ht = b(() => new Map(pt.map(([e, t]) => [e, Object.keys(t.data).length])), [pt]);
|
|
11881
|
+
Ee.current = mt, De.current = ht, ke.current = l, _(() => {
|
|
11882
|
+
let e = new Set(mt);
|
|
11883
|
+
Ve.current.forEach((t, n) => {
|
|
11884
|
+
e.has(n) || Ve.current.delete(n);
|
|
11864
11885
|
});
|
|
11865
|
-
}, [
|
|
11866
|
-
let
|
|
11886
|
+
}, [mt]);
|
|
11887
|
+
let gt = o !== "performance", _t = h(() => {
|
|
11867
11888
|
n.current && (n.current.minDistance = Dm(s.current));
|
|
11868
|
-
}, [n, s]),
|
|
11889
|
+
}, [n, s]), vt = h((e, t = !1) => {
|
|
11869
11890
|
let r = n.current;
|
|
11870
11891
|
if (!r) return !1;
|
|
11871
11892
|
let i = t ? Um(e, A, r.minDistance) : e;
|
|
11872
11893
|
return r.cancel(), r.setOrbitPoint(i.x, i.y, i.z), !0;
|
|
11873
|
-
}, [A, n]),
|
|
11874
|
-
xe.current = e.clone(),
|
|
11875
|
-
}, [
|
|
11894
|
+
}, [A, n]), yt = h((e) => {
|
|
11895
|
+
xe.current = e.clone(), vt(e, !0);
|
|
11896
|
+
}, [vt]), bt = h(() => {
|
|
11876
11897
|
xe.current = null, be(s, n, a);
|
|
11877
11898
|
}, [
|
|
11878
11899
|
n,
|
|
11879
11900
|
be,
|
|
11880
11901
|
a,
|
|
11881
11902
|
s
|
|
11882
|
-
]),
|
|
11903
|
+
]), xt = h((e) => {
|
|
11883
11904
|
if (!Pm(A)) return null;
|
|
11884
11905
|
if (Nm(A) === e) return A;
|
|
11885
11906
|
let r = n.current, i = new U(), a = new U();
|
|
@@ -11891,12 +11912,12 @@ function Wm({ autoFitCamera: e, cameraRef: t, controlRef: n, fitToView: r, loadG
|
|
|
11891
11912
|
let e = c / (2 * Math.tan(Se.degToRad(d.fov) * .5));
|
|
11892
11913
|
a.copy(i).addScaledVector(o, e);
|
|
11893
11914
|
}
|
|
11894
|
-
return d.position.copy(a), d.up.copy(A.up), d.layers.mask = A.layers.mask, d.lookAt(i), d.updateMatrixWorld(!0), zm(d, ae),
|
|
11915
|
+
return d.position.copy(a), d.up.copy(A.up), d.layers.mask = A.layers.mask, d.lookAt(i), d.updateMatrixWorld(!0), zm(d, ae), Ne.current = {
|
|
11895
11916
|
cameraUuid: d.uuid,
|
|
11896
11917
|
position: a.clone(),
|
|
11897
11918
|
target: i.clone(),
|
|
11898
11919
|
zoom: d.zoom
|
|
11899
|
-
}, r?.cancel(),
|
|
11920
|
+
}, r?.cancel(), Me.current = d.uuid, t.current = d, ie({ camera: d }), j(), d;
|
|
11900
11921
|
}, [
|
|
11901
11922
|
A,
|
|
11902
11923
|
t,
|
|
@@ -11906,14 +11927,14 @@ function Wm({ autoFitCamera: e, cameraRef: t, controlRef: n, fitToView: r, loadG
|
|
|
11906
11927
|
ie,
|
|
11907
11928
|
ae.height,
|
|
11908
11929
|
ae.width
|
|
11909
|
-
]),
|
|
11930
|
+
]), St = h(() => {
|
|
11910
11931
|
let e = Nm(A) === "perspective" ? "orthographic" : "perspective";
|
|
11911
|
-
return
|
|
11912
|
-
}, [A,
|
|
11913
|
-
let i =
|
|
11932
|
+
return xt(e), e;
|
|
11933
|
+
}, [A, xt]), Ct = h((e, t, { createClippingPlane: r = !0 } = {}) => {
|
|
11934
|
+
let i = xt("orthographic") ?? (Pm(A) ? A : null);
|
|
11914
11935
|
if (!i) return null;
|
|
11915
11936
|
let a = e.clone().normalize(), o = !1;
|
|
11916
|
-
|
|
11937
|
+
Fe.current += 1, ut(!0), N.setHelpersActive(!1), r && N.createPlaneFromPointAndNormal(wl(a), a.normal.clone());
|
|
11917
11938
|
let c = Cl({
|
|
11918
11939
|
camera: i,
|
|
11919
11940
|
controls: n.current,
|
|
@@ -11923,33 +11944,33 @@ function Wm({ autoFitCamera: e, cameraRef: t, controlRef: n, fitToView: r, loadG
|
|
|
11923
11944
|
size: ae,
|
|
11924
11945
|
viewNormal: t
|
|
11925
11946
|
});
|
|
11926
|
-
return c ? (
|
|
11947
|
+
return c ? (Ne.current = {
|
|
11927
11948
|
cameraUuid: i.uuid,
|
|
11928
11949
|
position: c.position.clone(),
|
|
11929
11950
|
target: c.target.clone(),
|
|
11930
11951
|
zoom: c.zoom
|
|
11931
|
-
},
|
|
11952
|
+
}, Me.current = i.uuid, xe.current = null, {
|
|
11932
11953
|
dispose: () => {
|
|
11933
|
-
o || (o = !0,
|
|
11954
|
+
o || (o = !0, Fe.current = Math.max(0, Fe.current - 1), Fe.current || ut(!1));
|
|
11934
11955
|
},
|
|
11935
11956
|
plane: a.clone()
|
|
11936
|
-
}) : (
|
|
11957
|
+
}) : (Fe.current = Math.max(0, Fe.current - 1), Fe.current || ut(!1), null);
|
|
11937
11958
|
}, [
|
|
11938
11959
|
A,
|
|
11939
11960
|
N,
|
|
11940
11961
|
n,
|
|
11941
11962
|
j,
|
|
11942
11963
|
s,
|
|
11943
|
-
|
|
11944
|
-
|
|
11964
|
+
xt,
|
|
11965
|
+
ut,
|
|
11945
11966
|
ae
|
|
11946
11967
|
]);
|
|
11947
11968
|
_(() => {
|
|
11948
|
-
if (!u ||
|
|
11969
|
+
if (!u || ze.current || !s.current || !Pm(A)) return;
|
|
11949
11970
|
let e = u.clone().normalize();
|
|
11950
|
-
|
|
11951
|
-
let t =
|
|
11952
|
-
t && (
|
|
11971
|
+
ze.current = !0;
|
|
11972
|
+
let t = xt("orthographic") ?? (Pm(A) ? A : null);
|
|
11973
|
+
t && (ut(!0), N.setHelpersActive(!1), N.createPlaneFromPointAndNormal(wl(e), e.normal.clone()), requestAnimationFrame(() => {
|
|
11953
11974
|
Cl({
|
|
11954
11975
|
camera: t,
|
|
11955
11976
|
controls: n.current,
|
|
@@ -11966,20 +11987,20 @@ function Wm({ autoFitCamera: e, cameraRef: t, controlRef: n, fitToView: r, loadG
|
|
|
11966
11987
|
u,
|
|
11967
11988
|
j,
|
|
11968
11989
|
s,
|
|
11969
|
-
|
|
11970
|
-
|
|
11990
|
+
xt,
|
|
11991
|
+
ut,
|
|
11971
11992
|
ae
|
|
11972
11993
|
]);
|
|
11973
|
-
let
|
|
11974
|
-
if (
|
|
11994
|
+
let wt = h(() => {
|
|
11995
|
+
if (ke.current) return !0;
|
|
11975
11996
|
let e = Ee.current;
|
|
11976
11997
|
return e.length ? !e.every((e) => {
|
|
11977
11998
|
let t = De.current.get(e) ?? 0;
|
|
11978
|
-
return t <= 0 ? !0 : (
|
|
11999
|
+
return t <= 0 ? !0 : (Ve.current.get(e) ?? 0) >= t;
|
|
11979
12000
|
}) : !1;
|
|
11980
|
-
}, []),
|
|
12001
|
+
}, []), Tt = h((t) => {
|
|
11981
12002
|
if (!t) return !1;
|
|
11982
|
-
let n =
|
|
12003
|
+
let n = wt();
|
|
11983
12004
|
if (!e || !r) return n || (B.current = vm()), !1;
|
|
11984
12005
|
let i = B.current;
|
|
11985
12006
|
if (n) {
|
|
@@ -11991,8 +12012,8 @@ function Wm({ autoFitCamera: e, cameraRef: t, controlRef: n, fitToView: r, loadG
|
|
|
11991
12012
|
}, [
|
|
11992
12013
|
e,
|
|
11993
12014
|
r,
|
|
11994
|
-
|
|
11995
|
-
]),
|
|
12015
|
+
wt
|
|
12016
|
+
]), Dt = h((e, t = !1) => {
|
|
11996
12017
|
let r = n.current;
|
|
11997
12018
|
if (!r) return;
|
|
11998
12019
|
let i = Vm(e, M.buildIndex());
|
|
@@ -12007,16 +12028,16 @@ function Wm({ autoFitCamera: e, cameraRef: t, controlRef: n, fitToView: r, loadG
|
|
|
12007
12028
|
paddingTop: e
|
|
12008
12029
|
}).then(() => {
|
|
12009
12030
|
let e = xe.current;
|
|
12010
|
-
e &&
|
|
12031
|
+
e && vt(e, !0);
|
|
12011
12032
|
});
|
|
12012
12033
|
return;
|
|
12013
12034
|
}
|
|
12014
|
-
|
|
12035
|
+
vt(a, !0);
|
|
12015
12036
|
}, [
|
|
12016
|
-
|
|
12037
|
+
vt,
|
|
12017
12038
|
n,
|
|
12018
12039
|
M
|
|
12019
|
-
]),
|
|
12040
|
+
]), Ot = b(() => {
|
|
12020
12041
|
let e = (e) => ({
|
|
12021
12042
|
...e,
|
|
12022
12043
|
activeViewRoot: s.current
|
|
@@ -12043,8 +12064,8 @@ function Wm({ autoFitCamera: e, cameraRef: t, controlRef: n, fitToView: r, loadG
|
|
|
12043
12064
|
let r = n.current;
|
|
12044
12065
|
if (!r) return;
|
|
12045
12066
|
let i = () => {
|
|
12046
|
-
|
|
12047
|
-
if (
|
|
12067
|
+
Ie.current || (e(), v("wake"), R.current = window.setTimeout(() => {
|
|
12068
|
+
if (Ie.current) {
|
|
12048
12069
|
R.current = null, v("sleep");
|
|
12049
12070
|
return;
|
|
12050
12071
|
}
|
|
@@ -12059,7 +12080,7 @@ function Wm({ autoFitCamera: e, cameraRef: t, controlRef: n, fitToView: r, loadG
|
|
|
12059
12080
|
}, [
|
|
12060
12081
|
N,
|
|
12061
12082
|
n,
|
|
12062
|
-
|
|
12083
|
+
We,
|
|
12063
12084
|
j,
|
|
12064
12085
|
v,
|
|
12065
12086
|
te
|
|
@@ -12082,14 +12103,14 @@ function Wm({ autoFitCamera: e, cameraRef: t, controlRef: n, fitToView: r, loadG
|
|
|
12082
12103
|
let a = n.current;
|
|
12083
12104
|
if (!a) return;
|
|
12084
12105
|
let o = () => {
|
|
12085
|
-
if (z.current = null,
|
|
12086
|
-
s.current?.updateMatrixWorld(!0), (!we.current || we.current.root !== s.current) && (we.current = wm(s.current,
|
|
12106
|
+
if (z.current = null, Ie.current || Te.current) return;
|
|
12107
|
+
s.current?.updateMatrixWorld(!0), (!we.current || we.current.root !== s.current) && (we.current = wm(s.current, Qe));
|
|
12087
12108
|
let e = we.current;
|
|
12088
12109
|
if (!e) return;
|
|
12089
12110
|
let t = Tm(e);
|
|
12090
12111
|
t && (Te.current = t, j());
|
|
12091
12112
|
}, c = () => {
|
|
12092
|
-
|
|
12113
|
+
Ie.current || (t(), !Te.current && z.current === null && (z.current = window.setTimeout(o, $p)));
|
|
12093
12114
|
}, l = () => {
|
|
12094
12115
|
r(), i();
|
|
12095
12116
|
};
|
|
@@ -12098,13 +12119,13 @@ function Wm({ autoFitCamera: e, cameraRef: t, controlRef: n, fitToView: r, loadG
|
|
|
12098
12119
|
};
|
|
12099
12120
|
}, [
|
|
12100
12121
|
n,
|
|
12101
|
-
|
|
12122
|
+
We,
|
|
12102
12123
|
j,
|
|
12103
12124
|
s,
|
|
12104
|
-
|
|
12125
|
+
Qe,
|
|
12105
12126
|
te
|
|
12106
12127
|
]), _(() => {
|
|
12107
|
-
l && !
|
|
12128
|
+
l && !Le.current && (B.current = vm(!0)), Le.current = l;
|
|
12108
12129
|
}, [l]), _(() => {
|
|
12109
12130
|
let e = n.current, t = ne.domElement, r = () => {
|
|
12110
12131
|
let e = B.current;
|
|
@@ -12115,19 +12136,19 @@ function Wm({ autoFitCamera: e, cameraRef: t, controlRef: n, fitToView: r, loadG
|
|
|
12115
12136
|
};
|
|
12116
12137
|
}, [
|
|
12117
12138
|
n,
|
|
12118
|
-
|
|
12139
|
+
We,
|
|
12119
12140
|
ne
|
|
12120
12141
|
]);
|
|
12121
|
-
let
|
|
12122
|
-
return sp(s, n, de,
|
|
12142
|
+
let kt = h(() => !wt(), [wt]);
|
|
12143
|
+
return sp(s, n, de, yt, N.getSelectableObjects, fe, kt, We), df(), _(() => {
|
|
12123
12144
|
let e = ne.domElement, t = (e) => {
|
|
12124
12145
|
let t = xe.current;
|
|
12125
|
-
t && e.button === 0 && (e.ctrlKey || e.metaKey || e.shiftKey ||
|
|
12146
|
+
t && e.button === 0 && (e.ctrlKey || e.metaKey || e.shiftKey || vt(t, !0));
|
|
12126
12147
|
};
|
|
12127
12148
|
return e.addEventListener("pointerdown", t, !0), () => {
|
|
12128
12149
|
e.removeEventListener("pointerdown", t, !0);
|
|
12129
12150
|
};
|
|
12130
|
-
}, [
|
|
12151
|
+
}, [vt, ne]), _(() => (de.setClippingSource(N), () => {
|
|
12131
12152
|
de.setClippingSource(null);
|
|
12132
12153
|
}), [de, N]), _(() => (t.current = A, () => {
|
|
12133
12154
|
t.current === A && (t.current = null);
|
|
@@ -12136,7 +12157,7 @@ function Wm({ autoFitCamera: e, cameraRef: t, controlRef: n, fitToView: r, loadG
|
|
|
12136
12157
|
let t = null, n = null, r = !1, a = (e) => {
|
|
12137
12158
|
t = requestAnimationFrame(e);
|
|
12138
12159
|
}, o = () => {
|
|
12139
|
-
let e =
|
|
12160
|
+
let e = wt();
|
|
12140
12161
|
if (!e) {
|
|
12141
12162
|
let e = B.current;
|
|
12142
12163
|
if (e.active && e.firstFitDone && e.userInteractedAfterFirstFit) {
|
|
@@ -12144,7 +12165,7 @@ function Wm({ autoFitCamera: e, cameraRef: t, controlRef: n, fitToView: r, loadG
|
|
|
12144
12165
|
return;
|
|
12145
12166
|
}
|
|
12146
12167
|
}
|
|
12147
|
-
|
|
12168
|
+
bt(), e || (B.current = vm());
|
|
12148
12169
|
}, c = () => {
|
|
12149
12170
|
if (e) {
|
|
12150
12171
|
if (!k) {
|
|
@@ -12170,7 +12191,7 @@ function Wm({ autoFitCamera: e, cameraRef: t, controlRef: n, fitToView: r, loadG
|
|
|
12170
12191
|
n = null;
|
|
12171
12192
|
return;
|
|
12172
12193
|
}
|
|
12173
|
-
if (!s.current ||
|
|
12194
|
+
if (!s.current || wt()) {
|
|
12174
12195
|
n = null;
|
|
12175
12196
|
return;
|
|
12176
12197
|
}
|
|
@@ -12183,13 +12204,13 @@ function Wm({ autoFitCamera: e, cameraRef: t, controlRef: n, fitToView: r, loadG
|
|
|
12183
12204
|
n = requestAnimationFrame(t);
|
|
12184
12205
|
}, u = (e) => {
|
|
12185
12206
|
if (r || !s.current) return;
|
|
12186
|
-
s.current.updateMatrixWorld(!0), (A instanceof je || A instanceof Ae) && Bm(A, s.current),
|
|
12207
|
+
s.current.updateMatrixWorld(!0), (A instanceof je || A instanceof Ae) && Bm(A, s.current), _t(), ye();
|
|
12187
12208
|
let n = ve();
|
|
12188
12209
|
if (!n.records.size && e > 0) {
|
|
12189
12210
|
t = requestAnimationFrame(() => u(e - 1));
|
|
12190
12211
|
return;
|
|
12191
12212
|
}
|
|
12192
|
-
L(), N.syncWithModel(), P.syncWithModel(), n.records.size > 0 && !
|
|
12213
|
+
L(), N.syncWithModel(), P.syncWithModel(), n.records.size > 0 && !wt() && l(), Me.current !== A.uuid && Tt(n.records.size > 0) && c();
|
|
12193
12214
|
};
|
|
12194
12215
|
return a(() => u(k ? cm : sm)), () => {
|
|
12195
12216
|
r = !0, t !== null && cancelAnimationFrame(t), n !== null && cancelAnimationFrame(n);
|
|
@@ -12202,20 +12223,20 @@ function Wm({ autoFitCamera: e, cameraRef: t, controlRef: n, fitToView: r, loadG
|
|
|
12202
12223
|
N,
|
|
12203
12224
|
n,
|
|
12204
12225
|
P,
|
|
12205
|
-
|
|
12206
|
-
|
|
12226
|
+
bt,
|
|
12227
|
+
wt,
|
|
12207
12228
|
a,
|
|
12208
12229
|
ne,
|
|
12209
12230
|
s,
|
|
12210
12231
|
c,
|
|
12211
12232
|
l,
|
|
12212
|
-
|
|
12233
|
+
He,
|
|
12213
12234
|
i,
|
|
12214
12235
|
g,
|
|
12215
12236
|
ye,
|
|
12216
12237
|
re,
|
|
12217
|
-
|
|
12218
|
-
|
|
12238
|
+
Tt,
|
|
12239
|
+
_t,
|
|
12219
12240
|
k
|
|
12220
12241
|
]), _(() => {
|
|
12221
12242
|
let e = () => {
|
|
@@ -12225,13 +12246,13 @@ function Wm({ autoFitCamera: e, cameraRef: t, controlRef: n, fitToView: r, loadG
|
|
|
12225
12246
|
};
|
|
12226
12247
|
return E({
|
|
12227
12248
|
camera: {
|
|
12228
|
-
fitCamera:
|
|
12249
|
+
fitCamera: bt,
|
|
12229
12250
|
getIntersection: de.getIntersection,
|
|
12230
12251
|
getProjection: () => Nm(A),
|
|
12231
|
-
setFirstPersonControlActive:
|
|
12232
|
-
setFirstPersonControlSettings:
|
|
12233
|
-
setProjection:
|
|
12234
|
-
toggleProjection:
|
|
12252
|
+
setFirstPersonControlActive: it,
|
|
12253
|
+
setFirstPersonControlSettings: at,
|
|
12254
|
+
setProjection: xt,
|
|
12255
|
+
toggleProjection: St
|
|
12235
12256
|
},
|
|
12236
12257
|
clipping: {
|
|
12237
12258
|
createClippingRectangle: N.createClippingRectangle,
|
|
@@ -12261,7 +12282,7 @@ function Wm({ autoFitCamera: e, cameraRef: t, controlRef: n, fitToView: r, loadG
|
|
|
12261
12282
|
rebuildModelByColors: ce.rebuildModelByColors,
|
|
12262
12283
|
setColor: ce.setColor
|
|
12263
12284
|
},
|
|
12264
|
-
converter:
|
|
12285
|
+
converter: Ot,
|
|
12265
12286
|
dimensions: {
|
|
12266
12287
|
cancelDrawing: P.cancelDrawing,
|
|
12267
12288
|
changeAxes: P.changeAxes,
|
|
@@ -12308,43 +12329,43 @@ function Wm({ autoFitCamera: e, cameraRef: t, controlRef: n, fitToView: r, loadG
|
|
|
12308
12329
|
toggleIIfcSpacesVisibility: () => t(oe.toggleIIfcSpacesVisibility),
|
|
12309
12330
|
useTrueNorth: (e) => t(() => oe.useTrueNorth(e))
|
|
12310
12331
|
},
|
|
12311
|
-
plans: { createPlan:
|
|
12312
|
-
selector: { setTargetToSelection:
|
|
12313
|
-
}),
|
|
12332
|
+
plans: { createPlan: Ct },
|
|
12333
|
+
selector: { setTargetToSelection: Dt }
|
|
12334
|
+
}), Re.current || (Re.current = !0, m?.(C)), () => E(null);
|
|
12314
12335
|
}, [
|
|
12315
12336
|
A,
|
|
12316
12337
|
N,
|
|
12317
12338
|
de,
|
|
12318
12339
|
ce,
|
|
12319
12340
|
n,
|
|
12320
|
-
|
|
12321
|
-
|
|
12341
|
+
Ot,
|
|
12342
|
+
Ct,
|
|
12322
12343
|
P,
|
|
12323
|
-
|
|
12344
|
+
bt,
|
|
12324
12345
|
oe,
|
|
12325
12346
|
a,
|
|
12326
12347
|
s,
|
|
12327
12348
|
ge,
|
|
12328
12349
|
m,
|
|
12329
12350
|
C,
|
|
12330
|
-
|
|
12351
|
+
xt,
|
|
12331
12352
|
F,
|
|
12332
|
-
tt,
|
|
12333
12353
|
it,
|
|
12354
|
+
at,
|
|
12334
12355
|
E,
|
|
12335
|
-
|
|
12356
|
+
Dt,
|
|
12336
12357
|
pe,
|
|
12337
|
-
|
|
12358
|
+
St
|
|
12338
12359
|
]), /* @__PURE__ */ rt(nt, { children: [
|
|
12339
|
-
|
|
12340
|
-
ambientColor:
|
|
12341
|
-
ambientIntensity:
|
|
12342
|
-
directionalColor:
|
|
12343
|
-
directionalIntensity:
|
|
12360
|
+
gt && (k ? /* @__PURE__ */ W(Ro, {
|
|
12361
|
+
ambientColor: Ze.ambient.color,
|
|
12362
|
+
ambientIntensity: Ze.ambient.intensity,
|
|
12363
|
+
directionalColor: Ze.directional.color,
|
|
12364
|
+
directionalIntensity: Ze.directional.intensity,
|
|
12344
12365
|
lightRef: a
|
|
12345
12366
|
}) : /* @__PURE__ */ rt(nt, { children: [/* @__PURE__ */ W("ambientLight", {
|
|
12346
|
-
intensity:
|
|
12347
|
-
color:
|
|
12367
|
+
intensity: Ze.ambient.intensity,
|
|
12368
|
+
color: Ze.ambient.color
|
|
12348
12369
|
}), /* @__PURE__ */ W("directionalLight", {
|
|
12349
12370
|
ref: a,
|
|
12350
12371
|
position: [
|
|
@@ -12352,38 +12373,38 @@ function Wm({ autoFitCamera: e, cameraRef: t, controlRef: n, fitToView: r, loadG
|
|
|
12352
12373
|
10,
|
|
12353
12374
|
10
|
|
12354
12375
|
],
|
|
12355
|
-
color:
|
|
12356
|
-
intensity:
|
|
12376
|
+
color: Ze.directional.color,
|
|
12377
|
+
intensity: Ze.directional.intensity
|
|
12357
12378
|
})] })),
|
|
12358
|
-
|
|
12379
|
+
V && /* @__PURE__ */ W(ct, {}),
|
|
12359
12380
|
/* @__PURE__ */ W("group", {
|
|
12360
|
-
ref:
|
|
12361
|
-
children:
|
|
12381
|
+
ref: H,
|
|
12382
|
+
children: pt.map(([e, t]) => /* @__PURE__ */ W(nd, {
|
|
12362
12383
|
colorPaletteTexture: se,
|
|
12363
|
-
coordinationMatrix:
|
|
12384
|
+
coordinationMatrix: ft,
|
|
12364
12385
|
data: t,
|
|
12365
12386
|
loadGeneration: i,
|
|
12366
12387
|
materialMode: o,
|
|
12367
12388
|
modelID: e,
|
|
12368
|
-
onUploadComplete: (t) =>
|
|
12369
|
-
onUploadProgress: (t, n) =>
|
|
12389
|
+
onUploadComplete: (t) => $e(e, t, ht.get(e) ?? t),
|
|
12390
|
+
onUploadProgress: (t, n) => $e(e, t, n),
|
|
12370
12391
|
useWebGPU: k
|
|
12371
12392
|
}, e))
|
|
12372
12393
|
}),
|
|
12373
12394
|
ge.layer,
|
|
12374
12395
|
/* @__PURE__ */ W(Yp, {
|
|
12375
|
-
active:
|
|
12376
|
-
activeRef:
|
|
12396
|
+
active: Ke,
|
|
12397
|
+
activeRef: Xe,
|
|
12377
12398
|
controlRef: n,
|
|
12378
12399
|
modelRef: s,
|
|
12379
|
-
settings:
|
|
12400
|
+
settings: Je
|
|
12380
12401
|
}),
|
|
12381
|
-
!
|
|
12402
|
+
!Ke && /* @__PURE__ */ W(ot, {
|
|
12382
12403
|
camera: Pm(A) ? A : void 0,
|
|
12383
12404
|
dollyToCursor: !0,
|
|
12384
12405
|
infinityDolly: A instanceof je,
|
|
12385
12406
|
minDistance: Xp,
|
|
12386
|
-
ref:
|
|
12407
|
+
ref: tt,
|
|
12387
12408
|
draggingSmoothTime: .03,
|
|
12388
12409
|
smoothTime: .05
|
|
12389
12410
|
}, A.uuid)
|
|
@@ -12421,30 +12442,35 @@ function Jm(e) {
|
|
|
12421
12442
|
let t = {};
|
|
12422
12443
|
return e.materialMode !== void 0 && (t.materialMode = e.materialMode), e.uploadMode !== void 0 && (t.uploadMode = e.uploadMode), e.useDoubleSideMaterial !== void 0 && (t.useDoubleSideMaterial = e.useDoubleSideMaterial), Object.keys(t).length ? t : void 0;
|
|
12423
12444
|
}
|
|
12424
|
-
function Ym(e, t) {
|
|
12425
|
-
let
|
|
12426
|
-
return Object.entries(t).forEach(([t,
|
|
12427
|
-
let
|
|
12428
|
-
n[
|
|
12429
|
-
...
|
|
12445
|
+
function Ym(e, t, n) {
|
|
12446
|
+
let r = { ...e ?? {} };
|
|
12447
|
+
return Object.entries(t).forEach(([t, i]) => {
|
|
12448
|
+
let a = Number(t);
|
|
12449
|
+
n?.has(a) || (r[a] = {
|
|
12450
|
+
...i,
|
|
12430
12451
|
data: {
|
|
12431
|
-
...
|
|
12432
|
-
...e?.[
|
|
12452
|
+
...i.data,
|
|
12453
|
+
...e?.[a]?.data ?? {}
|
|
12433
12454
|
}
|
|
12434
|
-
};
|
|
12435
|
-
}),
|
|
12455
|
+
});
|
|
12456
|
+
}), r;
|
|
12436
12457
|
}
|
|
12437
12458
|
function Xm(e, t) {
|
|
12459
|
+
if (!e || !Object.prototype.hasOwnProperty.call(e, t)) return e;
|
|
12460
|
+
let n = { ...e };
|
|
12461
|
+
return delete n[t], Object.keys(n).length ? n : void 0;
|
|
12462
|
+
}
|
|
12463
|
+
function Zm(e, t) {
|
|
12438
12464
|
return Array.isArray(e) ? [Math.min(e[0], t), Math.min(e[1], t)] : typeof e == "number" ? Math.min(e, t) : t;
|
|
12439
12465
|
}
|
|
12440
|
-
function
|
|
12466
|
+
function Qm(e) {
|
|
12441
12467
|
return Array.isArray(e) ? [Math.max(e[0], 2), Math.max(e[1], 2)] : typeof e == "number" ? Math.max(e, 2) : 2;
|
|
12442
12468
|
}
|
|
12443
|
-
function
|
|
12469
|
+
function $m() {
|
|
12444
12470
|
let e = navigator, t = navigator.userAgent.toLowerCase(), n = navigator.platform === "MacIntel" && navigator.maxTouchPoints > 1, r = window.matchMedia?.("(pointer: coarse)").matches ?? !1;
|
|
12445
12471
|
return e.userAgentData?.mobile || n || /android|iphone|ipad|ipod|mobile|tablet/.test(t) || navigator.maxTouchPoints > 1 && r ? "mobile" : "pc";
|
|
12446
12472
|
}
|
|
12447
|
-
function
|
|
12473
|
+
function eh({ autoFitCamera: e = !0, camera: t = {
|
|
12448
12474
|
position: [
|
|
12449
12475
|
10,
|
|
12450
12476
|
10,
|
|
@@ -12455,59 +12481,59 @@ function $m({ autoFitCamera: e = !0, camera: t = {
|
|
|
12455
12481
|
let E = x(null), D = x(null), O = x(null), te = x(null), [k, A] = S(), [ne, j] = S(!1), [re, ie] = S(!0), [ae, M] = S(null), oe = x(void 0), se = x(!1), ce = x(null), le = x(null), ue = x({
|
|
12456
12482
|
lastProgress: 0,
|
|
12457
12483
|
requestID: 0
|
|
12458
|
-
}), de = x(
|
|
12459
|
-
|
|
12484
|
+
}), de = x(null), N = x(/* @__PURE__ */ new Set()), fe = x(0), P = x(/* @__PURE__ */ new Map()), F = x(/* @__PURE__ */ new Set()), pe = x(/* @__PURE__ */ new Set()), I = x(!1), me = x(null), he = x(null), ge = x(/* @__PURE__ */ new Set()), _e = x(/* @__PURE__ */ new Map()), ve = x(!T), ye = x(/* @__PURE__ */ new Set()), L = Et(), be = G((e) => e.setModelNames), xe = G((e) => e.setModelProps), Se = G((e) => e.setModelStructure), R = G((e) => e.setShowNavCube), z = G((e) => e.setShowStats), Ce = G((e) => e.setUserDevice), we = G((e) => e.showNavCube), Te = ne, B = Te ? k ?? s : s ?? k, Ee = r ?? re, De = u ? Zm(n, 1) : n, Oe = Zm(De, u ? Km : Gm), ke = c ?? (u ? "performance" : void 0), [Ae, je] = S("sleep"), Me = Qm(De), Ne = b(() => T ? Po({ performanceMode: u }) : u ? Go : void 0, [u, T]), Pe = u ? Wo : Uo, Fe = h(() => {
|
|
12485
|
+
F.current.forEach((e) => {
|
|
12460
12486
|
e();
|
|
12461
12487
|
});
|
|
12462
|
-
}, []),
|
|
12463
|
-
|
|
12464
|
-
}), []),
|
|
12465
|
-
|
|
12466
|
-
}), []),
|
|
12467
|
-
|
|
12488
|
+
}, []), Ie = h((e) => (F.current.add(e), () => {
|
|
12489
|
+
F.current.delete(e);
|
|
12490
|
+
}), []), Le = h((e) => (pe.current.add(e), e.setNodeModeActive(I.current), () => {
|
|
12491
|
+
pe.current.delete(e);
|
|
12492
|
+
}), []), Re = h(() => {
|
|
12493
|
+
pe.current.forEach((e) => {
|
|
12468
12494
|
e.deleteAllNotesFromMainView();
|
|
12469
12495
|
});
|
|
12470
|
-
}, []),
|
|
12471
|
-
let i = Array.from(
|
|
12472
|
-
return e ? a?.createComment(e, t, n, r) ?? null : (
|
|
12496
|
+
}, []), ze = h((e, t, n, r) => {
|
|
12497
|
+
let i = Array.from(pe.current), a = i[i.length - 1] ?? null;
|
|
12498
|
+
return e ? a?.createComment(e, t, n, r) ?? null : (I.current = !0, i.forEach((i) => {
|
|
12473
12499
|
i.setNodeModeActive(!0), i.createComment(e, t, n, r);
|
|
12474
12500
|
}), null);
|
|
12475
|
-
}, []),
|
|
12476
|
-
let r = Array.from(
|
|
12477
|
-
return !e || !t ? (
|
|
12501
|
+
}, []), Be = h((e, t, n) => {
|
|
12502
|
+
let r = Array.from(pe.current), i = r[r.length - 1] ?? null;
|
|
12503
|
+
return !e || !t ? (I.current = !0, r.forEach((r) => {
|
|
12478
12504
|
r.setNodeModeActive(!0), r.createMarkupCloud(e, t, n);
|
|
12479
12505
|
}), null) : i?.createMarkupCloud(e, t, n) ?? null;
|
|
12480
|
-
}, []),
|
|
12481
|
-
|
|
12506
|
+
}, []), Ve = h((e) => {
|
|
12507
|
+
I.current = e, pe.current.forEach((t) => {
|
|
12482
12508
|
t.setNodeModeActive(e);
|
|
12483
12509
|
});
|
|
12484
|
-
}, []),
|
|
12510
|
+
}, []), He = h((e, t, r, i) => {
|
|
12485
12511
|
let a = O.current;
|
|
12486
12512
|
if (!a) return null;
|
|
12487
|
-
|
|
12513
|
+
P.current.get(t)?.handle.dispose();
|
|
12488
12514
|
let o = C(t), s = (i ? Tl(a, i) : e).clone().normalize(), c = {
|
|
12489
12515
|
container: t,
|
|
12490
12516
|
dispose: () => {
|
|
12491
|
-
|
|
12517
|
+
P.current.get(t)?.handle === c && P.current.delete(t), o.unmount();
|
|
12492
12518
|
},
|
|
12493
12519
|
plane: s.clone(),
|
|
12494
12520
|
viewer: null
|
|
12495
12521
|
};
|
|
12496
|
-
return
|
|
12522
|
+
return P.current.set(t, {
|
|
12497
12523
|
handle: c,
|
|
12498
12524
|
root: o
|
|
12499
12525
|
}), o.render(/* @__PURE__ */ W(Tt, {
|
|
12500
|
-
store:
|
|
12526
|
+
store: L,
|
|
12501
12527
|
children: /* @__PURE__ */ W(Yl, {
|
|
12502
12528
|
dpr: n,
|
|
12503
|
-
getExtraObjects: () =>
|
|
12529
|
+
getExtraObjects: () => he.current?.() ?? [],
|
|
12504
12530
|
onPreselectionChange: (e) => {
|
|
12505
|
-
|
|
12531
|
+
me.current?.(e), Fe();
|
|
12506
12532
|
},
|
|
12507
12533
|
performanceMode: u,
|
|
12508
12534
|
plane: s,
|
|
12509
|
-
registerInvalidate:
|
|
12510
|
-
registerNotesApi:
|
|
12535
|
+
registerInvalidate: Ie,
|
|
12536
|
+
registerNotesApi: Le,
|
|
12511
12537
|
sourceModel: a,
|
|
12512
12538
|
useLocalClippingVisuals: !!i,
|
|
12513
12539
|
useWebGPU: T,
|
|
@@ -12516,169 +12542,181 @@ function $m({ autoFitCamera: e = !0, camera: t = {
|
|
|
12516
12542
|
})), c;
|
|
12517
12543
|
}, [
|
|
12518
12544
|
n,
|
|
12519
|
-
Ne,
|
|
12520
|
-
u,
|
|
12521
|
-
Pe,
|
|
12522
12545
|
Fe,
|
|
12546
|
+
u,
|
|
12547
|
+
Ie,
|
|
12548
|
+
Le,
|
|
12523
12549
|
T,
|
|
12524
|
-
|
|
12550
|
+
L
|
|
12525
12551
|
]);
|
|
12526
|
-
_(() => (m(
|
|
12527
|
-
let
|
|
12528
|
-
|
|
12529
|
-
}, []),
|
|
12530
|
-
|
|
12552
|
+
_(() => (m(He), () => m(null)), [He, m]);
|
|
12553
|
+
let Ue = h((e) => {
|
|
12554
|
+
he.current = e;
|
|
12555
|
+
}, []), We = h((e) => {
|
|
12556
|
+
me.current = e;
|
|
12531
12557
|
}, []);
|
|
12532
12558
|
_(() => () => {
|
|
12533
|
-
|
|
12559
|
+
P.current.forEach(({ root: e }) => {
|
|
12534
12560
|
e.unmount();
|
|
12535
|
-
}),
|
|
12561
|
+
}), P.current.clear();
|
|
12536
12562
|
}, []);
|
|
12537
|
-
let
|
|
12538
|
-
|
|
12539
|
-
}, []),
|
|
12563
|
+
let Ge = h(() => {
|
|
12564
|
+
ve.current = !0, ye.current.forEach((e) => e()), ye.current.clear();
|
|
12565
|
+
}, []), Ke = h(() => ve.current ? Promise.resolve() : new Promise((e) => {
|
|
12540
12566
|
let t = window.setTimeout(() => {
|
|
12541
|
-
|
|
12567
|
+
ye.current.delete(n), e();
|
|
12542
12568
|
}, 1e3), n = () => {
|
|
12543
12569
|
window.clearTimeout(t), e();
|
|
12544
12570
|
};
|
|
12545
|
-
|
|
12546
|
-
}), []),
|
|
12547
|
-
|
|
12548
|
-
let t =
|
|
12549
|
-
t && (t.forEach((e) => e()),
|
|
12550
|
-
}, []),
|
|
12551
|
-
let n =
|
|
12552
|
-
n.add(t),
|
|
12571
|
+
ye.current.add(n);
|
|
12572
|
+
}), []), qe = h((e) => {
|
|
12573
|
+
ge.current.add(e);
|
|
12574
|
+
let t = _e.current.get(e);
|
|
12575
|
+
t && (t.forEach((e) => e()), _e.current.delete(e));
|
|
12576
|
+
}, []), Je = h((e) => ge.current.has(e) ? Promise.resolve() : new Promise((t) => {
|
|
12577
|
+
let n = _e.current.get(e) ?? /* @__PURE__ */ new Set();
|
|
12578
|
+
n.add(t), _e.current.set(e, n);
|
|
12553
12579
|
}), []);
|
|
12554
12580
|
_(() => () => {
|
|
12555
|
-
|
|
12581
|
+
_e.current.forEach((e) => {
|
|
12556
12582
|
e.forEach((e) => e());
|
|
12557
|
-
}),
|
|
12583
|
+
}), _e.current.clear(), ge.current.clear();
|
|
12558
12584
|
}, []), _(() => {
|
|
12559
|
-
oe.current =
|
|
12560
|
-
}, [
|
|
12561
|
-
se.current =
|
|
12562
|
-
}, [
|
|
12585
|
+
oe.current = B;
|
|
12586
|
+
}, [B]), _(() => {
|
|
12587
|
+
se.current = Te;
|
|
12588
|
+
}, [Te]), _(() => {
|
|
12563
12589
|
ce.current = ae;
|
|
12564
12590
|
}, [ae]), _(() => {
|
|
12565
|
-
|
|
12591
|
+
ve.current = !T, T || (ye.current.forEach((e) => e()), ye.current.clear());
|
|
12566
12592
|
}, [T]);
|
|
12567
|
-
let
|
|
12593
|
+
let Ye = h((e) => {
|
|
12568
12594
|
let t = ue.current;
|
|
12569
|
-
if (
|
|
12595
|
+
if (fe.current !== t.requestID) return;
|
|
12570
12596
|
let n = e.phase === "error" ? e.progress : Math.max(e.progress, t.lastProgress), r = n === e.progress ? e : {
|
|
12571
12597
|
...e,
|
|
12572
12598
|
progress: n
|
|
12573
12599
|
};
|
|
12574
12600
|
t.lastProgress = r.progress, ce.current = r, M(r), t.onModelProgress?.(r), t.onProgress?.(r);
|
|
12575
|
-
}, []),
|
|
12576
|
-
|
|
12601
|
+
}, []), Xe = h(() => {
|
|
12602
|
+
fe.current += 1, _e.current.forEach((e) => {
|
|
12577
12603
|
e.forEach((e) => e());
|
|
12578
|
-
}),
|
|
12604
|
+
}), _e.current.clear(), ge.current.clear(), j(!1), M(null), ce.current = null, le.current = null, ue.current = {
|
|
12579
12605
|
lastProgress: 0,
|
|
12580
|
-
requestID:
|
|
12581
|
-
}, A(void 0),
|
|
12582
|
-
}, [
|
|
12606
|
+
requestID: fe.current
|
|
12607
|
+
}, N.current.clear(), A(void 0), oe.current = void 0, de.current?.(void 0), L.getState().setSelection({}), L.getState().setModelNames({}), L.getState().setModelProps({}), L.getState().setModelStructure({});
|
|
12608
|
+
}, [L]), V = h((e, t) => {
|
|
12583
12609
|
A((n) => {
|
|
12584
12610
|
let r = e(n);
|
|
12585
12611
|
return t?.(r), r;
|
|
12586
12612
|
});
|
|
12587
|
-
}, []),
|
|
12588
|
-
|
|
12589
|
-
}, [
|
|
12590
|
-
let { clearViewer: n = !1, fitToView: r = !0, onChunk: i, onModelLoadingChange: a, onModelProgress: o, onModelsDataChange: s, onProgress: c, ...l } = t, u =
|
|
12591
|
-
f ||
|
|
12613
|
+
}, []), Ze = h((e, t, n) => {
|
|
12614
|
+
V((t) => qm(t, e, n), t);
|
|
12615
|
+
}, [V]), Qe = h(async (e, t = {}) => {
|
|
12616
|
+
let { clearViewer: n = !1, fitToView: r = !0, onChunk: i, onModelLoadingChange: a, onModelProgress: o, onModelsDataChange: s, onProgress: c, ...l } = t, u = fe.current + 1, d = Jm(l), f = !1, p = !1, m = () => {
|
|
12617
|
+
f || fe.current !== u || (f = !0, j(!1));
|
|
12592
12618
|
}, h = () => {
|
|
12593
|
-
p ||
|
|
12619
|
+
p || fe.current !== u || (p = !0, a?.(!1));
|
|
12594
12620
|
};
|
|
12595
|
-
|
|
12621
|
+
fe.current = u, _e.current.forEach((e) => {
|
|
12596
12622
|
e.forEach((e) => e());
|
|
12597
|
-
}),
|
|
12623
|
+
}), _e.current.clear(), ge.current.clear(), M(null), ce.current = null, le.current = null, ue.current = {
|
|
12598
12624
|
lastProgress: 0,
|
|
12599
12625
|
onModelProgress: o,
|
|
12600
12626
|
onProgress: c,
|
|
12601
12627
|
requestID: u
|
|
12602
|
-
}, ie(r), j(!0), o?.(null), a?.(!0),
|
|
12628
|
+
}, s && (de.current = s), ie(r), j(!0), o?.(null), a?.(!0), L.getState().setSelection({}), n && (N.current.clear(), A({}), s?.({}));
|
|
12603
12629
|
let g = (e) => {
|
|
12604
|
-
le.current = e,
|
|
12630
|
+
le.current = e, Ye(e);
|
|
12605
12631
|
};
|
|
12606
12632
|
try {
|
|
12607
12633
|
let t = !!l.useWorker;
|
|
12608
|
-
T && (!n && !oe.current && (A({}), s?.({})), await
|
|
12634
|
+
T && (!n && !oe.current && (A({}), s?.({})), await Ke());
|
|
12609
12635
|
let r = await xi.loadModel(e, {
|
|
12610
12636
|
...l,
|
|
12611
12637
|
...t ? {
|
|
12612
12638
|
collectWorkerChunks: l.collectWorkerChunks ?? !1,
|
|
12613
12639
|
onChunk: (e) => {
|
|
12614
|
-
|
|
12640
|
+
fe.current === u && !N.current.has(e.modelID) && Ze(e, s, d), i?.(e);
|
|
12615
12641
|
},
|
|
12616
12642
|
onProgress: g
|
|
12617
12643
|
} : { onProgress: g }
|
|
12618
12644
|
});
|
|
12619
|
-
|
|
12645
|
+
if (fe.current !== u) return r;
|
|
12646
|
+
let a = Object.fromEntries(Object.entries(r).filter(([e]) => !N.current.has(Number(e))));
|
|
12647
|
+
return V((e) => t ? Ym(e, a, N.current) : {
|
|
12620
12648
|
...e ?? {},
|
|
12621
|
-
...
|
|
12622
|
-
}, s), m(), Object.keys(
|
|
12649
|
+
...a
|
|
12650
|
+
}, s), m(), Object.keys(a).length > 0 && await Je(u), h(), r;
|
|
12623
12651
|
} finally {
|
|
12624
12652
|
m(), h();
|
|
12625
12653
|
}
|
|
12626
12654
|
}, [
|
|
12627
|
-
|
|
12628
|
-
qe,
|
|
12655
|
+
Ze,
|
|
12629
12656
|
Ye,
|
|
12657
|
+
V,
|
|
12630
12658
|
T,
|
|
12631
|
-
|
|
12632
|
-
|
|
12633
|
-
|
|
12634
|
-
]),
|
|
12659
|
+
L,
|
|
12660
|
+
Je,
|
|
12661
|
+
Ke
|
|
12662
|
+
]), $e = h((e) => {
|
|
12663
|
+
if (!Number.isFinite(e)) return;
|
|
12664
|
+
N.current.add(e);
|
|
12665
|
+
let t = oe.current, n = Xm(t, e);
|
|
12666
|
+
n !== t && (oe.current = n, A(n), de.current?.(n)), L.getState().removeModelState(e);
|
|
12667
|
+
}, [L]), H = b(() => ({
|
|
12635
12668
|
getData: () => oe.current,
|
|
12636
12669
|
getLoading: () => se.current,
|
|
12637
12670
|
getProgress: () => ce.current,
|
|
12638
|
-
loadModels:
|
|
12639
|
-
reset:
|
|
12640
|
-
|
|
12641
|
-
|
|
12642
|
-
|
|
12643
|
-
|
|
12644
|
-
|
|
12645
|
-
|
|
12646
|
-
|
|
12647
|
-
|
|
12671
|
+
loadModels: Qe,
|
|
12672
|
+
reset: Xe,
|
|
12673
|
+
unloadModel: $e
|
|
12674
|
+
}), [
|
|
12675
|
+
Qe,
|
|
12676
|
+
Xe,
|
|
12677
|
+
$e
|
|
12678
|
+
]);
|
|
12679
|
+
return _(() => (p(H), () => p(null)), [H, p]), _(() => {
|
|
12680
|
+
Ce($m());
|
|
12681
|
+
}, [Ce]), _(() => {
|
|
12682
|
+
z(!!y);
|
|
12683
|
+
}, [z, y]), _(() => {
|
|
12684
|
+
v !== void 0 && R(v);
|
|
12685
|
+
}, [R, v]), _(() => {
|
|
12648
12686
|
let e = {}, t = {}, n = {};
|
|
12649
|
-
|
|
12687
|
+
B && Object.entries(B).forEach(([r, i]) => {
|
|
12650
12688
|
let a = Number(r);
|
|
12651
12689
|
i.name !== void 0 && (e[a] = i.name), i.props !== void 0 && (t[a] = i.props), i.structure !== void 0 && (n[a] = i.structure);
|
|
12652
|
-
}),
|
|
12690
|
+
}), be(e), xe(t), Se(n);
|
|
12653
12691
|
}, [
|
|
12654
|
-
|
|
12655
|
-
|
|
12656
|
-
|
|
12657
|
-
|
|
12692
|
+
B,
|
|
12693
|
+
be,
|
|
12694
|
+
xe,
|
|
12695
|
+
Se
|
|
12658
12696
|
]), _(() => {
|
|
12659
12697
|
if (s) return;
|
|
12660
12698
|
let t = o ?? a;
|
|
12661
|
-
t?.length &&
|
|
12699
|
+
t?.length && Qe(t, {
|
|
12662
12700
|
clearViewer: !0,
|
|
12663
12701
|
fitToView: e
|
|
12664
12702
|
});
|
|
12665
12703
|
}, [
|
|
12666
12704
|
e,
|
|
12667
12705
|
s,
|
|
12668
|
-
|
|
12706
|
+
Qe,
|
|
12669
12707
|
o,
|
|
12670
12708
|
a
|
|
12671
|
-
]),
|
|
12709
|
+
]), B ? /* @__PURE__ */ rt("div", {
|
|
12672
12710
|
style: Vo,
|
|
12673
12711
|
children: [/* @__PURE__ */ rt(w, {
|
|
12674
12712
|
camera: t,
|
|
12675
|
-
dpr: ee &&
|
|
12676
|
-
gl:
|
|
12713
|
+
dpr: ee && Ae === "move" ? Oe : De,
|
|
12714
|
+
gl: Ne,
|
|
12677
12715
|
children: [/* @__PURE__ */ W("color", {
|
|
12678
12716
|
attach: "background",
|
|
12679
12717
|
args: ["#eef2f7"]
|
|
12680
12718
|
}), /* @__PURE__ */ rt(Tt, {
|
|
12681
|
-
store:
|
|
12719
|
+
store: L,
|
|
12682
12720
|
children: [
|
|
12683
12721
|
/* @__PURE__ */ W(d, {
|
|
12684
12722
|
fallback: null,
|
|
@@ -12686,33 +12724,33 @@ function $m({ autoFitCamera: e = !0, camera: t = {
|
|
|
12686
12724
|
}),
|
|
12687
12725
|
/* @__PURE__ */ W(Lo, {
|
|
12688
12726
|
active: T,
|
|
12689
|
-
onReady:
|
|
12727
|
+
onReady: Ge
|
|
12690
12728
|
}),
|
|
12691
12729
|
/* @__PURE__ */ W(Io, { active: T }),
|
|
12692
12730
|
/* @__PURE__ */ W(Wm, {
|
|
12693
12731
|
autoFitCamera: e,
|
|
12694
12732
|
cameraRef: E,
|
|
12695
12733
|
controlRef: D,
|
|
12696
|
-
fitToView:
|
|
12697
|
-
loadGeneration:
|
|
12734
|
+
fitToView: Ee,
|
|
12735
|
+
loadGeneration: fe.current,
|
|
12698
12736
|
lightRef: te,
|
|
12699
|
-
materialMode:
|
|
12737
|
+
materialMode: ke,
|
|
12700
12738
|
modelRef: O,
|
|
12701
|
-
modelsData:
|
|
12702
|
-
modelsLoading:
|
|
12739
|
+
modelsData: B,
|
|
12740
|
+
modelsLoading: Te,
|
|
12703
12741
|
initialPlanPlane: i,
|
|
12704
|
-
createPlanComment:
|
|
12705
|
-
createPlanMarkupCloud:
|
|
12706
|
-
deleteAllPlanNotes:
|
|
12742
|
+
createPlanComment: ze,
|
|
12743
|
+
createPlanMarkupCloud: Be,
|
|
12744
|
+
deleteAllPlanNotes: Re,
|
|
12707
12745
|
onReady: l,
|
|
12708
|
-
onModelsReady:
|
|
12709
|
-
onCameraDprModeChange:
|
|
12746
|
+
onModelsReady: qe,
|
|
12747
|
+
onCameraDprModeChange: je,
|
|
12710
12748
|
publicApi: f,
|
|
12711
|
-
invalidatePlanViews:
|
|
12712
|
-
setPlanPreselectionHandler:
|
|
12713
|
-
setPlanVisualObjectsGetter:
|
|
12749
|
+
invalidatePlanViews: Fe,
|
|
12750
|
+
setPlanPreselectionHandler: We,
|
|
12751
|
+
setPlanVisualObjectsGetter: Ue,
|
|
12714
12752
|
setSceneApi: g,
|
|
12715
|
-
setPlanNotesModeActive:
|
|
12753
|
+
setPlanNotesModeActive: Ve,
|
|
12716
12754
|
usePerformanceMoving: ee,
|
|
12717
12755
|
useWebGPU: T
|
|
12718
12756
|
}),
|
|
@@ -12720,12 +12758,12 @@ function $m({ autoFitCamera: e = !0, camera: t = {
|
|
|
12720
12758
|
/* @__PURE__ */ W(Mo, { enabled: T })
|
|
12721
12759
|
]
|
|
12722
12760
|
})]
|
|
12723
|
-
}, T ? "viewer-webgpu" : "viewer-webgl"),
|
|
12761
|
+
}, T ? "viewer-webgpu" : "viewer-webgl"), we && /* @__PURE__ */ W("div", {
|
|
12724
12762
|
style: Bo,
|
|
12725
12763
|
children: /* @__PURE__ */ W(w, {
|
|
12726
12764
|
camera: Ho,
|
|
12727
|
-
dpr:
|
|
12728
|
-
gl:
|
|
12765
|
+
dpr: Me,
|
|
12766
|
+
gl: Pe,
|
|
12729
12767
|
orthographic: !0,
|
|
12730
12768
|
children: /* @__PURE__ */ W(ea, {
|
|
12731
12769
|
active: !0,
|
|
@@ -12737,7 +12775,7 @@ function $m({ autoFitCamera: e = !0, camera: t = {
|
|
|
12737
12775
|
})]
|
|
12738
12776
|
}) : /* @__PURE__ */ W(nt, {});
|
|
12739
12777
|
}
|
|
12740
|
-
var
|
|
12778
|
+
var th = p(function(e, t) {
|
|
12741
12779
|
let [n] = S(Ct), r = x(!1), i = x(!1), a = b(() => new Ko(), []), o = b(() => new Jo(), []), { defaultSelected: s, onSelectedChange: c, selected: l } = e, u = h((e) => {
|
|
12742
12780
|
a.set(e);
|
|
12743
12781
|
}, [a]), d = b(() => new qo(), []), f = h((e) => {
|
|
@@ -12766,7 +12804,7 @@ var eh = p(function(e, t) {
|
|
|
12766
12804
|
});
|
|
12767
12805
|
}, [c, n]), /* @__PURE__ */ W(Tt, {
|
|
12768
12806
|
store: n,
|
|
12769
|
-
children: /* @__PURE__ */ W(
|
|
12807
|
+
children: /* @__PURE__ */ W(eh, {
|
|
12770
12808
|
...e,
|
|
12771
12809
|
publicApi: m,
|
|
12772
12810
|
setModelsApi: f,
|
|
@@ -12775,6 +12813,6 @@ var eh = p(function(e, t) {
|
|
|
12775
12813
|
})
|
|
12776
12814
|
});
|
|
12777
12815
|
});
|
|
12778
|
-
|
|
12816
|
+
th.displayName = "Viewer";
|
|
12779
12817
|
//#endregion
|
|
12780
|
-
export { Ar as BMTLoader, $n as BmtConverter, tr as ConvertIfcFileToBmt, nr as ConvertToBmt, qs as DimensionLine, nc as DimensionsUtils, mr as FilteredElementsCollector, Su as ModelGrids, ea as NavigationCube,
|
|
12818
|
+
export { Ar as BMTLoader, $n as BmtConverter, tr as ConvertIfcFileToBmt, nr as ConvertToBmt, qs as DimensionLine, nc as DimensionsUtils, mr as FilteredElementsCollector, Su as ModelGrids, ea as NavigationCube, th as Viewer, Tt as ViewerStoreProvider, er as bmtConverter, ti as convertIfcFilesToBmtInWorker, ni as createBmtConverterWorker, Br as createBmtWorker, mi as createIfcWorker, Ct as createViewerStore, gn as exportExcel, pn as exportModelPropertiesToExcel, zr as loadBmtModelsInWorker, pi as loadIfcModelsInWorker, xi as loader, rc as useDimensionsUtils, G as useViewerStore, Et as useViewerStoreApi };
|