mxdraw 0.1.113 → 0.1.115

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 (34) hide show
  1. package/dist/index.d.ts +290 -58
  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/MxDbEntity/index.d.ts +17 -3
  9. package/dist/lib/MxModule/MxDbEntity/index.js +1 -1
  10. package/dist/lib/MxModule/MxDbGradientLine/index.d.ts +6 -6
  11. package/dist/lib/MxModule/MxDbSVG/index.d.ts +1 -0
  12. package/dist/lib/MxModule/MxDbSVG/index.js +1 -1
  13. package/dist/lib/MxModule/MxDbText/MxDbText.d.ts +138 -0
  14. package/dist/lib/MxModule/MxDbText/MxDbText.js +1 -0
  15. package/dist/lib/MxModule/MxDbText/MxDbText_old.d.ts +23 -0
  16. package/dist/lib/MxModule/MxDbText/MxDbText_old.js +1 -0
  17. package/dist/lib/MxModule/MxDbText/SpriteText.d.ts +54 -0
  18. package/dist/lib/MxModule/MxDbText/SpriteText.js +1 -0
  19. package/dist/lib/MxModule/MxDbText/index.d.ts +2 -23
  20. package/dist/lib/MxModule/MxDbText/index.js +1 -1
  21. package/dist/lib/MxModule/MxDrawObject/index.d.ts +20 -2
  22. package/dist/lib/MxModule/MxDrawObject/index.js +1 -1
  23. package/dist/lib/MxModule/MxFun/index.d.ts +10 -0
  24. package/dist/lib/MxModule/MxFun/index.js +1 -1
  25. package/dist/lib/MxModule/MxType/MxType.d.ts +2 -9
  26. package/dist/lib/MxModule/MxType/MxType.js +1 -1
  27. package/dist/lib/MxModule/MxType/index.d.ts +3 -47
  28. package/dist/lib/MxModule/MxType/index.js +1 -1
  29. package/dist/lib/MxModule/loadCoreCode/mxfun.es5.js +1 -1
  30. package/dist/lib/tools/three/index.d.ts +19 -0
  31. package/dist/lib/tools/three/index.js +1 -1
  32. package/dist/mxdraw.es.js +1 -1
  33. package/dist/mxdraw.umd.js +1 -1
  34. 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
@@ -131,12 +131,25 @@ declare enum InputToucheType {
131
131
  kGetEnd = 2
132
132
  }
133
133
  declare type MxColorType = number | string | THREE.Color;
134
- declare type UnstableColor = MxColorType | undefined;
135
- declare const _default: {
136
- MxCloneType: typeof MxCloneType;
137
- MxDefaultRenderOrder: typeof MxDefaultRenderOrder;
138
- InputToucheType: typeof InputToucheType;
139
- };
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
+ }
140
153
 
141
154
  /** @module McGiWorldDraw*/
142
155
 
@@ -420,6 +433,17 @@ interface McGiWorldDraw {
420
433
  *
421
434
  */
422
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;
423
447
  }
424
448
 
425
449
  /**
@@ -555,7 +579,10 @@ declare abstract class MxDbEntity {
555
579
  * }
556
580
  * ```
557
581
  */
558
- abstract dwgIn(obj: any): boolean;
582
+ abstract dwgIn(obj: {
583
+ type: MxType.MxCloneType;
584
+ [x: string]: any;
585
+ }): boolean;
559
586
  /**
560
587
  * 自定义对象数据输出,必须要实现该函数
561
588
  * @param
@@ -570,7 +597,10 @@ declare abstract class MxDbEntity {
570
597
  * }
571
598
  * ```
572
599
  */
573
- abstract dwgOut(obj: any): object;
600
+ abstract dwgOut(obj: {
601
+ type: MxType.MxCloneType;
602
+ [x: string]: any;
603
+ }): object;
574
604
  /**
575
605
  * 自定义实体的矩阵 坐标变换 (需要重写该方法实现如果通过矩阵对自定义实体进行操作 默认不会进行任何操作)
576
606
  * @param _mat THREE.Matrix4 变化矩阵
@@ -583,6 +613,14 @@ declare abstract class MxDbEntity {
583
613
  * @returns void
584
614
  */
585
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;
586
624
  private getImp;
587
625
  /**
588
626
  * 更新显示
@@ -903,7 +941,7 @@ interface MxDrawObjectType {
903
941
  addMxCurrentSelect(id: number): void;
904
942
  clearMxCurrentSelect(): boolean;
905
943
  getMxEntityUserObject(id: number): MxDbEntity;
906
- findMxEntityAtPoint(ptMouse: THREE.Vector3): Array<MxDbEntity>;
944
+ findMxEntityAtPoint(ptMouse: THREE.Vector3, isDocCoord?: boolean, retWordDrawXDataCall?: (id: number, data: any) => void): Array<MxDbEntity>;
907
945
  setMouseMiddlePan(isPan: boolean): void;
908
946
  resetThreeJSControls(): void;
909
947
  getAllMxEntity(): Array<MxDbEntity>;
@@ -1403,7 +1441,7 @@ declare class MxDrawObject {
1403
1441
  *
1404
1442
  * ```
1405
1443
  */
1406
- findMxEntityAtPoint(ptMouse: THREE.Vector3): Array<MxDbEntity>;
1444
+ findMxEntityAtPoint(ptMouse: THREE.Vector3, isDocCoord?: boolean, retWordDrawXDataCall?: (id: number, data: any) => void): Array<MxDbEntity>;
1407
1445
  /**
1408
1446
  *得到所有用户自绘对象.
1409
1447
  * @returns MxDbEntity[] 返回用户自绘对象数组
@@ -1696,6 +1734,24 @@ declare class MxDrawObject {
1696
1734
  * ```
1697
1735
  */
1698
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;
1699
1755
  }
1700
1756
 
1701
1757
  /**
@@ -2447,6 +2503,16 @@ declare class MxFunClass {
2447
2503
  * ```
2448
2504
  */
2449
2505
  getMxEntity(id: number): MxDbEntity | undefined;
2506
+ /**
2507
+ * 得到当前鼠标位置,返回的是屏幕坐标 。
2508
+ * @returns 返MxDbEntity
2509
+ * @example
2510
+ * ```typescript
2511
+ *
2512
+ *
2513
+ * ```
2514
+ */
2515
+ getCurrentMousePostion(): THREE.Vector3;
2450
2516
  }
2451
2517
  /**
2452
2518
  * MxFun 模块
@@ -2773,7 +2839,7 @@ declare class MrxDbgUtilsClass {
2773
2839
  * @example
2774
2840
  * ```
2775
2841
  */
2776
- 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[]>;
2777
2843
  /**
2778
2844
  * 交互选择对象.
2779
2845
  * @param strPrompt 提示字符串
@@ -3126,6 +3192,7 @@ declare class MxDbSVG extends MxDbEntity {
3126
3192
  setSvgChildColor(aryColor: number[]): void;
3127
3193
  getSvgChildColor(): number[];
3128
3194
  private calcVewSize;
3195
+ private calcSvgDrawRect;
3129
3196
  worldDraw(pWorldDraw: McGiWorldDraw): void;
3130
3197
  /**
3131
3198
  * 设置SVG的路径
@@ -3217,22 +3284,22 @@ declare class MxDbPolyline extends MxDbEntity {
3217
3284
 
3218
3285
  declare class MxDb2LineAngularDimension extends MxDbEntity {
3219
3286
  /**
3220
- * MxDb2LineAngularDimension
3221
- * 显示角度测量的图形
3222
- * @param options.points [point1(起始点)、point2(角顶点)、point3(结束点)]
3223
- * @param options.colors [起始线段颜色, 结束线段颜色, 标注角度圆弧颜色, 文字标注的角度颜色]
3224
- * @example
3225
- * ``` typescript
3226
- * const draw = Mx.MxFun.getCurrentDraw();
3227
- * const points = [ getPoint.value(),
3228
- * getPoint.value().add(new THREE.Vector3(8880, 0, 0)),
3229
- * getPoint.value().add(new THREE.Vector3(0, 6666, 0)),
3230
- * ]
3231
- * const colors = ['#F00880','#00ff1a', void 0, 0XFF0000]
3232
- * const obj = new Mx.MxDb2LineAngularDimension().setPoints(points).setColor(colors).setLineWidth(6)
3233
- * draw.addMxEntity(obj)
3234
- * ```
3235
- **/
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
+ **/
3236
3303
  constructor(options?: {
3237
3304
  /** 传入三个位置THREE向量 分别对应 属性: point1(起始点)、point2(角顶点)、point3(结束点) 计算角度 */
3238
3305
  points?: THREE.Vector3[];
@@ -3257,10 +3324,10 @@ declare class MxDb2LineAngularDimension extends MxDbEntity {
3257
3324
  */
3258
3325
  setPoints(points: THREE.Vector3[]): this;
3259
3326
  /**
3260
- * 设置颜色组合
3261
- * @param colors [起始线段颜色, 结束线段颜色, 标注角度圆弧颜色, 文字标注的角度颜色]
3262
- * 某一项为null或undefined采用绘制颜色 || 单颜色
3263
- * */
3327
+ * 设置颜色组合
3328
+ * @param colors [起始线段颜色, 结束线段颜色, 标注角度圆弧颜色, 文字标注的角度颜色]
3329
+ * 某一项为null或undefined采用绘制颜色 || 单颜色
3330
+ * */
3264
3331
  setColor(colors: UnstableColor[] | MxColorType): this;
3265
3332
  worldDraw(pWorldDraw: McGiWorldDraw): void;
3266
3333
  getGripPoints(): three.Vector3[];
@@ -3496,22 +3563,22 @@ declare class MxDbRect extends MxDbEntity {
3496
3563
  */
3497
3564
  declare class MxDbAlignedDimension extends MxDbEntity {
3498
3565
  /**
3499
- * MxDbAlignedDimension
3500
- * 尺寸标注
3501
- * @param options.points 提供两个向量测量尺寸
3502
- * @param options.fontColor 字体颜色
3503
- * @example ```typescript
3504
- * const draw = Mx.MxFun.getCurrentDraw();
3505
- * const v3 = new THREE.Vector3()
3506
- * const points = [v3 , v3.clone().add(new THREE.Vector3(8880, 0, 0))]
3507
- * const colors = ['#F00880','#00ff1a']
3508
- * draw.addMxEntity(
3509
- * new Mx.MxDbAlignedDimension({ points })
3510
- * .setColor(colors)
3511
- * .setLineWidth(6)
3512
- * )
3513
- * ```
3514
- **/
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
+ **/
3515
3582
  constructor(options?: {
3516
3583
  /** [point1, point2] 两个向量位置 */
3517
3584
  points?: THREE.Vector3[];
@@ -3618,7 +3685,7 @@ declare class MxDbAnyLine extends MxDbEntity {
3618
3685
  worldDraw(pWorldDraw: McGiWorldDraw): void;
3619
3686
  /** 设置线段points
3620
3687
  * @param points 构成线段的多个点
3621
- */
3688
+ */
3622
3689
  setPoints(points: THREE.Vector3[]): this;
3623
3690
  /** 获取线段的包围盒的中心点坐标 */
3624
3691
  getCenter(): THREE.Vector3;
@@ -3766,26 +3833,190 @@ declare class MxDbEllipse extends MxDbEntity {
3766
3833
  dwgOut(obj: any): object;
3767
3834
  }
3768
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
+
3769
3887
  /**
3770
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
+ * ```
3771
3907
  */
3772
3908
  declare class MxDbText extends MxDbEntity {
3773
3909
  /** 文字所在位置*/
3774
3910
  position: three.Vector3;
3911
+ setPosition(position: THREE.Vector3): this;
3912
+ private _text;
3775
3913
  /** 文字内容*/
3776
- text: string;
3914
+ get text(): string;
3915
+ set text(text: string);
3916
+ setText(text: string): this;
3917
+ private _height;
3777
3918
  /** 文字高度*/
3778
- 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;
3779
3998
  /** 角度*/
3780
- 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;
3781
4009
  getTypeName(): string;
3782
4010
  worldDraw(pWorldDraw: McGiWorldDraw): void;
4011
+ /**创建精灵文字对象 */
4012
+ protected createSpriteText(): void;
3783
4013
  getGripPoints(): THREE.Vector3[];
3784
4014
  moveGripPointsAt(index: number, offset: THREE.Vector3): boolean;
3785
4015
  create(): MxDbEntity;
3786
4016
  dwgIn(obj: any): boolean;
3787
4017
  dwgOut(obj: any): object;
3788
4018
  getGeomExtents(): THREE.Box3 | null;
4019
+ erase(): boolean;
3789
4020
  }
3790
4021
 
3791
4022
  /**
@@ -3836,13 +4067,13 @@ declare class MxDbGradientLine extends MxDbEntity {
3836
4067
  * 当curveType为catmullrom时,定义catmullrom的张力。 张力: 数值越大,曲线越弯曲。值为0将导致没有插值。默认值是0
3837
4068
  * @access public
3838
4069
  *
3839
- */
4070
+ */
3840
4071
  tension: number;
3841
4072
  /**
3842
4073
  * 如果没有提供张力,但bezierType赋值为'quadratic'| 'cubic',则使用点集合中的点绘制一条bezier线 默认: undefined
3843
4074
  * @summary quadratic: 三维二次贝塞尔曲线 => 起点 – 中间的控制点 – 终点
3844
4075
  * @summary cubic: 三维三次贝塞尔曲线 => 起点v – 第一个控制点 – 第二个控制点 – 终点
3845
- */
4076
+ */
3846
4077
  bezierType: 'quadratic' | 'cubic' | undefined;
3847
4078
  protected curve?: THREE.CatmullRomCurve3 | THREE.CurvePath<THREE.Vector3>;
3848
4079
  create(): MxDbGradientLine;
@@ -3850,9 +4081,9 @@ declare class MxDbGradientLine extends MxDbEntity {
3850
4081
  setPoints(points: THREE.Vector3[]): this;
3851
4082
  setColors(colors: (THREE.Color | string | number)[]): this;
3852
4083
  addColor(color: THREE.Color): this;
3853
- setLinecap(linecap: "butt" | "round" | "square"): void;
4084
+ setLinecap(linecap: 'butt' | 'round' | 'square'): void;
3854
4085
  setClosed(closed: boolean): void;
3855
- setCurveType(curveType: "chordal" | "centripetal" | "catmullrom"): void;
4086
+ setCurveType(curveType: 'chordal' | 'centripetal' | 'catmullrom'): void;
3856
4087
  setTension(tension: number): void;
3857
4088
  setBezierType(bezierType: 'quadratic' | 'cubic'): void;
3858
4089
  worldDraw(pWorldDraw: McGiWorldDraw): void;
@@ -3869,6 +4100,7 @@ declare const Mx_useCanvasResizeListener: typeof useCanvasResizeListener;
3869
4100
  declare const Mx_store: typeof store;
3870
4101
  declare const Mx_MxFun: typeof MxFun;
3871
4102
  declare const Mx_MxThreeJS: typeof MxThreeJS;
4103
+ declare const Mx_MxType: typeof MxType;
3872
4104
  declare const Mx_Mxassembly: typeof Mxassembly;
3873
4105
  declare const Mx_McGeTool: typeof McGeTool;
3874
4106
  declare const Mx_MrxDbgUtils: typeof MrxDbgUtils;
@@ -3944,7 +4176,7 @@ declare namespace Mx {
3944
4176
  Mx_store as store,
3945
4177
  Mx_MxFun as MxFun,
3946
4178
  Mx_MxThreeJS as MxThreeJS,
3947
- _default as MxType,
4179
+ Mx_MxType as MxType,
3948
4180
  Mx_Mxassembly as Mxassembly,
3949
4181
  Mx_McGeTool as McGeTool,
3950
4182
  Mx_MrxDbgUtils as MrxDbgUtils,
@@ -3986,4 +4218,4 @@ declare namespace Mx {
3986
4218
  };
3987
4219
  }
3988
4220
 
3989
- 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[];
@@ -7,22 +7,22 @@ import { MxColorType, UnstableColor } from '../MxType';
7
7
  */
8
8
  export default class MxDbAlignedDimension extends MxDbEntity {
9
9
  /**
10
- * MxDbAlignedDimension
11
- * 尺寸标注
12
- * @param options.points 提供两个向量测量尺寸
13
- * @param options.fontColor 字体颜色
14
- * @example ```typescript
15
- * const draw = Mx.MxFun.getCurrentDraw();
16
- * const v3 = new THREE.Vector3()
17
- * const points = [v3 , v3.clone().add(new THREE.Vector3(8880, 0, 0))]
18
- * const colors = ['#F00880','#00ff1a']
19
- * draw.addMxEntity(
20
- * new Mx.MxDbAlignedDimension({ points })
21
- * .setColor(colors)
22
- * .setLineWidth(6)
23
- * )
24
- * ```
25
- **/
10
+ * MxDbAlignedDimension
11
+ * 尺寸标注
12
+ * @param options.points 提供两个向量测量尺寸
13
+ * @param options.fontColor 字体颜色
14
+ * @example ```typescript
15
+ * const draw = Mx.MxFun.getCurrentDraw();
16
+ * const v3 = new THREE.Vector3()
17
+ * const points = [v3 , v3.clone().add(new THREE.Vector3(8880, 0, 0))]
18
+ * const colors = ['#F00880','#00ff1a']
19
+ * draw.addMxEntity(
20
+ * new Mx.MxDbAlignedDimension({ points })
21
+ * .setColor(colors)
22
+ * .setLineWidth(6)
23
+ * )
24
+ * ```
25
+ **/
26
26
  constructor(options?: {
27
27
  /** [point1, point2] 两个向量位置 */
28
28
  points?: THREE.Vector3[];
@@ -13,7 +13,7 @@ export default class MxDbAnyLine extends MxDbEntity {
13
13
  worldDraw(pWorldDraw: McGiWorldDraw): void;
14
14
  /** 设置线段points
15
15
  * @param points 构成线段的多个点
16
- */
16
+ */
17
17
  setPoints(points: THREE.Vector3[]): this;
18
18
  /** 获取线段的包围盒的中心点坐标 */
19
19
  getCenter(): THREE.Vector3;