mxdraw 0.1.121 → 0.1.122

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 (29) hide show
  1. package/dist/index.d.ts +191 -114
  2. package/dist/lib/MxModule/MxDbArcShape/index.d.ts +1 -1
  3. package/dist/lib/MxModule/MxDbArcShapeDraw/index.d.ts +1 -1
  4. package/dist/lib/MxModule/MxDbArrow/index.d.ts +20 -0
  5. package/dist/lib/MxModule/MxDbArrow/index.js +1 -0
  6. package/dist/lib/MxModule/MxDbCircleArc/index.d.ts +1 -1
  7. package/dist/lib/MxModule/MxDbEllipseArc/index.d.ts +3 -3
  8. package/dist/lib/MxModule/MxDbEllipseShape/index.d.ts +3 -0
  9. package/dist/lib/MxModule/MxDbEllipseShape/index.js +1 -1
  10. package/dist/lib/MxModule/MxDbLineShape/index.d.ts +21 -0
  11. package/dist/lib/MxModule/MxDbLineShape/index.js +1 -0
  12. package/dist/lib/MxModule/MxDbRegularPolygon/index.d.ts +6 -8
  13. package/dist/lib/MxModule/MxDbRegularPolygon/index.js +1 -1
  14. package/dist/lib/MxModule/MxDbRegularPolygonShape/index.d.ts +2 -1
  15. package/dist/lib/MxModule/MxDbRegularPolygonShape/index.js +1 -1
  16. package/dist/lib/MxModule/MxDbShape/index.d.ts +23 -3
  17. package/dist/lib/MxModule/MxDbShape/index.js +1 -1
  18. package/dist/lib/MxModule/MxDbStarShape/index.d.ts +1 -1
  19. package/dist/lib/MxModule/MxDbText/SpriteText.d.ts +1 -1
  20. package/dist/lib/MxModule/MxDrawObject/index.d.ts +1 -1
  21. package/dist/lib/MxModule/MxFilters/index.d.ts +4 -0
  22. package/dist/lib/MxModule/MxFilters/index.js +1 -1
  23. package/dist/lib/MxModule/loadCoreCode/mxfun.es5.js +1 -1
  24. package/dist/lib/index.d.ts +6 -0
  25. package/dist/lib/mxdraw.d.ts +2 -0
  26. package/dist/lib/mxdraw.js +1 -1
  27. package/dist/mxdraw.es.js +1 -1
  28. package/dist/mxdraw.umd.js +1 -1
  29. package/package.json +3 -1
package/dist/index.d.ts CHANGED
@@ -1754,7 +1754,7 @@ declare class MxDrawObject {
1754
1754
  */
1755
1755
  isMxCAD(): boolean;
1756
1756
  /**
1757
- * 得到实执行的内部MxObject对象.
1757
+ * 得执行的内部MxObject对象.
1758
1758
  * @example
1759
1759
  * ```typescript
1760
1760
  *
@@ -3375,13 +3375,113 @@ declare class MxDb2LineAngularDimension extends MxDbEntity {
3375
3375
  getTypeName(): string;
3376
3376
  }
3377
3377
 
3378
+ /** 简单颜色滤镜矩阵 */
3379
+ interface ChannelParamTypes {
3380
+ r?: number;
3381
+ g?: number;
3382
+ b?: number;
3383
+ }
3384
+ declare class MxFilters {
3385
+ private uniformObj;
3386
+ private filtersStr;
3387
+ private filtersTypes;
3388
+ private VSHADER_SOURCE;
3389
+ private FSHADER_SOURCE;
3390
+ private _matrix;
3391
+ /**
3392
+ * 过滤或增强某个颜色通道
3393
+ * @param {ChannelParamTypes}
3394
+ * */
3395
+ channel({ r, g, b }: ChannelParamTypes): this;
3396
+ /**
3397
+ * 改变亮度
3398
+ * @param {number} p
3399
+ * p = 0 全暗,p > 0 且 p < 1 调暗,p = 1 原色, p > 1 调亮
3400
+ * */
3401
+ brightness(p: number): this;
3402
+ /**
3403
+ * 饱和度
3404
+ * @param {number} p
3405
+ * p = 0 完全灰度化,p = 1 原色,p > 1 增强饱和度
3406
+ * */
3407
+ saturate(p: number): this;
3408
+ /**
3409
+ * 对比度
3410
+ * @param {number} p
3411
+ * p = 1 原色, p < 1 减弱对比度,p > 1 增强对比度
3412
+ * */
3413
+ contrast(p: number): this;
3414
+ /**
3415
+ * 透明度
3416
+ * @param {number} p
3417
+ * p = 0 全透明,p = 1 原色
3418
+ * */
3419
+ opacity(p: number): this;
3420
+ /**
3421
+ * 反色
3422
+ * @param {number} p
3423
+ * p = 0 原色, p = 1 完全反色
3424
+ * */
3425
+ invert(p: number): this;
3426
+ /**
3427
+ * 灰度
3428
+ * @param {number} p 0~1
3429
+ * */
3430
+ grayscale(p?: number): this;
3431
+ /**
3432
+ * 深褐色
3433
+ * @param {number} p 0~1
3434
+ * */
3435
+ sepia(p?: number): this;
3436
+ /**
3437
+ * 色相旋转,将色调沿极坐标转过deg角度
3438
+ * @param {number} deg 0~360
3439
+ * */
3440
+ hueRotate(deg: number): this;
3441
+ /**
3442
+ * 色相旋转,将色调沿极坐标转过deg角度
3443
+ * @param {number} deg 0~360
3444
+ * */
3445
+ /**
3446
+ * 卷积
3447
+ * @param {Matrix3} cKernel 3*3的矩阵
3448
+ * @param {number} stStep 1 / 9
3449
+ * @param {number} scaleFactor 521
3450
+ * */
3451
+ convolution(cKernel: THREE.Matrix3, stStep?: number, scaleFactor?: number): this;
3452
+ /**
3453
+ * 重置所有滤镜效果
3454
+ * */
3455
+ reset(): this;
3456
+ _getFilterShaderData(texture: THREE.Texture): {
3457
+ uniforms: {
3458
+ e_Texture: {
3459
+ value: three.Texture;
3460
+ };
3461
+ colorMatrix: {
3462
+ value: three.Matrix4;
3463
+ };
3464
+ };
3465
+ vertexShader: string;
3466
+ fragmentShader: string;
3467
+ };
3468
+ _getFilterColor(color?: string | number | THREE.Color, opacity?: number): three.Color;
3469
+ /** 转成JSON字符串 */
3470
+ toJSON(): string;
3471
+ /** 还原序列化的数据 */
3472
+ static fromJSON(json: string): MxFilters;
3473
+ }
3474
+
3378
3475
  /** 动态绘制形状
3379
- * 基于THREE.Shape计算实现的2d形状 通过extrude3dConfig 配置可挤压缓冲为3d形状
3476
+ * 基于THREE.Shape计算实现的形状
3477
+ * 通过扩展可以实现各种2d 3d形状
3380
3478
  * **/
3381
3479
  declare class MxDbShape extends MxDbEntity {
3382
3480
  protected _paths: THREE.CurvePath<THREE.Vector3 | THREE.Vector2>;
3383
3481
  protected points: THREE.Vector3[];
3384
3482
  protected closedLine: THREE.Curve<THREE.Vector3>;
3483
+ protected isLoadMaterialFromPath: boolean;
3484
+ protected material: THREE.MeshLambertMaterial | null;
3385
3485
  /** 描边颜色 */
3386
3486
  stroke: UnstableColor;
3387
3487
  setStroke(stroke: UnstableColor): this;
@@ -3394,12 +3494,28 @@ declare class MxDbShape extends MxDbEntity {
3394
3494
  /** 填充 */
3395
3495
  isFill: boolean;
3396
3496
  setIsFill(isFill: boolean): this;
3497
+ /** 填充图片路径 */
3498
+ fillImageSrc?: string;
3499
+ setFillImageSrc(fillImageSrc: string): this;
3500
+ /**
3501
+ * fillImageParam 填充背景图片的参数设置(如果使用了滤镜则部分参数功能失效)
3502
+ * */
3503
+ fillImageParam: {
3504
+ offset?: THREE.Vector2;
3505
+ repeat?: THREE.Vector2;
3506
+ rotation?: number;
3507
+ center?: THREE.Vector2;
3508
+ } | undefined;
3397
3509
  /** 线段细分数值 */
3398
3510
  curveSegments: number;
3399
3511
  setCurveSegments(curveSegments: number): this;
3400
3512
  /** 闭合 */
3401
3513
  closed: boolean;
3402
3514
  setClosed(closed: boolean): this;
3515
+ /**
3516
+ * 设置滤镜对象{@link MxFilters} 默认为undefined | null 则不使用该滤镜效果
3517
+ * */
3518
+ filter: MxFilters | undefined | null;
3403
3519
  /** 圆角半径 (一个向量点对应一个角的半径值)*/
3404
3520
  cornerRadius: number[] | number;
3405
3521
  /**
@@ -3422,13 +3538,13 @@ declare class MxDbShape extends MxDbEntity {
3422
3538
  _drawStoreLine(pWorldDraw: McGiWorldDraw, points: THREE.Vector3[], draw?: (pWorldDraw: McGiWorldDraw) => void): void;
3423
3539
  /** 获取线段闭合后的曲线点数 */
3424
3540
  getClosedPoints(points: THREE.Vector3[]): three.Vector3[];
3425
- /** 获取闭合线段 */
3426
- getClosedLine(points: THREE.Vector3[]): THREE.Curve<THREE.Vector3>;
3427
3541
  /** 获取长度 */
3428
3542
  getTotalLength(): number;
3429
3543
  /** 获取面积 */
3430
3544
  getArea(): number;
3431
3545
  worldDraw(pWorldDraw: McGiWorldDraw): void;
3546
+ /** 图片填充 */
3547
+ _fillImg(pWorldDraw: McGiWorldDraw, points: THREE.Vector3[]): void;
3432
3548
  getGripPoints(): THREE.Vector3[];
3433
3549
  moveGripPointsAt(index: number, offset: THREE.Vector3): boolean;
3434
3550
  dwgIn(obj: any): boolean;
@@ -3475,6 +3591,9 @@ declare class MxDbEllipseShape extends MxDbShape {
3475
3591
  };
3476
3592
  /** 创建圆弧 */
3477
3593
  createEllipseCurve(x?: number, y?: number, xRadius?: number, yRadius?: number, startAngle?: number, endAngle?: number, clockwise?: boolean, rotation?: number): three.EllipseCurve;
3594
+ /** 获取圆角的点集合(椭圆不需要) */
3595
+ getCornerRadiusPoints(points: THREE.Vector3[]): three.Vector3[];
3596
+ getClosedPoints(points: THREE.Vector3[]): THREE.Vector3[];
3478
3597
  getClosedLine(points: THREE.Vector3[]): three.CatmullRomCurve3;
3479
3598
  getGripPoints(): three.Vector3[];
3480
3599
  moveGripPointsAt(index: number, offset: THREE.Vector3): boolean;
@@ -3565,99 +3684,6 @@ declare class MxDbLine extends MxDbEntity {
3565
3684
  getGetLength(): number;
3566
3685
  }
3567
3686
 
3568
- /** 简单颜色滤镜矩阵 */
3569
- interface ChannelParamTypes {
3570
- r?: number;
3571
- g?: number;
3572
- b?: number;
3573
- }
3574
- declare class MxFilters {
3575
- private uniformObj;
3576
- private filtersStr;
3577
- private filtersTypes;
3578
- private VSHADER_SOURCE;
3579
- private FSHADER_SOURCE;
3580
- private _matrix;
3581
- /**
3582
- * 过滤或增强某个颜色通道
3583
- * @param {ChannelParamTypes}
3584
- * */
3585
- channel({ r, g, b }: ChannelParamTypes): this;
3586
- /**
3587
- * 改变亮度
3588
- * @param {number} p
3589
- * p = 0 全暗,p > 0 且 p < 1 调暗,p = 1 原色, p > 1 调亮
3590
- * */
3591
- brightness(p: number): this;
3592
- /**
3593
- * 饱和度
3594
- * @param {number} p
3595
- * p = 0 完全灰度化,p = 1 原色,p > 1 增强饱和度
3596
- * */
3597
- saturate(p: number): this;
3598
- /**
3599
- * 对比度
3600
- * @param {number} p
3601
- * p = 1 原色, p < 1 减弱对比度,p > 1 增强对比度
3602
- * */
3603
- contrast(p: number): this;
3604
- /**
3605
- * 透明度
3606
- * @param {number} p
3607
- * p = 0 全透明,p = 1 原色
3608
- * */
3609
- opacity(p: number): this;
3610
- /**
3611
- * 反色
3612
- * @param {number} p
3613
- * p = 0 原色, p = 1 完全反色
3614
- * */
3615
- invert(p: number): this;
3616
- /**
3617
- * 灰度
3618
- * @param {number} p 0~1
3619
- * */
3620
- grayscale(p?: number): this;
3621
- /**
3622
- * 深褐色
3623
- * @param {number} p 0~1
3624
- * */
3625
- sepia(p?: number): this;
3626
- /**
3627
- * 色相旋转,将色调沿极坐标转过deg角度
3628
- * @param {number} deg 0~360
3629
- * */
3630
- hueRotate(deg: number): this;
3631
- /**
3632
- * 色相旋转,将色调沿极坐标转过deg角度
3633
- * @param {number} deg 0~360
3634
- * */
3635
- /**
3636
- * 卷积
3637
- * @param {Matrix3} cKernel 3*3的矩阵
3638
- * @param {number} stStep 1 / 9
3639
- * @param {number} scaleFactor 521
3640
- * */
3641
- convolution(cKernel: THREE.Matrix3, stStep?: number, scaleFactor?: number): this;
3642
- /**
3643
- * 重置所有滤镜效果
3644
- * */
3645
- reset(): this;
3646
- _getFilterShaderData(texture: THREE.Texture): {
3647
- uniforms: {
3648
- e_Texture: {
3649
- value: three.Texture;
3650
- };
3651
- colorMatrix: {
3652
- value: three.Matrix4;
3653
- };
3654
- };
3655
- vertexShader: string;
3656
- fragmentShader: string;
3657
- };
3658
- _getFilterColor(color?: string | number | THREE.Color, opacity?: number): three.Color;
3659
- }
3660
-
3661
3687
  /**
3662
3688
  * MxRectEntity 矩形对象.
3663
3689
  */
@@ -3898,10 +3924,7 @@ declare class MxDbCloudLine extends MxDbEntity {
3898
3924
  dwgOut(obj: any): object;
3899
3925
  }
3900
3926
 
3901
- /**
3902
- * MxDbRegularPolygon 正多边形
3903
- */
3904
- declare class MxDbRegularPolygon extends MxDbEntity {
3927
+ declare class MxDbRegularPolygon extends MxDbShape {
3905
3928
  /** 正多边形的中心点位置 */
3906
3929
  centerPoint: three.Vector3;
3907
3930
  /** 正多边形两条边之间的交点位置 */
@@ -3909,12 +3932,13 @@ declare class MxDbRegularPolygon extends MxDbEntity {
3909
3932
  /** 正多边形边的数量 */
3910
3933
  sidesNumber: number;
3911
3934
  getTypeName(): string;
3935
+ /**
3936
+ * MxDbRegularPolygon 正多边形
3937
+ */
3938
+ constructor();
3912
3939
  worldDraw(pWorldDraw: McGiWorldDraw): void;
3913
3940
  getGripPoints(): THREE.Vector3[];
3914
3941
  moveGripPointsAt(index: number, offset: THREE.Vector3): boolean;
3915
- create(): MxDbEntity;
3916
- dwgIn(obj: any): boolean;
3917
- dwgOut(obj: any): object;
3918
3942
  }
3919
3943
 
3920
3944
  /** @module MxDbLeadComment*/
@@ -4021,7 +4045,7 @@ declare class SpriteText extends THREE.Sprite {
4021
4045
  underline: boolean;
4022
4046
  fontStyle: TextFontStyle;
4023
4047
  fontVariant: string;
4024
- private _genCanvas;
4048
+ _genCanvas(): void;
4025
4049
  dispose(): void;
4026
4050
  }
4027
4051
  interface SpriteTextOptions {
@@ -4267,11 +4291,11 @@ declare class MxDbGradientLine extends MxDbEntity {
4267
4291
  dwgOut(obj: any): object;
4268
4292
  }
4269
4293
 
4270
- /**
4271
- * 根据中心点、椭圆开始点和结束点确定椭圆弧
4272
- * */
4273
4294
  declare class MxDbEllipseArc extends MxDbEllipseShape {
4274
4295
  getTypeName(): string;
4296
+ /**
4297
+ * 根据中心点、椭圆开始点和结束点确定椭圆弧
4298
+ * */
4275
4299
  constructor();
4276
4300
  /** 椭圆弧决定开始点 控制x轴半径和开始角度 */
4277
4301
  startPoint: THREE.Vector3;
@@ -4287,8 +4311,8 @@ declare class MxDbEllipseArc extends MxDbEllipseShape {
4287
4311
  moveGripPointsAt(index: number, offset: THREE.Vector3): boolean;
4288
4312
  }
4289
4313
 
4290
- /** 根据圆心、起始点、结束点位置动态绘制圆弧 **/
4291
4314
  declare class MxDbCircleArc extends MxDbCircleShape {
4315
+ /** 根据圆心、起始点、结束点位置动态绘制圆弧 **/
4292
4316
  constructor();
4293
4317
  getTypeName(): string;
4294
4318
  /** 圆弧开始点 设置开始点将自动计算 radius、startAngle、endAngle */
@@ -4303,8 +4327,8 @@ declare class MxDbCircleArc extends MxDbCircleShape {
4303
4327
  moveGripPointsAt(index: number, offset: THREE.Vector3): boolean;
4304
4328
  }
4305
4329
 
4306
- /** 弧形 */
4307
4330
  declare class MxDbArcShape extends MxDbCircleArc {
4331
+ /** 环形 */
4308
4332
  constructor();
4309
4333
  getTypeName(): string;
4310
4334
  create(): MxDbArcShape;
@@ -4317,9 +4341,9 @@ declare class MxDbArcShape extends MxDbCircleArc {
4317
4341
  moveGripPointsAt(index: number, offset: THREE.Vector3): boolean;
4318
4342
  }
4319
4343
 
4320
- /** 绘制弧形 */
4321
4344
  declare class MxDbArcShapeDraw extends MxDbArcShape {
4322
4345
  getTypeName(): string;
4346
+ /** 绘制弧形 */
4323
4347
  constructor();
4324
4348
  outerRadiusPoint: three.Vector3;
4325
4349
  interRadiusPoint: three.Vector3;
@@ -4334,9 +4358,9 @@ declare class MxDbRingShape extends MxDbArcShape {
4334
4358
  worldDraw(pWorldDraw: McGiWorldDraw): void;
4335
4359
  }
4336
4360
 
4337
- /** 星形 */
4338
4361
  declare class MxDbStarShape extends MxDbShape {
4339
4362
  getTypeName(): string;
4363
+ /** 星形 */
4340
4364
  constructor();
4341
4365
  center: three.Vector3;
4342
4366
  numPoints: number;
@@ -4350,11 +4374,12 @@ declare class MxDbStarShape extends MxDbShape {
4350
4374
  /** 等边多边形 */
4351
4375
  declare class MxDbRegularPolygonShape extends MxDbShape {
4352
4376
  center: three.Vector3;
4353
- sides: number;
4377
+ sidesNumber: number;
4354
4378
  radius: number;
4355
4379
  getTypeName(): string;
4356
4380
  constructor();
4357
4381
  worldDraw(pWorldDraw: McGiWorldDraw): void;
4382
+ _drawPolygonShape(pWorldDraw: McGiWorldDraw): void;
4358
4383
  _getPoints(): {
4359
4384
  x: number;
4360
4385
  y: number;
@@ -4363,6 +4388,45 @@ declare class MxDbRegularPolygonShape extends MxDbShape {
4363
4388
  moveGripPointsAt(index: number, offset: THREE.Vector3): boolean;
4364
4389
  }
4365
4390
 
4391
+ declare class MxDbArrow extends MxDbShape {
4392
+ /** 箭头图形 */
4393
+ constructor();
4394
+ /** 开始是否为尖角 */
4395
+ isSharpCorner: boolean;
4396
+ /** 内部偏移量 */
4397
+ innerOffset: number;
4398
+ /** 外部偏移量 */
4399
+ outerOffset: number;
4400
+ /** 顶部偏移量 */
4401
+ topOffset: number;
4402
+ startPoint: three.Vector3;
4403
+ endPoint: three.Vector3;
4404
+ worldDraw(pWorldDraw: McGiWorldDraw): void;
4405
+ getArrowVertex(p1: THREE.Vector3, p2: THREE.Vector3, isSharpCorner?: boolean): three.Vector3[] | undefined;
4406
+ getGripPoints(): THREE.Vector3[];
4407
+ moveGripPointsAt(index: number, offset: THREE.Vector3): boolean;
4408
+ }
4409
+
4410
+ /** 线形状 */
4411
+ declare class MxDbLineShape extends MxDbShape {
4412
+ points: THREE.Vector3[];
4413
+ setPoints(points: THREE.Vector3[]): this;
4414
+ addPoint(point: THREE.Vector3): this;
4415
+ removePoint(index: number): this;
4416
+ constructor();
4417
+ getTypeName(): string;
4418
+ worldDraw(pWorldDraw: McGiWorldDraw): void;
4419
+ getGripPoints(): Array<THREE.Vector3>;
4420
+ moveGripPointsAt(index: number, offset: THREE.Vector3): boolean;
4421
+ /** 获取包围盒 */
4422
+ getGeomExtents(): THREE.Box3 | null;
4423
+ /**
4424
+ * 返回曲线长度.
4425
+ * @returns number
4426
+ */
4427
+ getGetLength(): number;
4428
+ }
4429
+
4366
4430
  declare const Mx_loadCoreCode: typeof loadCoreCode;
4367
4431
  declare const Mx_useCanvasResizeListener: typeof useCanvasResizeListener;
4368
4432
  declare const Mx_store: typeof store;
@@ -4455,6 +4519,10 @@ type Mx_MxDbStarShape = MxDbStarShape;
4455
4519
  declare const Mx_MxDbStarShape: typeof MxDbStarShape;
4456
4520
  type Mx_MxDbRegularPolygonShape = MxDbRegularPolygonShape;
4457
4521
  declare const Mx_MxDbRegularPolygonShape: typeof MxDbRegularPolygonShape;
4522
+ type Mx_MxDbArrow = MxDbArrow;
4523
+ declare const Mx_MxDbArrow: typeof MxDbArrow;
4524
+ type Mx_MxDbLineShape = MxDbLineShape;
4525
+ declare const Mx_MxDbLineShape: typeof MxDbLineShape;
4458
4526
  declare namespace Mx {
4459
4527
  export {
4460
4528
  Mx_loadCoreCode as loadCoreCode,
@@ -4510,7 +4578,16 @@ declare namespace Mx {
4510
4578
  Mx_MxDbRingShape as MxDbRingShape,
4511
4579
  Mx_MxDbStarShape as MxDbStarShape,
4512
4580
  Mx_MxDbRegularPolygonShape as MxDbRegularPolygonShape,
4581
+ Mx_MxDbArrow as MxDbArrow,
4582
+ Mx_MxDbLineShape as MxDbLineShape,
4513
4583
  };
4514
4584
  }
4515
4585
 
4516
- export { McEdGetPointWorldDrawObject, McGePoint3d, McGePoint3dArray, McGeTool, McGiWorldDraw, McGiWorldDrawType, MrxDbgUiPrBaseReturn, MrxDbgUiPrPoint, MrxDbgUtils, Mx3PointArc, MxCADObject, MxDb2LineAngularDimension, MxDbAlignedDimension, MxDbAnyLine, MxDbArcShapeDraw, MxDbArea, MxDbCircleArc, MxDbCircleShape, MxDbCloudLine, MxDbCoord, MxDbDatabase, MxDbEllipse, MxDbEllipseArc, MxDbEllipseShape, MxDbEntity, MxDbGradientLine, MxDbGroup, MxDbHatch, MxDbImage, MxDbLayerTableRecord, MxDbLeadComment, MxDbLeadTag, MxDbLine, MxDbPolyline, MxDbRect, MxDbRectBoxLeadComment, MxDbRegularPolygon, MxDbRegularPolygonShape, MxDbRingShape, MxDbSVG, MxDbSVGText, MxDbShape, MxDbStarShape, MxDbText, MxDrawObject, MxFilters, MxFun, MxThreeJS, MxType, Mxassembly, Mx as default, loadCoreCode, store, useCanvasResizeListener };
4586
+ declare global {
4587
+ type THREE = typeof THREE;
4588
+ interface Window {
4589
+ THREE: typeof THREE;
4590
+ }
4591
+ }
4592
+
4593
+ export { McEdGetPointWorldDrawObject, McGePoint3d, McGePoint3dArray, McGeTool, McGiWorldDraw, McGiWorldDrawType, MrxDbgUiPrBaseReturn, MrxDbgUiPrPoint, MrxDbgUtils, Mx3PointArc, MxCADObject, MxDb2LineAngularDimension, MxDbAlignedDimension, MxDbAnyLine, MxDbArcShapeDraw, MxDbArea, MxDbArrow, MxDbCircleArc, MxDbCircleShape, MxDbCloudLine, MxDbCoord, MxDbDatabase, MxDbEllipse, MxDbEllipseArc, MxDbEllipseShape, MxDbEntity, MxDbGradientLine, MxDbGroup, MxDbHatch, MxDbImage, MxDbLayerTableRecord, MxDbLeadComment, MxDbLeadTag, MxDbLine, MxDbLineShape, MxDbPolyline, MxDbRect, MxDbRectBoxLeadComment, MxDbRegularPolygon, MxDbRegularPolygonShape, MxDbRingShape, MxDbSVG, MxDbSVGText, MxDbShape, MxDbStarShape, MxDbText, MxDrawObject, MxFilters, MxFun, MxThreeJS, MxType, Mxassembly, Mx as default, loadCoreCode, store, useCanvasResizeListener };
@@ -1,7 +1,7 @@
1
1
  import McGiWorldDraw from "../McGiWorldDraw";
2
2
  import MxDbCircleArc from "../MxDbCircleArc";
3
- /** 弧形 */
4
3
  export default class MxDbArcShape extends MxDbCircleArc {
4
+ /** 环形 */
5
5
  constructor();
6
6
  getTypeName(): string;
7
7
  create(): MxDbArcShape;
@@ -1,8 +1,8 @@
1
1
  import McGiWorldDraw from "../McGiWorldDraw";
2
2
  import MxDbArcShape from "../MxDbArcShape";
3
- /** 绘制弧形 */
4
3
  export default class MxDbArcShapeDraw extends MxDbArcShape {
5
4
  getTypeName(): string;
5
+ /** 绘制弧形 */
6
6
  constructor();
7
7
  outerRadiusPoint: import("three").Vector3;
8
8
  interRadiusPoint: import("three").Vector3;
@@ -0,0 +1,20 @@
1
+ import McGiWorldDraw from "../McGiWorldDraw";
2
+ import MxDbShape from "../MxDbShape";
3
+ export default class MxDbArrow extends MxDbShape {
4
+ /** 箭头图形 */
5
+ constructor();
6
+ /** 开始是否为尖角 */
7
+ isSharpCorner: boolean;
8
+ /** 内部偏移量 */
9
+ innerOffset: number;
10
+ /** 外部偏移量 */
11
+ outerOffset: number;
12
+ /** 顶部偏移量 */
13
+ topOffset: number;
14
+ startPoint: import("three").Vector3;
15
+ endPoint: import("three").Vector3;
16
+ worldDraw(pWorldDraw: McGiWorldDraw): void;
17
+ getArrowVertex(p1: THREE.Vector3, p2: THREE.Vector3, isSharpCorner?: boolean): import("three").Vector3[] | undefined;
18
+ getGripPoints(): THREE.Vector3[];
19
+ moveGripPointsAt(index: number, offset: THREE.Vector3): boolean;
20
+ }
@@ -0,0 +1 @@
1
+ import MxDbShape from"../MxDbShape";export default class MxDbArrow extends MxDbShape{constructor(){super(),this.isSharpCorner=!0,this.innerOffset=10,this.outerOffset=22,this.topOffset=36,this.startPoint=new THREE.Vector3,this.endPoint=new THREE.Vector3,this._propertyDbKeys=[...this._propertyDbKeys,"outerOffset","topOffset","innerOffset","isSharpCorner","startPoint","endPoint"]}worldDraw(t){const e=this.getArrowVertex(this.startPoint,this.endPoint);e&&(this._draw(t,e),this._drawStoreLine(t,e))}getArrowVertex(t,e,r=this.isSharpCorner){let{innerOffset:s,topOffset:n,outerOffset:o}=this;const i=[];i[3]=e;const x=Math.sqrt((t.x-e.x)*(t.x-e.x)+(t.y-e.y)*(t.y-e.y));if(0===x)return;const h=-(e.x-t.x)/x,y=(e.y-t.y)/x,a=t.x+s,f=t.y+x-n,d=t.x+o,E=t.y+x-n,p=t.x-s,c=t.y+x-n,w=t.x-o,P=t.y+x-n;return r?(i[0]=t,i[6]=i[0]):(i[0]=new THREE.Vector3(t.x-(p-t.x)*y,t.y-(p-t.x)*h),i[6]=new THREE.Vector3(t.x+(p-t.x)*y,t.y+(p-t.x)*h),i[7]=i[0]),i[1]=new THREE.Vector3(t.x+(a-t.x)*y-(f-t.y)*h,t.y+(a-t.x)*h+(f-t.y)*y),i[2]=new THREE.Vector3(t.x+(d-t.x)*y-(E-t.y)*h,t.y+(d-t.x)*h+(E-t.y)*y),i[4]=new THREE.Vector3(t.x+(w-t.x)*y-(P-t.y)*h,t.y+(w-t.x)*h+(P-t.y)*y),i[5]=new THREE.Vector3(t.x+(p-t.x)*y-(c-t.y)*h,t.y+(p-t.x)*h+(c-t.y)*y),i}getGripPoints(){const t=new THREE.Vector3;return new THREE.Line3(this.startPoint,this.endPoint).getCenter(t),[this.startPoint,t,this.endPoint]}moveGripPointsAt(t,e){return 0===t&&this.startPoint.add(e),1===t&&(this.startPoint.add(e),this.endPoint.add(e)),2===t&&this.endPoint.add(e),!0}};
@@ -1,7 +1,7 @@
1
1
  import McGiWorldDraw from "../McGiWorldDraw";
2
2
  import MxDbCircleShape from "../MxDbCircleShape";
3
- /** 根据圆心、起始点、结束点位置动态绘制圆弧 **/
4
3
  export default class MxDbCircleArc extends MxDbCircleShape {
4
+ /** 根据圆心、起始点、结束点位置动态绘制圆弧 **/
5
5
  constructor();
6
6
  getTypeName(): string;
7
7
  /** 圆弧开始点 设置开始点将自动计算 radius、startAngle、endAngle */
@@ -1,10 +1,10 @@
1
1
  import McGiWorldDraw from "../McGiWorldDraw";
2
2
  import MxDbEllipseShape from "../MxDbEllipseShape";
3
- /**
4
- * 根据中心点、椭圆开始点和结束点确定椭圆弧
5
- * */
6
3
  export default class MxDbEllipseArc extends MxDbEllipseShape {
7
4
  getTypeName(): string;
5
+ /**
6
+ * 根据中心点、椭圆开始点和结束点确定椭圆弧
7
+ * */
8
8
  constructor();
9
9
  /** 椭圆弧决定开始点 控制x轴半径和开始角度 */
10
10
  startPoint: THREE.Vector3;
@@ -40,6 +40,9 @@ export default class MxDbEllipseShape extends MxDbShape {
40
40
  };
41
41
  /** 创建圆弧 */
42
42
  createEllipseCurve(x?: number, y?: number, xRadius?: number, yRadius?: number, startAngle?: number, endAngle?: number, clockwise?: boolean, rotation?: number): import("three").EllipseCurve;
43
+ /** 获取圆角的点集合(椭圆不需要) */
44
+ getCornerRadiusPoints(points: THREE.Vector3[]): import("three").Vector3[];
45
+ getClosedPoints(points: THREE.Vector3[]): THREE.Vector3[];
43
46
  getClosedLine(points: THREE.Vector3[]): import("three").CatmullRomCurve3;
44
47
  getGripPoints(): import("three").Vector3[];
45
48
  moveGripPointsAt(index: number, offset: THREE.Vector3): boolean;
@@ -1 +1 @@
1
- import MxDbShape from"../MxDbShape";export default class MxDbEllipseShape extends MxDbShape{constructor(){super(),this.center=new THREE.Vector3,this.xRadius=10,this.yRadius=10,this.startAngle=0,this.endAngle=2*Math.PI,this.clockwise=!1,this.rotation=0,this.isClosedToCenter=!0,this._propertyDbKeys=[...this._propertyDbKeys,"center","xRadius","yRadius","startAngle","endAngle","clockwise","rotation","isClosedToCenter"]}getTypeName(){return"MxDbEllipseShape"}setCenter(t){return this.center=t,this}setXRadius(t){return this.xRadius=t,this}setYRadius(t){return this.yRadius=t,this}setStartAngle(t){return this.startAngle=t,this}setEndAngle(t){return this.endAngle=t,this}setClockwise(t){return this.clockwise=t,this}setRotation(t){return this.rotation=t,this}setIsClosedToCenter(t){return this.isClosedToCenter=t,this}worldDraw(t){this.drawEllipseShape(t)}drawEllipseShape(t){let{startAngle:e,endAngle:s,clockwise:r}=this;const i=this.createEllipseCurve(),n=this.createPaths(i);let a,l=this.getShapePoints(n);return this._draw(t,l),this._drawStoreLine(t,l),{centralAngle:a=r?s>e?THREE.MathUtils.radToDeg(i.aEndAngle-i.aStartAngle):360-Math.abs(THREE.MathUtils.radToDeg(i.aEndAngle-i.aStartAngle)):e>s?Math.abs(THREE.MathUtils.radToDeg(i.aEndAngle-i.aStartAngle)):360-THREE.MathUtils.radToDeg(i.aEndAngle-i.aStartAngle),curve:i,points:l}}createEllipseCurve(t=this.center.x,e=this.center.y,s=this.xRadius,r=this.yRadius,i=this.startAngle,n=this.endAngle,a=this.clockwise,l=this.rotation){return new THREE.EllipseCurve(t,e,s,r,i,n,a,l)}getClosedLine(t){const{isClosedToCenter:e,center:s}=this;let r=e?[t[t.length-1],s,t[0]]:[t[t.length-1],t[0]];return new THREE.CatmullRomCurve3(r,!1,"catmullrom",.01)}getGripPoints(){return[this.center]}moveGripPointsAt(t,e){return 0===t&&this.center.add(e),!0}};
1
+ import MxDbShape from"../MxDbShape";export default class MxDbEllipseShape extends MxDbShape{constructor(){super(),this.center=new THREE.Vector3,this.xRadius=10,this.yRadius=10,this.startAngle=0,this.endAngle=2*Math.PI,this.clockwise=!1,this.rotation=0,this.isClosedToCenter=!0,this._propertyDbKeys=[...this._propertyDbKeys,"center","xRadius","yRadius","startAngle","endAngle","clockwise","rotation","isClosedToCenter"]}getTypeName(){return"MxDbEllipseShape"}setCenter(t){return this.center=t,this}setXRadius(t){return this.xRadius=t,this}setYRadius(t){return this.yRadius=t,this}setStartAngle(t){return this.startAngle=t,this}setEndAngle(t){return this.endAngle=t,this}setClockwise(t){return this.clockwise=t,this}setRotation(t){return this.rotation=t,this}setIsClosedToCenter(t){return this.isClosedToCenter=t,this}worldDraw(t){this.drawEllipseShape(t)}drawEllipseShape(t){let{startAngle:e,endAngle:s,clockwise:i}=this;const r=this.createEllipseCurve(),n=this.createPaths(r);let a,h=this.getShapePoints(n);return this._draw(t,h),this._drawStoreLine(t,h),{centralAngle:a=i?s>e?THREE.MathUtils.radToDeg(r.aEndAngle-r.aStartAngle):360-Math.abs(THREE.MathUtils.radToDeg(r.aEndAngle-r.aStartAngle)):e>s?Math.abs(THREE.MathUtils.radToDeg(r.aEndAngle-r.aStartAngle)):360-THREE.MathUtils.radToDeg(r.aEndAngle-r.aStartAngle),curve:r,points:h}}createEllipseCurve(t=this.center.x,e=this.center.y,s=this.xRadius,i=this.yRadius,r=this.startAngle,n=this.endAngle,a=this.clockwise,h=this.rotation){return new THREE.EllipseCurve(t,e,s,i,r,n,a,h)}getCornerRadiusPoints(t){return t}getClosedPoints(t){try{let e=(this._paths||new THREE.CatmullRomCurve3(t,!1,"catmullrom",0)).getLength();this.closedLine=this.getClosedLine(t);const s=this.closedLine.getLength();let i=this.curveSegments/e,r=2.5*(e>this.curveSegments?s*i:1);if(r>20*this.curveSegments&&(r=20*this.curveSegments),r<=0)return t;const n=this.closedLine.getPoints(r);return[...t,...n]}catch(e){return[...t,t[0]]}}getClosedLine(t){const{isClosedToCenter:e,center:s}=this;let i=e?[t[t.length-1],s,t[0]]:[t[t.length-1],t[0]];return new THREE.CatmullRomCurve3(i,!1,"catmullrom",.01)}getGripPoints(){return[this.center]}moveGripPointsAt(t,e){return 0===t&&this.center.add(e),!0}};
@@ -0,0 +1,21 @@
1
+ import McGiWorldDraw from "../McGiWorldDraw";
2
+ import MxDbShape from "../MxDbShape";
3
+ /** 线形状 */
4
+ export default class MxDbLineShape extends MxDbShape {
5
+ points: THREE.Vector3[];
6
+ setPoints(points: THREE.Vector3[]): this;
7
+ addPoint(point: THREE.Vector3): this;
8
+ removePoint(index: number): this;
9
+ constructor();
10
+ getTypeName(): string;
11
+ worldDraw(pWorldDraw: McGiWorldDraw): void;
12
+ getGripPoints(): Array<THREE.Vector3>;
13
+ moveGripPointsAt(index: number, offset: THREE.Vector3): boolean;
14
+ /** 获取包围盒 */
15
+ getGeomExtents(): THREE.Box3 | null;
16
+ /**
17
+ * 返回曲线长度.
18
+ * @returns number
19
+ */
20
+ getGetLength(): number;
21
+ }
@@ -0,0 +1 @@
1
+ import MxDbShape from"../MxDbShape";export default class MxDbLineShape extends MxDbShape{constructor(){super(),this.points=[],this._propertyDbKeys=[...this._propertyDbKeys,"points"]}setPoints(t){return this.points=t,this}addPoint(t){return this.points.push(t),this}removePoint(t){return this.points.splice(t,1),this}getTypeName(){return"MxDbLineShape"}worldDraw(t){this._draw(t,this.points),this._drawStoreLine(t,this.points)}getGripPoints(){return this.points}moveGripPointsAt(t,s){return this.points[t].add(s),!0}getGeomExtents(){return(new THREE.Box3).setFromPoints(this.points)}getGetLength(){let t=0;for(let s=0;s++;s<this.points.length)this.points[s+1]&&(t+=this.points[s].distanceTo(this.points[s+1]));return t}};
@@ -1,9 +1,6 @@
1
- import MxDbEntity from '../MxDbEntity';
2
1
  import McGiWorldDraw from '../McGiWorldDraw';
3
- /**
4
- * MxDbRegularPolygon 正多边形
5
- */
6
- export default class MxDbRegularPolygon extends MxDbEntity {
2
+ import MxDbShape from '../MxDbShape';
3
+ export default class MxDbRegularPolygon extends MxDbShape {
7
4
  /** 正多边形的中心点位置 */
8
5
  centerPoint: import("three").Vector3;
9
6
  /** 正多边形两条边之间的交点位置 */
@@ -11,10 +8,11 @@ export default class MxDbRegularPolygon extends MxDbEntity {
11
8
  /** 正多边形边的数量 */
12
9
  sidesNumber: number;
13
10
  getTypeName(): string;
11
+ /**
12
+ * MxDbRegularPolygon 正多边形
13
+ */
14
+ constructor();
14
15
  worldDraw(pWorldDraw: McGiWorldDraw): void;
15
16
  getGripPoints(): THREE.Vector3[];
16
17
  moveGripPointsAt(index: number, offset: THREE.Vector3): boolean;
17
- create(): MxDbEntity;
18
- dwgIn(obj: any): boolean;
19
- dwgOut(obj: any): object;
20
18
  }
@@ -1 +1 @@
1
- import MxDbEntity from"../MxDbEntity";import MxFun from"../MxFun";import McGiWorldDrawType from"../McGiWorldDrawType";import{createThreeRegularPolygon}from"../../tools/three/index";export default class MxDbRegularPolygon extends MxDbEntity{constructor(){super(...arguments),this.centerPoint=new THREE.Vector3,this.otherPoint=new THREE.Vector3,this.sidesNumber=5}getTypeName(){return"MxDbRegularPolygon"}worldDraw(t){const e=createThreeRegularPolygon(this.centerPoint,this.otherPoint,this.sidesNumber,t.getColor());if(e.geometry.computeBoundingBox(),t.getType()===McGiWorldDrawType.kSelectDraw){const r=new THREE.Vector3;e.geometry.boundingBox.getSize(r),r.addScalar(MxFun.screenCoordLong2Doc(10));const o=r.x/2,n=r.y/2,i={x:this.centerPoint.x-o,y:this.centerPoint.y-n},s={x:this.centerPoint.x+o,y:this.centerPoint.y-n},h={x:this.centerPoint.x+o,y:this.centerPoint.y+n},c={x:this.centerPoint.x-o,y:this.centerPoint.y+n};t.drawLine(i.x,i.y,s.x,s.y),t.drawLine(s.x,s.y,h.x,h.y),t.drawLine(h.x,h.y,c.x,c.y),t.drawLine(c.x,c.y,i.x,i.y)}t.drawEntity(e)}getGripPoints(){return[this.centerPoint,this.otherPoint]}moveGripPointsAt(t,e){return 0===t?(this.centerPoint.add(e),this.otherPoint.add(e)):1===t&&this.otherPoint.add(e),!0}create(){return new MxDbRegularPolygon}dwgIn(t){return this.onDwgIn(t),this.centerPoint.copy(t.centerPoint),this.otherPoint.copy(t.otherPoint),this.sidesNumber=t.sidesNumber,!0}dwgOut(t){return this.onDwgOut(t),t.centerPoint=this.centerPoint,t.otherPoint=this.otherPoint,t.sidesNumber=this.sidesNumber,t}};
1
+ import{computeRegularPolygonVertices}from"../../tools/three/index";import MxDbShape from"../MxDbShape";export default class MxDbRegularPolygon extends MxDbShape{constructor(){super(),this.centerPoint=new THREE.Vector3,this.otherPoint=new THREE.Vector3,this.sidesNumber=5,this._propertyDbKeys=[...this._propertyDbKeys,"centerPoint","otherPoint","sidesNumber"]}getTypeName(){return"MxDbRegularPolygon"}worldDraw(t){const e=computeRegularPolygonVertices(this.centerPoint,this.otherPoint,this.sidesNumber);this.closed=!1,e.push(e[0]),this._draw(t,e),this._drawStoreLine(t,e)}getGripPoints(){return[this.centerPoint,this.otherPoint]}moveGripPointsAt(t,e){return 0===t?(this.centerPoint.add(e),this.otherPoint.add(e)):1===t&&this.otherPoint.add(e),!0}};
@@ -3,11 +3,12 @@ import MxDbShape from "../MxDbShape";
3
3
  /** 等边多边形 */
4
4
  export default class MxDbRegularPolygonShape extends MxDbShape {
5
5
  center: import("three").Vector3;
6
- sides: number;
6
+ sidesNumber: number;
7
7
  radius: number;
8
8
  getTypeName(): string;
9
9
  constructor();
10
10
  worldDraw(pWorldDraw: McGiWorldDraw): void;
11
+ _drawPolygonShape(pWorldDraw: McGiWorldDraw): void;
11
12
  _getPoints(): {
12
13
  x: number;
13
14
  y: number;
@@ -1 +1 @@
1
- import MxDbShape from"../MxDbShape";export default class MxDbRegularPolygonShape extends MxDbShape{constructor(){super(),this.center=new THREE.Vector3,this.sides=6,this.radius=70,this._propertyDbKeys=[...this._propertyDbKeys,"center","sides","radius"]}getTypeName(){return"MxDbRegularPolygonShape"}worldDraw(t){const e=this._getPoints(),s=new THREE.Path;s.moveTo(e[0].x,e[0].y);for(let t=0;t<e.length;t++)s.lineTo(e[t].x,e[t].y);s.closePath();const r=this.createPaths(s),i=this.getShapePoints(r);this._draw(t,i),this._drawStoreLine(t,i)}_getPoints(){const{sides:t,radius:e}=this,{x:s,y:r}=this.center,i=[];for(let o=0;o<t;o++)i.push({x:e*Math.sin(2*o*Math.PI/t)+s,y:-1*e*Math.cos(2*o*Math.PI/t)+r});return i}getGripPoints(){return[this.center]}moveGripPointsAt(t,e){return 0===t&&this.center.add(e),!0}};
1
+ import MxDbShape from"../MxDbShape";export default class MxDbRegularPolygonShape extends MxDbShape{constructor(){super(),this.center=new THREE.Vector3,this.sidesNumber=6,this.radius=70,this._propertyDbKeys=[...this._propertyDbKeys,"center","sidesNumber","radius"]}getTypeName(){return"MxDbRegularPolygonShape"}worldDraw(e){this._drawPolygonShape(e)}_drawPolygonShape(e){const t=this._getPoints(),r=new THREE.Path;r.moveTo(t[0].x,t[0].y);for(let e=0;e<t.length;e++)r.lineTo(t[e].x,t[e].y);r.closePath();const s=this.createPaths(r),o=this.getShapePoints(s);this._draw(e,o),this._drawStoreLine(e,o)}_getPoints(){const{sidesNumber:e,radius:t}=this,{x:r,y:s}=this.center,o=[];for(let h=0;h<e;h++)o.push({x:t*Math.sin(2*h*Math.PI/e)+r,y:-1*t*Math.cos(2*h*Math.PI/e)+s});return o}getGripPoints(){return[this.center]}moveGripPointsAt(e,t){return 0===e&&this.center.add(t),!0}};