build-dxf 0.0.20-11 → 0.0.20-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.
package/src/index3.js
CHANGED
|
@@ -1,32 +1,32 @@
|
|
|
1
1
|
import * as m from "three";
|
|
2
|
-
import { i as dt, n as lt, r as
|
|
3
|
-
import { C as ye, L as ne, P as A, B as We, E as Ue, b as
|
|
2
|
+
import { i as dt, n as lt, r as qe, t as $e, c as Le, d as ct, e as mt, f as De, g as B, _ as He, u as ht, h as me, j as Pe, w as ut, k as pt, l as vt, p as ft, m as gt, o as yt, T as Ie, q as Se, s as wt, v as bt, x as Ne, y as Ee, z as Ce, A as xt, B as Ct, L as he, D as Mt, b as Oe, E as pe, S as Et } from "./selectLocalFile.js";
|
|
3
|
+
import { C as ye, L as ne, P as A, B as We, E as Ue, b as Re, Q as ze, W as Lt } from "./build.js";
|
|
4
4
|
import "clipper-lib";
|
|
5
5
|
import "dxf-writer";
|
|
6
6
|
import "three/addons/controls/OrbitControls.js";
|
|
7
|
-
import { watch as V, ref as
|
|
7
|
+
import { watch as V, ref as E, defineComponent as oe, computed as D, createElementBlock as S, openBlock as M, normalizeClass as O, unref as v, renderSlot as fe, createVNode as z, Transition as ge, withCtx as F, withDirectives as Qe, createElementVNode as x, normalizeStyle as _e, createTextVNode as le, toDisplayString as J, vShow as Ye, shallowReactive as Dt, onMounted as Ze, createBlock as de, createCommentVNode as q, resolveDynamicComponent as _t, Fragment as ce, withModifiers as kt, nextTick as ve, isVNode as Xe, render as Be, toRaw as Pt, onUnmounted as It, renderList as Me, createStaticVNode as St, TransitionGroup as Nt, createApp as Ot } from "vue";
|
|
8
8
|
function Je(r) {
|
|
9
9
|
var e;
|
|
10
|
-
const t =
|
|
10
|
+
const t = qe(r);
|
|
11
11
|
return (e = t?.$el) != null ? e : t;
|
|
12
12
|
}
|
|
13
13
|
const et = Le ? window : void 0;
|
|
14
|
-
function
|
|
14
|
+
function Rt(...r) {
|
|
15
15
|
let e, t, n, o;
|
|
16
16
|
if (dt(r[0]) || Array.isArray(r[0]) ? ([t, n, o] = r, e = et) : [e, t, n, o] = r, !e)
|
|
17
17
|
return lt;
|
|
18
18
|
Array.isArray(t) || (t = [t]), Array.isArray(n) || (n = [n]);
|
|
19
19
|
const s = [], a = () => {
|
|
20
20
|
s.forEach((c) => c()), s.length = 0;
|
|
21
|
-
}, i = (c, h,
|
|
22
|
-
a(), c && s.push(...t.flatMap((
|
|
21
|
+
}, i = (c, h, f, g) => (c.addEventListener(h, f, g), () => c.removeEventListener(h, f, g)), d = V(() => [Je(e), qe(o)], ([c, h]) => {
|
|
22
|
+
a(), c && s.push(...t.flatMap((f) => n.map((g) => i(c, f, g, h))));
|
|
23
23
|
}, { immediate: !0, flush: "post" }), l = () => {
|
|
24
24
|
d(), a();
|
|
25
25
|
};
|
|
26
|
-
return
|
|
26
|
+
return $e(l), l;
|
|
27
27
|
}
|
|
28
28
|
function zt(r, e = !1) {
|
|
29
|
-
const t =
|
|
29
|
+
const t = E(), n = () => t.value = !!r();
|
|
30
30
|
return n(), ct(n, e), t;
|
|
31
31
|
}
|
|
32
32
|
const Fe = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}, Ke = "__vueuse_ssr_handlers__";
|
|
@@ -50,7 +50,7 @@ function Tt(r, e, t = {}) {
|
|
|
50
50
|
}, { immediate: !0, flush: "post" }), c = () => {
|
|
51
51
|
d(), l();
|
|
52
52
|
};
|
|
53
|
-
return
|
|
53
|
+
return $e(c), {
|
|
54
54
|
isSupported: i,
|
|
55
55
|
stop: c
|
|
56
56
|
};
|
|
@@ -67,7 +67,7 @@ var Vt = Object.defineProperty, Ae = Object.getOwnPropertySymbols, At = Object.p
|
|
|
67
67
|
jt.call(e, t) && je(r, t, e[t]);
|
|
68
68
|
return r;
|
|
69
69
|
};
|
|
70
|
-
const
|
|
70
|
+
const qt = {
|
|
71
71
|
easeInSine: [0.12, 0, 0.39, 0],
|
|
72
72
|
easeOutSine: [0.61, 1, 0.88, 1],
|
|
73
73
|
easeInOutSine: [0.37, 0, 0.63, 1],
|
|
@@ -95,10 +95,10 @@ const $t = {
|
|
|
95
95
|
};
|
|
96
96
|
Gt({
|
|
97
97
|
linear: mt
|
|
98
|
-
},
|
|
99
|
-
const
|
|
98
|
+
}, qt);
|
|
99
|
+
const $t = (r) => r, Ht = {
|
|
100
100
|
esc: "Escape"
|
|
101
|
-
}, Wt =
|
|
101
|
+
}, Wt = De({
|
|
102
102
|
value: {
|
|
103
103
|
type: [String, Number],
|
|
104
104
|
default: ""
|
|
@@ -135,7 +135,7 @@ const Ht = (r) => r, qt = {
|
|
|
135
135
|
...Ut,
|
|
136
136
|
props: Wt,
|
|
137
137
|
setup(r, { expose: e }) {
|
|
138
|
-
const t = r, n = ht("badge"), o =
|
|
138
|
+
const t = r, n = ht("badge"), o = D(() => t.isDot ? "" : me(t.value) && me(t.max) ? t.max < t.value ? `${t.max}+` : `${t.value}` : `${t.value}`), s = D(() => {
|
|
139
139
|
var a, i, d, l, c;
|
|
140
140
|
return [
|
|
141
141
|
{
|
|
@@ -148,31 +148,31 @@ const Ht = (r) => r, qt = {
|
|
|
148
148
|
});
|
|
149
149
|
return e({
|
|
150
150
|
content: o
|
|
151
|
-
}), (a, i) => (
|
|
152
|
-
class:
|
|
151
|
+
}), (a, i) => (M(), S("div", {
|
|
152
|
+
class: O(v(n).b())
|
|
153
153
|
}, [
|
|
154
|
-
|
|
155
|
-
z(
|
|
156
|
-
name: `${
|
|
154
|
+
fe(a.$slots, "default"),
|
|
155
|
+
z(ge, {
|
|
156
|
+
name: `${v(n).namespace.value}-zoom-in-center`,
|
|
157
157
|
persisted: ""
|
|
158
158
|
}, {
|
|
159
159
|
default: F(() => [
|
|
160
160
|
Qe(x("sup", {
|
|
161
|
-
class:
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
161
|
+
class: O([
|
|
162
|
+
v(n).e("content"),
|
|
163
|
+
v(n).em("content", a.type),
|
|
164
|
+
v(n).is("fixed", !!a.$slots.default),
|
|
165
|
+
v(n).is("dot", a.isDot),
|
|
166
|
+
v(n).is("hide-zero", !a.showZero && t.value === 0),
|
|
167
167
|
a.badgeClass
|
|
168
168
|
]),
|
|
169
|
-
style:
|
|
169
|
+
style: _e(v(s))
|
|
170
170
|
}, [
|
|
171
|
-
|
|
172
|
-
le(J(
|
|
171
|
+
fe(a.$slots, "content", { value: v(o) }, () => [
|
|
172
|
+
le(J(v(o)), 1)
|
|
173
173
|
])
|
|
174
174
|
], 6), [
|
|
175
|
-
[Ye, !a.hidden && (
|
|
175
|
+
[Ye, !a.hidden && (v(o) || a.isDot || a.$slots.content)]
|
|
176
176
|
])
|
|
177
177
|
]),
|
|
178
178
|
_: 3
|
|
@@ -180,8 +180,8 @@ const Ht = (r) => r, qt = {
|
|
|
180
180
|
], 2));
|
|
181
181
|
}
|
|
182
182
|
});
|
|
183
|
-
var Yt = /* @__PURE__ */
|
|
184
|
-
const Zt = ut(Yt), Xt =
|
|
183
|
+
var Yt = /* @__PURE__ */ He(Qt, [["__file", "badge.vue"]]);
|
|
184
|
+
const Zt = ut(Yt), Xt = De({
|
|
185
185
|
a11y: {
|
|
186
186
|
type: Boolean,
|
|
187
187
|
default: !0
|
|
@@ -223,11 +223,11 @@ oe({
|
|
|
223
223
|
name: "ElConfigProvider",
|
|
224
224
|
props: Xt,
|
|
225
225
|
setup(r, { slots: e }) {
|
|
226
|
-
const t =
|
|
226
|
+
const t = ft(r);
|
|
227
227
|
return V(() => r.message, (n) => {
|
|
228
228
|
var o, s;
|
|
229
229
|
Object.assign(N, (s = (o = t?.value) == null ? void 0 : o.message) != null ? s : {}, n ?? {});
|
|
230
|
-
}, { immediate: !0, deep: !0 }), () =>
|
|
230
|
+
}, { immediate: !0, deep: !0 }), () => fe(e, "default", { config: t?.value });
|
|
231
231
|
}
|
|
232
232
|
});
|
|
233
233
|
const tt = [
|
|
@@ -236,7 +236,7 @@ const tt = [
|
|
|
236
236
|
"info",
|
|
237
237
|
"warning",
|
|
238
238
|
"error"
|
|
239
|
-
], I =
|
|
239
|
+
], I = $t({
|
|
240
240
|
customClass: "",
|
|
241
241
|
dangerouslyUseHTMLString: !1,
|
|
242
242
|
duration: 3e3,
|
|
@@ -252,7 +252,7 @@ const tt = [
|
|
|
252
252
|
grouping: !1,
|
|
253
253
|
repeatNum: 1,
|
|
254
254
|
appendTo: Le ? document.body : void 0
|
|
255
|
-
}), Jt =
|
|
255
|
+
}), Jt = De({
|
|
256
256
|
customClass: {
|
|
257
257
|
type: String,
|
|
258
258
|
default: I.customClass
|
|
@@ -266,7 +266,7 @@ const tt = [
|
|
|
266
266
|
default: I.duration
|
|
267
267
|
},
|
|
268
268
|
icon: {
|
|
269
|
-
type:
|
|
269
|
+
type: gt,
|
|
270
270
|
default: I.icon
|
|
271
271
|
},
|
|
272
272
|
id: {
|
|
@@ -316,7 +316,7 @@ const tt = [
|
|
|
316
316
|
}
|
|
317
317
|
}), en = {
|
|
318
318
|
destroy: () => !0
|
|
319
|
-
}, K =
|
|
319
|
+
}, K = Dt([]), tn = (r) => {
|
|
320
320
|
const e = K.findIndex((o) => o.id === r), t = K[e];
|
|
321
321
|
let n;
|
|
322
322
|
return e > 0 && (n = K[e - 1]), { current: t, prev: n };
|
|
@@ -330,103 +330,103 @@ const tt = [
|
|
|
330
330
|
props: Jt,
|
|
331
331
|
emits: en,
|
|
332
332
|
setup(r, { expose: e, emit: t }) {
|
|
333
|
-
const n = r, { Close: o } = wt, s =
|
|
333
|
+
const n = r, { Close: o } = wt, s = E(!1), { ns: a, zIndex: i } = yt("message"), { currentZIndex: d, nextZIndex: l } = i, c = E(), h = E(!1), f = E(0);
|
|
334
334
|
let g;
|
|
335
|
-
const
|
|
336
|
-
const
|
|
337
|
-
return { [a.bm("icon",
|
|
338
|
-
}), P =
|
|
335
|
+
const C = D(() => n.type ? n.type === "error" ? "danger" : n.type : "info"), b = D(() => {
|
|
336
|
+
const w = n.type;
|
|
337
|
+
return { [a.bm("icon", w)]: w && Ie[w] };
|
|
338
|
+
}), P = D(() => n.icon || Ie[n.type] || ""), _ = D(() => nn(n.id)), j = D(() => on(n.id, n.offset) + _.value), se = D(() => f.value + j.value), ue = D(() => ({
|
|
339
339
|
top: `${j.value}px`,
|
|
340
340
|
zIndex: d.value
|
|
341
341
|
}));
|
|
342
342
|
function X() {
|
|
343
343
|
n.duration !== 0 && ({ stop: g } = bt(() => {
|
|
344
|
-
|
|
344
|
+
L();
|
|
345
345
|
}, n.duration));
|
|
346
346
|
}
|
|
347
|
-
function
|
|
347
|
+
function R() {
|
|
348
348
|
g?.();
|
|
349
349
|
}
|
|
350
|
-
function
|
|
350
|
+
function L() {
|
|
351
351
|
h.value = !1, ve(() => {
|
|
352
|
-
var
|
|
353
|
-
s.value || ((
|
|
352
|
+
var w;
|
|
353
|
+
s.value || ((w = n.onClose) == null || w.call(n), t("destroy"));
|
|
354
354
|
});
|
|
355
355
|
}
|
|
356
|
-
function
|
|
357
|
-
|
|
356
|
+
function $({ code: w }) {
|
|
357
|
+
w === Ht.esc && L();
|
|
358
358
|
}
|
|
359
359
|
return Ze(() => {
|
|
360
360
|
X(), l(), h.value = !0;
|
|
361
361
|
}), V(() => n.repeatNum, () => {
|
|
362
|
-
|
|
363
|
-
}),
|
|
364
|
-
|
|
362
|
+
R(), X();
|
|
363
|
+
}), Rt(document, "keydown", $), Tt(c, () => {
|
|
364
|
+
f.value = c.value.getBoundingClientRect().height;
|
|
365
365
|
}), e({
|
|
366
366
|
visible: h,
|
|
367
367
|
bottom: se,
|
|
368
|
-
close:
|
|
369
|
-
}), (
|
|
370
|
-
name:
|
|
368
|
+
close: L
|
|
369
|
+
}), (w, we) => (M(), de(ge, {
|
|
370
|
+
name: v(a).b("fade"),
|
|
371
371
|
onBeforeEnter: (ae) => s.value = !0,
|
|
372
|
-
onBeforeLeave:
|
|
373
|
-
onAfterLeave: (ae) =>
|
|
372
|
+
onBeforeLeave: w.onClose,
|
|
373
|
+
onAfterLeave: (ae) => w.$emit("destroy"),
|
|
374
374
|
persisted: ""
|
|
375
375
|
}, {
|
|
376
376
|
default: F(() => [
|
|
377
377
|
Qe(x("div", {
|
|
378
|
-
id:
|
|
378
|
+
id: w.id,
|
|
379
379
|
ref_key: "messageRef",
|
|
380
380
|
ref: c,
|
|
381
|
-
class:
|
|
382
|
-
|
|
383
|
-
{ [
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
381
|
+
class: O([
|
|
382
|
+
v(a).b(),
|
|
383
|
+
{ [v(a).m(w.type)]: w.type },
|
|
384
|
+
v(a).is("closable", w.showClose),
|
|
385
|
+
v(a).is("plain", w.plain),
|
|
386
|
+
w.customClass
|
|
387
387
|
]),
|
|
388
|
-
style:
|
|
388
|
+
style: _e(v(ue)),
|
|
389
389
|
role: "alert",
|
|
390
|
-
onMouseenter:
|
|
390
|
+
onMouseenter: R,
|
|
391
391
|
onMouseleave: X
|
|
392
392
|
}, [
|
|
393
|
-
|
|
393
|
+
w.repeatNum > 1 ? (M(), de(v(Zt), {
|
|
394
394
|
key: 0,
|
|
395
|
-
value:
|
|
396
|
-
type:
|
|
397
|
-
class:
|
|
398
|
-
}, null, 8, ["value", "type", "class"])) :
|
|
399
|
-
|
|
395
|
+
value: w.repeatNum,
|
|
396
|
+
type: v(C),
|
|
397
|
+
class: O(v(a).e("badge"))
|
|
398
|
+
}, null, 8, ["value", "type", "class"])) : q("v-if", !0),
|
|
399
|
+
v(P) ? (M(), de(v(Se), {
|
|
400
400
|
key: 1,
|
|
401
|
-
class:
|
|
401
|
+
class: O([v(a).e("icon"), v(b)])
|
|
402
402
|
}, {
|
|
403
403
|
default: F(() => [
|
|
404
|
-
(
|
|
404
|
+
(M(), de(_t(v(P))))
|
|
405
405
|
]),
|
|
406
406
|
_: 1
|
|
407
|
-
}, 8, ["class"])) :
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
407
|
+
}, 8, ["class"])) : q("v-if", !0),
|
|
408
|
+
fe(w.$slots, "default", {}, () => [
|
|
409
|
+
w.dangerouslyUseHTMLString ? (M(), S(ce, { key: 1 }, [
|
|
410
|
+
q(" Caution here, message could've been compromised, never use user's input as message "),
|
|
411
411
|
x("p", {
|
|
412
|
-
class:
|
|
413
|
-
innerHTML:
|
|
412
|
+
class: O(v(a).e("content")),
|
|
413
|
+
innerHTML: w.message
|
|
414
414
|
}, null, 10, ["innerHTML"])
|
|
415
|
-
], 2112)) : (
|
|
415
|
+
], 2112)) : (M(), S("p", {
|
|
416
416
|
key: 0,
|
|
417
|
-
class:
|
|
418
|
-
}, J(
|
|
417
|
+
class: O(v(a).e("content"))
|
|
418
|
+
}, J(w.message), 3))
|
|
419
419
|
]),
|
|
420
|
-
|
|
420
|
+
w.showClose ? (M(), de(v(Se), {
|
|
421
421
|
key: 2,
|
|
422
|
-
class:
|
|
423
|
-
onClick: kt(
|
|
422
|
+
class: O(v(a).e("closeBtn")),
|
|
423
|
+
onClick: kt(L, ["stop"])
|
|
424
424
|
}, {
|
|
425
425
|
default: F(() => [
|
|
426
|
-
z(
|
|
426
|
+
z(v(o))
|
|
427
427
|
]),
|
|
428
428
|
_: 1
|
|
429
|
-
}, 8, ["class", "onClick"])) :
|
|
429
|
+
}, 8, ["class", "onClick"])) : q("v-if", !0)
|
|
430
430
|
], 46, ["id"]), [
|
|
431
431
|
[Ye, h.value]
|
|
432
432
|
])
|
|
@@ -435,7 +435,7 @@ const tt = [
|
|
|
435
435
|
}, 8, ["name", "onBeforeEnter", "onBeforeLeave", "onAfterLeave"]));
|
|
436
436
|
}
|
|
437
437
|
});
|
|
438
|
-
var rn = /* @__PURE__ */
|
|
438
|
+
var rn = /* @__PURE__ */ He(an, [["__file", "message.vue"]]);
|
|
439
439
|
let dn = 1;
|
|
440
440
|
const nt = (r) => {
|
|
441
441
|
const e = !r || Ne(r) || Xe(r) || Ee(r) ? { message: r } : r, t = {
|
|
@@ -514,7 +514,7 @@ function mn(r) {
|
|
|
514
514
|
}
|
|
515
515
|
te.closeAll = mn;
|
|
516
516
|
te._context = null;
|
|
517
|
-
const
|
|
517
|
+
const k = Ct(te, "$message");
|
|
518
518
|
class T extends ye {
|
|
519
519
|
_renderer;
|
|
520
520
|
get renderer() {
|
|
@@ -633,11 +633,11 @@ class hn extends T {
|
|
|
633
633
|
this.addEventRecord(
|
|
634
634
|
"clear",
|
|
635
635
|
t.addEventListener("pointerPositionChange", () => {
|
|
636
|
-
const { point:
|
|
637
|
-
if (this.dispatchEvent({ type: "pointerMove", point:
|
|
636
|
+
const { point: f, find: g } = t.renderManager.adsorption();
|
|
637
|
+
if (this.dispatchEvent({ type: "pointerMove", point: f }), g ? (a.position.set(f.x, f.y, 0), this.container.add(a), i.style.cursor = "none") : (a.removeFromParent(), i.style.cursor = "crosshair"), h.copy(f), !!(n && o)) {
|
|
638
638
|
if (t.eventInput.isKeyDown("shift")) {
|
|
639
|
-
const
|
|
640
|
-
|
|
639
|
+
const C = Math.abs(t.pointerPosition.x - n.x), b = Math.abs(t.pointerPosition.y - n.y);
|
|
640
|
+
C > b ? o.set(t.pointerPosition.x, n.y, 0) : o.set(n.x, t.pointerPosition.y, 0), c(), h.copy(o);
|
|
641
641
|
return;
|
|
642
642
|
}
|
|
643
643
|
o.set(t.pointerPosition.x, t.pointerPosition.y, 0), c();
|
|
@@ -652,8 +652,8 @@ class hn extends T {
|
|
|
652
652
|
o = h.clone(), s.push(n.clone(), o.clone()), n.copy(o), c();
|
|
653
653
|
} else if (t.eventInput.isOnlyKeyDowns(this.withdrawalKeys)) {
|
|
654
654
|
if (s.length) {
|
|
655
|
-
const { point:
|
|
656
|
-
s.pop(), o?.copy(
|
|
655
|
+
const { point: f } = t.renderManager.adsorption();
|
|
656
|
+
s.pop(), o?.copy(f), n?.copy(s.pop()), c();
|
|
657
657
|
}
|
|
658
658
|
} else t.eventInput.isKeyDowns(this.confirmKeys) && e(s);
|
|
659
659
|
}),
|
|
@@ -749,7 +749,7 @@ class ke extends ye {
|
|
|
749
749
|
start() {
|
|
750
750
|
const e = this.editor, t = e.eventInput, n = new m.Mesh(), o = e.domContainer.domElement;
|
|
751
751
|
let s = null;
|
|
752
|
-
n.position.z =
|
|
752
|
+
n.position.z = 1e-3, this.selectLineObject3D.position.z = n.position.z + 1e-3, n.material = new m.MeshBasicMaterial({ color: 55561 });
|
|
753
753
|
const a = () => {
|
|
754
754
|
const i = e.pointerPosition.clone(), d = e.pointerPosition.clone(), l = new m.Mesh();
|
|
755
755
|
this.container.add(l), l.position.z = 0.05, l.material = new m.MeshBasicMaterial({
|
|
@@ -758,14 +758,14 @@ class ke extends ye {
|
|
|
758
758
|
opacity: 0.5
|
|
759
759
|
});
|
|
760
760
|
const c = () => {
|
|
761
|
-
const g = Math.min(i.x, d.x),
|
|
761
|
+
const g = Math.min(i.x, d.x), C = Math.max(i.x, d.x), b = Math.min(i.y, d.y), P = Math.max(i.y, d.y), _ = [
|
|
762
762
|
g,
|
|
763
763
|
P,
|
|
764
764
|
0,
|
|
765
|
-
|
|
765
|
+
C,
|
|
766
766
|
b,
|
|
767
767
|
0,
|
|
768
|
-
|
|
768
|
+
C,
|
|
769
769
|
P,
|
|
770
770
|
0,
|
|
771
771
|
g,
|
|
@@ -774,27 +774,27 @@ class ke extends ye {
|
|
|
774
774
|
g,
|
|
775
775
|
b,
|
|
776
776
|
0,
|
|
777
|
-
|
|
777
|
+
C,
|
|
778
778
|
b,
|
|
779
779
|
0
|
|
780
780
|
];
|
|
781
781
|
l.geometry = e.renderManager.createGeometry({ position: _ }, _.length / 3);
|
|
782
782
|
}, h = () => {
|
|
783
783
|
d.copy(e.pointerPosition), c();
|
|
784
|
-
},
|
|
785
|
-
document.removeEventListener("mousemove", h), document.removeEventListener("mouseup",
|
|
786
|
-
const g = Math.min(i.x, d.x),
|
|
784
|
+
}, f = () => {
|
|
785
|
+
document.removeEventListener("mousemove", h), document.removeEventListener("mouseup", f), l.removeFromParent();
|
|
786
|
+
const g = Math.min(i.x, d.x), C = Math.max(i.x, d.x), b = Math.min(i.y, d.y), P = Math.max(i.y, d.y), _ = new We(g, C, b, P), j = e.renderManager.quadtree.queryBox(_);
|
|
787
787
|
this.removeSelectLineAll(), j.forEach((se) => this.addSelectLine(se.line)), this.updateSelectLinesGeometry();
|
|
788
788
|
};
|
|
789
|
-
document.addEventListener("mousemove", h), document.addEventListener("mouseup",
|
|
789
|
+
document.addEventListener("mousemove", h), document.addEventListener("mouseup", f);
|
|
790
790
|
};
|
|
791
791
|
this.addEventRecord(
|
|
792
792
|
"clear",
|
|
793
793
|
// 注册鼠标指针位置变化事件
|
|
794
794
|
e.addEventListener("pointerPositionChange", () => {
|
|
795
|
-
const { line: i } = e.renderManager.adsorption(0.
|
|
795
|
+
const { line: i } = e.renderManager.adsorption(0.02);
|
|
796
796
|
if (i) {
|
|
797
|
-
const d = i.expandToRectangle(0.
|
|
797
|
+
const d = i.expandToRectangle(0.025, "bothSides");
|
|
798
798
|
n.geometry = e.renderManager.createGeometry({ position: d.createGeometry() }, 6), this.container.add(n), o.style.cursor = "pointer", s = i;
|
|
799
799
|
} else
|
|
800
800
|
n.removeFromParent(), o.style.cursor = "default", s = null;
|
|
@@ -823,6 +823,8 @@ class un extends Ue {
|
|
|
823
823
|
list = [];
|
|
824
824
|
rollbacklist = [];
|
|
825
825
|
revokeRollbacklist = [];
|
|
826
|
+
// 是否写入操作记录
|
|
827
|
+
writeOperationList = !0;
|
|
826
828
|
/**
|
|
827
829
|
*
|
|
828
830
|
* @param operation
|
|
@@ -907,7 +909,7 @@ class pn extends Ue {
|
|
|
907
909
|
} catch (s) {
|
|
908
910
|
console.error(s);
|
|
909
911
|
} finally {
|
|
910
|
-
this.abortController && !this.abortController.signal.aborted && (o.dispatchEvent({ type: "completed", data: t }), this.dispatchEvent({ type: "completed", name: e, data: t }), this.operationList.push({ name: e, data: t }), this.rollbackList.length = 0), this.lock = !1, this.abortController = null, this.currentName = null, o.dispatchEvent({ type: "finally" }), this.dispatchEvent({ type: "finally", name: e }), this.executionResolve && (this.executionResolve(null), this.executionResolve = null);
|
|
912
|
+
this.abortController && !this.abortController.signal.aborted && (o.dispatchEvent({ type: "completed", data: t }), this.dispatchEvent({ type: "completed", name: e, data: t }), o.writeOperationList && (this.operationList.push({ name: e, data: t }), this.rollbackList.length = 0)), this.lock = !1, this.abortController = null, this.currentName = null, o.dispatchEvent({ type: "finally" }), this.dispatchEvent({ type: "finally", name: e }), this.executionResolve && (this.executionResolve(null), this.executionResolve = null);
|
|
911
913
|
}
|
|
912
914
|
return t;
|
|
913
915
|
}
|
|
@@ -950,12 +952,12 @@ class pn extends Ue {
|
|
|
950
952
|
}
|
|
951
953
|
}
|
|
952
954
|
}
|
|
953
|
-
const vn = "data:image/svg+xml,%3csvg%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20fill='%23555'%20width='16'%20height='16'%3e%3cpath%20d='M639.999191%20893.597594c-0.999994-54.699654-36.39977-101.099361-85.39946-118.399252-6.39996-2.199986-10.599933-8.299948-10.599933-14.999905V263.801573c0-6.699958%204.199973-12.799919%2010.599933-14.999905%2049.09969-17.299891%2084.399467-63.599598%2085.39946-118.399252C641.299183%2059.902862%20583.399549%200.503237%20512.899994%200.00324%20441.800444-0.496757%20384.000809%2057.00288%20384.000809%20128.002431c0%2055.699648%2035.599775%20103.099349%2085.299461%20120.699238%206.39996%202.299985%2010.699932%208.299948%2010.699932%2015.099904v496.396864c0%206.799957-4.299973%2012.799919-10.699932%2015.099904-49.699686%2017.599889-85.299461%2064.999589-85.299461%20120.699238%200%2070.999551%2057.799635%20128.499188%20128.899185%20127.999191%2070.499555-0.499997%20128.399189-59.899622%20127.099197-130.399176zM448.000404%20128.002431c0-35.299777%2028.699819-63.999596%2063.999596-63.999595s63.999596%2028.699819%2063.999596%2063.999595-28.699819%2063.999596-63.999596%2063.999596-63.999596-28.699819-63.999596-63.999596z%20m0%20767.995148c0-35.299777%2028.699819-63.999596%2063.999596-63.999596s63.999596%2028.699819%2063.999596%2063.999596-28.699819%2063.999596-63.999596%2063.999595-63.999596-28.699819-63.999596-63.999595z'%3e%3c/path%3e%3c/svg%3e",
|
|
955
|
+
const vn = "data:image/svg+xml,%3csvg%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20fill='%23555'%20width='16'%20height='16'%3e%3cpath%20d='M639.999191%20893.597594c-0.999994-54.699654-36.39977-101.099361-85.39946-118.399252-6.39996-2.199986-10.599933-8.299948-10.599933-14.999905V263.801573c0-6.699958%204.199973-12.799919%2010.599933-14.999905%2049.09969-17.299891%2084.399467-63.599598%2085.39946-118.399252C641.299183%2059.902862%20583.399549%200.503237%20512.899994%200.00324%20441.800444-0.496757%20384.000809%2057.00288%20384.000809%20128.002431c0%2055.699648%2035.599775%20103.099349%2085.299461%20120.699238%206.39996%202.299985%2010.699932%208.299948%2010.699932%2015.099904v496.396864c0%206.799957-4.299973%2012.799919-10.699932%2015.099904-49.699686%2017.599889-85.299461%2064.999589-85.299461%20120.699238%200%2070.999551%2057.799635%20128.499188%20128.899185%20127.999191%2070.499555-0.499997%20128.399189-59.899622%20127.099197-130.399176zM448.000404%20128.002431c0-35.299777%2028.699819-63.999596%2063.999596-63.999595s63.999596%2028.699819%2063.999596%2063.999595-28.699819%2063.999596-63.999596%2063.999596-63.999596-28.699819-63.999596-63.999596z%20m0%20767.995148c0-35.299777%2028.699819-63.999596%2063.999596-63.999596s63.999596%2028.699819%2063.999596%2063.999596-28.699819%2063.999596-63.999596%2063.999595-63.999596-28.699819-63.999596-63.999595z'%3e%3c/path%3e%3c/svg%3e", fn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
954
956
|
__proto__: null,
|
|
955
957
|
default: vn
|
|
956
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
958
|
+
}, Symbol.toStringTag, { value: "Module" })), gn = "data:image/svg+xml,%3csvg%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20fill='%23555'%20width='16'%20height='16'%3e%3cpath%20d='M909.050991%20169.476903l-217.554898%200%200-31.346939c0-39.5866-32.205493-71.792093-71.793116-71.792093L408.15591%2066.337871c-39.5866%200-71.792093%2032.205493-71.792093%2071.792093l0%2031.346939L113.349581%20169.476903c-11.013845%200-19.942191%208.940626-19.942191%2019.954471s8.928347%2019.954471%2019.942191%2019.954471l84.264149%200%200%20640.687918c0%2060.479443%2049.203632%20109.683075%20109.683075%20109.683075l416.474366%200c60.479443%200%20109.683075-49.203632%20109.683075-109.683075L833.454246%20209.385844l75.595722%200c11.012821%200%2019.942191-8.940626%2019.942191-19.954471S920.063813%20169.476903%20909.050991%20169.476903zM376.2482%20138.130987c0-17.593703%2014.314007-31.907711%2031.907711-31.907711l211.547067%200c17.593703%200%2031.907711%2014.314007%2031.907711%2031.907711l0%2031.346939L376.2482%20169.477926%20376.2482%20138.130987zM793.569864%20850.074785c0%2038.486546-31.312146%2069.798692-69.798692%2069.798692L307.297828%20919.873478c-38.486546%200-69.798692-31.312146-69.798692-69.798692L237.499136%20211.042577l556.070728%200L793.569864%20850.074785zM510.662539%20861.276918c11.012821%200%2019.954471-8.92937%2019.954471-19.942191L530.61701%20294.912753c0-11.013845-8.94165-19.942191-19.954471-19.942191s-19.954471%208.928347-19.954471%2019.942191L490.708068%20841.334727C490.708068%20852.347548%20499.649717%20861.276918%20510.662539%20861.276918zM374.562814%20801.449321c11.012821%200%2019.954471-8.92937%2019.954471-19.942191L394.517285%20354.74035c0-11.013845-8.94165-19.942191-19.954471-19.942191s-19.954471%208.928347-19.954471%2019.942191l0%20426.76678C354.608344%20792.519951%20363.549993%20801.449321%20374.562814%20801.449321zM649.832182%20801.449321c11.012821%200%2019.954471-8.92937%2019.954471-19.942191L669.786653%20354.74035c0-11.013845-8.94165-19.942191-19.954471-19.942191s-19.954471%208.928347-19.954471%2019.942191l0%20426.76678C629.877711%20792.519951%20638.81936%20801.449321%20649.832182%20801.449321z'%20%3e%3c/path%3e%3c/svg%3e", yn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
957
959
|
__proto__: null,
|
|
958
|
-
default:
|
|
960
|
+
default: gn
|
|
959
961
|
}, Symbol.toStringTag, { value: "Module" })), wn = "data:image/svg+xml,%3csvg%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20fill='%23555'%20width='16'%20height='16'%3e%3cpath%20d='M220.451548%20913.518482V318.145854c0-27.62038%2022.505495-50.125874%2050.125875-50.125874H865.95005c27.62038%200%2050.125874%2022.505495%2050.125874%2050.125874v218.917083h59.332667V318.145854c0-60.355644-49.102897-109.458541-109.458541-109.458541h-39.896104v-99.228772C826.053946%2049.102897%20776.951049%200%20716.595405%200H121.222777C60.867133%200%2011.764236%2049.102897%2011.764236%20109.458541V705.854146c0%2060.355644%2049.102897%20109.458541%20109.458541%20109.458541h39.896104v99.228772c0%2060.355644%2049.102897%20109.458541%20109.458542%20109.458541h257.790209v-59.332667H269.554446c-26.597403-1.022977-49.102897-23.528472-49.102898-51.148851z%20m-59.332667-595.372628v436.811189h-39.896104c-27.62038%200-50.125874-22.505495-50.125874-50.125874V109.458541c0-27.62038%2022.505495-50.125874%2050.125874-50.125874H716.595405c27.62038%200%2050.125874%2022.505495%2050.125874%2050.125874v99.228772H269.554446c-59.332667%200-108.435564%2049.102897-108.435565%20109.458541z'%20%3e%3c/path%3e%3cpath%20d='M902.777223%20854.185814l98.205794-98.205794c15.344655-15.344655%2015.344655-40.919081%200-56.263736s-40.919081-15.344655-56.263736%200L846.513487%20797.922078%20747.284715%20699.716284c-15.344655-15.344655-40.919081-15.344655-56.263736%200s-15.344655%2040.919081%200%2056.263736l98.205794%2098.205794-98.205794%2098.205794c-15.344655%2015.344655-15.344655%2040.919081%200%2056.263737s40.919081%2015.344655%2056.263736%200l98.205794-98.205795%2098.205795%2098.205795c15.344655%2015.344655%2040.919081%2015.344655%2056.263736%200s15.344655-40.919081%200-56.263737l-97.182817-98.205794z'%20%3e%3c/path%3e%3c/svg%3e", bn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
960
962
|
__proto__: null,
|
|
961
963
|
default: wn
|
|
@@ -965,21 +967,21 @@ const vn = "data:image/svg+xml,%3csvg%20viewBox='0%200%201024%201024'%20version=
|
|
|
965
967
|
}, Symbol.toStringTag, { value: "Module" })), Mn = "data:image/svg+xml,%3csvg%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20fill='%23555'%20width='16'%20height='16'%3e%3cpath%20d='M491.80027198%20557.44938977c-10.0998647-15.14979706-20.19972802-25.24966037-35.34952507-35.34952507-15.14979706-10.0998647-30.29959271-15.14979706-50.49932211-15.14979704-55.54925309%200-100.99864286%2045.44938977-100.99864287%20100.99864285%200%2015.14979706%205.04993234%2035.34952507%2015.14979568%2050.49932212%2010.0998647%2015.14979706%2020.19972802%2030.29959271%2035.34952506%2035.34952508%2015.14979706%2010.0998647%2035.34952507%2015.14979706%2050.49932213%2015.14979567%2055.54925309%200%20100.99864286-45.44938977%20100.99864286-100.99864287%200-15.14979706-5.04993234-35.34952507-15.14979568-50.49932074z%20m-85.84884718%20100.99864286h-15.14979706c-20.19972802-5.04993234-30.29959271-20.19972802-35.34952507-35.34952507V612.99864286c0-30.29959271%2025.24966037-50.49932212%2050.49932213-50.49932074h10.09986469c15.14979706%205.04993234%2030.29959271%2015.14979706%2035.34952507%2035.34952507v15.14979567c5.04993234%2025.24966037-20.19972802%2045.44938977-45.44938976%2045.44938977z'%3e%3c/path%3e%3cpath%20d='M390.80162774%20658.44803263l-40.39945604%2040.39945743-227.24694747%20222.19701373-35.34952506-35.34952508%20227.24694745-227.24694608%2040.39945605-40.39945743c5.04993234%2020.19972802%2020.19972802%2035.34952507%2035.34952507%2040.39945743zM648.34816793%20405.9514248l-40.39945742%2040.3994574-116.14843853%20116.14843992-40.39945742%2035.34952507c-5.04993234-20.19972802-20.19972802-30.29959271-35.34952507-35.34952507l40.39945742-40.39945742%20116.14843853-111.09850756%2035.34952507-35.34952507c10.0998647%2015.14979706%2020.19972802%2025.24966037%2040.39945742%2030.29959273zM926.09443614%20133.25508894L749.34681078%20310.00271428l-40.3994574%2040.39945742c-5.04993234-20.19972802-15.14979706-35.34952507-30.29959272-40.39945742l35.34952506-40.39945742%20176.74762534-176.74762535%2035.34952508%2040.39945743z'%20%3e%3c/path%3e%3cpath%20d='M749.34681078%20310.00271428c-10.0998647-15.14979706-20.19972802-30.29959271-35.34952506-35.34952506-15.14979706-10.0998647-35.34952507-15.14979706-55.54925309-15.14979706-55.54925309%200-100.99864286%2045.44938977-100.99864286%20100.99864286%200%2020.19972802%205.04993234%2040.39945743%2015.14979567%2055.54925447%2010.0998647%2015.14979706%2020.19972802%2025.24966037%2035.34952507%2035.34952507%2015.14979706%2010.0998647%2030.29959271%2015.14979706%2050.49932212%2015.14979567%2055.54925309%200%20100.99864286-45.44938977%20100.99864286-100.99864286%200-25.24966037-5.04993234-40.39945743-10.09986471-55.54925309z%20m-90.89877815%2095.94871052h-10.0998647c-20.19972802-5.04993234-35.34952507-15.14979706-40.39945742-35.34952509%200-5.04993234-5.04993234-10.0998647-5.04993234-15.14979704%200-30.29959271%2025.24966037-50.49932212%2050.49932212-50.49932074%205.04993234%200%2010.0998647%200%2015.14979704%205.04993235%2015.14979706%205.04993234%2030.29959271%2020.19972802%2030.29959273%2040.39945742v10.09986332c10.0998647%2025.24966037-15.14979706%2045.44938977-40.39945743%2045.44938978z'%20%3e%3c/path%3e%3c/svg%3e", En = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
966
968
|
__proto__: null,
|
|
967
969
|
default: Mn
|
|
968
|
-
}, Symbol.toStringTag, { value: "Module" })), Ln = "data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg%20t='1757902422799'%20class='icon'%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20p-id='1735'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20width='200'%20height='200'%3e%3cpath%20d='M843.2%20726.4c-20.2%200-39.2%205.2-55.8%2014.3L283.8%20237.2c9-16.5%2014.1-35.4%2014.1-55.5%200-64.2-52.3-116.5-116.5-116.5S65%20117.4%2065%20181.6s52.3%20116.5%20116.5%20116.5c20.2%200%2039.2-5.2%2055.8-14.2l503.5%20503.5c-9%2016.5-14.1%2035.4-14.1%2055.5%200%2064.2%2052.3%20116.5%20116.5%20116.5s116.5-52.3%20116.5-116.5-52.3-116.5-116.5-116.5zM181.4%20232.1c-27.8%200-50.5-22.6-50.5-50.5s22.6-50.5%2050.5-50.5%2050.5%2022.6%2050.5%2050.5-22.6%2050.5-50.5%2050.5z%20m661.8%20661.3c-27.8%200-50.5-22.6-50.5-50.5%200-27.8%2022.6-50.5%2050.5-50.5s50.5%2022.6%2050.5%2050.5c0%2027.8-22.7%2050.5-50.5%2050.5z'%20fill='%23231815'%20p-id='1736'%3e%3c/path%3e%3c/svg%3e",
|
|
970
|
+
}, Symbol.toStringTag, { value: "Module" })), Ln = "data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg%20t='1757902422799'%20class='icon'%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20p-id='1735'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20width='200'%20height='200'%3e%3cpath%20d='M843.2%20726.4c-20.2%200-39.2%205.2-55.8%2014.3L283.8%20237.2c9-16.5%2014.1-35.4%2014.1-55.5%200-64.2-52.3-116.5-116.5-116.5S65%20117.4%2065%20181.6s52.3%20116.5%20116.5%20116.5c20.2%200%2039.2-5.2%2055.8-14.2l503.5%20503.5c-9%2016.5-14.1%2035.4-14.1%2055.5%200%2064.2%2052.3%20116.5%20116.5%20116.5s116.5-52.3%20116.5-116.5-52.3-116.5-116.5-116.5zM181.4%20232.1c-27.8%200-50.5-22.6-50.5-50.5s22.6-50.5%2050.5-50.5%2050.5%2022.6%2050.5%2050.5-22.6%2050.5-50.5%2050.5z%20m661.8%20661.3c-27.8%200-50.5-22.6-50.5-50.5%200-27.8%2022.6-50.5%2050.5-50.5s50.5%2022.6%2050.5%2050.5c0%2027.8-22.7%2050.5-50.5%2050.5z'%20fill='%23231815'%20p-id='1736'%3e%3c/path%3e%3c/svg%3e", Dn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
969
971
|
__proto__: null,
|
|
970
972
|
default: Ln
|
|
971
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
973
|
+
}, Symbol.toStringTag, { value: "Module" })), _n = "data:image/svg+xml,%3csvg%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20fill='%23555'%20width='16'%20height='16'%3e%3cpath%20d='M114.176%2046.528h618.496c37.312%200.064%2067.584%2030.336%2067.648%2067.648v618.56c0%2037.248-30.336%2067.584-67.648%2067.584H114.176A67.776%2067.776%200%200%201%2046.528%20732.8V114.176c0-37.312%2030.336-67.648%2067.648-67.648z%20m2.176%20686.208l616.32-2.24-2.176-616.32-614.144%202.176v616.32zM907.648%20291.2l2.176%20616.32H291.264a34.88%2034.88%200%201%200%200%2069.888h618.56c37.312%200%2067.648-30.336%2067.648-67.648V291.264a34.88%2034.88%200%201%200-69.824%200z'%20%3e%3c/path%3e%3c/svg%3e", kn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
972
974
|
__proto__: null,
|
|
973
|
-
default:
|
|
975
|
+
default: _n
|
|
974
976
|
}, Symbol.toStringTag, { value: "Module" })), Pn = "data:image/svg+xml,%3csvg%20viewBox='0%200%201029%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20fill='%23555'%20width='16'%20height='16'%3e%3cpath%20d='M788.17984%2016l-55.424%2060.672%20116.48%20106.56H418.13184a410.816%20410.816%200%201%200%200%20821.632h547.712v-82.176H418.13184a328.64%20328.64%200%200%201%200-657.28l441.792-0.128-124.8%2098.368%2050.752%2064.512%20243.328-191.488L788.17984%2016z'%3e%3c/path%3e%3c/svg%3e", In = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
975
977
|
__proto__: null,
|
|
976
978
|
default: Pn
|
|
977
979
|
}, Symbol.toStringTag, { value: "Module" })), Sn = "data:image/svg+xml,%3csvg%20viewBox='0%200%201048%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20fill='%23555'%20width='16'%20height='16'%3e%3cpath%20d='M310.04722%20451.334244A49.95122%2049.95122%200%200%201%20239.416195%20521.990244L27.473171%20310.04722a49.95122%2049.95122%200%200%201%200-70.631025L239.416195%2027.473171a49.95122%2049.95122%200%200%201%2070.631025%2070.631024l-126.651318%20126.626342L649.365854%20224.780488c220.709463%200%20399.609756%20178.900293%20399.609756%20399.609756s-178.900293%20399.609756-399.609756%20399.609756H124.878049a49.95122%2049.95122%200%201%201%200-99.902439h524.487805c165.513366%200%20299.707317-134.193951%20299.707317-299.707317s-134.193951-299.707317-299.707317-299.707317H183.395902l126.651318%20126.651317z'%3e%3c/path%3e%3c/svg%3e", Nn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
978
980
|
__proto__: null,
|
|
979
981
|
default: Sn
|
|
980
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
982
|
+
}, Symbol.toStringTag, { value: "Module" })), On = "data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20p-id='11576'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20fill='%23555'%20width='16'%20height='16'%3e%3cpath%20d='M102.4%20302.08c5.12%205.12%2015.36%2010.24%2025.6%2010.24s15.36-5.12%2025.6-10.24l174.08-174.08c5.12-5.12%2010.24-15.36%2010.24-25.6s-5.12-15.36-10.24-25.6c-20.48-5.12-40.96-5.12-51.2%2010.24l-148.48%20153.6-71.68-76.8C51.2%20158.72%2040.96%20158.72%2035.84%20158.72c-10.24%200-15.36%205.12-25.6%2010.24-5.12%205.12-10.24%2010.24-10.24%2020.48s5.12%2015.36%2010.24%2025.6L102.4%20302.08zM276.48%20409.6l-148.48%20153.6-71.68-71.68C51.2%20486.4%2040.96%20481.28%2035.84%20481.28c-10.24%200-15.36%205.12-25.6%2010.24-5.12%2010.24-10.24%2015.36-10.24%2025.6s5.12%2015.36%2010.24%2025.6L102.4%20629.76c5.12%205.12%2015.36%2010.24%2025.6%2010.24s15.36-5.12%2025.6-10.24L322.56%20460.8c5.12-5.12%2010.24-15.36%2010.24-25.6s-5.12-15.36-10.24-25.6c-10.24-10.24-30.72-10.24-46.08%200z%20m0%20327.68l-148.48%20153.6L56.32%20819.2c-5.12-5.12-15.36-10.24-25.6-10.24s-15.36%205.12-25.6%2010.24c0%205.12-5.12%2015.36-5.12%2025.6s5.12%2015.36%2010.24%2025.6L102.4%20957.44c5.12%205.12%2015.36%2010.24%2025.6%2010.24h5.12c10.24%200%2015.36-5.12%2025.6-10.24l174.08-174.08c5.12-5.12%2010.24-15.36%2010.24-25.6s-5.12-15.36-10.24-25.6c-25.6-5.12-40.96-5.12-56.32%205.12zM1024%20153.6c0%2030.72-25.6%2056.32-56.32%2056.32h-460.8c-30.72%200-61.44-25.6-61.44-56.32%200-30.72%2025.6-56.32%2056.32-56.32h455.68c35.84-5.12%2066.56%2020.48%2066.56%2056.32z%20m0%20358.4c0%2030.72-25.6%2056.32-56.32%2056.32h-460.8c-30.72%200-56.32-25.6-56.32-56.32s25.6-56.32%2056.32-56.32h455.68c35.84%200%2061.44%2025.6%2061.44%2056.32z%20m-5.12%20358.4c0%2030.72-25.6%2056.32-56.32%2056.32h-460.8c-30.72%200-56.32-25.6-56.32-56.32%200-30.72%2025.6-56.32%2056.32-56.32h455.68c35.84%200%2061.44%2025.6%2061.44%2056.32z%20m0%200'%20%3e%3c/path%3e%3c/svg%3e", Rn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
981
983
|
__proto__: null,
|
|
982
|
-
default:
|
|
984
|
+
default: On
|
|
983
985
|
}, Symbol.toStringTag, { value: "Module" })), zn = "data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg%20t='1757902488735'%20class='icon'%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20p-id='3957'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20width='200'%20height='200'%3e%3cpath%20d='M520.416%20179.392c-12.384%200-22.4%204.672-22.4%2010.432l-0.032%20139.136c0%205.76%2010.016%2010.432%2022.368%2010.432%2012.352%200%2022.368-4.672%2022.368-10.432l0.064-139.136c0-5.76-10.016-10.432-22.4-10.432M520.32%20623.04c-12.352%200-22.368%204.64-22.368%2010.4l-0.032%20139.168c0%205.76%2010.016%2010.432%2022.368%2010.432%2012.352%200%2022.368-4.672%2022.368-10.432l0.064-139.168c0-5.76-10.016-10.4-22.4-10.4M800.256%20458.72l-139.168-0.064c-5.76%200-10.432%2010.016-10.432%2022.4%200%2012.352%204.672%2022.368%2010.432%2022.368l139.168%200.032c5.76%200%2010.4-10.016%2010.4-22.368%200-12.352-4.64-22.368-10.4-22.4zM352.256%20458.72l-139.168-0.064c-5.76%200-10.432%2010.016-10.432%2022.4%200%2012.352%204.672%2022.368%2010.432%2022.368l139.168%200.032c5.76%200%2010.4-10.016%2010.4-22.368%200-12.352-4.64-22.368-10.4-22.4M801.568%20748.672l-72.544-72.544%2073.792-23.2a4.416%204.416%200%200%200%200.096-8.384l-183.136-62.4a4.416%204.416%200%200%200-5.6%205.568l62.464%20183.168a4.416%204.416%200%200%200%208.352-0.064l23.36-73.6%2072.32%2072.32a14.752%2014.752%200%200%200%2020.896-20.864M510.688%20382.112c49.952%200%2092.8%2040.832%2092.8%2092.8%200%2051.968-42.848%2092.8-92.8%2092.8-49.984%200-92.8-40.832-92.8-92.8%200-51.968%2042.816-92.8%2092.8-92.8z'%20p-id='3958'%3e%3c/path%3e%3c/svg%3e", Bn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
984
986
|
__proto__: null,
|
|
985
987
|
default: zn
|
|
@@ -994,7 +996,7 @@ class An extends ye {
|
|
|
994
996
|
static name = "RenderManager";
|
|
995
997
|
container = new m.Group();
|
|
996
998
|
lines = [];
|
|
997
|
-
pointVirtualGrid = new
|
|
999
|
+
pointVirtualGrid = new Re();
|
|
998
1000
|
quadtree = new ze(new We());
|
|
999
1001
|
actionHistory = /* @__PURE__ */ new Set();
|
|
1000
1002
|
onAddFromParent() {
|
|
@@ -1016,7 +1018,7 @@ class An extends ye {
|
|
|
1016
1018
|
return;
|
|
1017
1019
|
} else
|
|
1018
1020
|
this.updatedMode = "dxf";
|
|
1019
|
-
this.pointVirtualGrid = new
|
|
1021
|
+
this.pointVirtualGrid = new Re();
|
|
1020
1022
|
const e = this.dxf.box.clone().expansion(Math.max(this.dxf.box.width, this.dxf.box.height) * 2);
|
|
1021
1023
|
(e.width === 0 || e.height === 0) && e.set(-200, -200, 200, 200), this.quadtree = new ze(e), this.lines.length = 0, this.dxf.lineSegments.forEach((t) => {
|
|
1022
1024
|
t.userData.isDoor && !t.userData.doorDirectConnection || this.addLine(t.clone());
|
|
@@ -1359,7 +1361,9 @@ class ee extends T {
|
|
|
1359
1361
|
onAddFromParent(e) {
|
|
1360
1362
|
super.onAddFromParent(e), this.editor.container.add(this.container), this.container.position.z = 1e-3;
|
|
1361
1363
|
const t = this.commandManager.addCommandFlow(ee.commandName).add(this.createInterrupt()).add(this.constraint.bind(this)).add(this.verticalCorrection.bind(this)).addRollback(this.rollback.bind(this)).addRevokeRollback(this.revokeRollback.bind(this));
|
|
1362
|
-
t.addEventListener("finally", this.createFinally()), t.addEventListener("completed", (n) => this.completed(n.data)),
|
|
1364
|
+
t.addEventListener("finally", this.createFinally()), t.addEventListener("completed", (n) => this.completed(n.data)), t.addEventListener("started", () => {
|
|
1365
|
+
!this.eventInput.isOnlyKeyDowns(this.shortcutKeys) && !this.eventInput.isOnlyKeyDowns(this.shortcutKeys2) && (this.recursion = !1);
|
|
1366
|
+
}), this.eventInput.addEventListener("codeChange", async () => {
|
|
1363
1367
|
this.eventInput.isOnlyKeyDowns(this.shortcutKeys) ? (this.recursion = !1, this.commandManager.start(ee.commandName, [...this.default.selectLines])) : this.eventInput.isOnlyKeyDowns(this.shortcutKeys2) && (this.recursion = !0, this.commandManager.start(ee.commandName, [...this.default.selectLines]));
|
|
1364
1368
|
}), this.eventInput.addCancelDefaultBehavior(() => this.eventInput.isOnlyKeyDowns(this.shortcutKeys) || this.eventInput.isOnlyKeyDowns(this.shortcutKeys2));
|
|
1365
1369
|
}
|
|
@@ -1367,7 +1371,7 @@ class ee extends T {
|
|
|
1367
1371
|
* 进入命令约束
|
|
1368
1372
|
*/
|
|
1369
1373
|
constraint(e, t) {
|
|
1370
|
-
Array.isArray(t) ? t.length !== 1 ? (
|
|
1374
|
+
Array.isArray(t) ? t.length !== 1 ? (k({ message: "请选择一条线段", type: "warning" }), this.cancel()) : e(t) : (k({ message: "进入命令失败", type: "warning" }), this.cancel());
|
|
1371
1375
|
}
|
|
1372
1376
|
/**
|
|
1373
1377
|
* 线段是否为结尾线段
|
|
@@ -1394,18 +1398,21 @@ class ee extends T {
|
|
|
1394
1398
|
* @param point2
|
|
1395
1399
|
*/
|
|
1396
1400
|
getSamePointAll(e, t) {
|
|
1397
|
-
return this.renderManager.pointVirtualGrid.queryPoint(e).map((o) =>
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1401
|
+
return this.renderManager.pointVirtualGrid.queryPoint(e).map((o) => {
|
|
1402
|
+
const s = {
|
|
1403
|
+
point: o.point,
|
|
1404
|
+
oldPoint: o.point.clone(),
|
|
1405
|
+
newPoint: t,
|
|
1406
|
+
line: o.userData
|
|
1407
|
+
};
|
|
1408
|
+
return o.point.copy(s.newPoint), s;
|
|
1409
|
+
});
|
|
1403
1410
|
}
|
|
1404
1411
|
/** 修正
|
|
1405
1412
|
* @param targettLine
|
|
1406
1413
|
* @param vistedList
|
|
1407
1414
|
*/
|
|
1408
|
-
|
|
1415
|
+
correction0(e, t = [], n = /* @__PURE__ */ new Set()) {
|
|
1409
1416
|
if (n.has(e)) return;
|
|
1410
1417
|
n.add(e);
|
|
1411
1418
|
const o = this.renderManager.quadtree.queryLineSegment(e).filter(({ line: a }) => !(a === e || a.userData.isDoor)).map((a) => a.line), s = e.direction();
|
|
@@ -1415,20 +1422,41 @@ class ee extends T {
|
|
|
1415
1422
|
const i = a.direction(), d = s.angleBetween(i, "angle"), l = Math.abs(90 - d);
|
|
1416
1423
|
if (!(l > 20 || l < 1))
|
|
1417
1424
|
if (this.isTowLineSegmentConnect(e, a)) {
|
|
1418
|
-
const c = e.start.equal(a.start) || e.start.equal(a.end) ? e.start : e.end, h = a.start.equal(e.start) || a.start.equal(e.end) ? a.end : a.start,
|
|
1425
|
+
const c = e.start.equal(a.start) || e.start.equal(a.end) ? e.start : e.end, h = a.start.equal(e.start) || a.start.equal(e.end) ? a.end : a.start, f = new ne(
|
|
1419
1426
|
h.clone().add(s.clone().multiplyScalar(1)),
|
|
1420
1427
|
h.clone().add(s.clone().multiplyScalar(-1))
|
|
1421
|
-
), g =
|
|
1428
|
+
), g = f.projectPoint(c, !1);
|
|
1422
1429
|
g && t.push(this.getSamePointAll(h, g));
|
|
1423
1430
|
} else
|
|
1424
1431
|
console.log("交点");
|
|
1425
|
-
}), this.recursion && o.forEach((a) => this.
|
|
1432
|
+
}), this.recursion && o.forEach((a) => this.correction0(a, t, n)), t;
|
|
1433
|
+
}
|
|
1434
|
+
/** 修正2
|
|
1435
|
+
* 第一步:确定需要修复的线段
|
|
1436
|
+
* 第二步:查找与该线段相交的其他线段
|
|
1437
|
+
* 第三步:找出两端点相交的线段,其他为区间相交
|
|
1438
|
+
* 第四步:找出两端点相交的线段数量,大于2, 该点不能修
|
|
1439
|
+
* 第五步:修正
|
|
1440
|
+
* 第六步:修正同向线段
|
|
1441
|
+
* @param targettLine
|
|
1442
|
+
* @param vistedList
|
|
1443
|
+
*/
|
|
1444
|
+
correction(e, t = [], n = /* @__PURE__ */ new Set()) {
|
|
1445
|
+
if (n.has(e)) return;
|
|
1446
|
+
n.add(e);
|
|
1447
|
+
const o = this.renderManager.quadtree.queryLineSegment(e).filter(({ line: d }) => !(d === e || d.userData.isDoor)).map((d) => d.line);
|
|
1448
|
+
e.direction();
|
|
1449
|
+
const [s, a, i] = o.reduce((d, l) => {
|
|
1450
|
+
const [c, h, f] = d;
|
|
1451
|
+
return e.start.equal(l.start) || e.start.equal(l.end) ? c.push(l) : e.end.equal(l.start) || e.end.equal(l.end) ? h.push(l) : f.push(l), d;
|
|
1452
|
+
}, [[], [], []]);
|
|
1453
|
+
return s.length >= 2, console.log(s, a, i), t;
|
|
1426
1454
|
}
|
|
1427
1455
|
/** 开始
|
|
1428
1456
|
* @param next
|
|
1429
1457
|
*/
|
|
1430
1458
|
verticalCorrection(e, t) {
|
|
1431
|
-
e(this.
|
|
1459
|
+
e(this.correction0(t[0]));
|
|
1432
1460
|
}
|
|
1433
1461
|
/** 执行完成
|
|
1434
1462
|
* @param data
|
|
@@ -1460,22 +1488,22 @@ class ee extends T {
|
|
|
1460
1488
|
return this.completed(e), e;
|
|
1461
1489
|
}
|
|
1462
1490
|
}
|
|
1463
|
-
class
|
|
1491
|
+
class H extends T {
|
|
1464
1492
|
static name = "MergeLine";
|
|
1465
1493
|
shortcutKeys = ["control", "g"];
|
|
1466
1494
|
static commandName = "merge-line";
|
|
1467
1495
|
onAddFromParent(e) {
|
|
1468
1496
|
super.onAddFromParent(e);
|
|
1469
|
-
const t = e.findComponentByType(ke), n = this.commandManager.addCommandFlow(
|
|
1470
|
-
n.addEventListener("finally", this.createFinally()), n.addEventListener("completed", (o) => this.completed(o.data)), this.eventInput.addKeyCombination(
|
|
1471
|
-
t?.selectLines.length === 2 && this.eventInput.isKeyCombination(
|
|
1497
|
+
const t = e.findComponentByType(ke), n = this.commandManager.addCommandFlow(H.commandName).add(this.createInterrupt()).add(this.constraint.bind(this)).add(this.mergeLine.bind(this)).addRollback(this.rollback.bind(this)).addRevokeRollback(this.revokeRollback.bind(this));
|
|
1498
|
+
n.addEventListener("finally", this.createFinally()), n.addEventListener("completed", (o) => this.completed(o.data)), this.eventInput.addKeyCombination(H.commandName, this.shortcutKeys), this.eventInput.addEventListener("codeChange", async () => {
|
|
1499
|
+
t?.selectLines.length === 2 && this.eventInput.isKeyCombination(H.commandName) && await this.commandManager.start(H.commandName, [...this.default.selectLines]);
|
|
1472
1500
|
}), this.eventInput.addCancelDefaultBehavior(() => this.eventInput.isOnlyKeyDowns(this.shortcutKeys));
|
|
1473
1501
|
}
|
|
1474
1502
|
/**
|
|
1475
1503
|
* 进入命令约束
|
|
1476
1504
|
*/
|
|
1477
1505
|
constraint(e, t) {
|
|
1478
|
-
Array.isArray(t) ? t.length !== 2 ? (
|
|
1506
|
+
Array.isArray(t) ? t.length !== 2 ? (k({ message: "未执行线段合并,请选择两条线段", type: "warning" }), this.cancel()) : e(t) : (k({ message: "进入命令失败", type: "warning" }), this.cancel());
|
|
1479
1507
|
}
|
|
1480
1508
|
/** 开始
|
|
1481
1509
|
* @param next
|
|
@@ -1489,11 +1517,11 @@ class q extends T {
|
|
|
1489
1517
|
const d = o.points[i];
|
|
1490
1518
|
if (a.equal(d)) {
|
|
1491
1519
|
const l = n.points[(s + 1) % 2], c = o.points[(i + 1) % 2], h = new ne(l, c);
|
|
1492
|
-
return e({ line1: n, line2: o, newLine: h }),
|
|
1520
|
+
return e({ line1: n, line2: o, newLine: h }), k({ message: "已合并", type: "success" });
|
|
1493
1521
|
}
|
|
1494
1522
|
}
|
|
1495
1523
|
}
|
|
1496
|
-
|
|
1524
|
+
k({ message: "合并失败,两条线未找到共用点", type: "warning" }), this.commandManager.cancel();
|
|
1497
1525
|
}
|
|
1498
1526
|
/** 执行完成
|
|
1499
1527
|
* @param data
|
|
@@ -1528,13 +1556,13 @@ class W extends T {
|
|
|
1528
1556
|
* 进入命令约束
|
|
1529
1557
|
*/
|
|
1530
1558
|
constraint(e, t) {
|
|
1531
|
-
Array.isArray(t) ? e(t) : (
|
|
1559
|
+
Array.isArray(t) ? e(t) : (k({ message: "请选择线段", type: "warning" }), this.cancel());
|
|
1532
1560
|
}
|
|
1533
1561
|
/** 开始
|
|
1534
1562
|
* @param next
|
|
1535
1563
|
*/
|
|
1536
1564
|
delete(e, t) {
|
|
1537
|
-
t.forEach((n) => this.renderManager.removeLine(n)),
|
|
1565
|
+
t.forEach((n) => this.renderManager.removeLine(n)), k({ message: "删除成功", type: "success" }), e(t);
|
|
1538
1566
|
}
|
|
1539
1567
|
/** 回滚操作
|
|
1540
1568
|
* @param data
|
|
@@ -1565,7 +1593,7 @@ class U extends T {
|
|
|
1565
1593
|
* 进入命令约束
|
|
1566
1594
|
*/
|
|
1567
1595
|
constraint(e, t) {
|
|
1568
|
-
Array.isArray(t) ? t.length !== 2 ? (
|
|
1596
|
+
Array.isArray(t) ? t.length !== 2 ? (k({ message: "请选择2条线段", type: "warning" }), this.cancel()) : e(t) : (k({ message: "进入命令失败", type: "warning" }), this.cancel());
|
|
1569
1597
|
}
|
|
1570
1598
|
/** 连接
|
|
1571
1599
|
* @param next
|
|
@@ -1579,7 +1607,7 @@ class U extends T {
|
|
|
1579
1607
|
}
|
|
1580
1608
|
if (n && o) {
|
|
1581
1609
|
const a = new ne(n.clone(), o.clone());
|
|
1582
|
-
e(a),
|
|
1610
|
+
e(a), k({ message: "连接成功", type: "success" });
|
|
1583
1611
|
} else this.cancel();
|
|
1584
1612
|
}
|
|
1585
1613
|
/** 成功
|
|
@@ -1618,7 +1646,7 @@ class Q extends T {
|
|
|
1618
1646
|
* 进入命令约束
|
|
1619
1647
|
*/
|
|
1620
1648
|
constraint(e, t) {
|
|
1621
|
-
Array.isArray(t) ? t.length !== 2 ? (
|
|
1649
|
+
Array.isArray(t) ? t.length !== 2 ? (k({ message: "请选择2条线段", type: "warning" }), this.cancel()) : e(t) : (k({ message: "进入命令失败", type: "warning" }), this.cancel());
|
|
1622
1650
|
}
|
|
1623
1651
|
/** 开始
|
|
1624
1652
|
* @param next
|
|
@@ -1629,7 +1657,7 @@ class Q extends T {
|
|
|
1629
1657
|
const a = n.points.map((c) => c.clone()), i = o.points.map((c) => c.clone());
|
|
1630
1658
|
n.start.distance(s) < n.end.distance(s) ? n.start.copy(s) : n.end.copy(s), o.start.distance(s) < o.end.distance(s) ? o.start.copy(s) : o.end.copy(s);
|
|
1631
1659
|
const d = n.points.map((c) => c.clone()), l = o.points.map((c) => c.clone());
|
|
1632
|
-
e({ line1: n, line2: o, oldLine1: a, oldLine2: i, newLine1: d, newLine2: l }),
|
|
1660
|
+
e({ line1: n, line2: o, oldLine1: a, oldLine2: i, newLine1: d, newLine2: l }), k({ message: "连接成功", type: "success" });
|
|
1633
1661
|
}
|
|
1634
1662
|
/** 执行完成
|
|
1635
1663
|
* @param next
|
|
@@ -1668,7 +1696,7 @@ class Y extends T {
|
|
|
1668
1696
|
* 进入命令约束
|
|
1669
1697
|
*/
|
|
1670
1698
|
constraint(e, t) {
|
|
1671
|
-
Array.isArray(t) ? t.some((n) => n.userData.isWindow) ? e(t) : (
|
|
1699
|
+
Array.isArray(t) ? t.some((n) => n.userData.isWindow) ? e(t) : (k({ message: "请选择有窗户线段", type: "warning" }), this.cancel()) : (k({ message: "进入命令失败", type: "warning" }), this.cancel());
|
|
1672
1700
|
}
|
|
1673
1701
|
/** 开始
|
|
1674
1702
|
* @param next
|
|
@@ -1680,7 +1708,7 @@ class Y extends T {
|
|
|
1680
1708
|
line: s,
|
|
1681
1709
|
drawDoorData: s.userData.drawDoorData
|
|
1682
1710
|
}), n = !0);
|
|
1683
|
-
}), n &&
|
|
1711
|
+
}), n && k({ message: "删除窗户成功", type: "success" }), e(o);
|
|
1684
1712
|
}
|
|
1685
1713
|
/**
|
|
1686
1714
|
* 完成
|
|
@@ -1718,7 +1746,7 @@ class Z extends T {
|
|
|
1718
1746
|
onAddFromParent(e) {
|
|
1719
1747
|
super.onAddFromParent(e), this.editor.container.add(this.container), this.container.position.z = 1e-3;
|
|
1720
1748
|
const t = this.commandManager.addCommandFlow(Z.commandName).add(this.createInterrupt()).add(this.selectAll.bind(this)).addRollback(this.rollback.bind(this)).addRevokeRollback(this.revokeRollback.bind(this));
|
|
1721
|
-
t.addEventListener("finally", this.createFinally()), t.addEventListener("completed", (n) => this.completed(n.data)), this.eventInput.addKeyCombination(Z.commandName, this.shortcutKeys), this.eventInput.addEventListener("codeChange", async () => {
|
|
1749
|
+
t.writeOperationList = !1, t.addEventListener("finally", this.createFinally()), t.addEventListener("completed", (n) => this.completed(n.data)), this.eventInput.addKeyCombination(Z.commandName, this.shortcutKeys), this.eventInput.addEventListener("codeChange", async () => {
|
|
1722
1750
|
this.eventInput.isKeyCombination(Z.commandName) && await this.commandManager.start(Z.commandName);
|
|
1723
1751
|
}), this.eventInput.addCancelDefaultBehavior(() => this.eventInput.isOnlyKeyDowns(this.shortcutKeys));
|
|
1724
1752
|
}
|
|
@@ -1747,10 +1775,10 @@ class Z extends T {
|
|
|
1747
1775
|
return this.completed(e), e;
|
|
1748
1776
|
}
|
|
1749
1777
|
}
|
|
1750
|
-
const
|
|
1778
|
+
const qn = {
|
|
1751
1779
|
key: 0,
|
|
1752
1780
|
class: "mt-[5px] text-[#ccc] text-[11px] absolute left-[10px] bottom-[10px] rounded-[8px] min-w-[150px] bg-black/15 p-[10px]"
|
|
1753
|
-
},
|
|
1781
|
+
}, $n = { class: "text-start max-w-[150px]" }, Hn = { class: "inline-block ml-[10px] text-[var(--color-primary)]" }, Wn = {
|
|
1754
1782
|
key: 0,
|
|
1755
1783
|
class: "p-[5px] max-w-[200px]"
|
|
1756
1784
|
}, Un = { class: "text-[14px] flex flex-col" }, Qn = ["onClick"], Yn = { class: "flex flex-row items-center" }, Zn = { class: "flex justify-center items-center size-[20px] bg-[#f0f0f0] rounded-[2px] mr-[10px]" }, Xn = ["src"], Jn = { class: "text-wrap" }, eo = {
|
|
@@ -1769,45 +1797,45 @@ const $n = {
|
|
|
1769
1797
|
permission: {}
|
|
1770
1798
|
},
|
|
1771
1799
|
setup(r) {
|
|
1772
|
-
function e(
|
|
1773
|
-
const re =
|
|
1774
|
-
|
|
1800
|
+
function e(y, u, p = h.value.getBoundingClientRect(), G = f.value.getBoundingClientRect()) {
|
|
1801
|
+
const re = p.width - G.width, ie = 0, xe = p.height - G.height;
|
|
1802
|
+
y = Math.max(0, Math.min(y, re)), u = Math.max(ie, Math.min(u, xe)), R.value = { left: y, top: u };
|
|
1775
1803
|
}
|
|
1776
|
-
function t(
|
|
1777
|
-
|
|
1804
|
+
function t(y) {
|
|
1805
|
+
C.value === y.command || C.value !== "default" || _.commandManager.start(y.command);
|
|
1778
1806
|
}
|
|
1779
|
-
function n(
|
|
1780
|
-
if (
|
|
1781
|
-
localStorage.setItem("lines", JSON.stringify(
|
|
1807
|
+
function n(y) {
|
|
1808
|
+
if (y) {
|
|
1809
|
+
localStorage.setItem("lines", JSON.stringify(y));
|
|
1782
1810
|
try {
|
|
1783
|
-
b.Dxf.set(
|
|
1811
|
+
b.Dxf.set(y), b.Dxf.lineOffset();
|
|
1784
1812
|
} catch (u) {
|
|
1785
1813
|
console.log(u);
|
|
1786
1814
|
}
|
|
1787
1815
|
}
|
|
1788
1816
|
}
|
|
1789
1817
|
async function o() {
|
|
1790
|
-
const
|
|
1791
|
-
Array.isArray(
|
|
1818
|
+
const y = await Et.json();
|
|
1819
|
+
Array.isArray(y) && (localStorage.removeItem("orbitControls"), n(y));
|
|
1792
1820
|
}
|
|
1793
|
-
function s({ offsetX:
|
|
1821
|
+
function s({ offsetX: y, offsetY: u }) {
|
|
1794
1822
|
P.mouseMoveEventProxylock = !0;
|
|
1795
|
-
const
|
|
1823
|
+
const p = document.body.style.cursor;
|
|
1796
1824
|
document.body.style.cursor = "move";
|
|
1797
1825
|
const G = (re) => {
|
|
1798
|
-
const ie = h.value.getBoundingClientRect(), xe =
|
|
1826
|
+
const ie = h.value.getBoundingClientRect(), xe = f.value.getBoundingClientRect();
|
|
1799
1827
|
e(
|
|
1800
|
-
re.pageX - ie.left -
|
|
1828
|
+
re.pageX - ie.left - y,
|
|
1801
1829
|
re.pageY - ie.top - u,
|
|
1802
1830
|
ie,
|
|
1803
1831
|
xe
|
|
1804
1832
|
), re.stopPropagation(), document.body.style.cursor = "move";
|
|
1805
1833
|
}, be = () => {
|
|
1806
|
-
document.body.removeEventListener("mousemove", G), document.removeEventListener("mouseup", be), document.body.style.cursor =
|
|
1834
|
+
document.body.removeEventListener("mousemove", G), document.removeEventListener("mouseup", be), document.body.style.cursor = p, P.mouseMoveEventProxylock = !1;
|
|
1807
1835
|
};
|
|
1808
1836
|
document.body.addEventListener("mousemove", G), document.addEventListener("mouseup", be);
|
|
1809
1837
|
}
|
|
1810
|
-
const a = r, i =
|
|
1838
|
+
const a = r, i = E(!0), d = E(!0), l = E(!0), c = E(!1), h = E(), f = E(), g = E(!0), C = E(""), b = Pt(a.dxfSystem), P = b.findComponentByType(Mt), _ = b.findComponentByType(ot), j = b.findComponentByType(ke), se = b.findComponentByType(Lt), ue = E(0), X = E(0), R = E({ left: 10, top: 10 }), L = /* @__PURE__ */ Object.assign({ "./assets/images/connection.svg": fn, "./assets/images/deleteSelectLine.svg": yn, "./assets/images/deleteSelectWindow.svg": bn, "./assets/images/door.svg": Cn, "./assets/images/intersectionConnection.svg": En, "./assets/images/line.svg": Dn, "./assets/images/mergeLine.svg": kn, "./assets/images/revokeRollback.svg": In, "./assets/images/rollback.svg": Nn, "./assets/images/selectAll.svg": Rn, "./assets/images/selectPoint.svg": Bn, "./assets/images/verticalCorrection.svg": Kn, "./assets/images/window.svg": Vn }), $ = E(!1), w = E(0), we = E(!1), ae = new ResizeObserver(() => e(R.value.left, R.value.top)), st = [
|
|
1811
1839
|
{ name: "开启绘制线段命令", shortcut: "Ctrl + L" },
|
|
1812
1840
|
{ name: "开启绘制门线命令", shortcut: "Ctrl + M" },
|
|
1813
1841
|
{ name: "开启绘制窗户线命令", shortcut: "Ctrl + Q" },
|
|
@@ -1837,7 +1865,7 @@ const $n = {
|
|
|
1837
1865
|
{
|
|
1838
1866
|
command: "draw-line",
|
|
1839
1867
|
name: "绘制线段",
|
|
1840
|
-
src:
|
|
1868
|
+
src: L["./assets/images/line.svg"].default,
|
|
1841
1869
|
show: !0,
|
|
1842
1870
|
shortcut: "Ctrl + L"
|
|
1843
1871
|
},
|
|
@@ -1845,29 +1873,29 @@ const $n = {
|
|
|
1845
1873
|
command: "draw-door-line",
|
|
1846
1874
|
name: "绘制门线",
|
|
1847
1875
|
show: !0,
|
|
1848
|
-
src:
|
|
1876
|
+
src: L["./assets/images/door.svg"].default,
|
|
1849
1877
|
shortcut: "Ctrl + M"
|
|
1850
1878
|
},
|
|
1851
1879
|
{
|
|
1852
1880
|
command: "draw-window-line",
|
|
1853
1881
|
name: "绘制窗户线",
|
|
1854
1882
|
show: !0,
|
|
1855
|
-
src:
|
|
1883
|
+
src: L["./assets/images/window.svg"].default,
|
|
1856
1884
|
shortcut: "Ctrl + Q"
|
|
1857
1885
|
},
|
|
1858
1886
|
{
|
|
1859
1887
|
command: "point",
|
|
1860
1888
|
name: "点修改",
|
|
1861
1889
|
show: !0,
|
|
1862
|
-
src:
|
|
1890
|
+
src: L["./assets/images/selectPoint.svg"].default,
|
|
1863
1891
|
shortcut: "Ctrl + P"
|
|
1864
1892
|
}
|
|
1865
1893
|
], rt = [
|
|
1866
1894
|
{
|
|
1867
1895
|
command: "",
|
|
1868
1896
|
name: "操作回滚",
|
|
1869
|
-
src:
|
|
1870
|
-
show:
|
|
1897
|
+
src: L["./assets/images/rollback.svg"].default,
|
|
1898
|
+
show: D(() => ue.value !== 0),
|
|
1871
1899
|
shortcut: "Ctrl + Z",
|
|
1872
1900
|
action() {
|
|
1873
1901
|
_.commandManager.rollback();
|
|
@@ -1876,8 +1904,8 @@ const $n = {
|
|
|
1876
1904
|
{
|
|
1877
1905
|
command: "",
|
|
1878
1906
|
name: "撤销操作回滚",
|
|
1879
|
-
src:
|
|
1880
|
-
show:
|
|
1907
|
+
src: L["./assets/images/revokeRollback.svg"].default,
|
|
1908
|
+
show: D(() => X.value !== 0),
|
|
1881
1909
|
shortcut: "Ctrl + Y",
|
|
1882
1910
|
class: "rotateY-[180deg]",
|
|
1883
1911
|
action() {
|
|
@@ -1885,72 +1913,72 @@ const $n = {
|
|
|
1885
1913
|
}
|
|
1886
1914
|
},
|
|
1887
1915
|
{
|
|
1888
|
-
command:
|
|
1916
|
+
command: H.commandName,
|
|
1889
1917
|
name: "合并",
|
|
1890
|
-
src:
|
|
1891
|
-
show:
|
|
1918
|
+
src: L["./assets/images/mergeLine.svg"].default,
|
|
1919
|
+
show: D(() => w.value === 2),
|
|
1892
1920
|
shortcut: "Ctrl + G"
|
|
1893
1921
|
},
|
|
1894
1922
|
{
|
|
1895
1923
|
command: U.commandName,
|
|
1896
1924
|
name: "两点连接",
|
|
1897
|
-
show:
|
|
1898
|
-
src:
|
|
1925
|
+
show: D(() => w.value === 2),
|
|
1926
|
+
src: L["./assets/images/connection.svg"].default,
|
|
1899
1927
|
shortcut: "Shift + L"
|
|
1900
1928
|
},
|
|
1901
1929
|
{
|
|
1902
1930
|
command: Q.commandName,
|
|
1903
1931
|
name: "延长线交点连接",
|
|
1904
|
-
show:
|
|
1905
|
-
src:
|
|
1932
|
+
show: D(() => w.value === 2),
|
|
1933
|
+
src: L["./assets/images/intersectionConnection.svg"].default,
|
|
1906
1934
|
shortcut: "Ctrl + Shift + L"
|
|
1907
1935
|
},
|
|
1908
1936
|
{
|
|
1909
1937
|
command: ee.commandName,
|
|
1910
1938
|
name: "线段垂直纠正",
|
|
1911
|
-
show:
|
|
1912
|
-
src:
|
|
1939
|
+
show: D(() => w.value === 1),
|
|
1940
|
+
src: L["./assets/images/verticalCorrection.svg"].default,
|
|
1913
1941
|
shortcut: "Ctrl + C 或 Ctrl + Shift + C"
|
|
1914
1942
|
},
|
|
1915
1943
|
{
|
|
1916
1944
|
command: Z.commandName,
|
|
1917
1945
|
name: "全选",
|
|
1918
|
-
show:
|
|
1919
|
-
src:
|
|
1946
|
+
show: D(() => w.value !== _.renderManager.lines.length),
|
|
1947
|
+
src: L["./assets/images/selectAll.svg"].default,
|
|
1920
1948
|
shortcut: "Ctrl + A"
|
|
1921
1949
|
},
|
|
1922
1950
|
{
|
|
1923
1951
|
command: Y.commandName,
|
|
1924
1952
|
name: "清除窗户",
|
|
1925
|
-
show:
|
|
1926
|
-
src:
|
|
1953
|
+
show: D(() => we.value),
|
|
1954
|
+
src: L["./assets/images/deleteSelectWindow.svg"].default,
|
|
1927
1955
|
shortcut: "Q + Delete"
|
|
1928
1956
|
},
|
|
1929
1957
|
{
|
|
1930
1958
|
command: W.commandName,
|
|
1931
1959
|
name: "删除",
|
|
1932
|
-
show:
|
|
1933
|
-
src:
|
|
1960
|
+
show: D(() => w.value > 0),
|
|
1961
|
+
src: L["./assets/images/deleteSelectLine.svg"].default,
|
|
1934
1962
|
shortcut: "Delete"
|
|
1935
1963
|
}
|
|
1936
1964
|
];
|
|
1937
|
-
V(
|
|
1938
|
-
localStorage.setItem("toolBarExpand", g.value + ""), g.value && ve(() => e(
|
|
1939
|
-
}), V(i, () => b.Variable.set("originalLineVisible", i.value)), V(d, () => b.Variable.set("dxfVisible", d.value)), V(l, () => b.Variable.set("whiteModelVisible", l.value)), b.Variable.addEventListener("isLook", (
|
|
1940
|
-
const it = _.commandManager.addEventListener("started", (
|
|
1941
|
-
|
|
1965
|
+
V(R, () => localStorage.setItem("editorToolPosition", JSON.stringify(R.value))), V($, () => localStorage.setItem("showShortcutKey", $.value + "")), V(g, () => {
|
|
1966
|
+
localStorage.setItem("toolBarExpand", g.value + ""), g.value && ve(() => e(R.value.left, R.value.top));
|
|
1967
|
+
}), V(i, () => b.Variable.set("originalLineVisible", i.value)), V(d, () => b.Variable.set("dxfVisible", d.value)), V(l, () => b.Variable.set("whiteModelVisible", l.value)), b.Variable.addEventListener("isLook", (y) => c.value = y.value), b.Variable.addEventListener("originalLineVisible", (y) => i.value = y.value), b.Variable.addEventListener("dxfVisible", (y) => d.value = y.value), b.Variable.addEventListener("whiteModelVisible", (y) => l.value = y.value);
|
|
1968
|
+
const it = _.commandManager.addEventListener("started", (y) => {
|
|
1969
|
+
C.value = y.name;
|
|
1942
1970
|
});
|
|
1943
|
-
return localStorage.getItem("showShortcutKey") && (
|
|
1944
|
-
|
|
1945
|
-
if (
|
|
1946
|
-
const { left:
|
|
1947
|
-
e(
|
|
1971
|
+
return localStorage.getItem("showShortcutKey") && ($.value = localStorage.getItem("showShortcutKey") === "true"), localStorage.getItem("toolBarExpand") && (g.value = localStorage.getItem("toolBarExpand") === "true"), Ze(() => {
|
|
1972
|
+
f.value.style.display = "none", setTimeout(() => {
|
|
1973
|
+
if (f.value.style.display = "block", localStorage.getItem("editorToolPosition")) {
|
|
1974
|
+
const { left: y, top: u } = JSON.parse(localStorage.getItem("editorToolPosition") ?? "{}");
|
|
1975
|
+
e(y, u), ve(() => ae.observe(h.value));
|
|
1948
1976
|
} else
|
|
1949
1977
|
ve(() => ae.observe(h.value));
|
|
1950
1978
|
}, 100), j.addEventListener("selectLineChange", () => {
|
|
1951
|
-
|
|
1952
|
-
}), ["rollback", "completed", "revokeRollback"].forEach((
|
|
1953
|
-
_.commandManager.addEventListener(
|
|
1979
|
+
w.value = j.selectLines.length, we.value = j.selectLines.some((y) => y.userData.isWindow);
|
|
1980
|
+
}), ["rollback", "completed", "revokeRollback"].forEach((y) => {
|
|
1981
|
+
_.commandManager.addEventListener(y, () => {
|
|
1954
1982
|
setTimeout(() => {
|
|
1955
1983
|
ue.value = _.commandManager.operationList.length, X.value = _.commandManager.rollbackList.length;
|
|
1956
1984
|
});
|
|
@@ -1958,45 +1986,45 @@ const $n = {
|
|
|
1958
1986
|
});
|
|
1959
1987
|
}), It(() => {
|
|
1960
1988
|
P.mouseMoveEventProxylock = !1, it(), ae.disconnect();
|
|
1961
|
-
}), (
|
|
1989
|
+
}), (y, u) => (M(), S("div", {
|
|
1962
1990
|
ref_key: "elRef",
|
|
1963
1991
|
ref: h,
|
|
1964
1992
|
class: "editorTool pointer-events-none overflow-hidden absolute left-0 top-0 w-full h-full z-[20] flex flex-row justify-between p-[5px] box-border select-none pointer-events-[all]"
|
|
1965
1993
|
}, [
|
|
1966
|
-
z(
|
|
1994
|
+
z(ge, null, {
|
|
1967
1995
|
default: F(() => [
|
|
1968
|
-
|
|
1969
|
-
(
|
|
1996
|
+
$.value ? (M(), S("div", qn, [
|
|
1997
|
+
(M(), S(ce, null, Me(st, (p) => x("div", {
|
|
1970
1998
|
class: "p-[4px_0px] flex justify-between text-right border-b-1 border-b-[rgba(255,255,255,0.1)] last-of-type:border-b-0",
|
|
1971
|
-
key:
|
|
1999
|
+
key: p.name
|
|
1972
2000
|
}, [
|
|
1973
|
-
x("p",
|
|
1974
|
-
x("span",
|
|
2001
|
+
x("p", $n, J(p.name), 1),
|
|
2002
|
+
x("span", Hn, J(p.shortcut), 1)
|
|
1975
2003
|
])), 64))
|
|
1976
|
-
])) :
|
|
2004
|
+
])) : q("", !0)
|
|
1977
2005
|
]),
|
|
1978
2006
|
_: 1
|
|
1979
2007
|
}),
|
|
1980
2008
|
x("div", {
|
|
1981
2009
|
ref_key: "toolBarRef",
|
|
1982
|
-
ref:
|
|
1983
|
-
style:
|
|
1984
|
-
class:
|
|
1985
|
-
onMousedown: u[8] || (u[8] = (
|
|
2010
|
+
ref: f,
|
|
2011
|
+
style: _e({ left: R.value.left + "px", top: R.value.top + "px" }),
|
|
2012
|
+
class: O(["overflow-hidden pointer-events-auto w-fit max-w-[260px] transition-[border-radius] text-[#333] absolute z-[11] bg-white select-none", { "rounded-[8px] ": g.value }]),
|
|
2013
|
+
onMousedown: u[8] || (u[8] = (p) => p.stopPropagation())
|
|
1986
2014
|
}, [
|
|
1987
2015
|
x("div", {
|
|
1988
2016
|
onMousedown: s,
|
|
1989
|
-
class:
|
|
2017
|
+
class: O([{ "border-b-[#eee] border-b-1": g.value }, "flex flex-row justify-between header text-[14px] font-bold p-[10px 0px]"])
|
|
1990
2018
|
}, [
|
|
1991
|
-
u[10] || (u[10] = St('<div class="flex flex-row" data-v-
|
|
2019
|
+
u[10] || (u[10] = St('<div class="flex flex-row" data-v-fb4f87a4><div class="p-[2px_5px] flex items-center pointer-events-none" data-v-fb4f87a4><svg fill="#aaa" width="20" height="20" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" data-v-fb4f87a4><path d="M341.333333 298.666667a85.333333 85.333333 0 1 0 0-170.666667 85.333333 85.333333 0 0 0 0 170.666667z m0 298.666666a85.333333 85.333333 0 1 0 0-170.666666 85.333333 85.333333 0 0 0 0 170.666666z m85.333334 213.333334a85.333333 85.333333 0 1 1-170.666667 0 85.333333 85.333333 0 0 1 170.666667 0z m256-512a85.333333 85.333333 0 1 0 0-170.666667 85.333333 85.333333 0 0 0 0 170.666667z m85.333333 213.333333a85.333333 85.333333 0 1 1-170.666667 0 85.333333 85.333333 0 0 1 170.666667 0z m-85.333333 384a85.333333 85.333333 0 1 0 0-170.666667 85.333333 85.333333 0 0 0 0 170.666667z" data-v-fb4f87a4></path></svg></div><h5 class="flex text-nowrap text-[12px] items-center pointer-events-none" data-v-fb4f87a4>绘制工具</h5></div>', 1)),
|
|
1992
2020
|
x("div", {
|
|
1993
|
-
onMousedown: u[0] || (u[0] = (
|
|
1994
|
-
onClick: u[1] || (u[1] = (
|
|
2021
|
+
onMousedown: u[0] || (u[0] = (p) => p.stopPropagation()),
|
|
2022
|
+
onClick: u[1] || (u[1] = (p) => g.value = !g.value),
|
|
1995
2023
|
class: "cursor-pointer flex items-center p-[0px_5px]"
|
|
1996
2024
|
}, [
|
|
1997
|
-
(
|
|
2025
|
+
(M(), S("svg", {
|
|
1998
2026
|
fill: "#666",
|
|
1999
|
-
class:
|
|
2027
|
+
class: O([{ "rotate-90": g.value }, "transition-all"]),
|
|
2000
2028
|
viewBox: "0 0 1024 1024",
|
|
2001
2029
|
version: "1.1",
|
|
2002
2030
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -2007,32 +2035,35 @@ const $n = {
|
|
|
2007
2035
|
]), 2))
|
|
2008
2036
|
], 32)
|
|
2009
2037
|
], 34),
|
|
2010
|
-
g.value ? (
|
|
2038
|
+
g.value ? (M(), S("div", Wn, [
|
|
2011
2039
|
x("ul", Un, [
|
|
2012
|
-
(
|
|
2013
|
-
key:
|
|
2040
|
+
(M(), S(ce, null, Me(at, (p) => (M(), S(ce, {
|
|
2041
|
+
key: p.command
|
|
2014
2042
|
}, [
|
|
2015
|
-
|
|
2043
|
+
p.show ? (M(), S("li", {
|
|
2016
2044
|
key: 0,
|
|
2017
|
-
onClick: (G) => t(
|
|
2018
|
-
class:
|
|
2045
|
+
onClick: (G) => t(p),
|
|
2046
|
+
class: O([{
|
|
2047
|
+
"!bg-[var(--primary-color)] text-[#fff]": C.value === p.command,
|
|
2048
|
+
"!cursor-no-drop": C.value !== p.command && C.value !== "default"
|
|
2049
|
+
}, "gap-[10px] text-[12px] hover:bg-[#ddd] transition-all rounded-[6px] p-[5px] flex flex-row items-center justify-between cursor-pointer"])
|
|
2019
2050
|
}, [
|
|
2020
2051
|
x("div", Yn, [
|
|
2021
2052
|
x("div", Zn, [
|
|
2022
2053
|
x("img", {
|
|
2023
2054
|
class: "size-[14px]",
|
|
2024
|
-
src:
|
|
2055
|
+
src: p.src,
|
|
2025
2056
|
alt: "",
|
|
2026
2057
|
srcset: ""
|
|
2027
2058
|
}, null, 8, Xn)
|
|
2028
2059
|
]),
|
|
2029
|
-
x("span", Jn, J(
|
|
2060
|
+
x("span", Jn, J(p.name), 1)
|
|
2030
2061
|
]),
|
|
2031
|
-
|
|
2062
|
+
C.value === p.command ? (M(), S("div", {
|
|
2032
2063
|
key: 0,
|
|
2033
2064
|
title: "取消命令(Esc)",
|
|
2034
2065
|
class: "active:scale-[0.7] transition-all",
|
|
2035
|
-
onClick: u[2] || (u[2] = (G) => (
|
|
2066
|
+
onClick: u[2] || (u[2] = (G) => (v(_).cancelCommand(), G.stopPropagation()))
|
|
2036
2067
|
}, u[11] || (u[11] = [
|
|
2037
2068
|
x("svg", {
|
|
2038
2069
|
fill: "#fff",
|
|
@@ -2045,26 +2076,26 @@ const $n = {
|
|
|
2045
2076
|
x("path", { d: "M511.104 0C228.821333 0 0 228.821333 0 511.104c0 282.282667 228.821333 511.104 511.104 511.104 282.282667 0 511.104-228.842667 511.104-511.104C1022.208 228.821333 793.386667 0 511.104 0zM511.104 898.496c-213.973333 0-387.434667-173.44-387.434667-387.413333 0-213.952 173.44-387.413333 387.434667-387.413333 213.952 0 387.392 173.44 387.392 387.413333C898.496 725.056 725.056 898.496 511.104 898.496z" }),
|
|
2046
2077
|
x("path", { d: "M236.437333 463.914667l549.333333 0 0 96.874667-549.333333 0 0-96.874667Z" })
|
|
2047
2078
|
], -1)
|
|
2048
|
-
]))) :
|
|
2049
|
-
], 10, Qn)) :
|
|
2079
|
+
]))) : p.shortcut ? (M(), S("div", eo, J(p.shortcut), 1)) : q("", !0)
|
|
2080
|
+
], 10, Qn)) : q("", !0)
|
|
2050
2081
|
], 64))), 64))
|
|
2051
2082
|
]),
|
|
2052
2083
|
x("div", to, [
|
|
2053
|
-
z(
|
|
2084
|
+
z(v(Oe), {
|
|
2054
2085
|
size: "small",
|
|
2055
|
-
modelValue:
|
|
2056
|
-
"onUpdate:modelValue": u[3] || (u[3] = (
|
|
2086
|
+
modelValue: $.value,
|
|
2087
|
+
"onUpdate:modelValue": u[3] || (u[3] = (p) => $.value = p),
|
|
2057
2088
|
label: "快捷键提示"
|
|
2058
2089
|
}, null, 8, ["modelValue"]),
|
|
2059
|
-
z(
|
|
2090
|
+
z(v(Oe), {
|
|
2060
2091
|
size: "small",
|
|
2061
2092
|
modelValue: d.value,
|
|
2062
|
-
"onUpdate:modelValue": u[4] || (u[4] = (
|
|
2093
|
+
"onUpdate:modelValue": u[4] || (u[4] = (p) => d.value = p),
|
|
2063
2094
|
label: "dxf"
|
|
2064
2095
|
}, null, 8, ["modelValue"])
|
|
2065
2096
|
]),
|
|
2066
|
-
|
|
2067
|
-
z(
|
|
2097
|
+
y.permission === "admin" ? (M(), S("div", no, [
|
|
2098
|
+
z(v(pe), {
|
|
2068
2099
|
style: { padding: "5px", "font-size": "10px" },
|
|
2069
2100
|
size: "small",
|
|
2070
2101
|
type: "success",
|
|
@@ -2076,11 +2107,11 @@ const $n = {
|
|
|
2076
2107
|
_: 1,
|
|
2077
2108
|
__: [12]
|
|
2078
2109
|
}),
|
|
2079
|
-
z(
|
|
2110
|
+
z(v(pe), {
|
|
2080
2111
|
style: { padding: "5px", "font-size": "10px" },
|
|
2081
2112
|
size: "small",
|
|
2082
2113
|
type: "primary",
|
|
2083
|
-
onClick: u[5] || (u[5] = (
|
|
2114
|
+
onClick: u[5] || (u[5] = (p) => console.log(v(b).Dxf.originalData))
|
|
2084
2115
|
}, {
|
|
2085
2116
|
default: F(() => u[13] || (u[13] = [
|
|
2086
2117
|
le(" 打印Json ", -1)
|
|
@@ -2088,11 +2119,11 @@ const $n = {
|
|
|
2088
2119
|
_: 1,
|
|
2089
2120
|
__: [13]
|
|
2090
2121
|
}),
|
|
2091
|
-
z(
|
|
2122
|
+
z(v(pe), {
|
|
2092
2123
|
style: { padding: "5px", "font-size": "10px" },
|
|
2093
2124
|
size: "small",
|
|
2094
2125
|
type: "primary",
|
|
2095
|
-
onClick: u[6] || (u[6] = (
|
|
2126
|
+
onClick: u[6] || (u[6] = (p) => v(b).Dxf.download("test.dxf"))
|
|
2096
2127
|
}, {
|
|
2097
2128
|
default: F(() => u[14] || (u[14] = [
|
|
2098
2129
|
le(" 下载DXF ", -1)
|
|
@@ -2100,11 +2131,11 @@ const $n = {
|
|
|
2100
2131
|
_: 1,
|
|
2101
2132
|
__: [14]
|
|
2102
2133
|
}),
|
|
2103
|
-
z(
|
|
2134
|
+
z(v(pe), {
|
|
2104
2135
|
style: { padding: "5px", "font-size": "10px" },
|
|
2105
2136
|
size: "small",
|
|
2106
2137
|
type: "primary",
|
|
2107
|
-
onClick: u[7] || (u[7] = (
|
|
2138
|
+
onClick: u[7] || (u[7] = (p) => v(se).downloadGltf("test.glb", !0))
|
|
2108
2139
|
}, {
|
|
2109
2140
|
default: F(() => u[15] || (u[15] = [
|
|
2110
2141
|
le(" 下载白膜 ", -1)
|
|
@@ -2112,21 +2143,24 @@ const $n = {
|
|
|
2112
2143
|
_: 1,
|
|
2113
2144
|
__: [15]
|
|
2114
2145
|
})
|
|
2115
|
-
])) :
|
|
2116
|
-
z(
|
|
2146
|
+
])) : q("", !0),
|
|
2147
|
+
z(ge, null, {
|
|
2117
2148
|
default: F(() => [
|
|
2118
2149
|
x("div", oo, [
|
|
2119
2150
|
z(Nt, null, {
|
|
2120
2151
|
default: F(() => [
|
|
2121
|
-
(
|
|
2122
|
-
onClick: (G) =>
|
|
2123
|
-
title: `${
|
|
2124
|
-
class:
|
|
2125
|
-
|
|
2152
|
+
(M(), S(ce, null, Me(rt, (p) => x("div", {
|
|
2153
|
+
onClick: (G) => p.show.value && C.value === "default" && (p.action ? p.action() : v(_).commandManager.start(p.command, [...v(j).selectLines])),
|
|
2154
|
+
title: `${p.name}(${p.shortcut})`,
|
|
2155
|
+
class: O(["size-[20px] flex justify-center items-center relative overflow-hidden active:scale-[0.8] border-1 border-[#ccc] rounded-[4px] transition-all cursor-pointer", {
|
|
2156
|
+
"opacity-30 bg-[#ccc] !cursor-no-drop active:!scale-[1]": !p.show.value || C.value !== "default",
|
|
2157
|
+
[p.class ?? ""]: !0
|
|
2158
|
+
}]),
|
|
2159
|
+
key: p.command
|
|
2126
2160
|
}, [
|
|
2127
2161
|
x("img", {
|
|
2128
2162
|
class: "size-[14px]",
|
|
2129
|
-
src:
|
|
2163
|
+
src: p.src
|
|
2130
2164
|
}, null, 8, ao)
|
|
2131
2165
|
], 10, so)), 64))
|
|
2132
2166
|
]),
|
|
@@ -2136,7 +2170,7 @@ const $n = {
|
|
|
2136
2170
|
]),
|
|
2137
2171
|
_: 1
|
|
2138
2172
|
})
|
|
2139
|
-
])) :
|
|
2173
|
+
])) : q("", !0)
|
|
2140
2174
|
], 38)
|
|
2141
2175
|
], 512));
|
|
2142
2176
|
}
|
|
@@ -2145,7 +2179,7 @@ const $n = {
|
|
|
2145
2179
|
for (const [n, o] of e)
|
|
2146
2180
|
t[n] = o;
|
|
2147
2181
|
return t;
|
|
2148
|
-
}, lo = /* @__PURE__ */ io(ro, [["__scopeId", "data-v-
|
|
2182
|
+
}, lo = /* @__PURE__ */ io(ro, [["__scopeId", "data-v-fb4f87a4"]]);
|
|
2149
2183
|
let ot = class extends ye {
|
|
2150
2184
|
static name = "Editor";
|
|
2151
2185
|
container = new m.Group();
|
|
@@ -2186,7 +2220,7 @@ let ot = class extends ye {
|
|
|
2186
2220
|
this.domContainer.domElement.parentElement && (this.domContainer.domElement.parentElement.appendChild(this.domElement), t());
|
|
2187
2221
|
});
|
|
2188
2222
|
setTimeout(() => {
|
|
2189
|
-
this.app =
|
|
2223
|
+
this.app = Ot(lo, { dxfSystem: this.parent, permission: this.viewPermission }), this.app.mount(this.domElement);
|
|
2190
2224
|
});
|
|
2191
2225
|
}
|
|
2192
2226
|
/**
|
|
@@ -2204,16 +2238,16 @@ let ot = class extends ye {
|
|
|
2204
2238
|
* 打开编辑器
|
|
2205
2239
|
*/
|
|
2206
2240
|
openEdit() {
|
|
2207
|
-
const e = this.renderer, t = this.domEventRegister, n = this.dxf, o = e.orbitControls, s = e.camera, a = n.box.center, i = e.camera.position.clone(), d = o?.target?.clone(), l = new m.Vector2(), c = new m.Raycaster(), h = this.coords,
|
|
2241
|
+
const e = this.renderer, t = this.domEventRegister, n = this.dxf, o = e.orbitControls, s = e.camera, a = n.box.center, i = e.camera.position.clone(), d = o?.target?.clone(), l = new m.Vector2(), c = new m.Raycaster(), h = this.coords, f = this.pointerPosition;
|
|
2208
2242
|
this.container.position.z = n.originalZAverage, e.scene.add(this.container), o && (s.position.set(a.x, a.y, 15), o.target.set(a.x, a.y, 0), o.enableRotate = !1);
|
|
2209
2243
|
const g = () => {
|
|
2210
2244
|
e.renderer.getSize(l);
|
|
2211
|
-
const
|
|
2212
|
-
h.set(
|
|
2245
|
+
const C = t.pointer.x / l.x * 2 - 1, b = -(t.pointer.y / l.y * 2 - 1);
|
|
2246
|
+
h.set(C, b), c.setFromCamera(h, e.camera.children.length ? e.camera.children[0] : e.camera);
|
|
2213
2247
|
const P = c.intersectObject(this.plane);
|
|
2214
|
-
P.length && (
|
|
2248
|
+
P.length && (f.copy(P[0].point), this.dispatchEvent({
|
|
2215
2249
|
type: "pointerPositionChange",
|
|
2216
|
-
position:
|
|
2250
|
+
position: f
|
|
2217
2251
|
}));
|
|
2218
2252
|
};
|
|
2219
2253
|
t.addEventListener("mousemove", g), this.commandManager.disabled = !1, this.commandManager.start("default"), this._exitEditCallBack = () => {
|
|
@@ -2265,8 +2299,8 @@ class co extends T {
|
|
|
2265
2299
|
let { point: l, find: c } = this.editor.renderManager.adsorption(), h = "none";
|
|
2266
2300
|
if (l) {
|
|
2267
2301
|
if (this.dispatchEvent({ type: "pointerMove", point: l }), this.eventInput.isKeyDown("shift")) {
|
|
2268
|
-
const
|
|
2269
|
-
l.set(
|
|
2302
|
+
const f = n.projectPoint(A.from(l), !1);
|
|
2303
|
+
l.set(f?.x ?? l.x, f?.y ?? l.y, 0), c = !0, h = "crosshair";
|
|
2270
2304
|
}
|
|
2271
2305
|
c ? (d.position.copy(l), this.container.add(d)) : (d.removeFromParent(), h = "crosshair"), a.copy(l), i.setPoint(s, a), this.domElement.style.cursor = h;
|
|
2272
2306
|
}
|
|
@@ -2296,7 +2330,7 @@ class co extends T {
|
|
|
2296
2330
|
}
|
|
2297
2331
|
}
|
|
2298
2332
|
function Ge(r, e = {}) {
|
|
2299
|
-
r.addComponent(new ot(e.viewPermission)), r.addComponent(new An()), r.addComponent(new ke()), r.addComponent(new hn()), r.addComponent(new jn()), r.addComponent(new Gn()), r.addComponent(new co()), r.addComponent(new W()), r.addComponent(new
|
|
2333
|
+
r.addComponent(new ot(e.viewPermission)), r.addComponent(new An()), r.addComponent(new ke()), r.addComponent(new hn()), r.addComponent(new jn()), r.addComponent(new Gn()), r.addComponent(new co()), r.addComponent(new W()), r.addComponent(new H()), r.addComponent(new ee()), r.addComponent(new U()), r.addComponent(new Q()), r.addComponent(new Y()), r.addComponent(new Z());
|
|
2300
2334
|
}
|
|
2301
2335
|
const yo = Object.assign(Ge, {
|
|
2302
2336
|
create(r = {}) {
|