@xtctwins/tctwins-bimx-engine 0.3.11 → 0.3.13

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.
Files changed (61) hide show
  1. package/README.md +1 -1
  2. package/dist/{AnnotationTool-BnLd0s38.mjs → AnnotationTool-k3W4xmw6.mjs} +13 -14
  3. package/dist/BIMX_Viewer_Lib.es.js +5 -5
  4. package/dist/BIMX_Viewer_Lib.umd.js +184 -164
  5. package/dist/{CameraViewTool-BGmwAori.mjs → CameraViewTool-CuXnJa74.mjs} +15 -15
  6. package/dist/{CommentTool-B9TgO52t.mjs → CommentTool-CUtaZc7Y.mjs} +276 -277
  7. package/dist/{HiddenTool-CNMJqZzC.mjs → HiddenTool-CzJ19mP1.mjs} +9 -10
  8. package/dist/{InspectorTool-CiyN_aCB.mjs → InspectorTool-BTH82K8b.mjs} +3 -3
  9. package/dist/MeasureTool-BvPkIvmX.mjs +593 -0
  10. package/dist/{MouseTool-B07SstRZ.mjs → MouseTool-CiywjpW3.mjs} +6 -6
  11. package/dist/{NavigateTool-B8qIl9xy.mjs → NavigateTool-CDlYpMXl.mjs} +13 -14
  12. package/dist/OperateTool-NMIYz2YN.mjs +185 -0
  13. package/dist/{RoamTool-3sDI1Ouu.mjs → RoamTool-BkwJBBAg.mjs} +1 -1
  14. package/dist/{ScreenShotTool-CjsT2-Va.mjs → ScreenShotTool-BP-xDRKf.mjs} +16 -17
  15. package/dist/SectionTool-mt4iqa1I.mjs +241 -0
  16. package/dist/SettingTool-DieHq4VO.mjs +1745 -0
  17. package/dist/{StructureTree-B183vT5b.mjs → StructureTree-C8C435JY.mjs} +5 -6
  18. package/dist/{alert-DN7oOiZl.mjs → alert-B9Uw8l52.mjs} +18 -13
  19. package/dist/{index-DfRswjrC.mjs → index-B_IMYBaJ.mjs} +59333 -53195
  20. package/dist/{panel.vue_vue_type_style_index_0_lang-DOsptET6.mjs → panel.vue_vue_type_style_index_0_lang-BswWCo8x.mjs} +1 -1
  21. package/dist/style.css +1 -1
  22. package/dist/{tallPanel-D0Zgkc3n.mjs → tallPanel-CnTIaRU-.mjs} +1 -1
  23. package/package.json +5 -5
  24. package/types/components/BimViewerComponents/OperateTool.vue.d.ts +12 -0
  25. package/types/components/BimViewerComponents/SectionModeBar.vue.d.ts +2 -0
  26. package/types/components/BimxViewerComp.vue.d.ts +2 -0
  27. package/types/components/utilsComponents/alert.vue.d.ts +9 -0
  28. package/types/i18n/index.d.ts +212 -0
  29. package/types/i18n/locales/en-US.d.ts +53 -0
  30. package/types/i18n/locales/zh-CN.d.ts +53 -0
  31. package/types/pages/BimxViewerEntry.vue.d.ts +3 -0
  32. package/types/store/const.d.ts +12 -0
  33. package/types/store/toolbars.d.ts +53 -1
  34. package/types/utils/OSSHelper.d.ts +2 -0
  35. package/types/utils/eventBus.d.ts +6 -1
  36. package/types/viewerManager/load/loadModel.d.ts +88 -0
  37. package/types/viewerManager/sectionManager.d.ts +524 -0
  38. package/types/viewerManager/viewerManager.d.ts +7 -1
  39. package/dist/AnnotationTool-Bp8DGFFA.mjs +0 -167
  40. package/dist/CameraViewTool-BwVnc0ua.mjs +0 -164
  41. package/dist/CommentTool-C7NLPxMd.mjs +0 -1529
  42. package/dist/HiddenTool-i1AESn4-.mjs +0 -57
  43. package/dist/InspectorTool-D4gr7uiQ.mjs +0 -679
  44. package/dist/MeasureTool-BNBUx-1X.mjs +0 -323
  45. package/dist/MeasureTool-Cxnp9MVY.mjs +0 -323
  46. package/dist/MouseTool-DVqNDADf.mjs +0 -84
  47. package/dist/NavigateTool-DKTSPVCL.mjs +0 -52
  48. package/dist/RoamTool-CazuxheL.mjs +0 -287
  49. package/dist/ScreenShotTool-fYVxpPrW.mjs +0 -430
  50. package/dist/SectionTool-Bpk5jewK.mjs +0 -331
  51. package/dist/SectionTool-DMSGkjYm.mjs +0 -331
  52. package/dist/SettingTool-BuSm2JB6.mjs +0 -695
  53. package/dist/SettingTool-IBRpWdfo.mjs +0 -695
  54. package/dist/StructureTree-D9z28tm4.mjs +0 -1686
  55. package/dist/alert-DwTFq4bp.mjs +0 -47
  56. package/dist/const-DOnRsYpZ.mjs +0 -389
  57. package/dist/el-slider-C9_q447A.mjs +0 -1059
  58. package/dist/el-slider-dslleM3g.mjs +0 -1059
  59. package/dist/index-BzB8rqmg.mjs +0 -131961
  60. package/dist/panel.vue_vue_type_style_index_0_lang-E8w23EhV.mjs +0 -61
  61. package/dist/tallPanel-Dp1ZbCTR.mjs +0 -84
@@ -1,323 +0,0 @@
1
- import { F as De, G as Re, T as ae, I as ne, H as f, P as w, J as Ce, W as Le, X as $e, K as Pe, Y as ue, M as ze } from "./index-DfRswjrC.mjs";
2
- import { _ as Ne } from "./panel.vue_vue_type_style_index_0_lang-E8w23EhV.mjs";
3
- import { defineComponent as Ue, ref as n, onMounted as ie, onBeforeUnmount as Xe, watch as Ye, openBlock as i, createElementBlock as c, Fragment as E, unref as t, createBlock as Fe, withCtx as U, createElementVNode as s, renderList as X, normalizeClass as ce, toDisplayString as o, createVNode as T, createCommentVNode as He, normalizeStyle as re, withDirectives as Oe, vShow as We } from "vue";
4
- import { M as Y } from "./const-DOnRsYpZ.mjs";
5
- const Je = {
6
- key: 0,
7
- class: "measure_panel_content"
8
- }, Ke = { class: "measurement_type" }, je = ["onClick"], qe = ["src"], Qe = {
9
- key: 0,
10
- class: "measurement_data"
11
- }, Ze = { class: "data_box" }, Ge = { style: { color: "#0065fc" } }, es = { class: "data_box" }, ss = { style: { color: "#fe4444" } }, ts = { class: "data_box" }, ls = { style: { color: "#4ed17a" } }, os = { class: "data_box" }, as = { style: { color: "#ffce19" } }, ns = {
12
- key: 1,
13
- class: "measurement_data"
14
- }, us = { class: "data_box" }, is = { style: { color: "#0065fc" } }, cs = { class: "footer" }, rs = {
15
- key: 1,
16
- class: "setMeasurePanel"
17
- }, vs = { class: "set_content_par" }, ds = { class: "set_content_" }, ms = {
18
- class: "set_content scale",
19
- style: { display: "none" }
20
- }, _s = { class: "set_content unit" }, hs = { class: "set_content precision" }, ps = { class: "footer" }, gs = {
21
- key: 1,
22
- class: "mobile_measure_panel"
23
- }, fs = { class: "measure-list" }, ys = ["onClick"], bs = { class: "measure-icon" }, Ms = ["src"], ws = { class: "measure-name" }, Ts = { class: "measure-icon" }, ks = ["src"], Vs = {
24
- class: "measure-name",
25
- style: { color: "#df1c1c" }
26
- }, xs = { class: "mouse_btn" }, Is = ["src"], As = ["src"], Bs = ["src"], Es = /* @__PURE__ */ Ue({
27
- __name: "MeasureTool",
28
- props: ["componentId"],
29
- emits: ["closePanel", "emitHandler"],
30
- setup(ve, { emit: de }) {
31
- const a = De(), S = Re(), me = ve, F = n(0);
32
- ie(() => {
33
- S.setReadyById(me.componentId), ae.currentTheme == "blue" ? F.value = 224 : ae.currentTheme == "light-gray" && (F.value = 202);
34
- });
35
- let r, k, D, _;
36
- const v = n(1), R = n(), h = n(), V = n(), y = n(), H = n(), J = n(), K = n(), j = n(), x = n(1), I = n("m"), b = n(3), A = n(!1), _e = [{ value: "m" }, { value: "cm" }, { value: "mm" }], d = n(!1), he = [
37
- { label: "0", value: 0 },
38
- { label: "0.0", value: 1 },
39
- { label: "0.00", value: 2 },
40
- { label: "0.000", value: 3 }
41
- ], q = de, Q = (e) => {
42
- q("emitHandler", e);
43
- }, Z = () => {
44
- D = window.bimViewer, ue.SaveViewerState({ measure: "distance" }), k = window.bimViewer.measureAngleTool, r = window.bimViewer.measureDistanceTool, _ = window.bimViewer.eventTrigger, f("isMobile") && (_.on("newAngleMeasure", (e) => {
45
- d.value = !1;
46
- }), _.on("newDistanceMeasure", (e) => {
47
- d.value = !1;
48
- })), _.on("createAngleMeasure", (e) => {
49
- H.value = e.id, y.value = e.result, f("isMobile") && (d.value = !0), m("createAngleMeasure", { newMeasure: e });
50
- }), _.on("createDistanceMeasure", (e) => {
51
- R.value = e.id, V.value = e.id, h.value = e.result, J.value = e.xResult ? e.xResult : 0, K.value = e.yResult ? e.yResult : 0, j.value = e.zResult ? e.zResult : 0, f("isMobile") && (d.value = !0), m("createAngleMeasure", { newMeasure: e });
52
- }), _.on("clickDistanceMeasure", (e) => {
53
- v.value == 2 && C(Y[0]), R.value = e.id, Te(e.id), f("isMobile") && (d.value = !0), m("clickDistanceMeasure", { id: e.id });
54
- }), _.on("clickAngleMeasure", (e) => {
55
- v.value == 1 && C(Y[1]), Me(e.id), f("isMobile") && (d.value = !0), m("clickAngleMeasure", { id: e.id });
56
- }), r.precision = b.value, r.unit = I.value, r.scale = x.value;
57
- };
58
- ne.on("BimViewer", Z), Xe(() => {
59
- ne.off("BimViewer", Z);
60
- }), Ye(
61
- () => S.isToolActive(3),
62
- (e) => {
63
- Ve(e);
64
- }
65
- );
66
- const m = (e, u) => {
67
- Q({
68
- isTool: !0,
69
- event_name: e,
70
- event_target: "MeasureTool",
71
- content: u
72
- });
73
- }, pe = () => {
74
- window.bimViewer.measureTool.setActive(!1), q("closePanel"), A.value === !0 && L();
75
- }, C = (e) => {
76
- v.value !== e.id && (v.value = e.id, ue.SaveViewerState({ measure: e.code }), ge(e), f("isMobile") && (d.value = !1));
77
- }, ge = (e) => {
78
- let u = e.code;
79
- window.bimViewer.measureTool.setActiveByType(u, !0), Q({
80
- isTool: !0,
81
- event_name: "",
82
- event_target: "MeasureTool",
83
- content: {
84
- measureTool: u
85
- }
86
- });
87
- }, fe = () => {
88
- h.value = "", y.value = "", r.clear(), k.clear(), m("destroyAllMeasure", { msg: "删除全部测量" }), d.value = !1;
89
- }, ye = () => {
90
- h.value = "", y.value = "", v.value === 1 ? (ke(V.value), m("destroyMeasureDistance", { id: V.value })) : v.value === 2 && (we(H.value), m("destroyMeasurementAngle", { id: V.value })), d.value = !1;
91
- }, L = () => {
92
- A.value = !A.value;
93
- }, be = () => {
94
- L(), r.precision = b.value, r.unit = I.value, r.scale = x.value, R.value && (h.value = r.getMeasureResultByID(R.value)), m("updateMeasureSet", {
95
- measurePrefer: {
96
- distance_precision: b.value,
97
- distance_unit: I.value,
98
- distance_scale: x.value
99
- }
100
- });
101
- }, Me = (e) => {
102
- H.value = e, y.value = k.getMeasureResultByID(e);
103
- }, we = (e) => k.destroyMeasurementById(e), Te = (e) => {
104
- V.value = e, h.value = r.getMeasureResultByID(e);
105
- }, ke = (e) => r.destroyMeasurementById(e), Ve = (e) => {
106
- r.setAllVisible(e), k.setAllVisible(e);
107
- };
108
- ie(() => {
109
- document.getElementById("top_bar");
110
- });
111
- const M = n(!1);
112
- let $ = !1, P = 0, z = 0, O = 0, W = 0;
113
- const p = n(290), g = n(300), xe = () => {
114
- M.value = !M.value, M.value ? Ie() : Ae();
115
- }, G = (e) => {
116
- $ ? D.measureTool.currentTool.onSimulateMousedown([p.value, g.value]) : e.touches.length == 1 && (P = e.touches[0].clientX, z = e.touches[0].clientY, $ = !0);
117
- }, ee = (e) => {
118
- if (e.touches.length == 1) {
119
- const u = e.touches[0].clientX, N = e.touches[0].clientY;
120
- O = u - P, W = N - z, p.value += O, g.value += W;
121
- let B = new Int16Array(2);
122
- B[0] = p.value + 5, B[1] = g.value + 6, P = u, z = N, D.measureTool.currentTool.onSimulateMousemove([p.value, g.value]);
123
- }
124
- }, se = (e) => {
125
- $ && D.measureTool.currentTool.onSimulateMouseup([p.value, g.value]);
126
- }, Ie = () => {
127
- const e = document.getElementById("measure_mouseGroup");
128
- e == null || e.addEventListener("touchstart", G), e == null || e.addEventListener("touchmove", ee), e == null || e.addEventListener("touchend", se), p.value = 290, g.value = 300, P = 0, z = 0, O = 0, W = 0, $ = !1;
129
- }, Ae = () => {
130
- const e = document.getElementById("measure_mouseGroup");
131
- e == null || e.removeEventListener("touchstart", G), e == null || e.removeEventListener("touchmove", ee), e == null || e.removeEventListener("touchend", se);
132
- };
133
- return (e, u) => {
134
- var le, oe;
135
- const N = Ce, B = $e, te = Le, Be = Ne, Ee = Pe;
136
- return i(), c(E, null, [
137
- t(f)("isMobile") ? (i(), c("div", gs, [
138
- T(Ee, null, {
139
- default: U(() => [
140
- s("div", fs, [
141
- (i(!0), c(E, null, X(t(Y), (l) => (i(), c("div", {
142
- key: l.id,
143
- class: ce(["measure-item", {
144
- "measure-item-active": v.value === l.id
145
- }]),
146
- onClick: (Se) => C(l)
147
- }, [
148
- s("div", bs, [
149
- s("img", {
150
- src: t(w) + `/bim-viewer/measure-bar/bimkk-mobile-measure-${v.value === l.id ? l.svgActive : l.svg}.svg`,
151
- alt: ""
152
- }, null, 8, Ms),
153
- s("div", ws, o(t(a)(l.label || l.name)), 1)
154
- ])
155
- ], 10, ys))), 128)),
156
- d.value ? (i(), c("div", {
157
- key: 0,
158
- class: "measure-item",
159
- onClick: ye
160
- }, [
161
- s("div", Ts, [
162
- s("img", {
163
- src: t(w) + "/bim-viewer/delete.svg",
164
- alt: ""
165
- }, null, 8, ks),
166
- s("div", Vs, o(t(a)("common.delete")), 1)
167
- ])
168
- ])) : He("", !0)
169
- ])
170
- ]),
171
- _: 1
172
- }),
173
- s("div", xs, [
174
- s("div", {
175
- class: "mouse",
176
- onClick: xe
177
- }, [
178
- s("img", {
179
- src: `${t(w)}/industry-viewer/action-bar/${M.value ? (le = t(S).getToolById(16)) == null ? void 0 : le.imgActive : (oe = t(S).getToolById(16)) == null ? void 0 : oe.img}.svg`
180
- }, null, 8, Is),
181
- s("span", {
182
- style: re({ color: M.value ? "#1457F7" : "#262626" })
183
- }, o(t(a)("toolbar.virtualMouse")), 5)
184
- ])
185
- ])
186
- ])) : (i(), Fe(Be, {
187
- key: 0,
188
- class: "measure_panel",
189
- width: F.value,
190
- panelTitle: A.value ? t(a)("measure.settings") : t(a)("measure.title"),
191
- "click-handle": pe
192
- }, {
193
- default: U(() => [
194
- A.value ? (i(), c("div", rs, [
195
- s("div", vs, [
196
- s("div", ds, [
197
- s("div", ms, [
198
- s("span", null, o(t(a)("measure.scaleLabel")), 1),
199
- u[3] || (u[3] = s("span", null, "1:", -1)),
200
- T(N, {
201
- modelValue: x.value,
202
- "onUpdate:modelValue": u[0] || (u[0] = (l) => x.value = l),
203
- style: { width: "122px", height: "28px" },
204
- placeholder: "1"
205
- }, null, 8, ["modelValue"])
206
- ]),
207
- s("div", _s, [
208
- s("span", null, o(t(a)("measure.unitLabel")), 1),
209
- T(te, {
210
- modelValue: I.value,
211
- "onUpdate:modelValue": u[1] || (u[1] = (l) => I.value = l),
212
- placeholder: t(a)("measure.unitPlaceholder"),
213
- style: { width: "136px", height: "28px" }
214
- }, {
215
- default: U(() => [
216
- (i(), c(E, null, X(_e, (l) => T(B, {
217
- key: l.value,
218
- value: l.value
219
- }, null, 8, ["value"])), 64))
220
- ]),
221
- _: 1
222
- }, 8, ["modelValue", "placeholder"])
223
- ]),
224
- s("div", hs, [
225
- s("span", null, o(t(a)("measure.precisionLabel")), 1),
226
- T(te, {
227
- modelValue: b.value,
228
- "onUpdate:modelValue": u[2] || (u[2] = (l) => b.value = l),
229
- placeholder: t(a)("measure.precisionPlaceholder"),
230
- style: { width: "136px", height: "28px" }
231
- }, {
232
- default: U(() => [
233
- (i(), c(E, null, X(he, (l) => T(B, {
234
- key: l.value,
235
- label: l.label,
236
- value: l.value
237
- }, null, 8, ["label", "value"])), 64))
238
- ]),
239
- _: 1
240
- }, 8, ["modelValue", "placeholder"])
241
- ])
242
- ])
243
- ]),
244
- s("div", ps, [
245
- s("div", {
246
- class: "measure_footer_button measure_footer_button_cancel",
247
- onClick: L
248
- }, o(t(a)("common.cancel")), 1),
249
- s("div", {
250
- class: "measure_footer_button measure_footer_button_save",
251
- onClick: be
252
- }, o(t(a)("common.save")), 1)
253
- ])
254
- ])) : (i(), c("div", Je, [
255
- s("div", Ke, [
256
- (i(!0), c(E, null, X(t(Y), (l) => (i(), c("div", {
257
- key: l.id,
258
- class: ce(["measurement_box", { measurement_box_active: v.value === l.id }]),
259
- onClick: (Se) => C(l)
260
- }, [
261
- s("img", {
262
- class: "measurement_img",
263
- src: t(w) + `/bim-viewer/action-bars/${v.value === l.id ? l.imgActive : l.img}.svg`,
264
- alt: ""
265
- }, null, 8, qe)
266
- ], 10, je))), 128))
267
- ]),
268
- v.value == 1 ? (i(), c("div", Qe, [
269
- s("div", Ze, [
270
- s("div", null, o(t(a)("measure.totalLength")), 1),
271
- s("div", Ge, o(h.value ? h.value.toFixed(b.value) : "~"), 1)
272
- ]),
273
- s("div", es, [
274
- s("div", null, o(t(a)("measure.x")), 1),
275
- s("div", ss, o(J.value), 1)
276
- ]),
277
- s("div", ts, [
278
- s("div", null, o(t(a)("measure.y")), 1),
279
- s("div", ls, o(K.value), 1)
280
- ]),
281
- s("div", os, [
282
- s("div", null, o(t(a)("measure.z")), 1),
283
- s("div", as, o(j.value), 1)
284
- ])
285
- ])) : (i(), c("div", ns, [
286
- s("div", us, [
287
- s("div", null, o(t(a)("measure.angleLabel")), 1),
288
- s("div", is, o(y.value ? y.value.toFixed(2) + "°" : "~"), 1)
289
- ])
290
- ])),
291
- s("div", cs, [
292
- s("span", { onClick: fe }, o(t(a)("measure.clearAll")), 1),
293
- s("span", { onClick: L }, o(t(a)("setting.title")), 1)
294
- ])
295
- ]))
296
- ]),
297
- _: 1
298
- }, 8, ["width", "panelTitle"])),
299
- Oe(s("div", {
300
- id: "measure_mouseGroup",
301
- class: "mouse_group",
302
- style: re({ left: `${p.value}px`, top: `${g.value}px` })
303
- }, [
304
- s("img", {
305
- id: "mouse_icon",
306
- class: "mouse_icon",
307
- src: `${t(w)}/industry-viewer/mouse-icon.svg`
308
- }, null, 8, As),
309
- s("img", {
310
- id: "mouse_img",
311
- class: "mouse_img",
312
- src: `${t(w)}/industry-viewer/mouse-active-large.svg`
313
- }, null, 8, Bs)
314
- ], 4), [
315
- [We, M.value]
316
- ])
317
- ], 64);
318
- };
319
- }
320
- }), Ls = /* @__PURE__ */ ze(Es, [["__scopeId", "data-v-fcef3ec9"]]);
321
- export {
322
- Ls as default
323
- };
@@ -1,323 +0,0 @@
1
- import { F as De, G as Re, T as ae, I as ne, H as f, P as w, J as Ce, W as Le, X as $e, K as Pe, Y as ue, M as ze } from "./index-BzB8rqmg.mjs";
2
- import { _ as Ne } from "./panel.vue_vue_type_style_index_0_lang-DOsptET6.mjs";
3
- import { defineComponent as Ue, ref as n, onMounted as ie, onBeforeUnmount as Xe, watch as Ye, openBlock as i, createElementBlock as c, Fragment as E, unref as t, createBlock as Fe, withCtx as U, createElementVNode as s, renderList as X, normalizeClass as ce, toDisplayString as o, createVNode as T, createCommentVNode as He, normalizeStyle as re, withDirectives as Oe, vShow as We } from "vue";
4
- import { M as Y } from "./const-DOnRsYpZ.mjs";
5
- const Je = {
6
- key: 0,
7
- class: "measure_panel_content"
8
- }, Ke = { class: "measurement_type" }, je = ["onClick"], qe = ["src"], Qe = {
9
- key: 0,
10
- class: "measurement_data"
11
- }, Ze = { class: "data_box" }, Ge = { style: { color: "#0065fc" } }, es = { class: "data_box" }, ss = { style: { color: "#fe4444" } }, ts = { class: "data_box" }, ls = { style: { color: "#4ed17a" } }, os = { class: "data_box" }, as = { style: { color: "#ffce19" } }, ns = {
12
- key: 1,
13
- class: "measurement_data"
14
- }, us = { class: "data_box" }, is = { style: { color: "#0065fc" } }, cs = { class: "footer" }, rs = {
15
- key: 1,
16
- class: "setMeasurePanel"
17
- }, vs = { class: "set_content_par" }, ds = { class: "set_content_" }, ms = {
18
- class: "set_content scale",
19
- style: { display: "none" }
20
- }, _s = { class: "set_content unit" }, hs = { class: "set_content precision" }, ps = { class: "footer" }, gs = {
21
- key: 1,
22
- class: "mobile_measure_panel"
23
- }, fs = { class: "measure-list" }, ys = ["onClick"], bs = { class: "measure-icon" }, Ms = ["src"], ws = { class: "measure-name" }, Ts = { class: "measure-icon" }, ks = ["src"], Vs = {
24
- class: "measure-name",
25
- style: { color: "#df1c1c" }
26
- }, xs = { class: "mouse_btn" }, Is = ["src"], As = ["src"], Bs = ["src"], Es = /* @__PURE__ */ Ue({
27
- __name: "MeasureTool",
28
- props: ["componentId"],
29
- emits: ["closePanel", "emitHandler"],
30
- setup(ve, { emit: de }) {
31
- const a = De(), S = Re(), me = ve, F = n(0);
32
- ie(() => {
33
- S.setReadyById(me.componentId), ae.currentTheme == "blue" ? F.value = 224 : ae.currentTheme == "light-gray" && (F.value = 202);
34
- });
35
- let r, k, D, _;
36
- const v = n(1), R = n(), h = n(), V = n(), y = n(), H = n(), J = n(), K = n(), j = n(), x = n(1), I = n("m"), b = n(3), A = n(!1), _e = [{ value: "m" }, { value: "cm" }, { value: "mm" }], d = n(!1), he = [
37
- { label: "0", value: 0 },
38
- { label: "0.0", value: 1 },
39
- { label: "0.00", value: 2 },
40
- { label: "0.000", value: 3 }
41
- ], q = de, Q = (e) => {
42
- q("emitHandler", e);
43
- }, Z = () => {
44
- D = window.bimViewer, ue.SaveViewerState({ measure: "distance" }), k = window.bimViewer.measureAngleTool, r = window.bimViewer.measureDistanceTool, _ = window.bimViewer.eventTrigger, f("isMobile") && (_.on("newAngleMeasure", (e) => {
45
- d.value = !1;
46
- }), _.on("newDistanceMeasure", (e) => {
47
- d.value = !1;
48
- })), _.on("createAngleMeasure", (e) => {
49
- H.value = e.id, y.value = e.result, f("isMobile") && (d.value = !0), m("createAngleMeasure", { newMeasure: e });
50
- }), _.on("createDistanceMeasure", (e) => {
51
- R.value = e.id, V.value = e.id, h.value = e.result, J.value = e.xResult ? e.xResult : 0, K.value = e.yResult ? e.yResult : 0, j.value = e.zResult ? e.zResult : 0, f("isMobile") && (d.value = !0), m("createAngleMeasure", { newMeasure: e });
52
- }), _.on("clickDistanceMeasure", (e) => {
53
- v.value == 2 && C(Y[0]), R.value = e.id, Te(e.id), f("isMobile") && (d.value = !0), m("clickDistanceMeasure", { id: e.id });
54
- }), _.on("clickAngleMeasure", (e) => {
55
- v.value == 1 && C(Y[1]), Me(e.id), f("isMobile") && (d.value = !0), m("clickAngleMeasure", { id: e.id });
56
- }), r.precision = b.value, r.unit = I.value, r.scale = x.value;
57
- };
58
- ne.on("BimViewer", Z), Xe(() => {
59
- ne.off("BimViewer", Z);
60
- }), Ye(
61
- () => S.isToolActive(3),
62
- (e) => {
63
- Ve(e);
64
- }
65
- );
66
- const m = (e, u) => {
67
- Q({
68
- isTool: !0,
69
- event_name: e,
70
- event_target: "MeasureTool",
71
- content: u
72
- });
73
- }, pe = () => {
74
- window.bimViewer.measureTool.setActive(!1), q("closePanel"), A.value === !0 && L();
75
- }, C = (e) => {
76
- v.value !== e.id && (v.value = e.id, ue.SaveViewerState({ measure: e.code }), ge(e), f("isMobile") && (d.value = !1));
77
- }, ge = (e) => {
78
- let u = e.code;
79
- window.bimViewer.measureTool.setActiveByType(u, !0), Q({
80
- isTool: !0,
81
- event_name: "",
82
- event_target: "MeasureTool",
83
- content: {
84
- measureTool: u
85
- }
86
- });
87
- }, fe = () => {
88
- h.value = "", y.value = "", r.clear(), k.clear(), m("destroyAllMeasure", { msg: "删除全部测量" }), d.value = !1;
89
- }, ye = () => {
90
- h.value = "", y.value = "", v.value === 1 ? (ke(V.value), m("destroyMeasureDistance", { id: V.value })) : v.value === 2 && (we(H.value), m("destroyMeasurementAngle", { id: V.value })), d.value = !1;
91
- }, L = () => {
92
- A.value = !A.value;
93
- }, be = () => {
94
- L(), r.precision = b.value, r.unit = I.value, r.scale = x.value, R.value && (h.value = r.getMeasureResultByID(R.value)), m("updateMeasureSet", {
95
- measurePrefer: {
96
- distance_precision: b.value,
97
- distance_unit: I.value,
98
- distance_scale: x.value
99
- }
100
- });
101
- }, Me = (e) => {
102
- H.value = e, y.value = k.getMeasureResultByID(e);
103
- }, we = (e) => k.destroyMeasurementById(e), Te = (e) => {
104
- V.value = e, h.value = r.getMeasureResultByID(e);
105
- }, ke = (e) => r.destroyMeasurementById(e), Ve = (e) => {
106
- r.setAllVisible(e), k.setAllVisible(e);
107
- };
108
- ie(() => {
109
- document.getElementById("top_bar");
110
- });
111
- const M = n(!1);
112
- let $ = !1, P = 0, z = 0, O = 0, W = 0;
113
- const p = n(290), g = n(300), xe = () => {
114
- M.value = !M.value, M.value ? Ie() : Ae();
115
- }, G = (e) => {
116
- $ ? D.measureTool.currentTool.onSimulateMousedown([p.value, g.value]) : e.touches.length == 1 && (P = e.touches[0].clientX, z = e.touches[0].clientY, $ = !0);
117
- }, ee = (e) => {
118
- if (e.touches.length == 1) {
119
- const u = e.touches[0].clientX, N = e.touches[0].clientY;
120
- O = u - P, W = N - z, p.value += O, g.value += W;
121
- let B = new Int16Array(2);
122
- B[0] = p.value + 5, B[1] = g.value + 6, P = u, z = N, D.measureTool.currentTool.onSimulateMousemove([p.value, g.value]);
123
- }
124
- }, se = (e) => {
125
- $ && D.measureTool.currentTool.onSimulateMouseup([p.value, g.value]);
126
- }, Ie = () => {
127
- const e = document.getElementById("measure_mouseGroup");
128
- e == null || e.addEventListener("touchstart", G), e == null || e.addEventListener("touchmove", ee), e == null || e.addEventListener("touchend", se), p.value = 290, g.value = 300, P = 0, z = 0, O = 0, W = 0, $ = !1;
129
- }, Ae = () => {
130
- const e = document.getElementById("measure_mouseGroup");
131
- e == null || e.removeEventListener("touchstart", G), e == null || e.removeEventListener("touchmove", ee), e == null || e.removeEventListener("touchend", se);
132
- };
133
- return (e, u) => {
134
- var le, oe;
135
- const N = Ce, B = $e, te = Le, Be = Ne, Ee = Pe;
136
- return i(), c(E, null, [
137
- t(f)("isMobile") ? (i(), c("div", gs, [
138
- T(Ee, null, {
139
- default: U(() => [
140
- s("div", fs, [
141
- (i(!0), c(E, null, X(t(Y), (l) => (i(), c("div", {
142
- key: l.id,
143
- class: ce(["measure-item", {
144
- "measure-item-active": v.value === l.id
145
- }]),
146
- onClick: (Se) => C(l)
147
- }, [
148
- s("div", bs, [
149
- s("img", {
150
- src: t(w) + `/bim-viewer/measure-bar/bimkk-mobile-measure-${v.value === l.id ? l.svgActive : l.svg}.svg`,
151
- alt: ""
152
- }, null, 8, Ms),
153
- s("div", ws, o(t(a)(l.label || l.name)), 1)
154
- ])
155
- ], 10, ys))), 128)),
156
- d.value ? (i(), c("div", {
157
- key: 0,
158
- class: "measure-item",
159
- onClick: ye
160
- }, [
161
- s("div", Ts, [
162
- s("img", {
163
- src: t(w) + "/bim-viewer/delete.svg",
164
- alt: ""
165
- }, null, 8, ks),
166
- s("div", Vs, o(t(a)("common.delete")), 1)
167
- ])
168
- ])) : He("", !0)
169
- ])
170
- ]),
171
- _: 1
172
- }),
173
- s("div", xs, [
174
- s("div", {
175
- class: "mouse",
176
- onClick: xe
177
- }, [
178
- s("img", {
179
- src: `${t(w)}/industry-viewer/action-bar/${M.value ? (le = t(S).getToolById(16)) == null ? void 0 : le.imgActive : (oe = t(S).getToolById(16)) == null ? void 0 : oe.img}.svg`
180
- }, null, 8, Is),
181
- s("span", {
182
- style: re({ color: M.value ? "#1457F7" : "#262626" })
183
- }, o(t(a)("toolbar.virtualMouse")), 5)
184
- ])
185
- ])
186
- ])) : (i(), Fe(Be, {
187
- key: 0,
188
- class: "measure_panel",
189
- width: F.value,
190
- panelTitle: A.value ? t(a)("measure.settings") : t(a)("measure.title"),
191
- "click-handle": pe
192
- }, {
193
- default: U(() => [
194
- A.value ? (i(), c("div", rs, [
195
- s("div", vs, [
196
- s("div", ds, [
197
- s("div", ms, [
198
- s("span", null, o(t(a)("measure.scaleLabel")), 1),
199
- u[3] || (u[3] = s("span", null, "1:", -1)),
200
- T(N, {
201
- modelValue: x.value,
202
- "onUpdate:modelValue": u[0] || (u[0] = (l) => x.value = l),
203
- style: { width: "122px", height: "28px" },
204
- placeholder: "1"
205
- }, null, 8, ["modelValue"])
206
- ]),
207
- s("div", _s, [
208
- s("span", null, o(t(a)("measure.unitLabel")), 1),
209
- T(te, {
210
- modelValue: I.value,
211
- "onUpdate:modelValue": u[1] || (u[1] = (l) => I.value = l),
212
- placeholder: t(a)("measure.unitPlaceholder"),
213
- style: { width: "136px", height: "28px" }
214
- }, {
215
- default: U(() => [
216
- (i(), c(E, null, X(_e, (l) => T(B, {
217
- key: l.value,
218
- value: l.value
219
- }, null, 8, ["value"])), 64))
220
- ]),
221
- _: 1
222
- }, 8, ["modelValue", "placeholder"])
223
- ]),
224
- s("div", hs, [
225
- s("span", null, o(t(a)("measure.precisionLabel")), 1),
226
- T(te, {
227
- modelValue: b.value,
228
- "onUpdate:modelValue": u[2] || (u[2] = (l) => b.value = l),
229
- placeholder: t(a)("measure.precisionPlaceholder"),
230
- style: { width: "136px", height: "28px" }
231
- }, {
232
- default: U(() => [
233
- (i(), c(E, null, X(he, (l) => T(B, {
234
- key: l.value,
235
- label: l.label,
236
- value: l.value
237
- }, null, 8, ["label", "value"])), 64))
238
- ]),
239
- _: 1
240
- }, 8, ["modelValue", "placeholder"])
241
- ])
242
- ])
243
- ]),
244
- s("div", ps, [
245
- s("div", {
246
- class: "measure_footer_button measure_footer_button_cancel",
247
- onClick: L
248
- }, o(t(a)("common.cancel")), 1),
249
- s("div", {
250
- class: "measure_footer_button measure_footer_button_save",
251
- onClick: be
252
- }, o(t(a)("common.save")), 1)
253
- ])
254
- ])) : (i(), c("div", Je, [
255
- s("div", Ke, [
256
- (i(!0), c(E, null, X(t(Y), (l) => (i(), c("div", {
257
- key: l.id,
258
- class: ce(["measurement_box", { measurement_box_active: v.value === l.id }]),
259
- onClick: (Se) => C(l)
260
- }, [
261
- s("img", {
262
- class: "measurement_img",
263
- src: t(w) + `/bim-viewer/action-bars/${v.value === l.id ? l.imgActive : l.img}.svg`,
264
- alt: ""
265
- }, null, 8, qe)
266
- ], 10, je))), 128))
267
- ]),
268
- v.value == 1 ? (i(), c("div", Qe, [
269
- s("div", Ze, [
270
- s("div", null, o(t(a)("measure.totalLength")), 1),
271
- s("div", Ge, o(h.value ? h.value.toFixed(b.value) : "~"), 1)
272
- ]),
273
- s("div", es, [
274
- s("div", null, o(t(a)("measure.x")), 1),
275
- s("div", ss, o(J.value), 1)
276
- ]),
277
- s("div", ts, [
278
- s("div", null, o(t(a)("measure.y")), 1),
279
- s("div", ls, o(K.value), 1)
280
- ]),
281
- s("div", os, [
282
- s("div", null, o(t(a)("measure.z")), 1),
283
- s("div", as, o(j.value), 1)
284
- ])
285
- ])) : (i(), c("div", ns, [
286
- s("div", us, [
287
- s("div", null, o(t(a)("measure.angleLabel")), 1),
288
- s("div", is, o(y.value ? y.value.toFixed(2) + "°" : "~"), 1)
289
- ])
290
- ])),
291
- s("div", cs, [
292
- s("span", { onClick: fe }, o(t(a)("measure.clearAll")), 1),
293
- s("span", { onClick: L }, o(t(a)("setting.title")), 1)
294
- ])
295
- ]))
296
- ]),
297
- _: 1
298
- }, 8, ["width", "panelTitle"])),
299
- Oe(s("div", {
300
- id: "measure_mouseGroup",
301
- class: "mouse_group",
302
- style: re({ left: `${p.value}px`, top: `${g.value}px` })
303
- }, [
304
- s("img", {
305
- id: "mouse_icon",
306
- class: "mouse_icon",
307
- src: `${t(w)}/industry-viewer/mouse-icon.svg`
308
- }, null, 8, As),
309
- s("img", {
310
- id: "mouse_img",
311
- class: "mouse_img",
312
- src: `${t(w)}/industry-viewer/mouse-active-large.svg`
313
- }, null, 8, Bs)
314
- ], 4), [
315
- [We, M.value]
316
- ])
317
- ], 64);
318
- };
319
- }
320
- }), Ls = /* @__PURE__ */ ze(Es, [["__scopeId", "data-v-fcef3ec9"]]);
321
- export {
322
- Ls as default
323
- };