build-dxf 0.0.20-1 → 0.0.20-10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/build.js +28 -19
- package/src/index.css +56 -20
- package/src/index2.js +2 -14
- package/src/index3.js +1021 -345
- package/src/selectLocalFile.js +10 -9
- package/src/utils/CommandManager/CommandFlow.d.ts +16 -0
- package/src/utils/CommandManager/CommandManager.d.ts +23 -0
- package/src/utils/DxfSystem/components/Dxf.d.ts +1 -0
- package/src/utils/DxfSystem/plugin/Editor/components/CommandFlow/CommandFlowComponent.d.ts +4 -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 +0 -20
- 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 +19 -3
- package/src/utils/DxfSystem/plugin/Editor/components/CommandFlow/DrawLine.d.ts +20 -4
- package/src/utils/DxfSystem/plugin/Editor/components/CommandFlow/DrawWindow.d.ts +20 -1
- package/src/utils/DxfSystem/plugin/Editor/components/CommandFlow/IntersectionConnectionLine.d.ts +33 -0
- package/src/utils/DxfSystem/plugin/Editor/components/CommandFlow/MergeLine.d.ts +32 -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 +63 -0
- package/src/utils/DxfSystem/plugin/Editor/components/index.d.ts +1 -0
- package/src/utils/Quadtree/LineSegment.d.ts +1 -0
- package/src/utils/Quadtree/Point.d.ts +2 -1
package/src/index3.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import * as THREE from "three";
|
|
2
2
|
import { i as isString, n as noop, r as resolveUnref, t as tryOnScopeDispose, c as isClient, d as tryOnMounted, e as identity, f as buildProps, g as definePropType, _ as _export_sfc$1, u as useNamespace, h as isNumber, j as addUnit, w as withInstall, k as useEmptyValuesProps, l as useSizeProp, p as provideGlobalConfig, m as iconPropType, o as useGlobalComponentSettings, T as TypeComponentsMap, q as ElIcon, s as TypeComponents, v as useTimeoutFn, x as isString$1, y as isFunction, z as isBoolean, A as isElement, B as withInstallFunction, L as Lines, D as DomEventRegister, b as ElCheckbox, E as ElButton, S as SelectLocalFile } from "./selectLocalFile.js";
|
|
3
3
|
import { C as Component, L as LineSegment, P as Point, B as Box2, E as EventDispatcher, b as PointVirtualGrid, Q as Quadtree, W as WhiteModel } from "./build.js";
|
|
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";
|
|
5
4
|
import "clipper-lib";
|
|
6
5
|
import "dxf-writer";
|
|
7
6
|
import "three/addons/controls/OrbitControls.js";
|
|
7
|
+
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, TransitionGroup, createApp } from "vue";
|
|
8
8
|
function unrefElement(elRef) {
|
|
9
9
|
var _a;
|
|
10
10
|
const plain = resolveUnref(elRef);
|
|
@@ -713,6 +713,11 @@ class CommandFlowComponent extends Component {
|
|
|
713
713
|
if (!this._commandManager) this._commandManager = this.editor?.commandManager;
|
|
714
714
|
return this._commandManager;
|
|
715
715
|
}
|
|
716
|
+
_default;
|
|
717
|
+
get default() {
|
|
718
|
+
if (!this._default) this._default = this.parent?.findComponentByName("Default");
|
|
719
|
+
return this._default;
|
|
720
|
+
}
|
|
716
721
|
interruptKeys = ["escape"];
|
|
717
722
|
commandName = "";
|
|
718
723
|
constructor() {
|
|
@@ -727,19 +732,20 @@ class CommandFlowComponent extends Component {
|
|
|
727
732
|
* 取消
|
|
728
733
|
*/
|
|
729
734
|
cancel() {
|
|
730
|
-
|
|
731
|
-
this.
|
|
735
|
+
const commandName = this.commandName || this.constructor.commandName;
|
|
736
|
+
if (this.commandManager.currentName !== commandName) return;
|
|
737
|
+
this.commandManager.cancel();
|
|
732
738
|
}
|
|
733
739
|
/**
|
|
734
|
-
*
|
|
740
|
+
* 创建中断处理命令节点
|
|
735
741
|
* @returns
|
|
736
742
|
*/
|
|
737
743
|
createInterrupt() {
|
|
738
744
|
return (next, data) => {
|
|
739
745
|
this.addEventRecord(
|
|
740
746
|
"clear",
|
|
741
|
-
this.
|
|
742
|
-
if (this.
|
|
747
|
+
this.eventInput.addEventListener("codeChange", async () => {
|
|
748
|
+
if (this.eventInput.isKeyDowns(this.interruptKeys)) this.cancel();
|
|
743
749
|
})
|
|
744
750
|
);
|
|
745
751
|
next(data);
|
|
@@ -782,7 +788,7 @@ class DrawLine extends CommandFlowComponent {
|
|
|
782
788
|
onAddFromParent(parent) {
|
|
783
789
|
super.onAddFromParent(parent);
|
|
784
790
|
this.editor.container.add(this.container);
|
|
785
|
-
const commandFlow = this.commandManager.addCommandFlow(this.commandName).add(this.createInterrupt()).add(this.createCursor("crosshair")).add(this.selectPoint.bind(this));
|
|
791
|
+
const commandFlow = 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));
|
|
786
792
|
commandFlow.addEventListener("finally", this.createFinally());
|
|
787
793
|
commandFlow.addEventListener("completed", (e) => this.completed(e.data));
|
|
788
794
|
this.eventInput.addKeyCombination(this.commandName, this.shortcutKeys);
|
|
@@ -817,6 +823,7 @@ class DrawLine extends CommandFlowComponent {
|
|
|
817
823
|
"clear",
|
|
818
824
|
editor.addEventListener("pointerPositionChange", () => {
|
|
819
825
|
const { point, find } = editor.renderManager.adsorption();
|
|
826
|
+
this.dispatchEvent({ type: "pointerMove", point });
|
|
820
827
|
if (find) {
|
|
821
828
|
circle.position.set(point.x, point.y, 0);
|
|
822
829
|
this.container.add(circle);
|
|
@@ -867,15 +874,37 @@ class DrawLine extends CommandFlowComponent {
|
|
|
867
874
|
}
|
|
868
875
|
);
|
|
869
876
|
}
|
|
870
|
-
/**
|
|
877
|
+
/** 结束, 汇总结果
|
|
878
|
+
* @param points
|
|
871
879
|
*/
|
|
872
|
-
|
|
873
|
-
const
|
|
880
|
+
end(next, points) {
|
|
881
|
+
const lines = [];
|
|
874
882
|
for (let i = 0; i < points.length; i += 2) {
|
|
875
883
|
lines.push(new LineSegment(Point.from(points[i]), Point.from(points[i + 1])));
|
|
876
884
|
}
|
|
877
|
-
|
|
878
|
-
|
|
885
|
+
next(lines);
|
|
886
|
+
}
|
|
887
|
+
/** 执行完成
|
|
888
|
+
*/
|
|
889
|
+
completed(lines) {
|
|
890
|
+
this.renderManager.addLines(lines);
|
|
891
|
+
this.renderManager.draw();
|
|
892
|
+
}
|
|
893
|
+
/** 回滚操作
|
|
894
|
+
* @param data
|
|
895
|
+
*/
|
|
896
|
+
rollback(lines) {
|
|
897
|
+
lines.forEach((line2) => this.renderManager.removeLine(line2));
|
|
898
|
+
this.renderManager.draw();
|
|
899
|
+
return lines;
|
|
900
|
+
}
|
|
901
|
+
/** 撤回回滚
|
|
902
|
+
* @param lines
|
|
903
|
+
* @returns
|
|
904
|
+
*/
|
|
905
|
+
revokeRollback(lines) {
|
|
906
|
+
this.completed(lines);
|
|
907
|
+
return lines;
|
|
879
908
|
}
|
|
880
909
|
}
|
|
881
910
|
class Default extends Component {
|
|
@@ -931,111 +960,6 @@ class Default extends Component {
|
|
|
931
960
|
type: "selectLineChange"
|
|
932
961
|
});
|
|
933
962
|
}
|
|
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
963
|
_timer = null;
|
|
1040
964
|
/**
|
|
1041
965
|
* 更新选择的线段
|
|
@@ -1061,14 +985,6 @@ class Default extends Component {
|
|
|
1061
985
|
object3D.position.z = 0.01;
|
|
1062
986
|
this.selectLineObject3D.position.z = object3D.position.z + 0.01;
|
|
1063
987
|
object3D.material = new THREE.MeshBasicMaterial({ color: 55561 });
|
|
1064
|
-
eventInput.addKeyCombination("intersectionConnection", ["control", "shift", "l"]);
|
|
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
988
|
const showSelectBox = () => {
|
|
1073
989
|
const startPoint = editor.pointerPosition.clone(), endPoint = editor.pointerPosition.clone(), mesh = new THREE.Mesh();
|
|
1074
990
|
this.container.add(mesh);
|
|
@@ -1145,16 +1061,10 @@ class Default extends Component {
|
|
|
1145
1061
|
}
|
|
1146
1062
|
if (!eventInput.isKeyDown("control")) this.removeSelectLineAll();
|
|
1147
1063
|
this.addSelectLine(currentSelectLine);
|
|
1148
|
-
} else if (eventInput.
|
|
1149
|
-
|
|
1150
|
-
} else if (eventInput.isKeyDowns(["
|
|
1151
|
-
|
|
1152
|
-
} else if (eventInput.isKeyCombination("connection")) {
|
|
1153
|
-
this.connection();
|
|
1154
|
-
} else if (eventInput.isKeyCombination("intersectionConnection")) {
|
|
1155
|
-
this.intersectionConnection();
|
|
1156
|
-
} else if (eventInput.isKeyCombination("mergeLine")) {
|
|
1157
|
-
this.mergeLine();
|
|
1064
|
+
} else if (eventInput.isKeyDowns(["control", "z"])) {
|
|
1065
|
+
editor.commandManager.rollback();
|
|
1066
|
+
} else if (eventInput.isKeyDowns(["control", "y"])) {
|
|
1067
|
+
editor.commandManager.revokeRollback();
|
|
1158
1068
|
}
|
|
1159
1069
|
}),
|
|
1160
1070
|
function() {
|
|
@@ -1173,10 +1083,32 @@ class Default extends Component {
|
|
|
1173
1083
|
}
|
|
1174
1084
|
class CommandFlow extends EventDispatcher {
|
|
1175
1085
|
list = [];
|
|
1086
|
+
rollbacklist = [];
|
|
1087
|
+
revokeRollbacklist = [];
|
|
1088
|
+
/**
|
|
1089
|
+
*
|
|
1090
|
+
* @param operation
|
|
1091
|
+
* @returns
|
|
1092
|
+
*/
|
|
1176
1093
|
add(operation) {
|
|
1177
1094
|
this.list.push(operation);
|
|
1178
1095
|
return this;
|
|
1179
1096
|
}
|
|
1097
|
+
/** 添加回滚回调列表
|
|
1098
|
+
* @param callBack
|
|
1099
|
+
*/
|
|
1100
|
+
addRollback(callBack) {
|
|
1101
|
+
this.rollbacklist.push(callBack);
|
|
1102
|
+
return this;
|
|
1103
|
+
}
|
|
1104
|
+
/** 添加撤回回滚回调列表
|
|
1105
|
+
* @param callBack
|
|
1106
|
+
* @returns
|
|
1107
|
+
*/
|
|
1108
|
+
addRevokeRollback(callBack) {
|
|
1109
|
+
this.revokeRollbacklist.push(callBack);
|
|
1110
|
+
return this;
|
|
1111
|
+
}
|
|
1180
1112
|
}
|
|
1181
1113
|
class CommandManager extends EventDispatcher {
|
|
1182
1114
|
commandFlowMap = /* @__PURE__ */ new Map();
|
|
@@ -1192,6 +1124,11 @@ class CommandManager extends EventDispatcher {
|
|
|
1192
1124
|
get disabled() {
|
|
1193
1125
|
return this._disabled;
|
|
1194
1126
|
}
|
|
1127
|
+
/**
|
|
1128
|
+
* 操作记录
|
|
1129
|
+
*/
|
|
1130
|
+
operationList = [];
|
|
1131
|
+
rollbackList = [];
|
|
1195
1132
|
constructor() {
|
|
1196
1133
|
super();
|
|
1197
1134
|
}
|
|
@@ -1221,7 +1158,7 @@ class CommandManager extends EventDispatcher {
|
|
|
1221
1158
|
this.executionPromise && await this.executionPromise;
|
|
1222
1159
|
this.executionPromise = null;
|
|
1223
1160
|
if (this.lock) {
|
|
1224
|
-
throw new Error("
|
|
1161
|
+
throw new Error("命令管理器已被 " + this.currentName + " 命令锁定,无法启动新的命令流,请退出或等待命令执行结束");
|
|
1225
1162
|
}
|
|
1226
1163
|
const commandFlow = this.commandFlowMap.get(name);
|
|
1227
1164
|
if (!commandFlow) {
|
|
@@ -1257,6 +1194,8 @@ class CommandManager extends EventDispatcher {
|
|
|
1257
1194
|
if (this.abortController && !this.abortController.signal.aborted) {
|
|
1258
1195
|
commandFlow.dispatchEvent({ type: "completed", data });
|
|
1259
1196
|
this.dispatchEvent({ type: "completed", name, data });
|
|
1197
|
+
this.operationList.push({ name, data });
|
|
1198
|
+
this.rollbackList.length = 0;
|
|
1260
1199
|
}
|
|
1261
1200
|
this.lock = false;
|
|
1262
1201
|
this.abortController = null;
|
|
@@ -1279,24 +1218,106 @@ class CommandManager extends EventDispatcher {
|
|
|
1279
1218
|
this.executionPromise = new Promise((resolve) => this.executionResolve = resolve);
|
|
1280
1219
|
}
|
|
1281
1220
|
}
|
|
1221
|
+
/**
|
|
1222
|
+
* 回滚
|
|
1223
|
+
*/
|
|
1224
|
+
rollback() {
|
|
1225
|
+
try {
|
|
1226
|
+
const operation = this.operationList.pop();
|
|
1227
|
+
if (!operation) return false;
|
|
1228
|
+
const commandFlow = this.commandFlowMap.get(operation.name);
|
|
1229
|
+
if (!commandFlow) return false;
|
|
1230
|
+
const data = commandFlow.rollbacklist.reduce((data2, callBack) => callBack(data2), operation.data);
|
|
1231
|
+
this.dispatchEvent({ type: "rollback", name: operation.name });
|
|
1232
|
+
this.rollbackList.push({
|
|
1233
|
+
data,
|
|
1234
|
+
name: operation.name
|
|
1235
|
+
});
|
|
1236
|
+
return true;
|
|
1237
|
+
} catch (error) {
|
|
1238
|
+
throw new Error(`回滚失败:${error}`);
|
|
1239
|
+
}
|
|
1240
|
+
}
|
|
1241
|
+
/**
|
|
1242
|
+
* 撤销回滚
|
|
1243
|
+
*/
|
|
1244
|
+
revokeRollback() {
|
|
1245
|
+
try {
|
|
1246
|
+
const operation = this.rollbackList.pop();
|
|
1247
|
+
if (!operation) return false;
|
|
1248
|
+
const commandFlow = this.commandFlowMap.get(operation.name);
|
|
1249
|
+
if (!commandFlow) return false;
|
|
1250
|
+
const data = commandFlow.revokeRollbacklist.reduce((data2, callBack) => callBack(data2), operation.data);
|
|
1251
|
+
this.dispatchEvent({ type: "revokeRollback", name: operation.name });
|
|
1252
|
+
this.operationList.push({ name: operation.name, data });
|
|
1253
|
+
return true;
|
|
1254
|
+
} catch (error) {
|
|
1255
|
+
throw new Error(`撤回回滚失败:${error}`);
|
|
1256
|
+
}
|
|
1257
|
+
}
|
|
1282
1258
|
}
|
|
1283
|
-
const
|
|
1259
|
+
const connection = "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";
|
|
1284
1260
|
const __vite_glob_0_0 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1261
|
+
__proto__: null,
|
|
1262
|
+
default: connection
|
|
1263
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
1264
|
+
const deleteSelectLine = "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";
|
|
1265
|
+
const __vite_glob_0_1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1266
|
+
__proto__: null,
|
|
1267
|
+
default: deleteSelectLine
|
|
1268
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
1269
|
+
const deleteSelectWindow = "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";
|
|
1270
|
+
const __vite_glob_0_2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1271
|
+
__proto__: null,
|
|
1272
|
+
default: deleteSelectWindow
|
|
1273
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
1274
|
+
const door = "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";
|
|
1275
|
+
const __vite_glob_0_3 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1285
1276
|
__proto__: null,
|
|
1286
1277
|
default: door
|
|
1287
1278
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
1279
|
+
const intersectionConnection = "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";
|
|
1280
|
+
const __vite_glob_0_4 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1281
|
+
__proto__: null,
|
|
1282
|
+
default: intersectionConnection
|
|
1283
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
1288
1284
|
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
|
|
1285
|
+
const __vite_glob_0_5 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1290
1286
|
__proto__: null,
|
|
1291
1287
|
default: line
|
|
1292
1288
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
1289
|
+
const mergeLine = "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";
|
|
1290
|
+
const __vite_glob_0_6 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1291
|
+
__proto__: null,
|
|
1292
|
+
default: mergeLine
|
|
1293
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
1294
|
+
const revokeRollback = "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";
|
|
1295
|
+
const __vite_glob_0_7 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1296
|
+
__proto__: null,
|
|
1297
|
+
default: revokeRollback
|
|
1298
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
1299
|
+
const rollback = "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";
|
|
1300
|
+
const __vite_glob_0_8 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1301
|
+
__proto__: null,
|
|
1302
|
+
default: rollback
|
|
1303
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
1304
|
+
const selectAll = "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";
|
|
1305
|
+
const __vite_glob_0_9 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1306
|
+
__proto__: null,
|
|
1307
|
+
default: selectAll
|
|
1308
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
1293
1309
|
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
|
|
1310
|
+
const __vite_glob_0_10 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1295
1311
|
__proto__: null,
|
|
1296
1312
|
default: selectPoint
|
|
1297
1313
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
1314
|
+
const verticalCorrection = "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";
|
|
1315
|
+
const __vite_glob_0_11 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1316
|
+
__proto__: null,
|
|
1317
|
+
default: verticalCorrection
|
|
1318
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
1298
1319
|
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
|
|
1320
|
+
const __vite_glob_0_12 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1300
1321
|
__proto__: null,
|
|
1301
1322
|
default: window$1
|
|
1302
1323
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
@@ -1498,11 +1519,12 @@ class RenderManager extends Component {
|
|
|
1498
1519
|
const drawDoorData = userData.drawDoorData;
|
|
1499
1520
|
const insetionArr = this.quadtree.queryLineSegment(line2).filter((r) => r.line !== line2 && !r.userData?.isDoor).map((r) => ({ index: this.lines.indexOf(r.line) }));
|
|
1500
1521
|
return {
|
|
1501
|
-
start: line2.start.toJson(),
|
|
1502
|
-
end: line2.end.toJson(),
|
|
1522
|
+
start: line2.start.toJson(this.dxf.originalZAverage),
|
|
1523
|
+
end: line2.end.toJson(this.dxf.originalZAverage),
|
|
1503
1524
|
insetionArr,
|
|
1504
1525
|
isDoor: userData.isDoor,
|
|
1505
1526
|
doorDirectConnection: userData.isDoor,
|
|
1527
|
+
length: line2.length(),
|
|
1506
1528
|
isWindow: userData.isWindow,
|
|
1507
1529
|
drawDoorData: drawDoorData && drawDoorData.map((w) => ({
|
|
1508
1530
|
p: { x: w.p.x, y: w.p.y, z: w.p.z },
|
|
@@ -1522,7 +1544,7 @@ class RenderManager extends Component {
|
|
|
1522
1544
|
return;
|
|
1523
1545
|
}
|
|
1524
1546
|
if (this._timer) clearTimeout(this._timer);
|
|
1525
|
-
setTimeout(() => {
|
|
1547
|
+
this._timer = setTimeout(() => {
|
|
1526
1548
|
this.updatedMode = "self";
|
|
1527
1549
|
const dxf = this.dxf;
|
|
1528
1550
|
const json = this.toJson();
|
|
@@ -1560,7 +1582,7 @@ class DrawDoorLine extends CommandFlowComponent {
|
|
|
1560
1582
|
super.onAddFromParent(parent);
|
|
1561
1583
|
const editor = parent.findComponentByName("Editor"), eventInput = editor.eventInput, commandManager = editor.commandManager;
|
|
1562
1584
|
this.editor.container.add(this.container);
|
|
1563
|
-
const commandFlow = this.commandManager.addCommandFlow("draw-door-line").add(this.createInterrupt()).add(this.createCursor("no-drop")).add(this.selectPoint.bind(this));
|
|
1585
|
+
const commandFlow = 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));
|
|
1564
1586
|
eventInput.addKeyCombination(this.commandName, this.shortcutKeys);
|
|
1565
1587
|
commandFlow.addEventListener("finally", this.createFinally());
|
|
1566
1588
|
commandFlow.addEventListener("completed", (e) => this.completed(e.data));
|
|
@@ -1619,18 +1641,42 @@ class DrawDoorLine extends CommandFlowComponent {
|
|
|
1619
1641
|
}
|
|
1620
1642
|
);
|
|
1621
1643
|
}
|
|
1622
|
-
/**
|
|
1644
|
+
/**
|
|
1645
|
+
* 结束处理
|
|
1646
|
+
* @param next
|
|
1647
|
+
* @param points
|
|
1623
1648
|
*/
|
|
1624
|
-
|
|
1625
|
-
const
|
|
1649
|
+
end(next, points) {
|
|
1650
|
+
const lines = [];
|
|
1626
1651
|
for (let i = 0; i < points.length; i += 2) {
|
|
1627
1652
|
const line2 = new LineSegment(Point.from(points[i]), Point.from(points[i + 1]));
|
|
1628
1653
|
line2.userData.isDoor = true;
|
|
1629
1654
|
line2.userData.doorDirectConnection = true;
|
|
1630
1655
|
lines.push(line2);
|
|
1631
1656
|
}
|
|
1632
|
-
|
|
1633
|
-
|
|
1657
|
+
next(lines);
|
|
1658
|
+
}
|
|
1659
|
+
/** 执行完成
|
|
1660
|
+
*/
|
|
1661
|
+
completed(lines) {
|
|
1662
|
+
this.renderManager.addLines(lines);
|
|
1663
|
+
this.renderManager.draw();
|
|
1664
|
+
}
|
|
1665
|
+
/** 回滚操作
|
|
1666
|
+
* @param data
|
|
1667
|
+
*/
|
|
1668
|
+
rollback(lines) {
|
|
1669
|
+
lines.forEach((line2) => this.renderManager.removeLine(line2));
|
|
1670
|
+
this.renderManager.draw();
|
|
1671
|
+
return lines;
|
|
1672
|
+
}
|
|
1673
|
+
/** 撤回回滚
|
|
1674
|
+
* @param lines
|
|
1675
|
+
* @returns
|
|
1676
|
+
*/
|
|
1677
|
+
revokeRollback(lines) {
|
|
1678
|
+
this.completed(lines);
|
|
1679
|
+
return lines;
|
|
1634
1680
|
}
|
|
1635
1681
|
}
|
|
1636
1682
|
class DrawWindow extends CommandFlowComponent {
|
|
@@ -1642,7 +1688,7 @@ class DrawWindow extends CommandFlowComponent {
|
|
|
1642
1688
|
onAddFromParent(parent) {
|
|
1643
1689
|
super.onAddFromParent(parent);
|
|
1644
1690
|
this.editor.container.add(this.container);
|
|
1645
|
-
const commandFlow = this.commandManager.addCommandFlow(this.commandName).add(this.createInterrupt()).add(this.createCursor("no-drop")).add(this.selectPointStart.bind(this)).add(this.selectPointEnd.bind(this));
|
|
1691
|
+
const commandFlow = 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));
|
|
1646
1692
|
commandFlow.addEventListener("finally", this.createFinally(["selectPointStart"]));
|
|
1647
1693
|
commandFlow.addEventListener("completed", (e) => this.completed(e.data));
|
|
1648
1694
|
this.eventInput.addKeyCombination(this.commandName, this.shortcutKeys);
|
|
@@ -1696,85 +1742,673 @@ class DrawWindow extends CommandFlowComponent {
|
|
|
1696
1742
|
if (this.eventInput.isKeyDown("mouse_0") && currentPoint) next({ line: line2, start: point, end: currentPoint });
|
|
1697
1743
|
}));
|
|
1698
1744
|
}
|
|
1699
|
-
/**
|
|
1745
|
+
/**
|
|
1746
|
+
* 结束处理
|
|
1747
|
+
* @param next
|
|
1748
|
+
* @param points
|
|
1700
1749
|
*/
|
|
1701
|
-
|
|
1702
|
-
const
|
|
1703
|
-
|
|
1704
|
-
if (!line2.userData.drawDoorData) line2.userData.drawDoorData = [];
|
|
1705
|
-
line2.userData.drawDoorData.push({
|
|
1750
|
+
end(next, { start, end, line: line2 }) {
|
|
1751
|
+
const win = new LineSegment(Point.from(start), Point.from(end)), center = win.center, len = win.length();
|
|
1752
|
+
const doorDataItem = {
|
|
1706
1753
|
p: new THREE.Vector3(center.x, center.y, 0),
|
|
1707
1754
|
width: len,
|
|
1708
1755
|
full: Math.abs(len - line2.length()) < 0.01
|
|
1709
|
-
}
|
|
1756
|
+
};
|
|
1757
|
+
next({ line: line2, doorDataItem });
|
|
1758
|
+
}
|
|
1759
|
+
/** 执行完成
|
|
1760
|
+
*/
|
|
1761
|
+
completed({ doorDataItem, line: line2 }) {
|
|
1762
|
+
line2.userData.isWindow = true;
|
|
1763
|
+
if (!line2.userData.drawDoorData) line2.userData.drawDoorData = [];
|
|
1764
|
+
line2.userData.drawDoorData.push(doorDataItem);
|
|
1710
1765
|
this.renderManager.draw();
|
|
1711
1766
|
}
|
|
1767
|
+
/** 回滚操作
|
|
1768
|
+
* @param data
|
|
1769
|
+
*/
|
|
1770
|
+
rollback(data) {
|
|
1771
|
+
const { doorDataItem, line: line2 } = data;
|
|
1772
|
+
if (line2.userData.drawDoorData) {
|
|
1773
|
+
const index = line2.userData.drawDoorData.indexOf(doorDataItem);
|
|
1774
|
+
if (index !== -1) {
|
|
1775
|
+
line2.userData.drawDoorData.splice(index, 1);
|
|
1776
|
+
if (line2.userData.drawDoorData.length === 0) {
|
|
1777
|
+
delete line2.userData.drawDoorData;
|
|
1778
|
+
delete line2.userData.isWindow;
|
|
1779
|
+
}
|
|
1780
|
+
this.renderManager.draw();
|
|
1781
|
+
}
|
|
1782
|
+
}
|
|
1783
|
+
return data;
|
|
1784
|
+
}
|
|
1785
|
+
/** 撤回回滚
|
|
1786
|
+
* @param data
|
|
1787
|
+
* @returns
|
|
1788
|
+
*/
|
|
1789
|
+
revokeRollback(data) {
|
|
1790
|
+
this.completed(data);
|
|
1791
|
+
return data;
|
|
1792
|
+
}
|
|
1712
1793
|
}
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
};
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
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 };
|
|
1794
|
+
class VerticalCorrection extends CommandFlowComponent {
|
|
1795
|
+
static name = "VerticalCorrection";
|
|
1796
|
+
container = new THREE.Group();
|
|
1797
|
+
shortcutKeys = ["control", "c"];
|
|
1798
|
+
static commandName = "verticalCorrection";
|
|
1799
|
+
onAddFromParent(parent) {
|
|
1800
|
+
super.onAddFromParent(parent);
|
|
1801
|
+
this.editor.container.add(this.container);
|
|
1802
|
+
this.container.position.z = 1e-3;
|
|
1803
|
+
const commandFlow = this.commandManager.addCommandFlow(VerticalCorrection.commandName).add(this.createInterrupt()).add(this.constraint.bind(this)).add(this.verticalCorrection.bind(this)).addRollback(this.rollback.bind(this)).addRevokeRollback(this.revokeRollback.bind(this));
|
|
1804
|
+
commandFlow.addEventListener("finally", this.createFinally());
|
|
1805
|
+
commandFlow.addEventListener("completed", (e) => this.completed(e.data));
|
|
1806
|
+
this.eventInput.addKeyCombination(VerticalCorrection.commandName, this.shortcutKeys);
|
|
1807
|
+
this.eventInput.addEventListener("codeChange", async () => {
|
|
1808
|
+
this.eventInput.isKeyCombination(VerticalCorrection.commandName) && await this.commandManager.start(VerticalCorrection.commandName, [...this.default.selectLines]);
|
|
1809
|
+
});
|
|
1810
|
+
this.eventInput.addCancelDefaultBehavior(() => this.eventInput.isOnlyKeyDowns(this.shortcutKeys));
|
|
1811
|
+
}
|
|
1812
|
+
/**
|
|
1813
|
+
* 进入命令约束
|
|
1814
|
+
*/
|
|
1815
|
+
constraint(next, selectLines) {
|
|
1816
|
+
if (!Array.isArray(selectLines)) {
|
|
1817
|
+
ElMessage({ message: "进入命令失败", type: "warning" });
|
|
1818
|
+
this.cancel();
|
|
1819
|
+
} else if (selectLines.length !== 1) {
|
|
1820
|
+
ElMessage({ message: "请选择一条线段", type: "warning" });
|
|
1821
|
+
this.cancel();
|
|
1822
|
+
} else next(selectLines);
|
|
1823
|
+
}
|
|
1824
|
+
/**
|
|
1825
|
+
* 线段是否为结尾线段
|
|
1826
|
+
* @param line
|
|
1827
|
+
*/
|
|
1828
|
+
lineIsPathEnd(line2) {
|
|
1829
|
+
for (let i = 0; i < line2.points.length; i++) {
|
|
1830
|
+
const point = line2.points[i];
|
|
1831
|
+
const length = this.renderManager.pointVirtualGrid.queryPoint(point).filter((p) => !p.point.equal(point)).length;
|
|
1832
|
+
if (length === 0) return true;
|
|
1757
1833
|
}
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
1834
|
+
return false;
|
|
1835
|
+
}
|
|
1836
|
+
/**
|
|
1837
|
+
*
|
|
1838
|
+
* @param line0
|
|
1839
|
+
* @param line1
|
|
1840
|
+
*/
|
|
1841
|
+
isTowLineSegmentConnect(line0, line1) {
|
|
1842
|
+
if (line0.start.equal(line1.start) || line0.start.equal(line1.end) || line0.end.equal(line1.start) || line0.end.equal(line1.end)) {
|
|
1843
|
+
return true;
|
|
1761
1844
|
}
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
|
|
1845
|
+
return false;
|
|
1846
|
+
}
|
|
1847
|
+
/**
|
|
1848
|
+
* 获取所有相同点的位置信息
|
|
1849
|
+
* @param point
|
|
1850
|
+
* @param point2
|
|
1851
|
+
*/
|
|
1852
|
+
getSamePointAll(point, point2) {
|
|
1853
|
+
const resultList = this.renderManager.pointVirtualGrid.queryPoint(point);
|
|
1854
|
+
return resultList.map((result) => ({
|
|
1855
|
+
point: result.point,
|
|
1856
|
+
oldPoint: result.point.clone(),
|
|
1857
|
+
newPoint: point2,
|
|
1858
|
+
line: result.userData
|
|
1859
|
+
}));
|
|
1860
|
+
}
|
|
1861
|
+
/** 修正
|
|
1862
|
+
* @param targettLine
|
|
1863
|
+
* @param vistedList
|
|
1864
|
+
*/
|
|
1865
|
+
correction(targettLine, resultList = [], vistedList = /* @__PURE__ */ new Set()) {
|
|
1866
|
+
if (vistedList.has(targettLine)) return;
|
|
1867
|
+
vistedList.add(targettLine);
|
|
1868
|
+
const lines = this.renderManager.quadtree.queryLineSegment(targettLine).filter(({ line: line2 }) => {
|
|
1869
|
+
if (line2 === targettLine || line2.userData.isDoor) return false;
|
|
1870
|
+
return true;
|
|
1871
|
+
}).map((result) => result.line), targettLineDirection = targettLine.direction();
|
|
1872
|
+
lines.forEach((line2) => {
|
|
1873
|
+
if (vistedList.has(line2)) return false;
|
|
1874
|
+
const direction = line2.direction(), angle = targettLineDirection.angleBetween(direction, "angle"), gap = Math.abs(90 - angle);
|
|
1875
|
+
if (gap > 10 || gap < 1) return;
|
|
1876
|
+
if (this.isTowLineSegmentConnect(targettLine, line2)) {
|
|
1877
|
+
const point0 = targettLine.start.equal(line2.start) || targettLine.start.equal(line2.end) ? targettLine.start : targettLine.end, point1 = line2.start.equal(targettLine.start) || line2.start.equal(targettLine.end) ? line2.end : line2.start, projectLine = new LineSegment(
|
|
1878
|
+
point1.clone().add(targettLineDirection.clone().multiplyScalar(1)),
|
|
1879
|
+
point1.clone().add(targettLineDirection.clone().multiplyScalar(-1))
|
|
1880
|
+
), projectPoint = projectLine.projectPoint(point0, false);
|
|
1881
|
+
if (projectPoint) {
|
|
1882
|
+
resultList.push(this.getSamePointAll(point1, projectPoint));
|
|
1770
1883
|
}
|
|
1884
|
+
} else {
|
|
1885
|
+
console.log("交点");
|
|
1771
1886
|
}
|
|
1772
|
-
}
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
|
|
1887
|
+
});
|
|
1888
|
+
lines.forEach((line2) => this.correction(line2, resultList, vistedList));
|
|
1889
|
+
return resultList;
|
|
1890
|
+
}
|
|
1891
|
+
/** 开始
|
|
1892
|
+
* @param next
|
|
1893
|
+
*/
|
|
1894
|
+
verticalCorrection(next, selectLines) {
|
|
1895
|
+
next(this.correction(selectLines[0]));
|
|
1896
|
+
}
|
|
1897
|
+
/** 执行完成
|
|
1898
|
+
* @param data
|
|
1899
|
+
*/
|
|
1900
|
+
completed(data) {
|
|
1901
|
+
data.forEach((items) => {
|
|
1902
|
+
items.forEach((item) => {
|
|
1903
|
+
const { line: line2, newPoint, point } = item;
|
|
1904
|
+
point.copy(newPoint);
|
|
1905
|
+
this.renderManager.removeLine(line2);
|
|
1906
|
+
this.renderManager.addLine(line2);
|
|
1907
|
+
});
|
|
1908
|
+
});
|
|
1909
|
+
this.renderManager.draw();
|
|
1910
|
+
}
|
|
1911
|
+
/** 回滚操作
|
|
1912
|
+
* @param data
|
|
1913
|
+
*/
|
|
1914
|
+
rollback(data) {
|
|
1915
|
+
data.forEach((items) => {
|
|
1916
|
+
items.forEach((item) => {
|
|
1917
|
+
const { line: line2, oldPoint, point } = item;
|
|
1918
|
+
point.copy(oldPoint);
|
|
1919
|
+
this.renderManager.removeLine(line2);
|
|
1920
|
+
this.renderManager.addLine(line2);
|
|
1921
|
+
});
|
|
1922
|
+
});
|
|
1923
|
+
this.renderManager.draw();
|
|
1924
|
+
return data;
|
|
1925
|
+
}
|
|
1926
|
+
/** 撤回回滚
|
|
1927
|
+
* @param lines
|
|
1928
|
+
* @returns
|
|
1929
|
+
*/
|
|
1930
|
+
revokeRollback(data) {
|
|
1931
|
+
this.completed(data);
|
|
1932
|
+
return data;
|
|
1933
|
+
}
|
|
1934
|
+
}
|
|
1935
|
+
class MergeLine extends CommandFlowComponent {
|
|
1936
|
+
static name = "MergeLine";
|
|
1937
|
+
shortcutKeys = ["control", "g"];
|
|
1938
|
+
static commandName = "merge-line";
|
|
1939
|
+
onAddFromParent(parent) {
|
|
1940
|
+
super.onAddFromParent(parent);
|
|
1941
|
+
const defaultComponent = parent.findComponentByType(Default);
|
|
1942
|
+
const commandFlow = this.commandManager.addCommandFlow(MergeLine.commandName).add(this.createInterrupt()).add(this.constraint.bind(this)).add(this.mergeLine.bind(this)).addRollback(this.rollback.bind(this)).addRevokeRollback(this.revokeRollback.bind(this));
|
|
1943
|
+
commandFlow.addEventListener("finally", this.createFinally());
|
|
1944
|
+
commandFlow.addEventListener("completed", (e) => this.completed(e.data));
|
|
1945
|
+
this.eventInput.addKeyCombination(MergeLine.commandName, this.shortcutKeys);
|
|
1946
|
+
this.eventInput.addEventListener("codeChange", async () => {
|
|
1947
|
+
defaultComponent?.selectLines.length === 2 && this.eventInput.isKeyCombination(MergeLine.commandName) && await this.commandManager.start(MergeLine.commandName, [...this.default.selectLines]);
|
|
1948
|
+
});
|
|
1949
|
+
this.eventInput.addCancelDefaultBehavior(() => this.eventInput.isOnlyKeyDowns(this.shortcutKeys));
|
|
1950
|
+
}
|
|
1951
|
+
/**
|
|
1952
|
+
* 进入命令约束
|
|
1953
|
+
*/
|
|
1954
|
+
constraint(next, selectLines) {
|
|
1955
|
+
if (!Array.isArray(selectLines)) {
|
|
1956
|
+
ElMessage({ message: "进入命令失败", type: "warning" });
|
|
1957
|
+
this.cancel();
|
|
1958
|
+
} else if (selectLines.length !== 2) {
|
|
1959
|
+
ElMessage({ message: "未执行线段合并,请选择两条线段", type: "warning" });
|
|
1960
|
+
this.cancel();
|
|
1961
|
+
} else {
|
|
1962
|
+
next(selectLines);
|
|
1963
|
+
}
|
|
1964
|
+
}
|
|
1965
|
+
/** 开始
|
|
1966
|
+
* @param next
|
|
1967
|
+
*/
|
|
1968
|
+
mergeLine(next, selectLines) {
|
|
1969
|
+
const line1 = selectLines[0], line2 = selectLines[1];
|
|
1970
|
+
for (let i = 0; i < line1.points.length; i++) {
|
|
1971
|
+
const p1 = line1.points[i];
|
|
1972
|
+
for (let j = 0; j < line2.points.length; j++) {
|
|
1973
|
+
const p2 = line2.points[j];
|
|
1974
|
+
if (p1.equal(p2)) {
|
|
1975
|
+
const p1Next = line1.points[(i + 1) % 2];
|
|
1976
|
+
const p2Next = line2.points[(j + 1) % 2];
|
|
1977
|
+
const line3 = new LineSegment(p1Next, p2Next);
|
|
1978
|
+
next({ line1, line2, newLine: line3 });
|
|
1979
|
+
return ElMessage({ message: "已合并", type: "success" });
|
|
1980
|
+
}
|
|
1981
|
+
}
|
|
1982
|
+
}
|
|
1983
|
+
ElMessage({ message: "合并失败,两条线未找到共用点", type: "warning" });
|
|
1984
|
+
next();
|
|
1985
|
+
}
|
|
1986
|
+
/** 执行完成
|
|
1987
|
+
* @param data
|
|
1988
|
+
*/
|
|
1989
|
+
completed(data) {
|
|
1990
|
+
this.renderManager.removeLine(data.line1);
|
|
1991
|
+
this.renderManager.removeLine(data.line2);
|
|
1992
|
+
this.renderManager.addLine(data.newLine);
|
|
1993
|
+
this.renderManager.draw();
|
|
1994
|
+
}
|
|
1995
|
+
/** 回滚操作
|
|
1996
|
+
* @param data
|
|
1997
|
+
*/
|
|
1998
|
+
rollback(data) {
|
|
1999
|
+
this.renderManager.addLines([data.line1, data.line2]);
|
|
2000
|
+
this.renderManager.removeLine(data.newLine);
|
|
2001
|
+
this.renderManager.draw();
|
|
2002
|
+
return data;
|
|
2003
|
+
}
|
|
2004
|
+
/** 撤回回滚
|
|
2005
|
+
* @param lines
|
|
2006
|
+
* @returns
|
|
2007
|
+
*/
|
|
2008
|
+
revokeRollback(data) {
|
|
2009
|
+
this.completed(data);
|
|
2010
|
+
return data;
|
|
2011
|
+
}
|
|
2012
|
+
}
|
|
2013
|
+
class DeleteSelectLine extends CommandFlowComponent {
|
|
2014
|
+
static name = "DeleteSelectLine";
|
|
2015
|
+
shortcutKeys = ["Delete"];
|
|
2016
|
+
static commandName = "deleteSelectLine";
|
|
2017
|
+
onAddFromParent(parent) {
|
|
2018
|
+
super.onAddFromParent(parent);
|
|
2019
|
+
const commandFlow = this.commandManager.addCommandFlow(DeleteSelectLine.commandName).add(this.createInterrupt()).add(this.constraint.bind(this)).add(this.delete.bind(this)).addRollback(this.rollback.bind(this)).addRevokeRollback(this.revokeRollback.bind(this));
|
|
2020
|
+
commandFlow.addEventListener("finally", this.createFinally());
|
|
2021
|
+
this.eventInput.addKeyCombination(DeleteSelectLine.commandName, this.shortcutKeys);
|
|
2022
|
+
this.eventInput.addEventListener("codeChange", async () => {
|
|
2023
|
+
this.eventInput.isKeyCombination(DeleteSelectLine.commandName) && await this.commandManager.start(DeleteSelectLine.commandName, [...this.default.selectLines]);
|
|
2024
|
+
});
|
|
2025
|
+
this.eventInput.addCancelDefaultBehavior(() => this.eventInput.isOnlyKeyDowns(this.shortcutKeys));
|
|
2026
|
+
}
|
|
2027
|
+
/**
|
|
2028
|
+
* 进入命令约束
|
|
2029
|
+
*/
|
|
2030
|
+
constraint(next, selectLines) {
|
|
2031
|
+
if (!Array.isArray(selectLines)) {
|
|
2032
|
+
ElMessage({ message: "请选择线段", type: "warning" });
|
|
2033
|
+
this.cancel();
|
|
2034
|
+
} else {
|
|
2035
|
+
next(selectLines);
|
|
2036
|
+
}
|
|
2037
|
+
}
|
|
2038
|
+
/** 开始
|
|
2039
|
+
* @param next
|
|
2040
|
+
*/
|
|
2041
|
+
delete(next, selectLines) {
|
|
2042
|
+
selectLines.forEach((line2) => this.renderManager.removeLine(line2));
|
|
2043
|
+
ElMessage({ message: "删除成功", type: "success" });
|
|
2044
|
+
next(selectLines);
|
|
2045
|
+
}
|
|
2046
|
+
/** 回滚操作
|
|
2047
|
+
* @param data
|
|
2048
|
+
*/
|
|
2049
|
+
rollback(lines) {
|
|
2050
|
+
this.renderManager.addLines(lines);
|
|
2051
|
+
this.renderManager.draw();
|
|
2052
|
+
return lines;
|
|
2053
|
+
}
|
|
2054
|
+
/** 撤回回滚
|
|
2055
|
+
* @param lines
|
|
2056
|
+
* @returns
|
|
2057
|
+
*/
|
|
2058
|
+
revokeRollback(lines) {
|
|
2059
|
+
lines.forEach((line2) => this.renderManager.removeLine(line2));
|
|
2060
|
+
return lines;
|
|
2061
|
+
}
|
|
2062
|
+
}
|
|
2063
|
+
class ConnectionLine extends CommandFlowComponent {
|
|
2064
|
+
static name = "ConnectionLine";
|
|
2065
|
+
shortcutKeys = ["Shift", "L"];
|
|
2066
|
+
static commandName = "connectionLine";
|
|
2067
|
+
onAddFromParent(parent) {
|
|
2068
|
+
super.onAddFromParent(parent);
|
|
2069
|
+
const commandFlow = this.commandManager.addCommandFlow(ConnectionLine.commandName).add(this.createInterrupt()).add(this.constraint.bind(this)).add(this.connection.bind(this)).addRollback(this.rollback.bind(this)).addRevokeRollback(this.revokeRollback.bind(this));
|
|
2070
|
+
commandFlow.addEventListener("finally", this.createFinally());
|
|
2071
|
+
commandFlow.addEventListener("completed", (e) => this.completed(e.data));
|
|
2072
|
+
this.eventInput.addKeyCombination(ConnectionLine.commandName, this.shortcutKeys);
|
|
2073
|
+
this.eventInput.addEventListener("codeChange", async () => {
|
|
2074
|
+
this.eventInput.isKeyCombination(ConnectionLine.commandName) && await this.commandManager.start(ConnectionLine.commandName, [...this.default.selectLines]);
|
|
2075
|
+
});
|
|
2076
|
+
this.eventInput.addCancelDefaultBehavior(() => this.eventInput.isOnlyKeyDowns(this.shortcutKeys));
|
|
2077
|
+
}
|
|
2078
|
+
/**
|
|
2079
|
+
* 进入命令约束
|
|
2080
|
+
*/
|
|
2081
|
+
constraint(next, selectLines) {
|
|
2082
|
+
if (!Array.isArray(selectLines)) {
|
|
2083
|
+
ElMessage({ message: "进入命令失败", type: "warning" });
|
|
2084
|
+
this.cancel();
|
|
2085
|
+
} else if (selectLines.length !== 2) {
|
|
2086
|
+
ElMessage({ message: "请选择2条线段", type: "warning" });
|
|
2087
|
+
this.cancel();
|
|
2088
|
+
} else {
|
|
2089
|
+
next(selectLines);
|
|
2090
|
+
}
|
|
2091
|
+
}
|
|
2092
|
+
/** 连接
|
|
2093
|
+
* @param next
|
|
2094
|
+
*/
|
|
2095
|
+
connection(next, selectLines) {
|
|
2096
|
+
let start, end, diatance = Infinity;
|
|
2097
|
+
for (let i = 0; i < 2; i++)
|
|
2098
|
+
for (let j = 0; j < 2; j++) {
|
|
2099
|
+
const point1 = selectLines[0].points[i];
|
|
2100
|
+
const point2 = selectLines[1].points[j];
|
|
2101
|
+
const d = point1.distance(point2);
|
|
2102
|
+
if (d < diatance) {
|
|
2103
|
+
start = point1;
|
|
2104
|
+
end = point2;
|
|
2105
|
+
diatance = d;
|
|
2106
|
+
}
|
|
2107
|
+
}
|
|
2108
|
+
if (start && end) {
|
|
2109
|
+
const line2 = new LineSegment(start.clone(), end.clone());
|
|
2110
|
+
next(line2);
|
|
2111
|
+
ElMessage({ message: "连接成功", type: "success" });
|
|
2112
|
+
} else this.cancel();
|
|
2113
|
+
}
|
|
2114
|
+
/** 成功
|
|
2115
|
+
* @param next
|
|
2116
|
+
* @param selectLines
|
|
2117
|
+
*/
|
|
2118
|
+
completed(line2) {
|
|
2119
|
+
this.renderManager.addLine(line2);
|
|
2120
|
+
this.renderManager.draw();
|
|
2121
|
+
}
|
|
2122
|
+
/** 回滚操作
|
|
2123
|
+
* @param data
|
|
2124
|
+
*/
|
|
2125
|
+
rollback(line2) {
|
|
2126
|
+
this.renderManager.removeLine(line2);
|
|
2127
|
+
return line2;
|
|
2128
|
+
}
|
|
2129
|
+
/** 撤回回滚
|
|
2130
|
+
* @param lines
|
|
2131
|
+
* @returns
|
|
2132
|
+
*/
|
|
2133
|
+
revokeRollback(line2) {
|
|
2134
|
+
this.completed(line2);
|
|
2135
|
+
return line2;
|
|
2136
|
+
}
|
|
2137
|
+
}
|
|
2138
|
+
class IntersectionConnectionLine extends CommandFlowComponent {
|
|
2139
|
+
static name = "IntersectionConnectionLine";
|
|
2140
|
+
shortcutKeys = ["control", "Shift", "L"];
|
|
2141
|
+
static commandName = "intersectionConnectionLine";
|
|
2142
|
+
onAddFromParent(parent) {
|
|
2143
|
+
super.onAddFromParent(parent);
|
|
2144
|
+
const commandFlow = this.commandManager.addCommandFlow(IntersectionConnectionLine.commandName).add(this.createInterrupt()).add(this.constraint.bind(this)).add(this.connection.bind(this)).addRollback(this.rollback.bind(this)).addRevokeRollback(this.revokeRollback.bind(this));
|
|
2145
|
+
commandFlow.addEventListener("finally", this.createFinally());
|
|
2146
|
+
commandFlow.addEventListener("completed", (e) => this.completed(e.data));
|
|
2147
|
+
this.eventInput.addKeyCombination(IntersectionConnectionLine.commandName, this.shortcutKeys);
|
|
2148
|
+
this.eventInput.addEventListener("codeChange", async () => {
|
|
2149
|
+
this.eventInput.isKeyCombination(IntersectionConnectionLine.commandName) && await this.commandManager.start(IntersectionConnectionLine.commandName, [...this.default.selectLines]);
|
|
2150
|
+
});
|
|
2151
|
+
this.eventInput.addCancelDefaultBehavior(() => this.eventInput.isOnlyKeyDowns(this.shortcutKeys));
|
|
2152
|
+
}
|
|
2153
|
+
/**
|
|
2154
|
+
* 进入命令约束
|
|
2155
|
+
*/
|
|
2156
|
+
constraint(next, selectLines) {
|
|
2157
|
+
if (!Array.isArray(selectLines)) {
|
|
2158
|
+
ElMessage({ message: "进入命令失败", type: "warning" });
|
|
2159
|
+
this.cancel();
|
|
2160
|
+
} else if (selectLines.length !== 2) {
|
|
2161
|
+
ElMessage({ message: "请选择2条线段", type: "warning" });
|
|
2162
|
+
this.cancel();
|
|
2163
|
+
} else {
|
|
2164
|
+
next(selectLines);
|
|
2165
|
+
}
|
|
2166
|
+
}
|
|
2167
|
+
/** 开始
|
|
2168
|
+
* @param next
|
|
2169
|
+
*/
|
|
2170
|
+
connection(next, selectLines) {
|
|
2171
|
+
const line1 = selectLines[0], line2 = selectLines[1], point = selectLines[0].getIntersection(selectLines[1]);
|
|
2172
|
+
if (!point) return;
|
|
2173
|
+
const oldLine1 = line1.points.map((p) => p.clone()), oldLine2 = line2.points.map((p) => p.clone());
|
|
2174
|
+
if (line1.start.distance(point) < line1.end.distance(point)) {
|
|
2175
|
+
line1.start.copy(point);
|
|
2176
|
+
} else {
|
|
2177
|
+
line1.end.copy(point);
|
|
2178
|
+
}
|
|
2179
|
+
if (line2.start.distance(point) < line2.end.distance(point)) {
|
|
2180
|
+
line2.start.copy(point);
|
|
2181
|
+
} else {
|
|
2182
|
+
line2.end.copy(point);
|
|
2183
|
+
}
|
|
2184
|
+
const newLine1 = line1.points.map((p) => p.clone()), newLine2 = line2.points.map((p) => p.clone());
|
|
2185
|
+
next({ line1, line2, oldLine1, oldLine2, newLine1, newLine2 });
|
|
2186
|
+
ElMessage({ message: "连接成功", type: "success" });
|
|
2187
|
+
}
|
|
2188
|
+
/** 执行完成
|
|
2189
|
+
* @param next
|
|
2190
|
+
* @param selectLines
|
|
2191
|
+
*/
|
|
2192
|
+
completed({ line1, line2, newLine1, newLine2 }) {
|
|
2193
|
+
this.renderManager.removeLine(line1);
|
|
2194
|
+
this.renderManager.removeLine(line2);
|
|
2195
|
+
line1.set(...newLine1);
|
|
2196
|
+
line2.set(...newLine2);
|
|
2197
|
+
this.renderManager.addLines([line1, line2]);
|
|
2198
|
+
this.renderManager.draw();
|
|
2199
|
+
}
|
|
2200
|
+
/** 回滚操作
|
|
2201
|
+
* @param data
|
|
2202
|
+
*/
|
|
2203
|
+
rollback(data) {
|
|
2204
|
+
const { line1, line2, oldLine1, oldLine2 } = data;
|
|
2205
|
+
this.renderManager.removeLine(line1);
|
|
2206
|
+
this.renderManager.removeLine(line2);
|
|
2207
|
+
line1.set(...oldLine1);
|
|
2208
|
+
line2.set(...oldLine2);
|
|
2209
|
+
this.renderManager.addLines([line1, line2]);
|
|
2210
|
+
this.renderManager.draw();
|
|
2211
|
+
return data;
|
|
2212
|
+
}
|
|
2213
|
+
/** 撤回回滚
|
|
2214
|
+
* @param lines
|
|
2215
|
+
* @returns
|
|
2216
|
+
*/
|
|
2217
|
+
revokeRollback(data) {
|
|
2218
|
+
this.completed(data);
|
|
2219
|
+
return data;
|
|
2220
|
+
}
|
|
2221
|
+
}
|
|
2222
|
+
class DeleteSelectWindow extends CommandFlowComponent {
|
|
2223
|
+
static name = "DeleteSelectWindow";
|
|
2224
|
+
shortcutKeys = ["Q", "Delete"];
|
|
2225
|
+
static commandName = "deleteSelectWindow";
|
|
2226
|
+
onAddFromParent(parent) {
|
|
2227
|
+
super.onAddFromParent(parent);
|
|
2228
|
+
const commandFlow = this.commandManager.addCommandFlow(DeleteSelectWindow.commandName).add(this.createInterrupt()).add(this.constraint.bind(this)).add(this.end.bind(this)).addRollback(this.rollback.bind(this)).addRevokeRollback(this.revokeRollback.bind(this));
|
|
2229
|
+
commandFlow.addEventListener("finally", this.createFinally());
|
|
2230
|
+
commandFlow.addEventListener("completed", (e) => this.completed(e.data));
|
|
2231
|
+
this.eventInput.addKeyCombination(DeleteSelectWindow.commandName, this.shortcutKeys);
|
|
2232
|
+
this.eventInput.addEventListener("codeChange", async () => {
|
|
2233
|
+
this.eventInput.isKeyCombination(DeleteSelectWindow.commandName) && await this.commandManager.start(DeleteSelectWindow.commandName, [...this.default.selectLines]);
|
|
2234
|
+
});
|
|
2235
|
+
this.eventInput.addCancelDefaultBehavior(() => this.eventInput.isOnlyKeyDowns(this.shortcutKeys));
|
|
2236
|
+
}
|
|
2237
|
+
/**
|
|
2238
|
+
* 进入命令约束
|
|
2239
|
+
*/
|
|
2240
|
+
constraint(next, selectLines) {
|
|
2241
|
+
if (!Array.isArray(selectLines)) {
|
|
2242
|
+
ElMessage({ message: "进入命令失败", type: "warning" });
|
|
2243
|
+
this.cancel();
|
|
2244
|
+
} else if (!selectLines.some((l) => l.userData.isWindow)) {
|
|
2245
|
+
ElMessage({ message: "请选择有窗户线段", type: "warning" });
|
|
2246
|
+
this.cancel();
|
|
2247
|
+
} else {
|
|
2248
|
+
next(selectLines);
|
|
2249
|
+
}
|
|
2250
|
+
}
|
|
2251
|
+
/** 开始
|
|
2252
|
+
* @param next
|
|
2253
|
+
*/
|
|
2254
|
+
end(next, selectLines) {
|
|
2255
|
+
let is = false, list = [];
|
|
2256
|
+
selectLines.forEach((line2) => {
|
|
2257
|
+
if (!line2.userData.isWindow) return;
|
|
2258
|
+
list.push({
|
|
2259
|
+
line: line2,
|
|
2260
|
+
drawDoorData: line2.userData.drawDoorData
|
|
2261
|
+
});
|
|
2262
|
+
is = true;
|
|
2263
|
+
});
|
|
2264
|
+
is && ElMessage({ message: "删除窗户成功", type: "success" });
|
|
2265
|
+
next(list);
|
|
2266
|
+
}
|
|
2267
|
+
/**
|
|
2268
|
+
* 完成
|
|
2269
|
+
* @param list
|
|
2270
|
+
*/
|
|
2271
|
+
completed(list) {
|
|
2272
|
+
list.forEach((item) => {
|
|
2273
|
+
const userData = item.line.userData;
|
|
2274
|
+
if (userData) {
|
|
2275
|
+
delete userData.isWindow;
|
|
2276
|
+
delete userData.drawDoorData;
|
|
2277
|
+
}
|
|
2278
|
+
});
|
|
2279
|
+
this.renderManager.draw();
|
|
2280
|
+
}
|
|
2281
|
+
/** 回滚操作
|
|
2282
|
+
* @param data
|
|
2283
|
+
*/
|
|
2284
|
+
rollback(list) {
|
|
2285
|
+
list.forEach((item) => {
|
|
2286
|
+
if (!item.line.userData) item.line.userData = {};
|
|
2287
|
+
const userData = item.line.userData;
|
|
2288
|
+
userData.isWindow = true;
|
|
2289
|
+
userData.drawDoorData = item.drawDoorData;
|
|
2290
|
+
});
|
|
2291
|
+
this.renderManager.draw();
|
|
2292
|
+
return list;
|
|
2293
|
+
}
|
|
2294
|
+
/** 撤回回滚
|
|
2295
|
+
* @param lines
|
|
2296
|
+
* @returns
|
|
2297
|
+
*/
|
|
2298
|
+
revokeRollback(list) {
|
|
2299
|
+
this.completed(list);
|
|
2300
|
+
return list;
|
|
2301
|
+
}
|
|
2302
|
+
}
|
|
2303
|
+
class SelectAll extends CommandFlowComponent {
|
|
2304
|
+
static name = "SelectAll";
|
|
2305
|
+
container = new THREE.Group();
|
|
2306
|
+
shortcutKeys = ["control", "a"];
|
|
2307
|
+
static commandName = "selectAll";
|
|
2308
|
+
onAddFromParent(parent) {
|
|
2309
|
+
super.onAddFromParent(parent);
|
|
2310
|
+
this.editor.container.add(this.container);
|
|
2311
|
+
this.container.position.z = 1e-3;
|
|
2312
|
+
const commandFlow = this.commandManager.addCommandFlow(SelectAll.commandName).add(this.createInterrupt()).add(this.selectAll.bind(this)).addRollback(this.rollback.bind(this)).addRevokeRollback(this.revokeRollback.bind(this));
|
|
2313
|
+
commandFlow.addEventListener("finally", this.createFinally());
|
|
2314
|
+
commandFlow.addEventListener("completed", (e) => this.completed(e.data));
|
|
2315
|
+
this.eventInput.addKeyCombination(SelectAll.commandName, this.shortcutKeys);
|
|
2316
|
+
this.eventInput.addEventListener("codeChange", async () => {
|
|
2317
|
+
this.eventInput.isKeyCombination(SelectAll.commandName) && await this.commandManager.start(SelectAll.commandName);
|
|
2318
|
+
});
|
|
2319
|
+
this.eventInput.addCancelDefaultBehavior(() => this.eventInput.isOnlyKeyDowns(this.shortcutKeys));
|
|
2320
|
+
}
|
|
2321
|
+
/** 开始
|
|
2322
|
+
* @param next
|
|
2323
|
+
*/
|
|
2324
|
+
selectAll(next) {
|
|
2325
|
+
next([...this.renderManager.lines]);
|
|
2326
|
+
}
|
|
2327
|
+
/** 执行完成
|
|
2328
|
+
*/
|
|
2329
|
+
completed(lines) {
|
|
2330
|
+
lines.map((line2) => this.default.addSelectLine(line2));
|
|
2331
|
+
}
|
|
2332
|
+
/** 回滚操作
|
|
2333
|
+
* @param lines
|
|
2334
|
+
*/
|
|
2335
|
+
rollback(lines) {
|
|
2336
|
+
lines.map((line2) => this.default.removeSelectLine(line2));
|
|
2337
|
+
return lines;
|
|
2338
|
+
}
|
|
2339
|
+
/** 撤回回滚
|
|
2340
|
+
* @param lines
|
|
2341
|
+
* @returns
|
|
2342
|
+
*/
|
|
2343
|
+
revokeRollback(lines) {
|
|
2344
|
+
this.completed(lines);
|
|
2345
|
+
return lines;
|
|
2346
|
+
}
|
|
2347
|
+
}
|
|
2348
|
+
const _hoisted_1 = {
|
|
2349
|
+
key: 0,
|
|
2350
|
+
class: "mt-[5px] text-[#ccc] text-[11px] absolute left-[10px] bottom-[10px] rounded-[8px] min-w-[150px] bg-black/15 p-[10px]"
|
|
2351
|
+
};
|
|
2352
|
+
const _hoisted_2 = { class: "text-start max-w-[150px]" };
|
|
2353
|
+
const _hoisted_3 = { class: "inline-block ml-[10px] text-[var(--color-primary)]" };
|
|
2354
|
+
const _hoisted_4 = {
|
|
2355
|
+
key: 0,
|
|
2356
|
+
class: "p-[5px] max-w-[200px]"
|
|
2357
|
+
};
|
|
2358
|
+
const _hoisted_5 = { class: "text-[14px] flex flex-col" };
|
|
2359
|
+
const _hoisted_6 = ["onClick"];
|
|
2360
|
+
const _hoisted_7 = { class: "flex flex-row items-center" };
|
|
2361
|
+
const _hoisted_8 = { class: "flex justify-center items-center size-[20px] bg-[#f0f0f0] rounded-[2px] mr-[10px]" };
|
|
2362
|
+
const _hoisted_9 = ["src"];
|
|
2363
|
+
const _hoisted_10 = { class: "text-wrap" };
|
|
2364
|
+
const _hoisted_11 = {
|
|
2365
|
+
key: 1,
|
|
2366
|
+
class: "text-[#999]"
|
|
2367
|
+
};
|
|
2368
|
+
const _hoisted_12 = {
|
|
2369
|
+
style: { "--el-color-primary": "var(--primary-color)" },
|
|
2370
|
+
class: "flex flex-row items-center justify-between gap-[10px] mt-[10px] text-[10px]"
|
|
2371
|
+
};
|
|
2372
|
+
const _hoisted_13 = {
|
|
2373
|
+
key: 0,
|
|
2374
|
+
class: "flex flex-row items-center flex-wrap justify-between gap-[10px] mt-[10px] text-[10px]"
|
|
2375
|
+
};
|
|
2376
|
+
const _hoisted_14 = { class: "flex-wrap border-t-1 border-t-[#eee] mt-[5px] pt-[5px] flex items-center gap-[10px]" };
|
|
2377
|
+
const _hoisted_15 = ["onClick", "title"];
|
|
2378
|
+
const _hoisted_16 = ["src"];
|
|
2379
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
2380
|
+
__name: "EditorTool",
|
|
2381
|
+
props: {
|
|
2382
|
+
dxfSystem: {},
|
|
2383
|
+
permission: {}
|
|
2384
|
+
},
|
|
2385
|
+
setup(__props) {
|
|
2386
|
+
function setEditorToolPosition(left, top, rect = elRef.value.getBoundingClientRect(), toolBarRect = toolBarRef.value.getBoundingClientRect()) {
|
|
2387
|
+
const minX = 0, maxX = rect.width - toolBarRect.width, minY = 0, maxY = rect.height - toolBarRect.height;
|
|
2388
|
+
left = Math.max(minX, Math.min(left, maxX));
|
|
2389
|
+
top = Math.max(minY, Math.min(top, maxY));
|
|
2390
|
+
toolBarPosition.value = { left, top };
|
|
2391
|
+
}
|
|
2392
|
+
function startCurrentCommandItem(item) {
|
|
2393
|
+
if (currentCommand.value === item.command) return;
|
|
2394
|
+
editor.commandManager.start(item.command);
|
|
2395
|
+
}
|
|
2396
|
+
function setLines(lines) {
|
|
2397
|
+
if (lines) {
|
|
2398
|
+
localStorage.setItem("lines", JSON.stringify(lines));
|
|
2399
|
+
try {
|
|
2400
|
+
dxfSystem.Dxf.set(lines);
|
|
2401
|
+
dxfSystem.Dxf.lineOffset();
|
|
2402
|
+
} catch (error) {
|
|
2403
|
+
console.log(error);
|
|
2404
|
+
}
|
|
2405
|
+
}
|
|
2406
|
+
}
|
|
2407
|
+
async function selectLocalFile() {
|
|
2408
|
+
const data = await SelectLocalFile.json();
|
|
2409
|
+
if (Array.isArray(data)) {
|
|
2410
|
+
localStorage.removeItem("orbitControls");
|
|
2411
|
+
setLines(data);
|
|
1778
2412
|
}
|
|
1779
2413
|
}
|
|
1780
2414
|
function dragMoveHelper({ offsetX, offsetY }) {
|
|
@@ -1802,7 +2436,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
1802
2436
|
document.addEventListener("mouseup", end);
|
|
1803
2437
|
}
|
|
1804
2438
|
const props = __props;
|
|
1805
|
-
const originalLineVisible = ref(true), dxfVisible = ref(true), whiteModelVisible = ref(true), isLook = ref(false), elRef = ref(), toolBarRef = ref(), toolBarExpand = ref(true), currentCommand = ref(""), dxfSystem = toRaw(props.dxfSystem), domEventRegister = dxfSystem.findComponentByType(DomEventRegister), editor = dxfSystem.findComponentByType(Editor$1), defaultComponent = dxfSystem.findComponentByType(Default), whiteModel = dxfSystem.findComponentByType(WhiteModel), toolBarPosition = ref({ left: 10, top: 10 }), images = /* @__PURE__ */ Object.assign({ "./assets/images/
|
|
2439
|
+
const originalLineVisible = ref(true), dxfVisible = ref(true), whiteModelVisible = ref(true), isLook = ref(false), elRef = ref(), toolBarRef = ref(), toolBarExpand = ref(true), currentCommand = ref(""), dxfSystem = toRaw(props.dxfSystem), domEventRegister = dxfSystem.findComponentByType(DomEventRegister), editor = dxfSystem.findComponentByType(Editor$1), defaultComponent = dxfSystem.findComponentByType(Default), whiteModel = dxfSystem.findComponentByType(WhiteModel), rollbackCount = ref(0), revokeRollbackCount = ref(0), toolBarPosition = ref({ left: 10, top: 10 }), images = /* @__PURE__ */ Object.assign({ "./assets/images/connection.svg": __vite_glob_0_0, "./assets/images/deleteSelectLine.svg": __vite_glob_0_1, "./assets/images/deleteSelectWindow.svg": __vite_glob_0_2, "./assets/images/door.svg": __vite_glob_0_3, "./assets/images/intersectionConnection.svg": __vite_glob_0_4, "./assets/images/line.svg": __vite_glob_0_5, "./assets/images/mergeLine.svg": __vite_glob_0_6, "./assets/images/revokeRollback.svg": __vite_glob_0_7, "./assets/images/rollback.svg": __vite_glob_0_8, "./assets/images/selectAll.svg": __vite_glob_0_9, "./assets/images/selectPoint.svg": __vite_glob_0_10, "./assets/images/verticalCorrection.svg": __vite_glob_0_11, "./assets/images/window.svg": __vite_glob_0_12 }), showShortcutKey = ref(false), selectLineCount = ref(0), hasWindowLine = ref(false), resizeObserver = new ResizeObserver(() => setEditorToolPosition(toolBarPosition.value.left, toolBarPosition.value.top)), shortcutKeys = [
|
|
1806
2440
|
{ "name": "开启绘制线段命令", "shortcut": "Ctrl + L" },
|
|
1807
2441
|
{ "name": "开启绘制门线命令", "shortcut": "Ctrl + M" },
|
|
1808
2442
|
{ "name": "开启绘制窗户线命令", "shortcut": "Ctrl + Q" },
|
|
@@ -1818,7 +2452,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
1818
2452
|
{ "name": "线段连接", "shortcut": "选中 + Shift + L" },
|
|
1819
2453
|
{ "name": "线段交点连接", "shortcut": "选中 + Ctrl + Shift + L" },
|
|
1820
2454
|
{ "name": "命令确认", "shortcut": "Enter" },
|
|
1821
|
-
{ "name": "取消命令", "shortcut": "Esc" }
|
|
2455
|
+
{ "name": "取消命令", "shortcut": "Esc" },
|
|
2456
|
+
{ "name": "回滚操作", "shortcut": "Ctrl + Z" },
|
|
2457
|
+
{ "name": "取消回滚操作", "shortcut": "Ctrl + Y" }
|
|
1822
2458
|
], commandList = [
|
|
1823
2459
|
{
|
|
1824
2460
|
command: "default",
|
|
@@ -1854,10 +2490,86 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
1854
2490
|
src: images["./assets/images/selectPoint.svg"].default,
|
|
1855
2491
|
shortcut: "Ctrl + P"
|
|
1856
2492
|
}
|
|
2493
|
+
], otherCommandList = [
|
|
2494
|
+
{
|
|
2495
|
+
command: "",
|
|
2496
|
+
name: "操作回滚",
|
|
2497
|
+
src: images["./assets/images/rollback.svg"].default,
|
|
2498
|
+
show: computed(() => rollbackCount.value !== 0),
|
|
2499
|
+
shortcut: "Ctrl + Z",
|
|
2500
|
+
action() {
|
|
2501
|
+
editor.commandManager.rollback();
|
|
2502
|
+
}
|
|
2503
|
+
},
|
|
2504
|
+
{
|
|
2505
|
+
command: "",
|
|
2506
|
+
name: "撤销操作回滚",
|
|
2507
|
+
src: images["./assets/images/revokeRollback.svg"].default,
|
|
2508
|
+
show: computed(() => revokeRollbackCount.value !== 0),
|
|
2509
|
+
shortcut: "Ctrl + Y",
|
|
2510
|
+
class: "rotateY-[180deg]",
|
|
2511
|
+
action() {
|
|
2512
|
+
editor.commandManager.revokeRollback();
|
|
2513
|
+
}
|
|
2514
|
+
},
|
|
2515
|
+
{
|
|
2516
|
+
command: MergeLine.commandName,
|
|
2517
|
+
name: "合并",
|
|
2518
|
+
src: images["./assets/images/mergeLine.svg"].default,
|
|
2519
|
+
show: computed(() => selectLineCount.value === 2),
|
|
2520
|
+
shortcut: "Ctrl + G"
|
|
2521
|
+
},
|
|
2522
|
+
{
|
|
2523
|
+
command: ConnectionLine.commandName,
|
|
2524
|
+
name: "两点连接",
|
|
2525
|
+
show: computed(() => selectLineCount.value === 2),
|
|
2526
|
+
src: images["./assets/images/connection.svg"].default,
|
|
2527
|
+
shortcut: "Shift + L"
|
|
2528
|
+
},
|
|
2529
|
+
{
|
|
2530
|
+
command: IntersectionConnectionLine.commandName,
|
|
2531
|
+
name: "延长线交点连接",
|
|
2532
|
+
show: computed(() => selectLineCount.value === 2),
|
|
2533
|
+
src: images["./assets/images/intersectionConnection.svg"].default,
|
|
2534
|
+
shortcut: "Ctrl + Shift + L"
|
|
2535
|
+
},
|
|
2536
|
+
{
|
|
2537
|
+
command: VerticalCorrection.commandName,
|
|
2538
|
+
name: "线段垂直纠正",
|
|
2539
|
+
show: computed(() => selectLineCount.value === 1),
|
|
2540
|
+
src: images["./assets/images/verticalCorrection.svg"].default,
|
|
2541
|
+
shortcut: "Ctrl + C"
|
|
2542
|
+
},
|
|
2543
|
+
{
|
|
2544
|
+
command: SelectAll.commandName,
|
|
2545
|
+
name: "全选",
|
|
2546
|
+
show: computed(() => selectLineCount.value !== editor.renderManager.lines.length),
|
|
2547
|
+
src: images["./assets/images/selectAll.svg"].default,
|
|
2548
|
+
shortcut: "Ctrl + A"
|
|
2549
|
+
},
|
|
2550
|
+
{
|
|
2551
|
+
command: DeleteSelectWindow.commandName,
|
|
2552
|
+
name: "清除窗户",
|
|
2553
|
+
show: computed(() => hasWindowLine.value),
|
|
2554
|
+
src: images["./assets/images/deleteSelectWindow.svg"].default,
|
|
2555
|
+
shortcut: "Q + Delete"
|
|
2556
|
+
},
|
|
2557
|
+
{
|
|
2558
|
+
command: DeleteSelectLine.commandName,
|
|
2559
|
+
name: "删除",
|
|
2560
|
+
show: computed(() => selectLineCount.value > 0),
|
|
2561
|
+
src: images["./assets/images/deleteSelectLine.svg"].default,
|
|
2562
|
+
shortcut: "Delete"
|
|
2563
|
+
}
|
|
1857
2564
|
];
|
|
1858
2565
|
watch(toolBarPosition, () => localStorage.setItem("editorToolPosition", JSON.stringify(toolBarPosition.value)));
|
|
1859
2566
|
watch(showShortcutKey, () => localStorage.setItem("showShortcutKey", showShortcutKey.value + ""));
|
|
1860
|
-
watch(toolBarExpand, () =>
|
|
2567
|
+
watch(toolBarExpand, () => {
|
|
2568
|
+
localStorage.setItem("toolBarExpand", toolBarExpand.value + "");
|
|
2569
|
+
if (toolBarExpand.value) {
|
|
2570
|
+
nextTick(() => setEditorToolPosition(toolBarPosition.value.left, toolBarPosition.value.top));
|
|
2571
|
+
}
|
|
2572
|
+
});
|
|
1861
2573
|
watch(originalLineVisible, () => dxfSystem.Variable.set("originalLineVisible", originalLineVisible.value));
|
|
1862
2574
|
watch(dxfVisible, () => dxfSystem.Variable.set("dxfVisible", dxfVisible.value));
|
|
1863
2575
|
watch(whiteModelVisible, () => dxfSystem.Variable.set("whiteModelVisible", whiteModelVisible.value));
|
|
@@ -1885,11 +2597,19 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
1885
2597
|
} else {
|
|
1886
2598
|
nextTick(() => resizeObserver.observe(elRef.value));
|
|
1887
2599
|
}
|
|
1888
|
-
},
|
|
2600
|
+
}, 100);
|
|
1889
2601
|
defaultComponent.addEventListener("selectLineChange", () => {
|
|
1890
2602
|
selectLineCount.value = defaultComponent.selectLines.length;
|
|
1891
2603
|
hasWindowLine.value = defaultComponent.selectLines.some((l) => l.userData.isWindow);
|
|
1892
2604
|
});
|
|
2605
|
+
["rollback", "completed", "revokeRollback"].forEach((key) => {
|
|
2606
|
+
editor.commandManager.addEventListener(key, () => {
|
|
2607
|
+
setTimeout(() => {
|
|
2608
|
+
rollbackCount.value = editor.commandManager.operationList.length;
|
|
2609
|
+
revokeRollbackCount.value = editor.commandManager.rollbackList.length;
|
|
2610
|
+
});
|
|
2611
|
+
});
|
|
2612
|
+
});
|
|
1893
2613
|
});
|
|
1894
2614
|
onUnmounted(() => {
|
|
1895
2615
|
domEventRegister.mouseMoveEventProxylock = false;
|
|
@@ -1900,13 +2620,13 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
1900
2620
|
return openBlock(), createElementBlock("div", {
|
|
1901
2621
|
ref_key: "elRef",
|
|
1902
2622
|
ref: elRef,
|
|
1903
|
-
class: "editorTool pointer-events-none overflow-hidden absolute left-0 top-0 w-full h-full z-[
|
|
2623
|
+
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]"
|
|
1904
2624
|
}, [
|
|
1905
2625
|
createVNode(Transition, null, {
|
|
1906
2626
|
default: withCtx(() => [
|
|
1907
2627
|
showShortcutKey.value ? (openBlock(), createElementBlock("div", _hoisted_1, [
|
|
1908
2628
|
(openBlock(), createElementBlock(Fragment, null, renderList(shortcutKeys, (item) => {
|
|
1909
|
-
return createElementVNode("
|
|
2629
|
+
return createElementVNode("div", {
|
|
1910
2630
|
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
2631
|
key: item.name
|
|
1912
2632
|
}, [
|
|
@@ -1922,14 +2642,14 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
1922
2642
|
ref_key: "toolBarRef",
|
|
1923
2643
|
ref: toolBarRef,
|
|
1924
2644
|
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[
|
|
2645
|
+
class: normalizeClass(["overflow-hidden pointer-events-auto w-fit max-w-[260px] transition-[border-radius] text-[#333] absolute z-[11] bg-white select-none", { "rounded-[8px] ": toolBarExpand.value }]),
|
|
2646
|
+
onMousedown: _cache[8] || (_cache[8] = (e) => e.stopPropagation())
|
|
1927
2647
|
}, [
|
|
1928
2648
|
createElementVNode("div", {
|
|
1929
2649
|
onMousedown: dragMoveHelper,
|
|
1930
|
-
class: normalizeClass([{ "border-b-[#eee]": toolBarExpand.value }, "flex flex-row justify-between header text-[14px] font-bold p-[10px 0px]
|
|
2650
|
+
class: normalizeClass([{ "border-b-[#eee] border-b-1": toolBarExpand.value }, "flex flex-row justify-between header text-[14px] font-bold p-[10px 0px]"])
|
|
1931
2651
|
}, [
|
|
1932
|
-
_cache[
|
|
2652
|
+
_cache[10] || (_cache[10] = createStaticVNode('<div class="flex flex-row" data-v-953dfd98><div class="p-[2px_5px] flex items-center pointer-events-none" data-v-953dfd98><svg fill="#aaa" width="20" height="20" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" data-v-953dfd98><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-953dfd98></path></svg></div><h5 class="flex text-nowrap text-[12px] items-center pointer-events-none" data-v-953dfd98>绘制工具</h5></div>', 1)),
|
|
1933
2653
|
createElementVNode("div", {
|
|
1934
2654
|
onMousedown: _cache[0] || (_cache[0] = (e) => e.stopPropagation()),
|
|
1935
2655
|
onClick: _cache[1] || (_cache[1] = ($event) => toolBarExpand.value = !toolBarExpand.value),
|
|
@@ -1943,7 +2663,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
1943
2663
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1944
2664
|
width: "12",
|
|
1945
2665
|
height: "12"
|
|
1946
|
-
}, _cache[
|
|
2666
|
+
}, _cache[9] || (_cache[9] = [
|
|
1947
2667
|
createElementVNode("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)
|
|
1948
2668
|
]), 2))
|
|
1949
2669
|
], 32)
|
|
@@ -1957,7 +2677,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
1957
2677
|
item.show ? (openBlock(), createElementBlock("li", {
|
|
1958
2678
|
key: 0,
|
|
1959
2679
|
onClick: ($event) => startCurrentCommandItem(item),
|
|
1960
|
-
class: normalizeClass([{ "!bg-[var(--primary-color)] text-[#fff]": currentCommand.value === item.command }, "gap-[
|
|
2680
|
+
class: normalizeClass([{ "!bg-[var(--primary-color)] text-[#fff]": currentCommand.value === item.command }, "gap-[10px] text-[12px] hover:bg-[#ddd] transition-all rounded-[6px] p-[5px] flex flex-row items-center justify-between cursor-pointer"])
|
|
1961
2681
|
}, [
|
|
1962
2682
|
createElementVNode("div", _hoisted_7, [
|
|
1963
2683
|
createElementVNode("div", _hoisted_8, [
|
|
@@ -1968,14 +2688,14 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
1968
2688
|
srcset: ""
|
|
1969
2689
|
}, null, 8, _hoisted_9)
|
|
1970
2690
|
]),
|
|
1971
|
-
createElementVNode("span",
|
|
2691
|
+
createElementVNode("span", _hoisted_10, toDisplayString(item.name), 1)
|
|
1972
2692
|
]),
|
|
1973
2693
|
currentCommand.value === item.command ? (openBlock(), createElementBlock("div", {
|
|
1974
2694
|
key: 0,
|
|
1975
2695
|
title: "取消命令(Esc)",
|
|
1976
2696
|
class: "active:scale-[0.7] transition-all",
|
|
1977
2697
|
onClick: _cache[2] || (_cache[2] = (e) => (unref(editor).cancelCommand(), e.stopPropagation()))
|
|
1978
|
-
}, _cache[
|
|
2698
|
+
}, _cache[11] || (_cache[11] = [
|
|
1979
2699
|
createElementVNode("svg", {
|
|
1980
2700
|
fill: "#fff",
|
|
1981
2701
|
width: "16",
|
|
@@ -1987,12 +2707,12 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
1987
2707
|
createElementVNode("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" }),
|
|
1988
2708
|
createElementVNode("path", { d: "M236.437333 463.914667l549.333333 0 0 96.874667-549.333333 0 0-96.874667Z" })
|
|
1989
2709
|
], -1)
|
|
1990
|
-
]))) : item.shortcut ? (openBlock(), createElementBlock("div",
|
|
2710
|
+
]))) : item.shortcut ? (openBlock(), createElementBlock("div", _hoisted_11, toDisplayString(item.shortcut), 1)) : createCommentVNode("", true)
|
|
1991
2711
|
], 10, _hoisted_6)) : createCommentVNode("", true)
|
|
1992
2712
|
], 64);
|
|
1993
2713
|
}), 64))
|
|
1994
2714
|
]),
|
|
1995
|
-
createElementVNode("div",
|
|
2715
|
+
createElementVNode("div", _hoisted_12, [
|
|
1996
2716
|
createVNode(unref(ElCheckbox), {
|
|
1997
2717
|
size: "small",
|
|
1998
2718
|
modelValue: showShortcutKey.value,
|
|
@@ -2006,148 +2726,77 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
2006
2726
|
label: "dxf"
|
|
2007
2727
|
}, null, 8, ["modelValue"])
|
|
2008
2728
|
]),
|
|
2009
|
-
_ctx.permission === "admin" ? (openBlock(), createElementBlock("div",
|
|
2729
|
+
_ctx.permission === "admin" ? (openBlock(), createElementBlock("div", _hoisted_13, [
|
|
2010
2730
|
createVNode(unref(ElButton), {
|
|
2011
2731
|
style: { "padding": "5px", "font-size": "10px" },
|
|
2012
2732
|
size: "small",
|
|
2013
2733
|
type: "success",
|
|
2014
2734
|
onClick: selectLocalFile
|
|
2015
2735
|
}, {
|
|
2016
|
-
default: withCtx(() => _cache[
|
|
2736
|
+
default: withCtx(() => _cache[12] || (_cache[12] = [
|
|
2017
2737
|
createTextVNode(" 选择文件 ", -1)
|
|
2018
2738
|
])),
|
|
2019
2739
|
_: 1,
|
|
2020
|
-
__: [
|
|
2740
|
+
__: [12]
|
|
2021
2741
|
}),
|
|
2022
2742
|
createVNode(unref(ElButton), {
|
|
2023
2743
|
style: { "padding": "5px", "font-size": "10px" },
|
|
2024
2744
|
size: "small",
|
|
2025
2745
|
type: "primary",
|
|
2026
|
-
onClick: _cache[5] || (_cache[5] = ($event) => unref(dxfSystem).Dxf.
|
|
2746
|
+
onClick: _cache[5] || (_cache[5] = ($event) => console.log(unref(dxfSystem).Dxf.originalData))
|
|
2027
2747
|
}, {
|
|
2028
|
-
default: withCtx(() => _cache[
|
|
2029
|
-
createTextVNode("
|
|
2748
|
+
default: withCtx(() => _cache[13] || (_cache[13] = [
|
|
2749
|
+
createTextVNode(" 打印Json ", -1)
|
|
2030
2750
|
])),
|
|
2031
2751
|
_: 1,
|
|
2032
|
-
__: [
|
|
2752
|
+
__: [13]
|
|
2033
2753
|
}),
|
|
2034
2754
|
createVNode(unref(ElButton), {
|
|
2035
2755
|
style: { "padding": "5px", "font-size": "10px" },
|
|
2036
2756
|
size: "small",
|
|
2037
2757
|
type: "primary",
|
|
2038
|
-
onClick: _cache[6] || (_cache[6] = ($event) => unref(
|
|
2758
|
+
onClick: _cache[6] || (_cache[6] = ($event) => unref(dxfSystem).Dxf.download("test.dxf"))
|
|
2039
2759
|
}, {
|
|
2040
|
-
default: withCtx(() => _cache[
|
|
2041
|
-
createTextVNode(" 下载
|
|
2760
|
+
default: withCtx(() => _cache[14] || (_cache[14] = [
|
|
2761
|
+
createTextVNode(" 下载DXF ", -1)
|
|
2042
2762
|
])),
|
|
2043
2763
|
_: 1,
|
|
2044
|
-
__: [
|
|
2764
|
+
__: [14]
|
|
2045
2765
|
}),
|
|
2046
2766
|
createVNode(unref(ElButton), {
|
|
2047
2767
|
style: { "padding": "5px", "font-size": "10px" },
|
|
2048
2768
|
size: "small",
|
|
2049
2769
|
type: "primary",
|
|
2050
|
-
onClick: _cache[7] || (_cache[7] = ($event) =>
|
|
2770
|
+
onClick: _cache[7] || (_cache[7] = ($event) => unref(whiteModel).downloadGltf("test.glb", true))
|
|
2051
2771
|
}, {
|
|
2052
|
-
default: withCtx(() => _cache[
|
|
2053
|
-
createTextVNode("
|
|
2772
|
+
default: withCtx(() => _cache[15] || (_cache[15] = [
|
|
2773
|
+
createTextVNode(" 下载白膜 ", -1)
|
|
2054
2774
|
])),
|
|
2055
2775
|
_: 1,
|
|
2056
|
-
__: [
|
|
2776
|
+
__: [15]
|
|
2057
2777
|
})
|
|
2058
2778
|
])) : createCommentVNode("", true),
|
|
2059
2779
|
createVNode(Transition, null, {
|
|
2060
2780
|
default: withCtx(() => [
|
|
2061
|
-
createElementVNode("div",
|
|
2062
|
-
|
|
2063
|
-
|
|
2064
|
-
|
|
2065
|
-
|
|
2066
|
-
|
|
2067
|
-
|
|
2068
|
-
|
|
2069
|
-
|
|
2070
|
-
|
|
2071
|
-
|
|
2072
|
-
|
|
2073
|
-
|
|
2074
|
-
|
|
2075
|
-
|
|
2076
|
-
},
|
|
2077
|
-
|
|
2078
|
-
|
|
2079
|
-
|
|
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, " 无可用操作 "))
|
|
2781
|
+
createElementVNode("div", _hoisted_14, [
|
|
2782
|
+
createVNode(TransitionGroup, null, {
|
|
2783
|
+
default: withCtx(() => [
|
|
2784
|
+
(openBlock(), createElementBlock(Fragment, null, renderList(otherCommandList, (item) => {
|
|
2785
|
+
return createElementVNode("div", {
|
|
2786
|
+
onClick: ($event) => item.show.value && (item.action ? item.action() : unref(editor).commandManager.start(item.command, [...unref(defaultComponent).selectLines])),
|
|
2787
|
+
title: `${item.name}(${item.shortcut})`,
|
|
2788
|
+
class: normalizeClass(["size-[20px] flex justify-center items-center relative overflow-hidden active:scale-[0.8] border-1 border-[#ccc] rounded-[4px] transition-all cursor-pointer", { "opacity-30 bg-[#ccc] !cursor-no-drop active:!scale-[1]": !item.show.value, [item.class ?? ""]: true }]),
|
|
2789
|
+
key: item.command
|
|
2790
|
+
}, [
|
|
2791
|
+
createElementVNode("img", {
|
|
2792
|
+
class: "size-[14px]",
|
|
2793
|
+
src: item.src
|
|
2794
|
+
}, null, 8, _hoisted_16)
|
|
2795
|
+
], 10, _hoisted_15);
|
|
2796
|
+
}), 64))
|
|
2797
|
+
]),
|
|
2798
|
+
_: 1
|
|
2799
|
+
})
|
|
2151
2800
|
])
|
|
2152
2801
|
]),
|
|
2153
2802
|
_: 1
|
|
@@ -2165,7 +2814,7 @@ const _export_sfc = (sfc, props) => {
|
|
|
2165
2814
|
}
|
|
2166
2815
|
return target;
|
|
2167
2816
|
};
|
|
2168
|
-
const EditorTool = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-
|
|
2817
|
+
const EditorTool = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-953dfd98"]]);
|
|
2169
2818
|
let Editor$1 = class Editor extends Component {
|
|
2170
2819
|
static name = "Editor";
|
|
2171
2820
|
container = new THREE.Group();
|
|
@@ -2236,8 +2885,8 @@ let Editor$1 = class Editor extends Component {
|
|
|
2236
2885
|
const renderer = this.renderer, domEventRegister = this.domEventRegister, dxf = this.dxf, orbitControls = renderer.orbitControls, camera = renderer.camera, center = dxf.box.center, cameraPosition = renderer.camera.position.clone(), target = orbitControls?.target?.clone(), size = new THREE.Vector2(), raycaster = new THREE.Raycaster(), coords = this.coords, pointerPosition = this.pointerPosition;
|
|
2237
2886
|
this.container.position.z = dxf.originalZAverage;
|
|
2238
2887
|
renderer.scene.add(this.container);
|
|
2239
|
-
camera.position.set(center.x, center.y, 5);
|
|
2240
2888
|
if (orbitControls) {
|
|
2889
|
+
camera.position.set(center.x, center.y, 15);
|
|
2241
2890
|
orbitControls.target.set(center.x, center.y, 0);
|
|
2242
2891
|
orbitControls.enableRotate = false;
|
|
2243
2892
|
}
|
|
@@ -2246,7 +2895,7 @@ let Editor$1 = class Editor extends Component {
|
|
|
2246
2895
|
const x = domEventRegister.pointer.x / size.x * 2 - 1;
|
|
2247
2896
|
const y = -(domEventRegister.pointer.y / size.y * 2 - 1);
|
|
2248
2897
|
coords.set(x, y);
|
|
2249
|
-
raycaster.setFromCamera(coords, renderer.camera);
|
|
2898
|
+
raycaster.setFromCamera(coords, renderer.camera.children.length ? renderer.camera.children[0] : renderer.camera);
|
|
2250
2899
|
const intersections = raycaster.intersectObject(this.plane);
|
|
2251
2900
|
if (intersections.length) {
|
|
2252
2901
|
pointerPosition.copy(intersections[0].point);
|
|
@@ -2261,8 +2910,8 @@ let Editor$1 = class Editor extends Component {
|
|
|
2261
2910
|
this.commandManager.start("default");
|
|
2262
2911
|
this._exitEditCallBack = () => {
|
|
2263
2912
|
domEventRegister.removeEventListener("mousemove", mousemoveFun);
|
|
2264
|
-
camera.position.copy(cameraPosition);
|
|
2265
2913
|
if (orbitControls) {
|
|
2914
|
+
camera.position.copy(cameraPosition);
|
|
2266
2915
|
orbitControls.enableRotate = true;
|
|
2267
2916
|
orbitControls.target.copy(target);
|
|
2268
2917
|
}
|
|
@@ -2296,7 +2945,7 @@ class PointDrag extends CommandFlowComponent {
|
|
|
2296
2945
|
super.onAddFromParent(parent);
|
|
2297
2946
|
this.editor.container.add(this.container);
|
|
2298
2947
|
this.container.position.z = 1e-3;
|
|
2299
|
-
const commandFlow = this.commandManager.addCommandFlow(this.commandName).add(this.createInterrupt()).add(this.createCursor("crosshair")).add(this.selectPoint.bind(this)).add(this.drag.bind(this));
|
|
2948
|
+
const commandFlow = 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));
|
|
2300
2949
|
commandFlow.addEventListener("finally", this.createFinally());
|
|
2301
2950
|
commandFlow.addEventListener("completed", (e) => this.completed(e.data));
|
|
2302
2951
|
this.eventInput.addKeyCombination(this.commandName, this.shortcutKeys);
|
|
@@ -2342,6 +2991,7 @@ class PointDrag extends CommandFlowComponent {
|
|
|
2342
2991
|
this.addEventRecord("clear").add(this.editor.addEventListener("pointerPositionChange", () => {
|
|
2343
2992
|
let { point: point2, find } = this.editor.renderManager.adsorption(), cursor = "none";
|
|
2344
2993
|
if (point2) {
|
|
2994
|
+
this.dispatchEvent({ type: "pointerMove", point: point2 });
|
|
2345
2995
|
if (this.eventInput.isKeyDown("shift")) {
|
|
2346
2996
|
const p = line2.projectPoint(Point.from(point2), false);
|
|
2347
2997
|
point2.set(p?.x ?? point2.x, p?.y ?? point2.y, 0);
|
|
@@ -2362,7 +3012,7 @@ class PointDrag extends CommandFlowComponent {
|
|
|
2362
3012
|
})).add(this.eventInput.addEventListener("codeChange", () => {
|
|
2363
3013
|
if (this.eventInput.isKeyDown("mouse_0")) {
|
|
2364
3014
|
this.canceEventRecord("selectPointStart");
|
|
2365
|
-
next({ point: end, line: line2, mode });
|
|
3015
|
+
next({ point: end, oldPoint: mode === "end" ? line2.end.clone() : line2.start.clone(), line: line2, mode });
|
|
2366
3016
|
}
|
|
2367
3017
|
})).add(() => circle.removeFromParent()).add(() => lines.removeFromParent());
|
|
2368
3018
|
}
|
|
@@ -2376,6 +3026,25 @@ class PointDrag extends CommandFlowComponent {
|
|
|
2376
3026
|
this.renderManager.addLine(line2);
|
|
2377
3027
|
this.renderManager.draw();
|
|
2378
3028
|
}
|
|
3029
|
+
/** 回滚操作
|
|
3030
|
+
* @param data
|
|
3031
|
+
*/
|
|
3032
|
+
rollback(data) {
|
|
3033
|
+
const { line: line2, oldPoint, mode } = data;
|
|
3034
|
+
if (mode === "end") line2.end.set(oldPoint.x, oldPoint.y);
|
|
3035
|
+
else if (mode === "start") line2.start.set(oldPoint.x, oldPoint.y);
|
|
3036
|
+
this.renderManager.addLine(line2);
|
|
3037
|
+
this.renderManager.draw();
|
|
3038
|
+
return data;
|
|
3039
|
+
}
|
|
3040
|
+
/** 撤回回滚
|
|
3041
|
+
* @param lines
|
|
3042
|
+
* @returns
|
|
3043
|
+
*/
|
|
3044
|
+
revokeRollback(data) {
|
|
3045
|
+
this.completed(data);
|
|
3046
|
+
return data;
|
|
3047
|
+
}
|
|
2379
3048
|
}
|
|
2380
3049
|
function Editor_(dxfSystem, option = {}) {
|
|
2381
3050
|
dxfSystem.addComponent(new Editor$1(option.viewPermission));
|
|
@@ -2385,6 +3054,13 @@ function Editor_(dxfSystem, option = {}) {
|
|
|
2385
3054
|
dxfSystem.addComponent(new DrawDoorLine());
|
|
2386
3055
|
dxfSystem.addComponent(new DrawWindow());
|
|
2387
3056
|
dxfSystem.addComponent(new PointDrag());
|
|
3057
|
+
dxfSystem.addComponent(new DeleteSelectLine());
|
|
3058
|
+
dxfSystem.addComponent(new MergeLine());
|
|
3059
|
+
dxfSystem.addComponent(new VerticalCorrection());
|
|
3060
|
+
dxfSystem.addComponent(new ConnectionLine());
|
|
3061
|
+
dxfSystem.addComponent(new IntersectionConnectionLine());
|
|
3062
|
+
dxfSystem.addComponent(new DeleteSelectWindow());
|
|
3063
|
+
dxfSystem.addComponent(new SelectAll());
|
|
2388
3064
|
}
|
|
2389
3065
|
const Editor2 = Object.assign(Editor_, {
|
|
2390
3066
|
create(option = {}) {
|