iflow-engine-base 3.11.1 → 3.11.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bim-engine-sdk.es.js +7 -7
- package/dist/bim-engine-sdk.umd.js +352 -338
- package/dist/chunks/{engine-2d-olNpwT1j.js → engine-2d-Bhjg0s-h.js} +3 -3
- package/dist/chunks/{engine-3d-BzQ_DvYN.js → engine-3d-DBxD5ujO.js} +444 -176
- package/dist/chunks/{engine-720-B2c8mBQe.js → engine-720-Bpc4qBYo.js} +1 -1
- package/dist/chunks/{engine-gaussian-BAKXl2qt.js → engine-gaussian-D58l9XLl.js} +1 -1
- package/dist/chunks/{engine-gis-BXi9CNer.js → engine-gis-D760uMHg.js} +2 -2
- package/dist/chunks/{sdk-assets-y5vuEihm.js → sdk-assets-BvUSl5e_.js} +1 -1
- package/dist/chunks/{sdk-runtime-CjCXLGbs.js → sdk-runtime-CKzRVToz.js} +2 -2
- package/dist/chunks/{sdk-vendor-VNZqYnFS.js → sdk-vendor-DgZ0Rkal.js} +1 -1
- package/dist/iflow-engine-base.css +1 -1
- package/dist/index.d.ts +68 -0
- package/dist2d/dwg-preview.es.js +1 -1
- package/dist2d/dwg-preview.umd.js +1 -1
- package/distGaussian/gaussian.es.js +1 -1
- package/distGaussian/gaussian.umd.js +1 -1
- package/package.json +1 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { n as jh, G as Jt, t as Jr, O as Pn, a as $e, V as _, u as S0, v as Ts, b as lt, Q as ri, q as bp, R as Qt, E as Jh, w as Sp, r as
|
|
2
|
-
import { W as Ht, C as sx, b as Ga, B as pd, g as Yn, L as rx, E as ox, r as ax } from "./sdk-runtime-
|
|
3
|
-
import { r as at, g as lx } from "./sdk-assets-
|
|
4
|
-
import { a as Bp, J as Ch, c as cx, b as hx, P as Sc, q as ux, k as dx, n as md, E as gd, S as fx } from "./sdk-vendor-
|
|
5
|
-
import { L as px } from "./engine-2d-
|
|
1
|
+
import { n as jh, G as Jt, t as Jr, O as Pn, a as $e, V as _, u as S0, v as Ts, b as lt, Q as ri, q as bp, R as Qt, E as Jh, w as Sp, r as gt, x as wp, y as w0, M as it, j as nt, I as vt, f as _c, z as bc, H as Ep, J as Cp, K as Oa, U as E0, X as C0, Y as A0, Z as ld, _ as cd, $ as T0, a0 as P0, C as fs, i as Qh, d as Ap, a1 as Tp, a2 as eu, D as hn, a3 as I0, a4 as Pp, B as In, a5 as R0, a6 as L0, m as Qr, a7 as D0, a8 as F0, a9 as N0, aa as Ni, ab as za, ac as Ip, ad as Mt, h as ln, ae as B0, af as br, W as Rp, T as eo, ag as O0, ah as Ua, ai as ka, L as zi, o as Mo, aj as z0, ak as Lp, k as bh, al as Va, am as U0, an as nr, ao as k0, ap as V0, aq as Dp, ar as Fp, as as Np, F as Ha, g as Sh, at as H0, au as hd, av as wh, aw as Eh, s as to, ax as G0, ay as W0, az as ud, aA as X0, aB as dd, aC as q0, aD as Y0, aE as $0, aF as K0, c as Z0, aG as j0, aH as J0, l as Q0, p as ex, aI as tx, aJ as nx, aK as ix, aL as fd } from "./three-vendor-fDCVai2b.js";
|
|
2
|
+
import { W as Ht, C as sx, b as Ga, B as pd, g as Yn, L as rx, E as ox, r as ax } from "./sdk-runtime-CKzRVToz.js";
|
|
3
|
+
import { r as at, g as lx } from "./sdk-assets-BvUSl5e_.js";
|
|
4
|
+
import { a as Bp, J as Ch, c as cx, b as hx, P as Sc, q as ux, k as dx, n as md, E as gd, S as fx } from "./sdk-vendor-DgZ0Rkal.js";
|
|
5
|
+
import { L as px } from "./engine-2d-Bhjg0s-h.js";
|
|
6
6
|
class mx {
|
|
7
7
|
engine;
|
|
8
8
|
scene;
|
|
@@ -29324,14 +29324,14 @@ function ME(r, e, t, n, i, s, o) {
|
|
|
29324
29324
|
z.morphAttributes.position !== void 0 && (Be = 1), z.morphAttributes.normal !== void 0 && (Be = 2), z.morphAttributes.color !== void 0 && (Be = 3);
|
|
29325
29325
|
let Ae, Ze, rt, J;
|
|
29326
29326
|
if (Q) {
|
|
29327
|
-
const
|
|
29328
|
-
Ae =
|
|
29327
|
+
const yt = Gn[Q];
|
|
29328
|
+
Ae = yt.vertexShader, Ze = yt.fragmentShader;
|
|
29329
29329
|
} else
|
|
29330
29330
|
Ae = C.vertexShader, Ze = C.fragmentShader, l.update(C), rt = l.getVertexShaderID(C), J = l.getFragmentShaderID(C);
|
|
29331
29331
|
const ee = r.getRenderTarget(), N = r.state.buffers.depth.getReversed(), Z = I.isInstancedMesh === !0, se = I.isBatchedMesh === !0, xe = !!C.map, Re = !!C.matcap, Te = !!X, j = !!C.aoMap, te = !!C.lightMap, ne = !!C.bumpMap, le = !!C.normalMap, me = !!C.displacementMap, Le = !!C.emissiveMap, Ce = !!C.metalnessMap, Ke = !!C.roughnessMap, Ye = C.anisotropy > 0, M = C.clearcoat > 0, A = C.dispersion > 0, V = C.iridescence > 0, $ = C.sheen > 0, Y = C.transmission > 0, K = Ye && !!C.anisotropyMap, ce = M && !!C.clearcoatMap, ae = M && !!C.clearcoatNormalMap, Ne = M && !!C.clearcoatRoughnessMap, Oe = V && !!C.iridescenceMap, he = V && !!C.iridescenceThicknessMap, be = $ && !!C.sheenColorMap, ze = $ && !!C.sheenRoughnessMap, Fe = !!C.specularMap, Se = !!C.specularColorMap, et = !!C.specularIntensityMap, O = Y && !!C.transmissionMap, pe = Y && !!C.thicknessMap, de = !!C.gradientMap, _e = !!C.alphaMap, ue = C.alphaTest > 0, ie = !!C.alphaHash, De = !!C.extensions;
|
|
29332
29332
|
let ke = yi;
|
|
29333
29333
|
C.toneMapped && (ee === null || ee.isXRRenderTarget === !0) && (ke = r.toneMapping);
|
|
29334
|
-
const
|
|
29334
|
+
const xt = {
|
|
29335
29335
|
shaderID: Q,
|
|
29336
29336
|
shaderType: C.type,
|
|
29337
29337
|
shaderName: C.name,
|
|
@@ -29463,7 +29463,7 @@ function ME(r, e, t, n, i, s, o) {
|
|
|
29463
29463
|
rendererExtensionParallelShaderCompile: n.has("KHR_parallel_shader_compile"),
|
|
29464
29464
|
customProgramCacheKey: C.customProgramCacheKey()
|
|
29465
29465
|
};
|
|
29466
|
-
return
|
|
29466
|
+
return xt.vertexUv1s = c.has(1), xt.vertexUv2s = c.has(2), xt.vertexUv3s = c.has(3), c.clear(), xt;
|
|
29467
29467
|
}
|
|
29468
29468
|
function p(C) {
|
|
29469
29469
|
const w = [];
|
|
@@ -30046,8 +30046,8 @@ function FE(r, e) {
|
|
|
30046
30046
|
setLocked: function(ue) {
|
|
30047
30047
|
O = ue;
|
|
30048
30048
|
},
|
|
30049
|
-
setClear: function(ue, ie, De, ke,
|
|
30050
|
-
|
|
30049
|
+
setClear: function(ue, ie, De, ke, xt) {
|
|
30050
|
+
xt === !0 && (ue *= ke, ie *= ke, De *= ke), pe.set(ue, ie, De, ke), _e.equals(pe) === !1 && (r.clearColor(ue, ie, De, ke), _e.copy(pe));
|
|
30051
30051
|
},
|
|
30052
30052
|
reset: function() {
|
|
30053
30053
|
O = !1, de = null, _e.set(-1, 0, 0, 0);
|
|
@@ -30119,28 +30119,28 @@ function FE(r, e) {
|
|
|
30119
30119
|
};
|
|
30120
30120
|
}
|
|
30121
30121
|
function i() {
|
|
30122
|
-
let O = !1, pe = null, de = null, _e = null, ue = null, ie = null, De = null, ke = null,
|
|
30122
|
+
let O = !1, pe = null, de = null, _e = null, ue = null, ie = null, De = null, ke = null, xt = null;
|
|
30123
30123
|
return {
|
|
30124
|
-
setTest: function(
|
|
30125
|
-
O || (
|
|
30124
|
+
setTest: function(yt) {
|
|
30125
|
+
O || (yt ? ee(r.STENCIL_TEST) : N(r.STENCIL_TEST));
|
|
30126
30126
|
},
|
|
30127
|
-
setMask: function(
|
|
30128
|
-
pe !==
|
|
30127
|
+
setMask: function(yt) {
|
|
30128
|
+
pe !== yt && !O && (r.stencilMask(yt), pe = yt);
|
|
30129
30129
|
},
|
|
30130
|
-
setFunc: function(
|
|
30131
|
-
(de !==
|
|
30130
|
+
setFunc: function(yt, Zn, wt) {
|
|
30131
|
+
(de !== yt || _e !== Zn || ue !== wt) && (r.stencilFunc(yt, Zn, wt), de = yt, _e = Zn, ue = wt);
|
|
30132
30132
|
},
|
|
30133
|
-
setOp: function(
|
|
30134
|
-
(ie !==
|
|
30133
|
+
setOp: function(yt, Zn, wt) {
|
|
30134
|
+
(ie !== yt || De !== Zn || ke !== wt) && (r.stencilOp(yt, Zn, wt), ie = yt, De = Zn, ke = wt);
|
|
30135
30135
|
},
|
|
30136
|
-
setLocked: function(
|
|
30137
|
-
O =
|
|
30136
|
+
setLocked: function(yt) {
|
|
30137
|
+
O = yt;
|
|
30138
30138
|
},
|
|
30139
|
-
setClear: function(
|
|
30140
|
-
|
|
30139
|
+
setClear: function(yt) {
|
|
30140
|
+
xt !== yt && (r.clearStencil(yt), xt = yt);
|
|
30141
30141
|
},
|
|
30142
30142
|
reset: function() {
|
|
30143
|
-
O = !1, pe = null, de = null, _e = null, ue = null, ie = null, De = null, ke = null,
|
|
30143
|
+
O = !1, pe = null, de = null, _e = null, ue = null, ie = null, De = null, ke = null, xt = null;
|
|
30144
30144
|
}
|
|
30145
30145
|
};
|
|
30146
30146
|
}
|
|
@@ -30210,14 +30210,14 @@ function FE(r, e) {
|
|
|
30210
30210
|
[tm]: r.CONSTANT_ALPHA,
|
|
30211
30211
|
[nm]: r.ONE_MINUS_CONSTANT_ALPHA
|
|
30212
30212
|
};
|
|
30213
|
-
function j(O, pe, de, _e, ue, ie, De, ke,
|
|
30213
|
+
function j(O, pe, de, _e, ue, ie, De, ke, xt, yt) {
|
|
30214
30214
|
if (O === si) {
|
|
30215
30215
|
g === !0 && (N(r.BLEND), g = !1);
|
|
30216
30216
|
return;
|
|
30217
30217
|
}
|
|
30218
30218
|
if (g === !1 && (ee(r.BLEND), g = !0), O !== Up) {
|
|
30219
|
-
if (O !== x ||
|
|
30220
|
-
if ((p !== Fi || b !== Fi) && (r.blendEquation(r.FUNC_ADD), p = Fi, b = Fi),
|
|
30219
|
+
if (O !== x || yt !== C) {
|
|
30220
|
+
if ((p !== Fi || b !== Fi) && (r.blendEquation(r.FUNC_ADD), p = Fi, b = Fi), yt)
|
|
30221
30221
|
switch (O) {
|
|
30222
30222
|
case ps:
|
|
30223
30223
|
r.blendFuncSeparate(r.ONE, r.ONE_MINUS_SRC_ALPHA, r.ONE, r.ONE_MINUS_SRC_ALPHA);
|
|
@@ -30253,11 +30253,11 @@ function FE(r, e) {
|
|
|
30253
30253
|
qe("WebGLState: Invalid blending: ", O);
|
|
30254
30254
|
break;
|
|
30255
30255
|
}
|
|
30256
|
-
v = null, y = null, T = null, S = null, L.set(0, 0, 0), D = 0, x = O, C =
|
|
30256
|
+
v = null, y = null, T = null, S = null, L.set(0, 0, 0), D = 0, x = O, C = yt;
|
|
30257
30257
|
}
|
|
30258
30258
|
return;
|
|
30259
30259
|
}
|
|
30260
|
-
ue = ue || pe, ie = ie || de, De = De || _e, (pe !== p || ue !== b) && (r.blendEquationSeparate(Re[pe], Re[ue]), p = pe, b = ue), (de !== v || _e !== y || ie !== T || De !== S) && (r.blendFuncSeparate(Te[de], Te[_e], Te[ie], Te[De]), v = de, y = _e, T = ie, S = De), (ke.equals(L) === !1 ||
|
|
30260
|
+
ue = ue || pe, ie = ie || de, De = De || _e, (pe !== p || ue !== b) && (r.blendEquationSeparate(Re[pe], Re[ue]), p = pe, b = ue), (de !== v || _e !== y || ie !== T || De !== S) && (r.blendFuncSeparate(Te[de], Te[_e], Te[ie], Te[De]), v = de, y = _e, T = ie, S = De), (ke.equals(L) === !1 || xt !== D) && (r.blendColor(ke.r, ke.g, ke.b, xt), L.copy(ke), D = xt), x = O, C = !1;
|
|
30261
30261
|
}
|
|
30262
30262
|
function te(O, pe) {
|
|
30263
30263
|
O.side === ei ? N(r.CULL_FACE) : ee(r.CULL_FACE);
|
|
@@ -30690,11 +30690,11 @@ function NE(r, e, t, n, i, s, o) {
|
|
|
30690
30690
|
if (A.layerUpdates.size > 0) {
|
|
30691
30691
|
const De = kh(Se.width, Se.height, A.format, A.type);
|
|
30692
30692
|
for (const ke of A.layerUpdates) {
|
|
30693
|
-
const
|
|
30693
|
+
const xt = Se.data.subarray(
|
|
30694
30694
|
ke * De / Se.data.BYTES_PER_ELEMENT,
|
|
30695
30695
|
(ke + 1) * De / Se.data.BYTES_PER_ELEMENT
|
|
30696
30696
|
);
|
|
30697
|
-
t.compressedTexSubImage3D(r.TEXTURE_2D_ARRAY, ue, 0, 0, ke, Se.width, Se.height, 1, be,
|
|
30697
|
+
t.compressedTexSubImage3D(r.TEXTURE_2D_ARRAY, ue, 0, 0, ke, Se.width, Se.height, 1, be, xt);
|
|
30698
30698
|
}
|
|
30699
30699
|
A.clearLayerUpdates();
|
|
30700
30700
|
} else
|
|
@@ -30793,8 +30793,8 @@ function NE(r, e, t, n, i, s, o) {
|
|
|
30793
30793
|
if (he) {
|
|
30794
30794
|
O ? de && t.texSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X + ie, 0, 0, 0, be[ie].width, be[ie].height, Fe, Se, be[ie].data) : t.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X + ie, 0, et, be[ie].width, be[ie].height, 0, Fe, Se, be[ie].data);
|
|
30795
30795
|
for (let De = 0; De < ue.length; De++) {
|
|
30796
|
-
const
|
|
30797
|
-
O ? de && t.texSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X + ie, De + 1, 0, 0,
|
|
30796
|
+
const xt = ue[De].image[ie].image;
|
|
30797
|
+
O ? de && t.texSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X + ie, De + 1, 0, 0, xt.width, xt.height, Fe, Se, xt.data) : t.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X + ie, De + 1, et, xt.width, xt.height, 0, Fe, Se, xt.data);
|
|
30798
30798
|
}
|
|
30799
30799
|
} else {
|
|
30800
30800
|
O ? de && t.texSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X + ie, 0, 0, 0, Fe, Se, be[ie]) : t.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X + ie, 0, et, Fe, Se, be[ie]);
|
|
@@ -33763,9 +33763,9 @@ class Og {
|
|
|
33763
33763
|
} catch (P) {
|
|
33764
33764
|
throw P("WebGLRenderer: " + P.message), P;
|
|
33765
33765
|
}
|
|
33766
|
-
let V, $, Y, K, ce, ae, Ne, Oe, he, be, ze, Fe, Se, et, O, pe, de, _e, ue, ie, De, ke,
|
|
33766
|
+
let V, $, Y, K, ce, ae, Ne, Oe, he, be, ze, Fe, Se, et, O, pe, de, _e, ue, ie, De, ke, xt, yt;
|
|
33767
33767
|
function Zn() {
|
|
33768
|
-
V = new ew(M), V.init(), ke = new Bg(M, V), $ = new XS(M, V, e, ke), Y = new FE(M, V), $.reversedDepthBuffer && d && Y.buffers.depth.setReversed(!0), K = new iw(M), ce = new _E(), ae = new NE(M, V, Y, ce, $, ke, K), Ne = new YS(S), Oe = new QS(S), he = new a_(M),
|
|
33768
|
+
V = new ew(M), V.init(), ke = new Bg(M, V), $ = new XS(M, V, e, ke), Y = new FE(M, V), $.reversedDepthBuffer && d && Y.buffers.depth.setReversed(!0), K = new iw(M), ce = new _E(), ae = new NE(M, V, Y, ce, $, ke, K), Ne = new YS(S), Oe = new QS(S), he = new a_(M), xt = new GS(M, he), be = new tw(M, he, K, xt), ze = new rw(M, be, he, K), ue = new sw(M, $, ae), pe = new qS(ce), Fe = new ME(S, Ne, Oe, V, $, xt, pe), Se = new VE(S, ce), et = new SE(), O = new PE(V), _e = new HS(S, Ne, Oe, Y, ze, f, l), de = new LE(S, ze, $), yt = new HE(M, K, $, Y), ie = new WS(M, V, K), De = new nw(M, V, K), K.programs = Fe.programs, S.capabilities = $, S.extensions = V, S.properties = ce, S.renderLists = et, S.shadowMap = de, S.state = Y, S.info = K;
|
|
33769
33769
|
}
|
|
33770
33770
|
Zn();
|
|
33771
33771
|
const wt = new UE(S, M);
|
|
@@ -33843,7 +33843,7 @@ class Og {
|
|
|
33843
33843
|
}, this.clearStencil = function() {
|
|
33844
33844
|
this.clear(!1, !1, !0);
|
|
33845
33845
|
}, this.dispose = function() {
|
|
33846
|
-
t.removeEventListener("webglcontextlost", Zu, !1), t.removeEventListener("webglcontextrestored", ju, !1), t.removeEventListener("webglcontextcreationerror", Ju, !1), _e.dispose(), et.dispose(), O.dispose(), ce.dispose(), Ne.dispose(), Oe.dispose(), ze.dispose(),
|
|
33846
|
+
t.removeEventListener("webglcontextlost", Zu, !1), t.removeEventListener("webglcontextrestored", ju, !1), t.removeEventListener("webglcontextcreationerror", Ju, !1), _e.dispose(), et.dispose(), O.dispose(), ce.dispose(), Ne.dispose(), Oe.dispose(), ze.dispose(), xt.dispose(), yt.dispose(), Fe.dispose(), wt.dispose(), wt.removeEventListener("sessionstart", td), wt.removeEventListener("sessionend", nd), qi.stop();
|
|
33847
33847
|
};
|
|
33848
33848
|
function Zu(P) {
|
|
33849
33849
|
P.preventDefault(), uo("WebGLRenderer: Context Lost."), L = !0;
|
|
@@ -33883,7 +33883,7 @@ class Og {
|
|
|
33883
33883
|
ge !== null && (st = Math.max(st, ge.start * He), ct = Math.min(ct, (ge.start + ge.count) * He)), ye !== null ? (st = Math.max(st, 0), ct = Math.min(ct, ye.count)) : Ue != null && (st = Math.max(st, 0), ct = Math.min(ct, Ue.count));
|
|
33884
33884
|
const Pt = ct - st;
|
|
33885
33885
|
if (Pt < 0 || Pt === 1 / 0) return;
|
|
33886
|
-
|
|
33886
|
+
xt.setup(H, q, Ee, W, ye);
|
|
33887
33887
|
let It, St = ie;
|
|
33888
33888
|
if (ye !== null && (It = he.get(ye), St = De, St.setIndex(It)), H.isMesh)
|
|
33889
33889
|
q.wireframe === !0 ? (Y.setLineWidth(q.wireframeLinewidth * Ye()), St.setMode(M.LINES)) : St.setMode(M.TRIANGLES);
|
|
@@ -33993,7 +33993,7 @@ class Og {
|
|
|
33993
33993
|
} finally {
|
|
33994
33994
|
me();
|
|
33995
33995
|
}
|
|
33996
|
-
w !== null && C === 0 && (ae.updateMultisampleRenderTarget(w), ae.updateRenderTargetMipmap(w)), P.isScene === !0 && P.onAfterRender(S, P, k),
|
|
33996
|
+
w !== null && C === 0 && (ae.updateMultisampleRenderTarget(w), ae.updateRenderTargetMipmap(w)), P.isScene === !0 && P.onAfterRender(S, P, k), xt.resetDefaultState(), R = -1, E = null, T.pop(), T.length > 0 ? (y = T[T.length - 1], ee === !0 && pe.setGlobalState(S.clippingPlanes, y.state.camera)) : y = null, b.pop(), b.length > 0 ? v = b[b.length - 1] : v = null;
|
|
33997
33997
|
}
|
|
33998
33998
|
};
|
|
33999
33999
|
function Do(P, k, W, q) {
|
|
@@ -34144,7 +34144,7 @@ class Og {
|
|
|
34144
34144
|
const tn = q.uniformsGroups;
|
|
34145
34145
|
for (let pn = 0, Mc = tn.length; pn < Mc; pn++) {
|
|
34146
34146
|
const Yi = tn[pn];
|
|
34147
|
-
|
|
34147
|
+
yt.update(Yi, bn), yt.bind(Yi, bn);
|
|
34148
34148
|
}
|
|
34149
34149
|
}
|
|
34150
34150
|
return bn;
|
|
@@ -34294,7 +34294,7 @@ class Og {
|
|
|
34294
34294
|
}, this.initTexture = function(P) {
|
|
34295
34295
|
P.isCubeTexture ? ae.setTextureCube(P, 0) : P.isData3DTexture ? ae.setTexture3D(P, 0) : P.isDataArrayTexture || P.isCompressedArrayTexture ? ae.setTexture2DArray(P, 0) : ae.setTexture2D(P, 0), Y.unbindTexture();
|
|
34296
34296
|
}, this.resetState = function() {
|
|
34297
|
-
D = 0, C = 0, w = null, Y.reset(),
|
|
34297
|
+
D = 0, C = 0, w = null, Y.reset(), xt.reset();
|
|
34298
34298
|
}, typeof __THREE_DEVTOOLS__ < "u" && __THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe", { detail: this }));
|
|
34299
34299
|
}
|
|
34300
34300
|
/**
|
|
@@ -35523,7 +35523,7 @@ class Qf extends bp {
|
|
|
35523
35523
|
setAvatarModel(e, t = {}) {
|
|
35524
35524
|
if (e) {
|
|
35525
35525
|
if (this.clearAvatarAnimation(), this.avatar && (this.avatarRoot.remove(this.avatar), this._ownsAvatarResources && this.disposeObjectResources(this.avatar)), this.avatar = e, this._ownsAvatarResources = t.ownsResources === !0, e.rotation.y += t.yawOffset ?? 0, t.alignToFeet !== !1) {
|
|
35526
|
-
const n = new
|
|
35526
|
+
const n = new gt().setFromObject(e), i = n.max.y - n.min.y;
|
|
35527
35527
|
if (t.fitToPlayerHeight !== !1 && Number.isFinite(i) && i > 1e-6) {
|
|
35528
35528
|
const o = (t.targetHeight ?? this.playerHeight) / i;
|
|
35529
35529
|
e.scale.multiplyScalar(o), n.setFromObject(e);
|
|
@@ -35993,7 +35993,7 @@ function Wu(r, e) {
|
|
|
35993
35993
|
}), t;
|
|
35994
35994
|
}
|
|
35995
35995
|
function Xu(r) {
|
|
35996
|
-
return Wu(r, (e) => e instanceof nt && !(e instanceof
|
|
35996
|
+
return Wu(r, (e) => e instanceof nt && !(e instanceof vt));
|
|
35997
35997
|
}
|
|
35998
35998
|
function t1(r) {
|
|
35999
35999
|
if (typeof r.__modelObjectIndexSeed == "number")
|
|
@@ -36994,7 +36994,7 @@ function c1(r, e, t, n, i) {
|
|
|
36994
36994
|
}
|
|
36995
36995
|
if (!s)
|
|
36996
36996
|
return null;
|
|
36997
|
-
const a = new
|
|
36997
|
+
const a = new vt(s.geometry, s.material, t.length);
|
|
36998
36998
|
a.url = n, e.add(a);
|
|
36999
36999
|
const l = qu(i, a);
|
|
37000
37000
|
Yu(a, l);
|
|
@@ -37359,7 +37359,7 @@ async function X1(r, e, t, n, i, s) {
|
|
|
37359
37359
|
const o = Mr(t, r);
|
|
37360
37360
|
if (o == null)
|
|
37361
37361
|
return;
|
|
37362
|
-
const a = new
|
|
37362
|
+
const a = new vt(n.geometry, i0(n.material), i.length);
|
|
37363
37363
|
vr(t, r).add(a);
|
|
37364
37364
|
const c = qu(t, a);
|
|
37365
37365
|
Yu(a, c);
|
|
@@ -37375,7 +37375,7 @@ async function X1(r, e, t, n, i, s) {
|
|
|
37375
37375
|
const x = W1(n, g);
|
|
37376
37376
|
if (x != null && (m.box = x.clone()), a.setMatrixAt(f, g), a.matrixs || (a.matrixs = []), a.matrixs.push(g.clone()), d.push(g.clone()), o.nodesMap.has(m.id)) {
|
|
37377
37377
|
const p = o.nodesMap.get(m.id);
|
|
37378
|
-
p.indexes == null && (p.indexes = []), p.indexes.push([c, f, 0, 0]), x != null && p?.info != null && (p.info.box instanceof
|
|
37378
|
+
p.indexes == null && (p.indexes = []), p.indexes.push([c, f, 0, 0]), x != null && p?.info != null && (p.info.box instanceof gt ? p.info.box.union(x) : p.info.box = x.clone());
|
|
37379
37379
|
} else
|
|
37380
37380
|
o.nodesMap.set(m.id, { instance: !0, info: m, indexes: [[c, f, 0, 0]] });
|
|
37381
37381
|
(f + 1) % _1 === 0 && (u = await wi(t, s, u));
|
|
@@ -37476,7 +37476,7 @@ async function $1(r, e, t, n) {
|
|
|
37476
37476
|
}
|
|
37477
37477
|
}
|
|
37478
37478
|
function K1(r, e, t) {
|
|
37479
|
-
if (t.boundingBox || (t.boundingBox = new
|
|
37479
|
+
if (t.boundingBox || (t.boundingBox = new gt(), t.boundingBox.min = new _(t.octreeBox.min.X, t.octreeBox.min.Z, -t.octreeBox.min.Y), t.boundingBox.max = new _(t.octreeBox.max.X, t.octreeBox.max.Z, -t.octreeBox.max.Y)), !t.maxSize)
|
|
37480
37480
|
return 1e3;
|
|
37481
37481
|
const n = t.boundingBox, i = n.min, s = n.max, o = i.clone().add(s.clone()).multiplyScalar(0.5), a = i.distanceTo(s), l = new _(), c = new _(), h = new _(), u = new _();
|
|
37482
37482
|
if (e.getWorldDirection(h), e.getWorldPosition(u), e.matrixWorld.extractBasis(l, c, new _()), e instanceof Pn) {
|
|
@@ -38106,11 +38106,11 @@ class PC {
|
|
|
38106
38106
|
const t = this.engine.scene;
|
|
38107
38107
|
if (!t)
|
|
38108
38108
|
return null;
|
|
38109
|
-
const n = new
|
|
38109
|
+
const n = new gt();
|
|
38110
38110
|
let i = !1;
|
|
38111
38111
|
return t.traverse((s) => {
|
|
38112
|
-
if (s instanceof nt || s instanceof
|
|
38113
|
-
const o = new
|
|
38112
|
+
if (s instanceof nt || s instanceof vt) {
|
|
38113
|
+
const o = new gt().setFromObject(s);
|
|
38114
38114
|
o.isEmpty() || (n.union(o), i = !0);
|
|
38115
38115
|
}
|
|
38116
38116
|
}), !i || n.isEmpty() ? null : this.validateBox(n);
|
|
@@ -38123,7 +38123,7 @@ class PC {
|
|
|
38123
38123
|
*/
|
|
38124
38124
|
normalizeBox(e, t) {
|
|
38125
38125
|
return [e.x, e.y, e.z, t.x, t.y, t.z].every(Number.isFinite) ? this.validateBox(
|
|
38126
|
-
new
|
|
38126
|
+
new gt(
|
|
38127
38127
|
new _(
|
|
38128
38128
|
Math.min(e.x, t.x),
|
|
38129
38129
|
Math.min(e.y, t.y),
|
|
@@ -38242,7 +38242,7 @@ class PC {
|
|
|
38242
38242
|
return;
|
|
38243
38243
|
const n = e.getSize(new _()).length();
|
|
38244
38244
|
(this.lastShadowCasterPolicySceneSize <= 0 || Math.abs(n - this.lastShadowCasterPolicySceneSize) > this.lastShadowCasterPolicySceneSize * 0.1) && (this.shadowCasterPolicyChecked = /* @__PURE__ */ new WeakSet(), this.lastShadowCasterPolicySceneSize = n), t.traverse((i) => {
|
|
38245
|
-
this.shadowCasterPolicyChecked.has(i) || (i instanceof nt || i instanceof
|
|
38245
|
+
this.shadowCasterPolicyChecked.has(i) || (i instanceof nt || i instanceof vt) && (this.shadowCasterPolicyChecked.add(i), this.applyShadowCasterPolicy(i));
|
|
38246
38246
|
});
|
|
38247
38247
|
}
|
|
38248
38248
|
/**
|
|
@@ -38253,7 +38253,7 @@ class PC {
|
|
|
38253
38253
|
const t = e.userData;
|
|
38254
38254
|
if (t.__lightModuleOriginalCastShadow == null && (t.__lightModuleOriginalCastShadow = e.castShadow), t.__lightModuleOriginalCastShadow !== !0 || e.receiveShadow !== !0)
|
|
38255
38255
|
return;
|
|
38256
|
-
const n = new
|
|
38256
|
+
const n = new gt().setFromObject(e);
|
|
38257
38257
|
if (n.isEmpty())
|
|
38258
38258
|
return;
|
|
38259
38259
|
const i = n.getSize(new _()), s = Math.max(i.x, i.z), o = Math.max(
|
|
@@ -38589,7 +38589,7 @@ class IC {
|
|
|
38589
38589
|
}
|
|
38590
38590
|
getNodeWorldBox(e, t) {
|
|
38591
38591
|
if (Array.isArray(t?.infos) && t.infos.length > 0) {
|
|
38592
|
-
const n = bs(this.engine, e.url), i = t.infos.map((s) => s?.box).filter((s) => s instanceof
|
|
38592
|
+
const n = bs(this.engine, e.url), i = t.infos.map((s) => s?.box).filter((s) => s instanceof gt).map((s) => s.clone().applyMatrix4(n));
|
|
38593
38593
|
return this.getMergedBox(i);
|
|
38594
38594
|
}
|
|
38595
38595
|
if (Array.isArray(t?.indexes) && t.indexes.length > 0) {
|
|
@@ -38614,7 +38614,7 @@ class IC {
|
|
|
38614
38614
|
return [];
|
|
38615
38615
|
}
|
|
38616
38616
|
createInstanceCatchMesh(e, t) {
|
|
38617
|
-
if (!(e instanceof
|
|
38617
|
+
if (!(e instanceof vt) || e.geometry == null)
|
|
38618
38618
|
return null;
|
|
38619
38619
|
if (typeof e.getMatrixAt == "function")
|
|
38620
38620
|
e.getMatrixAt(t, this.tempInstanceMatrix);
|
|
@@ -38626,7 +38626,7 @@ class IC {
|
|
|
38626
38626
|
return e.updateWorldMatrix(!0, !1), n.applyMatrix4(this.tempInstanceMatrix), n.applyMatrix4(e.matrixWorld), new nt(n, e.material);
|
|
38627
38627
|
}
|
|
38628
38628
|
getInstanceWorldBox(e, t) {
|
|
38629
|
-
if (!(e instanceof
|
|
38629
|
+
if (!(e instanceof vt))
|
|
38630
38630
|
return null;
|
|
38631
38631
|
e.geometry.boundingBox || e.geometry.computeBoundingBox();
|
|
38632
38632
|
const n = e.geometry.boundingBox;
|
|
@@ -38668,7 +38668,7 @@ class IC {
|
|
|
38668
38668
|
getMergedBox(e) {
|
|
38669
38669
|
if (e.length === 0)
|
|
38670
38670
|
return null;
|
|
38671
|
-
const t = new
|
|
38671
|
+
const t = new gt().makeEmpty();
|
|
38672
38672
|
return e.forEach((n) => t.union(n)), t.isEmpty() ? null : t;
|
|
38673
38673
|
}
|
|
38674
38674
|
getSceneModel(e) {
|
|
@@ -38710,7 +38710,7 @@ class RC {
|
|
|
38710
38710
|
// ***************************************************** 模型高亮 ***************************************************** //
|
|
38711
38711
|
// 拆分网格
|
|
38712
38712
|
split_merge_model(e) {
|
|
38713
|
-
if (e.isSplit || e instanceof
|
|
38713
|
+
if (e.isSplit || e instanceof vt)
|
|
38714
38714
|
return;
|
|
38715
38715
|
e.geometry != null && (e.__mergedGeometryBackup = e.geometry);
|
|
38716
38716
|
let t = e.material, n = Qr(e.geometrys, !0);
|
|
@@ -38720,7 +38720,7 @@ class RC {
|
|
|
38720
38720
|
}
|
|
38721
38721
|
// 合并网格
|
|
38722
38722
|
un_split_merge_model(e) {
|
|
38723
|
-
if (e == null || e instanceof
|
|
38723
|
+
if (e == null || e instanceof vt || e.isSplit !== !0 || this.shouldKeepSplitState(e))
|
|
38724
38724
|
return;
|
|
38725
38725
|
const t = e.__mergedGeometryBackup;
|
|
38726
38726
|
if (t != null) {
|
|
@@ -38758,7 +38758,7 @@ class RC {
|
|
|
38758
38758
|
restoreSplitModelsOnIdle() {
|
|
38759
38759
|
if (!this.engine?.scene)
|
|
38760
38760
|
return;
|
|
38761
|
-
Wu(this.engine, (t) => t instanceof nt && !(t instanceof
|
|
38761
|
+
Wu(this.engine, (t) => t instanceof nt && !(t instanceof vt)).forEach((t) => {
|
|
38762
38762
|
t instanceof nt && (t.isSplit === !0 && (t.visible = !this.areAllGroupsHidden(t)), t.isSplit === !0 && this.un_split_merge_model(t));
|
|
38763
38763
|
});
|
|
38764
38764
|
}
|
|
@@ -38770,7 +38770,7 @@ class RC {
|
|
|
38770
38770
|
getModelCenter(e = this.engine.engineStatus.highlightModels ?? []) {
|
|
38771
38771
|
if (!Array.isArray(e) || e.length === 0)
|
|
38772
38772
|
return null;
|
|
38773
|
-
const t = new
|
|
38773
|
+
const t = new gt();
|
|
38774
38774
|
let n = !1;
|
|
38775
38775
|
return e.forEach((i) => {
|
|
38776
38776
|
if (i?.url == null || !Array.isArray(i.ids))
|
|
@@ -38786,7 +38786,7 @@ class RC {
|
|
|
38786
38786
|
l?.info?.box,
|
|
38787
38787
|
l?.box
|
|
38788
38788
|
].forEach((h) => {
|
|
38789
|
-
!(h instanceof
|
|
38789
|
+
!(h instanceof gt) || h.isEmpty() || (n ? t.union(h.clone().applyMatrix4(o)) : (t.copy(h).applyMatrix4(o), n = !0));
|
|
38790
38790
|
});
|
|
38791
38791
|
});
|
|
38792
38792
|
}), n ? t.getCenter(new _()) : null;
|
|
@@ -38831,7 +38831,7 @@ class RC {
|
|
|
38831
38831
|
let a = n.nodesMap.get(o);
|
|
38832
38832
|
a != null && a.indexes != null && a.indexes.forEach((l) => {
|
|
38833
38833
|
const c = this.getSceneModel(l[0]);
|
|
38834
|
-
c instanceof
|
|
38834
|
+
c instanceof vt ? i.has(l[0]) ? i.get(l[0])?.push(l[1]) : i.set(l[0], [l[1]]) : (this.split_merge_model(c), c.geometry.groups[l[1]].materialIndex = 1);
|
|
38835
38835
|
});
|
|
38836
38836
|
}), LC(i, this.engine);
|
|
38837
38837
|
let s = this.engine.engineStatus.highlightModels.find((o) => o.url == t.url);
|
|
@@ -38849,7 +38849,7 @@ class RC {
|
|
|
38849
38849
|
let o = n.nodesMap.get(s);
|
|
38850
38850
|
o != null && o.indexes != null && o.indexes.forEach((a) => {
|
|
38851
38851
|
const l = this.getSceneModel(a[0]);
|
|
38852
|
-
l instanceof
|
|
38852
|
+
l instanceof vt ? i.has(a[0]) ? i.get(a[0])?.push(a[1]) : i.set(a[0], [a[1]]) : l.geometry.groups.length != 0 && (l.geometry.groups[a[1]].materialIndex = this.getCustomSimpleMaterialIndex(a[0], a[1]) ?? 0);
|
|
38853
38853
|
});
|
|
38854
38854
|
}), fp(i, this.engine, "highlightModel");
|
|
38855
38855
|
}), this.updateMaterial(), this.syncHighlightModelEdges(this.getHighlightModelsAfterRemove(e));
|
|
@@ -38873,7 +38873,7 @@ class RC {
|
|
|
38873
38873
|
let a = n.nodesMap.get(o);
|
|
38874
38874
|
this.engine.modelEdge.hideModelEdge(t.url, o), a != null && a.indexes != null && a.indexes.forEach((l) => {
|
|
38875
38875
|
const c = this.getSceneModel(l[0]);
|
|
38876
|
-
c instanceof
|
|
38876
|
+
c instanceof vt ? i.has(l[0]) ? i.get(l[0])?.push(l[1]) : i.set(l[0], [l[1]]) : (this.split_merge_model(c), c.geometry.groups[l[1]].materialIndex = -1, c.geometry.groups[l[1]].visible = !1);
|
|
38877
38877
|
});
|
|
38878
38878
|
}), i.size > 0 && FC(i, this.engine);
|
|
38879
38879
|
let s = this.engine.engineStatus.hideModels.find((o) => o.url == t.url);
|
|
@@ -38894,7 +38894,7 @@ class RC {
|
|
|
38894
38894
|
let l = i.nodesMap.get(a);
|
|
38895
38895
|
this.engine.modelEdge.showModelEdge(n.url, a), l != null && l.indexes != null && l.indexes.forEach((c) => {
|
|
38896
38896
|
const h = this.getSceneModel(c[0]);
|
|
38897
|
-
h instanceof
|
|
38897
|
+
h instanceof vt ? s.has(c[0]) ? s.get(c[0])?.push(c[1]) : s.set(c[0], [c[1]]) : (h.visible = !0, h.geometry.groups[c[1]].materialIndex = this.getCustomSimpleMaterialIndex(c[0], c[1]) ?? 0, h.geometry.groups[c[1]].visible = !0);
|
|
38898
38898
|
});
|
|
38899
38899
|
}), s.size > 0 && pp(s, this.engine), t)
|
|
38900
38900
|
return;
|
|
@@ -38931,7 +38931,7 @@ class RC {
|
|
|
38931
38931
|
/** 设置构件自定义颜色,入参与高亮接口一致:[{ url, ids }],同时兼容旧的直接 Mesh 入参。 */
|
|
38932
38932
|
setModelColor(e, t = 16777215, n = 1) {
|
|
38933
38933
|
const i = this.normalizeOpacity(n);
|
|
38934
|
-
if (e instanceof nt && !(e instanceof
|
|
38934
|
+
if (e instanceof nt && !(e instanceof vt)) {
|
|
38935
38935
|
e.material?.color != null && (e.material.color.set(t), this.clearMaterialTextures(e.material), e.material.transparent = i < 1, e.material.opacity = i, e.material.needsUpdate = !0);
|
|
38936
38936
|
return;
|
|
38937
38937
|
}
|
|
@@ -38944,7 +38944,7 @@ class RC {
|
|
|
38944
38944
|
let c = a.nodesMap.get(l);
|
|
38945
38945
|
c == null || c.indexes == null || c.indexes.forEach((h) => {
|
|
38946
38946
|
const u = this.getSceneModel(h[0]);
|
|
38947
|
-
u instanceof
|
|
38947
|
+
u instanceof vt ? this.setInstanceModelColor(o.url, l, u, h[0], h[1], s, i) : u instanceof nt && this.setSimpleModelColor(o.url, l, u, h[1], s, i);
|
|
38948
38948
|
});
|
|
38949
38949
|
});
|
|
38950
38950
|
});
|
|
@@ -38960,7 +38960,7 @@ class RC {
|
|
|
38960
38960
|
let o = i.nodesMap.get(s);
|
|
38961
38961
|
o == null || o.indexes == null || o.indexes.forEach((a) => {
|
|
38962
38962
|
const l = this.getSceneModel(a[0]);
|
|
38963
|
-
l instanceof
|
|
38963
|
+
l instanceof vt ? this.restoreInstanceModelColor(n.url, s, l, a[0], a[1]) : l instanceof nt && this.restoreSimpleModelColor(n.url, s, l, a[0], a[1]);
|
|
38964
38964
|
});
|
|
38965
38965
|
});
|
|
38966
38966
|
});
|
|
@@ -38984,7 +38984,7 @@ class RC {
|
|
|
38984
38984
|
if (t == null)
|
|
38985
38985
|
return;
|
|
38986
38986
|
const n = this.getSceneModel(t.meshIndex);
|
|
38987
|
-
t.type === "instance" && n instanceof
|
|
38987
|
+
t.type === "instance" && n instanceof vt ? this.restoreInstanceColorRecord(n, t) : t.type === "mesh" && n instanceof nt && this.restoreSimpleColorRecord(n, t), this.customModelColorRecords.delete(e);
|
|
38988
38988
|
});
|
|
38989
38989
|
}
|
|
38990
38990
|
/** 获取所有通过 setModelColor/setAllModelsColor 改过颜色的构件,返回 [{url, ids}]。 */
|
|
@@ -39144,7 +39144,7 @@ class RC {
|
|
|
39144
39144
|
side: hn
|
|
39145
39145
|
});
|
|
39146
39146
|
this.clearMaterialTextures(a), a.clippingPlanes = this.engine.sectionPlane, a.needsUpdate = !0;
|
|
39147
|
-
const l = new
|
|
39147
|
+
const l = new vt(e.geometry, a, 1);
|
|
39148
39148
|
return l.name = "customColorModel", l.key = t, l.url = e.url, l.ids = Array.isArray(e.ids) ? [e.ids[n]] : [], l.matrixs = [i.clone()], l.setMatrixAt(0, i), l.instanceMatrix.needsUpdate = !0, l;
|
|
39149
39149
|
}
|
|
39150
39150
|
removeCustomInstanceClone(e) {
|
|
@@ -39185,7 +39185,7 @@ class RC {
|
|
|
39185
39185
|
let a = n.nodesMap.get(o);
|
|
39186
39186
|
a != null && a.indexes != null && a.indexes.forEach((l) => {
|
|
39187
39187
|
const c = this.getSceneModel(l[0]);
|
|
39188
|
-
c instanceof
|
|
39188
|
+
c instanceof vt ? i.has(l[0]) ? i.get(l[0])?.push(l[1]) : i.set(l[0], [l[1]]) : (this.split_merge_model(c), c.geometry.groups[l[1]].materialIndex = 2);
|
|
39189
39189
|
});
|
|
39190
39190
|
}), DC(i, this.engine);
|
|
39191
39191
|
let s = this.engine.engineStatus.translucentModels.find((o) => o.url == t.url);
|
|
@@ -39206,7 +39206,7 @@ class RC {
|
|
|
39206
39206
|
let o = n.nodesMap.get(s);
|
|
39207
39207
|
o != null && o.indexes != null && o.indexes.forEach((a) => {
|
|
39208
39208
|
const l = this.getSceneModel(a[0]);
|
|
39209
|
-
l instanceof
|
|
39209
|
+
l instanceof vt ? i.has(a[0]) ? i.get(a[0])?.push(a[1]) : i.set(a[0], [a[1]]) : (this.split_merge_model(l), l.geometry.groups[a[1]].materialIndex = this.getCustomSimpleMaterialIndex(a[0], a[1]) ?? 0);
|
|
39210
39210
|
});
|
|
39211
39211
|
}), i.size > 0 && pp(i, this.engine), fp(i, this.engine, "translucentModel");
|
|
39212
39212
|
}), this.engine.engineStatus.translucentModels = [];
|
|
@@ -39259,7 +39259,7 @@ class RC {
|
|
|
39259
39259
|
function LC(r, e) {
|
|
39260
39260
|
r.forEach((t, n) => {
|
|
39261
39261
|
const i = Lo(e, n);
|
|
39262
|
-
if (!(i instanceof
|
|
39262
|
+
if (!(i instanceof vt))
|
|
39263
39263
|
return;
|
|
39264
39264
|
const s = i.geometry, o = new ln({
|
|
39265
39265
|
color: 43775,
|
|
@@ -39276,7 +39276,7 @@ function LC(r, e) {
|
|
|
39276
39276
|
// 双面渲染
|
|
39277
39277
|
});
|
|
39278
39278
|
o.clippingPlanes = e.sectionPlane;
|
|
39279
|
-
const a = new
|
|
39279
|
+
const a = new vt(s, o, t.length);
|
|
39280
39280
|
a.name = "highlightModel", a.key = n, a.ids = [], a.matrixs = [], a.url = i.url, t.forEach((u) => {
|
|
39281
39281
|
a.ids.push(i.ids[u]), a.matrixs.push(i.matrixs[u]);
|
|
39282
39282
|
});
|
|
@@ -39292,7 +39292,7 @@ function LC(r, e) {
|
|
|
39292
39292
|
function fp(r, e, t) {
|
|
39293
39293
|
r.forEach((n, i) => {
|
|
39294
39294
|
const s = Lo(e, i);
|
|
39295
|
-
if (!(s instanceof
|
|
39295
|
+
if (!(s instanceof vt))
|
|
39296
39296
|
return;
|
|
39297
39297
|
n.forEach((a) => {
|
|
39298
39298
|
const l = Io(e, i, a);
|
|
@@ -39314,7 +39314,7 @@ function fp(r, e, t) {
|
|
|
39314
39314
|
function DC(r, e) {
|
|
39315
39315
|
r.forEach((t, n) => {
|
|
39316
39316
|
const i = Lo(e, n);
|
|
39317
|
-
if (!(i instanceof
|
|
39317
|
+
if (!(i instanceof vt))
|
|
39318
39318
|
return;
|
|
39319
39319
|
const s = i.geometry, o = new ln({
|
|
39320
39320
|
color: 16777215,
|
|
@@ -39327,7 +39327,7 @@ function DC(r, e) {
|
|
|
39327
39327
|
// 双面渲染
|
|
39328
39328
|
});
|
|
39329
39329
|
o.clippingPlanes = e.sectionPlane;
|
|
39330
|
-
const a = new
|
|
39330
|
+
const a = new vt(s, o, t.length);
|
|
39331
39331
|
a.name = "translucentModel", a.key = n;
|
|
39332
39332
|
const l = /* @__PURE__ */ new Map(), c = new it(), h = new it();
|
|
39333
39333
|
h.makeScale(0, 0, 0), t.forEach((u, d) => {
|
|
@@ -39346,7 +39346,7 @@ function FC(r, e) {
|
|
|
39346
39346
|
r0(n);
|
|
39347
39347
|
}), r.forEach((n, i) => {
|
|
39348
39348
|
const s = Lo(e, i);
|
|
39349
|
-
if (!(s instanceof
|
|
39349
|
+
if (!(s instanceof vt))
|
|
39350
39350
|
return;
|
|
39351
39351
|
const o = /* @__PURE__ */ new Map(), a = new it(), l = new it();
|
|
39352
39352
|
l.makeScale(0, 0, 0), n.forEach((c) => {
|
|
@@ -39360,7 +39360,7 @@ function FC(r, e) {
|
|
|
39360
39360
|
function pp(r, e) {
|
|
39361
39361
|
r.forEach((t, n) => {
|
|
39362
39362
|
const i = Lo(e, n);
|
|
39363
|
-
i instanceof
|
|
39363
|
+
i instanceof vt && (t.forEach((s) => {
|
|
39364
39364
|
const o = Io(e, n, s);
|
|
39365
39365
|
if (o != null) {
|
|
39366
39366
|
i.setMatrixAt(s, new it().makeScale(0, 0, 0)), Ro(o, !0);
|
|
@@ -40325,7 +40325,7 @@ class UC {
|
|
|
40325
40325
|
flyToModels(e = this.engine.engineStatus.highlightModels ?? []) {
|
|
40326
40326
|
if (!Array.isArray(e) || e.length === 0)
|
|
40327
40327
|
return;
|
|
40328
|
-
const t = new
|
|
40328
|
+
const t = new gt();
|
|
40329
40329
|
let n = !1;
|
|
40330
40330
|
e.forEach((i) => {
|
|
40331
40331
|
if (i?.url == null || !Array.isArray(i.ids))
|
|
@@ -40341,7 +40341,7 @@ class UC {
|
|
|
40341
40341
|
l?.info?.box,
|
|
40342
40342
|
l?.box
|
|
40343
40343
|
].forEach((h) => {
|
|
40344
|
-
!(h instanceof
|
|
40344
|
+
!(h instanceof gt) || h.isEmpty() || (n ? t.union(h.clone().applyMatrix4(o)) : (t.copy(h).applyMatrix4(o), n = !0));
|
|
40345
40345
|
});
|
|
40346
40346
|
});
|
|
40347
40347
|
}), n && this.zoomToModel(t);
|
|
@@ -40445,7 +40445,7 @@ function kC(r) {
|
|
|
40445
40445
|
return;
|
|
40446
40446
|
if (!E.threeBox) {
|
|
40447
40447
|
let G = new _(E.min.X * 0.3048, E.min.Z * 0.3048, -E.min.Y * 0.3048), Q = new _(E.max.X * 0.3048, E.max.Z * 0.3048, -E.max.Y * 0.3048), oe = new _(Math.min(G.x, Q.x), Math.min(G.y, Q.y), Math.min(G.z, Q.z)), fe = new _(Math.max(Q.x, G.x), Math.max(Q.y, G.y), Math.max(Q.z, G.z));
|
|
40448
|
-
E.threeBox = new
|
|
40448
|
+
E.threeBox = new gt(oe, fe).applyMatrix4(z);
|
|
40449
40449
|
}
|
|
40450
40450
|
const U = E.threeBox, X = R.ray.intersectsBox(U);
|
|
40451
40451
|
if (!(X == null || X == !1) && c?.doesBoxIntersectClippingRange?.(U) !== !1)
|
|
@@ -40504,7 +40504,7 @@ function kC(r) {
|
|
|
40504
40504
|
if (!Array.isArray(E) || E.length < 2 || R?.info == null)
|
|
40505
40505
|
return null;
|
|
40506
40506
|
const z = yc(r, E[0]);
|
|
40507
|
-
if (!(z instanceof
|
|
40507
|
+
if (!(z instanceof vt) || z.geometry == null)
|
|
40508
40508
|
return null;
|
|
40509
40509
|
const U = E[1];
|
|
40510
40510
|
if (i && z.geometry.attributes.position.count >= 2e3)
|
|
@@ -40547,7 +40547,7 @@ function kC(r) {
|
|
|
40547
40547
|
};
|
|
40548
40548
|
}
|
|
40549
40549
|
function D(R, E) {
|
|
40550
|
-
return R.box instanceof
|
|
40550
|
+
return R.box instanceof gt ? R.box : R.geometry == null || (R.geometry.boundingBox == null && R.geometry.computeBoundingBox(), R.geometry.boundingBox == null) ? null : (R.box = R.geometry.boundingBox.clone().applyMatrix4(E), R.box);
|
|
40551
40551
|
}
|
|
40552
40552
|
function C(R, E) {
|
|
40553
40553
|
return d.get(R)?.has(E) || f.get(R)?.has(E);
|
|
@@ -40694,7 +40694,7 @@ class VC {
|
|
|
40694
40694
|
console.warn("RangeScale: 无法将屏幕区域转换为世界坐标");
|
|
40695
40695
|
return;
|
|
40696
40696
|
}
|
|
40697
|
-
const c = new
|
|
40697
|
+
const c = new gt();
|
|
40698
40698
|
for (const h of a)
|
|
40699
40699
|
c.expandByPoint(h);
|
|
40700
40700
|
if (c.isEmpty()) {
|
|
@@ -41533,7 +41533,7 @@ class ZC {
|
|
|
41533
41533
|
min: { x: -this.halfSize, y: -this.halfSize, z: -this.halfSize },
|
|
41534
41534
|
max: { x: this.halfSize, y: this.halfSize, z: this.halfSize }
|
|
41535
41535
|
};
|
|
41536
|
-
const e = new
|
|
41536
|
+
const e = new gt();
|
|
41537
41537
|
let t = !1;
|
|
41538
41538
|
return this.engine.models.forEach((n) => {
|
|
41539
41539
|
const i = n.boundingBox;
|
|
@@ -42766,7 +42766,7 @@ class cA {
|
|
|
42766
42766
|
if (!s)
|
|
42767
42767
|
continue;
|
|
42768
42768
|
typeof s.updateMatrixWorld == "function" && s.updateMatrixWorld(!0);
|
|
42769
|
-
const o = new
|
|
42769
|
+
const o = new gt().setFromObject(s);
|
|
42770
42770
|
!Number.isFinite(o.min.y) || !Number.isFinite(o.max.y) || (o.min.y < t && (t = o.min.y), o.max.y > n && (n = o.max.y));
|
|
42771
42771
|
}
|
|
42772
42772
|
return !Number.isFinite(t) || !Number.isFinite(n) ? null : { minY: t, maxY: n };
|
|
@@ -44786,7 +44786,7 @@ class _A {
|
|
|
44786
44786
|
Math.max(t.y, n.y),
|
|
44787
44787
|
Math.max(t.z, n.z)
|
|
44788
44788
|
);
|
|
44789
|
-
return new
|
|
44789
|
+
return new gt(i, s);
|
|
44790
44790
|
}
|
|
44791
44791
|
/**
|
|
44792
44792
|
* 候选 mesh 二次筛选:
|
|
@@ -44795,7 +44795,7 @@ class _A {
|
|
|
44795
44795
|
* - world bbox 必须与 plane 相交
|
|
44796
44796
|
*/
|
|
44797
44797
|
filterMeshesByBoxAndComplexity(e, t) {
|
|
44798
|
-
const n = [], i = new
|
|
44798
|
+
const n = [], i = new gt();
|
|
44799
44799
|
for (const s of t) {
|
|
44800
44800
|
const o = s.geometry, a = o?.attributes?.position;
|
|
44801
44801
|
!o || !a || a.count === 0 || (o.index ? Math.floor(o.index.count / 3) : Math.floor(a.count / 3)) > this.maxTriangleCountPerMesh || (o.boundingBox || o.computeBoundingBox(), o.boundingBox && (i.copy(o.boundingBox), s.updateWorldMatrix(!0, !1), i.applyMatrix4(s.matrixWorld), e.intersectsBox(i) && (s.geometry.attributes.position.count > 500 || n.push(s))));
|
|
@@ -44961,7 +44961,7 @@ class bA {
|
|
|
44961
44961
|
let o = new _(1e8, 1e9, 1e10), a = new _(-1e8, -1e9, -1e10);
|
|
44962
44962
|
return s.forEach((l) => {
|
|
44963
44963
|
l.min.x < o.x && (o.x = l.min.x), l.min.y < o.y && (o.y = l.min.y), l.min.z < o.z && (o.z = l.min.z), l.max.x > a.x && (a.x = l.max.x), l.max.y > a.y && (a.y = l.max.y), l.max.z > a.z && (a.z = l.max.z);
|
|
44964
|
-
}), new
|
|
44964
|
+
}), new gt(o, a);
|
|
44965
44965
|
}
|
|
44966
44966
|
}
|
|
44967
44967
|
// ****************************更新剖切值*******************************
|
|
@@ -45034,7 +45034,7 @@ class bA {
|
|
|
45034
45034
|
const c = this.intersectThreePlanes(i[o], i[a], i[l]);
|
|
45035
45035
|
c && this.isPointInsidePlanes(c, i) && this.pushUniquePoint(s, c);
|
|
45036
45036
|
}
|
|
45037
|
-
return s.length === 0 ? null : new
|
|
45037
|
+
return s.length === 0 ? null : new gt().setFromPoints(s);
|
|
45038
45038
|
}
|
|
45039
45039
|
getEffectiveClippingPlanes() {
|
|
45040
45040
|
const e = Array.isArray(this.engine.sectionPlane) ? this.engine.sectionPlane : [];
|
|
@@ -45047,7 +45047,7 @@ class bA {
|
|
|
45047
45047
|
return [];
|
|
45048
45048
|
}
|
|
45049
45049
|
toBox3(e) {
|
|
45050
|
-
return e == null || e.min == null || e.max == null ? null : new
|
|
45050
|
+
return e == null || e.min == null || e.max == null ? null : new gt(
|
|
45051
45051
|
new _(e.min.x, e.min.y, e.min.z),
|
|
45052
45052
|
new _(e.max.x, e.max.y, e.max.z)
|
|
45053
45053
|
);
|
|
@@ -45322,7 +45322,273 @@ class EA {
|
|
|
45322
45322
|
}
|
|
45323
45323
|
}
|
|
45324
45324
|
}
|
|
45325
|
-
|
|
45325
|
+
const CA = '<svg width="18" height="18" viewBox="0 0 24 24" fill="none" aria-hidden="true"><circle cx="10.8" cy="10.8" r="6.5" stroke="currentColor" stroke-width="2"/><path d="m16 16 4.3 4.3" stroke="currentColor" stroke-width="2" stroke-linecap="round"/></svg>';
|
|
45326
|
+
class AA {
|
|
45327
|
+
manager;
|
|
45328
|
+
wrapper;
|
|
45329
|
+
input;
|
|
45330
|
+
status;
|
|
45331
|
+
list;
|
|
45332
|
+
pagination;
|
|
45333
|
+
results = [];
|
|
45334
|
+
activeIndex = -1;
|
|
45335
|
+
currentPage = 1;
|
|
45336
|
+
pageSize = 20;
|
|
45337
|
+
debounceTimer = null;
|
|
45338
|
+
constructor(e, t) {
|
|
45339
|
+
this.manager = t, this.wrapper = document.createElement("div"), this.wrapper.className = "engine-3d-search", this.wrapper.innerHTML = `
|
|
45340
|
+
<section class="engine-3d-search__box" role="dialog" aria-label="模型检索">
|
|
45341
|
+
<div class="engine-3d-search__input-row">
|
|
45342
|
+
<span class="engine-3d-search__icon">${CA}</span>
|
|
45343
|
+
<input class="engine-3d-search__input" type="search" placeholder="检索模型名称、构件 ID、房间" autocomplete="off" spellcheck="false" />
|
|
45344
|
+
<button class="engine-3d-search__clear" type="button" aria-label="清空">×</button>
|
|
45345
|
+
</div>
|
|
45346
|
+
<div class="engine-3d-search__status" aria-live="polite"></div>
|
|
45347
|
+
<ul class="engine-3d-search__list" role="listbox"></ul>
|
|
45348
|
+
<div class="engine-3d-search__pagination">
|
|
45349
|
+
<button class="engine-3d-search__page-button" type="button" data-page="previous">上一页</button>
|
|
45350
|
+
<span class="engine-3d-search__page-info"></span>
|
|
45351
|
+
<button class="engine-3d-search__page-button" type="button" data-page="next">下一页</button>
|
|
45352
|
+
</div>
|
|
45353
|
+
</section>`, this.input = this.wrapper.querySelector(".engine-3d-search__input"), this.status = this.wrapper.querySelector(".engine-3d-search__status"), this.list = this.wrapper.querySelector(".engine-3d-search__list"), this.pagination = this.wrapper.querySelector(".engine-3d-search__pagination"), e.appendChild(this.wrapper), this.bindEvents();
|
|
45354
|
+
}
|
|
45355
|
+
bindEvents() {
|
|
45356
|
+
this.input.addEventListener("input", this.onInput), this.input.addEventListener("keydown", this.onKeyDown), this.wrapper.querySelector(".engine-3d-search__clear")?.addEventListener("click", this.clear), this.pagination.addEventListener("click", this.onPageClick), document.addEventListener("mousedown", this.onDocumentMouseDown), document.addEventListener("keydown", this.onDocumentKeyDown);
|
|
45357
|
+
}
|
|
45358
|
+
onInput = () => {
|
|
45359
|
+
this.debounceTimer !== null && clearTimeout(this.debounceTimer), this.debounceTimer = setTimeout(() => this.search(), 150);
|
|
45360
|
+
};
|
|
45361
|
+
onKeyDown = (e) => {
|
|
45362
|
+
const t = this.getPageResults();
|
|
45363
|
+
if (e.key === "Enter" && t[this.activeIndex])
|
|
45364
|
+
e.preventDefault(), this.select(t[this.activeIndex]);
|
|
45365
|
+
else if (e.key === "ArrowDown" || e.key === "ArrowUp") {
|
|
45366
|
+
if (e.preventDefault(), t.length === 0) return;
|
|
45367
|
+
const n = e.key === "ArrowDown" ? 1 : -1, i = this.activeIndex + n;
|
|
45368
|
+
i >= t.length && this.currentPage < this.getPageCount() ? (this.currentPage += 1, this.activeIndex = 0, this.render()) : i < 0 && this.currentPage > 1 ? (this.currentPage -= 1, this.activeIndex = this.getPageResults().length - 1, this.render()) : (this.activeIndex = Math.max(0, Math.min(t.length - 1, i)), this.updateActiveItem());
|
|
45369
|
+
}
|
|
45370
|
+
};
|
|
45371
|
+
onDocumentMouseDown = (e) => {
|
|
45372
|
+
this.wrapper.contains(e.target) || this.hide();
|
|
45373
|
+
};
|
|
45374
|
+
onDocumentKeyDown = (e) => {
|
|
45375
|
+
e.key === "Escape" && this.hide();
|
|
45376
|
+
};
|
|
45377
|
+
/** 以短防抖频率刷新已加载模型索引,避免输入过程阻塞渲染。 */
|
|
45378
|
+
search() {
|
|
45379
|
+
const e = this.input.value.trim();
|
|
45380
|
+
this.results = e ? this.manager.search(e, { limit: 1e3 }) : [], this.currentPage = 1, this.activeIndex = this.results.length > 0 ? 0 : -1, this.render();
|
|
45381
|
+
}
|
|
45382
|
+
render() {
|
|
45383
|
+
if (this.list.innerHTML = "", !this.input.value.trim()) {
|
|
45384
|
+
this.status.textContent = "输入模型名称、构件 ID 或房间名称", this.pagination.style.display = "none";
|
|
45385
|
+
return;
|
|
45386
|
+
}
|
|
45387
|
+
const t = this.getPageResults();
|
|
45388
|
+
this.status.textContent = this.results.length ? `找到 ${this.results.length} 条结果` : "没有匹配结果", t.forEach((n, i) => {
|
|
45389
|
+
const s = document.createElement("li");
|
|
45390
|
+
s.className = `engine-3d-search__item${i === this.activeIndex ? " engine-3d-search__item--active" : ""}`, s.setAttribute("role", "option"), s.innerHTML = `<span class="engine-3d-search__badge">${this.getTypeLabel(n.type)}</span><span class="engine-3d-search__name">${this.escapeHtml(n.name)}</span><span class="engine-3d-search__id">#${this.escapeHtml(String(n.id))}</span>`, s.addEventListener("mouseenter", () => {
|
|
45391
|
+
this.activeIndex = i, this.updateActiveItem();
|
|
45392
|
+
}), s.addEventListener("click", () => this.select(n)), this.list.appendChild(s);
|
|
45393
|
+
}), this.renderPagination();
|
|
45394
|
+
}
|
|
45395
|
+
getPageCount() {
|
|
45396
|
+
return Math.max(1, Math.ceil(this.results.length / this.pageSize));
|
|
45397
|
+
}
|
|
45398
|
+
getPageResults() {
|
|
45399
|
+
const e = (this.currentPage - 1) * this.pageSize;
|
|
45400
|
+
return this.results.slice(e, e + this.pageSize);
|
|
45401
|
+
}
|
|
45402
|
+
updateActiveItem() {
|
|
45403
|
+
this.list.querySelectorAll(".engine-3d-search__item").forEach((e, t) => {
|
|
45404
|
+
e.classList.toggle("engine-3d-search__item--active", t === this.activeIndex);
|
|
45405
|
+
});
|
|
45406
|
+
}
|
|
45407
|
+
renderPagination() {
|
|
45408
|
+
const e = this.getPageCount();
|
|
45409
|
+
this.pagination.style.display = this.results.length > this.pageSize ? "flex" : "none";
|
|
45410
|
+
const t = this.pagination.querySelector(".engine-3d-search__page-info"), n = this.pagination.querySelector('[data-page="previous"]'), i = this.pagination.querySelector('[data-page="next"]');
|
|
45411
|
+
t.textContent = `${this.currentPage} / ${e}`, n.disabled = this.currentPage <= 1, i.disabled = this.currentPage >= e;
|
|
45412
|
+
}
|
|
45413
|
+
onPageClick = (e) => {
|
|
45414
|
+
const t = e.target.closest("[data-page]");
|
|
45415
|
+
!t || t.disabled || (this.currentPage += t.dataset.page === "next" ? 1 : -1, this.activeIndex = 0, this.render());
|
|
45416
|
+
};
|
|
45417
|
+
select(e) {
|
|
45418
|
+
this.manager.focus(e), this.hide();
|
|
45419
|
+
}
|
|
45420
|
+
getTypeLabel(e) {
|
|
45421
|
+
return e === "room" ? "房间" : e === "model" ? "模型" : "构件";
|
|
45422
|
+
}
|
|
45423
|
+
escapeHtml(e) {
|
|
45424
|
+
return e.replace(/[&<>"']/g, (t) => ({ "&": "&", "<": "<", ">": ">", '"': """, "'": "'" })[t] ?? t);
|
|
45425
|
+
}
|
|
45426
|
+
clear = () => {
|
|
45427
|
+
this.input.value = "", this.results = [], this.activeIndex = -1, this.currentPage = 1, this.render(), this.input.focus();
|
|
45428
|
+
};
|
|
45429
|
+
/** 显示位于引擎画布中央上方的检索框,并将焦点交给输入框。 */
|
|
45430
|
+
show() {
|
|
45431
|
+
this.wrapper.classList.add("engine-3d-search--visible"), this.render(), requestAnimationFrame(() => this.input.focus());
|
|
45432
|
+
}
|
|
45433
|
+
hide() {
|
|
45434
|
+
this.wrapper.classList.remove("engine-3d-search--visible"), this.input.value = "", this.results = [], this.activeIndex = -1, this.currentPage = 1, this.render();
|
|
45435
|
+
}
|
|
45436
|
+
toggle() {
|
|
45437
|
+
this.wrapper.classList.contains("engine-3d-search--visible") ? this.hide() : this.show();
|
|
45438
|
+
}
|
|
45439
|
+
/** 切换检索面板配色,不会关闭当前输入或丢失实时结果。 */
|
|
45440
|
+
setTheme(e) {
|
|
45441
|
+
this.wrapper.classList.toggle("engine-3d-search--light", e === "light");
|
|
45442
|
+
}
|
|
45443
|
+
dispose() {
|
|
45444
|
+
this.input.removeEventListener("input", this.onInput), this.input.removeEventListener("keydown", this.onKeyDown), this.pagination.removeEventListener("click", this.onPageClick), document.removeEventListener("mousedown", this.onDocumentMouseDown), document.removeEventListener("keydown", this.onDocumentKeyDown), this.debounceTimer !== null && clearTimeout(this.debounceTimer), this.wrapper.remove();
|
|
45445
|
+
}
|
|
45446
|
+
}
|
|
45447
|
+
class TA {
|
|
45448
|
+
engine;
|
|
45449
|
+
searchUI = null;
|
|
45450
|
+
constructor(e) {
|
|
45451
|
+
this.engine = e;
|
|
45452
|
+
const t = e?.container;
|
|
45453
|
+
t && (this.searchUI = new AA(t, this), this.setTheme(e?.options?.searchTheme === "light" ? "light" : "dark"));
|
|
45454
|
+
}
|
|
45455
|
+
/** 按名称、ID、房间名称/编号检索已加载模型。 */
|
|
45456
|
+
search(e, t = {}) {
|
|
45457
|
+
const n = this.normalize(e);
|
|
45458
|
+
if (!n) return [];
|
|
45459
|
+
const i = new Set(t.types ?? ["element", "room", "model"]), s = [];
|
|
45460
|
+
return (this.engine.models ?? []).forEach((o) => {
|
|
45461
|
+
i.has("model") && this.collectModelResult(s, o, n), i.has("element") && this.collectElementResults(s, o, n, t.exactId === !0), i.has("room") && this.collectRoomResults(s, o, n);
|
|
45462
|
+
}), s.sort((o, a) => a.score - o.score || o.name.length - a.name.length).slice(0, Math.max(1, t.limit ?? 100));
|
|
45463
|
+
}
|
|
45464
|
+
/** 仅按构件名称检索。 */
|
|
45465
|
+
searchByName(e, t = 100) {
|
|
45466
|
+
return this.search(e, { types: ["element", "model"], limit: t });
|
|
45467
|
+
}
|
|
45468
|
+
/** 仅按构件 ID 检索。 */
|
|
45469
|
+
searchById(e, t = !0) {
|
|
45470
|
+
return this.search(e, { types: ["element"], exactId: t });
|
|
45471
|
+
}
|
|
45472
|
+
/** 仅按房间名称、编号或房间 ID 检索。 */
|
|
45473
|
+
searchRooms(e, t = 100) {
|
|
45474
|
+
return this.search(e, { types: ["room"], limit: t });
|
|
45475
|
+
}
|
|
45476
|
+
/** 高亮并飞行定位到单个检索结果。 */
|
|
45477
|
+
focus(e) {
|
|
45478
|
+
const t = this.toSelections(e);
|
|
45479
|
+
t.length > 0 && (this.engine.modelToolModule?.unhighlightAllModels?.(), this.engine.modelToolModule?.highlightModel?.(t)), e.box && !e.box.isEmpty() ? this.engine.viewCube?.zoomToModel?.(e.box) : t.length > 0 && this.engine.viewCube?.flyToModels?.(t);
|
|
45480
|
+
}
|
|
45481
|
+
/** 批量高亮并定位,适合“定位全部搜索结果”的业务按钮。 */
|
|
45482
|
+
focusAll(e) {
|
|
45483
|
+
const t = this.mergeSelections(e);
|
|
45484
|
+
t.length !== 0 && (this.engine.modelToolModule?.unhighlightAllModels?.(), this.engine.modelToolModule?.highlightModel?.(t), this.engine.viewCube?.flyToModels?.(t));
|
|
45485
|
+
}
|
|
45486
|
+
/** 清除由检索触发的构件高亮。 */
|
|
45487
|
+
clearHighlight() {
|
|
45488
|
+
this.engine.modelToolModule?.unhighlightAllModels?.();
|
|
45489
|
+
}
|
|
45490
|
+
/** 显示居中检索框。 */
|
|
45491
|
+
show() {
|
|
45492
|
+
this.searchUI?.show();
|
|
45493
|
+
}
|
|
45494
|
+
/** 隐藏居中检索框。 */
|
|
45495
|
+
hide() {
|
|
45496
|
+
this.searchUI?.hide();
|
|
45497
|
+
}
|
|
45498
|
+
/** 切换居中检索框显示状态。 */
|
|
45499
|
+
toggle() {
|
|
45500
|
+
this.searchUI?.toggle();
|
|
45501
|
+
}
|
|
45502
|
+
/** 设置检索框明暗主题;也可在引擎初始化参数中传入 searchTheme。 */
|
|
45503
|
+
setTheme(e) {
|
|
45504
|
+
this.searchUI?.setTheme(e);
|
|
45505
|
+
}
|
|
45506
|
+
/** 销毁检索界面及其事件监听。 */
|
|
45507
|
+
dispose() {
|
|
45508
|
+
this.searchUI?.dispose(), this.searchUI = null;
|
|
45509
|
+
}
|
|
45510
|
+
collectModelResult(e, t, n) {
|
|
45511
|
+
const i = String(t?.name ?? t?.baseInfo?.name ?? "未命名模型"), s = this.getMatchScore(i, n);
|
|
45512
|
+
s != null && e.push({ id: t.url, name: i, type: "model", url: t.url, modelName: i, box: this.toBox3(t.boundingBox), score: s });
|
|
45513
|
+
}
|
|
45514
|
+
collectElementResults(e, t, n, i) {
|
|
45515
|
+
t?.nodesMap?.forEach?.((s, o) => {
|
|
45516
|
+
const a = String(o), l = this.getMatchScore(a, n, i), c = Array.isArray(s?.infos) ? s.infos[0] : s?.info, h = String(c?.name ?? s?.name ?? a), u = this.getMatchScore(h, n);
|
|
45517
|
+
l == null && u == null || e.push({
|
|
45518
|
+
id: o,
|
|
45519
|
+
name: h,
|
|
45520
|
+
type: "element",
|
|
45521
|
+
url: t.url,
|
|
45522
|
+
modelName: t.name,
|
|
45523
|
+
elementIds: [o],
|
|
45524
|
+
score: Math.max(l ?? -1 / 0, u ?? -1 / 0)
|
|
45525
|
+
});
|
|
45526
|
+
});
|
|
45527
|
+
}
|
|
45528
|
+
collectRoomResults(e, t, n) {
|
|
45529
|
+
this.toArray(t?.rooms).forEach((i, s) => {
|
|
45530
|
+
const o = i?.id ?? i?.Id ?? i?.uniqueId ?? i?.UniqueId ?? s, a = String(i?.name ?? i?.Name ?? i?.roomName ?? i?.RoomName ?? "未命名房间"), l = i?.number ?? i?.Number ?? i?.roomNumber ?? i?.RoomNumber, c = Math.max(
|
|
45531
|
+
this.getMatchScore(a, n) ?? -1 / 0,
|
|
45532
|
+
this.getMatchScore(String(l ?? ""), n) ?? -1 / 0,
|
|
45533
|
+
this.getMatchScore(String(o), n) ?? -1 / 0
|
|
45534
|
+
);
|
|
45535
|
+
c !== -1 / 0 && e.push({
|
|
45536
|
+
id: o,
|
|
45537
|
+
name: a,
|
|
45538
|
+
type: "room",
|
|
45539
|
+
url: t.url,
|
|
45540
|
+
modelName: t.name,
|
|
45541
|
+
roomId: o,
|
|
45542
|
+
roomNumber: l == null ? void 0 : String(l),
|
|
45543
|
+
elementIds: this.getRoomElementIds(i),
|
|
45544
|
+
box: this.toBox3(i?.box ?? i?.boundingBox ?? i?.bounds),
|
|
45545
|
+
score: c
|
|
45546
|
+
});
|
|
45547
|
+
});
|
|
45548
|
+
}
|
|
45549
|
+
toSelections(e) {
|
|
45550
|
+
if (e.type === "model") {
|
|
45551
|
+
const t = (this.engine.models ?? []).find((i) => i.url === e.url), n = Array.from(t?.nodesMap?.keys?.() ?? []);
|
|
45552
|
+
return n.length > 0 ? [{ url: e.url, ids: n }] : [];
|
|
45553
|
+
}
|
|
45554
|
+
return e.elementIds?.length ? [{ url: e.url, ids: e.elementIds }] : [];
|
|
45555
|
+
}
|
|
45556
|
+
mergeSelections(e) {
|
|
45557
|
+
const t = /* @__PURE__ */ new Map();
|
|
45558
|
+
return e.forEach((n) => this.toSelections(n).forEach((i) => {
|
|
45559
|
+
t.has(i.url) || t.set(i.url, /* @__PURE__ */ new Set()), i.ids.forEach((s) => t.get(i.url)?.add(s));
|
|
45560
|
+
})), Array.from(t, ([n, i]) => ({ url: n, ids: Array.from(i) }));
|
|
45561
|
+
}
|
|
45562
|
+
getRoomElementIds(e) {
|
|
45563
|
+
const t = e?.elementIds ?? e?.ElementIds ?? e?.ids ?? e?.Ids ?? e?.elements ?? e?.Elements;
|
|
45564
|
+
if (Array.isArray(t))
|
|
45565
|
+
return t.map((n) => typeof n == "object" ? n.id ?? n.Id : n).filter((n) => n != null);
|
|
45566
|
+
}
|
|
45567
|
+
toArray(e) {
|
|
45568
|
+
return Array.isArray(e) ? e : e && typeof e == "object" ? Object.values(e) : [];
|
|
45569
|
+
}
|
|
45570
|
+
toBox3(e) {
|
|
45571
|
+
if (e instanceof gt) return e.clone();
|
|
45572
|
+
const t = e?.min ?? e?.Min, n = e?.max ?? e?.Max;
|
|
45573
|
+
if (!t || !n) return;
|
|
45574
|
+
const i = new gt(
|
|
45575
|
+
new _(t.x ?? t.X, t.y ?? t.Y, t.z ?? t.Z),
|
|
45576
|
+
new _(n.x ?? n.X, n.y ?? n.Y, n.z ?? n.Z)
|
|
45577
|
+
);
|
|
45578
|
+
return i.isEmpty() ? void 0 : i;
|
|
45579
|
+
}
|
|
45580
|
+
normalize(e) {
|
|
45581
|
+
return String(e ?? "").trim().toLocaleLowerCase().replace(/\s+/g, "");
|
|
45582
|
+
}
|
|
45583
|
+
getMatchScore(e, t, n = !1) {
|
|
45584
|
+
const i = this.normalize(e);
|
|
45585
|
+
if (!i) return null;
|
|
45586
|
+
if (n) return i === t ? 2e3 : null;
|
|
45587
|
+
const s = i.indexOf(t);
|
|
45588
|
+
return s < 0 ? null : (s === 0 ? 1e3 : 500) - s - Math.max(0, i.length - t.length) * 0.01;
|
|
45589
|
+
}
|
|
45590
|
+
}
|
|
45591
|
+
class PA {
|
|
45326
45592
|
engine;
|
|
45327
45593
|
constructor(e) {
|
|
45328
45594
|
this.engine = e;
|
|
@@ -45415,7 +45681,7 @@ class CA {
|
|
|
45415
45681
|
}), t && t(n), n;
|
|
45416
45682
|
}
|
|
45417
45683
|
}
|
|
45418
|
-
class
|
|
45684
|
+
class IA {
|
|
45419
45685
|
engine;
|
|
45420
45686
|
/** 点位列表 */
|
|
45421
45687
|
points = [];
|
|
@@ -45655,7 +45921,7 @@ class AA {
|
|
|
45655
45921
|
this.stop(), this.points = [], this.playOptions = {};
|
|
45656
45922
|
}
|
|
45657
45923
|
}
|
|
45658
|
-
class
|
|
45924
|
+
class RA {
|
|
45659
45925
|
engine;
|
|
45660
45926
|
miniMapCamera = null;
|
|
45661
45927
|
miniMapRenderer = null;
|
|
@@ -46116,7 +46382,7 @@ class TA {
|
|
|
46116
46382
|
this.miniMapContainer && (this.miniMapContainer.removeEventListener("wheel", this.onWheel), this.miniMapContainer.removeEventListener("mousedown", this.onMouseDown), this.miniMapContainer.removeEventListener("mousemove", this.onMouseMove), this.miniMapContainer.removeEventListener("mouseup", this.onMouseUp), this.miniMapContainer.removeEventListener("pointerdown", this.onMouseDown), this.miniMapContainer.removeEventListener("pointermove", this.onMouseMove), this.miniMapContainer.removeEventListener("pointerup", this.onMouseUp), this.miniMapContainer.removeEventListener("pointercancel", this.onMouseUp), this.miniMapContainer.removeEventListener("mouseenter", this.onMouseEnter), this.miniMapContainer.removeEventListener("mouseleave", this.onMouseLeave)), window.removeEventListener("mousemove", this.onMouseMove), window.removeEventListener("mouseup", this.onMouseUp), window.removeEventListener("pointermove", this.onMouseMove), window.removeEventListener("pointerup", this.onMouseUp), window.removeEventListener("pointercancel", this.onMouseUp), window.removeEventListener("resize", this.onWindowResize), this.sizeToggleButton?.removeEventListener("click", this.onSizeToggleClick), this.resizeHandle?.removeEventListener("mousedown", this.onResizeHandleMouseDown), this.resizeHandle?.removeEventListener("pointerdown", this.onResizeHandleMouseDown), this.modelSelect?.removeEventListener("change", this.onModelChange), this.levelSelect?.removeEventListener("change", this.onLevelChange), this.engine.events?.off?.(this.loadingCompletedEventName, this.onLoadingCompleted), this.miniMapRenderer && (this.miniMapRenderer.dispose(), this.miniMapRenderer = null), this.miniMapContainer && (this.miniMapContainer.remove(), this.miniMapContainer = null), this.miniMapCamera = null, this.overlayCtx = null, this.overlayCanvas = null, this.levelToolbar = null, this.sizeToggleButton = null, this.resizeHandle = null, this.modelSelect = null, this.levelSelect = null, this.levelModels = [], this.levelDataSignature = "", this.selectedModelUrl = null;
|
|
46117
46383
|
}
|
|
46118
46384
|
}
|
|
46119
|
-
class
|
|
46385
|
+
class LA {
|
|
46120
46386
|
engine;
|
|
46121
46387
|
constructor(e) {
|
|
46122
46388
|
this.engine = e;
|
|
@@ -46380,7 +46646,7 @@ class PA {
|
|
|
46380
46646
|
const n = e.ids.map((s) => t.nodesMap.get(s)).flatMap((s) => s?.infos?.map((o) => o?.box).filter(Boolean) ?? []);
|
|
46381
46647
|
if (n.length === 0)
|
|
46382
46648
|
return null;
|
|
46383
|
-
const i = new
|
|
46649
|
+
const i = new gt();
|
|
46384
46650
|
i.copy(n[0]);
|
|
46385
46651
|
for (let s = 1; s < n.length; s++)
|
|
46386
46652
|
i.union(n[s]);
|
|
@@ -46413,14 +46679,14 @@ class PA {
|
|
|
46413
46679
|
return Math.abs(s.dot(e)) < 0.999 ? s : new _(1, 0, 0);
|
|
46414
46680
|
}
|
|
46415
46681
|
}
|
|
46416
|
-
class
|
|
46682
|
+
class DA {
|
|
46417
46683
|
engine;
|
|
46418
46684
|
constructor(e) {
|
|
46419
46685
|
}
|
|
46420
46686
|
update() {
|
|
46421
46687
|
}
|
|
46422
46688
|
}
|
|
46423
|
-
class
|
|
46689
|
+
class FA {
|
|
46424
46690
|
engine;
|
|
46425
46691
|
constructor(e) {
|
|
46426
46692
|
this.engine = e, this.active();
|
|
@@ -46449,7 +46715,7 @@ class RA {
|
|
|
46449
46715
|
}), (Number(e.detail.id) == -1 || t) && this.engine.modelToolModule.unhighlightAllModels();
|
|
46450
46716
|
};
|
|
46451
46717
|
}
|
|
46452
|
-
class
|
|
46718
|
+
class NA {
|
|
46453
46719
|
engine;
|
|
46454
46720
|
constructor(e) {
|
|
46455
46721
|
this.engine = e, this.active();
|
|
@@ -46503,7 +46769,7 @@ const Js = {
|
|
|
46503
46769
|
EncodingComplete: "encoding-complete",
|
|
46504
46770
|
EncodingError: "encoding-error"
|
|
46505
46771
|
};
|
|
46506
|
-
class
|
|
46772
|
+
class BA {
|
|
46507
46773
|
engine;
|
|
46508
46774
|
apiKey;
|
|
46509
46775
|
baseURL = "https://api.deepseek.com";
|
|
@@ -46691,7 +46957,7 @@ class DA {
|
|
|
46691
46957
|
}
|
|
46692
46958
|
}
|
|
46693
46959
|
}
|
|
46694
|
-
class
|
|
46960
|
+
class OA {
|
|
46695
46961
|
engine;
|
|
46696
46962
|
constructor(e) {
|
|
46697
46963
|
this.engine = e;
|
|
@@ -46814,7 +47080,7 @@ class FA {
|
|
|
46814
47080
|
!e || e.isEmpty?.() || this.engine.viewCube?.zoomToModel?.(e);
|
|
46815
47081
|
}
|
|
46816
47082
|
}
|
|
46817
|
-
class
|
|
47083
|
+
class zA {
|
|
46818
47084
|
engine;
|
|
46819
47085
|
sectionPlaneGroup = null;
|
|
46820
47086
|
loaderModule2d;
|
|
@@ -46884,16 +47150,16 @@ class NA {
|
|
|
46884
47150
|
), l.setPosition(e), l;
|
|
46885
47151
|
}
|
|
46886
47152
|
}
|
|
46887
|
-
function
|
|
47153
|
+
function UA(r, e, t = "bim-snapshot.png") {
|
|
46888
47154
|
const n = r?.renderer, i = n?.domElement;
|
|
46889
47155
|
if (!n || !i || !e)
|
|
46890
47156
|
return null;
|
|
46891
47157
|
const s = i.width || i.clientWidth, o = i.height || i.clientHeight;
|
|
46892
47158
|
if (s <= 0 || o <= 0)
|
|
46893
47159
|
return null;
|
|
46894
|
-
let a =
|
|
46895
|
-
if (!
|
|
46896
|
-
const d =
|
|
47160
|
+
let a = kA(i, s, o);
|
|
47161
|
+
if (!VA(a)) {
|
|
47162
|
+
const d = HA(r, s, o);
|
|
46897
47163
|
d && (a = d);
|
|
46898
47164
|
}
|
|
46899
47165
|
const l = document.createElement("canvas");
|
|
@@ -46905,13 +47171,13 @@ function BA(r, e, t = "bim-snapshot.png") {
|
|
|
46905
47171
|
const h = l.toDataURL("image/png"), u = document.createElement("a");
|
|
46906
47172
|
return u.href = h, u.download = t.toLowerCase().endsWith(".png") ? t : `${t}.png`, u.click(), h;
|
|
46907
47173
|
}
|
|
46908
|
-
function
|
|
47174
|
+
function kA(r, e, t) {
|
|
46909
47175
|
const n = document.createElement("canvas");
|
|
46910
47176
|
n.width = e, n.height = t;
|
|
46911
47177
|
const i = n.getContext("2d");
|
|
46912
47178
|
return i && i.drawImage(r, 0, 0, e, t), n;
|
|
46913
47179
|
}
|
|
46914
|
-
function
|
|
47180
|
+
function VA(r) {
|
|
46915
47181
|
const e = r.getContext("2d");
|
|
46916
47182
|
if (!e || r.width <= 0 || r.height <= 0)
|
|
46917
47183
|
return !1;
|
|
@@ -46924,7 +47190,7 @@ function zA(r) {
|
|
|
46924
47190
|
}
|
|
46925
47191
|
return !1;
|
|
46926
47192
|
}
|
|
46927
|
-
function
|
|
47193
|
+
function HA(r, e, t) {
|
|
46928
47194
|
const n = r?.renderer, i = r?.scene, s = r?.camera;
|
|
46929
47195
|
if (!n || !i || !s)
|
|
46930
47196
|
return null;
|
|
@@ -46938,14 +47204,14 @@ function UA(r, e, t) {
|
|
|
46938
47204
|
try {
|
|
46939
47205
|
n.xr && (n.xr.enabled = !1), n.autoClear = !0, n.setRenderTarget(o), n.clear(!0, !0, !0), n.render(i, s);
|
|
46940
47206
|
const h = new Uint8Array(e * t * 4);
|
|
46941
|
-
return n.readRenderTargetPixels(o, 0, 0, e, t, h),
|
|
47207
|
+
return n.readRenderTargetPixels(o, 0, 0, e, t, h), GA(h, e, t);
|
|
46942
47208
|
} catch {
|
|
46943
47209
|
return null;
|
|
46944
47210
|
} finally {
|
|
46945
47211
|
n.setRenderTarget(a), n.autoClear = l, n.xr && (n.xr.enabled = c), o.dispose();
|
|
46946
47212
|
}
|
|
46947
47213
|
}
|
|
46948
|
-
function
|
|
47214
|
+
function GA(r, e, t) {
|
|
46949
47215
|
const n = document.createElement("canvas");
|
|
46950
47216
|
n.width = e, n.height = t;
|
|
46951
47217
|
const i = n.getContext("2d");
|
|
@@ -46959,7 +47225,7 @@ function kA(r, e, t) {
|
|
|
46959
47225
|
}
|
|
46960
47226
|
return i.putImageData(s, 0, 0), n;
|
|
46961
47227
|
}
|
|
46962
|
-
const
|
|
47228
|
+
const WA = [
|
|
46963
47229
|
"#ffffff",
|
|
46964
47230
|
"#000000",
|
|
46965
47231
|
"#ff4d4f",
|
|
@@ -46970,7 +47236,7 @@ const VA = [
|
|
|
46970
47236
|
"#1677ff",
|
|
46971
47237
|
"#722ed1",
|
|
46972
47238
|
"#eb2f96"
|
|
46973
|
-
],
|
|
47239
|
+
], XA = {
|
|
46974
47240
|
none: at("/assets/icon/选择.svg", import.meta.url),
|
|
46975
47241
|
line: at("/assets/icon/线.svg", import.meta.url),
|
|
46976
47242
|
arrow: at("/assets/icon/箭头.svg", import.meta.url),
|
|
@@ -46978,7 +47244,7 @@ const VA = [
|
|
|
46978
47244
|
circle: at("/assets/icon/圆形.svg", import.meta.url),
|
|
46979
47245
|
text: at("/assets/icon/文字.svg", import.meta.url),
|
|
46980
47246
|
cloudline: at("/assets/icon/云线.svg", import.meta.url)
|
|
46981
|
-
},
|
|
47247
|
+
}, qA = at("/assets/icon/测距.svg", import.meta.url), YA = at("/assets/icon/截图.svg", import.meta.url), $A = at("/assets/icon/线宽.svg", import.meta.url), KA = at("/assets/icon/字号.svg", import.meta.url), ZA = `data:image/svg+xml;utf8,${encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 2l4 8-4 12-4-12 4-8z" fill="#1677ff"/><circle cx="12" cy="10" r="2.5" fill="#fff"/></svg>')}`, jA = [
|
|
46982
47248
|
{ type: "distance", label: "距离" },
|
|
46983
47249
|
{ type: "clearDistance", label: "净距" },
|
|
46984
47250
|
{ type: "clearHeight", label: "净高" },
|
|
@@ -46987,7 +47253,7 @@ const VA = [
|
|
|
46987
47253
|
{ type: "angle", label: "角度" },
|
|
46988
47254
|
{ type: "area", label: "面积" },
|
|
46989
47255
|
{ type: "slope", label: "坡度" }
|
|
46990
|
-
],
|
|
47256
|
+
], JA = {
|
|
46991
47257
|
distance: at("/assets/icon/距离.svg", import.meta.url),
|
|
46992
47258
|
clearDistance: at("/assets/icon/净距.svg", import.meta.url),
|
|
46993
47259
|
clearHeight: at("/assets/icon/净高.svg", import.meta.url),
|
|
@@ -46997,7 +47263,7 @@ const VA = [
|
|
|
46997
47263
|
area: at("/assets/icon/面积.svg", import.meta.url),
|
|
46998
47264
|
slope: at("/assets/icon/坡度.svg", import.meta.url)
|
|
46999
47265
|
};
|
|
47000
|
-
class
|
|
47266
|
+
class QA {
|
|
47001
47267
|
constructor(e, t) {
|
|
47002
47268
|
this.handlers = e, this.root = document.createElement("div"), this.root.style.position = "absolute", this.root.style.top = "8px", this.root.style.left = "50%", this.root.style.transform = "translateX(-50%)", this.root.style.display = "none", this.root.style.padding = "6px", this.root.style.background = "#ffffff", this.root.style.border = "1px solid #d9d9d9", this.root.style.borderRadius = "8px", this.root.style.pointerEvents = "auto", this.root.style.userSelect = "none", this.root.style.boxShadow = "0 4px 14px rgba(0, 0, 0, 0.12)", this.root.style.zIndex = "1300", this.root.style.overflow = "visible", this.editPanel = document.createElement("div"), this.editPanel.style.display = "flex", this.editPanel.style.flexDirection = "column", this.editPanel.style.gap = "6px", this.viewPanel = document.createElement("div"), this.viewPanel.style.display = "none", this.viewPanel.style.alignItems = "center", this.viewPanel.style.gap = "6px";
|
|
47003
47269
|
const n = document.createElement("div");
|
|
@@ -47010,7 +47276,7 @@ class ZA {
|
|
|
47010
47276
|
{ type: "text", label: "文字" },
|
|
47011
47277
|
{ type: "cloudline", label: "云线" }
|
|
47012
47278
|
].forEach((m) => {
|
|
47013
|
-
const g = this.createIconButton(m.label,
|
|
47279
|
+
const g = this.createIconButton(m.label, XA[m.type]);
|
|
47014
47280
|
g.onclick = () => this.handlers.onDrawTypeChange(m.type), this.drawButtons[m.type] = g, n.appendChild(g);
|
|
47015
47281
|
});
|
|
47016
47282
|
const s = document.createElement("div");
|
|
@@ -47020,23 +47286,23 @@ class ZA {
|
|
|
47020
47286
|
this.updateColorControl(this.colorInput.value), this.handlers.onColorChange(this.colorInput.value), this.setColorPresetVisible(!1);
|
|
47021
47287
|
}, s.appendChild(this.colorInput), this.colorPresetPanel = document.createElement("div"), this.colorPresetPanel.style.position = "absolute", this.colorPresetPanel.style.top = "30px", this.colorPresetPanel.style.left = "0", this.colorPresetPanel.style.display = "none", this.colorPresetPanel.style.padding = "8px", this.colorPresetPanel.style.background = "#ffffff", this.colorPresetPanel.style.border = "1px solid #d9d9d9", this.colorPresetPanel.style.borderRadius = "6px", this.colorPresetPanel.style.boxShadow = "0 6px 18px rgba(0, 0, 0, 0.14)", this.colorPresetPanel.style.zIndex = "20", this.colorPresetPanel.style.width = "152px";
|
|
47022
47288
|
const a = document.createElement("div");
|
|
47023
|
-
a.style.display = "grid", a.style.gridTemplateColumns = "repeat(5, 1fr)", a.style.gap = "6px",
|
|
47289
|
+
a.style.display = "grid", a.style.gridTemplateColumns = "repeat(5, 1fr)", a.style.gap = "6px", WA.forEach((m) => {
|
|
47024
47290
|
const g = document.createElement("button");
|
|
47025
47291
|
g.type = "button", g.title = m, g.style.width = "22px", g.style.height = "22px", g.style.padding = "0", g.style.border = "1px solid #d9d9d9", g.style.borderRadius = "4px", g.style.background = m, g.style.cursor = "pointer", g.onclick = () => {
|
|
47026
47292
|
this.updateColorControl(m), this.handlers.onColorChange(m), this.setColorPresetVisible(!1);
|
|
47027
47293
|
}, a.appendChild(g);
|
|
47028
47294
|
}), this.colorPresetPanel.appendChild(a);
|
|
47029
47295
|
const l = document.createElement("button");
|
|
47030
|
-
l.type = "button", l.textContent = "自定义", l.style.marginTop = "8px", l.style.width = "100%", l.style.height = "26px", l.style.border = "1px solid #d9d9d9", l.style.borderRadius = "4px", l.style.background = "#ffffff", l.style.color = "#333333", l.style.cursor = "pointer", l.onclick = () => this.openNativeColorPicker(), this.colorPresetPanel.appendChild(l), s.appendChild(this.colorPresetPanel), this.updateColorControl(t.stroke), n.appendChild(this.createField("", s)), this.strokeWidthInput = document.createElement("input"), this.strokeWidthInput.type = "number", this.strokeWidthInput.min = "1", this.strokeWidthInput.max = "20", this.strokeWidthInput.step = "1", this.strokeWidthInput.value = String(t.strokeWidth), this.strokeWidthInput.style.width = "46px", this.strokeWidthInput.oninput = () => this.handlers.onStrokeWidthChange(this.strokeWidthInput.value), n.appendChild(this.createField("", this.strokeWidthInput,
|
|
47031
|
-
const c = this.createIconButton("截图",
|
|
47296
|
+
l.type = "button", l.textContent = "自定义", l.style.marginTop = "8px", l.style.width = "100%", l.style.height = "26px", l.style.border = "1px solid #d9d9d9", l.style.borderRadius = "4px", l.style.background = "#ffffff", l.style.color = "#333333", l.style.cursor = "pointer", l.onclick = () => this.openNativeColorPicker(), this.colorPresetPanel.appendChild(l), s.appendChild(this.colorPresetPanel), this.updateColorControl(t.stroke), n.appendChild(this.createField("", s)), this.strokeWidthInput = document.createElement("input"), this.strokeWidthInput.type = "number", this.strokeWidthInput.min = "1", this.strokeWidthInput.max = "20", this.strokeWidthInput.step = "1", this.strokeWidthInput.value = String(t.strokeWidth), this.strokeWidthInput.style.width = "46px", this.strokeWidthInput.oninput = () => this.handlers.onStrokeWidthChange(this.strokeWidthInput.value), n.appendChild(this.createField("", this.strokeWidthInput, $A, "线宽")), this.fontSizeInput = document.createElement("input"), this.fontSizeInput.type = "number", this.fontSizeInput.min = "10", this.fontSizeInput.max = "96", this.fontSizeInput.step = "1", this.fontSizeInput.value = String(t.fontSize), this.fontSizeInput.style.width = "46px", this.fontSizeInput.oninput = () => this.handlers.onFontSizeChange(this.fontSizeInput.value), n.appendChild(this.createField("", this.fontSizeInput, KA, "字号")), this.distanceButton = this.createIconButton("测量", qA), this.distanceButton.onclick = () => this.handlers.onMeasureToggle(), n.appendChild(this.distanceButton);
|
|
47297
|
+
const c = this.createIconButton("截图", YA);
|
|
47032
47298
|
c.onclick = () => this.handlers.onScreenshot(), n.appendChild(c);
|
|
47033
|
-
const h = this.createIconButton("捕捉点",
|
|
47299
|
+
const h = this.createIconButton("捕捉点", ZA);
|
|
47034
47300
|
h.onclick = () => this.handlers.onPickPoint(), n.appendChild(h);
|
|
47035
47301
|
const u = this.createTextButton("×", "取消");
|
|
47036
47302
|
u.onclick = () => this.handlers.onCancel(), u.style.background = "#ff4d4f", u.style.borderColor = "#ff4d4f", u.style.color = "#ffffff", n.appendChild(u);
|
|
47037
47303
|
const d = this.createTextButton("✔", "确定");
|
|
47038
|
-
d.onclick = () => this.handlers.onConfirm(), d.style.background = "#52c41a", d.style.borderColor = "#52c41a", d.style.color = "#ffffff", n.appendChild(d), this.measureSubPanel = document.createElement("div"), this.measureSubPanel.style.display = "none", this.measureSubPanel.style.alignItems = "center", this.measureSubPanel.style.gap = "6px", this.measureSubPanel.style.flexWrap = "wrap", this.measureSubPanel.style.paddingTop = "2px",
|
|
47039
|
-
const g = this.createSmallIconButton(m.label,
|
|
47304
|
+
d.onclick = () => this.handlers.onConfirm(), d.style.background = "#52c41a", d.style.borderColor = "#52c41a", d.style.color = "#ffffff", n.appendChild(d), this.measureSubPanel = document.createElement("div"), this.measureSubPanel.style.display = "none", this.measureSubPanel.style.alignItems = "center", this.measureSubPanel.style.gap = "6px", this.measureSubPanel.style.flexWrap = "wrap", this.measureSubPanel.style.paddingTop = "2px", jA.forEach((m) => {
|
|
47305
|
+
const g = this.createSmallIconButton(m.label, JA[m.type]);
|
|
47040
47306
|
g.onclick = () => this.handlers.onMeasureTypeChange(m.type), this.measureTypeButtons[m.type] = g, this.measureSubPanel.appendChild(g);
|
|
47041
47307
|
}), this.editPanel.appendChild(n), this.editPanel.appendChild(this.measureSubPanel);
|
|
47042
47308
|
const f = this.createTextButton("关闭", "关闭");
|
|
@@ -47161,7 +47427,7 @@ class ZA {
|
|
|
47161
47427
|
return n.type = "button", n.title = t, n.textContent = e, n.style.width = "28px", n.style.height = "28px", n.style.padding = "0 10px", n.style.border = "1px solid #d9d9d9", n.style.borderRadius = "4px", n.style.background = "#ffffff", n.style.color = "#333333", n.style.fontSize = "13px", n.style.lineHeight = "1", n.style.cursor = "pointer", n;
|
|
47162
47428
|
}
|
|
47163
47429
|
}
|
|
47164
|
-
class
|
|
47430
|
+
class eT {
|
|
47165
47431
|
engine;
|
|
47166
47432
|
wrapper;
|
|
47167
47433
|
canvasEl;
|
|
@@ -47200,7 +47466,7 @@ class jA {
|
|
|
47200
47466
|
const t = this.engine.container;
|
|
47201
47467
|
if (!t)
|
|
47202
47468
|
throw new Error("FabricDraw: engine container not found.");
|
|
47203
|
-
this.wrapper = document.createElement("div"), this.wrapper.className = "fabric-draw-layer", this.wrapper.style.position = "absolute", this.wrapper.style.left = "0", this.wrapper.style.top = "0", this.wrapper.style.right = "0", this.wrapper.style.bottom = "0", this.wrapper.style.pointerEvents = "none", this.canvasEl = document.createElement("canvas"), this.canvasEl.style.width = "100%", this.canvasEl.style.height = "100%", this.wrapper.appendChild(this.canvasEl), this.toolbar = new
|
|
47469
|
+
this.wrapper = document.createElement("div"), this.wrapper.className = "fabric-draw-layer", this.wrapper.style.position = "absolute", this.wrapper.style.left = "0", this.wrapper.style.top = "0", this.wrapper.style.right = "0", this.wrapper.style.bottom = "0", this.wrapper.style.pointerEvents = "none", this.canvasEl = document.createElement("canvas"), this.canvasEl.style.width = "100%", this.canvasEl.style.height = "100%", this.wrapper.appendChild(this.canvasEl), this.toolbar = new QA({
|
|
47204
47470
|
onDrawTypeChange: (i) => this.setDrawType(i),
|
|
47205
47471
|
onMeasureToggle: () => this.toggleMeasurePanel(),
|
|
47206
47472
|
onMeasureTypeChange: (i) => this.activateDistanceMeasure(i),
|
|
@@ -47349,7 +47615,7 @@ class jA {
|
|
|
47349
47615
|
* 鎴浘淇濆瓨锛堟ā鍨?Fabric鎵规敞鍚堟垚锛夈€? */
|
|
47350
47616
|
saveScreenshot(e = "bim-snapshot.png") {
|
|
47351
47617
|
const t = this.canvas.lowerCanvasEl;
|
|
47352
|
-
return t ?
|
|
47618
|
+
return t ? UA(this.engine, t, e) : null;
|
|
47353
47619
|
}
|
|
47354
47620
|
/**
|
|
47355
47621
|
* 鍚屾鐢诲竷灏哄銆? */
|
|
@@ -47833,7 +48099,7 @@ class jA {
|
|
|
47833
48099
|
return JSON.parse(JSON.stringify(e));
|
|
47834
48100
|
}
|
|
47835
48101
|
}
|
|
47836
|
-
class
|
|
48102
|
+
class tT {
|
|
47837
48103
|
engine;
|
|
47838
48104
|
capturePoint = null;
|
|
47839
48105
|
labelPrefix = "drawing-pin-label-";
|
|
@@ -48229,7 +48495,7 @@ class JA {
|
|
|
48229
48495
|
return e;
|
|
48230
48496
|
}
|
|
48231
48497
|
}
|
|
48232
|
-
const _h = "bim-engine:model-link-3d",
|
|
48498
|
+
const _h = "bim-engine:model-link-3d", nT = "default-model-link-3d-group", vp = {
|
|
48233
48499
|
enabled: !1,
|
|
48234
48500
|
highlight: !0,
|
|
48235
48501
|
visibility: !0,
|
|
@@ -48238,7 +48504,7 @@ const _h = "bim-engine:model-link-3d", QA = "default-model-link-3d-group", vp =
|
|
|
48238
48504
|
cameraMode: "onStop",
|
|
48239
48505
|
cameraThrottleMs: 50
|
|
48240
48506
|
};
|
|
48241
|
-
class
|
|
48507
|
+
class iT {
|
|
48242
48508
|
viewerGuid;
|
|
48243
48509
|
engine;
|
|
48244
48510
|
options;
|
|
@@ -48302,7 +48568,7 @@ class eT {
|
|
|
48302
48568
|
return {
|
|
48303
48569
|
...vp,
|
|
48304
48570
|
...e,
|
|
48305
|
-
groupId: e.groupId ?? this.engine?.options?.linkGroupId ??
|
|
48571
|
+
groupId: e.groupId ?? this.engine?.options?.linkGroupId ?? nT,
|
|
48306
48572
|
modelId: e.modelId ?? this.engine?.options?.modelLinkId
|
|
48307
48573
|
};
|
|
48308
48574
|
}
|
|
@@ -48533,7 +48799,7 @@ class eT {
|
|
|
48533
48799
|
})).filter((i) => i.ids.length > 0);
|
|
48534
48800
|
}
|
|
48535
48801
|
}
|
|
48536
|
-
class
|
|
48802
|
+
class sT {
|
|
48537
48803
|
engine;
|
|
48538
48804
|
manager;
|
|
48539
48805
|
worldToScreen;
|
|
@@ -48611,7 +48877,7 @@ function Ia(r) {
|
|
|
48611
48877
|
const e = new _();
|
|
48612
48878
|
return r.length === 0 ? e : (r.forEach((t) => e.add(Cn(t))), e.multiplyScalar(1 / r.length));
|
|
48613
48879
|
}
|
|
48614
|
-
function
|
|
48880
|
+
function rT(r) {
|
|
48615
48881
|
const e = new _();
|
|
48616
48882
|
for (let t = 0; t < r.length; t += 1) {
|
|
48617
48883
|
const n = r[t], i = r[(t + 1) % r.length];
|
|
@@ -48621,7 +48887,7 @@ function nT(r) {
|
|
|
48621
48887
|
}
|
|
48622
48888
|
function Mp(r) {
|
|
48623
48889
|
const e = r.map((c) => Cn(c)), t = e[0].clone(), n = e.length > 1 ? e[1].clone().sub(t).normalize() : new _(1, 0, 0);
|
|
48624
|
-
let i =
|
|
48890
|
+
let i = rT(e);
|
|
48625
48891
|
i.lengthSq() < 1e-8 && (i = new _(0, 1, 0));
|
|
48626
48892
|
const s = new _().crossVectors(i, n).normalize(), o = new _().crossVectors(s, i).normalize(), a = e.map((c) => {
|
|
48627
48893
|
const h = c.clone().sub(t);
|
|
@@ -48644,12 +48910,12 @@ function _p(r) {
|
|
|
48644
48910
|
e.lineTo(t.x, t.y);
|
|
48645
48911
|
}), e.closePath(), e;
|
|
48646
48912
|
}
|
|
48647
|
-
function
|
|
48913
|
+
function oT(r, e) {
|
|
48648
48914
|
r.traverse((t) => {
|
|
48649
48915
|
t.userData = t.userData ?? {}, t.userData.annotationId = e;
|
|
48650
48916
|
});
|
|
48651
48917
|
}
|
|
48652
|
-
function
|
|
48918
|
+
function aT(r) {
|
|
48653
48919
|
r.traverse((e) => {
|
|
48654
48920
|
const t = e;
|
|
48655
48921
|
t.geometry?.dispose?.();
|
|
@@ -48661,13 +48927,13 @@ function sT(r) {
|
|
|
48661
48927
|
n?.dispose?.();
|
|
48662
48928
|
});
|
|
48663
48929
|
}
|
|
48664
|
-
function
|
|
48930
|
+
function lT(r) {
|
|
48665
48931
|
return r.replace(/[A-Z]/g, (e) => `-${e.toLowerCase()}`);
|
|
48666
48932
|
}
|
|
48667
|
-
function
|
|
48933
|
+
function cT(r) {
|
|
48668
48934
|
return r === "polyline" ? "center" : r === "polygon" ? "centroid" : "top";
|
|
48669
48935
|
}
|
|
48670
|
-
class
|
|
48936
|
+
class hT {
|
|
48671
48937
|
constructor(e, t, n) {
|
|
48672
48938
|
this.engine = e, this.textureLoader = t, this.materialFactory = n;
|
|
48673
48939
|
}
|
|
@@ -48769,7 +49035,7 @@ class aT {
|
|
|
48769
49035
|
n.add(new $0(t[c], t[c + 1]));
|
|
48770
49036
|
const i = Math.max(e.instance.style.lineWidth ?? 0.18, 0.02), s = new K0(n, Math.max(32, t.length * 14), i, 10, !1);
|
|
48771
49037
|
s.computeBoundingBox();
|
|
48772
|
-
const o = s.boundingBox ?? new
|
|
49038
|
+
const o = s.boundingBox ?? new gt(new _(0, 0, 0), new _(1, 1, 1)), a = this.materialFactory.createSurfaceMaterial({
|
|
48773
49039
|
color: e.instance.style.color ?? "#7ffcff",
|
|
48774
49040
|
opacity: e.instance.style.opacity ?? 0.92,
|
|
48775
49041
|
style: e.instance.style,
|
|
@@ -48784,7 +49050,7 @@ class aT {
|
|
|
48784
49050
|
buildPolygon(e) {
|
|
48785
49051
|
const t = Mp(e.instance.points), n = _p(t.localPoints), i = new Z0(n);
|
|
48786
49052
|
i.computeBoundingBox();
|
|
48787
|
-
const s = i.boundingBox ?? new
|
|
49053
|
+
const s = i.boundingBox ?? new gt(new _(0, 0, 0), new _(1, 1, 1)), o = this.materialFactory.createSurfaceMaterial({
|
|
48788
49054
|
color: e.instance.style.fillColor ?? e.instance.style.color ?? "#7ffcff",
|
|
48789
49055
|
opacity: e.instance.style.fillOpacity ?? 0.18,
|
|
48790
49056
|
style: e.instance.style,
|
|
@@ -48812,7 +49078,7 @@ class aT {
|
|
|
48812
49078
|
curveSegments: 24
|
|
48813
49079
|
});
|
|
48814
49080
|
s.computeBoundingBox();
|
|
48815
|
-
const o = s.boundingBox ?? new
|
|
49081
|
+
const o = s.boundingBox ?? new gt(new _(0, 0, 0), new _(1, 1, 1)), a = this.materialFactory.createSurfaceMaterial({
|
|
48816
49082
|
color: e.instance.style.fillColor ?? e.instance.style.color ?? "#7ffcff",
|
|
48817
49083
|
opacity: e.instance.style.fillOpacity ?? 0.22,
|
|
48818
49084
|
style: e.instance.style,
|
|
@@ -48835,7 +49101,7 @@ class aT {
|
|
|
48835
49101
|
return;
|
|
48836
49102
|
const t = Cn(e.instance.points[0]), n = Cn(e.instance.points[1]), i = t.clone().min(n), s = t.clone().max(n), o = s.clone().sub(i), a = i.clone().add(s).multiplyScalar(0.5), l = new Ua(o.x || 0.1, o.y || 0.1, o.z || 0.1);
|
|
48837
49103
|
l.computeBoundingBox();
|
|
48838
|
-
const c = l.boundingBox ?? new
|
|
49104
|
+
const c = l.boundingBox ?? new gt(
|
|
48839
49105
|
new _(-0.5, -0.5, -0.5),
|
|
48840
49106
|
new _(0.5, 0.5, 0.5)
|
|
48841
49107
|
), h = this.materialFactory.createSurfaceMaterial({
|
|
@@ -48888,7 +49154,7 @@ class aT {
|
|
|
48888
49154
|
return o.renderOrder = 998, o;
|
|
48889
49155
|
}
|
|
48890
49156
|
}
|
|
48891
|
-
class
|
|
49157
|
+
class uT {
|
|
48892
49158
|
constructor(e) {
|
|
48893
49159
|
this.engine = e;
|
|
48894
49160
|
}
|
|
@@ -48933,7 +49199,7 @@ class lT {
|
|
|
48933
49199
|
t.scale.set(o, o, 1);
|
|
48934
49200
|
}
|
|
48935
49201
|
}
|
|
48936
|
-
class
|
|
49202
|
+
class dT {
|
|
48937
49203
|
constructor(e) {
|
|
48938
49204
|
this.engine = e;
|
|
48939
49205
|
}
|
|
@@ -49124,7 +49390,7 @@ const zr = {
|
|
|
49124
49390
|
showBottom: !1,
|
|
49125
49391
|
edgeColor: "#d9ffff"
|
|
49126
49392
|
}
|
|
49127
|
-
},
|
|
49393
|
+
}, fT = {
|
|
49128
49394
|
background: "rgba(10, 18, 28, 0.92)",
|
|
49129
49395
|
color: "#ffffff",
|
|
49130
49396
|
border: "1px solid rgba(127, 252, 255, 0.72)",
|
|
@@ -49133,8 +49399,8 @@ const zr = {
|
|
|
49133
49399
|
boxShadow: "0 10px 30px rgba(0, 0, 0, 0.32)",
|
|
49134
49400
|
minWidth: "120px",
|
|
49135
49401
|
pointerEvents: "auto"
|
|
49136
|
-
},
|
|
49137
|
-
class
|
|
49402
|
+
}, pT = "bim-engine-annotation3d-panels";
|
|
49403
|
+
class mT {
|
|
49138
49404
|
/** 新增或恢复数据前先做标准化,保证后续模块只处理完整结构。 */
|
|
49139
49405
|
normalizeData(e) {
|
|
49140
49406
|
return {
|
|
@@ -49279,7 +49545,7 @@ class dT {
|
|
|
49279
49545
|
screenOffset: { ...e.screenOffset ?? {} },
|
|
49280
49546
|
className: e.className,
|
|
49281
49547
|
style: {
|
|
49282
|
-
...
|
|
49548
|
+
...fT,
|
|
49283
49549
|
...e.style ?? {}
|
|
49284
49550
|
},
|
|
49285
49551
|
interactive: e.interactive ?? !0,
|
|
@@ -49288,7 +49554,7 @@ class dT {
|
|
|
49288
49554
|
};
|
|
49289
49555
|
}
|
|
49290
49556
|
}
|
|
49291
|
-
function
|
|
49557
|
+
function gT(r, e, t) {
|
|
49292
49558
|
const n = r.camera;
|
|
49293
49559
|
if (!n)
|
|
49294
49560
|
return !1;
|
|
@@ -49301,9 +49567,9 @@ function fT(r, e, t) {
|
|
|
49301
49567
|
const a = o.sort((l, c) => l.distance - c.distance)[0];
|
|
49302
49568
|
return !!(a && a.distance < s - 0.05);
|
|
49303
49569
|
}
|
|
49304
|
-
class
|
|
49570
|
+
class xT {
|
|
49305
49571
|
constructor(e, t) {
|
|
49306
|
-
this.engine = e, this.isAnchorOccluded = t, this.container = document.createElement("div"), this.container.className =
|
|
49572
|
+
this.engine = e, this.isAnchorOccluded = t, this.container = document.createElement("div"), this.container.className = pT, this.container.style.cssText = [
|
|
49307
49573
|
"position:absolute",
|
|
49308
49574
|
"left:0",
|
|
49309
49575
|
"top:0",
|
|
@@ -49331,7 +49597,7 @@ class pT {
|
|
|
49331
49597
|
"display:none",
|
|
49332
49598
|
t.interactive === !1 ? "pointer-events:none" : "pointer-events:auto"
|
|
49333
49599
|
].join(";"), t.mode === "html" ? n.innerHTML = t.html ?? "" : n.textContent = t.text ?? "", Object.entries(t.style ?? {}).forEach(([i, s]) => {
|
|
49334
|
-
n.style.setProperty(
|
|
49600
|
+
n.style.setProperty(lT(i), s);
|
|
49335
49601
|
}), n;
|
|
49336
49602
|
}
|
|
49337
49603
|
/** 根据标记状态刷新面板位置、遮挡逻辑和显示方式。 */
|
|
@@ -49366,7 +49632,7 @@ class pT {
|
|
|
49366
49632
|
}
|
|
49367
49633
|
/** 不同几何类型的面板锚点算法不同,这里统一做收口。 */
|
|
49368
49634
|
getPanelAnchorPoint(e) {
|
|
49369
|
-
const t = e.instance.panel?.anchor ??
|
|
49635
|
+
const t = e.instance.panel?.anchor ?? cT(e.instance.type), n = e.instance.panel?.offset ?? {};
|
|
49370
49636
|
let i = new _();
|
|
49371
49637
|
if (e.instance.type === "point")
|
|
49372
49638
|
i.copy(Cn(e.instance.points[0])), t === "top" && (i.y += e.volumeHeight ?? e.instance.style.point?.anchorY ?? 0);
|
|
@@ -49383,7 +49649,7 @@ class pT {
|
|
|
49383
49649
|
return i.add(new _(n.x ?? 0, n.y ?? 0, n.z ?? 0)), i;
|
|
49384
49650
|
}
|
|
49385
49651
|
}
|
|
49386
|
-
class
|
|
49652
|
+
class yT {
|
|
49387
49653
|
engine;
|
|
49388
49654
|
rootGroup;
|
|
49389
49655
|
records;
|
|
@@ -49498,11 +49764,11 @@ class mT {
|
|
|
49498
49764
|
};
|
|
49499
49765
|
}
|
|
49500
49766
|
}
|
|
49501
|
-
function
|
|
49767
|
+
function vT(r) {
|
|
49502
49768
|
const { actions: e, ...t } = r;
|
|
49503
49769
|
return t;
|
|
49504
49770
|
}
|
|
49505
|
-
function
|
|
49771
|
+
function MT(r) {
|
|
49506
49772
|
return {
|
|
49507
49773
|
id: r.instance.id,
|
|
49508
49774
|
type: r.instance.type,
|
|
@@ -49518,13 +49784,13 @@ function xT(r) {
|
|
|
49518
49784
|
function Ra(r) {
|
|
49519
49785
|
return r === void 0 ? r : JSON.parse(JSON.stringify(r));
|
|
49520
49786
|
}
|
|
49521
|
-
class
|
|
49787
|
+
class _T {
|
|
49522
49788
|
engine;
|
|
49523
49789
|
rootGroup;
|
|
49524
49790
|
records = /* @__PURE__ */ new Map();
|
|
49525
49791
|
textureLoader = new eo();
|
|
49526
49792
|
occlusionRaycaster = new Qt();
|
|
49527
|
-
normalizer = new
|
|
49793
|
+
normalizer = new mT();
|
|
49528
49794
|
materialFactory;
|
|
49529
49795
|
geometryBuilder;
|
|
49530
49796
|
effectsController;
|
|
@@ -49533,10 +49799,10 @@ class yT {
|
|
|
49533
49799
|
currentTime = 0;
|
|
49534
49800
|
/** 初始化标记根节点、DOM 面板层以及交互控制器。 */
|
|
49535
49801
|
constructor(e) {
|
|
49536
|
-
this.engine = e, this.rootGroup = new Jt(), this.rootGroup.name = "Annotation3dRoot", this.engine.scene.add(this.rootGroup), this.materialFactory = new
|
|
49802
|
+
this.engine = e, this.rootGroup = new Jt(), this.rootGroup.name = "Annotation3dRoot", this.engine.scene.add(this.rootGroup), this.materialFactory = new dT(this.engine), this.geometryBuilder = new hT(this.engine, this.textureLoader, this.materialFactory), this.effectsController = new uT(this.engine), this.panelLayer = new xT(
|
|
49537
49803
|
this.engine,
|
|
49538
|
-
(t) =>
|
|
49539
|
-
), this.interaction = new
|
|
49804
|
+
(t) => gT(this.engine, this.occlusionRaycaster, t)
|
|
49805
|
+
), this.interaction = new yT({
|
|
49540
49806
|
engine: this.engine,
|
|
49541
49807
|
rootGroup: this.rootGroup,
|
|
49542
49808
|
records: this.records,
|
|
@@ -49635,7 +49901,7 @@ class yT {
|
|
|
49635
49901
|
}
|
|
49636
49902
|
/** 导出纯数据快照,供保存和恢复。 */
|
|
49637
49903
|
getData() {
|
|
49638
|
-
return Array.from(this.records.values()).map((e) =>
|
|
49904
|
+
return Array.from(this.records.values()).map((e) => MT(e));
|
|
49639
49905
|
}
|
|
49640
49906
|
/** 从纯数据快照恢复整套标记。 */
|
|
49641
49907
|
restoreData(e) {
|
|
@@ -49663,7 +49929,7 @@ class yT {
|
|
|
49663
49929
|
selectable: e.selectable ?? !0,
|
|
49664
49930
|
style: e.style,
|
|
49665
49931
|
effect: e.effect ?? {},
|
|
49666
|
-
panel: e.panel ?
|
|
49932
|
+
panel: e.panel ? vT(e.panel) : void 0,
|
|
49667
49933
|
data: e.data,
|
|
49668
49934
|
panelVisible: e.panel?.trigger === "always",
|
|
49669
49935
|
hovered: !1,
|
|
@@ -49678,7 +49944,7 @@ class yT {
|
|
|
49678
49944
|
baseRingMeshes: [],
|
|
49679
49945
|
animatedMaterials: []
|
|
49680
49946
|
};
|
|
49681
|
-
return this.geometryBuilder.build(i),
|
|
49947
|
+
return this.geometryBuilder.build(i), oT(t, n.id), i;
|
|
49682
49948
|
}
|
|
49683
49949
|
/** 新记录统一走同一挂载流程,减少 add / update 重复代码。 */
|
|
49684
49950
|
attachRecord(e) {
|
|
@@ -49687,7 +49953,7 @@ class yT {
|
|
|
49687
49953
|
/** 内部删除会负责资源回收和 hover 状态清理。 */
|
|
49688
49954
|
removeInternal(e, t) {
|
|
49689
49955
|
const n = this.records.get(e);
|
|
49690
|
-
return n ? (this.interaction.handleRecordRemoved(e),
|
|
49956
|
+
return n ? (this.interaction.handleRecordRemoved(e), aT(n.instance.root), n.instance.root.removeFromParent(), n.panelElement?.remove(), this.records.delete(e), t && this.emit("annotation3d-removed", { id: e }), !0) : !1;
|
|
49691
49957
|
}
|
|
49692
49958
|
/** 标记显隐变化时,同时同步渲染顺序和面板显示。 */
|
|
49693
49959
|
applyVisibility(e) {
|
|
@@ -49708,7 +49974,7 @@ class yT {
|
|
|
49708
49974
|
this.engine.events?.trigger?.(e, t);
|
|
49709
49975
|
}
|
|
49710
49976
|
}
|
|
49711
|
-
class
|
|
49977
|
+
class bT {
|
|
49712
49978
|
constructor(e) {
|
|
49713
49979
|
this.engine = e;
|
|
49714
49980
|
}
|
|
@@ -49773,7 +50039,7 @@ class vT {
|
|
|
49773
50039
|
min: n.boundingBox.min.clone(),
|
|
49774
50040
|
max: n.boundingBox.max.clone()
|
|
49775
50041
|
});
|
|
49776
|
-
const i = new
|
|
50042
|
+
const i = new gt(
|
|
49777
50043
|
n.localBoundingBox.min.clone(),
|
|
49778
50044
|
n.localBoundingBox.max.clone()
|
|
49779
50045
|
);
|
|
@@ -49784,7 +50050,7 @@ class vT {
|
|
|
49784
50050
|
}
|
|
49785
50051
|
clearRuntimeWorldBoxCache(e) {
|
|
49786
50052
|
e.traverse((t) => {
|
|
49787
|
-
t?.box instanceof
|
|
50053
|
+
t?.box instanceof gt && delete t.box;
|
|
49788
50054
|
});
|
|
49789
50055
|
}
|
|
49790
50056
|
toThreeMatrix(e) {
|
|
@@ -49829,7 +50095,7 @@ class vT {
|
|
|
49829
50095
|
return "x" in e ? new _(e.x, e.y, e.z) : new _(e.X, e.Y, e.Z);
|
|
49830
50096
|
}
|
|
49831
50097
|
}
|
|
49832
|
-
class
|
|
50098
|
+
class TT {
|
|
49833
50099
|
// 引擎参数
|
|
49834
50100
|
options;
|
|
49835
50101
|
deviceType;
|
|
@@ -49901,6 +50167,8 @@ class ET {
|
|
|
49901
50167
|
modelTree;
|
|
49902
50168
|
engineInfo;
|
|
49903
50169
|
modelProperties;
|
|
50170
|
+
/** 提供构件、模型与房间的检索、高亮和相机定位能力。 */
|
|
50171
|
+
search;
|
|
49904
50172
|
modelMapperBatch;
|
|
49905
50173
|
modelEdge;
|
|
49906
50174
|
pathRoaming;
|
|
@@ -49940,7 +50208,7 @@ class ET {
|
|
|
49940
50208
|
const t = this.events.trigger.bind(this.events);
|
|
49941
50209
|
this.events.trigger = ((o, a) => {
|
|
49942
50210
|
t(o, a), String(o) !== String(On.EngineBusy) && this.requestComposerRender();
|
|
49943
|
-
}), this.engineStatus = new lC(this), this.engineStatus.init(), this.loaderModule = new Bn(this), this.lightModule = new PC(this), this.lightModule.init(), this.viewCube = new UC(this), this.viewCube.init(), this.options.showViewCube == !1 && this.viewCube.hide(), this.octreeBox = kC(this), this.rangeScale = new VC(this), this.rangeScale.init(), this.setting = new lA(this), this.engineModelModule.init(), this.handelBehaved = $u(this), this.modelMapperBatch = new
|
|
50211
|
+
}), this.engineStatus = new lC(this), this.engineStatus.init(), this.loaderModule = new Bn(this), this.lightModule = new PC(this), this.lightModule.init(), this.viewCube = new UC(this), this.viewCube.init(), this.options.showViewCube == !1 && this.viewCube.hide(), this.octreeBox = kC(this), this.rangeScale = new VC(this), this.rangeScale.init(), this.setting = new lA(this), this.engineModelModule.init(), this.handelBehaved = $u(this), this.modelMapperBatch = new PA(this), this.measure = new xA(this), this.modelToolModule = new RC(this), this.modelLink3d = new iT(this, this.options.linkOptions ?? {}), this.modelLink3d.init(), this.modelProperties = new EA(this), this.search = new TA(this), this.interactionModule = new IC(this), this.interactionModule.init(), this.interactionModule.active(), this.hoverHighLight = new Fl(this), this.modelEdge = new oA(this), this.modelTree = new SA(this), this.viewTree = new OA(this), this.merge2d = new zA(this), this.engineInfo = new wA(this), this.pathRoaming = new IA(this), this.pathRoaming.init(), this.oneClickEncoding = new BA(this), this.minMap = new RA(this), this.linkElement2d3d = new FA(this), this.linkView2d3d = new NA(this), this.grid = new WC(this), this.level = new ZC(this), this.issueReport = new LA(this), this.fabricDraw = new eT(this), this.drawingPin = new tT(this), this.label = new sT(this), this.annotation3d = new _T(this), this.calibration = new bT(this), this.text = new DA(this), this.hdr = new YC(this), this.ground = new Ku(this), this.ground.init(), this.skyManager = new aA(this), this.setting.init(), this.worldToScreen = new Ht(this.camera, this.renderer, this.scene), this.options.showStats && (this.stats = new fx(), this.stats.showPanel(0), this.stats.dom.style.position = "absolute", this.stats.dom.style.top = "0px", this.stats.dom.style.left = "0px", this.stats.dom.style.zIndex = "1000", this.container.appendChild(this.stats.dom));
|
|
49944
50212
|
let n = document.createElement("div");
|
|
49945
50213
|
n.className = "versionText", this.versionEl = n, this.updateVersionDisplay(), this.container.appendChild(n);
|
|
49946
50214
|
let i = document.createElementNS("http://www.w3.org/2000/svg", "svg");
|
|
@@ -50128,7 +50396,7 @@ class ET {
|
|
|
50128
50396
|
return;
|
|
50129
50397
|
this.isDisposed = !0, console.log("[BimEngine] Starting engine disposal..."), this.animationId !== null && (cancelAnimationFrame(this.animationId), this.animationId = null), this.isRenderingPaused = !0, this.onWindowResize && window.removeEventListener("resize", this.onWindowResize);
|
|
50130
50398
|
try {
|
|
50131
|
-
this.invokeIfExists(this.rangeScale, "dispose"), this.invokeIfExists(this.measure, "dispose"), this.invokeIfExists(this.clipping, "disActive"), this.invokeIfExists(this.interactionModule, "dispose"), this.invokeIfExists(this.controlModule, "dispose"), this.invokeIfExists(this.pathRoaming, "dispose"), this.invokeIfExists(this.hoverHighLight, "dispose"), this.invokeIfExists(this.linkElement2d3d, "dispose"), this.invokeIfExists(this.linkView2d3d, "dispose"), this.invokeIfExists(this.skyManager, "close", !0), this.invokeIfExists(this.hdr, "dispose"), this.invokeIfExists(this.minMap, "dispose"), this.invokeIfExists(this.grid, "dispose"), this.invokeIfExists(this.level, "dispose"), this.invokeIfExists(this.ground, "dispose"), this.invokeIfExists(this.text, "dispose"), this.invokeIfExists(this.issueReport, "dispose"), this.invokeIfExists(this.fabricDraw, "dispose"), this.invokeIfExists(this.modelLink3d, "dispose"), this.invokeIfExists(this.label, "dispose"), this.invokeIfExists(this.annotation3d, "dispose"), this.invokeIfExists(this.viewCube?.cubeTool, "dispose"), this.invokeIfExists(this.handelBehaved, "disActive"), this.invokeIfExists(this.engineStatus, "dispose");
|
|
50399
|
+
this.invokeIfExists(this.rangeScale, "dispose"), this.invokeIfExists(this.measure, "dispose"), this.invokeIfExists(this.clipping, "disActive"), this.invokeIfExists(this.interactionModule, "dispose"), this.invokeIfExists(this.controlModule, "dispose"), this.invokeIfExists(this.pathRoaming, "dispose"), this.invokeIfExists(this.hoverHighLight, "dispose"), this.invokeIfExists(this.linkElement2d3d, "dispose"), this.invokeIfExists(this.linkView2d3d, "dispose"), this.invokeIfExists(this.skyManager, "close", !0), this.invokeIfExists(this.hdr, "dispose"), this.invokeIfExists(this.minMap, "dispose"), this.invokeIfExists(this.grid, "dispose"), this.invokeIfExists(this.level, "dispose"), this.invokeIfExists(this.ground, "dispose"), this.invokeIfExists(this.text, "dispose"), this.invokeIfExists(this.issueReport, "dispose"), this.invokeIfExists(this.fabricDraw, "dispose"), this.invokeIfExists(this.modelLink3d, "dispose"), this.invokeIfExists(this.label, "dispose"), this.invokeIfExists(this.annotation3d, "dispose"), this.invokeIfExists(this.search, "dispose"), this.invokeIfExists(this.viewCube?.cubeTool, "dispose"), this.invokeIfExists(this.handelBehaved, "disActive"), this.invokeIfExists(this.engineStatus, "dispose");
|
|
50132
50400
|
} catch (t) {
|
|
50133
50401
|
console.warn("[BimEngine] Error disposing managers:", t);
|
|
50134
50402
|
}
|
|
@@ -50161,7 +50429,7 @@ class ET {
|
|
|
50161
50429
|
console.warn("[BimEngine] Error clearing event listeners:", t);
|
|
50162
50430
|
}
|
|
50163
50431
|
const e = this;
|
|
50164
|
-
e.scene = null, e.camera = null, e.renderer = null, e.controls = null, e.models = [], e.container = null, e.catchSvg = null, e.stats = null, e.versionEl = null, e.worldToScreen = null, e.measure = null, e.clipping = null, e.interactionModule = null, e.controlModule = null, e.sceneModule = null, e.cameraModule = null, e.deviceModule = null, e.renderModule = null, e.composerModule = null, e.loaderModule = null, e.lightModule = null, e.engineStatus = null, e.hoverHighLight = null, e.pathRoaming = null, e.hdr = null, e.skyManager = null, e.viewCube = null, e.grid = null, e.level = null, e.ground = null, e.minMap = null, e.fabricDraw = null, e.modelLink3d = null, e.label = null, e.annotation3d = null, e.calibration = null, e.linkElement2d3d = null, e.linkView2d3d = null, e.rangeScale = null, e.text = null, e.issueReport = null, e.modelEdge = null, e.modelTree = null, e.modelProperties = null, e.modelMapperBatch = null, e.engineInfo = null, e.ai = null, e.oneClickEncoding = null, e.drawingPin = null, e.events = null, console.log("[BimEngine] Engine disposal completed");
|
|
50432
|
+
e.scene = null, e.camera = null, e.renderer = null, e.controls = null, e.models = [], e.container = null, e.catchSvg = null, e.stats = null, e.versionEl = null, e.worldToScreen = null, e.measure = null, e.clipping = null, e.interactionModule = null, e.controlModule = null, e.sceneModule = null, e.cameraModule = null, e.deviceModule = null, e.renderModule = null, e.composerModule = null, e.loaderModule = null, e.lightModule = null, e.engineStatus = null, e.hoverHighLight = null, e.pathRoaming = null, e.hdr = null, e.skyManager = null, e.viewCube = null, e.grid = null, e.level = null, e.ground = null, e.minMap = null, e.fabricDraw = null, e.modelLink3d = null, e.label = null, e.annotation3d = null, e.calibration = null, e.linkElement2d3d = null, e.linkView2d3d = null, e.rangeScale = null, e.text = null, e.issueReport = null, e.modelEdge = null, e.modelTree = null, e.modelProperties = null, e.search = null, e.modelMapperBatch = null, e.engineInfo = null, e.ai = null, e.oneClickEncoding = null, e.drawingPin = null, e.events = null, console.log("[BimEngine] Engine disposal completed");
|
|
50165
50433
|
}
|
|
50166
50434
|
/**
|
|
50167
50435
|
* 递归清理场景中的所有对象
|
|
@@ -50170,7 +50438,7 @@ class ET {
|
|
|
50170
50438
|
if (!e) return;
|
|
50171
50439
|
[...e.children].forEach((n) => {
|
|
50172
50440
|
this.clearScene(n);
|
|
50173
|
-
}), e.parent && e.parent.remove(e), e instanceof nt && !(e instanceof
|
|
50441
|
+
}), e.parent && e.parent.remove(e), e instanceof nt && !(e instanceof vt) && (e.geometry && e.geometry.dispose(), e.material && (Array.isArray(e.material) ? e.material.forEach((n) => this.disposeMaterial(n)) : this.disposeMaterial(e.material))), e instanceof Mo && (e.geometry && e.geometry.dispose(), e.material && this.disposeMaterial(e.material)), e instanceof tx && (e.geometry && e.geometry.dispose(), e.material && this.disposeMaterial(e.material)), e instanceof vt && (e.geometry && e.geometry.dispose(), e.material && (Array.isArray(e.material) ? e.material.forEach((n) => this.disposeMaterial(n)) : this.disposeMaterial(e.material)), e.instanceMatrix && (e.instanceMatrix = null), e.instanceColor && (e.instanceColor = null)), e instanceof ka && e.material && this.disposeMaterial(e.material), e instanceof nx && e.shadow?.dispose?.();
|
|
50174
50442
|
}
|
|
50175
50443
|
/**
|
|
50176
50444
|
* 清理材质及其纹理
|
|
@@ -50225,5 +50493,5 @@ class ET {
|
|
|
50225
50493
|
}
|
|
50226
50494
|
}
|
|
50227
50495
|
export {
|
|
50228
|
-
|
|
50496
|
+
TT as EngineKernelV2
|
|
50229
50497
|
};
|