mxdraw 0.1.12 → 0.1.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (74) hide show
  1. package/dist/lib/MxModule/McEdGetPointWorldDrawObject/McEdGetPointWorldDrawObjectClass.js +1 -128
  2. package/dist/lib/MxModule/McEdGetPointWorldDrawObject/index.js +1 -5
  3. package/dist/lib/MxModule/McGeVector3d/McGeVector3d.js +1 -2
  4. package/dist/lib/MxModule/McGeVector3d/index.js +1 -3
  5. package/dist/lib/MxModule/McGiWorldDraw/McGiWorldDraw.js +1 -2
  6. package/dist/lib/MxModule/McGiWorldDraw/index.js +1 -2
  7. package/dist/lib/MxModule/McGiWorldDrawType/McGiWorldDrawType.js +1 -19
  8. package/dist/lib/MxModule/McGiWorldDrawType/index.js +1 -4
  9. package/dist/lib/MxModule/MrxDbgUiPrBaseReturn/MrxDbgUiPrBaseReturn.js +1 -31
  10. package/dist/lib/MxModule/MrxDbgUiPrBaseReturn/index.js +1 -5
  11. package/dist/lib/MxModule/MrxDbgUiPrPoint/MrxDbgUiPrPointClass.js +1 -150
  12. package/dist/lib/MxModule/MrxDbgUiPrPoint/index.js +1 -5
  13. package/dist/lib/MxModule/MxDbAlignedDimension/MxDbAlignedDimension.js +1 -213
  14. package/dist/lib/MxModule/MxDbAlignedDimension/index.js +1 -5
  15. package/dist/lib/MxModule/MxDbEntity/MxDbEntity.js +1 -241
  16. package/dist/lib/MxModule/MxDbEntity/index.js +1 -5
  17. package/dist/lib/MxModule/MxDbImage/MxDbImage.js +1 -160
  18. package/dist/lib/MxModule/MxDbImage/index.js +1 -5
  19. package/dist/lib/MxModule/MxDbLine/MxDbLine.js +1 -94
  20. package/dist/lib/MxModule/MxDbLine/index.js +1 -5
  21. package/dist/lib/MxModule/MxDbRect/MxDbRect.js +1 -273
  22. package/dist/lib/MxModule/MxDbRect/index.js +1 -4
  23. package/dist/lib/MxModule/MxDbSVG/MxDbSVG.js +1 -369
  24. package/dist/lib/MxModule/MxDbSVG/index.js +1 -5
  25. package/dist/lib/MxModule/MxDbSVGText/MxDbSVGText.js +1 -21
  26. package/dist/lib/MxModule/MxDbSVGText/index.js +1 -5
  27. package/dist/lib/MxModule/MxDrawObject/MxDrawObject.js +1 -754
  28. package/dist/lib/MxModule/MxDrawObject/index.js +1 -5
  29. package/dist/lib/MxModule/MxFilters/MxFilters.js +1 -201
  30. package/dist/lib/MxModule/MxFilters/index.js +1 -4
  31. package/dist/lib/MxModule/MxFun/MxFun.js +1 -630
  32. package/dist/lib/MxModule/MxFun/index.js +1 -9
  33. package/dist/lib/MxModule/MxThreeJS/MxThreeJS.js +1 -283
  34. package/dist/lib/MxModule/MxThreeJS/MxThreeJS.mixin.js +1 -146
  35. package/dist/lib/MxModule/MxThreeJS/SVGLoader.js +1 -1862
  36. package/dist/lib/MxModule/MxThreeJS/index.js +1 -7
  37. package/dist/lib/MxModule/MxType/MxType.js +1 -27
  38. package/dist/lib/MxModule/MxType/index.js +1 -4
  39. package/dist/lib/MxModule/Mxassembly/Mxassembly.js +1 -18
  40. package/dist/lib/MxModule/Mxassembly/index.js +1 -9
  41. package/dist/lib/MxModule/loadCoreCode/index.js +1 -5
  42. package/dist/lib/MxModule/loadCoreCode/loadCoreCode.js +1 -125
  43. package/dist/lib/MxModule/loadCoreCode/mxUiData.js +1 -317
  44. package/dist/lib/MxModule/loadCoreCode/mxcadassembly_es5.js +1 -1519
  45. package/dist/lib/MxModule/loadCoreCode/mxfun.es5.js +1 -7361
  46. package/dist/lib/MxModule/store/PubsubClass.js +1 -40
  47. package/dist/lib/MxModule/store/StoreClass.js +1 -73
  48. package/dist/lib/MxModule/store/index.js +1 -16
  49. package/dist/lib/MxModule/store/store.js +1 -25
  50. package/dist/lib/MxModule/useCanvasResizeListener/index.js +1 -5
  51. package/dist/lib/MxModule/useCanvasResizeListener/useCanvasResizeListener.js +1 -95
  52. package/dist/lib/doc.js +1 -38
  53. package/dist/lib/mxdraw.js +1 -64
  54. package/dist/lib/tools/algorithm/math.js +1 -16
  55. package/dist/lib/tools/algorithm/random.js +1 -13
  56. package/dist/lib/tools/dom/create.js +1 -47
  57. package/dist/lib/tools/dynamicImport/index.js +1 -186
  58. package/dist/lib/tools/formatting/index.js +1 -20
  59. package/dist/lib/tools/proxy/index.js +1 -17
  60. package/dist/lib/tools/three/index.js +1 -124
  61. package/dist/lib/types/McEdGetPointWorldDrawObject.js +1 -2
  62. package/dist/lib/types/MrxDbgUiPrPoint.js +1 -2
  63. package/dist/lib/types/MxCADObject.js +1 -2
  64. package/dist/lib/types/MxDrawObject.js +1 -2
  65. package/dist/lib/types/MxFun.js +1 -2
  66. package/dist/lib/types/Mxassembly.js +1 -2
  67. package/dist/mxdraw.es5.js +1 -45
  68. package/dist/mxdraw.umd.js +1 -45
  69. package/dist/types/MxModule/MxFun/MxFun.d.ts +18 -1
  70. package/dist/types/MxModule/store/index.d.ts +2 -7
  71. package/dist/types/mxdraw.d.ts +1 -4
  72. package/package.json +6 -5
  73. package/dist/mxdraw.es5.js.map +0 -1
  74. package/dist/mxdraw.umd.js.map +0 -1
@@ -1,241 +1 @@
1
- "use strict";
2
- ///////////////////////////////////////////////////////////////////////////////
3
- //版权所有(C)2002-2022,成都梦想凯德科技有限公司。
4
- //本软件代码及其文档和相关资料归成都梦想凯德科技有限公司,应用包含本软件的程序必须包括以下版权声明
5
- //此应用程序与成都梦想凯德科技有限公司成协议。通过使用本软件、其文档或相关材料
6
- ///////////////////////////////////////////////////////////////////////////////
7
- /** @module MxDbEntity*/
8
- Object.defineProperty(exports, "__esModule", { value: true });
9
- var MxType_1 = require("../MxType");
10
- var store_1 = require("../store/store");
11
- /**
12
- * MxDbEntity 用于构建一个自定义对象的抽象类(该类无法实例化 请通过继承的方式对其抽象方法进行实现)
13
- * @description MxDbEntity 属于 abstract class(抽象类) 主要用途是通过继承这个类实现一个用于动态绘制的回调对象
14
- * 继承实现这个类必须实现的抽象方法:(方法名称前有'Abstract'标签就是必须实现的方法)
15
- * @example ```typescript
16
- * import THREE from "three"
17
- * import { McGiWorldDraw, MxDbEntity } from "mxdraw"
18
- * class MxLineEntity extends MxDbEntity {
19
- * constructor() {
20
- * super(); // 在派生类的构造函数中必须调用 super()
21
- * }
22
- * private pt1: THREE.Vector3 = new THREE.Vector3();
23
- * private pt2: THREE.Vector3 = new THREE.Vector3();
24
- * worldDraw(pWorldDraw: McGiWorldDraw) {
25
- * pWorldDraw.drawLine(this.pt1,this.pt2);
26
- * }
27
- * ...
28
- * }
29
- * ```
30
- */
31
- var MxDbEntity = /** @class */ (function () {
32
- function MxDbEntity() {
33
- this.color = 0xffffff;
34
- this.renderOrder = 30;
35
- /**
36
- * opacity 设置透明度 0 ~ 1,1表示完全不透明,0表示全透明.
37
- * */
38
- this.opacity = 1;
39
- /**
40
- * visible 该矩形对象是否可见
41
- * */
42
- this.visible = true;
43
- }
44
- /**
45
- * 自定义实体的坐标变换.
46
- * @param
47
- * @returns void
48
- * @example
49
- * }
50
- * ```
51
- */
52
- MxDbEntity.prototype.transformBy = function (mat) { };
53
- MxDbEntity.prototype.getImp = function () {
54
- var myThis = this;
55
- var imp = myThis['MxDbEntityImp'];
56
- return imp;
57
- };
58
- /**
59
- * 更新显示
60
- * @param
61
- * @returns boolean
62
- * @example
63
- * ``` typescript
64
- *
65
- * ```
66
- */
67
- MxDbEntity.prototype.setNeedUpdateDisplay = function (isImmediate) {
68
- var imp = this.getImp();
69
- if (imp) {
70
- if (isImmediate) {
71
- imp.upDisplay();
72
- }
73
- else {
74
- imp.setDirtyDisplay(true);
75
- }
76
- return true;
77
- }
78
- else {
79
- return false;
80
- }
81
- };
82
- /**
83
- * 返回对象所在的控件对象。
84
- * @param
85
- * @returns boolean
86
- * @example
87
- * ``` typescript
88
- *
89
- * ```
90
- */
91
- MxDbEntity.prototype.getMxObject = function () {
92
- var imp = this.getImp();
93
- if (imp)
94
- return imp.getMxObject();
95
- else
96
- return null;
97
- };
98
- /**
99
- * 视区显示比较发生成变化,继承类可以向应该事件,更新显示大小。
100
- * @param
101
- * @returns boolean
102
- * @example
103
- * ``` typescript
104
- *
105
- * ```
106
- */
107
- MxDbEntity.prototype.onViewChange = function () {
108
- return false;
109
- };
110
- /**
111
- * 得到对象的id.
112
- * @param
113
- * @returns number
114
- * @example
115
- * ``` typescript
116
- *
117
- * ```
118
- */
119
- MxDbEntity.prototype.objectId = function () {
120
- var imp = this.getImp();
121
- if (imp) {
122
- return imp.objectId();
123
- }
124
- else {
125
- return 0;
126
- }
127
- };
128
- /**
129
- * 删除对象
130
- * @param
131
- * @returns boolean
132
- * @example
133
- * ``` typescript
134
- *
135
- * ```
136
- */
137
- MxDbEntity.prototype.erase = function () {
138
- var imp = this.getImp();
139
- if (imp) {
140
- return imp.erase();
141
- }
142
- else {
143
- return false;
144
- }
145
- };
146
- /**
147
- * 设置颜色
148
- * @param
149
- * @returns boolean
150
- * @example
151
- * ``` typescript
152
- *
153
- * ```
154
- */
155
- MxDbEntity.prototype.setColor = function (color) {
156
- this.color = color;
157
- };
158
- /**
159
- * 得到颜色
160
- * @param
161
- * @returns boolean
162
- * @example
163
- * ``` typescript
164
- *
165
- * ```
166
- */
167
- MxDbEntity.prototype.getColor = function () {
168
- return this.color;
169
- };
170
- /**
171
- * 复制对象。
172
- * @param
173
- * @returns MxDbEntity
174
- * @example
175
- * ``` typescript
176
- *
177
- * ```
178
- */
179
- MxDbEntity.prototype.clone = function (type) {
180
- var ret = this.create();
181
- var objData = { type: type ? type : MxType_1.default.MxCloneType.kClone };
182
- this.dwgOut(objData);
183
- ret.dwgIn(objData);
184
- return ret;
185
- };
186
- /**
187
- * 自定义对象内部数据输入同步(实现dwgIn抽象方法 必须在实现中调用 this.onDwgIn())
188
- * @param obj dwgIn抽象方法的回调数据
189
- */
190
- MxDbEntity.prototype.onDwgIn = function (obj) {
191
- this.color = obj['color'];
192
- this.renderOrder = obj['renderOrder'];
193
- };
194
- /**
195
- * 自定义对象内部数据输出同步(实现dwgIn抽象方法 必须在实现中调用 this.onDwgIn()
196
- * @param obj dwgOut抽象方法的回调数据
197
- */
198
- MxDbEntity.prototype.onDwgOut = function (obj) {
199
- obj['color'] = this.color;
200
- obj['renderOrder'] = this.renderOrder;
201
- };
202
- /**
203
- * 初始自定义对象的类型信息.
204
- * @param
205
- * @returns
206
- * @example
207
- * ``` typescript
208
- *
209
- * ```
210
- */
211
- MxDbEntity.prototype.rxInit = function () {
212
- ;
213
- store_1.default.state.MxFun.initMxDbEntityType(this);
214
- };
215
- /**
216
- * 设置显示顺序
217
- * @param
218
- * @returns boolean
219
- * @example
220
- * ``` typescript
221
- *
222
- * ```
223
- */
224
- MxDbEntity.prototype.setRenderOrder = function (renderOrder) {
225
- this.renderOrder = renderOrder;
226
- };
227
- /**
228
- * 得到显示顺序
229
- * @param
230
- * @returns boolean
231
- * @example
232
- * ``` typescript
233
- *
234
- * ```
235
- */
236
- MxDbEntity.prototype.getRenderOrder = function () {
237
- return this.renderOrder;
238
- };
239
- return MxDbEntity;
240
- }());
241
- 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}return 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(),r={type:t||MxType_1.default.MxCloneType.kClone};return this.dwgOut(r),e.dwgIn(r),e},t.prototype.onDwgIn=function(t){this.color=t.color,this.renderOrder=t.renderOrder},t.prototype.onDwgOut=function(t){t.color=this.color,t.renderOrder=this.renderOrder},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}();exports.default=MxDbEntity;
@@ -1,5 +1 @@
1
- "use strict";
2
- /** @module McEdGetPointWorldDrawObject*/
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- var MxDbEntity_1 = require("./MxDbEntity");
5
- exports.default = MxDbEntity_1.default;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var MxDbEntity_1=require("./MxDbEntity");exports.default=MxDbEntity_1.default;
@@ -1,160 +1 @@
1
- "use strict";
2
- ///////////////////////////////////////////////////////////////////////////////
3
- //版权所有(C)2002-2022,成都梦想凯德科技有限公司。
4
- //本软件代码及其文档和相关资料归成都梦想凯德科技有限公司,应用包含本软件的程序必须包括以下版权声明
5
- //此应用程序与成都梦想凯德科技有限公司成协议。通过使用本软件、其文档或相关材料
6
- ///////////////////////////////////////////////////////////////////////////////
7
- /** @module MxDbImage*/
8
- var __extends = (this && this.__extends) || (function () {
9
- var extendStatics = function (d, b) {
10
- extendStatics = Object.setPrototypeOf ||
11
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
12
- function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
13
- return extendStatics(d, b);
14
- };
15
- return function (d, b) {
16
- if (typeof b !== "function" && b !== null)
17
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
18
- extendStatics(d, b);
19
- function __() { this.constructor = d; }
20
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
21
- };
22
- })();
23
- Object.defineProperty(exports, "__esModule", { value: true });
24
- var THREE = require("three");
25
- var MxDbEntity_1 = require("../MxDbEntity");
26
- var MxFun_1 = require("../MxFun");
27
- /**
28
- * MxDbImage 图片对象.
29
- */
30
- var MxDbImage = /** @class */ (function (_super) {
31
- __extends(MxDbImage, _super);
32
- function MxDbImage() {
33
- var _this = _super !== null && _super.apply(this, arguments) || this;
34
- // pt1,pt2是图片的两个对角点.
35
- _this.pt1 = new THREE.Vector3();
36
- _this.pt2 = new THREE.Vector3();
37
- _this.imagePath = '';
38
- _this.isLoadMaterialFromPath = true;
39
- _this.material = null;
40
- return _this;
41
- }
42
- MxDbImage.prototype.getTypeName = function () {
43
- return 'MxDbImage';
44
- };
45
- // 图片对象的绘制
46
- MxDbImage.prototype.worldDraw = function (pWorldDraw) {
47
- var _this = this;
48
- var pt3 = new THREE.Vector3(this.pt1.x, this.pt2.y);
49
- var pt4 = new THREE.Vector3(this.pt2.x, this.pt1.y);
50
- if (pWorldDraw.getType() == 1) {
51
- pWorldDraw.drawSelectLine(this.pt1, pt3);
52
- pWorldDraw.drawSelectLine(pt3, this.pt2);
53
- pWorldDraw.drawSelectLine(this.pt2, pt4);
54
- pWorldDraw.drawSelectLine(pt4, this.pt1);
55
- // 图片正常的显示绘制.
56
- if (this.material) {
57
- var w = Math.abs(this.pt1.x - this.pt2.x);
58
- var h = Math.abs(this.pt1.y - this.pt2.y);
59
- var geometry = new THREE.PlaneGeometry(w, h);
60
- var x = Math.min(this.pt1.x, this.pt2.x);
61
- var y = Math.min(this.pt1.y, this.pt2.y);
62
- for (var i = 0; i < geometry.vertices.length; i++) {
63
- geometry.vertices[i].x += x + w * 0.5;
64
- geometry.vertices[i].y += y + h * 0.5;
65
- geometry.vertices[i].z = 0;
66
- }
67
- var mesh = new THREE.Mesh(geometry, this.material);
68
- mesh.material['depthTest'] = false;
69
- pWorldDraw.drawEntity(mesh);
70
- }
71
- else if (this.imagePath.length > 0 && this.isLoadMaterialFromPath) {
72
- var myThis_1 = this;
73
- var mxobj_1 = pWorldDraw.getMxObject();
74
- MxFun_1.default.loadImageMaterial(this.imagePath, function (material) {
75
- _this.isLoadMaterialFromPath = false;
76
- if (!material) {
77
- return;
78
- }
79
- myThis_1.setMaterial(material);
80
- myThis_1.setNeedUpdateDisplay();
81
- mxobj_1.updateDisplay();
82
- });
83
- }
84
- }
85
- else {
86
- pWorldDraw.drawLine(this.pt1, pt3);
87
- pWorldDraw.drawLine(pt3, this.pt2);
88
- pWorldDraw.drawLine(this.pt2, pt4);
89
- pWorldDraw.drawLine(pt4, this.pt1);
90
- }
91
- };
92
- MxDbImage.prototype.setImagePath = function (sPath) {
93
- this.imagePath = sPath;
94
- this.isLoadMaterialFromPath = true;
95
- this.material = null;
96
- };
97
- MxDbImage.prototype.getImagePath = function () {
98
- return this.imagePath;
99
- };
100
- MxDbImage.prototype.setMaterial = function (material) {
101
- this.material = material;
102
- };
103
- MxDbImage.prototype.setPoint1 = function (pt1) {
104
- this.pt1 = pt1;
105
- };
106
- MxDbImage.prototype.getPoint1 = function () {
107
- return this.pt1;
108
- };
109
- MxDbImage.prototype.setPoint2 = function (pt2) {
110
- this.pt2 = pt2;
111
- };
112
- MxDbImage.prototype.getPoint2 = function () {
113
- return this.pt2;
114
- };
115
- // 返回图片的可编辑的夹点.
116
- MxDbImage.prototype.getGripPoints = function () {
117
- var ret = [];
118
- ret.push(this.pt1);
119
- ret.push(this.pt2);
120
- var midPt = new THREE.Vector3(this.pt1.x + (this.pt2.x - this.pt1.x) * 0.5, this.pt1.y + (this.pt2.y - this.pt1.y) * 0.5);
121
- ret.push(midPt);
122
- return ret;
123
- };
124
- // 图片的夹点拖动编辑.
125
- MxDbImage.prototype.moveGripPointsAt = function (index, offset) {
126
- if (index == 0) {
127
- this.pt1.add(offset);
128
- }
129
- else if (index == 1) {
130
- this.pt2.add(offset);
131
- }
132
- else if (index == 2) {
133
- this.pt1.add(offset);
134
- this.pt2.add(offset);
135
- }
136
- return true;
137
- };
138
- // 图片数据的保存.
139
- MxDbImage.prototype.dwgIn = function (obj) {
140
- this.onDwgIn(obj);
141
- this.pt1.copy(obj['pt1']);
142
- this.pt2.copy(obj['pt2']);
143
- this.imagePath = obj['imagePath'].substr(0);
144
- this.isLoadMaterialFromPath = true;
145
- return true;
146
- };
147
- // 图片数据的恢复.
148
- MxDbImage.prototype.dwgOut = function (obj) {
149
- this.onDwgOut(obj);
150
- obj['pt1'] = this.pt1;
151
- obj['pt2'] = this.pt2;
152
- obj['imagePath'] = this.imagePath;
153
- return obj;
154
- };
155
- MxDbImage.prototype.create = function () {
156
- return new MxDbImage();
157
- };
158
- return MxDbImage;
159
- }(MxDbEntity_1.default));
160
- exports.default = MxDbImage;
1
+ "use strict";var __extends=this&&this.__extends||function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}();Object.defineProperty(exports,"__esModule",{value:!0});var THREE=require("three"),MxDbEntity_1=require("../MxDbEntity"),MxFun_1=require("../MxFun"),MxDbImage=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.imagePath="",e.isLoadMaterialFromPath=!0,e.material=null,e}return __extends(e,t),e.prototype.getTypeName=function(){return"MxDbImage"},e.prototype.worldDraw=function(t){var e=this,i=new THREE.Vector3(this.pt1.x,this.pt2.y),r=new THREE.Vector3(this.pt2.x,this.pt1.y);if(1==t.getType()){if(t.drawSelectLine(this.pt1,i),t.drawSelectLine(i,this.pt2),t.drawSelectLine(this.pt2,r),t.drawSelectLine(r,this.pt1),this.material){for(var n=Math.abs(this.pt1.x-this.pt2.x),a=Math.abs(this.pt1.y-this.pt2.y),o=new THREE.PlaneGeometry(n,a),s=Math.min(this.pt1.x,this.pt2.x),p=Math.min(this.pt1.y,this.pt2.y),h=0;h<o.vertices.length;h++)o.vertices[h].x+=s+.5*n,o.vertices[h].y+=p+.5*a,o.vertices[h].z=0;var u=new THREE.Mesh(o,this.material);u.material.depthTest=!1,t.drawEntity(u)}else if(this.imagePath.length>0&&this.isLoadMaterialFromPath){var c=this,l=t.getMxObject();MxFun_1.default.loadImageMaterial(this.imagePath,function(t){e.isLoadMaterialFromPath=!1,t&&(c.setMaterial(t),c.setNeedUpdateDisplay(),l.updateDisplay())})}}else t.drawLine(this.pt1,i),t.drawLine(i,this.pt2),t.drawLine(this.pt2,r),t.drawLine(r,this.pt1)},e.prototype.setImagePath=function(t){this.imagePath=t,this.isLoadMaterialFromPath=!0,this.material=null},e.prototype.getImagePath=function(){return this.imagePath},e.prototype.setMaterial=function(t){this.material=t},e.prototype.setPoint1=function(t){this.pt1=t},e.prototype.getPoint1=function(){return this.pt1},e.prototype.setPoint2=function(t){this.pt2=t},e.prototype.getPoint2=function(){return this.pt2},e.prototype.getGripPoints=function(){var t=[];t.push(this.pt1),t.push(this.pt2);var e=new THREE.Vector3(this.pt1.x+.5*(this.pt2.x-this.pt1.x),this.pt1.y+.5*(this.pt2.y-this.pt1.y));return t.push(e),t},e.prototype.moveGripPointsAt=function(t,e){return 0==t?this.pt1.add(e):1==t?this.pt2.add(e):2==t&&(this.pt1.add(e),this.pt2.add(e)),!0},e.prototype.dwgIn=function(t){return this.onDwgIn(t),this.pt1.copy(t.pt1),this.pt2.copy(t.pt2),this.imagePath=t.imagePath.substr(0),this.isLoadMaterialFromPath=!0,!0},e.prototype.dwgOut=function(t){return this.onDwgOut(t),t.pt1=this.pt1,t.pt2=this.pt2,t.imagePath=this.imagePath,t},e.prototype.create=function(){return new e},e}(MxDbEntity_1.default);exports.default=MxDbImage;
@@ -1,5 +1 @@
1
- "use strict";
2
- /** @module McEdGetPointWorldDrawObject*/
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- var MxDbImage_1 = require("./MxDbImage");
5
- exports.default = MxDbImage_1.default;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var MxDbImage_1=require("./MxDbImage");exports.default=MxDbImage_1.default;
@@ -1,94 +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 MxDbLine*/
24
- var THREE = require("three");
25
- var MxDbEntity_1 = require("../MxDbEntity");
26
- /**
27
- * MxDbLine 直线对象.
28
- */
29
- var MxDbLine = /** @class */ (function (_super) {
30
- __extends(MxDbLine, _super);
31
- function MxDbLine() {
32
- var _this = _super !== null && _super.apply(this, arguments) || this;
33
- // pt1,pt2
34
- _this.pt1 = new THREE.Vector3();
35
- _this.pt2 = new THREE.Vector3();
36
- return _this;
37
- }
38
- MxDbLine.prototype.getTypeName = function () {
39
- return 'MxDbLine';
40
- };
41
- MxDbLine.prototype.worldDraw = function (pWorldDraw) {
42
- pWorldDraw.drawLine(this.pt1, this.pt2);
43
- };
44
- MxDbLine.prototype.setPoint1 = function (pt1) {
45
- this.pt1 = pt1;
46
- };
47
- MxDbLine.prototype.getPoint1 = function () {
48
- return this.pt1;
49
- };
50
- MxDbLine.prototype.setPoint2 = function (pt2) {
51
- this.pt2 = pt2;
52
- };
53
- MxDbLine.prototype.getPoint2 = function () {
54
- return this.pt2;
55
- };
56
- MxDbLine.prototype.getGripPoints = function () {
57
- var ret = [];
58
- ret.push(this.pt1);
59
- ret.push(this.pt2);
60
- var midPoint = new THREE.Vector3(this.pt1.x + (this.pt2.x - this.pt1.x) * 0.5, this.pt1.y + (this.pt2.y - this.pt1.y) * 0.5, 0);
61
- ret.push(midPoint);
62
- return ret;
63
- };
64
- MxDbLine.prototype.moveGripPointsAt = function (index, offset) {
65
- if (index == 0) {
66
- this.pt1.add(offset);
67
- }
68
- else if (index == 1) {
69
- this.pt2.add(offset);
70
- }
71
- else if (index == 2) {
72
- this.pt1.add(offset);
73
- this.pt2.add(offset);
74
- }
75
- return true;
76
- };
77
- MxDbLine.prototype.dwgIn = function (obj) {
78
- this.onDwgIn(obj);
79
- this.pt1.copy(obj['pt1']);
80
- this.pt2.copy(obj['pt2']);
81
- return true;
82
- };
83
- MxDbLine.prototype.dwgOut = function (obj) {
84
- this.onDwgOut(obj);
85
- obj['pt1'] = this.pt1;
86
- obj['pt2'] = this.pt2;
87
- return obj;
88
- };
89
- MxDbLine.prototype.create = function () {
90
- return new MxDbLine();
91
- };
92
- return MxDbLine;
93
- }(MxDbEntity_1.default));
94
- exports.default = MxDbLine;
1
+ "use strict";var __extends=this&&this.__extends||function(){var t=function(n,e){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])})(n,e)};return function(n,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=n}t(n,e),n.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}}();Object.defineProperty(exports,"__esModule",{value:!0});var THREE=require("three"),MxDbEntity_1=require("../MxDbEntity"),MxDbLine=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.pt1=new THREE.Vector3,n.pt2=new THREE.Vector3,n}return __extends(n,t),n.prototype.getTypeName=function(){return"MxDbLine"},n.prototype.worldDraw=function(t){t.drawLine(this.pt1,this.pt2)},n.prototype.setPoint1=function(t){this.pt1=t},n.prototype.getPoint1=function(){return this.pt1},n.prototype.setPoint2=function(t){this.pt2=t},n.prototype.getPoint2=function(){return this.pt2},n.prototype.getGripPoints=function(){var t=[];t.push(this.pt1),t.push(this.pt2);var n=new THREE.Vector3(this.pt1.x+.5*(this.pt2.x-this.pt1.x),this.pt1.y+.5*(this.pt2.y-this.pt1.y),0);return t.push(n),t},n.prototype.moveGripPointsAt=function(t,n){return 0==t?this.pt1.add(n):1==t?this.pt2.add(n):2==t&&(this.pt1.add(n),this.pt2.add(n)),!0},n.prototype.dwgIn=function(t){return this.onDwgIn(t),this.pt1.copy(t.pt1),this.pt2.copy(t.pt2),!0},n.prototype.dwgOut=function(t){return this.onDwgOut(t),t.pt1=this.pt1,t.pt2=this.pt2,t},n.prototype.create=function(){return new n},n}(MxDbEntity_1.default);exports.default=MxDbLine;
@@ -1,5 +1 @@
1
- "use strict";
2
- /** @module McEdGetPointWorldDrawObject*/
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- var MxDbLine_1 = require("./MxDbLine");
5
- exports.default = MxDbLine_1.default;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var MxDbLine_1=require("./MxDbLine");exports.default=MxDbLine_1.default;