build-dxf 0.0.20 → 0.0.22
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/README.md +3 -0
- package/package.json +6 -4
- package/src/build.d.ts +6 -0
- package/src/build.js +1432 -1916
- package/src/index.css +1 -641
- package/src/index.js +7 -7
- package/src/index2.js +327 -528
- package/src/index3.js +2049 -1736
- package/src/selectLocalFile.js +1960 -3145
- package/src/utils/CommandManager/CommandFlow.d.ts +17 -0
- package/src/utils/CommandManager/CommandManager.d.ts +23 -0
- package/src/utils/DxfSystem/components/AngleCorrectionDxf.d.ts +13 -0
- package/src/utils/DxfSystem/components/Dxf.d.ts +36 -5
- package/src/utils/DxfSystem/components/LineAnalysis.d.ts +3 -1
- package/src/utils/DxfSystem/index.d.ts +2 -0
- package/src/utils/DxfSystem/plugin/Editor/components/CommandFlow/ClippingLine.d.ts +45 -0
- package/src/utils/DxfSystem/plugin/Editor/components/CommandFlow/CommandFlowComponent.d.ts +15 -1
- package/src/utils/DxfSystem/plugin/Editor/components/CommandFlow/ConnectionLine.d.ts +33 -0
- package/src/utils/DxfSystem/plugin/Editor/components/CommandFlow/Default.d.ts +2 -26
- package/src/utils/DxfSystem/plugin/Editor/components/CommandFlow/DeleteSelectLine.d.ts +28 -0
- package/src/utils/DxfSystem/plugin/Editor/components/CommandFlow/DeleteSelectWindow.d.ts +33 -0
- package/src/utils/DxfSystem/plugin/Editor/components/CommandFlow/DrawDoorLine.d.ts +22 -4
- package/src/utils/DxfSystem/plugin/Editor/components/CommandFlow/DrawLine.d.ts +20 -4
- package/src/utils/DxfSystem/plugin/Editor/components/CommandFlow/DrawWindow.d.ts +25 -2
- package/src/utils/DxfSystem/plugin/Editor/components/CommandFlow/IntersectionConnectionLine.d.ts +33 -0
- package/src/utils/DxfSystem/plugin/Editor/components/CommandFlow/MergeLine.d.ts +33 -0
- package/src/utils/DxfSystem/plugin/Editor/components/CommandFlow/PointDrag.d.ts +14 -1
- package/src/utils/DxfSystem/plugin/Editor/components/CommandFlow/SelectAll.d.ts +30 -0
- package/src/utils/DxfSystem/plugin/Editor/components/CommandFlow/VerticalCorrection.d.ts +75 -0
- package/src/utils/DxfSystem/plugin/Editor/components/CommandFlow/VerticalReferenceLine.d.ts +21 -0
- package/src/utils/DxfSystem/plugin/Editor/components/CommandFlow/ViewAngle.d.ts +21 -0
- package/src/utils/DxfSystem/plugin/Editor/components/Editor.d.ts +4 -1
- package/src/utils/DxfSystem/plugin/Editor/components/RenderManager.d.ts +4 -1
- package/src/utils/DxfSystem/plugin/Editor/components/index.d.ts +1 -0
- package/src/utils/DxfSystem/plugin/RenderPlugin/components/Renderer.d.ts +3 -0
- package/src/utils/PointVirtualGrid/index.d.ts +8 -0
- package/src/utils/Quadtree/LineSegment.d.ts +34 -2
- package/src/utils/Quadtree/Point.d.ts +9 -2
- package/src/utils/Quadtree/Quadtree.d.ts +1 -1
- package/src/utils/deepClone.d.ts +6 -0
package/src/index3.js
CHANGED
|
@@ -1,134 +1,73 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import { i as
|
|
3
|
-
import { C as
|
|
4
|
-
import { watch, ref, defineComponent, computed, createElementBlock, openBlock, normalizeClass, unref, renderSlot, createVNode, Transition, withCtx, withDirectives, createElementVNode, normalizeStyle, createTextVNode, toDisplayString, vShow, shallowReactive, onMounted, createBlock, createCommentVNode, resolveDynamicComponent, Fragment, withModifiers, nextTick, isVNode, render, toRaw, onUnmounted, renderList, createStaticVNode, createApp } from "vue";
|
|
1
|
+
import * as m from "three";
|
|
2
|
+
import { i as mt, n as ht, r as Je, t as qe, c as Pe, d as ut, e as pt, f as De, g as Q, _ as Ze, u as gt, h as ve, j as Be, w as vt, k as ft, l as yt, p as wt, m as bt, o as Ct, T as Ne, q as Re, s as xt, v as Et, x as Oe, y as Ie, z as Le, A as Mt, B as Lt, L as fe, D as kt, b as Fe, E as ue, S as It } from "./selectLocalFile.js";
|
|
3
|
+
import { C as Se, P as A, L as B, B as Ye, E as Xe, b as Ke, Q as ze, u as Pt, W as Dt } from "./build.js";
|
|
5
4
|
import "clipper-lib";
|
|
6
5
|
import "dxf-writer";
|
|
7
6
|
import "three/addons/controls/OrbitControls.js";
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
7
|
+
import { watch as W, ref as S, defineComponent as ce, computed as P, createElementBlock as R, openBlock as I, normalizeClass as j, unref as y, renderSlot as we, createVNode as z, Transition as be, withCtx as V, withDirectives as $e, createElementVNode as k, normalizeStyle as Ae, createTextVNode as ie, toDisplayString as re, vShow as et, shallowReactive as St, onMounted as tt, createBlock as pe, createCommentVNode as J, resolveDynamicComponent as At, Fragment as ge, withModifiers as _t, nextTick as ye, isVNode as nt, render as Te, toRaw as Bt, onUnmounted as Nt, renderList as ke, createStaticVNode as Rt, TransitionGroup as Ot, createApp as Ft } from "vue";
|
|
8
|
+
function ot(d) {
|
|
9
|
+
var e;
|
|
10
|
+
const t = Je(d);
|
|
11
|
+
return (e = t?.$el) != null ? e : t;
|
|
12
12
|
}
|
|
13
|
-
const
|
|
14
|
-
function
|
|
15
|
-
let
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
if (!target)
|
|
26
|
-
return noop;
|
|
27
|
-
if (!Array.isArray(events))
|
|
28
|
-
events = [events];
|
|
29
|
-
if (!Array.isArray(listeners))
|
|
30
|
-
listeners = [listeners];
|
|
31
|
-
const cleanups = [];
|
|
32
|
-
const cleanup = () => {
|
|
33
|
-
cleanups.forEach((fn) => fn());
|
|
34
|
-
cleanups.length = 0;
|
|
13
|
+
const st = Pe ? window : void 0;
|
|
14
|
+
function Kt(...d) {
|
|
15
|
+
let e, t, n, o;
|
|
16
|
+
if (mt(d[0]) || Array.isArray(d[0]) ? ([t, n, o] = d, e = st) : [e, t, n, o] = d, !e)
|
|
17
|
+
return ht;
|
|
18
|
+
Array.isArray(t) || (t = [t]), Array.isArray(n) || (n = [n]);
|
|
19
|
+
const s = [], a = () => {
|
|
20
|
+
s.forEach((c) => c()), s.length = 0;
|
|
21
|
+
}, r = (c, h, f, u) => (c.addEventListener(h, f, u), () => c.removeEventListener(h, f, u)), l = W(() => [ot(e), Je(o)], ([c, h]) => {
|
|
22
|
+
a(), c && s.push(...t.flatMap((f) => n.map((u) => r(c, f, u, h))));
|
|
23
|
+
}, { immediate: !0, flush: "post" }), i = () => {
|
|
24
|
+
l(), a();
|
|
35
25
|
};
|
|
36
|
-
|
|
37
|
-
el.addEventListener(event, listener, options2);
|
|
38
|
-
return () => el.removeEventListener(event, listener, options2);
|
|
39
|
-
};
|
|
40
|
-
const stopWatch = watch(() => [unrefElement(target), resolveUnref(options)], ([el, options2]) => {
|
|
41
|
-
cleanup();
|
|
42
|
-
if (!el)
|
|
43
|
-
return;
|
|
44
|
-
cleanups.push(...events.flatMap((event) => {
|
|
45
|
-
return listeners.map((listener) => register(el, event, listener, options2));
|
|
46
|
-
}));
|
|
47
|
-
}, { immediate: true, flush: "post" });
|
|
48
|
-
const stop = () => {
|
|
49
|
-
stopWatch();
|
|
50
|
-
cleanup();
|
|
51
|
-
};
|
|
52
|
-
tryOnScopeDispose(stop);
|
|
53
|
-
return stop;
|
|
26
|
+
return qe(i), i;
|
|
54
27
|
}
|
|
55
|
-
function
|
|
56
|
-
const
|
|
57
|
-
|
|
58
|
-
update();
|
|
59
|
-
tryOnMounted(update, sync);
|
|
60
|
-
return isSupported;
|
|
28
|
+
function zt(d, e = !1) {
|
|
29
|
+
const t = S(), n = () => t.value = !!d();
|
|
30
|
+
return n(), ut(n, e), t;
|
|
61
31
|
}
|
|
62
|
-
const
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
var
|
|
66
|
-
var
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
target[prop] = source[prop];
|
|
73
|
-
if (source != null && __getOwnPropSymbols$g)
|
|
74
|
-
for (var prop of __getOwnPropSymbols$g(source)) {
|
|
75
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum$g.call(source, prop))
|
|
76
|
-
target[prop] = source[prop];
|
|
77
|
-
}
|
|
78
|
-
return target;
|
|
32
|
+
const je = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}, Ve = "__vueuse_ssr_handlers__";
|
|
33
|
+
je[Ve] = je[Ve] || {};
|
|
34
|
+
var Ge = Object.getOwnPropertySymbols, Tt = Object.prototype.hasOwnProperty, jt = Object.prototype.propertyIsEnumerable, Vt = (d, e) => {
|
|
35
|
+
var t = {};
|
|
36
|
+
for (var n in d)
|
|
37
|
+
Tt.call(d, n) && e.indexOf(n) < 0 && (t[n] = d[n]);
|
|
38
|
+
if (d != null && Ge)
|
|
39
|
+
for (var n of Ge(d))
|
|
40
|
+
e.indexOf(n) < 0 && jt.call(d, n) && (t[n] = d[n]);
|
|
41
|
+
return t;
|
|
79
42
|
};
|
|
80
|
-
function
|
|
81
|
-
const
|
|
82
|
-
let
|
|
83
|
-
const
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
};
|
|
90
|
-
const stopWatch = watch(() => unrefElement(target), (el) => {
|
|
91
|
-
cleanup();
|
|
92
|
-
if (isSupported.value && window2 && el) {
|
|
93
|
-
observer = new ResizeObserver(callback);
|
|
94
|
-
observer.observe(el, observerOptions);
|
|
95
|
-
}
|
|
96
|
-
}, { immediate: true, flush: "post" });
|
|
97
|
-
const stop = () => {
|
|
98
|
-
cleanup();
|
|
99
|
-
stopWatch();
|
|
43
|
+
function Gt(d, e, t = {}) {
|
|
44
|
+
const n = t, { window: o = st } = n, s = Vt(n, ["window"]);
|
|
45
|
+
let a;
|
|
46
|
+
const r = zt(() => o && "ResizeObserver" in o), l = () => {
|
|
47
|
+
a && (a.disconnect(), a = void 0);
|
|
48
|
+
}, i = W(() => ot(d), (h) => {
|
|
49
|
+
l(), r.value && o && h && (a = new ResizeObserver(e), a.observe(h, s));
|
|
50
|
+
}, { immediate: !0, flush: "post" }), c = () => {
|
|
51
|
+
l(), i();
|
|
100
52
|
};
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
stop
|
|
53
|
+
return qe(c), {
|
|
54
|
+
isSupported: r,
|
|
55
|
+
stop: c
|
|
105
56
|
};
|
|
106
57
|
}
|
|
107
|
-
var
|
|
108
|
-
(function(
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
var
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
119
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
120
|
-
var __spreadValues = (a, b) => {
|
|
121
|
-
for (var prop in b || (b = {}))
|
|
122
|
-
if (__hasOwnProp.call(b, prop))
|
|
123
|
-
__defNormalProp(a, prop, b[prop]);
|
|
124
|
-
if (__getOwnPropSymbols)
|
|
125
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
126
|
-
if (__propIsEnum.call(b, prop))
|
|
127
|
-
__defNormalProp(a, prop, b[prop]);
|
|
128
|
-
}
|
|
129
|
-
return a;
|
|
58
|
+
var Qe;
|
|
59
|
+
(function(d) {
|
|
60
|
+
d.UP = "UP", d.RIGHT = "RIGHT", d.DOWN = "DOWN", d.LEFT = "LEFT", d.NONE = "NONE";
|
|
61
|
+
})(Qe || (Qe = {}));
|
|
62
|
+
var Qt = Object.defineProperty, He = Object.getOwnPropertySymbols, Ht = Object.prototype.hasOwnProperty, Wt = Object.prototype.propertyIsEnumerable, We = (d, e, t) => e in d ? Qt(d, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : d[e] = t, Ut = (d, e) => {
|
|
63
|
+
for (var t in e || (e = {}))
|
|
64
|
+
Ht.call(e, t) && We(d, t, e[t]);
|
|
65
|
+
if (He)
|
|
66
|
+
for (var t of He(e))
|
|
67
|
+
Wt.call(e, t) && We(d, t, e[t]);
|
|
68
|
+
return d;
|
|
130
69
|
};
|
|
131
|
-
const
|
|
70
|
+
const Jt = {
|
|
132
71
|
easeInSine: [0.12, 0, 0.39, 0],
|
|
133
72
|
easeOutSine: [0.61, 1, 0.88, 1],
|
|
134
73
|
easeInOutSine: [0.37, 0, 0.63, 1],
|
|
@@ -154,14 +93,12 @@ const _TransitionPresets = {
|
|
|
154
93
|
easeOutBack: [0.34, 1.56, 0.64, 1],
|
|
155
94
|
easeInOutBack: [0.68, -0.6, 0.32, 1.6]
|
|
156
95
|
};
|
|
157
|
-
|
|
158
|
-
linear:
|
|
159
|
-
},
|
|
160
|
-
const
|
|
161
|
-
const EVENT_CODE = {
|
|
96
|
+
Ut({
|
|
97
|
+
linear: pt
|
|
98
|
+
}, Jt);
|
|
99
|
+
const qt = (d) => d, Zt = {
|
|
162
100
|
esc: "Escape"
|
|
163
|
-
}
|
|
164
|
-
const badgeProps = buildProps({
|
|
101
|
+
}, Yt = De({
|
|
165
102
|
value: {
|
|
166
103
|
type: [String, Number],
|
|
167
104
|
default: ""
|
|
@@ -179,546 +116,440 @@ const badgeProps = buildProps({
|
|
|
179
116
|
},
|
|
180
117
|
showZero: {
|
|
181
118
|
type: Boolean,
|
|
182
|
-
default:
|
|
119
|
+
default: !0
|
|
183
120
|
},
|
|
184
121
|
color: String,
|
|
185
122
|
badgeStyle: {
|
|
186
|
-
type:
|
|
123
|
+
type: Q([String, Object, Array])
|
|
187
124
|
},
|
|
188
125
|
offset: {
|
|
189
|
-
type:
|
|
126
|
+
type: Q(Array),
|
|
190
127
|
default: [0, 0]
|
|
191
128
|
},
|
|
192
129
|
badgeClass: {
|
|
193
130
|
type: String
|
|
194
131
|
}
|
|
195
|
-
})
|
|
196
|
-
const __default__$1 = defineComponent({
|
|
132
|
+
}), Xt = ce({
|
|
197
133
|
name: "ElBadge"
|
|
198
|
-
})
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
const ns = useNamespace("badge");
|
|
205
|
-
const content = computed(() => {
|
|
206
|
-
if (props.isDot)
|
|
207
|
-
return "";
|
|
208
|
-
if (isNumber(props.value) && isNumber(props.max)) {
|
|
209
|
-
return props.max < props.value ? `${props.max}+` : `${props.value}`;
|
|
210
|
-
}
|
|
211
|
-
return `${props.value}`;
|
|
212
|
-
});
|
|
213
|
-
const style = computed(() => {
|
|
214
|
-
var _a, _b, _c, _d, _e;
|
|
134
|
+
}), $t = /* @__PURE__ */ ce({
|
|
135
|
+
...Xt,
|
|
136
|
+
props: Yt,
|
|
137
|
+
setup(d, { expose: e }) {
|
|
138
|
+
const t = d, n = gt("badge"), o = P(() => t.isDot ? "" : ve(t.value) && ve(t.max) ? t.max < t.value ? `${t.max}+` : `${t.value}` : `${t.value}`), s = P(() => {
|
|
139
|
+
var a, r, l, i, c;
|
|
215
140
|
return [
|
|
216
141
|
{
|
|
217
|
-
backgroundColor:
|
|
218
|
-
marginRight:
|
|
219
|
-
marginTop:
|
|
142
|
+
backgroundColor: t.color,
|
|
143
|
+
marginRight: Be(-((r = (a = t.offset) == null ? void 0 : a[0]) != null ? r : 0)),
|
|
144
|
+
marginTop: Be((i = (l = t.offset) == null ? void 0 : l[1]) != null ? i : 0)
|
|
220
145
|
},
|
|
221
|
-
(
|
|
146
|
+
(c = t.badgeStyle) != null ? c : {}
|
|
222
147
|
];
|
|
223
148
|
});
|
|
224
|
-
|
|
225
|
-
content
|
|
226
|
-
})
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
renderSlot(_ctx.$slots, "content", { value: unref(content) }, () => [
|
|
249
|
-
createTextVNode(toDisplayString(unref(content)), 1)
|
|
250
|
-
])
|
|
251
|
-
], 6), [
|
|
252
|
-
[vShow, !_ctx.hidden && (unref(content) || _ctx.isDot || _ctx.$slots.content)]
|
|
149
|
+
return e({
|
|
150
|
+
content: o
|
|
151
|
+
}), (a, r) => (I(), R("div", {
|
|
152
|
+
class: j(y(n).b())
|
|
153
|
+
}, [
|
|
154
|
+
we(a.$slots, "default"),
|
|
155
|
+
z(be, {
|
|
156
|
+
name: `${y(n).namespace.value}-zoom-in-center`,
|
|
157
|
+
persisted: ""
|
|
158
|
+
}, {
|
|
159
|
+
default: V(() => [
|
|
160
|
+
$e(k("sup", {
|
|
161
|
+
class: j([
|
|
162
|
+
y(n).e("content"),
|
|
163
|
+
y(n).em("content", a.type),
|
|
164
|
+
y(n).is("fixed", !!a.$slots.default),
|
|
165
|
+
y(n).is("dot", a.isDot),
|
|
166
|
+
y(n).is("hide-zero", !a.showZero && t.value === 0),
|
|
167
|
+
a.badgeClass
|
|
168
|
+
]),
|
|
169
|
+
style: Ae(y(s))
|
|
170
|
+
}, [
|
|
171
|
+
we(a.$slots, "content", { value: y(o) }, () => [
|
|
172
|
+
ie(re(y(o)), 1)
|
|
253
173
|
])
|
|
254
|
-
]),
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
174
|
+
], 6), [
|
|
175
|
+
[et, !a.hidden && (y(o) || a.isDot || a.$slots.content)]
|
|
176
|
+
])
|
|
177
|
+
]),
|
|
178
|
+
_: 3
|
|
179
|
+
}, 8, ["name"])
|
|
180
|
+
], 2));
|
|
259
181
|
}
|
|
260
182
|
});
|
|
261
|
-
var
|
|
262
|
-
const
|
|
263
|
-
const configProviderProps = buildProps({
|
|
183
|
+
var en = /* @__PURE__ */ Ze($t, [["__file", "badge.vue"]]);
|
|
184
|
+
const tn = vt(en), nn = De({
|
|
264
185
|
a11y: {
|
|
265
186
|
type: Boolean,
|
|
266
|
-
default:
|
|
187
|
+
default: !0
|
|
267
188
|
},
|
|
268
189
|
locale: {
|
|
269
|
-
type:
|
|
190
|
+
type: Q(Object)
|
|
270
191
|
},
|
|
271
|
-
size:
|
|
192
|
+
size: yt,
|
|
272
193
|
button: {
|
|
273
|
-
type:
|
|
194
|
+
type: Q(Object)
|
|
274
195
|
},
|
|
275
196
|
card: {
|
|
276
|
-
type:
|
|
197
|
+
type: Q(Object)
|
|
277
198
|
},
|
|
278
199
|
dialog: {
|
|
279
|
-
type:
|
|
200
|
+
type: Q(Object)
|
|
280
201
|
},
|
|
281
202
|
link: {
|
|
282
|
-
type:
|
|
203
|
+
type: Q(Object)
|
|
283
204
|
},
|
|
284
205
|
experimentalFeatures: {
|
|
285
|
-
type:
|
|
206
|
+
type: Q(Object)
|
|
286
207
|
},
|
|
287
208
|
keyboardNavigation: {
|
|
288
209
|
type: Boolean,
|
|
289
|
-
default:
|
|
210
|
+
default: !0
|
|
290
211
|
},
|
|
291
212
|
message: {
|
|
292
|
-
type:
|
|
213
|
+
type: Q(Object)
|
|
293
214
|
},
|
|
294
215
|
zIndex: Number,
|
|
295
216
|
namespace: {
|
|
296
217
|
type: String,
|
|
297
218
|
default: "el"
|
|
298
219
|
},
|
|
299
|
-
...
|
|
300
|
-
});
|
|
301
|
-
|
|
302
|
-
defineComponent({
|
|
220
|
+
...ft
|
|
221
|
+
}), T = {};
|
|
222
|
+
ce({
|
|
303
223
|
name: "ElConfigProvider",
|
|
304
|
-
props:
|
|
305
|
-
setup(
|
|
306
|
-
const
|
|
307
|
-
|
|
308
|
-
var
|
|
309
|
-
Object.assign(
|
|
310
|
-
}, { immediate:
|
|
311
|
-
return () => renderSlot(slots, "default", { config: config == null ? void 0 : config.value });
|
|
224
|
+
props: nn,
|
|
225
|
+
setup(d, { slots: e }) {
|
|
226
|
+
const t = wt(d);
|
|
227
|
+
return W(() => d.message, (n) => {
|
|
228
|
+
var o, s;
|
|
229
|
+
Object.assign(T, (s = (o = t?.value) == null ? void 0 : o.message) != null ? s : {}, n ?? {});
|
|
230
|
+
}, { immediate: !0, deep: !0 }), () => we(e, "default", { config: t?.value });
|
|
312
231
|
}
|
|
313
232
|
});
|
|
314
|
-
const
|
|
233
|
+
const at = [
|
|
315
234
|
"primary",
|
|
316
235
|
"success",
|
|
317
236
|
"info",
|
|
318
237
|
"warning",
|
|
319
238
|
"error"
|
|
320
|
-
]
|
|
321
|
-
const messageDefaults = mutable({
|
|
239
|
+
], N = qt({
|
|
322
240
|
customClass: "",
|
|
323
|
-
dangerouslyUseHTMLString:
|
|
241
|
+
dangerouslyUseHTMLString: !1,
|
|
324
242
|
duration: 3e3,
|
|
325
243
|
icon: void 0,
|
|
326
244
|
id: "",
|
|
327
245
|
message: "",
|
|
328
246
|
onClose: void 0,
|
|
329
|
-
showClose:
|
|
247
|
+
showClose: !1,
|
|
330
248
|
type: "info",
|
|
331
|
-
plain:
|
|
249
|
+
plain: !1,
|
|
332
250
|
offset: 16,
|
|
333
251
|
zIndex: 0,
|
|
334
|
-
grouping:
|
|
252
|
+
grouping: !1,
|
|
335
253
|
repeatNum: 1,
|
|
336
|
-
appendTo:
|
|
337
|
-
})
|
|
338
|
-
const messageProps = buildProps({
|
|
254
|
+
appendTo: Pe ? document.body : void 0
|
|
255
|
+
}), on = De({
|
|
339
256
|
customClass: {
|
|
340
257
|
type: String,
|
|
341
|
-
default:
|
|
258
|
+
default: N.customClass
|
|
342
259
|
},
|
|
343
260
|
dangerouslyUseHTMLString: {
|
|
344
261
|
type: Boolean,
|
|
345
|
-
default:
|
|
262
|
+
default: N.dangerouslyUseHTMLString
|
|
346
263
|
},
|
|
347
264
|
duration: {
|
|
348
265
|
type: Number,
|
|
349
|
-
default:
|
|
266
|
+
default: N.duration
|
|
350
267
|
},
|
|
351
268
|
icon: {
|
|
352
|
-
type:
|
|
353
|
-
default:
|
|
269
|
+
type: bt,
|
|
270
|
+
default: N.icon
|
|
354
271
|
},
|
|
355
272
|
id: {
|
|
356
273
|
type: String,
|
|
357
|
-
default:
|
|
274
|
+
default: N.id
|
|
358
275
|
},
|
|
359
276
|
message: {
|
|
360
|
-
type:
|
|
277
|
+
type: Q([
|
|
361
278
|
String,
|
|
362
279
|
Object,
|
|
363
280
|
Function
|
|
364
281
|
]),
|
|
365
|
-
default:
|
|
282
|
+
default: N.message
|
|
366
283
|
},
|
|
367
284
|
onClose: {
|
|
368
|
-
type:
|
|
369
|
-
default:
|
|
285
|
+
type: Q(Function),
|
|
286
|
+
default: N.onClose
|
|
370
287
|
},
|
|
371
288
|
showClose: {
|
|
372
289
|
type: Boolean,
|
|
373
|
-
default:
|
|
290
|
+
default: N.showClose
|
|
374
291
|
},
|
|
375
292
|
type: {
|
|
376
293
|
type: String,
|
|
377
|
-
values:
|
|
378
|
-
default:
|
|
294
|
+
values: at,
|
|
295
|
+
default: N.type
|
|
379
296
|
},
|
|
380
297
|
plain: {
|
|
381
298
|
type: Boolean,
|
|
382
|
-
default:
|
|
299
|
+
default: N.plain
|
|
383
300
|
},
|
|
384
301
|
offset: {
|
|
385
302
|
type: Number,
|
|
386
|
-
default:
|
|
303
|
+
default: N.offset
|
|
387
304
|
},
|
|
388
305
|
zIndex: {
|
|
389
306
|
type: Number,
|
|
390
|
-
default:
|
|
307
|
+
default: N.zIndex
|
|
391
308
|
},
|
|
392
309
|
grouping: {
|
|
393
310
|
type: Boolean,
|
|
394
|
-
default:
|
|
311
|
+
default: N.grouping
|
|
395
312
|
},
|
|
396
313
|
repeatNum: {
|
|
397
314
|
type: Number,
|
|
398
|
-
default:
|
|
399
|
-
}
|
|
400
|
-
})
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
const
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
prev = instances[idx - 1];
|
|
411
|
-
}
|
|
412
|
-
return { current, prev };
|
|
413
|
-
};
|
|
414
|
-
const getLastOffset = (id) => {
|
|
415
|
-
const { prev } = getInstance(id);
|
|
416
|
-
if (!prev)
|
|
417
|
-
return 0;
|
|
418
|
-
return prev.vm.exposed.bottom.value;
|
|
419
|
-
};
|
|
420
|
-
const getOffsetOrSpace = (id, offset) => {
|
|
421
|
-
const idx = instances.findIndex((instance) => instance.id === id);
|
|
422
|
-
return idx > 0 ? 16 : offset;
|
|
423
|
-
};
|
|
424
|
-
const __default__ = defineComponent({
|
|
315
|
+
default: N.repeatNum
|
|
316
|
+
}
|
|
317
|
+
}), sn = {
|
|
318
|
+
destroy: () => !0
|
|
319
|
+
}, H = St([]), an = (d) => {
|
|
320
|
+
const e = H.findIndex((o) => o.id === d), t = H[e];
|
|
321
|
+
let n;
|
|
322
|
+
return e > 0 && (n = H[e - 1]), { current: t, prev: n };
|
|
323
|
+
}, rn = (d) => {
|
|
324
|
+
const { prev: e } = an(d);
|
|
325
|
+
return e ? e.vm.exposed.bottom.value : 0;
|
|
326
|
+
}, dn = (d, e) => H.findIndex((n) => n.id === d) > 0 ? 16 : e, ln = ce({
|
|
425
327
|
name: "ElMessage"
|
|
426
|
-
})
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
const
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
const height = ref(0);
|
|
440
|
-
let stopTimer = void 0;
|
|
441
|
-
const badgeType = computed(() => props.type ? props.type === "error" ? "danger" : props.type : "info");
|
|
442
|
-
const typeClass = computed(() => {
|
|
443
|
-
const type = props.type;
|
|
444
|
-
return { [ns.bm("icon", type)]: type && TypeComponentsMap[type] };
|
|
445
|
-
});
|
|
446
|
-
const iconComponent = computed(() => props.icon || TypeComponentsMap[props.type] || "");
|
|
447
|
-
const lastOffset = computed(() => getLastOffset(props.id));
|
|
448
|
-
const offset = computed(() => getOffsetOrSpace(props.id, props.offset) + lastOffset.value);
|
|
449
|
-
const bottom = computed(() => height.value + offset.value);
|
|
450
|
-
const customStyle = computed(() => ({
|
|
451
|
-
top: `${offset.value}px`,
|
|
452
|
-
zIndex: currentZIndex.value
|
|
328
|
+
}), cn = /* @__PURE__ */ ce({
|
|
329
|
+
...ln,
|
|
330
|
+
props: on,
|
|
331
|
+
emits: sn,
|
|
332
|
+
setup(d, { expose: e, emit: t }) {
|
|
333
|
+
const n = d, { Close: o } = xt, s = S(!1), { ns: a, zIndex: r } = Ct("message"), { currentZIndex: l, nextZIndex: i } = r, c = S(), h = S(!1), f = S(0);
|
|
334
|
+
let u;
|
|
335
|
+
const p = P(() => n.type ? n.type === "error" ? "danger" : n.type : "info"), g = P(() => {
|
|
336
|
+
const w = n.type;
|
|
337
|
+
return { [a.bm("icon", w)]: w && Ne[w] };
|
|
338
|
+
}), E = P(() => n.icon || Ne[n.type] || ""), C = P(() => rn(n.id)), D = P(() => dn(n.id, n.offset) + C.value), F = P(() => f.value + D.value), ae = P(() => ({
|
|
339
|
+
top: `${D.value}px`,
|
|
340
|
+
zIndex: l.value
|
|
453
341
|
}));
|
|
454
|
-
function
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
close();
|
|
459
|
-
}, props.duration));
|
|
342
|
+
function q() {
|
|
343
|
+
n.duration !== 0 && ({ stop: u } = Et(() => {
|
|
344
|
+
M();
|
|
345
|
+
}, n.duration));
|
|
460
346
|
}
|
|
461
|
-
function
|
|
462
|
-
|
|
347
|
+
function _() {
|
|
348
|
+
u?.();
|
|
463
349
|
}
|
|
464
|
-
function
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
if (!isStartTransition.value) {
|
|
469
|
-
(_a = props.onClose) == null ? void 0 : _a.call(props);
|
|
470
|
-
emit("destroy");
|
|
471
|
-
}
|
|
350
|
+
function M() {
|
|
351
|
+
h.value = !1, ye(() => {
|
|
352
|
+
var w;
|
|
353
|
+
s.value || ((w = n.onClose) == null || w.call(n), t("destroy"));
|
|
472
354
|
});
|
|
473
355
|
}
|
|
474
|
-
function
|
|
475
|
-
|
|
476
|
-
close();
|
|
477
|
-
}
|
|
356
|
+
function K({ code: w }) {
|
|
357
|
+
w === Zt.esc && M();
|
|
478
358
|
}
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
})
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
359
|
+
return tt(() => {
|
|
360
|
+
q(), i(), h.value = !0;
|
|
361
|
+
}), W(() => n.repeatNum, () => {
|
|
362
|
+
_(), q();
|
|
363
|
+
}), Kt(document, "keydown", K), Gt(c, () => {
|
|
364
|
+
f.value = c.value.getBoundingClientRect().height;
|
|
365
|
+
}), e({
|
|
366
|
+
visible: h,
|
|
367
|
+
bottom: F,
|
|
368
|
+
close: M
|
|
369
|
+
}), (w, Z) => (I(), pe(be, {
|
|
370
|
+
name: y(a).b("fade"),
|
|
371
|
+
onBeforeEnter: (G) => s.value = !0,
|
|
372
|
+
onBeforeLeave: w.onClose,
|
|
373
|
+
onAfterLeave: (G) => w.$emit("destroy"),
|
|
374
|
+
persisted: ""
|
|
375
|
+
}, {
|
|
376
|
+
default: V(() => [
|
|
377
|
+
$e(k("div", {
|
|
378
|
+
id: w.id,
|
|
379
|
+
ref_key: "messageRef",
|
|
380
|
+
ref: c,
|
|
381
|
+
class: j([
|
|
382
|
+
y(a).b(),
|
|
383
|
+
{ [y(a).m(w.type)]: w.type },
|
|
384
|
+
y(a).is("closable", w.showClose),
|
|
385
|
+
y(a).is("plain", w.plain),
|
|
386
|
+
w.customClass
|
|
387
|
+
]),
|
|
388
|
+
style: Ae(y(ae)),
|
|
389
|
+
role: "alert",
|
|
390
|
+
onMouseenter: _,
|
|
391
|
+
onMouseleave: q
|
|
392
|
+
}, [
|
|
393
|
+
w.repeatNum > 1 ? (I(), pe(y(tn), {
|
|
394
|
+
key: 0,
|
|
395
|
+
value: w.repeatNum,
|
|
396
|
+
type: y(p),
|
|
397
|
+
class: j(y(a).e("badge"))
|
|
398
|
+
}, null, 8, ["value", "type", "class"])) : J("v-if", !0),
|
|
399
|
+
y(E) ? (I(), pe(y(Re), {
|
|
400
|
+
key: 1,
|
|
401
|
+
class: j([y(a).e("icon"), y(g)])
|
|
402
|
+
}, {
|
|
403
|
+
default: V(() => [
|
|
404
|
+
(I(), pe(At(y(E))))
|
|
516
405
|
]),
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
406
|
+
_: 1
|
|
407
|
+
}, 8, ["class"])) : J("v-if", !0),
|
|
408
|
+
we(w.$slots, "default", {}, () => [
|
|
409
|
+
w.dangerouslyUseHTMLString ? (I(), R(ge, { key: 1 }, [
|
|
410
|
+
J(" Caution here, message could've been compromised, never use user's input as message "),
|
|
411
|
+
k("p", {
|
|
412
|
+
class: j(y(a).e("content")),
|
|
413
|
+
innerHTML: w.message
|
|
414
|
+
}, null, 10, ["innerHTML"])
|
|
415
|
+
], 2112)) : (I(), R("p", {
|
|
523
416
|
key: 0,
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
]),
|
|
535
|
-
_: 1
|
|
536
|
-
}, 8, ["class"])) : createCommentVNode("v-if", true),
|
|
537
|
-
renderSlot(_ctx.$slots, "default", {}, () => [
|
|
538
|
-
!_ctx.dangerouslyUseHTMLString ? (openBlock(), createElementBlock("p", {
|
|
539
|
-
key: 0,
|
|
540
|
-
class: normalizeClass(unref(ns).e("content"))
|
|
541
|
-
}, toDisplayString(_ctx.message), 3)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
542
|
-
createCommentVNode(" Caution here, message could've been compromised, never use user's input as message "),
|
|
543
|
-
createElementVNode("p", {
|
|
544
|
-
class: normalizeClass(unref(ns).e("content")),
|
|
545
|
-
innerHTML: _ctx.message
|
|
546
|
-
}, null, 10, ["innerHTML"])
|
|
547
|
-
], 2112))
|
|
417
|
+
class: j(y(a).e("content"))
|
|
418
|
+
}, re(w.message), 3))
|
|
419
|
+
]),
|
|
420
|
+
w.showClose ? (I(), pe(y(Re), {
|
|
421
|
+
key: 2,
|
|
422
|
+
class: j(y(a).e("closeBtn")),
|
|
423
|
+
onClick: _t(M, ["stop"])
|
|
424
|
+
}, {
|
|
425
|
+
default: V(() => [
|
|
426
|
+
z(y(o))
|
|
548
427
|
]),
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
_: 1
|
|
558
|
-
}, 8, ["class", "onClick"])) : createCommentVNode("v-if", true)
|
|
559
|
-
], 46, ["id"]), [
|
|
560
|
-
[vShow, visible.value]
|
|
561
|
-
])
|
|
562
|
-
]),
|
|
563
|
-
_: 3
|
|
564
|
-
}, 8, ["name", "onBeforeEnter", "onBeforeLeave", "onAfterLeave"]);
|
|
565
|
-
};
|
|
428
|
+
_: 1
|
|
429
|
+
}, 8, ["class", "onClick"])) : J("v-if", !0)
|
|
430
|
+
], 46, ["id"]), [
|
|
431
|
+
[et, h.value]
|
|
432
|
+
])
|
|
433
|
+
]),
|
|
434
|
+
_: 3
|
|
435
|
+
}, 8, ["name", "onBeforeEnter", "onBeforeLeave", "onAfterLeave"]));
|
|
566
436
|
}
|
|
567
437
|
});
|
|
568
|
-
var
|
|
569
|
-
let
|
|
570
|
-
const
|
|
571
|
-
const
|
|
572
|
-
|
|
573
|
-
...
|
|
574
|
-
...options
|
|
438
|
+
var mn = /* @__PURE__ */ Ze(cn, [["__file", "message.vue"]]);
|
|
439
|
+
let hn = 1;
|
|
440
|
+
const it = (d) => {
|
|
441
|
+
const e = !d || Oe(d) || nt(d) || Ie(d) ? { message: d } : d, t = {
|
|
442
|
+
...N,
|
|
443
|
+
...e
|
|
575
444
|
};
|
|
576
|
-
if (!
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
let
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
if (
|
|
586
|
-
normalized.grouping = messageConfig.grouping;
|
|
587
|
-
}
|
|
588
|
-
if (isNumber(messageConfig.duration) && normalized.duration === 3e3) {
|
|
589
|
-
normalized.duration = messageConfig.duration;
|
|
590
|
-
}
|
|
591
|
-
if (isNumber(messageConfig.offset) && normalized.offset === 16) {
|
|
592
|
-
normalized.offset = messageConfig.offset;
|
|
593
|
-
}
|
|
594
|
-
if (isBoolean(messageConfig.showClose) && !normalized.showClose) {
|
|
595
|
-
normalized.showClose = messageConfig.showClose;
|
|
596
|
-
}
|
|
597
|
-
if (isBoolean(messageConfig.plain) && !normalized.plain) {
|
|
598
|
-
normalized.plain = messageConfig.plain;
|
|
599
|
-
}
|
|
600
|
-
return normalized;
|
|
601
|
-
};
|
|
602
|
-
const closeMessage = (instance) => {
|
|
603
|
-
const idx = instances.indexOf(instance);
|
|
604
|
-
if (idx === -1)
|
|
445
|
+
if (!t.appendTo)
|
|
446
|
+
t.appendTo = document.body;
|
|
447
|
+
else if (Oe(t.appendTo)) {
|
|
448
|
+
let n = document.querySelector(t.appendTo);
|
|
449
|
+
Mt(n) || (n = document.body), t.appendTo = n;
|
|
450
|
+
}
|
|
451
|
+
return Le(T.grouping) && !t.grouping && (t.grouping = T.grouping), ve(T.duration) && t.duration === 3e3 && (t.duration = T.duration), ve(T.offset) && t.offset === 16 && (t.offset = T.offset), Le(T.showClose) && !t.showClose && (t.showClose = T.showClose), Le(T.plain) && !t.plain && (t.plain = T.plain), t;
|
|
452
|
+
}, un = (d) => {
|
|
453
|
+
const e = H.indexOf(d);
|
|
454
|
+
if (e === -1)
|
|
605
455
|
return;
|
|
606
|
-
|
|
607
|
-
const { handler } =
|
|
608
|
-
|
|
609
|
-
}
|
|
610
|
-
const
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
const container = document.createElement("div");
|
|
614
|
-
const props = {
|
|
615
|
-
...options,
|
|
616
|
-
id,
|
|
456
|
+
H.splice(e, 1);
|
|
457
|
+
const { handler: t } = d;
|
|
458
|
+
t.close();
|
|
459
|
+
}, pn = ({ appendTo: d, ...e }, t) => {
|
|
460
|
+
const n = `message_${hn++}`, o = e.onClose, s = document.createElement("div"), a = {
|
|
461
|
+
...e,
|
|
462
|
+
id: n,
|
|
617
463
|
onClose: () => {
|
|
618
|
-
|
|
619
|
-
closeMessage(instance);
|
|
464
|
+
o?.(), un(c);
|
|
620
465
|
},
|
|
621
466
|
onDestroy: () => {
|
|
622
|
-
|
|
467
|
+
Te(null, s);
|
|
623
468
|
}
|
|
624
|
-
}
|
|
625
|
-
|
|
626
|
-
default: isFunction(props.message) ? props.message : () => props.message
|
|
469
|
+
}, r = z(mn, a, Ie(a.message) || nt(a.message) ? {
|
|
470
|
+
default: Ie(a.message) ? a.message : () => a.message
|
|
627
471
|
} : null);
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
vnode,
|
|
640
|
-
vm,
|
|
641
|
-
handler,
|
|
642
|
-
props: vnode.component.props
|
|
472
|
+
r.appContext = t || le._context, Te(r, s), d.appendChild(s.firstElementChild);
|
|
473
|
+
const l = r.component, c = {
|
|
474
|
+
id: n,
|
|
475
|
+
vnode: r,
|
|
476
|
+
vm: l,
|
|
477
|
+
handler: {
|
|
478
|
+
close: () => {
|
|
479
|
+
l.exposed.close();
|
|
480
|
+
}
|
|
481
|
+
},
|
|
482
|
+
props: r.component.props
|
|
643
483
|
};
|
|
644
|
-
return
|
|
645
|
-
}
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
const
|
|
650
|
-
if (
|
|
651
|
-
const
|
|
652
|
-
var
|
|
653
|
-
return ((
|
|
484
|
+
return c;
|
|
485
|
+
}, le = (d = {}, e) => {
|
|
486
|
+
if (!Pe)
|
|
487
|
+
return { close: () => {
|
|
488
|
+
} };
|
|
489
|
+
const t = it(d);
|
|
490
|
+
if (t.grouping && H.length) {
|
|
491
|
+
const o = H.find(({ vnode: s }) => {
|
|
492
|
+
var a;
|
|
493
|
+
return ((a = s.props) == null ? void 0 : a.message) === t.message;
|
|
654
494
|
});
|
|
655
|
-
if (
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
}
|
|
664
|
-
const instance = createMessage(normalized, context);
|
|
665
|
-
instances.push(instance);
|
|
666
|
-
return instance.handler;
|
|
495
|
+
if (o)
|
|
496
|
+
return o.props.repeatNum += 1, o.props.type = t.type, o.handler;
|
|
497
|
+
}
|
|
498
|
+
if (ve(T.max) && H.length >= T.max)
|
|
499
|
+
return { close: () => {
|
|
500
|
+
} };
|
|
501
|
+
const n = pn(t, e);
|
|
502
|
+
return H.push(n), n.handler;
|
|
667
503
|
};
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
const
|
|
671
|
-
return
|
|
504
|
+
at.forEach((d) => {
|
|
505
|
+
le[d] = (e = {}, t) => {
|
|
506
|
+
const n = it(e);
|
|
507
|
+
return le({ ...n, type: d }, t);
|
|
672
508
|
};
|
|
673
509
|
});
|
|
674
|
-
function
|
|
675
|
-
const
|
|
676
|
-
for (const
|
|
677
|
-
|
|
678
|
-
instance.handler.close();
|
|
679
|
-
}
|
|
680
|
-
}
|
|
510
|
+
function gn(d) {
|
|
511
|
+
const e = [...H];
|
|
512
|
+
for (const t of e)
|
|
513
|
+
(!d || d === t.props.type) && t.handler.close();
|
|
681
514
|
}
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
const
|
|
685
|
-
class
|
|
515
|
+
le.closeAll = gn;
|
|
516
|
+
le._context = null;
|
|
517
|
+
const L = Lt(le, "$message");
|
|
518
|
+
class O extends Se {
|
|
686
519
|
_renderer;
|
|
687
520
|
get renderer() {
|
|
688
|
-
|
|
689
|
-
return this._renderer;
|
|
521
|
+
return this._renderer || (this._renderer = this.parent?.findComponentByName("Renderer")), this._renderer;
|
|
690
522
|
}
|
|
691
523
|
_domElement;
|
|
692
524
|
get domElement() {
|
|
693
|
-
|
|
694
|
-
return this._domElement;
|
|
525
|
+
return this._domElement || (this._domElement = this.editor?.domContainer?.domElement), this._domElement;
|
|
695
526
|
}
|
|
696
527
|
_editor;
|
|
697
528
|
get editor() {
|
|
698
|
-
|
|
699
|
-
return this._editor;
|
|
529
|
+
return this._editor || (this._editor = this.parent?.findComponentByName("Editor")), this._editor;
|
|
700
530
|
}
|
|
701
531
|
_eventInput;
|
|
702
532
|
get eventInput() {
|
|
703
|
-
|
|
704
|
-
return this._eventInput;
|
|
533
|
+
return this._eventInput || (this._eventInput = this.parent?.findComponentByName("EventInput")), this._eventInput;
|
|
705
534
|
}
|
|
706
535
|
_renderManager;
|
|
707
536
|
get renderManager() {
|
|
708
|
-
|
|
709
|
-
return this._renderManager;
|
|
537
|
+
return this._renderManager || (this._renderManager = this.parent?.findComponentByName("RenderManager")), this._renderManager;
|
|
710
538
|
}
|
|
711
539
|
_commandManager;
|
|
712
540
|
get commandManager() {
|
|
713
|
-
|
|
714
|
-
|
|
541
|
+
return this._commandManager || (this._commandManager = this.editor?.commandManager), this._commandManager;
|
|
542
|
+
}
|
|
543
|
+
_default;
|
|
544
|
+
get default() {
|
|
545
|
+
return this._default || (this._default = this.parent?.findComponentByName("Default")), this._default;
|
|
715
546
|
}
|
|
716
547
|
interruptKeys = ["escape"];
|
|
717
548
|
commandName = "";
|
|
718
549
|
constructor() {
|
|
719
550
|
super();
|
|
720
551
|
}
|
|
721
|
-
onAddFromParent(
|
|
552
|
+
onAddFromParent(e) {
|
|
722
553
|
this.editor.addEventListener("cancelCommand", () => {
|
|
723
554
|
this.cancel();
|
|
724
555
|
});
|
|
@@ -727,22 +558,21 @@ class CommandFlowComponent extends Component {
|
|
|
727
558
|
* 取消
|
|
728
559
|
*/
|
|
729
560
|
cancel() {
|
|
730
|
-
|
|
731
|
-
this.
|
|
561
|
+
const e = this.commandName || this.constructor.commandName;
|
|
562
|
+
this.commandManager.currentName === e && this.commandManager.cancel();
|
|
732
563
|
}
|
|
733
564
|
/**
|
|
734
|
-
*
|
|
565
|
+
* 创建中断处理命令节点
|
|
735
566
|
* @returns
|
|
736
567
|
*/
|
|
737
568
|
createInterrupt() {
|
|
738
|
-
return (
|
|
569
|
+
return (e, t) => {
|
|
739
570
|
this.addEventRecord(
|
|
740
571
|
"clear",
|
|
741
|
-
this.
|
|
742
|
-
|
|
572
|
+
this.eventInput.addEventListener("codeChange", async () => {
|
|
573
|
+
this.eventInput.isKeyDowns(this.interruptKeys) && this.cancel();
|
|
743
574
|
})
|
|
744
|
-
);
|
|
745
|
-
next(data);
|
|
575
|
+
), e(t);
|
|
746
576
|
};
|
|
747
577
|
}
|
|
748
578
|
/**
|
|
@@ -750,305 +580,195 @@ class CommandFlowComponent extends Component {
|
|
|
750
580
|
* @param cursor
|
|
751
581
|
* @returns
|
|
752
582
|
*/
|
|
753
|
-
createCursor(
|
|
754
|
-
return (
|
|
755
|
-
const
|
|
756
|
-
this.domElement.style.cursor =
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
});
|
|
760
|
-
next(data);
|
|
583
|
+
createCursor(e) {
|
|
584
|
+
return (t, n) => {
|
|
585
|
+
const o = this.domElement.style.cursor;
|
|
586
|
+
this.domElement.style.cursor = e, this.addEventRecord("clear", () => {
|
|
587
|
+
this.domElement.style.cursor = o ?? "default";
|
|
588
|
+
}), t(n);
|
|
761
589
|
};
|
|
762
590
|
}
|
|
763
591
|
/**
|
|
764
592
|
* 创建清理
|
|
765
593
|
* @returns
|
|
766
594
|
*/
|
|
767
|
-
createFinally(
|
|
595
|
+
createFinally(e = []) {
|
|
768
596
|
return () => {
|
|
769
|
-
this.canceEventRecord("clear");
|
|
770
|
-
|
|
597
|
+
this.canceEventRecord("clear"), e.forEach((t) => this.canceEventRecord(t));
|
|
598
|
+
};
|
|
599
|
+
}
|
|
600
|
+
/**
|
|
601
|
+
* 创建鼠标移动
|
|
602
|
+
* @param callBack
|
|
603
|
+
* @returns
|
|
604
|
+
*/
|
|
605
|
+
createPointerMove(e) {
|
|
606
|
+
const t = this.editor, n = new A();
|
|
607
|
+
let o = null, s = null, a = null;
|
|
608
|
+
const r = t.addEventListener("pointerPositionChange", () => {
|
|
609
|
+
const l = A.from(t.pointerPosition);
|
|
610
|
+
if (o && t.eventInput.isKeyDown("shift")) {
|
|
611
|
+
const i = Math.abs(l.x - o.x), c = Math.abs(l.y - o.y);
|
|
612
|
+
i > c ? n.set(l.x, o.y) : n.set(o.x, l.y), e(n, !1);
|
|
613
|
+
} else if (s && a && t.eventInput.isKeyDown("alt")) {
|
|
614
|
+
const i = s.projectPoint(l, !1), c = a.projectPoint(l, !1);
|
|
615
|
+
i && c ? l.distance(i) < l.distance(c) ? n.copy(i) : n.copy(c) : i ? n.copy(i) : c && n.copy(c), e(n, !1);
|
|
616
|
+
} else {
|
|
617
|
+
const { point: i, find: c } = t.renderManager.adsorption();
|
|
618
|
+
n.copy(i), e(n, c);
|
|
619
|
+
}
|
|
620
|
+
});
|
|
621
|
+
return {
|
|
622
|
+
destroy() {
|
|
623
|
+
r();
|
|
624
|
+
},
|
|
625
|
+
setBaseLine(l, i) {
|
|
626
|
+
if (s = l, o = i, l && i) {
|
|
627
|
+
const c = l.normal();
|
|
628
|
+
a = new B(
|
|
629
|
+
i.clone().add(c.clone().multiplyScalar(10)),
|
|
630
|
+
i.clone().add(c.multiplyScalar(-10))
|
|
631
|
+
);
|
|
632
|
+
} else a = null;
|
|
633
|
+
}
|
|
771
634
|
};
|
|
772
635
|
}
|
|
773
636
|
}
|
|
774
|
-
class
|
|
637
|
+
class vn extends O {
|
|
775
638
|
static name = "DrawLine";
|
|
776
|
-
container = new
|
|
639
|
+
container = new m.Group();
|
|
777
640
|
interruptKeys = ["escape"];
|
|
778
641
|
withdrawalKeys = ["control", "z"];
|
|
779
642
|
shortcutKeys = ["control", "l"];
|
|
780
643
|
confirmKeys = ["enter"];
|
|
781
644
|
commandName = "draw-line";
|
|
782
|
-
onAddFromParent(
|
|
783
|
-
super.onAddFromParent(
|
|
784
|
-
this.
|
|
785
|
-
|
|
786
|
-
commandFlow.addEventListener("finally", this.createFinally());
|
|
787
|
-
commandFlow.addEventListener("completed", (e) => this.completed(e.data));
|
|
788
|
-
this.eventInput.addKeyCombination(this.commandName, this.shortcutKeys);
|
|
789
|
-
this.eventInput.addEventListener("codeChange", async () => this.eventInput.isKeyCombination(this.commandName) && await this.commandManager.start(this.commandName));
|
|
790
|
-
this.eventInput.addCancelDefaultBehavior(() => this.eventInput.isOnlyKeyDowns(this.shortcutKeys));
|
|
645
|
+
onAddFromParent(e) {
|
|
646
|
+
super.onAddFromParent(e), this.editor.container.add(this.container);
|
|
647
|
+
const t = this.commandManager.addCommandFlow(this.commandName).add(this.createInterrupt()).add(this.createCursor("crosshair")).add(this.selectPoint.bind(this)).add(this.end.bind(this)).addRollback(this.rollback.bind(this)).addRevokeRollback(this.revokeRollback.bind(this));
|
|
648
|
+
t.addEventListener("finally", this.createFinally()), t.addEventListener("completed", (n) => this.completed(n.data)), this.eventInput.addKeyCombination(this.commandName, this.shortcutKeys), this.eventInput.addEventListener("codeChange", async () => this.eventInput.isKeyCombination(this.commandName) && await this.commandManager.start(this.commandName)), this.eventInput.addCancelDefaultBehavior(() => this.eventInput.isOnlyKeyDowns(this.shortcutKeys));
|
|
791
649
|
}
|
|
792
650
|
/** 选择点
|
|
793
651
|
* @param next
|
|
794
652
|
*/
|
|
795
|
-
selectPoint(
|
|
796
|
-
let
|
|
797
|
-
new
|
|
798
|
-
new
|
|
799
|
-
new
|
|
800
|
-
new
|
|
653
|
+
selectPoint(e) {
|
|
654
|
+
let t = this.parent?.findComponentByName("Editor"), n = null, o = null, s = [], a = new m.Mesh(new m.SphereGeometry(0.04), new m.MeshBasicMaterial({ color: 65280 })), r = t.domContainer.domElement, l = new fe([], 16711935), i = new fe([
|
|
655
|
+
new m.Vector3(-1e4, 0, 0),
|
|
656
|
+
new m.Vector3(1e4, 0, 0),
|
|
657
|
+
new m.Vector3(0, -1e4, 0),
|
|
658
|
+
new m.Vector3(0, 1e4, 0)
|
|
801
659
|
], 16711935);
|
|
802
|
-
|
|
660
|
+
i.material = new m.LineDashedMaterial({
|
|
803
661
|
color: 4235007,
|
|
804
662
|
dashSize: 0.1,
|
|
805
663
|
gapSize: 0.1,
|
|
806
664
|
linewidth: 0.1
|
|
665
|
+
}), this.container.add(l);
|
|
666
|
+
const c = () => {
|
|
667
|
+
l.setPoint(...s, n, o), i.position.copy(o), this.container.add(i), i.computeLineDistances();
|
|
668
|
+
}, h = new m.Vector3(), f = this.createPointerMove((u, p) => {
|
|
669
|
+
h.set(u.x, u.y, 0), this.dispatchEvent({ type: "pointerMove", point: h }), p ? (a.position.set(u.x, u.y, 0), this.container.add(a), r.style.cursor = "none") : (a.removeFromParent(), r.style.cursor = "crosshair"), n && o && (c(), o.copy(h));
|
|
807
670
|
});
|
|
808
|
-
this.container.add(line2);
|
|
809
|
-
const updateLine = () => {
|
|
810
|
-
line2.setPoint(...points, start, end);
|
|
811
|
-
auxiliaryLine.position.copy(end);
|
|
812
|
-
this.container.add(auxiliaryLine);
|
|
813
|
-
auxiliaryLine.computeLineDistances();
|
|
814
|
-
};
|
|
815
|
-
const currentPoint = new THREE.Vector3();
|
|
816
671
|
this.addEventRecord(
|
|
817
672
|
"clear",
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
if (
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
dom.style.cursor = "none";
|
|
824
|
-
} else {
|
|
825
|
-
circle.removeFromParent();
|
|
826
|
-
dom.style.cursor = "crosshair";
|
|
827
|
-
}
|
|
828
|
-
currentPoint.copy(point);
|
|
829
|
-
if (!(start && end)) return;
|
|
830
|
-
if (editor.eventInput.isKeyDown("shift")) {
|
|
831
|
-
const x = Math.abs(editor.pointerPosition.x - start.x), y = Math.abs(editor.pointerPosition.y - start.y);
|
|
832
|
-
if (x > y) end.set(editor.pointerPosition.x, start.y, 0);
|
|
833
|
-
else end.set(start.x, editor.pointerPosition.y, 0);
|
|
834
|
-
updateLine();
|
|
835
|
-
currentPoint.copy(end);
|
|
836
|
-
return;
|
|
837
|
-
}
|
|
838
|
-
end.set(editor.pointerPosition.x, editor.pointerPosition.y, 0);
|
|
839
|
-
updateLine();
|
|
840
|
-
}),
|
|
841
|
-
editor.eventInput.addEventListener("codeChange", async () => {
|
|
842
|
-
if (editor.eventInput.isKeyDown("mouse_0")) {
|
|
843
|
-
if (!start) {
|
|
844
|
-
start = currentPoint.clone();
|
|
845
|
-
end = currentPoint.clone();
|
|
846
|
-
updateLine();
|
|
673
|
+
() => f.destroy(),
|
|
674
|
+
t.eventInput.addEventListener("codeChange", async () => {
|
|
675
|
+
if (t.eventInput.isKeyDown("mouse_0")) {
|
|
676
|
+
if (!n) {
|
|
677
|
+
n = h.clone(), o = h.clone(), c(), f.setBaseLine(null, A.from(n));
|
|
847
678
|
return;
|
|
848
679
|
}
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
updateLine();
|
|
680
|
+
o = h.clone(), s.push(n.clone(), o.clone());
|
|
681
|
+
const u = new B(A.from(n), A.from(o));
|
|
682
|
+
f.setBaseLine(u, u.end), n.copy(o), c();
|
|
683
|
+
} else if (t.eventInput.isOnlyKeyDowns(this.withdrawalKeys)) {
|
|
684
|
+
if (s.length) {
|
|
685
|
+
const { point: u } = t.renderManager.adsorption();
|
|
686
|
+
if (s.pop(), o?.copy(u), n?.copy(s.pop()), c(), s.length >= 2) {
|
|
687
|
+
const p = new B(A.from(s[s.length - 2]), A.from(s[s.length - 1]));
|
|
688
|
+
f.setBaseLine(p, p.end);
|
|
689
|
+
}
|
|
860
690
|
}
|
|
861
|
-
} else
|
|
691
|
+
} else t.eventInput.isKeyDowns(this.confirmKeys) && e(s);
|
|
862
692
|
}),
|
|
863
693
|
function() {
|
|
864
|
-
|
|
865
|
-
circle.removeFromParent();
|
|
866
|
-
auxiliaryLine.removeFromParent();
|
|
694
|
+
l.removeFromParent(), a.removeFromParent(), i.removeFromParent();
|
|
867
695
|
}
|
|
868
696
|
);
|
|
869
697
|
}
|
|
698
|
+
/** 结束, 汇总结果
|
|
699
|
+
* @param points
|
|
700
|
+
*/
|
|
701
|
+
end(e, t) {
|
|
702
|
+
const n = [];
|
|
703
|
+
for (let o = 0; o < t.length; o += 2)
|
|
704
|
+
n.push(new B(A.from(t[o]), A.from(t[o + 1])));
|
|
705
|
+
e(n);
|
|
706
|
+
}
|
|
870
707
|
/** 执行完成
|
|
871
708
|
*/
|
|
872
|
-
completed(
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
709
|
+
completed(e) {
|
|
710
|
+
this.renderManager.addLines(e), this.renderManager.draw();
|
|
711
|
+
}
|
|
712
|
+
/** 回滚操作
|
|
713
|
+
* @param data
|
|
714
|
+
*/
|
|
715
|
+
rollback(e) {
|
|
716
|
+
return e.forEach((t) => this.renderManager.removeLine(t)), this.renderManager.draw(), e;
|
|
717
|
+
}
|
|
718
|
+
/** 撤回回滚
|
|
719
|
+
* @param lines
|
|
720
|
+
* @returns
|
|
721
|
+
*/
|
|
722
|
+
revokeRollback(e) {
|
|
723
|
+
return this.completed(e), e;
|
|
879
724
|
}
|
|
880
725
|
}
|
|
881
|
-
class
|
|
726
|
+
class _e extends O {
|
|
882
727
|
static name = "Default";
|
|
883
|
-
|
|
884
|
-
return this.parent?.findComponentByName("Editor");
|
|
885
|
-
}
|
|
886
|
-
renderer;
|
|
887
|
-
container = new THREE.Group();
|
|
728
|
+
container = new m.Group();
|
|
888
729
|
onAddFromParent() {
|
|
889
|
-
const
|
|
890
|
-
this.
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
commandManager.addEventListener("startedBefore", (e) => {
|
|
894
|
-
if (e.currentName === "default" && e.name !== "default") commandManager.cancel();
|
|
895
|
-
});
|
|
896
|
-
commandManager.addEventListener("finally", (e) => e.name !== "default" && commandManager.start("default"));
|
|
897
|
-
editor.eventInput.addCancelDefaultBehavior(() => editor.eventInput.isOnlyKeyDowns(["control", "g"]));
|
|
730
|
+
const e = this.editor, t = e.commandManager;
|
|
731
|
+
e.container.add(this.container), t.addCommandFlow("default").add(this.start.bind(this)).addEventListener("finally", this.finally.bind(this)), t.addEventListener("startedBefore", (n) => {
|
|
732
|
+
n.currentName === "default" && n.name !== "default" && t.cancel();
|
|
733
|
+
}), t.addEventListener("finally", (n) => n.name !== "default" && t.start("default")), e.eventInput.addCancelDefaultBehavior(() => e.eventInput.isOnlyKeyDowns(["control", "g"]));
|
|
898
734
|
}
|
|
899
735
|
selectLines = [];
|
|
900
|
-
selectLineObject3D = new
|
|
736
|
+
selectLineObject3D = new m.Mesh();
|
|
901
737
|
/** 添加选择的线段
|
|
902
738
|
* @param lineSegment
|
|
903
739
|
*/
|
|
904
|
-
addSelectLine(
|
|
905
|
-
|
|
906
|
-
this.selectLines.push(lineSegment);
|
|
907
|
-
this.updateSelectLinesGeometry();
|
|
908
|
-
this.dispatchEvent({
|
|
740
|
+
addSelectLine(e) {
|
|
741
|
+
this.selectLines.indexOf(e) > -1 || (this.selectLines.push(e), this.updateSelectLinesGeometry(), this.dispatchEvent({
|
|
909
742
|
type: "selectLineChange"
|
|
910
|
-
});
|
|
743
|
+
}));
|
|
911
744
|
}
|
|
912
745
|
/** 移除选择的线段
|
|
913
746
|
* @param lineSegment
|
|
914
747
|
*/
|
|
915
|
-
removeSelectLine(
|
|
916
|
-
const
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
this.dispatchEvent({
|
|
921
|
-
type: "selectLineChange"
|
|
922
|
-
});
|
|
923
|
-
}
|
|
748
|
+
removeSelectLine(e) {
|
|
749
|
+
const t = this.selectLines.indexOf(e);
|
|
750
|
+
t > -1 && (this.selectLines.splice(t, 1), this.updateSelectLinesGeometry(), this.dispatchEvent({
|
|
751
|
+
type: "selectLineChange"
|
|
752
|
+
}));
|
|
924
753
|
}
|
|
925
754
|
/**
|
|
926
755
|
* 移除所有选中线段
|
|
927
756
|
*/
|
|
928
757
|
removeSelectLineAll() {
|
|
929
|
-
this.selectLines.length = 0
|
|
930
|
-
this.dispatchEvent({
|
|
758
|
+
this.selectLines.length = 0, this.dispatchEvent({
|
|
931
759
|
type: "selectLineChange"
|
|
932
760
|
});
|
|
933
761
|
}
|
|
934
|
-
/**
|
|
935
|
-
* 删除选择的线段
|
|
936
|
-
*/
|
|
937
|
-
deleteSelectLine() {
|
|
938
|
-
const editor = this.editor;
|
|
939
|
-
this.selectLines.forEach((line2) => editor.renderManager.removeLine(line2));
|
|
940
|
-
this.removeSelectLineAll();
|
|
941
|
-
this.updateSelectLinesGeometry();
|
|
942
|
-
ElMessage({ message: "删除成功", type: "success" });
|
|
943
|
-
}
|
|
944
|
-
/**
|
|
945
|
-
* 删除选择线段上的窗户
|
|
946
|
-
*/
|
|
947
|
-
deleteSelectWindow() {
|
|
948
|
-
let is = false;
|
|
949
|
-
this.selectLines.forEach((line2) => {
|
|
950
|
-
if (!line2.userData.isWindow) return;
|
|
951
|
-
line2.userData = {};
|
|
952
|
-
is = true;
|
|
953
|
-
});
|
|
954
|
-
this.editor.renderManager.draw();
|
|
955
|
-
is && ElMessage({ message: "删除窗户成功", type: "success" });
|
|
956
|
-
}
|
|
957
|
-
/**
|
|
958
|
-
* 如果只选择两个线段,可为两个未链接的点创建连接
|
|
959
|
-
*/
|
|
960
|
-
connection() {
|
|
961
|
-
if (this.selectLines.length !== 2) {
|
|
962
|
-
ElMessage({ message: "连接失败,请选择两个线段", type: "warning" });
|
|
963
|
-
return;
|
|
964
|
-
}
|
|
965
|
-
const editor = this.editor;
|
|
966
|
-
let start, end, diatance = Infinity;
|
|
967
|
-
for (let i = 0; i < 2; i++)
|
|
968
|
-
for (let j = 0; j < 2; j++) {
|
|
969
|
-
const point1 = this.selectLines[0].points[i];
|
|
970
|
-
const point2 = this.selectLines[1].points[j];
|
|
971
|
-
const d = point1.distance(point2);
|
|
972
|
-
if (d < diatance) {
|
|
973
|
-
start = point1;
|
|
974
|
-
end = point2;
|
|
975
|
-
diatance = d;
|
|
976
|
-
}
|
|
977
|
-
}
|
|
978
|
-
if (start && end) {
|
|
979
|
-
const line2 = new LineSegment(start.clone(), end.clone());
|
|
980
|
-
editor.renderManager.addLine(line2);
|
|
981
|
-
editor.renderManager.draw();
|
|
982
|
-
ElMessage({ message: "连接成功", type: "success" });
|
|
983
|
-
}
|
|
984
|
-
}
|
|
985
|
-
/**
|
|
986
|
-
* 如果只选择两个线段,可为两个未链接的点创建连接, 通过计算交点,线段延长到交点
|
|
987
|
-
*/
|
|
988
|
-
intersectionConnection() {
|
|
989
|
-
if (this.selectLines.length !== 2) {
|
|
990
|
-
ElMessage({ message: "连接失败,请选择两个线段", type: "warning" });
|
|
991
|
-
return;
|
|
992
|
-
}
|
|
993
|
-
const editor = this.editor, line1 = this.selectLines[0], line2 = this.selectLines[1], point = this.selectLines[0].getIntersection(this.selectLines[1]);
|
|
994
|
-
if (!point) return;
|
|
995
|
-
editor.renderManager.removeLine(line1);
|
|
996
|
-
editor.renderManager.removeLine(line2);
|
|
997
|
-
if (line1.start.distance(point) < line1.end.distance(point)) {
|
|
998
|
-
line1.start.copy(point);
|
|
999
|
-
} else {
|
|
1000
|
-
line1.end.copy(point);
|
|
1001
|
-
}
|
|
1002
|
-
if (line2.start.distance(point) < line2.end.distance(point)) {
|
|
1003
|
-
line2.start.copy(point);
|
|
1004
|
-
} else {
|
|
1005
|
-
line2.end.copy(point);
|
|
1006
|
-
}
|
|
1007
|
-
editor.renderManager.addLines([line1, line2]);
|
|
1008
|
-
editor.renderManager.draw();
|
|
1009
|
-
ElMessage({ message: "连接成功", type: "success" });
|
|
1010
|
-
}
|
|
1011
|
-
/**
|
|
1012
|
-
* 如果只选择两个线段, 且两个线段在一条路径上,合并线段
|
|
1013
|
-
*/
|
|
1014
|
-
mergeLine() {
|
|
1015
|
-
if (this.selectLines.length !== 2) {
|
|
1016
|
-
ElMessage({ message: "未执行线段合并,请选择两条线段", type: "warning" });
|
|
1017
|
-
return;
|
|
1018
|
-
}
|
|
1019
|
-
const editor = this.editor, line1 = this.selectLines[0], line2 = this.selectLines[1];
|
|
1020
|
-
for (let i = 0; i < line1.points.length; i++) {
|
|
1021
|
-
const p1 = line1.points[i];
|
|
1022
|
-
for (let j = 0; j < line2.points.length; j++) {
|
|
1023
|
-
const p2 = line2.points[j];
|
|
1024
|
-
if (p1.equal(p2)) {
|
|
1025
|
-
const p1Next = line1.points[(i + 1) % 2];
|
|
1026
|
-
const p2Next = line2.points[(j + 1) % 2];
|
|
1027
|
-
editor.renderManager.removeLine(line1);
|
|
1028
|
-
editor.renderManager.removeLine(line2);
|
|
1029
|
-
const line3 = new LineSegment(p1Next, p2Next);
|
|
1030
|
-
editor.renderManager.addLine(line3);
|
|
1031
|
-
editor.renderManager.draw();
|
|
1032
|
-
ElMessage({ message: "已合并", type: "success" });
|
|
1033
|
-
return;
|
|
1034
|
-
}
|
|
1035
|
-
}
|
|
1036
|
-
}
|
|
1037
|
-
ElMessage({ message: "合并失败,两条线未找到共用点", type: "warning" });
|
|
1038
|
-
}
|
|
1039
762
|
_timer = null;
|
|
1040
763
|
/**
|
|
1041
764
|
* 更新选择的线段
|
|
1042
765
|
*/
|
|
1043
766
|
updateSelectLinesGeometry() {
|
|
1044
|
-
|
|
1045
|
-
this._timer = setTimeout(() => {
|
|
767
|
+
this._timer && clearTimeout(this._timer), this._timer = setTimeout(() => {
|
|
1046
768
|
if (this.destroyed) return;
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
const position = this.selectLines.flatMap((line2) => line2.expandToRectangle(0.04, "bothSides").createGeometry());
|
|
1051
|
-
this.selectLineObject3D.geometry = editor.renderManager.createGeometry({ position }, position.length / 3);
|
|
769
|
+
this.selectLines.length ? this.container.add(this.selectLineObject3D) : this.selectLineObject3D.removeFromParent();
|
|
770
|
+
const e = this.editor, t = this.selectLines.flatMap((n) => n.expandToRectangle(0.04, "bothSides").createGeometry());
|
|
771
|
+
this.selectLineObject3D.geometry = e.renderManager.createGeometry({ position: t }, t.length / 3);
|
|
1052
772
|
}, 10);
|
|
1053
773
|
}
|
|
1054
774
|
/**
|
|
@@ -1056,109 +776,74 @@ class Default extends Component {
|
|
|
1056
776
|
* @param next
|
|
1057
777
|
*/
|
|
1058
778
|
start() {
|
|
1059
|
-
const
|
|
1060
|
-
let
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
eventInput.addKeyCombination("connection", ["shift", "l"]);
|
|
1066
|
-
eventInput.addKeyCombination("mergeLine", ["control", "g"]);
|
|
1067
|
-
this.addEventRecord("clear", () => {
|
|
1068
|
-
eventInput.removeKeyCombination("intersectionConnection");
|
|
1069
|
-
eventInput.removeKeyCombination("connection");
|
|
1070
|
-
eventInput.removeKeyCombination("mergeLine");
|
|
1071
|
-
});
|
|
1072
|
-
const showSelectBox = () => {
|
|
1073
|
-
const startPoint = editor.pointerPosition.clone(), endPoint = editor.pointerPosition.clone(), mesh = new THREE.Mesh();
|
|
1074
|
-
this.container.add(mesh);
|
|
1075
|
-
mesh.position.z = 0.05;
|
|
1076
|
-
mesh.material = new THREE.MeshBasicMaterial({
|
|
779
|
+
const e = this.editor, t = e.eventInput, n = new m.Mesh(), o = e.domContainer.domElement;
|
|
780
|
+
let s = null;
|
|
781
|
+
n.position.z = 1e-3, this.selectLineObject3D.position.z = n.position.z + 1e-3, n.material = new m.MeshBasicMaterial({ color: 55561 });
|
|
782
|
+
const a = () => {
|
|
783
|
+
const r = e.pointerPosition.clone(), l = e.pointerPosition.clone(), i = new m.Mesh();
|
|
784
|
+
this.container.add(i), i.position.z = 0.05, i.material = new m.MeshBasicMaterial({
|
|
1077
785
|
color: 16777215,
|
|
1078
|
-
transparent:
|
|
786
|
+
transparent: !0,
|
|
1079
787
|
opacity: 0.5
|
|
1080
788
|
});
|
|
1081
|
-
const
|
|
1082
|
-
const
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
maxY,
|
|
789
|
+
const c = () => {
|
|
790
|
+
const u = Math.min(r.x, l.x), p = Math.max(r.x, l.x), g = Math.min(r.y, l.y), E = Math.max(r.y, l.y), C = [
|
|
791
|
+
u,
|
|
792
|
+
E,
|
|
1086
793
|
0,
|
|
1087
|
-
|
|
1088
|
-
|
|
794
|
+
p,
|
|
795
|
+
g,
|
|
1089
796
|
0,
|
|
1090
|
-
|
|
1091
|
-
|
|
797
|
+
p,
|
|
798
|
+
E,
|
|
1092
799
|
0,
|
|
1093
|
-
|
|
1094
|
-
|
|
800
|
+
u,
|
|
801
|
+
E,
|
|
1095
802
|
0,
|
|
1096
|
-
|
|
1097
|
-
|
|
803
|
+
u,
|
|
804
|
+
g,
|
|
1098
805
|
0,
|
|
1099
|
-
|
|
1100
|
-
|
|
806
|
+
p,
|
|
807
|
+
g,
|
|
1101
808
|
0
|
|
1102
809
|
];
|
|
1103
|
-
|
|
1104
|
-
}
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
810
|
+
i.geometry = e.renderManager.createGeometry({ position: C }, C.length / 3);
|
|
811
|
+
}, h = () => {
|
|
812
|
+
l.copy(e.pointerPosition), c();
|
|
813
|
+
}, f = () => {
|
|
814
|
+
document.removeEventListener("mousemove", h), document.removeEventListener("mouseup", f), i.removeFromParent();
|
|
815
|
+
const u = Math.min(r.x, l.x), p = Math.max(r.x, l.x), g = Math.min(r.y, l.y), E = Math.max(r.y, l.y), C = new Ye(u, p, g, E), D = e.renderManager.quadtree.queryBox(C);
|
|
816
|
+
this.removeSelectLineAll(), D.forEach((F) => this.addSelectLine(F.line)), this.updateSelectLinesGeometry();
|
|
1108
817
|
};
|
|
1109
|
-
|
|
1110
|
-
document.removeEventListener("mousemove", move);
|
|
1111
|
-
document.removeEventListener("mouseup", end);
|
|
1112
|
-
mesh.removeFromParent();
|
|
1113
|
-
const minX = Math.min(startPoint.x, endPoint.x), maxX = Math.max(startPoint.x, endPoint.x), minY = Math.min(startPoint.y, endPoint.y), maxY = Math.max(startPoint.y, endPoint.y);
|
|
1114
|
-
const box = new Box2(minX, maxX, minY, maxY);
|
|
1115
|
-
const resultList = editor.renderManager.quadtree.queryBox(box);
|
|
1116
|
-
this.removeSelectLineAll();
|
|
1117
|
-
resultList.forEach((result) => this.addSelectLine(result.line));
|
|
1118
|
-
this.updateSelectLinesGeometry();
|
|
1119
|
-
};
|
|
1120
|
-
document.addEventListener("mousemove", move);
|
|
1121
|
-
document.addEventListener("mouseup", end);
|
|
818
|
+
document.addEventListener("mousemove", h), document.addEventListener("mouseup", f);
|
|
1122
819
|
};
|
|
1123
820
|
this.addEventRecord(
|
|
1124
821
|
"clear",
|
|
1125
822
|
// 注册鼠标指针位置变化事件
|
|
1126
|
-
|
|
1127
|
-
const { line:
|
|
1128
|
-
if (
|
|
1129
|
-
const
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
currentSelectLine = line2;
|
|
1134
|
-
} else {
|
|
1135
|
-
object3D.removeFromParent();
|
|
1136
|
-
dom.style.cursor = "default";
|
|
1137
|
-
currentSelectLine = null;
|
|
1138
|
-
}
|
|
823
|
+
e.addEventListener("pointerPositionChange", () => {
|
|
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), o.style.cursor = "pointer", s = r;
|
|
828
|
+
} else
|
|
829
|
+
n.removeFromParent(), o.style.cursor = "default", s = null;
|
|
1139
830
|
}),
|
|
1140
|
-
|
|
1141
|
-
if (
|
|
1142
|
-
if (!
|
|
1143
|
-
if (
|
|
1144
|
-
return this.removeSelectLine(
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
this.
|
|
1152
|
-
} else
|
|
1153
|
-
this.connection();
|
|
1154
|
-
} else if (eventInput.isKeyCombination("intersectionConnection")) {
|
|
1155
|
-
this.intersectionConnection();
|
|
1156
|
-
} else if (eventInput.isKeyCombination("mergeLine")) {
|
|
1157
|
-
this.mergeLine();
|
|
1158
|
-
}
|
|
831
|
+
t.addEventListener("codeChange", () => {
|
|
832
|
+
if (t.isKeyDown("mouse_0")) {
|
|
833
|
+
if (!s) return a();
|
|
834
|
+
if (t.isKeyDown("alt"))
|
|
835
|
+
return this.removeSelectLine(s);
|
|
836
|
+
t.isKeyDown("control") || this.removeSelectLineAll(), this.addSelectLine(s);
|
|
837
|
+
} else if (t.isKeyDown("mouse_1")) {
|
|
838
|
+
if (!s) return;
|
|
839
|
+
this.removeSelectLine(s);
|
|
840
|
+
} else if (t.isKeyDown("mouse_2")) {
|
|
841
|
+
if (!s) return;
|
|
842
|
+
this.addSelectLine(s);
|
|
843
|
+
} else t.isKeyDowns(["control", "z"]) ? e.commandManager.rollback() : t.isKeyDowns(["control", "y"]) && e.commandManager.revokeRollback();
|
|
1159
844
|
}),
|
|
1160
845
|
function() {
|
|
1161
|
-
|
|
846
|
+
n.removeFromParent();
|
|
1162
847
|
}
|
|
1163
848
|
);
|
|
1164
849
|
}
|
|
@@ -1166,32 +851,55 @@ class Default extends Component {
|
|
|
1166
851
|
* 清理
|
|
1167
852
|
*/
|
|
1168
853
|
finally() {
|
|
1169
|
-
this.canceEventRecord("clear");
|
|
1170
|
-
this.removeSelectLineAll();
|
|
1171
|
-
this.updateSelectLinesGeometry();
|
|
854
|
+
this.canceEventRecord("clear"), this.removeSelectLineAll(), this.updateSelectLinesGeometry();
|
|
1172
855
|
}
|
|
1173
856
|
}
|
|
1174
|
-
class
|
|
857
|
+
class fn extends Xe {
|
|
1175
858
|
list = [];
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
859
|
+
rollbacklist = [];
|
|
860
|
+
revokeRollbacklist = [];
|
|
861
|
+
// 是否写入操作记录
|
|
862
|
+
writeOperationList = !0;
|
|
863
|
+
/**
|
|
864
|
+
*
|
|
865
|
+
* @param operation
|
|
866
|
+
* @returns
|
|
867
|
+
*/
|
|
868
|
+
add(e) {
|
|
869
|
+
return this.list.push(e), this;
|
|
870
|
+
}
|
|
871
|
+
/** 添加回滚回调列表
|
|
872
|
+
* @param callBack
|
|
873
|
+
*/
|
|
874
|
+
addRollback(e) {
|
|
875
|
+
return this.rollbacklist.push(e), this;
|
|
876
|
+
}
|
|
877
|
+
/** 添加撤回回滚回调列表
|
|
878
|
+
* @param callBack
|
|
879
|
+
* @returns
|
|
880
|
+
*/
|
|
881
|
+
addRevokeRollback(e) {
|
|
882
|
+
return this.revokeRollbacklist.push(e), this;
|
|
1179
883
|
}
|
|
1180
884
|
}
|
|
1181
|
-
class
|
|
885
|
+
class yn extends Xe {
|
|
1182
886
|
commandFlowMap = /* @__PURE__ */ new Map();
|
|
1183
|
-
lock =
|
|
887
|
+
lock = !1;
|
|
1184
888
|
abortController = null;
|
|
1185
889
|
resolve = null;
|
|
1186
890
|
currentName = null;
|
|
1187
|
-
_disabled =
|
|
1188
|
-
set disabled(
|
|
1189
|
-
this._disabled =
|
|
1190
|
-
if (this._disabled) this.cancel();
|
|
891
|
+
_disabled = !1;
|
|
892
|
+
set disabled(e) {
|
|
893
|
+
this._disabled = e, this._disabled && this.cancel();
|
|
1191
894
|
}
|
|
1192
895
|
get disabled() {
|
|
1193
896
|
return this._disabled;
|
|
1194
897
|
}
|
|
898
|
+
/**
|
|
899
|
+
* 操作记录
|
|
900
|
+
*/
|
|
901
|
+
operationList = [];
|
|
902
|
+
rollbackList = [];
|
|
1195
903
|
constructor() {
|
|
1196
904
|
super();
|
|
1197
905
|
}
|
|
@@ -1199,11 +907,10 @@ class CommandManager extends EventDispatcher {
|
|
|
1199
907
|
* @param name
|
|
1200
908
|
* @returns
|
|
1201
909
|
*/
|
|
1202
|
-
addCommandFlow(
|
|
1203
|
-
if (this.commandFlowMap.has(
|
|
1204
|
-
const
|
|
1205
|
-
this.commandFlowMap.set(
|
|
1206
|
-
return commandFlow;
|
|
910
|
+
addCommandFlow(e) {
|
|
911
|
+
if (this.commandFlowMap.has(e)) throw new Error(`${e} 命令已经存在`);
|
|
912
|
+
const t = new fn();
|
|
913
|
+
return this.commandFlowMap.set(e, t), t;
|
|
1207
914
|
}
|
|
1208
915
|
executionPromise = null;
|
|
1209
916
|
executionResolve = null;
|
|
@@ -1211,118 +918,141 @@ class CommandManager extends EventDispatcher {
|
|
|
1211
918
|
* @param name
|
|
1212
919
|
* @returns
|
|
1213
920
|
*/
|
|
1214
|
-
async start(
|
|
921
|
+
async start(e, t = null, n = 0) {
|
|
1215
922
|
if (this.disabled) throw new Error("命令管理器已禁用,无法启动新的命令流");
|
|
1216
|
-
this.dispatchEvent({
|
|
923
|
+
if (this.dispatchEvent({
|
|
1217
924
|
type: "startedBefore",
|
|
1218
|
-
name,
|
|
925
|
+
name: e,
|
|
1219
926
|
currentName: this.currentName
|
|
1220
|
-
})
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
if (
|
|
1224
|
-
throw new Error(
|
|
1225
|
-
}
|
|
1226
|
-
const commandFlow = this.commandFlowMap.get(name);
|
|
1227
|
-
if (!commandFlow) {
|
|
1228
|
-
throw new Error(`命令流 ${name} 不存在`);
|
|
1229
|
-
}
|
|
1230
|
-
this.lock = true;
|
|
1231
|
-
this.abortController = new AbortController();
|
|
1232
|
-
this.currentName = name;
|
|
1233
|
-
commandFlow.dispatchEvent({ type: "started" });
|
|
1234
|
-
this.dispatchEvent({ type: "started", name });
|
|
927
|
+
}), this.executionPromise && await this.executionPromise, this.executionPromise = null, this.lock)
|
|
928
|
+
throw new Error("命令管理器已被 " + this.currentName + " 命令锁定,无法启动新的命令流,请退出或等待命令执行结束");
|
|
929
|
+
const o = this.commandFlowMap.get(e);
|
|
930
|
+
if (!o)
|
|
931
|
+
throw new Error(`命令流 ${e} 不存在`);
|
|
932
|
+
this.lock = !0, this.abortController = new AbortController(), this.currentName = e, o.dispatchEvent({ type: "started" }), this.dispatchEvent({ type: "started", name: e });
|
|
1235
933
|
try {
|
|
1236
|
-
for (let
|
|
1237
|
-
const
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
this.
|
|
1242
|
-
operation(resolve, data);
|
|
1243
|
-
});
|
|
1244
|
-
if (this.abortController.signal.aborted) {
|
|
1245
|
-
commandFlow.dispatchEvent({ type: "executionInterrupt", index: i });
|
|
1246
|
-
this.dispatchEvent({ type: "executionInterrupt", name, index: i });
|
|
1247
|
-
this.dispatchEvent({ type: "cancel", name });
|
|
934
|
+
for (let s = n; s < o.list.length; s++) {
|
|
935
|
+
const a = o.list[s];
|
|
936
|
+
if (o.dispatchEvent({ type: "executing", index: s }), this.dispatchEvent({ type: "executing", name: e, index: s }), t = await new Promise((r) => {
|
|
937
|
+
this.resolve = r, a(r, t);
|
|
938
|
+
}), this.abortController.signal.aborted) {
|
|
939
|
+
o.dispatchEvent({ type: "executionInterrupt", index: s }), this.dispatchEvent({ type: "executionInterrupt", name: e, index: s }), this.dispatchEvent({ type: "cancel", name: e });
|
|
1248
940
|
break;
|
|
1249
|
-
} else
|
|
1250
|
-
|
|
1251
|
-
this.dispatchEvent({ type: "executionCompleted", name, index: i, data });
|
|
1252
|
-
}
|
|
941
|
+
} else
|
|
942
|
+
o.dispatchEvent({ type: "executionCompleted", index: s, data: t }), this.dispatchEvent({ type: "executionCompleted", name: e, index: s, data: t });
|
|
1253
943
|
}
|
|
1254
|
-
} catch (
|
|
1255
|
-
console.error(
|
|
944
|
+
} catch (s) {
|
|
945
|
+
console.error(s);
|
|
1256
946
|
} finally {
|
|
1257
|
-
|
|
1258
|
-
commandFlow.dispatchEvent({ type: "completed", data });
|
|
1259
|
-
this.dispatchEvent({ type: "completed", name, data });
|
|
1260
|
-
}
|
|
1261
|
-
this.lock = false;
|
|
1262
|
-
this.abortController = null;
|
|
1263
|
-
this.currentName = null;
|
|
1264
|
-
commandFlow.dispatchEvent({ type: "finally" });
|
|
1265
|
-
this.dispatchEvent({ type: "finally", name });
|
|
1266
|
-
if (this.executionResolve) {
|
|
1267
|
-
this.executionResolve(null);
|
|
1268
|
-
this.executionResolve = null;
|
|
1269
|
-
}
|
|
947
|
+
this.abortController && !this.abortController.signal.aborted && (o.dispatchEvent({ type: "completed", data: t }), this.dispatchEvent({ type: "completed", name: e, data: t }), o.writeOperationList && (this.operationList.push({ name: e, data: t }), this.rollbackList.length = 0)), this.lock = !1, this.abortController = null, this.currentName = null, o.dispatchEvent({ type: "finally" }), this.dispatchEvent({ type: "finally", name: e }), this.executionResolve && (this.executionResolve(null), this.executionResolve = null);
|
|
1270
948
|
}
|
|
1271
|
-
return
|
|
949
|
+
return t;
|
|
1272
950
|
}
|
|
1273
951
|
/** 取消当前命令
|
|
1274
952
|
*/
|
|
1275
953
|
cancel() {
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
954
|
+
this.abortController && (this.abortController.abort(), this.resolve && this.resolve(), this.executionPromise = new Promise((e) => this.executionResolve = e));
|
|
955
|
+
}
|
|
956
|
+
/**
|
|
957
|
+
* 回滚
|
|
958
|
+
*/
|
|
959
|
+
rollback() {
|
|
960
|
+
try {
|
|
961
|
+
const e = this.operationList.pop();
|
|
962
|
+
if (!e) return !1;
|
|
963
|
+
const t = this.commandFlowMap.get(e.name);
|
|
964
|
+
if (!t) return !1;
|
|
965
|
+
const n = t.rollbacklist.reduce((o, s) => s(o), e.data);
|
|
966
|
+
return this.dispatchEvent({ type: "rollback", name: e.name }), this.rollbackList.push({
|
|
967
|
+
data: n,
|
|
968
|
+
name: e.name
|
|
969
|
+
}), !0;
|
|
970
|
+
} catch (e) {
|
|
971
|
+
throw new Error(`回滚失败:${e}`);
|
|
972
|
+
}
|
|
973
|
+
}
|
|
974
|
+
/**
|
|
975
|
+
* 撤销回滚
|
|
976
|
+
*/
|
|
977
|
+
revokeRollback() {
|
|
978
|
+
try {
|
|
979
|
+
const e = this.rollbackList.pop();
|
|
980
|
+
if (!e) return !1;
|
|
981
|
+
const t = this.commandFlowMap.get(e.name);
|
|
982
|
+
if (!t) return !1;
|
|
983
|
+
const n = t.revokeRollbacklist.reduce((o, s) => s(o), e.data);
|
|
984
|
+
return this.dispatchEvent({ type: "revokeRollback", name: e.name }), this.operationList.push({ name: e.name, data: n }), !0;
|
|
985
|
+
} catch (e) {
|
|
986
|
+
throw new Error(`撤回回滚失败:${e}`);
|
|
1280
987
|
}
|
|
1281
988
|
}
|
|
1282
989
|
}
|
|
1283
|
-
const
|
|
1284
|
-
|
|
990
|
+
const wn = "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", bn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
991
|
+
__proto__: null,
|
|
992
|
+
default: wn
|
|
993
|
+
}, Symbol.toStringTag, { value: "Module" })), Cn = "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", xn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
994
|
+
__proto__: null,
|
|
995
|
+
default: Cn
|
|
996
|
+
}, 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({
|
|
997
|
+
__proto__: null,
|
|
998
|
+
default: En
|
|
999
|
+
}, 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='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({
|
|
1000
|
+
__proto__: null,
|
|
1001
|
+
default: Ln
|
|
1002
|
+
}, Symbol.toStringTag, { value: "Module" })), In = "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", Pn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1003
|
+
__proto__: null,
|
|
1004
|
+
default: In
|
|
1005
|
+
}, Symbol.toStringTag, { value: "Module" })), Dn = "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", Sn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1006
|
+
__proto__: null,
|
|
1007
|
+
default: Dn
|
|
1008
|
+
}, Symbol.toStringTag, { value: "Module" })), An = "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", _n = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1009
|
+
__proto__: null,
|
|
1010
|
+
default: An
|
|
1011
|
+
}, Symbol.toStringTag, { value: "Module" })), Bn = "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", Nn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1285
1012
|
__proto__: null,
|
|
1286
|
-
default:
|
|
1287
|
-
}, Symbol.toStringTag, { value: "Module" }))
|
|
1288
|
-
const line = "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";
|
|
1289
|
-
const __vite_glob_0_1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1013
|
+
default: Bn
|
|
1014
|
+
}, Symbol.toStringTag, { value: "Module" })), Rn = "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", On = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1290
1015
|
__proto__: null,
|
|
1291
|
-
default:
|
|
1292
|
-
}, Symbol.toStringTag, { value: "Module" }))
|
|
1293
|
-
const selectPoint = "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";
|
|
1294
|
-
const __vite_glob_0_2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1016
|
+
default: Rn
|
|
1017
|
+
}, Symbol.toStringTag, { value: "Module" })), Fn = "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", Kn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1295
1018
|
__proto__: null,
|
|
1296
|
-
default:
|
|
1297
|
-
}, Symbol.toStringTag, { value: "Module" }))
|
|
1298
|
-
const window$1 = "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";
|
|
1299
|
-
const __vite_glob_0_3 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1019
|
+
default: Fn
|
|
1020
|
+
}, Symbol.toStringTag, { value: "Module" })), zn = "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", Tn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1300
1021
|
__proto__: null,
|
|
1301
|
-
default:
|
|
1302
|
-
}, Symbol.toStringTag, { value: "Module" }))
|
|
1303
|
-
|
|
1022
|
+
default: zn
|
|
1023
|
+
}, 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='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", Vn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1024
|
+
__proto__: null,
|
|
1025
|
+
default: jn
|
|
1026
|
+
}, 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%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", Qn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1027
|
+
__proto__: null,
|
|
1028
|
+
default: Gn
|
|
1029
|
+
}, 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='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", Wn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1030
|
+
__proto__: null,
|
|
1031
|
+
default: Hn
|
|
1032
|
+
}, Symbol.toStringTag, { value: "Module" })), Un = "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", Jn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1033
|
+
__proto__: null,
|
|
1034
|
+
default: Un
|
|
1035
|
+
}, 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='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", Zn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1036
|
+
__proto__: null,
|
|
1037
|
+
default: qn
|
|
1038
|
+
}, Symbol.toStringTag, { value: "Module" })), Yn = "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==", Xn = new m.TextureLoader(), $n = Xn.load(Yn);
|
|
1039
|
+
class eo extends Se {
|
|
1304
1040
|
static name = "RenderManager";
|
|
1305
|
-
container = new
|
|
1041
|
+
container = new m.Group();
|
|
1306
1042
|
lines = [];
|
|
1307
|
-
pointVirtualGrid = new
|
|
1308
|
-
quadtree = new
|
|
1043
|
+
pointVirtualGrid = new Ke();
|
|
1044
|
+
quadtree = new ze(new Ye());
|
|
1309
1045
|
actionHistory = /* @__PURE__ */ new Set();
|
|
1046
|
+
verticalReferenceLineFlag = new m.Mesh(new m.PlaneGeometry(0.3, 0.3), new m.MeshBasicMaterial({ map: $n, color: 58111, transparent: !0 }));
|
|
1310
1047
|
onAddFromParent() {
|
|
1311
|
-
const
|
|
1312
|
-
this.editor.container.add(this.container)
|
|
1313
|
-
|
|
1314
|
-
dxfLineModel.dxfLineModel.material = new THREE.LineBasicMaterial({
|
|
1315
|
-
transparent: true,
|
|
1048
|
+
const e = this.dxfLineModel;
|
|
1049
|
+
this.editor.container.add(this.container), this.editor.container.add(e.dxfModelGroup), e.dxfLineModel.material = new m.LineBasicMaterial({
|
|
1050
|
+
transparent: !0,
|
|
1316
1051
|
opacity: 0.5,
|
|
1317
1052
|
color: 16777215
|
|
1318
|
-
})
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
dxfLineModel.dxfDoorsLineModel.visible = false;
|
|
1322
|
-
});
|
|
1323
|
-
this.variable.addEventListener("dxfVisible", (e) => dxfLineModel.dxfModelGroup.visible = e.value);
|
|
1324
|
-
this.dxf.addEventListener("createGroup", () => this.reset());
|
|
1325
|
-
this.reset();
|
|
1053
|
+
}), e.addEventListener("modelUpdate", (t) => {
|
|
1054
|
+
t.model.position.z = 0, e.dxfDoorsLineModel.visible = !1;
|
|
1055
|
+
}), this.variable.addEventListener("dxfVisible", (t) => e.dxfModelGroup.visible = t.value), this.dxf.addEventListener("createGroup", () => this.reset()), this.reset();
|
|
1326
1056
|
}
|
|
1327
1057
|
updatedMode = null;
|
|
1328
1058
|
/** 重新设置数据
|
|
@@ -1331,183 +1061,149 @@ class RenderManager extends Component {
|
|
|
1331
1061
|
if (this.updatedMode === "self") {
|
|
1332
1062
|
this.updatedMode = null;
|
|
1333
1063
|
return;
|
|
1334
|
-
} else
|
|
1064
|
+
} else
|
|
1335
1065
|
this.updatedMode = "dxf";
|
|
1336
|
-
|
|
1337
|
-
this.
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
this.
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
this.
|
|
1347
|
-
const door2 = line2.clone();
|
|
1348
|
-
door2.userData = {
|
|
1349
|
-
isDoor: true,
|
|
1350
|
-
doorDirectConnection: true
|
|
1351
|
-
};
|
|
1352
|
-
this.addLine(door2);
|
|
1353
|
-
});
|
|
1354
|
-
this.draw();
|
|
1066
|
+
this.pointVirtualGrid = new Ke();
|
|
1067
|
+
const e = this.dxf.box.clone().expansion(Math.max(this.dxf.box.width, this.dxf.box.height) * 2);
|
|
1068
|
+
(e.width === 0 || e.height === 0) && e.set(-200, -200, 200, 200), this.quadtree = new ze(e), this.lines.length = 0, this.dxf.lineSegments.forEach((t) => {
|
|
1069
|
+
t.userData.isDoor || this.addLine(t.clone());
|
|
1070
|
+
}), this.dxf.doorLineSegment.forEach((t) => {
|
|
1071
|
+
const n = t.clone();
|
|
1072
|
+
n.userData = {
|
|
1073
|
+
isDoor: !0,
|
|
1074
|
+
doorDirectConnection: !0
|
|
1075
|
+
}, this.addLine(n);
|
|
1076
|
+
}), this.draw();
|
|
1355
1077
|
}
|
|
1356
1078
|
/** 添加线段
|
|
1357
1079
|
* @param line
|
|
1358
1080
|
*/
|
|
1359
|
-
addLine(
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
this.pointVirtualGrid.insert(line2.end, line2);
|
|
1364
|
-
const quadtreeNode = {
|
|
1365
|
-
line: line2,
|
|
1081
|
+
addLine(e) {
|
|
1082
|
+
e.userData || (e.userData = {}), this.lines.push(e), this.pointVirtualGrid.insert(e.start, e), this.pointVirtualGrid.insert(e.end, e);
|
|
1083
|
+
const t = {
|
|
1084
|
+
line: e,
|
|
1366
1085
|
userData: void 0
|
|
1367
1086
|
};
|
|
1368
|
-
|
|
1369
|
-
this.quadtree.insert(quadtreeNode);
|
|
1370
|
-
this.actionHistory.add({
|
|
1087
|
+
e.userData.quadtreeNode = t, this.quadtree.insert(t), this.actionHistory.add({
|
|
1371
1088
|
type: "addLine",
|
|
1372
|
-
data: [
|
|
1089
|
+
data: [e]
|
|
1373
1090
|
});
|
|
1374
1091
|
}
|
|
1375
1092
|
/**
|
|
1376
1093
|
* 批量添加
|
|
1377
1094
|
* @param lines
|
|
1378
1095
|
*/
|
|
1379
|
-
addLines(
|
|
1380
|
-
for (let
|
|
1381
|
-
const
|
|
1382
|
-
this.lines.push(
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
const quadtreeNode = {
|
|
1386
|
-
line: line2,
|
|
1096
|
+
addLines(e) {
|
|
1097
|
+
for (let t = 0; t < e.length; t++) {
|
|
1098
|
+
const n = e[t];
|
|
1099
|
+
this.lines.push(n), this.pointVirtualGrid.insert(n.start, n), this.pointVirtualGrid.insert(n.end, n);
|
|
1100
|
+
const o = {
|
|
1101
|
+
line: n,
|
|
1387
1102
|
userData: void 0
|
|
1388
1103
|
};
|
|
1389
|
-
|
|
1390
|
-
this.quadtree.insert(quadtreeNode);
|
|
1104
|
+
n.userData.quadtreeNode = o, this.quadtree.insert(o);
|
|
1391
1105
|
}
|
|
1392
1106
|
this.actionHistory.add({
|
|
1393
1107
|
type: "addLine",
|
|
1394
|
-
data: [...
|
|
1108
|
+
data: [...e]
|
|
1395
1109
|
});
|
|
1396
1110
|
}
|
|
1397
1111
|
/** 移除线段
|
|
1398
1112
|
* @param line
|
|
1399
1113
|
*/
|
|
1400
|
-
removeLine(
|
|
1401
|
-
|
|
1402
|
-
this.
|
|
1403
|
-
this.
|
|
1404
|
-
const index = this.lines.indexOf(line2);
|
|
1405
|
-
this.lines.splice(index, 1);
|
|
1406
|
-
this.draw();
|
|
1407
|
-
this.actionHistory.add({
|
|
1114
|
+
removeLine(e) {
|
|
1115
|
+
e.userData.quadtreeNode && this.quadtree.remove(e.userData.quadtreeNode), this.pointVirtualGrid.remove(e.start), this.pointVirtualGrid.remove(e.end);
|
|
1116
|
+
const t = this.lines.indexOf(e);
|
|
1117
|
+
this.lines.splice(t, 1), this.draw(), this.actionHistory.add({
|
|
1408
1118
|
type: "removeLine",
|
|
1409
|
-
data: [
|
|
1119
|
+
data: [e]
|
|
1410
1120
|
});
|
|
1411
1121
|
}
|
|
1412
1122
|
/**
|
|
1413
1123
|
* 绘制
|
|
1414
1124
|
*/
|
|
1415
|
-
draw(
|
|
1125
|
+
draw(e = !0) {
|
|
1416
1126
|
this.container.clear();
|
|
1417
|
-
const
|
|
1418
|
-
this.lines.forEach((
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
windowPosition.push(end.x, end.y, 1e-3);
|
|
1428
|
-
});
|
|
1127
|
+
const t = [], n = [], o = [];
|
|
1128
|
+
this.lines.forEach((s) => {
|
|
1129
|
+
if (s.points.forEach((a) => {
|
|
1130
|
+
s.userData.isDoor ? n.push(a.x, a.y, 0) : t.push(a.x, a.y, 0);
|
|
1131
|
+
}), s.userData.isWindow && s.userData.drawWindow && s.userData.drawWindow.forEach(({ width: a, p: r }) => {
|
|
1132
|
+
const l = A.from(r), i = s.direction(), c = l.clone().add(i.clone().multiplyScalar(a * 0.5)), h = l.clone().add(i.clone().multiplyScalar(-a * 0.5));
|
|
1133
|
+
o.push(c.x, c.y, 1e-3), o.push(h.x, h.y, 1e-3);
|
|
1134
|
+
}), s.userData.isVerticalReferenceLine) {
|
|
1135
|
+
const a = s.center;
|
|
1136
|
+
this.verticalReferenceLineFlag.position.set(a.x, a.y, 0), this.container.add(this.verticalReferenceLineFlag);
|
|
1429
1137
|
}
|
|
1430
|
-
})
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
}, position.length / 3, {
|
|
1138
|
+
}), t.length && this.renderer.createLineSegments({
|
|
1139
|
+
position: t
|
|
1140
|
+
}, t.length / 3, {
|
|
1434
1141
|
color: 5745151
|
|
1435
|
-
}, this.container)
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
}, doorPosition.length / 3, {
|
|
1142
|
+
}, this.container), n.length && this.renderer.createLineSegments({
|
|
1143
|
+
position: n
|
|
1144
|
+
}, n.length / 3, {
|
|
1439
1145
|
color: 16776960
|
|
1440
|
-
}, this.container)
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
}, windowPosition.length / 3, {
|
|
1146
|
+
}, this.container), o.length && this.renderer.createLineSegments({
|
|
1147
|
+
position: o
|
|
1148
|
+
}, o.length / 3, {
|
|
1444
1149
|
color: 16711935
|
|
1445
|
-
}, this.container);
|
|
1446
|
-
synchronize && this.synchronizeDxf();
|
|
1150
|
+
}, this.container), e && this.synchronizeDxf();
|
|
1447
1151
|
}
|
|
1448
1152
|
/** 获取鼠标当前点, 吸附后的点
|
|
1449
1153
|
* @param point
|
|
1450
1154
|
* @returns
|
|
1451
1155
|
*/
|
|
1452
|
-
adsorption(
|
|
1453
|
-
const
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
find: true,
|
|
1156
|
+
adsorption(e = 0.04, t = this.pointVirtualGrid, n = this.quadtree) {
|
|
1157
|
+
const o = this.parent?.findComponentByName("Editor"), s = A.from(o.pointerPosition), a = t.queryCircle(s, e).sort((l, i) => l.point.distance(s) - i.point.distance(s));
|
|
1158
|
+
if (a.length) return {
|
|
1159
|
+
point: new m.Vector3(a[0].point.x, a[0].point.y, 0),
|
|
1160
|
+
find: !0,
|
|
1458
1161
|
mode: "point",
|
|
1459
|
-
line:
|
|
1162
|
+
line: a[0].userData
|
|
1460
1163
|
};
|
|
1461
|
-
let
|
|
1462
|
-
if (
|
|
1463
|
-
let
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
});
|
|
1468
|
-
result = result.filter((_, i) => !!projectPoints[i]);
|
|
1469
|
-
projectPoints = projectPoints.filter((_, i) => !!projectPoints[i]);
|
|
1470
|
-
return {
|
|
1471
|
-
point: new THREE.Vector3(projectPoints[0].x, projectPoints[0].y, 0),
|
|
1472
|
-
find: true,
|
|
1164
|
+
let r = n.queryCircle(s, e);
|
|
1165
|
+
if (r.length) {
|
|
1166
|
+
let l = r.map((i) => i.line.projectPoint(s));
|
|
1167
|
+
return l.sort((i, c) => i && c ? i.distance(s) - c.distance(s) : 0), r = r.filter((i, c) => !!l[c]), l = l.filter((i, c) => !!l[c]), {
|
|
1168
|
+
point: new m.Vector3(l[0].x, l[0].y, 0),
|
|
1169
|
+
find: !0,
|
|
1473
1170
|
mode: "line",
|
|
1474
|
-
line:
|
|
1171
|
+
line: r[0].line
|
|
1475
1172
|
};
|
|
1476
1173
|
}
|
|
1477
1174
|
return {
|
|
1478
|
-
point: new
|
|
1479
|
-
find:
|
|
1175
|
+
point: new m.Vector3(o.pointerPosition.x, o.pointerPosition.y, 0),
|
|
1176
|
+
find: !1
|
|
1480
1177
|
};
|
|
1481
1178
|
}
|
|
1482
1179
|
/** 创建几何体
|
|
1483
1180
|
* @param rectangle
|
|
1484
1181
|
*/
|
|
1485
|
-
createGeometry(
|
|
1486
|
-
const
|
|
1487
|
-
Object.keys(
|
|
1488
|
-
|
|
1489
|
-
});
|
|
1490
|
-
return geometry;
|
|
1182
|
+
createGeometry(e, t) {
|
|
1183
|
+
const n = new m.BufferGeometry();
|
|
1184
|
+
return Object.keys(e).forEach((o) => {
|
|
1185
|
+
n.setAttribute("position", new m.BufferAttribute(new Float32Array(e[o]), e[o].length / t));
|
|
1186
|
+
}), n;
|
|
1491
1187
|
}
|
|
1492
1188
|
/**
|
|
1493
1189
|
* 转为json
|
|
1494
1190
|
*/
|
|
1495
1191
|
toJson() {
|
|
1496
|
-
return this.lines.map((
|
|
1497
|
-
const userData =
|
|
1498
|
-
const drawDoorData = userData.drawDoorData;
|
|
1499
|
-
const insetionArr = this.quadtree.queryLineSegment(line2).filter((r) => r.line !== line2 && !r.userData?.isDoor).map((r) => ({ index: this.lines.indexOf(r.line) }));
|
|
1192
|
+
return this.lines.map((e) => {
|
|
1193
|
+
const t = e.userData, n = t.drawWindow, o = this.quadtree.queryLineSegment(e).filter((s) => s.line !== e && !s.userData?.isDoor).map((s) => ({ index: this.lines.indexOf(s.line) }));
|
|
1500
1194
|
return {
|
|
1501
|
-
start:
|
|
1502
|
-
end:
|
|
1503
|
-
insetionArr,
|
|
1504
|
-
isDoor:
|
|
1505
|
-
doorDirectConnection:
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1195
|
+
start: e.start.toJson(this.dxf.originalZAverage),
|
|
1196
|
+
end: e.end.toJson(this.dxf.originalZAverage),
|
|
1197
|
+
insetionArr: o,
|
|
1198
|
+
isDoor: t.isDoor,
|
|
1199
|
+
doorDirectConnection: t.isDoor,
|
|
1200
|
+
length: e.length(),
|
|
1201
|
+
isWindow: t.isWindow,
|
|
1202
|
+
isVerticalReferenceLine: t.isVerticalReferenceLine,
|
|
1203
|
+
drawWindow: n && n.map((s) => ({
|
|
1204
|
+
p: { x: s.p.x, y: s.p.y, z: s.p.z },
|
|
1205
|
+
width: s.width,
|
|
1206
|
+
full: s.full
|
|
1511
1207
|
}))
|
|
1512
1208
|
};
|
|
1513
1209
|
});
|
|
@@ -1521,13 +1217,11 @@ class RenderManager extends Component {
|
|
|
1521
1217
|
this.updatedMode = null;
|
|
1522
1218
|
return;
|
|
1523
1219
|
}
|
|
1524
|
-
|
|
1525
|
-
setTimeout(() => {
|
|
1220
|
+
this._timer && clearTimeout(this._timer), this._timer = setTimeout(() => {
|
|
1526
1221
|
this.updatedMode = "self";
|
|
1527
|
-
const dxf = this.
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
dxf.lineOffset();
|
|
1222
|
+
const e = this.dxf, t = this.toJson();
|
|
1223
|
+
e.set(t).then(() => {
|
|
1224
|
+
e.lineOffset();
|
|
1531
1225
|
});
|
|
1532
1226
|
}, 10);
|
|
1533
1227
|
}
|
|
@@ -1550,625 +1244,1278 @@ class RenderManager extends Component {
|
|
|
1550
1244
|
return this.parent?.findComponentByName("DxfLineModel");
|
|
1551
1245
|
}
|
|
1552
1246
|
}
|
|
1553
|
-
class
|
|
1247
|
+
class to extends O {
|
|
1554
1248
|
static name = "DrawDoorLine";
|
|
1555
|
-
container = new
|
|
1249
|
+
container = new m.Group();
|
|
1556
1250
|
interruptKeys = ["escape"];
|
|
1557
1251
|
shortcutKeys = ["control", "m"];
|
|
1558
1252
|
commandName = "draw-door-line";
|
|
1559
|
-
onAddFromParent(
|
|
1560
|
-
super.onAddFromParent(
|
|
1561
|
-
const
|
|
1253
|
+
onAddFromParent(e) {
|
|
1254
|
+
super.onAddFromParent(e);
|
|
1255
|
+
const t = e.findComponentByName("Editor"), n = t.eventInput, o = t.commandManager;
|
|
1562
1256
|
this.editor.container.add(this.container);
|
|
1563
|
-
const
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
commandFlow.addEventListener("completed", (e) => this.completed(e.data));
|
|
1567
|
-
eventInput.addCancelDefaultBehavior(() => eventInput.isOnlyKeyDowns(this.shortcutKeys));
|
|
1568
|
-
eventInput.addEventListener("codeChange", async () => {
|
|
1569
|
-
eventInput.isKeyCombination(this.commandName) && await commandManager.start(this.commandName);
|
|
1257
|
+
const s = 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));
|
|
1258
|
+
n.addKeyCombination(this.commandName, this.shortcutKeys), s.addEventListener("finally", this.createFinally()), s.addEventListener("completed", (a) => this.completed(a.data)), n.addCancelDefaultBehavior(() => n.isOnlyKeyDowns(this.shortcutKeys)), n.addEventListener("codeChange", async () => {
|
|
1259
|
+
n.isKeyCombination(this.commandName) && await o.start(this.commandName);
|
|
1570
1260
|
});
|
|
1571
1261
|
}
|
|
1572
1262
|
/** 选择点
|
|
1573
1263
|
* @param next
|
|
1574
1264
|
*/
|
|
1575
|
-
selectPoint(
|
|
1576
|
-
let
|
|
1577
|
-
new
|
|
1578
|
-
new
|
|
1579
|
-
new
|
|
1580
|
-
new
|
|
1265
|
+
selectPoint(e) {
|
|
1266
|
+
let t = this.parent?.findComponentByName("Editor"), n = null, o = new m.Mesh(new m.SphereGeometry(0.04), new m.MeshBasicMaterial({ color: 65280 })), s = new fe([], 16711935), a = new fe([
|
|
1267
|
+
new m.Vector3(-1e4, 0, 0),
|
|
1268
|
+
new m.Vector3(1e4, 0, 0),
|
|
1269
|
+
new m.Vector3(0, -1e4, 0),
|
|
1270
|
+
new m.Vector3(0, 1e4, 0)
|
|
1581
1271
|
], 16711935);
|
|
1582
|
-
|
|
1272
|
+
a.material = new m.LineDashedMaterial({
|
|
1583
1273
|
color: 4235007,
|
|
1584
1274
|
dashSize: 0.1,
|
|
1585
1275
|
gapSize: 0.1,
|
|
1586
1276
|
linewidth: 0.1
|
|
1587
|
-
});
|
|
1588
|
-
|
|
1589
|
-
let currentPoint = null;
|
|
1277
|
+
}), this.container.add(s);
|
|
1278
|
+
let r = null;
|
|
1590
1279
|
this.addEventRecord(
|
|
1591
1280
|
"clear",
|
|
1592
|
-
|
|
1593
|
-
const { point, find } =
|
|
1594
|
-
|
|
1595
|
-
if (find) {
|
|
1596
|
-
circle.position.set(point.x, point.y, 0);
|
|
1597
|
-
this.container.add(circle);
|
|
1598
|
-
this.domElement.style.cursor = "none";
|
|
1599
|
-
currentPoint = point.clone();
|
|
1600
|
-
} else {
|
|
1601
|
-
currentPoint = null;
|
|
1602
|
-
circle.removeFromParent();
|
|
1603
|
-
this.domElement.style.cursor = "no-drop";
|
|
1604
|
-
}
|
|
1281
|
+
t.addEventListener("pointerPositionChange", () => {
|
|
1282
|
+
const { point: l, find: i } = t.renderManager.adsorption();
|
|
1283
|
+
n && s.setPoint(n, l), this.dispatchEvent({ type: "pointerMove", point: l }), i ? (o.position.set(l.x, l.y, 0), this.container.add(o), this.domElement.style.cursor = "none", r = l.clone()) : (r = null, o.removeFromParent(), this.domElement.style.cursor = "no-drop");
|
|
1605
1284
|
}),
|
|
1606
|
-
|
|
1607
|
-
if (
|
|
1608
|
-
if (!
|
|
1609
|
-
|
|
1285
|
+
t.eventInput.addEventListener("codeChange", async () => {
|
|
1286
|
+
if (t.eventInput.isKeyDown("mouse_0") && r) {
|
|
1287
|
+
if (!n) {
|
|
1288
|
+
n = r.clone();
|
|
1610
1289
|
return;
|
|
1611
1290
|
}
|
|
1612
|
-
|
|
1291
|
+
e([n.clone(), r.clone()]);
|
|
1613
1292
|
}
|
|
1614
1293
|
}),
|
|
1615
1294
|
function() {
|
|
1616
|
-
|
|
1617
|
-
circle.removeFromParent();
|
|
1618
|
-
auxiliaryLine.removeFromParent();
|
|
1295
|
+
s.removeFromParent(), o.removeFromParent(), a.removeFromParent();
|
|
1619
1296
|
}
|
|
1620
1297
|
);
|
|
1621
1298
|
}
|
|
1622
|
-
/**
|
|
1299
|
+
/**
|
|
1300
|
+
* 结束处理
|
|
1301
|
+
* @param next
|
|
1302
|
+
* @param points
|
|
1623
1303
|
*/
|
|
1624
|
-
|
|
1625
|
-
const
|
|
1626
|
-
for (let
|
|
1627
|
-
const
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1304
|
+
end(e, t) {
|
|
1305
|
+
const n = [];
|
|
1306
|
+
for (let o = 0; o < t.length; o += 2) {
|
|
1307
|
+
const s = A.from(t[o]), a = A.from(t[o + 1]), r = this.renderManager.quadtree.queryCircle(s, 1e-3)[0].line, l = this.renderManager.quadtree.queryCircle(a, 1e-3)[0].line;
|
|
1308
|
+
let i = null;
|
|
1309
|
+
r === l && (i = {
|
|
1310
|
+
oldLine: r,
|
|
1311
|
+
newLine1: new B(
|
|
1312
|
+
r.start,
|
|
1313
|
+
r.start.distance(s) < r.start.distance(a) ? s.clone() : a.clone()
|
|
1314
|
+
),
|
|
1315
|
+
newLine2: new B(
|
|
1316
|
+
r.end,
|
|
1317
|
+
r.end.distance(s) < r.end.distance(a) ? s.clone() : a.clone()
|
|
1318
|
+
)
|
|
1319
|
+
});
|
|
1320
|
+
const c = new B(s, a);
|
|
1321
|
+
c.userData.isDoor = !0, c.userData.doorDirectConnection = !0, n.push({
|
|
1322
|
+
line: c,
|
|
1323
|
+
option: i
|
|
1324
|
+
});
|
|
1631
1325
|
}
|
|
1632
|
-
|
|
1633
|
-
|
|
1326
|
+
e(n);
|
|
1327
|
+
}
|
|
1328
|
+
/** 执行完成
|
|
1329
|
+
*/
|
|
1330
|
+
completed(e) {
|
|
1331
|
+
e.forEach(({ line: t, option: n }) => {
|
|
1332
|
+
this.renderManager.addLine(t), n && (this.renderManager.removeLine(n.oldLine), this.renderManager.addLines([n.newLine1, n.newLine2]));
|
|
1333
|
+
}), this.renderManager.draw();
|
|
1334
|
+
}
|
|
1335
|
+
/** 回滚操作
|
|
1336
|
+
* @param data
|
|
1337
|
+
*/
|
|
1338
|
+
rollback(e) {
|
|
1339
|
+
return e.forEach(({ line: t, option: n }) => {
|
|
1340
|
+
this.renderManager.removeLine(t), n && (this.renderManager.addLine(n.oldLine), this.renderManager.removeLine(n.newLine1), this.renderManager.removeLine(n.newLine2));
|
|
1341
|
+
}), this.renderManager.draw(), e;
|
|
1342
|
+
}
|
|
1343
|
+
/** 撤回回滚
|
|
1344
|
+
* @param data
|
|
1345
|
+
* @returns
|
|
1346
|
+
*/
|
|
1347
|
+
revokeRollback(e) {
|
|
1348
|
+
return this.completed(e), e;
|
|
1634
1349
|
}
|
|
1635
1350
|
}
|
|
1636
|
-
class
|
|
1351
|
+
class no extends O {
|
|
1637
1352
|
static name = "DrawWindow";
|
|
1638
|
-
container = new
|
|
1353
|
+
container = new m.Group();
|
|
1639
1354
|
interruptKeys = ["escape"];
|
|
1640
1355
|
shortcutKeys = ["control", "q"];
|
|
1641
1356
|
commandName = "draw-window-line";
|
|
1642
|
-
onAddFromParent(
|
|
1643
|
-
super.onAddFromParent(
|
|
1644
|
-
this.
|
|
1645
|
-
|
|
1646
|
-
commandFlow.addEventListener("finally", this.createFinally(["selectPointStart"]));
|
|
1647
|
-
commandFlow.addEventListener("completed", (e) => this.completed(e.data));
|
|
1648
|
-
this.eventInput.addKeyCombination(this.commandName, this.shortcutKeys);
|
|
1649
|
-
this.eventInput.addEventListener("codeChange", async () => this.eventInput.isKeyCombination(this.commandName) && await this.commandManager.start(this.commandName));
|
|
1650
|
-
this.eventInput.addCancelDefaultBehavior(() => this.eventInput.isOnlyKeyDowns(this.shortcutKeys));
|
|
1357
|
+
onAddFromParent(e) {
|
|
1358
|
+
super.onAddFromParent(e), this.editor.container.add(this.container);
|
|
1359
|
+
const t = this.commandManager.addCommandFlow(this.commandName).add(this.createInterrupt()).add(this.createCursor("no-drop")).add(this.selectPointStart.bind(this)).add(this.selectPointEnd.bind(this)).add(this.end.bind(this)).addRollback(this.rollback.bind(this)).addRevokeRollback(this.revokeRollback.bind(this));
|
|
1360
|
+
t.addEventListener("finally", this.createFinally(["selectPointStart"])), t.addEventListener("completed", (n) => this.completed(n.data)), this.eventInput.addKeyCombination(this.commandName, this.shortcutKeys), this.eventInput.addEventListener("codeChange", async () => this.eventInput.isKeyCombination(this.commandName) && await this.commandManager.start(this.commandName)), this.eventInput.addCancelDefaultBehavior(() => this.eventInput.isOnlyKeyDowns(this.shortcutKeys));
|
|
1651
1361
|
}
|
|
1652
1362
|
/** 选择开始点
|
|
1653
1363
|
* @param next
|
|
1654
1364
|
*/
|
|
1655
|
-
selectPointStart(
|
|
1656
|
-
let
|
|
1365
|
+
selectPointStart(e) {
|
|
1366
|
+
let t = null, n = new m.Mesh(new m.SphereGeometry(0.04), new m.MeshBasicMaterial({ color: 16711935 })), o = null;
|
|
1657
1367
|
this.addEventRecord("selectPointStart").add(this.editor.addEventListener("pointerPositionChange", () => {
|
|
1658
|
-
const { point, line:
|
|
1659
|
-
|
|
1660
|
-
this.domElement.style.cursor = "none";
|
|
1661
|
-
circle.position.copy(point);
|
|
1662
|
-
currentLine = line2;
|
|
1663
|
-
currentPoint = point.clone();
|
|
1664
|
-
this.container.add(circle);
|
|
1665
|
-
} else {
|
|
1666
|
-
this.domElement.style.cursor = "no-drop";
|
|
1667
|
-
currentPoint = null;
|
|
1668
|
-
circle.removeFromParent();
|
|
1669
|
-
}
|
|
1368
|
+
const { point: s, line: a, find: r } = this.editor.renderManager.adsorption();
|
|
1369
|
+
this.dispatchEvent({ type: "pointerMove", point: s }), r ? (this.domElement.style.cursor = "none", n.position.copy(s), o = a, t = s.clone(), this.container.add(n)) : (this.domElement.style.cursor = "no-drop", t = null, n.removeFromParent());
|
|
1670
1370
|
})).add(this.eventInput.addEventListener("codeChange", () => {
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
next({ point: currentPoint, line: currentLine });
|
|
1674
|
-
}
|
|
1675
|
-
}));
|
|
1676
|
-
this.addEventRecord("clear").add(() => circle.removeFromParent());
|
|
1371
|
+
this.eventInput.isKeyDown("mouse_0") && t && (this.canceEventRecord("selectPointStart"), e({ point: t, line: o }));
|
|
1372
|
+
})), this.addEventRecord("clear").add(() => n.removeFromParent());
|
|
1677
1373
|
}
|
|
1678
1374
|
/** 选择结束点
|
|
1679
1375
|
* @param next
|
|
1680
1376
|
*/
|
|
1681
|
-
selectPointEnd(
|
|
1682
|
-
let
|
|
1683
|
-
this.addEventRecord("clear").add(() =>
|
|
1684
|
-
const { point:
|
|
1685
|
-
|
|
1686
|
-
this.domElement.style.cursor = "none";
|
|
1687
|
-
circle.position.copy(point2);
|
|
1688
|
-
currentPoint = point2.clone();
|
|
1689
|
-
this.container.add(circle);
|
|
1690
|
-
} else {
|
|
1691
|
-
this.domElement.style.cursor = "no-drop";
|
|
1692
|
-
currentPoint = null;
|
|
1693
|
-
circle.removeFromParent();
|
|
1694
|
-
}
|
|
1377
|
+
selectPointEnd(e, { point: t, line: n }) {
|
|
1378
|
+
let o = null, s = new m.Mesh(new m.SphereGeometry(0.04), new m.MeshBasicMaterial({ color: 16711935 }));
|
|
1379
|
+
this.addEventRecord("clear").add(() => s.removeFromParent()).add(this.editor.addEventListener("pointerPositionChange", () => {
|
|
1380
|
+
const { point: a, find: r, line: l } = this.editor.renderManager.adsorption();
|
|
1381
|
+
this.dispatchEvent({ type: "pointerMove", point: a }), r && l === n ? (this.domElement.style.cursor = "none", s.position.copy(a), o = a.clone(), this.container.add(s)) : (this.domElement.style.cursor = "no-drop", o = null, s.removeFromParent());
|
|
1695
1382
|
})).add(this.eventInput.addEventListener("codeChange", () => {
|
|
1696
|
-
|
|
1383
|
+
this.eventInput.isKeyDown("mouse_0") && o && e({ line: n, start: t, end: o });
|
|
1697
1384
|
}));
|
|
1698
1385
|
}
|
|
1386
|
+
/**
|
|
1387
|
+
* 结束处理
|
|
1388
|
+
* @param next
|
|
1389
|
+
* @param points
|
|
1390
|
+
*/
|
|
1391
|
+
end(e, { start: t, end: n, line: o }) {
|
|
1392
|
+
const s = new B(A.from(t), A.from(n)), a = s.center, r = s.length(), l = {
|
|
1393
|
+
p: new m.Vector3(a.x, a.y, 0),
|
|
1394
|
+
width: r,
|
|
1395
|
+
full: Math.abs(r - o.length()) < 0.01
|
|
1396
|
+
};
|
|
1397
|
+
e({ line: o, doorDataItem: l });
|
|
1398
|
+
}
|
|
1699
1399
|
/** 执行完成
|
|
1700
1400
|
*/
|
|
1701
|
-
completed(
|
|
1702
|
-
|
|
1703
|
-
line2.userData.isWindow = true;
|
|
1704
|
-
if (!line2.userData.drawDoorData) line2.userData.drawDoorData = [];
|
|
1705
|
-
line2.userData.drawDoorData.push({
|
|
1706
|
-
p: new THREE.Vector3(center.x, center.y, 0),
|
|
1707
|
-
width: len,
|
|
1708
|
-
full: Math.abs(len - line2.length()) < 0.01
|
|
1709
|
-
});
|
|
1710
|
-
this.renderManager.draw();
|
|
1401
|
+
completed({ doorDataItem: e, line: t }) {
|
|
1402
|
+
t.userData.isWindow = !0, t.userData.drawWindow || (t.userData.drawWindow = []), t.userData.drawWindow.push(e), this.renderManager.draw();
|
|
1711
1403
|
}
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
};
|
|
1717
|
-
|
|
1718
|
-
const
|
|
1719
|
-
|
|
1720
|
-
key: 0,
|
|
1721
|
-
class: "p-[5px] min-w-[140px]"
|
|
1722
|
-
};
|
|
1723
|
-
const _hoisted_5 = { class: "text-[14px] flex flex-col" };
|
|
1724
|
-
const _hoisted_6 = ["onClick"];
|
|
1725
|
-
const _hoisted_7 = { class: "flex flex-row items-center" };
|
|
1726
|
-
const _hoisted_8 = { class: "flex justify-center items-center size-[20px] bg-[#f0f0f0] rounded-[2px] mr-[10px]" };
|
|
1727
|
-
const _hoisted_9 = ["src"];
|
|
1728
|
-
const _hoisted_10 = {
|
|
1729
|
-
key: 1,
|
|
1730
|
-
class: "text-[#999]"
|
|
1731
|
-
};
|
|
1732
|
-
const _hoisted_11 = {
|
|
1733
|
-
style: { "--el-color-primary": "var(--primary-color)" },
|
|
1734
|
-
class: "flex flex-row items-center justify-between gap-[10px] mt-[10px] text-[10px]"
|
|
1735
|
-
};
|
|
1736
|
-
const _hoisted_12 = {
|
|
1737
|
-
key: 0,
|
|
1738
|
-
class: "flex flex-row items-center flex-wrap justify-between gap-[10px] mt-[10px] text-[10px]"
|
|
1739
|
-
};
|
|
1740
|
-
const _hoisted_13 = { class: "border-t-1 border-t-[#eee] mt-[5px] pt-[5px] h-[20px] flex items-center gap-[10px]" };
|
|
1741
|
-
const _hoisted_14 = {
|
|
1742
|
-
key: 1,
|
|
1743
|
-
class: "select-none flex-1 flex justify-center text-[12px] text-[#999]"
|
|
1744
|
-
};
|
|
1745
|
-
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
1746
|
-
__name: "EditorTool",
|
|
1747
|
-
props: {
|
|
1748
|
-
dxfSystem: {},
|
|
1749
|
-
permission: {}
|
|
1750
|
-
},
|
|
1751
|
-
setup(__props) {
|
|
1752
|
-
function setEditorToolPosition(left, top, rect = elRef.value.getBoundingClientRect(), toolBarRect = toolBarRef.value.getBoundingClientRect()) {
|
|
1753
|
-
const minX = 0, maxX = rect.width - toolBarRect.width, minY = 0, maxY = rect.height - toolBarRect.height;
|
|
1754
|
-
left = Math.max(minX, Math.min(left, maxX));
|
|
1755
|
-
top = Math.max(minY, Math.min(top, maxY));
|
|
1756
|
-
toolBarPosition.value = { left, top };
|
|
1404
|
+
/** 回滚操作
|
|
1405
|
+
* @param data
|
|
1406
|
+
*/
|
|
1407
|
+
rollback(e) {
|
|
1408
|
+
const { doorDataItem: t, line: n } = e;
|
|
1409
|
+
if (n.userData.drawWindow) {
|
|
1410
|
+
const o = n.userData.drawWindow.indexOf(t);
|
|
1411
|
+
o !== -1 && (n.userData.drawWindow.splice(o, 1), n.userData.drawWindow.length === 0 && (delete n.userData.drawWindow, delete n.userData.isWindow), this.renderManager.draw());
|
|
1757
1412
|
}
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
1413
|
+
return e;
|
|
1414
|
+
}
|
|
1415
|
+
/** 撤回回滚
|
|
1416
|
+
* @param data
|
|
1417
|
+
* @returns
|
|
1418
|
+
*/
|
|
1419
|
+
revokeRollback(e) {
|
|
1420
|
+
return this.completed(e), e;
|
|
1421
|
+
}
|
|
1422
|
+
}
|
|
1423
|
+
class de extends O {
|
|
1424
|
+
static name = "VerticalCorrection";
|
|
1425
|
+
container = new m.Group();
|
|
1426
|
+
shortcutKeys = ["control", "c"];
|
|
1427
|
+
shortcutKeys2 = ["control", "shift", "c"];
|
|
1428
|
+
static commandName = "verticalCorrection";
|
|
1429
|
+
recursion = !1;
|
|
1430
|
+
onAddFromParent(e) {
|
|
1431
|
+
super.onAddFromParent(e), this.editor.container.add(this.container), this.container.position.z = 1e-3;
|
|
1432
|
+
const t = this.commandManager.addCommandFlow(de.commandName).add(this.createInterrupt()).add(this.constraint.bind(this)).add(this.verticalCorrection.bind(this)).addRollback(this.rollback.bind(this)).addRevokeRollback(this.revokeRollback.bind(this));
|
|
1433
|
+
t.addEventListener("finally", this.createFinally()), t.addEventListener("completed", (n) => this.completed(n.data)), t.addEventListener("started", () => {
|
|
1434
|
+
!this.eventInput.isOnlyKeyDowns(this.shortcutKeys) && !this.eventInput.isOnlyKeyDowns(this.shortcutKeys2) && (this.recursion = !1);
|
|
1435
|
+
}), this.eventInput.addEventListener("codeChange", async () => {
|
|
1436
|
+
this.eventInput.isOnlyKeyDowns(this.shortcutKeys) ? (this.recursion = !1, this.commandManager.start(de.commandName, [...this.default.selectLines])) : this.eventInput.isOnlyKeyDowns(this.shortcutKeys2) && (this.recursion = !0, this.commandManager.start(de.commandName, [...this.default.selectLines]));
|
|
1437
|
+
}), this.eventInput.addCancelDefaultBehavior(() => this.eventInput.isOnlyKeyDowns(this.shortcutKeys) || this.eventInput.isOnlyKeyDowns(this.shortcutKeys2));
|
|
1438
|
+
}
|
|
1439
|
+
/**
|
|
1440
|
+
* 进入命令约束
|
|
1441
|
+
*/
|
|
1442
|
+
constraint(e, t) {
|
|
1443
|
+
Array.isArray(t) ? t.length !== 1 ? (L({ message: "请选择一条线段", type: "warning" }), this.cancel()) : e(t) : (L({ message: "进入命令失败", type: "warning" }), this.cancel());
|
|
1444
|
+
}
|
|
1445
|
+
/**
|
|
1446
|
+
* 线段是否为结尾线段
|
|
1447
|
+
* @param line
|
|
1448
|
+
*/
|
|
1449
|
+
lineIsPathEnd(e) {
|
|
1450
|
+
for (let t = 0; t < e.points.length; t++) {
|
|
1451
|
+
const n = e.points[t];
|
|
1452
|
+
if (this.renderManager.pointVirtualGrid.queryPoint(n).filter((s) => !s.point.equal(n)).length === 0) return !0;
|
|
1761
1453
|
}
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
|
|
1454
|
+
return !1;
|
|
1455
|
+
}
|
|
1456
|
+
/**
|
|
1457
|
+
*
|
|
1458
|
+
* @param line0
|
|
1459
|
+
* @param line1
|
|
1460
|
+
*/
|
|
1461
|
+
isTowLineSegmentConnect(e, t) {
|
|
1462
|
+
return !!(e.start.equal(t.start) || e.start.equal(t.end) || e.end.equal(t.start) || e.end.equal(t.end));
|
|
1463
|
+
}
|
|
1464
|
+
/**
|
|
1465
|
+
*
|
|
1466
|
+
* @param line
|
|
1467
|
+
* @param newStartPoint
|
|
1468
|
+
* @param newEndPoint
|
|
1469
|
+
* @param mode 需要匹配的点
|
|
1470
|
+
* @param record
|
|
1471
|
+
* @param id
|
|
1472
|
+
* @returns
|
|
1473
|
+
*/
|
|
1474
|
+
setLinePoint(e, t, n, o = "all", s = [], a = Pt()) {
|
|
1475
|
+
if (e.userData.setLinePointUUid === a) return [];
|
|
1476
|
+
e.userData.setLinePointUUid = a;
|
|
1477
|
+
let r = [], l = [];
|
|
1478
|
+
(o === "start" || o === "all") && (r = this.renderManager.pointVirtualGrid.queryPoint(e.start).filter((f) => f.userData !== e)), (o === "end" || o === "all") && (l = this.renderManager.pointVirtualGrid.queryPoint(e.end).filter((f) => f.userData !== e));
|
|
1479
|
+
const i = e.clone();
|
|
1480
|
+
let c = "";
|
|
1481
|
+
t && (e.start.equal(t) || (c = "start"), s.push({
|
|
1482
|
+
point: e.start,
|
|
1483
|
+
oldPoint: e.start.clone(),
|
|
1484
|
+
newPoint: t,
|
|
1485
|
+
line: e
|
|
1486
|
+
}), e.start.copy(t)), n && (e.end.equal(n) || (c = c === "start" ? "all" : "end"), s.push({
|
|
1487
|
+
point: e.end,
|
|
1488
|
+
oldPoint: e.end.clone(),
|
|
1489
|
+
newPoint: n,
|
|
1490
|
+
line: e
|
|
1491
|
+
}), e.end.copy(n));
|
|
1492
|
+
const h = (f, u, p) => {
|
|
1493
|
+
f.forEach((g) => {
|
|
1494
|
+
const { point: E, userData: C } = g, D = C.start === E ? "start" : "end";
|
|
1495
|
+
if (C.directionEqual(i))
|
|
1496
|
+
if (D === "start") {
|
|
1497
|
+
const F = e.projectPoint(C.end, !1);
|
|
1498
|
+
if (F) return this.setLinePoint(C, u, F, "end", s, a);
|
|
1499
|
+
} else {
|
|
1500
|
+
const F = e.projectPoint(C.start, !1);
|
|
1501
|
+
if (F) return this.setLinePoint(C, F, u, "start", s, a);
|
|
1502
|
+
}
|
|
1503
|
+
(c === "all" || p === c) && this.setLinePoint(
|
|
1504
|
+
C,
|
|
1505
|
+
C.start === E ? u : C.start,
|
|
1506
|
+
C.end === E ? u : C.end,
|
|
1507
|
+
C.start === E ? "end" : "start",
|
|
1508
|
+
s,
|
|
1509
|
+
a
|
|
1510
|
+
);
|
|
1511
|
+
});
|
|
1512
|
+
};
|
|
1513
|
+
return h(r, e.start, "start"), h(l, e.end, "end"), [...r, ...l];
|
|
1514
|
+
}
|
|
1515
|
+
/** 修正2
|
|
1516
|
+
* 第一步:确定需要修复的线段
|
|
1517
|
+
* 第二步:查找与该线段相交的其他线段
|
|
1518
|
+
* 第三步:找出两端点相交的线段,其他为区间相交
|
|
1519
|
+
* 第四步:修正相交的线段的另一个端点
|
|
1520
|
+
* 第五步:判断是否有方向一致的线段,有就调整,调整方法:查找连续平行的线段,求点在线段方向的投影,直到不平行的线段结束
|
|
1521
|
+
* 第六步: 中间线段采用投影修正
|
|
1522
|
+
* @param targettLine
|
|
1523
|
+
* @param vistedList
|
|
1524
|
+
*/
|
|
1525
|
+
correction(e, t = [], n = /* @__PURE__ */ new Set()) {
|
|
1526
|
+
n.add(e);
|
|
1527
|
+
const o = this.renderManager.quadtree.queryLineSegment(e).filter(({ line: i }) => !(i === e || i.userData.isDoor || n.has(i))).map((i) => i.line), s = e.direction(), [a, r] = o.reduce((i, c) => {
|
|
1528
|
+
const [h, f] = i;
|
|
1529
|
+
return c.sameEndpoint(e) ? h.push(c) : f.push(c), i;
|
|
1530
|
+
}, [[], []]);
|
|
1531
|
+
a.forEach((i) => {
|
|
1532
|
+
const c = i.direction(), h = s.angleBetween(c, "angle");
|
|
1533
|
+
if (Math.abs(90 - h) > 45) return !1;
|
|
1534
|
+
const u = e.sameEndpointAsStart(i) ? e.start : e.end, p = i.sameEndpointAsStart(e) ? i.end : i.start, g = new B(
|
|
1535
|
+
p.clone().add(s.clone().multiplyScalar(1)),
|
|
1536
|
+
p.clone().add(s.clone().multiplyScalar(-1))
|
|
1537
|
+
), E = g.projectPoint(u, !1);
|
|
1538
|
+
if (E) {
|
|
1539
|
+
const C = [];
|
|
1540
|
+
this.setLinePoint(
|
|
1541
|
+
i,
|
|
1542
|
+
i.start === p ? E : i.start,
|
|
1543
|
+
i.end === p ? E : i.end,
|
|
1544
|
+
i.start === p ? "start" : "end",
|
|
1545
|
+
C
|
|
1546
|
+
), t.push(C);
|
|
1547
|
+
}
|
|
1548
|
+
return n.add(i), !1;
|
|
1549
|
+
}), s.copy(e.direction());
|
|
1550
|
+
const l = (i, c, h) => {
|
|
1551
|
+
const f = e.projectPoint(c);
|
|
1552
|
+
if (f) i.copy(f);
|
|
1553
|
+
else {
|
|
1554
|
+
const u = new B(
|
|
1555
|
+
c.clone().add(s.clone().multiplyScalar(1)),
|
|
1556
|
+
c.clone().add(s.clone().multiplyScalar(-1))
|
|
1557
|
+
), p = u.projectPoint(i, !1);
|
|
1558
|
+
if (p) {
|
|
1559
|
+
const g = [];
|
|
1560
|
+
this.setLinePoint(
|
|
1561
|
+
h,
|
|
1562
|
+
h.start === c ? p : h.start,
|
|
1563
|
+
h.end === c ? p : h.end,
|
|
1564
|
+
h.start === c ? "start" : "end",
|
|
1565
|
+
g
|
|
1566
|
+
), t.push(g);
|
|
1567
|
+
}
|
|
1568
|
+
}
|
|
1569
|
+
};
|
|
1570
|
+
return r.forEach((i) => {
|
|
1571
|
+
if (e.containsPoint(i.start))
|
|
1572
|
+
l(i.start, i.end, i);
|
|
1573
|
+
else if (e.containsPoint(i.end))
|
|
1574
|
+
l(i.end, i.start, i);
|
|
1575
|
+
else {
|
|
1576
|
+
const c = e.getIntersection(i);
|
|
1577
|
+
if (c) {
|
|
1578
|
+
const h = new B(
|
|
1579
|
+
i.start.clone().add(s.clone().multiplyScalar(1)),
|
|
1580
|
+
i.start.clone().add(s.clone().multiplyScalar(-1))
|
|
1581
|
+
), f = h.projectPoint(c, !1);
|
|
1582
|
+
if (f) {
|
|
1583
|
+
const g = [];
|
|
1584
|
+
this.setLinePoint(i, f, i.end, "start", g), t.push(g);
|
|
1585
|
+
}
|
|
1586
|
+
const u = new B(
|
|
1587
|
+
i.end.clone().add(s.clone().multiplyScalar(1)),
|
|
1588
|
+
i.end.clone().add(s.clone().multiplyScalar(-1))
|
|
1589
|
+
), p = u.projectPoint(c, !1);
|
|
1590
|
+
if (p) {
|
|
1591
|
+
const g = [];
|
|
1592
|
+
this.setLinePoint(i, i.start, p, "end", g), t.push(g);
|
|
1593
|
+
}
|
|
1594
|
+
}
|
|
1595
|
+
}
|
|
1596
|
+
}), this.recursion && o.forEach((i) => this.correction(i, t, n)), t;
|
|
1597
|
+
}
|
|
1598
|
+
/** 开始
|
|
1599
|
+
* @param next
|
|
1600
|
+
*/
|
|
1601
|
+
verticalCorrection(e, t) {
|
|
1602
|
+
e(this.correction(t[0]));
|
|
1603
|
+
}
|
|
1604
|
+
/** 执行完成
|
|
1605
|
+
* @param data
|
|
1606
|
+
*/
|
|
1607
|
+
completed(e) {
|
|
1608
|
+
e.forEach((t) => {
|
|
1609
|
+
t.forEach((n) => {
|
|
1610
|
+
const { line: o, newPoint: s, point: a } = n;
|
|
1611
|
+
a.copy(s), this.renderManager.removeLine(o), this.renderManager.addLine(o);
|
|
1612
|
+
});
|
|
1613
|
+
}), this.renderManager.draw();
|
|
1614
|
+
}
|
|
1615
|
+
/** 回滚操作
|
|
1616
|
+
* @param data
|
|
1617
|
+
*/
|
|
1618
|
+
rollback(e) {
|
|
1619
|
+
for (let t = e.length - 1; t >= 0; t--) {
|
|
1620
|
+
const n = e[t];
|
|
1621
|
+
for (let o = n.length - 1; o >= 0; o--) {
|
|
1622
|
+
const s = n[o], { line: a, oldPoint: r, point: l } = s;
|
|
1623
|
+
l.copy(r), this.renderManager.removeLine(a), this.renderManager.addLine(a);
|
|
1624
|
+
}
|
|
1625
|
+
}
|
|
1626
|
+
return this.renderManager.draw(), e;
|
|
1627
|
+
}
|
|
1628
|
+
/** 撤回回滚
|
|
1629
|
+
* @param lines
|
|
1630
|
+
* @returns
|
|
1631
|
+
*/
|
|
1632
|
+
revokeRollback(e) {
|
|
1633
|
+
return this.completed(e), e;
|
|
1634
|
+
}
|
|
1635
|
+
}
|
|
1636
|
+
class Y extends O {
|
|
1637
|
+
static name = "MergeLine";
|
|
1638
|
+
shortcutKeys = ["control", "g"];
|
|
1639
|
+
static commandName = "merge-line";
|
|
1640
|
+
onAddFromParent(e) {
|
|
1641
|
+
super.onAddFromParent(e);
|
|
1642
|
+
const t = e.findComponentByType(_e), n = this.commandManager.addCommandFlow(Y.commandName).add(this.createInterrupt()).add(this.constraint.bind(this)).add(this.mergeLine.bind(this)).addRollback(this.rollback.bind(this)).addRevokeRollback(this.revokeRollback.bind(this));
|
|
1643
|
+
n.addEventListener("finally", this.createFinally()), n.addEventListener("completed", (o) => this.completed(o.data)), this.eventInput.addKeyCombination(Y.commandName, this.shortcutKeys), this.eventInput.addEventListener("codeChange", async () => {
|
|
1644
|
+
t?.selectLines.length === 2 && this.eventInput.isKeyCombination(Y.commandName) && await this.commandManager.start(Y.commandName, [...this.default.selectLines]);
|
|
1645
|
+
}), this.eventInput.addCancelDefaultBehavior(() => this.eventInput.isOnlyKeyDowns(this.shortcutKeys));
|
|
1646
|
+
}
|
|
1647
|
+
/**
|
|
1648
|
+
* 进入命令约束
|
|
1649
|
+
*/
|
|
1650
|
+
constraint(e, t) {
|
|
1651
|
+
Array.isArray(t) ? t.length !== 2 ? (L({ message: "未执行线段合并,请选择两条线段", type: "warning" }), this.cancel()) : e(t) : (L({ message: "进入命令失败", type: "warning" }), this.cancel());
|
|
1652
|
+
}
|
|
1653
|
+
/** 开始
|
|
1654
|
+
* @param next
|
|
1655
|
+
* @todo 合并所有
|
|
1656
|
+
*/
|
|
1657
|
+
mergeLine(e, t) {
|
|
1658
|
+
const n = t[0], o = t[1];
|
|
1659
|
+
for (let s = 0; s < n.points.length; s++) {
|
|
1660
|
+
const a = n.points[s];
|
|
1661
|
+
for (let r = 0; r < o.points.length; r++) {
|
|
1662
|
+
const l = o.points[r];
|
|
1663
|
+
if (a.equal(l)) {
|
|
1664
|
+
const i = n.points[(s + 1) % 2], c = o.points[(r + 1) % 2], h = new B(i, c);
|
|
1665
|
+
return e({ line1: n, line2: o, newLine: h }), L({ message: "已合并", type: "success" });
|
|
1770
1666
|
}
|
|
1771
1667
|
}
|
|
1772
1668
|
}
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
|
|
1669
|
+
L({ message: "合并失败,两条线未找到共用点", type: "warning" }), this.commandManager.cancel();
|
|
1670
|
+
}
|
|
1671
|
+
/** 执行完成
|
|
1672
|
+
* @param data
|
|
1673
|
+
*/
|
|
1674
|
+
completed(e) {
|
|
1675
|
+
this.renderManager.removeLine(e.line1), this.renderManager.removeLine(e.line2), this.renderManager.addLine(e.newLine), this.renderManager.draw();
|
|
1676
|
+
}
|
|
1677
|
+
/** 回滚操作
|
|
1678
|
+
* @param data
|
|
1679
|
+
*/
|
|
1680
|
+
rollback(e) {
|
|
1681
|
+
return this.renderManager.addLines([e.line1, e.line2]), this.renderManager.removeLine(e.newLine), this.renderManager.draw(), e;
|
|
1682
|
+
}
|
|
1683
|
+
/** 撤回回滚
|
|
1684
|
+
* @param lines
|
|
1685
|
+
* @returns
|
|
1686
|
+
*/
|
|
1687
|
+
revokeRollback(e) {
|
|
1688
|
+
return this.completed(e), e;
|
|
1689
|
+
}
|
|
1690
|
+
}
|
|
1691
|
+
class X extends O {
|
|
1692
|
+
static name = "DeleteSelectLine";
|
|
1693
|
+
shortcutKeys = ["Delete"];
|
|
1694
|
+
static commandName = "deleteSelectLine";
|
|
1695
|
+
onAddFromParent(e) {
|
|
1696
|
+
super.onAddFromParent(e), this.commandManager.addCommandFlow(X.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(X.commandName, this.shortcutKeys), this.eventInput.addEventListener("codeChange", async () => {
|
|
1697
|
+
this.eventInput.isKeyCombination(X.commandName) && await this.commandManager.start(X.commandName, [...this.default.selectLines]);
|
|
1698
|
+
}), this.eventInput.addCancelDefaultBehavior(() => this.eventInput.isOnlyKeyDowns(this.shortcutKeys));
|
|
1699
|
+
}
|
|
1700
|
+
/**
|
|
1701
|
+
* 进入命令约束
|
|
1702
|
+
*/
|
|
1703
|
+
constraint(e, t) {
|
|
1704
|
+
Array.isArray(t) ? t.length === 0 ? (L({ message: "请选择线段", type: "warning" }), this.cancel()) : e(t) : (L({ message: "进入命令失败", type: "warning" }), this.cancel());
|
|
1705
|
+
}
|
|
1706
|
+
/** 开始
|
|
1707
|
+
* @param next
|
|
1708
|
+
*/
|
|
1709
|
+
delete(e, t) {
|
|
1710
|
+
t.forEach((n) => this.renderManager.removeLine(n)), L({ message: "删除成功", type: "success" }), e(t);
|
|
1711
|
+
}
|
|
1712
|
+
/** 回滚操作
|
|
1713
|
+
* @param data
|
|
1714
|
+
*/
|
|
1715
|
+
rollback(e) {
|
|
1716
|
+
return this.renderManager.addLines(e), this.renderManager.draw(), e;
|
|
1717
|
+
}
|
|
1718
|
+
/** 撤回回滚
|
|
1719
|
+
* @param lines
|
|
1720
|
+
* @returns
|
|
1721
|
+
*/
|
|
1722
|
+
revokeRollback(e) {
|
|
1723
|
+
return e.forEach((t) => this.renderManager.removeLine(t)), e;
|
|
1724
|
+
}
|
|
1725
|
+
}
|
|
1726
|
+
class $ extends O {
|
|
1727
|
+
static name = "ConnectionLine";
|
|
1728
|
+
shortcutKeys = ["Shift", "L"];
|
|
1729
|
+
static commandName = "connectionLine";
|
|
1730
|
+
onAddFromParent(e) {
|
|
1731
|
+
super.onAddFromParent(e);
|
|
1732
|
+
const t = this.commandManager.addCommandFlow($.commandName).add(this.createInterrupt()).add(this.constraint.bind(this)).add(this.connection.bind(this)).addRollback(this.rollback.bind(this)).addRevokeRollback(this.revokeRollback.bind(this));
|
|
1733
|
+
t.addEventListener("finally", this.createFinally()), t.addEventListener("completed", (n) => this.completed(n.data)), this.eventInput.addKeyCombination($.commandName, this.shortcutKeys), this.eventInput.addEventListener("codeChange", async () => {
|
|
1734
|
+
this.eventInput.isKeyCombination($.commandName) && await this.commandManager.start($.commandName, [...this.default.selectLines]);
|
|
1735
|
+
}), this.eventInput.addCancelDefaultBehavior(() => this.eventInput.isOnlyKeyDowns(this.shortcutKeys));
|
|
1736
|
+
}
|
|
1737
|
+
/**
|
|
1738
|
+
* 进入命令约束
|
|
1739
|
+
*/
|
|
1740
|
+
constraint(e, t) {
|
|
1741
|
+
Array.isArray(t) ? t.length !== 2 ? (L({ message: "请选择2条线段", type: "warning" }), this.cancel()) : e(t) : (L({ message: "进入命令失败", type: "warning" }), this.cancel());
|
|
1742
|
+
}
|
|
1743
|
+
/** 连接
|
|
1744
|
+
* @param next
|
|
1745
|
+
*/
|
|
1746
|
+
connection(e, t) {
|
|
1747
|
+
let n, o, s = 1 / 0;
|
|
1748
|
+
for (let a = 0; a < 2; a++)
|
|
1749
|
+
for (let r = 0; r < 2; r++) {
|
|
1750
|
+
const l = t[0].points[a], i = t[1].points[r], c = l.distance(i);
|
|
1751
|
+
c < s && (n = l, o = i, s = c);
|
|
1752
|
+
}
|
|
1753
|
+
if (n && o) {
|
|
1754
|
+
const a = new B(n.clone(), o.clone());
|
|
1755
|
+
e(a), L({ message: "连接成功", type: "success" });
|
|
1756
|
+
} else this.cancel();
|
|
1757
|
+
}
|
|
1758
|
+
/** 成功
|
|
1759
|
+
* @param next
|
|
1760
|
+
* @param selectLines
|
|
1761
|
+
*/
|
|
1762
|
+
completed(e) {
|
|
1763
|
+
this.renderManager.addLine(e), this.renderManager.draw();
|
|
1764
|
+
}
|
|
1765
|
+
/** 回滚操作
|
|
1766
|
+
* @param data
|
|
1767
|
+
*/
|
|
1768
|
+
rollback(e) {
|
|
1769
|
+
return this.renderManager.removeLine(e), e;
|
|
1770
|
+
}
|
|
1771
|
+
/** 撤回回滚
|
|
1772
|
+
* @param lines
|
|
1773
|
+
* @returns
|
|
1774
|
+
*/
|
|
1775
|
+
revokeRollback(e) {
|
|
1776
|
+
return this.completed(e), e;
|
|
1777
|
+
}
|
|
1778
|
+
}
|
|
1779
|
+
class ee extends O {
|
|
1780
|
+
static name = "IntersectionConnectionLine";
|
|
1781
|
+
shortcutKeys = ["control", "Shift", "L"];
|
|
1782
|
+
static commandName = "intersectionConnectionLine";
|
|
1783
|
+
onAddFromParent(e) {
|
|
1784
|
+
super.onAddFromParent(e);
|
|
1785
|
+
const t = this.commandManager.addCommandFlow(ee.commandName).add(this.createInterrupt()).add(this.constraint.bind(this)).add(this.connection.bind(this)).addRollback(this.rollback.bind(this)).addRevokeRollback(this.revokeRollback.bind(this));
|
|
1786
|
+
t.addEventListener("finally", this.createFinally()), t.addEventListener("completed", (n) => this.completed(n.data)), this.eventInput.addKeyCombination(ee.commandName, this.shortcutKeys), this.eventInput.addEventListener("codeChange", async () => {
|
|
1787
|
+
this.eventInput.isKeyCombination(ee.commandName) && await this.commandManager.start(ee.commandName, [...this.default.selectLines]);
|
|
1788
|
+
}), this.eventInput.addCancelDefaultBehavior(() => this.eventInput.isOnlyKeyDowns(this.shortcutKeys));
|
|
1789
|
+
}
|
|
1790
|
+
/**
|
|
1791
|
+
* 进入命令约束
|
|
1792
|
+
*/
|
|
1793
|
+
constraint(e, t) {
|
|
1794
|
+
Array.isArray(t) ? t.length !== 2 ? (L({ message: "请选择2条线段", type: "warning" }), this.cancel()) : e(t) : (L({ message: "进入命令失败", type: "warning" }), this.cancel());
|
|
1795
|
+
}
|
|
1796
|
+
/** 开始
|
|
1797
|
+
* @param next
|
|
1798
|
+
*/
|
|
1799
|
+
connection(e, t) {
|
|
1800
|
+
const n = t[0], o = t[1], s = t[0].getIntersection(t[1]);
|
|
1801
|
+
if (!s) return;
|
|
1802
|
+
const a = n.points.map((c) => c.clone()), r = o.points.map((c) => c.clone());
|
|
1803
|
+
n.start.distance(s) < n.end.distance(s) ? n.start.copy(s) : n.end.copy(s), o.start.distance(s) < o.end.distance(s) ? o.start.copy(s) : o.end.copy(s);
|
|
1804
|
+
const l = n.points.map((c) => c.clone()), i = o.points.map((c) => c.clone());
|
|
1805
|
+
e({ line1: n, line2: o, oldLine1: a, oldLine2: r, newLine1: l, newLine2: i }), L({ message: "连接成功", type: "success" });
|
|
1806
|
+
}
|
|
1807
|
+
/** 执行完成
|
|
1808
|
+
* @param next
|
|
1809
|
+
* @param selectLines
|
|
1810
|
+
*/
|
|
1811
|
+
completed({ line1: e, line2: t, newLine1: n, newLine2: o }) {
|
|
1812
|
+
this.renderManager.removeLine(e), this.renderManager.removeLine(t), e.set(...n), t.set(...o), this.renderManager.addLines([e, t]), this.renderManager.draw();
|
|
1813
|
+
}
|
|
1814
|
+
/** 回滚操作
|
|
1815
|
+
* @param data
|
|
1816
|
+
*/
|
|
1817
|
+
rollback(e) {
|
|
1818
|
+
const { line1: t, line2: n, oldLine1: o, oldLine2: s } = e;
|
|
1819
|
+
return this.renderManager.removeLine(t), this.renderManager.removeLine(n), t.set(...o), n.set(...s), this.renderManager.addLines([t, n]), this.renderManager.draw(), e;
|
|
1820
|
+
}
|
|
1821
|
+
/** 撤回回滚
|
|
1822
|
+
* @param lines
|
|
1823
|
+
* @returns
|
|
1824
|
+
*/
|
|
1825
|
+
revokeRollback(e) {
|
|
1826
|
+
return this.completed(e), e;
|
|
1827
|
+
}
|
|
1828
|
+
}
|
|
1829
|
+
class te extends O {
|
|
1830
|
+
static name = "DeleteSelectWindow";
|
|
1831
|
+
shortcutKeys = ["Q", "Delete"];
|
|
1832
|
+
static commandName = "deleteSelectWindow";
|
|
1833
|
+
onAddFromParent(e) {
|
|
1834
|
+
super.onAddFromParent(e);
|
|
1835
|
+
const t = this.commandManager.addCommandFlow(te.commandName).add(this.createInterrupt()).add(this.constraint.bind(this)).add(this.end.bind(this)).addRollback(this.rollback.bind(this)).addRevokeRollback(this.revokeRollback.bind(this));
|
|
1836
|
+
t.addEventListener("finally", this.createFinally()), t.addEventListener("completed", (n) => this.completed(n.data)), this.eventInput.addKeyCombination(te.commandName, this.shortcutKeys), this.eventInput.addEventListener("codeChange", async () => {
|
|
1837
|
+
this.eventInput.isKeyCombination(te.commandName) && await this.commandManager.start(te.commandName, [...this.default.selectLines]);
|
|
1838
|
+
}), this.eventInput.addCancelDefaultBehavior(() => this.eventInput.isOnlyKeyDowns(this.shortcutKeys));
|
|
1839
|
+
}
|
|
1840
|
+
/**
|
|
1841
|
+
* 进入命令约束
|
|
1842
|
+
*/
|
|
1843
|
+
constraint(e, t) {
|
|
1844
|
+
Array.isArray(t) ? t.some((n) => n.userData.isWindow) ? e(t) : (L({ message: "请选择有窗户线段", type: "warning" }), this.cancel()) : (L({ message: "进入命令失败", type: "warning" }), this.cancel());
|
|
1845
|
+
}
|
|
1846
|
+
/** 开始
|
|
1847
|
+
* @param next
|
|
1848
|
+
*/
|
|
1849
|
+
end(e, t) {
|
|
1850
|
+
let n = !1, o = [];
|
|
1851
|
+
t.forEach((s) => {
|
|
1852
|
+
s.userData.isWindow && (o.push({
|
|
1853
|
+
line: s,
|
|
1854
|
+
drawDoorData: s.userData.drawDoorData
|
|
1855
|
+
}), n = !0);
|
|
1856
|
+
}), n && L({ message: "删除窗户成功", type: "success" }), e(o);
|
|
1857
|
+
}
|
|
1858
|
+
/**
|
|
1859
|
+
* 完成
|
|
1860
|
+
* @param list
|
|
1861
|
+
*/
|
|
1862
|
+
completed(e) {
|
|
1863
|
+
e.forEach((t) => {
|
|
1864
|
+
const n = t.line.userData;
|
|
1865
|
+
n && (delete n.isWindow, delete n.drawDoorData);
|
|
1866
|
+
}), this.renderManager.draw();
|
|
1867
|
+
}
|
|
1868
|
+
/** 回滚操作
|
|
1869
|
+
* @param data
|
|
1870
|
+
*/
|
|
1871
|
+
rollback(e) {
|
|
1872
|
+
return e.forEach((t) => {
|
|
1873
|
+
t.line.userData || (t.line.userData = {});
|
|
1874
|
+
const n = t.line.userData;
|
|
1875
|
+
n.isWindow = !0, n.drawDoorData = t.drawDoorData;
|
|
1876
|
+
}), this.renderManager.draw(), e;
|
|
1877
|
+
}
|
|
1878
|
+
/** 撤回回滚
|
|
1879
|
+
* @param lines
|
|
1880
|
+
* @returns
|
|
1881
|
+
*/
|
|
1882
|
+
revokeRollback(e) {
|
|
1883
|
+
return this.completed(e), e;
|
|
1884
|
+
}
|
|
1885
|
+
}
|
|
1886
|
+
class ne extends O {
|
|
1887
|
+
static name = "SelectAll";
|
|
1888
|
+
container = new m.Group();
|
|
1889
|
+
shortcutKeys = ["control", "a"];
|
|
1890
|
+
static commandName = "selectAll";
|
|
1891
|
+
onAddFromParent(e) {
|
|
1892
|
+
super.onAddFromParent(e), this.editor.container.add(this.container), this.container.position.z = 1e-3;
|
|
1893
|
+
const t = this.commandManager.addCommandFlow(ne.commandName).add(this.createInterrupt()).add(this.selectAll.bind(this)).addRollback(this.rollback.bind(this)).addRevokeRollback(this.revokeRollback.bind(this));
|
|
1894
|
+
t.writeOperationList = !1, t.addEventListener("finally", this.createFinally()), t.addEventListener("completed", (n) => this.completed(n.data)), this.eventInput.addKeyCombination(ne.commandName, this.shortcutKeys), this.eventInput.addEventListener("codeChange", async () => {
|
|
1895
|
+
this.eventInput.isKeyCombination(ne.commandName) && await this.commandManager.start(ne.commandName);
|
|
1896
|
+
}), this.eventInput.addCancelDefaultBehavior(() => this.eventInput.isOnlyKeyDowns(this.shortcutKeys));
|
|
1897
|
+
}
|
|
1898
|
+
/** 开始
|
|
1899
|
+
* @param next
|
|
1900
|
+
*/
|
|
1901
|
+
selectAll(e) {
|
|
1902
|
+
e([...this.renderManager.lines]);
|
|
1903
|
+
}
|
|
1904
|
+
/** 执行完成
|
|
1905
|
+
*/
|
|
1906
|
+
completed(e) {
|
|
1907
|
+
e.map((t) => this.default.addSelectLine(t));
|
|
1908
|
+
}
|
|
1909
|
+
/** 回滚操作
|
|
1910
|
+
* @param lines
|
|
1911
|
+
*/
|
|
1912
|
+
rollback(e) {
|
|
1913
|
+
return e.map((t) => this.default.removeSelectLine(t)), e;
|
|
1914
|
+
}
|
|
1915
|
+
/** 撤回回滚
|
|
1916
|
+
* @param lines
|
|
1917
|
+
* @returns
|
|
1918
|
+
*/
|
|
1919
|
+
revokeRollback(e) {
|
|
1920
|
+
return this.completed(e), e;
|
|
1921
|
+
}
|
|
1922
|
+
}
|
|
1923
|
+
class oe extends O {
|
|
1924
|
+
static name = "ViewAngle";
|
|
1925
|
+
shortcutKeys = ["r"];
|
|
1926
|
+
static commandName = "viewAngle";
|
|
1927
|
+
onAddFromParent(e) {
|
|
1928
|
+
super.onAddFromParent(e);
|
|
1929
|
+
const t = this.commandManager.addCommandFlow(oe.commandName).add(this.createInterrupt()).add(this.constraint.bind(this)).add(this.viewAngle.bind(this));
|
|
1930
|
+
t.writeOperationList = !1, t.addEventListener("finally", this.createFinally()), this.eventInput.addKeyCombination(oe.commandName, this.shortcutKeys), this.eventInput.addEventListener("codeChange", async () => {
|
|
1931
|
+
this.eventInput.isKeyCombination(oe.commandName) && await this.commandManager.start(oe.commandName, [...this.default.selectLines]);
|
|
1932
|
+
}), this.eventInput.addCancelDefaultBehavior(() => this.eventInput.isOnlyKeyDowns(this.shortcutKeys));
|
|
1933
|
+
}
|
|
1934
|
+
/**
|
|
1935
|
+
* 进入命令约束
|
|
1936
|
+
*/
|
|
1937
|
+
constraint(e, t) {
|
|
1938
|
+
Array.isArray(t) ? t.length !== 2 || !t[0].sameEndpoint(t[1]) ? (L({ message: "请选择两条具有端点相交的线段", type: "warning" }), this.cancel()) : e(t) : (L({ message: "进入命令失败", type: "warning" }), this.cancel());
|
|
1939
|
+
}
|
|
1940
|
+
/**
|
|
1941
|
+
*
|
|
1942
|
+
* @param next
|
|
1943
|
+
* @param selectLines
|
|
1944
|
+
*/
|
|
1945
|
+
viewAngle(e, t) {
|
|
1946
|
+
const [n, o] = t, s = Math.min(0.5, n.length(), o.length());
|
|
1947
|
+
let a, r, l, i = 0, c = 0;
|
|
1948
|
+
n.sameEndpointAsStart(o) ? (a = n.start, r = n.end) : (a = n.end, r = n.start), o.sameEndpointAsStart(n) ? l = o.end : l = o.start;
|
|
1949
|
+
function h(M, K) {
|
|
1950
|
+
const w = K.x - M.x, Z = K.y - M.y;
|
|
1951
|
+
let G = Math.atan2(Z, w) * (180 / Math.PI);
|
|
1952
|
+
return G < 0 && (G += 360), G;
|
|
1953
|
+
}
|
|
1954
|
+
const f = h(a, r), u = h(a, l), p = Math.min(f, u), g = Math.max(f, u), E = [];
|
|
1955
|
+
function C(M, K) {
|
|
1956
|
+
for (let w = M; w <= K; w++) {
|
|
1957
|
+
const Z = Math.cos(w * Math.PI / 180) * s + a.x, G = Math.sin(w * Math.PI / 180) * s + a.y, Ce = Math.cos((w + 1) * Math.PI / 180) * s + a.x, xe = Math.sin((w + 1) * Math.PI / 180) * s + a.y;
|
|
1958
|
+
E.push(Z, G, 0, Ce, xe, 0);
|
|
1959
|
+
}
|
|
1960
|
+
}
|
|
1961
|
+
g - p > 180 ? (C(0, p), C(g, 360), i = 360 - (g - p), c = (g + i / 2) % 360) : (C(p, g), i = g - p, c = p + i / 2);
|
|
1962
|
+
const D = new m.LineSegments();
|
|
1963
|
+
D.geometry = this.renderManager.createGeometry({
|
|
1964
|
+
position: E
|
|
1965
|
+
}, E.length / 3), D.material = new m.LineBasicMaterial({ color: 16711935 }), this.renderManager.container.add(D);
|
|
1966
|
+
const F = Math.cos(c * Math.PI / 180) * s + a.x, ae = Math.sin(c * Math.PI / 180) * s + a.y, q = this.renderer.createText(Number(i.toFixed(2)), new m.Vector3(F, ae, 0), {
|
|
1967
|
+
textShadow: "0px 0px 2px #000"
|
|
1968
|
+
}, this.renderManager.container);
|
|
1969
|
+
let _ = 0;
|
|
1970
|
+
this.addEventRecord("clear").add(() => D.removeFromParent()).add(() => q.removeFromParent()).add(this.eventInput.addEventListener("codeChange", () => {
|
|
1971
|
+
this.eventInput.isOnlyKeyDown("enter") ? e() : this.eventInput.isOnlyKeyDown("mouse_0") && (_++, _ === 1 ? setTimeout(() => _ = 0, 500) : _ === 2 && (e(), _ = 0));
|
|
1972
|
+
}));
|
|
1973
|
+
}
|
|
1974
|
+
}
|
|
1975
|
+
class rt extends O {
|
|
1976
|
+
static name = "ClippingLine";
|
|
1977
|
+
container = new m.Group();
|
|
1978
|
+
shortcutKeys = ["control", "x"];
|
|
1979
|
+
commandName = "clippingLine";
|
|
1980
|
+
static commandName = "clippingLine";
|
|
1981
|
+
onAddFromParent(e) {
|
|
1982
|
+
super.onAddFromParent(e), this.editor.container.add(this.container);
|
|
1983
|
+
const t = this.commandManager.addCommandFlow(this.commandName).add(this.createInterrupt()).add(this.createCursor("no-drop")).add(this.selectPointStart.bind(this)).add(this.selectPointEnd.bind(this)).add(this.end.bind(this)).addRollback(this.rollback.bind(this)).addRevokeRollback(this.revokeRollback.bind(this));
|
|
1984
|
+
t.addEventListener("finally", this.createFinally(["selectPointStart"])), t.addEventListener("completed", (n) => this.completed(n.data)), this.eventInput.addKeyCombination(this.commandName, this.shortcutKeys), this.eventInput.addEventListener("codeChange", async () => this.eventInput.isKeyCombination(this.commandName) && await this.commandManager.start(this.commandName)), this.eventInput.addCancelDefaultBehavior(() => this.eventInput.isOnlyKeyDowns(this.shortcutKeys));
|
|
1985
|
+
}
|
|
1986
|
+
/** 选择开始点
|
|
1987
|
+
* @param next
|
|
1988
|
+
*/
|
|
1989
|
+
selectPointStart(e) {
|
|
1990
|
+
let t = null, n = new m.Mesh(new m.SphereGeometry(0.04), new m.MeshBasicMaterial({ color: 16711935 })), o = null;
|
|
1991
|
+
this.addEventRecord("selectPointStart").add(this.editor.addEventListener("pointerPositionChange", () => {
|
|
1992
|
+
const { point: s, line: a, find: r } = this.editor.renderManager.adsorption();
|
|
1993
|
+
this.dispatchEvent({ type: "pointerMove", point: s }), r ? (this.domElement.style.cursor = "none", n.position.copy(s), o = a, t = s.clone(), this.container.add(n)) : (this.domElement.style.cursor = "no-drop", t = null, n.removeFromParent());
|
|
1994
|
+
})).add(this.eventInput.addEventListener("codeChange", () => {
|
|
1995
|
+
this.eventInput.isKeyDown("mouse_0") && t && (this.canceEventRecord("selectPointStart"), e({ point: t, line: o }));
|
|
1996
|
+
})), this.addEventRecord("clear").add(() => n.removeFromParent());
|
|
1997
|
+
}
|
|
1998
|
+
/** 选择结束点
|
|
1999
|
+
* @param next
|
|
2000
|
+
*/
|
|
2001
|
+
selectPointEnd(e, { point: t, line: n }) {
|
|
2002
|
+
let o = null, s = new m.Mesh(new m.SphereGeometry(0.04), new m.MeshBasicMaterial({ color: 16711935 }));
|
|
2003
|
+
this.addEventRecord("clear").add(() => s.removeFromParent()).add(this.editor.addEventListener("pointerPositionChange", () => {
|
|
2004
|
+
const { point: a, find: r, line: l } = this.editor.renderManager.adsorption();
|
|
2005
|
+
this.dispatchEvent({ type: "pointerMove", point: a }), r && l === n ? (this.domElement.style.cursor = "none", s.position.copy(a), o = a.clone(), this.container.add(s)) : (this.domElement.style.cursor = "no-drop", o = null, s.removeFromParent());
|
|
2006
|
+
})).add(this.eventInput.addEventListener("codeChange", () => {
|
|
2007
|
+
this.eventInput.isKeyDown("mouse_0") && o && e({ line: n, start: t, end: o });
|
|
2008
|
+
}));
|
|
2009
|
+
}
|
|
2010
|
+
/**
|
|
2011
|
+
* 结束处理
|
|
2012
|
+
* @param next
|
|
2013
|
+
* @param points
|
|
2014
|
+
*/
|
|
2015
|
+
end(e, { start: t, end: n, line: o }) {
|
|
2016
|
+
const s = A.from(t), a = A.from(n);
|
|
2017
|
+
e({
|
|
2018
|
+
oldLine: o,
|
|
2019
|
+
newLine1: new B(
|
|
2020
|
+
o.start,
|
|
2021
|
+
o.start.distance(s) < o.start.distance(a) ? s.clone() : a.clone()
|
|
2022
|
+
),
|
|
2023
|
+
newLine2: new B(
|
|
2024
|
+
o.end,
|
|
2025
|
+
o.end.distance(s) < o.end.distance(a) ? s.clone() : a.clone()
|
|
2026
|
+
)
|
|
2027
|
+
});
|
|
2028
|
+
}
|
|
2029
|
+
/** 执行完成
|
|
2030
|
+
*/
|
|
2031
|
+
completed(e) {
|
|
2032
|
+
this.renderManager.removeLine(e.oldLine), this.renderManager.addLines([e.newLine1, e.newLine2]), this.renderManager.draw();
|
|
2033
|
+
}
|
|
2034
|
+
/** 回滚操作
|
|
2035
|
+
* @param data
|
|
2036
|
+
*/
|
|
2037
|
+
rollback(e) {
|
|
2038
|
+
return this.renderManager.addLine(e.oldLine), this.renderManager.removeLine(e.newLine1), this.renderManager.removeLine(e.newLine2), e;
|
|
2039
|
+
}
|
|
2040
|
+
/** 撤回回滚
|
|
2041
|
+
* @param data
|
|
2042
|
+
* @returns
|
|
2043
|
+
*/
|
|
2044
|
+
revokeRollback(e) {
|
|
2045
|
+
return this.completed(e), e;
|
|
2046
|
+
}
|
|
2047
|
+
}
|
|
2048
|
+
class se extends O {
|
|
2049
|
+
static name = "VerticalReferenceLine";
|
|
2050
|
+
shortcutKeys = ["v"];
|
|
2051
|
+
static commandName = "VerticalReferenceLine";
|
|
2052
|
+
onAddFromParent(e) {
|
|
2053
|
+
super.onAddFromParent(e);
|
|
2054
|
+
const t = this.commandManager.addCommandFlow(se.commandName).add(this.createInterrupt()).add(this.constraint.bind(this)).add(this.verticalReferenceLine.bind(this));
|
|
2055
|
+
t.writeOperationList = !1, t.addEventListener("finally", this.createFinally()), this.eventInput.addKeyCombination(se.commandName, this.shortcutKeys), this.eventInput.addEventListener("codeChange", async () => {
|
|
2056
|
+
this.eventInput.isKeyCombination(se.commandName) && await this.commandManager.start(se.commandName, [...this.default.selectLines]);
|
|
2057
|
+
}), this.eventInput.addCancelDefaultBehavior(() => this.eventInput.isOnlyKeyDowns(this.shortcutKeys));
|
|
2058
|
+
}
|
|
2059
|
+
/**
|
|
2060
|
+
* 进入命令约束
|
|
2061
|
+
*/
|
|
2062
|
+
constraint(e, t) {
|
|
2063
|
+
Array.isArray(t) ? t.length !== 1 ? (L({ message: "请选择一条墙壁线段", type: "warning" }), this.cancel()) : t[0].userData.isDoor ? (L({ message: "请选择一条墙壁线段", type: "warning" }), this.cancel()) : e(t) : (L({ message: "进入命令失败", type: "warning" }), this.cancel());
|
|
2064
|
+
}
|
|
2065
|
+
/**
|
|
2066
|
+
*
|
|
2067
|
+
* @param next
|
|
2068
|
+
* @param selectLines
|
|
2069
|
+
*/
|
|
2070
|
+
verticalReferenceLine(e, t) {
|
|
2071
|
+
this.renderManager.lines.forEach((n) => {
|
|
2072
|
+
delete n.userData.isVerticalReferenceLine;
|
|
2073
|
+
}), t[0].userData.isVerticalReferenceLine = !0, e(), this.renderManager.draw();
|
|
2074
|
+
}
|
|
2075
|
+
}
|
|
2076
|
+
const oo = {
|
|
2077
|
+
key: 0,
|
|
2078
|
+
class: "mt-[5px] text-[#ccc] text-[11px] absolute left-[10px] bottom-[10px] rounded-[8px] min-w-[150px] bg-black/15 p-[10px]"
|
|
2079
|
+
}, so = { class: "text-start max-w-[150px]" }, ao = { class: "inline-block ml-[10px] text-[var(--color-primary)]" }, io = {
|
|
2080
|
+
key: 0,
|
|
2081
|
+
class: "p-[5px] max-w-[200px]"
|
|
2082
|
+
}, ro = { class: "text-[14px] flex flex-col" }, lo = ["onClick"], co = { class: "flex flex-row items-center" }, mo = { class: "flex justify-center items-center size-[20px] bg-[#f0f0f0] rounded-[2px] mr-[10px]" }, ho = ["src"], uo = { class: "text-wrap" }, po = {
|
|
2083
|
+
key: 1,
|
|
2084
|
+
class: "text-[#999]"
|
|
2085
|
+
}, go = {
|
|
2086
|
+
style: { "--el-color-primary": "var(--primary-color)" },
|
|
2087
|
+
class: "flex flex-row items-center justify-between gap-[10px] mt-[10px] text-[10px]"
|
|
2088
|
+
}, vo = {
|
|
2089
|
+
key: 0,
|
|
2090
|
+
class: "flex flex-row items-center flex-wrap justify-between gap-[10px] mt-[10px] text-[10px]"
|
|
2091
|
+
}, fo = { class: "flex-wrap border-t-1 border-t-[#eee] mt-[5px] pt-[5px] flex items-center gap-[10px]" }, yo = ["onClick", "title"], wo = ["src"], bo = /* @__PURE__ */ ce({
|
|
2092
|
+
__name: "EditorTool",
|
|
2093
|
+
props: {
|
|
2094
|
+
dxfSystem: {},
|
|
2095
|
+
permission: {}
|
|
2096
|
+
},
|
|
2097
|
+
setup(d) {
|
|
2098
|
+
function e(x, v, b = h.value.getBoundingClientRect(), U = f.value.getBoundingClientRect()) {
|
|
2099
|
+
const me = b.width - U.width, he = 0, Me = b.height - U.height;
|
|
2100
|
+
x = Math.max(0, Math.min(x, me)), v = Math.max(he, Math.min(v, Me)), _.value = { left: x, top: v };
|
|
2101
|
+
}
|
|
2102
|
+
function t(x) {
|
|
2103
|
+
p.value === x.command || p.value !== "default" || C.commandManager.start(x.command);
|
|
2104
|
+
}
|
|
2105
|
+
function n(x) {
|
|
2106
|
+
if (x) {
|
|
2107
|
+
localStorage.setItem("lines", JSON.stringify(x));
|
|
2108
|
+
try {
|
|
2109
|
+
g.Dxf.set(x), g.Dxf.lineOffset();
|
|
2110
|
+
} catch (v) {
|
|
2111
|
+
console.log(v);
|
|
2112
|
+
}
|
|
1778
2113
|
}
|
|
1779
2114
|
}
|
|
1780
|
-
function
|
|
1781
|
-
|
|
1782
|
-
|
|
2115
|
+
async function o() {
|
|
2116
|
+
const x = await It.json();
|
|
2117
|
+
Array.isArray(x) && (localStorage.removeItem("orbitControls"), n(x));
|
|
2118
|
+
}
|
|
2119
|
+
function s({ offsetX: x, offsetY: v }) {
|
|
2120
|
+
E.mouseMoveEventProxylock = !0;
|
|
2121
|
+
const b = document.body.style.cursor;
|
|
1783
2122
|
document.body.style.cursor = "move";
|
|
1784
|
-
const
|
|
1785
|
-
const
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
|
|
1790
|
-
|
|
1791
|
-
);
|
|
1792
|
-
|
|
1793
|
-
document.body.style.cursor =
|
|
1794
|
-
};
|
|
1795
|
-
const end = () => {
|
|
1796
|
-
document.body.removeEventListener("mousemove", move);
|
|
1797
|
-
document.removeEventListener("mouseup", end);
|
|
1798
|
-
document.body.style.cursor = cusor;
|
|
1799
|
-
domEventRegister.mouseMoveEventProxylock = false;
|
|
2123
|
+
const U = (me) => {
|
|
2124
|
+
const he = h.value.getBoundingClientRect(), Me = f.value.getBoundingClientRect();
|
|
2125
|
+
e(
|
|
2126
|
+
me.pageX - he.left - x,
|
|
2127
|
+
me.pageY - he.top - v,
|
|
2128
|
+
he,
|
|
2129
|
+
Me
|
|
2130
|
+
), me.stopPropagation(), document.body.style.cursor = "move";
|
|
2131
|
+
}, Ee = () => {
|
|
2132
|
+
document.body.removeEventListener("mousemove", U), document.removeEventListener("mouseup", Ee), document.body.style.cursor = b, E.mouseMoveEventProxylock = !1;
|
|
1800
2133
|
};
|
|
1801
|
-
document.body.addEventListener("mousemove",
|
|
1802
|
-
document.addEventListener("mouseup", end);
|
|
2134
|
+
document.body.addEventListener("mousemove", U), document.addEventListener("mouseup", Ee);
|
|
1803
2135
|
}
|
|
1804
|
-
const
|
|
1805
|
-
|
|
1806
|
-
{
|
|
1807
|
-
{
|
|
1808
|
-
{
|
|
1809
|
-
{
|
|
1810
|
-
{
|
|
1811
|
-
{
|
|
1812
|
-
{
|
|
1813
|
-
{
|
|
1814
|
-
{
|
|
1815
|
-
{
|
|
1816
|
-
{
|
|
1817
|
-
{
|
|
1818
|
-
{
|
|
1819
|
-
{
|
|
1820
|
-
{
|
|
1821
|
-
{
|
|
1822
|
-
|
|
2136
|
+
const a = d, r = S(!0), l = S(!0), i = S(!0), c = S(!1), h = S(), f = S(), u = S(!0), p = S(""), g = Bt(a.dxfSystem), E = g.findComponentByType(kt), C = g.findComponentByType(dt), D = g.findComponentByType(_e), F = g.findComponentByType(Dt), ae = S(0), q = S(0), _ = S({ left: 10, top: 100 }), M = /* @__PURE__ */ Object.assign({ "./assets/images/angle.svg": bn, "./assets/images/connection.svg": xn, "./assets/images/cutLine.svg": Mn, "./assets/images/deleteSelectLine.svg": kn, "./assets/images/deleteSelectWindow.svg": Pn, "./assets/images/door.svg": Sn, "./assets/images/intersectionConnection.svg": _n, "./assets/images/line.svg": Nn, "./assets/images/mergeLine.svg": On, "./assets/images/revokeRollback.svg": Kn, "./assets/images/rollback.svg": Tn, "./assets/images/selectAll.svg": Vn, "./assets/images/selectPoint.svg": Qn, "./assets/images/verticalCorrection.svg": Wn, "./assets/images/verticalLine.svg": Jn, "./assets/images/window.svg": Zn }), K = S(!1), w = S(0), Z = S(!1), G = new ResizeObserver(() => e(_.value.left, _.value.top)), Ce = [
|
|
2137
|
+
{ name: "开启绘制线段命令", shortcut: "Ctrl + L" },
|
|
2138
|
+
{ name: "开启绘制门线命令", shortcut: "Ctrl + M" },
|
|
2139
|
+
{ name: "开启绘制窗户线命令", shortcut: "Ctrl + Q" },
|
|
2140
|
+
{ name: "开启点修改命令", shortcut: "Ctrl + P" },
|
|
2141
|
+
{ name: "线段方向移动线段点(点修改命令下)", shortcut: "Shift + 移动" },
|
|
2142
|
+
{ name: "删除线段", shortcut: "选中 + Delete" },
|
|
2143
|
+
{ name: "删除窗户线", shortcut: "选中 + Q + Delete" },
|
|
2144
|
+
{ name: "选中", shortcut: "鼠标左键" },
|
|
2145
|
+
{ name: "多选", shortcut: "鼠标左键 + Ctrl" },
|
|
2146
|
+
{ name: "取消选中", shortcut: "鼠标左键 + Alt" },
|
|
2147
|
+
{ name: "框选", shortcut: "鼠标左键 + 移动" },
|
|
2148
|
+
{ name: "线段同方向合并", shortcut: "Ctrl + G" },
|
|
2149
|
+
{ name: "线段连接", shortcut: "选中 + Shift + L" },
|
|
2150
|
+
{ name: "线段交点连接", shortcut: "选中 + Ctrl + Shift + L" },
|
|
2151
|
+
{ name: "垂直修正", shortcut: "Ctrl + C 或 Ctrl + Shift + C" },
|
|
2152
|
+
{ name: "命令确认", shortcut: "Enter" },
|
|
2153
|
+
{ name: "取消命令", shortcut: "Esc" },
|
|
2154
|
+
{ name: "回滚操作", shortcut: "Ctrl + Z" },
|
|
2155
|
+
{ name: "取消回滚操作", shortcut: "Ctrl + Y" }
|
|
2156
|
+
], xe = [
|
|
1823
2157
|
{
|
|
1824
2158
|
command: "default",
|
|
1825
2159
|
name: "默认",
|
|
1826
|
-
show:
|
|
2160
|
+
show: !1,
|
|
1827
2161
|
shortcut: ""
|
|
1828
2162
|
},
|
|
1829
2163
|
{
|
|
1830
2164
|
command: "draw-line",
|
|
1831
2165
|
name: "绘制线段",
|
|
1832
|
-
src:
|
|
1833
|
-
show:
|
|
2166
|
+
src: M["./assets/images/line.svg"].default,
|
|
2167
|
+
show: !0,
|
|
1834
2168
|
shortcut: "Ctrl + L"
|
|
1835
2169
|
},
|
|
1836
2170
|
{
|
|
1837
2171
|
command: "draw-door-line",
|
|
1838
2172
|
name: "绘制门线",
|
|
1839
|
-
show:
|
|
1840
|
-
src:
|
|
2173
|
+
show: !0,
|
|
2174
|
+
src: M["./assets/images/door.svg"].default,
|
|
1841
2175
|
shortcut: "Ctrl + M"
|
|
1842
2176
|
},
|
|
1843
2177
|
{
|
|
1844
2178
|
command: "draw-window-line",
|
|
1845
2179
|
name: "绘制窗户线",
|
|
1846
|
-
show:
|
|
1847
|
-
src:
|
|
2180
|
+
show: !0,
|
|
2181
|
+
src: M["./assets/images/window.svg"].default,
|
|
1848
2182
|
shortcut: "Ctrl + Q"
|
|
1849
2183
|
},
|
|
1850
2184
|
{
|
|
1851
2185
|
command: "point",
|
|
1852
2186
|
name: "点修改",
|
|
1853
|
-
show:
|
|
1854
|
-
src:
|
|
2187
|
+
show: !0,
|
|
2188
|
+
src: M["./assets/images/selectPoint.svg"].default,
|
|
1855
2189
|
shortcut: "Ctrl + P"
|
|
2190
|
+
},
|
|
2191
|
+
{
|
|
2192
|
+
command: rt.commandName,
|
|
2193
|
+
name: "裁剪线段",
|
|
2194
|
+
show: !0,
|
|
2195
|
+
src: M["./assets/images/cutLine.svg"].default,
|
|
2196
|
+
shortcut: "Ctrl + X"
|
|
2197
|
+
}
|
|
2198
|
+
], lt = [
|
|
2199
|
+
{
|
|
2200
|
+
command: "",
|
|
2201
|
+
name: "操作回滚",
|
|
2202
|
+
src: M["./assets/images/rollback.svg"].default,
|
|
2203
|
+
show: P(() => ae.value !== 0),
|
|
2204
|
+
shortcut: "Ctrl + Z",
|
|
2205
|
+
action() {
|
|
2206
|
+
C.commandManager.rollback();
|
|
2207
|
+
}
|
|
2208
|
+
},
|
|
2209
|
+
{
|
|
2210
|
+
command: "",
|
|
2211
|
+
name: "撤销操作回滚",
|
|
2212
|
+
src: M["./assets/images/revokeRollback.svg"].default,
|
|
2213
|
+
show: P(() => q.value !== 0),
|
|
2214
|
+
shortcut: "Ctrl + Y",
|
|
2215
|
+
class: "rotateY-[180deg]",
|
|
2216
|
+
action() {
|
|
2217
|
+
C.commandManager.revokeRollback();
|
|
2218
|
+
}
|
|
2219
|
+
},
|
|
2220
|
+
{
|
|
2221
|
+
command: Y.commandName,
|
|
2222
|
+
name: "合并",
|
|
2223
|
+
src: M["./assets/images/mergeLine.svg"].default,
|
|
2224
|
+
show: P(() => w.value === 2),
|
|
2225
|
+
shortcut: "Ctrl + G"
|
|
2226
|
+
},
|
|
2227
|
+
{
|
|
2228
|
+
command: $.commandName,
|
|
2229
|
+
name: "两点连接",
|
|
2230
|
+
show: P(() => w.value === 2),
|
|
2231
|
+
src: M["./assets/images/connection.svg"].default,
|
|
2232
|
+
shortcut: "Shift + L"
|
|
2233
|
+
},
|
|
2234
|
+
{
|
|
2235
|
+
command: ee.commandName,
|
|
2236
|
+
name: "延长线交点连接",
|
|
2237
|
+
show: P(() => w.value === 2),
|
|
2238
|
+
src: M["./assets/images/intersectionConnection.svg"].default,
|
|
2239
|
+
shortcut: "Ctrl + Shift + L"
|
|
2240
|
+
},
|
|
2241
|
+
{
|
|
2242
|
+
command: de.commandName,
|
|
2243
|
+
name: "线段垂直纠正",
|
|
2244
|
+
show: P(() => w.value === 1),
|
|
2245
|
+
src: M["./assets/images/verticalCorrection.svg"].default,
|
|
2246
|
+
shortcut: "Ctrl + C 或 Ctrl + Shift + C"
|
|
2247
|
+
},
|
|
2248
|
+
{
|
|
2249
|
+
command: se.commandName,
|
|
2250
|
+
name: "y轴垂直基准线",
|
|
2251
|
+
show: P(
|
|
2252
|
+
() => w.value === 1 && !D.selectLines[0].userData.isDoor
|
|
2253
|
+
),
|
|
2254
|
+
src: M["./assets/images/verticalLine.svg"].default,
|
|
2255
|
+
shortcut: "V"
|
|
2256
|
+
},
|
|
2257
|
+
{
|
|
2258
|
+
command: oe.commandName,
|
|
2259
|
+
name: "角度显示",
|
|
2260
|
+
show: P(() => w.value === 2 && D.selectLines[0].sameEndpoint(D.selectLines[1])),
|
|
2261
|
+
src: M["./assets/images/angle.svg"].default,
|
|
2262
|
+
shortcut: "r"
|
|
2263
|
+
},
|
|
2264
|
+
{
|
|
2265
|
+
command: ne.commandName,
|
|
2266
|
+
name: "全选",
|
|
2267
|
+
show: P(() => w.value !== C.renderManager.lines.length),
|
|
2268
|
+
src: M["./assets/images/selectAll.svg"].default,
|
|
2269
|
+
shortcut: "Ctrl + A"
|
|
2270
|
+
},
|
|
2271
|
+
{
|
|
2272
|
+
command: te.commandName,
|
|
2273
|
+
name: "清除窗户",
|
|
2274
|
+
show: P(() => Z.value),
|
|
2275
|
+
src: M["./assets/images/deleteSelectWindow.svg"].default,
|
|
2276
|
+
shortcut: "Q + Delete"
|
|
2277
|
+
},
|
|
2278
|
+
{
|
|
2279
|
+
command: X.commandName,
|
|
2280
|
+
name: "删除",
|
|
2281
|
+
show: P(() => w.value > 0),
|
|
2282
|
+
src: M["./assets/images/deleteSelectLine.svg"].default,
|
|
2283
|
+
shortcut: "Delete"
|
|
1856
2284
|
}
|
|
1857
2285
|
];
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
|
|
1862
|
-
|
|
1863
|
-
watch(whiteModelVisible, () => dxfSystem.Variable.set("whiteModelVisible", whiteModelVisible.value));
|
|
1864
|
-
dxfSystem.Variable.addEventListener("isLook", (e) => isLook.value = e.value);
|
|
1865
|
-
dxfSystem.Variable.addEventListener("originalLineVisible", (e) => originalLineVisible.value = e.value);
|
|
1866
|
-
dxfSystem.Variable.addEventListener("dxfVisible", (e) => dxfVisible.value = e.value);
|
|
1867
|
-
dxfSystem.Variable.addEventListener("whiteModelVisible", (e) => whiteModelVisible.value = e.value);
|
|
1868
|
-
const startedEventCancel = editor.commandManager.addEventListener("started", (e) => {
|
|
1869
|
-
currentCommand.value = e.name;
|
|
2286
|
+
W(_, () => localStorage.setItem("editorToolPosition", JSON.stringify(_.value))), W(K, () => localStorage.setItem("showShortcutKey", K.value + "")), W(u, () => {
|
|
2287
|
+
localStorage.setItem("toolBarExpand", u.value + ""), u.value && ye(() => e(_.value.left, _.value.top));
|
|
2288
|
+
}), W(r, () => g.Variable.set("originalLineVisible", r.value)), W(l, () => g.Variable.set("dxfVisible", l.value)), W(i, () => g.Variable.set("whiteModelVisible", i.value)), g.Variable.addEventListener("isLook", (x) => c.value = x.value), g.Variable.addEventListener("originalLineVisible", (x) => r.value = x.value), g.Variable.addEventListener("dxfVisible", (x) => l.value = x.value), g.Variable.addEventListener("whiteModelVisible", (x) => i.value = x.value);
|
|
2289
|
+
const ct = C.commandManager.addEventListener("started", (x) => {
|
|
2290
|
+
p.value = x.name;
|
|
1870
2291
|
});
|
|
1871
|
-
|
|
1872
|
-
|
|
1873
|
-
|
|
1874
|
-
|
|
1875
|
-
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
|
|
1879
|
-
|
|
1880
|
-
|
|
1881
|
-
|
|
1882
|
-
|
|
1883
|
-
|
|
1884
|
-
|
|
1885
|
-
}
|
|
1886
|
-
nextTick(() => resizeObserver.observe(elRef.value));
|
|
1887
|
-
}
|
|
1888
|
-
}, 20);
|
|
1889
|
-
defaultComponent.addEventListener("selectLineChange", () => {
|
|
1890
|
-
selectLineCount.value = defaultComponent.selectLines.length;
|
|
1891
|
-
hasWindowLine.value = defaultComponent.selectLines.some((l) => l.userData.isWindow);
|
|
2292
|
+
return localStorage.getItem("showShortcutKey") && (K.value = localStorage.getItem("showShortcutKey") === "true"), localStorage.getItem("toolBarExpand") && (u.value = localStorage.getItem("toolBarExpand") === "true"), tt(() => {
|
|
2293
|
+
f.value.style.display = "none", setTimeout(() => {
|
|
2294
|
+
if (f.value.style.display = "block", localStorage.getItem("editorToolPosition")) {
|
|
2295
|
+
const { left: x, top: v } = JSON.parse(localStorage.getItem("editorToolPosition") ?? "{}");
|
|
2296
|
+
e(x, v), ye(() => G.observe(h.value));
|
|
2297
|
+
} else
|
|
2298
|
+
ye(() => G.observe(h.value));
|
|
2299
|
+
}, 100), D.addEventListener("selectLineChange", () => {
|
|
2300
|
+
w.value = D.selectLines.length, Z.value = D.selectLines.some((x) => x.userData.isWindow);
|
|
2301
|
+
}), ["rollback", "completed", "revokeRollback"].forEach((x) => {
|
|
2302
|
+
C.commandManager.addEventListener(x, () => {
|
|
2303
|
+
setTimeout(() => {
|
|
2304
|
+
ae.value = C.commandManager.operationList.length, q.value = C.commandManager.rollbackList.length;
|
|
2305
|
+
});
|
|
2306
|
+
});
|
|
1892
2307
|
});
|
|
1893
|
-
})
|
|
1894
|
-
|
|
1895
|
-
|
|
1896
|
-
|
|
1897
|
-
|
|
1898
|
-
|
|
1899
|
-
|
|
1900
|
-
|
|
1901
|
-
|
|
1902
|
-
|
|
1903
|
-
|
|
2308
|
+
}), Nt(() => {
|
|
2309
|
+
E.mouseMoveEventProxylock = !1, ct(), G.disconnect();
|
|
2310
|
+
}), (x, v) => (I(), R("div", {
|
|
2311
|
+
ref_key: "elRef",
|
|
2312
|
+
ref: h,
|
|
2313
|
+
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]"
|
|
2314
|
+
}, [
|
|
2315
|
+
z(be, null, {
|
|
2316
|
+
default: V(() => [
|
|
2317
|
+
K.value ? (I(), R("div", oo, [
|
|
2318
|
+
(I(), R(ge, null, ke(Ce, (b) => k("div", {
|
|
2319
|
+
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",
|
|
2320
|
+
key: b.name
|
|
2321
|
+
}, [
|
|
2322
|
+
k("p", so, re(b.name), 1),
|
|
2323
|
+
k("span", ao, re(b.shortcut), 1)
|
|
2324
|
+
])), 64))
|
|
2325
|
+
])) : J("", !0)
|
|
2326
|
+
]),
|
|
2327
|
+
_: 1
|
|
2328
|
+
}),
|
|
2329
|
+
k("div", {
|
|
2330
|
+
ref_key: "toolBarRef",
|
|
2331
|
+
ref: f,
|
|
2332
|
+
style: Ae({ left: _.value.left + "px", top: _.value.top + "px" }),
|
|
2333
|
+
class: j(["overflow-hidden pointer-events-auto w-fit max-w-[260px] transition-[border-radius] text-[#333] absolute z-[11] bg-white select-none", { "rounded-[8px] ": u.value }]),
|
|
2334
|
+
onMousedown: v[9] || (v[9] = (b) => b.stopPropagation())
|
|
1904
2335
|
}, [
|
|
1905
|
-
|
|
1906
|
-
|
|
1907
|
-
|
|
1908
|
-
(openBlock(), createElementBlock(Fragment, null, renderList(shortcutKeys, (item) => {
|
|
1909
|
-
return createElementVNode("p", {
|
|
1910
|
-
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",
|
|
1911
|
-
key: item.name
|
|
1912
|
-
}, [
|
|
1913
|
-
createElementVNode("p", _hoisted_2, toDisplayString(item.name), 1),
|
|
1914
|
-
createElementVNode("span", _hoisted_3, toDisplayString(item.shortcut), 1)
|
|
1915
|
-
]);
|
|
1916
|
-
}), 64))
|
|
1917
|
-
])) : createCommentVNode("", true)
|
|
1918
|
-
]),
|
|
1919
|
-
_: 1
|
|
1920
|
-
}),
|
|
1921
|
-
createElementVNode("div", {
|
|
1922
|
-
ref_key: "toolBarRef",
|
|
1923
|
-
ref: toolBarRef,
|
|
1924
|
-
style: normalizeStyle({ left: toolBarPosition.value.left + "px", top: toolBarPosition.value.top + "px" }),
|
|
1925
|
-
class: normalizeClass(["pointer-events-auto max-w-[260px] transition-[border-radius] text-[#333] absolute z-[11] bg-white select-none", { "rounded-[8px] ": toolBarExpand.value }]),
|
|
1926
|
-
onMousedown: _cache[13] || (_cache[13] = (e) => e.stopPropagation())
|
|
2336
|
+
k("div", {
|
|
2337
|
+
onMousedown: s,
|
|
2338
|
+
class: j([{ "border-b-[#eee] border-b-1": u.value }, "flex flex-row justify-between header text-[14px] font-bold p-[10px 0px]"])
|
|
1927
2339
|
}, [
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
|
|
2340
|
+
v[11] || (v[11] = Rt('<div class="flex flex-row" data-v-205ff80d><div class="p-[2px_5px] flex items-center pointer-events-none" data-v-205ff80d><svg fill="#aaa" width="20" height="20" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" data-v-205ff80d><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-205ff80d></path></svg></div><h5 class="flex text-nowrap text-[12px] items-center pointer-events-none" data-v-205ff80d>绘制工具</h5></div>', 1)),
|
|
2341
|
+
k("div", {
|
|
2342
|
+
onMousedown: v[0] || (v[0] = (b) => b.stopPropagation()),
|
|
2343
|
+
onClick: v[1] || (v[1] = (b) => u.value = !u.value),
|
|
2344
|
+
class: "cursor-pointer flex items-center p-[0px_5px]"
|
|
1931
2345
|
}, [
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
|
|
1935
|
-
|
|
1936
|
-
|
|
2346
|
+
(I(), R("svg", {
|
|
2347
|
+
fill: "#666",
|
|
2348
|
+
class: j([{ "rotate-90": u.value }, "transition-all"]),
|
|
2349
|
+
viewBox: "0 0 1024 1024",
|
|
2350
|
+
version: "1.1",
|
|
2351
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2352
|
+
width: "12",
|
|
2353
|
+
height: "12"
|
|
2354
|
+
}, v[10] || (v[10] = [
|
|
2355
|
+
k("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)
|
|
2356
|
+
]), 2))
|
|
2357
|
+
], 32)
|
|
2358
|
+
], 34),
|
|
2359
|
+
u.value ? (I(), R("div", io, [
|
|
2360
|
+
k("ul", ro, [
|
|
2361
|
+
(I(), R(ge, null, ke(xe, (b) => (I(), R(ge, {
|
|
2362
|
+
key: b.command
|
|
1937
2363
|
}, [
|
|
1938
|
-
(
|
|
1939
|
-
|
|
1940
|
-
|
|
1941
|
-
|
|
1942
|
-
|
|
1943
|
-
|
|
1944
|
-
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
|
|
1951
|
-
|
|
1952
|
-
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
|
|
1958
|
-
|
|
1959
|
-
|
|
1960
|
-
|
|
2364
|
+
b.show ? (I(), R("li", {
|
|
2365
|
+
key: 0,
|
|
2366
|
+
onClick: (U) => t(b),
|
|
2367
|
+
class: j([{
|
|
2368
|
+
"!bg-[var(--primary-color)] text-[#fff]": p.value === b.command,
|
|
2369
|
+
"!cursor-no-drop": p.value !== b.command && p.value !== "default"
|
|
2370
|
+
}, "gap-[10px] text-[12px] hover:bg-[#ddd] transition-all rounded-[6px] p-[5px] flex flex-row items-center justify-between cursor-pointer"])
|
|
2371
|
+
}, [
|
|
2372
|
+
k("div", co, [
|
|
2373
|
+
k("div", mo, [
|
|
2374
|
+
k("img", {
|
|
2375
|
+
class: "size-[14px]",
|
|
2376
|
+
src: b.src,
|
|
2377
|
+
alt: "",
|
|
2378
|
+
srcset: ""
|
|
2379
|
+
}, null, 8, ho)
|
|
2380
|
+
]),
|
|
2381
|
+
k("span", uo, re(b.name), 1)
|
|
2382
|
+
]),
|
|
2383
|
+
p.value === b.command ? (I(), R("div", {
|
|
2384
|
+
key: 0,
|
|
2385
|
+
title: "取消命令(Esc)",
|
|
2386
|
+
class: "active:scale-[0.7] transition-all",
|
|
2387
|
+
onClick: v[2] || (v[2] = (U) => (y(C).cancelCommand(), U.stopPropagation()))
|
|
2388
|
+
}, v[12] || (v[12] = [
|
|
2389
|
+
k("svg", {
|
|
2390
|
+
fill: "#fff",
|
|
2391
|
+
width: "16",
|
|
2392
|
+
height: "16",
|
|
2393
|
+
viewBox: "0 0 1024 1024",
|
|
2394
|
+
version: "1.1",
|
|
2395
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
1961
2396
|
}, [
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
|
|
1965
|
-
|
|
1966
|
-
|
|
1967
|
-
|
|
1968
|
-
|
|
1969
|
-
|
|
1970
|
-
|
|
1971
|
-
|
|
1972
|
-
|
|
1973
|
-
|
|
1974
|
-
|
|
1975
|
-
|
|
1976
|
-
|
|
1977
|
-
|
|
1978
|
-
|
|
1979
|
-
|
|
1980
|
-
|
|
1981
|
-
|
|
1982
|
-
|
|
1983
|
-
|
|
1984
|
-
|
|
1985
|
-
|
|
1986
|
-
|
|
1987
|
-
|
|
1988
|
-
|
|
1989
|
-
|
|
1990
|
-
|
|
1991
|
-
|
|
1992
|
-
|
|
1993
|
-
|
|
1994
|
-
|
|
1995
|
-
|
|
1996
|
-
|
|
1997
|
-
|
|
1998
|
-
|
|
1999
|
-
|
|
2000
|
-
|
|
2001
|
-
|
|
2002
|
-
|
|
2003
|
-
|
|
2004
|
-
|
|
2005
|
-
|
|
2006
|
-
|
|
2007
|
-
|
|
2008
|
-
|
|
2009
|
-
|
|
2010
|
-
|
|
2011
|
-
|
|
2012
|
-
|
|
2013
|
-
|
|
2014
|
-
|
|
2015
|
-
|
|
2016
|
-
|
|
2017
|
-
|
|
2018
|
-
|
|
2019
|
-
|
|
2020
|
-
|
|
2021
|
-
}
|
|
2022
|
-
|
|
2023
|
-
|
|
2024
|
-
|
|
2025
|
-
|
|
2026
|
-
|
|
2027
|
-
|
|
2028
|
-
|
|
2029
|
-
|
|
2030
|
-
|
|
2031
|
-
|
|
2032
|
-
|
|
2033
|
-
}
|
|
2034
|
-
|
|
2035
|
-
|
|
2036
|
-
|
|
2037
|
-
|
|
2038
|
-
|
|
2039
|
-
|
|
2040
|
-
|
|
2041
|
-
|
|
2042
|
-
|
|
2043
|
-
_: 1,
|
|
2044
|
-
__: [19]
|
|
2045
|
-
}),
|
|
2046
|
-
createVNode(unref(ElButton), {
|
|
2047
|
-
style: { "padding": "5px", "font-size": "10px" },
|
|
2048
|
-
size: "small",
|
|
2049
|
-
type: "primary",
|
|
2050
|
-
onClick: _cache[7] || (_cache[7] = ($event) => console.log(unref(dxfSystem).Dxf.originalData))
|
|
2051
|
-
}, {
|
|
2052
|
-
default: withCtx(() => _cache[20] || (_cache[20] = [
|
|
2053
|
-
createTextVNode(" 打印Json ", -1)
|
|
2054
|
-
])),
|
|
2055
|
-
_: 1,
|
|
2056
|
-
__: [20]
|
|
2057
|
-
})
|
|
2058
|
-
])) : createCommentVNode("", true),
|
|
2059
|
-
createVNode(Transition, null, {
|
|
2060
|
-
default: withCtx(() => [
|
|
2061
|
-
createElementVNode("div", _hoisted_13, [
|
|
2062
|
-
selectLineCount.value ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
2063
|
-
selectLineCount.value == 2 ? (openBlock(), createElementBlock("div", {
|
|
2064
|
-
key: 0,
|
|
2065
|
-
onClick: _cache[8] || (_cache[8] = ($event) => unref(defaultComponent).mergeLine()),
|
|
2066
|
-
title: "合并(Ctrl + G)",
|
|
2067
|
-
class: "active:scale-[0.8] transition-all cursor-pointer"
|
|
2068
|
-
}, _cache[21] || (_cache[21] = [
|
|
2069
|
-
createElementVNode("svg", {
|
|
2070
|
-
viewBox: "0 0 1024 1024",
|
|
2071
|
-
version: "1.1",
|
|
2072
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
2073
|
-
fill: "#555",
|
|
2074
|
-
width: "16",
|
|
2075
|
-
height: "16"
|
|
2076
|
-
}, [
|
|
2077
|
-
createElementVNode("path", { d: "M114.176 46.528h618.496c37.312 0.064 67.584 30.336 67.648 67.648v618.56c0 37.248-30.336 67.584-67.648 67.584H114.176A67.776 67.776 0 0 1 46.528 732.8V114.176c0-37.312 30.336-67.648 67.648-67.648z m2.176 686.208l616.32-2.24-2.176-616.32-614.144 2.176v616.32zM907.648 291.2l2.176 616.32H291.264a34.88 34.88 0 1 0 0 69.888h618.56c37.312 0 67.648-30.336 67.648-67.648V291.264a34.88 34.88 0 1 0-69.824 0z" })
|
|
2078
|
-
], -1)
|
|
2079
|
-
]))) : createCommentVNode("", true),
|
|
2080
|
-
selectLineCount.value == 2 ? (openBlock(), createElementBlock("div", {
|
|
2081
|
-
key: 1,
|
|
2082
|
-
onClick: _cache[9] || (_cache[9] = ($event) => unref(defaultComponent).connection()),
|
|
2083
|
-
title: "两点连接(Shift + L)",
|
|
2084
|
-
class: "active:scale-[0.8] transition-all cursor-pointer"
|
|
2085
|
-
}, _cache[22] || (_cache[22] = [
|
|
2086
|
-
createElementVNode("svg", {
|
|
2087
|
-
viewBox: "0 0 1024 1024",
|
|
2088
|
-
version: "1.1",
|
|
2089
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
2090
|
-
fill: "#555",
|
|
2091
|
-
width: "16",
|
|
2092
|
-
height: "16"
|
|
2093
|
-
}, [
|
|
2094
|
-
createElementVNode("path", { d: "M639.999191 893.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 4.199973-12.799919 10.599933-14.999905 49.09969-17.299891 84.399467-63.599598 85.39946-118.399252C641.299183 59.902862 583.399549 0.503237 512.899994 0.00324 441.800444-0.496757 384.000809 57.00288 384.000809 128.002431c0 55.699648 35.599775 103.099349 85.299461 120.699238 6.39996 2.299985 10.699932 8.299948 10.699932 15.099904v496.396864c0 6.799957-4.299973 12.799919-10.699932 15.099904-49.699686 17.599889-85.299461 64.999589-85.299461 120.699238 0 70.999551 57.799635 128.499188 128.899185 127.999191 70.499555-0.499997 128.399189-59.899622 127.099197-130.399176zM448.000404 128.002431c0-35.299777 28.699819-63.999596 63.999596-63.999595s63.999596 28.699819 63.999596 63.999595-28.699819 63.999596-63.999596 63.999596-63.999596-28.699819-63.999596-63.999596z m0 767.995148c0-35.299777 28.699819-63.999596 63.999596-63.999596s63.999596 28.699819 63.999596 63.999596-28.699819 63.999596-63.999596 63.999595-63.999596-28.699819-63.999596-63.999595z" })
|
|
2095
|
-
], -1)
|
|
2096
|
-
]))) : createCommentVNode("", true),
|
|
2097
|
-
selectLineCount.value == 2 ? (openBlock(), createElementBlock("div", {
|
|
2098
|
-
key: 2,
|
|
2099
|
-
onClick: _cache[10] || (_cache[10] = ($event) => unref(defaultComponent).intersectionConnection()),
|
|
2100
|
-
title: "延长线交点连接(Ctrl + Shift + L)",
|
|
2101
|
-
class: "active:scale-[0.8] transition-all cursor-pointer"
|
|
2102
|
-
}, _cache[23] || (_cache[23] = [
|
|
2103
|
-
createElementVNode("svg", {
|
|
2104
|
-
viewBox: "0 0 1024 1024",
|
|
2105
|
-
version: "1.1",
|
|
2106
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
2107
|
-
fill: "#555",
|
|
2108
|
-
width: "16",
|
|
2109
|
-
height: "16"
|
|
2110
|
-
}, [
|
|
2111
|
-
createElementVNode("path", { d: "M491.80027198 557.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 0-100.99864286 45.44938977-100.99864287 100.99864285 0 15.14979706 5.04993234 35.34952507 15.14979568 50.49932212 10.0998647 15.14979706 20.19972802 30.29959271 35.34952506 35.34952508 15.14979706 10.0998647 35.34952507 15.14979706 50.49932213 15.14979567 55.54925309 0 100.99864286-45.44938977 100.99864286-100.99864287 0-15.14979706-5.04993234-35.34952507-15.14979568-50.49932074z m-85.84884718 100.99864286h-15.14979706c-20.19972802-5.04993234-30.29959271-20.19972802-35.34952507-35.34952507V612.99864286c0-30.29959271 25.24966037-50.49932212 50.49932213-50.49932074h10.09986469c15.14979706 5.04993234 30.29959271 15.14979706 35.34952507 35.34952507v15.14979567c5.04993234 25.24966037-20.19972802 45.44938977-45.44938976 45.44938977z" }),
|
|
2112
|
-
createElementVNode("path", { d: "M390.80162774 658.44803263l-40.39945604 40.39945743-227.24694747 222.19701373-35.34952506-35.34952508 227.24694745-227.24694608 40.39945605-40.39945743c5.04993234 20.19972802 20.19972802 35.34952507 35.34952507 40.39945743zM648.34816793 405.9514248l-40.39945742 40.3994574-116.14843853 116.14843992-40.39945742 35.34952507c-5.04993234-20.19972802-20.19972802-30.29959271-35.34952507-35.34952507l40.39945742-40.39945742 116.14843853-111.09850756 35.34952507-35.34952507c10.0998647 15.14979706 20.19972802 25.24966037 40.39945742 30.29959273zM926.09443614 133.25508894L749.34681078 310.00271428l-40.3994574 40.39945742c-5.04993234-20.19972802-15.14979706-35.34952507-30.29959272-40.39945742l35.34952506-40.39945742 176.74762534-176.74762535 35.34952508 40.39945743z" }),
|
|
2113
|
-
createElementVNode("path", { d: "M749.34681078 310.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 0-100.99864286 45.44938977-100.99864286 100.99864286 0 20.19972802 5.04993234 40.39945743 15.14979567 55.54925447 10.0998647 15.14979706 20.19972802 25.24966037 35.34952507 35.34952507 15.14979706 10.0998647 30.29959271 15.14979706 50.49932212 15.14979567 55.54925309 0 100.99864286-45.44938977 100.99864286-100.99864286 0-25.24966037-5.04993234-40.39945743-10.09986471-55.54925309z m-90.89877815 95.94871052h-10.0998647c-20.19972802-5.04993234-35.34952507-15.14979706-40.39945742-35.34952509 0-5.04993234-5.04993234-10.0998647-5.04993234-15.14979704 0-30.29959271 25.24966037-50.49932212 50.49932212-50.49932074 5.04993234 0 10.0998647 0 15.14979704 5.04993235 15.14979706 5.04993234 30.29959271 20.19972802 30.29959273 40.39945742v10.09986332c10.0998647 25.24966037-15.14979706 45.44938977-40.39945743 45.44938978z" })
|
|
2114
|
-
], -1)
|
|
2115
|
-
]))) : createCommentVNode("", true),
|
|
2116
|
-
hasWindowLine.value ? (openBlock(), createElementBlock("div", {
|
|
2117
|
-
key: 3,
|
|
2118
|
-
onClick: _cache[11] || (_cache[11] = ($event) => unref(defaultComponent).deleteSelectWindow()),
|
|
2119
|
-
title: "清除窗户(Q + Delete)",
|
|
2120
|
-
class: "active:scale-[0.8] transition-all cursor-pointer"
|
|
2121
|
-
}, _cache[24] || (_cache[24] = [
|
|
2122
|
-
createElementVNode("svg", {
|
|
2123
|
-
viewBox: "0 0 1024 1024",
|
|
2124
|
-
version: "1.1",
|
|
2125
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
2126
|
-
fill: "#555",
|
|
2127
|
-
width: "16",
|
|
2128
|
-
height: "16"
|
|
2129
|
-
}, [
|
|
2130
|
-
createElementVNode("path", { d: "M220.451548 913.518482V318.145854c0-27.62038 22.505495-50.125874 50.125875-50.125874H865.95005c27.62038 0 50.125874 22.505495 50.125874 50.125874v218.917083h59.332667V318.145854c0-60.355644-49.102897-109.458541-109.458541-109.458541h-39.896104v-99.228772C826.053946 49.102897 776.951049 0 716.595405 0H121.222777C60.867133 0 11.764236 49.102897 11.764236 109.458541V705.854146c0 60.355644 49.102897 109.458541 109.458541 109.458541h39.896104v99.228772c0 60.355644 49.102897 109.458541 109.458542 109.458541h257.790209v-59.332667H269.554446c-26.597403-1.022977-49.102897-23.528472-49.102898-51.148851z m-59.332667-595.372628v436.811189h-39.896104c-27.62038 0-50.125874-22.505495-50.125874-50.125874V109.458541c0-27.62038 22.505495-50.125874 50.125874-50.125874H716.595405c27.62038 0 50.125874 22.505495 50.125874 50.125874v99.228772H269.554446c-59.332667 0-108.435564 49.102897-108.435565 109.458541z" }),
|
|
2131
|
-
createElementVNode("path", { d: "M902.777223 854.185814l98.205794-98.205794c15.344655-15.344655 15.344655-40.919081 0-56.263736s-40.919081-15.344655-56.263736 0L846.513487 797.922078 747.284715 699.716284c-15.344655-15.344655-40.919081-15.344655-56.263736 0s-15.344655 40.919081 0 56.263736l98.205794 98.205794-98.205794 98.205794c-15.344655 15.344655-15.344655 40.919081 0 56.263737s40.919081 15.344655 56.263736 0l98.205794-98.205795 98.205795 98.205795c15.344655 15.344655 40.919081 15.344655 56.263736 0s15.344655-40.919081 0-56.263737l-97.182817-98.205794z" })
|
|
2132
|
-
], -1)
|
|
2133
|
-
]))) : createCommentVNode("", true),
|
|
2134
|
-
createElementVNode("div", {
|
|
2135
|
-
onClick: _cache[12] || (_cache[12] = ($event) => unref(defaultComponent).deleteSelectLine()),
|
|
2136
|
-
title: "删除(Delete)",
|
|
2137
|
-
class: "active:scale-[0.8] transition-all cursor-pointer"
|
|
2138
|
-
}, _cache[25] || (_cache[25] = [
|
|
2139
|
-
createElementVNode("svg", {
|
|
2140
|
-
viewBox: "0 0 1024 1024",
|
|
2141
|
-
version: "1.1",
|
|
2142
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
2143
|
-
fill: "#555",
|
|
2144
|
-
width: "16",
|
|
2145
|
-
height: "16"
|
|
2146
|
-
}, [
|
|
2147
|
-
createElementVNode("path", { d: "M909.050991 169.476903l-217.554898 0 0-31.346939c0-39.5866-32.205493-71.792093-71.793116-71.792093L408.15591 66.337871c-39.5866 0-71.792093 32.205493-71.792093 71.792093l0 31.346939L113.349581 169.476903c-11.013845 0-19.942191 8.940626-19.942191 19.954471s8.928347 19.954471 19.942191 19.954471l84.264149 0 0 640.687918c0 60.479443 49.203632 109.683075 109.683075 109.683075l416.474366 0c60.479443 0 109.683075-49.203632 109.683075-109.683075L833.454246 209.385844l75.595722 0c11.012821 0 19.942191-8.940626 19.942191-19.954471S920.063813 169.476903 909.050991 169.476903zM376.2482 138.130987c0-17.593703 14.314007-31.907711 31.907711-31.907711l211.547067 0c17.593703 0 31.907711 14.314007 31.907711 31.907711l0 31.346939L376.2482 169.477926 376.2482 138.130987zM793.569864 850.074785c0 38.486546-31.312146 69.798692-69.798692 69.798692L307.297828 919.873478c-38.486546 0-69.798692-31.312146-69.798692-69.798692L237.499136 211.042577l556.070728 0L793.569864 850.074785zM510.662539 861.276918c11.012821 0 19.954471-8.92937 19.954471-19.942191L530.61701 294.912753c0-11.013845-8.94165-19.942191-19.954471-19.942191s-19.954471 8.928347-19.954471 19.942191L490.708068 841.334727C490.708068 852.347548 499.649717 861.276918 510.662539 861.276918zM374.562814 801.449321c11.012821 0 19.954471-8.92937 19.954471-19.942191L394.517285 354.74035c0-11.013845-8.94165-19.942191-19.954471-19.942191s-19.954471 8.928347-19.954471 19.942191l0 426.76678C354.608344 792.519951 363.549993 801.449321 374.562814 801.449321zM649.832182 801.449321c11.012821 0 19.954471-8.92937 19.954471-19.942191L669.786653 354.74035c0-11.013845-8.94165-19.942191-19.954471-19.942191s-19.954471 8.928347-19.954471 19.942191l0 426.76678C629.877711 792.519951 638.81936 801.449321 649.832182 801.449321z" })
|
|
2148
|
-
], -1)
|
|
2149
|
-
]))
|
|
2150
|
-
], 64)) : (openBlock(), createElementBlock("div", _hoisted_14, " 无可用操作 "))
|
|
2151
|
-
])
|
|
2152
|
-
]),
|
|
2153
|
-
_: 1
|
|
2397
|
+
k("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" }),
|
|
2398
|
+
k("path", { d: "M236.437333 463.914667l549.333333 0 0 96.874667-549.333333 0 0-96.874667Z" })
|
|
2399
|
+
], -1)
|
|
2400
|
+
]))) : b.shortcut ? (I(), R("div", po, re(b.shortcut), 1)) : J("", !0)
|
|
2401
|
+
], 10, lo)) : J("", !0)
|
|
2402
|
+
], 64))), 64))
|
|
2403
|
+
]),
|
|
2404
|
+
k("div", go, [
|
|
2405
|
+
z(y(Fe), {
|
|
2406
|
+
size: "small",
|
|
2407
|
+
modelValue: K.value,
|
|
2408
|
+
"onUpdate:modelValue": v[3] || (v[3] = (b) => K.value = b),
|
|
2409
|
+
label: "快捷键提示"
|
|
2410
|
+
}, null, 8, ["modelValue"]),
|
|
2411
|
+
z(y(Fe), {
|
|
2412
|
+
size: "small",
|
|
2413
|
+
modelValue: l.value,
|
|
2414
|
+
"onUpdate:modelValue": v[4] || (v[4] = (b) => l.value = b),
|
|
2415
|
+
label: "dxf"
|
|
2416
|
+
}, null, 8, ["modelValue"])
|
|
2417
|
+
]),
|
|
2418
|
+
x.permission === "admin" ? (I(), R("div", vo, [
|
|
2419
|
+
z(y(ue), {
|
|
2420
|
+
style: { padding: "5px", "font-size": "10px" },
|
|
2421
|
+
size: "small",
|
|
2422
|
+
type: "success",
|
|
2423
|
+
onClick: o
|
|
2424
|
+
}, {
|
|
2425
|
+
default: V(() => v[13] || (v[13] = [
|
|
2426
|
+
ie(" 选择文件 ", -1)
|
|
2427
|
+
])),
|
|
2428
|
+
_: 1,
|
|
2429
|
+
__: [13]
|
|
2430
|
+
}),
|
|
2431
|
+
z(y(ue), {
|
|
2432
|
+
style: { padding: "5px", "font-size": "10px" },
|
|
2433
|
+
size: "small",
|
|
2434
|
+
type: "primary",
|
|
2435
|
+
onClick: v[5] || (v[5] = (b) => console.log(y(g).Dxf.originalData))
|
|
2436
|
+
}, {
|
|
2437
|
+
default: V(() => v[14] || (v[14] = [
|
|
2438
|
+
ie(" 打印Json ", -1)
|
|
2439
|
+
])),
|
|
2440
|
+
_: 1,
|
|
2441
|
+
__: [14]
|
|
2442
|
+
}),
|
|
2443
|
+
z(y(ue), {
|
|
2444
|
+
style: { padding: "5px", "font-size": "10px" },
|
|
2445
|
+
size: "small",
|
|
2446
|
+
type: "primary",
|
|
2447
|
+
onClick: v[6] || (v[6] = (b) => y(g).Dxf.download("test.dxf"))
|
|
2448
|
+
}, {
|
|
2449
|
+
default: V(() => v[15] || (v[15] = [
|
|
2450
|
+
ie(" 下载DXF ", -1)
|
|
2451
|
+
])),
|
|
2452
|
+
_: 1,
|
|
2453
|
+
__: [15]
|
|
2454
|
+
}),
|
|
2455
|
+
z(y(ue), {
|
|
2456
|
+
style: { padding: "5px", "font-size": "10px" },
|
|
2457
|
+
size: "small",
|
|
2458
|
+
type: "primary",
|
|
2459
|
+
onClick: v[7] || (v[7] = (b) => y(g).AngleCorrectionDxf.downloadImage("dxf.jpg"))
|
|
2460
|
+
}, {
|
|
2461
|
+
default: V(() => v[16] || (v[16] = [
|
|
2462
|
+
ie(" 下载JPG ", -1)
|
|
2463
|
+
])),
|
|
2464
|
+
_: 1,
|
|
2465
|
+
__: [16]
|
|
2466
|
+
}),
|
|
2467
|
+
z(y(ue), {
|
|
2468
|
+
style: { padding: "5px", "font-size": "10px" },
|
|
2469
|
+
size: "small",
|
|
2470
|
+
type: "primary",
|
|
2471
|
+
onClick: v[8] || (v[8] = (b) => y(F).downloadGltf("test.glb", !0))
|
|
2472
|
+
}, {
|
|
2473
|
+
default: V(() => v[17] || (v[17] = [
|
|
2474
|
+
ie(" 下载白膜 ", -1)
|
|
2475
|
+
])),
|
|
2476
|
+
_: 1,
|
|
2477
|
+
__: [17]
|
|
2154
2478
|
})
|
|
2155
|
-
])) :
|
|
2156
|
-
|
|
2157
|
-
|
|
2158
|
-
|
|
2159
|
-
|
|
2160
|
-
|
|
2161
|
-
|
|
2162
|
-
|
|
2163
|
-
|
|
2164
|
-
|
|
2165
|
-
|
|
2166
|
-
|
|
2167
|
-
}
|
|
2168
|
-
|
|
2169
|
-
|
|
2479
|
+
])) : J("", !0),
|
|
2480
|
+
z(be, null, {
|
|
2481
|
+
default: V(() => [
|
|
2482
|
+
k("div", fo, [
|
|
2483
|
+
z(Ot, null, {
|
|
2484
|
+
default: V(() => [
|
|
2485
|
+
(I(), R(ge, null, ke(lt, (b) => k("div", {
|
|
2486
|
+
onClick: (U) => b.show.value && p.value === "default" && (b.action ? b.action() : y(C).commandManager.start(b.command, [...y(D).selectLines])),
|
|
2487
|
+
title: `${b.name}(${b.shortcut})`,
|
|
2488
|
+
class: j(["size-[20px] flex justify-center items-center relative overflow-hidden active:scale-[0.8] border-1 border-[#ccc] rounded-[4px] transition-all cursor-pointer", {
|
|
2489
|
+
"opacity-30 bg-[#ccc] !cursor-no-drop active:!scale-[1]": !b.show.value || p.value !== "default",
|
|
2490
|
+
[b.class ?? ""]: !0
|
|
2491
|
+
}]),
|
|
2492
|
+
key: b.command
|
|
2493
|
+
}, [
|
|
2494
|
+
k("img", {
|
|
2495
|
+
class: "size-[14px]",
|
|
2496
|
+
src: b.src
|
|
2497
|
+
}, null, 8, wo)
|
|
2498
|
+
], 10, yo)), 64))
|
|
2499
|
+
]),
|
|
2500
|
+
_: 1
|
|
2501
|
+
})
|
|
2502
|
+
])
|
|
2503
|
+
]),
|
|
2504
|
+
_: 1
|
|
2505
|
+
})
|
|
2506
|
+
])) : J("", !0)
|
|
2507
|
+
], 38)
|
|
2508
|
+
], 512));
|
|
2509
|
+
}
|
|
2510
|
+
}), Co = (d, e) => {
|
|
2511
|
+
const t = d.__vccOpts || d;
|
|
2512
|
+
for (const [n, o] of e)
|
|
2513
|
+
t[n] = o;
|
|
2514
|
+
return t;
|
|
2515
|
+
}, xo = /* @__PURE__ */ Co(bo, [["__scopeId", "data-v-205ff80d"]]);
|
|
2516
|
+
let dt = class extends Se {
|
|
2170
2517
|
static name = "Editor";
|
|
2171
|
-
container = new
|
|
2518
|
+
container = new m.Group();
|
|
2172
2519
|
get renderer() {
|
|
2173
2520
|
return this.parent?.findComponentByName("Renderer");
|
|
2174
2521
|
}
|
|
@@ -2190,32 +2537,55 @@ let Editor$1 = class Editor extends Component {
|
|
|
2190
2537
|
get domContainer() {
|
|
2191
2538
|
return this.parent?.findComponentByName("DomContainer");
|
|
2192
2539
|
}
|
|
2193
|
-
commandManager = new
|
|
2194
|
-
plane = new
|
|
2540
|
+
commandManager = new yn();
|
|
2541
|
+
plane = new m.Mesh(new m.PlaneGeometry(2e3, 2e3, 2, 2));
|
|
2195
2542
|
app;
|
|
2196
2543
|
domElement = document.createElement("div");
|
|
2197
2544
|
viewPermission;
|
|
2198
|
-
|
|
2199
|
-
|
|
2200
|
-
|
|
2201
|
-
|
|
2202
|
-
|
|
2545
|
+
imgEl = document.createElement("img");
|
|
2546
|
+
imgWidth = 80;
|
|
2547
|
+
constructor(e) {
|
|
2548
|
+
super(), this.viewPermission = e, Object.assign(this.imgEl.style, {
|
|
2549
|
+
position: "absolute",
|
|
2550
|
+
left: "5px",
|
|
2551
|
+
top: "5px",
|
|
2552
|
+
width: `${this.imgWidth}px`,
|
|
2553
|
+
height: `${this.imgWidth}px`,
|
|
2554
|
+
borderRadius: "10px",
|
|
2555
|
+
objectFit: "contain",
|
|
2556
|
+
background: "rgba(255,255,255,0.2)",
|
|
2557
|
+
pointerEvents: "none",
|
|
2558
|
+
cursor: "pointer",
|
|
2559
|
+
transition: "all 0.25s"
|
|
2560
|
+
}), this.imgEl.addEventListener("mousedown", (t) => t.stopPropagation()), this.imgEl.addEventListener("mouseup", (t) => t.stopPropagation()), this.imgEl.addEventListener("mousemove", (t) => t.stopPropagation()), this.imgEl.draggable = !1;
|
|
2561
|
+
}
|
|
2562
|
+
onAddFromParent(e) {
|
|
2203
2563
|
setTimeout(() => this.openEdit(), 10);
|
|
2204
|
-
const
|
|
2205
|
-
|
|
2206
|
-
|
|
2207
|
-
|
|
2208
|
-
this.container.add(this.plane);
|
|
2209
|
-
this.plane.visible = false;
|
|
2210
|
-
const cancelEvent = this.addEventListener("update", () => {
|
|
2211
|
-
if (this.domContainer.domElement.parentElement) {
|
|
2212
|
-
this.domContainer.domElement.parentElement.appendChild(this.domElement);
|
|
2213
|
-
cancelEvent();
|
|
2214
|
-
}
|
|
2564
|
+
const t = new m.GridHelper(200, 100, 6710886, 4473924);
|
|
2565
|
+
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;
|
|
2566
|
+
const n = this.addEventListener("update", () => {
|
|
2567
|
+
this.domContainer.domElement.parentElement && (this.domContainer.domElement.parentElement.appendChild(this.domElement), this.domContainer.domElement.parentElement.appendChild(this.imgEl), n());
|
|
2215
2568
|
});
|
|
2216
2569
|
setTimeout(() => {
|
|
2217
|
-
this.app =
|
|
2218
|
-
|
|
2570
|
+
this.app = Ft(xo, { dxfSystem: this.parent, permission: this.viewPermission }), this.app.mount(this.domElement);
|
|
2571
|
+
}), e.AngleCorrectionDxf.addEventListener("lineOffset", async () => {
|
|
2572
|
+
this.imgEl.src && URL.revokeObjectURL(this.imgEl.src), setTimeout(async () => {
|
|
2573
|
+
this.imgEl.src = URL.createObjectURL(await e.AngleCorrectionDxf.toDxfImageBlob("Centimeters", "image/png", "transparent"));
|
|
2574
|
+
});
|
|
2575
|
+
}), this.domEventRegister.addEventListener("mousedown", (o) => {
|
|
2576
|
+
o.x < this.imgWidth + 10 && o.x > 10 && o.y < this.imgWidth && o.y > 10 && Object.assign(this.imgEl.style, {
|
|
2577
|
+
width: `${Math.min(this.imgWidth * 10, this.renderer.width * 0.9)}px`,
|
|
2578
|
+
height: `${Math.min(this.imgWidth * 10, this.renderer.height * 0.9)}px`,
|
|
2579
|
+
background: "rgba(0,0,0,1)",
|
|
2580
|
+
zIndex: 100
|
|
2581
|
+
});
|
|
2582
|
+
}), this.domEventRegister.addEventListener("mousemove", (o) => {
|
|
2583
|
+
o.x < this.imgWidth + 10 && o.x > 10 && o.y < this.imgWidth && o.y > 10 || Object.assign(this.imgEl.style, {
|
|
2584
|
+
width: `${this.imgWidth}px`,
|
|
2585
|
+
height: `${this.imgWidth}px`,
|
|
2586
|
+
background: "rgba(255,255,255,0.2)",
|
|
2587
|
+
zIndex: 0
|
|
2588
|
+
});
|
|
2219
2589
|
});
|
|
2220
2590
|
}
|
|
2221
2591
|
/**
|
|
@@ -2226,170 +2596,113 @@ let Editor$1 = class Editor extends Component {
|
|
|
2226
2596
|
type: "cancelCommand"
|
|
2227
2597
|
});
|
|
2228
2598
|
}
|
|
2229
|
-
coords = new
|
|
2230
|
-
pointerPosition = new
|
|
2599
|
+
coords = new m.Vector2();
|
|
2600
|
+
pointerPosition = new m.Vector2();
|
|
2231
2601
|
_exitEditCallBack;
|
|
2232
2602
|
/**
|
|
2233
2603
|
* 打开编辑器
|
|
2234
2604
|
*/
|
|
2235
2605
|
openEdit() {
|
|
2236
|
-
const
|
|
2237
|
-
this.container.position.z =
|
|
2238
|
-
|
|
2239
|
-
|
|
2240
|
-
|
|
2241
|
-
|
|
2242
|
-
|
|
2243
|
-
|
|
2244
|
-
|
|
2245
|
-
|
|
2246
|
-
|
|
2247
|
-
const y = -(domEventRegister.pointer.y / size.y * 2 - 1);
|
|
2248
|
-
coords.set(x, y);
|
|
2249
|
-
raycaster.setFromCamera(coords, renderer.camera);
|
|
2250
|
-
const intersections = raycaster.intersectObject(this.plane);
|
|
2251
|
-
if (intersections.length) {
|
|
2252
|
-
pointerPosition.copy(intersections[0].point);
|
|
2253
|
-
this.dispatchEvent({
|
|
2254
|
-
type: "pointerPositionChange",
|
|
2255
|
-
position: pointerPosition
|
|
2256
|
-
});
|
|
2257
|
-
}
|
|
2606
|
+
const e = this.renderer, t = this.domEventRegister, n = this.dxf, o = e.orbitControls, s = e.camera, a = n.box.center, r = e.camera.position.clone(), l = o?.target?.clone(), i = new m.Vector2(), c = new m.Raycaster(), h = this.coords, f = this.pointerPosition;
|
|
2607
|
+
this.container.position.z = n.originalZAverage, e.scene.add(this.container), o && (s.position.set(a.x, a.y, 15), o.target.set(a.x, a.y, 0), o.enableRotate = !1);
|
|
2608
|
+
const u = () => {
|
|
2609
|
+
e.renderer.getSize(i);
|
|
2610
|
+
const p = t.pointer.x / i.x * 2 - 1, g = -(t.pointer.y / i.y * 2 - 1);
|
|
2611
|
+
h.set(p, g), c.setFromCamera(h, e.camera.children.length ? e.camera.children[0] : e.camera);
|
|
2612
|
+
const E = c.intersectObject(this.plane);
|
|
2613
|
+
E.length && (f.copy(E[0].point), this.dispatchEvent({
|
|
2614
|
+
type: "pointerPositionChange",
|
|
2615
|
+
position: f
|
|
2616
|
+
}));
|
|
2258
2617
|
};
|
|
2259
|
-
|
|
2260
|
-
|
|
2261
|
-
this.commandManager.start("default");
|
|
2262
|
-
this._exitEditCallBack = () => {
|
|
2263
|
-
domEventRegister.removeEventListener("mousemove", mousemoveFun);
|
|
2264
|
-
camera.position.copy(cameraPosition);
|
|
2265
|
-
orbitControls.enableRotate = true;
|
|
2266
|
-
orbitControls.target.copy(target);
|
|
2618
|
+
t.addEventListener("mousemove", u), this.commandManager.disabled = !1, this.commandManager.start("default"), this._exitEditCallBack = () => {
|
|
2619
|
+
t.removeEventListener("mousemove", u), o && (s.position.copy(r), o.enableRotate = !0, o.target.copy(l));
|
|
2267
2620
|
};
|
|
2268
2621
|
}
|
|
2269
2622
|
/**
|
|
2270
2623
|
* 退出编辑
|
|
2271
2624
|
*/
|
|
2272
2625
|
exitEdit() {
|
|
2273
|
-
|
|
2274
|
-
this._exitEditCallBack();
|
|
2275
|
-
this._exitEditCallBack = void 0;
|
|
2276
|
-
this.commandManager.disabled = true;
|
|
2277
|
-
}
|
|
2626
|
+
typeof this._exitEditCallBack == "function" && (this._exitEditCallBack(), this._exitEditCallBack = void 0, this.commandManager.disabled = !0);
|
|
2278
2627
|
}
|
|
2279
2628
|
destroy() {
|
|
2280
|
-
super.destroy();
|
|
2281
|
-
this.exitEdit();
|
|
2282
|
-
this.renderer.scene.remove(this.container);
|
|
2283
|
-
this.domElement.remove();
|
|
2284
|
-
this.app?.unmount();
|
|
2629
|
+
super.destroy(), this.exitEdit(), this.renderer.scene.remove(this.container), this.domElement.remove(), this.app?.unmount();
|
|
2285
2630
|
}
|
|
2286
2631
|
};
|
|
2287
|
-
class
|
|
2632
|
+
class Eo extends O {
|
|
2288
2633
|
static name = "PointDrag";
|
|
2289
|
-
container = new
|
|
2634
|
+
container = new m.Group();
|
|
2290
2635
|
interruptKeys = ["escape"];
|
|
2291
2636
|
shortcutKeys = ["control", "p"];
|
|
2292
2637
|
commandName = "point";
|
|
2293
|
-
onAddFromParent(
|
|
2294
|
-
super.onAddFromParent(
|
|
2295
|
-
this.
|
|
2296
|
-
this.
|
|
2297
|
-
const commandFlow = this.commandManager.addCommandFlow(this.commandName).add(this.createInterrupt()).add(this.createCursor("crosshair")).add(this.selectPoint.bind(this)).add(this.drag.bind(this));
|
|
2298
|
-
commandFlow.addEventListener("finally", this.createFinally());
|
|
2299
|
-
commandFlow.addEventListener("completed", (e) => this.completed(e.data));
|
|
2300
|
-
this.eventInput.addKeyCombination(this.commandName, this.shortcutKeys);
|
|
2301
|
-
this.eventInput.addEventListener("codeChange", async () => this.eventInput.isKeyCombination(this.commandName) && await this.commandManager.start(this.commandName));
|
|
2302
|
-
this.eventInput.addCancelDefaultBehavior(() => this.eventInput.isOnlyKeyDowns(this.shortcutKeys));
|
|
2638
|
+
onAddFromParent(e) {
|
|
2639
|
+
super.onAddFromParent(e), this.editor.container.add(this.container), this.container.position.z = 1e-3;
|
|
2640
|
+
const t = this.commandManager.addCommandFlow(this.commandName).add(this.createInterrupt()).add(this.createCursor("crosshair")).add(this.selectPoint.bind(this)).add(this.drag.bind(this)).addRollback(this.rollback.bind(this)).addRevokeRollback(this.revokeRollback.bind(this));
|
|
2641
|
+
t.addEventListener("finally", this.createFinally()), t.addEventListener("completed", (n) => this.completed(n.data)), this.eventInput.addKeyCombination(this.commandName, this.shortcutKeys), this.eventInput.addEventListener("codeChange", async () => this.eventInput.isKeyCombination(this.commandName) && await this.commandManager.start(this.commandName)), this.eventInput.addCancelDefaultBehavior(() => this.eventInput.isOnlyKeyDowns(this.shortcutKeys));
|
|
2303
2642
|
}
|
|
2304
2643
|
/** 选择开始点
|
|
2305
2644
|
* @param next
|
|
2306
2645
|
*/
|
|
2307
|
-
selectPoint(
|
|
2308
|
-
let
|
|
2646
|
+
selectPoint(e) {
|
|
2647
|
+
let t = null, n = new m.Mesh(new m.SphereGeometry(0.04), new m.MeshBasicMaterial({ color: 16711935 })), o = null;
|
|
2309
2648
|
this.addEventRecord("selectPointStart").add(this.editor.addEventListener("pointerPositionChange", () => {
|
|
2310
|
-
const { point, line:
|
|
2311
|
-
|
|
2312
|
-
this.domElement.style.cursor = "none";
|
|
2313
|
-
circle.position.copy(point);
|
|
2314
|
-
currentLine = line2;
|
|
2315
|
-
currentPoint = point.clone();
|
|
2316
|
-
this.container.add(circle);
|
|
2317
|
-
} else {
|
|
2318
|
-
this.domElement.style.cursor = "no-drop";
|
|
2319
|
-
currentPoint = null;
|
|
2320
|
-
circle.removeFromParent();
|
|
2321
|
-
}
|
|
2649
|
+
const { point: s, line: a, find: r, mode: l } = this.editor.renderManager.adsorption();
|
|
2650
|
+
this.dispatchEvent({ type: "pointerMove", point: s }), r && l === "point" ? (this.domElement.style.cursor = "none", n.position.copy(s), o = a, t = s.clone(), this.container.add(n)) : (this.domElement.style.cursor = "no-drop", t = null, n.removeFromParent());
|
|
2322
2651
|
})).add(this.eventInput.addEventListener("codeChange", () => {
|
|
2323
|
-
|
|
2324
|
-
|
|
2325
|
-
circle.material.color.set(65280);
|
|
2326
|
-
next({ point: currentPoint, line: currentLine });
|
|
2327
|
-
}
|
|
2328
|
-
}));
|
|
2329
|
-
this.addEventRecord("clear").add(() => circle.removeFromParent());
|
|
2652
|
+
this.eventInput.isKeyDown("mouse_0") && t && (this.canceEventRecord("selectPointStart"), n.material.color.set(65280), e({ point: t, line: o }));
|
|
2653
|
+
})), this.addEventRecord("clear").add(() => n.removeFromParent());
|
|
2330
2654
|
}
|
|
2331
2655
|
/** 拖拽点
|
|
2332
2656
|
* @description 拖拽点到指定位置
|
|
2333
2657
|
* @param next
|
|
2334
2658
|
* @param param1
|
|
2335
2659
|
*/
|
|
2336
|
-
drag(
|
|
2660
|
+
drag(e, { point: t, line: n }) {
|
|
2337
2661
|
this.domElement.style.cursor = "crosshair";
|
|
2338
|
-
const
|
|
2339
|
-
this.container.add(
|
|
2340
|
-
|
|
2341
|
-
|
|
2342
|
-
|
|
2343
|
-
|
|
2344
|
-
|
|
2345
|
-
point2.set(p?.x ?? point2.x, p?.y ?? point2.y, 0);
|
|
2346
|
-
find = true;
|
|
2347
|
-
cursor = "crosshair";
|
|
2348
|
-
}
|
|
2349
|
-
if (find) {
|
|
2350
|
-
circle.position.copy(point2);
|
|
2351
|
-
this.container.add(circle);
|
|
2352
|
-
} else {
|
|
2353
|
-
circle.removeFromParent();
|
|
2354
|
-
cursor = "crosshair";
|
|
2662
|
+
const o = n.start.equal(A.from(t)) ? "start" : "end", s = o == "start" ? new m.Vector3(n.end.x, n.end.y, 0) : new m.Vector3(n.start.x, n.start.y, 0), a = t.clone(), r = new fe([s, a], 16711935), l = new m.Mesh(new m.SphereGeometry(0.03), new m.MeshBasicMaterial({ color: 16711935 }));
|
|
2663
|
+
this.container.add(r), this.addEventRecord("clear").add(this.editor.addEventListener("pointerPositionChange", () => {
|
|
2664
|
+
let { point: i, find: c } = this.editor.renderManager.adsorption(), h = "none";
|
|
2665
|
+
if (i) {
|
|
2666
|
+
if (this.dispatchEvent({ type: "pointerMove", point: i }), this.eventInput.isKeyDown("shift")) {
|
|
2667
|
+
const f = n.projectPoint(A.from(i), !1);
|
|
2668
|
+
i.set(f?.x ?? i.x, f?.y ?? i.y, 0), c = !0, h = "crosshair";
|
|
2355
2669
|
}
|
|
2356
|
-
|
|
2357
|
-
lines.setPoint(start, end);
|
|
2358
|
-
this.domElement.style.cursor = cursor;
|
|
2670
|
+
c ? (l.position.copy(i), this.container.add(l)) : (l.removeFromParent(), h = "crosshair"), a.copy(i), r.setPoint(s, a), this.domElement.style.cursor = h;
|
|
2359
2671
|
}
|
|
2360
2672
|
})).add(this.eventInput.addEventListener("codeChange", () => {
|
|
2361
|
-
|
|
2362
|
-
|
|
2363
|
-
next({ point: end, line: line2, mode });
|
|
2364
|
-
}
|
|
2365
|
-
})).add(() => circle.removeFromParent()).add(() => lines.removeFromParent());
|
|
2673
|
+
this.eventInput.isKeyDown("mouse_0") && (this.canceEventRecord("selectPointStart"), e({ point: a, oldPoint: o === "end" ? n.end.clone() : n.start.clone(), line: n, mode: o }));
|
|
2674
|
+
})).add(() => l.removeFromParent()).add(() => r.removeFromParent());
|
|
2366
2675
|
}
|
|
2367
2676
|
/** 执行完成
|
|
2368
2677
|
*/
|
|
2369
|
-
completed(
|
|
2370
|
-
const { line:
|
|
2371
|
-
this.renderManager.removeLine(
|
|
2372
|
-
|
|
2373
|
-
|
|
2374
|
-
|
|
2375
|
-
|
|
2678
|
+
completed(e) {
|
|
2679
|
+
const { line: t, point: n, mode: o } = e;
|
|
2680
|
+
this.renderManager.removeLine(t), o === "end" ? t.end.set(n.x, n.y) : o === "start" && t.start.set(n.x, n.y), this.renderManager.addLine(t), this.renderManager.draw();
|
|
2681
|
+
}
|
|
2682
|
+
/** 回滚操作
|
|
2683
|
+
* @param data
|
|
2684
|
+
*/
|
|
2685
|
+
rollback(e) {
|
|
2686
|
+
const { line: t, oldPoint: n, mode: o } = e;
|
|
2687
|
+
return o === "end" ? t.end.set(n.x, n.y) : o === "start" && t.start.set(n.x, n.y), this.renderManager.addLine(t), this.renderManager.draw(), e;
|
|
2688
|
+
}
|
|
2689
|
+
/** 撤回回滚
|
|
2690
|
+
* @param lines
|
|
2691
|
+
* @returns
|
|
2692
|
+
*/
|
|
2693
|
+
revokeRollback(e) {
|
|
2694
|
+
return this.completed(e), e;
|
|
2376
2695
|
}
|
|
2377
2696
|
}
|
|
2378
|
-
function
|
|
2379
|
-
|
|
2380
|
-
dxfSystem.addComponent(new RenderManager());
|
|
2381
|
-
dxfSystem.addComponent(new Default());
|
|
2382
|
-
dxfSystem.addComponent(new DrawLine());
|
|
2383
|
-
dxfSystem.addComponent(new DrawDoorLine());
|
|
2384
|
-
dxfSystem.addComponent(new DrawWindow());
|
|
2385
|
-
dxfSystem.addComponent(new PointDrag());
|
|
2697
|
+
function Ue(d, e = {}) {
|
|
2698
|
+
d.addComponent(new dt(e.viewPermission)), d.addComponent(new eo()), d.addComponent(new _e()), d.addComponent(new vn()), d.addComponent(new to()), d.addComponent(new no()), d.addComponent(new Eo()), d.addComponent(new X()), d.addComponent(new Y()), d.addComponent(new de()), d.addComponent(new $()), d.addComponent(new ee()), d.addComponent(new te()), d.addComponent(new ne()), d.addComponent(new oe()), d.addComponent(new se()), d.addComponent(new rt());
|
|
2386
2699
|
}
|
|
2387
|
-
const
|
|
2388
|
-
create(
|
|
2389
|
-
return (
|
|
2700
|
+
const Ao = Object.assign(Ue, {
|
|
2701
|
+
create(d = {}) {
|
|
2702
|
+
return (e) => Ue(e, d);
|
|
2390
2703
|
}
|
|
2391
2704
|
});
|
|
2392
2705
|
export {
|
|
2393
|
-
|
|
2394
|
-
Editor_
|
|
2706
|
+
Ao as Editor,
|
|
2707
|
+
Ue as Editor_
|
|
2395
2708
|
};
|