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
|
@@ -1,11 +1,30 @@
|
|
|
1
|
+
import { Vector2 } from 'three';
|
|
1
2
|
import { Component, ComponentManager } from '../../../../ComponentManager';
|
|
2
|
-
export declare class DomEventRegister extends Component
|
|
3
|
+
export declare class DomEventRegister extends Component<{
|
|
4
|
+
mousemove: {
|
|
5
|
+
x: number;
|
|
6
|
+
y: number;
|
|
7
|
+
moveX: number;
|
|
8
|
+
moveY: number;
|
|
9
|
+
};
|
|
10
|
+
mousedown: {
|
|
11
|
+
x: number;
|
|
12
|
+
y: number;
|
|
13
|
+
};
|
|
14
|
+
}> {
|
|
3
15
|
static name: string;
|
|
16
|
+
cancelDefaultBehaviorList: ((e: KeyboardEvent) => boolean)[];
|
|
17
|
+
pointer: Vector2;
|
|
4
18
|
/**
|
|
5
19
|
*
|
|
6
20
|
* @param parent
|
|
7
21
|
*/
|
|
8
22
|
onAddFromParent(parent: ComponentManager): void;
|
|
23
|
+
/**
|
|
24
|
+
*
|
|
25
|
+
* @param callBack
|
|
26
|
+
*/
|
|
27
|
+
addCancelDefaultBehavior(callBack: (e: KeyboardEvent) => boolean): this;
|
|
9
28
|
/**
|
|
10
29
|
*
|
|
11
30
|
* @param el
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { Component, ComponentManager } from '../../../../ComponentManager';
|
|
2
|
+
export declare class EventInput extends Component<{
|
|
3
|
+
codeChange: {
|
|
4
|
+
code: string;
|
|
5
|
+
mode: "up" | "down";
|
|
6
|
+
};
|
|
7
|
+
}> {
|
|
8
|
+
static name: string;
|
|
9
|
+
keyList: Set<string>;
|
|
10
|
+
mouseList: Set<string>;
|
|
11
|
+
private keyCombinationMap;
|
|
12
|
+
currentKeyCombinationMap: Map<string, number>;
|
|
13
|
+
get codeCount(): number;
|
|
14
|
+
/**
|
|
15
|
+
*
|
|
16
|
+
* @param parent
|
|
17
|
+
*/
|
|
18
|
+
onAddFromParent(parent: ComponentManager): void;
|
|
19
|
+
/** 添加取消浏览器默认行为规则
|
|
20
|
+
* @param callBack
|
|
21
|
+
*/
|
|
22
|
+
addCancelDefaultBehavior(callBack: (input: EventInput) => boolean): void;
|
|
23
|
+
/**
|
|
24
|
+
* 计算组合按键
|
|
25
|
+
*/
|
|
26
|
+
private _computedkeyCombination;
|
|
27
|
+
/**
|
|
28
|
+
* 添加组合按键
|
|
29
|
+
* @param name
|
|
30
|
+
* @param keys
|
|
31
|
+
* @param count
|
|
32
|
+
*/
|
|
33
|
+
addKeyCombination(name: string, keys: string[], count?: number): void;
|
|
34
|
+
/**
|
|
35
|
+
* 移除组合按键
|
|
36
|
+
* @param name
|
|
37
|
+
*/
|
|
38
|
+
removeKeyCombination(name: string): void;
|
|
39
|
+
/**
|
|
40
|
+
* 是否按下按键
|
|
41
|
+
* @param key
|
|
42
|
+
* @returns
|
|
43
|
+
*/
|
|
44
|
+
isKeyDown(key: string): boolean;
|
|
45
|
+
/**
|
|
46
|
+
* 是否按下按键组
|
|
47
|
+
* @param keys
|
|
48
|
+
* @returns
|
|
49
|
+
*/
|
|
50
|
+
isKeyDowns(keys: string[]): boolean;
|
|
51
|
+
/**
|
|
52
|
+
* 是否按下按键组中部分
|
|
53
|
+
* @param keys
|
|
54
|
+
* @returns
|
|
55
|
+
*/
|
|
56
|
+
isSomeKeyDowns(keys: string[]): boolean;
|
|
57
|
+
/**
|
|
58
|
+
* 是否按下按键组中所有,并且只按下按键组中的按键
|
|
59
|
+
* @param keys
|
|
60
|
+
* @returns
|
|
61
|
+
*/
|
|
62
|
+
isOnlyKeyDowns(keys: string[]): boolean;
|
|
63
|
+
/**
|
|
64
|
+
*
|
|
65
|
+
* @param keys
|
|
66
|
+
* @returns
|
|
67
|
+
*/
|
|
68
|
+
isOnlyKeyDown(key: string): boolean;
|
|
69
|
+
/**
|
|
70
|
+
*
|
|
71
|
+
* @param name
|
|
72
|
+
*/
|
|
73
|
+
isKeyCombination(name: string): boolean;
|
|
74
|
+
}
|
|
@@ -24,16 +24,6 @@ export declare class Renderer extends Component<{
|
|
|
24
24
|
width: number;
|
|
25
25
|
height: number;
|
|
26
26
|
};
|
|
27
|
-
mousemove: {
|
|
28
|
-
x: number;
|
|
29
|
-
y: number;
|
|
30
|
-
moveX: number;
|
|
31
|
-
moveY: number;
|
|
32
|
-
};
|
|
33
|
-
mousedown: {
|
|
34
|
-
x: number;
|
|
35
|
-
y: number;
|
|
36
|
-
};
|
|
37
27
|
}> {
|
|
38
28
|
static name: string;
|
|
39
29
|
static CSS2DObject: typeof CSS2DObject;
|
|
@@ -56,7 +46,6 @@ export declare class Renderer extends Component<{
|
|
|
56
46
|
container: THREE.Group<THREE.Object3DEventMap>;
|
|
57
47
|
onUpdate?: () => void;
|
|
58
48
|
onResize?: (width: number, height: number) => void;
|
|
59
|
-
pointer: THREE.Vector2;
|
|
60
49
|
private tweenTaskList;
|
|
61
50
|
constructor(description: RendererDescription);
|
|
62
51
|
/**
|
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
import { DxfSystem } from '../..';
|
|
2
2
|
import { default as Dxf3DView } from './pages/Dxf.vue';
|
|
3
3
|
import * as components from "./components";
|
|
4
|
-
|
|
4
|
+
import * as THREE from "three";
|
|
5
|
+
type Option = {
|
|
6
|
+
originalLine?: boolean;
|
|
7
|
+
modelData?: boolean;
|
|
8
|
+
detailsPoint?: boolean;
|
|
9
|
+
camera?: THREE.OrthographicCamera;
|
|
10
|
+
};
|
|
11
|
+
declare function RenderPlugin_(dxfSystem: DxfSystem, option?: Option): void;
|
|
12
|
+
declare const RenderPlugin: typeof RenderPlugin_ & {
|
|
13
|
+
create(option?: Option): (dxfSystem: DxfSystem) => void;
|
|
14
|
+
};
|
|
5
15
|
export { components, RenderPlugin, Dxf3DView };
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { Box2 } from '../Quadtree/Box2';
|
|
2
2
|
import { Point } from '../Quadtree/Point';
|
|
3
3
|
import { Rectangle } from '../Quadtree/Rectangle';
|
|
4
|
+
type NodeSet<T> = Set<{
|
|
5
|
+
point: Point;
|
|
6
|
+
userData?: T;
|
|
7
|
+
}>;
|
|
4
8
|
export declare class PointVirtualGrid<T = Record<string, any>> {
|
|
5
|
-
map: Map<string,
|
|
6
|
-
point: Point;
|
|
7
|
-
userData?: T;
|
|
8
|
-
}>>;
|
|
9
|
+
map: Map<string, NodeSet<T>>;
|
|
9
10
|
gridSize: number;
|
|
10
11
|
constructor(gridSize?: number);
|
|
11
12
|
/**
|
|
@@ -22,6 +23,10 @@ export declare class PointVirtualGrid<T = Record<string, any>> {
|
|
|
22
23
|
point: Point;
|
|
23
24
|
userData?: T;
|
|
24
25
|
}>): void;
|
|
26
|
+
/** 移除点
|
|
27
|
+
* @param point
|
|
28
|
+
*/
|
|
29
|
+
remove(point: Point): void;
|
|
25
30
|
/**
|
|
26
31
|
* 获取通过坐标,获取唯一网格索引
|
|
27
32
|
* @param point
|
|
@@ -68,3 +73,4 @@ export declare class PointVirtualGrid<T = Record<string, any>> {
|
|
|
68
73
|
userData?: T;
|
|
69
74
|
}[];
|
|
70
75
|
}
|
|
76
|
+
export {};
|
|
@@ -6,10 +6,10 @@ export declare class Box2 {
|
|
|
6
6
|
maxX: number;
|
|
7
7
|
minY: number;
|
|
8
8
|
maxY: number;
|
|
9
|
-
get points(): Point[];
|
|
9
|
+
get points(): Point<Record<string, any>>[];
|
|
10
10
|
get width(): number;
|
|
11
11
|
get height(): number;
|
|
12
|
-
get center(): Point
|
|
12
|
+
get center(): Point<Record<string, any>>;
|
|
13
13
|
constructor(minX?: number, maxX?: number, minY?: number, maxY?: number);
|
|
14
14
|
/**
|
|
15
15
|
*
|
|
@@ -75,6 +75,7 @@ export declare class Box2 {
|
|
|
75
75
|
* @returns
|
|
76
76
|
*/
|
|
77
77
|
multiplyScalar(scalar: number): this;
|
|
78
|
+
expansion(w: number): this;
|
|
78
79
|
/**
|
|
79
80
|
*
|
|
80
81
|
* @returns
|
|
@@ -6,9 +6,10 @@ import { Rectangle } from './Rectangle';
|
|
|
6
6
|
export declare class LineSegment<T = Record<string, any>> {
|
|
7
7
|
points: Point[];
|
|
8
8
|
userData: T;
|
|
9
|
-
|
|
10
|
-
get
|
|
11
|
-
get
|
|
9
|
+
line: any;
|
|
10
|
+
get center(): Point<Record<string, any>>;
|
|
11
|
+
get start(): Point<Record<string, any>>;
|
|
12
|
+
get end(): Point<Record<string, any>>;
|
|
12
13
|
constructor(p1?: Point, p2?: Point);
|
|
13
14
|
/** 膨胀
|
|
14
15
|
* @description 向线段的两个端点分别膨胀 width
|
|
@@ -46,11 +47,11 @@ export declare class LineSegment<T = Record<string, any>> {
|
|
|
46
47
|
* 获取方向
|
|
47
48
|
* @returns
|
|
48
49
|
*/
|
|
49
|
-
direction(): Point
|
|
50
|
+
direction(): Point<Record<string, any>>;
|
|
50
51
|
/**
|
|
51
52
|
* 获取发向量
|
|
52
53
|
*/
|
|
53
|
-
normal(): Point
|
|
54
|
+
normal(): Point<Record<string, any>>;
|
|
54
55
|
/**
|
|
55
56
|
* 线段长度
|
|
56
57
|
* @returns
|
|
@@ -63,11 +64,12 @@ export declare class LineSegment<T = Record<string, any>> {
|
|
|
63
64
|
*/
|
|
64
65
|
projectLineSegment(line: LineSegment): LineSegment;
|
|
65
66
|
/**
|
|
66
|
-
*
|
|
67
|
-
* @param
|
|
67
|
+
* 计算一条线段在另一条直线上的投影
|
|
68
|
+
* @param p1 要投影的点
|
|
69
|
+
* @param clip 是否裁剪超出目标线段的部分,默认裁剪
|
|
68
70
|
* @returns 投影并裁剪后的线段
|
|
69
71
|
*/
|
|
70
|
-
projectPoint(p1: Point): Point | null;
|
|
72
|
+
projectPoint(p1: Point, clip?: boolean): Point | null;
|
|
71
73
|
/**
|
|
72
74
|
* 判断线段是与线段相交
|
|
73
75
|
* @param line
|
|
@@ -105,5 +107,5 @@ export declare class LineSegment<T = Record<string, any>> {
|
|
|
105
107
|
* @returns
|
|
106
108
|
*/
|
|
107
109
|
areLinesCoincident(line: LineSegment): boolean;
|
|
108
|
-
clone(): LineSegment<
|
|
110
|
+
clone(): LineSegment<T>;
|
|
109
111
|
}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
export declare class Point {
|
|
1
|
+
export declare class Point<T = Record<string, any>> {
|
|
2
2
|
x: number;
|
|
3
3
|
y: number;
|
|
4
4
|
get X(): number;
|
|
5
5
|
get Y(): number;
|
|
6
|
+
userData: T;
|
|
6
7
|
/**
|
|
7
8
|
*
|
|
8
9
|
* @param x
|
|
@@ -70,14 +71,14 @@ export declare class Point {
|
|
|
70
71
|
* @param point
|
|
71
72
|
* @returns
|
|
72
73
|
*/
|
|
73
|
-
normal(point: Point): Point
|
|
74
|
+
normal(point: Point): Point<Record<string, any>>;
|
|
74
75
|
/**
|
|
75
76
|
* 获取由传入的点到该点的单位方向向量
|
|
76
77
|
* @description 计算当前点到指定点的方向向量,并返回单位方向
|
|
77
78
|
* @param point
|
|
78
79
|
* @returns
|
|
79
80
|
*/
|
|
80
|
-
direction(point: Point): Point
|
|
81
|
+
direction(point: Point): Point<Record<string, any>>;
|
|
81
82
|
/**
|
|
82
83
|
* 计算模长
|
|
83
84
|
* @returns
|
|
@@ -115,7 +116,7 @@ export declare class Point {
|
|
|
115
116
|
* 克隆
|
|
116
117
|
* @returns
|
|
117
118
|
*/
|
|
118
|
-
clone(): Point
|
|
119
|
+
clone(): Point<Record<string, any>>;
|
|
119
120
|
/**
|
|
120
121
|
* 克隆
|
|
121
122
|
* @returns
|
|
@@ -124,6 +125,10 @@ export declare class Point {
|
|
|
124
125
|
x: number;
|
|
125
126
|
y: number;
|
|
126
127
|
}): void;
|
|
127
|
-
|
|
128
|
-
|
|
128
|
+
toJson(): {
|
|
129
|
+
x: number;
|
|
130
|
+
y: number;
|
|
131
|
+
};
|
|
132
|
+
static from(arr: any): Point<Record<string, any>>;
|
|
133
|
+
static zero(): Point<Record<string, any>>;
|
|
129
134
|
}
|
|
@@ -5,6 +5,7 @@ import { Rectangle } from './Rectangle';
|
|
|
5
5
|
export interface QuadtreeNode<T = any> {
|
|
6
6
|
line: LineSegment;
|
|
7
7
|
userData: T;
|
|
8
|
+
parent?: Quadtree;
|
|
8
9
|
}
|
|
9
10
|
export declare class Quadtree<T = any> {
|
|
10
11
|
bounds: Box2;
|
|
@@ -21,6 +22,10 @@ export declare class Quadtree<T = any> {
|
|
|
21
22
|
* @param node 线段节点
|
|
22
23
|
*/
|
|
23
24
|
insert(node: QuadtreeNode<T>): void;
|
|
25
|
+
/** 移除
|
|
26
|
+
* @param node
|
|
27
|
+
*/
|
|
28
|
+
remove(node: QuadtreeNode<T>): void;
|
|
24
29
|
/**
|
|
25
30
|
* 获取线段所属的象限
|
|
26
31
|
* @param line 线段
|
|
@@ -6,12 +6,13 @@ import { Point } from './Point';
|
|
|
6
6
|
*/
|
|
7
7
|
export declare class Rectangle {
|
|
8
8
|
points: Point[];
|
|
9
|
-
get p0(): Point
|
|
10
|
-
get p1(): Point
|
|
11
|
-
get p2(): Point
|
|
12
|
-
get p3(): Point
|
|
9
|
+
get p0(): Point<Record<string, any>>;
|
|
10
|
+
get p1(): Point<Record<string, any>>;
|
|
11
|
+
get p2(): Point<Record<string, any>>;
|
|
12
|
+
get p3(): Point<Record<string, any>>;
|
|
13
13
|
get path(): number[];
|
|
14
14
|
path2D(callback?: (point1: Point, point2: Point) => void): number[];
|
|
15
|
+
createGeometry(): number[];
|
|
15
16
|
constructor(points: Point[]);
|
|
16
17
|
/**
|
|
17
18
|
* 判断线段是否与矩形相交
|