build-dxf 0.0.20-14 → 0.0.20-2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (27) hide show
  1. package/package.json +1 -1
  2. package/src/build.js +1915 -1194
  3. package/src/index.css +629 -1
  4. package/src/index.js +7 -7
  5. package/src/index2.js +528 -327
  6. package/src/index3.js +1714 -1660
  7. package/src/selectLocalFile.js +3145 -1955
  8. package/src/utils/CommandManager/CommandFlow.d.ts +0 -17
  9. package/src/utils/CommandManager/CommandManager.d.ts +0 -23
  10. package/src/utils/DxfSystem/components/Dxf.d.ts +0 -1
  11. package/src/utils/DxfSystem/plugin/Editor/components/CommandFlow/CommandFlowComponent.d.ts +1 -4
  12. package/src/utils/DxfSystem/plugin/Editor/components/CommandFlow/Default.d.ts +20 -0
  13. package/src/utils/DxfSystem/plugin/Editor/components/CommandFlow/DrawDoorLine.d.ts +4 -24
  14. package/src/utils/DxfSystem/plugin/Editor/components/CommandFlow/DrawLine.d.ts +4 -20
  15. package/src/utils/DxfSystem/plugin/Editor/components/CommandFlow/DrawWindow.d.ts +2 -25
  16. package/src/utils/DxfSystem/plugin/Editor/components/CommandFlow/PointDrag.d.ts +1 -14
  17. package/src/utils/DxfSystem/plugin/Editor/components/index.d.ts +0 -1
  18. package/src/utils/Quadtree/LineSegment.d.ts +0 -1
  19. package/src/utils/Quadtree/Point.d.ts +1 -2
  20. package/src/utils/DxfSystem/plugin/Editor/components/CommandFlow/ConnectionLine.d.ts +0 -33
  21. package/src/utils/DxfSystem/plugin/Editor/components/CommandFlow/DeleteSelectLine.d.ts +0 -28
  22. package/src/utils/DxfSystem/plugin/Editor/components/CommandFlow/DeleteSelectWindow.d.ts +0 -33
  23. package/src/utils/DxfSystem/plugin/Editor/components/CommandFlow/IntersectionConnectionLine.d.ts +0 -33
  24. package/src/utils/DxfSystem/plugin/Editor/components/CommandFlow/MergeLine.d.ts +0 -33
  25. package/src/utils/DxfSystem/plugin/Editor/components/CommandFlow/SelectAll.d.ts +0 -30
  26. package/src/utils/DxfSystem/plugin/Editor/components/CommandFlow/VerticalCorrection.d.ts +0 -76
  27. package/src/utils/DxfSystem/plugin/Editor/components/CommandFlow/ViewAngle.d.ts +0 -15
@@ -18,23 +18,6 @@ export declare class CommandFlow extends EventDispatcher<{
18
18
  finally: {};
19
19
  }> {
20
20
  list: CommandFlowCallBack[];
21
- rollbacklist: ((data?: any) => void)[];
22
- revokeRollbacklist: ((data?: any) => void)[];
23
- writeOperationList: boolean;
24
- /**
25
- *
26
- * @param operation
27
- * @returns
28
- */
29
21
  add(operation: CommandFlowCallBack): this;
30
- /** 添加回滚回调列表
31
- * @param callBack
32
- */
33
- addRollback(callBack: (data?: any) => void): this;
34
- /** 添加撤回回滚回调列表
35
- * @param callBack
36
- * @returns
37
- */
38
- addRevokeRollback(callBack: (data?: any) => void): this;
39
22
  }
40
23
  export {};
@@ -1,9 +1,5 @@
1
1
  import { EventDispatcher } from '../ComponentManager';
2
2
  import { CommandFlow } from './CommandFlow';
3
- export type Operation = {
4
- name: string;
5
- data: any;
6
- };
7
3
  export declare class CommandManager extends EventDispatcher<{
8
4
  startedBefore: {
9
5
  name: string;
@@ -35,12 +31,6 @@ export declare class CommandManager extends EventDispatcher<{
35
31
  finally: {
36
32
  name: string;
37
33
  };
38
- rollback: {
39
- name: string;
40
- };
41
- revokeRollback: {
42
- name: string;
43
- };
44
34
  }> {
45
35
  commandFlowMap: Map<string, CommandFlow>;
46
36
  lock: boolean;
@@ -50,11 +40,6 @@ export declare class CommandManager extends EventDispatcher<{
50
40
  private _disabled;
51
41
  set disabled(disabled: boolean);
52
42
  get disabled(): boolean;
53
- /**
54
- * 操作记录
55
- */
56
- operationList: Operation[];
57
- rollbackList: Operation[];
58
43
  constructor();
59
44
  /** 添加命令流
60
45
  * @param name
@@ -71,12 +56,4 @@ export declare class CommandManager extends EventDispatcher<{
71
56
  /** 取消当前命令
72
57
  */
73
58
  cancel(): void;
74
- /**
75
- * 回滚
76
- */
77
- rollback(): boolean;
78
- /**
79
- * 撤销回滚
80
- */
81
- revokeRollback(): boolean;
82
59
  }
@@ -22,7 +22,6 @@ export interface OriginalDataItem {
22
22
  z?: number;
23
23
  };
24
24
  }[];
25
- length: number;
26
25
  isDoor?: boolean;
27
26
  doorDirectConnection?: boolean;
28
27
  drawDoorData?: {
@@ -3,7 +3,6 @@ import { Editor } from '../Editor';
3
3
  import { EventInput, Renderer } from '../../../RenderPlugin/components';
4
4
  import { CommandManager } from '../../../../../CommandManager';
5
5
  import { RenderManager } from '../RenderManager';
6
- import { Default } from './Default';
7
6
  export declare class CommandFlowComponent<TEventMap extends {} = {}> extends Component<TEventMap> {
8
7
  private _renderer?;
9
8
  get renderer(): Renderer;
@@ -17,8 +16,6 @@ export declare class CommandFlowComponent<TEventMap extends {} = {}> extends Com
17
16
  get renderManager(): RenderManager;
18
17
  private _commandManager?;
19
18
  get commandManager(): CommandManager;
20
- private _default?;
21
- get default(): Default;
22
19
  interruptKeys: string[];
23
20
  commandName: string;
24
21
  constructor();
@@ -28,7 +25,7 @@ export declare class CommandFlowComponent<TEventMap extends {} = {}> extends Com
28
25
  */
29
26
  cancel(): void;
30
27
  /**
31
- * 创建中断处理命令节点
28
+ * 创建中断
32
29
  * @returns
33
30
  */
34
31
  createInterrupt(): (next: any, data: any) => void;
@@ -26,6 +26,26 @@ export declare class Default extends Component<{
26
26
  * 移除所有选中线段
27
27
  */
28
28
  removeSelectLineAll(): void;
29
+ /**
30
+ * 删除选择的线段
31
+ */
32
+ deleteSelectLine(): void;
33
+ /**
34
+ * 删除选择线段上的窗户
35
+ */
36
+ deleteSelectWindow(): void;
37
+ /**
38
+ * 如果只选择两个线段,可为两个未链接的点创建连接
39
+ */
40
+ connection(): void;
41
+ /**
42
+ * 如果只选择两个线段,可为两个未链接的点创建连接, 通过计算交点,线段延长到交点
43
+ */
44
+ intersectionConnection(): void;
45
+ /**
46
+ * 如果只选择两个线段, 且两个线段在一条路径上,合并线段
47
+ */
48
+ mergeLine(): void;
29
49
  private _timer;
30
50
  /**
31
51
  * 更新选择的线段
@@ -1,13 +1,8 @@
1
1
  import { ComponentManager } from '../../../../../ComponentManager';
2
- import { LineSegment } from '../../../../../Quadtree/LineSegment';
3
- import { LineUserData } from '../RenderManager';
2
+ import { Point } from '../../../../../Quadtree/Point';
4
3
  import { CommandFlowComponent } from './CommandFlowComponent';
5
4
  import * as THREE from "three";
6
- export declare class DrawDoorLine extends CommandFlowComponent<{
7
- pointerMove: {
8
- point: THREE.Vector3;
9
- };
10
- }> {
5
+ export declare class DrawDoorLine extends CommandFlowComponent<{}> {
11
6
  static name: string;
12
7
  container: THREE.Group<THREE.Object3DEventMap>;
13
8
  interruptKeys: string[];
@@ -17,23 +12,8 @@ export declare class DrawDoorLine extends CommandFlowComponent<{
17
12
  /** 选择点
18
13
  * @param next
19
14
  */
20
- private selectPoint;
21
- /**
22
- * 结束处理
23
- * @param next
24
- * @param points
25
- */
26
- private end;
15
+ selectPoint(next: any): void;
27
16
  /** 执行完成
28
17
  */
29
- completed(lines: LineSegment<LineUserData>[]): void;
30
- /** 回滚操作
31
- * @param data
32
- */
33
- private rollback;
34
- /** 撤回回滚
35
- * @param lines
36
- * @returns
37
- */
38
- private revokeRollback;
18
+ completed(points: Point[]): void;
39
19
  }
@@ -1,11 +1,8 @@
1
+ import { Point } from '../../../../../Quadtree/Point';
1
2
  import { CommandFlowComponent } from './CommandFlowComponent';
2
3
  import { ComponentManager } from '../../../../../ComponentManager';
3
4
  import * as THREE from "three";
4
- export declare class DrawLine extends CommandFlowComponent<{
5
- pointerMove: {
6
- point: THREE.Vector3;
7
- };
8
- }> {
5
+ export declare class DrawLine extends CommandFlowComponent<{}> {
9
6
  static name: string;
10
7
  container: THREE.Group<THREE.Object3DEventMap>;
11
8
  interruptKeys: string[];
@@ -17,21 +14,8 @@ export declare class DrawLine extends CommandFlowComponent<{
17
14
  /** 选择点
18
15
  * @param next
19
16
  */
20
- private selectPoint;
21
- /** 结束, 汇总结果
22
- * @param points
23
- */
24
- private end;
17
+ selectPoint(next: any): void;
25
18
  /** 执行完成
26
19
  */
27
- private completed;
28
- /** 回滚操作
29
- * @param data
30
- */
31
- private rollback;
32
- /** 撤回回滚
33
- * @param lines
34
- * @returns
35
- */
36
- private revokeRollback;
20
+ completed(points: Point[]): void;
37
21
  }
@@ -1,13 +1,8 @@
1
1
  import { CommandFlowComponent } from './CommandFlowComponent';
2
2
  import { LineSegment } from '../../../../../Quadtree/LineSegment';
3
- import { LineUserData } from '../RenderManager';
4
3
  import { ComponentManager } from '../../../../../ComponentManager';
5
4
  import * as THREE from "three";
6
- export declare class DrawWindow extends CommandFlowComponent<{
7
- pointerMove: {
8
- point: THREE.Vector3;
9
- };
10
- }> {
5
+ export declare class DrawWindow extends CommandFlowComponent<{}> {
11
6
  static name: string;
12
7
  container: THREE.Group<THREE.Object3DEventMap>;
13
8
  interruptKeys: string[];
@@ -25,25 +20,7 @@ export declare class DrawWindow extends CommandFlowComponent<{
25
20
  point: THREE.Vector3;
26
21
  line: LineSegment;
27
22
  }): void;
28
- /**
29
- * 结束处理
30
- * @param next
31
- * @param points
32
- */
33
- private end;
34
23
  /** 执行完成
35
24
  */
36
- completed({ doorDataItem, line }: {
37
- doorDataItem: any;
38
- line: LineSegment<LineUserData>;
39
- }): void;
40
- /** 回滚操作
41
- * @param data
42
- */
43
- private rollback;
44
- /** 撤回回滚
45
- * @param data
46
- * @returns
47
- */
48
- private revokeRollback;
25
+ completed(data: any): void;
49
26
  }
@@ -2,11 +2,7 @@ import { CommandFlowComponent } from './CommandFlowComponent';
2
2
  import { LineSegment } from '../../../../../Quadtree/LineSegment';
3
3
  import { ComponentManager } from '../../../../../ComponentManager';
4
4
  import * as THREE from "three";
5
- export declare class PointDrag extends CommandFlowComponent<{
6
- pointerMove: {
7
- point: THREE.Vector3;
8
- };
9
- }> {
5
+ export declare class PointDrag extends CommandFlowComponent<{}> {
10
6
  static name: string;
11
7
  container: THREE.Group<THREE.Object3DEventMap>;
12
8
  interruptKeys: string[];
@@ -29,13 +25,4 @@ export declare class PointDrag extends CommandFlowComponent<{
29
25
  /** 执行完成
30
26
  */
31
27
  completed(data: any): void;
32
- /** 回滚操作
33
- * @param data
34
- */
35
- private rollback;
36
- /** 撤回回滚
37
- * @param lines
38
- * @returns
39
- */
40
- private revokeRollback;
41
28
  }
@@ -4,4 +4,3 @@ export * from './CommandFlow/Default';
4
4
  export * from './CommandFlow/DrawDoorLine';
5
5
  export * from './CommandFlow/DrawLine';
6
6
  export * from './CommandFlow/DrawWindow';
7
- export * from './CommandFlow/VerticalCorrection';
@@ -11,7 +11,6 @@ export declare class LineSegment<T = Record<string, any>> {
11
11
  get start(): Point<Record<string, any>>;
12
12
  get end(): Point<Record<string, any>>;
13
13
  constructor(p1?: Point, p2?: Point);
14
- set(p1: Point, p2: Point): void;
15
14
  /** 膨胀
16
15
  * @description 向线段的两个端点分别膨胀 width
17
16
  * @param width
@@ -125,10 +125,9 @@ export declare class Point<T = Record<string, any>> {
125
125
  x: number;
126
126
  y: number;
127
127
  }): void;
128
- toJson(z?: number): {
128
+ toJson(): {
129
129
  x: number;
130
130
  y: number;
131
- z: number;
132
131
  };
133
132
  static from(arr: any): Point<Record<string, any>>;
134
133
  static zero(): Point<Record<string, any>>;
@@ -1,33 +0,0 @@
1
- import { CommandFlowComponent } from './CommandFlowComponent';
2
- import { ComponentManager } from '../../../../../ComponentManager';
3
- /**
4
- * 连接选择的线段
5
- */
6
- export declare class ConnectionLine extends CommandFlowComponent<{}> {
7
- static name: string;
8
- shortcutKeys: string[];
9
- static commandName: string;
10
- onAddFromParent(parent: ComponentManager): void;
11
- /**
12
- * 进入命令约束
13
- */
14
- private constraint;
15
- /** 连接
16
- * @param next
17
- */
18
- private connection;
19
- /** 成功
20
- * @param next
21
- * @param selectLines
22
- */
23
- private completed;
24
- /** 回滚操作
25
- * @param data
26
- */
27
- private rollback;
28
- /** 撤回回滚
29
- * @param lines
30
- * @returns
31
- */
32
- private revokeRollback;
33
- }
@@ -1,28 +0,0 @@
1
- import { CommandFlowComponent } from './CommandFlowComponent';
2
- import { ComponentManager } from '../../../../../ComponentManager';
3
- /**
4
- * 删除选择的线段
5
- */
6
- export declare class DeleteSelectLine extends CommandFlowComponent<{}> {
7
- static name: string;
8
- shortcutKeys: string[];
9
- static commandName: string;
10
- onAddFromParent(parent: ComponentManager): void;
11
- /**
12
- * 进入命令约束
13
- */
14
- private constraint;
15
- /** 开始
16
- * @param next
17
- */
18
- private delete;
19
- /** 回滚操作
20
- * @param data
21
- */
22
- private rollback;
23
- /** 撤回回滚
24
- * @param lines
25
- * @returns
26
- */
27
- private revokeRollback;
28
- }
@@ -1,33 +0,0 @@
1
- import { CommandFlowComponent } from './CommandFlowComponent';
2
- import { ComponentManager } from '../../../../../ComponentManager';
3
- /**
4
- * 删除选择的线段上的窗户线
5
- */
6
- export declare class DeleteSelectWindow extends CommandFlowComponent<{}> {
7
- static name: string;
8
- shortcutKeys: string[];
9
- static commandName: string;
10
- onAddFromParent(parent: ComponentManager): void;
11
- /**
12
- * 进入命令约束
13
- */
14
- private constraint;
15
- /** 开始
16
- * @param next
17
- */
18
- private end;
19
- /**
20
- * 完成
21
- * @param list
22
- */
23
- private completed;
24
- /** 回滚操作
25
- * @param data
26
- */
27
- private rollback;
28
- /** 撤回回滚
29
- * @param lines
30
- * @returns
31
- */
32
- private revokeRollback;
33
- }
@@ -1,33 +0,0 @@
1
- import { CommandFlowComponent } from './CommandFlowComponent';
2
- import { ComponentManager } from '../../../../../ComponentManager';
3
- /**
4
- * 连接选择的线段
5
- */
6
- export declare class IntersectionConnectionLine extends CommandFlowComponent<{}> {
7
- static name: string;
8
- shortcutKeys: string[];
9
- static commandName: string;
10
- onAddFromParent(parent: ComponentManager): void;
11
- /**
12
- * 进入命令约束
13
- */
14
- private constraint;
15
- /** 开始
16
- * @param next
17
- */
18
- private connection;
19
- /** 执行完成
20
- * @param next
21
- * @param selectLines
22
- */
23
- private completed;
24
- /** 回滚操作
25
- * @param data
26
- */
27
- private rollback;
28
- /** 撤回回滚
29
- * @param lines
30
- * @returns
31
- */
32
- private revokeRollback;
33
- }
@@ -1,33 +0,0 @@
1
- import { CommandFlowComponent } from './CommandFlowComponent';
2
- import { ComponentManager } from '../../../../../ComponentManager';
3
- /**
4
- * 合并同向线段
5
- */
6
- export declare class MergeLine extends CommandFlowComponent<{}> {
7
- static name: string;
8
- shortcutKeys: string[];
9
- static commandName: string;
10
- onAddFromParent(parent: ComponentManager): void;
11
- /**
12
- * 进入命令约束
13
- */
14
- private constraint;
15
- /** 开始
16
- * @param next
17
- * @todo 合并所有
18
- */
19
- private mergeLine;
20
- /** 执行完成
21
- * @param data
22
- */
23
- private completed;
24
- /** 回滚操作
25
- * @param data
26
- */
27
- private rollback;
28
- /** 撤回回滚
29
- * @param lines
30
- * @returns
31
- */
32
- private revokeRollback;
33
- }
@@ -1,30 +0,0 @@
1
- import { CommandFlowComponent } from './CommandFlowComponent';
2
- import { ComponentManager } from '../../../../../ComponentManager';
3
- import { LineSegment } from '../../../../../Quadtree/LineSegment';
4
- import * as THREE from "three";
5
- /**
6
- * 选择全部命令
7
- */
8
- export declare class SelectAll extends CommandFlowComponent<{}> {
9
- static name: string;
10
- container: THREE.Group<THREE.Object3DEventMap>;
11
- shortcutKeys: string[];
12
- static commandName: string;
13
- onAddFromParent(parent: ComponentManager): void;
14
- /** 开始
15
- * @param next
16
- */
17
- selectAll(next: any): void;
18
- /** 执行完成
19
- */
20
- completed(lines: LineSegment[]): void;
21
- /** 回滚操作
22
- * @param lines
23
- */
24
- private rollback;
25
- /** 撤回回滚
26
- * @param lines
27
- * @returns
28
- */
29
- private revokeRollback;
30
- }
@@ -1,76 +0,0 @@
1
- import { CommandFlowComponent } from './CommandFlowComponent';
2
- import { ComponentManager } from '../../../../../ComponentManager';
3
- import { LineSegment } from '../../../../../Quadtree/LineSegment';
4
- import { Point } from '../../../../../Quadtree/Point';
5
- import * as THREE from "three";
6
- /**
7
- * 垂直纠正
8
- */
9
- export declare class VerticalCorrection extends CommandFlowComponent<{}> {
10
- static name: string;
11
- container: THREE.Group<THREE.Object3DEventMap>;
12
- shortcutKeys: string[];
13
- shortcutKeys2: string[];
14
- static commandName: string;
15
- recursion: boolean;
16
- onAddFromParent(parent: ComponentManager): void;
17
- /**
18
- * 进入命令约束
19
- */
20
- constraint(next: any, selectLines: LineSegment[]): void;
21
- /**
22
- * 线段是否为结尾线段
23
- * @param line
24
- */
25
- lineIsPathEnd(line: LineSegment): boolean;
26
- /**
27
- *
28
- * @param line0
29
- * @param line1
30
- */
31
- isTowLineSegmentConnect(line0: LineSegment, line1: LineSegment): boolean;
32
- /**
33
- * 获取所有相同点的位置信息
34
- * @param point
35
- * @param point2
36
- */
37
- getSamePointAll(point: Point, point2: Point): {
38
- point: Point<Record<string, any>>;
39
- oldPoint: Point<Record<string, any>>;
40
- newPoint: Point<Record<string, any>>;
41
- line: LineSegment;
42
- }[];
43
- /** 修正
44
- * @param targettLine
45
- * @param vistedList
46
- */
47
- correction0(targettLine: LineSegment, resultList?: any[], vistedList?: Set<LineSegment>): any[] | undefined;
48
- /** 修正2
49
- * 第一步:确定需要修复的线段
50
- * 第二步:查找与该线段相交的其他线段
51
- * 第三步:找出两端点相交的线段,其他为区间相交
52
- * 第四步:找出两端点相交的线段数量,大于2, 该点不能修
53
- * 第五步:修正
54
- * 第六步:修正同向线段
55
- * @param targettLine
56
- * @param vistedList
57
- */
58
- correction(targettLine: LineSegment, resultList?: any[], vistedList?: Set<LineSegment>): any[] | undefined;
59
- /** 开始
60
- * @param next
61
- */
62
- verticalCorrection(next: any, selectLines: LineSegment[]): void;
63
- /** 执行完成
64
- * @param data
65
- */
66
- private completed;
67
- /** 回滚操作
68
- * @param data
69
- */
70
- private rollback;
71
- /** 撤回回滚
72
- * @param lines
73
- * @returns
74
- */
75
- private revokeRollback;
76
- }
@@ -1,15 +0,0 @@
1
- import { CommandFlowComponent } from './CommandFlowComponent';
2
- import { ComponentManager } from '../../../../../ComponentManager';
3
- /**
4
- * 查看线段角度
5
- */
6
- export declare class ViewAngle extends CommandFlowComponent<{}> {
7
- static name: string;
8
- shortcutKeys: string[];
9
- static commandName: string;
10
- onAddFromParent(parent: ComponentManager): void;
11
- /** 执行完成
12
- * @param data
13
- */
14
- private completed;
15
- }