mxdraw 0.1.21 → 0.1.25

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.
Files changed (120) hide show
  1. package/dist/lib/MxModule/McEdGetPointWorldDrawObject/McEdGetPointWorldDrawObjectClass.js +1 -128
  2. package/dist/lib/MxModule/McEdGetPointWorldDrawObject/index.js +1 -5
  3. package/dist/lib/MxModule/McGePoint3d/McGePoint3d.js +1 -0
  4. package/dist/lib/MxModule/McGePoint3d/index.js +1 -0
  5. package/dist/lib/MxModule/McGePoint3dArray/McGePoint3dArray.js +1 -0
  6. package/dist/lib/MxModule/McGePoint3dArray/index.js +1 -0
  7. package/dist/lib/MxModule/McGeTool/McGeTool.js +1 -0
  8. package/dist/lib/MxModule/McGeTool/index.js +1 -0
  9. package/dist/lib/MxModule/McGiWorldDraw/McGiWorldDraw.js +1 -3
  10. package/dist/lib/MxModule/McGiWorldDraw/index.js +1 -2
  11. package/dist/lib/MxModule/McGiWorldDrawType/McGiWorldDrawType.js +1 -19
  12. package/dist/lib/MxModule/McGiWorldDrawType/index.js +1 -4
  13. package/dist/lib/MxModule/MrxDbgUiPrBaseReturn/MrxDbgUiPrBaseReturn.js +1 -31
  14. package/dist/lib/MxModule/MrxDbgUiPrBaseReturn/index.js +1 -5
  15. package/dist/lib/MxModule/MrxDbgUiPrPoint/MrxDbgUiPrPointClass.js +1 -159
  16. package/dist/lib/MxModule/MrxDbgUiPrPoint/index.js +1 -5
  17. package/dist/lib/MxModule/Mx3PointArc/Mx3PointArc.js +1 -0
  18. package/dist/lib/MxModule/Mx3PointArc/index.js +1 -0
  19. package/dist/lib/MxModule/MxDb2LineAngularDimension/MxDb2LineAngularDimension.js +1 -0
  20. package/dist/lib/MxModule/MxDb2LineAngularDimension/index.js +1 -0
  21. package/dist/lib/MxModule/MxDbAlignedDimension/MxDbAlignedDimension.js +1 -213
  22. package/dist/lib/MxModule/MxDbAlignedDimension/index.js +1 -5
  23. package/dist/lib/MxModule/MxDbAnyLine/MxDbAnyLine.js +1 -0
  24. package/dist/lib/MxModule/MxDbAnyLine/index.js +1 -0
  25. package/dist/lib/MxModule/MxDbArea/MxDbArea.js +1 -0
  26. package/dist/lib/MxModule/MxDbArea/index.js +1 -0
  27. package/dist/lib/MxModule/MxDbCoord/MxDbCoord.js +1 -0
  28. package/dist/lib/MxModule/MxDbCoord/index.js +1 -0
  29. package/dist/lib/MxModule/MxDbEntity/MxDbEntity.js +1 -258
  30. package/dist/lib/MxModule/MxDbEntity/index.js +1 -5
  31. package/dist/lib/MxModule/MxDbImage/MxDbImage.js +1 -160
  32. package/dist/lib/MxModule/MxDbImage/index.js +1 -5
  33. package/dist/lib/MxModule/MxDbLine/MxDbLine.js +1 -94
  34. package/dist/lib/MxModule/MxDbLine/index.js +1 -5
  35. package/dist/lib/MxModule/MxDbPolyline/MxDbPolyline.js +1 -97
  36. package/dist/lib/MxModule/MxDbPolyline/index.js +1 -5
  37. package/dist/lib/MxModule/MxDbRect/MxDbRect.js +1 -273
  38. package/dist/lib/MxModule/MxDbRect/index.js +1 -4
  39. package/dist/lib/MxModule/MxDbSVG/MxDbSVG.js +1 -419
  40. package/dist/lib/MxModule/MxDbSVG/index.js +1 -5
  41. package/dist/lib/MxModule/MxDbSVGText/MxDbSVGText.js +1 -21
  42. package/dist/lib/MxModule/MxDbSVGText/index.js +1 -5
  43. package/dist/lib/MxModule/MxDrawObject/MxDrawObject.js +1 -782
  44. package/dist/lib/MxModule/MxDrawObject/index.js +1 -5
  45. package/dist/lib/MxModule/MxFilters/MxFilters.js +1 -201
  46. package/dist/lib/MxModule/MxFilters/index.js +1 -4
  47. package/dist/lib/MxModule/MxFun/MxFun.js +1 -676
  48. package/dist/lib/MxModule/MxFun/index.js +1 -4
  49. package/dist/lib/MxModule/MxThreeJS/MxThreeJS.js +1 -283
  50. package/dist/lib/MxModule/MxThreeJS/MxThreeJS.mixin.js +1 -146
  51. package/dist/lib/MxModule/MxThreeJS/index.js +1 -7
  52. package/dist/lib/MxModule/MxType/MxType.js +1 -27
  53. package/dist/lib/MxModule/MxType/index.js +1 -4
  54. package/dist/lib/MxModule/Mxassembly/Mxassembly.js +1 -20
  55. package/dist/lib/MxModule/Mxassembly/index.js +1 -9
  56. package/dist/lib/MxModule/loadCoreCode/index.js +1 -5
  57. package/dist/lib/MxModule/loadCoreCode/loadCoreCode.js +1 -125
  58. package/dist/lib/MxModule/loadCoreCode/mxUiData.js +1 -312
  59. package/dist/lib/MxModule/loadCoreCode/mxcadassembly_es5.js +1 -1519
  60. package/dist/lib/MxModule/loadCoreCode/mxfun.es5.js +1 -7363
  61. package/dist/lib/MxModule/store/PubsubClass.js +1 -40
  62. package/dist/lib/MxModule/store/StoreClass.js +1 -73
  63. package/dist/lib/MxModule/store/index.js +1 -19
  64. package/dist/lib/MxModule/store/store.js +1 -25
  65. package/dist/lib/MxModule/useCanvasResizeListener/index.js +1 -5
  66. package/dist/lib/MxModule/useCanvasResizeListener/useCanvasResizeListener.js +1 -95
  67. package/dist/lib/doc.js +1 -38
  68. package/dist/lib/mxdraw.js +1 -67
  69. package/dist/lib/tools/algorithm/math.js +1 -16
  70. package/dist/lib/tools/algorithm/random.js +1 -13
  71. package/dist/lib/tools/dom/create.js +1 -47
  72. package/dist/lib/tools/dynamicImport/index.js +1 -243
  73. package/dist/lib/tools/formatting/index.js +1 -20
  74. package/dist/lib/tools/proxy/index.js +1 -17
  75. package/dist/lib/tools/three/index.js +1 -124
  76. package/dist/mxdraw.es5.js +1 -0
  77. package/dist/mxdraw.umd.js +1 -0
  78. package/dist/types/MxModule/McEdGetPointWorldDrawObject/McEdGetPointWorldDrawObjectClass.d.ts +9 -0
  79. package/dist/types/MxModule/McGePoint3d/McGePoint3d.d.ts +11 -0
  80. package/dist/types/MxModule/McGePoint3d/index.d.ts +3 -0
  81. package/dist/types/MxModule/McGePoint3dArray/McGePoint3dArray.d.ts +14 -0
  82. package/dist/types/MxModule/McGePoint3dArray/index.d.ts +3 -0
  83. package/dist/types/MxModule/McGeTool/McGeTool.d.ts +38 -0
  84. package/dist/types/MxModule/McGeTool/index.d.ts +4 -0
  85. package/dist/types/MxModule/MrxDbgUiPrPoint/MrxDbgUiPrPointClass.d.ts +18 -1
  86. package/dist/types/MxModule/Mx3PointArc/Mx3PointArc.d.ts +19 -0
  87. package/dist/types/MxModule/Mx3PointArc/index.d.ts +3 -0
  88. package/dist/types/MxModule/MxDb2LineAngularDimension/MxDb2LineAngularDimension.d.ts +22 -0
  89. package/dist/types/MxModule/MxDb2LineAngularDimension/index.d.ts +3 -0
  90. package/dist/types/MxModule/MxDbAnyLine/MxDbAnyLine.d.ts +18 -0
  91. package/dist/types/MxModule/MxDbAnyLine/index.d.ts +3 -0
  92. package/dist/types/MxModule/MxDbArea/MxDbArea.d.ts +17 -0
  93. package/dist/types/MxModule/MxDbArea/index.d.ts +3 -0
  94. package/dist/types/MxModule/MxDbCoord/MxDbCoord.d.ts +19 -0
  95. package/dist/types/MxModule/MxDbCoord/index.d.ts +3 -0
  96. package/dist/types/MxModule/MxDrawObject/MxDrawObject.d.ts +70 -1
  97. package/dist/types/MxModule/MxFun/MxFun.d.ts +95 -30
  98. package/dist/types/MxModule/Mxassembly/Mxassembly.d.ts +11 -2
  99. package/dist/types/MxModule/store/store.d.ts +2 -2
  100. package/dist/types/mxdraw.d.ts +17 -4
  101. package/dist/types/tools/three/index.d.ts +28 -1
  102. package/package.json +3 -2
  103. package/dist/lib/MxModule/McGeVector3d/McGeVector3d.js +0 -2
  104. package/dist/lib/MxModule/McGeVector3d/index.js +0 -3
  105. package/dist/lib/MxModule/MxThreeJS/SVGLoader.js +0 -1862
  106. package/dist/lib/types/McEdGetPointWorldDrawObject.js +0 -2
  107. package/dist/lib/types/MrxDbgUiPrPoint.js +0 -2
  108. package/dist/lib/types/MxCADObject.js +0 -2
  109. package/dist/lib/types/MxDrawObject.js +0 -2
  110. package/dist/lib/types/MxFun.js +0 -2
  111. package/dist/lib/types/Mxassembly.js +0 -2
  112. package/dist/types/MxModule/McGeVector3d/McGeVector3d.d.ts +0 -17
  113. package/dist/types/MxModule/McGeVector3d/index.d.ts +0 -3
  114. package/dist/types/MxModule/MxThreeJS/SVGLoader.d.ts +0 -22
  115. package/dist/types/types/McEdGetPointWorldDrawObject.d.ts +0 -9
  116. package/dist/types/types/MrxDbgUiPrPoint.d.ts +0 -23
  117. package/dist/types/types/MxCADObject.d.ts +0 -40
  118. package/dist/types/types/MxDrawObject.d.ts +0 -60
  119. package/dist/types/types/MxFun.d.ts +0 -47
  120. package/dist/types/types/Mxassembly.d.ts +0 -3
@@ -1,5 +1,14 @@
1
1
  /** @module McEdGetPointWorldDrawObject*/
2
2
  import { ColorType } from '../MxType/MxType';
3
+ export interface McEdGetPointWorldDrawObjectClass {
4
+ [x: string]: any;
5
+ drawCircle(cen: THREE.Vector3, dRadius: number): void;
6
+ drawLine(pt1: THREE.Vector3, pt2: THREE.Vector3): void;
7
+ drawEntity(ent: THREE.Object3D | null): void;
8
+ drawText(sText: string, iSize: number, dAngle: number, pt: THREE.Vector3): void;
9
+ setDraw(call: (currentPoint: THREE.Vector3, pWorldDraw: McEdGetPointWorldDrawObjectClass) => void): void;
10
+ drawCustomEntity(ent: any): void;
11
+ }
3
12
  /**
4
13
  * McEdGetPointWorldDrawObject 用于构建一个动态绘制回调对象
5
14
  * @example ```typescript
@@ -0,0 +1,11 @@
1
+ /** @module McGePoint3d */
2
+ /**
3
+ * McGePoint3d
4
+ * @example ```typescript
5
+ * ```
6
+ */
7
+ export default interface McGePoint3d {
8
+ x: number;
9
+ y: number;
10
+ z: number;
11
+ }
@@ -0,0 +1,3 @@
1
+ /** @module MrxDbgUiPrPointClass */
2
+ import McGePoint3d from './McGePoint3d';
3
+ export default McGePoint3d;
@@ -0,0 +1,14 @@
1
+ /** @module McGePoint3dArray */
2
+ import McGePoint3d from '../McGePoint3d';
3
+ /**
4
+ * McGePoint3dArray
5
+ * @example ```typescript
6
+ * ```
7
+ */
8
+ export default interface McGePoint3dArray {
9
+ /**
10
+ *
11
+ * @returns
12
+ */
13
+ append(pt: McGePoint3d): void;
14
+ }
@@ -0,0 +1,3 @@
1
+ /** @module MrxDbgUiPrPointClass */
2
+ import McGePoint3dArray from './McGePoint3dArray';
3
+ export default McGePoint3dArray;
@@ -0,0 +1,38 @@
1
+ /** @module McGeTool */
2
+ import McGePoint3d from '../McGePoint3d';
3
+ import McGePoint3dArray from '../McGePoint3dArray';
4
+ /**
5
+ * McGeTool
6
+ * @example ```typescript
7
+ * ```
8
+ */
9
+ export default class McGeTool {
10
+ private mxgeTool;
11
+ private initImp;
12
+ /**
13
+ * 计算闭合的区域面积
14
+ * @param
15
+ * @return number
16
+ * @example
17
+ * ```
18
+ */
19
+ calcArea(aryPoint: McGePoint3dArray | THREE.Vector3[]): number;
20
+ /**
21
+ * 判断点是否在一个闭合的多边形区域。
22
+ * @param p
23
+ * @return any
24
+ * @example
25
+ * ``` typescript
26
+ * let aryPoint:Array<THREE.Vector3> = [];
27
+ * aryPoint.push(new THREE.Vector3(0,0,0));
28
+ * aryPoint.push(new THREE.Vector3(0,100,0));
29
+ * aryPoint.push(new THREE.Vector3(100,100,0));
30
+ * aryPoint.push(new THREE.Vector3(100,0,0));
31
+ * let pt:THREE.Vector3 = new THREE.Vector3(150,150);
32
+ * if(McGeTool.pointInPolyline(pt,aryPoint) ){
33
+ * console.log("in");
34
+ * }
35
+ * ```
36
+ */
37
+ pointInPolyline(pt: McGePoint3d, aryPoint: McGePoint3dArray | THREE.Vector3[]): boolean;
38
+ }
@@ -0,0 +1,4 @@
1
+ /** @module MrxDbgUiPrPointClass */
2
+ import McGeToolModule from './McGeTool';
3
+ declare const _default: McGeToolModule;
4
+ export default _default;
@@ -1,6 +1,23 @@
1
1
  /** @module MrxDbgUiPrPointClass */
2
- import { MrxDbgUiPrBaseReturn } from '../../types/MrxDbgUiPrPoint';
3
2
  import McEdGetPointWorldDrawObject from '../McEdGetPointWorldDrawObject';
3
+ import MrxDbgUiPrBaseReturn from '../MrxDbgUiPrBaseReturn';
4
+ export interface MrxDbgUiPrPointClass {
5
+ keyWords(): string;
6
+ setKeyWords(keyWordList: string): void;
7
+ message(): string;
8
+ setMessage(message: string): void;
9
+ keyWordPicked(): string;
10
+ isKeyWordPicked(matchKeyWord: string): boolean;
11
+ setUserDraw(pDraw: any): void;
12
+ value(): THREE.Vector3;
13
+ valueDocCoord(): THREE.Vector3;
14
+ basePt(): THREE.Vector3;
15
+ setBasePt(basePt: THREE.Vector3): void;
16
+ setUseBasePt(useIt: boolean): void;
17
+ go(retcall: (status: MrxDbgUiPrBaseReturn) => void): void;
18
+ goWhile(retcall: (status: MrxDbgUiPrBaseReturn) => any, exitcall?: (status: MrxDbgUiPrBaseReturn) => any): void;
19
+ drawReserve(callAddEntity?: (ent: THREE.Object3D) => void): void;
20
+ }
4
21
  /**
5
22
  * MrxDbgUiPrPoint 用于构建一个取点对象
6
23
  * @example ```typescript
@@ -0,0 +1,19 @@
1
+ /** @module Mx3PointArc*/
2
+ import { Vector3 } from 'three';
3
+ import McGiWorldDraw from '../McGiWorldDraw';
4
+ import MxDbEntity from '../MxDbEntity';
5
+ /**
6
+ * Mx3PointArc 对象.
7
+ */
8
+ export default class Mx3PointArc extends MxDbEntity {
9
+ point1: Vector3;
10
+ point2: Vector3;
11
+ point3: Vector3;
12
+ getTypeName(): string;
13
+ create(): MxDbEntity;
14
+ worldDraw(pWorldDraw: McGiWorldDraw): void;
15
+ getGripPoints(): Vector3[];
16
+ moveGripPointsAt(index: number, offset: Vector3): boolean;
17
+ dwgIn(obj: any): boolean;
18
+ dwgOut(obj: any): object;
19
+ }
@@ -0,0 +1,3 @@
1
+ /** @module McEdGetPointWorldDrawObject*/
2
+ import Mx3PointArc from './Mx3PointArc';
3
+ export default Mx3PointArc;
@@ -0,0 +1,22 @@
1
+ /** @module MxDb2LineAngularDimension*/
2
+ import * as THREE from 'three';
3
+ import { Vector3 } from 'three';
4
+ import McGiWorldDraw from '../McGiWorldDraw';
5
+ import MxDbEntity from '../MxDbEntity';
6
+ /**
7
+ * MxDb2LineAngularDimension 对象.
8
+ */
9
+ export default class MxDb2LineAngularDimension extends MxDbEntity {
10
+ point1: THREE.Vector3;
11
+ point2: THREE.Vector3;
12
+ point3: THREE.Vector3;
13
+ private calculateLineAngle;
14
+ worldDraw(pWorldDraw: McGiWorldDraw): void;
15
+ getGripPoints(): Vector3[];
16
+ moveGripPointsAt(index: number, offset: Vector3): boolean;
17
+ dwgIn(obj: any): boolean;
18
+ dwgOut(obj: any): object;
19
+ create(): MxDbEntity;
20
+ transformBy(mat: THREE.Matrix4): void;
21
+ getTypeName(): string;
22
+ }
@@ -0,0 +1,3 @@
1
+ /** @module McEdGetPointWorldDrawObject*/
2
+ import MxDb2LineAngularDimension from './MxDb2LineAngularDimension';
3
+ export default MxDb2LineAngularDimension;
@@ -0,0 +1,18 @@
1
+ /** @module MxDbAnyLine*/
2
+ import { Vector3 } from 'three';
3
+ import McGiWorldDraw from '../McGiWorldDraw';
4
+ import MxDbEntity from '../MxDbEntity';
5
+ /**
6
+ * MxDbAnyLine 对象.
7
+ */
8
+ export default class MxDbAnyLine extends MxDbEntity {
9
+ points: Vector3[];
10
+ getTypeName(): string;
11
+ create(): MxDbEntity;
12
+ worldDraw(pWorldDraw: McGiWorldDraw): void;
13
+ getCenter(): Vector3;
14
+ getGripPoints(): Vector3[];
15
+ moveGripPointsAt(index: number, offset: Vector3): boolean;
16
+ dwgIn(obj: any): boolean;
17
+ dwgOut(obj: any): object;
18
+ }
@@ -0,0 +1,3 @@
1
+ /** @module McEdGetPointWorldDrawObject*/
2
+ import MxDbAnyLine from './MxDbAnyLine';
3
+ export default MxDbAnyLine;
@@ -0,0 +1,17 @@
1
+ /** @module MxDbArea*/
2
+ import * as THREE from 'three';
3
+ import McGiWorldDraw from '../McGiWorldDraw';
4
+ import MxDbEntity from '../MxDbEntity';
5
+ export default class MxDbArea extends MxDbEntity {
6
+ points: Array<THREE.Vector3>;
7
+ getTypeName(): string;
8
+ create(): MxDbEntity;
9
+ worldDraw(pWorldDraw: McGiWorldDraw): void;
10
+ getGripPoints(): Array<THREE.Vector3>;
11
+ moveGripPointsAt(index: number, offset: THREE.Vector3): boolean;
12
+ dwgIn(obj: any): boolean;
13
+ dwgOut(obj: any): object;
14
+ addPoint(pt: THREE.Vector3): void;
15
+ getPoints(): Array<THREE.Vector3>;
16
+ clearPoint(): void;
17
+ }
@@ -0,0 +1,3 @@
1
+ /** @module McEdGetPointWorldDrawObject*/
2
+ import MxDbArea from './MxDbArea';
3
+ export default MxDbArea;
@@ -0,0 +1,19 @@
1
+ /** @module MxDbCoord*/
2
+ import * as THREE from 'three';
3
+ import McGiWorldDraw from '../McGiWorldDraw';
4
+ import MxDbEntity from '../MxDbEntity';
5
+ /**
6
+ * MxDbCoord 对象.
7
+ */
8
+ export default class MxDbCoord extends MxDbEntity {
9
+ point1: THREE.Vector3;
10
+ point2: THREE.Vector3;
11
+ worldDraw(pWorldDraw: McGiWorldDraw): void;
12
+ getGripPoints(): Array<THREE.Vector3>;
13
+ moveGripPointsAt(index: number, offset: THREE.Vector3): boolean;
14
+ dwgIn(obj: any): boolean;
15
+ dwgOut(obj: any): object;
16
+ create(): MxDbEntity;
17
+ transformBy(mat: THREE.Matrix4): void;
18
+ getTypeName(): string;
19
+ }
@@ -0,0 +1,3 @@
1
+ /** @module McEdGetPointWorldDrawObject*/
2
+ import MxDbCoord from './MxDbCoord';
3
+ export default MxDbCoord;
@@ -1,6 +1,64 @@
1
1
  /** @module MxDrawObject */
2
- import { MxDrawObjectType } from '../../types/MxDrawObject';
3
2
  import MxDbEntity from '../MxDbEntity';
3
+ export interface MxDrawObjectType {
4
+ renderer: THREE.WebGLRenderer;
5
+ addEvent(arg0: string, arg1: (...parmes: any) => any): void;
6
+ setIniset(arg0: {
7
+ EnableOsnapFunction: boolean;
8
+ }): void;
9
+ getScene(): THREE.Scene;
10
+ getCamera(): THREE.Camera;
11
+ setMouseRightRotate(isRotate: boolean): void;
12
+ getFullDisplayRange(): object;
13
+ getCanvas(): HTMLCanvasElement;
14
+ updateDisplay(): void;
15
+ createCanvasImageData(fun: (imageData: string) => void, param?: object): void;
16
+ setViewColor(color: number): void;
17
+ setSize(width: number, height: number): void;
18
+ getIntersectObjects(ptMouse: THREE.Vector2): THREE.Intersection[];
19
+ getViewWidth(): number;
20
+ getViewHeight(): number;
21
+ zoomInitialStates(): void;
22
+ zoomScale(scale: number): void;
23
+ zoomW(minPt: THREE.Vector3, maxPt: THREE.Vector3, isWorld?: boolean): void;
24
+ zoomCenter(dCenX: number, dCenY: number): void;
25
+ initZoomW(pt1Doc: THREE.Vector3, pt2Doc: THREE.Vector3): void;
26
+ addMxEntity(ent: any): number;
27
+ eraseMxEntity(id: number): boolean;
28
+ screenCoord2World(x: number, y: number, z?: number): THREE.Vector3;
29
+ worldCoord2Screen(x: number, y: number, z: number): THREE.Vector3;
30
+ screenCoord2Doc(x: number, y: number, z: number): THREE.Vector3;
31
+ worldCoordLong2Doc(l: number): number;
32
+ docCoordLong2World(l: number): number;
33
+ docCoord2World(x: number, y: number, z: number): THREE.Vector3;
34
+ worldCoord2Doc(x: number, y: number, z: number): THREE.Vector3;
35
+ docCoord2Screen(x: number, y: number, z: number): THREE.Vector3;
36
+ screenCoordLong2Doc(l: number): number;
37
+ docCoordLong2Screen(l: number): number;
38
+ screenCoordLong2World(l: number): number;
39
+ worldCoordLong2Screen(l: number): number;
40
+ initRendererParam(param: object): void;
41
+ getMxAllSelect(): Array<number>;
42
+ addMxCurrentSelect(id: number): void;
43
+ clearMxCurrentSelect(): boolean;
44
+ getMxEntityUserObject(id: number): MxDbEntity;
45
+ findMxEntityAtPoint(ptMouse: THREE.Vector3): Array<MxDbEntity>;
46
+ setMouseMiddlePan(isPan: boolean): void;
47
+ resetThreeJSControls(): void;
48
+ getAllMxEntity(): Array<MxDbEntity>;
49
+ enableZoom(isEnable: boolean): void;
50
+ enablePan(isEnable: boolean): void;
51
+ addObject(obj: THREE.Object3D | null, isAddToSelect?: boolean): void;
52
+ addViewObject(obj: THREE.Object3D): void;
53
+ removeViewObject(obj: THREE.Object3D): void;
54
+ removeObject(obj: THREE.Object3D, isRemoveSelectObject?: boolean): void;
55
+ saveMxEntityToJson(): string;
56
+ loadMxEntityFromJson(dataString: string): Promise<boolean>;
57
+ eraseAllMxEntity(): void;
58
+ makeCurrent(): void;
59
+ getViewCenterDocCoord(): THREE.Vector3;
60
+ updateCanvasSize(): void;
61
+ }
4
62
  /**
5
63
  * 引入mxdraw库不会挂载MxDrawObject 只能在以下特定函数中获取
6
64
  * @function
@@ -606,4 +664,15 @@ export default class MxDrawObject {
606
664
  * ```
607
665
  */
608
666
  updateCanvasSize(): void;
667
+ /**
668
+ * 新建图纸.
669
+ * @param ptin1,ptin2新建图纸的显示范围.
670
+ * @returns
671
+ * @example
672
+ * ```typescript
673
+ *
674
+ *
675
+ * ```
676
+ */
677
+ newFile(ptin1: THREE.Vector3 | number, ptin2: THREE.Vector3 | number, x2?: number, y2?: number): boolean;
609
678
  }
@@ -2,9 +2,93 @@ import MxDrawObject from '../MxDrawObject';
2
2
  import { MeshLambertMaterial } from 'three';
3
3
  import MxDbEntity from '../MxDbEntity';
4
4
  import mxUiData from '../loadCoreCode/mxUiData';
5
+ import { MxDrawObjectType } from '../MxDrawObject/MxDrawObject';
6
+ import { ColorType } from '../MxType/MxType';
5
7
  interface CanvasParent extends HTMLElement {
6
8
  tabindex?: number;
7
9
  }
10
+ interface MxCADLayerTableRecord {
11
+ id: number;
12
+ name: string;
13
+ color: number;
14
+ off: boolean;
15
+ }
16
+ export interface MxCADObject {
17
+ /** 新建文件 */
18
+ newFile(): void;
19
+ /** 撤销操作 */
20
+ undo(): void;
21
+ /**
22
+ * 打开文件
23
+ * @param file 文件路径
24
+ * @param retfun 打开文件后的回调函数
25
+ *
26
+ * */
27
+ openFile(file: string, retfun?: (ret: Object) => void): void;
28
+ /**
29
+ * 保存文件
30
+ * @param file 文件路径
31
+ * @param retfun 保存文件后的回调函数
32
+ *
33
+ * */
34
+ saveFile(file: string, retfun?: (ret: Object) => void): void;
35
+ /**
36
+ * 获取打开的文件名称
37
+ * @param file 文件路径
38
+ * @param retfun 保存文件后的回调函数
39
+ *
40
+ * */
41
+ getFileName(): string;
42
+ /**
43
+ * 获取全部图层数据
44
+ * @retruns 全部图层数据
45
+ *
46
+ * */
47
+ getAllLayerData(): MxCADLayerTableRecord[];
48
+ }
49
+ interface CmdMangerType {
50
+ McEdGetPointWorldDrawObjectClass(): any;
51
+ getMrxDbgUiPrPointClass(): any;
52
+ }
53
+ export interface MxFunType {
54
+ createMxObject(canvasId: string, arg1: string | string[], arg2: (mxDraw: MxDrawObjectType) => void, is2d: boolean | undefined, isNewCreate?: boolean, isStaticLoad?: boolean): void;
55
+ setMxServer(MXSERVER: string): void;
56
+ addCommand(cmdName: string, fun: Function): void;
57
+ sendStringToExecute(sCmd: string, ...params: any[]): boolean;
58
+ call(cmd: string, param: any, retfun?: Function): void;
59
+ getCurrentDraw(): MxDrawObjectType;
60
+ screenCoordLong2World(len: number): number;
61
+ screenCoordLong2Doc(len: number): number;
62
+ worldCoordLong2Doc(len: number): number;
63
+ docCoordLong2World(len: number): number;
64
+ docCoordLong2Screen(len: number): number;
65
+ screenCoord2World(x: number | THREE.Vector3, y?: number, z?: number): THREE.Vector3;
66
+ worldCoord2Screen(x: number | THREE.Vector3, y?: number, z?: number): THREE.Vector3;
67
+ docCoord2World(x: number | THREE.Vector3, y?: number, z?: number): THREE.Vector3;
68
+ worldCoord2Doc(x: number | THREE.Vector3, y?: number, z?: number): THREE.Vector3;
69
+ screenCoord2Doc(x: number | THREE.Vector3, y?: number, z?: number): THREE.Vector3;
70
+ docCoord2Screen(x: number | THREE.Vector3, y?: number, z?: number): THREE.Vector3;
71
+ updateDisplay(): void;
72
+ addWindowsEvent(fun: (type: string, event: any) => number): void;
73
+ isRunningCommand(): boolean;
74
+ zoomW(x1: number, y1: number, x2: number, y2: number, isWorld?: boolean): void;
75
+ showLayer(idLayer: number | string, isShow: boolean, isSketch?: boolean): void;
76
+ acutPrintf(sval: string, ...val: string[]): void;
77
+ getCurrentMxCAD(): MxCADObject;
78
+ getQueryString(name: string): string;
79
+ setIniset(iniObj: object): void;
80
+ upDisplayForLayerData(dataLayers: any): boolean;
81
+ enablStaticLoad(isStaticLoad?: boolean): void;
82
+ setStaticServer(server: string): void;
83
+ initUiDataObject(uiDataObj: any): void;
84
+ loadImageMaterial(imageUrlPath: string, callResult: (material: MeshLambertMaterial) => void): void;
85
+ initMxDbEntityType(userObject: any): void;
86
+ initDynamicCreate(dynCreate: any): void;
87
+ openFile(sFile: string | string[], useWebsocket: boolean): boolean;
88
+ getMxJigCmdManager(): CmdMangerType;
89
+ loadSVG(url: string, color?: ColorType, callResult?: any): void;
90
+ getTHREE(): any;
91
+ }
8
92
  /**
9
93
  * MxFun 模块
10
94
  * 导出库时已实例化,只需要调用实例方法 例如:
@@ -39,7 +123,7 @@ export default class MxFun {
39
123
  */
40
124
  createMxObject({ canvasId, cadFile, callback, isNewFile, useWebsocket, isAutoResize }: {
41
125
  canvasId?: string;
42
- cadFile?: string;
126
+ cadFile?: string | string[];
43
127
  callback?: (mxDraw: MxDrawObject, dom: {
44
128
  canvas: HTMLCanvasElement;
45
129
  canvasParent: CanvasParent;
@@ -350,7 +434,7 @@ export default class MxFun {
350
434
  * console.log(mxcad)
351
435
  * ```
352
436
  */
353
- getCurrentMxCAD(): import("../../types/MxCADObject").MxCADObject;
437
+ getCurrentMxCAD(): MxCADObject;
354
438
  /**
355
439
  * 得到地址栏参数
356
440
  * @param name
@@ -416,33 +500,6 @@ export default class MxFun {
416
500
  * ```
417
501
  */
418
502
  loadImageMaterial(imageUrlPath: string, callResult: (material: MeshLambertMaterial) => void | null): Promise<MeshLambertMaterial | null>;
419
- /**
420
- * 判断点是否在一个闭合的多边形区域。
421
- * @param p
422
- * @return any
423
- * @example
424
- * ``` typescript
425
- * let aryPoint:Array<THREE.Vector3> = [];
426
- * aryPoint.push(new THREE.Vector3(0,0,0));
427
- * aryPoint.push(new THREE.Vector3(0,100,0));
428
- * aryPoint.push(new THREE.Vector3(100,100,0));
429
- * aryPoint.push(new THREE.Vector3(100,0,0));
430
- * let pt:THREE.Vector3 = new THREE.Vector3(150,150);
431
- * if(MxFun.pointInPolyline(pt,aryPoint) ){
432
- * console.log("in");
433
- * }
434
- * ```
435
- */
436
- pointInPolyline(pt: THREE.Vector3, vecPolyline: Array<THREE.Vector3>): boolean;
437
- /**
438
- * 计算多边形区域的面积
439
- * @param p
440
- * @return any
441
- * @example
442
- * ``` typescript
443
- * ```
444
- */
445
- calcArea(aryPoint: Array<THREE.Vector3>): number;
446
503
  /**
447
504
  * 重新打开cad文件,该函数在控件创建完后,需要再次重新打开文件,调用。
448
505
  * @param sFile 打的cad文件路径
@@ -451,7 +508,7 @@ export default class MxFun {
451
508
  * ``` typescript
452
509
  * ```
453
510
  */
454
- openFile(sFile: string, useWebsocket?: boolean): boolean;
511
+ openFile(sFile: string | string[], useWebsocket?: boolean): boolean;
455
512
  /**
456
513
  * 添加一个MxDbEntity实体到当前绘图对象上。
457
514
  * @param ent 实体对象
@@ -496,5 +553,13 @@ export default class MxFun {
496
553
  * @parma callback 回调函数中返回坐标信息
497
554
  * */
498
555
  listenForCoordTip(callback: (coordTip: string) => void): void;
556
+ /**
557
+ * 返回mxfun.min.js中的THREE.JS对象,可以用它来创建mxfun.min.js中THREE对象。
558
+ * */
559
+ getMxFunTHREE(): any;
560
+ /**
561
+ * 返回mxfun.min.js中的ThreeJsTool对象
562
+ * */
563
+ getMxFunThreeTool(): any;
499
564
  }
500
565
  export {};
@@ -1,4 +1,10 @@
1
- import McGeVector3d from '../McGeVector3d';
1
+ import McGePoint3d from '../McGePoint3d';
2
+ import McGePoint3dArray from '../McGePoint3dArray';
3
+ export interface MxassemblyType {
4
+ McGePoint3d: any;
5
+ McGePoint3dArray: any;
6
+ McGeTool: any;
7
+ }
2
8
  /**
3
9
  * Mxassembly 模块
4
10
  * 导出库时已实例化,只需要调用实例方法 例如:
@@ -7,5 +13,8 @@ import McGeVector3d from '../McGeVector3d';
7
13
  */
8
14
  export default class Mxassembly {
9
15
  constructor();
10
- NewMcGeVector3d(): McGeVector3d;
16
+ private mxassembly;
17
+ private initImp;
18
+ NewMcGePoint3d(x?: number, y?: number, z?: number): McGePoint3d;
19
+ NewMcGePoint3dArray(aryPoint?: Array<THREE.Vector3>): McGePoint3dArray;
11
20
  }
@@ -1,5 +1,5 @@
1
- import { MxFunType } from '../../types/MxFun';
2
- import { MxassemblyType } from '../../types/Mxassembly';
1
+ import { MxassemblyType } from '../Mxassembly/Mxassembly';
2
+ import { MxFunType } from '../MxFun/MxFun';
3
3
  import Store from './StoreClass';
4
4
  declare type stateType = {
5
5
  [x: string]: any;
@@ -11,6 +11,9 @@ import MxDbImage from './MxModule/MxDbImage';
11
11
  import MxDbSVG from './MxModule/MxDbSVG';
12
12
  import MxDbSVGText from './MxModule/MxDbSVGText';
13
13
  import MxDbPolyline from './MxModule/MxDbPolyline';
14
+ import MxDb2LineAngularDimension from './MxModule/MxDb2LineAngularDimension';
15
+ import Mx3PointArc from './MxModule/Mx3PointArc';
16
+ import MxDbCoord from './MxModule/MxDbCoord';
14
17
  import MxDbLine from './MxModule/MxDbLine';
15
18
  import MxDbRect from './MxModule/MxDbRect';
16
19
  import MxDbAlignedDimension from './MxModule/MxDbAlignedDimension';
@@ -19,11 +22,16 @@ import McGiWorldDraw from './MxModule/McGiWorldDraw';
19
22
  import McGiWorldDrawType from './MxModule/McGiWorldDrawType';
20
23
  import MxType from './MxModule/MxType';
21
24
  import Mxassembly from './MxModule/Mxassembly';
22
- import McGeVector3d from './MxModule/McGeVector3d';
23
- export { MxFun, Mxassembly, MxThreeJS, McEdGetPointWorldDrawObject, MrxDbgUiPrPoint, McGeVector3d, MxDbEntity, MxFilters, MxDbImage, MxDbLine, MxDbSVG, MxDbSVGText, MxDbPolyline, MxDbRect, MxDbAlignedDimension, useCanvasResizeListener, loadCoreCode, store, McGiWorldDraw, McGiWorldDrawType, MrxDbgUiPrBaseReturn, MxType };
25
+ import MxDbArea from './MxModule/MxDbArea';
26
+ import MxDbAnyLine from './MxModule/MxDbAnyLine';
27
+ import McGePoint3d from './MxModule/McGePoint3d';
28
+ import McGePoint3dArray from './MxModule/McGePoint3dArray';
29
+ import McGeTool from './MxModule/McGeTool';
30
+ export { MxFun, Mxassembly, MxThreeJS, McEdGetPointWorldDrawObject, MrxDbgUiPrPoint, McGePoint3d, McGePoint3dArray, McGeTool, MxDbEntity, MxFilters, MxDbImage, MxDbLine, MxDbSVG, MxDbSVGText, MxDbPolyline, Mx3PointArc, MxDbCoord, MxDb2LineAngularDimension, MxDbRect, MxDbAlignedDimension, useCanvasResizeListener, loadCoreCode, store, McGiWorldDraw, McGiWorldDrawType, MrxDbgUiPrBaseReturn, MxType, MxDbArea, MxDbAnyLine };
24
31
  declare const _default: {
25
32
  MxFun: import("./doc").MxFun;
26
33
  Mxassembly: import("./MxModule/Mxassembly/Mxassembly").default;
34
+ McGeTool: import("./MxModule/McGeTool/McGeTool").default;
27
35
  MxThreeJS: import("./doc").MxThreeJS;
28
36
  McEdGetPointWorldDrawObject: typeof McEdGetPointWorldDrawObject;
29
37
  MrxDbgUiPrPoint: typeof MrxDbgUiPrPoint;
@@ -34,17 +42,22 @@ declare const _default: {
34
42
  MxDbSVG: typeof MxDbSVG;
35
43
  MxDbSVGText: typeof MxDbSVGText;
36
44
  MxDbPolyline: typeof MxDbPolyline;
45
+ Mx3PointArc: typeof Mx3PointArc;
46
+ MxDbCoord: typeof MxDbCoord;
47
+ MxDb2LineAngularDimension: typeof MxDb2LineAngularDimension;
37
48
  MxDbRect: typeof MxDbRect;
38
49
  MxDbAlignedDimension: typeof MxDbAlignedDimension;
39
50
  useCanvasResizeListener: typeof useCanvasResizeListener;
40
51
  loadCoreCode: typeof loadCoreCode;
41
52
  store: import("./MxModule/store/StoreClass").default<{
42
53
  [x: string]: any;
43
- MxFun: import("./types/MxFun").MxFunType | null;
44
- Mxassembly: import("./types/Mxassembly").MxassemblyType | null;
54
+ MxFun: import("./MxModule/MxFun/MxFun").MxFunType | null;
55
+ Mxassembly: import("./MxModule/Mxassembly/Mxassembly").MxassemblyType | null;
45
56
  isCreateDrawObj: boolean;
46
57
  }>;
47
58
  MrxDbgUiPrBaseReturn: typeof MrxDbgUiPrBaseReturn;
48
59
  McGiWorldDrawType: typeof McGiWorldDrawType;
60
+ MxDbArea: typeof MxDbArea;
61
+ MxDbAnyLine: typeof MxDbAnyLine;
49
62
  };
50
63
  export default _default;
@@ -1,4 +1,4 @@
1
- import { Vector3 } from 'three';
1
+ import { Vector3, Color, Line } from 'three';
2
2
  /**
3
3
  * 移动geometry坐标。
4
4
  * @param geometry Three的Geometry对象
@@ -28,3 +28,30 @@ export declare function getToGenerateRoundedCorners(points: THREE.Vector3[], cor
28
28
  * @param pt3 点3
29
29
  * */
30
30
  export declare function computeRectPoints(pt1: Vector3, pt3: Vector3): Vector3[];
31
+ /**
32
+ * 计算圆弧任意点到原点的的各种角度
33
+ * @param pt1 圆弧任意一点
34
+ * @param origin 原点(圆心点)
35
+ * @param radius 半径
36
+ */
37
+ export declare function calculateArcAngle(pt1: Vector3, origin: Vector3, radius: number): {
38
+ sin: number;
39
+ cos: number;
40
+ angle: number;
41
+ };
42
+ /**
43
+ * 三点创建圆弧
44
+ * @param pt1 开始点
45
+ * @param pt2 圆弧任意一点
46
+ * @param pt3 结束点
47
+ * @param isRule 默认 false pt1是圆弧起始点 pt2圆弧任意一点 pt3是圆弧结束点 否则 pt1是圆弧起始点 pt2是圆弧结束点 pt3是圆弧任意一点
48
+ * @param alwaysClockwise 默认 false 圆弧根据三个点的角度关系自动确定是顺时针渲染函数逆时针方向渲染 否则为true始终顺时针方向渲染
49
+ * @param color 颜色值
50
+ */
51
+ export declare function createThreePointArc(pt1: Vector3, pt2: Vector3, pt3: Vector3, isRule?: boolean, alwaysClockwise?: boolean, color?: Color): {
52
+ arc: Line;
53
+ radius: number;
54
+ angle: number;
55
+ arcLength: number;
56
+ };
57
+ export declare function createAnyLine(points: Vector3[]): Line;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mxdraw",
3
- "version": "0.1.21",
3
+ "version": "0.1.25",
4
4
  "description": "",
5
5
  "keywords": [],
6
6
  "main": "dist/mxdraw.umd.js",
@@ -25,7 +25,7 @@
25
25
  "lint": "tslint --project tsconfig.json -t codeFrame 'src/**/*.ts' 'test/**/*.ts'",
26
26
  "prebuild": "rimraf dist",
27
27
  "build": "tsc --module commonjs && rollup -c rollup.config.ts && typedoc --out docs && node compress",
28
- "builddebug": "tsc --module commonjs && rollup -c rollup.config.ts && typedoc --out docs",
28
+ "builddebug": "tsc --module commonjs && rollup -c rollup.config.ts",
29
29
  "oldDocs": "typedoc --out docs --target es6 --theme minimal --mode file src",
30
30
  "docs": "npm run patch && npm run doctoc && typedoc --out docs",
31
31
  "start": "rollup -c rollup.config.ts -w",
@@ -117,6 +117,7 @@
117
117
  "rollup-plugin-node-resolve": "^3.4.0",
118
118
  "rollup-plugin-sizes": "^1.0.4",
119
119
  "rollup-plugin-sourcemaps": "^0.4.2",
120
+ "rollup-plugin-terser": "^7.0.2",
120
121
  "rollup-plugin-typescript2": "^0.31.1",
121
122
  "rollup-plugin-visualizer": "^5.5.2",
122
123
  "semantic-release": "^15.9.16",
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,3 +0,0 @@
1
- "use strict";
2
- /** @module MrxDbgUiPrPointClass */
3
- Object.defineProperty(exports, "__esModule", { value: true });