build-dxf 0.0.20-9 → 0.0.21

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 (38) hide show
  1. package/README.md +3 -0
  2. package/package.json +6 -4
  3. package/src/build.d.ts +4 -0
  4. package/src/build.js +1403 -1922
  5. package/src/index.css +1 -649
  6. package/src/index.js +7 -7
  7. package/src/index2.js +327 -516
  8. package/src/index3.js +1798 -1841
  9. package/src/selectLocalFile.js +1960 -3146
  10. package/src/utils/CommandManager/CommandFlow.d.ts +17 -4
  11. package/src/utils/CommandManager/CommandManager.d.ts +11 -2
  12. package/src/utils/DxfSystem/components/AngleCorrectionDxf.d.ts +10 -0
  13. package/src/utils/DxfSystem/components/Dxf.d.ts +35 -5
  14. package/src/utils/DxfSystem/components/LineAnalysis.d.ts +3 -1
  15. package/src/utils/DxfSystem/index.d.ts +2 -0
  16. package/src/utils/DxfSystem/plugin/Editor/components/CommandFlow/ClippingLine.d.ts +45 -0
  17. package/src/utils/DxfSystem/plugin/Editor/components/CommandFlow/ConnectionLine.d.ts +15 -1
  18. package/src/utils/DxfSystem/plugin/Editor/components/CommandFlow/DeleteSelectLine.d.ts +9 -0
  19. package/src/utils/DxfSystem/plugin/Editor/components/CommandFlow/DeleteSelectWindow.d.ts +15 -1
  20. package/src/utils/DxfSystem/plugin/Editor/components/CommandFlow/DrawDoorLine.d.ts +22 -4
  21. package/src/utils/DxfSystem/plugin/Editor/components/CommandFlow/DrawLine.d.ts +20 -4
  22. package/src/utils/DxfSystem/plugin/Editor/components/CommandFlow/DrawWindow.d.ts +25 -2
  23. package/src/utils/DxfSystem/plugin/Editor/components/CommandFlow/IntersectionConnectionLine.d.ts +14 -0
  24. package/src/utils/DxfSystem/plugin/Editor/components/CommandFlow/MergeLine.d.ts +33 -0
  25. package/src/utils/DxfSystem/plugin/Editor/components/CommandFlow/PointDrag.d.ts +14 -1
  26. package/src/utils/DxfSystem/plugin/Editor/components/CommandFlow/SelectAll.d.ts +13 -0
  27. package/src/utils/DxfSystem/plugin/Editor/components/CommandFlow/VerticalCorrection copy.d.ts +82 -0
  28. package/src/utils/DxfSystem/plugin/Editor/components/CommandFlow/VerticalCorrection.d.ts +43 -7
  29. package/src/utils/DxfSystem/plugin/Editor/components/CommandFlow/VerticalReferenceLine.d.ts +21 -0
  30. package/src/utils/DxfSystem/plugin/Editor/components/CommandFlow/{mergeLine.d.ts → ViewAngle.d.ts} +5 -3
  31. package/src/utils/DxfSystem/plugin/Editor/components/Editor.d.ts +4 -1
  32. package/src/utils/DxfSystem/plugin/Editor/components/RenderManager.d.ts +4 -1
  33. package/src/utils/DxfSystem/plugin/RenderPlugin/components/Renderer.d.ts +3 -0
  34. package/src/utils/PointVirtualGrid/index.d.ts +8 -0
  35. package/src/utils/Quadtree/LineSegment.d.ts +34 -1
  36. package/src/utils/Quadtree/Point.d.ts +7 -1
  37. package/src/utils/Quadtree/Quadtree.d.ts +1 -1
  38. package/src/utils/deepClone.d.ts +6 -0
@@ -18,10 +18,23 @@ export declare class CommandFlow extends EventDispatcher<{
18
18
  finally: {};
19
19
  }> {
20
20
  list: CommandFlowCallBack[];
21
- rollbacklist: CommandFlowCallBack[];
22
- revokeList: CommandFlowCallBack[];
21
+ rollbacklist: ((data?: any) => void)[];
22
+ revokeRollbacklist: ((data?: any) => void)[];
23
+ writeOperationList: boolean;
24
+ /**
25
+ *
26
+ * @param operation
27
+ * @returns
28
+ */
23
29
  add(operation: CommandFlowCallBack): this;
24
- addRollback(callBack: (data?: any) => void): void;
25
- addRevoke(callBack: (data?: any) => void): void;
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;
26
39
  }
27
40
  export {};
@@ -35,6 +35,12 @@ export declare class CommandManager extends EventDispatcher<{
35
35
  finally: {
36
36
  name: string;
37
37
  };
38
+ rollback: {
39
+ name: string;
40
+ };
41
+ revokeRollback: {
42
+ name: string;
43
+ };
38
44
  }> {
39
45
  commandFlowMap: Map<string, CommandFlow>;
40
46
  lock: boolean;
@@ -68,6 +74,9 @@ export declare class CommandManager extends EventDispatcher<{
68
74
  /**
69
75
  * 回滚
70
76
  */
71
- rollback(): void;
72
- revoke(): void;
77
+ rollback(): boolean;
78
+ /**
79
+ * 撤销回滚
80
+ */
81
+ revokeRollback(): boolean;
73
82
  }
@@ -0,0 +1,10 @@
1
+ import { ComponentManager } from '../../ComponentManager';
2
+ import { Dxf } from './Dxf';
3
+ /**
4
+ * 角度修正过后的DXF格式数据
5
+ */
6
+ export declare class AngleCorrectionDxf extends Dxf<{}> {
7
+ static name: string;
8
+ onAddFromParent(parent: ComponentManager): void;
9
+ update(): Promise<void>;
10
+ }
@@ -38,6 +38,7 @@ export interface OriginalDataItem {
38
38
  };
39
39
  };
40
40
  isWindow?: boolean;
41
+ isVerticalReferenceLine?: boolean;
41
42
  drawWindow?: {
42
43
  p: {
43
44
  x: number;
@@ -52,6 +53,19 @@ export interface OriginalDataItem {
52
53
  * [开始点, 结束点, 相交点, 是否是门, 索引]
53
54
  */
54
55
  export type DataItem = [Point, Point, number[], boolean, number];
56
+ export type DrawData = {
57
+ unit: Unit;
58
+ line: [number, number, number, number, string][];
59
+ arc: [number, number, number, number, number, string][];
60
+ dimensionLine: number[][];
61
+ center: {
62
+ x: number;
63
+ y: number;
64
+ };
65
+ width: number;
66
+ height: number;
67
+ scale: number;
68
+ };
55
69
  /**
56
70
  *
57
71
  */
@@ -62,7 +76,7 @@ export interface PointGroup {
62
76
  /**
63
77
  * 将点云结构转换为DXF格式
64
78
  */
65
- export declare class Dxf extends Component<{
79
+ export declare class Dxf<TEventMap extends {} = {}> extends Component<{
66
80
  setDta: {
67
81
  originalData: OriginalDataItem[];
68
82
  data: DataItem[];
@@ -73,7 +87,7 @@ export declare class Dxf extends Component<{
73
87
  createGroup: {
74
88
  groups: Point[][][];
75
89
  };
76
- }> {
90
+ } & TEventMap> {
77
91
  static name: string;
78
92
  shortLine: number;
79
93
  width: number;
@@ -89,7 +103,8 @@ export declare class Dxf extends Component<{
89
103
  lineSegments: LineSegment<{
90
104
  isDoor: boolean;
91
105
  isWindow: boolean;
92
- drawDoorData: any[];
106
+ drawDoorData: any;
107
+ drawWindow: any[];
93
108
  }>[];
94
109
  originalZAverage: number;
95
110
  static EndType: {
@@ -107,7 +122,8 @@ export declare class Dxf extends Component<{
107
122
  get lines(): LineSegment<{
108
123
  isDoor: boolean;
109
124
  isWindow: boolean;
110
- drawDoorData: any[];
125
+ drawDoorData: any;
126
+ drawWindow: any[];
111
127
  }>[];
112
128
  /**初始化
113
129
  * @param data 点云数据
@@ -175,7 +191,16 @@ export declare class Dxf extends Component<{
175
191
  */
176
192
  private getArcAngleRange;
177
193
  /**
178
- * 将点云结构转换为string
194
+ * 转为绘制数据
195
+ */
196
+ toDrawDataJson(unit?: Unit): DrawData;
197
+ /**
198
+ *
199
+ * @param type
200
+ */
201
+ toDxfImageBlob(unit?: Unit, type?: string, background?: string): Promise<any>;
202
+ /**
203
+ * 将点json结构转换为Dxf string
179
204
  */
180
205
  toDxfString(unit?: Unit): string;
181
206
  /**
@@ -188,6 +213,11 @@ export declare class Dxf extends Component<{
188
213
  * @param filename
189
214
  */
190
215
  download(filename: string, unit?: Unit): Promise<void>;
216
+ /**
217
+ * 下载
218
+ * @param filename
219
+ */
220
+ downloadImage(filename: string, unit?: Unit, type?: string): Promise<boolean>;
191
221
  /**
192
222
  * 计算原始数据的边界框
193
223
  * @description 计算所有线段的起点和终点的最小最大值,形成一个边界框
@@ -13,7 +13,9 @@ type ProjectionAnalysisResult = {
13
13
  project: LineSegment;
14
14
  project2: LineSegment;
15
15
  };
16
- export declare class LineAnalysis extends Component {
16
+ export declare class LineAnalysis extends Component<{
17
+ analysisCompleted: {};
18
+ }> {
17
19
  static name: string;
18
20
  Dxf: Dxf | null;
19
21
  Variable: Variable | null;
@@ -1,8 +1,10 @@
1
1
  import { ComponentManager } from '../ComponentManager';
2
+ import { AngleCorrectionDxf } from './components/AngleCorrectionDxf';
2
3
  import { Dxf } from './components/Dxf';
3
4
  import { Variable } from './components/Variable';
4
5
  export declare class DxfSystem extends ComponentManager {
5
6
  Dxf: Dxf;
7
+ AngleCorrectionDxf: AngleCorrectionDxf;
6
8
  Variable: Variable;
7
9
  wallWidth: number;
8
10
  environment: "node" | "browser" | "unknown";
@@ -0,0 +1,45 @@
1
+ import { CommandFlowComponent } from './CommandFlowComponent';
2
+ import { LineSegment } from '../../../../../Quadtree/LineSegment';
3
+ import { ComponentManager } from '../../../../../ComponentManager';
4
+ import * as THREE from "three";
5
+ export declare class ClippingLine extends CommandFlowComponent<{
6
+ pointerMove: {
7
+ point: THREE.Vector3;
8
+ };
9
+ }> {
10
+ static name: string;
11
+ container: THREE.Group<THREE.Object3DEventMap>;
12
+ shortcutKeys: string[];
13
+ commandName: string;
14
+ static commandName: string;
15
+ onAddFromParent(parent: ComponentManager): void;
16
+ /** 选择开始点
17
+ * @param next
18
+ */
19
+ selectPointStart(next: any): void;
20
+ /** 选择结束点
21
+ * @param next
22
+ */
23
+ selectPointEnd(next: any, { point, line }: {
24
+ point: THREE.Vector3;
25
+ line: LineSegment;
26
+ }): void;
27
+ /**
28
+ * 结束处理
29
+ * @param next
30
+ * @param points
31
+ */
32
+ private end;
33
+ /** 执行完成
34
+ */
35
+ completed(data: any): void;
36
+ /** 回滚操作
37
+ * @param data
38
+ */
39
+ private rollback;
40
+ /** 撤回回滚
41
+ * @param data
42
+ * @returns
43
+ */
44
+ private revokeRollback;
45
+ }
@@ -12,8 +12,22 @@ export declare class ConnectionLine extends CommandFlowComponent<{}> {
12
12
  * 进入命令约束
13
13
  */
14
14
  private constraint;
15
- /** 开始
15
+ /** 连接
16
16
  * @param next
17
17
  */
18
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;
19
33
  }
@@ -16,4 +16,13 @@ export declare class DeleteSelectLine extends CommandFlowComponent<{}> {
16
16
  * @param next
17
17
  */
18
18
  private delete;
19
+ /** 回滚操作
20
+ * @param data
21
+ */
22
+ private rollback;
23
+ /** 撤回回滚
24
+ * @param lines
25
+ * @returns
26
+ */
27
+ private revokeRollback;
19
28
  }
@@ -15,5 +15,19 @@ export declare class DeleteSelectWindow extends CommandFlowComponent<{}> {
15
15
  /** 开始
16
16
  * @param next
17
17
  */
18
- private connection;
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;
19
33
  }
@@ -1,8 +1,11 @@
1
1
  import { ComponentManager } from '../../../../../ComponentManager';
2
- import { Point } from '../../../../../Quadtree/Point';
3
2
  import { CommandFlowComponent } from './CommandFlowComponent';
4
3
  import * as THREE from "three";
5
- export declare class DrawDoorLine extends CommandFlowComponent<{}> {
4
+ export declare class DrawDoorLine extends CommandFlowComponent<{
5
+ pointerMove: {
6
+ point: THREE.Vector3;
7
+ };
8
+ }> {
6
9
  static name: string;
7
10
  container: THREE.Group<THREE.Object3DEventMap>;
8
11
  interruptKeys: string[];
@@ -12,8 +15,23 @@ export declare class DrawDoorLine extends CommandFlowComponent<{}> {
12
15
  /** 选择点
13
16
  * @param next
14
17
  */
15
- selectPoint(next: any): void;
18
+ private selectPoint;
19
+ /**
20
+ * 结束处理
21
+ * @param next
22
+ * @param points
23
+ */
24
+ private end;
16
25
  /** 执行完成
17
26
  */
18
- completed(points: Point[]): void;
27
+ completed(data: any[]): void;
28
+ /** 回滚操作
29
+ * @param data
30
+ */
31
+ private rollback;
32
+ /** 撤回回滚
33
+ * @param data
34
+ * @returns
35
+ */
36
+ private revokeRollback;
19
37
  }
@@ -1,8 +1,11 @@
1
- import { Point } from '../../../../../Quadtree/Point';
2
1
  import { CommandFlowComponent } from './CommandFlowComponent';
3
2
  import { ComponentManager } from '../../../../../ComponentManager';
4
3
  import * as THREE from "three";
5
- export declare class DrawLine extends CommandFlowComponent<{}> {
4
+ export declare class DrawLine extends CommandFlowComponent<{
5
+ pointerMove: {
6
+ point: THREE.Vector3;
7
+ };
8
+ }> {
6
9
  static name: string;
7
10
  container: THREE.Group<THREE.Object3DEventMap>;
8
11
  interruptKeys: string[];
@@ -14,8 +17,21 @@ export declare class DrawLine extends CommandFlowComponent<{}> {
14
17
  /** 选择点
15
18
  * @param next
16
19
  */
17
- selectPoint(next: any): void;
20
+ private selectPoint;
21
+ /** 结束, 汇总结果
22
+ * @param points
23
+ */
24
+ private end;
18
25
  /** 执行完成
19
26
  */
20
- completed(points: Point[]): void;
27
+ private completed;
28
+ /** 回滚操作
29
+ * @param data
30
+ */
31
+ private rollback;
32
+ /** 撤回回滚
33
+ * @param lines
34
+ * @returns
35
+ */
36
+ private revokeRollback;
21
37
  }
@@ -1,8 +1,13 @@
1
1
  import { CommandFlowComponent } from './CommandFlowComponent';
2
2
  import { LineSegment } from '../../../../../Quadtree/LineSegment';
3
+ import { LineUserData } from '../RenderManager';
3
4
  import { ComponentManager } from '../../../../../ComponentManager';
4
5
  import * as THREE from "three";
5
- export declare class DrawWindow extends CommandFlowComponent<{}> {
6
+ export declare class DrawWindow extends CommandFlowComponent<{
7
+ pointerMove: {
8
+ point: THREE.Vector3;
9
+ };
10
+ }> {
6
11
  static name: string;
7
12
  container: THREE.Group<THREE.Object3DEventMap>;
8
13
  interruptKeys: string[];
@@ -20,7 +25,25 @@ export declare class DrawWindow extends CommandFlowComponent<{}> {
20
25
  point: THREE.Vector3;
21
26
  line: LineSegment;
22
27
  }): void;
28
+ /**
29
+ * 结束处理
30
+ * @param next
31
+ * @param points
32
+ */
33
+ private end;
23
34
  /** 执行完成
24
35
  */
25
- completed(data: any): void;
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;
26
49
  }
@@ -16,4 +16,18 @@ export declare class IntersectionConnectionLine extends CommandFlowComponent<{}>
16
16
  * @param next
17
17
  */
18
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;
19
33
  }
@@ -0,0 +1,33 @@
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
+ }
@@ -2,7 +2,11 @@ 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<{}> {
5
+ export declare class PointDrag extends CommandFlowComponent<{
6
+ pointerMove: {
7
+ point: THREE.Vector3;
8
+ };
9
+ }> {
6
10
  static name: string;
7
11
  container: THREE.Group<THREE.Object3DEventMap>;
8
12
  interruptKeys: string[];
@@ -25,4 +29,13 @@ export declare class PointDrag extends CommandFlowComponent<{}> {
25
29
  /** 执行完成
26
30
  */
27
31
  completed(data: any): void;
32
+ /** 回滚操作
33
+ * @param data
34
+ */
35
+ private rollback;
36
+ /** 撤回回滚
37
+ * @param lines
38
+ * @returns
39
+ */
40
+ private revokeRollback;
28
41
  }
@@ -1,5 +1,6 @@
1
1
  import { CommandFlowComponent } from './CommandFlowComponent';
2
2
  import { ComponentManager } from '../../../../../ComponentManager';
3
+ import { LineSegment } from '../../../../../Quadtree/LineSegment';
3
4
  import * as THREE from "three";
4
5
  /**
5
6
  * 选择全部命令
@@ -14,4 +15,16 @@ export declare class SelectAll extends CommandFlowComponent<{}> {
14
15
  * @param next
15
16
  */
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;
17
30
  }
@@ -0,0 +1,82 @@
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, line: LineSegment): {
38
+ queryList: {
39
+ point: Point;
40
+ userData?: LineSegment<import('..').LineUserData> | undefined;
41
+ }[];
42
+ parallelList: {
43
+ point: Point;
44
+ userData?: LineSegment<import('..').LineUserData> | undefined;
45
+ }[];
46
+ };
47
+ /**
48
+ *
49
+ * @param line
50
+ * @param point
51
+ * @param newPoint
52
+ */
53
+ setLinePoint(line: LineSegment, newStartPoint?: Point, newEndPoint?: Point, mode?: "start" | "end" | "all", record?: any[]): void;
54
+ /** 修正2
55
+ * 第一步:确定需要修复的线段
56
+ * 第二步:查找与该线段相交的其他线段
57
+ * 第三步:找出两端点相交的线段,其他为区间相交
58
+ * 第四步:修正相交的线段的另一个端点
59
+ * 第五步:判断是否有方向一致的线段,有就调整,调整方法:查找连续平行的线段,求点在线段方向的投影,直到不平行的线段结束
60
+ * 第六步: 中间线段采用投影修正
61
+ * @param targettLine
62
+ * @param vistedList
63
+ */
64
+ correction(targettLine: LineSegment, entryPoint?: Point, resultList?: any[], vistedList?: Set<LineSegment | Point>): any[] | undefined;
65
+ /** 开始
66
+ * @param next
67
+ */
68
+ verticalCorrection(next: any, selectLines: LineSegment[]): void;
69
+ /** 执行完成
70
+ * @param data
71
+ */
72
+ private completed;
73
+ /** 回滚操作
74
+ * @param data
75
+ */
76
+ private rollback;
77
+ /** 撤回回滚
78
+ * @param lines
79
+ * @returns
80
+ */
81
+ private revokeRollback;
82
+ }
@@ -2,6 +2,7 @@ import { CommandFlowComponent } from './CommandFlowComponent';
2
2
  import { ComponentManager } from '../../../../../ComponentManager';
3
3
  import { LineSegment } from '../../../../../Quadtree/LineSegment';
4
4
  import { Point } from '../../../../../Quadtree/Point';
5
+ import { LineUserData } from '../RenderManager';
5
6
  import * as THREE from "three";
6
7
  /**
7
8
  * 垂直纠正
@@ -10,7 +11,9 @@ export declare class VerticalCorrection extends CommandFlowComponent<{}> {
10
11
  static name: string;
11
12
  container: THREE.Group<THREE.Object3DEventMap>;
12
13
  shortcutKeys: string[];
14
+ shortcutKeys2: string[];
13
15
  static commandName: string;
16
+ recursion: boolean;
14
17
  onAddFromParent(parent: ComponentManager): void;
15
18
  /**
16
19
  * 进入命令约束
@@ -22,18 +25,51 @@ export declare class VerticalCorrection extends CommandFlowComponent<{}> {
22
25
  */
23
26
  lineIsPathEnd(line: LineSegment): boolean;
24
27
  /**
25
- * 设置所有相同点的位置
26
- * @param point
27
- * @param point2
28
+ *
29
+ * @param line0
30
+ * @param line1
28
31
  */
29
- setPointAll(point: Point, point2: Point): void;
30
- /** 修正
31
- * @param selectLine
32
+ isTowLineSegmentConnect(line0: LineSegment, line1: LineSegment): boolean;
33
+ /**
34
+ *
35
+ * @param line
36
+ * @param newStartPoint
37
+ * @param newEndPoint
38
+ * @param mode 需要匹配的点
39
+ * @param record
40
+ * @param id
41
+ * @returns
42
+ */
43
+ setLinePoint(line: LineSegment, newStartPoint: Point, newEndPoint: Point, mode?: "start" | "end" | "all" | "none", resultList?: any[], id?: string): {
44
+ point: Point;
45
+ userData?: LineSegment<LineUserData>;
46
+ }[];
47
+ /** 修正2
48
+ * 第一步:确定需要修复的线段
49
+ * 第二步:查找与该线段相交的其他线段
50
+ * 第三步:找出两端点相交的线段,其他为区间相交
51
+ * 第四步:修正相交的线段的另一个端点
52
+ * 第五步:判断是否有方向一致的线段,有就调整,调整方法:查找连续平行的线段,求点在线段方向的投影,直到不平行的线段结束
53
+ * 第六步: 中间线段采用投影修正
54
+ * @param targettLine
32
55
  * @param vistedList
33
56
  */
34
- correction(selectLine: LineSegment, vistedList?: Set<LineSegment>): Set<LineSegment<Record<string, any>>> | undefined;
57
+ correction(targettLine: LineSegment, resultList?: any[], vistedList?: Set<LineSegment>): any[];
35
58
  /** 开始
36
59
  * @param next
37
60
  */
38
61
  verticalCorrection(next: any, selectLines: LineSegment[]): void;
62
+ /** 执行完成
63
+ * @param data
64
+ */
65
+ private completed;
66
+ /** 回滚操作
67
+ * @param data
68
+ */
69
+ private rollback;
70
+ /** 撤回回滚
71
+ * @param lines
72
+ * @returns
73
+ */
74
+ private revokeRollback;
39
75
  }