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.
- package/dist/lib/MxModule/McEdGetPointWorldDrawObject/McEdGetPointWorldDrawObjectClass.js +1 -128
- package/dist/lib/MxModule/McEdGetPointWorldDrawObject/index.js +1 -5
- package/dist/lib/MxModule/McGePoint3d/McGePoint3d.js +1 -0
- package/dist/lib/MxModule/McGePoint3d/index.js +1 -0
- package/dist/lib/MxModule/McGePoint3dArray/McGePoint3dArray.js +1 -0
- package/dist/lib/MxModule/McGePoint3dArray/index.js +1 -0
- package/dist/lib/MxModule/McGeTool/McGeTool.js +1 -0
- package/dist/lib/MxModule/McGeTool/index.js +1 -0
- package/dist/lib/MxModule/McGiWorldDraw/McGiWorldDraw.js +1 -3
- package/dist/lib/MxModule/McGiWorldDraw/index.js +1 -2
- package/dist/lib/MxModule/McGiWorldDrawType/McGiWorldDrawType.js +1 -19
- package/dist/lib/MxModule/McGiWorldDrawType/index.js +1 -4
- package/dist/lib/MxModule/MrxDbgUiPrBaseReturn/MrxDbgUiPrBaseReturn.js +1 -31
- package/dist/lib/MxModule/MrxDbgUiPrBaseReturn/index.js +1 -5
- package/dist/lib/MxModule/MrxDbgUiPrPoint/MrxDbgUiPrPointClass.js +1 -159
- package/dist/lib/MxModule/MrxDbgUiPrPoint/index.js +1 -5
- package/dist/lib/MxModule/Mx3PointArc/Mx3PointArc.js +1 -0
- package/dist/lib/MxModule/Mx3PointArc/index.js +1 -0
- package/dist/lib/MxModule/MxDb2LineAngularDimension/MxDb2LineAngularDimension.js +1 -0
- package/dist/lib/MxModule/MxDb2LineAngularDimension/index.js +1 -0
- package/dist/lib/MxModule/MxDbAlignedDimension/MxDbAlignedDimension.js +1 -213
- package/dist/lib/MxModule/MxDbAlignedDimension/index.js +1 -5
- package/dist/lib/MxModule/MxDbAnyLine/MxDbAnyLine.js +1 -0
- package/dist/lib/MxModule/MxDbAnyLine/index.js +1 -0
- package/dist/lib/MxModule/MxDbArea/MxDbArea.js +1 -0
- package/dist/lib/MxModule/MxDbArea/index.js +1 -0
- package/dist/lib/MxModule/MxDbCoord/MxDbCoord.js +1 -0
- package/dist/lib/MxModule/MxDbCoord/index.js +1 -0
- package/dist/lib/MxModule/MxDbEntity/MxDbEntity.js +1 -258
- package/dist/lib/MxModule/MxDbEntity/index.js +1 -5
- package/dist/lib/MxModule/MxDbImage/MxDbImage.js +1 -160
- package/dist/lib/MxModule/MxDbImage/index.js +1 -5
- package/dist/lib/MxModule/MxDbLine/MxDbLine.js +1 -94
- package/dist/lib/MxModule/MxDbLine/index.js +1 -5
- package/dist/lib/MxModule/MxDbPolyline/MxDbPolyline.js +1 -97
- package/dist/lib/MxModule/MxDbPolyline/index.js +1 -5
- package/dist/lib/MxModule/MxDbRect/MxDbRect.js +1 -273
- package/dist/lib/MxModule/MxDbRect/index.js +1 -4
- package/dist/lib/MxModule/MxDbSVG/MxDbSVG.js +1 -419
- package/dist/lib/MxModule/MxDbSVG/index.js +1 -5
- package/dist/lib/MxModule/MxDbSVGText/MxDbSVGText.js +1 -21
- package/dist/lib/MxModule/MxDbSVGText/index.js +1 -5
- package/dist/lib/MxModule/MxDrawObject/MxDrawObject.js +1 -782
- package/dist/lib/MxModule/MxDrawObject/index.js +1 -5
- package/dist/lib/MxModule/MxFilters/MxFilters.js +1 -201
- package/dist/lib/MxModule/MxFilters/index.js +1 -4
- package/dist/lib/MxModule/MxFun/MxFun.js +1 -676
- package/dist/lib/MxModule/MxFun/index.js +1 -4
- package/dist/lib/MxModule/MxThreeJS/MxThreeJS.js +1 -283
- package/dist/lib/MxModule/MxThreeJS/MxThreeJS.mixin.js +1 -146
- package/dist/lib/MxModule/MxThreeJS/index.js +1 -7
- package/dist/lib/MxModule/MxType/MxType.js +1 -27
- package/dist/lib/MxModule/MxType/index.js +1 -4
- package/dist/lib/MxModule/Mxassembly/Mxassembly.js +1 -20
- package/dist/lib/MxModule/Mxassembly/index.js +1 -9
- package/dist/lib/MxModule/loadCoreCode/index.js +1 -5
- package/dist/lib/MxModule/loadCoreCode/loadCoreCode.js +1 -125
- package/dist/lib/MxModule/loadCoreCode/mxUiData.js +1 -312
- package/dist/lib/MxModule/loadCoreCode/mxcadassembly_es5.js +1 -1519
- package/dist/lib/MxModule/loadCoreCode/mxfun.es5.js +1 -7363
- package/dist/lib/MxModule/store/PubsubClass.js +1 -40
- package/dist/lib/MxModule/store/StoreClass.js +1 -73
- package/dist/lib/MxModule/store/index.js +1 -19
- package/dist/lib/MxModule/store/store.js +1 -25
- package/dist/lib/MxModule/useCanvasResizeListener/index.js +1 -5
- package/dist/lib/MxModule/useCanvasResizeListener/useCanvasResizeListener.js +1 -95
- package/dist/lib/doc.js +1 -38
- package/dist/lib/mxdraw.js +1 -67
- package/dist/lib/tools/algorithm/math.js +1 -16
- package/dist/lib/tools/algorithm/random.js +1 -13
- package/dist/lib/tools/dom/create.js +1 -47
- package/dist/lib/tools/dynamicImport/index.js +1 -243
- package/dist/lib/tools/formatting/index.js +1 -20
- package/dist/lib/tools/proxy/index.js +1 -17
- package/dist/lib/tools/three/index.js +1 -124
- package/dist/mxdraw.es5.js +1 -0
- package/dist/mxdraw.umd.js +1 -0
- package/dist/types/MxModule/McEdGetPointWorldDrawObject/McEdGetPointWorldDrawObjectClass.d.ts +9 -0
- package/dist/types/MxModule/McGePoint3d/McGePoint3d.d.ts +11 -0
- package/dist/types/MxModule/McGePoint3d/index.d.ts +3 -0
- package/dist/types/MxModule/McGePoint3dArray/McGePoint3dArray.d.ts +14 -0
- package/dist/types/MxModule/McGePoint3dArray/index.d.ts +3 -0
- package/dist/types/MxModule/McGeTool/McGeTool.d.ts +38 -0
- package/dist/types/MxModule/McGeTool/index.d.ts +4 -0
- package/dist/types/MxModule/MrxDbgUiPrPoint/MrxDbgUiPrPointClass.d.ts +18 -1
- package/dist/types/MxModule/Mx3PointArc/Mx3PointArc.d.ts +19 -0
- package/dist/types/MxModule/Mx3PointArc/index.d.ts +3 -0
- package/dist/types/MxModule/MxDb2LineAngularDimension/MxDb2LineAngularDimension.d.ts +22 -0
- package/dist/types/MxModule/MxDb2LineAngularDimension/index.d.ts +3 -0
- package/dist/types/MxModule/MxDbAnyLine/MxDbAnyLine.d.ts +18 -0
- package/dist/types/MxModule/MxDbAnyLine/index.d.ts +3 -0
- package/dist/types/MxModule/MxDbArea/MxDbArea.d.ts +17 -0
- package/dist/types/MxModule/MxDbArea/index.d.ts +3 -0
- package/dist/types/MxModule/MxDbCoord/MxDbCoord.d.ts +19 -0
- package/dist/types/MxModule/MxDbCoord/index.d.ts +3 -0
- package/dist/types/MxModule/MxDrawObject/MxDrawObject.d.ts +70 -1
- package/dist/types/MxModule/MxFun/MxFun.d.ts +95 -30
- package/dist/types/MxModule/Mxassembly/Mxassembly.d.ts +11 -2
- package/dist/types/MxModule/store/store.d.ts +2 -2
- package/dist/types/mxdraw.d.ts +17 -4
- package/dist/types/tools/three/index.d.ts +28 -1
- package/package.json +3 -2
- package/dist/lib/MxModule/McGeVector3d/McGeVector3d.js +0 -2
- package/dist/lib/MxModule/McGeVector3d/index.js +0 -3
- 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/McGeVector3d/McGeVector3d.d.ts +0 -17
- package/dist/types/MxModule/McGeVector3d/index.d.ts +0 -3
- 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
|
@@ -1,782 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/** @module MxDrawObject */
|
|
3
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
4
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
5
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
6
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
7
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
8
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
9
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
10
|
-
});
|
|
11
|
-
};
|
|
12
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
13
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
14
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
15
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
16
|
-
function step(op) {
|
|
17
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
18
|
-
while (_) try {
|
|
19
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
20
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
21
|
-
switch (op[0]) {
|
|
22
|
-
case 0: case 1: t = op; break;
|
|
23
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
24
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
25
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
26
|
-
default:
|
|
27
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
28
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
29
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
30
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
31
|
-
if (t[2]) _.ops.pop();
|
|
32
|
-
_.trys.pop(); continue;
|
|
33
|
-
}
|
|
34
|
-
op = body.call(thisArg, _);
|
|
35
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
36
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
37
|
-
}
|
|
38
|
-
};
|
|
39
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
40
|
-
var MxThreeJS_1 = require("../MxThreeJS");
|
|
41
|
-
/**
|
|
42
|
-
* 引入mxdraw库不会挂载MxDrawObject 只能在以下特定函数中获取
|
|
43
|
-
* @function
|
|
44
|
-
* {@link MxFun.createMxObject}中callback回调参数`mxDraw`的构造类
|
|
45
|
-
* @function
|
|
46
|
-
* {@link MxFun.getCurrentDraw} 方法返回值的构造类
|
|
47
|
-
* @function
|
|
48
|
-
* {@link MxFun.getCurrentMxCAD} 方法返回值的构造类
|
|
49
|
-
*
|
|
50
|
-
*/
|
|
51
|
-
var MxDrawObject = /** @class */ (function () {
|
|
52
|
-
function MxDrawObject(Mxdraw) {
|
|
53
|
-
this._mxdrawObj = Mxdraw;
|
|
54
|
-
}
|
|
55
|
-
/**
|
|
56
|
-
* 获取Three.js绘图场景
|
|
57
|
-
* @returns THREE.Scene
|
|
58
|
-
*/
|
|
59
|
-
MxDrawObject.prototype.getScene = function () {
|
|
60
|
-
return this._mxdrawObj.getScene();
|
|
61
|
-
};
|
|
62
|
-
/**
|
|
63
|
-
* 获取Three.js相机对象
|
|
64
|
-
* @returns THREE.Camera
|
|
65
|
-
*/
|
|
66
|
-
MxDrawObject.prototype.getCamera = function () {
|
|
67
|
-
return this._mxdrawObj.getCamera();
|
|
68
|
-
};
|
|
69
|
-
/**
|
|
70
|
-
* 获取Three renderer渲染器
|
|
71
|
-
* @returns THREE.WebGLRenderer
|
|
72
|
-
*/
|
|
73
|
-
MxDrawObject.prototype.getRenderer = function () {
|
|
74
|
-
return this._mxdrawObj.renderer;
|
|
75
|
-
};
|
|
76
|
-
/**
|
|
77
|
-
* 设置鼠标按下是否旋视区
|
|
78
|
-
* @param isRotate 是否旋视区
|
|
79
|
-
* @returns void
|
|
80
|
-
* @example
|
|
81
|
-
* ```typescript
|
|
82
|
-
* Mx.MxFun.getCurrentDraw().setMouseRightRotate(false)
|
|
83
|
-
* ```
|
|
84
|
-
*
|
|
85
|
-
*/
|
|
86
|
-
MxDrawObject.prototype.setMouseRightRotate = function (isRotate) {
|
|
87
|
-
if (isRotate === void 0) { isRotate = true; }
|
|
88
|
-
return this._mxdrawObj.setMouseRightRotate(isRotate);
|
|
89
|
-
};
|
|
90
|
-
/**
|
|
91
|
-
* 得到全部显示所有图形所需要的显示的范围 ,Three.js的坐标系。world坐标。
|
|
92
|
-
* @returns {minPt: value,maxPt: value}
|
|
93
|
-
* @example
|
|
94
|
-
* ```typescript
|
|
95
|
-
* Mx.MxFun.getCurrentDraw().getFullDisplayRange()
|
|
96
|
-
* ```
|
|
97
|
-
*/
|
|
98
|
-
MxDrawObject.prototype.getFullDisplayRange = function () {
|
|
99
|
-
return this._mxdrawObj.getFullDisplayRange();
|
|
100
|
-
};
|
|
101
|
-
/**
|
|
102
|
-
* 获取Canvas对象.
|
|
103
|
-
* @returns HTMLCanvasElement
|
|
104
|
-
*/
|
|
105
|
-
MxDrawObject.prototype.getCanvas = function () {
|
|
106
|
-
return this._mxdrawObj.getCanvas();
|
|
107
|
-
};
|
|
108
|
-
/**
|
|
109
|
-
* 通知Three.js更新显示
|
|
110
|
-
* @returns void
|
|
111
|
-
*/
|
|
112
|
-
MxDrawObject.prototype.updateDisplay = function () {
|
|
113
|
-
return this._mxdrawObj.updateDisplay();
|
|
114
|
-
};
|
|
115
|
-
/**
|
|
116
|
-
* 通知Three.js生成ImgeData显示I数据.
|
|
117
|
-
* @param fn 回调函数或者imageData
|
|
118
|
-
* @param param 函数载荷
|
|
119
|
-
* @returns void
|
|
120
|
-
* @example
|
|
121
|
-
* ```typescript
|
|
122
|
-
* Mx.MxFun.getCurrentDraw().createCanvasImageData((imageData)=> {
|
|
123
|
-
* console.log(imageData)
|
|
124
|
-
* })
|
|
125
|
-
* ```
|
|
126
|
-
*/
|
|
127
|
-
MxDrawObject.prototype.createCanvasImageData = function (fn, param) {
|
|
128
|
-
return this._mxdrawObj.createCanvasImageData(fn, param);
|
|
129
|
-
};
|
|
130
|
-
/**
|
|
131
|
-
* 设置视区背景色,
|
|
132
|
-
* @param color 如0xFFFFFF 白色
|
|
133
|
-
* @returns void
|
|
134
|
-
* @example
|
|
135
|
-
* ```typescript
|
|
136
|
-
* Mx.MxFun.getCurrentDraw().setViewColor(0xFFFFFF)
|
|
137
|
-
* ```
|
|
138
|
-
*/
|
|
139
|
-
MxDrawObject.prototype.setViewColor = function (color) {
|
|
140
|
-
return this._mxdrawObj.setViewColor(color);
|
|
141
|
-
};
|
|
142
|
-
/**
|
|
143
|
-
* 设置视区背景色,
|
|
144
|
-
* @param width 宽度
|
|
145
|
-
* @param height 宽度
|
|
146
|
-
* @returns void
|
|
147
|
-
* @example
|
|
148
|
-
* ```typescript
|
|
149
|
-
* Mx.MxFun.getCurrentDraw().setSize(0xFFFFFF)
|
|
150
|
-
* ```
|
|
151
|
-
*/
|
|
152
|
-
MxDrawObject.prototype.setSize = function (width, height) {
|
|
153
|
-
return this._mxdrawObj.setSize(width, height);
|
|
154
|
-
};
|
|
155
|
-
/**
|
|
156
|
-
* 获取某屏幕点下的绘制对象,ptMouse是.,
|
|
157
|
-
* @param ptMouse THREE.Vector2 屏幕坐标
|
|
158
|
-
* @returns THREE.Intersection[]
|
|
159
|
-
* @example
|
|
160
|
-
* ```typescript
|
|
161
|
-
* Mx.MxFun.getCurrentDraw().getIntersectObjects(new THREE.Vector2(2, 3))
|
|
162
|
-
* ```
|
|
163
|
-
*/
|
|
164
|
-
MxDrawObject.prototype.getIntersectObjects = function (ptMouse) {
|
|
165
|
-
return this._mxdrawObj.getIntersectObjects(ptMouse);
|
|
166
|
-
};
|
|
167
|
-
/**
|
|
168
|
-
* 添加THREE.Object3D对象到当前场景
|
|
169
|
-
* @param obj THREE.Object3D
|
|
170
|
-
* @param isAddToSelect 默认值为true 是否把对象添加选择对象集中,调用 getIntersectObjects可以找到
|
|
171
|
-
* @returns void
|
|
172
|
-
* @example
|
|
173
|
-
* ```typescript
|
|
174
|
-
* Mx.MxFun.getCurrentDraw().addObject(new THREE.Object3D(), false)
|
|
175
|
-
* ```
|
|
176
|
-
*/
|
|
177
|
-
MxDrawObject.prototype.addObject = function (obj, isAddToSelect) {
|
|
178
|
-
if (isAddToSelect === void 0) { isAddToSelect = true; }
|
|
179
|
-
return this._mxdrawObj.addObject(obj, isAddToSelect);
|
|
180
|
-
};
|
|
181
|
-
/**
|
|
182
|
-
* 添加THREE.Object3D对象到视区场景,对象坐标系是窗口视区坐标系。0,0点在左下角.
|
|
183
|
-
* @param obj THREE.Object3D
|
|
184
|
-
* @returns void
|
|
185
|
-
* @example
|
|
186
|
-
* ```typescript
|
|
187
|
-
* Mx.MxFun.getCurrentDraw().addViewObject(new THREE.Object3D())
|
|
188
|
-
* ```
|
|
189
|
-
*/
|
|
190
|
-
MxDrawObject.prototype.addViewObject = function (obj) {
|
|
191
|
-
return this._mxdrawObj.addViewObject(obj);
|
|
192
|
-
};
|
|
193
|
-
/**
|
|
194
|
-
* 得到对象画布的宽度,单位屏幕像素
|
|
195
|
-
* @returns number
|
|
196
|
-
* @example
|
|
197
|
-
* ```typescript
|
|
198
|
-
* Mx.MxFun.getCurrentDraw().getViewWidth()
|
|
199
|
-
* ```
|
|
200
|
-
*/
|
|
201
|
-
MxDrawObject.prototype.getViewWidth = function () {
|
|
202
|
-
return this._mxdrawObj.getViewWidth();
|
|
203
|
-
};
|
|
204
|
-
/**
|
|
205
|
-
* 得到对象画布的高度,单位屏幕像素
|
|
206
|
-
* @returns number
|
|
207
|
-
* @example
|
|
208
|
-
* ```typescript
|
|
209
|
-
* Mx.MxFun.getCurrentDraw().getViewHeight()
|
|
210
|
-
* ```
|
|
211
|
-
*/
|
|
212
|
-
MxDrawObject.prototype.getViewHeight = function () {
|
|
213
|
-
return this._mxdrawObj.getViewHeight();
|
|
214
|
-
};
|
|
215
|
-
/**
|
|
216
|
-
* 删除addObject函数添加的THREE.Object3D对象
|
|
217
|
-
* @param obj THREE.Object3D
|
|
218
|
-
* @param isRemoveSelectObject 默认值为true 删除选择集中的对象
|
|
219
|
-
* @returns void
|
|
220
|
-
* @example
|
|
221
|
-
* ```typescript
|
|
222
|
-
* Mx.MxFun.getCurrentDraw().removeObject(new THREE.Object3D(), false)
|
|
223
|
-
* ```
|
|
224
|
-
*/
|
|
225
|
-
MxDrawObject.prototype.removeObject = function (obj, isRemoveSelectObject) {
|
|
226
|
-
if (isRemoveSelectObject === void 0) { isRemoveSelectObject = true; }
|
|
227
|
-
return this._mxdrawObj.removeObject(obj, isRemoveSelectObject);
|
|
228
|
-
};
|
|
229
|
-
/**
|
|
230
|
-
* 把视区显示范围恢复到初始显示范围.
|
|
231
|
-
* @returns void
|
|
232
|
-
*/
|
|
233
|
-
MxDrawObject.prototype.zoomInitialStates = function () {
|
|
234
|
-
return this._mxdrawObj.zoomInitialStates();
|
|
235
|
-
};
|
|
236
|
-
/**
|
|
237
|
-
* 缩放当前显示范围,它是相对于当前显示范围进行缩放
|
|
238
|
-
* @param scale scale缩放比例
|
|
239
|
-
* @returns void
|
|
240
|
-
* @example
|
|
241
|
-
* ```typescript
|
|
242
|
-
* Mx.MxFun.getCurrentDraw().zoomScale(0.8)
|
|
243
|
-
* ```
|
|
244
|
-
*/
|
|
245
|
-
MxDrawObject.prototype.zoomScale = function (scale) {
|
|
246
|
-
return this._mxdrawObj.zoomScale(scale);
|
|
247
|
-
};
|
|
248
|
-
/**
|
|
249
|
-
* 把当前显示范围移到指定的显示范围
|
|
250
|
-
* @param minPt 坐标1 THREE.Vector3
|
|
251
|
-
* @param maxPt 坐标2 THREE.Vector3
|
|
252
|
-
* @param isWorld 默认为felse DWG图纸坐标,设置为true是THREEJS坐标
|
|
253
|
-
* @returns void
|
|
254
|
-
* @example
|
|
255
|
-
* ```typescript
|
|
256
|
-
* Mx.MxFun.getCurrentDraw().zoomW(new THREE.Vector3(0,10,10), new THREE.Vector3(3,8,20), true)
|
|
257
|
-
* ```
|
|
258
|
-
*/
|
|
259
|
-
MxDrawObject.prototype.zoomW = function (minPt, maxPt, isWorld) {
|
|
260
|
-
return this._mxdrawObj.zoomW(minPt, maxPt, isWorld);
|
|
261
|
-
};
|
|
262
|
-
/**
|
|
263
|
-
* 把当前显示范围移到指定的位置,dCenX,dCenY是DWG图纸坐标。
|
|
264
|
-
* @param minPt DWG图纸坐标1 THREE.Vector3
|
|
265
|
-
* @param maxPt DWG图纸坐标2 THREE.Vector3
|
|
266
|
-
* @returns void
|
|
267
|
-
* @example
|
|
268
|
-
* ```typescript
|
|
269
|
-
* Mx.MxFun.getCurrentDraw().zoomCenter(new THREE.Vector3(0,10,10), new THREE.Vector3(3,8,20))
|
|
270
|
-
* ```
|
|
271
|
-
*/
|
|
272
|
-
MxDrawObject.prototype.zoomCenter = function (dCenX, dCenY) {
|
|
273
|
-
return this._mxdrawObj.zoomCenter(dCenX, dCenY);
|
|
274
|
-
};
|
|
275
|
-
/**
|
|
276
|
-
* 初始化控件默认加载后,显示视区范围,默认使用图纸转换时的显示范围。。
|
|
277
|
-
* @param minPt DWG文档坐标1显示区域的左下角 THREE.Vector3
|
|
278
|
-
* @param maxPt DWG文档坐标2显示区域的右上角 THREE.Vector3
|
|
279
|
-
* @returns void
|
|
280
|
-
* @example
|
|
281
|
-
* ```typescript
|
|
282
|
-
* Mx.MxFun.getCurrentDraw().initZoomW(new THREE.Vector3(0,10,10), new THREE.Vector3(3,8,20))
|
|
283
|
-
*
|
|
284
|
-
* ```
|
|
285
|
-
*/
|
|
286
|
-
MxDrawObject.prototype.initZoomW = function (pt1Doc, pt2Doc) {
|
|
287
|
-
return this._mxdrawObj.initZoomW(pt1Doc, pt2Doc);
|
|
288
|
-
};
|
|
289
|
-
/**
|
|
290
|
-
* 初始化控件默认加载后,显示视区范围,默认使用图纸转换时的显示范围。。
|
|
291
|
-
* @param minPt DWG文档坐标1显示区域的左下角 THREE.Vector3
|
|
292
|
-
* @param maxPt DWG文档坐标2显示区域的右上角 THREE.Vector3
|
|
293
|
-
* @returns void
|
|
294
|
-
* @example
|
|
295
|
-
* ```typescript
|
|
296
|
-
* Mx.MxFun.getCurrentDraw().addEvent(new THREE.Vector3(0,10,10), new THREE.Vector3(3,8,20))
|
|
297
|
-
*
|
|
298
|
-
* ```
|
|
299
|
-
*/
|
|
300
|
-
/**
|
|
301
|
-
* 控件对象的事件监听
|
|
302
|
-
* @param eventNaem 事件名称
|
|
303
|
-
* @param fun 回调函数
|
|
304
|
-
* @returns void
|
|
305
|
-
* @example
|
|
306
|
-
* ```typescript
|
|
307
|
-
* Mx.MxFun.getCurrentDraw().addEvent("addResizeEvent", ()=> {})
|
|
308
|
-
* Mx.MxFun.getCurrentDraw().addEvent("viewchange", ()=> {})
|
|
309
|
-
* 图纸加载完成
|
|
310
|
-
* Mx.MxFun.getCurrentDraw().addEvent("loadComplete", ()=> {})
|
|
311
|
-
* 视区重绘事件.
|
|
312
|
-
* Mx.MxFun.getCurrentDraw().addEvent("render", (renderer)=> {})
|
|
313
|
-
* 视区大小被修改事件.,viewsize={viewWidth:viewWidth,viewHeight:viewHeight}
|
|
314
|
-
* Mx.MxFun.getCurrentDraw().addEvent("viewsizechange", (viewsize)=> {})
|
|
315
|
-
* 实体选择状态发生改变的事件.
|
|
316
|
-
* Mx.MxFun.getCurrentDraw().addEvent("MxEntitySelectChange", (aryId:Array<number>)=> {})
|
|
317
|
-
* ```
|
|
318
|
-
*/
|
|
319
|
-
MxDrawObject.prototype.addEvent = function (eventNaem, fun) {
|
|
320
|
-
return this._mxdrawObj.addEvent(eventNaem, fun);
|
|
321
|
-
};
|
|
322
|
-
/**
|
|
323
|
-
* INI设置
|
|
324
|
-
* @param options { EnableOsnapFunction: boolean; }
|
|
325
|
-
* @returns void
|
|
326
|
-
* @example
|
|
327
|
-
* ```typescript
|
|
328
|
-
* Mx.MxFun.getCurrentDraw().setIniset(options: { EnableOsnapFunction: true })
|
|
329
|
-
*
|
|
330
|
-
* ```
|
|
331
|
-
*/
|
|
332
|
-
MxDrawObject.prototype.setIniset = function (options) {
|
|
333
|
-
return this._mxdrawObj.setIniset(options);
|
|
334
|
-
};
|
|
335
|
-
/**
|
|
336
|
-
* 屏幕坐标到ThreeJS坐标
|
|
337
|
-
* @returns THREE.Vector3
|
|
338
|
-
* @example
|
|
339
|
-
* ```typescript
|
|
340
|
-
*
|
|
341
|
-
*
|
|
342
|
-
* ```
|
|
343
|
-
*/
|
|
344
|
-
MxDrawObject.prototype.screenCoord2World = function (x, y, z) {
|
|
345
|
-
return this._mxdrawObj.screenCoord2World(x, y, z);
|
|
346
|
-
};
|
|
347
|
-
/**
|
|
348
|
-
* ThreeJS坐标到屏幕坐标,屏幕坐标的Y轴向下。坐标原点在左上角.
|
|
349
|
-
* @returns THREE.Vector3
|
|
350
|
-
* @example
|
|
351
|
-
* ```typescript
|
|
352
|
-
*
|
|
353
|
-
*
|
|
354
|
-
* ```
|
|
355
|
-
*/
|
|
356
|
-
MxDrawObject.prototype.worldCoord2Screen = function (x, y, z) {
|
|
357
|
-
return this._mxdrawObj.worldCoord2Screen(x, y, z);
|
|
358
|
-
};
|
|
359
|
-
/**
|
|
360
|
-
* 屏幕坐标到DWG文档坐标
|
|
361
|
-
* @returns THREE.Vector3
|
|
362
|
-
* @example
|
|
363
|
-
* ```typescript
|
|
364
|
-
*
|
|
365
|
-
*
|
|
366
|
-
* ```
|
|
367
|
-
*/
|
|
368
|
-
MxDrawObject.prototype.screenCoord2Doc = function (x, y) {
|
|
369
|
-
return this._mxdrawObj.screenCoord2Doc(x, y, 0);
|
|
370
|
-
};
|
|
371
|
-
/**
|
|
372
|
-
* ThreeJS坐标长度到DWG文档坐标长度
|
|
373
|
-
* @returns number
|
|
374
|
-
* @example
|
|
375
|
-
* ```typescript
|
|
376
|
-
*
|
|
377
|
-
*
|
|
378
|
-
* ```
|
|
379
|
-
*/
|
|
380
|
-
MxDrawObject.prototype.worldCoordLong2Doc = function (l) {
|
|
381
|
-
return this._mxdrawObj.worldCoordLong2Doc(l);
|
|
382
|
-
};
|
|
383
|
-
/**
|
|
384
|
-
* DWG文档坐标长度到ThreeJS坐标长度
|
|
385
|
-
* @returns number
|
|
386
|
-
* @example
|
|
387
|
-
* ```typescript
|
|
388
|
-
*
|
|
389
|
-
*
|
|
390
|
-
* ```
|
|
391
|
-
*/
|
|
392
|
-
MxDrawObject.prototype.docCoordLong2World = function (l) {
|
|
393
|
-
return this._mxdrawObj.docCoordLong2World(l);
|
|
394
|
-
};
|
|
395
|
-
/**
|
|
396
|
-
* DWG文档坐标到ThreeJS坐标
|
|
397
|
-
* @returns number
|
|
398
|
-
* @example
|
|
399
|
-
* ```typescript
|
|
400
|
-
*
|
|
401
|
-
*
|
|
402
|
-
* ```
|
|
403
|
-
*/
|
|
404
|
-
MxDrawObject.prototype.docCoord2World = function (x, y, z) {
|
|
405
|
-
return this._mxdrawObj.docCoord2World(x, y, z);
|
|
406
|
-
};
|
|
407
|
-
/**
|
|
408
|
-
* DWG文档坐标到ThreeJS坐标
|
|
409
|
-
* @returns THREE.Vector3
|
|
410
|
-
* @example
|
|
411
|
-
* ```typescript
|
|
412
|
-
*
|
|
413
|
-
*
|
|
414
|
-
* ```
|
|
415
|
-
*/
|
|
416
|
-
MxDrawObject.prototype.docCoord2World2 = function (pt) {
|
|
417
|
-
return this._mxdrawObj.docCoord2World(pt.x, pt.y, pt.z);
|
|
418
|
-
};
|
|
419
|
-
/**
|
|
420
|
-
* ThreeJS坐标到DWG文档坐标
|
|
421
|
-
* @returns number
|
|
422
|
-
* @example
|
|
423
|
-
* ```typescript
|
|
424
|
-
*
|
|
425
|
-
*
|
|
426
|
-
* ```
|
|
427
|
-
*/
|
|
428
|
-
MxDrawObject.prototype.worldCoord2Doc = function (x, y, z) {
|
|
429
|
-
return this._mxdrawObj.worldCoord2Doc(x, y, z);
|
|
430
|
-
};
|
|
431
|
-
/**
|
|
432
|
-
* ThreeJS坐标到DWG文档坐标
|
|
433
|
-
* @returns THREE.Vector3
|
|
434
|
-
* @example
|
|
435
|
-
* ```typescript
|
|
436
|
-
*
|
|
437
|
-
*
|
|
438
|
-
* ```
|
|
439
|
-
*/
|
|
440
|
-
MxDrawObject.prototype.worldCoord2Doc2 = function (pt) {
|
|
441
|
-
return this._mxdrawObj.worldCoord2Doc(pt.x, pt.y, pt.z);
|
|
442
|
-
};
|
|
443
|
-
/**
|
|
444
|
-
* DWG文档坐标到屏幕坐标
|
|
445
|
-
* @returns number
|
|
446
|
-
* @example
|
|
447
|
-
* ```typescript
|
|
448
|
-
*
|
|
449
|
-
*
|
|
450
|
-
* ```
|
|
451
|
-
*/
|
|
452
|
-
MxDrawObject.prototype.docCoord2Screen = function (x, y) {
|
|
453
|
-
return this._mxdrawObj.docCoord2Screen(x, y, 0);
|
|
454
|
-
};
|
|
455
|
-
/**
|
|
456
|
-
* 屏幕坐标长度到DWG文档坐标长度
|
|
457
|
-
* @returns number
|
|
458
|
-
* @example
|
|
459
|
-
* ```typescript
|
|
460
|
-
*
|
|
461
|
-
*
|
|
462
|
-
* ```
|
|
463
|
-
*/
|
|
464
|
-
MxDrawObject.prototype.screenCoordLong2Doc = function (l) {
|
|
465
|
-
return this._mxdrawObj.screenCoordLong2Doc(l);
|
|
466
|
-
};
|
|
467
|
-
/**
|
|
468
|
-
* DWG文档坐标长度到屏幕坐标长度
|
|
469
|
-
* @returns number
|
|
470
|
-
* @example
|
|
471
|
-
* ```typescript
|
|
472
|
-
*
|
|
473
|
-
*
|
|
474
|
-
* ```
|
|
475
|
-
*/
|
|
476
|
-
MxDrawObject.prototype.docCoordLong2Screen = function (l) {
|
|
477
|
-
return this._mxdrawObj.docCoordLong2Screen(l);
|
|
478
|
-
};
|
|
479
|
-
/**
|
|
480
|
-
* 屏幕坐标长度到ThreeJS坐标长度
|
|
481
|
-
* @returns number
|
|
482
|
-
* @example
|
|
483
|
-
* ```typescript
|
|
484
|
-
*
|
|
485
|
-
*
|
|
486
|
-
* ```
|
|
487
|
-
*/
|
|
488
|
-
MxDrawObject.prototype.screenCoordLong2World = function (l) {
|
|
489
|
-
return this._mxdrawObj.screenCoordLong2World(l);
|
|
490
|
-
};
|
|
491
|
-
/**
|
|
492
|
-
* ThreeJS坐标长度到屏幕坐标长度
|
|
493
|
-
* @returns number
|
|
494
|
-
* @example
|
|
495
|
-
* ```typescript
|
|
496
|
-
*
|
|
497
|
-
*
|
|
498
|
-
* ```
|
|
499
|
-
*/
|
|
500
|
-
MxDrawObject.prototype.worldCoordLong2Screen = function (l) {
|
|
501
|
-
return this._mxdrawObj.worldCoordLong2Screen(l);
|
|
502
|
-
};
|
|
503
|
-
/**
|
|
504
|
-
* 初始WebGL Renderer的创建参数,该函数在MxFun.createMxObject函数调用时,调用。
|
|
505
|
-
* @param param
|
|
506
|
-
* @returns void
|
|
507
|
-
* @example
|
|
508
|
-
* ```typescript
|
|
509
|
-
* mxObj.initRendererParam({preserveDrawingBuffer: true})
|
|
510
|
-
*
|
|
511
|
-
* ```
|
|
512
|
-
*/
|
|
513
|
-
MxDrawObject.prototype.initRendererParam = function (param) {
|
|
514
|
-
return this._mxdrawObj.initRendererParam(param);
|
|
515
|
-
};
|
|
516
|
-
/**
|
|
517
|
-
* 添加一个自定义实体到图上。
|
|
518
|
-
* @param ent 自定义实体对象
|
|
519
|
-
* @returns number 返回对象的id.
|
|
520
|
-
* @example
|
|
521
|
-
* ```typescript
|
|
522
|
-
*
|
|
523
|
-
*
|
|
524
|
-
* ```
|
|
525
|
-
*/
|
|
526
|
-
MxDrawObject.prototype.addMxEntity = function (ent) {
|
|
527
|
-
return this._mxdrawObj.addMxEntity(ent);
|
|
528
|
-
};
|
|
529
|
-
/**
|
|
530
|
-
* 得到图上当前选择的对象.
|
|
531
|
-
* @returns Array<number> 返回对象的id数组.
|
|
532
|
-
* @example
|
|
533
|
-
* ```typescript
|
|
534
|
-
*
|
|
535
|
-
*
|
|
536
|
-
* ```
|
|
537
|
-
*/
|
|
538
|
-
MxDrawObject.prototype.getMxCurrentSelect = function () {
|
|
539
|
-
return this._mxdrawObj.getMxAllSelect();
|
|
540
|
-
};
|
|
541
|
-
/**
|
|
542
|
-
* 把对象添加到当前选择中.
|
|
543
|
-
* @returns void
|
|
544
|
-
* @example
|
|
545
|
-
* ```typescript
|
|
546
|
-
*
|
|
547
|
-
*
|
|
548
|
-
* ```
|
|
549
|
-
*/
|
|
550
|
-
MxDrawObject.prototype.addMxCurrentSelect = function (id) {
|
|
551
|
-
return this._mxdrawObj.addMxCurrentSelect(id);
|
|
552
|
-
};
|
|
553
|
-
/**
|
|
554
|
-
* 清除当前所有选择
|
|
555
|
-
* @returns void
|
|
556
|
-
* @example
|
|
557
|
-
* ```typescript
|
|
558
|
-
*
|
|
559
|
-
*
|
|
560
|
-
* ```
|
|
561
|
-
*/
|
|
562
|
-
MxDrawObject.prototype.clearMxCurrentSelect = function () {
|
|
563
|
-
return this._mxdrawObj.clearMxCurrentSelect();
|
|
564
|
-
};
|
|
565
|
-
/**
|
|
566
|
-
*通过id获取绘制的对象.
|
|
567
|
-
* @param id 返回对象的id
|
|
568
|
-
* @returns MxDbEntity
|
|
569
|
-
* @example
|
|
570
|
-
* ```typescript
|
|
571
|
-
*
|
|
572
|
-
*
|
|
573
|
-
* ```
|
|
574
|
-
*/
|
|
575
|
-
MxDrawObject.prototype.getMxEntity = function (id) {
|
|
576
|
-
return this._mxdrawObj.getMxEntityUserObject(id);
|
|
577
|
-
};
|
|
578
|
-
/**
|
|
579
|
-
* 查找某点位置处的用户自绘对象.
|
|
580
|
-
* @param ptMouse 查找的点位 THREE.Vector3,默认是文档坐标
|
|
581
|
-
* @returns MxDbEntity[] 返回用户自绘对象数组
|
|
582
|
-
* @example
|
|
583
|
-
* ```typescript
|
|
584
|
-
*
|
|
585
|
-
*
|
|
586
|
-
* ```
|
|
587
|
-
*/
|
|
588
|
-
MxDrawObject.prototype.findMxEntityAtPoint = function (ptMouse) {
|
|
589
|
-
return this._mxdrawObj.findMxEntityAtPoint(ptMouse);
|
|
590
|
-
};
|
|
591
|
-
/**
|
|
592
|
-
*得到所有用户自绘对象.
|
|
593
|
-
* @returns MxDbEntity[] 返回用户自绘对象数组
|
|
594
|
-
* @example
|
|
595
|
-
* ```typescript
|
|
596
|
-
*
|
|
597
|
-
*
|
|
598
|
-
* ```
|
|
599
|
-
*/
|
|
600
|
-
MxDrawObject.prototype.getAllMxEntity = function () {
|
|
601
|
-
return this._mxdrawObj.getAllMxEntity();
|
|
602
|
-
};
|
|
603
|
-
/**
|
|
604
|
-
* 设置鼠标中键移动视区。
|
|
605
|
-
* @param isPan 设置是否可以鼠标中键移动视区
|
|
606
|
-
* @returns
|
|
607
|
-
* @example
|
|
608
|
-
* ```typescript
|
|
609
|
-
*
|
|
610
|
-
*
|
|
611
|
-
* ```
|
|
612
|
-
*/
|
|
613
|
-
MxDrawObject.prototype.setMouseMiddlePan = function (isPan) {
|
|
614
|
-
return this._mxdrawObj.setMouseMiddlePan(isPan);
|
|
615
|
-
};
|
|
616
|
-
/**
|
|
617
|
-
*重新设置ThreeJS Controls状态.
|
|
618
|
-
* @returns
|
|
619
|
-
* @example
|
|
620
|
-
* ```typescript
|
|
621
|
-
*
|
|
622
|
-
*
|
|
623
|
-
* ```
|
|
624
|
-
*/
|
|
625
|
-
MxDrawObject.prototype.resetThreeJSControls = function () {
|
|
626
|
-
return this._mxdrawObj.resetThreeJSControls();
|
|
627
|
-
};
|
|
628
|
-
/**
|
|
629
|
-
* 启用或禁用鼠标中键滚动缩放视区
|
|
630
|
-
* @param isEnable 是否启用
|
|
631
|
-
* @returns
|
|
632
|
-
* @example
|
|
633
|
-
* ```typescript
|
|
634
|
-
*
|
|
635
|
-
*
|
|
636
|
-
* ```
|
|
637
|
-
*/
|
|
638
|
-
MxDrawObject.prototype.enableZoom = function (isEnable) {
|
|
639
|
-
return this._mxdrawObj.enableZoom(isEnable);
|
|
640
|
-
};
|
|
641
|
-
/**
|
|
642
|
-
* 启用或禁用鼠标移动视区
|
|
643
|
-
* @param isEnable 是否启用
|
|
644
|
-
* @returns
|
|
645
|
-
* @example
|
|
646
|
-
* ```typescript
|
|
647
|
-
*
|
|
648
|
-
*
|
|
649
|
-
* ```
|
|
650
|
-
*/
|
|
651
|
-
MxDrawObject.prototype.enablePan = function (isEnable) {
|
|
652
|
-
return this._mxdrawObj.enablePan(isEnable);
|
|
653
|
-
};
|
|
654
|
-
/**
|
|
655
|
-
* 删除MxEntity
|
|
656
|
-
* @param id 实体id.
|
|
657
|
-
* @returns
|
|
658
|
-
* @example
|
|
659
|
-
* ```typescript
|
|
660
|
-
*
|
|
661
|
-
*
|
|
662
|
-
* ```
|
|
663
|
-
*/
|
|
664
|
-
MxDrawObject.prototype.eraseMxEntity = function (id) {
|
|
665
|
-
return this._mxdrawObj.eraseMxEntity(id);
|
|
666
|
-
};
|
|
667
|
-
/**
|
|
668
|
-
* 移除安视图坐标绘制的对象.
|
|
669
|
-
* @param obj 对象.
|
|
670
|
-
* @returns
|
|
671
|
-
* @example
|
|
672
|
-
* ```typescript
|
|
673
|
-
*
|
|
674
|
-
*
|
|
675
|
-
* ```
|
|
676
|
-
*/
|
|
677
|
-
MxDrawObject.prototype.removeViewObject = function (obj) {
|
|
678
|
-
this._mxdrawObj.removeViewObject(obj);
|
|
679
|
-
};
|
|
680
|
-
/**
|
|
681
|
-
* 保存所有MxEntity的数据到json字符串.
|
|
682
|
-
* @param
|
|
683
|
-
* @returns json字符串
|
|
684
|
-
* @example
|
|
685
|
-
* ```typescript
|
|
686
|
-
*
|
|
687
|
-
*
|
|
688
|
-
* ```
|
|
689
|
-
*/
|
|
690
|
-
MxDrawObject.prototype.saveMxEntityToJson = function () {
|
|
691
|
-
return this._mxdrawObj.saveMxEntityToJson();
|
|
692
|
-
};
|
|
693
|
-
/**
|
|
694
|
-
* 从json字符串恢复MxEntity
|
|
695
|
-
* @param dataString json字符串.
|
|
696
|
-
* @returns
|
|
697
|
-
* @example
|
|
698
|
-
* ```typescript
|
|
699
|
-
*
|
|
700
|
-
*
|
|
701
|
-
* ```
|
|
702
|
-
*/
|
|
703
|
-
MxDrawObject.prototype.loadMxEntityFromJson = function (dataString, aryPreloadSVG) {
|
|
704
|
-
if (aryPreloadSVG === void 0) { aryPreloadSVG = null; }
|
|
705
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
706
|
-
var iLen, i;
|
|
707
|
-
return __generator(this, function (_a) {
|
|
708
|
-
switch (_a.label) {
|
|
709
|
-
case 0:
|
|
710
|
-
if (!aryPreloadSVG) return [3 /*break*/, 4];
|
|
711
|
-
iLen = aryPreloadSVG.length;
|
|
712
|
-
i = 0;
|
|
713
|
-
_a.label = 1;
|
|
714
|
-
case 1:
|
|
715
|
-
if (!(i < iLen)) return [3 /*break*/, 4];
|
|
716
|
-
return [4 /*yield*/, MxThreeJS_1.default.loadSVG(aryPreloadSVG[i])];
|
|
717
|
-
case 2:
|
|
718
|
-
_a.sent();
|
|
719
|
-
_a.label = 3;
|
|
720
|
-
case 3:
|
|
721
|
-
i++;
|
|
722
|
-
return [3 /*break*/, 1];
|
|
723
|
-
case 4: return [2 /*return*/, this._mxdrawObj.loadMxEntityFromJson(dataString)];
|
|
724
|
-
}
|
|
725
|
-
});
|
|
726
|
-
});
|
|
727
|
-
};
|
|
728
|
-
/**
|
|
729
|
-
* 删除所有对MxEntity
|
|
730
|
-
* @param
|
|
731
|
-
* @returns
|
|
732
|
-
* @example
|
|
733
|
-
* ```typescript
|
|
734
|
-
*
|
|
735
|
-
*
|
|
736
|
-
* ```
|
|
737
|
-
*/
|
|
738
|
-
MxDrawObject.prototype.eraseAllMxEntity = function () {
|
|
739
|
-
return this._mxdrawObj.eraseAllMxEntity();
|
|
740
|
-
};
|
|
741
|
-
/**
|
|
742
|
-
* 把该控件对象,设置成当前控件.
|
|
743
|
-
* @param
|
|
744
|
-
* @returns
|
|
745
|
-
* @example
|
|
746
|
-
* ```typescript
|
|
747
|
-
*
|
|
748
|
-
*
|
|
749
|
-
* ```
|
|
750
|
-
*/
|
|
751
|
-
MxDrawObject.prototype.makeCurrent = function () {
|
|
752
|
-
this._mxdrawObj.makeCurrent();
|
|
753
|
-
};
|
|
754
|
-
/**
|
|
755
|
-
* 得到视区中心的文档坐标.
|
|
756
|
-
* @param
|
|
757
|
-
* @returns
|
|
758
|
-
* @example
|
|
759
|
-
* ```typescript
|
|
760
|
-
*
|
|
761
|
-
*
|
|
762
|
-
* ```
|
|
763
|
-
*/
|
|
764
|
-
MxDrawObject.prototype.getViewCenterDocCoord = function () {
|
|
765
|
-
return this._mxdrawObj.getViewCenterDocCoord();
|
|
766
|
-
};
|
|
767
|
-
/**
|
|
768
|
-
* 画布大小,自动修改到它父亲div大小。
|
|
769
|
-
* @param
|
|
770
|
-
* @returns
|
|
771
|
-
* @example
|
|
772
|
-
* ```typescript
|
|
773
|
-
*
|
|
774
|
-
*
|
|
775
|
-
* ```
|
|
776
|
-
*/
|
|
777
|
-
MxDrawObject.prototype.updateCanvasSize = function () {
|
|
778
|
-
this._mxdrawObj.updateCanvasSize();
|
|
779
|
-
};
|
|
780
|
-
return MxDrawObject;
|
|
781
|
-
}());
|
|
782
|
-
exports.default = MxDrawObject;
|
|
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 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}();exports.default=MxDrawObject;
|