mxdraw 0.1.22 → 0.1.26
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/MxDbCloudLine/MxDbCloudLine.js +1 -0
- package/dist/lib/MxModule/MxDbCloudLine/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/MxDbEllipse/MxDbEllipse.js +1 -0
- package/dist/lib/MxModule/MxDbEllipse/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/MxDbLeadComment/MxDbLeadComment.js +1 -0
- package/dist/lib/MxModule/MxDbLeadComment/index.js +1 -0
- 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/MxDbRectBoxLeadComment/MxDbRectBoxLeadComment.js +1 -0
- package/dist/lib/MxModule/MxDbRectBoxLeadComment/index.js +1 -0
- package/dist/lib/MxModule/MxDbRegularPolygon/MxDbRegularPolygon.js +1 -0
- package/dist/lib/MxModule/MxDbRegularPolygon/index.js +1 -0
- 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/MxDbText/MxDbText.js +1 -0
- package/dist/lib/MxModule/MxDbText/index.js +1 -0
- 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 -683
- package/dist/lib/MxModule/MxFun/index.js +1 -4
- package/dist/lib/MxModule/MxThreeJS/MxThreeJS.js +1 -296
- package/dist/lib/MxModule/MxThreeJS/MxThreeJS.mixin.js +1 -29
- 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 -7760
- 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/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/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/MxDbCloudLine/MxDbCloudLine.d.ts +27 -0
- package/dist/types/MxModule/MxDbCloudLine/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/MxDbEllipse/MxDbEllipse.d.ts +18 -0
- package/dist/types/MxModule/MxDbEllipse/index.d.ts +3 -0
- package/dist/types/MxModule/MxDbLeadComment/MxDbLeadComment.d.ts +17 -0
- package/dist/types/MxModule/MxDbLeadComment/index.d.ts +3 -0
- package/dist/types/MxModule/MxDbRectBoxLeadComment/MxDbRectBoxLeadComment.d.ts +19 -0
- package/dist/types/MxModule/MxDbRectBoxLeadComment/index.d.ts +3 -0
- package/dist/types/MxModule/MxDbRegularPolygon/MxDbRegularPolygon.d.ts +18 -0
- package/dist/types/MxModule/MxDbRegularPolygon/index.d.ts +2 -0
- package/dist/types/MxModule/MxDbText/MxDbText.d.ts +20 -0
- package/dist/types/MxModule/MxDbText/index.d.ts +3 -0
- package/dist/types/MxModule/MxDrawObject/MxDrawObject.d.ts +11 -0
- package/dist/types/MxModule/MxFun/MxFun.d.ts +8 -33
- package/dist/types/MxModule/Mxassembly/Mxassembly.d.ts +9 -3
- package/dist/types/mxdraw.d.ts +27 -2
- package/dist/types/tools/three/index.d.ts +41 -2
- package/package.json +3 -2
- package/dist/lib/MxModule/McGeVector3d/McGeVector3d.js +0 -3
- package/dist/lib/MxModule/McGeVector3d/index.js +0 -3
- package/dist/types/MxModule/McGeVector3d/McGeVector3d.d.ts +0 -18
- package/dist/types/MxModule/McGeVector3d/index.d.ts +0 -3
|
@@ -1,128 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/** @module McEdGetPointWorldDrawObject*/
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
var store_1 = require("../store/store");
|
|
5
|
-
/**
|
|
6
|
-
* McEdGetPointWorldDrawObject 用于构建一个动态绘制回调对象
|
|
7
|
-
* @example ```typescript
|
|
8
|
-
* Mx.McEdGetPointWorldDrawObject()
|
|
9
|
-
* ```
|
|
10
|
-
*/
|
|
11
|
-
var McEdGetPointWorldDrawObject = /** @class */ (function () {
|
|
12
|
-
function McEdGetPointWorldDrawObject() {
|
|
13
|
-
var _this = this;
|
|
14
|
-
var _a;
|
|
15
|
-
this._McEdGetPointWorldDraw = new ((_a = store_1.default.state.MxFun) === null || _a === void 0 ? void 0 : _a.getMxJigCmdManager().McEdGetPointWorldDrawObjectClass())();
|
|
16
|
-
/** @internal */
|
|
17
|
-
this._get = function () {
|
|
18
|
-
return _this._McEdGetPointWorldDraw;
|
|
19
|
-
};
|
|
20
|
-
}
|
|
21
|
-
/**
|
|
22
|
-
* 绘制圆
|
|
23
|
-
* @param cen 圆心位置
|
|
24
|
-
* @param dRadius 圆半径
|
|
25
|
-
* @returns void
|
|
26
|
-
* @example
|
|
27
|
-
* ``` typescript
|
|
28
|
-
* pWorldDraw.drawCircle(new HTREE.Vector3(0,100,5), 6)
|
|
29
|
-
* ```
|
|
30
|
-
*
|
|
31
|
-
*/
|
|
32
|
-
McEdGetPointWorldDrawObject.prototype.drawCircle = function (cen, dRadius) {
|
|
33
|
-
return this._McEdGetPointWorldDraw.drawCircle(cen, dRadius);
|
|
34
|
-
};
|
|
35
|
-
/**
|
|
36
|
-
* 绘制直线
|
|
37
|
-
* @param pt1 开始点
|
|
38
|
-
* @param pt2 结束点
|
|
39
|
-
* @returns void
|
|
40
|
-
* @example
|
|
41
|
-
* ``` typescript
|
|
42
|
-
* pWorldDraw.drawLine(new HTREE.Vector3(0,100,5), new HTREE.Vector3(0,600,5))
|
|
43
|
-
* ```
|
|
44
|
-
*
|
|
45
|
-
*/
|
|
46
|
-
McEdGetPointWorldDrawObject.prototype.drawLine = function (pt1, pt2) {
|
|
47
|
-
return this._McEdGetPointWorldDraw.drawLine(pt1, pt2);
|
|
48
|
-
};
|
|
49
|
-
/**
|
|
50
|
-
* 绘制一个Three.js对象.
|
|
51
|
-
* @param ent THREE.Object3D对象
|
|
52
|
-
* @returns void
|
|
53
|
-
* @example
|
|
54
|
-
* ``` typescript
|
|
55
|
-
* pWorldDraw.drawEntity(new THREE.Object3D()))
|
|
56
|
-
* ```
|
|
57
|
-
*
|
|
58
|
-
*/
|
|
59
|
-
McEdGetPointWorldDrawObject.prototype.drawEntity = function (ent) {
|
|
60
|
-
return this._McEdGetPointWorldDraw.drawEntity(ent);
|
|
61
|
-
};
|
|
62
|
-
/**
|
|
63
|
-
* 绘制一个文档对象
|
|
64
|
-
* @param sText 文本
|
|
65
|
-
* @param iSize 大小
|
|
66
|
-
* @param dAngle 角度
|
|
67
|
-
* @param pt 位置
|
|
68
|
-
* @returns void
|
|
69
|
-
* @example
|
|
70
|
-
* ``` typescript
|
|
71
|
-
* pWorldDraw.drawText("字符串" ,36 ,90 ,new HTREE.Vector3(0,100,5))
|
|
72
|
-
* ```
|
|
73
|
-
*
|
|
74
|
-
*/
|
|
75
|
-
McEdGetPointWorldDrawObject.prototype.drawText = function (sText, iSize, dAngle, pt) {
|
|
76
|
-
return this._McEdGetPointWorldDraw.drawText(sText, iSize, dAngle, pt);
|
|
77
|
-
};
|
|
78
|
-
/**
|
|
79
|
-
* 设置动态绘制回调函数。
|
|
80
|
-
* @param call 回调函数 currentPoint 回调参数 当前位置 pWorldDraw 回调参数文档绘制对象
|
|
81
|
-
* @returns void
|
|
82
|
-
* @example
|
|
83
|
-
* ``` typescript
|
|
84
|
-
* pWorldDraw.setDraw((currentPoint, pWorldDraw)=> {
|
|
85
|
-
*
|
|
86
|
-
* })
|
|
87
|
-
* ```
|
|
88
|
-
*/
|
|
89
|
-
McEdGetPointWorldDrawObject.prototype.setDraw = function (call) {
|
|
90
|
-
return this._McEdGetPointWorldDraw.setDraw(call);
|
|
91
|
-
};
|
|
92
|
-
/**
|
|
93
|
-
* 设置绘制对象颜色.
|
|
94
|
-
* @param iColor 颜色
|
|
95
|
-
* @returns void
|
|
96
|
-
* @example
|
|
97
|
-
* ``` typescript
|
|
98
|
-
* pWorldDraw.setColor(0xFFFFFF)
|
|
99
|
-
* ```
|
|
100
|
-
*/
|
|
101
|
-
McEdGetPointWorldDrawObject.prototype.setColor = function (iColor) {
|
|
102
|
-
return this._McEdGetPointWorldDraw.setColor(iColor);
|
|
103
|
-
};
|
|
104
|
-
/**
|
|
105
|
-
* 得到绘制对象颜色.
|
|
106
|
-
* @returns 颜色
|
|
107
|
-
* @example
|
|
108
|
-
* ``` typescript
|
|
109
|
-
* pWorldDraw.getColor()
|
|
110
|
-
* ```
|
|
111
|
-
*/
|
|
112
|
-
McEdGetPointWorldDrawObject.prototype.getColor = function () {
|
|
113
|
-
return this._McEdGetPointWorldDraw.getColor();
|
|
114
|
-
};
|
|
115
|
-
/**
|
|
116
|
-
* 动态绘制一个自定义实体
|
|
117
|
-
* @returns
|
|
118
|
-
* @example
|
|
119
|
-
* ``` typescript
|
|
120
|
-
*
|
|
121
|
-
* ```
|
|
122
|
-
*/
|
|
123
|
-
McEdGetPointWorldDrawObject.prototype.drawCustomEntity = function (ent) {
|
|
124
|
-
return this._McEdGetPointWorldDraw.drawCustomEntity(ent);
|
|
125
|
-
};
|
|
126
|
-
return McEdGetPointWorldDrawObject;
|
|
127
|
-
}());
|
|
128
|
-
exports.default = McEdGetPointWorldDrawObject;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var store_1=require("../store/store"),McEdGetPointWorldDrawObject=function(){function t(){var t,r=this;this._McEdGetPointWorldDraw=new(null===(t=store_1.default.state.MxFun)||void 0===t?void 0:t.getMxJigCmdManager().McEdGetPointWorldDrawObjectClass()),this._get=function(){return r._McEdGetPointWorldDraw}}return t.prototype.drawCircle=function(t,r){return this._McEdGetPointWorldDraw.drawCircle(t,r)},t.prototype.drawLine=function(t,r){return this._McEdGetPointWorldDraw.drawLine(t,r)},t.prototype.drawEntity=function(t){return this._McEdGetPointWorldDraw.drawEntity(t)},t.prototype.drawText=function(t,r,o,e){return this._McEdGetPointWorldDraw.drawText(t,r,o,e)},t.prototype.setDraw=function(t){return this._McEdGetPointWorldDraw.setDraw(t)},t.prototype.setColor=function(t){return this._McEdGetPointWorldDraw.setColor(t)},t.prototype.getColor=function(){return this._McEdGetPointWorldDraw.getColor()},t.prototype.drawCustomEntity=function(t){return this._McEdGetPointWorldDraw.drawCustomEntity(t)},t}();exports.default=McEdGetPointWorldDrawObject;
|
|
@@ -1,5 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/** @module McEdGetPointWorldDrawObject*/
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
var McEdGetPointWorldDrawObjectClass_1 = require("./McEdGetPointWorldDrawObjectClass");
|
|
5
|
-
exports.default = McEdGetPointWorldDrawObjectClass_1.default;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var McEdGetPointWorldDrawObjectClass_1=require("./McEdGetPointWorldDrawObjectClass");exports.default=McEdGetPointWorldDrawObjectClass_1.default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var Mxassembly_1=require("../Mxassembly"),store_1=require("../store/store"),McGeTool=function(){function e(){this.mxgeTool=null}return e.prototype.initImp=function(){this.mxgeTool||store_1.default.state.Mxassembly&&(this.mxgeTool=new store_1.default.state.Mxassembly.McGeTool)},e.prototype.calcArea=function(e){if(this.initImp(),e instanceof Array){var t=Mxassembly_1.default.NewMcGePoint3dArray(e);return this.mxgeTool.calcArea(t)}return this.mxgeTool.calcArea(e)},e.prototype.pointInPolyline=function(e,t){this.initImp();var o=t;t instanceof Array&&(o=Mxassembly_1.default.NewMcGePoint3dArray(t));var r=Mxassembly_1.default.NewMcGePoint3d(e.x,e.y,e.z);return this.mxgeTool.pointInPolyline(r,o)},e}();exports.default=McGeTool;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var McGeTool_1=require("./McGeTool");exports.default=new McGeTool_1.default;
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});
|
|
@@ -1,19 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/** @module McGiWorldDrawType*/
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
/**
|
|
5
|
-
* 动态绘制类型
|
|
6
|
-
* @example ```typescript
|
|
7
|
-
|
|
8
|
-
* ```
|
|
9
|
-
*/
|
|
10
|
-
var McGiWorldDrawType;
|
|
11
|
-
(function (McGiWorldDrawType) {
|
|
12
|
-
/** 正常绘制 */
|
|
13
|
-
McGiWorldDrawType[McGiWorldDrawType["kWorldDraw"] = 1] = "kWorldDraw";
|
|
14
|
-
/** 动态拖动的绘制 */
|
|
15
|
-
McGiWorldDrawType[McGiWorldDrawType["kDynDragDraw"] = 2] = "kDynDragDraw";
|
|
16
|
-
/** 对选择高亮的绘制 */
|
|
17
|
-
McGiWorldDrawType[McGiWorldDrawType["kSelectDraw"] = 3] = "kSelectDraw";
|
|
18
|
-
})(McGiWorldDrawType || (McGiWorldDrawType = {}));
|
|
19
|
-
exports.default = McGiWorldDrawType;
|
|
1
|
+
"use strict";var McGiWorldDrawType;Object.defineProperty(exports,"__esModule",{value:!0}),function(r){r[r.kWorldDraw=1]="kWorldDraw",r[r.kDynDragDraw=2]="kDynDragDraw",r[r.kSelectDraw=3]="kSelectDraw"}(McGiWorldDrawType||(McGiWorldDrawType={})),exports.default=McGiWorldDrawType;
|
|
@@ -1,4 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
var McGiWorldDrawType_1 = require("./McGiWorldDrawType");
|
|
4
|
-
exports.default = McGiWorldDrawType_1.default;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var McGiWorldDrawType_1=require("./McGiWorldDrawType");exports.default=McGiWorldDrawType_1.default;
|
|
@@ -1,31 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/** @module MrxDbgUiPrBaseReturn*/
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
/**
|
|
5
|
-
* MrxDbgUiPrBaseReturn枚举
|
|
6
|
-
* @description
|
|
7
|
-
* 用于适配{@link MrxDbgUiPrPoint.go} 和 {@link MrxDbgUiPrPoint.goWhile} 方法中的回调参数`status`
|
|
8
|
-
* @example
|
|
9
|
-
* ```
|
|
10
|
-
* const Point = new Mx.MrxDbgUiPrPoint()
|
|
11
|
-
* Point.go((status)=> {
|
|
12
|
-
* if(Mx.MrxDbgUiPrBaseReturn.kCancel === status) {
|
|
13
|
-
* // 取消
|
|
14
|
-
* }
|
|
15
|
-
* })
|
|
16
|
-
*
|
|
17
|
-
* ```
|
|
18
|
-
* @enum
|
|
19
|
-
* */
|
|
20
|
-
var MrxDbgUiPrBaseReturn;
|
|
21
|
-
(function (MrxDbgUiPrBaseReturn) {
|
|
22
|
-
/** 取消 */
|
|
23
|
-
MrxDbgUiPrBaseReturn[MrxDbgUiPrBaseReturn["kCancel"] = -2] = "kCancel";
|
|
24
|
-
/** 空输入,当输入关键字和实体时会返回此值 */
|
|
25
|
-
MrxDbgUiPrBaseReturn[MrxDbgUiPrBaseReturn["kNone"] = -1] = "kNone";
|
|
26
|
-
/** 获取用户输入成功 */
|
|
27
|
-
MrxDbgUiPrBaseReturn[MrxDbgUiPrBaseReturn["kOk"] = 0] = "kOk";
|
|
28
|
-
/** 用户输入了关键字*/
|
|
29
|
-
MrxDbgUiPrBaseReturn[MrxDbgUiPrBaseReturn["kKeyWord"] = 1] = "kKeyWord";
|
|
30
|
-
})(MrxDbgUiPrBaseReturn || (MrxDbgUiPrBaseReturn = {}));
|
|
31
|
-
exports.default = MrxDbgUiPrBaseReturn;
|
|
1
|
+
"use strict";var MrxDbgUiPrBaseReturn;Object.defineProperty(exports,"__esModule",{value:!0}),function(e){e[e.kCancel=-2]="kCancel",e[e.kNone=-1]="kNone",e[e.kOk=0]="kOk",e[e.kKeyWord=1]="kKeyWord"}(MrxDbgUiPrBaseReturn||(MrxDbgUiPrBaseReturn={})),exports.default=MrxDbgUiPrBaseReturn;
|
|
@@ -1,5 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/** @module MrxDbgUiPrBaseReturn*/
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
var MrxDbgUiPrBaseReturn_1 = require("./MrxDbgUiPrBaseReturn");
|
|
5
|
-
exports.default = MrxDbgUiPrBaseReturn_1.default;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var MrxDbgUiPrBaseReturn_1=require("./MrxDbgUiPrBaseReturn");exports.default=MrxDbgUiPrBaseReturn_1.default;
|
|
@@ -1,159 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/** @module MrxDbgUiPrPointClass */
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
var McEdGetPointWorldDrawObject_1 = require("../McEdGetPointWorldDrawObject");
|
|
5
|
-
var store_1 = require("../store/store");
|
|
6
|
-
var _MrxDbgUiPrPoint;
|
|
7
|
-
/**
|
|
8
|
-
* MrxDbgUiPrPoint 用于构建一个取点对象
|
|
9
|
-
* @example ```typescript
|
|
10
|
-
* new Mx.MrxDbgUiPrPoint()
|
|
11
|
-
* ```
|
|
12
|
-
*/
|
|
13
|
-
var MrxDbgUiPrPoint = /** @class */ (function () {
|
|
14
|
-
function MrxDbgUiPrPoint() {
|
|
15
|
-
var _a;
|
|
16
|
-
_MrxDbgUiPrPoint = new ((_a = store_1.default.state.MxFun) === null || _a === void 0 ? void 0 : _a.getMxJigCmdManager().getMrxDbgUiPrPointClass())();
|
|
17
|
-
}
|
|
18
|
-
/**
|
|
19
|
-
* 返回关键字列表
|
|
20
|
-
* @returns 关键词列表
|
|
21
|
-
*/
|
|
22
|
-
MrxDbgUiPrPoint.prototype.keyWords = function () {
|
|
23
|
-
return _MrxDbgUiPrPoint.keyWords();
|
|
24
|
-
};
|
|
25
|
-
/**
|
|
26
|
-
* 设置关键字列表
|
|
27
|
-
* @param keyWordList 关键词列表
|
|
28
|
-
* @returns void
|
|
29
|
-
*/
|
|
30
|
-
MrxDbgUiPrPoint.prototype.setKeyWords = function (keyWordList) {
|
|
31
|
-
return _MrxDbgUiPrPoint.setKeyWords(keyWordList);
|
|
32
|
-
};
|
|
33
|
-
/**
|
|
34
|
-
* 提示字符串
|
|
35
|
-
* @returns 提示消息
|
|
36
|
-
*/
|
|
37
|
-
MrxDbgUiPrPoint.prototype.message = function () {
|
|
38
|
-
return _MrxDbgUiPrPoint.message();
|
|
39
|
-
};
|
|
40
|
-
/**
|
|
41
|
-
* 设置提示字符串
|
|
42
|
-
* @param message 提示消息
|
|
43
|
-
* @returns 提示消息
|
|
44
|
-
*/
|
|
45
|
-
MrxDbgUiPrPoint.prototype.setMessage = function (message) {
|
|
46
|
-
return _MrxDbgUiPrPoint.setMessage(message);
|
|
47
|
-
};
|
|
48
|
-
/**
|
|
49
|
-
* 返回用户选择的关键字
|
|
50
|
-
* @returns 选择的关键字
|
|
51
|
-
*/
|
|
52
|
-
MrxDbgUiPrPoint.prototype.keyWordPicked = function () {
|
|
53
|
-
return _MrxDbgUiPrPoint.keyWordPicked();
|
|
54
|
-
};
|
|
55
|
-
/**
|
|
56
|
-
* 测试某一个关键字是否被用户选择
|
|
57
|
-
* @param matchKeyWord 要检测的关键字
|
|
58
|
-
* @returns true为真
|
|
59
|
-
*/
|
|
60
|
-
MrxDbgUiPrPoint.prototype.isKeyWordPicked = function (matchKeyWord) {
|
|
61
|
-
return _MrxDbgUiPrPoint.isKeyWordPicked(matchKeyWord);
|
|
62
|
-
};
|
|
63
|
-
/**
|
|
64
|
-
* 设置交互过程的动态绘制调用对象
|
|
65
|
-
* @param pDraw {@link McEdGetPointWorldDrawObject | 动态绘制调用对象}
|
|
66
|
-
* @returns void
|
|
67
|
-
*/
|
|
68
|
-
MrxDbgUiPrPoint.prototype.setUserDraw = function (pDraw) {
|
|
69
|
-
if (typeof pDraw === 'function') {
|
|
70
|
-
var worldDrawComment = new McEdGetPointWorldDrawObject_1.default();
|
|
71
|
-
worldDrawComment.setDraw(pDraw);
|
|
72
|
-
_MrxDbgUiPrPoint.setUserDraw(worldDrawComment._get());
|
|
73
|
-
}
|
|
74
|
-
else {
|
|
75
|
-
return _MrxDbgUiPrPoint.setUserDraw(pDraw._get ? pDraw._get() : pDraw);
|
|
76
|
-
}
|
|
77
|
-
};
|
|
78
|
-
/**
|
|
79
|
-
* 得以获取的点对象,Three.js坐标
|
|
80
|
-
* @returns 点对象 THREE.THREE.Vector3
|
|
81
|
-
*/
|
|
82
|
-
MrxDbgUiPrPoint.prototype.value = function () {
|
|
83
|
-
return _MrxDbgUiPrPoint.value();
|
|
84
|
-
};
|
|
85
|
-
/**
|
|
86
|
-
* 得以获取的点对象,DWG图纸坐标.
|
|
87
|
-
* @returns 点对象 DWG图纸坐标
|
|
88
|
-
*/
|
|
89
|
-
MrxDbgUiPrPoint.prototype.valueDocCoord = function () {
|
|
90
|
-
return _MrxDbgUiPrPoint.valueDocCoord();
|
|
91
|
-
};
|
|
92
|
-
/**
|
|
93
|
-
* 得到动态拖动的基点
|
|
94
|
-
* @returns 基点 THREE.THREE.Vector3
|
|
95
|
-
*/
|
|
96
|
-
MrxDbgUiPrPoint.prototype.basePt = function () {
|
|
97
|
-
return _MrxDbgUiPrPoint.basePt();
|
|
98
|
-
};
|
|
99
|
-
/**
|
|
100
|
-
* 设置动态拖动的基点
|
|
101
|
-
* @param basePt 基点 THREE.THREE.Vector3
|
|
102
|
-
* @returns 点对象 DWG图纸坐标
|
|
103
|
-
*/
|
|
104
|
-
MrxDbgUiPrPoint.prototype.setBasePt = function (basePt) {
|
|
105
|
-
return _MrxDbgUiPrPoint.setBasePt(basePt);
|
|
106
|
-
};
|
|
107
|
-
/**
|
|
108
|
-
* 设置使用动态拖动的基点
|
|
109
|
-
* @param useIt 是否设置 默认为false
|
|
110
|
-
* @returns void
|
|
111
|
-
*/
|
|
112
|
-
MrxDbgUiPrPoint.prototype.setUseBasePt = function (useIt) {
|
|
113
|
-
return _MrxDbgUiPrPoint.setUseBasePt(useIt);
|
|
114
|
-
};
|
|
115
|
-
/**
|
|
116
|
-
* 开始动态拖动
|
|
117
|
-
* @param retcall 回调参数status {@link MrxDbgUiPrBaseReturn | 状态值}
|
|
118
|
-
* @returns void
|
|
119
|
-
*/
|
|
120
|
-
MrxDbgUiPrPoint.prototype.go = function (retcall) {
|
|
121
|
-
if (retcall) {
|
|
122
|
-
_MrxDbgUiPrPoint.go(retcall);
|
|
123
|
-
return new Promise(function (resolve, reject) {
|
|
124
|
-
resolve(null);
|
|
125
|
-
});
|
|
126
|
-
}
|
|
127
|
-
else {
|
|
128
|
-
return new Promise(function (resolve, reject) {
|
|
129
|
-
_MrxDbgUiPrPoint.go(function (status) {
|
|
130
|
-
if (status != 0) {
|
|
131
|
-
resolve(null);
|
|
132
|
-
}
|
|
133
|
-
else {
|
|
134
|
-
resolve(_MrxDbgUiPrPoint.value());
|
|
135
|
-
}
|
|
136
|
-
});
|
|
137
|
-
});
|
|
138
|
-
}
|
|
139
|
-
};
|
|
140
|
-
/**
|
|
141
|
-
* 动态拖动,连续取点,直到ESC退出。
|
|
142
|
-
* @param retcall 回调参数status {@link MrxDbgUiPrBaseReturn | 状态值}
|
|
143
|
-
* @param exitcall 回调参数status {@link MrxDbgUiPrBaseReturn | 状态值}
|
|
144
|
-
* @returns void
|
|
145
|
-
*/
|
|
146
|
-
MrxDbgUiPrPoint.prototype.goWhile = function (retcall, exitcall) {
|
|
147
|
-
return _MrxDbgUiPrPoint.goWhile(retcall, exitcall);
|
|
148
|
-
};
|
|
149
|
-
/**
|
|
150
|
-
* 把动态绘制的对象,保留到图上。
|
|
151
|
-
* @param callAddEntity 回调参数ent 类型:THREE.THREE.Object3D
|
|
152
|
-
* @returns 点对象 DWG图纸坐标
|
|
153
|
-
*/
|
|
154
|
-
MrxDbgUiPrPoint.prototype.drawReserve = function (callAddEntity) {
|
|
155
|
-
return _MrxDbgUiPrPoint.drawReserve(callAddEntity);
|
|
156
|
-
};
|
|
157
|
-
return MrxDbgUiPrPoint;
|
|
158
|
-
}());
|
|
159
|
-
exports.default = MrxDbgUiPrPoint;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var _MrxDbgUiPrPoint,McEdGetPointWorldDrawObject_1=require("../McEdGetPointWorldDrawObject"),store_1=require("../store/store"),MrxDbgUiPrPoint=function(){function r(){var r;_MrxDbgUiPrPoint=new(null===(r=store_1.default.state.MxFun)||void 0===r?void 0:r.getMxJigCmdManager().getMrxDbgUiPrPointClass())}return r.prototype.keyWords=function(){return _MrxDbgUiPrPoint.keyWords()},r.prototype.setKeyWords=function(r){return _MrxDbgUiPrPoint.setKeyWords(r)},r.prototype.message=function(){return _MrxDbgUiPrPoint.message()},r.prototype.setMessage=function(r){return _MrxDbgUiPrPoint.setMessage(r)},r.prototype.keyWordPicked=function(){return _MrxDbgUiPrPoint.keyWordPicked()},r.prototype.isKeyWordPicked=function(r){return _MrxDbgUiPrPoint.isKeyWordPicked(r)},r.prototype.setUserDraw=function(r){if("function"!=typeof r)return _MrxDbgUiPrPoint.setUserDraw(r._get?r._get():r);var t=new McEdGetPointWorldDrawObject_1.default;t.setDraw(r),_MrxDbgUiPrPoint.setUserDraw(t._get())},r.prototype.value=function(){return _MrxDbgUiPrPoint.value()},r.prototype.valueDocCoord=function(){return _MrxDbgUiPrPoint.valueDocCoord()},r.prototype.basePt=function(){return _MrxDbgUiPrPoint.basePt()},r.prototype.setBasePt=function(r){return _MrxDbgUiPrPoint.setBasePt(r)},r.prototype.setUseBasePt=function(r){return _MrxDbgUiPrPoint.setUseBasePt(r)},r.prototype.go=function(r){return r?(_MrxDbgUiPrPoint.go(r),new Promise(function(r,t){r(null)})):new Promise(function(r,t){_MrxDbgUiPrPoint.go(function(t){r(0!=t?null:_MrxDbgUiPrPoint.value())})})},r.prototype.goWhile=function(r,t){return _MrxDbgUiPrPoint.goWhile(r,t)},r.prototype.drawReserve=function(r){return _MrxDbgUiPrPoint.drawReserve(r)},r}();exports.default=MrxDbgUiPrPoint;
|
|
@@ -1,5 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/** @module MrxDbgUiPrPointClass */
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
var MrxDbgUiPrPointClass_1 = require("./MrxDbgUiPrPointClass");
|
|
5
|
-
exports.default = MrxDbgUiPrPointClass_1.default;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var MrxDbgUiPrPointClass_1=require("./MrxDbgUiPrPointClass");exports.default=MrxDbgUiPrPointClass_1.default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var __extends=this&&this.__extends||function(){var t=function(n,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])})(n,o)};return function(n,o){if("function"!=typeof o&&null!==o)throw new TypeError("Class extends value "+String(o)+" is not a constructor or null");function e(){this.constructor=n}t(n,o),n.prototype=null===o?Object.create(o):(e.prototype=o.prototype,new e)}}();Object.defineProperty(exports,"__esModule",{value:!0});var three_1=require("three"),MxDbEntity_1=require("../MxDbEntity"),index_1=require("../../tools/three/index"),Mx3PointArc=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.point1=new three_1.Vector3,n.point2=new three_1.Vector3,n.point3=new three_1.Vector3,n}return __extends(n,t),n.prototype.getTypeName=function(){return"Mx3PointArc"},n.prototype.create=function(){return new n},n.prototype.worldDraw=function(t){var n=(0,index_1.createThreePointArc)(this.point1,this.point2,this.point3,!0).arc;t.drawEntity(n)},n.prototype.getGripPoints=function(){return[this.point1,this.point2,this.point3]},n.prototype.moveGripPointsAt=function(t,n){return 0===t?this.point1.add(n):1===t?this.point2.add(n):2===t&&this.point3.add(n),!0},n.prototype.dwgIn=function(t){return this.onDwgIn(t),this.point1.copy(t.point1),this.point2.copy(t.point2),this.point3.copy(t.point3),t},n.prototype.dwgOut=function(t){return this.onDwgOut(t),t.point1=this.point1,t.point2=this.point2,t.point3=this.point3,t},n}(MxDbEntity_1.default);exports.default=Mx3PointArc;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var Mx3PointArc_1=require("./Mx3PointArc");exports.default=Mx3PointArc_1.default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var __extends=this&&this.__extends||function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();Object.defineProperty(exports,"__esModule",{value:!0});var THREE=require("three"),three_1=require("three"),McGiWorldDrawType_1=require("../McGiWorldDrawType"),MxDbEntity_1=require("../MxDbEntity"),MxThreeJS_1=require("../MxThreeJS"),MxDb2LineAngularDimension=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.point1=new THREE.Vector3,e.point2=new THREE.Vector3,e.point3=new THREE.Vector3,e}return __extends(e,t),e.prototype.calculateLineAngle=function(t,e,n){var i=2*Math.PI/360;return{startAngle:180*Math.atan2(e.y-t.y,e.x-t.x)/Math.PI*i,endAngle:180*Math.atan2(n.y-t.y,n.x-t.x)/Math.PI*i}},e.prototype.worldDraw=function(t){if(t.getType()==McGiWorldDrawType_1.default.kWorldDraw||t.getType()==McGiWorldDrawType_1.default.kDynDragDraw){var e=t.getColor(),n=t.getMxObject(),i=MxThreeJS_1.default.createLine(this.point1,this.point2,e);t.drawEntity(i);var o=MxThreeJS_1.default.createLine(this.point2,this.point3,e);t.drawEntity(o);var r=this.calculateLineAngle(this.point2,this.point1,this.point3),p=r.startAngle,a=r.endAngle,s=this.point2.distanceTo(this.point1),h=this.point2.distanceTo(this.point3),u=(s>h?h:s)/4,c=three_1.MathUtils.radToDeg(p-a);c<0&&(c+=360);var l=n.screenCoordLong2Doc(50),y=new three_1.ArcCurve(this.point2.x,this.point2.y,u,p,a,!0),d=(new three_1.BufferGeometry).setFromPoints(y.getPoints(50)),f=new three_1.LineBasicMaterial({color:"#ff0000"}),w=new three_1.Line(d,f);t.drawEntity(w);var _=y.getPoint(.5),x=new THREE.Vector3(_.x,_.y,0),g=x.sub(this.point2),M=g.length()+.5*l;g.normalize().multiplyScalar(M),x=this.point2.clone().add(g);var D=MxThreeJS_1.default.creatTextSprite(c.toFixed(3)+"°",x,.5*l,0,e);null!=D&&t.drawEntity(D)}else t.drawLine(this.point1,this.point2),t.drawLine(this.point3,this.point2)},e.prototype.getGripPoints=function(){return[this.point1,this.point2,this.point3]},e.prototype.moveGripPointsAt=function(t,e){return 0===t?this.point1.add(e):1===t?this.point2.add(e):2===t&&this.point3.add(e),!0},e.prototype.dwgIn=function(t){return this.onDwgIn(t),this.point1.copy(t.point1),this.point2.copy(t.point2),this.point3.copy(t.point3),t},e.prototype.dwgOut=function(t){return this.onDwgOut(t),t.point1=this.point1,t.point2=this.point2,t.point3=this.point3,t},e.prototype.create=function(){return new e},e.prototype.transformBy=function(t){this.point1.applyMatrix4(t),this.point2.applyMatrix4(t)},e.prototype.getTypeName=function(){return"MxDb2LineAngularDimension"},e}(MxDbEntity_1.default);exports.default=MxDb2LineAngularDimension;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var MxDb2LineAngularDimension_1=require("./MxDb2LineAngularDimension");exports.default=MxDb2LineAngularDimension_1.default;
|
|
@@ -1,213 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __extends = (this && this.__extends) || (function () {
|
|
3
|
-
var extendStatics = function (d, b) {
|
|
4
|
-
extendStatics = Object.setPrototypeOf ||
|
|
5
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
-
return extendStatics(d, b);
|
|
8
|
-
};
|
|
9
|
-
return function (d, b) {
|
|
10
|
-
if (typeof b !== "function" && b !== null)
|
|
11
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
-
extendStatics(d, b);
|
|
13
|
-
function __() { this.constructor = d; }
|
|
14
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
-
};
|
|
16
|
-
})();
|
|
17
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
///////////////////////////////////////////////////////////////////////////////
|
|
19
|
-
//版权所有(C)2002-2022,成都梦想凯德科技有限公司。
|
|
20
|
-
//本软件代码及其文档和相关资料归成都梦想凯德科技有限公司,应用包含本软件的程序必须包括以下版权声明
|
|
21
|
-
//此应用程序与成都梦想凯德科技有限公司成协议。通过使用本软件、其文档或相关材料
|
|
22
|
-
///////////////////////////////////////////////////////////////////////////////
|
|
23
|
-
/** @module MxDbAlignedDimension*/
|
|
24
|
-
var THREE = require("three");
|
|
25
|
-
var McGiWorldDrawType_1 = require("../McGiWorldDrawType");
|
|
26
|
-
var MxDbEntity_1 = require("../MxDbEntity");
|
|
27
|
-
var MxFun_1 = require("../MxFun");
|
|
28
|
-
var MxThreeJS_1 = require("../MxThreeJS");
|
|
29
|
-
/**
|
|
30
|
-
* MxDbAlignedDimension 尺寸对象.
|
|
31
|
-
*/
|
|
32
|
-
var MxDbAlignedDimension = /** @class */ (function (_super) {
|
|
33
|
-
__extends(MxDbAlignedDimension, _super);
|
|
34
|
-
function MxDbAlignedDimension() {
|
|
35
|
-
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
36
|
-
_this.pt1 = new THREE.Vector3();
|
|
37
|
-
_this.pt2 = new THREE.Vector3();
|
|
38
|
-
return _this;
|
|
39
|
-
}
|
|
40
|
-
MxDbAlignedDimension.prototype.getTypeName = function () {
|
|
41
|
-
return 'MxDbAlignedDimension';
|
|
42
|
-
};
|
|
43
|
-
//获得标注方向
|
|
44
|
-
MxDbAlignedDimension.prototype.getDirection = function (v2ndPtTo1stPt, i3DFirstPt, i3DSecondPt) {
|
|
45
|
-
var vDirection = new THREE.Vector3(v2ndPtTo1stPt.x, v2ndPtTo1stPt.y, 0);
|
|
46
|
-
var mXnormal = new THREE.Vector3(1, 0, 0);
|
|
47
|
-
var fAngle = v2ndPtTo1stPt.angleTo(mXnormal);
|
|
48
|
-
//标尺与X的角度接近PI 靠近X轴;第二个点在右 或 标尺与X的角度接近0 靠近X轴;第二个点在左
|
|
49
|
-
var fMarkDirAnlge = -1;
|
|
50
|
-
if (fAngle < (Math.PI * 7) / 18 || fAngle > (Math.PI * 10) / 18) {
|
|
51
|
-
if (i3DFirstPt.x > i3DSecondPt.x) {
|
|
52
|
-
fMarkDirAnlge = 1;
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
var rotationWorldMatrix = new THREE.Matrix4();
|
|
56
|
-
rotationWorldMatrix.makeRotationZ((Math.PI / 2) * fMarkDirAnlge);
|
|
57
|
-
vDirection.applyMatrix4(rotationWorldMatrix);
|
|
58
|
-
return vDirection;
|
|
59
|
-
};
|
|
60
|
-
// 绘制尺寸标注.
|
|
61
|
-
MxDbAlignedDimension.prototype.worldDraw = function (pWorldDraw) {
|
|
62
|
-
if (pWorldDraw.getType() == McGiWorldDrawType_1.default.kWorldDraw ||
|
|
63
|
-
pWorldDraw.getType() == McGiWorldDrawType_1.default.kDynDragDraw) {
|
|
64
|
-
var pt1 = this.pt1;
|
|
65
|
-
var pt2 = this.pt2;
|
|
66
|
-
//标注的三条线
|
|
67
|
-
var line1;
|
|
68
|
-
var line2;
|
|
69
|
-
var line3;
|
|
70
|
-
var text;
|
|
71
|
-
var mTriangle1;
|
|
72
|
-
var mTriangle2;
|
|
73
|
-
var mPoint1;
|
|
74
|
-
var mPoint2;
|
|
75
|
-
var v2ndPtTo1stPt = new THREE.Vector3(pt1.x - pt2.x, pt1.y - pt2.y, 0);
|
|
76
|
-
var vDirection = this.getDirection(v2ndPtTo1stPt, pt1, pt2);
|
|
77
|
-
var fLen = v2ndPtTo1stPt.length();
|
|
78
|
-
var scaleWorldMatrix = new THREE.Matrix4();
|
|
79
|
-
scaleWorldMatrix.makeScale(0.01, 0.01, 0.01);
|
|
80
|
-
var vTemp = new THREE.Vector3(vDirection.x, vDirection.y, 0);
|
|
81
|
-
vTemp.applyMatrix4(scaleWorldMatrix);
|
|
82
|
-
var mTopPt1 = new THREE.Vector3(pt1.x + vTemp.x, pt1.y + vTemp.y, 0);
|
|
83
|
-
var mTopPt2 = new THREE.Vector3(pt2.x + vTemp.x, pt2.y + vTemp.y, 0);
|
|
84
|
-
var color = 0xffffff;
|
|
85
|
-
//画点
|
|
86
|
-
{
|
|
87
|
-
mPoint1 = MxThreeJS_1.default.createPoint(pt1, color);
|
|
88
|
-
mPoint2 = MxThreeJS_1.default.createPoint(pt2, color);
|
|
89
|
-
}
|
|
90
|
-
//画线
|
|
91
|
-
{
|
|
92
|
-
scaleWorldMatrix.identity();
|
|
93
|
-
scaleWorldMatrix.makeScale(0.2, 0.2, 0);
|
|
94
|
-
var vTemp1 = new THREE.Vector3(vDirection.x, vDirection.y, 0);
|
|
95
|
-
vTemp1.applyMatrix4(scaleWorldMatrix);
|
|
96
|
-
scaleWorldMatrix.identity();
|
|
97
|
-
scaleWorldMatrix.makeScale(0.02, 0.02, 0);
|
|
98
|
-
var vTemp2 = new THREE.Vector3(vDirection.x, vDirection.y, 0);
|
|
99
|
-
vTemp2.applyMatrix4(scaleWorldMatrix);
|
|
100
|
-
pWorldDraw.drawLine(mTopPt1, mTopPt2);
|
|
101
|
-
line2 = MxThreeJS_1.default.createLine(new THREE.Vector3(mTopPt1.x + vTemp2.x * 2, mTopPt1.y + vTemp2.y * 2, 0), new THREE.Vector3(pt1.x + vTemp2.x, pt1.y + vTemp2.y, 0), color);
|
|
102
|
-
line3 = MxThreeJS_1.default.createLine(new THREE.Vector3(mTopPt2.x + vTemp2.x * 2, mTopPt2.y + vTemp2.y * 2, 0), new THREE.Vector3(pt2.x + vTemp2.x, pt2.y + vTemp2.y, 0), color);
|
|
103
|
-
}
|
|
104
|
-
//画文字
|
|
105
|
-
{
|
|
106
|
-
var mXnormal = new THREE.Vector3(1, 0, 0);
|
|
107
|
-
var fAngle = v2ndPtTo1stPt.angleTo(mXnormal);
|
|
108
|
-
// vTemp 标注线垂直方向 。
|
|
109
|
-
var vTemp = new THREE.Vector3(vDirection.x, vDirection.y, 0);
|
|
110
|
-
vTemp.normalize();
|
|
111
|
-
var fSize = pt1.distanceTo(pt2);
|
|
112
|
-
if (v2ndPtTo1stPt.y < 0) {
|
|
113
|
-
if (fAngle < Math.PI / 2) {
|
|
114
|
-
fAngle = 2 * Math.PI - fAngle;
|
|
115
|
-
}
|
|
116
|
-
else {
|
|
117
|
-
fAngle = Math.PI - fAngle;
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
else {
|
|
121
|
-
if (fAngle > Math.PI / 2) {
|
|
122
|
-
fAngle = Math.PI + fAngle;
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
fLen = MxFun_1.default.worldCoordLong2Doc(fLen);
|
|
126
|
-
text = MxThreeJS_1.default.creatTextSprite(fLen.toFixed(3), new THREE.Vector3(mTopPt2.x + v2ndPtTo1stPt.x / 2 + (vTemp.x * fSize) / 30, mTopPt2.y + v2ndPtTo1stPt.y / 2 + (vTemp.y * fSize) / 30, 0), fSize * 0.07, // 文字高度,取两点距离的0.1
|
|
127
|
-
fAngle, color);
|
|
128
|
-
if (text != null)
|
|
129
|
-
pWorldDraw.drawEntity(text);
|
|
130
|
-
}
|
|
131
|
-
//画三角形
|
|
132
|
-
{
|
|
133
|
-
scaleWorldMatrix.identity();
|
|
134
|
-
scaleWorldMatrix.makeScale(0.08, 0.08, 0.08);
|
|
135
|
-
var rotationWorldMatrix = new THREE.Matrix4();
|
|
136
|
-
rotationWorldMatrix.makeRotationZ((Math.PI * 17) / 18);
|
|
137
|
-
var vTrianglePt1Dir = new THREE.Vector3(v2ndPtTo1stPt.x, v2ndPtTo1stPt.y, 0);
|
|
138
|
-
vTrianglePt1Dir.applyMatrix4(scaleWorldMatrix);
|
|
139
|
-
vTrianglePt1Dir.applyMatrix4(rotationWorldMatrix);
|
|
140
|
-
rotationWorldMatrix.identity();
|
|
141
|
-
rotationWorldMatrix.makeRotationZ((-Math.PI * 17) / 18);
|
|
142
|
-
var vTrianglePt2Dir = new THREE.Vector3(v2ndPtTo1stPt.x, v2ndPtTo1stPt.y, 0);
|
|
143
|
-
vTrianglePt2Dir.applyMatrix4(scaleWorldMatrix);
|
|
144
|
-
vTrianglePt2Dir.applyMatrix4(rotationWorldMatrix);
|
|
145
|
-
var pts1 = new Array();
|
|
146
|
-
pts1.push(new THREE.Vector3(mTopPt1.x, mTopPt1.y, 0), new THREE.Vector3(mTopPt1.x + vTrianglePt1Dir.x, mTopPt1.y + vTrianglePt1Dir.y, 0), new THREE.Vector3(mTopPt1.x + vTrianglePt2Dir.x, mTopPt1.y + vTrianglePt2Dir.y, 0));
|
|
147
|
-
mTriangle1 = MxThreeJS_1.default.createTriangle(pts1, color);
|
|
148
|
-
rotationWorldMatrix.identity();
|
|
149
|
-
rotationWorldMatrix.makeRotationZ(Math.PI / 18);
|
|
150
|
-
vTrianglePt1Dir = new THREE.Vector3(v2ndPtTo1stPt.x, v2ndPtTo1stPt.y, 0);
|
|
151
|
-
vTrianglePt1Dir.applyMatrix4(scaleWorldMatrix);
|
|
152
|
-
vTrianglePt1Dir.applyMatrix4(rotationWorldMatrix);
|
|
153
|
-
rotationWorldMatrix.identity();
|
|
154
|
-
rotationWorldMatrix.makeRotationZ(-Math.PI / 18);
|
|
155
|
-
vTrianglePt2Dir = new THREE.Vector3(v2ndPtTo1stPt.x, v2ndPtTo1stPt.y, 0);
|
|
156
|
-
vTrianglePt2Dir.applyMatrix4(scaleWorldMatrix);
|
|
157
|
-
vTrianglePt2Dir.applyMatrix4(rotationWorldMatrix);
|
|
158
|
-
var pts2 = new Array();
|
|
159
|
-
pts2.push(new THREE.Vector3(mTopPt2.x, mTopPt2.y, 0), new THREE.Vector3(mTopPt2.x + vTrianglePt1Dir.x, mTopPt2.y + vTrianglePt1Dir.y, 0), new THREE.Vector3(mTopPt2.x + vTrianglePt2Dir.x, mTopPt2.y + vTrianglePt2Dir.y, 0));
|
|
160
|
-
mTriangle2 = MxThreeJS_1.default.createTriangle(pts2, color);
|
|
161
|
-
}
|
|
162
|
-
pWorldDraw.drawEntity(line2);
|
|
163
|
-
pWorldDraw.drawEntity(line3);
|
|
164
|
-
if (mTriangle1)
|
|
165
|
-
pWorldDraw.drawEntity(mTriangle1);
|
|
166
|
-
if (mTriangle2)
|
|
167
|
-
pWorldDraw.drawEntity(mTriangle2);
|
|
168
|
-
pWorldDraw.drawEntity(mPoint1);
|
|
169
|
-
pWorldDraw.drawEntity(mPoint2);
|
|
170
|
-
}
|
|
171
|
-
else {
|
|
172
|
-
pWorldDraw.drawLine(this.pt1, this.pt2);
|
|
173
|
-
}
|
|
174
|
-
};
|
|
175
|
-
MxDbAlignedDimension.prototype.setPoint1 = function (pt1) {
|
|
176
|
-
this.pt1 = pt1;
|
|
177
|
-
};
|
|
178
|
-
MxDbAlignedDimension.prototype.setPoint2 = function (pt2) {
|
|
179
|
-
this.pt2 = pt2;
|
|
180
|
-
};
|
|
181
|
-
MxDbAlignedDimension.prototype.getGripPoints = function () {
|
|
182
|
-
var ret = [];
|
|
183
|
-
ret.push(this.pt1);
|
|
184
|
-
ret.push(this.pt2);
|
|
185
|
-
return ret;
|
|
186
|
-
};
|
|
187
|
-
MxDbAlignedDimension.prototype.moveGripPointsAt = function (index, offset) {
|
|
188
|
-
if (index == 0) {
|
|
189
|
-
this.pt1.add(offset);
|
|
190
|
-
}
|
|
191
|
-
else if ((index = 1)) {
|
|
192
|
-
this.pt2.add(offset);
|
|
193
|
-
}
|
|
194
|
-
return true;
|
|
195
|
-
};
|
|
196
|
-
MxDbAlignedDimension.prototype.dwgIn = function (obj) {
|
|
197
|
-
this.onDwgIn(obj);
|
|
198
|
-
this.pt1.copy(obj['pt1']);
|
|
199
|
-
this.pt2.copy(obj['pt2']);
|
|
200
|
-
return true;
|
|
201
|
-
};
|
|
202
|
-
MxDbAlignedDimension.prototype.dwgOut = function (obj) {
|
|
203
|
-
this.onDwgOut(obj);
|
|
204
|
-
obj['pt1'] = this.pt1;
|
|
205
|
-
obj['pt2'] = this.pt2;
|
|
206
|
-
return obj;
|
|
207
|
-
};
|
|
208
|
-
MxDbAlignedDimension.prototype.create = function () {
|
|
209
|
-
return new MxDbAlignedDimension();
|
|
210
|
-
};
|
|
211
|
-
return MxDbAlignedDimension;
|
|
212
|
-
}(MxDbEntity_1.default));
|
|
213
|
-
exports.default = MxDbAlignedDimension;
|
|
1
|
+
"use strict";var __extends=this&&this.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(exports,"__esModule",{value:!0});var THREE=require("three"),McGiWorldDrawType_1=require("../McGiWorldDrawType"),MxDbEntity_1=require("../MxDbEntity"),MxThreeJS_1=require("../MxThreeJS"),MxDbAlignedDimension=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.pt1=new THREE.Vector3,e.pt2=new THREE.Vector3,e}return __extends(e,t),e.prototype.getTypeName=function(){return"MxDbAlignedDimension"},e.prototype.getDirection=function(t,e,r){var n=new THREE.Vector3(t.x,t.y,0),o=new THREE.Vector3(1,0,0),a=t.angleTo(o),i=-1;(a<7*Math.PI/18||a>10*Math.PI/18)&&e.x>r.x&&(i=1);var p=new THREE.Matrix4;return p.makeRotationZ(Math.PI/2*i),n.applyMatrix4(p),n},e.prototype.worldDraw=function(t){if(t.getType()==McGiWorldDrawType_1.default.kWorldDraw||t.getType()==McGiWorldDrawType_1.default.kDynDragDraw){var e,r,n,o,a,i,p,y=this.pt1,c=this.pt2,x=new THREE.Vector3(y.x-c.x,y.y-c.y,0),E=this.getDirection(x,y,c),u=x.length(),l=new THREE.Matrix4;l.makeScale(.01,.01,.01),(d=new THREE.Vector3(E.x,E.y,0)).applyMatrix4(l);var w=new THREE.Vector3(y.x+d.x,y.y+d.y,0),T=new THREE.Vector3(c.x+d.x,c.y+d.y,0),s=16777215;i=MxThreeJS_1.default.createPoint(y,s),p=MxThreeJS_1.default.createPoint(c,s),l.identity(),l.makeScale(.2,.2,0),new THREE.Vector3(E.x,E.y,0).applyMatrix4(l),l.identity(),l.makeScale(.02,.02,0);var h=new THREE.Vector3(E.x,E.y,0);h.applyMatrix4(l),t.drawLine(w,T),e=MxThreeJS_1.default.createLine(new THREE.Vector3(w.x+2*h.x,w.y+2*h.y,0),new THREE.Vector3(y.x+h.x,y.y+h.y,0),s),r=MxThreeJS_1.default.createLine(new THREE.Vector3(T.x+2*h.x,T.y+2*h.y,0),new THREE.Vector3(c.x+h.x,c.y+h.y,0),s);var d,M=new THREE.Vector3(1,0,0),f=x.angleTo(M);(d=new THREE.Vector3(E.x,E.y,0)).normalize();var R=y.distanceTo(c);x.y<0?f=f<Math.PI/2?2*Math.PI-f:Math.PI-f:f>Math.PI/2&&(f=Math.PI+f),null!=(n=MxThreeJS_1.default.creatTextSprite(u.toFixed(3),new THREE.Vector3(T.x+x.x/2+d.x*R/30,T.y+x.y/2+d.y*R/30,0),.07*R,f,s))&&t.drawEntity(n),l.identity(),l.makeScale(.08,.08,.08);var H=new THREE.Matrix4;H.makeRotationZ(17*Math.PI/18);var _=new THREE.Vector3(x.x,x.y,0);_.applyMatrix4(l),_.applyMatrix4(H),H.identity(),H.makeRotationZ(17*-Math.PI/18);var V=new THREE.Vector3(x.x,x.y,0);V.applyMatrix4(l),V.applyMatrix4(H);var D=new Array;D.push(new THREE.Vector3(w.x,w.y,0),new THREE.Vector3(w.x+_.x,w.y+_.y,0),new THREE.Vector3(w.x+V.x,w.y+V.y,0)),o=MxThreeJS_1.default.createTriangle(D,s),H.identity(),H.makeRotationZ(Math.PI/18),(_=new THREE.Vector3(x.x,x.y,0)).applyMatrix4(l),_.applyMatrix4(H),H.identity(),H.makeRotationZ(-Math.PI/18),(V=new THREE.Vector3(x.x,x.y,0)).applyMatrix4(l),V.applyMatrix4(H);var v=new Array;v.push(new THREE.Vector3(T.x,T.y,0),new THREE.Vector3(T.x+_.x,T.y+_.y,0),new THREE.Vector3(T.x+V.x,T.y+V.y,0)),a=MxThreeJS_1.default.createTriangle(v,s),t.drawEntity(e),t.drawEntity(r),o&&t.drawEntity(o),a&&t.drawEntity(a),t.drawEntity(i),t.drawEntity(p)}else t.drawLine(this.pt1,this.pt2)},e.prototype.setPoint1=function(t){this.pt1=t},e.prototype.setPoint2=function(t){this.pt2=t},e.prototype.getGripPoints=function(){var t=[];return t.push(this.pt1),t.push(this.pt2),t},e.prototype.moveGripPointsAt=function(t,e){return 0==t?this.pt1.add(e):(t=1)&&this.pt2.add(e),!0},e.prototype.dwgIn=function(t){return this.onDwgIn(t),this.pt1.copy(t.pt1),this.pt2.copy(t.pt2),!0},e.prototype.dwgOut=function(t){return this.onDwgOut(t),t.pt1=this.pt1,t.pt2=this.pt2,t},e.prototype.create=function(){return new e},e}(MxDbEntity_1.default);exports.default=MxDbAlignedDimension;
|