build-dxf 0.0.20-2 → 0.0.20-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.
- package/README.md +3 -0
- package/package.json +1 -1
- package/src/build.js +1377 -1916
- package/src/index.css +1 -629
- package/src/index.js +7 -7
- package/src/index2.js +327 -528
- package/src/index3.js +1809 -1715
- package/src/selectLocalFile.js +1955 -3145
- package/src/utils/CommandManager/CommandFlow.d.ts +17 -0
- package/src/utils/CommandManager/CommandManager.d.ts +23 -0
- package/src/utils/DxfSystem/components/AngleCorrectionDxf.d.ts +9 -0
- package/src/utils/DxfSystem/components/Dxf.d.ts +36 -5
- package/src/utils/DxfSystem/components/LineAnalysis.d.ts +3 -1
- package/src/utils/DxfSystem/index.d.ts +2 -0
- package/src/utils/DxfSystem/plugin/Editor/components/CommandFlow/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 +24 -4
- package/src/utils/DxfSystem/plugin/Editor/components/CommandFlow/DrawLine.d.ts +20 -4
- package/src/utils/DxfSystem/plugin/Editor/components/CommandFlow/DrawWindow.d.ts +25 -2
- package/src/utils/DxfSystem/plugin/Editor/components/CommandFlow/IntersectionConnectionLine.d.ts +33 -0
- package/src/utils/DxfSystem/plugin/Editor/components/CommandFlow/MergeLine.d.ts +33 -0
- package/src/utils/DxfSystem/plugin/Editor/components/CommandFlow/PointDrag.d.ts +14 -1
- package/src/utils/DxfSystem/plugin/Editor/components/CommandFlow/SelectAll.d.ts +30 -0
- package/src/utils/DxfSystem/plugin/Editor/components/CommandFlow/VerticalCorrection.d.ts +82 -0
- package/src/utils/DxfSystem/plugin/Editor/components/CommandFlow/VerticalReferenceLine.d.ts +21 -0
- package/src/utils/DxfSystem/plugin/Editor/components/CommandFlow/ViewAngle.d.ts +21 -0
- package/src/utils/DxfSystem/plugin/Editor/components/RenderManager.d.ts +4 -1
- package/src/utils/DxfSystem/plugin/Editor/components/index.d.ts +1 -0
- package/src/utils/Quadtree/LineSegment.d.ts +19 -0
- package/src/utils/Quadtree/Point.d.ts +9 -2
- package/src/utils/deepClone.d.ts +6 -0
|
@@ -18,6 +18,23 @@ 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
|
+
*/
|
|
21
29
|
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;
|
|
22
39
|
}
|
|
23
40
|
export {};
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { EventDispatcher } from '../ComponentManager';
|
|
2
2
|
import { CommandFlow } from './CommandFlow';
|
|
3
|
+
export type Operation = {
|
|
4
|
+
name: string;
|
|
5
|
+
data: any;
|
|
6
|
+
};
|
|
3
7
|
export declare class CommandManager extends EventDispatcher<{
|
|
4
8
|
startedBefore: {
|
|
5
9
|
name: string;
|
|
@@ -31,6 +35,12 @@ export declare class CommandManager extends EventDispatcher<{
|
|
|
31
35
|
finally: {
|
|
32
36
|
name: string;
|
|
33
37
|
};
|
|
38
|
+
rollback: {
|
|
39
|
+
name: string;
|
|
40
|
+
};
|
|
41
|
+
revokeRollback: {
|
|
42
|
+
name: string;
|
|
43
|
+
};
|
|
34
44
|
}> {
|
|
35
45
|
commandFlowMap: Map<string, CommandFlow>;
|
|
36
46
|
lock: boolean;
|
|
@@ -40,6 +50,11 @@ export declare class CommandManager extends EventDispatcher<{
|
|
|
40
50
|
private _disabled;
|
|
41
51
|
set disabled(disabled: boolean);
|
|
42
52
|
get disabled(): boolean;
|
|
53
|
+
/**
|
|
54
|
+
* 操作记录
|
|
55
|
+
*/
|
|
56
|
+
operationList: Operation[];
|
|
57
|
+
rollbackList: Operation[];
|
|
43
58
|
constructor();
|
|
44
59
|
/** 添加命令流
|
|
45
60
|
* @param name
|
|
@@ -56,4 +71,12 @@ export declare class CommandManager extends EventDispatcher<{
|
|
|
56
71
|
/** 取消当前命令
|
|
57
72
|
*/
|
|
58
73
|
cancel(): void;
|
|
74
|
+
/**
|
|
75
|
+
* 回滚
|
|
76
|
+
*/
|
|
77
|
+
rollback(): boolean;
|
|
78
|
+
/**
|
|
79
|
+
* 撤销回滚
|
|
80
|
+
*/
|
|
81
|
+
revokeRollback(): boolean;
|
|
59
82
|
}
|
|
@@ -22,6 +22,7 @@ export interface OriginalDataItem {
|
|
|
22
22
|
z?: number;
|
|
23
23
|
};
|
|
24
24
|
}[];
|
|
25
|
+
length: number;
|
|
25
26
|
isDoor?: boolean;
|
|
26
27
|
doorDirectConnection?: boolean;
|
|
27
28
|
drawDoorData?: {
|
|
@@ -37,6 +38,7 @@ export interface OriginalDataItem {
|
|
|
37
38
|
};
|
|
38
39
|
};
|
|
39
40
|
isWindow?: boolean;
|
|
41
|
+
isVerticalReferenceLine?: boolean;
|
|
40
42
|
drawWindow?: {
|
|
41
43
|
p: {
|
|
42
44
|
x: number;
|
|
@@ -51,6 +53,19 @@ export interface OriginalDataItem {
|
|
|
51
53
|
* [开始点, 结束点, 相交点, 是否是门, 索引]
|
|
52
54
|
*/
|
|
53
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
|
+
};
|
|
54
69
|
/**
|
|
55
70
|
*
|
|
56
71
|
*/
|
|
@@ -61,7 +76,7 @@ export interface PointGroup {
|
|
|
61
76
|
/**
|
|
62
77
|
* 将点云结构转换为DXF格式
|
|
63
78
|
*/
|
|
64
|
-
export declare class Dxf extends Component<{
|
|
79
|
+
export declare class Dxf<TEventMap extends {} = {}> extends Component<{
|
|
65
80
|
setDta: {
|
|
66
81
|
originalData: OriginalDataItem[];
|
|
67
82
|
data: DataItem[];
|
|
@@ -72,7 +87,7 @@ export declare class Dxf extends Component<{
|
|
|
72
87
|
createGroup: {
|
|
73
88
|
groups: Point[][][];
|
|
74
89
|
};
|
|
75
|
-
}> {
|
|
90
|
+
} & TEventMap> {
|
|
76
91
|
static name: string;
|
|
77
92
|
shortLine: number;
|
|
78
93
|
width: number;
|
|
@@ -88,7 +103,8 @@ export declare class Dxf extends Component<{
|
|
|
88
103
|
lineSegments: LineSegment<{
|
|
89
104
|
isDoor: boolean;
|
|
90
105
|
isWindow: boolean;
|
|
91
|
-
drawDoorData: any
|
|
106
|
+
drawDoorData: any;
|
|
107
|
+
drawWindow: any[];
|
|
92
108
|
}>[];
|
|
93
109
|
originalZAverage: number;
|
|
94
110
|
static EndType: {
|
|
@@ -106,7 +122,8 @@ export declare class Dxf extends Component<{
|
|
|
106
122
|
get lines(): LineSegment<{
|
|
107
123
|
isDoor: boolean;
|
|
108
124
|
isWindow: boolean;
|
|
109
|
-
drawDoorData: any
|
|
125
|
+
drawDoorData: any;
|
|
126
|
+
drawWindow: any[];
|
|
110
127
|
}>[];
|
|
111
128
|
/**初始化
|
|
112
129
|
* @param data 点云数据
|
|
@@ -174,7 +191,16 @@ export declare class Dxf extends Component<{
|
|
|
174
191
|
*/
|
|
175
192
|
private getArcAngleRange;
|
|
176
193
|
/**
|
|
177
|
-
*
|
|
194
|
+
* 转为绘制数据
|
|
195
|
+
*/
|
|
196
|
+
toDrawDataJson(unit?: Unit): DrawData;
|
|
197
|
+
/**
|
|
198
|
+
*
|
|
199
|
+
* @param type
|
|
200
|
+
*/
|
|
201
|
+
toDxfImageBlob(unit?: Unit, type?: string): Promise<any>;
|
|
202
|
+
/**
|
|
203
|
+
* 将点json结构转换为Dxf string
|
|
178
204
|
*/
|
|
179
205
|
toDxfString(unit?: Unit): string;
|
|
180
206
|
/**
|
|
@@ -187,6 +213,11 @@ export declare class Dxf extends Component<{
|
|
|
187
213
|
* @param filename
|
|
188
214
|
*/
|
|
189
215
|
download(filename: string, unit?: Unit): Promise<void>;
|
|
216
|
+
/**
|
|
217
|
+
* 下载
|
|
218
|
+
* @param filename
|
|
219
|
+
*/
|
|
220
|
+
downloadImage(filename: string, unit?: Unit, type?: string): Promise<boolean>;
|
|
190
221
|
/**
|
|
191
222
|
* 计算原始数据的边界框
|
|
192
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";
|
|
@@ -3,6 +3,7 @@ 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';
|
|
6
7
|
export declare class CommandFlowComponent<TEventMap extends {} = {}> extends Component<TEventMap> {
|
|
7
8
|
private _renderer?;
|
|
8
9
|
get renderer(): Renderer;
|
|
@@ -16,6 +17,8 @@ export declare class CommandFlowComponent<TEventMap extends {} = {}> extends Com
|
|
|
16
17
|
get renderManager(): RenderManager;
|
|
17
18
|
private _commandManager?;
|
|
18
19
|
get commandManager(): CommandManager;
|
|
20
|
+
private _default?;
|
|
21
|
+
get default(): Default;
|
|
19
22
|
interruptKeys: string[];
|
|
20
23
|
commandName: string;
|
|
21
24
|
constructor();
|
|
@@ -25,7 +28,7 @@ export declare class CommandFlowComponent<TEventMap extends {} = {}> extends Com
|
|
|
25
28
|
*/
|
|
26
29
|
cancel(): void;
|
|
27
30
|
/**
|
|
28
|
-
*
|
|
31
|
+
* 创建中断处理命令节点
|
|
29
32
|
* @returns
|
|
30
33
|
*/
|
|
31
34
|
createInterrupt(): (next: any, data: any) => void;
|
|
@@ -0,0 +1,33 @@
|
|
|
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
|
+
}
|
|
@@ -26,26 +26,6 @@ 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;
|
|
49
29
|
private _timer;
|
|
50
30
|
/**
|
|
51
31
|
* 更新选择的线段
|
|
@@ -0,0 +1,28 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
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,8 +1,13 @@
|
|
|
1
1
|
import { ComponentManager } from '../../../../../ComponentManager';
|
|
2
|
-
import {
|
|
2
|
+
import { LineSegment } from '../../../../../Quadtree/LineSegment';
|
|
3
|
+
import { LineUserData } from '../RenderManager';
|
|
3
4
|
import { CommandFlowComponent } from './CommandFlowComponent';
|
|
4
5
|
import * as THREE from "three";
|
|
5
|
-
export declare class DrawDoorLine extends CommandFlowComponent<{
|
|
6
|
+
export declare class DrawDoorLine 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[];
|
|
@@ -12,8 +17,23 @@ export declare class DrawDoorLine extends CommandFlowComponent<{}> {
|
|
|
12
17
|
/** 选择点
|
|
13
18
|
* @param next
|
|
14
19
|
*/
|
|
15
|
-
selectPoint
|
|
20
|
+
private selectPoint;
|
|
21
|
+
/**
|
|
22
|
+
* 结束处理
|
|
23
|
+
* @param next
|
|
24
|
+
* @param points
|
|
25
|
+
*/
|
|
26
|
+
private end;
|
|
16
27
|
/** 执行完成
|
|
17
28
|
*/
|
|
18
|
-
completed(
|
|
29
|
+
completed(lines: LineSegment<LineUserData>[]): void;
|
|
30
|
+
/** 回滚操作
|
|
31
|
+
* @param data
|
|
32
|
+
*/
|
|
33
|
+
private rollback;
|
|
34
|
+
/** 撤回回滚
|
|
35
|
+
* @param lines
|
|
36
|
+
* @returns
|
|
37
|
+
*/
|
|
38
|
+
private revokeRollback;
|
|
19
39
|
}
|
|
@@ -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
|
|
20
|
+
private selectPoint;
|
|
21
|
+
/** 结束, 汇总结果
|
|
22
|
+
* @param points
|
|
23
|
+
*/
|
|
24
|
+
private end;
|
|
18
25
|
/** 执行完成
|
|
19
26
|
*/
|
|
20
|
-
completed
|
|
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(
|
|
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
|
}
|
package/src/utils/DxfSystem/plugin/Editor/components/CommandFlow/IntersectionConnectionLine.d.ts
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
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
|
+
}
|
|
@@ -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
|
}
|
|
@@ -0,0 +1,30 @@
|
|
|
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
|
+
}
|
|
@@ -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
|
+
setLine(line: LineSegment, point: Point, newPoint: Point, 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
|
+
}
|