build-dxf 0.0.20-8 → 0.0.20
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 +0 -2
- package/src/build.js +19 -27
- package/src/index.css +34 -42
- package/src/index2.js +14 -2
- package/src/index3.js +262 -542
- package/src/selectLocalFile.js +9 -10
- package/src/utils/CommandManager/CommandFlow.d.ts +0 -4
- package/src/utils/CommandManager/CommandManager.d.ts +0 -14
- package/src/utils/DxfSystem/components/Dxf.d.ts +0 -1
- package/src/utils/DxfSystem/plugin/Editor/components/CommandFlow/CommandFlowComponent.d.ts +1 -4
- package/src/utils/DxfSystem/plugin/Editor/components/CommandFlow/Default.d.ts +20 -0
- package/src/utils/DxfSystem/plugin/Editor/components/index.d.ts +0 -1
- package/src/utils/Quadtree/Point.d.ts +1 -2
- package/src/utils/DxfSystem/plugin/Editor/components/CommandFlow/ConnectionLine.d.ts +0 -19
- package/src/utils/DxfSystem/plugin/Editor/components/CommandFlow/DeleteSelectLine.d.ts +0 -19
- package/src/utils/DxfSystem/plugin/Editor/components/CommandFlow/DeleteSelectWindow.d.ts +0 -19
- package/src/utils/DxfSystem/plugin/Editor/components/CommandFlow/IntersectionConnectionLine.d.ts +0 -19
- package/src/utils/DxfSystem/plugin/Editor/components/CommandFlow/SelectAll.d.ts +0 -17
- package/src/utils/DxfSystem/plugin/Editor/components/CommandFlow/VerticalCorrection.d.ts +0 -39
- package/src/utils/DxfSystem/plugin/Editor/components/CommandFlow/mergeLine.d.ts +0 -19
package/src/selectLocalFile.js
CHANGED
|
@@ -69,17 +69,15 @@ class Renderer extends Component {
|
|
|
69
69
|
this.renderer.setSize(width, height);
|
|
70
70
|
if (this.html2DRenderer) this.html2DRenderer.setSize(width, height);
|
|
71
71
|
if (this.html3DRenderer) this.html3DRenderer.setSize(width, height);
|
|
72
|
-
if (
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
camera2.bottom = -height * 0.5;
|
|
80
|
-
}
|
|
81
|
-
camera2.updateProjectionMatrix();
|
|
72
|
+
if (camera2 instanceof THREE.PerspectiveCamera) {
|
|
73
|
+
camera2.aspect = width / height;
|
|
74
|
+
} else if (camera2 instanceof THREE.OrthographicCamera) {
|
|
75
|
+
camera2.left = -width * 0.5;
|
|
76
|
+
camera2.right = width * 0.5;
|
|
77
|
+
camera2.top = height * 0.5;
|
|
78
|
+
camera2.bottom = -height * 0.5;
|
|
82
79
|
}
|
|
80
|
+
camera2.updateProjectionMatrix();
|
|
83
81
|
this.onResize && this.onResize(width, height);
|
|
84
82
|
this.dispatchEvent({ type: "resize", width, height });
|
|
85
83
|
});
|
|
@@ -99,6 +97,7 @@ class Renderer extends Component {
|
|
|
99
97
|
const directLight = new THREE.DirectionalLight(16777215, 4);
|
|
100
98
|
directLight.position.set(100, -100, 100);
|
|
101
99
|
this.scene.add(directLight);
|
|
100
|
+
camera.position.set(10, 10, 10);
|
|
102
101
|
}
|
|
103
102
|
/**
|
|
104
103
|
* 世界坐标转屏幕坐标
|
|
@@ -18,10 +18,6 @@ export declare class CommandFlow extends EventDispatcher<{
|
|
|
18
18
|
finally: {};
|
|
19
19
|
}> {
|
|
20
20
|
list: CommandFlowCallBack[];
|
|
21
|
-
rollbacklist: CommandFlowCallBack[];
|
|
22
|
-
revokeList: CommandFlowCallBack[];
|
|
23
21
|
add(operation: CommandFlowCallBack): this;
|
|
24
|
-
addRollback(callBack: (data?: any) => void): void;
|
|
25
|
-
addRevoke(callBack: (data?: any) => void): void;
|
|
26
22
|
}
|
|
27
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;
|
|
@@ -44,11 +40,6 @@ export declare class CommandManager extends EventDispatcher<{
|
|
|
44
40
|
private _disabled;
|
|
45
41
|
set disabled(disabled: boolean);
|
|
46
42
|
get disabled(): boolean;
|
|
47
|
-
/**
|
|
48
|
-
* 操作记录
|
|
49
|
-
*/
|
|
50
|
-
operationList: Operation[];
|
|
51
|
-
rollbackList: Operation[];
|
|
52
43
|
constructor();
|
|
53
44
|
/** 添加命令流
|
|
54
45
|
* @param name
|
|
@@ -65,9 +56,4 @@ export declare class CommandManager extends EventDispatcher<{
|
|
|
65
56
|
/** 取消当前命令
|
|
66
57
|
*/
|
|
67
58
|
cancel(): void;
|
|
68
|
-
/**
|
|
69
|
-
* 回滚
|
|
70
|
-
*/
|
|
71
|
-
rollback(): void;
|
|
72
|
-
revoke(): void;
|
|
73
59
|
}
|
|
@@ -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
|
* 更新选择的线段
|
|
@@ -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(
|
|
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,19 +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
|
-
}
|
|
@@ -1,19 +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
|
-
}
|
|
@@ -1,19 +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 connection;
|
|
19
|
-
}
|
package/src/utils/DxfSystem/plugin/Editor/components/CommandFlow/IntersectionConnectionLine.d.ts
DELETED
|
@@ -1,19 +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
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { CommandFlowComponent } from './CommandFlowComponent';
|
|
2
|
-
import { ComponentManager } from '../../../../../ComponentManager';
|
|
3
|
-
import * as THREE from "three";
|
|
4
|
-
/**
|
|
5
|
-
* 选择全部命令
|
|
6
|
-
*/
|
|
7
|
-
export declare class SelectAll extends CommandFlowComponent<{}> {
|
|
8
|
-
static name: string;
|
|
9
|
-
container: THREE.Group<THREE.Object3DEventMap>;
|
|
10
|
-
shortcutKeys: string[];
|
|
11
|
-
static commandName: string;
|
|
12
|
-
onAddFromParent(parent: ComponentManager): void;
|
|
13
|
-
/** 开始
|
|
14
|
-
* @param next
|
|
15
|
-
*/
|
|
16
|
-
selectAll(next: any): void;
|
|
17
|
-
}
|
|
@@ -1,39 +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
|
-
static commandName: string;
|
|
14
|
-
onAddFromParent(parent: ComponentManager): void;
|
|
15
|
-
/**
|
|
16
|
-
* 进入命令约束
|
|
17
|
-
*/
|
|
18
|
-
constraint(next: any, selectLines: LineSegment[]): void;
|
|
19
|
-
/**
|
|
20
|
-
* 线段是否为结尾线段
|
|
21
|
-
* @param line
|
|
22
|
-
*/
|
|
23
|
-
lineIsPathEnd(line: LineSegment): boolean;
|
|
24
|
-
/**
|
|
25
|
-
* 设置所有相同点的位置
|
|
26
|
-
* @param point
|
|
27
|
-
* @param point2
|
|
28
|
-
*/
|
|
29
|
-
setPointAll(point: Point, point2: Point): void;
|
|
30
|
-
/** 修正
|
|
31
|
-
* @param selectLine
|
|
32
|
-
* @param vistedList
|
|
33
|
-
*/
|
|
34
|
-
correction(selectLine: LineSegment, vistedList?: Set<LineSegment>): Set<LineSegment<Record<string, any>>> | undefined;
|
|
35
|
-
/** 开始
|
|
36
|
-
* @param next
|
|
37
|
-
*/
|
|
38
|
-
verticalCorrection(next: any, selectLines: LineSegment[]): void;
|
|
39
|
-
}
|
|
@@ -1,19 +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
|
-
*/
|
|
18
|
-
private mergeLine;
|
|
19
|
-
}
|