mxdraw 0.1.21 → 0.1.22
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/dist/lib/MxModule/McGeVector3d/McGeVector3d.js +1 -0
- package/dist/lib/MxModule/MxFun/MxFun.js +7 -0
- package/dist/lib/MxModule/MxThreeJS/MxThreeJS.js +16 -3
- package/dist/lib/MxModule/MxThreeJS/MxThreeJS.mixin.js +0 -117
- package/dist/lib/MxModule/loadCoreCode/mxfun.es5.js +1131 -734
- package/dist/types/MxModule/McEdGetPointWorldDrawObject/McEdGetPointWorldDrawObjectClass.d.ts +9 -0
- package/dist/types/MxModule/McGeVector3d/McGeVector3d.d.ts +1 -0
- package/dist/types/MxModule/MrxDbgUiPrPoint/MrxDbgUiPrPointClass.d.ts +18 -1
- package/dist/types/MxModule/MxDrawObject/MxDrawObject.d.ts +59 -1
- package/dist/types/MxModule/MxFun/MxFun.d.ts +91 -1
- package/dist/types/MxModule/Mxassembly/Mxassembly.d.ts +3 -0
- package/dist/types/MxModule/store/store.d.ts +2 -2
- package/dist/types/mxdraw.d.ts +2 -2
- package/package.json +1 -1
- package/dist/lib/MxModule/MxThreeJS/SVGLoader.js +0 -1862
- package/dist/lib/types/McEdGetPointWorldDrawObject.js +0 -2
- package/dist/lib/types/MrxDbgUiPrPoint.js +0 -2
- package/dist/lib/types/MxCADObject.js +0 -2
- package/dist/lib/types/MxDrawObject.js +0 -2
- package/dist/lib/types/MxFun.js +0 -2
- package/dist/lib/types/Mxassembly.js +0 -2
- package/dist/types/MxModule/MxThreeJS/SVGLoader.d.ts +0 -22
- package/dist/types/types/McEdGetPointWorldDrawObject.d.ts +0 -9
- package/dist/types/types/MrxDbgUiPrPoint.d.ts +0 -23
- package/dist/types/types/MxCADObject.d.ts +0 -40
- package/dist/types/types/MxDrawObject.d.ts +0 -60
- package/dist/types/types/MxFun.d.ts +0 -47
- package/dist/types/types/Mxassembly.d.ts +0 -3
package/dist/types/MxModule/McEdGetPointWorldDrawObject/McEdGetPointWorldDrawObjectClass.d.ts
CHANGED
|
@@ -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
|
|
@@ -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
|
|
@@ -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
|
|
@@ -2,9 +2,95 @@ 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
|
+
pointInPolyline(pt: THREE.Vector3, vecPolyline: Array<THREE.Vector3>): boolean;
|
|
86
|
+
calcArea(aryPoint: Array<THREE.Vector3>): number;
|
|
87
|
+
initMxDbEntityType(userObject: any): void;
|
|
88
|
+
initDynamicCreate(dynCreate: any): void;
|
|
89
|
+
openFile(sFile: string, useWebsocket: boolean): boolean;
|
|
90
|
+
getMxJigCmdManager(): CmdMangerType;
|
|
91
|
+
loadSVG(url: string, color?: ColorType, callResult?: any): void;
|
|
92
|
+
getTHREE(): any;
|
|
93
|
+
}
|
|
8
94
|
/**
|
|
9
95
|
* MxFun 模块
|
|
10
96
|
* 导出库时已实例化,只需要调用实例方法 例如:
|
|
@@ -350,7 +436,7 @@ export default class MxFun {
|
|
|
350
436
|
* console.log(mxcad)
|
|
351
437
|
* ```
|
|
352
438
|
*/
|
|
353
|
-
getCurrentMxCAD():
|
|
439
|
+
getCurrentMxCAD(): MxCADObject;
|
|
354
440
|
/**
|
|
355
441
|
* 得到地址栏参数
|
|
356
442
|
* @param name
|
|
@@ -496,5 +582,9 @@ export default class MxFun {
|
|
|
496
582
|
* @parma callback 回调函数中返回坐标信息
|
|
497
583
|
* */
|
|
498
584
|
listenForCoordTip(callback: (coordTip: string) => void): void;
|
|
585
|
+
/**
|
|
586
|
+
* 返回mxfun.min.js中的THREE.JS对象,可以用它来创建mxfun.min.js中THREE对象。
|
|
587
|
+
* */
|
|
588
|
+
getMxFunTHREE(): any;
|
|
499
589
|
}
|
|
500
590
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
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;
|
package/dist/types/mxdraw.d.ts
CHANGED
|
@@ -40,8 +40,8 @@ declare const _default: {
|
|
|
40
40
|
loadCoreCode: typeof loadCoreCode;
|
|
41
41
|
store: import("./MxModule/store/StoreClass").default<{
|
|
42
42
|
[x: string]: any;
|
|
43
|
-
MxFun: import("./
|
|
44
|
-
Mxassembly: import("./
|
|
43
|
+
MxFun: import("./MxModule/MxFun/MxFun").MxFunType | null;
|
|
44
|
+
Mxassembly: import("./MxModule/Mxassembly/Mxassembly").MxassemblyType | null;
|
|
45
45
|
isCreateDrawObj: boolean;
|
|
46
46
|
}>;
|
|
47
47
|
MrxDbgUiPrBaseReturn: typeof MrxDbgUiPrBaseReturn;
|