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,5 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/** @module McEdGetPointWorldDrawObject*/
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
var MxDbAlignedDimension_1 = require("./MxDbAlignedDimension");
|
|
5
|
-
exports.default = MxDbAlignedDimension_1.default;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var MxDbAlignedDimension_1=require("./MxDbAlignedDimension");exports.default=MxDbAlignedDimension_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 r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(exports,"__esModule",{value:!0});var index_1=require("../../tools/three/index"),three_1=require("three"),MxDbEntity_1=require("../MxDbEntity"),McGiWorldDrawType_1=require("../McGiWorldDrawType"),MxDbAnyLine=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.points=[],e}return __extends(e,t),e.prototype.getTypeName=function(){return"MxDbAnyLine"},e.prototype.create=function(){return new e},e.prototype.worldDraw=function(t){var e=t.getMxObject(),n=(0,index_1.createAnyLine)(this.points);n.geometry.computeBoundingBox();var r=new three_1.Vector3;if(n.geometry.boundingBox.getCenter(r),t.drawEntity(n),t.getType()===McGiWorldDrawType_1.default.kSelectDraw){var o=new three_1.Vector3;n.geometry.boundingBox.getSize(o),o.addScalar(e.screenCoordLong2Doc(20));var i=o.x/2,u=o.y/2,p={x:r.x-i,y:r.y-u},y={x:r.x+i,y:r.y-u},c={x:r.x+i,y:r.y+u},s={x:r.x-i,y:r.y+u};t.drawLine(p.x,p.y,y.x,y.y),t.drawLine(y.x,y.y,c.x,c.y),t.drawLine(c.x,c.y,s.x,s.y),t.drawLine(s.x,s.y,p.x,p.y)}},e.prototype.getCenter=function(){var t=new three_1.Geometry;t.vertices=this.points;var e=new three_1.Vector3;return t.computeBoundingBox(),t.boundingBox.getCenter(e),e},e.prototype.getGripPoints=function(){return[this.getCenter()]},e.prototype.moveGripPointsAt=function(t,e){return this.points.forEach(function(t){t.add(e)}),!0},e.prototype.dwgIn=function(t){var e=this;this.onDwgIn(t);var n=t.points;return this.points=[],n.forEach(function(t){e.points.push(new three_1.Vector3(t.x,t.y,t.z))}),!0},e.prototype.dwgOut=function(t){return this.onDwgOut(t),t.points=this.points,t},e}(MxDbEntity_1.default);exports.default=MxDbAnyLine;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var MxDbAnyLine_1=require("./MxDbAnyLine");exports.default=MxDbAnyLine_1.default;
|
|
@@ -0,0 +1 @@
|
|
|
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"),McGeTool_1=require("../McGeTool"),MxDbEntity_1=require("../MxDbEntity"),MxFun_1=require("../MxFun"),MxThreeJS_1=require("../MxThreeJS"),MxDbArea=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.points=[],n}return __extends(n,t),n.prototype.getTypeName=function(){return"MxDbArea"},n.prototype.create=function(){return new n},n.prototype.worldDraw=function(t){if(this.points.length<3)2==this.points.length&&t.drawLine(this.points[0],this.points[1]);else{for(var n=this.points[0],e=n.clone(),o=n.clone(),r=this.points.length,i=1;i<r;i++){var s=this.points[i];e.x>s.x&&(e.x=s.x),e.y>s.y&&(e.y=s.y),o.x<s.x&&(o.x=s.x),o.y<s.y&&(o.y=s.y),t.drawLine(n,s),n=s}t.drawLine(n,this.points[0]);var p=McGeTool_1.default.calcArea(this.points),u=new THREE.Vector3(e.x+.5*(o.x-e.x),e.y+.5*(o.y-e.y)),c=MxFun_1.default.screenCoordLong2Doc(20),a=MxThreeJS_1.default.creatTextSprite(p.toFixed(2),u,c,0,16777215);null!=a&&t.drawEntity(a)}},n.prototype.getGripPoints=function(){return this.points},n.prototype.moveGripPointsAt=function(t,n){return!(t>=this.points.length)&&(this.points[t].add(n),!0)},n.prototype.dwgIn=function(t){var n=this;this.onDwgIn(t);var e=t.points;return this.points=[],e.forEach(function(t){n.points.push(new THREE.Vector3(t.x,t.y,t.z))}),!0},n.prototype.dwgOut=function(t){return this.onDwgOut(t),t.points=this.points,t},n.prototype.addPoint=function(t){this.points.push(t.clone())},n.prototype.getPoints=function(){return this.points},n.prototype.clearPoint=function(){this.points=[]},n}(MxDbEntity_1.default);exports.default=MxDbArea;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var MxDbArea_1=require("./MxDbArea");exports.default=MxDbArea_1.default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var __extends=this&&this.__extends||function(){var t=function(o,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,o){t.__proto__=o}||function(t,o){for(var n in o)Object.prototype.hasOwnProperty.call(o,n)&&(t[n]=o[n])})(o,n)};return function(o,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=o}t(o,n),o.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();Object.defineProperty(exports,"__esModule",{value:!0});var THREE=require("three"),MxDbEntity_1=require("../MxDbEntity"),MxDbCoord=function(t){function o(){var o=null!==t&&t.apply(this,arguments)||this;return o.point1=new THREE.Vector3,o.point2=new THREE.Vector3,o}return __extends(o,t),o.prototype.worldDraw=function(t){var o=t.getMxObject();t.drawLine(this.point1,this.point2);var n=this.point2.clone(),i=o.screenCoordLong2Doc(20),r=6*i;n.x=n.x+r,t.drawLine(this.point2,n);var e=new THREE.Vector3,p=new THREE.Vector3,s=this.point1.x.toFixed(3),u=this.point1.y.toFixed(3);e.x=this.point2.x+.3*i+.5*r,e.y=this.point2.y+.1*i+.5*i,t.drawText(s,i,0,e),p.x=this.point2.x+.3*i+.5*r,p.y=this.point2.y-.1*i-.5*i,t.drawText(u,i,0,p)},o.prototype.getGripPoints=function(){var t=[];return t.push(this.point1),t.push(this.point2),t},o.prototype.moveGripPointsAt=function(t,o){return 0==t?this.point1.add(o):1==t&&this.point2.add(o),!0},o.prototype.dwgIn=function(t){return this.onDwgIn(t),this.point1.copy(t.point1),this.point2.copy(t.point2),!0},o.prototype.dwgOut=function(t){return this.onDwgOut(t),t.point1=this.point1,t.point2=this.point2,t},o.prototype.create=function(){return new o},o.prototype.transformBy=function(t){this.point1.applyMatrix4(t),this.point2.applyMatrix4(t)},o.prototype.getTypeName=function(){return"MxDbCoord"},o}(MxDbEntity_1.default);exports.default=MxDbCoord;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var MxDbCoord_1=require("./MxDbCoord");exports.default=MxDbCoord_1.default;
|
|
@@ -1,258 +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
|
-
* visible 用户自定义数据.
|
|
45
|
-
* */
|
|
46
|
-
this.userData = {};
|
|
47
|
-
}
|
|
48
|
-
/**
|
|
49
|
-
* 自定义实体的坐标变换.
|
|
50
|
-
* @param
|
|
51
|
-
* @returns void
|
|
52
|
-
* @example
|
|
53
|
-
* }
|
|
54
|
-
* ```
|
|
55
|
-
*/
|
|
56
|
-
MxDbEntity.prototype.transformBy = function (mat) { };
|
|
57
|
-
MxDbEntity.prototype.getImp = function () {
|
|
58
|
-
var myThis = this;
|
|
59
|
-
var imp = myThis['MxDbEntityImp'];
|
|
60
|
-
return imp;
|
|
61
|
-
};
|
|
62
|
-
/**
|
|
63
|
-
* 更新显示
|
|
64
|
-
* @param
|
|
65
|
-
* @returns boolean
|
|
66
|
-
* @example
|
|
67
|
-
* ``` typescript
|
|
68
|
-
*
|
|
69
|
-
* ```
|
|
70
|
-
*/
|
|
71
|
-
MxDbEntity.prototype.setNeedUpdateDisplay = function (isImmediate) {
|
|
72
|
-
var imp = this.getImp();
|
|
73
|
-
if (imp) {
|
|
74
|
-
if (isImmediate) {
|
|
75
|
-
imp.upDisplay();
|
|
76
|
-
}
|
|
77
|
-
else {
|
|
78
|
-
imp.setDirtyDisplay(true);
|
|
79
|
-
}
|
|
80
|
-
return true;
|
|
81
|
-
}
|
|
82
|
-
else {
|
|
83
|
-
return false;
|
|
84
|
-
}
|
|
85
|
-
};
|
|
86
|
-
/**
|
|
87
|
-
* 返回对象所在的控件对象。
|
|
88
|
-
* @param
|
|
89
|
-
* @returns boolean
|
|
90
|
-
* @example
|
|
91
|
-
* ``` typescript
|
|
92
|
-
*
|
|
93
|
-
* ```
|
|
94
|
-
*/
|
|
95
|
-
MxDbEntity.prototype.getMxObject = function () {
|
|
96
|
-
var imp = this.getImp();
|
|
97
|
-
if (imp)
|
|
98
|
-
return imp.getMxObject();
|
|
99
|
-
else
|
|
100
|
-
return null;
|
|
101
|
-
};
|
|
102
|
-
/**
|
|
103
|
-
* 视区显示比较发生成变化,继承类可以向应该事件,更新显示大小。
|
|
104
|
-
* @param
|
|
105
|
-
* @returns boolean
|
|
106
|
-
* @example
|
|
107
|
-
* ``` typescript
|
|
108
|
-
*
|
|
109
|
-
* ```
|
|
110
|
-
*/
|
|
111
|
-
MxDbEntity.prototype.onViewChange = function () {
|
|
112
|
-
return false;
|
|
113
|
-
};
|
|
114
|
-
/**
|
|
115
|
-
* 得到对象的id.
|
|
116
|
-
* @param
|
|
117
|
-
* @returns number
|
|
118
|
-
* @example
|
|
119
|
-
* ``` typescript
|
|
120
|
-
*
|
|
121
|
-
* ```
|
|
122
|
-
*/
|
|
123
|
-
MxDbEntity.prototype.objectId = function () {
|
|
124
|
-
var imp = this.getImp();
|
|
125
|
-
if (imp) {
|
|
126
|
-
return imp.objectId();
|
|
127
|
-
}
|
|
128
|
-
else {
|
|
129
|
-
return 0;
|
|
130
|
-
}
|
|
131
|
-
};
|
|
132
|
-
/**
|
|
133
|
-
* 删除对象
|
|
134
|
-
* @param
|
|
135
|
-
* @returns boolean
|
|
136
|
-
* @example
|
|
137
|
-
* ``` typescript
|
|
138
|
-
*
|
|
139
|
-
* ```
|
|
140
|
-
*/
|
|
141
|
-
MxDbEntity.prototype.erase = function () {
|
|
142
|
-
var imp = this.getImp();
|
|
143
|
-
if (imp) {
|
|
144
|
-
return imp.erase();
|
|
145
|
-
}
|
|
146
|
-
else {
|
|
147
|
-
return false;
|
|
148
|
-
}
|
|
149
|
-
};
|
|
150
|
-
/**
|
|
151
|
-
* 设置颜色
|
|
152
|
-
* @param
|
|
153
|
-
* @returns boolean
|
|
154
|
-
* @example
|
|
155
|
-
* ``` typescript
|
|
156
|
-
*
|
|
157
|
-
* ```
|
|
158
|
-
*/
|
|
159
|
-
MxDbEntity.prototype.setColor = function (color) {
|
|
160
|
-
this.color = color;
|
|
161
|
-
};
|
|
162
|
-
/**
|
|
163
|
-
* 得到颜色
|
|
164
|
-
* @param
|
|
165
|
-
* @returns boolean
|
|
166
|
-
* @example
|
|
167
|
-
* ``` typescript
|
|
168
|
-
*
|
|
169
|
-
* ```
|
|
170
|
-
*/
|
|
171
|
-
MxDbEntity.prototype.getColor = function () {
|
|
172
|
-
return this.color;
|
|
173
|
-
};
|
|
174
|
-
/**
|
|
175
|
-
* 复制对象。
|
|
176
|
-
* @param
|
|
177
|
-
* @returns MxDbEntity
|
|
178
|
-
* @example
|
|
179
|
-
* ``` typescript
|
|
180
|
-
*
|
|
181
|
-
* ```
|
|
182
|
-
*/
|
|
183
|
-
MxDbEntity.prototype.clone = function (type) {
|
|
184
|
-
var ret = this.create();
|
|
185
|
-
var objData = { type: type ? type : MxType_1.default.MxCloneType.kClone };
|
|
186
|
-
this.dwgOut(objData);
|
|
187
|
-
ret.dwgIn(objData);
|
|
188
|
-
return ret;
|
|
189
|
-
};
|
|
190
|
-
/**
|
|
191
|
-
* 自定义对象内部数据输入同步(实现dwgIn抽象方法 必须在实现中调用 this.onDwgIn())
|
|
192
|
-
* @param obj dwgIn抽象方法的回调数据
|
|
193
|
-
*/
|
|
194
|
-
MxDbEntity.prototype.onDwgIn = function (obj) {
|
|
195
|
-
this.color = obj['color'];
|
|
196
|
-
this.renderOrder = obj['renderOrder'];
|
|
197
|
-
this.opacity = obj['opacity'];
|
|
198
|
-
this.visible = obj['visible'];
|
|
199
|
-
if (obj['userData']) {
|
|
200
|
-
this.userData = JSON.parse(JSON.stringify(obj['userData']));
|
|
201
|
-
}
|
|
202
|
-
else {
|
|
203
|
-
this.userData = {};
|
|
204
|
-
}
|
|
205
|
-
};
|
|
206
|
-
/**
|
|
207
|
-
* 自定义对象内部数据输出同步(实现dwgIn抽象方法 必须在实现中调用 this.onDwgIn()
|
|
208
|
-
* @param obj dwgOut抽象方法的回调数据
|
|
209
|
-
*/
|
|
210
|
-
MxDbEntity.prototype.onDwgOut = function (obj) {
|
|
211
|
-
obj['color'] = this.color;
|
|
212
|
-
obj['renderOrder'] = this.renderOrder;
|
|
213
|
-
obj['opacity'] = this.opacity;
|
|
214
|
-
obj['visible'] = this.visible;
|
|
215
|
-
if (Object.keys(this.userData).length > 0) {
|
|
216
|
-
obj['userData'] = this.userData;
|
|
217
|
-
}
|
|
218
|
-
};
|
|
219
|
-
/**
|
|
220
|
-
* 初始自定义对象的类型信息.
|
|
221
|
-
* @param
|
|
222
|
-
* @returns
|
|
223
|
-
* @example
|
|
224
|
-
* ``` typescript
|
|
225
|
-
*
|
|
226
|
-
* ```
|
|
227
|
-
*/
|
|
228
|
-
MxDbEntity.prototype.rxInit = function () {
|
|
229
|
-
;
|
|
230
|
-
store_1.default.state.MxFun.initMxDbEntityType(this);
|
|
231
|
-
};
|
|
232
|
-
/**
|
|
233
|
-
* 设置显示顺序
|
|
234
|
-
* @param
|
|
235
|
-
* @returns boolean
|
|
236
|
-
* @example
|
|
237
|
-
* ``` typescript
|
|
238
|
-
*
|
|
239
|
-
* ```
|
|
240
|
-
*/
|
|
241
|
-
MxDbEntity.prototype.setRenderOrder = function (renderOrder) {
|
|
242
|
-
this.renderOrder = renderOrder;
|
|
243
|
-
};
|
|
244
|
-
/**
|
|
245
|
-
* 得到显示顺序
|
|
246
|
-
* @param
|
|
247
|
-
* @returns boolean
|
|
248
|
-
* @example
|
|
249
|
-
* ``` typescript
|
|
250
|
-
*
|
|
251
|
-
* ```
|
|
252
|
-
*/
|
|
253
|
-
MxDbEntity.prototype.getRenderOrder = function () {
|
|
254
|
-
return this.renderOrder;
|
|
255
|
-
};
|
|
256
|
-
return MxDbEntity;
|
|
257
|
-
}());
|
|
258
|
-
exports.default = MxDbEntity;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var MxType_1=require("../MxType"),store_1=require("../store/store"),MxDbEntity=function(){function t(){this.color=16777215,this.renderOrder=30,this.opacity=1,this.visible=!0,this.userData={}}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,this.opacity=t.opacity,this.visible=t.visible,t.userData?this.userData=JSON.parse(JSON.stringify(t.userData)):this.userData={}},t.prototype.onDwgOut=function(t){t.color=this.color,t.renderOrder=this.renderOrder,t.opacity=this.opacity,t.visible=this.visible,Object.keys(this.userData).length>0&&(t.userData=this.userData)},t.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;
|