mxdraw 0.1.32 → 0.1.35
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/README.md +43 -64
- package/dist/lib/MxModule/MxDbDatabase/MxDbDatabase.js +1 -0
- package/dist/lib/MxModule/MxDbDatabase/index.js +1 -0
- package/dist/lib/MxModule/MxDbEntity/MxDbEntity.js +1 -1
- package/dist/lib/MxModule/MxDbLayerTableRecord/MxDbLayerTableRecord.js +1 -0
- package/dist/lib/MxModule/MxDbLayerTableRecord/index.js +1 -0
- package/dist/lib/MxModule/MxDbSVG/MxDbSVG.js +1 -1
- package/dist/lib/MxModule/MxDrawObject/MxDrawObject.js +1 -1
- package/dist/lib/MxModule/MxFun/MxFun.js +1 -1
- package/dist/lib/MxModule/loadCoreCode/mxfun.es5.js +1 -1
- package/dist/lib/doc.js +1 -1
- package/dist/lib/mxdraw.js +1 -1
- package/dist/mxdraw.es5.js +1 -1
- package/dist/mxdraw.umd.js +1 -1
- package/dist/types/MxModule/MxDbDatabase/MxDbDatabase.d.ts +51 -0
- package/dist/types/MxModule/MxDbDatabase/index.d.ts +3 -0
- package/dist/types/MxModule/MxDbEntity/MxDbEntity.d.ts +11 -0
- package/dist/types/MxModule/MxDbLayerTableRecord/MxDbLayerTableRecord.d.ts +10 -0
- package/dist/types/MxModule/MxDbLayerTableRecord/index.d.ts +3 -0
- package/dist/types/MxModule/MxDrawObject/MxDrawObject.d.ts +17 -0
- package/dist/types/MxModule/MxFun/MxFun.d.ts +9 -0
- package/dist/types/doc.d.ts +3 -1
- package/dist/types/mxdraw.d.ts +3 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -9,7 +9,6 @@
|
|
|
9
9
|
- [Mx模块集](#mx%E6%A8%A1%E5%9D%97%E9%9B%86)
|
|
10
10
|
- [loadCoreCode 动态加载核心(初始化)](#loadcorecode-%E5%8A%A8%E6%80%81%E5%8A%A0%E8%BD%BD%E6%A0%B8%E5%BF%83%E5%88%9D%E5%A7%8B%E5%8C%96)
|
|
11
11
|
- [MxDrawObject 控件对象](#mxdrawobject-%E6%8E%A7%E4%BB%B6%E5%AF%B9%E8%B1%A1)
|
|
12
|
-
- [MxThreeJS 创建THREE图形物体对象](#mxthreejs-%E5%88%9B%E5%BB%BAthree%E5%9B%BE%E5%BD%A2%E7%89%A9%E4%BD%93%E5%AF%B9%E8%B1%A1)
|
|
13
12
|
- [McEdGetPointWorldDrawObject / MrxDbgUiPrPoint / MrxDbgUiPrBaseReturn 动态绘制](#mcedgetpointworlddrawobject--mrxdbguiprpoint--mrxdbguiprbasereturn-%E5%8A%A8%E6%80%81%E7%BB%98%E5%88%B6)
|
|
14
13
|
- [MxDbEntity / McGiWorldDraw / McGiWorldDrawType 自定义对象](#mxdbentity--mcgiworlddraw--mcgiworlddrawtype-%E8%87%AA%E5%AE%9A%E4%B9%89%E5%AF%B9%E8%B1%A1)
|
|
15
14
|
- [按需引入配置](#%E6%8C%89%E9%9C%80%E5%BC%95%E5%85%A5%E9%85%8D%E7%BD%AE)
|
|
@@ -20,7 +19,8 @@
|
|
|
20
19
|
## 快速上手
|
|
21
20
|
### 简介
|
|
22
21
|
#### mxdraw 是什么?
|
|
23
|
-
> mxdraw
|
|
22
|
+
> mxdraw 是个在线CAD的JS库,实现在线CAD,DWG图纸浏览和编辑等功能的一套解决方案, 支持大部分现代主流浏览器比如Chrome、Edge等, 不支持IE浏览器。
|
|
23
|
+
> DWG文件通过后端程序格式转换后[后端程序详见](https://help.mxdraw.com/?pid=111),就可使用mxdraw在线打开。
|
|
24
24
|
#### 使用人群
|
|
25
25
|
> 面向前端开发者 熟悉了解`JavaScript` 并且会使用 `three.js`框架。
|
|
26
26
|
> 如从未接触过three.js建议先阅读[three.js中文文档](http://www.yanhuangxueyuan.com/threejs/docs/index.html#manual/zh/) 后再进行开发使用。
|
|
@@ -51,25 +51,22 @@ import Mx from "mxdraw"
|
|
|
51
51
|
import Mx from "mxdraw"
|
|
52
52
|
// 动态加载 js库核心代码
|
|
53
53
|
Mx.loadCoreCode().then(()=> {
|
|
54
|
-
// 设置服务器地址
|
|
55
|
-
Mx.MxFun.setMxServer("服务器地址")
|
|
56
54
|
// 创建控件对象
|
|
57
55
|
Mx.MxFun.createMxObject({
|
|
58
|
-
canvasId:
|
|
59
|
-
cadFile"
|
|
60
|
-
callback: (
|
|
56
|
+
canvasId:"mxcad", // canvas元素的id
|
|
57
|
+
cadFile:"http://localhost:8088/demo/buf/hhhh.dwg.mxb1.wgh", // 后端程序转换dwg文件后的文件位置。
|
|
58
|
+
callback: (mxDrawObject, {
|
|
61
59
|
canvas,
|
|
62
60
|
canvasParent
|
|
63
61
|
}) => {
|
|
64
62
|
// 可以拿到canvas元素和它的父级元素
|
|
65
|
-
console.log(canvas, canvasParent)
|
|
66
|
-
console.log(
|
|
67
|
-
//
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
})
|
|
71
|
-
}
|
|
72
|
-
isNewFile: true // 是否新建文件
|
|
63
|
+
//console.log(canvas, canvasParent)
|
|
64
|
+
//console.log(mxDrawObject)
|
|
65
|
+
// 图纸加载完成
|
|
66
|
+
mxDrawObject.addEvent("loadComplete", () => {
|
|
67
|
+
console.log("mx loadComplete");
|
|
68
|
+
});
|
|
69
|
+
}
|
|
73
70
|
})
|
|
74
71
|
})
|
|
75
72
|
```
|
|
@@ -81,55 +78,41 @@ Mx.loadCoreCode().then(()=> {
|
|
|
81
78
|
* [MrxDbgUiPrPointClass | getPoint](https://mxtmpweb.mxdraw.f3322.net:3562/mxdrawcloud/classes/MrxDbgUiPrPointClass.html) 构建取点对象
|
|
82
79
|
* [status](https://mxtmpweb.mxdraw.f3322.net:3562/mxdrawcloud/enums/MrxDbgUiPrBaseReturn.html) MrxDbgUiPrBaseReturn 表示对应状态
|
|
83
80
|
* [McEdGetPointWorldDrawObjectClass | pWorldDraw](https://mxtmpweb.mxdraw.f3322.net:3562/mxdrawcloud/classes/McEdGetPointWorldDrawObjectClass.html) 用于构建一个动态绘制回调对象
|
|
84
|
-
* [MxThreeJS](https://mxtmpweb.mxdraw.f3322.net:3562/mxdrawcloud/classes/MxThreeJS.html) three.js基础封装的一些功能
|
|
85
|
-
* [pt1 | pt2 | lastPt](http://www.yanhuangxueyuan.com/threejs/docs/index.html#api/zh/math/Vector3) THREE.Vector3 数据类型
|
|
86
81
|
|
|
87
82
|
``` javascript
|
|
88
83
|
import Mx from "mxdraw"
|
|
89
84
|
// 画线的函数
|
|
90
|
-
function BR_Line() {
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
// 创建一条 从起始点到 当前点击位置的线段
|
|
122
|
-
let line = Mx.MxThreeJS.createLine(lastPt, pt2, 0xffffff);
|
|
123
|
-
|
|
124
|
-
// 将线段添加到场景中
|
|
125
|
-
sence.add(line);
|
|
126
|
-
|
|
127
|
-
// 将第二点作为起始点
|
|
128
|
-
lastPt = pt2
|
|
129
|
-
}
|
|
130
|
-
});
|
|
131
|
-
});
|
|
132
|
-
}
|
|
85
|
+
export async function BR_Line() {
|
|
86
|
+
|
|
87
|
+
// 让用在图上点取直线的开始点.
|
|
88
|
+
const getPoint = new MrxDbgUiPrPoint();
|
|
89
|
+
getPoint.setMessage("\n指定第一点:");
|
|
90
|
+
let pt1:THREE.Vector3|null = await getPoint.go();
|
|
91
|
+
if(pt1 == null){
|
|
92
|
+
return;
|
|
93
|
+
|
|
94
|
+
}
|
|
95
|
+
getPoint.setBasePt(pt1.clone());
|
|
96
|
+
getPoint.setUseBasePt(true);
|
|
97
|
+
getPoint.setMessage("\n指定第二点:");
|
|
98
|
+
|
|
99
|
+
// 让用在图上点取直线的结束点.
|
|
100
|
+
let pt2:THREE.Vector3|null = await getPoint.go();
|
|
101
|
+
if(pt2 == null){
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
// 创建一个直线对象,添加到图上。
|
|
106
|
+
let line = new MxDbLine()
|
|
107
|
+
line.pt1 = pt1;
|
|
108
|
+
line.pt2 = pt2;
|
|
109
|
+
|
|
110
|
+
line.setDashLineDisplay(true);
|
|
111
|
+
line.setLineWidth(10);
|
|
112
|
+
line.setLineWidthByPixels(true);
|
|
113
|
+
|
|
114
|
+
MxFun.addToCurrentSpace(line);
|
|
115
|
+
}
|
|
133
116
|
```
|
|
134
117
|
|
|
135
118
|
|
|
@@ -176,10 +159,6 @@ loadCoreCode().then(()=> {
|
|
|
176
159
|
### MxDrawObject 控件对象
|
|
177
160
|
> [MxFun.createMxObject](https://mxtmpweb.mxdraw.f3322.net:3562/mxdrawcloud/classes/MxFun.html#createMxObject) 创建的控件对象可以对canvas画布上展示的图纸进行控制修改以及添加three.js中各种组合图形等功能[详情](https://mxtmpweb.mxdraw.f3322.net:3562/mxdrawcloud/classes/MxDrawObject.html)
|
|
178
161
|
|
|
179
|
-
### MxThreeJS 创建THREE图形物体对象
|
|
180
|
-
> [MxThreeJS](https://mxtmpweb.mxdraw.f3322.net:3562/mxdrawcloud/classes/MxThreeJS.html)是根据Three.js提供的APi 创建各种常见的基础图形文字以及加载的图片/SVG等的方法集合
|
|
181
|
-
* 一般情况最终创建返回的都是基于THREE.Object3D的物体对象,可以通过[MxDrawObject控件对象的addObject](https://mxtmpweb.mxdraw.f3322.net:3562/mxdrawcloud/classes/MxDrawObject.html#addObject) 方法添加到场景中,最后通过[MxDrawObject.updateDisplay](https://mxtmpweb.mxdraw.f3322.net:3562/mxdrawcloud/classes/MxDrawObject.html#updateDisplay)更新显示场景,就可以将物体对象渲染到canvas画布上了。
|
|
182
|
-
* 当然也可以不使用MxThreeJS提供的创建物体的方式,可以用three.js自定义创建各种需要的物体图形模型。
|
|
183
162
|
|
|
184
163
|
### McEdGetPointWorldDrawObject / MrxDbgUiPrPoint / MrxDbgUiPrBaseReturn 动态绘制
|
|
185
164
|
* [McEdGetPointWorldDrawObject](https://mxtmpweb.mxdraw.f3322.net:3562/mxdrawcloud/classes/McEdGetPointWorldDrawObject.html)是动态绘制对象的类, 一个McEdGetPointWorldDrawObject实例可以使用setDraw方法设置动态的回调函数,一般情况下回调函数中会通过drawCustomEntity或者提供的其他方法绘制出需要动态绘制的部分(鼠标移动将会触发动态回调函数)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var MxDbDatabase=function(){function t(t){this._mxDatabase=t}return t.prototype.addLayer=function(t){return this._mxDatabase.addLayer(t)},t.prototype.showLayer=function(t,e){this._mxDatabase.showLayer(t,e)},t.prototype.setCurrentLayer=function(t){return this._mxDatabase.setCurrentLayer(t)},t.prototype.getLayer=function(t){return this._mxDatabase.getLayer(t)},t.prototype.addEntity=function(t){return this._mxDatabase.addMxEntity(t)},t}();exports.default=MxDbDatabase;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var MxDbDatabase_1=require("./MxDbDatabase");exports.default=MxDbDatabase_1.default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var MxType_1=require("../MxType"),store_1=require("../store/store"),MxDbEntity=function(){function t(){this.color=16777215,this.renderOrder=30,this.opacity=1,this.visible=!0,this.userData={},this.dLineWidth=0,this.lineWidthByPixels=!0,this.dDashArray=0,this.dDashRatio=0}return t.prototype.dwgInHelp=function(t,e){var i=function(t){return"object"==typeof t?function(t){return!!(t.isVector3||t.isVector2||t.isVector4)}(t)?t.clone():n(t,Object.create(null)):t instanceof Array?r(t):t},r=function(t){return t.map(function(t){return i(t)})},n=function(t,e){for(var r in t)t[r]&&(e[r]=i(t[r]));return e},o=this;return e.forEach(function(e){t[e]&&(o[e]=i(t[e]))}),!0},t.prototype.dwgOutHelp=function(t,e){var i=this;return e.forEach(function(e){t[e]=i[e]}),t},t.prototype.getTypeName=function(){return this.constructor.name},t.prototype.create=function(){return new(0,this.constructor)},t.prototype.transformBy=function(t){},t.prototype.getImp=function(){return this.MxDbEntityImp},t.prototype.setNeedUpdateDisplay=function(t){var e=this.getImp();return!!e&&(t?e.upDisplay():e.setDirtyDisplay(!0),!0)},t.prototype.getMxObject=function(){var t=this.getImp();return t?t.getMxObject():null},t.prototype.onViewChange=function(){return!1},t.prototype.objectId=function(){var t=this.getImp();return t?t.objectId():0},t.prototype.erase=function(){var t=this.getImp();return!!t&&t.erase()},t.prototype.setColor=function(t){this.color=t},t.prototype.getColor=function(){return this.color},t.prototype.clone=function(t){var e=this.create(),i={type:t||MxType_1.default.MxCloneType.kClone};return this.dwgOut(i),e.dwgIn(i),e},t.prototype.onDwgIn=function(t){this.color=t.color,this.renderOrder=t.renderOrder,this.opacity=t.opacity,this.visible=t.visible,t.userData?this.userData=JSON.parse(JSON.stringify(t.userData)):this.userData={},this.dLineWidth=t.lineWidth,this.lineWidthByPixels=t.lineWidthByPixels,this.dDashArray=t.dashArray,this.dDashRatio=t.dashRatio},t.prototype.onDwgOut=function(t){t.color=this.color,t.renderOrder=this.renderOrder,t.opacity=this.opacity,t.visible=this.visible,Object.keys(this.userData).length>0&&(t.userData=this.userData),t.lineWidth=this.dLineWidth,t.lineWidthByPixels=this.lineWidthByPixels,t.dashArray=this.dDashArray,t.dashRatio=this.dDashRatio},t.prototype.rxInit=function(){store_1.default.state.MxFun.initMxDbEntityType(this)},t.prototype.setRenderOrder=function(t){this.renderOrder=t},t.prototype.getRenderOrder=function(){return this.renderOrder},t.prototype.setDash=function(t,e){this.dDashArray=t,this.dDashRatio=e,0==this.dLineWidth&&(this.dLineWidth=6,this.lineWidthByPixels=!0)},t.prototype.getDash=function(){return{dDashArray:this.dDashArray,dDashRatio:this.dDashRatio}},t.prototype.setDashLineDisplay=function(t){t?(this.dDashArray=.03,this.dDashRatio=.1,0==this.dLineWidth&&(this.dLineWidth=6,this.lineWidthByPixels=!0)):(this.dDashArray=0,this.dDashRatio=0)},t.prototype.isDashLineDisplay=function(){return this.dDashArray>0&&this.dDashRatio>0},t.prototype.setLineWidthByPixels=function(t){this.lineWidthByPixels=t},t.prototype.getLineWidthByPixels=function(){return this.lineWidthByPixels},t.prototype.setLineWidth=function(t){this.dLineWidth=t},t.prototype.getLineWidth=function(){return this.dLineWidth},t}();exports.default=MxDbEntity;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var MxType_1=require("../MxType"),store_1=require("../store/store"),MxDbEntity=function(){function t(){this.color=16777215,this.renderOrder=30,this.opacity=1,this.visible=!0,this.userData={},this.dLineWidth=0,this.lineWidthByPixels=!0,this.dDashArray=0,this.dDashRatio=0,this.layer=""}return t.prototype.dwgInHelp=function(t,e){var i=function(t){return"object"==typeof t?function(t){return!!(t.isVector3||t.isVector2||t.isVector4)}(t)?t.clone():n(t,Object.create(null)):t instanceof Array?r(t):t},r=function(t){return t.map(function(t){return i(t)})},n=function(t,e){for(var r in t)t[r]&&(e[r]=i(t[r]));return e},o=this;return e.forEach(function(e){t[e]&&(o[e]=i(t[e]))}),!0},t.prototype.dwgOutHelp=function(t,e){var i=this;return e.forEach(function(e){t[e]=i[e]}),t},t.prototype.getTypeName=function(){return this.constructor.name},t.prototype.create=function(){return new(0,this.constructor)},t.prototype.transformBy=function(t){},t.prototype.getImp=function(){return this.MxDbEntityImp},t.prototype.setNeedUpdateDisplay=function(t){var e=this.getImp();return!!e&&(t?e.upDisplay():e.setDirtyDisplay(!0),!0)},t.prototype.getMxObject=function(){var t=this.getImp();return t?t.getMxObject():null},t.prototype.onViewChange=function(){return!1},t.prototype.objectId=function(){var t=this.getImp();return t?t.objectId():0},t.prototype.erase=function(){var t=this.getImp();return!!t&&t.erase()},t.prototype.setLayer=function(t){var e=this.getImp();e&&e.nodifySetLayer(),this.layer=t},t.prototype.getLayer=function(){return this.layer},t.prototype.setColor=function(t){this.color=t},t.prototype.getColor=function(){return this.color},t.prototype.clone=function(t){var e=this.create(),i={type:t||MxType_1.default.MxCloneType.kClone};return this.dwgOut(i),e.dwgIn(i),e},t.prototype.onDwgIn=function(t){this.color=t.color,this.renderOrder=t.renderOrder,this.opacity=t.opacity,this.visible=t.visible,t.userData?this.userData=JSON.parse(JSON.stringify(t.userData)):this.userData={},this.dLineWidth=t.lineWidth,this.lineWidthByPixels=t.lineWidthByPixels,this.dDashArray=t.dashArray,this.dDashRatio=t.dashRatio,this.layer=t.layer},t.prototype.onDwgOut=function(t){t.color=this.color,t.renderOrder=this.renderOrder,t.opacity=this.opacity,t.visible=this.visible,Object.keys(this.userData).length>0&&(t.userData=this.userData),t.lineWidth=this.dLineWidth,t.lineWidthByPixels=this.lineWidthByPixels,t.dashArray=this.dDashArray,t.dashRatio=this.dDashRatio,t.layer=this.layer},t.prototype.rxInit=function(){store_1.default.state.MxFun.initMxDbEntityType(this)},t.prototype.setRenderOrder=function(t){this.renderOrder=t},t.prototype.getRenderOrder=function(){return this.renderOrder},t.prototype.setDash=function(t,e){this.dDashArray=t,this.dDashRatio=e,0==this.dLineWidth&&(this.dLineWidth=6,this.lineWidthByPixels=!0)},t.prototype.getDash=function(){return{dDashArray:this.dDashArray,dDashRatio:this.dDashRatio}},t.prototype.setDashLineDisplay=function(t){t?(this.dDashArray=.03,this.dDashRatio=.1,0==this.dLineWidth&&(this.dLineWidth=6,this.lineWidthByPixels=!0)):(this.dDashArray=0,this.dDashRatio=0)},t.prototype.isDashLineDisplay=function(){return this.dDashArray>0&&this.dDashRatio>0},t.prototype.setLineWidthByPixels=function(t){this.lineWidthByPixels=t},t.prototype.getLineWidthByPixels=function(){return this.lineWidthByPixels},t.prototype.setLineWidth=function(t){this.dLineWidth=t},t.prototype.getLineWidth=function(){return this.dLineWidth},t}();exports.default=MxDbEntity;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var __extends=this&&this.__extends||function(){var t=function(e,
|
|
1
|
+
"use strict";var __extends=this&&this.__extends||function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(e,o)};return function(e,o){if("function"!=typeof o&&null!==o)throw new TypeError("Class extends value "+String(o)+" is not a constructor or null");function i(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(i.prototype=o.prototype,new i)}}(),__awaiter=this&&this.__awaiter||function(t,e,o,i){return new(o||(o=Promise))(function(s,r){function n(t){try{c(i.next(t))}catch(t){r(t)}}function a(t){try{c(i.throw(t))}catch(t){r(t)}}function c(t){var e;t.done?s(t.value):(e=t.value,e instanceof o?e:new o(function(t){t(e)})).then(n,a)}c((i=i.apply(t,e||[])).next())})},__generator=this&&this.__generator||function(t,e){var o,i,s,r,n={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]};return r={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function a(r){return function(a){return function(r){if(o)throw new TypeError("Generator is already executing.");for(;n;)try{if(o=1,i&&(s=2&r[0]?i.return:r[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,r[1])).done)return s;switch(i=0,s&&(r=[2&r[0],s.value]),r[0]){case 0:case 1:s=r;break;case 4:return n.label++,{value:r[1],done:!1};case 5:n.label++,i=r[1],r=[0];continue;case 7:r=n.ops.pop(),n.trys.pop();continue;default:if(!(s=(s=n.trys).length>0&&s[s.length-1])&&(6===r[0]||2===r[0])){n=0;continue}if(3===r[0]&&(!s||r[1]>s[0]&&r[1]<s[3])){n.label=r[1];break}if(6===r[0]&&n.label<s[1]){n.label=s[1],s=r;break}if(s&&n.label<s[2]){n.label=s[2],n.ops.push(r);break}s[2]&&n.ops.pop(),n.trys.pop();continue}r=e.call(t,n)}catch(t){r=[6,t],i=0}finally{o=s=0}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}([r,a])}}};Object.defineProperty(exports,"__esModule",{value:!0});var THREE=require("three"),MxDbEntity_1=require("../MxDbEntity"),MxDbSVGText_1=require("../MxDbSVGText"),MxThreeJS_1=require("../MxThreeJS"),MxType_1=require("../MxType"),MxDbSVG=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.svgPos=new THREE.Vector3,e.svg=null,e.svgPath="",e.svgSize=new THREE.Vector2(50,50),e.svgAlignmentRatio=new THREE.Vector2(0,0),e.svgRotate=0,e.svgReverse=!1,e.svgMargin=new THREE.Vector2(0,0),e.isSvgDirtyLocation=!1,e.isLoadFromPath=!0,e.aryText=[],e.svgBoxSize=null,e.fixedSize=!1,e.useSvgColor=!1,e}return __extends(e,t),e.prototype.calcVewSize=function(t){var e=this.svgSize.x,o=this.svgSize.y;return o<=0&&(o=this.svgBoxSize?this.svgBoxSize.y/this.svgBoxSize.x*e:e),this.fixedSize&&(e=t.screenCoordLong2Doc(e),o=t.screenCoordLong2Doc(o)),[e,o]},e.prototype.worldDraw=function(t){var e=this,o=t.getMxObject();this.calcSvgPosition(o);var i=this.calcVewSize(o),s=i[0],r=i[1],n=new THREE.Matrix4;this.svgReverse&&n.makeScale(1,-1,1);var a=new THREE.Matrix4;a.makeRotationZ(this.svgRotate);var c=new THREE.Matrix4,g=new THREE.Vector3(this.svgPos.x-s*this.svgAlignmentRatio.x,this.svgPos.y-r*this.svgAlignmentRatio.y,0);c.makeTranslation(g.x,g.y,g.z),a.multiply(n),a.premultiply(c);var v=new THREE.Vector3(0,0,0),h=new THREE.Vector3(s,0,0),x=new THREE.Vector3(s,r,0),l=new THREE.Vector3(0,r,0);if(v.applyMatrix4(a),h.applyMatrix4(a),x.applyMatrix4(a),l.applyMatrix4(a),1==t.getType()){if(this.aryText.forEach(function(i){if(i.txt.length>0){var s=new THREE.Vector3(i.txtPos.x,i.txtPos.y,0);e.fixedSize&&(i.txtPos.x>0?s.x=e.svgPos.x+o.screenCoordLong2Doc(i.txtPos.x):s.x=e.svgPos.x-o.screenCoordLong2Doc(i.txtPos.x),i.txtPos.y>0?s.y=e.svgPos.y+o.screenCoordLong2Doc(i.txtPos.y):s.y=e.svgPos.y-o.screenCoordLong2Doc(i.txtPos.y));var r=void 0;i.color&&(r=t.getColor(),t.setColor(i.color));var n=i.txtHeight;e.fixedSize&&(n=o.screenCoordLong2Doc(i.txtHeight)),i._txtObject=t.drawText(i.txt,n,0,s),i._txtAspectRatio=-1,r&&t.setColor(r)}}),this.svg)t.drawEntity(this.svg);else if(this.svgPath.length>0&&this.isLoadFromPath){var u=this,y=t.getMxObject();MxThreeJS_1.default.loadSVG(this.svgPath,void 0,function(e){if(e){var i=(new THREE.Box3).setFromObject(e);u.svgBoxSize||(u.svgBoxSize=new THREE.Vector3),u.svgBoxSize.x=i.max.x-i.min.x,u.svgBoxSize.y=i.max.y-i.min.y;var s=u.calcVewSize(o),r=s[0],n=s[1];e.scale.x=r/u.svgBoxSize.x,e.scale.y=n/u.svgBoxSize.y,e.scale.z=e.scale.x,u.svgReverse&&(e.scale.y*=-1),e.rotateZ(u.svgRotate),u.isSvgDirtyLocation=!0;var a=new THREE.Color(t.getColor());e.traverse(function(t){t.material&&(t.material=t.material.clone(),t.material.transparent=!0,u.useSvgColor||(t.material.color=a))}),u.svg=e,u.setNeedUpdateDisplay(),y.updateDisplay()}u.isLoadFromPath=!1})}t.drawSelectLine(v,x),t.drawSelectLine(h,l),t.drawSelectLine(v,h),t.drawSelectLine(h,x),t.drawSelectLine(x,l),t.drawSelectLine(l,v)}else t.drawLine(v,h),t.drawLine(h,x),t.drawLine(x,l),t.drawLine(l,v)},e.prototype.setSvgPath=function(t,e){return void 0===e&&(e=!1),__awaiter(this,void 0,void 0,function(){return __generator(this,function(o){switch(o.label){case 0:return this.svgPath=t,this.svg=null,this.isLoadFromPath=!0,this.svgBoxSize=null,e?[4,MxThreeJS_1.default.loadSVG(t)]:[3,2];case 1:o.sent(),o.label=2;case 2:return[2]}})})},e.prototype.getSvgPath=function(){return this.svgPath},e.prototype.setSvgPostion=function(t){this.svgPos=t.clone(),this.isSvgDirtyLocation=!0},e.prototype.getSvgPostion=function(){return this.svgPos},e.prototype.setSvgSize=function(t){this.svgSize=t,this.isSvgDirtyLocation=!0},e.prototype.getSvgSize=function(){return this.svgSize},e.prototype.setSvgAlignmentRatio=function(t){this.svgAlignmentRatio=t,this.isSvgDirtyLocation=!0},e.prototype.getSvgAlignmentRatio=function(){return this.svgAlignmentRatio},e.prototype.getText=function(t){return t<this.aryText.length?this.aryText[t]:null},e.prototype.addText=function(t){this.aryText.push(t)},e.prototype.getGripPoints=function(){var t=[];return t.push(this.svgPos),t},e.prototype.moveGripPointsAt=function(t,e){return 0==t&&(this.svgPos.add(e),this.fixedSize||this.aryText.forEach(function(t){t.txtPos.add(e)})),this.isSvgDirtyLocation=!0,!0},e.prototype.calcSvgPosition=function(t){if(this.svg&&this.isSvgDirtyLocation){this.isSvgDirtyLocation=!1;var e=this.calcVewSize(t),o=e[0],i=e[1];this.svg.position.x=this.svgPos.x-o*this.svgAlignmentRatio.x-this.svgMargin.x*o,this.svg.position.y=this.svgPos.y-i*this.svgAlignmentRatio.y-this.svgMargin.y*i}},e.prototype.dwgIn=function(t){var e=this;this.onDwgIn(t),this.fixedSize=t.fixedSize,this.fixedSize?this.svg=null:t.type==MxType_1.default.MxCloneType.kClone&&t.svg&&(this.svg=t.svg.clone()),this.svgPos.copy(t.svgPos),this.svgPath=t.svgPath.substr(0),this.svgSize.copy(t.svgSize),this.svgAlignmentRatio.copy(t.svgAlignmentRatio),this.isSvgDirtyLocation=!0,this.svg||(this.isLoadFromPath=!0),this.svgBoxSize=null;var o=t.txts;return this.aryText=[],o.forEach(function(t){var o=new MxDbSVGText_1.default;o.txt=t.txt,o.txtHeight=t.txtHeight,o.txtPos.copy(t.txtPos),e.aryText.push(o)}),this.svgRotate=t.svgRotate,this.useSvgColor=t.useSvgColor,this.svgReverse=t.svgReverse,this.svgMargin=t.svgMargin,!0},e.prototype.dwgOut=function(t){return this.onDwgOut(t),t.type==MxType_1.default.MxCloneType.kClone&&(t.svg=this.svg),t.svgPath=this.svgPath,t.svgPos=this.svgPos,t.svgSize=this.svgSize,t.svgAlignmentRatio=this.svgAlignmentRatio,t.txts=[],this.aryText.forEach(function(e){var o={txtPos:e.txtPos,txt:e.txt,txtHeight:e.txtHeight,color:e.color,_txtAspectRatio:e._txtAspectRatio};t.txts.push(o)}),t.fixedSize=this.fixedSize,t.svgRotate=this.svgRotate,t.useSvgColor=this.useSvgColor,t.svgReverse=this.svgReverse,t.svgMargin=this.svgMargin,t},e.prototype.create=function(){return new e},e.prototype.transformBy=function(t){this.svgPos.applyMatrix4(t),this.isSvgDirtyLocation=!0,this.fixedSize||this.aryText.forEach(function(e){e.txtPos.applyMatrix4(t)})},e.prototype.getTypeName=function(){return"MxDbSVG"},e.prototype.setColor=function(e){if(t.prototype.setColor.call(this,e),this.svg){var o=new THREE.Color(this.color);this.svg.traverse(function(t){t.material&&(t.material.color=o)})}},e.prototype.onViewChange=function(){if(!this.fixedSize)return!1;var t=this.getMxObject();if(null==t)return!1;if(this.svg){if(!this.svgBoxSize){this.svgBoxSize=new THREE.Vector3;var e=(new THREE.Box3).setFromObject(this.svg);this.svgBoxSize.x=e.max.x-e.min.x,this.svgBoxSize.y=e.max.y-e.min.y}var o=this.calcVewSize(t),i=o[0],s=o[1];this.svg.scale.x=i/this.svgBoxSize.x,this.svg.scale.y=s/this.svgBoxSize.y,this.svg.scale.z=this.svg.scale.x,this.svgReverse&&(this.svg.scale.y*=-1),this.isSvgDirtyLocation=!0,this.calcSvgPosition(t)}var r=this;return this.aryText.forEach(function(e){if(e._txtObject&&t){var o=t.screenCoordLong2Doc(e.txtHeight);o>1e-5&&(e._txtAspectRatio<=0&&(e._txtAspectRatio=e._txtObject.scale.x/e._txtObject.scale.y),e._txtObject.scale.set(e._txtAspectRatio*o,o,1),e.txtPos.x>0?e._txtObject.position.x=r.svgPos.x+t.screenCoordLong2Doc(e.txtPos.x):e._txtObject.position.x=r.svgPos.x-t.screenCoordLong2Doc(e.txtPos.x),e.txtPos.y>0?e._txtObject.position.y=r.svgPos.y+t.screenCoordLong2Doc(e.txtPos.y):e._txtObject.position.y=r.svgPos.y-t.screenCoordLong2Doc(e.txtPos.y),e._txtObject.updateMatrix())}}),!0},e}(MxDbEntity_1.default);exports.default=MxDbSVG;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var __awaiter=this&&this.__awaiter||function(t,r,
|
|
1
|
+
"use strict";var __awaiter=this&&this.__awaiter||function(t,e,r,o){return new(r||(r=Promise))(function(n,i){function a(t){try{d(o.next(t))}catch(t){i(t)}}function u(t){try{d(o.throw(t))}catch(t){i(t)}}function d(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r(function(t){t(e)})).then(a,u)}d((o=o.apply(t,e||[])).next())})},__generator=this&&this.__generator||function(t,e){var r,o,n,i,a={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,o&&(n=2&i[0]?o.return:i[0]?o.throw||((n=o.return)&&n.call(o),0):o.next)&&!(n=n.call(o,i[1])).done)return n;switch(o=0,n&&(i=[2&i[0],n.value]),i[0]){case 0:case 1:n=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,o=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(n=(n=a.trys).length>0&&n[n.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!n||i[1]>n[0]&&i[1]<n[3])){a.label=i[1];break}if(6===i[0]&&a.label<n[1]){a.label=n[1],n=i;break}if(n&&a.label<n[2]){a.label=n[2],a.ops.push(i);break}n[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],o=0}finally{r=n=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}};Object.defineProperty(exports,"__esModule",{value:!0});var MxDbDatabase_1=require("../MxDbDatabase"),MxThreeJS_1=require("../MxThreeJS"),MxDrawObject=function(){function t(t){this._mxdrawObj=t}return t.prototype.getScene=function(){return this._mxdrawObj.getScene()},t.prototype.getCamera=function(){return this._mxdrawObj.getCamera()},t.prototype.getRenderer=function(){return this._mxdrawObj.renderer},t.prototype.setMouseRightRotate=function(t){return void 0===t&&(t=!0),this._mxdrawObj.setMouseRightRotate(t)},t.prototype.getFullDisplayRange=function(){return this._mxdrawObj.getFullDisplayRange()},t.prototype.getCanvas=function(){return this._mxdrawObj.getCanvas()},t.prototype.updateDisplay=function(){return this._mxdrawObj.updateDisplay()},t.prototype.createCanvasImageData=function(t,e){return this._mxdrawObj.createCanvasImageData(t,e)},t.prototype.setViewColor=function(t){return this._mxdrawObj.setViewColor(t)},t.prototype.setSize=function(t,e){return this._mxdrawObj.setSize(t,e)},t.prototype.getIntersectObjects=function(t){return this._mxdrawObj.getIntersectObjects(t)},t.prototype.addObject=function(t,e){return void 0===e&&(e=!0),this._mxdrawObj.addObject(t,e)},t.prototype.addViewObject=function(t){return this._mxdrawObj.addViewObject(t)},t.prototype.getViewWidth=function(){return this._mxdrawObj.getViewWidth()},t.prototype.getViewHeight=function(){return this._mxdrawObj.getViewHeight()},t.prototype.removeObject=function(t,e){return void 0===e&&(e=!0),this._mxdrawObj.removeObject(t,e)},t.prototype.zoomInitialStates=function(){return this._mxdrawObj.zoomInitialStates()},t.prototype.zoomScale=function(t){return this._mxdrawObj.zoomScale(t)},t.prototype.zoomW=function(t,e,r){return this._mxdrawObj.zoomW(t,e,r)},t.prototype.zoomCenter=function(t,e){return this._mxdrawObj.zoomCenter(t,e)},t.prototype.initZoomW=function(t,e){return this._mxdrawObj.initZoomW(t,e)},t.prototype.addEvent=function(t,e){return this._mxdrawObj.addEvent(t,e)},t.prototype.setIniset=function(t){return this._mxdrawObj.setIniset(t)},t.prototype.screenCoord2World=function(t,e,r){return this._mxdrawObj.screenCoord2World(t,e,r)},t.prototype.worldCoord2Screen=function(t,e,r){return this._mxdrawObj.worldCoord2Screen(t,e,r)},t.prototype.screenCoord2Doc=function(t,e){return this._mxdrawObj.screenCoord2Doc(t,e,0)},t.prototype.worldCoordLong2Doc=function(t){return this._mxdrawObj.worldCoordLong2Doc(t)},t.prototype.docCoordLong2World=function(t){return this._mxdrawObj.docCoordLong2World(t)},t.prototype.docCoord2World=function(t,e,r){return this._mxdrawObj.docCoord2World(t,e,r)},t.prototype.docCoord2World2=function(t){return this._mxdrawObj.docCoord2World(t.x,t.y,t.z)},t.prototype.worldCoord2Doc=function(t,e,r){return this._mxdrawObj.worldCoord2Doc(t,e,r)},t.prototype.worldCoord2Doc2=function(t){return this._mxdrawObj.worldCoord2Doc(t.x,t.y,t.z)},t.prototype.docCoord2Screen=function(t,e){return this._mxdrawObj.docCoord2Screen(t,e,0)},t.prototype.screenCoordLong2Doc=function(t){return this._mxdrawObj.screenCoordLong2Doc(t)},t.prototype.docCoordLong2Screen=function(t){return this._mxdrawObj.docCoordLong2Screen(t)},t.prototype.screenCoordLong2World=function(t){return this._mxdrawObj.screenCoordLong2World(t)},t.prototype.worldCoordLong2Screen=function(t){return this._mxdrawObj.worldCoordLong2Screen(t)},t.prototype.initRendererParam=function(t){return this._mxdrawObj.initRendererParam(t)},t.prototype.addMxEntity=function(t){return this._mxdrawObj.addMxEntity(t)},t.prototype.getMxCurrentSelect=function(){return this._mxdrawObj.getMxAllSelect()},t.prototype.addMxCurrentSelect=function(t){return this._mxdrawObj.addMxCurrentSelect(t)},t.prototype.clearMxCurrentSelect=function(){return this._mxdrawObj.clearMxCurrentSelect()},t.prototype.getMxEntity=function(t){return this._mxdrawObj.getMxEntityUserObject(t)},t.prototype.findMxEntityAtPoint=function(t){return this._mxdrawObj.findMxEntityAtPoint(t)},t.prototype.getAllMxEntity=function(){return this._mxdrawObj.getAllMxEntity()},t.prototype.setMouseMiddlePan=function(t){return this._mxdrawObj.setMouseMiddlePan(t)},t.prototype.resetThreeJSControls=function(){return this._mxdrawObj.resetThreeJSControls()},t.prototype.enableZoom=function(t){return this._mxdrawObj.enableZoom(t)},t.prototype.enablePan=function(t){return this._mxdrawObj.enablePan(t)},t.prototype.eraseMxEntity=function(t){return this._mxdrawObj.eraseMxEntity(t)},t.prototype.removeViewObject=function(t){this._mxdrawObj.removeViewObject(t)},t.prototype.saveMxEntityToJson=function(){return this._mxdrawObj.saveMxEntityToJson()},t.prototype.loadMxEntityFromJson=function(t,e){return void 0===e&&(e=null),__awaiter(this,void 0,void 0,function(){var r,o;return __generator(this,function(n){switch(n.label){case 0:if(!e)return[3,4];r=e.length,o=0,n.label=1;case 1:return o<r?[4,MxThreeJS_1.default.loadSVG(e[o])]:[3,4];case 2:n.sent(),n.label=3;case 3:return o++,[3,1];case 4:return[2,this._mxdrawObj.loadMxEntityFromJson(t)]}})})},t.prototype.eraseAllMxEntity=function(){return this._mxdrawObj.eraseAllMxEntity()},t.prototype.makeCurrent=function(){this._mxdrawObj.makeCurrent()},t.prototype.getViewCenterDocCoord=function(){return this._mxdrawObj.getViewCenterDocCoord()},t.prototype.updateCanvasSize=function(){this._mxdrawObj.updateCanvasSize()},t.prototype.newFile=function(t,e,r,o){return this._mxdrawObj.newFile(t,e,r,o)},t.prototype.stopAllLoading=function(){return this._mxdrawObj.stopAllLoading()},t.prototype.getOrbitControls=function(){return this._mxdrawObj.getOrbitControls()},t.prototype.getMxDatabase=function(){return new MxDbDatabase_1.default(this._mxdrawObj.getMxDatabase())},t}();exports.default=MxDrawObject;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var __spreadArray=this&&this.__spreadArray||function(t,e,o){if(o||2===arguments.length)for(var r,n=0,a=e.length;n<a;n++)!r&&n in e||(r||(r=Array.prototype.slice.call(e,0,n)),r[n]=e[n]);return t.concat(r||Array.prototype.slice.call(e))};Object.defineProperty(exports,"__esModule",{value:!0});var random_1=require("../../tools/algorithm/random"),create_1=require("../../tools/dom/create"),MxDrawObject_1=require("../MxDrawObject"),store_1=require("../store"),useCanvasResizeListener_1=require("../useCanvasResizeListener"),MrxDbgUiPrPoint_1=require("../MrxDbgUiPrPoint"),mxUiData_1=require("../loadCoreCode/mxUiData"),MxFun=function(){function t(){}return t.prototype.createMxObject=function(t){var e=t.canvasId,o=void 0===e?(0,random_1.createReandomId)():e,r=t.cadFile,n=void 0===r?"":r,a=t.callback,u=t.isNewFile,i=void 0!==u&&u,
|
|
1
|
+
"use strict";var __spreadArray=this&&this.__spreadArray||function(t,e,o){if(o||2===arguments.length)for(var r,n=0,a=e.length;n<a;n++)!r&&n in e||(r||(r=Array.prototype.slice.call(e,0,n)),r[n]=e[n]);return t.concat(r||Array.prototype.slice.call(e))};Object.defineProperty(exports,"__esModule",{value:!0});var random_1=require("../../tools/algorithm/random"),create_1=require("../../tools/dom/create"),MxDrawObject_1=require("../MxDrawObject"),store_1=require("../store"),useCanvasResizeListener_1=require("../useCanvasResizeListener"),MrxDbgUiPrPoint_1=require("../MrxDbgUiPrPoint"),mxUiData_1=require("../loadCoreCode/mxUiData"),MxDbDatabase_1=require("../MxDbDatabase"),MxFun=function(){function t(){}return t.prototype.createMxObject=function(t){var e=t.canvasId,o=void 0===e?(0,random_1.createReandomId)():e,r=t.cadFile,n=void 0===r?"":r,a=t.callback,u=t.isNewFile,i=void 0!==u&&u,s=t.useWebsocket,d=void 0!==s&&s,c=t.isAutoResize,l=void 0===c||c;this.initUiDataObject(mxUiData_1.default);var p=(0,create_1.createCanvas)(o),f=(0,create_1.createCanvasParent)(p);f.parentNode&&11!=f.parentNode.nodeType||document.body.appendChild(f),!d&&i&&(i=!1),store_1.default.state.MxFun.createMxObject(o,n,function(t){var e=new MxDrawObject_1.default(t);t.setMouseRightRotate(!1),t.setIniset({EnableOsnapFunction:!0}),t.addEvent("onResize",function(){return f.tabindex=3,{width:f.clientWidth,height:f.clientHeight}}),l&&(0,useCanvasResizeListener_1.default)(e,p),a&&a(e,{canvas:p,canvasParent:f})},void 0,i,d)},t.prototype.setMxServer=function(t){void 0===t&&(t="ws://localhost:5090"),store_1.default.state.MxFun.setMxServer(t)},t.prototype.enablStaticLoad=function(t){store_1.default.state.MxFun.enablStaticLoad(t)},t.prototype.setStaticServer=function(t){store_1.default.state.MxFun.setStaticServer(t)},t.prototype.addCommand=function(t,e){store_1.default.state.MxFun.addCommand(t,e)},t.prototype.sendStringToExecute=function(t){for(var e,o=[],r=1;r<arguments.length;r++)o[r-1]=arguments[r];return(e=store_1.default.state.MxFun).sendStringToExecute.apply(e,__spreadArray([t],o,!1))},t.prototype.call=function(t,e,o){return store_1.default.state.MxFun.call(t,e,o)},t.prototype.getCurrentDraw=function(){return new MxDrawObject_1.default(store_1.default.state.MxFun.getCurrentDraw())},t.prototype.getCurrentDatabase=function(){var t=store_1.default.state.MxFun.getCurrentDraw();return new MxDbDatabase_1.default(t.getMxDatabase())},t.prototype.screenCoordLong2World=function(t){return store_1.default.state.MxFun.screenCoordLong2World(t)},t.prototype.screenCoordLong2Doc=function(t){return store_1.default.state.MxFun.screenCoordLong2Doc(t)},t.prototype.docCoordLong2Screen=function(t){return store_1.default.state.MxFun.docCoordLong2Screen(t)},t.prototype.worldCoordLong2Doc=function(t){return store_1.default.state.MxFun.worldCoordLong2Doc(t)},t.prototype.docCoordLong2World=function(t){return store_1.default.state.MxFun.docCoordLong2World(t)},t.prototype.screenCoord2World=function(t,e,o){return store_1.default.state.MxFun.screenCoord2World(t,e,o)},t.prototype.worldCoord2Screen=function(t,e,o){return store_1.default.state.MxFun.worldCoord2Screen(t,e,o)},t.prototype.docCoord2World=function(t,e,o){return store_1.default.state.MxFun.docCoord2World(t,e,o)},t.prototype.worldCoord2Doc=function(t,e,o){return store_1.default.state.MxFun.worldCoord2Doc(t,e,o)},t.prototype.screenCoord2Doc=function(t,e){return store_1.default.state.MxFun.screenCoord2Doc(t,e,0)},t.prototype.docCoord2Screen=function(t,e){return store_1.default.state.MxFun.docCoord2Screen(t,e,0)},t.prototype.updateDisplay=function(){return store_1.default.state.MxFun.updateDisplay()},t.prototype.addWindowsEvent=function(t){return store_1.default.state.MxFun.addWindowsEvent(t)},t.prototype.isRunningCommand=function(){return store_1.default.state.MxFun.isRunningCommand()},t.prototype.zoomW=function(t,e,o,r,n){return store_1.default.state.MxFun.zoomW(t,e,o,r,n)},t.prototype.showLayer=function(t,e,o){return store_1.default.state.MxFun.showLayer(t,e,o)},t.prototype.getCurrentMxCAD=function(){return store_1.default.state.MxFun.getCurrentMxCAD()},t.prototype.getQueryString=function(t){return store_1.default.state.MxFun.getQueryString(t)},t.prototype.setIniset=function(t){return store_1.default.state.MxFun.setIniset(t)},t.prototype.upDisplayForLayerData=function(t){return store_1.default.state.MxFun.upDisplayForLayerData(t)},t.prototype.initUiDataObject=function(t){return store_1.default.state.MxFun.initUiDataObject(t)},t.prototype.testMX=function(t){return 11},t.prototype.loadImageMaterial=function(t,e){return e?(store_1.default.state.MxFun.loadImageMaterial(t,e),new Promise(function(t,e){t(null)})):new Promise(function(e,o){store_1.default.state.MxFun.loadImageMaterial(t,function(t){e(t||null)})})},t.prototype.openFile=function(t,e){return void 0===e&&(e=!1),store_1.default.state.MxFun.openFile(t,e)},t.prototype.addToCurrentSpace=function(t){return this.getCurrentDraw().addMxEntity(t)},t.prototype.selectEnt=function(t,e){var o=this;return void 0===e&&(e=null),new Promise(function(r,n){var a=new MrxDbgUiPrPoint_1.default;a.setMessage(t),a.go(function(t){if(0==t){for(var n=a.value(),u=o.getCurrentDraw().findMxEntityAtPoint(n),i=0;0!=u.length;){for(var s=u.length,d=0;d<s;d++){var c=u[d];if(!e||!e.type||e.type==c.getTypeName()){i=c.objectId();break}}break}r(i)}else r(0)})})},t.prototype.listenForCommandLineInput=function(t){mxUiData_1.default.getCmdLine().mountUpDisplayFun(t)},t.prototype.setCommandLineInputData=function(t,e){mxUiData_1.default.getCmdLine().setCmdText(t),mxUiData_1.default.onKeydown(e)},t.prototype.listenForCoordTip=function(t){mxUiData_1.default.mountSetCoordFun(t)},t.prototype.getMxFunTHREE=function(){return store_1.default.state.MxFun.getTHREE()},t.prototype.getMxFunThreeTool=function(){return store_1.default.state.MxFun.getMxThreeJS()},t}();exports.default=MxFun;
|