@manycore/custom-sdk 1.7.0-rc.0 → 1.8.4-rc.0

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 (3) hide show
  1. package/index.d.ts +795 -33
  2. package/index.js +22 -36
  3. package/package.json +7 -2
package/index.d.ts CHANGED
@@ -1,7 +1,11 @@
1
1
  import { ELineType as ELineType_2 } from '@manycore/custom-miniapp-sdk';
2
2
  import { IExportModelData } from '@manycore/custom-miniapp-sdk';
3
3
  import { IParamModelPhotoResponse } from '@manycore/custom-miniapp-sdk';
4
+ import { IServClientService } from 'servkit';
5
+ import { Number2 } from '@manycore/custom-miniapp-sdk';
4
6
  import { Number3 } from '@manycore/custom-miniapp-sdk';
7
+ import { PlankArea } from '@qunhe/miniapp-model-viewer-core/src/model/base/plankArea';
8
+ import { ServService } from 'servkit';
5
9
 
6
10
  declare interface AMap<K, V> {
7
11
  clear(): void;
@@ -22,8 +26,13 @@ declare interface AMap<K, V> {
22
26
  * ```
23
27
  */
24
28
  export declare class Application {
25
- constructor();
26
29
  private serviceMap;
30
+ private sappSDK;
31
+ constructor();
32
+ /**
33
+ * 判断当前是否在定制小程序下运行
34
+ */
35
+ isInCustomMiniAppMode(): boolean;
27
36
  /**
28
37
  * 启动对接2.0应用
29
38
  *
@@ -34,7 +43,7 @@ export declare class Application {
34
43
  * await application.start();
35
44
  * ```
36
45
  */
37
- start(): Promise<void>;
46
+ start(option?: IApplicationStartOption): Promise<void>;
38
47
  /**
39
48
  * 初始化语言类型(默认不需要处理)
40
49
  *
@@ -71,6 +80,44 @@ export declare class Application {
71
80
  getService<T extends BaseService>(serv: {
72
81
  new (): T;
73
82
  }): T;
83
+ /**
84
+ * 在对接2.0,提供调用定制小程序服务的能力,兼容历史代码
85
+ *
86
+ * 可以参见[定制小程序相关API](https://manual.kujiale.com/custom-miniapp-sdk/)
87
+ *
88
+ * @example
89
+ * ```
90
+ * import { CustomDesignParamModelService } from '@manycore/custom-miniapp-sdk';
91
+ *
92
+ * const s = application.getCustomMiniAppService(CustomDesignParamModelService);
93
+ * ```
94
+ *
95
+ */
96
+ getCustomMiniAppService<T extends typeof ServService>(decl: T): IServClientService<T> | undefined;
97
+ getCustomMiniAppService<M extends {
98
+ [key: string]: typeof ServService;
99
+ }>(decls: M): {
100
+ [key in keyof M]: IServClientService<M[key]> | undefined;
101
+ };
102
+ /**
103
+ * 在对接2.0,提供调用定制小程序服务的能力,兼容历史代码
104
+ *
105
+ * 可以参见[定制小程序相关API](https://manual.kujiale.com/custom-miniapp-sdk/)
106
+ *
107
+ * @example
108
+ * ```
109
+ * import { CustomDesignParamModelService } from '@manycore/custom-miniapp-sdk';
110
+ *
111
+ * const s = application.getCustomMiniAppServiceUnSafe(CustomDesignParamModelService);
112
+ * ```
113
+ *
114
+ */
115
+ getCustomMiniAppServiceUnSafe<T extends typeof ServService>(decl: T): IServClientService<T>;
116
+ getCustomMiniAppServiceUnSafe<M extends {
117
+ [key: string]: typeof ServService;
118
+ }>(decls: M): {
119
+ [key in keyof M]: IServClientService<M[key]>;
120
+ };
74
121
  }
75
122
 
76
123
  /**
@@ -80,6 +127,24 @@ declare abstract class BaseService {
80
127
  __onDestroy?(): void;
81
128
  }
82
129
 
130
+ /**
131
+ * 定制模型真分类过滤列表默认值
132
+ */
133
+ export declare const CUSTOM_MODEL_CATEGORY_FILTER = [
134
+ /**
135
+ * 装饰陈设
136
+ */
137
+ 596,
138
+ /**
139
+ * 参数化软装
140
+ */
141
+ 2048,
142
+ /**
143
+ * 软装部件
144
+ */
145
+ 2049,
146
+ ];
147
+
83
148
  /**
84
149
  * 模型相关控制的逻辑
85
150
  *
@@ -161,12 +226,26 @@ export declare enum ECameraMoveDirection {
161
226
  BACK = "BACK"
162
227
  }
163
228
 
229
+ /**
230
+ * 线是否顺时针的值
231
+ */
232
+ declare enum EClockWise {
233
+ /**
234
+ * 顺时针
235
+ */
236
+ TRUE = "true",
237
+ /**
238
+ * 逆时针
239
+ */
240
+ FALSE = "false"
241
+ }
242
+
164
243
  /**
165
244
  * 交互模式
166
245
  */
167
246
  export declare enum EDesignMode {
168
247
  /**
169
- * 自定模式
248
+ * 自定义模式
170
249
  */
171
250
  CUSTOM = 'custom',
172
251
  /**
@@ -183,6 +262,36 @@ export declare enum EDesignMode {
183
262
  PRODUCT = 'product',
184
263
  }
185
264
 
265
+ /**
266
+ * 模型类型
267
+ */
268
+ export declare enum EElementType {
269
+ /**
270
+ * 参数化模型
271
+ */
272
+ PARAM_MODEL = 'paramModel',
273
+ /**
274
+ * 参数化组合
275
+ */
276
+ PARAM_MODEL_ASSEMBLY = 'paramModelAssembly',
277
+ /**
278
+ * 孔
279
+ */
280
+ HOLE = 'hole',
281
+ /**
282
+ * 槽
283
+ */
284
+ GROOVE = 'groove',
285
+ /**
286
+ * 五金
287
+ */
288
+ HARDWARE = 'hardware',
289
+ /**
290
+ * 五金槽
291
+ */
292
+ HARDWARE_GROOVE = 'hardwareGroove',
293
+ }
294
+
186
295
  /**
187
296
  * 孔槽配件类型
188
297
  */
@@ -274,6 +383,24 @@ export declare enum ELineType {
274
383
  ELLIPSE_ARC = 3,
275
384
  }
276
385
 
386
+ /**
387
+ * 线的类型
388
+ */
389
+ declare enum ELineType_3 {
390
+ /**
391
+ * 直线
392
+ */
393
+ SEGMENT = 0,
394
+ /**
395
+ * 圆弧
396
+ */
397
+ CIRCLE_ARC = 1,
398
+ /**
399
+ * 椭圆
400
+ */
401
+ ELLIPSE_ARC = 3
402
+ }
403
+
277
404
  /**
278
405
  * 模型类型
279
406
  */
@@ -286,6 +413,10 @@ export declare enum EModelType {
286
413
  * 模型组合
287
414
  */
288
415
  PARAM_MODEL_ASSEMBLY = 'param_model_assembly',
416
+ /**
417
+ * 孔槽五金模型
418
+ */
419
+ FITTING_MODEL = 'fitting_model',
289
420
  }
290
421
 
291
422
  /**
@@ -307,27 +438,98 @@ declare enum EParamModelType {
307
438
  }
308
439
 
309
440
  declare enum EParamType {
441
+ /**
442
+ * 浮点数
443
+ */
310
444
  FLOAT = "float",
445
+ /**
446
+ * 二维浮点数
447
+ */
311
448
  FLOAT2 = "float2",
449
+ /**
450
+ * 三维浮点数
451
+ */
312
452
  FLOAT3 = "float3",
453
+ /**
454
+ * 浮点数
455
+ */
313
456
  FLOAT_BUFFER = "floatbuf",
457
+ /**
458
+ * 二维浮点数
459
+ */
314
460
  FLOAT2_BUFFER = "float2buf",
461
+ /**
462
+ * 三维浮点数
463
+ */
315
464
  FLOAT3_BUFFER = "float3buf",
465
+ /**
466
+ * 引用
467
+ */
316
468
  REFERENCE = "reference",
469
+ /**
470
+ * 整数
471
+ */
317
472
  INT = "int",
473
+ /**
474
+ * 整数
475
+ */
318
476
  INT_BUFFER = "intbuf",
477
+ /**
478
+ * 字符串
479
+ */
319
480
  STRING = "string",
481
+ /**
482
+ * 轮廓,一般为商品ID
483
+ */
320
484
  SHAPE = "shape",
485
+ /**
486
+ * 材质,一般存储为商品ID
487
+ */
321
488
  MATERIAL = "material",
489
+ /**
490
+ * 布尔
491
+ */
322
492
  BOOLEAN = "boolean",
493
+ /**
494
+ * 布尔
495
+ */
323
496
  BOOLEAN_BUFFER = "booleanbuf",
497
+ /**
498
+ * 适配
499
+ */
324
500
  FIT = "fit",
501
+ /**
502
+ * 路径
503
+ */
325
504
  PATH = "paramcornerpath",
505
+ /**
506
+ * 样式
507
+ */
326
508
  STYLE = "style",
509
+ /**
510
+ * 字符串
511
+ */
327
512
  FORMULA_STRING = "formulaString",
513
+ /**
514
+ * 多布尔
515
+ */
328
516
  BOOLEAN_LIST = "booleanlist"
329
517
  }
330
518
 
519
+ /**
520
+ * 板件轮廓路径类型
521
+ */
522
+ export declare enum EPlankPathType {
523
+ /**
524
+ * 内部路径,例如某个挖洞
525
+ */
526
+ INNER = 'inner',
527
+ /**
528
+ * 外部路径
529
+ */
530
+ OUTER = 'outer',
531
+ }
532
+
331
533
  /**
332
534
  * 点的类型
333
535
  */
@@ -348,6 +550,32 @@ export declare enum EPointType {
348
550
  * 切圆,就是内挖一个倒圆的形状
349
551
  */
350
552
  CUT_CIRCLE = 3,
553
+ /**
554
+ * 椭圆
555
+ */
556
+ ELLIPSE = 4,
557
+ }
558
+
559
+ /**
560
+ * 点的类型
561
+ */
562
+ declare enum EPointType_2 {
563
+ /**
564
+ * 普通点
565
+ */
566
+ NONE = 0,
567
+ /**
568
+ * 倒圆
569
+ */
570
+ CIRCLE = 1,
571
+ /**
572
+ * 倒角
573
+ */
574
+ LINE = 2,
575
+ /**
576
+ * 切圆,就是内挖一个倒圆的形状
577
+ */
578
+ CUT_CIRCLE = 3
351
579
  }
352
580
 
353
581
  /**
@@ -442,6 +670,18 @@ export declare enum ETriggerType {
442
670
  DB_CLICK = 'double_click',
443
671
  }
444
672
 
673
+ /**
674
+ * 附加通用参数-几何体颜色key
675
+ * @default 孔:0x00ff00 槽:0x1e90ff 五金槽:0x1e90ff
676
+ */
677
+ export declare const FITTING_PARAM_GEOMETRY_COLOR_KEY = '$$geometry_color';
678
+
679
+ /**
680
+ * 附加通用参数-几何体不透明度key
681
+ * @default 1
682
+ */
683
+ export declare const FITTING_PARAM_GEOMETRY_OPACITY_KEY = '$$geometry_opacity';
684
+
445
685
  /**
446
686
  * 孔槽方案相关数据的管理
447
687
  *
@@ -558,7 +798,7 @@ export declare class FittingDesignService extends BaseService {
558
798
  /**
559
799
  * 删除当前孔槽方案(解锁主工具模型)
560
800
  *
561
- * 主工具当中,模型的锁定与解锁,与当前模型是不存在孔槽方案有关
801
+ * 主工具当中,模型的锁定与解锁,与当前模型是不是存在孔槽方案有关
562
802
  * 默认情况下,option不传时,清空当前正在编辑的模型的孔槽方案,当传入modelId时,表示清空指定模型的孔槽方案数据
563
803
  *
564
804
  * * @example
@@ -570,6 +810,28 @@ export declare class FittingDesignService extends BaseService {
570
810
  clearDesign(options?: IBaseOptions): Promise<void>;
571
811
  }
572
812
 
813
+ /**
814
+ * 配置孔槽特殊标识
815
+ *
816
+ * @example
817
+ * ```typescript
818
+ * const fittingHintService = application.getService(FittingHintService );
819
+ * ```
820
+ */
821
+ export declare class FittingHintService extends BaseService {
822
+ /**
823
+ * 设置五金孔槽高亮
824
+ * @param conf IFittingHintOption
825
+ */
826
+ setFittingHint(conf: IFittingHintOption): void;
827
+ /**
828
+ * 清空当前已经配置的标识信息
829
+ *
830
+ * @param id 待删除标识信息的模型ID,默认清空所有
831
+ */
832
+ clearFittingHint(id?: string | string[]): void;
833
+ }
834
+
573
835
  /**
574
836
  * 提供孔槽模型操作能力
575
837
  *
@@ -595,6 +857,8 @@ export declare class FittingDesignService extends BaseService {
595
857
  }): Promise<void>;
596
858
  }
597
859
 
860
+ export declare type IApplicationStartOption = ITerminalConfig;
861
+
598
862
  /**
599
863
  * 孔槽数据基础示意
600
864
  */
@@ -615,10 +879,16 @@ export declare class FittingDesignService extends BaseService {
615
879
 
616
880
  /**
617
881
  * 附加通用参数存储
882
+ *
883
+ * **内部占用key:**
884
+ * - $$geometry_color: 孔槽五金槽模型颜色
885
+ * - $$geometry_opacity: 孔槽五金槽模型不透明度
618
886
  */
619
887
  export declare interface IBaseFittingParameters {
620
888
  /**
621
889
  * 通用参数的key
890
+ *
891
+ * 不建议使用 **$$** 开头命名, **$$** 开头通常为SDK内部使用参数
622
892
  */
623
893
  key: string;
624
894
  /**
@@ -714,18 +984,32 @@ export declare class FittingDesignService extends BaseService {
714
984
  update?: IUpdateInfo[];
715
985
  }
716
986
 
987
+ /**
988
+ * 场景内的某个模型
989
+ */
990
+ export declare interface IElement {
991
+ /**
992
+ * 模型(paramModel|孔|槽|五金槽|五金)ID
993
+ */
994
+ id: string;
995
+ /**
996
+ * 模型类型
997
+ */
998
+ type: EElementType;
999
+ }
1000
+
717
1001
  /**
718
1002
  * 自定义模式,hover触发模型高亮回调
719
1003
  */
720
1004
  export declare interface IFindHintModel {
721
- (rayTarget: IParamModelLite): void | ISceneHintOption | ISceneHintOption[];
1005
+ (rayTarget: IParamModelLite | IFittingModelLite): void | ISceneHintOption | ISceneHintOption[];
722
1006
  }
723
1007
 
724
1008
  /**
725
1009
  * 自定义模式,单击、双击触发模型选中回调
726
1010
  */
727
1011
  export declare interface IFindSelectModel {
728
- (rayTarget: IParamModelLite, triggerType: ETriggerType):
1012
+ (rayTarget: IParamModelLite | IFittingModelLite, triggerType: ETriggerType):
729
1013
  | void
730
1014
  | ISceneSelectOption
731
1015
  | ISceneSelectOption[];
@@ -779,6 +1063,24 @@ export declare class FittingDesignService extends BaseService {
779
1063
  */
780
1064
  export declare type IFittingHardwareGrooves = Record<string, IHardwareGrooveData[]>;
781
1065
 
1066
+ /**
1067
+ * 五金孔槽模型ID - 标识信息
1068
+ *
1069
+ * @example
1070
+ *
1071
+ * ```json
1072
+ * {
1073
+ * "89D2793C-2B23-41A9-BA6E-4E3908490057": {
1074
+ * "outline": {
1075
+ * "color": "#234432",
1076
+ * "opacity": 0.8,
1077
+ * }
1078
+ * }
1079
+ * }
1080
+ * ```
1081
+ */
1082
+ export declare type IFittingHintOption = Record<string, IHintFitting>;
1083
+
782
1084
  /**
783
1085
  * 方案中,所有孔的数据
784
1086
  */
@@ -837,9 +1139,13 @@ export declare class FittingDesignService extends BaseService {
837
1139
  export declare interface IGetParamModelJsonOption extends IBaseOptions {
838
1140
  /**
839
1141
  * 是否强制重新获取
840
- * @default true 默认值为true,当前浏览模型时,获取json数据时,将会缓存
1142
+ * @default false 默认值为false,当获取正在查看的模型json数据时,默认情况会使用状态中的缓存数据,如果需要强制走后端重新获取,此字段需要传入true
841
1143
  */
842
1144
  force?: boolean;
1145
+ /**
1146
+ * 模板id
1147
+ */
1148
+ templateId?: string;
843
1149
  }
844
1150
 
845
1151
  export declare interface IGrooveData extends IBaseHoleGrooveData {
@@ -927,6 +1233,13 @@ export declare class FittingDesignService extends BaseService {
927
1233
  opacity: number;
928
1234
  }
929
1235
 
1236
+ export declare interface IHintFitting {
1237
+ /**
1238
+ * 轮廓高亮信息
1239
+ */
1240
+ outline: IHintBase;
1241
+ }
1242
+
930
1243
  /**
931
1244
  * 配置默认的高亮配置信息
932
1245
  */
@@ -996,16 +1309,104 @@ export declare class FittingDesignService extends BaseService {
996
1309
  intersectedGroups: IIntersectedGroup[];
997
1310
  }
998
1311
 
1312
+ /**
1313
+ * 轮廓路径线段表示
1314
+ */
1315
+ export declare interface ILine extends ILineBase {
1316
+ /**
1317
+ * 获取实际渲染端点
1318
+ * >线段两端
1319
+ */
1320
+ getRenderPoints(): [Number2, Number2];
1321
+ /**
1322
+ * 设置线段的高亮,高亮深度为板件厚度
1323
+ * @param hint 高亮配置
1324
+ */
1325
+ setHint(hint: IHintBase): void;
1326
+ /**
1327
+ * 清除高亮
1328
+ */
1329
+ clearHint(): void;
1330
+ /**
1331
+ * 获取高亮
1332
+ */
1333
+ getHint(): IHintBase | undefined;
1334
+ }
1335
+
1336
+ /**
1337
+ * 线段表示
1338
+ */
1339
+ export declare interface ILineBase {
1340
+ /**
1341
+ * 线条类型
1342
+ */
1343
+ type: ELineType;
1344
+ /**
1345
+ * 圆弧是否为顺时针
1346
+ */
1347
+ clockwise?: boolean;
1348
+ /**
1349
+ * 圆弧是否为劣弧
1350
+ */
1351
+ minorArc?: boolean;
1352
+ /**
1353
+ * 圆弧半径
1354
+ */
1355
+ radius?: number;
1356
+ /**
1357
+ * 椭圆弧长轴
1358
+ */
1359
+ majorRadius?: number;
1360
+ /**
1361
+ * 椭圆弧短轴
1362
+ */
1363
+ minorRadius?: number;
1364
+ /**
1365
+ * 椭圆圆心
1366
+ */
1367
+ ellipseCenter?: Number2;
1368
+ }
1369
+
999
1370
  export declare type ILineData = ILineDataBase | ILineDataCircle;
1000
1371
 
1001
- export declare interface ILineDataBase {
1372
+ declare interface ILineData_2 {
1373
+ /**
1374
+ * 线条类型
1375
+ */
1376
+ type: ELineType_3;
1377
+ /**
1378
+ * 是否顺时针
1379
+ */
1380
+ clockwise?: boolean;
1381
+ /**
1382
+ * 优弧劣弧 (只有弧线有)
1383
+ */
1384
+ minorArc?: boolean;
1385
+ /**
1386
+ * 半径 (只有弧线有)
1387
+ */
1388
+ radius?: number;
1389
+ }
1390
+
1391
+ /**
1392
+ * 直线
1393
+ */
1394
+ export declare interface ILineDataBase
1395
+ extends Omit<
1396
+ ILineBase,
1397
+ 'ellipseCenter' | 'clockwise' | 'minorArc' | 'radius' | 'majorRadius' | 'minorRadius'
1398
+ > {
1002
1399
  /**
1003
1400
  * 线条类型
1004
1401
  */
1005
1402
  type: ELineType_2.SEGMENT;
1006
1403
  }
1007
1404
 
1008
- export declare interface ILineDataCircle {
1405
+ /**
1406
+ * 弧线
1407
+ */
1408
+ export declare interface ILineDataCircle
1409
+ extends Omit<ILineBase, 'ellipseCenter' | 'majorRadius' | 'minorRadius'> {
1009
1410
  /**
1010
1411
  * 线条类型
1011
1412
  */
@@ -1154,6 +1555,20 @@ export declare class FittingDesignService extends BaseService {
1154
1555
  * @type string
1155
1556
  */
1156
1557
  readonly id: string;
1558
+ /**
1559
+ * 模型在方案中的名称
1560
+ * @readonly
1561
+ * @public
1562
+ * @type string
1563
+ */
1564
+ name: string;
1565
+ /**
1566
+ * 模型的备注信息
1567
+ * @readonly
1568
+ * @public
1569
+ * @typedef Number3
1570
+ */
1571
+ remark?: string;
1157
1572
  /**
1158
1573
  * 当前位置信息
1159
1574
  * @readonly
@@ -1226,6 +1641,26 @@ export declare class FittingDesignService extends BaseService {
1226
1641
  * @readonly
1227
1642
  */
1228
1643
  isRoot?: boolean;
1644
+ /**
1645
+ * 获取当前模型名称
1646
+ */
1647
+ getName(): string;
1648
+ /**
1649
+ * 更改当前模型名称
1650
+ *
1651
+ * @param name 需重新设置的模型名称
1652
+ */
1653
+ setName(name: string): void;
1654
+ /**
1655
+ * 获取模型备注信息
1656
+ */
1657
+ getRemark(): string | undefined;
1658
+ /**
1659
+ * 更改模型备注信息
1660
+ *
1661
+ * @param remark 备注信息
1662
+ */
1663
+ setRemark(remark: string): void;
1229
1664
  /**
1230
1665
  * 更新当前模型的位置信息
1231
1666
  * @param position {Number3} 坐标
@@ -1321,6 +1756,13 @@ export declare class FittingDesignService extends BaseService {
1321
1756
  * 将一个序列化之后的模型,进行反序列化操作
1322
1757
  */
1323
1758
  deserialize(model: string): IParamModelLite_2;
1759
+ /**
1760
+ * 刷新某个模型,此API仅适用于反向对接的模型:
1761
+ * 当前某个模型在后台更新了,但用户方案中,存储的仍然是之前的版本,调用此方法后,会自动将当前模型更新成后台最新的版本。
1762
+ * > 需要注意的是,此方法会导致更新后,模型ID存在变化
1763
+ * > 模型中,添加的appendChild或addAccessory等参数,可能会失效不起作用
1764
+ */
1765
+ forceUpdate(update?: boolean): void;
1324
1766
  }
1325
1767
 
1326
1768
  /**
@@ -1391,6 +1833,91 @@ export declare class FittingDesignService extends BaseService {
1391
1833
  setPrimitiveOverride(value: boolean): void;
1392
1834
  }
1393
1835
 
1836
+ declare interface IPathData {
1837
+ /**
1838
+ * 偏移, 正数扩大路径范围,负数缩小路径范围
1839
+ */
1840
+ offset?: number;
1841
+ /**
1842
+ * 轮廓上的点
1843
+ */
1844
+ paramPoints: IPointData_2[];
1845
+ /**
1846
+ * 轮廓上的线
1847
+ */
1848
+ paramPathLines: ILineData_2[];
1849
+ }
1850
+
1851
+ /**
1852
+ * 板件轮廓描述
1853
+ */
1854
+ export declare interface IPlankArea {
1855
+ /**
1856
+ * 由板件原始轮廓数据解析出的所有路径
1857
+ */
1858
+ paths: IPlankPath[];
1859
+
1860
+ /**
1861
+ * 对板件原始轮廓数据进行非直角端点处理、重合、偏移计算后的实际展示路径
1862
+ */
1863
+ getRealPaths(): IPlankArea;
1864
+ }
1865
+
1866
+ /**
1867
+ * 板件轮廓上的某条闭合路径,例如外轮廓、内部挖洞
1868
+ */
1869
+ export declare interface IPlankPath {
1870
+ /**
1871
+ * 路径类型
1872
+ */
1873
+ type: EPlankPathType;
1874
+ /**
1875
+ * 路径上的所有端点
1876
+ */
1877
+ points: IPoint[];
1878
+ /**
1879
+ * 路径上的所有线段
1880
+ */
1881
+ lines: ILine[];
1882
+ /**
1883
+ * 获取路径上实际渲染的端点
1884
+ */
1885
+ getRenderPoints(): Number2[];
1886
+ }
1887
+
1888
+ declare interface IPlankPathData {
1889
+ path?: IPathData;
1890
+ holes: IPathData[];
1891
+ /**
1892
+ * other fields
1893
+ */
1894
+ [key: string]: any;
1895
+ }
1896
+
1897
+ /**
1898
+ * 轮廓路径端点表示
1899
+ */
1900
+ export declare interface IPoint extends IPointBase {
1901
+ /**
1902
+ * 获取实际渲染端点
1903
+ * >非直角端点为渲染线段的两端,直角端点两个端点相同
1904
+ */
1905
+ getRenderPoints(): [Number2, Number2];
1906
+ /**
1907
+ * 设置非直角端点渲染线段的高亮,高亮深度为板件厚度
1908
+ * @param hint 高亮配置
1909
+ */
1910
+ setHint(hint: IHintBase): void;
1911
+ /**
1912
+ * 清除高亮
1913
+ */
1914
+ clearHint(): void;
1915
+ /**
1916
+ * 获取高亮
1917
+ */
1918
+ getHint(): IHintBase | undefined;
1919
+ }
1920
+
1394
1921
  /**
1395
1922
  * 点的基本类型
1396
1923
  */
@@ -1398,11 +1925,32 @@ export declare class FittingDesignService extends BaseService {
1398
1925
  type: EPointType;
1399
1926
  /**
1400
1927
  * 点的位置
1401
- *
1402
- * @example
1403
- * "123,-345"
1404
1928
  */
1405
- position: Number3;
1929
+ position: Number3 | Number2;
1930
+ /**
1931
+ * 切角长度
1932
+ */
1933
+ cornerCutDistance?: [number, number];
1934
+ /**
1935
+ * 椭圆端点长轴
1936
+ */
1937
+ majorRadius?: number;
1938
+ /**
1939
+ * 椭圆端点短轴
1940
+ */
1941
+ minorRadius?: number;
1942
+ /**
1943
+ * 圆弧、切圆半径
1944
+ */
1945
+ radius?: number;
1946
+ /**
1947
+ * 圆弧是否为顺时针
1948
+ */
1949
+ clockwise?: boolean;
1950
+ /**
1951
+ * 圆弧、椭圆弧圆心偏移
1952
+ */
1953
+ offset?: Number2;
1406
1954
  }
1407
1955
 
1408
1956
  /**
@@ -1410,10 +1958,60 @@ export declare class FittingDesignService extends BaseService {
1410
1958
  */
1411
1959
  export declare type IPointData = IPointWithNone | IPointWithLine | IPointWithCircle | IPointWithCutCircle;
1412
1960
 
1961
+ declare interface IPointData_2 {
1962
+ /**
1963
+ * 点的位置
1964
+ *
1965
+ * @example
1966
+ * "123,-345"
1967
+ */
1968
+ position: string;
1969
+ /**
1970
+ * 点的类型
1971
+ */
1972
+ type: EPointType_2;
1973
+ /**
1974
+ * 切角两边上切点距离当前点的距离(切角专用)
1975
+ */
1976
+ cornerCutDistance?: [string, string];
1977
+ /**
1978
+ * 是否顺时针, 前端必须保证逆时针
1979
+ */
1980
+ clockwise?: EClockWise;
1981
+ /**
1982
+ * 半径 (倒圆切圆专用)
1983
+ * @example
1984
+ * "345.12"
1985
+ */
1986
+ radius?: string;
1987
+ /**
1988
+ * 圆心偏移 (切圆专用)
1989
+ * @example
1990
+ * "345.12"
1991
+ */
1992
+ offset?: string;
1993
+ /**
1994
+ * 长轴 (椭圆必传)
1995
+ * @example
1996
+ * "345.12"
1997
+ */
1998
+ majorRadius?: string;
1999
+ /**
2000
+ * 短轴 (椭圆必传)
2001
+ * @example
2002
+ * "345.12"
2003
+ */
2004
+ minorRadius?: string;
2005
+ }
2006
+
1413
2007
  /**
1414
2008
  * 倒圆
1415
2009
  */
1416
- export declare interface IPointWithCircle extends IPointBase {
2010
+ export declare interface IPointWithCircle
2011
+ extends Omit<
2012
+ IPointBase,
2013
+ 'clockwise' | 'majorRadius' | 'minorRadius' | 'cornerCutDistance' | 'offset'
2014
+ > {
1417
2015
  /**
1418
2016
  * 切角类型
1419
2017
  */
@@ -1444,7 +2042,8 @@ export declare class FittingDesignService extends BaseService {
1444
2042
  /**
1445
2043
  * 切角
1446
2044
  */
1447
- export declare interface IPointWithLine extends IPointBase {
2045
+ export declare interface IPointWithLine
2046
+ extends Omit<IPointBase, 'clockwise' | 'majorRadius' | 'minorRadius' | 'radius' | 'offset'> {
1448
2047
  /**
1449
2048
  * 切角类型
1450
2049
  */
@@ -1458,7 +2057,11 @@ export declare class FittingDesignService extends BaseService {
1458
2057
  /**
1459
2058
  * 普通点类型
1460
2059
  */
1461
- export declare interface IPointWithNone extends IPointBase {
2060
+ export declare interface IPointWithNone
2061
+ extends Omit<
2062
+ IPointBase,
2063
+ 'cornerCutDistance' | 'majorRadius' | 'minorRadius' | 'radius' | 'offset'
2064
+ > {
1462
2065
  /**
1463
2066
  * 普通点
1464
2067
  */
@@ -1487,21 +2090,12 @@ export declare class FittingDesignService extends BaseService {
1487
2090
  /**
1488
2091
  * 高亮模型描述
1489
2092
  */
1490
- export declare type ISceneHintOption = ISceneSelectOption;
2093
+ export declare type ISceneHintOption = IElement;
1491
2094
 
1492
2095
  /**
1493
2096
  * 选中模型描述
1494
2097
  */
1495
- export declare interface ISceneSelectOption {
1496
- /**
1497
- * 模型id | 组合id
1498
- */
1499
- id: string;
1500
- /**
1501
- * 模型类型
1502
- */
1503
- type: EModelType;
1504
- }
2098
+ export declare type ISceneSelectOption = IElement;
1505
2099
 
1506
2100
  /**
1507
2101
  * 当前选中的数据
@@ -1574,6 +2168,51 @@ export declare class FittingDesignService extends BaseService {
1574
2168
  grooveColor: number;
1575
2169
  }
1576
2170
 
2171
+ /**
2172
+ * 场景中通用配置能力
2173
+ *
2174
+ * @example
2175
+ * ```json
2176
+ * {
2177
+ * holeOpacity: 0.8, // 孔透明度
2178
+ * grooveOpacity: 0.5 // 槽、五金槽透明度
2179
+ * }
2180
+ * ```
2181
+ */
2182
+ export declare interface ISettingCommon {
2183
+ /**
2184
+ * 孔不透明度
2185
+ *
2186
+ * @default 1
2187
+ */
2188
+ holeOpacity: number;
2189
+ /**
2190
+ * 槽不透明度
2191
+ *
2192
+ * @default 1
2193
+ */
2194
+ grooveOpacity: number;
2195
+ /**
2196
+ * 渲染忽略模型真分类ID
2197
+ * @default CUSTOM_MODEL_CATEGORY_FILTER
2198
+ */
2199
+ renderIgnoreCategory: number | number[];
2200
+ }
2201
+
2202
+ /**
2203
+ * 启动时,配置terminal信息
2204
+ */
2205
+ export declare interface ITerminalConfig {
2206
+ /**
2207
+ * 请输入clientId
2208
+ */
2209
+ clientId?: string;
2210
+ /**
2211
+ * 请输入连接超时时间
2212
+ */
2213
+ timeout?: number;
2214
+ }
2215
+
1577
2216
  /**
1578
2217
  * 展示交接信息时的筛选行为
1579
2218
  */
@@ -1672,6 +2311,10 @@ export declare class FittingDesignService extends BaseService {
1672
2311
  * 最大值为 500
1673
2312
  */
1674
2313
  pageNum?: number;
2314
+ /**
2315
+ * 真分类ID过滤
2316
+ */
2317
+ ignoreCategory?: number | number[];
1675
2318
  }
1676
2319
 
1677
2320
  declare interface IUpdateInfo {
@@ -2031,7 +2674,7 @@ export declare class FittingDesignService extends BaseService {
2031
2674
  *
2032
2675
  * @example
2033
2676
  * ```typescript
2034
- * await modelService.getParamData();
2677
+ * await modelService.getParamIntersected();
2035
2678
  * ```
2036
2679
  *
2037
2680
  * @param options
@@ -2040,6 +2683,7 @@ export declare class FittingDesignService extends BaseService {
2040
2683
  /**
2041
2684
  * 获取方案顶层模型列表
2042
2685
  * @param options
2686
+ * @param options.ignoreCategory 真分类id过滤,默认值 CUSTOM_MODEL_CATEGORY_FILTER
2043
2687
  */
2044
2688
  getTopParamModels(options?: ITopParamModelListOption): Promise<ITopParamModelDataResponse>;
2045
2689
  getParamModelPhotoById(modelId: string | string[]): Promise<IParamModelPhotoResponse[]>;
@@ -2054,7 +2698,12 @@ export declare class FittingDesignService extends BaseService {
2054
2698
  * ```
2055
2699
  */
2056
2700
  export declare class ModelViewerSelectionService extends BaseService {
2057
- constructor();
2701
+ /**
2702
+ * if watch EVENT_SELECT_CHANGED event
2703
+ *
2704
+ * @ignore
2705
+ */
2706
+ private hasWatchSelectionChange;
2058
2707
  /**
2059
2708
  * 获取当前选中的数据
2060
2709
  */
@@ -2102,6 +2751,10 @@ export declare class FittingDesignService extends BaseService {
2102
2751
  * @ignore
2103
2752
  */
2104
2753
  private __generateEntity;
2754
+ /**
2755
+ * @ignore
2756
+ */
2757
+ private startWatchSelectedChangedEvent;
2105
2758
  /**
2106
2759
  * @ignore
2107
2760
  */
@@ -2127,6 +2780,74 @@ export declare class FittingDesignService extends BaseService {
2127
2780
  __onDestroy(): void;
2128
2781
  }
2129
2782
 
2783
+ /**
2784
+ * ModelViewerSelectionService v2版本: 作为范围为场景内五金孔槽、参数化组合、参数化模型
2785
+ *
2786
+ * 主要是用来与场景交互的,监听当前选中的对象, 获取选中的内容
2787
+ *
2788
+ * @example
2789
+ * ```typescript
2790
+ * const viewerSelectionV2Service = application.getService(ModelViewerSelectionV2Service);
2791
+ * ```
2792
+ */
2793
+ export declare class ModelViewerSelectionV2Service extends BaseService {
2794
+ /**
2795
+ * if watch EVENT_SELECT_CHANGED_V2 event
2796
+ *
2797
+ * @ignore
2798
+ */
2799
+ private hasWatchSelectionChange;
2800
+ /**
2801
+ * 获取当前选中的数据
2802
+ */
2803
+ getSelected(): IElement[];
2804
+ /**
2805
+ * 设置选中的模型,支持多选
2806
+ * @param option IElement | IElement[]
2807
+ */
2808
+ select(option: IElement | IElement[]): void;
2809
+ /**
2810
+ * 取消场景当中选中内容
2811
+ * @param option IElement | IElement[]
2812
+ */
2813
+ unSelect(option?: IElement | IElement[]): void;
2814
+ /**
2815
+ * 监听当前选中内容
2816
+ * @param fn
2817
+ */
2818
+ on(fn: (param: IElement | IElement[]) => any): void;
2819
+ /**
2820
+ * 取消监听选中变化
2821
+ * @param fn
2822
+ */
2823
+ off(fn?: (param: IElement | IElement[]) => any): void;
2824
+ /**
2825
+ * 监听当前选中的内容(触发一次后自动取消)
2826
+ * @param fn
2827
+ */
2828
+ once(fn: (param: IElement | IElement[]) => any): void;
2829
+ /**
2830
+ * @ignore
2831
+ */
2832
+ private startWatchSelectedChangedEvent;
2833
+ /**
2834
+ * @ignore
2835
+ */
2836
+ private onSelectedChanged;
2837
+ /**
2838
+ * @ignore
2839
+ */
2840
+ private _genEntityFromElement;
2841
+ /**
2842
+ * @ignore
2843
+ */
2844
+ private _genElement;
2845
+ /**
2846
+ * @ignore
2847
+ */
2848
+ __onDestroy(): void;
2849
+ }
2850
+
2130
2851
  /**
2131
2852
  * 主要提供了模型展示的控制能力:重置视角,边框,半透明,以及展示颜色配置
2132
2853
  *
@@ -2164,11 +2885,16 @@ export declare class FittingDesignService extends BaseService {
2164
2885
  */
2165
2886
  toggleModelTransparent(flag: boolean): void;
2166
2887
  /**
2167
- * 设置交接信息展示颜色
2888
+ * 配置模型展示信息
2889
+ * - 交界面、交接体颜色
2890
+ * - 五金与柜体交界面、五金与柜体交接体颜色
2891
+ * - 孔颜色、不透明度
2892
+ * - 槽、五金槽颜色、不透明度
2893
+ * - 模型渲染真分类过滤
2168
2894
  *
2169
2895
  * > `settings`,需要在application.start()后,立即被设置,否则展示会读取至之前配置信息,展示可能存在异常。
2170
2896
  */
2171
- setting(settings: Partial<ISettingColor>): void;
2897
+ setting(settings: Partial<ISettingColor & ISettingCommon>): void;
2172
2898
  /**
2173
2899
  * 刷新场景内所有模型
2174
2900
  *
@@ -2191,7 +2917,7 @@ export declare class FittingDesignService extends BaseService {
2191
2917
  /**
2192
2918
  * 二维空间下:坐标/向量/旋转/尺寸的基础表示
2193
2919
  */
2194
- declare interface Number2 {
2920
+ declare interface Number2_2 {
2195
2921
  /**
2196
2922
  * x轴上的数据
2197
2923
  */
@@ -2205,13 +2931,49 @@ export declare class FittingDesignService extends BaseService {
2205
2931
  /**
2206
2932
  * 三维空间下,坐标/向量/旋转/尺寸的基础表示
2207
2933
  */
2208
- declare interface Number3_2 extends Number2 {
2934
+ declare interface Number3_2 extends Number2_2 {
2209
2935
  /**
2210
2936
  * z轴方向数据
2211
2937
  */
2212
2938
  z: number;
2213
2939
  }
2214
2940
 
2941
+ /**
2942
+ * 底层板件轮廓服务,支持对模型json中轮廓解析为特定的类,暴露对轮廓数据查看、计算、修改的方法
2943
+ *
2944
+ * - 解析板件json数据
2945
+ * - 同步板件轮廓修改到渲染场景中
2946
+ *
2947
+ * @example
2948
+ * ```typescript
2949
+ * const plankPathService = application.getService(PlankPathService);
2950
+ * const modelID = 'xx'; // 板件模型ID
2951
+ * const plankPathData: IPlankPathData = { ... }; // 轮廓数据
2952
+ * const plankArea = plankPathService.parseModelPlankPath(modelID, plankPathData);
2953
+ * // change plankArea
2954
+ * plankPathService.syncModelPlankPath(plankArea); // 同步修改
2955
+ * ```
2956
+ */
2957
+ export declare class PlankPathService extends BaseService {
2958
+ /**
2959
+ * 解析板件轮廓
2960
+ *
2961
+ * @param option.modelID 关联模型ID
2962
+ * @param option.data `IDesignExportData.paramModel` 仅处理底层板件数据(只有板件包含轮廓路径)
2963
+ * @returns
2964
+ */
2965
+ parseModelPlankPath(option: {
2966
+ modelID: string;
2967
+ data: IPlankPathData;
2968
+ }): PlankArea;
2969
+ /**
2970
+ * 同步板件轮廓修改到渲染场景中
2971
+ *
2972
+ * @param plankArea
2973
+ */
2974
+ syncModelPlankPath(plankArea: IPlankArea): void;
2975
+ }
2976
+
2215
2977
  /**
2216
2978
  * 提供渲染场景的控制
2217
2979
  *