mxdraw 0.1.19 → 0.1.24

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 (112) 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 -2
  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 -158
  16. package/dist/lib/MxModule/MrxDbgUiPrPoint/index.js +1 -5
  17. package/dist/lib/MxModule/MxDbAlignedDimension/MxDbAlignedDimension.js +1 -213
  18. package/dist/lib/MxModule/MxDbAlignedDimension/index.js +1 -5
  19. package/dist/lib/MxModule/MxDbArea/MxDbArea.js +1 -0
  20. package/dist/lib/MxModule/MxDbArea/index.js +1 -0
  21. package/dist/lib/MxModule/MxDbEntity/MxDbEntity.js +1 -258
  22. package/dist/lib/MxModule/MxDbEntity/index.js +1 -5
  23. package/dist/lib/MxModule/MxDbImage/MxDbImage.js +1 -160
  24. package/dist/lib/MxModule/MxDbImage/index.js +1 -5
  25. package/dist/lib/MxModule/MxDbLine/MxDbLine.js +1 -94
  26. package/dist/lib/MxModule/MxDbLine/index.js +1 -5
  27. package/dist/lib/MxModule/MxDbPolyline/MxDbPolyline.js +1 -97
  28. package/dist/lib/MxModule/MxDbPolyline/index.js +1 -5
  29. package/dist/lib/MxModule/MxDbRect/MxDbRect.js +1 -273
  30. package/dist/lib/MxModule/MxDbRect/index.js +1 -4
  31. package/dist/lib/MxModule/MxDbSVG/MxDbSVG.js +1 -413
  32. package/dist/lib/MxModule/MxDbSVG/index.js +1 -5
  33. package/dist/lib/MxModule/MxDbSVGText/MxDbSVGText.js +1 -15
  34. package/dist/lib/MxModule/MxDbSVGText/index.js +1 -5
  35. package/dist/lib/MxModule/MxDrawObject/MxDrawObject.js +1 -782
  36. package/dist/lib/MxModule/MxDrawObject/index.js +1 -5
  37. package/dist/lib/MxModule/MxFilters/MxFilters.js +1 -201
  38. package/dist/lib/MxModule/MxFilters/index.js +1 -4
  39. package/dist/lib/MxModule/MxFun/MxFun.js +1 -676
  40. package/dist/lib/MxModule/MxFun/index.js +1 -9
  41. package/dist/lib/MxModule/MxThreeJS/MxThreeJS.js +1 -278
  42. package/dist/lib/MxModule/MxThreeJS/MxThreeJS.mixin.js +1 -146
  43. package/dist/lib/MxModule/MxThreeJS/index.js +1 -7
  44. package/dist/lib/MxModule/MxType/MxType.js +1 -27
  45. package/dist/lib/MxModule/MxType/index.js +1 -4
  46. package/dist/lib/MxModule/Mxassembly/Mxassembly.js +1 -18
  47. package/dist/lib/MxModule/Mxassembly/index.js +1 -9
  48. package/dist/lib/MxModule/loadCoreCode/index.js +1 -5
  49. package/dist/lib/MxModule/loadCoreCode/loadCoreCode.js +1 -125
  50. package/dist/lib/MxModule/loadCoreCode/mxUiData.js +1 -312
  51. package/dist/lib/MxModule/loadCoreCode/mxcadassembly_es5.js +1 -1519
  52. package/dist/lib/MxModule/loadCoreCode/mxfun.es5.js +1 -7363
  53. package/dist/lib/MxModule/store/PubsubClass.js +1 -40
  54. package/dist/lib/MxModule/store/StoreClass.js +1 -73
  55. package/dist/lib/MxModule/store/index.js +1 -19
  56. package/dist/lib/MxModule/store/store.js +1 -25
  57. package/dist/lib/MxModule/useCanvasResizeListener/index.js +1 -5
  58. package/dist/lib/MxModule/useCanvasResizeListener/useCanvasResizeListener.js +1 -95
  59. package/dist/lib/doc.js +1 -38
  60. package/dist/lib/mxdraw.js +1 -67
  61. package/dist/lib/tools/algorithm/math.js +1 -16
  62. package/dist/lib/tools/algorithm/random.js +1 -13
  63. package/dist/lib/tools/dom/create.js +1 -47
  64. package/dist/lib/tools/dynamicImport/index.js +1 -243
  65. package/dist/lib/tools/formatting/index.js +1 -20
  66. package/dist/lib/tools/proxy/index.js +1 -17
  67. package/dist/lib/tools/three/index.js +1 -124
  68. package/dist/mxdraw.es5.js +1 -0
  69. package/dist/mxdraw.umd.js +1 -0
  70. package/dist/types/MxModule/McEdGetPointWorldDrawObject/McEdGetPointWorldDrawObjectClass.d.ts +10 -1
  71. package/dist/types/MxModule/McGePoint3d/McGePoint3d.d.ts +11 -0
  72. package/dist/types/MxModule/McGePoint3d/index.d.ts +3 -0
  73. package/dist/types/MxModule/McGePoint3dArray/McGePoint3dArray.d.ts +14 -0
  74. package/dist/types/MxModule/McGePoint3dArray/index.d.ts +3 -0
  75. package/dist/types/MxModule/McGeTool/McGeTool.d.ts +38 -0
  76. package/dist/types/MxModule/McGeTool/index.d.ts +4 -0
  77. package/dist/types/MxModule/McGiWorldDraw/McGiWorldDraw.d.ts +1 -1
  78. package/dist/types/MxModule/MrxDbgUiPrPoint/MrxDbgUiPrPointClass.d.ts +18 -1
  79. package/dist/types/MxModule/MxDbArea/MxDbArea.d.ts +17 -0
  80. package/dist/types/MxModule/MxDbArea/index.d.ts +3 -0
  81. package/dist/types/MxModule/MxDbEntity/MxDbEntity.d.ts +1 -1
  82. package/dist/types/MxModule/MxDbSVG/MxDbSVG.d.ts +1 -1
  83. package/dist/types/MxModule/MxDbSVGText/MxDbSVGText.d.ts +1 -1
  84. package/dist/types/MxModule/MxDrawObject/MxDrawObject.d.ts +70 -1
  85. package/dist/types/MxModule/MxFun/MxFun.d.ts +93 -28
  86. package/dist/types/MxModule/MxThreeJS/MxThreeJS.d.ts +2 -1
  87. package/dist/types/MxModule/MxType/MxType.d.ts +1 -0
  88. package/dist/types/MxModule/Mxassembly/Mxassembly.d.ts +11 -2
  89. package/dist/types/MxModule/store/StoreClass.d.ts +10 -4
  90. package/dist/types/MxModule/store/store.d.ts +4 -4
  91. package/dist/types/mxdraw.d.ts +13 -3
  92. package/package.json +3 -2
  93. package/dist/lib/MxModule/McGeVector3d/McGeVector3d.js +0 -2
  94. package/dist/lib/MxModule/McGeVector3d/index.js +0 -3
  95. package/dist/lib/MxModule/MxThreeJS/SVGLoader.js +0 -1862
  96. package/dist/lib/types/McEdGetPointWorldDrawObject.js +0 -2
  97. package/dist/lib/types/MrxDbgUiPrPoint.js +0 -2
  98. package/dist/lib/types/MxCADObject.js +0 -2
  99. package/dist/lib/types/MxDrawObject.js +0 -2
  100. package/dist/lib/types/MxFun.js +0 -2
  101. package/dist/lib/types/Mxassembly.js +0 -2
  102. package/dist/lib/types/index.js +0 -2
  103. package/dist/types/MxModule/McGeVector3d/McGeVector3d.d.ts +0 -17
  104. package/dist/types/MxModule/McGeVector3d/index.d.ts +0 -3
  105. package/dist/types/MxModule/MxThreeJS/SVGLoader.d.ts +0 -22
  106. package/dist/types/types/McEdGetPointWorldDrawObject.d.ts +0 -9
  107. package/dist/types/types/MrxDbgUiPrPoint.d.ts +0 -23
  108. package/dist/types/types/MxCADObject.d.ts +0 -40
  109. package/dist/types/types/MxDrawObject.d.ts +0 -60
  110. package/dist/types/types/MxFun.d.ts +0 -41
  111. package/dist/types/types/Mxassembly.d.ts +0 -3
  112. package/dist/types/types/index.d.ts +0 -1
@@ -1,5 +1,14 @@
1
1
  /** @module McEdGetPointWorldDrawObject*/
2
- import { ColorType } from '@/types';
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,7 +1,7 @@
1
1
  /** @module McGiWorldDraw*/
2
- import { ColorType } from '@/types';
3
2
  import McGiWorldDrawType from '../McGiWorldDrawType';
4
3
  import MxDrawObject from '../MxDrawObject';
4
+ import { ColorType } from '../MxType/MxType';
5
5
  /**
6
6
  * McGiWorldDraw 用于构建一个动态绘制回调对象的规范接口
7
7
  * @abstract 是 {@link MxDbEntity.worldDraw }必须实现的抽象回调方法中的回调对象 通过回调对象完成一些动态绘制任务
@@ -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,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
+ aryPoint: 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;
@@ -1,7 +1,7 @@
1
1
  /** @module MxDbEntity*/
2
- import { ColorType } from '@/types';
3
2
  import McGiWorldDraw from '../McGiWorldDraw';
4
3
  import MxDrawObject from '../MxDrawObject';
4
+ import { ColorType } from '../MxType/MxType';
5
5
  /**
6
6
  * MxDbEntity 用于构建一个自定义对象的抽象类(该类无法实例化 请通过继承的方式对其抽象方法进行实现)
7
7
  * @description MxDbEntity 属于 abstract class(抽象类) 主要用途是通过继承这个类实现一个用于动态绘制的回调对象
@@ -1,9 +1,9 @@
1
1
  /** @module MxDbSVG*/
2
- import { ColorType } from '@/types';
3
2
  import * as THREE from 'three';
4
3
  import McGiWorldDraw from '../McGiWorldDraw';
5
4
  import MxDbEntity from '../MxDbEntity';
6
5
  import MxDbSVGText from '../MxDbSVGText';
6
+ import { ColorType } from '../MxType/MxType';
7
7
  /**
8
8
  * MxDbSVG SVG对象.
9
9
  */
@@ -1,6 +1,6 @@
1
1
  /** @module MxDbSVG*/
2
- import { ColorType } from '@/types';
3
2
  import * as THREE from 'three';
3
+ import { ColorType } from '../MxType/MxType';
4
4
  export default class MxDbSVGText {
5
5
  txtPos: THREE.Vector3;
6
6
  txt: string;
@@ -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, 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, 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
  * 导出库时已实例化,只需要调用实例方法 例如:
@@ -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文件路径
@@ -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,5 +1,5 @@
1
- import { ColorType } from '@/types';
2
1
  import { Vector3, Line, Object3D, Points, Sprite, Mesh, MeshBasicMaterial } from 'three';
2
+ declare type ColorType = number | string | THREE.Color;
3
3
  /**
4
4
  * MxThreeJS 模块
5
5
  * ##### 使用说明:
@@ -166,3 +166,4 @@ export default class MxThreeJS {
166
166
  */
167
167
  loadSVG(url: string, color?: ColorType, callResult?: (threeobj: Object3D, aryMeterial: Array<MeshBasicMaterial>) => void): Promise<THREE.Object3D | null>;
168
168
  }
169
+ export {};
@@ -17,6 +17,7 @@ declare enum MxCloneType2 {
17
17
  /** 动态拖动Clone */
18
18
  kDragClone = 2
19
19
  }
20
+ export declare type ColorType = number | string | THREE.Color;
20
21
  declare const _default: {
21
22
  MxCloneType: typeof MxCloneType;
22
23
  MxCloneType2: typeof MxCloneType2;
@@ -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
  }
@@ -6,12 +6,18 @@ export default class Store<T> {
6
6
  mutations: {
7
7
  [x: string | number]: Function;
8
8
  };
9
- state: {
10
- [x: string | number]: any;
11
- };
9
+ state: T;
12
10
  status: string;
13
11
  events: PubSub;
14
- constructor(params: T | any);
12
+ constructor(params: {
13
+ state: T;
14
+ mutations: {
15
+ [x: string | number]: Function;
16
+ };
17
+ actions: {
18
+ [x: string | number]: Function;
19
+ };
20
+ });
15
21
  /**
16
22
  * 调用active方法 触发修改状态前的异步行为
17
23
  * @param actionKey 方法名称
@@ -1,11 +1,11 @@
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
- export declare type stateType = {
4
+ declare type stateType = {
5
5
  [x: string]: any;
6
6
  MxFun: MxFunType | null;
7
7
  Mxassembly: MxassemblyType | null;
8
8
  isCreateDrawObj: boolean;
9
9
  };
10
- declare const _default: Store<unknown>;
10
+ declare const _default: Store<stateType>;
11
11
  export default _default;
@@ -19,11 +19,15 @@ import McGiWorldDraw from './MxModule/McGiWorldDraw';
19
19
  import McGiWorldDrawType from './MxModule/McGiWorldDrawType';
20
20
  import MxType from './MxModule/MxType';
21
21
  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 };
22
+ import MxDbArea from './MxModule/MxDbArea';
23
+ import McGePoint3d from './MxModule/McGePoint3d';
24
+ import McGePoint3dArray from './MxModule/McGePoint3dArray';
25
+ import McGeTool from './MxModule/McGeTool';
26
+ export { MxFun, Mxassembly, MxThreeJS, McEdGetPointWorldDrawObject, MrxDbgUiPrPoint, McGePoint3d, McGePoint3dArray, McGeTool, MxDbEntity, MxFilters, MxDbImage, MxDbLine, MxDbSVG, MxDbSVGText, MxDbPolyline, MxDbRect, MxDbAlignedDimension, useCanvasResizeListener, loadCoreCode, store, McGiWorldDraw, McGiWorldDrawType, MrxDbgUiPrBaseReturn, MxType, MxDbArea };
24
27
  declare const _default: {
25
28
  MxFun: import("./doc").MxFun;
26
29
  Mxassembly: import("./MxModule/Mxassembly/Mxassembly").default;
30
+ McGeTool: import("./MxModule/McGeTool/McGeTool").default;
27
31
  MxThreeJS: import("./doc").MxThreeJS;
28
32
  McEdGetPointWorldDrawObject: typeof McEdGetPointWorldDrawObject;
29
33
  MrxDbgUiPrPoint: typeof MrxDbgUiPrPoint;
@@ -38,8 +42,14 @@ declare const _default: {
38
42
  MxDbAlignedDimension: typeof MxDbAlignedDimension;
39
43
  useCanvasResizeListener: typeof useCanvasResizeListener;
40
44
  loadCoreCode: typeof loadCoreCode;
41
- store: import("./MxModule/store/StoreClass").default<unknown>;
45
+ store: import("./MxModule/store/StoreClass").default<{
46
+ [x: string]: any;
47
+ MxFun: import("./MxModule/MxFun/MxFun").MxFunType | null;
48
+ Mxassembly: import("./MxModule/Mxassembly/Mxassembly").MxassemblyType | null;
49
+ isCreateDrawObj: boolean;
50
+ }>;
42
51
  MrxDbgUiPrBaseReturn: typeof MrxDbgUiPrBaseReturn;
43
52
  McGiWorldDrawType: typeof McGiWorldDrawType;
53
+ MxDbArea: typeof MxDbArea;
44
54
  };
45
55
  export default _default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mxdraw",
3
- "version": "0.1.19",
3
+ "version": "0.1.24",
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 });