build-dxf 0.0.18 → 0.0.19
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.d.ts +10 -1
- package/src/build.js +555 -471
- package/src/components/Editor.vue.d.ts +26 -0
- package/src/index.js +3 -2
- package/src/index2.js +373 -3426
- package/src/index3.js +1937 -0
- package/src/pages/Editor.vue.d.ts +2 -0
- package/src/pages/Editor02.vue.d.ts +4 -0
- package/src/selectLocalFile.js +3745 -0
- package/src/utils/CommandManager/CommandFlow.d.ts +23 -0
- package/src/utils/CommandManager/CommandManager.d.ts +59 -0
- package/src/utils/CommandManager/index.d.ts +2 -0
- package/src/utils/ComponentManager/EventDispatcher.d.ts +11 -1
- package/src/utils/DxfSystem/components/Dxf.d.ts +15 -12
- package/src/utils/DxfSystem/components/LineAnalysis.d.ts +1 -20
- package/src/utils/DxfSystem/components/Variable.d.ts +8 -0
- package/src/utils/DxfSystem/plugin/Editor/components/CommandFlow/CommandFlowComponent.d.ts +36 -0
- package/src/utils/DxfSystem/plugin/Editor/components/CommandFlow/Default.d.ts +57 -0
- package/src/utils/DxfSystem/plugin/Editor/components/CommandFlow/DrawDoorLine.d.ts +19 -0
- package/src/utils/DxfSystem/plugin/Editor/components/CommandFlow/DrawLine.d.ts +20 -0
- package/src/utils/DxfSystem/plugin/Editor/components/CommandFlow/DrawWindow.d.ts +25 -0
- package/src/utils/DxfSystem/plugin/Editor/components/CommandFlow/PointDrag.d.ts +27 -0
- package/src/utils/DxfSystem/plugin/Editor/components/Editor.d.ts +22 -3
- package/src/utils/DxfSystem/plugin/Editor/components/RenderManager.d.ts +88 -0
- package/src/utils/DxfSystem/plugin/Editor/components/index.d.ts +6 -0
- package/src/utils/DxfSystem/plugin/Editor/pages/EditorTool.vue.d.ts +6 -0
- package/src/utils/DxfSystem/plugin/ModelDataPlugin/components/DxfLineModel.d.ts +7 -3
- package/src/utils/DxfSystem/plugin/ModelDataPlugin/index.d.ts +9 -1
- package/src/utils/DxfSystem/plugin/RenderPlugin/components/DomContainer.d.ts +1 -0
- package/src/utils/DxfSystem/plugin/RenderPlugin/components/DomEventRegister.d.ts +20 -1
- package/src/utils/DxfSystem/plugin/RenderPlugin/components/EventInput.d.ts +74 -0
- package/src/utils/DxfSystem/plugin/RenderPlugin/components/Renderer.d.ts +0 -11
- package/src/utils/DxfSystem/plugin/RenderPlugin/components/index.d.ts +1 -0
- package/src/utils/DxfSystem/plugin/RenderPlugin/index.d.ts +11 -1
- package/src/utils/PointVirtualGrid/index.d.ts +10 -4
- package/src/utils/Quadtree/Box2.d.ts +3 -2
- package/src/utils/Quadtree/LineSegment.d.ts +11 -9
- package/src/utils/Quadtree/Point.d.ts +11 -6
- package/src/utils/Quadtree/Quadtree.d.ts +5 -0
- package/src/utils/Quadtree/Rectangle.d.ts +5 -4
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { EventDispatcher } from '../ComponentManager';
|
|
2
|
+
type CommandFlowCallBack = ((next: (data?: any) => void, data?: any) => void);
|
|
3
|
+
export declare class CommandFlow extends EventDispatcher<{
|
|
4
|
+
started: {};
|
|
5
|
+
executing: {
|
|
6
|
+
index: number;
|
|
7
|
+
};
|
|
8
|
+
executionCompleted: {
|
|
9
|
+
index: number;
|
|
10
|
+
data?: any;
|
|
11
|
+
};
|
|
12
|
+
executionInterrupt: {
|
|
13
|
+
index: number;
|
|
14
|
+
};
|
|
15
|
+
completed: {
|
|
16
|
+
data?: any;
|
|
17
|
+
};
|
|
18
|
+
finally: {};
|
|
19
|
+
}> {
|
|
20
|
+
list: CommandFlowCallBack[];
|
|
21
|
+
add(operation: CommandFlowCallBack): this;
|
|
22
|
+
}
|
|
23
|
+
export {};
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { EventDispatcher } from '../ComponentManager';
|
|
2
|
+
import { CommandFlow } from './CommandFlow';
|
|
3
|
+
export declare class CommandManager extends EventDispatcher<{
|
|
4
|
+
startedBefore: {
|
|
5
|
+
name: string;
|
|
6
|
+
currentName: string | null;
|
|
7
|
+
};
|
|
8
|
+
started: {
|
|
9
|
+
name: string;
|
|
10
|
+
};
|
|
11
|
+
cancel: {
|
|
12
|
+
name: string;
|
|
13
|
+
};
|
|
14
|
+
executing: {
|
|
15
|
+
name: string;
|
|
16
|
+
index: number;
|
|
17
|
+
};
|
|
18
|
+
executionCompleted: {
|
|
19
|
+
name: string;
|
|
20
|
+
index: number;
|
|
21
|
+
data?: any;
|
|
22
|
+
};
|
|
23
|
+
executionInterrupt: {
|
|
24
|
+
name: string;
|
|
25
|
+
index: number;
|
|
26
|
+
};
|
|
27
|
+
completed: {
|
|
28
|
+
name: string;
|
|
29
|
+
data?: any;
|
|
30
|
+
};
|
|
31
|
+
finally: {
|
|
32
|
+
name: string;
|
|
33
|
+
};
|
|
34
|
+
}> {
|
|
35
|
+
commandFlowMap: Map<string, CommandFlow>;
|
|
36
|
+
lock: boolean;
|
|
37
|
+
private abortController;
|
|
38
|
+
private resolve;
|
|
39
|
+
currentName: string | null;
|
|
40
|
+
private _disabled;
|
|
41
|
+
set disabled(disabled: boolean);
|
|
42
|
+
get disabled(): boolean;
|
|
43
|
+
constructor();
|
|
44
|
+
/** 添加命令流
|
|
45
|
+
* @param name
|
|
46
|
+
* @returns
|
|
47
|
+
*/
|
|
48
|
+
addCommandFlow(name: string): CommandFlow;
|
|
49
|
+
private executionPromise;
|
|
50
|
+
private executionResolve;
|
|
51
|
+
/** 执行控制流
|
|
52
|
+
* @param name
|
|
53
|
+
* @returns
|
|
54
|
+
*/
|
|
55
|
+
start(name: string, data?: any, step?: number): Promise<any>;
|
|
56
|
+
/** 取消当前命令
|
|
57
|
+
*/
|
|
58
|
+
cancel(): void;
|
|
59
|
+
}
|
|
@@ -1,4 +1,14 @@
|
|
|
1
|
-
import { EventDispatcher as ED } from 'three';
|
|
1
|
+
import { EventDispatcher as ED, EventListener } from 'three';
|
|
2
2
|
export declare class EventDispatcher<TEventMap extends {} = {}> extends ED<TEventMap> {
|
|
3
3
|
uuid: string;
|
|
4
|
+
addEventListener<T extends Extract<keyof TEventMap, string>>(type: T, listener: EventListener<TEventMap[T], T, this>, option?: {
|
|
5
|
+
once: boolean;
|
|
6
|
+
}): () => void;
|
|
7
|
+
private eventRecordStack;
|
|
8
|
+
addEventRecord(name: string, ...cancels: (() => void)[]): {
|
|
9
|
+
add: (cancel: () => void) => {
|
|
10
|
+
add: /*elided*/ any;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
canceEventRecord(name: string): void;
|
|
4
14
|
}
|
|
@@ -7,32 +7,33 @@ export interface OriginalDataItem {
|
|
|
7
7
|
start: {
|
|
8
8
|
x: number;
|
|
9
9
|
y: number;
|
|
10
|
-
z
|
|
10
|
+
z?: number;
|
|
11
11
|
};
|
|
12
12
|
end: {
|
|
13
13
|
x: number;
|
|
14
14
|
y: number;
|
|
15
|
-
z
|
|
15
|
+
z?: number;
|
|
16
16
|
};
|
|
17
17
|
insetionArr: {
|
|
18
18
|
index: number;
|
|
19
19
|
p: {
|
|
20
20
|
x: number;
|
|
21
21
|
y: number;
|
|
22
|
-
z
|
|
22
|
+
z?: number;
|
|
23
23
|
};
|
|
24
24
|
}[];
|
|
25
25
|
isDoor?: boolean;
|
|
26
|
+
doorDirectConnection?: boolean;
|
|
26
27
|
drawDoorData?: {
|
|
27
28
|
start: {
|
|
28
29
|
x: number;
|
|
29
30
|
y: number;
|
|
30
|
-
z
|
|
31
|
+
z?: number;
|
|
31
32
|
};
|
|
32
33
|
n: {
|
|
33
34
|
x: number;
|
|
34
35
|
y: number;
|
|
35
|
-
z
|
|
36
|
+
z?: number;
|
|
36
37
|
};
|
|
37
38
|
};
|
|
38
39
|
isWindow?: boolean;
|
|
@@ -40,11 +41,11 @@ export interface OriginalDataItem {
|
|
|
40
41
|
p: {
|
|
41
42
|
x: number;
|
|
42
43
|
y: number;
|
|
43
|
-
z
|
|
44
|
+
z?: number;
|
|
44
45
|
};
|
|
45
46
|
width: number;
|
|
46
47
|
full: boolean;
|
|
47
|
-
};
|
|
48
|
+
}[];
|
|
48
49
|
}
|
|
49
50
|
/**
|
|
50
51
|
* [开始点, 结束点, 相交点, 是否是门, 索引]
|
|
@@ -87,6 +88,7 @@ export declare class Dxf extends Component<{
|
|
|
87
88
|
lineSegments: LineSegment<{
|
|
88
89
|
isDoor: boolean;
|
|
89
90
|
isWindow: boolean;
|
|
91
|
+
drawDoorData: any[];
|
|
90
92
|
}>[];
|
|
91
93
|
originalZAverage: number;
|
|
92
94
|
static EndType: {
|
|
@@ -104,6 +106,7 @@ export declare class Dxf extends Component<{
|
|
|
104
106
|
get lines(): LineSegment<{
|
|
105
107
|
isDoor: boolean;
|
|
106
108
|
isWindow: boolean;
|
|
109
|
+
drawDoorData: any[];
|
|
107
110
|
}>[];
|
|
108
111
|
/**初始化
|
|
109
112
|
* @param data 点云数据
|
|
@@ -133,7 +136,7 @@ export declare class Dxf extends Component<{
|
|
|
133
136
|
* @description 处理线路拓扑,使线路有序链接,形成长路径
|
|
134
137
|
* @param lines
|
|
135
138
|
*/
|
|
136
|
-
lineTopology(lines: Point[][]): Point[][];
|
|
139
|
+
lineTopology(lines: Point[][]): Point<Record<string, any>>[][];
|
|
137
140
|
/** 合并方向相同的线段
|
|
138
141
|
* @param lines
|
|
139
142
|
* @param errAngle
|
|
@@ -148,21 +151,21 @@ export declare class Dxf extends Component<{
|
|
|
148
151
|
* @description 突变长度小于墙体宽度,该线段可能为突起线段,
|
|
149
152
|
* @description 判断后续第2线段与上一条线段是否方向相同,相同就为突刺
|
|
150
153
|
*/
|
|
151
|
-
lineSegmentStraightening(path: Point[]): Point[];
|
|
154
|
+
lineSegmentStraightening(path: Point[]): Point<Record<string, any>>[];
|
|
152
155
|
/**
|
|
153
156
|
* 移除短线段
|
|
154
157
|
* @todo 根据线段两端线段长度,选取参照物_|▔▔
|
|
155
158
|
* @param path
|
|
156
159
|
*/
|
|
157
|
-
removeShortLine(path: Point[], shortLine?: number): Point[];
|
|
160
|
+
removeShortLine(path: Point[], shortLine?: number): Point<Record<string, any>>[];
|
|
158
161
|
/** 线偏移
|
|
159
162
|
* @description 使用 ClipperLib 对每个点组进行线偏移处理,生成具有指定宽度的墙体路径
|
|
160
163
|
*/
|
|
161
|
-
lineOffset(endType?: number, joinType?: number, scale?: number): Point[][];
|
|
164
|
+
lineOffset(endType?: number, joinType?: number, scale?: number): Point<Record<string, any>>[][];
|
|
162
165
|
/**
|
|
163
166
|
* 将点云结构转换为Float32Array
|
|
164
167
|
*/
|
|
165
|
-
to3DArray(scale: number): Float32Array<ArrayBuffer>;
|
|
168
|
+
to3DArray(scale: number, z?: number): Float32Array<ArrayBuffer>;
|
|
166
169
|
/** 获取角度范围
|
|
167
170
|
* @param center
|
|
168
171
|
* @param p1
|
|
@@ -4,7 +4,6 @@ import { Variable } from './Variable';
|
|
|
4
4
|
import { Quadtree } from '../../Quadtree/Quadtree';
|
|
5
5
|
import { LineSegment } from '../../Quadtree/LineSegment';
|
|
6
6
|
import { Point } from '../../Quadtree/Point';
|
|
7
|
-
import { PointVirtualGrid } from '../../PointVirtualGrid';
|
|
8
7
|
import * as THREE from "three";
|
|
9
8
|
type ProjectionAnalysisResult = {
|
|
10
9
|
source: LineSegment;
|
|
@@ -38,7 +37,7 @@ export declare class LineAnalysis extends Component {
|
|
|
38
37
|
* @returns
|
|
39
38
|
*/
|
|
40
39
|
expandLineSegment(p1: Point, p2: Point, width?: number): {
|
|
41
|
-
points: Point[];
|
|
40
|
+
points: Point<Record<string, any>>[];
|
|
42
41
|
indices: number[];
|
|
43
42
|
rectIndices: number[];
|
|
44
43
|
};
|
|
@@ -53,14 +52,6 @@ export declare class LineAnalysis extends Component {
|
|
|
53
52
|
* @param result
|
|
54
53
|
*/
|
|
55
54
|
createRectangle(result: ProjectionAnalysisResult): void;
|
|
56
|
-
pointVirtualGrid: PointVirtualGrid<{
|
|
57
|
-
index: number;
|
|
58
|
-
type: "start" | "end";
|
|
59
|
-
}>;
|
|
60
|
-
/**
|
|
61
|
-
* 构建点的虚拟网格索引
|
|
62
|
-
*/
|
|
63
|
-
buildVirtualGrid(): void;
|
|
64
55
|
quadtree?: Quadtree;
|
|
65
56
|
/**
|
|
66
57
|
* 构建线段四叉树,快速查找,
|
|
@@ -83,16 +74,6 @@ export declare class LineAnalysis extends Component {
|
|
|
83
74
|
doorSearchNearAngle: number;
|
|
84
75
|
doorSearchDistance: number;
|
|
85
76
|
doors: LineSegment[];
|
|
86
|
-
/**
|
|
87
|
-
* 门的位置判断
|
|
88
|
-
*/
|
|
89
77
|
doorsAnalysis(): void;
|
|
90
|
-
/**
|
|
91
|
-
*
|
|
92
|
-
* @param line
|
|
93
|
-
* @returns
|
|
94
|
-
*/
|
|
95
|
-
findLongLineSegment(line: LineSegment): LineSegment<Record<string, any>>;
|
|
96
|
-
doorsAnalysis2(): void;
|
|
97
78
|
}
|
|
98
79
|
export {};
|
|
@@ -14,6 +14,10 @@ interface EventType {
|
|
|
14
14
|
y: number;
|
|
15
15
|
}>;
|
|
16
16
|
currentKeyUp: EventData<string>;
|
|
17
|
+
currentKeyDown: EventData<string>;
|
|
18
|
+
currentMouseUp: EventData<string>;
|
|
19
|
+
currentMouseDown: EventData<string>;
|
|
20
|
+
focus: EventData<boolean>;
|
|
17
21
|
}
|
|
18
22
|
export declare class Variable extends Component<EventType> {
|
|
19
23
|
static name: string;
|
|
@@ -27,6 +31,10 @@ export declare class Variable extends Component<EventType> {
|
|
|
27
31
|
y: number;
|
|
28
32
|
};
|
|
29
33
|
currentKeyUp: string;
|
|
34
|
+
currentKeyDown: string;
|
|
35
|
+
currentMouseUp: string;
|
|
36
|
+
currentMouseDown: string;
|
|
37
|
+
focus: boolean;
|
|
30
38
|
set<KeyT extends keyof EventType>(key: KeyT, value: any): void;
|
|
31
39
|
get<KeyT extends keyof EventType>(key: KeyT): this[KeyT] | undefined;
|
|
32
40
|
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { Component } from '../../../../../ComponentManager';
|
|
2
|
+
import { Editor } from '../Editor';
|
|
3
|
+
import { EventInput, Renderer } from '../../../RenderPlugin/components';
|
|
4
|
+
import { CommandManager } from '../../../../../CommandManager';
|
|
5
|
+
import { RenderManager } from '../RenderManager';
|
|
6
|
+
export declare class CommandFlowComponent<TEventMap extends {} = {}> extends Component<TEventMap> {
|
|
7
|
+
private _renderer?;
|
|
8
|
+
get renderer(): Renderer;
|
|
9
|
+
private _domElement?;
|
|
10
|
+
get domElement(): HTMLDivElement;
|
|
11
|
+
private _editor?;
|
|
12
|
+
get editor(): Editor;
|
|
13
|
+
private _eventInput?;
|
|
14
|
+
get eventInput(): EventInput;
|
|
15
|
+
private _renderManager?;
|
|
16
|
+
get renderManager(): RenderManager;
|
|
17
|
+
private _commandManager?;
|
|
18
|
+
get commandManager(): CommandManager;
|
|
19
|
+
interruptKeys: string[];
|
|
20
|
+
/**
|
|
21
|
+
* 创建中断
|
|
22
|
+
* @returns
|
|
23
|
+
*/
|
|
24
|
+
createInterrupt(): (next: any, data: any) => void;
|
|
25
|
+
/**
|
|
26
|
+
* 创建鼠标图标变化
|
|
27
|
+
* @param cursor
|
|
28
|
+
* @returns
|
|
29
|
+
*/
|
|
30
|
+
createCursor(cursor: string): (next: any, data: any) => void;
|
|
31
|
+
/**
|
|
32
|
+
* 创建清理
|
|
33
|
+
* @returns
|
|
34
|
+
*/
|
|
35
|
+
createFinally(): () => void;
|
|
36
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { Component } from '../../../../../ComponentManager';
|
|
2
|
+
import { Editor } from '../Editor';
|
|
3
|
+
import { Renderer } from '../../../RenderPlugin/components';
|
|
4
|
+
import { LineSegment } from '../../../../../Quadtree/LineSegment';
|
|
5
|
+
import { LineUserData } from '../RenderManager';
|
|
6
|
+
import * as THREE from "three";
|
|
7
|
+
export declare class Default extends Component<{}> {
|
|
8
|
+
static name: string;
|
|
9
|
+
get editor(): Editor;
|
|
10
|
+
renderer?: Renderer;
|
|
11
|
+
container: THREE.Group<THREE.Object3DEventMap>;
|
|
12
|
+
onAddFromParent(): void;
|
|
13
|
+
selectLines: LineSegment<LineUserData>[];
|
|
14
|
+
selectLineObject3D: THREE.Mesh<THREE.BufferGeometry<THREE.NormalBufferAttributes, THREE.BufferGeometryEventMap>, THREE.Material | THREE.Material[], THREE.Object3DEventMap>;
|
|
15
|
+
/** 添加选择的线段
|
|
16
|
+
* @param lineSegment
|
|
17
|
+
*/
|
|
18
|
+
addSelectLine(lineSegment: LineSegment): void;
|
|
19
|
+
/** 移除选择的线段
|
|
20
|
+
* @param lineSegment
|
|
21
|
+
*/
|
|
22
|
+
removeSelectLine(lineSegment: LineSegment): void;
|
|
23
|
+
/**
|
|
24
|
+
* 删除选择的线段
|
|
25
|
+
*/
|
|
26
|
+
deleteSelectLine(): void;
|
|
27
|
+
/**
|
|
28
|
+
* 删除选择线段上的窗户
|
|
29
|
+
*/
|
|
30
|
+
deleteSelectWindow(): void;
|
|
31
|
+
/**
|
|
32
|
+
* 如果只选择两个线段,可为两个未链接的点创建连接
|
|
33
|
+
*/
|
|
34
|
+
connection(): void;
|
|
35
|
+
/**
|
|
36
|
+
* 如果只选择两个线段,可为两个未链接的点创建连接, 通过计算交点,线段延长到交点
|
|
37
|
+
*/
|
|
38
|
+
intersectionConnection(): void;
|
|
39
|
+
/**
|
|
40
|
+
* 如果只选择两个线段, 且两个线段在一条路径上,合并线段
|
|
41
|
+
*/
|
|
42
|
+
mergeLine(): void;
|
|
43
|
+
private _timer;
|
|
44
|
+
/**
|
|
45
|
+
* 更新选择的线段
|
|
46
|
+
*/
|
|
47
|
+
updateSelectLinesGeometry(): void;
|
|
48
|
+
/**
|
|
49
|
+
* 开始执行
|
|
50
|
+
* @param next
|
|
51
|
+
*/
|
|
52
|
+
start(): void;
|
|
53
|
+
/**
|
|
54
|
+
* 清理
|
|
55
|
+
*/
|
|
56
|
+
finally(): void;
|
|
57
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ComponentManager } from '../../../../../ComponentManager';
|
|
2
|
+
import { Point } from '../../../../../Quadtree/Point';
|
|
3
|
+
import { CommandFlowComponent } from './CommandFlowComponent';
|
|
4
|
+
import * as THREE from "three";
|
|
5
|
+
export declare class DrawDoorLine extends CommandFlowComponent<{}> {
|
|
6
|
+
static name: string;
|
|
7
|
+
container: THREE.Group<THREE.Object3DEventMap>;
|
|
8
|
+
interruptKeys: string[];
|
|
9
|
+
shortcutKeys: string[];
|
|
10
|
+
commandName: string;
|
|
11
|
+
onAddFromParent(parent: ComponentManager): void;
|
|
12
|
+
/** 选择点
|
|
13
|
+
* @param next
|
|
14
|
+
*/
|
|
15
|
+
selectPoint(next: any): void;
|
|
16
|
+
/** 执行完成
|
|
17
|
+
*/
|
|
18
|
+
completed(points: Point[]): void;
|
|
19
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Point } from '../../../../../Quadtree/Point';
|
|
2
|
+
import { CommandFlowComponent } from './CommandFlowComponent';
|
|
3
|
+
import * as THREE from "three";
|
|
4
|
+
export declare class DrawLine extends CommandFlowComponent<{}> {
|
|
5
|
+
static name: string;
|
|
6
|
+
container: THREE.Group<THREE.Object3DEventMap>;
|
|
7
|
+
interruptKeys: string[];
|
|
8
|
+
withdrawalKeys: string[];
|
|
9
|
+
shortcutKeys: string[];
|
|
10
|
+
confirmKeys: string[];
|
|
11
|
+
commandName: string;
|
|
12
|
+
onAddFromParent(): void;
|
|
13
|
+
/** 选择点
|
|
14
|
+
* @param next
|
|
15
|
+
*/
|
|
16
|
+
selectPoint(next: any): void;
|
|
17
|
+
/** 执行完成
|
|
18
|
+
*/
|
|
19
|
+
completed(points: Point[]): void;
|
|
20
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { CommandFlowComponent } from './CommandFlowComponent';
|
|
2
|
+
import { LineSegment } from '../../../../../Quadtree/LineSegment';
|
|
3
|
+
import * as THREE from "three";
|
|
4
|
+
export declare class DrawWindow extends CommandFlowComponent<{}> {
|
|
5
|
+
static name: string;
|
|
6
|
+
container: THREE.Group<THREE.Object3DEventMap>;
|
|
7
|
+
interruptKeys: string[];
|
|
8
|
+
shortcutKeys: string[];
|
|
9
|
+
commandName: string;
|
|
10
|
+
onAddFromParent(): void;
|
|
11
|
+
/** 选择开始点
|
|
12
|
+
* @param next
|
|
13
|
+
*/
|
|
14
|
+
selectPointStart(next: any): void;
|
|
15
|
+
/** 选择结束点
|
|
16
|
+
* @param next
|
|
17
|
+
*/
|
|
18
|
+
selectPointEnd(next: any, { point, line }: {
|
|
19
|
+
point: THREE.Vector3;
|
|
20
|
+
line: LineSegment;
|
|
21
|
+
}): void;
|
|
22
|
+
/** 执行完成
|
|
23
|
+
*/
|
|
24
|
+
completed(data: any): void;
|
|
25
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { CommandFlowComponent } from './CommandFlowComponent';
|
|
2
|
+
import { LineSegment } from '../../../../../Quadtree/LineSegment';
|
|
3
|
+
import * as THREE from "three";
|
|
4
|
+
export declare class PointDrag extends CommandFlowComponent<{}> {
|
|
5
|
+
static name: string;
|
|
6
|
+
container: THREE.Group<THREE.Object3DEventMap>;
|
|
7
|
+
interruptKeys: string[];
|
|
8
|
+
shortcutKeys: string[];
|
|
9
|
+
commandName: string;
|
|
10
|
+
onAddFromParent(): void;
|
|
11
|
+
/** 选择开始点
|
|
12
|
+
* @param next
|
|
13
|
+
*/
|
|
14
|
+
selectPoint(next: any): void;
|
|
15
|
+
/** 拖拽点
|
|
16
|
+
* @description 拖拽点到指定位置
|
|
17
|
+
* @param next
|
|
18
|
+
* @param param1
|
|
19
|
+
*/
|
|
20
|
+
drag(next: any, { point, line }: {
|
|
21
|
+
point: THREE.Vector3;
|
|
22
|
+
line: LineSegment;
|
|
23
|
+
}): void;
|
|
24
|
+
/** 执行完成
|
|
25
|
+
*/
|
|
26
|
+
completed(data: any): void;
|
|
27
|
+
}
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
import { Component
|
|
1
|
+
import { Component } from '../../../../ComponentManager';
|
|
2
2
|
import { Dxf } from '../../../components/Dxf';
|
|
3
3
|
import { Variable } from '../../../components/Variable';
|
|
4
|
-
import { Renderer } from '../../RenderPlugin/components';
|
|
4
|
+
import { DomContainer, DomEventRegister, EventInput, Renderer } from '../../RenderPlugin/components';
|
|
5
|
+
import { RenderManager } from './RenderManager';
|
|
6
|
+
import { CommandManager } from '../../../../CommandManager';
|
|
7
|
+
import { App } from 'vue';
|
|
5
8
|
import * as THREE from "three";
|
|
6
9
|
export declare class Editor extends Component<{
|
|
7
10
|
pointerPositionChange: {
|
|
@@ -13,9 +16,25 @@ export declare class Editor extends Component<{
|
|
|
13
16
|
get renderer(): Renderer;
|
|
14
17
|
get dxf(): Dxf;
|
|
15
18
|
get variable(): Variable;
|
|
19
|
+
get eventInput(): EventInput;
|
|
20
|
+
get renderManager(): RenderManager;
|
|
21
|
+
get domEventRegister(): DomEventRegister;
|
|
22
|
+
get domContainer(): DomContainer;
|
|
23
|
+
commandManager: CommandManager;
|
|
16
24
|
plane: THREE.Mesh<THREE.PlaneGeometry, THREE.Material | THREE.Material[], THREE.Object3DEventMap>;
|
|
17
|
-
|
|
25
|
+
app?: App<Element>;
|
|
26
|
+
domElement: HTMLDivElement;
|
|
27
|
+
onAddFromParent(): void;
|
|
28
|
+
coords: THREE.Vector2;
|
|
29
|
+
pointerPosition: THREE.Vector2;
|
|
18
30
|
private _exitEditCallBack?;
|
|
31
|
+
/**
|
|
32
|
+
* 打开编辑器
|
|
33
|
+
*/
|
|
19
34
|
openEdit(): void;
|
|
35
|
+
/**
|
|
36
|
+
* 退出编辑
|
|
37
|
+
*/
|
|
20
38
|
exitEdit(): void;
|
|
39
|
+
destroy(): void;
|
|
21
40
|
}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { LineSegment } from '../../../../Quadtree/LineSegment';
|
|
2
|
+
import { Component } from '../../../../ComponentManager';
|
|
3
|
+
import { Dxf, OriginalDataItem } from '../../../components/Dxf';
|
|
4
|
+
import { Variable } from '../../../components/Variable';
|
|
5
|
+
import { EventInput, Renderer } from '../../RenderPlugin/components';
|
|
6
|
+
import { PointVirtualGrid } from '../../../../PointVirtualGrid';
|
|
7
|
+
import { Editor } from './Editor';
|
|
8
|
+
import { Quadtree, QuadtreeNode } from '../../../../Quadtree/Quadtree';
|
|
9
|
+
import { DxfLineModel } from '../../ModelDataPlugin/components';
|
|
10
|
+
import * as THREE from "three";
|
|
11
|
+
export type LineUserData = {
|
|
12
|
+
doorDirectConnection?: boolean;
|
|
13
|
+
isDoor?: boolean;
|
|
14
|
+
isWindow?: boolean;
|
|
15
|
+
drawDoorData?: {
|
|
16
|
+
p: THREE.Vector3;
|
|
17
|
+
width: number;
|
|
18
|
+
full: boolean;
|
|
19
|
+
}[];
|
|
20
|
+
quadtreeNode?: QuadtreeNode;
|
|
21
|
+
};
|
|
22
|
+
export declare class RenderManager extends Component<{}> {
|
|
23
|
+
static name: string;
|
|
24
|
+
container: THREE.Group<THREE.Object3DEventMap>;
|
|
25
|
+
lines: LineSegment<LineUserData>[];
|
|
26
|
+
pointVirtualGrid: PointVirtualGrid<LineSegment<LineUserData>>;
|
|
27
|
+
quadtree: Quadtree<any>;
|
|
28
|
+
actionHistory: Set<{
|
|
29
|
+
type: "addLine" | "removeLine";
|
|
30
|
+
data: any;
|
|
31
|
+
}>;
|
|
32
|
+
onAddFromParent(): void;
|
|
33
|
+
private updatedMode;
|
|
34
|
+
/** 重新设置数据
|
|
35
|
+
*/
|
|
36
|
+
reset(): void;
|
|
37
|
+
/** 添加线段
|
|
38
|
+
* @param line
|
|
39
|
+
*/
|
|
40
|
+
addLine(line: LineSegment<LineUserData>): void;
|
|
41
|
+
/**
|
|
42
|
+
* 批量添加
|
|
43
|
+
* @param lines
|
|
44
|
+
*/
|
|
45
|
+
addLines(lines: LineSegment<LineUserData>[]): void;
|
|
46
|
+
/** 移除线段
|
|
47
|
+
* @param line
|
|
48
|
+
*/
|
|
49
|
+
removeLine(line: LineSegment<LineUserData>): void;
|
|
50
|
+
/**
|
|
51
|
+
* 绘制
|
|
52
|
+
*/
|
|
53
|
+
draw(synchronize?: boolean): void;
|
|
54
|
+
/** 获取鼠标当前点, 吸附后的点
|
|
55
|
+
* @param point
|
|
56
|
+
* @returns
|
|
57
|
+
*/
|
|
58
|
+
adsorption(radius?: number, pointVirtualGrid?: PointVirtualGrid<LineSegment<LineUserData>>, quadtree?: Quadtree<any>): {
|
|
59
|
+
point: THREE.Vector3;
|
|
60
|
+
find: boolean;
|
|
61
|
+
mode: string;
|
|
62
|
+
line: LineSegment;
|
|
63
|
+
} | {
|
|
64
|
+
point: THREE.Vector3;
|
|
65
|
+
find: boolean;
|
|
66
|
+
mode?: undefined;
|
|
67
|
+
line?: undefined;
|
|
68
|
+
};
|
|
69
|
+
/** 创建几何体
|
|
70
|
+
* @param rectangle
|
|
71
|
+
*/
|
|
72
|
+
createGeometry(map: Record<string, number[]>, count: number): THREE.BufferGeometry<THREE.NormalBufferAttributes, THREE.BufferGeometryEventMap>;
|
|
73
|
+
/**
|
|
74
|
+
* 转为json
|
|
75
|
+
*/
|
|
76
|
+
toJson(): OriginalDataItem[];
|
|
77
|
+
private _timer;
|
|
78
|
+
/**
|
|
79
|
+
* 同步到dxf
|
|
80
|
+
*/
|
|
81
|
+
synchronizeDxf(): void;
|
|
82
|
+
get renderer(): Renderer;
|
|
83
|
+
get dxf(): Dxf;
|
|
84
|
+
get variable(): Variable;
|
|
85
|
+
get eventInput(): EventInput;
|
|
86
|
+
get editor(): Editor;
|
|
87
|
+
get dxfLineModel(): DxfLineModel;
|
|
88
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { DxfSystem } from '../../..';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
dxfSystem: DxfSystem;
|
|
4
|
+
};
|
|
5
|
+
declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
6
|
+
export default _default;
|
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
import { Component, ComponentManager } from '../../../../ComponentManager';
|
|
2
2
|
import * as THREE from "three";
|
|
3
|
-
export declare class DxfLineModel extends Component
|
|
3
|
+
export declare class DxfLineModel extends Component<{
|
|
4
|
+
modelUpdate: {
|
|
5
|
+
model: THREE.Group;
|
|
6
|
+
};
|
|
7
|
+
}> {
|
|
4
8
|
static name: string;
|
|
5
|
-
|
|
6
|
-
|
|
9
|
+
dxfLineModel: THREE.LineSegments<THREE.BufferGeometry<THREE.NormalBufferAttributes, THREE.BufferGeometryEventMap>, THREE.Material | THREE.Material[], THREE.Object3DEventMap>;
|
|
10
|
+
dxfDoorsLineModel: THREE.LineSegments<THREE.BufferGeometry<THREE.NormalBufferAttributes, THREE.BufferGeometryEventMap>, THREE.Material | THREE.Material[], THREE.Object3DEventMap>;
|
|
7
11
|
dxfModelGroup: THREE.Group<THREE.Object3DEventMap>;
|
|
8
12
|
onAddFromParent(parent: ComponentManager): void;
|
|
9
13
|
updateMode(): void;
|
|
@@ -1,4 +1,12 @@
|
|
|
1
1
|
import { DxfSystem } from '../..';
|
|
2
2
|
import * as components from "./components";
|
|
3
|
-
|
|
3
|
+
type Option = {
|
|
4
|
+
detailsPoint?: boolean;
|
|
5
|
+
whiteModel?: boolean;
|
|
6
|
+
dxfLineModel?: boolean;
|
|
7
|
+
};
|
|
8
|
+
declare function ModelDataPlugin_(dxfSystem: DxfSystem, option?: Option): void;
|
|
9
|
+
declare const ModelDataPlugin: typeof ModelDataPlugin_ & {
|
|
10
|
+
create(option?: Option): (dxfSystem: DxfSystem) => void;
|
|
11
|
+
};
|
|
4
12
|
export { components, ModelDataPlugin };
|