mxdraw 0.1.112 → 0.1.114

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 (38) hide show
  1. package/dist/index.d.ts +298 -62
  2. package/dist/lib/MxModule/McGiWorldDraw/index.d.ts +11 -0
  3. package/dist/lib/MxModule/MrxDbgUtils/index.d.ts +1 -1
  4. package/dist/lib/MxModule/MrxDbgUtils/index.js +1 -1
  5. package/dist/lib/MxModule/MxDb2LineAngularDimension/index.d.ts +20 -20
  6. package/dist/lib/MxModule/MxDbAlignedDimension/index.d.ts +16 -16
  7. package/dist/lib/MxModule/MxDbAnyLine/index.d.ts +1 -1
  8. package/dist/lib/MxModule/MxDbCloudLine/index.d.ts +1 -0
  9. package/dist/lib/MxModule/MxDbCloudLine/index.js +1 -1
  10. package/dist/lib/MxModule/MxDbEntity/index.d.ts +17 -3
  11. package/dist/lib/MxModule/MxDbEntity/index.js +1 -1
  12. package/dist/lib/MxModule/MxDbGradientLine/index.d.ts +6 -6
  13. package/dist/lib/MxModule/MxDbRectBoxLeadComment/index.d.ts +1 -0
  14. package/dist/lib/MxModule/MxDbRectBoxLeadComment/index.js +1 -1
  15. package/dist/lib/MxModule/MxDbSVG/index.d.ts +1 -0
  16. package/dist/lib/MxModule/MxDbSVG/index.js +1 -1
  17. package/dist/lib/MxModule/MxDbText/MxDbText.d.ts +138 -0
  18. package/dist/lib/MxModule/MxDbText/MxDbText.js +1 -0
  19. package/dist/lib/MxModule/MxDbText/MxDbText_old.d.ts +23 -0
  20. package/dist/lib/MxModule/MxDbText/MxDbText_old.js +1 -0
  21. package/dist/lib/MxModule/MxDbText/SpriteText.d.ts +54 -0
  22. package/dist/lib/MxModule/MxDbText/SpriteText.js +1 -0
  23. package/dist/lib/MxModule/MxDbText/index.d.ts +2 -23
  24. package/dist/lib/MxModule/MxDbText/index.js +1 -1
  25. package/dist/lib/MxModule/MxDrawObject/index.d.ts +23 -5
  26. package/dist/lib/MxModule/MxDrawObject/index.js +1 -1
  27. package/dist/lib/MxModule/MxFun/index.d.ts +10 -0
  28. package/dist/lib/MxModule/MxFun/index.js +1 -1
  29. package/dist/lib/MxModule/MxType/MxType.d.ts +5 -10
  30. package/dist/lib/MxModule/MxType/MxType.js +1 -1
  31. package/dist/lib/MxModule/MxType/index.d.ts +3 -45
  32. package/dist/lib/MxModule/MxType/index.js +1 -1
  33. package/dist/lib/MxModule/loadCoreCode/mxfun.es5.js +1 -1
  34. package/dist/lib/tools/three/index.d.ts +19 -0
  35. package/dist/lib/tools/three/index.js +1 -1
  36. package/dist/mxdraw.es.js +1 -1
  37. package/dist/mxdraw.umd.js +1 -1
  38. package/package.json +1 -2
package/dist/index.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  import { OrbitControls } from 'three/examples/jsm/controls/OrbitControls';
2
2
  import * as three from 'three';
3
+ import { Color } from 'three';
3
4
 
4
5
  /**
5
6
  * 加载MxDraw库的核心代码 才能使用Mx的其他模块
@@ -91,7 +92,6 @@ declare enum McGiWorldDrawType {
91
92
  kSelectDraw = 3
92
93
  }
93
94
 
94
- /** @module MxType*/
95
95
  /**
96
96
  * 动态绘制类型
97
97
  * @example ```typescript
@@ -104,7 +104,9 @@ declare enum MxCloneType {
104
104
  /** 动态拖动Clone */
105
105
  kDragClone = 2,
106
106
  /** 数据归档 */
107
- kMxFileClone = 3
107
+ kMxFileClone = 3,
108
+ /** 保存数据到DWG文件 */
109
+ kSaveDwgClone = 4
108
110
  }
109
111
  /**
110
112
  * 控件对象缺省的绘制顺序
@@ -129,12 +131,25 @@ declare enum InputToucheType {
129
131
  kGetEnd = 2
130
132
  }
131
133
  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
- };
134
+ declare type UnstableColor = MxColorType | undefined;
135
+
136
+ type MxType_MxCloneType = MxCloneType;
137
+ declare const MxType_MxCloneType: typeof MxCloneType;
138
+ type MxType_MxDefaultRenderOrder = MxDefaultRenderOrder;
139
+ declare const MxType_MxDefaultRenderOrder: typeof MxDefaultRenderOrder;
140
+ type MxType_InputToucheType = InputToucheType;
141
+ declare const MxType_InputToucheType: typeof InputToucheType;
142
+ type MxType_MxColorType = MxColorType;
143
+ type MxType_UnstableColor = UnstableColor;
144
+ declare namespace MxType {
145
+ export {
146
+ MxType_MxCloneType as MxCloneType,
147
+ MxType_MxDefaultRenderOrder as MxDefaultRenderOrder,
148
+ MxType_InputToucheType as InputToucheType,
149
+ MxType_MxColorType as MxColorType,
150
+ MxType_UnstableColor as UnstableColor,
151
+ };
152
+ }
138
153
 
139
154
  /** @module McGiWorldDraw*/
140
155
 
@@ -418,6 +433,17 @@ interface McGiWorldDraw {
418
433
  *
419
434
  */
420
435
  setupForEntity(ent: MxDbEntity): void;
436
+ /**
437
+ *设置drawEntity函数,绘制的three.js对象,附加一个扩展数据,方便在后续选择对象,得到该扩展数据.、
438
+ *只会对一次的drawEntity调用有效.
439
+ * @returns
440
+ * @example
441
+ * ``` typescript
442
+ *
443
+ * ```
444
+ *
445
+ */
446
+ setXData(xData: any): void;
421
447
  }
422
448
 
423
449
  /**
@@ -553,7 +579,10 @@ declare abstract class MxDbEntity {
553
579
  * }
554
580
  * ```
555
581
  */
556
- abstract dwgIn(obj: any): boolean;
582
+ abstract dwgIn(obj: {
583
+ type: MxType.MxCloneType;
584
+ [x: string]: any;
585
+ }): boolean;
557
586
  /**
558
587
  * 自定义对象数据输出,必须要实现该函数
559
588
  * @param
@@ -568,7 +597,10 @@ declare abstract class MxDbEntity {
568
597
  * }
569
598
  * ```
570
599
  */
571
- abstract dwgOut(obj: any): object;
600
+ abstract dwgOut(obj: {
601
+ type: MxType.MxCloneType;
602
+ [x: string]: any;
603
+ }): object;
572
604
  /**
573
605
  * 自定义实体的矩阵 坐标变换 (需要重写该方法实现如果通过矩阵对自定义实体进行操作 默认不会进行任何操作)
574
606
  * @param _mat THREE.Matrix4 变化矩阵
@@ -581,6 +613,14 @@ declare abstract class MxDbEntity {
581
613
  * @returns void
582
614
  */
583
615
  getGeomExtents(): THREE.Box3 | null;
616
+ /**
617
+ * 对一个点到这个对象的最近点 。
618
+ * iOperationType == 0正常操作求值最近点.
619
+ * iOperationType == 1点选择操作求值最近点.
620
+ * @param
621
+ * @returns void
622
+ */
623
+ getClosestPointTo(pt: THREE.Vector3, iOperationType?: number): THREE.Vector3 | null;
584
624
  private getImp;
585
625
  /**
586
626
  * 更新显示
@@ -901,7 +941,7 @@ interface MxDrawObjectType {
901
941
  addMxCurrentSelect(id: number): void;
902
942
  clearMxCurrentSelect(): boolean;
903
943
  getMxEntityUserObject(id: number): MxDbEntity;
904
- findMxEntityAtPoint(ptMouse: THREE.Vector3): Array<MxDbEntity>;
944
+ findMxEntityAtPoint(ptMouse: THREE.Vector3, isDocCoord?: boolean, retWordDrawXDataCall?: (id: number, data: any) => void): Array<MxDbEntity>;
905
945
  setMouseMiddlePan(isPan: boolean): void;
906
946
  resetThreeJSControls(): void;
907
947
  getAllMxEntity(): Array<MxDbEntity>;
@@ -911,7 +951,7 @@ interface MxDrawObjectType {
911
951
  addViewObject(obj: THREE.Object3D): void;
912
952
  removeViewObject(obj: THREE.Object3D): void;
913
953
  removeObject(obj: THREE.Object3D, isRemoveSelectObject?: boolean): void;
914
- saveMxEntityToJson(): object;
954
+ saveMxEntityToJson(isSaveToDWG?: boolean): object;
915
955
  loadMxEntityFromJson(dataString: object): Promise<boolean>;
916
956
  eraseAllMxEntity(): void;
917
957
  makeCurrent(): void;
@@ -1401,7 +1441,7 @@ declare class MxDrawObject {
1401
1441
  *
1402
1442
  * ```
1403
1443
  */
1404
- findMxEntityAtPoint(ptMouse: THREE.Vector3): Array<MxDbEntity>;
1444
+ findMxEntityAtPoint(ptMouse: THREE.Vector3, isDocCoord?: boolean, retWordDrawXDataCall?: (id: number, data: any) => void): Array<MxDbEntity>;
1405
1445
  /**
1406
1446
  *得到所有用户自绘对象.
1407
1447
  * @returns MxDbEntity[] 返回用户自绘对象数组
@@ -1487,7 +1527,7 @@ declare class MxDrawObject {
1487
1527
  *
1488
1528
  * ```
1489
1529
  */
1490
- saveMxEntityToJson(): string;
1530
+ saveMxEntityToJson(isSaveToDWG?: boolean): string;
1491
1531
  /**
1492
1532
  * 保存所有MxEntity的数据到js对象.
1493
1533
  * @param
@@ -1498,7 +1538,7 @@ declare class MxDrawObject {
1498
1538
  *
1499
1539
  * ```
1500
1540
  */
1501
- saveMxEntityToObject(): object;
1541
+ saveMxEntityToObject(isSaveToDWG?: boolean): object;
1502
1542
  /**
1503
1543
  * 从json字符串恢复MxEntity
1504
1544
  * @param dataString json字符串.
@@ -1694,6 +1734,24 @@ declare class MxDrawObject {
1694
1734
  * ```
1695
1735
  */
1696
1736
  setSysVar(sName: string, val: any): void;
1737
+ /**
1738
+ * 是否是MxCAD模式运行.
1739
+ * @example
1740
+ * ```typescript
1741
+ *
1742
+ *
1743
+ * ```
1744
+ */
1745
+ isMxCAD(): boolean;
1746
+ /**
1747
+ * 得到实执行的内部MxObject对象.
1748
+ * @example
1749
+ * ```typescript
1750
+ *
1751
+ *
1752
+ * ```
1753
+ */
1754
+ getMxObjectImplement(): any;
1697
1755
  }
1698
1756
 
1699
1757
  /**
@@ -2445,6 +2503,16 @@ declare class MxFunClass {
2445
2503
  * ```
2446
2504
  */
2447
2505
  getMxEntity(id: number): MxDbEntity | undefined;
2506
+ /**
2507
+ * 得到当前鼠标位置,返回的是屏幕坐标 。
2508
+ * @returns 返MxDbEntity
2509
+ * @example
2510
+ * ```typescript
2511
+ *
2512
+ *
2513
+ * ```
2514
+ */
2515
+ getCurrentMousePostion(): THREE.Vector2;
2448
2516
  }
2449
2517
  /**
2450
2518
  * MxFun 模块
@@ -2771,7 +2839,7 @@ declare class MrxDbgUtilsClass {
2771
2839
  * @example
2772
2840
  * ```
2773
2841
  */
2774
- findEntAtPoint(pt: THREE.Vector3, filter?: any, mxObj?: MxDrawObject): Promise<number[]>;
2842
+ findEntAtPoint(pt: THREE.Vector3, filter?: any, mxObj?: MxDrawObject, isDocCoord?: boolean, retWordDrawXDataCall?: (id: number, data: any) => void): Promise<number[]>;
2775
2843
  /**
2776
2844
  * 交互选择对象.
2777
2845
  * @param strPrompt 提示字符串
@@ -3124,6 +3192,7 @@ declare class MxDbSVG extends MxDbEntity {
3124
3192
  setSvgChildColor(aryColor: number[]): void;
3125
3193
  getSvgChildColor(): number[];
3126
3194
  private calcVewSize;
3195
+ private calcSvgDrawRect;
3127
3196
  worldDraw(pWorldDraw: McGiWorldDraw): void;
3128
3197
  /**
3129
3198
  * 设置SVG的路径
@@ -3215,22 +3284,22 @@ declare class MxDbPolyline extends MxDbEntity {
3215
3284
 
3216
3285
  declare class MxDb2LineAngularDimension extends MxDbEntity {
3217
3286
  /**
3218
- * MxDb2LineAngularDimension
3219
- * 显示角度测量的图形
3220
- * @param options.points [point1(起始点)、point2(角顶点)、point3(结束点)]
3221
- * @param options.colors [起始线段颜色, 结束线段颜色, 标注角度圆弧颜色, 文字标注的角度颜色]
3222
- * @example
3223
- * ``` typescript
3224
- * const draw = Mx.MxFun.getCurrentDraw();
3225
- * const points = [ getPoint.value(),
3226
- * getPoint.value().add(new THREE.Vector3(8880, 0, 0)),
3227
- * getPoint.value().add(new THREE.Vector3(0, 6666, 0)),
3228
- * ]
3229
- * const colors = ['#F00880','#00ff1a', void 0, 0XFF0000]
3230
- * const obj = new Mx.MxDb2LineAngularDimension().setPoints(points).setColor(colors).setLineWidth(6)
3231
- * draw.addMxEntity(obj)
3232
- * ```
3233
- **/
3287
+ * MxDb2LineAngularDimension
3288
+ * 显示角度测量的图形
3289
+ * @param options.points [point1(起始点)、point2(角顶点)、point3(结束点)]
3290
+ * @param options.colors [起始线段颜色, 结束线段颜色, 标注角度圆弧颜色, 文字标注的角度颜色]
3291
+ * @example
3292
+ * ``` typescript
3293
+ * const draw = Mx.MxFun.getCurrentDraw();
3294
+ * const points = [ getPoint.value(),
3295
+ * getPoint.value().add(new THREE.Vector3(8880, 0, 0)),
3296
+ * getPoint.value().add(new THREE.Vector3(0, 6666, 0)),
3297
+ * ]
3298
+ * const colors = ['#F00880','#00ff1a', void 0, 0XFF0000]
3299
+ * const obj = new Mx.MxDb2LineAngularDimension().setPoints(points).setColor(colors).setLineWidth(6)
3300
+ * draw.addMxEntity(obj)
3301
+ * ```
3302
+ **/
3234
3303
  constructor(options?: {
3235
3304
  /** 传入三个位置THREE向量 分别对应 属性: point1(起始点)、point2(角顶点)、point3(结束点) 计算角度 */
3236
3305
  points?: THREE.Vector3[];
@@ -3255,10 +3324,10 @@ declare class MxDb2LineAngularDimension extends MxDbEntity {
3255
3324
  */
3256
3325
  setPoints(points: THREE.Vector3[]): this;
3257
3326
  /**
3258
- * 设置颜色组合
3259
- * @param colors [起始线段颜色, 结束线段颜色, 标注角度圆弧颜色, 文字标注的角度颜色]
3260
- * 某一项为null或undefined采用绘制颜色 || 单颜色
3261
- * */
3327
+ * 设置颜色组合
3328
+ * @param colors [起始线段颜色, 结束线段颜色, 标注角度圆弧颜色, 文字标注的角度颜色]
3329
+ * 某一项为null或undefined采用绘制颜色 || 单颜色
3330
+ * */
3262
3331
  setColor(colors: UnstableColor[] | MxColorType): this;
3263
3332
  worldDraw(pWorldDraw: McGiWorldDraw): void;
3264
3333
  getGripPoints(): three.Vector3[];
@@ -3494,22 +3563,22 @@ declare class MxDbRect extends MxDbEntity {
3494
3563
  */
3495
3564
  declare class MxDbAlignedDimension extends MxDbEntity {
3496
3565
  /**
3497
- * MxDbAlignedDimension
3498
- * 尺寸标注
3499
- * @param options.points 提供两个向量测量尺寸
3500
- * @param options.fontColor 字体颜色
3501
- * @example ```typescript
3502
- * const draw = Mx.MxFun.getCurrentDraw();
3503
- * const v3 = new THREE.Vector3()
3504
- * const points = [v3 , v3.clone().add(new THREE.Vector3(8880, 0, 0))]
3505
- * const colors = ['#F00880','#00ff1a']
3506
- * draw.addMxEntity(
3507
- * new Mx.MxDbAlignedDimension({ points })
3508
- * .setColor(colors)
3509
- * .setLineWidth(6)
3510
- * )
3511
- * ```
3512
- **/
3566
+ * MxDbAlignedDimension
3567
+ * 尺寸标注
3568
+ * @param options.points 提供两个向量测量尺寸
3569
+ * @param options.fontColor 字体颜色
3570
+ * @example ```typescript
3571
+ * const draw = Mx.MxFun.getCurrentDraw();
3572
+ * const v3 = new THREE.Vector3()
3573
+ * const points = [v3 , v3.clone().add(new THREE.Vector3(8880, 0, 0))]
3574
+ * const colors = ['#F00880','#00ff1a']
3575
+ * draw.addMxEntity(
3576
+ * new Mx.MxDbAlignedDimension({ points })
3577
+ * .setColor(colors)
3578
+ * .setLineWidth(6)
3579
+ * )
3580
+ * ```
3581
+ **/
3513
3582
  constructor(options?: {
3514
3583
  /** [point1, point2] 两个向量位置 */
3515
3584
  points?: THREE.Vector3[];
@@ -3616,7 +3685,7 @@ declare class MxDbAnyLine extends MxDbEntity {
3616
3685
  worldDraw(pWorldDraw: McGiWorldDraw): void;
3617
3686
  /** 设置线段points
3618
3687
  * @param points 构成线段的多个点
3619
- */
3688
+ */
3620
3689
  setPoints(points: THREE.Vector3[]): this;
3621
3690
  /** 获取线段的包围盒的中心点坐标 */
3622
3691
  getCenter(): THREE.Vector3;
@@ -3643,6 +3712,7 @@ declare class MxDbCloudLine extends MxDbEntity {
3643
3712
  * 获取云线的圆弧半径
3644
3713
  * */
3645
3714
  getRadius(): number;
3715
+ getCachePoint(): THREE.Vector3[] | null;
3646
3716
  private clacNewArcDiameterPoint;
3647
3717
  private createCloudArcCurvePoints;
3648
3718
  /**
@@ -3737,6 +3807,7 @@ declare class MxDbRectBoxLeadComment extends MxDbEntity {
3737
3807
  fixedSize: boolean;
3738
3808
  getTypeName(): string;
3739
3809
  create(): MxDbEntity;
3810
+ getCloudLine(): any;
3740
3811
  worldDraw(pWorldDraw: McGiWorldDraw): void;
3741
3812
  getGripPoints(): Array<THREE.Vector3>;
3742
3813
  moveGripPointsAt(index: number, offset: THREE.Vector3): boolean;
@@ -3762,26 +3833,190 @@ declare class MxDbEllipse extends MxDbEntity {
3762
3833
  dwgOut(obj: any): object;
3763
3834
  }
3764
3835
 
3836
+ declare type SpriteTextColorType = THREE.Color | string | number | CanvasGradient | CanvasPattern | undefined;
3837
+ declare type SpriteTextObj = SpriteText;
3838
+ declare class SpriteText extends THREE.Sprite {
3839
+ constructor(options?: SpriteTextOptions);
3840
+ text: string;
3841
+ textHeight: number;
3842
+ color: SpriteTextColorType;
3843
+ backgroundColor: SpriteTextColorType;
3844
+ padding: number | number[];
3845
+ borderWidth: number;
3846
+ borderRadius: number;
3847
+ borderColor: SpriteTextColorType;
3848
+ fontFace: string;
3849
+ fontSize: number;
3850
+ fontWeight: string;
3851
+ strokeWidth: number;
3852
+ strokeColor: SpriteTextColorType;
3853
+ textAlign: CanvasTextAlign;
3854
+ textShadowBlur: number;
3855
+ textShadowColor: string | number | THREE.Color | undefined;
3856
+ textShadowOffsetX: number;
3857
+ textShadowOffsetY: number;
3858
+ angle: number;
3859
+ textScale: number;
3860
+ private _genCanvas;
3861
+ dispose(): void;
3862
+ }
3863
+ interface SpriteTextOptions {
3864
+ text?: string;
3865
+ textHeight?: number;
3866
+ color?: SpriteTextColorType;
3867
+ backgroundColor?: SpriteTextColorType | undefined;
3868
+ padding?: number | number[];
3869
+ borderWidth?: number;
3870
+ borderRadius?: number;
3871
+ borderColor?: SpriteTextColorType;
3872
+ strokeWidth?: number;
3873
+ strokeColor?: SpriteTextColorType;
3874
+ fontFace?: string;
3875
+ fontSize?: number;
3876
+ fontWeight?: string;
3877
+ textAlign?: CanvasTextAlign;
3878
+ textBaseline?: CanvasTextBaseline;
3879
+ textShadowBlur?: number;
3880
+ textShadowColor?: string | number | THREE.Color | undefined;
3881
+ textShadowOffsetX?: number;
3882
+ textShadowOffsetY?: number;
3883
+ angle?: number;
3884
+ scale?: number;
3885
+ }
3886
+
3765
3887
  /**
3766
3888
  * MxDbText 绘制文字
3889
+ * @describe 适用于标签标注类型的文字(永远面向相机的平面)
3890
+ * @example
3891
+ * ``` js
3892
+ * obj = new MxDbText()
3893
+ obj.rxInit()
3894
+ obj.position = new THREE.Vector3()
3895
+ obj.backgroundColor = '#ff0000'
3896
+ obj.padding = 5
3897
+ obj.strokeWidth = 3
3898
+ obj.strokeColor = "#3a8bd2"
3899
+ obj.borderColor = "#ff00ff"
3900
+ obj.borderWidth = 2
3901
+ obj.borderRadius = 2
3902
+ obj.opacity = 0.8
3903
+ obj.text = 'This is\nsome multi-line\ntext'
3904
+ obj.height = 100000
3905
+ obj.color = "#fff000"
3906
+ * ```
3767
3907
  */
3768
3908
  declare class MxDbText extends MxDbEntity {
3769
3909
  /** 文字所在位置*/
3770
3910
  position: three.Vector3;
3911
+ setPosition(position: THREE.Vector3): this;
3912
+ private _text;
3771
3913
  /** 文字内容*/
3772
- text: string;
3914
+ get text(): string;
3915
+ set text(text: string);
3916
+ setText(text: string): this;
3917
+ private _height;
3773
3918
  /** 文字高度*/
3774
- height: number;
3919
+ get height(): number;
3920
+ set height(height: number);
3921
+ setHeight(height: number): this;
3922
+ private _backgroundColor;
3923
+ /** 背景颜色 */
3924
+ get backgroundColor(): SpriteTextColorType;
3925
+ set backgroundColor(color: SpriteTextColorType);
3926
+ setBackgroundColor(backgroundColor: SpriteTextColorType): this;
3927
+ private _padding;
3928
+ /** 填充范围 */
3929
+ get padding(): number | number[];
3930
+ set padding(padding: number | number[]);
3931
+ setPadding(padding: number | number[]): this;
3932
+ private _borderWidth;
3933
+ /** 边框宽度 */
3934
+ get borderWidth(): number;
3935
+ set borderWidth(borderWidth: number);
3936
+ setBorderWidth(borderWidth: number): this;
3937
+ private _borderRadius;
3938
+ /** 边框圆角 */
3939
+ get borderRadius(): number;
3940
+ set borderRadius(borderRadius: number);
3941
+ setBorderRadius(borderRadius: number): this;
3942
+ private _borderColor;
3943
+ /** 边框颜色 */
3944
+ get borderColor(): SpriteTextColorType;
3945
+ set borderColor(borderColor: SpriteTextColorType);
3946
+ setBorderColor(borderColor: SpriteTextColorType): this;
3947
+ private _fontFace;
3948
+ /** 字体 */
3949
+ get fontFace(): string;
3950
+ set fontFace(fontFace: string);
3951
+ setFontFace(fontFace: string): this;
3952
+ private _fontSize;
3953
+ /** 字体大小 */
3954
+ get fontSize(): number;
3955
+ set fontSize(fontSize: number);
3956
+ setFontSize(fontSize: number): this;
3957
+ private _fontWeight;
3958
+ /** 字体粗细 */
3959
+ get fontWeight(): string;
3960
+ set fontWeight(fontWeight: string);
3961
+ setFontWeight(fontWeight: string): this;
3962
+ private _strokeWidth;
3963
+ /** 笔划宽度 */
3964
+ get strokeWidth(): number;
3965
+ set strokeWidth(strokeWidth: number);
3966
+ setStrokeWidth(strokeWidth: number): this;
3967
+ private _strokeColor;
3968
+ /** 笔划颜色 */
3969
+ get strokeColor(): SpriteTextColorType;
3970
+ set strokeColor(strokeColor: SpriteTextColorType);
3971
+ setStrokeColor(strokeColor: SpriteTextColorType): this;
3972
+ private _textAlign;
3973
+ /** 文本格式 */
3974
+ get textAlign(): CanvasTextAlign;
3975
+ set textAlign(textAlign: CanvasTextAlign);
3976
+ setTextAlign(textAlign: CanvasTextAlign): this;
3977
+ private _textShadowBlur;
3978
+ /** 文字阴影模糊程度 */
3979
+ get textShadowBlur(): number;
3980
+ set textShadowBlur(textShadowBlur: number);
3981
+ setTextShadowBlur(textShadowBlur: number): this;
3982
+ private _textShadowColor;
3983
+ /** 文字阴影颜色*/
3984
+ get textShadowColor(): string | number | Color | undefined;
3985
+ set textShadowColor(textShadowColor: string | number | Color | undefined);
3986
+ setTextShadowColor(textShadowColor: string | number | Color | undefined): this;
3987
+ private _textShadowOffsetX;
3988
+ /** 文字阴影X轴偏移量 */
3989
+ get textShadowOffsetX(): number;
3990
+ set textShadowOffsetX(textShadowOffsetX: number);
3991
+ setTextShadowOffsetX(textShadowOffsetX: number): this;
3992
+ private _textShadowOffsetY;
3993
+ /** 文字阴影X轴偏移量 */
3994
+ get textShadowOffsetY(): number;
3995
+ set textShadowOffsetY(textShadowOffsetY: number);
3996
+ setTextShadowOffsetY(textShadowOffsetY: number): this;
3997
+ private _angle;
3775
3998
  /** 角度*/
3776
- angle: number;
3999
+ get angle(): number;
4000
+ set angle(angle: number);
4001
+ setAngle(angle: number): this;
4002
+ private _scale;
4003
+ /** 缩放倍数 */
4004
+ get scale(): number;
4005
+ set scale(scale: number);
4006
+ setScale(scale: number): this;
4007
+ /** SpriteText实例 */
4008
+ protected spriteText: SpriteTextObj;
3777
4009
  getTypeName(): string;
3778
4010
  worldDraw(pWorldDraw: McGiWorldDraw): void;
4011
+ /**创建精灵文字对象 */
4012
+ protected createSpriteText(): void;
3779
4013
  getGripPoints(): THREE.Vector3[];
3780
4014
  moveGripPointsAt(index: number, offset: THREE.Vector3): boolean;
3781
4015
  create(): MxDbEntity;
3782
4016
  dwgIn(obj: any): boolean;
3783
4017
  dwgOut(obj: any): object;
3784
4018
  getGeomExtents(): THREE.Box3 | null;
4019
+ erase(): boolean;
3785
4020
  }
3786
4021
 
3787
4022
  /**
@@ -3832,13 +4067,13 @@ declare class MxDbGradientLine extends MxDbEntity {
3832
4067
  * 当curveType为catmullrom时,定义catmullrom的张力。 张力: 数值越大,曲线越弯曲。值为0将导致没有插值。默认值是0
3833
4068
  * @access public
3834
4069
  *
3835
- */
4070
+ */
3836
4071
  tension: number;
3837
4072
  /**
3838
4073
  * 如果没有提供张力,但bezierType赋值为'quadratic'| 'cubic',则使用点集合中的点绘制一条bezier线 默认: undefined
3839
4074
  * @summary quadratic: 三维二次贝塞尔曲线 => 起点 – 中间的控制点 – 终点
3840
4075
  * @summary cubic: 三维三次贝塞尔曲线 => 起点v – 第一个控制点 – 第二个控制点 – 终点
3841
- */
4076
+ */
3842
4077
  bezierType: 'quadratic' | 'cubic' | undefined;
3843
4078
  protected curve?: THREE.CatmullRomCurve3 | THREE.CurvePath<THREE.Vector3>;
3844
4079
  create(): MxDbGradientLine;
@@ -3846,9 +4081,9 @@ declare class MxDbGradientLine extends MxDbEntity {
3846
4081
  setPoints(points: THREE.Vector3[]): this;
3847
4082
  setColors(colors: (THREE.Color | string | number)[]): this;
3848
4083
  addColor(color: THREE.Color): this;
3849
- setLinecap(linecap: "butt" | "round" | "square"): void;
4084
+ setLinecap(linecap: 'butt' | 'round' | 'square'): void;
3850
4085
  setClosed(closed: boolean): void;
3851
- setCurveType(curveType: "chordal" | "centripetal" | "catmullrom"): void;
4086
+ setCurveType(curveType: 'chordal' | 'centripetal' | 'catmullrom'): void;
3852
4087
  setTension(tension: number): void;
3853
4088
  setBezierType(bezierType: 'quadratic' | 'cubic'): void;
3854
4089
  worldDraw(pWorldDraw: McGiWorldDraw): void;
@@ -3865,6 +4100,7 @@ declare const Mx_useCanvasResizeListener: typeof useCanvasResizeListener;
3865
4100
  declare const Mx_store: typeof store;
3866
4101
  declare const Mx_MxFun: typeof MxFun;
3867
4102
  declare const Mx_MxThreeJS: typeof MxThreeJS;
4103
+ declare const Mx_MxType: typeof MxType;
3868
4104
  declare const Mx_Mxassembly: typeof Mxassembly;
3869
4105
  declare const Mx_McGeTool: typeof McGeTool;
3870
4106
  declare const Mx_MrxDbgUtils: typeof MrxDbgUtils;
@@ -3940,7 +4176,7 @@ declare namespace Mx {
3940
4176
  Mx_store as store,
3941
4177
  Mx_MxFun as MxFun,
3942
4178
  Mx_MxThreeJS as MxThreeJS,
3943
- _default as MxType,
4179
+ Mx_MxType as MxType,
3944
4180
  Mx_Mxassembly as Mxassembly,
3945
4181
  Mx_McGeTool as McGeTool,
3946
4182
  Mx_MrxDbgUtils as MrxDbgUtils,
@@ -3982,4 +4218,4 @@ declare namespace Mx {
3982
4218
  };
3983
4219
  }
3984
4220
 
3985
- 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 };
4221
+ 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, MxType, Mxassembly, Mx as default, loadCoreCode, store, useCanvasResizeListener };
@@ -283,4 +283,15 @@ export default interface McGiWorldDraw {
283
283
  *
284
284
  */
285
285
  setupForEntity(ent: MxDbEntity): void;
286
+ /**
287
+ *设置drawEntity函数,绘制的three.js对象,附加一个扩展数据,方便在后续选择对象,得到该扩展数据.、
288
+ *只会对一次的drawEntity调用有效.
289
+ * @returns
290
+ * @example
291
+ * ``` typescript
292
+ *
293
+ * ```
294
+ *
295
+ */
296
+ setXData(xData: any): void;
286
297
  }
@@ -16,7 +16,7 @@ declare class MrxDbgUtilsClass {
16
16
  * @example
17
17
  * ```
18
18
  */
19
- findEntAtPoint(pt: THREE.Vector3, filter?: any, mxObj?: MxDrawObject): Promise<number[]>;
19
+ findEntAtPoint(pt: THREE.Vector3, filter?: any, mxObj?: MxDrawObject, isDocCoord?: boolean, retWordDrawXDataCall?: (id: number, data: any) => void): Promise<number[]>;
20
20
  /**
21
21
  * 交互选择对象.
22
22
  * @param strPrompt 提示字符串
@@ -1 +1 @@
1
- import MxFun from"../MxFun";import store from"../store";class MrxDbgUtilsClass{constructor(){this.imp=null}initImp(){if(!this.imp&&store.state.MxFun){let t=store.state.MxFun;this.imp=new t.getMrxDbgUtilsClass}}findEntAtPoint(t,i=null,s){return this.initImp(),s||(s=MxFun.getCurrentDraw()),this.imp.findEntAtPoint(s,t,i)}selectEnt(t,i){return this.initImp(),this.imp.selectEnt(t)}}const MrxDbgUtils=new MrxDbgUtilsClass;export default MrxDbgUtils;
1
+ import MxFun from"../MxFun";import store from"../store";class MrxDbgUtilsClass{constructor(){this.imp=null}initImp(){if(!this.imp&&store.state.MxFun){let t=store.state.MxFun;this.imp=new t.getMrxDbgUtilsClass}}findEntAtPoint(t,i=null,s,n=!0,e){return this.initImp(),s||(s=MxFun.getCurrentDraw()),this.imp.findEntAtPoint(s.getMxObjectImplement(),t,i,n,e)}selectEnt(t,i){return this.initImp(),this.imp.selectEnt(t)}}const MrxDbgUtils=new MrxDbgUtilsClass;export default MrxDbgUtils;
@@ -3,22 +3,22 @@ import MxDbEntity from '../MxDbEntity';
3
3
  import { MxColorType, UnstableColor } from '../MxType';
4
4
  export default class MxDb2LineAngularDimension extends MxDbEntity {
5
5
  /**
6
- * MxDb2LineAngularDimension
7
- * 显示角度测量的图形
8
- * @param options.points [point1(起始点)、point2(角顶点)、point3(结束点)]
9
- * @param options.colors [起始线段颜色, 结束线段颜色, 标注角度圆弧颜色, 文字标注的角度颜色]
10
- * @example
11
- * ``` typescript
12
- * const draw = Mx.MxFun.getCurrentDraw();
13
- * const points = [ getPoint.value(),
14
- * getPoint.value().add(new THREE.Vector3(8880, 0, 0)),
15
- * getPoint.value().add(new THREE.Vector3(0, 6666, 0)),
16
- * ]
17
- * const colors = ['#F00880','#00ff1a', void 0, 0XFF0000]
18
- * const obj = new Mx.MxDb2LineAngularDimension().setPoints(points).setColor(colors).setLineWidth(6)
19
- * draw.addMxEntity(obj)
20
- * ```
21
- **/
6
+ * MxDb2LineAngularDimension
7
+ * 显示角度测量的图形
8
+ * @param options.points [point1(起始点)、point2(角顶点)、point3(结束点)]
9
+ * @param options.colors [起始线段颜色, 结束线段颜色, 标注角度圆弧颜色, 文字标注的角度颜色]
10
+ * @example
11
+ * ``` typescript
12
+ * const draw = Mx.MxFun.getCurrentDraw();
13
+ * const points = [ getPoint.value(),
14
+ * getPoint.value().add(new THREE.Vector3(8880, 0, 0)),
15
+ * getPoint.value().add(new THREE.Vector3(0, 6666, 0)),
16
+ * ]
17
+ * const colors = ['#F00880','#00ff1a', void 0, 0XFF0000]
18
+ * const obj = new Mx.MxDb2LineAngularDimension().setPoints(points).setColor(colors).setLineWidth(6)
19
+ * draw.addMxEntity(obj)
20
+ * ```
21
+ **/
22
22
  constructor(options?: {
23
23
  /** 传入三个位置THREE向量 分别对应 属性: point1(起始点)、point2(角顶点)、point3(结束点) 计算角度 */
24
24
  points?: THREE.Vector3[];
@@ -43,10 +43,10 @@ export default class MxDb2LineAngularDimension extends MxDbEntity {
43
43
  */
44
44
  setPoints(points: THREE.Vector3[]): this;
45
45
  /**
46
- * 设置颜色组合
47
- * @param colors [起始线段颜色, 结束线段颜色, 标注角度圆弧颜色, 文字标注的角度颜色]
48
- * 某一项为null或undefined采用绘制颜色 || 单颜色
49
- * */
46
+ * 设置颜色组合
47
+ * @param colors [起始线段颜色, 结束线段颜色, 标注角度圆弧颜色, 文字标注的角度颜色]
48
+ * 某一项为null或undefined采用绘制颜色 || 单颜色
49
+ * */
50
50
  setColor(colors: UnstableColor[] | MxColorType): this;
51
51
  worldDraw(pWorldDraw: McGiWorldDraw): void;
52
52
  getGripPoints(): import("three").Vector3[];