mxdraw 0.1.109 → 0.1.111
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/README.md +17 -17
- package/dist/index.d.ts +256 -108
- package/dist/lib/MxModule/McEdGetPointWorldDrawObject/index.js +1 -1
- package/dist/lib/MxModule/McGeTool/index.js +1 -1
- package/dist/lib/MxModule/McGiWorldDraw/index.d.ts +3 -2
- package/dist/lib/MxModule/MrxDbgUiPrPoint/index.js +1 -1
- package/dist/lib/MxModule/MrxDbgUtils/index.js +1 -1
- package/dist/lib/MxModule/MxDb2LineAngularDimension/index.d.ts +49 -11
- package/dist/lib/MxModule/MxDb2LineAngularDimension/index.js +1 -1
- package/dist/lib/MxModule/MxDbAlignedDimension/index.d.ts +35 -1
- package/dist/lib/MxModule/MxDbAlignedDimension/index.js +1 -1
- package/dist/lib/MxModule/MxDbAnyLine/index.d.ts +5 -1
- package/dist/lib/MxModule/MxDbAnyLine/index.js +1 -1
- package/dist/lib/MxModule/MxDbCloudLine/index.d.ts +2 -2
- package/dist/lib/MxModule/MxDbCloudLine/index.js +1 -1
- package/dist/lib/MxModule/MxDbEntity/index.d.ts +40 -24
- package/dist/lib/MxModule/MxDbEntity/index.js +1 -1
- package/dist/lib/MxModule/MxDbGradientLine/index.d.ts +62 -0
- package/dist/lib/MxModule/MxDbGradientLine/index.js +1 -0
- package/dist/lib/MxModule/MxDbSVG/index.d.ts +2 -2
- package/dist/lib/MxModule/MxDbSVG/index.js +1 -1
- package/dist/lib/MxModule/MxDrawObject/index.d.ts +2 -1
- package/dist/lib/MxModule/MxDrawObject/index.js +1 -1
- package/dist/lib/MxModule/MxFun/index.d.ts +8 -8
- package/dist/lib/MxModule/MxFun/index.js +1 -1
- package/dist/lib/MxModule/MxThreeJS/MxThreeJS.d.ts +13 -7
- package/dist/lib/MxModule/MxThreeJS/MxThreeJS.js +1 -1
- package/dist/lib/MxModule/MxThreeJS/MxThreeJS.mixin.js +1 -1
- package/dist/lib/MxModule/MxType/index.d.ts +13 -12
- package/dist/lib/MxModule/MxType/index.js +1 -1
- package/dist/lib/MxModule/Mxassembly/index.js +1 -1
- package/dist/lib/MxModule/loadCoreCode/mxfun.es5.js +1 -1
- package/dist/lib/MxModule/store/{PubsubClass.d.ts → Pubsub.d.ts} +0 -0
- package/dist/lib/MxModule/store/{PubsubClass.js → Pubsub.js} +0 -0
- package/dist/lib/MxModule/store/{StoreClass.d.ts → Store.d.ts} +1 -1
- package/dist/lib/MxModule/store/Store.js +1 -0
- package/dist/lib/MxModule/store/index.d.ts +11 -2
- package/dist/lib/MxModule/store/index.js +1 -1
- package/dist/lib/MxModule/useCanvasResizeListener/index.js +1 -1
- package/dist/lib/doc.d.ts +3 -1
- package/dist/lib/doc.js +1 -1
- package/dist/lib/index.js +1 -1
- package/dist/lib/mxdraw.d.ts +1 -0
- package/dist/lib/mxdraw.js +1 -1
- package/dist/lib/test/jestsetup.d.ts +0 -0
- package/dist/lib/test/jestsetup.js +1 -0
- package/dist/mxdraw.es.js +1 -0
- package/dist/mxdraw.umd.js +1 -1
- package/package.json +5 -1
- package/dist/lib/MxModule/store/StoreClass.js +0 -1
- package/dist/lib/MxModule/store/store.d.ts +0 -11
- package/dist/lib/MxModule/store/store.js +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { OrbitControls } from 'three/examples/jsm/controls/OrbitControls';
|
|
1
2
|
import * as three from 'three';
|
|
2
3
|
|
|
3
4
|
/**
|
|
@@ -90,6 +91,51 @@ declare enum McGiWorldDrawType {
|
|
|
90
91
|
kSelectDraw = 3
|
|
91
92
|
}
|
|
92
93
|
|
|
94
|
+
/** @module MxType*/
|
|
95
|
+
/**
|
|
96
|
+
* 动态绘制类型
|
|
97
|
+
* @example ```typescript
|
|
98
|
+
|
|
99
|
+
* ```
|
|
100
|
+
*/
|
|
101
|
+
declare enum MxCloneType {
|
|
102
|
+
/** 正常Clone */
|
|
103
|
+
kClone = 1,
|
|
104
|
+
/** 动态拖动Clone */
|
|
105
|
+
kDragClone = 2,
|
|
106
|
+
/** 数据归档 */
|
|
107
|
+
kMxFileClone = 3
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* 控件对象缺省的绘制顺序
|
|
111
|
+
* @example ```typescript
|
|
112
|
+
|
|
113
|
+
* ```
|
|
114
|
+
*/
|
|
115
|
+
declare enum MxDefaultRenderOrder {
|
|
116
|
+
kCADMeshRenderOrder = 10,
|
|
117
|
+
kCADCurveRenderOrder = 20,
|
|
118
|
+
kMxEntityRenderOrder = 30,
|
|
119
|
+
kGripRenderOrder = 110,
|
|
120
|
+
kDynJigRenderOrder = 120
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* 交互操作,需要的输入的触摸类型.
|
|
124
|
+
* @example ```typescript
|
|
125
|
+
* ```
|
|
126
|
+
*/
|
|
127
|
+
declare enum InputToucheType {
|
|
128
|
+
kGetBegan = 1,
|
|
129
|
+
kGetEnd = 2
|
|
130
|
+
}
|
|
131
|
+
declare type MxColorType = number | string | THREE.Color;
|
|
132
|
+
declare type UnstableColor = MxColorType | undefined;
|
|
133
|
+
declare const _default: {
|
|
134
|
+
MxCloneType: typeof MxCloneType;
|
|
135
|
+
MxDefaultRenderOrder: typeof MxDefaultRenderOrder;
|
|
136
|
+
InputToucheType: typeof InputToucheType;
|
|
137
|
+
};
|
|
138
|
+
|
|
93
139
|
/** @module McGiWorldDraw*/
|
|
94
140
|
|
|
95
141
|
/**
|
|
@@ -141,7 +187,7 @@ interface McGiWorldDraw {
|
|
|
141
187
|
* ```
|
|
142
188
|
*
|
|
143
189
|
*/
|
|
144
|
-
setColor(iColor:
|
|
190
|
+
setColor(iColor: UnstableColor): void;
|
|
145
191
|
/**
|
|
146
192
|
* 返回绘制颜色
|
|
147
193
|
* @returns
|
|
@@ -194,7 +240,7 @@ interface McGiWorldDraw {
|
|
|
194
240
|
* ```
|
|
195
241
|
*
|
|
196
242
|
*/
|
|
197
|
-
drawLines(points: THREE.Vector3[]): void;
|
|
243
|
+
drawLines(points: THREE.Vector3[] | THREE.Vector2[]): void;
|
|
198
244
|
/**
|
|
199
245
|
* 根据几何数据绘制直线
|
|
200
246
|
* @param points 点数组
|
|
@@ -374,8 +420,6 @@ interface McGiWorldDraw {
|
|
|
374
420
|
setupForEntity(ent: MxDbEntity): void;
|
|
375
421
|
}
|
|
376
422
|
|
|
377
|
-
/** @module MxDbEntity*/
|
|
378
|
-
|
|
379
423
|
/**
|
|
380
424
|
* MxDbEntity 用于构建一个自定义对象的抽象类(该类无法实例化 请通过继承的方式对其抽象方法进行实现)
|
|
381
425
|
* @description MxDbEntity 属于 abstract class(抽象类) 主要用途是通过继承这个类实现一个用于动态绘制的图形对象
|
|
@@ -400,7 +444,7 @@ declare abstract class MxDbEntity {
|
|
|
400
444
|
/**
|
|
401
445
|
* 颜色值
|
|
402
446
|
* */
|
|
403
|
-
color:
|
|
447
|
+
color: UnstableColor;
|
|
404
448
|
/**
|
|
405
449
|
* 显示顺序
|
|
406
450
|
* */
|
|
@@ -419,12 +463,12 @@ declare abstract class MxDbEntity {
|
|
|
419
463
|
userData: {
|
|
420
464
|
[key: string]: any;
|
|
421
465
|
};
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
466
|
+
sGuid: string;
|
|
467
|
+
dLineWidth: number;
|
|
468
|
+
lineWidthByPixels: boolean;
|
|
469
|
+
dDashArray: number;
|
|
470
|
+
dDashRatio: number;
|
|
471
|
+
layer: string;
|
|
428
472
|
private _event;
|
|
429
473
|
abstract getTypeName(): string;
|
|
430
474
|
initGuid(guid: string): void;
|
|
@@ -448,7 +492,10 @@ declare abstract class MxDbEntity {
|
|
|
448
492
|
abstract moveGripPointsAt(index: number, offset: THREE.Vector3): boolean;
|
|
449
493
|
/**
|
|
450
494
|
* 自定义对象数据输入,辅助函数.
|
|
451
|
-
* @param
|
|
495
|
+
* @param obj 数据对象
|
|
496
|
+
* @param aryProp 属性名称列表
|
|
497
|
+
* @param hooks.getVal 交互数据输入钩子函数 return null | undefined 默认深拷贝 ; return Value 返回数据
|
|
498
|
+
* @param hooks.getCacheVal 归档数据构子函数 return null | undefined 默认深拷贝 ; return Value 返回数据
|
|
452
499
|
* @returns boolean
|
|
453
500
|
* @example
|
|
454
501
|
* ``` typescript
|
|
@@ -460,7 +507,10 @@ declare abstract class MxDbEntity {
|
|
|
460
507
|
* }
|
|
461
508
|
* ```
|
|
462
509
|
*/
|
|
463
|
-
protected dwgInHelp(obj: any, aryProp:
|
|
510
|
+
protected dwgInHelp<T extends string[]>(obj: any, aryProp: T, hooks?: {
|
|
511
|
+
getVal?: (v: any) => any;
|
|
512
|
+
getCacheVal?: (v: any) => any;
|
|
513
|
+
}): boolean;
|
|
464
514
|
/**
|
|
465
515
|
* 自定义对象数据输出 辅助函数.
|
|
466
516
|
* @param
|
|
@@ -479,10 +529,10 @@ declare abstract class MxDbEntity {
|
|
|
479
529
|
protected callEvent(sEventName: string, param?: any): any;
|
|
480
530
|
/**
|
|
481
531
|
* 新创建一个自定义对象 (默认调用该对象的构造函数来创建新的对象)
|
|
482
|
-
* @param
|
|
532
|
+
* @param { T } options
|
|
483
533
|
* @returns MxDbEntity
|
|
484
534
|
*/
|
|
485
|
-
create():
|
|
535
|
+
create(options?: {}): any;
|
|
486
536
|
/**
|
|
487
537
|
* 自定义对象数据输入,必须要实现该函数
|
|
488
538
|
* @param
|
|
@@ -515,10 +565,10 @@ declare abstract class MxDbEntity {
|
|
|
515
565
|
abstract dwgOut(obj: any): object;
|
|
516
566
|
/**
|
|
517
567
|
* 自定义实体的矩阵 坐标变换 (需要重写该方法实现如果通过矩阵对自定义实体进行操作 默认不会进行任何操作)
|
|
518
|
-
* @param
|
|
568
|
+
* @param _mat THREE.Matrix4 变化矩阵
|
|
519
569
|
* @returns void
|
|
520
570
|
*/
|
|
521
|
-
transformBy(
|
|
571
|
+
transformBy(_mat: THREE.Matrix4): void;
|
|
522
572
|
/**
|
|
523
573
|
* 返回对象最小外包.
|
|
524
574
|
* @param
|
|
@@ -568,18 +618,18 @@ declare abstract class MxDbEntity {
|
|
|
568
618
|
* @param color 颜色值
|
|
569
619
|
* @returns boolean
|
|
570
620
|
*/
|
|
571
|
-
setColor(color:
|
|
621
|
+
setColor(color: MxColorType): this;
|
|
572
622
|
/**
|
|
573
623
|
* 得到颜色
|
|
574
624
|
* @returns boolean
|
|
575
625
|
*/
|
|
576
|
-
getColor():
|
|
626
|
+
getColor(): MxColorType;
|
|
577
627
|
/**
|
|
578
628
|
* 复制克隆对象。
|
|
579
629
|
* @param type {@link MxType.MxCloneType} 传入参数区分是正常拷贝还是动态拷贝
|
|
580
630
|
* @returns MxDbEntity
|
|
581
631
|
*/
|
|
582
|
-
clone(type?: number):
|
|
632
|
+
clone(type?: number): any;
|
|
583
633
|
/**
|
|
584
634
|
* 自定义对象内部数据输入同步(重写实现dwgIn抽象方法时 必须在实现中调用 this.onDwgIn(obj))
|
|
585
635
|
* @param obj dwgIn抽象方法的回调数据
|
|
@@ -609,7 +659,7 @@ declare abstract class MxDbEntity {
|
|
|
609
659
|
* 设置线宽是否随像素
|
|
610
660
|
* @returns number
|
|
611
661
|
*/
|
|
612
|
-
setLineWidthByPixels(isPixels: boolean):
|
|
662
|
+
setLineWidthByPixels(isPixels: boolean): this;
|
|
613
663
|
/**
|
|
614
664
|
* 线宽是否随像素
|
|
615
665
|
* @returns number
|
|
@@ -619,7 +669,7 @@ declare abstract class MxDbEntity {
|
|
|
619
669
|
* 设置线宽
|
|
620
670
|
* @returns number
|
|
621
671
|
*/
|
|
622
|
-
setLineWidth(dLineWidth: number):
|
|
672
|
+
setLineWidth(dLineWidth: number): this;
|
|
623
673
|
/**
|
|
624
674
|
* 得到线宽
|
|
625
675
|
* @returns number
|
|
@@ -635,22 +685,22 @@ declare abstract class MxDbEntity {
|
|
|
635
685
|
* dDashRatio确定虚线,与实线的比率.
|
|
636
686
|
* @returns number
|
|
637
687
|
*/
|
|
638
|
-
setDashLen(dashLen: number):
|
|
688
|
+
setDashLen(dashLen: number): this;
|
|
639
689
|
/**
|
|
640
690
|
* 设置虚线,与实线的比率
|
|
641
691
|
* @returns number
|
|
642
692
|
*/
|
|
643
|
-
setDashRatio(dDashRatio: number):
|
|
693
|
+
setDashRatio(dDashRatio: number): this;
|
|
644
694
|
/**
|
|
645
695
|
* 设置实线虚线总段数 = 1 / dashArray
|
|
646
696
|
* @returns number
|
|
647
697
|
*/
|
|
648
|
-
setDashArray(dDashArray: number):
|
|
698
|
+
setDashArray(dDashArray: number): this;
|
|
649
699
|
/**
|
|
650
700
|
* 设置虚线数据
|
|
651
701
|
* @returns number
|
|
652
702
|
*/
|
|
653
|
-
setDash(dDashArray: number, dDashRatio: number):
|
|
703
|
+
setDash(dDashArray: number, dDashRatio: number): this;
|
|
654
704
|
/**
|
|
655
705
|
* 得到虚线数据
|
|
656
706
|
* @returns number
|
|
@@ -660,7 +710,7 @@ declare abstract class MxDbEntity {
|
|
|
660
710
|
* 设置虚线显示。并初始化一个默认值。
|
|
661
711
|
* @returns number
|
|
662
712
|
*/
|
|
663
|
-
setDashLineDisplay(isDashLine: boolean):
|
|
713
|
+
setDashLineDisplay(isDashLine: boolean): this;
|
|
664
714
|
/**
|
|
665
715
|
* 是否虚线显示
|
|
666
716
|
* @returns number
|
|
@@ -1524,7 +1574,7 @@ declare class MxDrawObject {
|
|
|
1524
1574
|
*
|
|
1525
1575
|
* ```
|
|
1526
1576
|
*/
|
|
1527
|
-
getOrbitControls():
|
|
1577
|
+
getOrbitControls(): OrbitControls;
|
|
1528
1578
|
/**
|
|
1529
1579
|
* 禁用或启用视区的移动,放大,缩小等操作.
|
|
1530
1580
|
* @example
|
|
@@ -1841,13 +1891,6 @@ interface MxFunType {
|
|
|
1841
1891
|
loadSVG(url: string, color?: number | string | THREE.Color, callResult?: any, loadSet?: any): void;
|
|
1842
1892
|
getTHREE(): any;
|
|
1843
1893
|
}
|
|
1844
|
-
/**
|
|
1845
|
-
* MxFun 模块
|
|
1846
|
-
* 导出库时已实例化,只需要调用实例方法 例如:
|
|
1847
|
-
* ```typescript
|
|
1848
|
-
* Mx.MxFun.createMxObject
|
|
1849
|
-
* ```
|
|
1850
|
-
*/
|
|
1851
1894
|
declare class MxFunClass {
|
|
1852
1895
|
constructor();
|
|
1853
1896
|
/**
|
|
@@ -2341,7 +2384,7 @@ declare class MxFunClass {
|
|
|
2341
2384
|
/**
|
|
2342
2385
|
* 创建十字光标图片
|
|
2343
2386
|
* */
|
|
2344
|
-
ceneratecursor(cursorSize?: number, squareSize?: number, isRoss?: boolean): HTMLImageElement;
|
|
2387
|
+
ceneratecursor(cursorSize?: number, squareSize?: number, isRoss?: boolean, color?: string): HTMLImageElement;
|
|
2345
2388
|
/**
|
|
2346
2389
|
* 调用服务器后台CAD命令.
|
|
2347
2390
|
* */
|
|
@@ -2379,6 +2422,13 @@ declare class MxFunClass {
|
|
|
2379
2422
|
*/
|
|
2380
2423
|
getMxEntity(id: number): MxDbEntity | undefined;
|
|
2381
2424
|
}
|
|
2425
|
+
/**
|
|
2426
|
+
* MxFun 模块
|
|
2427
|
+
* 导出库时已实例化,只需要调用实例方法 例如:
|
|
2428
|
+
* ```typescript
|
|
2429
|
+
* Mx.MxFun.createMxObject
|
|
2430
|
+
* ```
|
|
2431
|
+
*/
|
|
2382
2432
|
declare const MxFun: MxFunClass;
|
|
2383
2433
|
|
|
2384
2434
|
declare class PubSub {
|
|
@@ -2515,13 +2565,14 @@ declare class MxThreeJS$1 {
|
|
|
2515
2565
|
* 创建Three.js点对象。
|
|
2516
2566
|
* @param mPt 点位置
|
|
2517
2567
|
* @param iColor 颜色
|
|
2568
|
+
* @param size 大小
|
|
2518
2569
|
* @returns THREE.Points
|
|
2519
2570
|
* @example
|
|
2520
2571
|
* ```typescript
|
|
2521
2572
|
* Mx.MxThreeJS.createPoint(new Three.Vector3(1,10,0), 0)
|
|
2522
2573
|
* ```
|
|
2523
2574
|
*/
|
|
2524
|
-
createPoint(mPt: THREE.Vector3, iColor: number | string | THREE.Color): THREE.Points;
|
|
2575
|
+
createPoint(mPt: THREE.Vector3, iColor: number | string | THREE.Color, size?: number): THREE.Points;
|
|
2525
2576
|
/**
|
|
2526
2577
|
* 创建Three.js 文字
|
|
2527
2578
|
* @param message 文字信息
|
|
@@ -2535,7 +2586,7 @@ declare class MxThreeJS$1 {
|
|
|
2535
2586
|
* Mx.MxThreeJS.creatTextSprite("hello",new Three.Vector3(1,10,0), 90, 60, 0)
|
|
2536
2587
|
* ```
|
|
2537
2588
|
*/
|
|
2538
|
-
creatTextSprite(message: string, pt: THREE.Vector3, iSize: number, fAngle: number, iColor: number)
|
|
2589
|
+
creatTextSprite: (message: string, pt: THREE.Vector3, iSize: number, fAngle: number, iColor: number | string | THREE.Color) => THREE.Sprite | null;
|
|
2539
2590
|
/**
|
|
2540
2591
|
* 计算creatTextSprite函数,创建的文字对象,的尺寸.
|
|
2541
2592
|
* @param message 文字信息
|
|
@@ -2547,7 +2598,12 @@ declare class MxThreeJS$1 {
|
|
|
2547
2598
|
*
|
|
2548
2599
|
* ```
|
|
2549
2600
|
*/
|
|
2550
|
-
clacTextSpriteSize(message: string, iHeight: number, iWidth?: number)
|
|
2601
|
+
clacTextSpriteSize: (message: string, iHeight: number, iWidth?: number) => {
|
|
2602
|
+
spritewidth: number;
|
|
2603
|
+
spriteheight: number;
|
|
2604
|
+
textwidth: number;
|
|
2605
|
+
singleline: boolean;
|
|
2606
|
+
};
|
|
2551
2607
|
/**
|
|
2552
2608
|
* 计算文字宽度.
|
|
2553
2609
|
* @param message 文字信息
|
|
@@ -2558,7 +2614,7 @@ declare class MxThreeJS$1 {
|
|
|
2558
2614
|
*
|
|
2559
2615
|
* ```
|
|
2560
2616
|
*/
|
|
2561
|
-
clacTextSize(message: string, iHeight: number)
|
|
2617
|
+
clacTextSize: (message: string, iHeight: number) => number;
|
|
2562
2618
|
/**
|
|
2563
2619
|
* 根据三角形数组,创建Three.js Mesh
|
|
2564
2620
|
* @param points 由三个点组成的数组
|
|
@@ -2614,13 +2670,13 @@ declare class MxThreeJS$1 {
|
|
|
2614
2670
|
* })
|
|
2615
2671
|
* ```
|
|
2616
2672
|
*/
|
|
2617
|
-
createImage(pos: THREE.Vector3, w: number, h: number, imageUrlPath: string, callResult?: (mesh: THREE.Mesh | null) => void)
|
|
2673
|
+
createImage: (pos: THREE.Vector3, w: number, h: number, imageUrlPath: string, callResult?: (mesh: THREE.Mesh | null) => void) => void | Promise<THREE.Mesh | null>;
|
|
2618
2674
|
/**
|
|
2619
2675
|
* 加载SVG
|
|
2620
2676
|
* @param url SVG路径地址,该函数具有缓存功能,下次加载同样的图片,可以直接返回.
|
|
2621
2677
|
* @param color 颜色
|
|
2622
2678
|
* @param callResult SVG加载完成的回调 回调参数:THREE.Object3D和Array<THREE.MeshBasicMaterial>
|
|
2623
|
-
* @returns void
|
|
2679
|
+
* @returns void | THREE.Object3D | null
|
|
2624
2680
|
* @example
|
|
2625
2681
|
* ```typescript
|
|
2626
2682
|
* Mx.MxThreeJS.loadSVG("../img/icon.svg", 10, 20, 1.5, new THREE.Color(0xff0000), (threeobj, aryMeterial)=> {
|
|
@@ -2628,55 +2684,11 @@ declare class MxThreeJS$1 {
|
|
|
2628
2684
|
* })
|
|
2629
2685
|
* ```
|
|
2630
2686
|
*/
|
|
2631
|
-
loadSVG(url: string, color?: number | string | THREE.Color, callResult?: (threeobj: THREE.Object3D, aryMeterial: Array<THREE.MeshBasicMaterial>) => void, loadSet?: any)
|
|
2687
|
+
loadSVG: (url: string, color?: number | string | THREE.Color, callResult?: (threeobj: THREE.Object3D, aryMeterial: Array<THREE.MeshBasicMaterial>) => void, loadSet?: any) => Promise<THREE.Object3D | null>;
|
|
2632
2688
|
}
|
|
2633
2689
|
|
|
2634
2690
|
declare const MxThreeJS: MxThreeJS$1;
|
|
2635
2691
|
|
|
2636
|
-
/**
|
|
2637
|
-
* 动态绘制类型
|
|
2638
|
-
* @example ```typescript
|
|
2639
|
-
|
|
2640
|
-
* ```
|
|
2641
|
-
*/
|
|
2642
|
-
declare enum MxCloneType {
|
|
2643
|
-
/** 正常Clone */
|
|
2644
|
-
kClone = 1,
|
|
2645
|
-
/** 动态拖动Clone */
|
|
2646
|
-
kDragClone = 2,
|
|
2647
|
-
/** 数据归档 */
|
|
2648
|
-
kMxFileClone = 3
|
|
2649
|
-
}
|
|
2650
|
-
/**
|
|
2651
|
-
* 控件对象缺省的绘制顺序
|
|
2652
|
-
* @example ```typescript
|
|
2653
|
-
|
|
2654
|
-
* ```
|
|
2655
|
-
*/
|
|
2656
|
-
declare enum MxDefaultRenderOrder {
|
|
2657
|
-
kCADMeshRenderOrder = 10,
|
|
2658
|
-
kCADCurveRenderOrder = 20,
|
|
2659
|
-
kMxEntityRenderOrder = 30,
|
|
2660
|
-
kGripRenderOrder = 110,
|
|
2661
|
-
kDynJigRenderOrder = 120
|
|
2662
|
-
}
|
|
2663
|
-
/**
|
|
2664
|
-
* 交互操作,需要的输入的触摸类型.
|
|
2665
|
-
* @example ```typescript
|
|
2666
|
-
|
|
2667
|
-
* ```
|
|
2668
|
-
*/
|
|
2669
|
-
declare enum InputToucheType {
|
|
2670
|
-
kGetBegan = 1,
|
|
2671
|
-
kGetEnd = 2
|
|
2672
|
-
}
|
|
2673
|
-
declare type MxColorType = number | string | THREE.Color;
|
|
2674
|
-
declare const MxType: {
|
|
2675
|
-
MxCloneType: typeof MxCloneType;
|
|
2676
|
-
MxDefaultRenderOrder: typeof MxDefaultRenderOrder;
|
|
2677
|
-
InputToucheType: typeof InputToucheType;
|
|
2678
|
-
};
|
|
2679
|
-
|
|
2680
2692
|
/** @module McGeTool */
|
|
2681
2693
|
|
|
2682
2694
|
/**
|
|
@@ -3133,14 +3145,14 @@ declare class MxDbSVG extends MxDbEntity {
|
|
|
3133
3145
|
private calcSvgPosition;
|
|
3134
3146
|
dwgIn(obj: any): boolean;
|
|
3135
3147
|
dwgOut(obj: any): object;
|
|
3136
|
-
create():
|
|
3148
|
+
create(): MxDbSVG;
|
|
3137
3149
|
transformBy(mat: THREE.Matrix4): void;
|
|
3138
3150
|
getTypeName(): string;
|
|
3139
3151
|
/**
|
|
3140
3152
|
* 设置颜色
|
|
3141
3153
|
* @param color 颜色值
|
|
3142
3154
|
* */
|
|
3143
|
-
setColor(color: number | string | THREE.Color):
|
|
3155
|
+
setColor(color: number | string | THREE.Color): this;
|
|
3144
3156
|
/**
|
|
3145
3157
|
* 设置svg对象
|
|
3146
3158
|
* */
|
|
@@ -3177,23 +3189,59 @@ declare class MxDbPolyline extends MxDbEntity {
|
|
|
3177
3189
|
setPointAt(index: number, pt: THREE.Vector3): boolean;
|
|
3178
3190
|
}
|
|
3179
3191
|
|
|
3180
|
-
/** @module MxDb2LineAngularDimension*/
|
|
3181
|
-
|
|
3182
|
-
/**
|
|
3183
|
-
* MxDb2LineAngularDimension
|
|
3184
|
-
* 显示角度测量的图形
|
|
3185
|
-
*/
|
|
3186
3192
|
declare class MxDb2LineAngularDimension extends MxDbEntity {
|
|
3187
|
-
|
|
3188
|
-
|
|
3189
|
-
|
|
3193
|
+
/**
|
|
3194
|
+
* MxDb2LineAngularDimension
|
|
3195
|
+
* 显示角度测量的图形
|
|
3196
|
+
* @param options.points [point1(起始点)、point2(角顶点)、point3(结束点)]
|
|
3197
|
+
* @param options.colors [起始线段颜色, 结束线段颜色, 标注角度圆弧颜色, 文字标注的角度颜色]
|
|
3198
|
+
* @example
|
|
3199
|
+
* ``` typescript
|
|
3200
|
+
* const draw = Mx.MxFun.getCurrentDraw();
|
|
3201
|
+
* const points = [ getPoint.value(),
|
|
3202
|
+
* getPoint.value().add(new THREE.Vector3(8880, 0, 0)),
|
|
3203
|
+
* getPoint.value().add(new THREE.Vector3(0, 6666, 0)),
|
|
3204
|
+
* ]
|
|
3205
|
+
* const colors = ['#F00880','#00ff1a', void 0, 0XFF0000]
|
|
3206
|
+
* const obj = new Mx.MxDb2LineAngularDimension().setPoints(points).setColor(colors).setLineWidth(6)
|
|
3207
|
+
* draw.addMxEntity(obj)
|
|
3208
|
+
* ```
|
|
3209
|
+
**/
|
|
3210
|
+
constructor(options?: {
|
|
3211
|
+
/** 传入三个位置THREE向量 分别对应 属性: point1(起始点)、point2(角顶点)、point3(结束点) 计算角度 */
|
|
3212
|
+
points?: THREE.Vector3[];
|
|
3213
|
+
/** colors 各标注的颜色设置:
|
|
3214
|
+
* [起始线段颜色, 结束线段颜色, 标注角度圆弧颜色, 文字标注的角度颜色]
|
|
3215
|
+
* 某一项为null或undefined采用绘制颜色 */
|
|
3216
|
+
colors?: UnstableColor[];
|
|
3217
|
+
});
|
|
3218
|
+
point1: three.Vector3;
|
|
3219
|
+
point2: three.Vector3;
|
|
3220
|
+
point3: three.Vector3;
|
|
3221
|
+
/**
|
|
3222
|
+
* colors 各标注的颜色设置:
|
|
3223
|
+
* [起始线段颜色, 结束线段颜色, 标注角度圆弧颜色, 文字标注的角度颜色]
|
|
3224
|
+
* 某一项为null或undefined采用绘制颜色
|
|
3225
|
+
* */
|
|
3226
|
+
colors: UnstableColor[];
|
|
3190
3227
|
private calculateLineAngle;
|
|
3228
|
+
/**
|
|
3229
|
+
* 设置point1 、 point2、point3 向量位置
|
|
3230
|
+
* @param { THREE.Vector3[] } points
|
|
3231
|
+
*/
|
|
3232
|
+
setPoints(points: THREE.Vector3[]): this;
|
|
3233
|
+
/**
|
|
3234
|
+
* 设置颜色组合
|
|
3235
|
+
* @param colors [起始线段颜色, 结束线段颜色, 标注角度圆弧颜色, 文字标注的角度颜色]
|
|
3236
|
+
* 某一项为null或undefined采用绘制颜色 || 单颜色
|
|
3237
|
+
* */
|
|
3238
|
+
setColor(colors: UnstableColor[] | MxColorType): this;
|
|
3191
3239
|
worldDraw(pWorldDraw: McGiWorldDraw): void;
|
|
3192
|
-
getGripPoints():
|
|
3240
|
+
getGripPoints(): three.Vector3[];
|
|
3193
3241
|
moveGripPointsAt(index: number, offset: THREE.Vector3): boolean;
|
|
3194
3242
|
dwgIn(obj: any): boolean;
|
|
3195
|
-
dwgOut(obj: any):
|
|
3196
|
-
create():
|
|
3243
|
+
dwgOut(obj: any): any;
|
|
3244
|
+
create(): MxDb2LineAngularDimension;
|
|
3197
3245
|
transformBy(mat: THREE.Matrix4): void;
|
|
3198
3246
|
getTypeName(): string;
|
|
3199
3247
|
}
|
|
@@ -3421,10 +3469,42 @@ declare class MxDbRect extends MxDbEntity {
|
|
|
3421
3469
|
* MxDbAlignedDimension 尺寸标注
|
|
3422
3470
|
*/
|
|
3423
3471
|
declare class MxDbAlignedDimension extends MxDbEntity {
|
|
3472
|
+
/**
|
|
3473
|
+
* MxDbAlignedDimension
|
|
3474
|
+
* 尺寸标注
|
|
3475
|
+
* @param options.points 提供两个向量测量尺寸
|
|
3476
|
+
* @param options.fontColor 字体颜色
|
|
3477
|
+
* @example ```typescript
|
|
3478
|
+
* const draw = Mx.MxFun.getCurrentDraw();
|
|
3479
|
+
* const v3 = new THREE.Vector3()
|
|
3480
|
+
* const points = [v3 , v3.clone().add(new THREE.Vector3(8880, 0, 0))]
|
|
3481
|
+
* const colors = ['#F00880','#00ff1a']
|
|
3482
|
+
* draw.addMxEntity(
|
|
3483
|
+
* new Mx.MxDbAlignedDimension({ points })
|
|
3484
|
+
* .setColor(colors)
|
|
3485
|
+
* .setLineWidth(6)
|
|
3486
|
+
* )
|
|
3487
|
+
* ```
|
|
3488
|
+
**/
|
|
3489
|
+
constructor(options?: {
|
|
3490
|
+
/** [point1, point2] 两个向量位置 */
|
|
3491
|
+
points?: THREE.Vector3[];
|
|
3492
|
+
/** 字体颜色 */
|
|
3493
|
+
fontColor?: MxColorType;
|
|
3494
|
+
});
|
|
3424
3495
|
point1: THREE.Vector3;
|
|
3425
3496
|
point2: THREE.Vector3;
|
|
3497
|
+
fontColor: UnstableColor;
|
|
3498
|
+
/**
|
|
3499
|
+
* 设置两个点位置向量
|
|
3500
|
+
* @param { THREE.Vector3[] } points [THREE.Vector3, THREE.Vector3]
|
|
3501
|
+
*/
|
|
3502
|
+
setPoints(points: THREE.Vector3[]): void;
|
|
3426
3503
|
getTypeName(): string;
|
|
3427
3504
|
private getDirection;
|
|
3505
|
+
/**
|
|
3506
|
+
* 获取尺寸距离
|
|
3507
|
+
* */
|
|
3428
3508
|
getDimText(): string;
|
|
3429
3509
|
worldDraw(pWorldDraw: McGiWorldDraw): void;
|
|
3430
3510
|
/**
|
|
@@ -3437,11 +3517,12 @@ declare class MxDbAlignedDimension extends MxDbEntity {
|
|
|
3437
3517
|
* @parma pt1 three.js坐标点位
|
|
3438
3518
|
* */
|
|
3439
3519
|
setPoint2(pt2: THREE.Vector3): void;
|
|
3520
|
+
setColor(color: UnstableColor | UnstableColor[]): this;
|
|
3440
3521
|
getGripPoints(): Array<THREE.Vector3>;
|
|
3441
3522
|
moveGripPointsAt(index: number, offset: THREE.Vector3): boolean;
|
|
3442
3523
|
dwgIn(obj: any): boolean;
|
|
3443
3524
|
dwgOut(obj: any): object;
|
|
3444
|
-
create():
|
|
3525
|
+
create(): MxDbAlignedDimension;
|
|
3445
3526
|
}
|
|
3446
3527
|
|
|
3447
3528
|
/**
|
|
@@ -3507,8 +3588,12 @@ declare class MxDbAnyLine extends MxDbEntity {
|
|
|
3507
3588
|
/** 构成线段的顶点坐标集合 */
|
|
3508
3589
|
points: THREE.Vector3[];
|
|
3509
3590
|
getTypeName(): string;
|
|
3510
|
-
create():
|
|
3591
|
+
create(): MxDbAnyLine;
|
|
3511
3592
|
worldDraw(pWorldDraw: McGiWorldDraw): void;
|
|
3593
|
+
/** 设置线段points
|
|
3594
|
+
* @param points 构成线段的多个点
|
|
3595
|
+
*/
|
|
3596
|
+
setPoints(points: THREE.Vector3[]): this;
|
|
3512
3597
|
/** 获取线段的包围盒的中心点坐标 */
|
|
3513
3598
|
getCenter(): THREE.Vector3;
|
|
3514
3599
|
getGripPoints(): THREE.Vector3[];
|
|
@@ -3523,7 +3608,7 @@ declare class MxDbAnyLine extends MxDbEntity {
|
|
|
3523
3608
|
declare class MxDbCloudLine extends MxDbEntity {
|
|
3524
3609
|
private points;
|
|
3525
3610
|
private radius;
|
|
3526
|
-
private
|
|
3611
|
+
private cachePoint;
|
|
3527
3612
|
getTypeName(): string;
|
|
3528
3613
|
create(): MxDbEntity;
|
|
3529
3614
|
/** 设置构成云线的每个圆弧半径长度
|
|
@@ -3549,7 +3634,7 @@ declare class MxDbCloudLine extends MxDbEntity {
|
|
|
3549
3634
|
* */
|
|
3550
3635
|
addLine(pt1: THREE.Vector3, pt2: THREE.Vector3): three.Vector3;
|
|
3551
3636
|
/** 重新计算云线的的所有顶点坐标, 如绘制完云线后 重新设置了圆弧半径, 在worldDraw动态绘制时会调用该方法 */
|
|
3552
|
-
|
|
3637
|
+
reCalculateDrawGeometryPoint(): THREE.Vector3[] | null;
|
|
3553
3638
|
worldDraw(pWorldDraw: McGiWorldDraw): void;
|
|
3554
3639
|
/**
|
|
3555
3640
|
* 获取云线包围盒的中心点
|
|
@@ -3690,12 +3775,72 @@ declare class MxDbHatch extends MxDbEntity {
|
|
|
3690
3775
|
dwgOut(obj: any): any;
|
|
3691
3776
|
}
|
|
3692
3777
|
|
|
3778
|
+
/***
|
|
3779
|
+
* 渐变线段
|
|
3780
|
+
* @augments MxDbEntity
|
|
3781
|
+
* */
|
|
3782
|
+
declare class MxDbGradientLine extends MxDbEntity {
|
|
3783
|
+
/** 点集合 */
|
|
3784
|
+
points: THREE.Vector3[];
|
|
3785
|
+
/** 渐变色 */
|
|
3786
|
+
colors: (THREE.Color | string | number)[];
|
|
3787
|
+
/**
|
|
3788
|
+
* 定义线两端的样式
|
|
3789
|
+
* @access public
|
|
3790
|
+
* */
|
|
3791
|
+
linecap: 'butt' | 'round' | 'square';
|
|
3792
|
+
/**
|
|
3793
|
+
* 定义线连接节点的样式
|
|
3794
|
+
* @access public
|
|
3795
|
+
* */
|
|
3796
|
+
linejoin: 'round' | 'bevel' | 'miter';
|
|
3797
|
+
/**
|
|
3798
|
+
* 定义线形状是否闭合,从而创建多边形或斑点
|
|
3799
|
+
* @access public
|
|
3800
|
+
* */
|
|
3801
|
+
closed: boolean;
|
|
3802
|
+
/**
|
|
3803
|
+
* 曲线的类型: chordal: 弦线、 centripetal: 向心线、 catmullrom: Catmull-Rom曲线 默认:centripetal
|
|
3804
|
+
* @access public
|
|
3805
|
+
* */
|
|
3806
|
+
curveType: 'chordal' | 'centripetal' | 'catmullrom';
|
|
3807
|
+
/**
|
|
3808
|
+
* 当curveType为catmullrom时,定义catmullrom的张力。 张力: 数值越大,曲线越弯曲。值为0将导致没有插值。默认值是0
|
|
3809
|
+
* @access public
|
|
3810
|
+
*
|
|
3811
|
+
*/
|
|
3812
|
+
tension: number;
|
|
3813
|
+
/**
|
|
3814
|
+
* 如果没有提供张力,但bezierType赋值为'quadratic'| 'cubic',则使用点集合中的点绘制一条bezier线 默认: undefined
|
|
3815
|
+
* @summary quadratic: 三维二次贝塞尔曲线 => 起点 – 中间的控制点 – 终点
|
|
3816
|
+
* @summary cubic: 三维三次贝塞尔曲线 => 起点v – 第一个控制点 – 第二个控制点 – 终点
|
|
3817
|
+
*/
|
|
3818
|
+
bezierType: 'quadratic' | 'cubic' | undefined;
|
|
3819
|
+
protected curve?: THREE.CatmullRomCurve3 | THREE.CurvePath<THREE.Vector3>;
|
|
3820
|
+
create(): MxDbGradientLine;
|
|
3821
|
+
getTypeName(): string;
|
|
3822
|
+
setPoints(points: THREE.Vector3[]): this;
|
|
3823
|
+
setColors(colors: (THREE.Color | string | number)[]): this;
|
|
3824
|
+
addColor(color: THREE.Color): this;
|
|
3825
|
+
setLinecap(linecap: "butt" | "round" | "square"): void;
|
|
3826
|
+
setClosed(closed: boolean): void;
|
|
3827
|
+
setCurveType(curveType: "chordal" | "centripetal" | "catmullrom"): void;
|
|
3828
|
+
setTension(tension: number): void;
|
|
3829
|
+
setBezierType(bezierType: 'quadratic' | 'cubic'): void;
|
|
3830
|
+
worldDraw(pWorldDraw: McGiWorldDraw): void;
|
|
3831
|
+
getGripPoints(): THREE.Vector3[];
|
|
3832
|
+
getPoints(): three.Vector3[];
|
|
3833
|
+
moveGripPointsAt(index: number, offset: THREE.Vector3): boolean;
|
|
3834
|
+
move(index: number, offset: THREE.Vector3): this;
|
|
3835
|
+
dwgIn(obj: any): boolean;
|
|
3836
|
+
dwgOut(obj: any): object;
|
|
3837
|
+
}
|
|
3838
|
+
|
|
3693
3839
|
declare const Mx_loadCoreCode: typeof loadCoreCode;
|
|
3694
3840
|
declare const Mx_useCanvasResizeListener: typeof useCanvasResizeListener;
|
|
3695
3841
|
declare const Mx_store: typeof store;
|
|
3696
3842
|
declare const Mx_MxFun: typeof MxFun;
|
|
3697
3843
|
declare const Mx_MxThreeJS: typeof MxThreeJS;
|
|
3698
|
-
declare const Mx_MxType: typeof MxType;
|
|
3699
3844
|
declare const Mx_Mxassembly: typeof Mxassembly;
|
|
3700
3845
|
declare const Mx_McGeTool: typeof McGeTool;
|
|
3701
3846
|
declare const Mx_MrxDbgUtils: typeof MrxDbgUtils;
|
|
@@ -3762,6 +3907,8 @@ declare const Mx_MxDbDatabase: typeof MxDbDatabase;
|
|
|
3762
3907
|
type Mx_MxCADObject = MxCADObject;
|
|
3763
3908
|
declare const Mx_MxCADObject: typeof MxCADObject;
|
|
3764
3909
|
type Mx_MxDbGroup = MxDbGroup;
|
|
3910
|
+
type Mx_MxDbGradientLine = MxDbGradientLine;
|
|
3911
|
+
declare const Mx_MxDbGradientLine: typeof MxDbGradientLine;
|
|
3765
3912
|
declare namespace Mx {
|
|
3766
3913
|
export {
|
|
3767
3914
|
Mx_loadCoreCode as loadCoreCode,
|
|
@@ -3769,7 +3916,7 @@ declare namespace Mx {
|
|
|
3769
3916
|
Mx_store as store,
|
|
3770
3917
|
Mx_MxFun as MxFun,
|
|
3771
3918
|
Mx_MxThreeJS as MxThreeJS,
|
|
3772
|
-
|
|
3919
|
+
_default as MxType,
|
|
3773
3920
|
Mx_Mxassembly as Mxassembly,
|
|
3774
3921
|
Mx_McGeTool as McGeTool,
|
|
3775
3922
|
Mx_MrxDbgUtils as MrxDbgUtils,
|
|
@@ -3807,7 +3954,8 @@ declare namespace Mx {
|
|
|
3807
3954
|
Mx_MxDbDatabase as MxDbDatabase,
|
|
3808
3955
|
Mx_MxCADObject as MxCADObject,
|
|
3809
3956
|
Mx_MxDbGroup as MxDbGroup,
|
|
3957
|
+
Mx_MxDbGradientLine as MxDbGradientLine,
|
|
3810
3958
|
};
|
|
3811
3959
|
}
|
|
3812
3960
|
|
|
3813
|
-
export { McEdGetPointWorldDrawObject, McGePoint3d, McGePoint3dArray, McGeTool, McGiWorldDraw, McGiWorldDrawType, MrxDbgUiPrBaseReturn, MrxDbgUiPrPoint, MrxDbgUtils, Mx3PointArc, MxCADObject, MxDb2LineAngularDimension, MxDbAlignedDimension, MxDbAnyLine, MxDbArea, MxDbCloudLine, MxDbCoord, MxDbDatabase, MxDbEllipse, MxDbEntity, MxDbGroup, MxDbHatch, MxDbImage, MxDbLayerTableRecord, MxDbLeadComment, MxDbLeadTag, MxDbLine, MxDbPolyline, MxDbRect, MxDbRectBoxLeadComment, MxDbRegularPolygon, MxDbSVG, MxDbSVGText, MxDbText, MxDrawObject, MxFilters, MxFun, MxThreeJS, MxType, Mxassembly, Mx as default, loadCoreCode, store, useCanvasResizeListener };
|
|
3961
|
+
export { McEdGetPointWorldDrawObject, McGePoint3d, McGePoint3dArray, McGeTool, McGiWorldDraw, McGiWorldDrawType, MrxDbgUiPrBaseReturn, MrxDbgUiPrPoint, MrxDbgUtils, Mx3PointArc, MxCADObject, MxDb2LineAngularDimension, MxDbAlignedDimension, MxDbAnyLine, MxDbArea, MxDbCloudLine, MxDbCoord, MxDbDatabase, MxDbEllipse, MxDbEntity, MxDbGradientLine, MxDbGroup, MxDbHatch, MxDbImage, MxDbLayerTableRecord, MxDbLeadComment, MxDbLeadTag, MxDbLine, MxDbPolyline, MxDbRect, MxDbRectBoxLeadComment, MxDbRegularPolygon, MxDbSVG, MxDbSVGText, MxDbText, MxDrawObject, MxFilters, MxFun, MxThreeJS, _default as MxType, Mxassembly, Mx as default, loadCoreCode, store, useCanvasResizeListener };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import store from"../store
|
|
1
|
+
import store from"../store";export default class McEdGetPointWorldDrawObject{constructor(){var t;this._McEdGetPointWorldDraw=new(null===(t=store.state.MxFun)||void 0===t?void 0:t.getMxJigCmdManager().McEdGetPointWorldDrawObjectClass()),this._get=(()=>this._McEdGetPointWorldDraw)}drawCircle(t,r){return this._McEdGetPointWorldDraw.drawCircle(t,r)}drawLine(t,r){return this._McEdGetPointWorldDraw.drawLine(t,r)}drawEntity(t,r){return this._McEdGetPointWorldDraw.drawEntity(t,r)}drawText(t,r,e,o){return this._McEdGetPointWorldDraw.drawText(t,r,e,o)}setDraw(t){return this._McEdGetPointWorldDraw.setDraw(t)}setColor(t){return this._McEdGetPointWorldDraw.setColor(t)}getColor(){return this._McEdGetPointWorldDraw.getColor()}drawCustomEntity(t,r){return this._McEdGetPointWorldDraw.drawCustomEntity(t,r)}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import Mxassembly from"../Mxassembly";import store from"../store
|
|
1
|
+
import Mxassembly from"../Mxassembly";import store from"../store";class McGeToolClass{constructor(){this.mxgeTool=null}initImp(){this.mxgeTool||store.state.Mxassembly&&(this.mxgeTool=new store.state.Mxassembly.McGeTool)}calcArea(e){if(this.initImp(),e instanceof Array){let o=Mxassembly.NewMcGePoint3dArray(e);return this.mxgeTool.calcArea(o)}return this.mxgeTool.calcArea(e)}pointInPolyline(e,o){this.initImp();let t=o;o instanceof Array&&(t=Mxassembly.NewMcGePoint3dArray(o));let s=Mxassembly.NewMcGePoint3d(e.x,e.y,e.z);return this.mxgeTool.pointInPolyline(s,t)}}const McGeTool=new McGeToolClass;export default McGeTool;
|