build-dxf 0.0.20-4 → 0.0.20-6

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.
@@ -69,15 +69,17 @@ 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 (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;
72
+ if (this.orbitControls) {
73
+ if (camera2 instanceof THREE.PerspectiveCamera) {
74
+ camera2.aspect = width / height;
75
+ } else if (camera2 instanceof THREE.OrthographicCamera) {
76
+ camera2.left = -width * 0.5;
77
+ camera2.right = width * 0.5;
78
+ camera2.top = height * 0.5;
79
+ camera2.bottom = -height * 0.5;
80
+ }
81
+ camera2.updateProjectionMatrix();
79
82
  }
80
- camera2.updateProjectionMatrix();
81
83
  this.onResize && this.onResize(width, height);
82
84
  this.dispatchEvent({ type: "resize", width, height });
83
85
  });
@@ -18,6 +18,10 @@ export declare class CommandFlow extends EventDispatcher<{
18
18
  finally: {};
19
19
  }> {
20
20
  list: CommandFlowCallBack[];
21
+ rollbacklist: CommandFlowCallBack[];
22
+ revokeList: CommandFlowCallBack[];
21
23
  add(operation: CommandFlowCallBack): this;
24
+ addRollback(callBack: (data?: any) => void): void;
25
+ addRevoke(callBack: (data?: any) => void): void;
22
26
  }
23
27
  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;
@@ -40,6 +44,11 @@ export declare class CommandManager extends EventDispatcher<{
40
44
  private _disabled;
41
45
  set disabled(disabled: boolean);
42
46
  get disabled(): boolean;
47
+ /**
48
+ * 操作记录
49
+ */
50
+ operationList: Operation[];
51
+ rollbackList: Operation[];
43
52
  constructor();
44
53
  /** 添加命令流
45
54
  * @param name
@@ -56,4 +65,9 @@ export declare class CommandManager extends EventDispatcher<{
56
65
  /** 取消当前命令
57
66
  */
58
67
  cancel(): void;
68
+ /**
69
+ * 回滚
70
+ */
71
+ rollback(): void;
72
+ revoke(): void;
59
73
  }
@@ -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,19 @@
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
+ }
@@ -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,19 @@
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
+ }
@@ -0,0 +1,19 @@
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
+ }
@@ -0,0 +1,19 @@
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
+ }
@@ -0,0 +1,17 @@
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
+ }
@@ -0,0 +1,39 @@
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
+ }
@@ -0,0 +1,19 @@
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
+ }
@@ -4,3 +4,4 @@ export * from './CommandFlow/Default';
4
4
  export * from './CommandFlow/DrawDoorLine';
5
5
  export * from './CommandFlow/DrawLine';
6
6
  export * from './CommandFlow/DrawWindow';
7
+ export * from './CommandFlow/VerticalCorrection';