mxcad 1.0.219 → 1.0.221
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/mxcad.d.ts +126 -26
- package/dist/mxcad.es.js +53 -26
- package/dist/mxcad.umd.js +1 -1
- package/dist/wasm/2d/mxdrawassembly_min.js +1509 -1509
- package/dist/wasm/2d/mxdrawassembly_min.wasm +0 -0
- package/dist/wasm/2d-st/mxdrawassembly_min.js +1510 -1510
- package/dist/wasm/2d-st/mxdrawassembly_minst.wasm +0 -0
- package/package.json +1 -1
package/dist/mxcad.d.ts
CHANGED
|
@@ -157,7 +157,8 @@ export declare class McRxObject {
|
|
|
157
157
|
*/
|
|
158
158
|
get objectName(): string;
|
|
159
159
|
/**
|
|
160
|
-
*
|
|
160
|
+
* 得到对象的DXF组码的类型名,这个和AutoCAD中的DXF组码是一样。
|
|
161
|
+
* 比如直线的类型名为:McDbLine,DXF0组码值: LINE,DXF0组码值可以用来构造集时的类型过滤。
|
|
161
162
|
*/
|
|
162
163
|
get dxf0(): string;
|
|
163
164
|
/**
|
|
@@ -615,12 +616,14 @@ export declare class McDbObject extends McRxObject {
|
|
|
615
616
|
*/
|
|
616
617
|
freeTempRelationObject(): void;
|
|
617
618
|
/**
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
619
|
+
* 设置对象被改变的状态,可自动触发更新显示函数,更新显示。
|
|
620
|
+
* 比如块表记录更新了,需要通知块引用更新显示,可以调用该函数。
|
|
621
|
+
* @example
|
|
622
|
+
* ```ts
|
|
623
|
+
* //假设obj为一个数据库对象
|
|
624
|
+
* obj.assertObjectModification()
|
|
625
|
+
* ```
|
|
626
|
+
*/
|
|
624
627
|
assertObjectModification(autoUndo?: boolean): number;
|
|
625
628
|
}
|
|
626
629
|
/** McDbObject 的一个数组,该数组存储了多个 McDbObject 对象的引用。 */
|
|
@@ -2678,7 +2681,7 @@ export declare class MxCADUtilityClass {
|
|
|
2678
2681
|
* ```ts
|
|
2679
2682
|
* import { MxCADUtility } from "mxcad";
|
|
2680
2683
|
*
|
|
2681
|
-
* const ret = MxCADUtility.getCorner("测试");
|
|
2684
|
+
* const ret = await MxCADUtility.getCorner("测试");
|
|
2682
2685
|
* if (!ret) return;
|
|
2683
2686
|
* console.log(ret.pt1, ret.pt2)
|
|
2684
2687
|
* ```
|
|
@@ -4258,7 +4261,7 @@ export declare class McDbEntity extends McDbObject {
|
|
|
4258
4261
|
};
|
|
4259
4262
|
/**
|
|
4260
4263
|
* 得到对象的扩展数据
|
|
4261
|
-
* @param appName
|
|
4264
|
+
* @param appName 扩展数据名
|
|
4262
4265
|
* @example
|
|
4263
4266
|
* ```ts
|
|
4264
4267
|
* // 假设ent为有效实例对象
|
|
@@ -4268,7 +4271,7 @@ export declare class McDbEntity extends McDbObject {
|
|
|
4268
4271
|
getxData(appName?: string): MxCADResbuf;
|
|
4269
4272
|
/**
|
|
4270
4273
|
* 设置对象的扩展数据
|
|
4271
|
-
* @param xdata
|
|
4274
|
+
* @param xdata 扩展数据链表
|
|
4272
4275
|
* @example
|
|
4273
4276
|
* ```ts
|
|
4274
4277
|
* import { MxCADUiPrEntity, McDbEntity } from "mxcad";
|
|
@@ -4286,12 +4289,15 @@ export declare class McDbEntity extends McDbObject {
|
|
|
4286
4289
|
setxData(xdata: MxCADResbuf): boolean;
|
|
4287
4290
|
/**
|
|
4288
4291
|
* 获取与特定实体关联的 XData 信息,并以字符串形式返回
|
|
4289
|
-
* @param appName
|
|
4292
|
+
* @param appName 扩展数据名称
|
|
4290
4293
|
* @returns { object } val XData信息 | ret 是否返回成功
|
|
4291
4294
|
* @example
|
|
4292
4295
|
* ```ts
|
|
4293
4296
|
* // 假设ent为有效实例对象
|
|
4294
4297
|
* let data = ent.getxDataString("DataName");
|
|
4298
|
+
* if(data.ret){
|
|
4299
|
+
* console.log(data.val)
|
|
4300
|
+
* }
|
|
4295
4301
|
* ```
|
|
4296
4302
|
*/
|
|
4297
4303
|
getxDataString(appName: string): {
|
|
@@ -4300,8 +4306,8 @@ export declare class McDbEntity extends McDbObject {
|
|
|
4300
4306
|
};
|
|
4301
4307
|
/**
|
|
4302
4308
|
* 设置与特定实体关联的 XData 信息,并以字符串形式设置
|
|
4303
|
-
* @param appName
|
|
4304
|
-
* @param val
|
|
4309
|
+
* @param appName 扩展数据名称
|
|
4310
|
+
* @param val 字符串值
|
|
4305
4311
|
* @returns 是否设置成功
|
|
4306
4312
|
* @example
|
|
4307
4313
|
* ```ts
|
|
@@ -4323,8 +4329,16 @@ export declare class McDbEntity extends McDbObject {
|
|
|
4323
4329
|
setxDataString(appName: string, val: string): boolean;
|
|
4324
4330
|
/**
|
|
4325
4331
|
* 获取实体的指定 XData 类型中的 double 值
|
|
4326
|
-
* @param appName
|
|
4332
|
+
* @param appName 扩展数据名称
|
|
4327
4333
|
* @returns double 值
|
|
4334
|
+
* @example
|
|
4335
|
+
* ```ts
|
|
4336
|
+
* // 假设ent为有效实例对象
|
|
4337
|
+
* let data = ent.getxDataDouble("DataName");
|
|
4338
|
+
* if(data.ret){
|
|
4339
|
+
* console.log(data.val)
|
|
4340
|
+
* }
|
|
4341
|
+
* ```
|
|
4328
4342
|
*/
|
|
4329
4343
|
getxDataDouble(appName: string): {
|
|
4330
4344
|
val: number;
|
|
@@ -4332,15 +4346,39 @@ export declare class McDbEntity extends McDbObject {
|
|
|
4332
4346
|
};
|
|
4333
4347
|
/**
|
|
4334
4348
|
* 设置实体的指定 XData 类型中的 double 值
|
|
4335
|
-
* @param appName
|
|
4349
|
+
* @param appName 扩展数据名称
|
|
4336
4350
|
* @param val double 值
|
|
4337
4351
|
* @returns 布尔值
|
|
4352
|
+
* @example
|
|
4353
|
+
* ```ts
|
|
4354
|
+
* import { MxCADUiPrEntity, McDbEntity } from "mxcad";
|
|
4355
|
+
* let selEntity = new MxCADUiPrEntity();
|
|
4356
|
+
* selEntity.setMessage("选择对象");
|
|
4357
|
+
* let id = await selEntity.go();
|
|
4358
|
+
* if (!id.isValid()) return;
|
|
4359
|
+
* let ent:McDbEntity = id.getMcDbEntity();
|
|
4360
|
+
* if (ent === null) return;
|
|
4361
|
+
* const res = ent.setxDataDouble("DataName", 0);
|
|
4362
|
+
* if(res){
|
|
4363
|
+
* //设置成功
|
|
4364
|
+
* }else{
|
|
4365
|
+
* //设置失败
|
|
4366
|
+
* }
|
|
4367
|
+
* ```
|
|
4338
4368
|
*/
|
|
4339
4369
|
setxDataDouble(appName: string, val: number): boolean;
|
|
4340
4370
|
/**
|
|
4341
4371
|
* 获取实体的指定 XData 类型中的 long(整数)值
|
|
4342
|
-
* @param appName
|
|
4372
|
+
* @param appName 扩展数据名称
|
|
4343
4373
|
* @returns long 值
|
|
4374
|
+
* @example
|
|
4375
|
+
* ```ts
|
|
4376
|
+
* // 假设ent为有效实例对象
|
|
4377
|
+
* let data = ent.getxDataLong("DataName");
|
|
4378
|
+
* if(data.ret){
|
|
4379
|
+
* console.log(data.val)
|
|
4380
|
+
* }
|
|
4381
|
+
* ```
|
|
4344
4382
|
*/
|
|
4345
4383
|
getxDataLong(appName: string): {
|
|
4346
4384
|
val: number;
|
|
@@ -4348,14 +4386,31 @@ export declare class McDbEntity extends McDbObject {
|
|
|
4348
4386
|
};
|
|
4349
4387
|
/**
|
|
4350
4388
|
* 设置实体的指定 XData 类型中的 long(整数)值
|
|
4351
|
-
* @param appName
|
|
4389
|
+
* @param appName 扩展数据名称
|
|
4352
4390
|
* @param val long 值
|
|
4353
4391
|
* @returns long 值
|
|
4392
|
+
* @example
|
|
4393
|
+
* ```ts
|
|
4394
|
+
* import { MxCADUiPrEntity, McDbEntity } from "mxcad";
|
|
4395
|
+
*
|
|
4396
|
+
* let selEntity = new MxCADUiPrEntity();
|
|
4397
|
+
* selEntity.setMessage("选择对象");
|
|
4398
|
+
* let id = await selEntity.go();
|
|
4399
|
+
* if (!id.isValid()) return;
|
|
4400
|
+
* let ent:McDbEntity = id.getMcDbEntity();
|
|
4401
|
+
* if (ent === null) return;
|
|
4402
|
+
* const res = ent.setxDataLong("DataName", 123456);
|
|
4403
|
+
* if(res){
|
|
4404
|
+
* //设置成功
|
|
4405
|
+
* }else{
|
|
4406
|
+
* //设置失败
|
|
4407
|
+
* }
|
|
4408
|
+
* ```
|
|
4354
4409
|
*/
|
|
4355
4410
|
setxDataLong(appName: string, val: number): boolean;
|
|
4356
4411
|
/**
|
|
4357
4412
|
* 获取实体的指定 XData 类型中的点对象
|
|
4358
|
-
* @param appName
|
|
4413
|
+
* @param appName 扩展数据名称
|
|
4359
4414
|
* @return 获取结果及三维点对象
|
|
4360
4415
|
*/
|
|
4361
4416
|
getxDataPoint(appName: string): {
|
|
@@ -4364,14 +4419,31 @@ export declare class McDbEntity extends McDbObject {
|
|
|
4364
4419
|
};
|
|
4365
4420
|
/**
|
|
4366
4421
|
* 设置实体的指定 XData 类型中的点对象
|
|
4367
|
-
* @param appName
|
|
4422
|
+
* @param appName 扩展数据名称
|
|
4368
4423
|
* @param val 点对象
|
|
4369
4424
|
* @return 获取结果及三维点对象
|
|
4370
4425
|
*/
|
|
4371
4426
|
setxDataPoint(appName: string, val: McGePoint3d): boolean;
|
|
4372
4427
|
/**
|
|
4373
4428
|
* 删除实体指定应用程序名称相关的数据
|
|
4374
|
-
* @param appName
|
|
4429
|
+
* @param appName 扩展数据名称
|
|
4430
|
+
* @example
|
|
4431
|
+
* ```ts
|
|
4432
|
+
* import { MxCADUiPrEntity, McDbEntity } from "mxcad";
|
|
4433
|
+
*
|
|
4434
|
+
* let selEntity = new MxCADUiPrEntity();
|
|
4435
|
+
* selEntity.setMessage("选择对象");
|
|
4436
|
+
* let id = await selEntity.go();
|
|
4437
|
+
* if (!id.isValid()) return;
|
|
4438
|
+
* let ent:McDbEntity = id.getMcDbEntity();
|
|
4439
|
+
* if (ent === null) return;
|
|
4440
|
+
* const res = ent.deleteXData("DataName");
|
|
4441
|
+
* if(res){
|
|
4442
|
+
* //删除成功
|
|
4443
|
+
* }else
|
|
4444
|
+
* //删除失败
|
|
4445
|
+
* }
|
|
4446
|
+
* ```
|
|
4375
4447
|
*/
|
|
4376
4448
|
deleteXData(appName: string): boolean;
|
|
4377
4449
|
/**
|
|
@@ -8870,20 +8942,20 @@ export declare class McDbTextStyleTableRecord extends McDbObject {
|
|
|
8870
8942
|
get flagBits(): number;
|
|
8871
8943
|
set flagBits(val: number);
|
|
8872
8944
|
/**
|
|
8873
|
-
*
|
|
8945
|
+
* 字体文件名称
|
|
8874
8946
|
* @example
|
|
8875
8947
|
* ```ts
|
|
8876
8948
|
* import { McDbTextStyleTableRecord } from 'mxcad';
|
|
8877
8949
|
*
|
|
8878
8950
|
* const newTextStyleRecord = new McDbTextStyleTableRecord();
|
|
8879
8951
|
* newTextStyleRecord.fileName = "测试字体名";
|
|
8880
|
-
* console.log("
|
|
8952
|
+
* console.log("当前字体文件名:",newTextStyleRecord.fileName)
|
|
8881
8953
|
* ```
|
|
8882
8954
|
*/
|
|
8883
8955
|
get fileName(): string;
|
|
8884
8956
|
set fileName(val: string);
|
|
8885
8957
|
/**
|
|
8886
|
-
*
|
|
8958
|
+
* 大字体文件名称
|
|
8887
8959
|
* @example
|
|
8888
8960
|
* ```ts
|
|
8889
8961
|
* import { McDbTextStyleTableRecord } from 'mxcad';
|
|
@@ -10327,7 +10399,7 @@ export declare class McDbXrecord extends McDbObject {
|
|
|
10327
10399
|
* const xrec = new McDbXrecord();
|
|
10328
10400
|
* let data = new MxCADResbuf();
|
|
10329
10401
|
* data.AddString("TestData");
|
|
10330
|
-
* const res =
|
|
10402
|
+
* const res = xrec.setData(data);
|
|
10331
10403
|
* if(res){
|
|
10332
10404
|
* //设置成功
|
|
10333
10405
|
* }else{
|
|
@@ -10570,6 +10642,18 @@ export declare class McObject {
|
|
|
10570
10642
|
*/
|
|
10571
10643
|
constructor(imp?: any);
|
|
10572
10644
|
/**
|
|
10645
|
+
* 设置对象的一些属性设置
|
|
10646
|
+
* @param val 属性设置内容.
|
|
10647
|
+
* 1. DisplayPrecision 显示精度设置,默认为0,可以取0 ~1000,1000为最高精度了
|
|
10648
|
+
* 2. EnableUndo 启用undo功能,默认是没有启动的
|
|
10649
|
+
* @example
|
|
10650
|
+
* ```ts
|
|
10651
|
+
* 启用undo
|
|
10652
|
+
* mxcad.setAttribute({EnableUndo:true})
|
|
10653
|
+
* ```
|
|
10654
|
+
*/
|
|
10655
|
+
setAttribute(val: object): boolean;
|
|
10656
|
+
/**
|
|
10573
10657
|
* 返回与MxCAD对象绑定的MxDraw对象。
|
|
10574
10658
|
* @returns MxDraw对象
|
|
10575
10659
|
* @example
|
|
@@ -10966,7 +11050,7 @@ export declare class McObject {
|
|
|
10966
11050
|
* 设置绘制颜色索引
|
|
10967
11051
|
* @returns val 颜色索引类型
|
|
10968
11052
|
*/
|
|
10969
|
-
get drawColorIndex():
|
|
11053
|
+
get drawColorIndex(): number;
|
|
10970
11054
|
/**
|
|
10971
11055
|
* 设置绘制颜色索引
|
|
10972
11056
|
* @param val 颜色索引类型
|
|
@@ -10977,7 +11061,7 @@ export declare class McObject {
|
|
|
10977
11061
|
* mxcad.drawColorIndex = ColorIndexType.kMagenta;
|
|
10978
11062
|
* ```
|
|
10979
11063
|
*/
|
|
10980
|
-
set drawColorIndex(val: ColorIndexType);
|
|
11064
|
+
set drawColorIndex(val: ColorIndexType | number);
|
|
10981
11065
|
/**
|
|
10982
11066
|
* 获取绘制线宽
|
|
10983
11067
|
* @returns 返回绘制线宽
|
|
@@ -11987,6 +12071,14 @@ export declare class McAppType {
|
|
|
11987
12071
|
*/
|
|
11988
12072
|
addNetworkLoadingFont(fontfiles: string | string[]): void;
|
|
11989
12073
|
/**
|
|
12074
|
+
* 全局参数的初始设置
|
|
12075
|
+
* @param ini 初始设置值
|
|
12076
|
+
* @example
|
|
12077
|
+
* ```ts
|
|
12078
|
+
* ```
|
|
12079
|
+
*/
|
|
12080
|
+
IniSet(ini: object): boolean;
|
|
12081
|
+
/**
|
|
11990
12082
|
* 配置需要通过网络加载的bigfont shx字体
|
|
11991
12083
|
* @param fontfiles 加载的字体文件
|
|
11992
12084
|
* @example
|
|
@@ -12966,6 +13058,14 @@ export interface MxCadConfig {
|
|
|
12966
13058
|
map?: any;
|
|
12967
13059
|
/**多选模式 */
|
|
12968
13060
|
multipleSelect?: boolean;
|
|
13061
|
+
/**是否启用Undo */
|
|
13062
|
+
enableUndo?: boolean;
|
|
13063
|
+
/**使用鼠标中键移动视区,默认是使用 */
|
|
13064
|
+
mouseMiddlePan?: number;
|
|
13065
|
+
/**是否启用选择功能,默认是使用 */
|
|
13066
|
+
enableIntelliSelect?: boolean;
|
|
13067
|
+
/**是否启用浏览模式,默认是编辑模式 */
|
|
13068
|
+
browse?: boolean;
|
|
12969
13069
|
}
|
|
12970
13070
|
/** 创建MxCad实例
|
|
12971
13071
|
* @param config 参数配置
|
package/dist/mxcad.es.js
CHANGED
|
@@ -14145,7 +14145,7 @@ win.McDrawObjectEvent_asciiToUTF8 = function (hexstr) {
|
|
|
14145
14145
|
return MxG2312Obj.decodeFromGb2312(hexstr);
|
|
14146
14146
|
};
|
|
14147
14147
|
|
|
14148
|
-
const version$1 = "1.0.
|
|
14148
|
+
const version$1 = "1.0.221";
|
|
14149
14149
|
|
|
14150
14150
|
var isSharedArrayBuffer = ("SharedArrayBuffer" in window);
|
|
14151
14151
|
var isCdn = document.currentScript && /unpkg\.com\/mxcad/.test(document.currentScript.src);
|
|
@@ -15160,39 +15160,42 @@ var MxCADUtilityClass = /*#__PURE__*/function () {
|
|
|
15160
15160
|
retPt2 = void 0;
|
|
15161
15161
|
case 5:
|
|
15162
15162
|
if (pt1) {
|
|
15163
|
-
_context3.next =
|
|
15163
|
+
_context3.next = 16;
|
|
15164
15164
|
break;
|
|
15165
15165
|
}
|
|
15166
15166
|
getPoint = new MxCADUiPrPoint();
|
|
15167
15167
|
if (strPrompt) {
|
|
15168
15168
|
getPoint.setMessage(strPrompt);
|
|
15169
15169
|
}
|
|
15170
|
+
if (isDisableAllTrace) {
|
|
15171
|
+
getPoint.disableAllTrace(true);
|
|
15172
|
+
}
|
|
15170
15173
|
init && init(getPoint);
|
|
15171
15174
|
getPoint.setDynamicInputType(DynamicInputType.kDynTip);
|
|
15172
|
-
_context3.next =
|
|
15175
|
+
_context3.next = 14;
|
|
15173
15176
|
return getPoint.go();
|
|
15174
|
-
case
|
|
15177
|
+
case 14:
|
|
15175
15178
|
pt1 = _context3.sent;
|
|
15176
15179
|
retcode = getPoint.getDetailedResult();
|
|
15177
|
-
case
|
|
15180
|
+
case 16:
|
|
15178
15181
|
if (pt1) {
|
|
15179
|
-
_context3.next =
|
|
15182
|
+
_context3.next = 18;
|
|
15180
15183
|
break;
|
|
15181
15184
|
}
|
|
15182
|
-
return _context3.abrupt("break",
|
|
15183
|
-
case
|
|
15185
|
+
return _context3.abrupt("break", 26);
|
|
15186
|
+
case 18:
|
|
15184
15187
|
pt1Doc = MxCoordConvert.cad2doc1(pt1);
|
|
15185
|
-
_context3.next =
|
|
15188
|
+
_context3.next = 21;
|
|
15186
15189
|
return MrxDbgUtils.getCorner(pt1Doc, strPrompt, drawSelectCroner, function (ret) {
|
|
15187
15190
|
retcode = ret.detailedResult;
|
|
15188
15191
|
}, isDisableAllTrace);
|
|
15189
|
-
case
|
|
15192
|
+
case 21:
|
|
15190
15193
|
pt2 = _context3.sent;
|
|
15191
15194
|
if (pt2) {
|
|
15192
15195
|
retPt2 = MxCoordConvert.doc2cad1(pt2);
|
|
15193
15196
|
}
|
|
15194
|
-
return _context3.abrupt("break",
|
|
15195
|
-
case
|
|
15197
|
+
return _context3.abrupt("break", 26);
|
|
15198
|
+
case 26:
|
|
15196
15199
|
if (detailedResult) detailedResult(retcode);
|
|
15197
15200
|
return _context3.abrupt("return", new Promise(function (resolve) {
|
|
15198
15201
|
if (retcode == DetailedResult.kEcsIn || retcode == DetailedResult.kNewCommadIn || retcode == DetailedResult.kUnknown) {
|
|
@@ -15208,7 +15211,7 @@ var MxCADUtilityClass = /*#__PURE__*/function () {
|
|
|
15208
15211
|
}
|
|
15209
15212
|
}
|
|
15210
15213
|
}));
|
|
15211
|
-
case
|
|
15214
|
+
case 28:
|
|
15212
15215
|
case "end":
|
|
15213
15216
|
return _context3.stop();
|
|
15214
15217
|
}
|
|
@@ -19869,6 +19872,11 @@ var McObject = /*#__PURE__*/function () {
|
|
|
19869
19872
|
this.imp = imp;
|
|
19870
19873
|
}
|
|
19871
19874
|
_createClass$1(McObject, [{
|
|
19875
|
+
key: "setAttribute",
|
|
19876
|
+
value: function setAttribute(val) {
|
|
19877
|
+
return this.imp.setAttribute(JSON.stringify(val));
|
|
19878
|
+
}
|
|
19879
|
+
}, {
|
|
19872
19880
|
key: "getMxDrawObject",
|
|
19873
19881
|
value: function getMxDrawObject() {
|
|
19874
19882
|
return this.imp["mxdrawObject"];
|
|
@@ -21067,6 +21075,11 @@ var McAppType = /*#__PURE__*/function () {
|
|
|
21067
21075
|
});
|
|
21068
21076
|
}
|
|
21069
21077
|
}
|
|
21078
|
+
}, {
|
|
21079
|
+
key: "IniSet",
|
|
21080
|
+
value: function IniSet(ini) {
|
|
21081
|
+
return this.imp.IniSet(JSON.stringify(ini));
|
|
21082
|
+
}
|
|
21070
21083
|
}, {
|
|
21071
21084
|
key: "addNetworkLoadingBigFont",
|
|
21072
21085
|
value: function addNetworkLoadingBigFont(fontfiles) {
|
|
@@ -25153,7 +25166,7 @@ function _getMxreleaseidId() {
|
|
|
25153
25166
|
}
|
|
25154
25167
|
var createMxCad = /*#__PURE__*/function () {
|
|
25155
25168
|
var _ref = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee(config, mxcadobj) {
|
|
25156
|
-
var _ref2, openParameter, networkFonts, fontspath, locateFile, wasmBinary, canvas, onOpenFileComplete, fileUrl, onInit, middlePan, registdata, registfile, viewBackgroundColor, map, multipleSelect, mxDraw, THREE, size, mxCadObj, registfileurl, regdataobj, fetchAttributes;
|
|
25169
|
+
var _ref2, openParameter, networkFonts, fontspath, locateFile, wasmBinary, canvas, onOpenFileComplete, fileUrl, onInit, middlePan, registdata, registfile, viewBackgroundColor, map, multipleSelect, enableUndo, mouseMiddlePan, enableIntelliSelect, browse, mxDraw, THREE, size, mxCadObj, registfileurl, regdataobj, fetchAttributes;
|
|
25157
25170
|
return regenerator.wrap(function _callee$(_context) {
|
|
25158
25171
|
while (1) switch (_context.prev = _context.next) {
|
|
25159
25172
|
case 0:
|
|
@@ -25164,7 +25177,7 @@ var createMxCad = /*#__PURE__*/function () {
|
|
|
25164
25177
|
_context.next = 3;
|
|
25165
25178
|
return loadCoreCode();
|
|
25166
25179
|
case 3:
|
|
25167
|
-
_ref2 = config || {}, openParameter = _ref2.openParameter, networkFonts = _ref2.networkFonts, fontspath = _ref2.fontspath, locateFile = _ref2.locateFile, wasmBinary = _ref2.wasmBinary, canvas = _ref2.canvas, onOpenFileComplete = _ref2.onOpenFileComplete, fileUrl = _ref2.fileUrl, onInit = _ref2.onInit, middlePan = _ref2.middlePan, registdata = _ref2.registdata, registfile = _ref2.registfile, viewBackgroundColor = _ref2.viewBackgroundColor, map = _ref2.map, multipleSelect = _ref2.multipleSelect;
|
|
25180
|
+
_ref2 = config || {}, openParameter = _ref2.openParameter, networkFonts = _ref2.networkFonts, fontspath = _ref2.fontspath, locateFile = _ref2.locateFile, wasmBinary = _ref2.wasmBinary, canvas = _ref2.canvas, onOpenFileComplete = _ref2.onOpenFileComplete, fileUrl = _ref2.fileUrl, onInit = _ref2.onInit, middlePan = _ref2.middlePan, registdata = _ref2.registdata, registfile = _ref2.registfile, viewBackgroundColor = _ref2.viewBackgroundColor, map = _ref2.map, multipleSelect = _ref2.multipleSelect, enableUndo = _ref2.enableUndo, mouseMiddlePan = _ref2.mouseMiddlePan, enableIntelliSelect = _ref2.enableIntelliSelect, browse = _ref2.browse;
|
|
25168
25181
|
_context.next = 6;
|
|
25169
25182
|
return loadMxCADassembly(function () {
|
|
25170
25183
|
return void 0;
|
|
@@ -25173,9 +25186,14 @@ var createMxCad = /*#__PURE__*/function () {
|
|
|
25173
25186
|
MxFun.initMxCpp(MxCpp);
|
|
25174
25187
|
MxCADUtility.init();
|
|
25175
25188
|
MxFun.setIniset({
|
|
25176
|
-
EnableIntelliSelect: true,
|
|
25189
|
+
EnableIntelliSelect: enableIntelliSelect === void 0 ? true : enableIntelliSelect,
|
|
25177
25190
|
IntelliSelectType: 1
|
|
25178
25191
|
});
|
|
25192
|
+
if (enableUndo !== void 0) {
|
|
25193
|
+
MxCpp.App.IniSet({
|
|
25194
|
+
EnableUndo: enableUndo
|
|
25195
|
+
});
|
|
25196
|
+
}
|
|
25179
25197
|
if (viewBackgroundColor) {
|
|
25180
25198
|
MxCpp.App.setDefaultViewBackgroundColor(viewBackgroundColor.red, viewBackgroundColor.green, viewBackgroundColor.blue);
|
|
25181
25199
|
}
|
|
@@ -25183,9 +25201,9 @@ var createMxCad = /*#__PURE__*/function () {
|
|
|
25183
25201
|
if (mxcadobj) {
|
|
25184
25202
|
mxcadobj.callEvent("init");
|
|
25185
25203
|
}
|
|
25186
|
-
_context.next =
|
|
25204
|
+
_context.next = 15;
|
|
25187
25205
|
return createMxDraw(canvas, middlePan, map, mxcadobj);
|
|
25188
|
-
case
|
|
25206
|
+
case 15:
|
|
25189
25207
|
mxDraw = _context.sent;
|
|
25190
25208
|
if (multipleSelect !== void 0) {
|
|
25191
25209
|
mxDraw.setMultipleSelect(multipleSelect);
|
|
@@ -25201,31 +25219,31 @@ var createMxCad = /*#__PURE__*/function () {
|
|
|
25201
25219
|
mxDraw.getRenderer().getSize(size);
|
|
25202
25220
|
mxCadObj = createMxCadCppObject(MxCpp.App.getImp(), size.width, size.height, mxDraw.getCanvas().id, mxDraw.isWebgl2(), mxDraw.getId(), map ? true : false, mxcadobj);
|
|
25203
25221
|
if (mxCadObj.isTryVersion()) {
|
|
25204
|
-
_context.next =
|
|
25222
|
+
_context.next = 34;
|
|
25205
25223
|
break;
|
|
25206
25224
|
}
|
|
25207
25225
|
if (!(registdata && registdata.length > 0)) {
|
|
25208
|
-
_context.next =
|
|
25226
|
+
_context.next = 28;
|
|
25209
25227
|
break;
|
|
25210
25228
|
}
|
|
25211
25229
|
mxCadObj.initRegist(registdata);
|
|
25212
|
-
_context.next =
|
|
25230
|
+
_context.next = 34;
|
|
25213
25231
|
break;
|
|
25214
|
-
case
|
|
25232
|
+
case 28:
|
|
25215
25233
|
registfileurl = registfile;
|
|
25216
25234
|
if (!(registfile && registfile.length > 0)) {
|
|
25217
25235
|
registfileurl = "mxkey.json.frontpage.json";
|
|
25218
25236
|
}
|
|
25219
|
-
_context.next =
|
|
25237
|
+
_context.next = 32;
|
|
25220
25238
|
return getJsonFromUrl(registfileurl);
|
|
25221
|
-
case
|
|
25239
|
+
case 32:
|
|
25222
25240
|
regdataobj = _context.sent;
|
|
25223
25241
|
if (regdataobj && regdataobj.registdata) {
|
|
25224
25242
|
mxCadObj.initRegist(regdataobj.registdata);
|
|
25225
25243
|
} else {
|
|
25226
25244
|
console.log("MxTip:empty regist data");
|
|
25227
25245
|
}
|
|
25228
|
-
case
|
|
25246
|
+
case 34:
|
|
25229
25247
|
getMxreleaseidId().then(function (val) {
|
|
25230
25248
|
mxCadObj.getImp().SetAppId(val);
|
|
25231
25249
|
});
|
|
@@ -25234,6 +25252,15 @@ var createMxCad = /*#__PURE__*/function () {
|
|
|
25234
25252
|
onOpenFileComplete && onOpenFileComplete(mxCadObj);
|
|
25235
25253
|
});
|
|
25236
25254
|
if (mxcadobj) {
|
|
25255
|
+
if (browse === true) {
|
|
25256
|
+
mxcadobj.setBrowse(true);
|
|
25257
|
+
if (mouseMiddlePan === void 0) {
|
|
25258
|
+
mouseMiddlePan = 0;
|
|
25259
|
+
}
|
|
25260
|
+
}
|
|
25261
|
+
if (mouseMiddlePan !== void 0) {
|
|
25262
|
+
mxcadobj.mxdraw.setMouseMiddlePan(mouseMiddlePan);
|
|
25263
|
+
}
|
|
25237
25264
|
mxcadobj.callEvent("init_mxcad", mxCadObj);
|
|
25238
25265
|
}
|
|
25239
25266
|
if (fileUrl) {
|
|
@@ -25244,7 +25271,7 @@ var createMxCad = /*#__PURE__*/function () {
|
|
|
25244
25271
|
mxCadObj.openWebFile(fileUrl, void 0, true, openParameter, fetchAttributes);
|
|
25245
25272
|
}
|
|
25246
25273
|
return _context.abrupt("return", mxCadObj);
|
|
25247
|
-
case
|
|
25274
|
+
case 40:
|
|
25248
25275
|
case "end":
|
|
25249
25276
|
return _context.stop();
|
|
25250
25277
|
}
|