mxdraw 0.1.8 → 0.1.11
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/MxDbEntity/MxDbEntity.js +53 -12
- package/dist/lib/MxModule/MxDbImage/MxDbImage.js +2 -1
- package/dist/lib/MxModule/MxDbRect/MxDbRect.js +140 -86
- package/dist/lib/MxModule/MxDbSVG/MxDbSVG.js +194 -58
- package/dist/lib/MxModule/MxDbSVGText/MxDbSVGText.js +21 -0
- package/dist/lib/MxModule/MxDbSVGText/index.js +5 -0
- package/dist/lib/MxModule/MxDrawObject/MxDrawObject.js +74 -2
- package/dist/lib/MxModule/MxFun/MxFun.js +64 -2
- package/dist/lib/MxModule/MxThreeJS/MxThreeJS.js +5 -1
- package/dist/lib/MxModule/MxThreeJS/MxThreeJS.mixin.js +13 -1
- package/dist/lib/MxModule/loadCoreCode/loadCoreCode.js +9 -8
- package/dist/lib/MxModule/loadCoreCode/mxUiData.js +317 -0
- package/dist/lib/MxModule/loadCoreCode/mxfun.es5.js +196 -64
- package/dist/lib/mxdraw.js +4 -1
- package/dist/lib/tools/dynamicImport/index.js +45 -1
- package/dist/lib/tools/three/index.js +21 -15
- package/dist/mxdraw.es5.js +3 -3
- package/dist/mxdraw.es5.js.map +1 -1
- package/dist/mxdraw.umd.js +3 -3
- package/dist/mxdraw.umd.js.map +1 -1
- package/dist/types/MxModule/McGiWorldDraw/McGiWorldDraw.d.ts +1 -1
- package/dist/types/MxModule/MxDbEntity/MxDbEntity.d.ts +33 -4
- package/dist/types/MxModule/MxDbRect/MxDbRect.d.ts +21 -42
- package/dist/types/MxModule/MxDbSVG/MxDbSVG.d.ts +10 -9
- package/dist/types/MxModule/MxDbSVGText/MxDbSVGText.d.ts +10 -0
- package/dist/types/MxModule/MxDbSVGText/index.d.ts +3 -0
- package/dist/types/MxModule/MxDrawObject/MxDrawObject.d.ts +12 -1
- package/dist/types/MxModule/MxFun/MxFun.d.ts +25 -1
- package/dist/types/MxModule/MxThreeJS/MxThreeJS.d.ts +1 -1
- package/dist/types/MxModule/loadCoreCode/mxUiData.d.ts +111 -0
- package/dist/types/mxdraw.d.ts +3 -1
- package/dist/types/tools/dynamicImport/index.d.ts +1 -0
- package/dist/types/types/MxDrawObject.d.ts +2 -1
- package/dist/types/types/MxFun.d.ts +2 -1
- package/package.json +1 -1
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
///////////////////////////////////////////////////////////////////////////////
|
|
3
|
+
//版权所有(C)2002-2022,成都梦想凯德科技有限公司。
|
|
4
|
+
//本软件代码及其文档和相关资料归成都梦想凯德科技有限公司,应用包含本软件的程序必须包括以下版权声明
|
|
5
|
+
//此应用程序与成都梦想凯德科技有限公司成协议。通过使用本软件、其文档或相关材料
|
|
6
|
+
///////////////////////////////////////////////////////////////////////////////
|
|
2
7
|
/** @module MxDbEntity*/
|
|
3
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
9
|
var MxType_1 = require("../MxType");
|
|
@@ -25,8 +30,16 @@ var store_1 = require("../store/store");
|
|
|
25
30
|
*/
|
|
26
31
|
var MxDbEntity = /** @class */ (function () {
|
|
27
32
|
function MxDbEntity() {
|
|
28
|
-
this.
|
|
29
|
-
this.
|
|
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;
|
|
30
43
|
}
|
|
31
44
|
/**
|
|
32
45
|
* 自定义实体的坐标变换.
|
|
@@ -66,6 +79,34 @@ var MxDbEntity = /** @class */ (function () {
|
|
|
66
79
|
return false;
|
|
67
80
|
}
|
|
68
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
|
+
};
|
|
69
110
|
/**
|
|
70
111
|
* 得到对象的id.
|
|
71
112
|
* @param
|
|
@@ -111,8 +152,8 @@ var MxDbEntity = /** @class */ (function () {
|
|
|
111
152
|
*
|
|
112
153
|
* ```
|
|
113
154
|
*/
|
|
114
|
-
MxDbEntity.prototype.setColor = function (
|
|
115
|
-
this.
|
|
155
|
+
MxDbEntity.prototype.setColor = function (color) {
|
|
156
|
+
this.color = color;
|
|
116
157
|
};
|
|
117
158
|
/**
|
|
118
159
|
* 得到颜色
|
|
@@ -124,7 +165,7 @@ var MxDbEntity = /** @class */ (function () {
|
|
|
124
165
|
* ```
|
|
125
166
|
*/
|
|
126
167
|
MxDbEntity.prototype.getColor = function () {
|
|
127
|
-
return this.
|
|
168
|
+
return this.color;
|
|
128
169
|
};
|
|
129
170
|
/**
|
|
130
171
|
* 复制对象。
|
|
@@ -147,16 +188,16 @@ var MxDbEntity = /** @class */ (function () {
|
|
|
147
188
|
* @param obj dwgIn抽象方法的回调数据
|
|
148
189
|
*/
|
|
149
190
|
MxDbEntity.prototype.onDwgIn = function (obj) {
|
|
150
|
-
this.
|
|
151
|
-
this.
|
|
191
|
+
this.color = obj['color'];
|
|
192
|
+
this.renderOrder = obj['renderOrder'];
|
|
152
193
|
};
|
|
153
194
|
/**
|
|
154
195
|
* 自定义对象内部数据输出同步(实现dwgIn抽象方法 必须在实现中调用 this.onDwgIn()
|
|
155
196
|
* @param obj dwgOut抽象方法的回调数据
|
|
156
197
|
*/
|
|
157
198
|
MxDbEntity.prototype.onDwgOut = function (obj) {
|
|
158
|
-
obj['
|
|
159
|
-
obj['
|
|
199
|
+
obj['color'] = this.color;
|
|
200
|
+
obj['renderOrder'] = this.renderOrder;
|
|
160
201
|
};
|
|
161
202
|
/**
|
|
162
203
|
* 初始自定义对象的类型信息.
|
|
@@ -180,8 +221,8 @@ var MxDbEntity = /** @class */ (function () {
|
|
|
180
221
|
*
|
|
181
222
|
* ```
|
|
182
223
|
*/
|
|
183
|
-
MxDbEntity.prototype.setRenderOrder = function (
|
|
184
|
-
this.
|
|
224
|
+
MxDbEntity.prototype.setRenderOrder = function (renderOrder) {
|
|
225
|
+
this.renderOrder = renderOrder;
|
|
185
226
|
};
|
|
186
227
|
/**
|
|
187
228
|
* 得到显示顺序
|
|
@@ -193,7 +234,7 @@ var MxDbEntity = /** @class */ (function () {
|
|
|
193
234
|
* ```
|
|
194
235
|
*/
|
|
195
236
|
MxDbEntity.prototype.getRenderOrder = function () {
|
|
196
|
-
return this.
|
|
237
|
+
return this.renderOrder;
|
|
197
238
|
};
|
|
198
239
|
return MxDbEntity;
|
|
199
240
|
}());
|
|
@@ -70,6 +70,7 @@ var MxDbImage = /** @class */ (function (_super) {
|
|
|
70
70
|
}
|
|
71
71
|
else if (this.imagePath.length > 0 && this.isLoadMaterialFromPath) {
|
|
72
72
|
var myThis_1 = this;
|
|
73
|
+
var mxobj_1 = pWorldDraw.getMxObject();
|
|
73
74
|
MxFun_1.default.loadImageMaterial(this.imagePath, function (material) {
|
|
74
75
|
_this.isLoadMaterialFromPath = false;
|
|
75
76
|
if (!material) {
|
|
@@ -77,7 +78,7 @@ var MxDbImage = /** @class */ (function (_super) {
|
|
|
77
78
|
}
|
|
78
79
|
myThis_1.setMaterial(material);
|
|
79
80
|
myThis_1.setNeedUpdateDisplay();
|
|
80
|
-
|
|
81
|
+
mxobj_1.updateDisplay();
|
|
81
82
|
});
|
|
82
83
|
}
|
|
83
84
|
}
|
|
@@ -26,10 +26,17 @@ var __assign = (this && this.__assign) || function () {
|
|
|
26
26
|
return __assign.apply(this, arguments);
|
|
27
27
|
};
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
+
///////////////////////////////////////////////////////////////////////////////
|
|
30
|
+
//版权所有(C)2002-2022,成都梦想凯德科技有限公司。
|
|
31
|
+
//本软件代码及其文档和相关资料归成都梦想凯德科技有限公司,应用包含本软件的程序必须包括以下版权声明
|
|
32
|
+
//此应用程序与成都梦想凯德科技有限公司成协议。通过使用本软件、其文档或相关材料
|
|
33
|
+
///////////////////////////////////////////////////////////////////////////////
|
|
29
34
|
var MxDbEntity_1 = require("../MxDbEntity");
|
|
30
35
|
var three_1 = require("three");
|
|
31
36
|
var index_1 = require("../../tools/three/index");
|
|
37
|
+
// import * as _ from 'lodash'
|
|
32
38
|
var MxFun_1 = require("../MxFun");
|
|
39
|
+
var McGiWorldDrawType_1 = require("../McGiWorldDrawType");
|
|
33
40
|
/**
|
|
34
41
|
* MxRectEntity 矩形对象.
|
|
35
42
|
*/
|
|
@@ -37,6 +44,8 @@ var MxDbRect = /** @class */ (function (_super) {
|
|
|
37
44
|
__extends(MxDbRect, _super);
|
|
38
45
|
function MxDbRect() {
|
|
39
46
|
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
47
|
+
// 圆角半径
|
|
48
|
+
_this.cornerRadius = [];
|
|
40
49
|
/**
|
|
41
50
|
* pt1: 构成矩形的第一个点
|
|
42
51
|
* */
|
|
@@ -46,122 +55,109 @@ var MxDbRect = /** @class */ (function (_super) {
|
|
|
46
55
|
* */
|
|
47
56
|
_this.pt2 = new three_1.Vector3();
|
|
48
57
|
/**
|
|
49
|
-
*
|
|
50
|
-
* */
|
|
51
|
-
_this.width = 0;
|
|
52
|
-
/**
|
|
53
|
-
* height: 在绘制时自动计算矩形像素高度 单位px
|
|
54
|
-
* */
|
|
55
|
-
_this.height = 0;
|
|
56
|
-
/**
|
|
57
|
-
* cornerRadius(优先级大于radius属性): 圆角的半径 如[3, 2, 1, 4]分别对应左上角圆角半径3 右上角2 右下角1 左下角4
|
|
58
|
+
* 是否需要颜色填充.
|
|
58
59
|
* */
|
|
59
|
-
_this.
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
* */
|
|
63
|
-
_this.transparent = true;
|
|
64
|
-
/**
|
|
65
|
-
* opacity 设置透明度 0 ~ 1
|
|
66
|
-
* */
|
|
67
|
-
_this.opacity = 1;
|
|
68
|
-
/**
|
|
69
|
-
* visible 该矩形对象是否可见
|
|
70
|
-
* */
|
|
71
|
-
_this.visible = true;
|
|
60
|
+
_this.isSolidColorFill = false;
|
|
61
|
+
_this.isLoadMaterialFromPath = true;
|
|
62
|
+
_this.material = null;
|
|
72
63
|
return _this;
|
|
73
64
|
}
|
|
74
65
|
MxDbRect.prototype.worldDraw = function (pWorldDraw) {
|
|
75
66
|
var _this = this;
|
|
76
67
|
// 根据第一个点和对角点 计算矩形的四个点位
|
|
77
68
|
var points = (0, index_1.computeRectPoints)(this.pt1, this.pt2);
|
|
78
|
-
// 计算圆角顶点坐标
|
|
79
|
-
if (this.cornerRadius.length <= 0 && this.radius) {
|
|
80
|
-
this.cornerRadius = [
|
|
81
|
-
MxFun_1.default.screenCoordLong2Doc(this.radius),
|
|
82
|
-
MxFun_1.default.screenCoordLong2Doc(this.radius),
|
|
83
|
-
MxFun_1.default.screenCoordLong2Doc(this.radius),
|
|
84
|
-
MxFun_1.default.screenCoordLong2Doc(this.radius)
|
|
85
|
-
];
|
|
86
|
-
}
|
|
87
69
|
if (this.cornerRadius.length > 0) {
|
|
88
70
|
points = (0, index_1.getToGenerateRoundedCorners)(points, this.cornerRadius);
|
|
89
71
|
}
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
72
|
+
if (pWorldDraw.getType() != McGiWorldDrawType_1.default.kWorldDraw) {
|
|
73
|
+
// 动态拖动绘制,或选择绘制 。
|
|
74
|
+
// 组成闭合区域。
|
|
75
|
+
points.push(points[0]);
|
|
76
|
+
pWorldDraw.drawLines(points);
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
93
79
|
// 公共的material参数
|
|
94
80
|
var materialParam = {
|
|
95
|
-
transparent:
|
|
81
|
+
transparent: true,
|
|
82
|
+
depthTest: false,
|
|
96
83
|
opacity: this.opacity,
|
|
97
84
|
visible: this.visible
|
|
98
85
|
};
|
|
99
86
|
// 如果是填充模式
|
|
100
|
-
if (this.
|
|
87
|
+
if (this.isSolidColorFill) {
|
|
101
88
|
// 三维坐标转二位坐标
|
|
102
89
|
points = points.map(function (_a) {
|
|
103
90
|
var x = _a.x, y = _a.y;
|
|
104
91
|
return new three_1.Vector2(x, y);
|
|
105
92
|
});
|
|
106
93
|
// 计算矩形宽高
|
|
94
|
+
var geometry = void 0;
|
|
107
95
|
geometry = new three_1.ShapeGeometry(new three_1.Shape(points));
|
|
108
|
-
|
|
109
|
-
var
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
96
|
+
// 颜色填充
|
|
97
|
+
var material = new three_1.MeshBasicMaterial(__assign({ color: this.filter
|
|
98
|
+
? this.filter._getFilterColor(this.color, this.opacity)
|
|
99
|
+
: new three_1.Color(this.color) }, materialParam));
|
|
100
|
+
var mash = new three_1.Mesh(geometry, material);
|
|
101
|
+
pWorldDraw.drawEntity(mash);
|
|
102
|
+
}
|
|
103
|
+
else if (this.fillImageSrc) {
|
|
104
|
+
// 图片填充.
|
|
105
|
+
if (this.material) {
|
|
106
|
+
// 三维坐标转二位坐标
|
|
107
|
+
points = points.map(function (_a) {
|
|
108
|
+
var x = _a.x, y = _a.y;
|
|
109
|
+
return new three_1.Vector2(x, y);
|
|
110
|
+
});
|
|
111
|
+
var material = this.material;
|
|
112
|
+
var geometry = new three_1.ShapeGeometry(new three_1.Shape(points));
|
|
113
|
+
// 修复集合体的uv坐标
|
|
114
|
+
geometry = (0, index_1.repairGeometryFaceVertexUvs)(geometry);
|
|
115
|
+
// 有滤镜对象使用自定义着色器
|
|
116
|
+
if (this.filter) {
|
|
123
117
|
// 纹理属性设置
|
|
118
|
+
var mate = material;
|
|
124
119
|
var map = mate.map;
|
|
125
|
-
if (
|
|
126
|
-
if (
|
|
127
|
-
map.center =
|
|
128
|
-
if (
|
|
129
|
-
map.offset =
|
|
130
|
-
if (
|
|
131
|
-
map.repeat =
|
|
132
|
-
if (
|
|
133
|
-
map.rotation =
|
|
120
|
+
if (this.fillImageParam) {
|
|
121
|
+
if (this.fillImageParam.center)
|
|
122
|
+
map.center = this.fillImageParam.center;
|
|
123
|
+
if (this.fillImageParam.offset)
|
|
124
|
+
map.offset = this.fillImageParam.offset;
|
|
125
|
+
if (this.fillImageParam.repeat)
|
|
126
|
+
map.repeat = this.fillImageParam.repeat;
|
|
127
|
+
if (this.fillImageParam.rotation)
|
|
128
|
+
map.rotation = this.fillImageParam.rotation;
|
|
134
129
|
}
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
130
|
+
var data = this.filter._getFilterShaderData(map);
|
|
131
|
+
material = new three_1.ShaderMaterial(__assign(__assign({}, data), materialParam));
|
|
132
|
+
}
|
|
133
|
+
// 设置材质属性
|
|
134
|
+
material.depthTest = false;
|
|
135
|
+
material.transparent = true;
|
|
136
|
+
material.opacity = this.opacity;
|
|
137
|
+
material.visible = this.visible;
|
|
138
|
+
var mash = new three_1.Mesh(geometry, material);
|
|
139
|
+
pWorldDraw.drawEntity(mash);
|
|
140
|
+
}
|
|
141
|
+
else if (this.fillImageSrc.length > 0 && this.isLoadMaterialFromPath) {
|
|
142
|
+
var myThis_1 = this;
|
|
143
|
+
MxFun_1.default.loadImageMaterial(this.fillImageSrc, function (material) {
|
|
144
|
+
_this.isLoadMaterialFromPath = false;
|
|
145
|
+
if (!material) {
|
|
146
|
+
return;
|
|
139
147
|
}
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
material.opacity = _this.opacity;
|
|
144
|
-
material.visible = _this.visible;
|
|
145
|
-
line = new three_1.Mesh(geometry, material);
|
|
146
|
-
pWorldDraw.drawEntity(line);
|
|
148
|
+
myThis_1.material = material;
|
|
149
|
+
myThis_1.setNeedUpdateDisplay();
|
|
150
|
+
MxFun_1.default.updateDisplay();
|
|
147
151
|
});
|
|
148
|
-
return;
|
|
149
|
-
}
|
|
150
|
-
else {
|
|
151
|
-
// 颜色填充
|
|
152
|
-
material = new three_1.MeshBasicMaterial(__assign({ color: this.filter
|
|
153
|
-
? this.filter._getFilterColor(this.fillColor, this.opacity)
|
|
154
|
-
: new three_1.Color(this.fillColor) }, materialParam));
|
|
155
|
-
line = new three_1.Mesh(geometry, material);
|
|
156
152
|
}
|
|
157
153
|
}
|
|
158
154
|
else {
|
|
159
155
|
// 线框模式
|
|
160
|
-
geometry = new three_1.BufferGeometry().setFromPoints(points);
|
|
161
|
-
material = new three_1.LineBasicMaterial(__assign({ color: this.getColor() }, materialParam));
|
|
162
|
-
line = new three_1.LineLoop(geometry, material);
|
|
156
|
+
var geometry = new three_1.BufferGeometry().setFromPoints(points);
|
|
157
|
+
var material = new three_1.LineBasicMaterial(__assign({ color: this.getColor() }, materialParam));
|
|
158
|
+
var line = new three_1.LineLoop(geometry, material);
|
|
159
|
+
pWorldDraw.drawEntity(line);
|
|
163
160
|
}
|
|
164
|
-
pWorldDraw.drawEntity(line);
|
|
165
161
|
};
|
|
166
162
|
MxDbRect.prototype.getGripPoints = function () {
|
|
167
163
|
var ret = [];
|
|
@@ -190,17 +186,23 @@ var MxDbRect = /** @class */ (function (_super) {
|
|
|
190
186
|
this.onDwgIn(obj);
|
|
191
187
|
this.pt1.copy(obj['pt1']);
|
|
192
188
|
this.pt2.copy(obj['pt2']);
|
|
189
|
+
this.isSolidColorFill = obj['isSolidColorFill'];
|
|
190
|
+
this.fillImageSrc = obj['fillImageSrc'];
|
|
191
|
+
this.fillImageParam = obj['fillImageParam'];
|
|
193
192
|
this.cornerRadius = obj['cornerRadius'];
|
|
194
|
-
this.radius = obj['radius'];
|
|
195
193
|
this.filter = obj['filter'];
|
|
194
|
+
this.isLoadMaterialFromPath = true;
|
|
195
|
+
this.material = null;
|
|
196
196
|
return true;
|
|
197
197
|
};
|
|
198
198
|
MxDbRect.prototype.dwgOut = function (obj) {
|
|
199
199
|
this.onDwgOut(obj);
|
|
200
200
|
obj['pt1'] = this.pt1;
|
|
201
201
|
obj['pt2'] = this.pt2;
|
|
202
|
+
obj['isSolidColorFill'] = this.isSolidColorFill;
|
|
203
|
+
obj['fillImageSrc'] = this.fillImageSrc;
|
|
204
|
+
obj['fillImageParam'] = this.fillImageParam;
|
|
202
205
|
obj['cornerRadius'] = this.cornerRadius;
|
|
203
|
-
obj['radius'] = this.radius;
|
|
204
206
|
obj['filter'] = this.filter;
|
|
205
207
|
return obj;
|
|
206
208
|
};
|
|
@@ -211,8 +213,60 @@ var MxDbRect = /** @class */ (function (_super) {
|
|
|
211
213
|
this.pt1.applyMatrix4(mat);
|
|
212
214
|
this.pt2.applyMatrix4(mat);
|
|
213
215
|
};
|
|
216
|
+
/**
|
|
217
|
+
* setRadius 设置圆角 圆角的半径 如[3, 2, 1, 4]分别对应左上角圆角半径3 右上角2 右下角1 左下角4
|
|
218
|
+
* @param { number | number[] } radius 圆角半径 为数组时[3, 2, 1, 4]分别对应左上角圆角半径3 右上角2 右下角1 左下角4; 或者直接设置半径值 则四个角统一半径
|
|
219
|
+
* */
|
|
220
|
+
MxDbRect.prototype.setRadius = function (radius, isScreenCoord) {
|
|
221
|
+
if (isScreenCoord === void 0) { isScreenCoord = true; }
|
|
222
|
+
if (radius instanceof Array) {
|
|
223
|
+
this.cornerRadius = radius.map(function (r) {
|
|
224
|
+
if (isScreenCoord)
|
|
225
|
+
return MxFun_1.default.screenCoordLong2Doc(r);
|
|
226
|
+
else
|
|
227
|
+
return r;
|
|
228
|
+
});
|
|
229
|
+
}
|
|
230
|
+
else {
|
|
231
|
+
if (radius > 0) {
|
|
232
|
+
if (isScreenCoord) {
|
|
233
|
+
this.cornerRadius = [
|
|
234
|
+
MxFun_1.default.screenCoordLong2Doc(radius),
|
|
235
|
+
MxFun_1.default.screenCoordLong2Doc(radius),
|
|
236
|
+
MxFun_1.default.screenCoordLong2Doc(radius),
|
|
237
|
+
MxFun_1.default.screenCoordLong2Doc(radius)
|
|
238
|
+
];
|
|
239
|
+
}
|
|
240
|
+
else {
|
|
241
|
+
this.cornerRadius = [radius, radius, radius, radius];
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
else {
|
|
245
|
+
this.cornerRadius = [];
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
};
|
|
214
249
|
MxDbRect.prototype.getTypeName = function () {
|
|
215
|
-
return '
|
|
250
|
+
return 'MxDbRect';
|
|
251
|
+
};
|
|
252
|
+
MxDbRect.prototype.getFilter = function () {
|
|
253
|
+
return this.filter;
|
|
254
|
+
};
|
|
255
|
+
MxDbRect.prototype.setFilter = function (filter) {
|
|
256
|
+
this.filter = filter;
|
|
257
|
+
this.isLoadMaterialFromPath = true;
|
|
258
|
+
this.material = null;
|
|
259
|
+
};
|
|
260
|
+
MxDbRect.prototype.setFillImagePath = function (sPath) {
|
|
261
|
+
this.fillImageSrc = sPath;
|
|
262
|
+
this.isLoadMaterialFromPath = true;
|
|
263
|
+
this.material = null;
|
|
264
|
+
if (this.fillImageSrc) {
|
|
265
|
+
this.isSolidColorFill = false;
|
|
266
|
+
}
|
|
267
|
+
};
|
|
268
|
+
MxDbRect.prototype.getFillImagePath = function () {
|
|
269
|
+
return this.fillImageSrc;
|
|
216
270
|
};
|
|
217
271
|
return MxDbRect;
|
|
218
272
|
}(MxDbEntity_1.default));
|