build-dxf 0.0.21 → 0.0.23
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/package.json +1 -1
- package/src/build.js +429 -275
- package/src/index.css +1 -1
- package/src/index2.js +10 -10
- package/src/index3.js +1159 -922
- package/src/selectLocalFile.js +4 -0
- package/src/utils/DxfSystem/components/AngleCorrectionDxf.d.ts +4 -1
- package/src/utils/DxfSystem/components/Dxf.d.ts +1 -0
- package/src/utils/DxfSystem/components/LineAnalysis.d.ts +77 -0
- package/src/utils/DxfSystem/components/ThreeVJia.d.ts +45 -0
- package/src/utils/DxfSystem/plugin/Editor/components/CommandFlow/CommandFlowComponent.d.ts +11 -0
- package/src/utils/DxfSystem/plugin/Editor/components/CommandFlow/Default.d.ts +2 -6
- package/src/utils/DxfSystem/plugin/Editor/components/CommandFlow/VerticalCorrection.d.ts +10 -7
- package/src/utils/DxfSystem/plugin/Editor/components/RenderManager.d.ts +6 -4
- package/src/utils/DxfSystem/plugin/RenderPlugin/components/Renderer.d.ts +2 -1
- package/src/utils/Quadtree/Box2.d.ts +6 -0
- package/src/utils/Quadtree/LineSegment.d.ts +5 -1
- package/src/utils/DxfSystem/plugin/Editor/components/CommandFlow/VerticalCorrection copy.d.ts +0 -82
package/src/index3.js
CHANGED
|
@@ -1,73 +1,73 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import { i as
|
|
3
|
-
import { C as
|
|
1
|
+
import * as h from "three";
|
|
2
|
+
import { i as ht, n as ut, r as Xe, t as $e, c as Be, d as pt, e as gt, f as Ne, g as X, _ as et, u as vt, h as xe, j as Fe, w as ft, k as yt, l as wt, p as bt, m as xt, o as Ct, T as ze, q as Te, s as Et, v as Mt, x as je, y as _e, z as Se, A as Lt, B as It, L as Ce, D as Pt, b as Ve, E as ue, S as kt } from "./selectLocalFile.js";
|
|
3
|
+
import { C as Oe, P as R, L as z, B as Me, E as tt, b as Ge, Q as Le, u as Dt, W as St, T as At } 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
|
|
8
|
-
function
|
|
7
|
+
import { watch as ee, ref as T, defineComponent as ve, computed as F, createElementBlock as H, openBlock as K, normalizeClass as Z, unref as L, renderSlot as Ie, createVNode as J, Transition as Pe, withCtx as q, withDirectives as nt, createElementVNode as O, normalizeStyle as Re, createTextVNode as se, toDisplayString as pe, vShow as st, shallowReactive as _t, onMounted as ot, createBlock as we, createCommentVNode as ne, resolveDynamicComponent as Bt, Fragment as be, withModifiers as Nt, nextTick as Ee, isVNode as at, render as Qe, toRaw as Ot, onUnmounted as Rt, renderList as Ae, createStaticVNode as Kt, TransitionGroup as Ft, createApp as zt } from "vue";
|
|
8
|
+
function it(c) {
|
|
9
9
|
var e;
|
|
10
|
-
const t =
|
|
10
|
+
const t = Xe(c);
|
|
11
11
|
return (e = t?.$el) != null ? e : t;
|
|
12
12
|
}
|
|
13
|
-
const
|
|
14
|
-
function
|
|
15
|
-
let e, t, n,
|
|
16
|
-
if (
|
|
17
|
-
return
|
|
13
|
+
const rt = Be ? window : void 0;
|
|
14
|
+
function Tt(...c) {
|
|
15
|
+
let e, t, n, s;
|
|
16
|
+
if (ht(c[0]) || Array.isArray(c[0]) ? ([t, n, s] = c, e = rt) : [e, t, n, s] = c, !e)
|
|
17
|
+
return ut;
|
|
18
18
|
Array.isArray(t) || (t = [t]), Array.isArray(n) || (n = [n]);
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
},
|
|
22
|
-
a(),
|
|
23
|
-
}, { immediate: !0, flush: "post" }),
|
|
24
|
-
|
|
19
|
+
const o = [], a = () => {
|
|
20
|
+
o.forEach((d) => d()), o.length = 0;
|
|
21
|
+
}, r = (d, p, E, f) => (d.addEventListener(p, E, f), () => d.removeEventListener(p, E, f)), l = ee(() => [it(e), Xe(s)], ([d, p]) => {
|
|
22
|
+
a(), d && o.push(...t.flatMap((E) => n.map((f) => r(d, E, f, p))));
|
|
23
|
+
}, { immediate: !0, flush: "post" }), i = () => {
|
|
24
|
+
l(), a();
|
|
25
25
|
};
|
|
26
|
-
return
|
|
26
|
+
return $e(i), i;
|
|
27
27
|
}
|
|
28
|
-
function
|
|
29
|
-
const t =
|
|
30
|
-
return n(),
|
|
28
|
+
function jt(c, e = !1) {
|
|
29
|
+
const t = T(), n = () => t.value = !!c();
|
|
30
|
+
return n(), pt(n, e), t;
|
|
31
31
|
}
|
|
32
|
-
const
|
|
33
|
-
|
|
34
|
-
var
|
|
32
|
+
const He = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}, We = "__vueuse_ssr_handlers__";
|
|
33
|
+
He[We] = He[We] || {};
|
|
34
|
+
var Je = Object.getOwnPropertySymbols, Vt = Object.prototype.hasOwnProperty, Gt = Object.prototype.propertyIsEnumerable, Qt = (c, e) => {
|
|
35
35
|
var t = {};
|
|
36
|
-
for (var n in
|
|
37
|
-
|
|
38
|
-
if (
|
|
39
|
-
for (var n of
|
|
40
|
-
e.indexOf(n) < 0 &&
|
|
36
|
+
for (var n in c)
|
|
37
|
+
Vt.call(c, n) && e.indexOf(n) < 0 && (t[n] = c[n]);
|
|
38
|
+
if (c != null && Je)
|
|
39
|
+
for (var n of Je(c))
|
|
40
|
+
e.indexOf(n) < 0 && Gt.call(c, n) && (t[n] = c[n]);
|
|
41
41
|
return t;
|
|
42
42
|
};
|
|
43
|
-
function
|
|
44
|
-
const n = t, { window:
|
|
43
|
+
function Ht(c, e, t = {}) {
|
|
44
|
+
const n = t, { window: s = rt } = n, o = Qt(n, ["window"]);
|
|
45
45
|
let a;
|
|
46
|
-
const
|
|
46
|
+
const r = jt(() => s && "ResizeObserver" in s), l = () => {
|
|
47
47
|
a && (a.disconnect(), a = void 0);
|
|
48
|
-
},
|
|
49
|
-
|
|
50
|
-
}, { immediate: !0, flush: "post" }),
|
|
51
|
-
|
|
48
|
+
}, i = ee(() => it(c), (p) => {
|
|
49
|
+
l(), r.value && s && p && (a = new ResizeObserver(e), a.observe(p, o));
|
|
50
|
+
}, { immediate: !0, flush: "post" }), d = () => {
|
|
51
|
+
l(), i();
|
|
52
52
|
};
|
|
53
|
-
return
|
|
54
|
-
isSupported:
|
|
55
|
-
stop:
|
|
53
|
+
return $e(d), {
|
|
54
|
+
isSupported: r,
|
|
55
|
+
stop: d
|
|
56
56
|
};
|
|
57
57
|
}
|
|
58
|
-
var
|
|
59
|
-
(function(
|
|
60
|
-
|
|
61
|
-
})(
|
|
62
|
-
var
|
|
58
|
+
var Ue;
|
|
59
|
+
(function(c) {
|
|
60
|
+
c.UP = "UP", c.RIGHT = "RIGHT", c.DOWN = "DOWN", c.LEFT = "LEFT", c.NONE = "NONE";
|
|
61
|
+
})(Ue || (Ue = {}));
|
|
62
|
+
var Wt = Object.defineProperty, qe = Object.getOwnPropertySymbols, Jt = Object.prototype.hasOwnProperty, Ut = Object.prototype.propertyIsEnumerable, Ze = (c, e, t) => e in c ? Wt(c, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : c[e] = t, qt = (c, e) => {
|
|
63
63
|
for (var t in e || (e = {}))
|
|
64
|
-
|
|
65
|
-
if (
|
|
66
|
-
for (var t of
|
|
67
|
-
|
|
68
|
-
return
|
|
64
|
+
Jt.call(e, t) && Ze(c, t, e[t]);
|
|
65
|
+
if (qe)
|
|
66
|
+
for (var t of qe(e))
|
|
67
|
+
Ut.call(e, t) && Ze(c, t, e[t]);
|
|
68
|
+
return c;
|
|
69
69
|
};
|
|
70
|
-
const
|
|
70
|
+
const Zt = {
|
|
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],
|
|
@@ -93,12 +93,12 @@ const Jt = {
|
|
|
93
93
|
easeOutBack: [0.34, 1.56, 0.64, 1],
|
|
94
94
|
easeInOutBack: [0.68, -0.6, 0.32, 1.6]
|
|
95
95
|
};
|
|
96
|
-
|
|
97
|
-
linear:
|
|
98
|
-
},
|
|
99
|
-
const
|
|
96
|
+
qt({
|
|
97
|
+
linear: gt
|
|
98
|
+
}, Zt);
|
|
99
|
+
const Yt = (c) => c, Xt = {
|
|
100
100
|
esc: "Escape"
|
|
101
|
-
},
|
|
101
|
+
}, $t = Ne({
|
|
102
102
|
value: {
|
|
103
103
|
type: [String, Number],
|
|
104
104
|
default: ""
|
|
@@ -120,59 +120,59 @@ const qt = (r) => r, Zt = {
|
|
|
120
120
|
},
|
|
121
121
|
color: String,
|
|
122
122
|
badgeStyle: {
|
|
123
|
-
type:
|
|
123
|
+
type: X([String, Object, Array])
|
|
124
124
|
},
|
|
125
125
|
offset: {
|
|
126
|
-
type:
|
|
126
|
+
type: X(Array),
|
|
127
127
|
default: [0, 0]
|
|
128
128
|
},
|
|
129
129
|
badgeClass: {
|
|
130
130
|
type: String
|
|
131
131
|
}
|
|
132
|
-
}),
|
|
132
|
+
}), en = ve({
|
|
133
133
|
name: "ElBadge"
|
|
134
|
-
}),
|
|
135
|
-
...
|
|
136
|
-
props:
|
|
137
|
-
setup(
|
|
138
|
-
const t =
|
|
139
|
-
var a,
|
|
134
|
+
}), tn = /* @__PURE__ */ ve({
|
|
135
|
+
...en,
|
|
136
|
+
props: $t,
|
|
137
|
+
setup(c, { expose: e }) {
|
|
138
|
+
const t = c, n = vt("badge"), s = F(() => t.isDot ? "" : xe(t.value) && xe(t.max) ? t.max < t.value ? `${t.max}+` : `${t.value}` : `${t.value}`), o = F(() => {
|
|
139
|
+
var a, r, l, i, d;
|
|
140
140
|
return [
|
|
141
141
|
{
|
|
142
142
|
backgroundColor: t.color,
|
|
143
|
-
marginRight:
|
|
144
|
-
marginTop:
|
|
143
|
+
marginRight: Fe(-((r = (a = t.offset) == null ? void 0 : a[0]) != null ? r : 0)),
|
|
144
|
+
marginTop: Fe((i = (l = t.offset) == null ? void 0 : l[1]) != null ? i : 0)
|
|
145
145
|
},
|
|
146
|
-
(
|
|
146
|
+
(d = t.badgeStyle) != null ? d : {}
|
|
147
147
|
];
|
|
148
148
|
});
|
|
149
149
|
return e({
|
|
150
|
-
content:
|
|
151
|
-
}), (a,
|
|
152
|
-
class:
|
|
150
|
+
content: s
|
|
151
|
+
}), (a, r) => (K(), H("div", {
|
|
152
|
+
class: Z(L(n).b())
|
|
153
153
|
}, [
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
name: `${
|
|
154
|
+
Ie(a.$slots, "default"),
|
|
155
|
+
J(Pe, {
|
|
156
|
+
name: `${L(n).namespace.value}-zoom-in-center`,
|
|
157
157
|
persisted: ""
|
|
158
158
|
}, {
|
|
159
|
-
default:
|
|
160
|
-
|
|
161
|
-
class:
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
159
|
+
default: q(() => [
|
|
160
|
+
nt(O("sup", {
|
|
161
|
+
class: Z([
|
|
162
|
+
L(n).e("content"),
|
|
163
|
+
L(n).em("content", a.type),
|
|
164
|
+
L(n).is("fixed", !!a.$slots.default),
|
|
165
|
+
L(n).is("dot", a.isDot),
|
|
166
|
+
L(n).is("hide-zero", !a.showZero && t.value === 0),
|
|
167
167
|
a.badgeClass
|
|
168
168
|
]),
|
|
169
|
-
style:
|
|
169
|
+
style: Re(L(o))
|
|
170
170
|
}, [
|
|
171
|
-
|
|
172
|
-
|
|
171
|
+
Ie(a.$slots, "content", { value: L(s) }, () => [
|
|
172
|
+
se(pe(L(s)), 1)
|
|
173
173
|
])
|
|
174
174
|
], 6), [
|
|
175
|
-
[
|
|
175
|
+
[st, !a.hidden && (L(s) || a.isDot || a.$slots.content)]
|
|
176
176
|
])
|
|
177
177
|
]),
|
|
178
178
|
_: 3
|
|
@@ -180,63 +180,63 @@ const qt = (r) => r, Zt = {
|
|
|
180
180
|
], 2));
|
|
181
181
|
}
|
|
182
182
|
});
|
|
183
|
-
var
|
|
184
|
-
const
|
|
183
|
+
var nn = /* @__PURE__ */ et(tn, [["__file", "badge.vue"]]);
|
|
184
|
+
const sn = ft(nn), on = Ne({
|
|
185
185
|
a11y: {
|
|
186
186
|
type: Boolean,
|
|
187
187
|
default: !0
|
|
188
188
|
},
|
|
189
189
|
locale: {
|
|
190
|
-
type:
|
|
190
|
+
type: X(Object)
|
|
191
191
|
},
|
|
192
|
-
size:
|
|
192
|
+
size: wt,
|
|
193
193
|
button: {
|
|
194
|
-
type:
|
|
194
|
+
type: X(Object)
|
|
195
195
|
},
|
|
196
196
|
card: {
|
|
197
|
-
type:
|
|
197
|
+
type: X(Object)
|
|
198
198
|
},
|
|
199
199
|
dialog: {
|
|
200
|
-
type:
|
|
200
|
+
type: X(Object)
|
|
201
201
|
},
|
|
202
202
|
link: {
|
|
203
|
-
type:
|
|
203
|
+
type: X(Object)
|
|
204
204
|
},
|
|
205
205
|
experimentalFeatures: {
|
|
206
|
-
type:
|
|
206
|
+
type: X(Object)
|
|
207
207
|
},
|
|
208
208
|
keyboardNavigation: {
|
|
209
209
|
type: Boolean,
|
|
210
210
|
default: !0
|
|
211
211
|
},
|
|
212
212
|
message: {
|
|
213
|
-
type:
|
|
213
|
+
type: X(Object)
|
|
214
214
|
},
|
|
215
215
|
zIndex: Number,
|
|
216
216
|
namespace: {
|
|
217
217
|
type: String,
|
|
218
218
|
default: "el"
|
|
219
219
|
},
|
|
220
|
-
...
|
|
221
|
-
}),
|
|
222
|
-
|
|
220
|
+
...yt
|
|
221
|
+
}), U = {};
|
|
222
|
+
ve({
|
|
223
223
|
name: "ElConfigProvider",
|
|
224
|
-
props:
|
|
225
|
-
setup(
|
|
226
|
-
const t =
|
|
227
|
-
return
|
|
228
|
-
var
|
|
229
|
-
Object.assign(
|
|
230
|
-
}, { immediate: !0, deep: !0 }), () =>
|
|
224
|
+
props: on,
|
|
225
|
+
setup(c, { slots: e }) {
|
|
226
|
+
const t = bt(c);
|
|
227
|
+
return ee(() => c.message, (n) => {
|
|
228
|
+
var s, o;
|
|
229
|
+
Object.assign(U, (o = (s = t?.value) == null ? void 0 : s.message) != null ? o : {}, n ?? {});
|
|
230
|
+
}, { immediate: !0, deep: !0 }), () => Ie(e, "default", { config: t?.value });
|
|
231
231
|
}
|
|
232
232
|
});
|
|
233
|
-
const
|
|
233
|
+
const dt = [
|
|
234
234
|
"primary",
|
|
235
235
|
"success",
|
|
236
236
|
"info",
|
|
237
237
|
"warning",
|
|
238
238
|
"error"
|
|
239
|
-
],
|
|
239
|
+
], Q = Yt({
|
|
240
240
|
customClass: "",
|
|
241
241
|
dangerouslyUseHTMLString: !1,
|
|
242
242
|
duration: 3e3,
|
|
@@ -251,271 +251,271 @@ const at = [
|
|
|
251
251
|
zIndex: 0,
|
|
252
252
|
grouping: !1,
|
|
253
253
|
repeatNum: 1,
|
|
254
|
-
appendTo:
|
|
255
|
-
}),
|
|
254
|
+
appendTo: Be ? document.body : void 0
|
|
255
|
+
}), an = Ne({
|
|
256
256
|
customClass: {
|
|
257
257
|
type: String,
|
|
258
|
-
default:
|
|
258
|
+
default: Q.customClass
|
|
259
259
|
},
|
|
260
260
|
dangerouslyUseHTMLString: {
|
|
261
261
|
type: Boolean,
|
|
262
|
-
default:
|
|
262
|
+
default: Q.dangerouslyUseHTMLString
|
|
263
263
|
},
|
|
264
264
|
duration: {
|
|
265
265
|
type: Number,
|
|
266
|
-
default:
|
|
266
|
+
default: Q.duration
|
|
267
267
|
},
|
|
268
268
|
icon: {
|
|
269
|
-
type:
|
|
270
|
-
default:
|
|
269
|
+
type: xt,
|
|
270
|
+
default: Q.icon
|
|
271
271
|
},
|
|
272
272
|
id: {
|
|
273
273
|
type: String,
|
|
274
|
-
default:
|
|
274
|
+
default: Q.id
|
|
275
275
|
},
|
|
276
276
|
message: {
|
|
277
|
-
type:
|
|
277
|
+
type: X([
|
|
278
278
|
String,
|
|
279
279
|
Object,
|
|
280
280
|
Function
|
|
281
281
|
]),
|
|
282
|
-
default:
|
|
282
|
+
default: Q.message
|
|
283
283
|
},
|
|
284
284
|
onClose: {
|
|
285
|
-
type:
|
|
286
|
-
default:
|
|
285
|
+
type: X(Function),
|
|
286
|
+
default: Q.onClose
|
|
287
287
|
},
|
|
288
288
|
showClose: {
|
|
289
289
|
type: Boolean,
|
|
290
|
-
default:
|
|
290
|
+
default: Q.showClose
|
|
291
291
|
},
|
|
292
292
|
type: {
|
|
293
293
|
type: String,
|
|
294
|
-
values:
|
|
295
|
-
default:
|
|
294
|
+
values: dt,
|
|
295
|
+
default: Q.type
|
|
296
296
|
},
|
|
297
297
|
plain: {
|
|
298
298
|
type: Boolean,
|
|
299
|
-
default:
|
|
299
|
+
default: Q.plain
|
|
300
300
|
},
|
|
301
301
|
offset: {
|
|
302
302
|
type: Number,
|
|
303
|
-
default:
|
|
303
|
+
default: Q.offset
|
|
304
304
|
},
|
|
305
305
|
zIndex: {
|
|
306
306
|
type: Number,
|
|
307
|
-
default:
|
|
307
|
+
default: Q.zIndex
|
|
308
308
|
},
|
|
309
309
|
grouping: {
|
|
310
310
|
type: Boolean,
|
|
311
|
-
default:
|
|
311
|
+
default: Q.grouping
|
|
312
312
|
},
|
|
313
313
|
repeatNum: {
|
|
314
314
|
type: Number,
|
|
315
|
-
default:
|
|
315
|
+
default: Q.repeatNum
|
|
316
316
|
}
|
|
317
|
-
}),
|
|
317
|
+
}), rn = {
|
|
318
318
|
destroy: () => !0
|
|
319
|
-
},
|
|
320
|
-
const e =
|
|
319
|
+
}, $ = _t([]), dn = (c) => {
|
|
320
|
+
const e = $.findIndex((s) => s.id === c), t = $[e];
|
|
321
321
|
let n;
|
|
322
|
-
return e > 0 && (n =
|
|
323
|
-
},
|
|
324
|
-
const { prev: e } =
|
|
322
|
+
return e > 0 && (n = $[e - 1]), { current: t, prev: n };
|
|
323
|
+
}, ln = (c) => {
|
|
324
|
+
const { prev: e } = dn(c);
|
|
325
325
|
return e ? e.vm.exposed.bottom.value : 0;
|
|
326
|
-
},
|
|
326
|
+
}, cn = (c, e) => $.findIndex((n) => n.id === c) > 0 ? 16 : e, mn = ve({
|
|
327
327
|
name: "ElMessage"
|
|
328
|
-
}),
|
|
329
|
-
...
|
|
330
|
-
props:
|
|
331
|
-
emits:
|
|
332
|
-
setup(
|
|
333
|
-
const n =
|
|
334
|
-
let
|
|
335
|
-
const
|
|
336
|
-
const
|
|
337
|
-
return { [a.bm("icon",
|
|
338
|
-
}),
|
|
339
|
-
top: `${
|
|
340
|
-
zIndex:
|
|
328
|
+
}), hn = /* @__PURE__ */ ve({
|
|
329
|
+
...mn,
|
|
330
|
+
props: an,
|
|
331
|
+
emits: rn,
|
|
332
|
+
setup(c, { expose: e, emit: t }) {
|
|
333
|
+
const n = c, { Close: s } = Et, o = T(!1), { ns: a, zIndex: r } = Ct("message"), { currentZIndex: l, nextZIndex: i } = r, d = T(), p = T(!1), E = T(0);
|
|
334
|
+
let f;
|
|
335
|
+
const y = F(() => n.type ? n.type === "error" ? "danger" : n.type : "info"), C = F(() => {
|
|
336
|
+
const m = n.type;
|
|
337
|
+
return { [a.bm("icon", m)]: m && ze[m] };
|
|
338
|
+
}), v = F(() => n.icon || ze[n.type] || ""), w = F(() => ln(n.id)), g = F(() => cn(n.id, n.offset) + w.value), S = F(() => E.value + g.value), A = F(() => ({
|
|
339
|
+
top: `${g.value}px`,
|
|
340
|
+
zIndex: l.value
|
|
341
341
|
}));
|
|
342
|
-
function
|
|
343
|
-
n.duration !== 0 && ({ stop:
|
|
344
|
-
|
|
342
|
+
function M() {
|
|
343
|
+
n.duration !== 0 && ({ stop: f } = Mt(() => {
|
|
344
|
+
D();
|
|
345
345
|
}, n.duration));
|
|
346
346
|
}
|
|
347
|
-
function
|
|
348
|
-
|
|
347
|
+
function u() {
|
|
348
|
+
f?.();
|
|
349
349
|
}
|
|
350
|
-
function
|
|
351
|
-
|
|
352
|
-
var
|
|
353
|
-
|
|
350
|
+
function D() {
|
|
351
|
+
p.value = !1, Ee(() => {
|
|
352
|
+
var m;
|
|
353
|
+
o.value || ((m = n.onClose) == null || m.call(n), t("destroy"));
|
|
354
354
|
});
|
|
355
355
|
}
|
|
356
|
-
function
|
|
357
|
-
|
|
356
|
+
function b({ code: m }) {
|
|
357
|
+
m === Xt.esc && D();
|
|
358
358
|
}
|
|
359
|
-
return
|
|
360
|
-
|
|
361
|
-
}),
|
|
362
|
-
|
|
363
|
-
}),
|
|
364
|
-
|
|
359
|
+
return ot(() => {
|
|
360
|
+
M(), i(), p.value = !0;
|
|
361
|
+
}), ee(() => n.repeatNum, () => {
|
|
362
|
+
u(), M();
|
|
363
|
+
}), Tt(document, "keydown", b), Ht(d, () => {
|
|
364
|
+
E.value = d.value.getBoundingClientRect().height;
|
|
365
365
|
}), e({
|
|
366
|
-
visible:
|
|
367
|
-
bottom:
|
|
368
|
-
close:
|
|
369
|
-
}), (
|
|
370
|
-
name:
|
|
371
|
-
onBeforeEnter: (
|
|
372
|
-
onBeforeLeave:
|
|
373
|
-
onAfterLeave: (
|
|
366
|
+
visible: p,
|
|
367
|
+
bottom: S,
|
|
368
|
+
close: D
|
|
369
|
+
}), (m, I) => (K(), we(Pe, {
|
|
370
|
+
name: L(a).b("fade"),
|
|
371
|
+
onBeforeEnter: (_) => o.value = !0,
|
|
372
|
+
onBeforeLeave: m.onClose,
|
|
373
|
+
onAfterLeave: (_) => m.$emit("destroy"),
|
|
374
374
|
persisted: ""
|
|
375
375
|
}, {
|
|
376
|
-
default:
|
|
377
|
-
|
|
378
|
-
id:
|
|
376
|
+
default: q(() => [
|
|
377
|
+
nt(O("div", {
|
|
378
|
+
id: m.id,
|
|
379
379
|
ref_key: "messageRef",
|
|
380
|
-
ref:
|
|
381
|
-
class:
|
|
382
|
-
|
|
383
|
-
{ [
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
380
|
+
ref: d,
|
|
381
|
+
class: Z([
|
|
382
|
+
L(a).b(),
|
|
383
|
+
{ [L(a).m(m.type)]: m.type },
|
|
384
|
+
L(a).is("closable", m.showClose),
|
|
385
|
+
L(a).is("plain", m.plain),
|
|
386
|
+
m.customClass
|
|
387
387
|
]),
|
|
388
|
-
style:
|
|
388
|
+
style: Re(L(A)),
|
|
389
389
|
role: "alert",
|
|
390
|
-
onMouseenter:
|
|
391
|
-
onMouseleave:
|
|
390
|
+
onMouseenter: u,
|
|
391
|
+
onMouseleave: M
|
|
392
392
|
}, [
|
|
393
|
-
|
|
393
|
+
m.repeatNum > 1 ? (K(), we(L(sn), {
|
|
394
394
|
key: 0,
|
|
395
|
-
value:
|
|
396
|
-
type:
|
|
397
|
-
class:
|
|
398
|
-
}, null, 8, ["value", "type", "class"])) :
|
|
399
|
-
|
|
395
|
+
value: m.repeatNum,
|
|
396
|
+
type: L(y),
|
|
397
|
+
class: Z(L(a).e("badge"))
|
|
398
|
+
}, null, 8, ["value", "type", "class"])) : ne("v-if", !0),
|
|
399
|
+
L(v) ? (K(), we(L(Te), {
|
|
400
400
|
key: 1,
|
|
401
|
-
class:
|
|
401
|
+
class: Z([L(a).e("icon"), L(C)])
|
|
402
402
|
}, {
|
|
403
|
-
default:
|
|
404
|
-
(
|
|
403
|
+
default: q(() => [
|
|
404
|
+
(K(), we(Bt(L(v))))
|
|
405
405
|
]),
|
|
406
406
|
_: 1
|
|
407
|
-
}, 8, ["class"])) :
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
class:
|
|
413
|
-
innerHTML:
|
|
407
|
+
}, 8, ["class"])) : ne("v-if", !0),
|
|
408
|
+
Ie(m.$slots, "default", {}, () => [
|
|
409
|
+
m.dangerouslyUseHTMLString ? (K(), H(be, { key: 1 }, [
|
|
410
|
+
ne(" Caution here, message could've been compromised, never use user's input as message "),
|
|
411
|
+
O("p", {
|
|
412
|
+
class: Z(L(a).e("content")),
|
|
413
|
+
innerHTML: m.message
|
|
414
414
|
}, null, 10, ["innerHTML"])
|
|
415
|
-
], 2112)) : (
|
|
415
|
+
], 2112)) : (K(), H("p", {
|
|
416
416
|
key: 0,
|
|
417
|
-
class:
|
|
418
|
-
},
|
|
417
|
+
class: Z(L(a).e("content"))
|
|
418
|
+
}, pe(m.message), 3))
|
|
419
419
|
]),
|
|
420
|
-
|
|
420
|
+
m.showClose ? (K(), we(L(Te), {
|
|
421
421
|
key: 2,
|
|
422
|
-
class:
|
|
423
|
-
onClick:
|
|
422
|
+
class: Z(L(a).e("closeBtn")),
|
|
423
|
+
onClick: Nt(D, ["stop"])
|
|
424
424
|
}, {
|
|
425
|
-
default:
|
|
426
|
-
|
|
425
|
+
default: q(() => [
|
|
426
|
+
J(L(s))
|
|
427
427
|
]),
|
|
428
428
|
_: 1
|
|
429
|
-
}, 8, ["class", "onClick"])) :
|
|
429
|
+
}, 8, ["class", "onClick"])) : ne("v-if", !0)
|
|
430
430
|
], 46, ["id"]), [
|
|
431
|
-
[
|
|
431
|
+
[st, p.value]
|
|
432
432
|
])
|
|
433
433
|
]),
|
|
434
434
|
_: 3
|
|
435
435
|
}, 8, ["name", "onBeforeEnter", "onBeforeLeave", "onAfterLeave"]));
|
|
436
436
|
}
|
|
437
437
|
});
|
|
438
|
-
var
|
|
439
|
-
let
|
|
440
|
-
const
|
|
441
|
-
const e = !
|
|
442
|
-
...
|
|
438
|
+
var un = /* @__PURE__ */ et(hn, [["__file", "message.vue"]]);
|
|
439
|
+
let pn = 1;
|
|
440
|
+
const lt = (c) => {
|
|
441
|
+
const e = !c || je(c) || at(c) || _e(c) ? { message: c } : c, t = {
|
|
442
|
+
...Q,
|
|
443
443
|
...e
|
|
444
444
|
};
|
|
445
445
|
if (!t.appendTo)
|
|
446
446
|
t.appendTo = document.body;
|
|
447
|
-
else if (
|
|
447
|
+
else if (je(t.appendTo)) {
|
|
448
448
|
let n = document.querySelector(t.appendTo);
|
|
449
|
-
|
|
449
|
+
Lt(n) || (n = document.body), t.appendTo = n;
|
|
450
450
|
}
|
|
451
|
-
return
|
|
452
|
-
},
|
|
453
|
-
const e =
|
|
451
|
+
return Se(U.grouping) && !t.grouping && (t.grouping = U.grouping), xe(U.duration) && t.duration === 3e3 && (t.duration = U.duration), xe(U.offset) && t.offset === 16 && (t.offset = U.offset), Se(U.showClose) && !t.showClose && (t.showClose = U.showClose), Se(U.plain) && !t.plain && (t.plain = U.plain), t;
|
|
452
|
+
}, gn = (c) => {
|
|
453
|
+
const e = $.indexOf(c);
|
|
454
454
|
if (e === -1)
|
|
455
455
|
return;
|
|
456
|
-
|
|
457
|
-
const { handler: t } =
|
|
456
|
+
$.splice(e, 1);
|
|
457
|
+
const { handler: t } = c;
|
|
458
458
|
t.close();
|
|
459
|
-
},
|
|
460
|
-
const n = `message_${
|
|
459
|
+
}, vn = ({ appendTo: c, ...e }, t) => {
|
|
460
|
+
const n = `message_${pn++}`, s = e.onClose, o = document.createElement("div"), a = {
|
|
461
461
|
...e,
|
|
462
462
|
id: n,
|
|
463
463
|
onClose: () => {
|
|
464
|
-
|
|
464
|
+
s?.(), gn(d);
|
|
465
465
|
},
|
|
466
466
|
onDestroy: () => {
|
|
467
|
-
|
|
467
|
+
Qe(null, o);
|
|
468
468
|
}
|
|
469
|
-
},
|
|
470
|
-
default:
|
|
469
|
+
}, r = J(un, a, _e(a.message) || at(a.message) ? {
|
|
470
|
+
default: _e(a.message) ? a.message : () => a.message
|
|
471
471
|
} : null);
|
|
472
|
-
|
|
473
|
-
const
|
|
472
|
+
r.appContext = t || ge._context, Qe(r, o), c.appendChild(o.firstElementChild);
|
|
473
|
+
const l = r.component, d = {
|
|
474
474
|
id: n,
|
|
475
|
-
vnode:
|
|
476
|
-
vm:
|
|
475
|
+
vnode: r,
|
|
476
|
+
vm: l,
|
|
477
477
|
handler: {
|
|
478
478
|
close: () => {
|
|
479
|
-
|
|
479
|
+
l.exposed.close();
|
|
480
480
|
}
|
|
481
481
|
},
|
|
482
|
-
props:
|
|
482
|
+
props: r.component.props
|
|
483
483
|
};
|
|
484
|
-
return
|
|
485
|
-
},
|
|
486
|
-
if (!
|
|
484
|
+
return d;
|
|
485
|
+
}, ge = (c = {}, e) => {
|
|
486
|
+
if (!Be)
|
|
487
487
|
return { close: () => {
|
|
488
488
|
} };
|
|
489
|
-
const t =
|
|
490
|
-
if (t.grouping &&
|
|
491
|
-
const
|
|
489
|
+
const t = lt(c);
|
|
490
|
+
if (t.grouping && $.length) {
|
|
491
|
+
const s = $.find(({ vnode: o }) => {
|
|
492
492
|
var a;
|
|
493
|
-
return ((a =
|
|
493
|
+
return ((a = o.props) == null ? void 0 : a.message) === t.message;
|
|
494
494
|
});
|
|
495
|
-
if (
|
|
496
|
-
return
|
|
495
|
+
if (s)
|
|
496
|
+
return s.props.repeatNum += 1, s.props.type = t.type, s.handler;
|
|
497
497
|
}
|
|
498
|
-
if (
|
|
498
|
+
if (xe(U.max) && $.length >= U.max)
|
|
499
499
|
return { close: () => {
|
|
500
500
|
} };
|
|
501
|
-
const n =
|
|
502
|
-
return
|
|
501
|
+
const n = vn(t, e);
|
|
502
|
+
return $.push(n), n.handler;
|
|
503
503
|
};
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
const n =
|
|
507
|
-
return
|
|
504
|
+
dt.forEach((c) => {
|
|
505
|
+
ge[c] = (e = {}, t) => {
|
|
506
|
+
const n = lt(e);
|
|
507
|
+
return ge({ ...n, type: c }, t);
|
|
508
508
|
};
|
|
509
509
|
});
|
|
510
|
-
function
|
|
511
|
-
const e = [
|
|
510
|
+
function fn(c) {
|
|
511
|
+
const e = [...$];
|
|
512
512
|
for (const t of e)
|
|
513
|
-
(!
|
|
513
|
+
(!c || c === t.props.type) && t.handler.close();
|
|
514
514
|
}
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
const
|
|
518
|
-
class
|
|
515
|
+
ge.closeAll = fn;
|
|
516
|
+
ge._context = null;
|
|
517
|
+
const B = It(ge, "$message");
|
|
518
|
+
class W extends Oe {
|
|
519
519
|
_renderer;
|
|
520
520
|
get renderer() {
|
|
521
521
|
return this._renderer || (this._renderer = this.parent?.findComponentByName("Renderer")), this._renderer;
|
|
@@ -582,9 +582,9 @@ class N extends Ce {
|
|
|
582
582
|
*/
|
|
583
583
|
createCursor(e) {
|
|
584
584
|
return (t, n) => {
|
|
585
|
-
const
|
|
585
|
+
const s = this.domElement.style.cursor;
|
|
586
586
|
this.domElement.style.cursor = e, this.addEventRecord("clear", () => {
|
|
587
|
-
this.domElement.style.cursor =
|
|
587
|
+
this.domElement.style.cursor = s ?? "default";
|
|
588
588
|
}), t(n);
|
|
589
589
|
};
|
|
590
590
|
}
|
|
@@ -597,10 +597,46 @@ class N extends Ce {
|
|
|
597
597
|
this.canceEventRecord("clear"), e.forEach((t) => this.canceEventRecord(t));
|
|
598
598
|
};
|
|
599
599
|
}
|
|
600
|
+
/**
|
|
601
|
+
* 创建鼠标移动
|
|
602
|
+
* @param callBack
|
|
603
|
+
* @returns
|
|
604
|
+
*/
|
|
605
|
+
createPointerMove(e) {
|
|
606
|
+
const t = this.editor, n = new R();
|
|
607
|
+
let s = null, o = null, a = null;
|
|
608
|
+
const r = t.addEventListener("pointerPositionChange", () => {
|
|
609
|
+
const l = R.from(t.pointerPosition);
|
|
610
|
+
if (s && t.eventInput.isKeyDown("shift")) {
|
|
611
|
+
const i = Math.abs(l.x - s.x), d = Math.abs(l.y - s.y);
|
|
612
|
+
i > d ? n.set(l.x, s.y) : n.set(s.x, l.y), e(n, !1);
|
|
613
|
+
} else if (o && a && t.eventInput.isKeyDown("alt")) {
|
|
614
|
+
const i = o.projectPoint(l, !1), d = a.projectPoint(l, !1);
|
|
615
|
+
i && d ? l.distance(i) < l.distance(d) ? n.copy(i) : n.copy(d) : i ? n.copy(i) : d && n.copy(d), e(n, !1);
|
|
616
|
+
} else {
|
|
617
|
+
const { point: i, find: d } = t.renderManager.adsorption();
|
|
618
|
+
n.copy(i), e(n, d);
|
|
619
|
+
}
|
|
620
|
+
});
|
|
621
|
+
return {
|
|
622
|
+
destroy() {
|
|
623
|
+
r();
|
|
624
|
+
},
|
|
625
|
+
setBaseLine(l, i) {
|
|
626
|
+
if (o = l, s = i, l && i) {
|
|
627
|
+
const d = l.normal();
|
|
628
|
+
a = new z(
|
|
629
|
+
i.clone().add(d.clone().multiplyScalar(10)),
|
|
630
|
+
i.clone().add(d.multiplyScalar(-10))
|
|
631
|
+
);
|
|
632
|
+
} else a = null;
|
|
633
|
+
}
|
|
634
|
+
};
|
|
635
|
+
}
|
|
600
636
|
}
|
|
601
|
-
class
|
|
637
|
+
class yn extends W {
|
|
602
638
|
static name = "DrawLine";
|
|
603
|
-
container = new
|
|
639
|
+
container = new h.Group();
|
|
604
640
|
interruptKeys = ["escape"];
|
|
605
641
|
withdrawalKeys = ["control", "z"];
|
|
606
642
|
shortcutKeys = ["control", "l"];
|
|
@@ -615,50 +651,47 @@ class vn extends N {
|
|
|
615
651
|
* @param next
|
|
616
652
|
*/
|
|
617
653
|
selectPoint(e) {
|
|
618
|
-
let t = this.parent?.findComponentByName("Editor"), n = null,
|
|
619
|
-
new
|
|
620
|
-
new
|
|
621
|
-
new
|
|
622
|
-
new
|
|
654
|
+
let t = this.parent?.findComponentByName("Editor"), n = null, s = null, o = [], a = new h.Mesh(new h.SphereGeometry(0.04), new h.MeshBasicMaterial({ color: 65280 })), r = t.domContainer.domElement, l = new Ce([], 16711935), i = new Ce([
|
|
655
|
+
new h.Vector3(-1e4, 0, 0),
|
|
656
|
+
new h.Vector3(1e4, 0, 0),
|
|
657
|
+
new h.Vector3(0, -1e4, 0),
|
|
658
|
+
new h.Vector3(0, 1e4, 0)
|
|
623
659
|
], 16711935);
|
|
624
|
-
|
|
660
|
+
i.material = new h.LineDashedMaterial({
|
|
625
661
|
color: 4235007,
|
|
626
662
|
dashSize: 0.1,
|
|
627
663
|
gapSize: 0.1,
|
|
628
664
|
linewidth: 0.1
|
|
629
|
-
}), this.container.add(
|
|
630
|
-
const
|
|
631
|
-
|
|
632
|
-
},
|
|
665
|
+
}), this.container.add(l);
|
|
666
|
+
const d = () => {
|
|
667
|
+
l.setPoint(...o, n, s), i.position.copy(s), this.container.add(i), i.computeLineDistances();
|
|
668
|
+
}, p = new h.Vector3(), E = this.createPointerMove((f, y) => {
|
|
669
|
+
p.set(f.x, f.y, 0), this.dispatchEvent({ type: "pointerMove", point: p }), y ? (a.position.set(f.x, f.y, 0), this.container.add(a), r.style.cursor = "none") : (a.removeFromParent(), r.style.cursor = "crosshair"), n && s && (d(), s.copy(p));
|
|
670
|
+
});
|
|
633
671
|
this.addEventRecord(
|
|
634
672
|
"clear",
|
|
635
|
-
|
|
636
|
-
const { point: w, find: p } = t.renderManager.adsorption();
|
|
637
|
-
if (this.dispatchEvent({ type: "pointerMove", point: w }), p ? (a.position.set(w.x, w.y, 0), this.container.add(a), d.style.cursor = "none") : (a.removeFromParent(), d.style.cursor = "crosshair"), h.copy(w), !!(n && o)) {
|
|
638
|
-
if (t.eventInput.isKeyDown("shift")) {
|
|
639
|
-
const x = Math.abs(t.pointerPosition.x - n.x), y = Math.abs(t.pointerPosition.y - n.y);
|
|
640
|
-
x > y ? o.set(t.pointerPosition.x, n.y, 0) : o.set(n.x, t.pointerPosition.y, 0), l(), h.copy(o);
|
|
641
|
-
return;
|
|
642
|
-
}
|
|
643
|
-
o.set(t.pointerPosition.x, t.pointerPosition.y, 0), l();
|
|
644
|
-
}
|
|
645
|
-
}),
|
|
673
|
+
() => E.destroy(),
|
|
646
674
|
t.eventInput.addEventListener("codeChange", async () => {
|
|
647
675
|
if (t.eventInput.isKeyDown("mouse_0")) {
|
|
648
676
|
if (!n) {
|
|
649
|
-
n =
|
|
677
|
+
n = p.clone(), s = p.clone(), d(), E.setBaseLine(null, R.from(n));
|
|
650
678
|
return;
|
|
651
679
|
}
|
|
652
|
-
|
|
680
|
+
s = p.clone(), o.push(n.clone(), s.clone());
|
|
681
|
+
const f = new z(R.from(n), R.from(s));
|
|
682
|
+
E.setBaseLine(f, f.end), n.copy(s), d();
|
|
653
683
|
} else if (t.eventInput.isOnlyKeyDowns(this.withdrawalKeys)) {
|
|
654
|
-
if (
|
|
655
|
-
const { point:
|
|
656
|
-
|
|
684
|
+
if (o.length) {
|
|
685
|
+
const { point: f } = t.renderManager.adsorption();
|
|
686
|
+
if (o.pop(), s?.copy(f), n?.copy(o.pop()), d(), o.length >= 2) {
|
|
687
|
+
const y = new z(R.from(o[o.length - 2]), R.from(o[o.length - 1]));
|
|
688
|
+
E.setBaseLine(y, y.end);
|
|
689
|
+
}
|
|
657
690
|
}
|
|
658
|
-
} else t.eventInput.isKeyDowns(this.confirmKeys) && e(
|
|
691
|
+
} else t.eventInput.isKeyDowns(this.confirmKeys) && e(o);
|
|
659
692
|
}),
|
|
660
693
|
function() {
|
|
661
|
-
|
|
694
|
+
l.removeFromParent(), a.removeFromParent(), i.removeFromParent();
|
|
662
695
|
}
|
|
663
696
|
);
|
|
664
697
|
}
|
|
@@ -667,8 +700,8 @@ class vn extends N {
|
|
|
667
700
|
*/
|
|
668
701
|
end(e, t) {
|
|
669
702
|
const n = [];
|
|
670
|
-
for (let
|
|
671
|
-
n.push(new
|
|
703
|
+
for (let s = 0; s < t.length; s += 2)
|
|
704
|
+
n.push(new z(R.from(t[s]), R.from(t[s + 1])));
|
|
672
705
|
e(n);
|
|
673
706
|
}
|
|
674
707
|
/** 执行完成
|
|
@@ -690,21 +723,17 @@ class vn extends N {
|
|
|
690
723
|
return this.completed(e), e;
|
|
691
724
|
}
|
|
692
725
|
}
|
|
693
|
-
class
|
|
726
|
+
class Ke extends W {
|
|
694
727
|
static name = "Default";
|
|
695
|
-
|
|
696
|
-
return this.parent?.findComponentByName("Editor");
|
|
697
|
-
}
|
|
698
|
-
renderer;
|
|
699
|
-
container = new m.Group();
|
|
728
|
+
container = new h.Group();
|
|
700
729
|
onAddFromParent() {
|
|
701
730
|
const e = this.editor, t = e.commandManager;
|
|
702
|
-
|
|
731
|
+
e.container.add(this.container), t.addCommandFlow("default").add(this.start.bind(this)).addEventListener("finally", this.finally.bind(this)), t.addEventListener("startedBefore", (n) => {
|
|
703
732
|
n.currentName === "default" && n.name !== "default" && t.cancel();
|
|
704
733
|
}), t.addEventListener("finally", (n) => n.name !== "default" && t.start("default")), e.eventInput.addCancelDefaultBehavior(() => e.eventInput.isOnlyKeyDowns(["control", "g"]));
|
|
705
734
|
}
|
|
706
735
|
selectLines = [];
|
|
707
|
-
selectLineObject3D = new
|
|
736
|
+
selectLineObject3D = new h.Mesh();
|
|
708
737
|
/** 添加选择的线段
|
|
709
738
|
* @param lineSegment
|
|
710
739
|
*/
|
|
@@ -747,70 +776,70 @@ class Se extends Ce {
|
|
|
747
776
|
* @param next
|
|
748
777
|
*/
|
|
749
778
|
start() {
|
|
750
|
-
const e = this.editor, t = e.eventInput, n = new
|
|
751
|
-
let
|
|
752
|
-
n.position.z = 1e-3, this.selectLineObject3D.position.z = n.position.z + 1e-3, n.material = new
|
|
779
|
+
const e = this.editor, t = e.eventInput, n = new h.Mesh(), s = e.domContainer.domElement;
|
|
780
|
+
let o = null;
|
|
781
|
+
n.position.z = 1e-3, this.selectLineObject3D.position.z = n.position.z + 1e-3, n.material = new h.MeshBasicMaterial({ color: 55561 });
|
|
753
782
|
const a = () => {
|
|
754
|
-
const
|
|
755
|
-
this.container.add(
|
|
783
|
+
const r = e.pointerPosition.clone(), l = e.pointerPosition.clone(), i = new h.Mesh();
|
|
784
|
+
this.container.add(i), i.position.z = 0.05, i.material = new h.MeshBasicMaterial({
|
|
756
785
|
color: 16777215,
|
|
757
786
|
transparent: !0,
|
|
758
787
|
opacity: 0.5
|
|
759
788
|
});
|
|
760
|
-
const
|
|
761
|
-
const
|
|
762
|
-
|
|
763
|
-
|
|
789
|
+
const d = () => {
|
|
790
|
+
const f = Math.min(r.x, l.x), y = Math.max(r.x, l.x), C = Math.min(r.y, l.y), v = Math.max(r.y, l.y), w = [
|
|
791
|
+
f,
|
|
792
|
+
v,
|
|
764
793
|
0,
|
|
765
|
-
x,
|
|
766
794
|
y,
|
|
795
|
+
C,
|
|
767
796
|
0,
|
|
768
|
-
|
|
769
|
-
|
|
797
|
+
y,
|
|
798
|
+
v,
|
|
770
799
|
0,
|
|
771
|
-
|
|
772
|
-
|
|
800
|
+
f,
|
|
801
|
+
v,
|
|
773
802
|
0,
|
|
774
|
-
|
|
775
|
-
|
|
803
|
+
f,
|
|
804
|
+
C,
|
|
776
805
|
0,
|
|
777
|
-
x,
|
|
778
806
|
y,
|
|
807
|
+
C,
|
|
779
808
|
0
|
|
780
809
|
];
|
|
781
|
-
|
|
782
|
-
},
|
|
783
|
-
|
|
784
|
-
},
|
|
785
|
-
document.removeEventListener("mousemove",
|
|
786
|
-
const
|
|
787
|
-
this.removeSelectLineAll(),
|
|
810
|
+
i.geometry = e.renderManager.createGeometry({ position: w }, w.length / 3);
|
|
811
|
+
}, p = () => {
|
|
812
|
+
l.copy(e.pointerPosition), d();
|
|
813
|
+
}, E = () => {
|
|
814
|
+
document.removeEventListener("mousemove", p), document.removeEventListener("mouseup", E), i.removeFromParent();
|
|
815
|
+
const f = Math.min(r.x, l.x), y = Math.max(r.x, l.x), C = Math.min(r.y, l.y), v = Math.max(r.y, l.y), w = new Me(f, y, C, v), g = e.renderManager.quadtree.queryBox(w);
|
|
816
|
+
this.removeSelectLineAll(), g.forEach((S) => this.addSelectLine(S.line)), this.updateSelectLinesGeometry();
|
|
788
817
|
};
|
|
789
|
-
document.addEventListener("mousemove",
|
|
818
|
+
document.addEventListener("mousemove", p), document.addEventListener("mouseup", E);
|
|
790
819
|
};
|
|
791
820
|
this.addEventRecord(
|
|
792
821
|
"clear",
|
|
793
822
|
// 注册鼠标指针位置变化事件
|
|
794
823
|
e.addEventListener("pointerPositionChange", () => {
|
|
795
|
-
const { line:
|
|
796
|
-
if (
|
|
797
|
-
const
|
|
798
|
-
n.geometry = e.renderManager.createGeometry({ position:
|
|
824
|
+
const { line: r } = e.renderManager.adsorption();
|
|
825
|
+
if (r) {
|
|
826
|
+
const l = r.expandToRectangle(0.025, "bothSides");
|
|
827
|
+
n.geometry = e.renderManager.createGeometry({ position: l.createGeometry() }, 6), this.container.add(n), s.style.cursor = "pointer", o = r;
|
|
799
828
|
} else
|
|
800
|
-
n.removeFromParent(),
|
|
829
|
+
n.removeFromParent(), s.style.cursor = "default", o = null;
|
|
801
830
|
}),
|
|
802
831
|
t.addEventListener("codeChange", () => {
|
|
803
832
|
if (t.isKeyDown("mouse_0")) {
|
|
804
|
-
if (!
|
|
833
|
+
if (!o) return a();
|
|
805
834
|
if (t.isKeyDown("alt"))
|
|
806
|
-
return this.removeSelectLine(
|
|
807
|
-
t.isKeyDown("control") || this.removeSelectLineAll(), this.addSelectLine(
|
|
835
|
+
return this.removeSelectLine(o);
|
|
836
|
+
t.isKeyDown("control") || this.removeSelectLineAll(), this.addSelectLine(o);
|
|
808
837
|
} else if (t.isKeyDown("mouse_1")) {
|
|
809
|
-
if (!
|
|
810
|
-
this.removeSelectLine(
|
|
838
|
+
if (!o) return;
|
|
839
|
+
this.removeSelectLine(o);
|
|
811
840
|
} else if (t.isKeyDown("mouse_2")) {
|
|
812
|
-
if (!
|
|
813
|
-
this.addSelectLine(
|
|
841
|
+
if (!o) return;
|
|
842
|
+
this.addSelectLine(o);
|
|
814
843
|
} else t.isKeyDowns(["control", "z"]) ? e.commandManager.rollback() : t.isKeyDowns(["control", "y"]) && e.commandManager.revokeRollback();
|
|
815
844
|
}),
|
|
816
845
|
function() {
|
|
@@ -825,7 +854,7 @@ class Se extends Ce {
|
|
|
825
854
|
this.canceEventRecord("clear"), this.removeSelectLineAll(), this.updateSelectLinesGeometry();
|
|
826
855
|
}
|
|
827
856
|
}
|
|
828
|
-
class
|
|
857
|
+
class wn extends tt {
|
|
829
858
|
list = [];
|
|
830
859
|
rollbacklist = [];
|
|
831
860
|
revokeRollbacklist = [];
|
|
@@ -853,7 +882,7 @@ class fn extends Xe {
|
|
|
853
882
|
return this.revokeRollbacklist.push(e), this;
|
|
854
883
|
}
|
|
855
884
|
}
|
|
856
|
-
class
|
|
885
|
+
class bn extends tt {
|
|
857
886
|
commandFlowMap = /* @__PURE__ */ new Map();
|
|
858
887
|
lock = !1;
|
|
859
888
|
abortController = null;
|
|
@@ -880,7 +909,7 @@ class yn extends Xe {
|
|
|
880
909
|
*/
|
|
881
910
|
addCommandFlow(e) {
|
|
882
911
|
if (this.commandFlowMap.has(e)) throw new Error(`${e} 命令已经存在`);
|
|
883
|
-
const t = new
|
|
912
|
+
const t = new wn();
|
|
884
913
|
return this.commandFlowMap.set(e, t), t;
|
|
885
914
|
}
|
|
886
915
|
executionPromise = null;
|
|
@@ -897,25 +926,25 @@ class yn extends Xe {
|
|
|
897
926
|
currentName: this.currentName
|
|
898
927
|
}), this.executionPromise && await this.executionPromise, this.executionPromise = null, this.lock)
|
|
899
928
|
throw new Error("命令管理器已被 " + this.currentName + " 命令锁定,无法启动新的命令流,请退出或等待命令执行结束");
|
|
900
|
-
const
|
|
901
|
-
if (!
|
|
929
|
+
const s = this.commandFlowMap.get(e);
|
|
930
|
+
if (!s)
|
|
902
931
|
throw new Error(`命令流 ${e} 不存在`);
|
|
903
|
-
this.lock = !0, this.abortController = new AbortController(), this.currentName = e,
|
|
932
|
+
this.lock = !0, this.abortController = new AbortController(), this.currentName = e, s.dispatchEvent({ type: "started" }), this.dispatchEvent({ type: "started", name: e });
|
|
904
933
|
try {
|
|
905
|
-
for (let
|
|
906
|
-
const a =
|
|
907
|
-
if (
|
|
908
|
-
this.resolve =
|
|
934
|
+
for (let o = n; o < s.list.length; o++) {
|
|
935
|
+
const a = s.list[o];
|
|
936
|
+
if (s.dispatchEvent({ type: "executing", index: o }), this.dispatchEvent({ type: "executing", name: e, index: o }), t = await new Promise((r) => {
|
|
937
|
+
this.resolve = r, a(r, t);
|
|
909
938
|
}), this.abortController.signal.aborted) {
|
|
910
|
-
|
|
939
|
+
s.dispatchEvent({ type: "executionInterrupt", index: o }), this.dispatchEvent({ type: "executionInterrupt", name: e, index: o }), this.dispatchEvent({ type: "cancel", name: e });
|
|
911
940
|
break;
|
|
912
941
|
} else
|
|
913
|
-
|
|
942
|
+
s.dispatchEvent({ type: "executionCompleted", index: o, data: t }), this.dispatchEvent({ type: "executionCompleted", name: e, index: o, data: t });
|
|
914
943
|
}
|
|
915
|
-
} catch (
|
|
916
|
-
console.error(
|
|
944
|
+
} catch (o) {
|
|
945
|
+
console.error(o);
|
|
917
946
|
} finally {
|
|
918
|
-
this.abortController && !this.abortController.signal.aborted && (
|
|
947
|
+
this.abortController && !this.abortController.signal.aborted && (s.dispatchEvent({ type: "completed", data: t }), this.dispatchEvent({ type: "completed", name: e, data: t }), s.writeOperationList && (this.operationList.push({ name: e, data: t }), this.rollbackList.length = 0)), this.lock = !1, this.abortController = null, this.currentName = null, s.dispatchEvent({ type: "finally" }), this.dispatchEvent({ type: "finally", name: e }), this.executionResolve && (this.executionResolve(null), this.executionResolve = null);
|
|
919
948
|
}
|
|
920
949
|
return t;
|
|
921
950
|
}
|
|
@@ -933,7 +962,7 @@ class yn extends Xe {
|
|
|
933
962
|
if (!e) return !1;
|
|
934
963
|
const t = this.commandFlowMap.get(e.name);
|
|
935
964
|
if (!t) return !1;
|
|
936
|
-
const n = t.rollbacklist.reduce((
|
|
965
|
+
const n = t.rollbacklist.reduce((s, o) => o(s), e.data);
|
|
937
966
|
return this.dispatchEvent({ type: "rollback", name: e.name }), this.rollbackList.push({
|
|
938
967
|
data: n,
|
|
939
968
|
name: e.name
|
|
@@ -951,73 +980,72 @@ class yn extends Xe {
|
|
|
951
980
|
if (!e) return !1;
|
|
952
981
|
const t = this.commandFlowMap.get(e.name);
|
|
953
982
|
if (!t) return !1;
|
|
954
|
-
const n = t.revokeRollbacklist.reduce((
|
|
983
|
+
const n = t.revokeRollbacklist.reduce((s, o) => o(s), e.data);
|
|
955
984
|
return this.dispatchEvent({ type: "revokeRollback", name: e.name }), this.operationList.push({ name: e.name, data: n }), !0;
|
|
956
985
|
} catch (e) {
|
|
957
986
|
throw new Error(`撤回回滚失败:${e}`);
|
|
958
987
|
}
|
|
959
988
|
}
|
|
960
989
|
}
|
|
961
|
-
const
|
|
990
|
+
const xn = "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='5569'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20fill='%23555'%20width='16'%20height='16'%3e%3cpath%20d='M522.1888%20811.3152a412.1088%20412.1088%200%200%200-114.5344-269.7728l-244.48%20269.7728h359.0144zM450.816%20493.824c83.5072%2085.3504%20132.7104%20197.4784%20136.5504%20317.4912h417.5872v63.232H18.9952L676.1472%20149.4016l48.9472%2041.7792-274.2784%20302.6432z'%20%3e%3c/path%3e%3c/svg%3e", Cn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
962
991
|
__proto__: null,
|
|
963
|
-
default:
|
|
964
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
965
|
-
__proto__: null,
|
|
966
|
-
default: Cn
|
|
967
|
-
}, Symbol.toStringTag, { value: "Module" })), En = "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='8193'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20fill='%23555'%20width='16'%20height='16'%3e%3cpath%20d='M426.666667%20255.872c0%2031.232-8.405333%2060.544-23.04%2085.76L512%20451.498667l287.061333-287.061334a85.333333%2085.333333%200%200%201%20120.661334%200l-516.693334%20516.693334a170.666667%20170.666667%200%201%201-60.330666-60.330667l108.970666-108.970667-108.970666-108.970666A170.666667%20170.666667%200%201%201%20426.666667%20255.872z%20m-85.333334%200a85.333333%2085.333333%200%201%200-170.666666%200%2085.333333%2085.333333%200%200%200%20170.666666%200z%20m578.389334%20603.392a85.333333%2085.333333%200%200%201-120.661334%200l-226.858666-226.858667%2060.373333-60.330666%20287.146667%20287.146666zM682.666667%20469.205333h85.333333v85.333334h-85.333333v-85.333334z%20m170.666666%200h85.333334v85.333334h-85.333334v-85.333334z%20m-597.333333%200h85.333333v85.333334H256v-85.333334z%20m-170.666667%200h85.333334v85.333334H85.333333v-85.333334z%20m170.666667%20384a85.333333%2085.333333%200%201%200%200-170.666666%2085.333333%2085.333333%200%200%200%200%20170.666666z'%3e%3c/path%3e%3c/svg%3e", Mn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
992
|
+
default: xn
|
|
993
|
+
}, Symbol.toStringTag, { value: "Module" })), En = "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", Mn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
968
994
|
__proto__: null,
|
|
969
995
|
default: En
|
|
970
|
-
}, Symbol.toStringTag, { value: "Module" })), Ln = "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='
|
|
996
|
+
}, 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%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20p-id='8193'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20fill='%23555'%20width='16'%20height='16'%3e%3cpath%20d='M426.666667%20255.872c0%2031.232-8.405333%2060.544-23.04%2085.76L512%20451.498667l287.061333-287.061334a85.333333%2085.333333%200%200%201%20120.661334%200l-516.693334%20516.693334a170.666667%20170.666667%200%201%201-60.330666-60.330667l108.970666-108.970667-108.970666-108.970666A170.666667%20170.666667%200%201%201%20426.666667%20255.872z%20m-85.333334%200a85.333333%2085.333333%200%201%200-170.666666%200%2085.333333%2085.333333%200%200%200%20170.666666%200z%20m578.389334%20603.392a85.333333%2085.333333%200%200%201-120.661334%200l-226.858666-226.858667%2060.373333-60.330666%20287.146667%20287.146666zM682.666667%20469.205333h85.333333v85.333334h-85.333333v-85.333334z%20m170.666666%200h85.333334v85.333334h-85.333334v-85.333334z%20m-597.333333%200h85.333333v85.333334H256v-85.333334z%20m-170.666667%200h85.333334v85.333334H85.333333v-85.333334z%20m170.666667%20384a85.333333%2085.333333%200%201%200%200-170.666666%2085.333333%2085.333333%200%200%200%200%20170.666666z'%3e%3c/path%3e%3c/svg%3e", In = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
971
997
|
__proto__: null,
|
|
972
998
|
default: Ln
|
|
973
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
999
|
+
}, Symbol.toStringTag, { value: "Module" })), Pn = "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", kn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
974
1000
|
__proto__: null,
|
|
975
|
-
default:
|
|
976
|
-
}, Symbol.toStringTag, { value: "Module" })), Dn = "data:image/svg+xml,%
|
|
1001
|
+
default: Pn
|
|
1002
|
+
}, Symbol.toStringTag, { value: "Module" })), Dn = "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", Sn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
977
1003
|
__proto__: null,
|
|
978
1004
|
default: Dn
|
|
979
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
1005
|
+
}, Symbol.toStringTag, { value: "Module" })), An = "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='1757902601497'%20class='icon'%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20p-id='9801'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20width='200'%20height='200'%3e%3cpath%20d='M761.344%20119.296H226.816c-18.944%200-39.424%2011.776-39.424%2030.72V921.6h614.4V148.48c0.512-18.944-22.016-29.184-40.448-29.184z%20m-537.6%20768c-2.048%200-2.048%200%200%200L221.696%20163.84c0-5.12%205.12-10.24%2010.24-10.24h522.24c8.704%200%2013.824%205.12%2013.824%2013.824v720.384s0%201.536-1.536%201.536h-15.36V194.56c0-16.896-8.704-24.064-29.184-24.064H266.24c-18.944%200-27.136%208.704-27.136%2024.064v692.736h-15.36z%20m49.152%200V204.8H716.8v682.496H272.896z'%20p-id='9802'%3e%3c/path%3e%3cpath%20d='M648.704%20508.416c-16.896%200-32.256%2013.824-32.256%2032.256%200%2016.896%2013.824%2032.256%2032.256%2032.256s32.256-13.824%2032.256-32.256c0-16.896-13.824-32.256-32.256-32.256z'%20p-id='9803'%3e%3c/path%3e%3c/svg%3e", _n = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
980
1006
|
__proto__: null,
|
|
981
|
-
default:
|
|
982
|
-
}, Symbol.toStringTag, { value: "Module" })), Bn = "data:image/svg+xml,%
|
|
1007
|
+
default: An
|
|
1008
|
+
}, Symbol.toStringTag, { value: "Module" })), Bn = "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", Nn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
983
1009
|
__proto__: null,
|
|
984
1010
|
default: Bn
|
|
985
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
1011
|
+
}, 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%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", Rn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
986
1012
|
__proto__: null,
|
|
987
|
-
default:
|
|
988
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
1013
|
+
default: On
|
|
1014
|
+
}, Symbol.toStringTag, { value: "Module" })), Kn = "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", Fn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
989
1015
|
__proto__: null,
|
|
990
|
-
default:
|
|
991
|
-
}, Symbol.toStringTag, { value: "Module" })), zn = "data:image/svg+xml,%3csvg%20viewBox='0%200%
|
|
1016
|
+
default: Kn
|
|
1017
|
+
}, Symbol.toStringTag, { value: "Module" })), zn = "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", Tn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
992
1018
|
__proto__: null,
|
|
993
1019
|
default: zn
|
|
994
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
1020
|
+
}, Symbol.toStringTag, { value: "Module" })), jn = "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", Vn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
995
1021
|
__proto__: null,
|
|
996
|
-
default:
|
|
997
|
-
}, Symbol.toStringTag, { value: "Module" })), Gn = "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%
|
|
1022
|
+
default: jn
|
|
1023
|
+
}, Symbol.toStringTag, { value: "Module" })), Gn = "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", Qn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
998
1024
|
__proto__: null,
|
|
999
1025
|
default: Gn
|
|
1000
|
-
}, Symbol.toStringTag, { value: "Module" })), Hn = "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='
|
|
1026
|
+
}, Symbol.toStringTag, { value: "Module" })), Hn = "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", Wn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1001
1027
|
__proto__: null,
|
|
1002
1028
|
default: Hn
|
|
1003
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
1029
|
+
}, Symbol.toStringTag, { value: "Module" })), Jn = "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='10587'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20fill='%23555'%20width='16'%20height='16'%3e%3cpath%20d='M64.21%20703.88h888.34M64.21%20667.88h888.34v72H64.21z'%3e%3c/path%3e%3cpath%20d='M509.58%20102.72v566.13M473.58%20102.72h72v566.14h-72z'%3e%3c/path%3e%3c/svg%3e", Un = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1004
1030
|
__proto__: null,
|
|
1005
|
-
default:
|
|
1006
|
-
}, Symbol.toStringTag, { value: "Module" })), qn = "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='
|
|
1031
|
+
default: Jn
|
|
1032
|
+
}, Symbol.toStringTag, { value: "Module" })), qn = "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='1759051895215'%20class='icon'%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20p-id='1800'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20width='200'%20height='200'%3e%3cpath%20d='M272.5888%20886.784v70.8608H203.2128V886.784h69.376z%20m416.256-256.6144l270.6944%20152.5248-270.6944%20148.1216v-114.8928H64.4608v-70.8608h624.384v-114.8928z%20m-416.256-26.88v70.912H203.2128v-70.912h69.376z%20m0-141.7216V532.48H203.2128V461.568h69.376z%20m-34.7136-398.336L385.024%20319.7952H272.5888V390.656H203.2128V319.8464H90.7776l147.0976-256.6656z'%20fill='%23444444'%20p-id='1801'%3e%3c/path%3e%3cpath%20d='M566.272%2073.3184l173.2608%20264.192V512h71.8848V337.5104l173.2608-264.192H898.048l-122.2656%20197.2224-122.88-197.2224H566.272z'%20fill='%230077FF'%20p-id='1802'%3e%3c/path%3e%3c/svg%3e", Zn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1007
1033
|
__proto__: null,
|
|
1008
1034
|
default: qn
|
|
1009
|
-
}, Symbol.toStringTag, { value: "Module" })), Yn = "data:image/
|
|
1010
|
-
|
|
1035
|
+
}, Symbol.toStringTag, { value: "Module" })), Yn = "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='1757902547951'%20class='icon'%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20p-id='5129'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20width='200'%20height='200'%3e%3cpath%20d='M59.355%2091.776v867.881h867.881V91.776H59.356zM897.31%20929.73H89.282V121.703h808.027V929.73z'%20fill=''%20p-id='5130'%3e%3c/path%3e%3cpath%20d='M833.964%20185.048H152.627v681.337h681.337V185.048z%20m-355.632%20651.41H182.554V532.2h295.778v304.257z%20m0-334.184H182.554V214.975h295.778v287.299z%20m325.705%20334.184H508.259V532.2h295.778v304.257z%20m0-334.184H508.259V214.975h295.778v287.299z'%20fill=''%20p-id='5131'%3e%3c/path%3e%3c/svg%3e", Xn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1036
|
+
__proto__: null,
|
|
1037
|
+
default: Yn
|
|
1038
|
+
}, Symbol.toStringTag, { value: "Module" })), $n = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAADICAYAAACtWK6eAAAKdUlEQVR4AeydbZrUKBRGq2YjOjvpWYntStSVjK5EdzLOSsr7arBLOkkBAcLHmacwlQQInMsZUvdP/3Xhv+oEbrfbk5XYz1P1gfLAC4KwCCCwQwBBduBwCwIIwhqAwA4BBNmBwy0IFBQEuBDonwCC9B9DZlCQAIIUhEvX/RNAkP5jyAwKEkCQgnDpun8CfQrSP3dm0AkBBOkkUAzzHAIIcg53ntoJAQTpJFAM8xwCCHIOd57aCQEE8QLFKQTuCSDIPQ2+Q8AjgCAeEE4hcE8AQe5p8B0CHgEE8YBwCoF7AghyT6Psd3rvkACCdBg0hlyPAILUY82TOiSAIB0GjSHXI4Ag9VjzpA4JIEiHQXs9ZK6UIoAgpcjS7xAEEGSIMDKJUgQQpBRZ+h2CAIIMEUYmUYoAgpQiO0q/k88DQSZfAEx/nwCC7PPh7uQEEGTyBcD09wkgyD4f7k5OAEEmXwBnTr+HZyNID1FijKcRQBAP/e12e2vl2cqHUsUe+c5K7OddqfG4fmMHNEN9BPGifL1ev9ulN1Y+FizP1nfsR21Kjun/2AHNUB9BVqJsknyyy1qMdpji89nm/HmKmUZOEkE2gNmCkSTaTTZqDHP5m831/TCz+TWRbP8iyA5KWzh/2+2RJfluc/zH5shngwCCbIC5u6wFNKIkmhM7x12g174iyBqVu2v2f1gtpBFft97b3L7dTZWvKwQQZAWKf8kWkn7Aqvi3ej1HjsDIIUggKJNEu8gImS0yVoExV7XXgugqZZXAIoleuVbvd3CRjFVkkBAkEphJ0mtmi4xVZKxVHUFEIb70ltnSrkfGKj7OFwRJgGa7iBacfpPomNBD9Sb8KE9EjiCJ4EwSZbVUEnuo1gw5DqCuKsiBcTbZ1CTRLtJyZouM1cGVgyAHAS6StPiqRcbqYGzVHEFE4WAxSVrLbJGxOhhT1xxBHInjx1YyW9rNyFgdj+fPHhDkJ4bj/9guooWp3yQ6Hu8wvQd+lKeze9VyFEFeTeyMCyaJsloqZzxez0QOUchYECQjTHVlkmgXOSOzRcZKAchcECQzUHW3SFLzVYuMlcAXKAhSAKq6NElqZbbIWAl4oYIghcAu3ZbObGmXImO1wC5xQJCHVNMr2C6iBazfJDqmd7Tdkh/l22yy3EGQLBi3OzFJlNVS2a6Udgc50rhFtUKQKFxplU0S7SI5M1tkrNJCEd0KQaKRpTVYJMnxqkXGKi0ESa0QJAlbWiOT5Ghmi4xVGvrkVgiSjC654UtmK64L7T5krOKYHa6NIIcRxnVgu4gWun6T6BjTmB/lMbQy1UWQTCBjujFJlNVSCW2GHKGkMtdDkMxAQ7szSbSLhGS2yFiFQi1QD0EKQA3tcpFk71WLjFUozEL1EKQQ2NBuTZKtzNahjFXo86m3TwBB9vnUuutntrSrkLGqRX/nOQiyA6fWLdtFJIR+k+iox/KjXBQaKAjSQBA0BJNEWS0V5BCQRgqCNBIIDcMk+WRFkuiU0gABBGkgCJ0NYarhIshU4WaysQQQJJYY9acigCBThZvJxhJAkFhi1J+KAIJMFe7WJ9ve+BCkvZgwooYIIEhDwWAo7RFAkPZiwogaIoAgDQWDobRHAEHaiwkjKkEgsU8ESQRHszkIIMgccWaWiQQQJBEczeYggCBzxJlZJhJAkERwNJuDQIggc5BglhBYIZBNkNvt9kSBQStrYGWtJ13KJsjy9K92pFwuMDiXgS3DPJ/cguQZFb1AoBECCNJIIBhGmwROFqRNKIwKAo4AgjgSHCGwQgBBVqBwCQKOAII4EhwhsEIAQVagcAkCjsC4grgZcoTAAQIIcgAeTccngCDjx5gZHiCAIAfg0XR8ArkF0V9KolwuMDiXQTZzswlyvV71ByenKMy1/VjnMiSbILkGRD8QaIkAgrQUDcbSHAEEaS4kDKglAgjSUjQYS3MEEKStkDCaxgggSGMBYThtEUCQtuLBaBojgCCNBYThtEUAQdqKB6NpjACCNBaQcsOh5xQCCJJCjTbTEECQaULNRFMIIEgKNdpMQwBBpgk1E00hgCAp1GjzJ4GBzxBk4OAyteMEEOQ4Q3oYmACCNBTc2+32bOVDQ0OafigI0sgSMDGebCj/Wvlo39/akU8DBBCkgSAsQuiP7rjR/Ldcc+fTHs+eOIKcHIFFBO0c/ki+Lvf865xXJIAgFWFvPEpy6PXKv63XrA9I4mOpe44gdXn/8TRb/FtyuHrP9uWdFT4nEUCQk8CbHFr8Ko9GoB/tZLYeUSp0H0EKgd3r1uTQK5V2j71q9/ckiV657q/x/RiBoNYIEoQpXyWTQwv9PmMV2jmZrVBSGeshSEaYj7pa5IjZOfwuyWz5RAqfI0hhwF73kkOvV97l4FPtPmS2gnEdr4ggxxkG9WC7x1E53HP0w57MlqNR+IgghQGre5NDi1pFpzmKfrST2cpB8kEfaYI86JTbLwRMDr1Safd4uZjnmyTRK1ee3uhllQCCrGLJc9Hk0AJOyViFDoDMViipxHoIkgjuUbNFjhI7h/9oMls+kYznCJIRpteV5NDrlXc5+6l2KTJb2bH+6hBBfnHI+q/tHrXkcONWAoDMlqOR8dicIBnndkpXJocWq0rt5+tHO5mtzNQRJCNQk0OvVNo9MvYa1ZUk0StXVCMqbxNAkG02UXdMDi3Mkhmr0PGQ2QolFVAPQQIgPaqyyHHmzuEPkcyWTyTxHEESwXnNJIder7zLp51qNyOzlQH/TIJkwPW6C9s9WpPDDVKJAjJbjkbiEUESwamZyaFFqKLTFot+tJPZOhAZBEmEZ3LolUq7R2IP1ZpJEr1yVXvgSA9CkIRomhxacC1krEJHT2YrlJRXD0E8II9OFzl62Dn8qZDZ8okEnCNIACSviuTQ69Xd5S6+atcjsxUZKgSJAGa7R69yuFkqoUBmy9EIOCJIACRVMTm0uFR02nPRj3YyW4ERRJAAUCaHXqm0ewTU7qKKJNErVxeDPXOQCPKAvsmhhdRTxurBjH7fJrP1G8X2FwTZZnNZ5Dh359gZX4ZbZLYeQESQfUCSQ69X+7X6vavdkczWTvwQZAOO7R6jy+FmrsQDmS1HwzsiiAdEpyaHFo2KTmco+tFOZmsl0giyAsUuvbHysWD5bH3HftSm5JhixzNFfQRZCfP1ev10LVjskV+sxH6+5B6T31/sgGaojyAzRJk5JhNAkGR0NJyBAILMEGXmmEwAQZLR0XAGAggyQ5Trz3GYJyLIMKFkIiUIIEgJqvQ5DAEEGSaUTKQEAQQpQZU+hyGAIMOEcpaJ1J0ngtTlzdM6I4AgnQWM4dYlgCB1efO0zgggSGcBY7h1CSBIXd48rWUCK2NDkBUoXIKAI4AgjgRHCKwQQJAVKFyCgCOAII4ERwisEECQFShcgoAjkEsQ1x9HCAxFAEGGCieTyU0AQXITpb+hCCDIUOFkMrkJIEhuovQ3FIEOBBmKN5PpjACCdBYwhluXAILU5c3TOiOAIJ0FjOHWJYAgdXnztM4IzC1IZ8FiuPUJIEh95jyxIwII0lGwGGp9AghSnzlP7IgAgnQULIZanwCCFGJOt2MQ+AEAAP//U3PGlQAAAAZJREFUAwA3ILMm/jaVEAAAAABJRU5ErkJggg==", es = new h.TextureLoader(), ts = es.load($n);
|
|
1039
|
+
class ns extends Oe {
|
|
1011
1040
|
static name = "RenderManager";
|
|
1012
|
-
container = new
|
|
1041
|
+
container = new h.Group();
|
|
1013
1042
|
lines = [];
|
|
1014
|
-
pointVirtualGrid = new
|
|
1015
|
-
quadtree = new
|
|
1016
|
-
|
|
1017
|
-
verticalReferenceLineFlag = new m.Mesh(new m.PlaneGeometry(0.3, 0.3), new m.MeshBasicMaterial({ map: $n, color: 58111, transparent: !0 }));
|
|
1043
|
+
pointVirtualGrid = new Ge();
|
|
1044
|
+
quadtree = new Le(new Me());
|
|
1045
|
+
verticalReferenceLineFlag = new h.Mesh(new h.PlaneGeometry(0.3, 0.3), new h.MeshBasicMaterial({ map: ts, color: 58111, transparent: !0 }));
|
|
1018
1046
|
onAddFromParent() {
|
|
1019
1047
|
const e = this.dxfLineModel;
|
|
1020
|
-
this.editor.container.add(this.container), this.editor.container.add(e.dxfModelGroup), e.dxfLineModel.material = new
|
|
1048
|
+
this.editor.container.add(this.container), this.editor.container.add(e.dxfModelGroup), e.dxfLineModel.material = new h.LineBasicMaterial({
|
|
1021
1049
|
transparent: !0,
|
|
1022
1050
|
opacity: 0.5,
|
|
1023
1051
|
color: 16777215
|
|
@@ -1034,9 +1062,9 @@ class eo extends Ce {
|
|
|
1034
1062
|
return;
|
|
1035
1063
|
} else
|
|
1036
1064
|
this.updatedMode = "dxf";
|
|
1037
|
-
this.pointVirtualGrid = new
|
|
1065
|
+
this.pointVirtualGrid = new Ge();
|
|
1038
1066
|
const e = this.dxf.box.clone().expansion(Math.max(this.dxf.box.width, this.dxf.box.height) * 2);
|
|
1039
|
-
(e.width === 0 || e.height === 0) && e.set(-200, -200, 200, 200), this.quadtree = new
|
|
1067
|
+
(e.width === 0 || e.height === 0) && e.set(-200, -200, 200, 200), this.quadtree = new Le(e), this.lines.length = 0, this.dxf.lineSegments.forEach((t) => {
|
|
1040
1068
|
t.userData.isDoor || this.addLine(t.clone());
|
|
1041
1069
|
}), this.dxf.doorLineSegment.forEach((t) => {
|
|
1042
1070
|
const n = t.clone();
|
|
@@ -1055,10 +1083,7 @@ class eo extends Ce {
|
|
|
1055
1083
|
line: e,
|
|
1056
1084
|
userData: void 0
|
|
1057
1085
|
};
|
|
1058
|
-
e.userData.quadtreeNode = t, this.quadtree.insert(t)
|
|
1059
|
-
type: "addLine",
|
|
1060
|
-
data: [e]
|
|
1061
|
-
});
|
|
1086
|
+
e.userData.quadtreeNode = t, this.quadtree.insert(t);
|
|
1062
1087
|
}
|
|
1063
1088
|
/**
|
|
1064
1089
|
* 批量添加
|
|
@@ -1068,16 +1093,12 @@ class eo extends Ce {
|
|
|
1068
1093
|
for (let t = 0; t < e.length; t++) {
|
|
1069
1094
|
const n = e[t];
|
|
1070
1095
|
this.lines.push(n), this.pointVirtualGrid.insert(n.start, n), this.pointVirtualGrid.insert(n.end, n);
|
|
1071
|
-
const
|
|
1096
|
+
const s = {
|
|
1072
1097
|
line: n,
|
|
1073
1098
|
userData: void 0
|
|
1074
1099
|
};
|
|
1075
|
-
n.userData.quadtreeNode =
|
|
1100
|
+
n.userData.quadtreeNode = s, this.quadtree.insert(s);
|
|
1076
1101
|
}
|
|
1077
|
-
this.actionHistory.add({
|
|
1078
|
-
type: "addLine",
|
|
1079
|
-
data: [...e]
|
|
1080
|
-
});
|
|
1081
1102
|
}
|
|
1082
1103
|
/** 移除线段
|
|
1083
1104
|
* @param line
|
|
@@ -1085,25 +1106,35 @@ class eo extends Ce {
|
|
|
1085
1106
|
removeLine(e) {
|
|
1086
1107
|
e.userData.quadtreeNode && this.quadtree.remove(e.userData.quadtreeNode), this.pointVirtualGrid.remove(e.start), this.pointVirtualGrid.remove(e.end);
|
|
1087
1108
|
const t = this.lines.indexOf(e);
|
|
1088
|
-
this.lines.splice(t, 1), this.draw()
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1109
|
+
this.lines.splice(t, 1), this.draw();
|
|
1110
|
+
}
|
|
1111
|
+
/**
|
|
1112
|
+
* 删除
|
|
1113
|
+
* @param lines
|
|
1114
|
+
*/
|
|
1115
|
+
removeLines(e) {
|
|
1116
|
+
for (let t = 0; t < e.length; t++) {
|
|
1117
|
+
const n = e[t];
|
|
1118
|
+
n.userData.quadtreeNode && this.quadtree.remove(n.userData.quadtreeNode), this.pointVirtualGrid.remove(n.start), this.pointVirtualGrid.remove(n.end);
|
|
1119
|
+
const s = this.lines.indexOf(n);
|
|
1120
|
+
this.lines.splice(s, 1);
|
|
1121
|
+
}
|
|
1122
|
+
this.draw();
|
|
1092
1123
|
}
|
|
1093
1124
|
/**
|
|
1094
1125
|
* 绘制
|
|
1095
1126
|
*/
|
|
1096
1127
|
draw(e = !0) {
|
|
1097
1128
|
this.container.clear();
|
|
1098
|
-
const t = [], n = [],
|
|
1099
|
-
this.lines.forEach((
|
|
1100
|
-
if (
|
|
1101
|
-
|
|
1102
|
-
}),
|
|
1103
|
-
const
|
|
1104
|
-
|
|
1105
|
-
}),
|
|
1106
|
-
const a =
|
|
1129
|
+
const t = [], n = [], s = [];
|
|
1130
|
+
this.lines.forEach((o) => {
|
|
1131
|
+
if (o.points.forEach((a) => {
|
|
1132
|
+
o.userData.isDoor ? n.push(a.x, a.y, 0) : t.push(a.x, a.y, 0);
|
|
1133
|
+
}), o.userData.isWindow && o.userData.drawWindow && o.userData.drawWindow.forEach(({ width: a, p: r }) => {
|
|
1134
|
+
const l = R.from(r), i = o.direction(), d = l.clone().add(i.clone().multiplyScalar(a * 0.5)), p = l.clone().add(i.clone().multiplyScalar(-a * 0.5));
|
|
1135
|
+
s.push(d.x, d.y, 1e-3), s.push(p.x, p.y, 1e-3);
|
|
1136
|
+
}), o.userData.isVerticalReferenceLine) {
|
|
1137
|
+
const a = o.center;
|
|
1107
1138
|
this.verticalReferenceLineFlag.position.set(a.x, a.y, 0), this.container.add(this.verticalReferenceLineFlag);
|
|
1108
1139
|
}
|
|
1109
1140
|
}), t.length && this.renderer.createLineSegments({
|
|
@@ -1114,9 +1145,9 @@ class eo extends Ce {
|
|
|
1114
1145
|
position: n
|
|
1115
1146
|
}, n.length / 3, {
|
|
1116
1147
|
color: 16776960
|
|
1117
|
-
}, this.container),
|
|
1118
|
-
position:
|
|
1119
|
-
},
|
|
1148
|
+
}, this.container), s.length && this.renderer.createLineSegments({
|
|
1149
|
+
position: s
|
|
1150
|
+
}, s.length / 3, {
|
|
1120
1151
|
color: 16711935
|
|
1121
1152
|
}, this.container), e && this.synchronizeDxf();
|
|
1122
1153
|
}
|
|
@@ -1124,26 +1155,26 @@ class eo extends Ce {
|
|
|
1124
1155
|
* @param point
|
|
1125
1156
|
* @returns
|
|
1126
1157
|
*/
|
|
1127
|
-
adsorption(e = 0.
|
|
1128
|
-
const
|
|
1158
|
+
adsorption(e = 0.04, t = this.pointVirtualGrid, n = this.quadtree) {
|
|
1159
|
+
const s = this.parent?.findComponentByName("Editor"), o = R.from(s.pointerPosition), a = t.queryCircle(o, e).sort((l, i) => l.point.distance(o) - i.point.distance(o));
|
|
1129
1160
|
if (a.length) return {
|
|
1130
|
-
point: new
|
|
1161
|
+
point: new h.Vector3(a[0].point.x, a[0].point.y, 0),
|
|
1131
1162
|
find: !0,
|
|
1132
1163
|
mode: "point",
|
|
1133
1164
|
line: a[0].userData
|
|
1134
1165
|
};
|
|
1135
|
-
let
|
|
1136
|
-
if (
|
|
1137
|
-
let
|
|
1138
|
-
return
|
|
1139
|
-
point: new
|
|
1166
|
+
let r = n.queryCircle(o, e);
|
|
1167
|
+
if (r.length) {
|
|
1168
|
+
let l = r.map((i) => i.line.projectPoint(o));
|
|
1169
|
+
return l.sort((i, d) => i && d ? i.distance(o) - d.distance(o) : 0), r = r.filter((i, d) => !!l[d]), l = l.filter((i, d) => !!l[d]), {
|
|
1170
|
+
point: new h.Vector3(l[0].x, l[0].y, 0),
|
|
1140
1171
|
find: !0,
|
|
1141
1172
|
mode: "line",
|
|
1142
|
-
line:
|
|
1173
|
+
line: r[0].line
|
|
1143
1174
|
};
|
|
1144
1175
|
}
|
|
1145
1176
|
return {
|
|
1146
|
-
point: new
|
|
1177
|
+
point: new h.Vector3(s.pointerPosition.x, s.pointerPosition.y, 0),
|
|
1147
1178
|
find: !1
|
|
1148
1179
|
};
|
|
1149
1180
|
}
|
|
@@ -1151,9 +1182,9 @@ class eo extends Ce {
|
|
|
1151
1182
|
* @param rectangle
|
|
1152
1183
|
*/
|
|
1153
1184
|
createGeometry(e, t) {
|
|
1154
|
-
const n = new
|
|
1155
|
-
return Object.keys(e).forEach((
|
|
1156
|
-
n.setAttribute("position", new
|
|
1185
|
+
const n = new h.BufferGeometry();
|
|
1186
|
+
return Object.keys(e).forEach((s) => {
|
|
1187
|
+
n.setAttribute("position", new h.BufferAttribute(new Float32Array(e[s]), e[s].length / t));
|
|
1157
1188
|
}), n;
|
|
1158
1189
|
}
|
|
1159
1190
|
/**
|
|
@@ -1161,20 +1192,21 @@ class eo extends Ce {
|
|
|
1161
1192
|
*/
|
|
1162
1193
|
toJson() {
|
|
1163
1194
|
return this.lines.map((e) => {
|
|
1164
|
-
const t = e.userData, n = t.drawWindow,
|
|
1195
|
+
const t = e.userData, n = t.drawWindow, s = this.quadtree.queryLineSegment(e).filter((o) => o.line !== e && !o.userData?.isDoor).map((o) => ({ index: this.lines.indexOf(o.line) }));
|
|
1165
1196
|
return {
|
|
1166
1197
|
start: e.start.toJson(this.dxf.originalZAverage),
|
|
1167
1198
|
end: e.end.toJson(this.dxf.originalZAverage),
|
|
1168
|
-
insetionArr:
|
|
1199
|
+
insetionArr: s,
|
|
1169
1200
|
isDoor: t.isDoor,
|
|
1170
1201
|
doorDirectConnection: t.isDoor,
|
|
1171
1202
|
length: e.length(),
|
|
1172
1203
|
isWindow: t.isWindow,
|
|
1173
1204
|
isVerticalReferenceLine: t.isVerticalReferenceLine,
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1205
|
+
wallWidth: e.userData.wallWidth,
|
|
1206
|
+
drawWindow: n && n.map((o) => ({
|
|
1207
|
+
p: { x: o.p.x, y: o.p.y, z: o.p.z },
|
|
1208
|
+
width: o.width,
|
|
1209
|
+
full: o.full
|
|
1178
1210
|
}))
|
|
1179
1211
|
};
|
|
1180
1212
|
});
|
|
@@ -1215,55 +1247,55 @@ class eo extends Ce {
|
|
|
1215
1247
|
return this.parent?.findComponentByName("DxfLineModel");
|
|
1216
1248
|
}
|
|
1217
1249
|
}
|
|
1218
|
-
class
|
|
1250
|
+
class ss extends W {
|
|
1219
1251
|
static name = "DrawDoorLine";
|
|
1220
|
-
container = new
|
|
1252
|
+
container = new h.Group();
|
|
1221
1253
|
interruptKeys = ["escape"];
|
|
1222
1254
|
shortcutKeys = ["control", "m"];
|
|
1223
1255
|
commandName = "draw-door-line";
|
|
1224
1256
|
onAddFromParent(e) {
|
|
1225
1257
|
super.onAddFromParent(e);
|
|
1226
|
-
const t = e.findComponentByName("Editor"), n = t.eventInput,
|
|
1258
|
+
const t = e.findComponentByName("Editor"), n = t.eventInput, s = t.commandManager;
|
|
1227
1259
|
this.editor.container.add(this.container);
|
|
1228
|
-
const
|
|
1229
|
-
n.addKeyCombination(this.commandName, this.shortcutKeys),
|
|
1230
|
-
n.isKeyCombination(this.commandName) && await
|
|
1260
|
+
const o = this.commandManager.addCommandFlow("draw-door-line").add(this.createInterrupt()).add(this.createCursor("no-drop")).add(this.selectPoint.bind(this)).add(this.end.bind(this)).addRollback(this.rollback.bind(this)).addRevokeRollback(this.revokeRollback.bind(this));
|
|
1261
|
+
n.addKeyCombination(this.commandName, this.shortcutKeys), o.addEventListener("finally", this.createFinally()), o.addEventListener("completed", (a) => this.completed(a.data)), n.addCancelDefaultBehavior(() => n.isOnlyKeyDowns(this.shortcutKeys)), n.addEventListener("codeChange", async () => {
|
|
1262
|
+
n.isKeyCombination(this.commandName) && await s.start(this.commandName);
|
|
1231
1263
|
});
|
|
1232
1264
|
}
|
|
1233
1265
|
/** 选择点
|
|
1234
1266
|
* @param next
|
|
1235
1267
|
*/
|
|
1236
1268
|
selectPoint(e) {
|
|
1237
|
-
let t = this.parent?.findComponentByName("Editor"), n = null,
|
|
1238
|
-
new
|
|
1239
|
-
new
|
|
1240
|
-
new
|
|
1241
|
-
new
|
|
1269
|
+
let t = this.parent?.findComponentByName("Editor"), n = null, s = new h.Mesh(new h.SphereGeometry(0.04), new h.MeshBasicMaterial({ color: 65280 })), o = new Ce([], 16711935), a = new Ce([
|
|
1270
|
+
new h.Vector3(-1e4, 0, 0),
|
|
1271
|
+
new h.Vector3(1e4, 0, 0),
|
|
1272
|
+
new h.Vector3(0, -1e4, 0),
|
|
1273
|
+
new h.Vector3(0, 1e4, 0)
|
|
1242
1274
|
], 16711935);
|
|
1243
|
-
a.material = new
|
|
1275
|
+
a.material = new h.LineDashedMaterial({
|
|
1244
1276
|
color: 4235007,
|
|
1245
1277
|
dashSize: 0.1,
|
|
1246
1278
|
gapSize: 0.1,
|
|
1247
1279
|
linewidth: 0.1
|
|
1248
|
-
}), this.container.add(
|
|
1249
|
-
let
|
|
1280
|
+
}), this.container.add(o);
|
|
1281
|
+
let r = null;
|
|
1250
1282
|
this.addEventRecord(
|
|
1251
1283
|
"clear",
|
|
1252
1284
|
t.addEventListener("pointerPositionChange", () => {
|
|
1253
|
-
const { point:
|
|
1254
|
-
n &&
|
|
1285
|
+
const { point: l, find: i } = t.renderManager.adsorption();
|
|
1286
|
+
n && o.setPoint(n, l), this.dispatchEvent({ type: "pointerMove", point: l }), i ? (s.position.set(l.x, l.y, 0), this.container.add(s), this.domElement.style.cursor = "none", r = l.clone()) : (r = null, s.removeFromParent(), this.domElement.style.cursor = "no-drop");
|
|
1255
1287
|
}),
|
|
1256
1288
|
t.eventInput.addEventListener("codeChange", async () => {
|
|
1257
|
-
if (t.eventInput.isKeyDown("mouse_0") &&
|
|
1289
|
+
if (t.eventInput.isKeyDown("mouse_0") && r) {
|
|
1258
1290
|
if (!n) {
|
|
1259
|
-
n =
|
|
1291
|
+
n = r.clone();
|
|
1260
1292
|
return;
|
|
1261
1293
|
}
|
|
1262
|
-
e([n.clone(),
|
|
1294
|
+
e([n.clone(), r.clone()]);
|
|
1263
1295
|
}
|
|
1264
1296
|
}),
|
|
1265
1297
|
function() {
|
|
1266
|
-
|
|
1298
|
+
o.removeFromParent(), s.removeFromParent(), a.removeFromParent();
|
|
1267
1299
|
}
|
|
1268
1300
|
);
|
|
1269
1301
|
}
|
|
@@ -1274,24 +1306,24 @@ class to extends N {
|
|
|
1274
1306
|
*/
|
|
1275
1307
|
end(e, t) {
|
|
1276
1308
|
const n = [];
|
|
1277
|
-
for (let
|
|
1278
|
-
const
|
|
1279
|
-
let
|
|
1280
|
-
|
|
1281
|
-
oldLine:
|
|
1282
|
-
newLine1: new
|
|
1283
|
-
|
|
1284
|
-
|
|
1309
|
+
for (let s = 0; s < t.length; s += 2) {
|
|
1310
|
+
const o = R.from(t[s]), a = R.from(t[s + 1]), r = this.renderManager.quadtree.queryCircle(o, 1e-3)[0].line, l = this.renderManager.quadtree.queryCircle(a, 1e-3)[0].line;
|
|
1311
|
+
let i = null;
|
|
1312
|
+
r === l && (i = {
|
|
1313
|
+
oldLine: r,
|
|
1314
|
+
newLine1: new z(
|
|
1315
|
+
r.start,
|
|
1316
|
+
r.start.distance(o) < r.start.distance(a) ? o.clone() : a.clone()
|
|
1285
1317
|
),
|
|
1286
|
-
newLine2: new
|
|
1287
|
-
|
|
1288
|
-
|
|
1318
|
+
newLine2: new z(
|
|
1319
|
+
r.end,
|
|
1320
|
+
r.end.distance(o) < r.end.distance(a) ? o.clone() : a.clone()
|
|
1289
1321
|
)
|
|
1290
1322
|
});
|
|
1291
|
-
const
|
|
1292
|
-
|
|
1293
|
-
line:
|
|
1294
|
-
option:
|
|
1323
|
+
const d = new z(o, a);
|
|
1324
|
+
d.userData.isDoor = !0, d.userData.doorDirectConnection = !0, n.push({
|
|
1325
|
+
line: d,
|
|
1326
|
+
option: i
|
|
1295
1327
|
});
|
|
1296
1328
|
}
|
|
1297
1329
|
e(n);
|
|
@@ -1319,9 +1351,9 @@ class to extends N {
|
|
|
1319
1351
|
return this.completed(e), e;
|
|
1320
1352
|
}
|
|
1321
1353
|
}
|
|
1322
|
-
class
|
|
1354
|
+
class os extends W {
|
|
1323
1355
|
static name = "DrawWindow";
|
|
1324
|
-
container = new
|
|
1356
|
+
container = new h.Group();
|
|
1325
1357
|
interruptKeys = ["escape"];
|
|
1326
1358
|
shortcutKeys = ["control", "q"];
|
|
1327
1359
|
commandName = "draw-window-line";
|
|
@@ -1334,24 +1366,24 @@ class no extends N {
|
|
|
1334
1366
|
* @param next
|
|
1335
1367
|
*/
|
|
1336
1368
|
selectPointStart(e) {
|
|
1337
|
-
let t = null, n = new
|
|
1369
|
+
let t = null, n = new h.Mesh(new h.SphereGeometry(0.04), new h.MeshBasicMaterial({ color: 16711935 })), s = null;
|
|
1338
1370
|
this.addEventRecord("selectPointStart").add(this.editor.addEventListener("pointerPositionChange", () => {
|
|
1339
|
-
const { point:
|
|
1340
|
-
this.dispatchEvent({ type: "pointerMove", point:
|
|
1371
|
+
const { point: o, line: a, find: r } = this.editor.renderManager.adsorption();
|
|
1372
|
+
this.dispatchEvent({ type: "pointerMove", point: o }), r ? (this.domElement.style.cursor = "none", n.position.copy(o), s = a, t = o.clone(), this.container.add(n)) : (this.domElement.style.cursor = "no-drop", t = null, n.removeFromParent());
|
|
1341
1373
|
})).add(this.eventInput.addEventListener("codeChange", () => {
|
|
1342
|
-
this.eventInput.isKeyDown("mouse_0") && t && (this.canceEventRecord("selectPointStart"), e({ point: t, line:
|
|
1374
|
+
this.eventInput.isKeyDown("mouse_0") && t && (this.canceEventRecord("selectPointStart"), e({ point: t, line: s }));
|
|
1343
1375
|
})), this.addEventRecord("clear").add(() => n.removeFromParent());
|
|
1344
1376
|
}
|
|
1345
1377
|
/** 选择结束点
|
|
1346
1378
|
* @param next
|
|
1347
1379
|
*/
|
|
1348
1380
|
selectPointEnd(e, { point: t, line: n }) {
|
|
1349
|
-
let
|
|
1350
|
-
this.addEventRecord("clear").add(() =>
|
|
1351
|
-
const { point: a, find:
|
|
1352
|
-
this.dispatchEvent({ type: "pointerMove", point: a }),
|
|
1381
|
+
let s = null, o = new h.Mesh(new h.SphereGeometry(0.04), new h.MeshBasicMaterial({ color: 16711935 }));
|
|
1382
|
+
this.addEventRecord("clear").add(() => o.removeFromParent()).add(this.editor.addEventListener("pointerPositionChange", () => {
|
|
1383
|
+
const { point: a, find: r, line: l } = this.editor.renderManager.adsorption();
|
|
1384
|
+
this.dispatchEvent({ type: "pointerMove", point: a }), r && l === n ? (this.domElement.style.cursor = "none", o.position.copy(a), s = a.clone(), this.container.add(o)) : (this.domElement.style.cursor = "no-drop", s = null, o.removeFromParent());
|
|
1353
1385
|
})).add(this.eventInput.addEventListener("codeChange", () => {
|
|
1354
|
-
this.eventInput.isKeyDown("mouse_0") &&
|
|
1386
|
+
this.eventInput.isKeyDown("mouse_0") && s && e({ line: n, start: t, end: s });
|
|
1355
1387
|
}));
|
|
1356
1388
|
}
|
|
1357
1389
|
/**
|
|
@@ -1359,13 +1391,13 @@ class no extends N {
|
|
|
1359
1391
|
* @param next
|
|
1360
1392
|
* @param points
|
|
1361
1393
|
*/
|
|
1362
|
-
end(e, { start: t, end: n, line:
|
|
1363
|
-
const
|
|
1364
|
-
p: new
|
|
1365
|
-
width:
|
|
1366
|
-
full: Math.abs(
|
|
1394
|
+
end(e, { start: t, end: n, line: s }) {
|
|
1395
|
+
const o = new z(R.from(t), R.from(n)), a = o.center, r = o.length(), l = {
|
|
1396
|
+
p: new h.Vector3(a.x, a.y, 0),
|
|
1397
|
+
width: r,
|
|
1398
|
+
full: Math.abs(r - s.length()) < 0.01
|
|
1367
1399
|
};
|
|
1368
|
-
e({ line:
|
|
1400
|
+
e({ line: s, doorDataItem: l });
|
|
1369
1401
|
}
|
|
1370
1402
|
/** 执行完成
|
|
1371
1403
|
*/
|
|
@@ -1378,8 +1410,8 @@ class no extends N {
|
|
|
1378
1410
|
rollback(e) {
|
|
1379
1411
|
const { doorDataItem: t, line: n } = e;
|
|
1380
1412
|
if (n.userData.drawWindow) {
|
|
1381
|
-
const
|
|
1382
|
-
|
|
1413
|
+
const s = n.userData.drawWindow.indexOf(t);
|
|
1414
|
+
s !== -1 && (n.userData.drawWindow.splice(s, 1), n.userData.drawWindow.length === 0 && (delete n.userData.drawWindow, delete n.userData.isWindow), this.renderManager.draw());
|
|
1383
1415
|
}
|
|
1384
1416
|
return e;
|
|
1385
1417
|
}
|
|
@@ -1391,41 +1423,31 @@ class no extends N {
|
|
|
1391
1423
|
return this.completed(e), e;
|
|
1392
1424
|
}
|
|
1393
1425
|
}
|
|
1394
|
-
class
|
|
1426
|
+
class oe extends W {
|
|
1395
1427
|
static name = "VerticalCorrection";
|
|
1396
|
-
container = new
|
|
1428
|
+
container = new h.Group();
|
|
1397
1429
|
shortcutKeys = ["control", "c"];
|
|
1398
1430
|
shortcutKeys2 = ["control", "shift", "c"];
|
|
1431
|
+
shortcutKeys3 = ["shift", "c"];
|
|
1399
1432
|
static commandName = "verticalCorrection";
|
|
1400
1433
|
recursion = !1;
|
|
1434
|
+
axisAlignment = !1;
|
|
1401
1435
|
onAddFromParent(e) {
|
|
1402
1436
|
super.onAddFromParent(e), this.editor.container.add(this.container), this.container.position.z = 1e-3;
|
|
1403
|
-
const t = this.commandManager.addCommandFlow(
|
|
1437
|
+
const t = this.commandManager.addCommandFlow(oe.commandName).add(this.createInterrupt()).add(this.constraint.bind(this)).add(this.verticalCorrection.bind(this)).addRollback(this.rollback.bind(this)).addRevokeRollback(this.revokeRollback.bind(this));
|
|
1404
1438
|
t.addEventListener("finally", this.createFinally()), t.addEventListener("completed", (n) => this.completed(n.data)), t.addEventListener("started", () => {
|
|
1405
1439
|
!this.eventInput.isOnlyKeyDowns(this.shortcutKeys) && !this.eventInput.isOnlyKeyDowns(this.shortcutKeys2) && (this.recursion = !1);
|
|
1406
1440
|
}), this.eventInput.addEventListener("codeChange", async () => {
|
|
1407
|
-
this.eventInput.isOnlyKeyDowns(this.shortcutKeys) ? (this.recursion = !1, this.commandManager.start(
|
|
1441
|
+
this.eventInput.isOnlyKeyDowns(this.shortcutKeys) ? (this.recursion = !1, this.axisAlignment = !1, this.commandManager.start(oe.commandName, [...this.default.selectLines])) : this.eventInput.isOnlyKeyDowns(this.shortcutKeys2) ? (this.recursion = !0, this.axisAlignment = !1, this.commandManager.start(oe.commandName, [...this.default.selectLines])) : this.eventInput.isOnlyKeyDowns(this.shortcutKeys3) && (this.axisAlignment = !0, this.commandManager.start(oe.commandName, [...this.default.selectLines]));
|
|
1408
1442
|
}), this.eventInput.addCancelDefaultBehavior(() => this.eventInput.isOnlyKeyDowns(this.shortcutKeys) || this.eventInput.isOnlyKeyDowns(this.shortcutKeys2));
|
|
1409
1443
|
}
|
|
1410
1444
|
/**
|
|
1411
1445
|
* 进入命令约束
|
|
1412
1446
|
*/
|
|
1413
1447
|
constraint(e, t) {
|
|
1414
|
-
Array.isArray(t) ? t.length !== 1 ? (
|
|
1415
|
-
}
|
|
1416
|
-
/**
|
|
1417
|
-
* 线段是否为结尾线段
|
|
1418
|
-
* @param line
|
|
1419
|
-
*/
|
|
1420
|
-
lineIsPathEnd(e) {
|
|
1421
|
-
for (let t = 0; t < e.points.length; t++) {
|
|
1422
|
-
const n = e.points[t];
|
|
1423
|
-
if (this.renderManager.pointVirtualGrid.queryPoint(n).filter((s) => !s.point.equal(n)).length === 0) return !0;
|
|
1424
|
-
}
|
|
1425
|
-
return !1;
|
|
1448
|
+
Array.isArray(t) ? t.length !== 1 ? (B({ message: "请选择一条线段", type: "warning" }), this.cancel()) : e(t) : (B({ message: "进入命令失败", type: "warning" }), this.cancel());
|
|
1426
1449
|
}
|
|
1427
1450
|
/**
|
|
1428
|
-
*
|
|
1429
1451
|
* @param line0
|
|
1430
1452
|
* @param line1
|
|
1431
1453
|
*/
|
|
@@ -1433,7 +1455,6 @@ class de extends N {
|
|
|
1433
1455
|
return !!(e.start.equal(t.start) || e.start.equal(t.end) || e.end.equal(t.start) || e.end.equal(t.end));
|
|
1434
1456
|
}
|
|
1435
1457
|
/**
|
|
1436
|
-
*
|
|
1437
1458
|
* @param line
|
|
1438
1459
|
* @param newStartPoint
|
|
1439
1460
|
* @param newEndPoint
|
|
@@ -1442,46 +1463,46 @@ class de extends N {
|
|
|
1442
1463
|
* @param id
|
|
1443
1464
|
* @returns
|
|
1444
1465
|
*/
|
|
1445
|
-
setLinePoint(e, t, n,
|
|
1466
|
+
setLinePoint(e, t, n, s = "all", o = [], a = Dt()) {
|
|
1446
1467
|
if (e.userData.setLinePointUUid === a) return [];
|
|
1447
1468
|
e.userData.setLinePointUUid = a;
|
|
1448
|
-
let
|
|
1449
|
-
(
|
|
1450
|
-
const
|
|
1451
|
-
let
|
|
1452
|
-
t && (e.start.equal(t) || (
|
|
1469
|
+
let r = [], l = [];
|
|
1470
|
+
(s === "start" || s === "all") && (r = this.renderManager.pointVirtualGrid.queryPoint(e.start).filter((E) => E.userData !== e)), (s === "end" || s === "all") && (l = this.renderManager.pointVirtualGrid.queryPoint(e.end).filter((E) => E.userData !== e));
|
|
1471
|
+
const i = e.clone();
|
|
1472
|
+
let d = "";
|
|
1473
|
+
t && (e.start.equal(t) || (d = "start"), o.push({
|
|
1453
1474
|
point: e.start,
|
|
1454
1475
|
oldPoint: e.start.clone(),
|
|
1455
1476
|
newPoint: t,
|
|
1456
1477
|
line: e
|
|
1457
|
-
}), e.start.copy(t)), n && (e.end.equal(n) || (
|
|
1478
|
+
}), e.start.copy(t)), n && (e.end.equal(n) || (d = d === "start" ? "all" : "end"), o.push({
|
|
1458
1479
|
point: e.end,
|
|
1459
1480
|
oldPoint: e.end.clone(),
|
|
1460
1481
|
newPoint: n,
|
|
1461
1482
|
line: e
|
|
1462
1483
|
}), e.end.copy(n));
|
|
1463
|
-
const
|
|
1464
|
-
|
|
1465
|
-
const { point:
|
|
1466
|
-
if (
|
|
1467
|
-
if (
|
|
1468
|
-
const
|
|
1469
|
-
if (
|
|
1484
|
+
const p = (E, f, y) => {
|
|
1485
|
+
E.forEach((C) => {
|
|
1486
|
+
const { point: v, userData: w } = C, g = w.start === v ? "start" : "end";
|
|
1487
|
+
if (w.directionEqual(i))
|
|
1488
|
+
if (g === "start") {
|
|
1489
|
+
const S = e.projectPoint(w.end, !1);
|
|
1490
|
+
if (S) return this.setLinePoint(w, f, S, "end", o, a);
|
|
1470
1491
|
} else {
|
|
1471
|
-
const
|
|
1472
|
-
if (
|
|
1492
|
+
const S = e.projectPoint(w.start, !1);
|
|
1493
|
+
if (S) return this.setLinePoint(w, S, f, "start", o, a);
|
|
1473
1494
|
}
|
|
1474
|
-
(
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1495
|
+
(d === "all" || y === d) && this.setLinePoint(
|
|
1496
|
+
w,
|
|
1497
|
+
w.start === v ? f : w.start,
|
|
1498
|
+
w.end === v ? f : w.end,
|
|
1499
|
+
w.start === v ? "end" : "start",
|
|
1500
|
+
o,
|
|
1480
1501
|
a
|
|
1481
1502
|
);
|
|
1482
1503
|
});
|
|
1483
1504
|
};
|
|
1484
|
-
return
|
|
1505
|
+
return p(r, e.start, "start"), p(l, e.end, "end"), [...r, ...l];
|
|
1485
1506
|
}
|
|
1486
1507
|
/** 修正2
|
|
1487
1508
|
* 第一步:确定需要修复的线段
|
|
@@ -1495,58 +1516,258 @@ class de extends N {
|
|
|
1495
1516
|
*/
|
|
1496
1517
|
correction(e, t = [], n = /* @__PURE__ */ new Set()) {
|
|
1497
1518
|
n.add(e);
|
|
1498
|
-
const
|
|
1499
|
-
const [
|
|
1500
|
-
return
|
|
1519
|
+
const s = this.renderManager.quadtree.queryLineSegment(e).filter(({ line: i }) => !(i === e || i.userData.isDoor || n.has(i))).map((i) => i.line), o = e.direction(), [a, r] = s.reduce((i, d) => {
|
|
1520
|
+
const [p, E] = i;
|
|
1521
|
+
return d.sameEndpoint(e) ? p.push(d) : E.push(d), i;
|
|
1501
1522
|
}, [[], []]);
|
|
1502
|
-
|
|
1503
|
-
const
|
|
1504
|
-
if (Math.abs(90 -
|
|
1505
|
-
const
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
),
|
|
1509
|
-
if (
|
|
1510
|
-
const
|
|
1523
|
+
a.forEach((i) => {
|
|
1524
|
+
const d = i.direction(), p = o.angleBetween(d, "angle");
|
|
1525
|
+
if (Math.abs(90 - p) > 45) return !1;
|
|
1526
|
+
const f = e.sameEndpointAsStart(i) ? e.start : e.end, y = i.sameEndpointAsStart(e) ? i.end : i.start, C = new z(
|
|
1527
|
+
y.clone().add(o.clone().multiplyScalar(1)),
|
|
1528
|
+
y.clone().add(o.clone().multiplyScalar(-1))
|
|
1529
|
+
), v = C.projectPoint(f, !1);
|
|
1530
|
+
if (v) {
|
|
1531
|
+
const w = [];
|
|
1511
1532
|
this.setLinePoint(
|
|
1512
1533
|
i,
|
|
1513
|
-
i.start ===
|
|
1514
|
-
i.end ===
|
|
1515
|
-
i.start ===
|
|
1516
|
-
|
|
1517
|
-
), t.push(
|
|
1534
|
+
i.start === y ? v : i.start,
|
|
1535
|
+
i.end === y ? v : i.end,
|
|
1536
|
+
i.start === y ? "start" : "end",
|
|
1537
|
+
w
|
|
1538
|
+
), t.push(w);
|
|
1518
1539
|
}
|
|
1519
1540
|
return n.add(i), !1;
|
|
1520
|
-
}),
|
|
1541
|
+
}), o.copy(e.direction());
|
|
1542
|
+
const l = (i, d, p) => {
|
|
1543
|
+
const E = e.projectPoint(d);
|
|
1544
|
+
if (E) i.copy(E);
|
|
1545
|
+
else {
|
|
1546
|
+
const f = new z(
|
|
1547
|
+
d.clone().add(o.clone().multiplyScalar(1)),
|
|
1548
|
+
d.clone().add(o.clone().multiplyScalar(-1))
|
|
1549
|
+
), y = f.projectPoint(i, !1);
|
|
1550
|
+
if (y) {
|
|
1551
|
+
const C = [];
|
|
1552
|
+
this.setLinePoint(
|
|
1553
|
+
p,
|
|
1554
|
+
p.start === d ? y : p.start,
|
|
1555
|
+
p.end === d ? y : p.end,
|
|
1556
|
+
p.start === d ? "start" : "end",
|
|
1557
|
+
C
|
|
1558
|
+
), t.push(C);
|
|
1559
|
+
}
|
|
1560
|
+
}
|
|
1561
|
+
};
|
|
1562
|
+
return r.forEach((i) => {
|
|
1563
|
+
if (e.containsPoint(i.start))
|
|
1564
|
+
l(i.start, i.end, i);
|
|
1565
|
+
else if (e.containsPoint(i.end))
|
|
1566
|
+
l(i.end, i.start, i);
|
|
1567
|
+
else {
|
|
1568
|
+
const d = e.getIntersection(i);
|
|
1569
|
+
if (d) {
|
|
1570
|
+
const p = new z(
|
|
1571
|
+
i.start.clone().add(o.clone().multiplyScalar(1)),
|
|
1572
|
+
i.start.clone().add(o.clone().multiplyScalar(-1))
|
|
1573
|
+
), E = p.projectPoint(d, !1);
|
|
1574
|
+
if (E) {
|
|
1575
|
+
const C = [];
|
|
1576
|
+
this.setLinePoint(i, E, i.end, "start", C), t.push(C);
|
|
1577
|
+
}
|
|
1578
|
+
const f = new z(
|
|
1579
|
+
i.end.clone().add(o.clone().multiplyScalar(1)),
|
|
1580
|
+
i.end.clone().add(o.clone().multiplyScalar(-1))
|
|
1581
|
+
), y = f.projectPoint(d, !1);
|
|
1582
|
+
if (y) {
|
|
1583
|
+
const C = [];
|
|
1584
|
+
this.setLinePoint(i, i.start, y, "end", C), t.push(C);
|
|
1585
|
+
}
|
|
1586
|
+
}
|
|
1587
|
+
}
|
|
1588
|
+
}), this.recursion && s.forEach((i) => this.correction(i, t, n)), t;
|
|
1589
|
+
}
|
|
1590
|
+
/** 轴对齐垂直修正
|
|
1591
|
+
* @param targettLine
|
|
1592
|
+
* @returns
|
|
1593
|
+
*/
|
|
1594
|
+
axisAlignmentCorrection(e) {
|
|
1595
|
+
function t(v, w) {
|
|
1596
|
+
const g = [v], S = [], A = [];
|
|
1597
|
+
for (let M = 0; M < w.length; M++) {
|
|
1598
|
+
const u = w[M];
|
|
1599
|
+
if (v !== u) {
|
|
1600
|
+
if (u.userData.isDoor) {
|
|
1601
|
+
A.push(u);
|
|
1602
|
+
continue;
|
|
1603
|
+
}
|
|
1604
|
+
if (u.parallel(v, 45)) {
|
|
1605
|
+
const D = Math.atan2(u.end.y - u.start.y, u.end.x - u.start.x);
|
|
1606
|
+
let m = Math.atan2(v.end.y - v.start.y, v.end.x - v.start.x) - D;
|
|
1607
|
+
for (; m > Math.PI; ) m -= 2 * Math.PI;
|
|
1608
|
+
for (; m < -Math.PI; ) m += 2 * Math.PI;
|
|
1609
|
+
const I = u.center;
|
|
1610
|
+
u.start.rotate(I, m), u.end.rotate(I, m), g.push(u);
|
|
1611
|
+
} else {
|
|
1612
|
+
const D = Math.atan2(u.end.y - u.start.y, u.end.x - u.start.x), b = Math.atan2(v.end.y - v.start.y, v.end.x - v.start.x);
|
|
1613
|
+
let m = b + Math.PI / 2 - D, I = b - Math.PI / 2 - D;
|
|
1614
|
+
for (; m > Math.PI; ) m -= 2 * Math.PI;
|
|
1615
|
+
for (; m < -Math.PI; ) m += 2 * Math.PI;
|
|
1616
|
+
for (; I > Math.PI; ) I -= 2 * Math.PI;
|
|
1617
|
+
for (; I < -Math.PI; ) I += 2 * Math.PI;
|
|
1618
|
+
const _ = Math.abs(m) < Math.abs(I) ? m : I, j = u.center;
|
|
1619
|
+
u.start.rotate(j, _), u.end.rotate(j, _), S.push(u);
|
|
1620
|
+
}
|
|
1621
|
+
}
|
|
1622
|
+
}
|
|
1623
|
+
return { parallelLines: g, verticalLines: S, doorLines: A };
|
|
1624
|
+
}
|
|
1625
|
+
function n(v, w, g, S = 0.3, A = 0.06) {
|
|
1626
|
+
const M = [];
|
|
1627
|
+
v.forEach((b) => {
|
|
1628
|
+
const m = g.projectPoint(b.start, !1);
|
|
1629
|
+
m && (m.userData = b, M.push(m));
|
|
1630
|
+
}), M.sort((b, m) => m.distance(g.start) - b.distance(g.start));
|
|
1631
|
+
const u = [], D = [];
|
|
1632
|
+
for (let b = 0; b < M.length; b++) {
|
|
1633
|
+
const m = M[b];
|
|
1634
|
+
if (b === 0) {
|
|
1635
|
+
D.push(m);
|
|
1636
|
+
continue;
|
|
1637
|
+
}
|
|
1638
|
+
M[b - 1].distance(m) < A || (u.push([...D]), D.length = 0), D.push(m), b === M.length - 1 && u.push(D);
|
|
1639
|
+
}
|
|
1640
|
+
return u.flatMap((b) => {
|
|
1641
|
+
const m = b.flatMap((N) => {
|
|
1642
|
+
const G = N.userData;
|
|
1643
|
+
return G.points.map((Y) => {
|
|
1644
|
+
const V = w.projectPoint(Y, !1);
|
|
1645
|
+
return V.userData = G, V;
|
|
1646
|
+
});
|
|
1647
|
+
});
|
|
1648
|
+
m.sort((N, G) => N.distance(w.start) - G.distance(w.start));
|
|
1649
|
+
const I = /* @__PURE__ */ new Map(), _ = [], j = [];
|
|
1650
|
+
return m.forEach((N, G) => {
|
|
1651
|
+
I.size === 0 && G > 0 && m[G - 1].distance(N) > S && (_.push([...j]), j.length = 0), I.set(N.userData, (I.get(N.userData) ?? 0) + 1);
|
|
1652
|
+
for (const Y of I.values()) if (Y !== 2) return;
|
|
1653
|
+
j.push(...I.keys()), I.clear();
|
|
1654
|
+
}), _.push([...j]), _;
|
|
1655
|
+
});
|
|
1656
|
+
}
|
|
1657
|
+
function s(v, w = 0.1) {
|
|
1658
|
+
return v.map((g) => {
|
|
1659
|
+
if (g.length === 0) return;
|
|
1660
|
+
if (g.length === 1) return g[0];
|
|
1661
|
+
const S = [];
|
|
1662
|
+
g.forEach((V) => {
|
|
1663
|
+
S.push(V.start.clone(), V.end.clone());
|
|
1664
|
+
});
|
|
1665
|
+
const A = g[0].direction().normalize();
|
|
1666
|
+
let M = 1 / 0, u = -1 / 0, D = 0, b = 0;
|
|
1667
|
+
S.forEach((V) => {
|
|
1668
|
+
const k = V.x * A.x + V.y * A.y;
|
|
1669
|
+
M = Math.min(M, k), u = Math.max(u, k), D += V.x, b += V.y;
|
|
1670
|
+
});
|
|
1671
|
+
const m = new R(D / S.length, b / S.length), I = m.x * A.x + m.y * A.y, _ = new R(m.x + (M - I) * A.x, m.y + (M - I) * A.y), j = new R(m.x + (u - I) * A.x, m.y + (u - I) * A.y), N = new z(_, j), G = g[0].normal().normalize();
|
|
1672
|
+
M = 1 / 0, u = -1 / 0, S.forEach((V) => {
|
|
1673
|
+
const k = V.x * G.x + V.y * G.y;
|
|
1674
|
+
M = Math.min(M, k), u = Math.max(u, k);
|
|
1675
|
+
});
|
|
1676
|
+
const Y = u - M;
|
|
1677
|
+
return Y >= w && (N.userData.wallWidth = Y), N;
|
|
1678
|
+
}).filter((g) => !!g);
|
|
1679
|
+
}
|
|
1680
|
+
function o(v, w = 0.2) {
|
|
1681
|
+
const g = new Le(Me.fromByLineSegment(...v)), S = /* @__PURE__ */ new Map();
|
|
1682
|
+
v.forEach((M) => {
|
|
1683
|
+
S.set(M, { line: M, userData: void 0 }), g.insert(S.get(M));
|
|
1684
|
+
});
|
|
1685
|
+
const A = new z();
|
|
1686
|
+
for (let M = 0; M < v.length; M++) {
|
|
1687
|
+
const u = v[M], D = u.direction().multiplyScalar(w), [b, m] = u.points.map((I) => {
|
|
1688
|
+
A.set(I, I), A.start.add(D), A.end.add(D.multiplyScalar(-1));
|
|
1689
|
+
const _ = /* @__PURE__ */ new Map(), j = g.queryRect(A.expandToRectangle(0.05, "bothSides")).filter((N) => N.line !== u).map((N) => {
|
|
1690
|
+
const G = N.line.getIntersection(A);
|
|
1691
|
+
return _.set(N.line, G), N.line;
|
|
1692
|
+
}).sort((N, G) => {
|
|
1693
|
+
const Y = _.get(N), V = _.get(G);
|
|
1694
|
+
return Y && V ? Y.distance(I) - V.distance(I) : 0;
|
|
1695
|
+
});
|
|
1696
|
+
return j.length ? _.get(j[0]) : void 0;
|
|
1697
|
+
});
|
|
1698
|
+
if (b && m)
|
|
1699
|
+
if (b.equal(m)) {
|
|
1700
|
+
const I = u.start.distance(b), _ = u.end.distance(m);
|
|
1701
|
+
I < _ ? u.directionMove(u.start.direction(u.end), I) : u.directionMove(u.end.direction(u.start), _);
|
|
1702
|
+
} else
|
|
1703
|
+
u.start.copy(b), u.end.copy(m);
|
|
1704
|
+
else b ? u.start.copy(b) : m && u.end.copy(m);
|
|
1705
|
+
g.remove(S.get(u)), g.insert(S.get(u));
|
|
1706
|
+
}
|
|
1707
|
+
return v.filter((M) => M.length() > 1e-3);
|
|
1708
|
+
}
|
|
1709
|
+
function a(v) {
|
|
1710
|
+
const w = new Le(Me.fromByLineSegment(...v));
|
|
1711
|
+
return v.forEach((g) => w.insert({ line: g, userData: void 0 })), v.flatMap((g) => {
|
|
1712
|
+
const S = w.queryLineSegment(g, !0).map((A) => {
|
|
1713
|
+
if (A.line === g) return;
|
|
1714
|
+
const M = A.line.getIntersection(g);
|
|
1715
|
+
if (!(!M || g.start.equal(M) || g.end.equal(M)))
|
|
1716
|
+
return M;
|
|
1717
|
+
}).filter((A) => !!A);
|
|
1718
|
+
return S.length ? (g = g.clone(), S.sort((M, u) => g.start.distance(M) - g.start.distance(u)), [...S.map((M) => {
|
|
1719
|
+
const u = g.clone();
|
|
1720
|
+
return u.set(g.start.clone(), M), g.start.copy(M), u;
|
|
1721
|
+
}), g]) : g;
|
|
1722
|
+
}).filter((g) => g.length() > 0.1);
|
|
1723
|
+
}
|
|
1724
|
+
const { parallelLines: r, verticalLines: l } = t(e, this.renderManager.lines.map((v) => v.clone())), i = e.normal(), d = e.center, p = e.direction(), E = new z(
|
|
1725
|
+
d.clone().add(i.clone().multiplyScalar(-1e3)),
|
|
1726
|
+
d.clone().add(i.clone().multiplyScalar(1e3))
|
|
1727
|
+
), f = new z(
|
|
1728
|
+
d.clone().add(p.clone().multiplyScalar(-1e3)),
|
|
1729
|
+
d.clone().add(p.clone().multiplyScalar(1e3))
|
|
1730
|
+
);
|
|
1731
|
+
let y = s([
|
|
1732
|
+
...n.call(this, r, f, E),
|
|
1733
|
+
...n.call(this, l, E, f)
|
|
1734
|
+
]);
|
|
1735
|
+
y = o.call(this, y), y = o.call(this, y), y = a.call(this, y);
|
|
1736
|
+
const C = [...this.renderManager.lines];
|
|
1737
|
+
return { newLines: y, oldLines: C };
|
|
1521
1738
|
}
|
|
1522
1739
|
/** 开始
|
|
1523
1740
|
* @param next
|
|
1524
1741
|
*/
|
|
1525
1742
|
verticalCorrection(e, t) {
|
|
1526
|
-
|
|
1743
|
+
const n = performance.now();
|
|
1744
|
+
e(this.axisAlignment ? this.axisAlignmentCorrection(t[0]) : this.correction(t[0])), console.log("处理时间:", performance.now() - n, "ms");
|
|
1527
1745
|
}
|
|
1528
1746
|
/** 执行完成
|
|
1529
1747
|
* @param data
|
|
1530
1748
|
*/
|
|
1531
1749
|
completed(e) {
|
|
1532
|
-
e.forEach((t) => {
|
|
1750
|
+
Array.isArray(e) ? e.forEach((t) => {
|
|
1533
1751
|
t.forEach((n) => {
|
|
1534
|
-
const { line:
|
|
1535
|
-
a.copy(
|
|
1752
|
+
const { line: s, newPoint: o, point: a } = n;
|
|
1753
|
+
a.copy(o), this.renderManager.removeLine(s), this.renderManager.addLine(s);
|
|
1536
1754
|
});
|
|
1537
|
-
}), this.renderManager.draw();
|
|
1755
|
+
}) : (this.renderManager.removeLines(e.oldLines), this.renderManager.addLines(e.newLines)), this.renderManager.draw();
|
|
1538
1756
|
}
|
|
1539
1757
|
/** 回滚操作
|
|
1540
1758
|
* @param data
|
|
1541
1759
|
*/
|
|
1542
1760
|
rollback(e) {
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1761
|
+
if (Array.isArray(e))
|
|
1762
|
+
for (let t = e.length - 1; t >= 0; t--) {
|
|
1763
|
+
const n = e[t];
|
|
1764
|
+
for (let s = n.length - 1; s >= 0; s--) {
|
|
1765
|
+
const o = n[s], { line: a, oldPoint: r, point: l } = o;
|
|
1766
|
+
l.copy(r), this.renderManager.removeLine(a), this.renderManager.addLine(a);
|
|
1767
|
+
}
|
|
1548
1768
|
}
|
|
1549
|
-
|
|
1769
|
+
else
|
|
1770
|
+
this.renderManager.removeLines(e.newLines), this.renderManager.addLines(e.oldLines);
|
|
1550
1771
|
return this.renderManager.draw(), e;
|
|
1551
1772
|
}
|
|
1552
1773
|
/** 撤回回滚
|
|
@@ -1557,40 +1778,40 @@ class de extends N {
|
|
|
1557
1778
|
return this.completed(e), e;
|
|
1558
1779
|
}
|
|
1559
1780
|
}
|
|
1560
|
-
class
|
|
1781
|
+
class ae extends W {
|
|
1561
1782
|
static name = "MergeLine";
|
|
1562
1783
|
shortcutKeys = ["control", "g"];
|
|
1563
1784
|
static commandName = "merge-line";
|
|
1564
1785
|
onAddFromParent(e) {
|
|
1565
1786
|
super.onAddFromParent(e);
|
|
1566
|
-
const t = e.findComponentByType(
|
|
1567
|
-
n.addEventListener("finally", this.createFinally()), n.addEventListener("completed", (
|
|
1568
|
-
t?.selectLines.length === 2 && this.eventInput.isKeyCombination(
|
|
1787
|
+
const t = e.findComponentByType(Ke), n = this.commandManager.addCommandFlow(ae.commandName).add(this.createInterrupt()).add(this.constraint.bind(this)).add(this.mergeLine.bind(this)).addRollback(this.rollback.bind(this)).addRevokeRollback(this.revokeRollback.bind(this));
|
|
1788
|
+
n.addEventListener("finally", this.createFinally()), n.addEventListener("completed", (s) => this.completed(s.data)), this.eventInput.addKeyCombination(ae.commandName, this.shortcutKeys), this.eventInput.addEventListener("codeChange", async () => {
|
|
1789
|
+
t?.selectLines.length === 2 && this.eventInput.isKeyCombination(ae.commandName) && await this.commandManager.start(ae.commandName, [...this.default.selectLines]);
|
|
1569
1790
|
}), this.eventInput.addCancelDefaultBehavior(() => this.eventInput.isOnlyKeyDowns(this.shortcutKeys));
|
|
1570
1791
|
}
|
|
1571
1792
|
/**
|
|
1572
1793
|
* 进入命令约束
|
|
1573
1794
|
*/
|
|
1574
1795
|
constraint(e, t) {
|
|
1575
|
-
Array.isArray(t) ? t.length !== 2 ? (
|
|
1796
|
+
Array.isArray(t) ? t.length !== 2 ? (B({ message: "未执行线段合并,请选择两条线段", type: "warning" }), this.cancel()) : e(t) : (B({ message: "进入命令失败", type: "warning" }), this.cancel());
|
|
1576
1797
|
}
|
|
1577
1798
|
/** 开始
|
|
1578
1799
|
* @param next
|
|
1579
1800
|
* @todo 合并所有
|
|
1580
1801
|
*/
|
|
1581
1802
|
mergeLine(e, t) {
|
|
1582
|
-
const n = t[0],
|
|
1583
|
-
for (let
|
|
1584
|
-
const a = n.points[
|
|
1585
|
-
for (let
|
|
1586
|
-
const
|
|
1587
|
-
if (a.equal(
|
|
1588
|
-
const
|
|
1589
|
-
return e({ line1: n, line2:
|
|
1803
|
+
const n = t[0], s = t[1];
|
|
1804
|
+
for (let o = 0; o < n.points.length; o++) {
|
|
1805
|
+
const a = n.points[o];
|
|
1806
|
+
for (let r = 0; r < s.points.length; r++) {
|
|
1807
|
+
const l = s.points[r];
|
|
1808
|
+
if (a.equal(l)) {
|
|
1809
|
+
const i = n.points[(o + 1) % 2], d = s.points[(r + 1) % 2], p = new z(i, d);
|
|
1810
|
+
return e({ line1: n, line2: s, newLine: p }), B({ message: "已合并", type: "success" });
|
|
1590
1811
|
}
|
|
1591
1812
|
}
|
|
1592
1813
|
}
|
|
1593
|
-
|
|
1814
|
+
B({ message: "合并失败,两条线未找到共用点", type: "warning" }), this.commandManager.cancel();
|
|
1594
1815
|
}
|
|
1595
1816
|
/** 执行完成
|
|
1596
1817
|
* @param data
|
|
@@ -1612,26 +1833,26 @@ class Y extends N {
|
|
|
1612
1833
|
return this.completed(e), e;
|
|
1613
1834
|
}
|
|
1614
1835
|
}
|
|
1615
|
-
class
|
|
1836
|
+
class ie extends W {
|
|
1616
1837
|
static name = "DeleteSelectLine";
|
|
1617
1838
|
shortcutKeys = ["Delete"];
|
|
1618
1839
|
static commandName = "deleteSelectLine";
|
|
1619
1840
|
onAddFromParent(e) {
|
|
1620
|
-
super.onAddFromParent(e), this.commandManager.addCommandFlow(
|
|
1621
|
-
this.eventInput.isKeyCombination(
|
|
1841
|
+
super.onAddFromParent(e), this.commandManager.addCommandFlow(ie.commandName).add(this.createInterrupt()).add(this.constraint.bind(this)).add(this.delete.bind(this)).addRollback(this.rollback.bind(this)).addRevokeRollback(this.revokeRollback.bind(this)).addEventListener("finally", this.createFinally()), this.eventInput.addKeyCombination(ie.commandName, this.shortcutKeys), this.eventInput.addEventListener("codeChange", async () => {
|
|
1842
|
+
this.eventInput.isKeyCombination(ie.commandName) && await this.commandManager.start(ie.commandName, [...this.default.selectLines]);
|
|
1622
1843
|
}), this.eventInput.addCancelDefaultBehavior(() => this.eventInput.isOnlyKeyDowns(this.shortcutKeys));
|
|
1623
1844
|
}
|
|
1624
1845
|
/**
|
|
1625
1846
|
* 进入命令约束
|
|
1626
1847
|
*/
|
|
1627
1848
|
constraint(e, t) {
|
|
1628
|
-
Array.isArray(t) ? t.length === 0 ? (
|
|
1849
|
+
Array.isArray(t) ? t.length === 0 ? (B({ message: "请选择线段", type: "warning" }), this.cancel()) : e(t) : (B({ message: "进入命令失败", type: "warning" }), this.cancel());
|
|
1629
1850
|
}
|
|
1630
1851
|
/** 开始
|
|
1631
1852
|
* @param next
|
|
1632
1853
|
*/
|
|
1633
1854
|
delete(e, t) {
|
|
1634
|
-
t.forEach((n) => this.renderManager.removeLine(n)),
|
|
1855
|
+
t.forEach((n) => this.renderManager.removeLine(n)), B({ message: "删除成功", type: "success" }), e(t);
|
|
1635
1856
|
}
|
|
1636
1857
|
/** 回滚操作
|
|
1637
1858
|
* @param data
|
|
@@ -1647,36 +1868,36 @@ class X extends N {
|
|
|
1647
1868
|
return e.forEach((t) => this.renderManager.removeLine(t)), e;
|
|
1648
1869
|
}
|
|
1649
1870
|
}
|
|
1650
|
-
class
|
|
1871
|
+
class re extends W {
|
|
1651
1872
|
static name = "ConnectionLine";
|
|
1652
1873
|
shortcutKeys = ["Shift", "L"];
|
|
1653
1874
|
static commandName = "connectionLine";
|
|
1654
1875
|
onAddFromParent(e) {
|
|
1655
1876
|
super.onAddFromParent(e);
|
|
1656
|
-
const t = this.commandManager.addCommandFlow(
|
|
1657
|
-
t.addEventListener("finally", this.createFinally()), t.addEventListener("completed", (n) => this.completed(n.data)), this.eventInput.addKeyCombination(
|
|
1658
|
-
this.eventInput.isKeyCombination(
|
|
1877
|
+
const t = this.commandManager.addCommandFlow(re.commandName).add(this.createInterrupt()).add(this.constraint.bind(this)).add(this.connection.bind(this)).addRollback(this.rollback.bind(this)).addRevokeRollback(this.revokeRollback.bind(this));
|
|
1878
|
+
t.addEventListener("finally", this.createFinally()), t.addEventListener("completed", (n) => this.completed(n.data)), this.eventInput.addKeyCombination(re.commandName, this.shortcutKeys), this.eventInput.addEventListener("codeChange", async () => {
|
|
1879
|
+
this.eventInput.isKeyCombination(re.commandName) && await this.commandManager.start(re.commandName, [...this.default.selectLines]);
|
|
1659
1880
|
}), this.eventInput.addCancelDefaultBehavior(() => this.eventInput.isOnlyKeyDowns(this.shortcutKeys));
|
|
1660
1881
|
}
|
|
1661
1882
|
/**
|
|
1662
1883
|
* 进入命令约束
|
|
1663
1884
|
*/
|
|
1664
1885
|
constraint(e, t) {
|
|
1665
|
-
Array.isArray(t) ? t.length !== 2 ? (
|
|
1886
|
+
Array.isArray(t) ? t.length !== 2 ? (B({ message: "请选择2条线段", type: "warning" }), this.cancel()) : e(t) : (B({ message: "进入命令失败", type: "warning" }), this.cancel());
|
|
1666
1887
|
}
|
|
1667
1888
|
/** 连接
|
|
1668
1889
|
* @param next
|
|
1669
1890
|
*/
|
|
1670
1891
|
connection(e, t) {
|
|
1671
|
-
let n,
|
|
1892
|
+
let n, s, o = 1 / 0;
|
|
1672
1893
|
for (let a = 0; a < 2; a++)
|
|
1673
|
-
for (let
|
|
1674
|
-
const
|
|
1675
|
-
|
|
1894
|
+
for (let r = 0; r < 2; r++) {
|
|
1895
|
+
const l = t[0].points[a], i = t[1].points[r], d = l.distance(i);
|
|
1896
|
+
d < o && (n = l, s = i, o = d);
|
|
1676
1897
|
}
|
|
1677
|
-
if (n &&
|
|
1678
|
-
const a = new
|
|
1679
|
-
e(a),
|
|
1898
|
+
if (n && s) {
|
|
1899
|
+
const a = new z(n.clone(), s.clone());
|
|
1900
|
+
e(a), B({ message: "连接成功", type: "success" });
|
|
1680
1901
|
} else this.cancel();
|
|
1681
1902
|
}
|
|
1682
1903
|
/** 成功
|
|
@@ -1700,47 +1921,47 @@ class $ extends N {
|
|
|
1700
1921
|
return this.completed(e), e;
|
|
1701
1922
|
}
|
|
1702
1923
|
}
|
|
1703
|
-
class
|
|
1924
|
+
class de extends W {
|
|
1704
1925
|
static name = "IntersectionConnectionLine";
|
|
1705
1926
|
shortcutKeys = ["control", "Shift", "L"];
|
|
1706
1927
|
static commandName = "intersectionConnectionLine";
|
|
1707
1928
|
onAddFromParent(e) {
|
|
1708
1929
|
super.onAddFromParent(e);
|
|
1709
|
-
const t = this.commandManager.addCommandFlow(
|
|
1710
|
-
t.addEventListener("finally", this.createFinally()), t.addEventListener("completed", (n) => this.completed(n.data)), this.eventInput.addKeyCombination(
|
|
1711
|
-
this.eventInput.isKeyCombination(
|
|
1930
|
+
const t = this.commandManager.addCommandFlow(de.commandName).add(this.createInterrupt()).add(this.constraint.bind(this)).add(this.connection.bind(this)).addRollback(this.rollback.bind(this)).addRevokeRollback(this.revokeRollback.bind(this));
|
|
1931
|
+
t.addEventListener("finally", this.createFinally()), t.addEventListener("completed", (n) => this.completed(n.data)), this.eventInput.addKeyCombination(de.commandName, this.shortcutKeys), this.eventInput.addEventListener("codeChange", async () => {
|
|
1932
|
+
this.eventInput.isKeyCombination(de.commandName) && await this.commandManager.start(de.commandName, [...this.default.selectLines]);
|
|
1712
1933
|
}), this.eventInput.addCancelDefaultBehavior(() => this.eventInput.isOnlyKeyDowns(this.shortcutKeys));
|
|
1713
1934
|
}
|
|
1714
1935
|
/**
|
|
1715
1936
|
* 进入命令约束
|
|
1716
1937
|
*/
|
|
1717
1938
|
constraint(e, t) {
|
|
1718
|
-
Array.isArray(t) ? t.length !== 2 ? (
|
|
1939
|
+
Array.isArray(t) ? t.length !== 2 ? (B({ message: "请选择2条线段", type: "warning" }), this.cancel()) : e(t) : (B({ message: "进入命令失败", type: "warning" }), this.cancel());
|
|
1719
1940
|
}
|
|
1720
1941
|
/** 开始
|
|
1721
1942
|
* @param next
|
|
1722
1943
|
*/
|
|
1723
1944
|
connection(e, t) {
|
|
1724
|
-
const n = t[0],
|
|
1725
|
-
if (!
|
|
1726
|
-
const a = n.points.map((
|
|
1727
|
-
n.start.distance(
|
|
1728
|
-
const
|
|
1729
|
-
e({ line1: n, line2:
|
|
1945
|
+
const n = t[0], s = t[1], o = t[0].getIntersection(t[1]);
|
|
1946
|
+
if (!o) return;
|
|
1947
|
+
const a = n.points.map((d) => d.clone()), r = s.points.map((d) => d.clone());
|
|
1948
|
+
n.start.distance(o) < n.end.distance(o) ? n.start.copy(o) : n.end.copy(o), s.start.distance(o) < s.end.distance(o) ? s.start.copy(o) : s.end.copy(o);
|
|
1949
|
+
const l = n.points.map((d) => d.clone()), i = s.points.map((d) => d.clone());
|
|
1950
|
+
e({ line1: n, line2: s, oldLine1: a, oldLine2: r, newLine1: l, newLine2: i }), B({ message: "连接成功", type: "success" });
|
|
1730
1951
|
}
|
|
1731
1952
|
/** 执行完成
|
|
1732
1953
|
* @param next
|
|
1733
1954
|
* @param selectLines
|
|
1734
1955
|
*/
|
|
1735
|
-
completed({ line1: e, line2: t, newLine1: n, newLine2:
|
|
1736
|
-
this.renderManager.removeLine(e), this.renderManager.removeLine(t), e.set(...n), t.set(...
|
|
1956
|
+
completed({ line1: e, line2: t, newLine1: n, newLine2: s }) {
|
|
1957
|
+
this.renderManager.removeLine(e), this.renderManager.removeLine(t), e.set(...n), t.set(...s), this.renderManager.addLines([e, t]), this.renderManager.draw();
|
|
1737
1958
|
}
|
|
1738
1959
|
/** 回滚操作
|
|
1739
1960
|
* @param data
|
|
1740
1961
|
*/
|
|
1741
1962
|
rollback(e) {
|
|
1742
|
-
const { line1: t, line2: n, oldLine1:
|
|
1743
|
-
return this.renderManager.removeLine(t), this.renderManager.removeLine(n), t.set(...
|
|
1963
|
+
const { line1: t, line2: n, oldLine1: s, oldLine2: o } = e;
|
|
1964
|
+
return this.renderManager.removeLine(t), this.renderManager.removeLine(n), t.set(...s), n.set(...o), this.renderManager.addLines([t, n]), this.renderManager.draw(), e;
|
|
1744
1965
|
}
|
|
1745
1966
|
/** 撤回回滚
|
|
1746
1967
|
* @param lines
|
|
@@ -1750,34 +1971,34 @@ class ee extends N {
|
|
|
1750
1971
|
return this.completed(e), e;
|
|
1751
1972
|
}
|
|
1752
1973
|
}
|
|
1753
|
-
class
|
|
1974
|
+
class le extends W {
|
|
1754
1975
|
static name = "DeleteSelectWindow";
|
|
1755
1976
|
shortcutKeys = ["Q", "Delete"];
|
|
1756
1977
|
static commandName = "deleteSelectWindow";
|
|
1757
1978
|
onAddFromParent(e) {
|
|
1758
1979
|
super.onAddFromParent(e);
|
|
1759
|
-
const t = this.commandManager.addCommandFlow(
|
|
1760
|
-
t.addEventListener("finally", this.createFinally()), t.addEventListener("completed", (n) => this.completed(n.data)), this.eventInput.addKeyCombination(
|
|
1761
|
-
this.eventInput.isKeyCombination(
|
|
1980
|
+
const t = this.commandManager.addCommandFlow(le.commandName).add(this.createInterrupt()).add(this.constraint.bind(this)).add(this.end.bind(this)).addRollback(this.rollback.bind(this)).addRevokeRollback(this.revokeRollback.bind(this));
|
|
1981
|
+
t.addEventListener("finally", this.createFinally()), t.addEventListener("completed", (n) => this.completed(n.data)), this.eventInput.addKeyCombination(le.commandName, this.shortcutKeys), this.eventInput.addEventListener("codeChange", async () => {
|
|
1982
|
+
this.eventInput.isKeyCombination(le.commandName) && await this.commandManager.start(le.commandName, [...this.default.selectLines]);
|
|
1762
1983
|
}), this.eventInput.addCancelDefaultBehavior(() => this.eventInput.isOnlyKeyDowns(this.shortcutKeys));
|
|
1763
1984
|
}
|
|
1764
1985
|
/**
|
|
1765
1986
|
* 进入命令约束
|
|
1766
1987
|
*/
|
|
1767
1988
|
constraint(e, t) {
|
|
1768
|
-
Array.isArray(t) ? t.some((n) => n.userData.isWindow) ? e(t) : (
|
|
1989
|
+
Array.isArray(t) ? t.some((n) => n.userData.isWindow) ? e(t) : (B({ message: "请选择有窗户线段", type: "warning" }), this.cancel()) : (B({ message: "进入命令失败", type: "warning" }), this.cancel());
|
|
1769
1990
|
}
|
|
1770
1991
|
/** 开始
|
|
1771
1992
|
* @param next
|
|
1772
1993
|
*/
|
|
1773
1994
|
end(e, t) {
|
|
1774
|
-
let n = !1,
|
|
1775
|
-
t.forEach((
|
|
1776
|
-
|
|
1777
|
-
line:
|
|
1778
|
-
drawDoorData:
|
|
1995
|
+
let n = !1, s = [];
|
|
1996
|
+
t.forEach((o) => {
|
|
1997
|
+
o.userData.isWindow && (s.push({
|
|
1998
|
+
line: o,
|
|
1999
|
+
drawDoorData: o.userData.drawDoorData
|
|
1779
2000
|
}), n = !0);
|
|
1780
|
-
}), n &&
|
|
2001
|
+
}), n && B({ message: "删除窗户成功", type: "success" }), e(s);
|
|
1781
2002
|
}
|
|
1782
2003
|
/**
|
|
1783
2004
|
* 完成
|
|
@@ -1807,16 +2028,16 @@ class te extends N {
|
|
|
1807
2028
|
return this.completed(e), e;
|
|
1808
2029
|
}
|
|
1809
2030
|
}
|
|
1810
|
-
class
|
|
2031
|
+
class ce extends W {
|
|
1811
2032
|
static name = "SelectAll";
|
|
1812
|
-
container = new
|
|
2033
|
+
container = new h.Group();
|
|
1813
2034
|
shortcutKeys = ["control", "a"];
|
|
1814
2035
|
static commandName = "selectAll";
|
|
1815
2036
|
onAddFromParent(e) {
|
|
1816
2037
|
super.onAddFromParent(e), this.editor.container.add(this.container), this.container.position.z = 1e-3;
|
|
1817
|
-
const t = this.commandManager.addCommandFlow(
|
|
1818
|
-
t.writeOperationList = !1, t.addEventListener("finally", this.createFinally()), t.addEventListener("completed", (n) => this.completed(n.data)), this.eventInput.addKeyCombination(
|
|
1819
|
-
this.eventInput.isKeyCombination(
|
|
2038
|
+
const t = this.commandManager.addCommandFlow(ce.commandName).add(this.createInterrupt()).add(this.selectAll.bind(this)).addRollback(this.rollback.bind(this)).addRevokeRollback(this.revokeRollback.bind(this));
|
|
2039
|
+
t.writeOperationList = !1, t.addEventListener("finally", this.createFinally()), t.addEventListener("completed", (n) => this.completed(n.data)), this.eventInput.addKeyCombination(ce.commandName, this.shortcutKeys), this.eventInput.addEventListener("codeChange", async () => {
|
|
2040
|
+
this.eventInput.isKeyCombination(ce.commandName) && await this.commandManager.start(ce.commandName);
|
|
1820
2041
|
}), this.eventInput.addCancelDefaultBehavior(() => this.eventInput.isOnlyKeyDowns(this.shortcutKeys));
|
|
1821
2042
|
}
|
|
1822
2043
|
/** 开始
|
|
@@ -1844,22 +2065,22 @@ class ne extends N {
|
|
|
1844
2065
|
return this.completed(e), e;
|
|
1845
2066
|
}
|
|
1846
2067
|
}
|
|
1847
|
-
class
|
|
2068
|
+
class me extends W {
|
|
1848
2069
|
static name = "ViewAngle";
|
|
1849
2070
|
shortcutKeys = ["r"];
|
|
1850
2071
|
static commandName = "viewAngle";
|
|
1851
2072
|
onAddFromParent(e) {
|
|
1852
2073
|
super.onAddFromParent(e);
|
|
1853
|
-
const t = this.commandManager.addCommandFlow(
|
|
1854
|
-
t.writeOperationList = !1, t.addEventListener("finally", this.createFinally()), this.eventInput.addKeyCombination(
|
|
1855
|
-
this.eventInput.isKeyCombination(
|
|
2074
|
+
const t = this.commandManager.addCommandFlow(me.commandName).add(this.createInterrupt()).add(this.constraint.bind(this)).add(this.viewAngle.bind(this));
|
|
2075
|
+
t.writeOperationList = !1, t.addEventListener("finally", this.createFinally()), this.eventInput.addKeyCombination(me.commandName, this.shortcutKeys), this.eventInput.addEventListener("codeChange", async () => {
|
|
2076
|
+
this.eventInput.isKeyCombination(me.commandName) && await this.commandManager.start(me.commandName, [...this.default.selectLines]);
|
|
1856
2077
|
}), this.eventInput.addCancelDefaultBehavior(() => this.eventInput.isOnlyKeyDowns(this.shortcutKeys));
|
|
1857
2078
|
}
|
|
1858
2079
|
/**
|
|
1859
2080
|
* 进入命令约束
|
|
1860
2081
|
*/
|
|
1861
2082
|
constraint(e, t) {
|
|
1862
|
-
Array.isArray(t) ? t.length !== 2 || !t[0].sameEndpoint(t[1]) ? (
|
|
2083
|
+
Array.isArray(t) ? t.length !== 2 || !t[0].sameEndpoint(t[1]) ? (B({ message: "请选择两条具有端点相交的线段", type: "warning" }), this.cancel()) : e(t) : (B({ message: "进入命令失败", type: "warning" }), this.cancel());
|
|
1863
2084
|
}
|
|
1864
2085
|
/**
|
|
1865
2086
|
*
|
|
@@ -1867,38 +2088,38 @@ class oe extends N {
|
|
|
1867
2088
|
* @param selectLines
|
|
1868
2089
|
*/
|
|
1869
2090
|
viewAngle(e, t) {
|
|
1870
|
-
const [n,
|
|
1871
|
-
let a,
|
|
1872
|
-
n.sameEndpointAsStart(
|
|
1873
|
-
function
|
|
1874
|
-
const
|
|
1875
|
-
let
|
|
1876
|
-
return
|
|
2091
|
+
const [n, s] = t, o = Math.min(0.5, n.length(), s.length());
|
|
2092
|
+
let a, r, l, i = 0, d = 0;
|
|
2093
|
+
n.sameEndpointAsStart(s) ? (a = n.start, r = n.end) : (a = n.end, r = n.start), s.sameEndpointAsStart(n) ? l = s.end : l = s.start;
|
|
2094
|
+
function p(D, b) {
|
|
2095
|
+
const m = b.x - D.x, I = b.y - D.y;
|
|
2096
|
+
let _ = Math.atan2(I, m) * (180 / Math.PI);
|
|
2097
|
+
return _ < 0 && (_ += 360), _;
|
|
1877
2098
|
}
|
|
1878
|
-
const
|
|
1879
|
-
function
|
|
1880
|
-
for (let
|
|
1881
|
-
const
|
|
1882
|
-
|
|
2099
|
+
const E = p(a, r), f = p(a, l), y = Math.min(E, f), C = Math.max(E, f), v = [];
|
|
2100
|
+
function w(D, b) {
|
|
2101
|
+
for (let m = D; m <= b; m++) {
|
|
2102
|
+
const I = Math.cos(m * Math.PI / 180) * o + a.x, _ = Math.sin(m * Math.PI / 180) * o + a.y, j = Math.cos((m + 1) * Math.PI / 180) * o + a.x, N = Math.sin((m + 1) * Math.PI / 180) * o + a.y;
|
|
2103
|
+
v.push(I, _, 0, j, N, 0);
|
|
1883
2104
|
}
|
|
1884
2105
|
}
|
|
1885
|
-
|
|
1886
|
-
const
|
|
1887
|
-
|
|
1888
|
-
position:
|
|
1889
|
-
},
|
|
1890
|
-
const
|
|
2106
|
+
C - y > 180 ? (w(0, y), w(C, 360), i = 360 - (C - y), d = (C + i / 2) % 360) : (w(y, C), i = C - y, d = y + i / 2);
|
|
2107
|
+
const g = new h.LineSegments();
|
|
2108
|
+
g.geometry = this.renderManager.createGeometry({
|
|
2109
|
+
position: v
|
|
2110
|
+
}, v.length / 3), g.material = new h.LineBasicMaterial({ color: 16711935 }), this.renderManager.container.add(g);
|
|
2111
|
+
const S = Math.cos(d * Math.PI / 180) * o + a.x, A = Math.sin(d * Math.PI / 180) * o + a.y, M = this.renderer.createText(Number(i.toFixed(2)), new h.Vector3(S, A, 0), {
|
|
1891
2112
|
textShadow: "0px 0px 2px #000"
|
|
1892
2113
|
}, this.renderManager.container);
|
|
1893
|
-
let
|
|
1894
|
-
this.addEventRecord("clear").add(() =>
|
|
1895
|
-
this.eventInput.isOnlyKeyDown("enter") ? e() : this.eventInput.isOnlyKeyDown("mouse_0") && (
|
|
2114
|
+
let u = 0;
|
|
2115
|
+
this.addEventRecord("clear").add(() => g.removeFromParent()).add(() => M.removeFromParent()).add(this.eventInput.addEventListener("codeChange", () => {
|
|
2116
|
+
this.eventInput.isOnlyKeyDown("enter") ? e() : this.eventInput.isOnlyKeyDown("mouse_0") && (u++, u === 1 ? setTimeout(() => u = 0, 500) : u === 2 && (e(), u = 0));
|
|
1896
2117
|
}));
|
|
1897
2118
|
}
|
|
1898
2119
|
}
|
|
1899
|
-
class
|
|
2120
|
+
class ct extends W {
|
|
1900
2121
|
static name = "ClippingLine";
|
|
1901
|
-
container = new
|
|
2122
|
+
container = new h.Group();
|
|
1902
2123
|
shortcutKeys = ["control", "x"];
|
|
1903
2124
|
commandName = "clippingLine";
|
|
1904
2125
|
static commandName = "clippingLine";
|
|
@@ -1911,24 +2132,24 @@ class rt extends N {
|
|
|
1911
2132
|
* @param next
|
|
1912
2133
|
*/
|
|
1913
2134
|
selectPointStart(e) {
|
|
1914
|
-
let t = null, n = new
|
|
2135
|
+
let t = null, n = new h.Mesh(new h.SphereGeometry(0.04), new h.MeshBasicMaterial({ color: 16711935 })), s = null;
|
|
1915
2136
|
this.addEventRecord("selectPointStart").add(this.editor.addEventListener("pointerPositionChange", () => {
|
|
1916
|
-
const { point:
|
|
1917
|
-
this.dispatchEvent({ type: "pointerMove", point:
|
|
2137
|
+
const { point: o, line: a, find: r } = this.editor.renderManager.adsorption();
|
|
2138
|
+
this.dispatchEvent({ type: "pointerMove", point: o }), r ? (this.domElement.style.cursor = "none", n.position.copy(o), s = a, t = o.clone(), this.container.add(n)) : (this.domElement.style.cursor = "no-drop", t = null, n.removeFromParent());
|
|
1918
2139
|
})).add(this.eventInput.addEventListener("codeChange", () => {
|
|
1919
|
-
this.eventInput.isKeyDown("mouse_0") && t && (this.canceEventRecord("selectPointStart"), e({ point: t, line:
|
|
2140
|
+
this.eventInput.isKeyDown("mouse_0") && t && (this.canceEventRecord("selectPointStart"), e({ point: t, line: s }));
|
|
1920
2141
|
})), this.addEventRecord("clear").add(() => n.removeFromParent());
|
|
1921
2142
|
}
|
|
1922
2143
|
/** 选择结束点
|
|
1923
2144
|
* @param next
|
|
1924
2145
|
*/
|
|
1925
2146
|
selectPointEnd(e, { point: t, line: n }) {
|
|
1926
|
-
let
|
|
1927
|
-
this.addEventRecord("clear").add(() =>
|
|
1928
|
-
const { point: a, find:
|
|
1929
|
-
this.dispatchEvent({ type: "pointerMove", point: a }),
|
|
2147
|
+
let s = null, o = new h.Mesh(new h.SphereGeometry(0.04), new h.MeshBasicMaterial({ color: 16711935 }));
|
|
2148
|
+
this.addEventRecord("clear").add(() => o.removeFromParent()).add(this.editor.addEventListener("pointerPositionChange", () => {
|
|
2149
|
+
const { point: a, find: r, line: l } = this.editor.renderManager.adsorption();
|
|
2150
|
+
this.dispatchEvent({ type: "pointerMove", point: a }), r && l === n ? (this.domElement.style.cursor = "none", o.position.copy(a), s = a.clone(), this.container.add(o)) : (this.domElement.style.cursor = "no-drop", s = null, o.removeFromParent());
|
|
1930
2151
|
})).add(this.eventInput.addEventListener("codeChange", () => {
|
|
1931
|
-
this.eventInput.isKeyDown("mouse_0") &&
|
|
2152
|
+
this.eventInput.isKeyDown("mouse_0") && s && e({ line: n, start: t, end: s });
|
|
1932
2153
|
}));
|
|
1933
2154
|
}
|
|
1934
2155
|
/**
|
|
@@ -1936,17 +2157,17 @@ class rt extends N {
|
|
|
1936
2157
|
* @param next
|
|
1937
2158
|
* @param points
|
|
1938
2159
|
*/
|
|
1939
|
-
end(e, { start: t, end: n, line:
|
|
1940
|
-
const
|
|
2160
|
+
end(e, { start: t, end: n, line: s }) {
|
|
2161
|
+
const o = R.from(t), a = R.from(n);
|
|
1941
2162
|
e({
|
|
1942
|
-
oldLine:
|
|
1943
|
-
newLine1: new
|
|
1944
|
-
|
|
1945
|
-
|
|
2163
|
+
oldLine: s,
|
|
2164
|
+
newLine1: new z(
|
|
2165
|
+
s.start,
|
|
2166
|
+
s.start.distance(o) < s.start.distance(a) ? o.clone() : a.clone()
|
|
1946
2167
|
),
|
|
1947
|
-
newLine2: new
|
|
1948
|
-
|
|
1949
|
-
|
|
2168
|
+
newLine2: new z(
|
|
2169
|
+
s.end,
|
|
2170
|
+
s.end.distance(o) < s.end.distance(a) ? o.clone() : a.clone()
|
|
1950
2171
|
)
|
|
1951
2172
|
});
|
|
1952
2173
|
}
|
|
@@ -1969,22 +2190,22 @@ class rt extends N {
|
|
|
1969
2190
|
return this.completed(e), e;
|
|
1970
2191
|
}
|
|
1971
2192
|
}
|
|
1972
|
-
class
|
|
2193
|
+
class he extends W {
|
|
1973
2194
|
static name = "VerticalReferenceLine";
|
|
1974
2195
|
shortcutKeys = ["v"];
|
|
1975
2196
|
static commandName = "VerticalReferenceLine";
|
|
1976
2197
|
onAddFromParent(e) {
|
|
1977
2198
|
super.onAddFromParent(e);
|
|
1978
|
-
const t = this.commandManager.addCommandFlow(
|
|
1979
|
-
t.writeOperationList = !1, t.addEventListener("finally", this.createFinally()), this.eventInput.addKeyCombination(
|
|
1980
|
-
this.eventInput.isKeyCombination(
|
|
2199
|
+
const t = this.commandManager.addCommandFlow(he.commandName).add(this.createInterrupt()).add(this.constraint.bind(this)).add(this.verticalReferenceLine.bind(this));
|
|
2200
|
+
t.writeOperationList = !1, t.addEventListener("finally", this.createFinally()), this.eventInput.addKeyCombination(he.commandName, this.shortcutKeys), this.eventInput.addEventListener("codeChange", async () => {
|
|
2201
|
+
this.eventInput.isKeyCombination(he.commandName) && await this.commandManager.start(he.commandName, [...this.default.selectLines]);
|
|
1981
2202
|
}), this.eventInput.addCancelDefaultBehavior(() => this.eventInput.isOnlyKeyDowns(this.shortcutKeys));
|
|
1982
2203
|
}
|
|
1983
2204
|
/**
|
|
1984
2205
|
* 进入命令约束
|
|
1985
2206
|
*/
|
|
1986
2207
|
constraint(e, t) {
|
|
1987
|
-
Array.isArray(t) ? t.length !== 1 ? (
|
|
2208
|
+
Array.isArray(t) ? t.length !== 1 ? (B({ message: "请选择一条墙壁线段", type: "warning" }), this.cancel()) : t[0].userData.isDoor ? (B({ message: "请选择一条墙壁线段", type: "warning" }), this.cancel()) : e(t) : (B({ message: "进入命令失败", type: "warning" }), this.cancel());
|
|
1988
2209
|
}
|
|
1989
2210
|
/**
|
|
1990
2211
|
*
|
|
@@ -1997,67 +2218,67 @@ class se extends N {
|
|
|
1997
2218
|
}), t[0].userData.isVerticalReferenceLine = !0, e(), this.renderManager.draw();
|
|
1998
2219
|
}
|
|
1999
2220
|
}
|
|
2000
|
-
const
|
|
2221
|
+
const as = {
|
|
2001
2222
|
key: 0,
|
|
2002
2223
|
class: "mt-[5px] text-[#ccc] text-[11px] absolute left-[10px] bottom-[10px] rounded-[8px] min-w-[150px] bg-black/15 p-[10px]"
|
|
2003
|
-
},
|
|
2224
|
+
}, is = { class: "text-start max-w-[150px]" }, rs = { class: "inline-block ml-[10px] text-[var(--color-primary)]" }, ds = {
|
|
2004
2225
|
key: 0,
|
|
2005
2226
|
class: "p-[5px] max-w-[200px]"
|
|
2006
|
-
},
|
|
2227
|
+
}, ls = { class: "text-[14px] flex flex-col" }, cs = ["onClick"], ms = { class: "flex flex-row items-center" }, hs = { class: "flex justify-center items-center size-[20px] bg-[#f0f0f0] rounded-[2px] mr-[10px]" }, us = ["src"], ps = { class: "text-wrap" }, gs = {
|
|
2007
2228
|
key: 1,
|
|
2008
2229
|
class: "text-[#999]"
|
|
2009
|
-
},
|
|
2230
|
+
}, vs = {
|
|
2010
2231
|
style: { "--el-color-primary": "var(--primary-color)" },
|
|
2011
2232
|
class: "flex flex-row items-center justify-between gap-[10px] mt-[10px] text-[10px]"
|
|
2012
|
-
},
|
|
2233
|
+
}, fs = {
|
|
2013
2234
|
key: 0,
|
|
2014
2235
|
class: "flex flex-row items-center flex-wrap justify-between gap-[10px] mt-[10px] text-[10px]"
|
|
2015
|
-
},
|
|
2236
|
+
}, ys = { class: "flex-wrap border-t-1 border-t-[#eee] mt-[5px] pt-[5px] flex items-center gap-[10px]" }, ws = ["onClick", "title"], bs = ["src"], xs = /* @__PURE__ */ ve({
|
|
2016
2237
|
__name: "EditorTool",
|
|
2017
2238
|
props: {
|
|
2018
2239
|
dxfSystem: {},
|
|
2019
2240
|
permission: {}
|
|
2020
2241
|
},
|
|
2021
|
-
setup(
|
|
2022
|
-
function e(
|
|
2023
|
-
const
|
|
2024
|
-
|
|
2242
|
+
setup(c) {
|
|
2243
|
+
function e(k, x, P = p.value.getBoundingClientRect(), te = E.value.getBoundingClientRect()) {
|
|
2244
|
+
const fe = P.width - te.width, ye = 0, De = P.height - te.height;
|
|
2245
|
+
k = Math.max(0, Math.min(k, fe)), x = Math.max(ye, Math.min(x, De)), D.value = { left: k, top: x };
|
|
2025
2246
|
}
|
|
2026
|
-
function t(
|
|
2027
|
-
|
|
2247
|
+
function t(k) {
|
|
2248
|
+
y.value === k.command || y.value !== "default" || w.commandManager.start(k.command);
|
|
2028
2249
|
}
|
|
2029
|
-
function n(
|
|
2030
|
-
if (
|
|
2031
|
-
localStorage.setItem("lines", JSON.stringify(
|
|
2250
|
+
function n(k) {
|
|
2251
|
+
if (k) {
|
|
2252
|
+
localStorage.setItem("lines", JSON.stringify(k));
|
|
2032
2253
|
try {
|
|
2033
|
-
|
|
2034
|
-
} catch (
|
|
2035
|
-
console.log(
|
|
2254
|
+
C.Dxf.set(k), C.Dxf.lineOffset();
|
|
2255
|
+
} catch (x) {
|
|
2256
|
+
console.log(x);
|
|
2036
2257
|
}
|
|
2037
2258
|
}
|
|
2038
2259
|
}
|
|
2039
|
-
async function
|
|
2040
|
-
const
|
|
2041
|
-
Array.isArray(
|
|
2260
|
+
async function s() {
|
|
2261
|
+
const k = await kt.json();
|
|
2262
|
+
Array.isArray(k) && (localStorage.removeItem("orbitControls"), n(k));
|
|
2042
2263
|
}
|
|
2043
|
-
function
|
|
2044
|
-
|
|
2045
|
-
const
|
|
2264
|
+
function o({ offsetX: k, offsetY: x }) {
|
|
2265
|
+
v.mouseMoveEventProxylock = !0;
|
|
2266
|
+
const P = document.body.style.cursor;
|
|
2046
2267
|
document.body.style.cursor = "move";
|
|
2047
|
-
const
|
|
2048
|
-
const
|
|
2268
|
+
const te = (fe) => {
|
|
2269
|
+
const ye = p.value.getBoundingClientRect(), De = E.value.getBoundingClientRect();
|
|
2049
2270
|
e(
|
|
2050
|
-
|
|
2051
|
-
|
|
2052
|
-
|
|
2053
|
-
|
|
2054
|
-
),
|
|
2055
|
-
},
|
|
2056
|
-
document.body.removeEventListener("mousemove",
|
|
2271
|
+
fe.pageX - ye.left - k,
|
|
2272
|
+
fe.pageY - ye.top - x,
|
|
2273
|
+
ye,
|
|
2274
|
+
De
|
|
2275
|
+
), fe.stopPropagation(), document.body.style.cursor = "move";
|
|
2276
|
+
}, ke = () => {
|
|
2277
|
+
document.body.removeEventListener("mousemove", te), document.removeEventListener("mouseup", ke), document.body.style.cursor = P, v.mouseMoveEventProxylock = !1;
|
|
2057
2278
|
};
|
|
2058
|
-
document.body.addEventListener("mousemove",
|
|
2279
|
+
document.body.addEventListener("mousemove", te), document.addEventListener("mouseup", ke);
|
|
2059
2280
|
}
|
|
2060
|
-
const a =
|
|
2281
|
+
const a = c, r = T(!0), l = T(!0), i = T(!0), d = T(!1), p = T(), E = T(), f = T(!0), y = T(""), C = Ot(a.dxfSystem), v = C.findComponentByType(Pt), w = C.findComponentByType(mt), g = C.findComponentByType(Ke), S = C.findComponentByType(St), A = C.findComponentByType(At), M = T(0), u = T(0), D = T({ left: 10, top: 100 }), b = /* @__PURE__ */ Object.assign({ "./assets/images/angle.svg": Cn, "./assets/images/connection.svg": Mn, "./assets/images/cutLine.svg": In, "./assets/images/deleteSelectLine.svg": kn, "./assets/images/deleteSelectWindow.svg": Sn, "./assets/images/door.svg": _n, "./assets/images/intersectionConnection.svg": Nn, "./assets/images/line.svg": Rn, "./assets/images/mergeLine.svg": Fn, "./assets/images/revokeRollback.svg": Tn, "./assets/images/rollback.svg": Vn, "./assets/images/selectAll.svg": Qn, "./assets/images/selectPoint.svg": Wn, "./assets/images/verticalCorrection.svg": Un, "./assets/images/verticalLine.svg": Zn, "./assets/images/window.svg": Xn }), m = T(!1), I = T(0), _ = T(!1), j = new ResizeObserver(() => e(D.value.left, D.value.top)), N = [
|
|
2061
2282
|
{ name: "开启绘制线段命令", shortcut: "Ctrl + L" },
|
|
2062
2283
|
{ name: "开启绘制门线命令", shortcut: "Ctrl + M" },
|
|
2063
2284
|
{ name: "开启绘制窗户线命令", shortcut: "Ctrl + Q" },
|
|
@@ -2077,7 +2298,7 @@ const oo = {
|
|
|
2077
2298
|
{ name: "取消命令", shortcut: "Esc" },
|
|
2078
2299
|
{ name: "回滚操作", shortcut: "Ctrl + Z" },
|
|
2079
2300
|
{ name: "取消回滚操作", shortcut: "Ctrl + Y" }
|
|
2080
|
-
],
|
|
2301
|
+
], G = [
|
|
2081
2302
|
{
|
|
2082
2303
|
command: "default",
|
|
2083
2304
|
name: "默认",
|
|
@@ -2087,7 +2308,7 @@ const oo = {
|
|
|
2087
2308
|
{
|
|
2088
2309
|
command: "draw-line",
|
|
2089
2310
|
name: "绘制线段",
|
|
2090
|
-
src:
|
|
2311
|
+
src: b["./assets/images/line.svg"].default,
|
|
2091
2312
|
show: !0,
|
|
2092
2313
|
shortcut: "Ctrl + L"
|
|
2093
2314
|
},
|
|
@@ -2095,222 +2316,226 @@ const oo = {
|
|
|
2095
2316
|
command: "draw-door-line",
|
|
2096
2317
|
name: "绘制门线",
|
|
2097
2318
|
show: !0,
|
|
2098
|
-
src:
|
|
2319
|
+
src: b["./assets/images/door.svg"].default,
|
|
2099
2320
|
shortcut: "Ctrl + M"
|
|
2100
2321
|
},
|
|
2101
2322
|
{
|
|
2102
2323
|
command: "draw-window-line",
|
|
2103
2324
|
name: "绘制窗户线",
|
|
2104
2325
|
show: !0,
|
|
2105
|
-
src:
|
|
2326
|
+
src: b["./assets/images/window.svg"].default,
|
|
2106
2327
|
shortcut: "Ctrl + Q"
|
|
2107
2328
|
},
|
|
2108
2329
|
{
|
|
2109
2330
|
command: "point",
|
|
2110
2331
|
name: "点修改",
|
|
2111
2332
|
show: !0,
|
|
2112
|
-
src:
|
|
2333
|
+
src: b["./assets/images/selectPoint.svg"].default,
|
|
2113
2334
|
shortcut: "Ctrl + P"
|
|
2114
2335
|
},
|
|
2115
2336
|
{
|
|
2116
|
-
command:
|
|
2337
|
+
command: ct.commandName,
|
|
2117
2338
|
name: "裁剪线段",
|
|
2118
2339
|
show: !0,
|
|
2119
|
-
src:
|
|
2340
|
+
src: b["./assets/images/cutLine.svg"].default,
|
|
2120
2341
|
shortcut: "Ctrl + X"
|
|
2121
2342
|
}
|
|
2122
|
-
],
|
|
2343
|
+
], Y = [
|
|
2123
2344
|
{
|
|
2124
2345
|
command: "",
|
|
2125
2346
|
name: "操作回滚",
|
|
2126
|
-
src:
|
|
2127
|
-
show:
|
|
2347
|
+
src: b["./assets/images/rollback.svg"].default,
|
|
2348
|
+
show: F(() => M.value !== 0),
|
|
2128
2349
|
shortcut: "Ctrl + Z",
|
|
2129
2350
|
action() {
|
|
2130
|
-
|
|
2351
|
+
w.commandManager.rollback();
|
|
2131
2352
|
}
|
|
2132
2353
|
},
|
|
2133
2354
|
{
|
|
2134
2355
|
command: "",
|
|
2135
2356
|
name: "撤销操作回滚",
|
|
2136
|
-
src:
|
|
2137
|
-
show:
|
|
2357
|
+
src: b["./assets/images/revokeRollback.svg"].default,
|
|
2358
|
+
show: F(() => u.value !== 0),
|
|
2138
2359
|
shortcut: "Ctrl + Y",
|
|
2139
2360
|
class: "rotateY-[180deg]",
|
|
2140
2361
|
action() {
|
|
2141
|
-
|
|
2362
|
+
w.commandManager.revokeRollback();
|
|
2142
2363
|
}
|
|
2143
2364
|
},
|
|
2144
2365
|
{
|
|
2145
|
-
command:
|
|
2366
|
+
command: ae.commandName,
|
|
2146
2367
|
name: "合并",
|
|
2147
|
-
src:
|
|
2148
|
-
show:
|
|
2368
|
+
src: b["./assets/images/mergeLine.svg"].default,
|
|
2369
|
+
show: F(() => I.value === 2),
|
|
2149
2370
|
shortcut: "Ctrl + G"
|
|
2150
2371
|
},
|
|
2151
2372
|
{
|
|
2152
|
-
command:
|
|
2373
|
+
command: re.commandName,
|
|
2153
2374
|
name: "两点连接",
|
|
2154
|
-
show:
|
|
2155
|
-
src:
|
|
2375
|
+
show: F(() => I.value === 2),
|
|
2376
|
+
src: b["./assets/images/connection.svg"].default,
|
|
2156
2377
|
shortcut: "Shift + L"
|
|
2157
2378
|
},
|
|
2158
2379
|
{
|
|
2159
|
-
command:
|
|
2380
|
+
command: de.commandName,
|
|
2160
2381
|
name: "延长线交点连接",
|
|
2161
|
-
show:
|
|
2162
|
-
src:
|
|
2382
|
+
show: F(() => I.value === 2),
|
|
2383
|
+
src: b["./assets/images/intersectionConnection.svg"].default,
|
|
2163
2384
|
shortcut: "Ctrl + Shift + L"
|
|
2164
2385
|
},
|
|
2165
2386
|
{
|
|
2166
|
-
command:
|
|
2387
|
+
command: oe.commandName,
|
|
2167
2388
|
name: "线段垂直纠正",
|
|
2168
|
-
show:
|
|
2169
|
-
src:
|
|
2170
|
-
shortcut:
|
|
2389
|
+
show: F(() => I.value === 1),
|
|
2390
|
+
src: b["./assets/images/verticalCorrection.svg"].default,
|
|
2391
|
+
shortcut: `
|
|
2392
|
+
Ctrl + C 垂直纠正
|
|
2393
|
+
Ctrl + Shift + C 全部垂直纠正
|
|
2394
|
+
Shift + C 轴对齐垂直纠正
|
|
2395
|
+
`
|
|
2171
2396
|
},
|
|
2172
2397
|
{
|
|
2173
|
-
command:
|
|
2398
|
+
command: he.commandName,
|
|
2174
2399
|
name: "y轴垂直基准线",
|
|
2175
|
-
show:
|
|
2176
|
-
() =>
|
|
2400
|
+
show: F(
|
|
2401
|
+
() => I.value === 1 && !g.selectLines[0].userData.isDoor
|
|
2177
2402
|
),
|
|
2178
|
-
src:
|
|
2403
|
+
src: b["./assets/images/verticalLine.svg"].default,
|
|
2179
2404
|
shortcut: "V"
|
|
2180
2405
|
},
|
|
2181
2406
|
{
|
|
2182
|
-
command:
|
|
2407
|
+
command: me.commandName,
|
|
2183
2408
|
name: "角度显示",
|
|
2184
|
-
show:
|
|
2185
|
-
src:
|
|
2409
|
+
show: F(() => I.value === 2 && g.selectLines[0].sameEndpoint(g.selectLines[1])),
|
|
2410
|
+
src: b["./assets/images/angle.svg"].default,
|
|
2186
2411
|
shortcut: "r"
|
|
2187
2412
|
},
|
|
2188
2413
|
{
|
|
2189
|
-
command:
|
|
2414
|
+
command: ce.commandName,
|
|
2190
2415
|
name: "全选",
|
|
2191
|
-
show:
|
|
2192
|
-
src:
|
|
2416
|
+
show: F(() => I.value !== w.renderManager.lines.length),
|
|
2417
|
+
src: b["./assets/images/selectAll.svg"].default,
|
|
2193
2418
|
shortcut: "Ctrl + A"
|
|
2194
2419
|
},
|
|
2195
2420
|
{
|
|
2196
|
-
command:
|
|
2421
|
+
command: le.commandName,
|
|
2197
2422
|
name: "清除窗户",
|
|
2198
|
-
show:
|
|
2199
|
-
src:
|
|
2423
|
+
show: F(() => _.value),
|
|
2424
|
+
src: b["./assets/images/deleteSelectWindow.svg"].default,
|
|
2200
2425
|
shortcut: "Q + Delete"
|
|
2201
2426
|
},
|
|
2202
2427
|
{
|
|
2203
|
-
command:
|
|
2428
|
+
command: ie.commandName,
|
|
2204
2429
|
name: "删除",
|
|
2205
|
-
show:
|
|
2206
|
-
src:
|
|
2430
|
+
show: F(() => I.value > 0),
|
|
2431
|
+
src: b["./assets/images/deleteSelectLine.svg"].default,
|
|
2207
2432
|
shortcut: "Delete"
|
|
2208
2433
|
}
|
|
2209
2434
|
];
|
|
2210
|
-
|
|
2211
|
-
localStorage.setItem("toolBarExpand",
|
|
2212
|
-
}),
|
|
2213
|
-
const
|
|
2214
|
-
|
|
2435
|
+
ee(D, () => localStorage.setItem("editorToolPosition", JSON.stringify(D.value))), ee(m, () => localStorage.setItem("showShortcutKey", m.value + "")), ee(f, () => {
|
|
2436
|
+
localStorage.setItem("toolBarExpand", f.value + ""), f.value && Ee(() => e(D.value.left, D.value.top));
|
|
2437
|
+
}), ee(r, () => C.Variable.set("originalLineVisible", r.value)), ee(l, () => C.Variable.set("dxfVisible", l.value)), ee(i, () => C.Variable.set("whiteModelVisible", i.value)), C.Variable.addEventListener("isLook", (k) => d.value = k.value), C.Variable.addEventListener("originalLineVisible", (k) => r.value = k.value), C.Variable.addEventListener("dxfVisible", (k) => l.value = k.value), C.Variable.addEventListener("whiteModelVisible", (k) => i.value = k.value);
|
|
2438
|
+
const V = w.commandManager.addEventListener("started", (k) => {
|
|
2439
|
+
y.value = k.name;
|
|
2215
2440
|
});
|
|
2216
|
-
return localStorage.getItem("showShortcutKey") && (
|
|
2217
|
-
|
|
2218
|
-
if (
|
|
2219
|
-
const { left:
|
|
2220
|
-
e(
|
|
2441
|
+
return localStorage.getItem("showShortcutKey") && (m.value = localStorage.getItem("showShortcutKey") === "true"), localStorage.getItem("toolBarExpand") && (f.value = localStorage.getItem("toolBarExpand") === "true"), ot(() => {
|
|
2442
|
+
E.value.style.display = "none", setTimeout(() => {
|
|
2443
|
+
if (E.value.style.display = "block", localStorage.getItem("editorToolPosition")) {
|
|
2444
|
+
const { left: k, top: x } = JSON.parse(localStorage.getItem("editorToolPosition") ?? "{}");
|
|
2445
|
+
e(k, x), Ee(() => j.observe(p.value));
|
|
2221
2446
|
} else
|
|
2222
|
-
|
|
2223
|
-
}, 100),
|
|
2224
|
-
|
|
2225
|
-
}), ["rollback", "completed", "revokeRollback"].forEach((
|
|
2226
|
-
|
|
2447
|
+
Ee(() => j.observe(p.value));
|
|
2448
|
+
}, 100), g.addEventListener("selectLineChange", () => {
|
|
2449
|
+
I.value = g.selectLines.length, _.value = g.selectLines.some((k) => k.userData.isWindow);
|
|
2450
|
+
}), ["rollback", "completed", "revokeRollback"].forEach((k) => {
|
|
2451
|
+
w.commandManager.addEventListener(k, () => {
|
|
2227
2452
|
setTimeout(() => {
|
|
2228
|
-
|
|
2453
|
+
M.value = w.commandManager.operationList.length, u.value = w.commandManager.rollbackList.length;
|
|
2229
2454
|
});
|
|
2230
2455
|
});
|
|
2231
2456
|
});
|
|
2232
|
-
}),
|
|
2233
|
-
|
|
2234
|
-
}), (
|
|
2457
|
+
}), Rt(() => {
|
|
2458
|
+
v.mouseMoveEventProxylock = !1, V(), j.disconnect();
|
|
2459
|
+
}), (k, x) => (K(), H("div", {
|
|
2235
2460
|
ref_key: "elRef",
|
|
2236
|
-
ref:
|
|
2461
|
+
ref: p,
|
|
2237
2462
|
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]"
|
|
2238
2463
|
}, [
|
|
2239
|
-
|
|
2240
|
-
default:
|
|
2241
|
-
|
|
2242
|
-
(
|
|
2464
|
+
J(Pe, null, {
|
|
2465
|
+
default: q(() => [
|
|
2466
|
+
m.value ? (K(), H("div", as, [
|
|
2467
|
+
(K(), H(be, null, Ae(N, (P) => O("div", {
|
|
2243
2468
|
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",
|
|
2244
|
-
key:
|
|
2469
|
+
key: P.name
|
|
2245
2470
|
}, [
|
|
2246
|
-
|
|
2247
|
-
|
|
2471
|
+
O("p", is, pe(P.name), 1),
|
|
2472
|
+
O("span", rs, pe(P.shortcut), 1)
|
|
2248
2473
|
])), 64))
|
|
2249
|
-
])) :
|
|
2474
|
+
])) : ne("", !0)
|
|
2250
2475
|
]),
|
|
2251
2476
|
_: 1
|
|
2252
2477
|
}),
|
|
2253
|
-
|
|
2478
|
+
O("div", {
|
|
2254
2479
|
ref_key: "toolBarRef",
|
|
2255
|
-
ref:
|
|
2256
|
-
style:
|
|
2257
|
-
class:
|
|
2258
|
-
onMousedown:
|
|
2480
|
+
ref: E,
|
|
2481
|
+
style: Re({ left: D.value.left + "px", top: D.value.top + "px" }),
|
|
2482
|
+
class: Z(["overflow-hidden pointer-events-auto w-fit max-w-[260px] transition-[border-radius] text-[#333] absolute z-[11] bg-white select-none", { "rounded-[8px] ": f.value }]),
|
|
2483
|
+
onMousedown: x[10] || (x[10] = (P) => P.stopPropagation())
|
|
2259
2484
|
}, [
|
|
2260
|
-
|
|
2261
|
-
onMousedown:
|
|
2262
|
-
class:
|
|
2485
|
+
O("div", {
|
|
2486
|
+
onMousedown: o,
|
|
2487
|
+
class: Z([{ "border-b-[#eee] border-b-1": f.value }, "flex flex-row justify-between header text-[14px] font-bold p-[10px 0px]"])
|
|
2263
2488
|
}, [
|
|
2264
|
-
|
|
2265
|
-
|
|
2266
|
-
onMousedown:
|
|
2267
|
-
onClick:
|
|
2489
|
+
x[12] || (x[12] = Kt('<div class="flex flex-row" data-v-d89e5fb2><div class="p-[2px_5px] flex items-center pointer-events-none" data-v-d89e5fb2><svg fill="#aaa" width="20" height="20" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" data-v-d89e5fb2><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-d89e5fb2></path></svg></div><h5 class="flex text-nowrap text-[12px] items-center pointer-events-none" data-v-d89e5fb2>绘制工具</h5></div>', 1)),
|
|
2490
|
+
O("div", {
|
|
2491
|
+
onMousedown: x[0] || (x[0] = (P) => P.stopPropagation()),
|
|
2492
|
+
onClick: x[1] || (x[1] = (P) => f.value = !f.value),
|
|
2268
2493
|
class: "cursor-pointer flex items-center p-[0px_5px]"
|
|
2269
2494
|
}, [
|
|
2270
|
-
(
|
|
2495
|
+
(K(), H("svg", {
|
|
2271
2496
|
fill: "#666",
|
|
2272
|
-
class:
|
|
2497
|
+
class: Z([{ "rotate-90": f.value }, "transition-all"]),
|
|
2273
2498
|
viewBox: "0 0 1024 1024",
|
|
2274
2499
|
version: "1.1",
|
|
2275
2500
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2276
2501
|
width: "12",
|
|
2277
2502
|
height: "12"
|
|
2278
|
-
},
|
|
2279
|
-
|
|
2503
|
+
}, x[11] || (x[11] = [
|
|
2504
|
+
O("path", { d: "M315.050667 938.666667a60.757333 60.757333 0 0 0 41.813333-16.298667L750.933333 551.338667a53.418667 53.418667 0 0 0 0-78.677334L356.864 101.632a61.696 61.696 0 0 0-83.541333 0 53.418667 53.418667 0 0 0-0.256 78.677333L625.408 512 273.066667 843.690667a53.418667 53.418667 0 0 0 0 78.677333 60.757333 60.757333 0 0 0 41.984 16.298667z" }, null, -1)
|
|
2280
2505
|
]), 2))
|
|
2281
2506
|
], 32)
|
|
2282
2507
|
], 34),
|
|
2283
|
-
|
|
2284
|
-
|
|
2285
|
-
(
|
|
2286
|
-
key:
|
|
2508
|
+
f.value ? (K(), H("div", ds, [
|
|
2509
|
+
O("ul", ls, [
|
|
2510
|
+
(K(), H(be, null, Ae(G, (P) => (K(), H(be, {
|
|
2511
|
+
key: P.command
|
|
2287
2512
|
}, [
|
|
2288
|
-
|
|
2513
|
+
P.show ? (K(), H("li", {
|
|
2289
2514
|
key: 0,
|
|
2290
|
-
onClick: (
|
|
2291
|
-
class:
|
|
2292
|
-
"!bg-[var(--primary-color)] text-[#fff]":
|
|
2293
|
-
"!cursor-no-drop":
|
|
2515
|
+
onClick: (te) => t(P),
|
|
2516
|
+
class: Z([{
|
|
2517
|
+
"!bg-[var(--primary-color)] text-[#fff]": y.value === P.command,
|
|
2518
|
+
"!cursor-no-drop": y.value !== P.command && y.value !== "default"
|
|
2294
2519
|
}, "gap-[10px] text-[12px] hover:bg-[#ddd] transition-all rounded-[6px] p-[5px] flex flex-row items-center justify-between cursor-pointer"])
|
|
2295
2520
|
}, [
|
|
2296
|
-
|
|
2297
|
-
|
|
2298
|
-
|
|
2521
|
+
O("div", ms, [
|
|
2522
|
+
O("div", hs, [
|
|
2523
|
+
O("img", {
|
|
2299
2524
|
class: "size-[14px]",
|
|
2300
|
-
src:
|
|
2525
|
+
src: P.src,
|
|
2301
2526
|
alt: "",
|
|
2302
2527
|
srcset: ""
|
|
2303
|
-
}, null, 8,
|
|
2528
|
+
}, null, 8, us)
|
|
2304
2529
|
]),
|
|
2305
|
-
|
|
2530
|
+
O("span", ps, pe(P.name), 1)
|
|
2306
2531
|
]),
|
|
2307
|
-
|
|
2532
|
+
y.value === P.command ? (K(), H("div", {
|
|
2308
2533
|
key: 0,
|
|
2309
2534
|
title: "取消命令(Esc)",
|
|
2310
2535
|
class: "active:scale-[0.7] transition-all",
|
|
2311
|
-
onClick:
|
|
2312
|
-
},
|
|
2313
|
-
|
|
2536
|
+
onClick: x[2] || (x[2] = (te) => (L(w).cancelCommand(), te.stopPropagation()))
|
|
2537
|
+
}, x[13] || (x[13] = [
|
|
2538
|
+
O("svg", {
|
|
2314
2539
|
fill: "#fff",
|
|
2315
2540
|
width: "16",
|
|
2316
2541
|
height: "16",
|
|
@@ -2318,108 +2543,120 @@ const oo = {
|
|
|
2318
2543
|
version: "1.1",
|
|
2319
2544
|
xmlns: "http://www.w3.org/2000/svg"
|
|
2320
2545
|
}, [
|
|
2321
|
-
|
|
2322
|
-
|
|
2546
|
+
O("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" }),
|
|
2547
|
+
O("path", { d: "M236.437333 463.914667l549.333333 0 0 96.874667-549.333333 0 0-96.874667Z" })
|
|
2323
2548
|
], -1)
|
|
2324
|
-
]))) :
|
|
2325
|
-
], 10,
|
|
2549
|
+
]))) : P.shortcut ? (K(), H("div", gs, pe(P.shortcut), 1)) : ne("", !0)
|
|
2550
|
+
], 10, cs)) : ne("", !0)
|
|
2326
2551
|
], 64))), 64))
|
|
2327
2552
|
]),
|
|
2328
|
-
|
|
2329
|
-
|
|
2553
|
+
O("div", vs, [
|
|
2554
|
+
J(L(Ve), {
|
|
2330
2555
|
size: "small",
|
|
2331
|
-
modelValue:
|
|
2332
|
-
"onUpdate:modelValue":
|
|
2556
|
+
modelValue: m.value,
|
|
2557
|
+
"onUpdate:modelValue": x[3] || (x[3] = (P) => m.value = P),
|
|
2333
2558
|
label: "快捷键提示"
|
|
2334
2559
|
}, null, 8, ["modelValue"]),
|
|
2335
|
-
|
|
2560
|
+
J(L(Ve), {
|
|
2336
2561
|
size: "small",
|
|
2337
|
-
modelValue:
|
|
2338
|
-
"onUpdate:modelValue":
|
|
2562
|
+
modelValue: l.value,
|
|
2563
|
+
"onUpdate:modelValue": x[4] || (x[4] = (P) => l.value = P),
|
|
2339
2564
|
label: "dxf"
|
|
2340
2565
|
}, null, 8, ["modelValue"])
|
|
2341
2566
|
]),
|
|
2342
|
-
|
|
2343
|
-
|
|
2567
|
+
k.permission === "admin" ? (K(), H("div", fs, [
|
|
2568
|
+
J(L(ue), {
|
|
2344
2569
|
style: { padding: "5px", "font-size": "10px" },
|
|
2345
2570
|
size: "small",
|
|
2346
2571
|
type: "success",
|
|
2347
|
-
onClick:
|
|
2572
|
+
onClick: s
|
|
2348
2573
|
}, {
|
|
2349
|
-
default:
|
|
2350
|
-
|
|
2574
|
+
default: q(() => x[14] || (x[14] = [
|
|
2575
|
+
se(" 选择文件 ", -1)
|
|
2351
2576
|
])),
|
|
2352
2577
|
_: 1,
|
|
2353
|
-
__: [
|
|
2578
|
+
__: [14]
|
|
2354
2579
|
}),
|
|
2355
|
-
|
|
2580
|
+
J(L(ue), {
|
|
2356
2581
|
style: { padding: "5px", "font-size": "10px" },
|
|
2357
2582
|
size: "small",
|
|
2358
2583
|
type: "primary",
|
|
2359
|
-
onClick:
|
|
2584
|
+
onClick: x[5] || (x[5] = (P) => console.log(L(C).Dxf.originalData))
|
|
2360
2585
|
}, {
|
|
2361
|
-
default:
|
|
2362
|
-
|
|
2586
|
+
default: q(() => x[15] || (x[15] = [
|
|
2587
|
+
se(" 打印Json ", -1)
|
|
2363
2588
|
])),
|
|
2364
2589
|
_: 1,
|
|
2365
|
-
__: [
|
|
2590
|
+
__: [15]
|
|
2366
2591
|
}),
|
|
2367
|
-
|
|
2592
|
+
J(L(ue), {
|
|
2368
2593
|
style: { padding: "5px", "font-size": "10px" },
|
|
2369
2594
|
size: "small",
|
|
2370
2595
|
type: "primary",
|
|
2371
|
-
onClick:
|
|
2596
|
+
onClick: x[6] || (x[6] = (P) => L(C).AngleCorrectionDxf.download("test.dxf"))
|
|
2372
2597
|
}, {
|
|
2373
|
-
default:
|
|
2374
|
-
|
|
2598
|
+
default: q(() => x[16] || (x[16] = [
|
|
2599
|
+
se(" 下载DXF ", -1)
|
|
2375
2600
|
])),
|
|
2376
2601
|
_: 1,
|
|
2377
|
-
__: [
|
|
2602
|
+
__: [16]
|
|
2378
2603
|
}),
|
|
2379
|
-
|
|
2604
|
+
J(L(ue), {
|
|
2380
2605
|
style: { padding: "5px", "font-size": "10px" },
|
|
2381
2606
|
size: "small",
|
|
2382
2607
|
type: "primary",
|
|
2383
|
-
onClick:
|
|
2608
|
+
onClick: x[7] || (x[7] = (P) => L(C).AngleCorrectionDxf.downloadImage("dxf.jpg"))
|
|
2384
2609
|
}, {
|
|
2385
|
-
default:
|
|
2386
|
-
|
|
2610
|
+
default: q(() => x[17] || (x[17] = [
|
|
2611
|
+
se(" 下载JPG ", -1)
|
|
2387
2612
|
])),
|
|
2388
2613
|
_: 1,
|
|
2389
|
-
__: [
|
|
2614
|
+
__: [17]
|
|
2390
2615
|
}),
|
|
2391
|
-
|
|
2616
|
+
J(L(ue), {
|
|
2392
2617
|
style: { padding: "5px", "font-size": "10px" },
|
|
2393
2618
|
size: "small",
|
|
2394
2619
|
type: "primary",
|
|
2395
|
-
onClick:
|
|
2620
|
+
onClick: x[8] || (x[8] = (P) => L(S).downloadGltf("test.glb", !0))
|
|
2396
2621
|
}, {
|
|
2397
|
-
default:
|
|
2398
|
-
|
|
2622
|
+
default: q(() => x[18] || (x[18] = [
|
|
2623
|
+
se(" 下载白膜 ", -1)
|
|
2399
2624
|
])),
|
|
2400
2625
|
_: 1,
|
|
2401
|
-
__: [
|
|
2626
|
+
__: [18]
|
|
2627
|
+
}),
|
|
2628
|
+
J(L(ue), {
|
|
2629
|
+
style: { padding: "5px", "font-size": "10px" },
|
|
2630
|
+
size: "small",
|
|
2631
|
+
type: "primary",
|
|
2632
|
+
onClick: x[9] || (x[9] = (P) => L(A).download())
|
|
2633
|
+
}, {
|
|
2634
|
+
default: q(() => x[19] || (x[19] = [
|
|
2635
|
+
se(" 下载三维家JSON ", -1)
|
|
2636
|
+
])),
|
|
2637
|
+
_: 1,
|
|
2638
|
+
__: [19]
|
|
2402
2639
|
})
|
|
2403
|
-
])) :
|
|
2404
|
-
|
|
2405
|
-
default:
|
|
2406
|
-
|
|
2407
|
-
|
|
2408
|
-
default:
|
|
2409
|
-
(
|
|
2410
|
-
onClick: (
|
|
2411
|
-
title: `${
|
|
2412
|
-
class:
|
|
2413
|
-
"opacity-30 bg-[#ccc] !cursor-no-drop active:!scale-[1]": !
|
|
2414
|
-
[
|
|
2640
|
+
])) : ne("", !0),
|
|
2641
|
+
J(Pe, null, {
|
|
2642
|
+
default: q(() => [
|
|
2643
|
+
O("div", ys, [
|
|
2644
|
+
J(Ft, null, {
|
|
2645
|
+
default: q(() => [
|
|
2646
|
+
(K(), H(be, null, Ae(Y, (P) => O("div", {
|
|
2647
|
+
onClick: (te) => P.show.value && y.value === "default" && (P.action ? P.action() : L(w).commandManager.start(P.command, [...L(g).selectLines])),
|
|
2648
|
+
title: `${P.name}(${P.shortcut})`,
|
|
2649
|
+
class: Z(["size-[20px] flex justify-center items-center relative overflow-hidden active:scale-[0.8] border-1 border-[#ccc] rounded-[4px] transition-all cursor-pointer", {
|
|
2650
|
+
"opacity-30 bg-[#ccc] !cursor-no-drop active:!scale-[1]": !P.show.value || y.value !== "default",
|
|
2651
|
+
[P.class ?? ""]: !0
|
|
2415
2652
|
}]),
|
|
2416
|
-
key:
|
|
2653
|
+
key: P.command
|
|
2417
2654
|
}, [
|
|
2418
|
-
|
|
2655
|
+
O("img", {
|
|
2419
2656
|
class: "size-[14px]",
|
|
2420
|
-
src:
|
|
2421
|
-
}, null, 8,
|
|
2422
|
-
], 10,
|
|
2657
|
+
src: P.src
|
|
2658
|
+
}, null, 8, bs)
|
|
2659
|
+
], 10, ws)), 64))
|
|
2423
2660
|
]),
|
|
2424
2661
|
_: 1
|
|
2425
2662
|
})
|
|
@@ -2427,19 +2664,19 @@ const oo = {
|
|
|
2427
2664
|
]),
|
|
2428
2665
|
_: 1
|
|
2429
2666
|
})
|
|
2430
|
-
])) :
|
|
2667
|
+
])) : ne("", !0)
|
|
2431
2668
|
], 38)
|
|
2432
2669
|
], 512));
|
|
2433
2670
|
}
|
|
2434
|
-
}),
|
|
2435
|
-
const t =
|
|
2436
|
-
for (const [n,
|
|
2437
|
-
t[n] =
|
|
2671
|
+
}), Cs = (c, e) => {
|
|
2672
|
+
const t = c.__vccOpts || c;
|
|
2673
|
+
for (const [n, s] of e)
|
|
2674
|
+
t[n] = s;
|
|
2438
2675
|
return t;
|
|
2439
|
-
},
|
|
2440
|
-
let
|
|
2676
|
+
}, Es = /* @__PURE__ */ Cs(xs, [["__scopeId", "data-v-d89e5fb2"]]);
|
|
2677
|
+
let mt = class extends Oe {
|
|
2441
2678
|
static name = "Editor";
|
|
2442
|
-
container = new
|
|
2679
|
+
container = new h.Group();
|
|
2443
2680
|
get renderer() {
|
|
2444
2681
|
return this.parent?.findComponentByName("Renderer");
|
|
2445
2682
|
}
|
|
@@ -2461,8 +2698,8 @@ let dt = class extends Ce {
|
|
|
2461
2698
|
get domContainer() {
|
|
2462
2699
|
return this.parent?.findComponentByName("DomContainer");
|
|
2463
2700
|
}
|
|
2464
|
-
commandManager = new
|
|
2465
|
-
plane = new
|
|
2701
|
+
commandManager = new bn();
|
|
2702
|
+
plane = new h.Mesh(new h.PlaneGeometry(2e3, 2e3, 2, 2));
|
|
2466
2703
|
app;
|
|
2467
2704
|
domElement = document.createElement("div");
|
|
2468
2705
|
viewPermission;
|
|
@@ -2485,26 +2722,26 @@ let dt = class extends Ce {
|
|
|
2485
2722
|
}
|
|
2486
2723
|
onAddFromParent(e) {
|
|
2487
2724
|
setTimeout(() => this.openEdit(), 10);
|
|
2488
|
-
const t = new
|
|
2725
|
+
const t = new h.GridHelper(200, 100, 6710886, 4473924);
|
|
2489
2726
|
t.rotation.x = Math.PI * 0.5, t.position.z = -0.01, this.container.add(t), this.container.add(this.plane), this.plane.visible = !1;
|
|
2490
2727
|
const n = this.addEventListener("update", () => {
|
|
2491
2728
|
this.domContainer.domElement.parentElement && (this.domContainer.domElement.parentElement.appendChild(this.domElement), this.domContainer.domElement.parentElement.appendChild(this.imgEl), n());
|
|
2492
2729
|
});
|
|
2493
2730
|
setTimeout(() => {
|
|
2494
|
-
this.app =
|
|
2731
|
+
this.app = zt(Es, { dxfSystem: this.parent, permission: this.viewPermission }), this.app.mount(this.domElement);
|
|
2495
2732
|
}), e.AngleCorrectionDxf.addEventListener("lineOffset", async () => {
|
|
2496
2733
|
this.imgEl.src && URL.revokeObjectURL(this.imgEl.src), setTimeout(async () => {
|
|
2497
2734
|
this.imgEl.src = URL.createObjectURL(await e.AngleCorrectionDxf.toDxfImageBlob("Centimeters", "image/png", "transparent"));
|
|
2498
2735
|
});
|
|
2499
|
-
}), this.domEventRegister.addEventListener("mousedown", (
|
|
2500
|
-
|
|
2736
|
+
}), this.domEventRegister.addEventListener("mousedown", (s) => {
|
|
2737
|
+
s.x < this.imgWidth + 10 && s.x > 10 && s.y < this.imgWidth && s.y > 10 && Object.assign(this.imgEl.style, {
|
|
2501
2738
|
width: `${Math.min(this.imgWidth * 10, this.renderer.width * 0.9)}px`,
|
|
2502
2739
|
height: `${Math.min(this.imgWidth * 10, this.renderer.height * 0.9)}px`,
|
|
2503
2740
|
background: "rgba(0,0,0,1)",
|
|
2504
2741
|
zIndex: 100
|
|
2505
2742
|
});
|
|
2506
|
-
}), this.domEventRegister.addEventListener("mousemove", (
|
|
2507
|
-
|
|
2743
|
+
}), this.domEventRegister.addEventListener("mousemove", (s) => {
|
|
2744
|
+
s.x < this.imgWidth + 10 && s.x > 10 && s.y < this.imgWidth && s.y > 10 || Object.assign(this.imgEl.style, {
|
|
2508
2745
|
width: `${this.imgWidth}px`,
|
|
2509
2746
|
height: `${this.imgWidth}px`,
|
|
2510
2747
|
background: "rgba(255,255,255,0.2)",
|
|
@@ -2520,27 +2757,27 @@ let dt = class extends Ce {
|
|
|
2520
2757
|
type: "cancelCommand"
|
|
2521
2758
|
});
|
|
2522
2759
|
}
|
|
2523
|
-
coords = new
|
|
2524
|
-
pointerPosition = new
|
|
2760
|
+
coords = new h.Vector2();
|
|
2761
|
+
pointerPosition = new h.Vector2();
|
|
2525
2762
|
_exitEditCallBack;
|
|
2526
2763
|
/**
|
|
2527
2764
|
* 打开编辑器
|
|
2528
2765
|
*/
|
|
2529
2766
|
openEdit() {
|
|
2530
|
-
const e = this.renderer, t = this.domEventRegister, n = this.dxf,
|
|
2531
|
-
this.container.position.z = n.originalZAverage, e.scene.add(this.container),
|
|
2532
|
-
const
|
|
2533
|
-
e.renderer.getSize(
|
|
2534
|
-
const
|
|
2535
|
-
|
|
2536
|
-
const
|
|
2537
|
-
|
|
2767
|
+
const e = this.renderer, t = this.domEventRegister, n = this.dxf, s = e.orbitControls, o = e.camera, a = n.box.center, r = e.camera.position.clone(), l = s?.target?.clone(), i = new h.Vector2(), d = new h.Raycaster(), p = this.coords, E = this.pointerPosition;
|
|
2768
|
+
this.container.position.z = n.originalZAverage, e.scene.add(this.container), s && (o.position.set(a.x, a.y, 15), s.target.set(a.x, a.y, 0), s.enableRotate = !1);
|
|
2769
|
+
const f = () => {
|
|
2770
|
+
e.renderer.getSize(i);
|
|
2771
|
+
const y = t.pointer.x / i.x * 2 - 1, C = -(t.pointer.y / i.y * 2 - 1);
|
|
2772
|
+
p.set(y, C), d.setFromCamera(p, e.camera.children.length ? e.camera.children[0] : e.camera);
|
|
2773
|
+
const v = d.intersectObject(this.plane);
|
|
2774
|
+
v.length && (E.copy(v[0].point), this.dispatchEvent({
|
|
2538
2775
|
type: "pointerPositionChange",
|
|
2539
|
-
position:
|
|
2776
|
+
position: E
|
|
2540
2777
|
}));
|
|
2541
2778
|
};
|
|
2542
|
-
t.addEventListener("mousemove",
|
|
2543
|
-
t.removeEventListener("mousemove",
|
|
2779
|
+
t.addEventListener("mousemove", f), this.commandManager.disabled = !1, this.commandManager.start("default"), this._exitEditCallBack = () => {
|
|
2780
|
+
t.removeEventListener("mousemove", f), s && (o.position.copy(r), s.enableRotate = !0, s.target.copy(l));
|
|
2544
2781
|
};
|
|
2545
2782
|
}
|
|
2546
2783
|
/**
|
|
@@ -2553,9 +2790,9 @@ let dt = class extends Ce {
|
|
|
2553
2790
|
super.destroy(), this.exitEdit(), this.renderer.scene.remove(this.container), this.domElement.remove(), this.app?.unmount();
|
|
2554
2791
|
}
|
|
2555
2792
|
};
|
|
2556
|
-
class
|
|
2793
|
+
class Ms extends W {
|
|
2557
2794
|
static name = "PointDrag";
|
|
2558
|
-
container = new
|
|
2795
|
+
container = new h.Group();
|
|
2559
2796
|
interruptKeys = ["escape"];
|
|
2560
2797
|
shortcutKeys = ["control", "p"];
|
|
2561
2798
|
commandName = "point";
|
|
@@ -2568,12 +2805,12 @@ class Eo extends N {
|
|
|
2568
2805
|
* @param next
|
|
2569
2806
|
*/
|
|
2570
2807
|
selectPoint(e) {
|
|
2571
|
-
let t = null, n = new
|
|
2808
|
+
let t = null, n = new h.Mesh(new h.SphereGeometry(0.04), new h.MeshBasicMaterial({ color: 16711935 })), s = null;
|
|
2572
2809
|
this.addEventRecord("selectPointStart").add(this.editor.addEventListener("pointerPositionChange", () => {
|
|
2573
|
-
const { point:
|
|
2574
|
-
this.dispatchEvent({ type: "pointerMove", point:
|
|
2810
|
+
const { point: o, line: a, find: r, mode: l } = this.editor.renderManager.adsorption();
|
|
2811
|
+
this.dispatchEvent({ type: "pointerMove", point: o }), r && l === "point" ? (this.domElement.style.cursor = "none", n.position.copy(o), s = a, t = o.clone(), this.container.add(n)) : (this.domElement.style.cursor = "no-drop", t = null, n.removeFromParent());
|
|
2575
2812
|
})).add(this.eventInput.addEventListener("codeChange", () => {
|
|
2576
|
-
this.eventInput.isKeyDown("mouse_0") && t && (this.canceEventRecord("selectPointStart"), n.material.color.set(65280), e({ point: t, line:
|
|
2813
|
+
this.eventInput.isKeyDown("mouse_0") && t && (this.canceEventRecord("selectPointStart"), n.material.color.set(65280), e({ point: t, line: s }));
|
|
2577
2814
|
})), this.addEventRecord("clear").add(() => n.removeFromParent());
|
|
2578
2815
|
}
|
|
2579
2816
|
/** 拖拽点
|
|
@@ -2583,32 +2820,32 @@ class Eo extends N {
|
|
|
2583
2820
|
*/
|
|
2584
2821
|
drag(e, { point: t, line: n }) {
|
|
2585
2822
|
this.domElement.style.cursor = "crosshair";
|
|
2586
|
-
const
|
|
2587
|
-
this.container.add(
|
|
2588
|
-
let { point:
|
|
2589
|
-
if (
|
|
2590
|
-
if (this.dispatchEvent({ type: "pointerMove", point:
|
|
2591
|
-
const
|
|
2592
|
-
|
|
2823
|
+
const s = n.start.equal(R.from(t)) ? "start" : "end", o = s == "start" ? new h.Vector3(n.end.x, n.end.y, 0) : new h.Vector3(n.start.x, n.start.y, 0), a = t.clone(), r = new Ce([o, a], 16711935), l = new h.Mesh(new h.SphereGeometry(0.03), new h.MeshBasicMaterial({ color: 16711935 }));
|
|
2824
|
+
this.container.add(r), this.addEventRecord("clear").add(this.editor.addEventListener("pointerPositionChange", () => {
|
|
2825
|
+
let { point: i, find: d } = this.editor.renderManager.adsorption(), p = "none";
|
|
2826
|
+
if (i) {
|
|
2827
|
+
if (this.dispatchEvent({ type: "pointerMove", point: i }), this.eventInput.isKeyDown("shift")) {
|
|
2828
|
+
const E = n.projectPoint(R.from(i), !1);
|
|
2829
|
+
i.set(E?.x ?? i.x, E?.y ?? i.y, 0), d = !0, p = "crosshair";
|
|
2593
2830
|
}
|
|
2594
|
-
|
|
2831
|
+
d ? (l.position.copy(i), this.container.add(l)) : (l.removeFromParent(), p = "crosshair"), a.copy(i), r.setPoint(o, a), this.domElement.style.cursor = p;
|
|
2595
2832
|
}
|
|
2596
2833
|
})).add(this.eventInput.addEventListener("codeChange", () => {
|
|
2597
|
-
this.eventInput.isKeyDown("mouse_0") && (this.canceEventRecord("selectPointStart"), e({ point: a, oldPoint:
|
|
2598
|
-
})).add(() =>
|
|
2834
|
+
this.eventInput.isKeyDown("mouse_0") && (this.canceEventRecord("selectPointStart"), e({ point: a, oldPoint: s === "end" ? n.end.clone() : n.start.clone(), line: n, mode: s }));
|
|
2835
|
+
})).add(() => l.removeFromParent()).add(() => r.removeFromParent());
|
|
2599
2836
|
}
|
|
2600
2837
|
/** 执行完成
|
|
2601
2838
|
*/
|
|
2602
2839
|
completed(e) {
|
|
2603
|
-
const { line: t, point: n, mode:
|
|
2604
|
-
this.renderManager.removeLine(t),
|
|
2840
|
+
const { line: t, point: n, mode: s } = e;
|
|
2841
|
+
this.renderManager.removeLine(t), s === "end" ? t.end.set(n.x, n.y) : s === "start" && t.start.set(n.x, n.y), this.renderManager.addLine(t), this.renderManager.draw();
|
|
2605
2842
|
}
|
|
2606
2843
|
/** 回滚操作
|
|
2607
2844
|
* @param data
|
|
2608
2845
|
*/
|
|
2609
2846
|
rollback(e) {
|
|
2610
|
-
const { line: t, oldPoint: n, mode:
|
|
2611
|
-
return
|
|
2847
|
+
const { line: t, oldPoint: n, mode: s } = e;
|
|
2848
|
+
return s === "end" ? t.end.set(n.x, n.y) : s === "start" && t.start.set(n.x, n.y), this.renderManager.addLine(t), this.renderManager.draw(), e;
|
|
2612
2849
|
}
|
|
2613
2850
|
/** 撤回回滚
|
|
2614
2851
|
* @param lines
|
|
@@ -2618,15 +2855,15 @@ class Eo extends N {
|
|
|
2618
2855
|
return this.completed(e), e;
|
|
2619
2856
|
}
|
|
2620
2857
|
}
|
|
2621
|
-
function
|
|
2622
|
-
|
|
2858
|
+
function Ye(c, e = {}) {
|
|
2859
|
+
c.addComponent(new mt(e.viewPermission)), c.addComponent(new ns()), c.addComponent(new Ke()), c.addComponent(new yn()), c.addComponent(new ss()), c.addComponent(new os()), c.addComponent(new Ms()), c.addComponent(new ie()), c.addComponent(new ae()), c.addComponent(new oe()), c.addComponent(new re()), c.addComponent(new de()), c.addComponent(new le()), c.addComponent(new ce()), c.addComponent(new me()), c.addComponent(new he()), c.addComponent(new ct());
|
|
2623
2860
|
}
|
|
2624
|
-
const
|
|
2625
|
-
create(
|
|
2626
|
-
return (e) =>
|
|
2861
|
+
const _s = Object.assign(Ye, {
|
|
2862
|
+
create(c = {}) {
|
|
2863
|
+
return (e) => Ye(e, c);
|
|
2627
2864
|
}
|
|
2628
2865
|
});
|
|
2629
2866
|
export {
|
|
2630
|
-
|
|
2631
|
-
|
|
2867
|
+
_s as Editor,
|
|
2868
|
+
Ye as Editor_
|
|
2632
2869
|
};
|