mxdraw 0.1.119 → 0.1.121
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/dist/index.d.ts +293 -19
- package/dist/lib/MxModule/Mx3PointArc/index.d.ts +16 -11
- package/dist/lib/MxModule/Mx3PointArc/index.js +1 -1
- package/dist/lib/MxModule/MxDbArcShape/index.d.ts +15 -0
- package/dist/lib/MxModule/MxDbArcShape/index.js +1 -0
- package/dist/lib/MxModule/MxDbArcShapeDraw/index.d.ts +12 -0
- package/dist/lib/MxModule/MxDbArcShapeDraw/index.js +1 -0
- package/dist/lib/MxModule/MxDbCircleArc/index.d.ts +17 -0
- package/dist/lib/MxModule/MxDbCircleArc/index.js +1 -0
- package/dist/lib/MxModule/MxDbCircleShape/index.d.ts +11 -0
- package/dist/lib/MxModule/MxDbCircleShape/index.js +1 -0
- package/dist/lib/MxModule/MxDbEllipse/index.d.ts +13 -13
- package/dist/lib/MxModule/MxDbEllipse/index.js +1 -1
- package/dist/lib/MxModule/MxDbEllipseArc/index.d.ts +21 -0
- package/dist/lib/MxModule/MxDbEllipseArc/index.js +1 -0
- package/dist/lib/MxModule/MxDbEllipseShape/index.d.ts +46 -0
- package/dist/lib/MxModule/MxDbEllipseShape/index.js +1 -0
- package/dist/lib/MxModule/MxDbEntity/index.d.ts +10 -0
- package/dist/lib/MxModule/MxDbEntity/index.js +1 -1
- package/dist/lib/MxModule/MxDbRegularPolygonShape/index.d.ts +17 -0
- package/dist/lib/MxModule/MxDbRegularPolygonShape/index.js +1 -0
- package/dist/lib/MxModule/MxDbRingShape/index.d.ts +7 -0
- package/dist/lib/MxModule/MxDbRingShape/index.js +1 -0
- package/dist/lib/MxModule/MxDbSVG/index.js +1 -1
- package/dist/lib/MxModule/MxDbSVGText/index.d.ts +4 -0
- package/dist/lib/MxModule/MxDbSVGText/index.js +1 -1
- package/dist/lib/MxModule/MxDbShape/index.d.ts +62 -0
- package/dist/lib/MxModule/MxDbShape/index.js +1 -0
- package/dist/lib/MxModule/MxDbStarShape/index.d.ts +14 -0
- package/dist/lib/MxModule/MxDbStarShape/index.js +1 -0
- package/dist/lib/MxModule/MxDbText/SpriteText.d.ts +6 -0
- package/dist/lib/MxModule/MxDbText/SpriteText.js +1 -1
- package/dist/lib/MxModule/MxDrawObject/index.d.ts +9 -0
- package/dist/lib/MxModule/MxDrawObject/index.js +1 -1
- package/dist/lib/MxModule/loadCoreCode/mxfun.es5.js +1 -1
- package/dist/lib/doc.d.ts +10 -1
- package/dist/lib/doc.js +1 -1
- package/dist/lib/mxdraw.d.ts +9 -0
- package/dist/lib/mxdraw.js +1 -1
- package/dist/mxdraw.es.js +1 -1
- package/dist/mxdraw.umd.js +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -787,6 +787,16 @@ declare abstract class MxDbEntity {
|
|
|
787
787
|
* @returns void
|
|
788
788
|
*/
|
|
789
789
|
removeEvent(name: string): void;
|
|
790
|
+
/**
|
|
791
|
+
* 把一个对象变成一个json字体串.
|
|
792
|
+
* @returns void
|
|
793
|
+
*/
|
|
794
|
+
toJsonString(type?: MxType.MxCloneType): string;
|
|
795
|
+
/**
|
|
796
|
+
* 从一个josn字符串加载数据.
|
|
797
|
+
* @returns void
|
|
798
|
+
*/
|
|
799
|
+
fromJsonString(str: string): boolean;
|
|
790
800
|
}
|
|
791
801
|
|
|
792
802
|
/** @module MxDbGroup */
|
|
@@ -1761,6 +1771,15 @@ declare class MxDrawObject {
|
|
|
1761
1771
|
* ```
|
|
1762
1772
|
*/
|
|
1763
1773
|
getAllLayoutName(): string[];
|
|
1774
|
+
/**
|
|
1775
|
+
* 得到数据库Json字符串数据.
|
|
1776
|
+
* @example
|
|
1777
|
+
* ```typescript
|
|
1778
|
+
*
|
|
1779
|
+
*
|
|
1780
|
+
* ```
|
|
1781
|
+
*/
|
|
1782
|
+
getDtabaseJsonString(): string;
|
|
1764
1783
|
}
|
|
1765
1784
|
|
|
1766
1785
|
/**
|
|
@@ -3170,10 +3189,14 @@ declare class MxDbSVGText {
|
|
|
3170
3189
|
move: boolean;
|
|
3171
3190
|
/** 文字移动到距图片远处,自动绘制一个连接线 */
|
|
3172
3191
|
drawConnectingLine: boolean;
|
|
3192
|
+
/** 连接线的临时绘制对象 */
|
|
3193
|
+
_connectingLine: THREE.Line | null;
|
|
3173
3194
|
/** 字体样式 */
|
|
3174
3195
|
fontStyle: string;
|
|
3175
3196
|
/** 下划线 */
|
|
3176
3197
|
underline: boolean;
|
|
3198
|
+
/** 下划线的临时绘制对象 */
|
|
3199
|
+
_underLine: THREE.Line | null;
|
|
3177
3200
|
}
|
|
3178
3201
|
|
|
3179
3202
|
/** @module MxDbSVG*/
|
|
@@ -3352,21 +3375,143 @@ declare class MxDb2LineAngularDimension extends MxDbEntity {
|
|
|
3352
3375
|
getTypeName(): string;
|
|
3353
3376
|
}
|
|
3354
3377
|
|
|
3355
|
-
/**
|
|
3356
|
-
*
|
|
3357
|
-
*
|
|
3358
|
-
|
|
3359
|
-
|
|
3378
|
+
/** 动态绘制形状
|
|
3379
|
+
* 基于THREE.Shape计算实现的2d形状 通过extrude3dConfig 配置可挤压缓冲为3d形状
|
|
3380
|
+
* **/
|
|
3381
|
+
declare class MxDbShape extends MxDbEntity {
|
|
3382
|
+
protected _paths: THREE.CurvePath<THREE.Vector3 | THREE.Vector2>;
|
|
3383
|
+
protected points: THREE.Vector3[];
|
|
3384
|
+
protected closedLine: THREE.Curve<THREE.Vector3>;
|
|
3385
|
+
/** 描边颜色 */
|
|
3386
|
+
stroke: UnstableColor;
|
|
3387
|
+
setStroke(stroke: UnstableColor): this;
|
|
3388
|
+
/** 描边线段的宽度 */
|
|
3389
|
+
strokeLineWidth: number;
|
|
3390
|
+
setStrokeLineWidth(strokeLineWidth: number): this;
|
|
3391
|
+
/** 描边是否为虚线 */
|
|
3392
|
+
isStrokeDashLine: boolean;
|
|
3393
|
+
setIsStrokeDashLine(isStrokeDashLine: boolean): this;
|
|
3394
|
+
/** 填充 */
|
|
3395
|
+
isFill: boolean;
|
|
3396
|
+
setIsFill(isFill: boolean): this;
|
|
3397
|
+
/** 线段细分数值 */
|
|
3398
|
+
curveSegments: number;
|
|
3399
|
+
setCurveSegments(curveSegments: number): this;
|
|
3400
|
+
/** 闭合 */
|
|
3401
|
+
closed: boolean;
|
|
3402
|
+
setClosed(closed: boolean): this;
|
|
3403
|
+
/** 圆角半径 (一个向量点对应一个角的半径值)*/
|
|
3404
|
+
cornerRadius: number[] | number;
|
|
3405
|
+
/**
|
|
3406
|
+
* 设置圆角 圆角的半径(如果参数为数组则一个角度对应一个圆角半径)
|
|
3407
|
+
* @param { number | number[] } radius 圆角半径 为数组时[3, 2, 1, 4]分别对应左上角圆角半径3 右上角2 右下角1 左下角4; 或者直接设置半径值 则四个角统一半径
|
|
3408
|
+
* */
|
|
3409
|
+
setCornerRadius(radius: number | number[], isScreenCoord?: boolean): void;
|
|
3410
|
+
/** 需要输入和输出的属性 */
|
|
3411
|
+
protected _propertyDbKeys: string[];
|
|
3412
|
+
getTypeName(): string;
|
|
3413
|
+
/** 获取坐标集合 */
|
|
3414
|
+
getShapePoints(paths: THREE.CurvePath<THREE.Vector3 | THREE.Vector2>): three.Vector3[];
|
|
3415
|
+
/*** 创建路径 */
|
|
3416
|
+
createPaths(shapes: THREE.Curve<THREE.Vector3 | THREE.Vector2> | THREE.Curve<THREE.Vector3 | THREE.Vector2>[]): three.CurvePath<three.Vector3 | three.Vector2>;
|
|
3417
|
+
/** 动态绘制函数*/
|
|
3418
|
+
_draw(pWorldDraw: McGiWorldDraw, vertices: THREE.Vector3[]): void;
|
|
3419
|
+
/** 获取生成圆角后的点 */
|
|
3420
|
+
getCornerRadiusPoints(points: THREE.Vector3[]): three.Vector3[];
|
|
3421
|
+
/** 绘制描边 */
|
|
3422
|
+
_drawStoreLine(pWorldDraw: McGiWorldDraw, points: THREE.Vector3[], draw?: (pWorldDraw: McGiWorldDraw) => void): void;
|
|
3423
|
+
/** 获取线段闭合后的曲线点数 */
|
|
3424
|
+
getClosedPoints(points: THREE.Vector3[]): three.Vector3[];
|
|
3425
|
+
/** 获取闭合线段 */
|
|
3426
|
+
getClosedLine(points: THREE.Vector3[]): THREE.Curve<THREE.Vector3>;
|
|
3427
|
+
/** 获取长度 */
|
|
3428
|
+
getTotalLength(): number;
|
|
3429
|
+
/** 获取面积 */
|
|
3430
|
+
getArea(): number;
|
|
3431
|
+
worldDraw(pWorldDraw: McGiWorldDraw): void;
|
|
3432
|
+
getGripPoints(): THREE.Vector3[];
|
|
3433
|
+
moveGripPointsAt(index: number, offset: THREE.Vector3): boolean;
|
|
3434
|
+
dwgIn(obj: any): boolean;
|
|
3435
|
+
dwgOut(obj: any): object;
|
|
3436
|
+
}
|
|
3437
|
+
|
|
3438
|
+
/*** 椭圆(弧)形状 */
|
|
3439
|
+
declare class MxDbEllipseShape extends MxDbShape {
|
|
3440
|
+
constructor();
|
|
3441
|
+
getTypeName(): string;
|
|
3442
|
+
/** 弧中心点 */
|
|
3443
|
+
center: three.Vector3;
|
|
3444
|
+
setCenter(center: THREE.Vector3): this;
|
|
3445
|
+
/** X轴椭圆弧半径 默认当前坐标转换下的10像素 */
|
|
3446
|
+
xRadius: number;
|
|
3447
|
+
setXRadius(xRadius: number): this;
|
|
3448
|
+
/** Y轴椭圆弧半径 默认当前坐标转换下的10像素 */
|
|
3449
|
+
yRadius: number;
|
|
3450
|
+
setYRadius(yRadius: number): this;
|
|
3451
|
+
/** 弧开始角度 默认0*/
|
|
3452
|
+
startAngle: number;
|
|
3453
|
+
setStartAngle(startAngle: number): this;
|
|
3454
|
+
/** 弧结束角度 默认0*/
|
|
3455
|
+
endAngle: number;
|
|
3456
|
+
setEndAngle(endAngle: number): this;
|
|
3457
|
+
/** 以顺时针方向创建(扫过)弧线 默认false */
|
|
3458
|
+
clockwise: boolean;
|
|
3459
|
+
setClockwise(clockwise: boolean): this;
|
|
3460
|
+
/** 旋转角度 */
|
|
3461
|
+
rotation: number;
|
|
3462
|
+
setRotation(rotation: number): this;
|
|
3463
|
+
/** 是否闭合到中心位置 */
|
|
3464
|
+
isClosedToCenter: boolean;
|
|
3465
|
+
setIsClosedToCenter(isClosedToCenter: boolean): this;
|
|
3466
|
+
worldDraw(pWorldDraw: McGiWorldDraw): void;
|
|
3467
|
+
/** 绘制椭圆形状 */
|
|
3468
|
+
drawEllipseShape(pWorldDraw: McGiWorldDraw): {
|
|
3469
|
+
/** 圆心角 */
|
|
3470
|
+
centralAngle: number;
|
|
3471
|
+
/** 圆弧曲线 */
|
|
3472
|
+
curve: three.EllipseCurve;
|
|
3473
|
+
/** 构成圆弧的向量点 */
|
|
3474
|
+
points: three.Vector3[];
|
|
3475
|
+
};
|
|
3476
|
+
/** 创建圆弧 */
|
|
3477
|
+
createEllipseCurve(x?: number, y?: number, xRadius?: number, yRadius?: number, startAngle?: number, endAngle?: number, clockwise?: boolean, rotation?: number): three.EllipseCurve;
|
|
3478
|
+
getClosedLine(points: THREE.Vector3[]): three.CatmullRomCurve3;
|
|
3479
|
+
getGripPoints(): three.Vector3[];
|
|
3480
|
+
moveGripPointsAt(index: number, offset: THREE.Vector3): boolean;
|
|
3481
|
+
}
|
|
3482
|
+
|
|
3483
|
+
/*** 圆(弧)形状 */
|
|
3484
|
+
declare class MxDbCircleShape extends MxDbEllipseShape {
|
|
3485
|
+
getTypeName(): string;
|
|
3486
|
+
/*** 圆半径 */
|
|
3487
|
+
get radius(): number;
|
|
3488
|
+
set radius(radius: number);
|
|
3489
|
+
setRadius(radius: number): this;
|
|
3490
|
+
setXRadius(xRadius: number): this;
|
|
3491
|
+
setYRadius(yRadius: number): this;
|
|
3492
|
+
}
|
|
3493
|
+
|
|
3494
|
+
/** 三点动态绘制圆弧 point1圆弧起始点 point2是圆弧结束点, point3圆弧任意一点 */
|
|
3495
|
+
declare class Mx3PointArc extends MxDbCircleShape {
|
|
3496
|
+
constructor();
|
|
3360
3497
|
point1: three.Vector3;
|
|
3361
3498
|
point2: three.Vector3;
|
|
3362
3499
|
point3: three.Vector3;
|
|
3500
|
+
/** 自动确定顺逆时针绘制 */
|
|
3501
|
+
autoClockwise: boolean;
|
|
3363
3502
|
getTypeName(): string;
|
|
3364
|
-
create():
|
|
3503
|
+
create(): Mx3PointArc;
|
|
3365
3504
|
worldDraw(pWorldDraw: McGiWorldDraw): void;
|
|
3366
3505
|
getGripPoints(): THREE.Vector3[];
|
|
3506
|
+
/** 计算三个控制点的角度 */
|
|
3507
|
+
compute3PointAngle(): number[];
|
|
3508
|
+
/** 根据三个控制点更新圆心 */
|
|
3509
|
+
upDateCenter(point1: THREE.Vector3, point2: THREE.Vector3, point3: THREE.Vector3): three.Vector3;
|
|
3510
|
+
/** 根据圆心和一个控制点自动更新半径大小 */
|
|
3511
|
+
upDateRadius(point: THREE.Vector3): number;
|
|
3512
|
+
/** 根据 三个控制点到圆心的角度 更新顺逆时针绘制 */
|
|
3513
|
+
upDataClockwise(angle1: number, angle2: number, angle3: number): void;
|
|
3367
3514
|
moveGripPointsAt(index: number, offset: THREE.Vector3): boolean;
|
|
3368
|
-
dwgIn(obj: any): boolean;
|
|
3369
|
-
dwgOut(obj: any): object;
|
|
3370
3515
|
}
|
|
3371
3516
|
|
|
3372
3517
|
/** @module MxDbCoord*/
|
|
@@ -3829,26 +3974,28 @@ declare class MxDbRectBoxLeadComment extends MxDbEntity {
|
|
|
3829
3974
|
protected onViewChange(): boolean;
|
|
3830
3975
|
}
|
|
3831
3976
|
|
|
3832
|
-
/**
|
|
3833
|
-
|
|
3834
|
-
|
|
3835
|
-
|
|
3836
|
-
|
|
3977
|
+
/** 通过两个构成矩形的点绘制椭圆形 */
|
|
3978
|
+
declare class MxDbEllipse extends MxDbEllipseShape {
|
|
3979
|
+
constructor();
|
|
3980
|
+
getTypeName(): string;
|
|
3981
|
+
create(): MxDbEllipse;
|
|
3982
|
+
/** 开始点 */
|
|
3837
3983
|
point1: three.Vector3;
|
|
3838
|
-
|
|
3984
|
+
setPoint1(point1: THREE.Vector3): this;
|
|
3985
|
+
/** 结束点 */
|
|
3839
3986
|
point2: three.Vector3;
|
|
3840
|
-
|
|
3987
|
+
setPoint2(point2: THREE.Vector3): this;
|
|
3988
|
+
isClosedToCenter: boolean;
|
|
3989
|
+
closed: boolean;
|
|
3841
3990
|
worldDraw(pWorldDraw: McGiWorldDraw): void;
|
|
3842
3991
|
getGripPoints(): THREE.Vector3[];
|
|
3843
3992
|
moveGripPointsAt(index: number, offset: THREE.Vector3): boolean;
|
|
3844
|
-
create(): MxDbEntity;
|
|
3845
|
-
dwgIn(obj: any): boolean;
|
|
3846
|
-
dwgOut(obj: any): object;
|
|
3847
3993
|
}
|
|
3848
3994
|
|
|
3849
3995
|
declare type SpriteTextColorType = THREE.Color | string | number | CanvasGradient | CanvasPattern | undefined;
|
|
3850
3996
|
declare type SpriteTextObj = SpriteText;
|
|
3851
3997
|
declare type TextFontWeight = 'normal' | 'bold' | 'lighter' | 'bolder' | 'inherit' | number;
|
|
3998
|
+
declare type TextFontStyle = 'normal' | 'italic' | 'oblique';
|
|
3852
3999
|
declare class SpriteText extends THREE.Sprite {
|
|
3853
4000
|
constructor(options?: SpriteTextOptions);
|
|
3854
4001
|
text: string;
|
|
@@ -3872,6 +4019,8 @@ declare class SpriteText extends THREE.Sprite {
|
|
|
3872
4019
|
angle: number;
|
|
3873
4020
|
textScale: number;
|
|
3874
4021
|
underline: boolean;
|
|
4022
|
+
fontStyle: TextFontStyle;
|
|
4023
|
+
fontVariant: string;
|
|
3875
4024
|
private _genCanvas;
|
|
3876
4025
|
dispose(): void;
|
|
3877
4026
|
}
|
|
@@ -3898,6 +4047,8 @@ interface SpriteTextOptions {
|
|
|
3898
4047
|
angle?: number;
|
|
3899
4048
|
scale?: number;
|
|
3900
4049
|
underline?: boolean;
|
|
4050
|
+
fontStyle?: TextFontStyle;
|
|
4051
|
+
fontVariant?: string;
|
|
3901
4052
|
}
|
|
3902
4053
|
|
|
3903
4054
|
/**
|
|
@@ -4116,6 +4267,102 @@ declare class MxDbGradientLine extends MxDbEntity {
|
|
|
4116
4267
|
dwgOut(obj: any): object;
|
|
4117
4268
|
}
|
|
4118
4269
|
|
|
4270
|
+
/**
|
|
4271
|
+
* 根据中心点、椭圆开始点和结束点确定椭圆弧
|
|
4272
|
+
* */
|
|
4273
|
+
declare class MxDbEllipseArc extends MxDbEllipseShape {
|
|
4274
|
+
getTypeName(): string;
|
|
4275
|
+
constructor();
|
|
4276
|
+
/** 椭圆弧决定开始点 控制x轴半径和开始角度 */
|
|
4277
|
+
startPoint: THREE.Vector3;
|
|
4278
|
+
setStartPoint(startPoint: THREE.Vector3): this;
|
|
4279
|
+
/** 椭圆弧决定结束点 控制y轴半径和结束角度*/
|
|
4280
|
+
endPoint: THREE.Vector3;
|
|
4281
|
+
setEndPoint(endPoint: THREE.Vector3): this;
|
|
4282
|
+
/** 控制椭圆弧旋转角度的点 */
|
|
4283
|
+
rotationPoint: THREE.Vector3;
|
|
4284
|
+
setRotationPoint(rotationPoint: THREE.Vector3): this;
|
|
4285
|
+
worldDraw(pWorldDraw: McGiWorldDraw): void;
|
|
4286
|
+
getGripPoints(): three.Vector3[];
|
|
4287
|
+
moveGripPointsAt(index: number, offset: THREE.Vector3): boolean;
|
|
4288
|
+
}
|
|
4289
|
+
|
|
4290
|
+
/** 根据圆心、起始点、结束点位置动态绘制圆弧 **/
|
|
4291
|
+
declare class MxDbCircleArc extends MxDbCircleShape {
|
|
4292
|
+
constructor();
|
|
4293
|
+
getTypeName(): string;
|
|
4294
|
+
/** 圆弧开始点 设置开始点将自动计算 radius、startAngle、endAngle */
|
|
4295
|
+
startPoint: THREE.Vector3;
|
|
4296
|
+
setStartPoint(startPoint: THREE.Vector3): this;
|
|
4297
|
+
/** 圆弧结束点 设置结束点将自动计算 radius、startAngle、endAngle */
|
|
4298
|
+
endPoint: THREE.Vector3;
|
|
4299
|
+
setEndPoint(endPoint: THREE.Vector3): this;
|
|
4300
|
+
worldDraw(pWorldDraw: McGiWorldDraw): void;
|
|
4301
|
+
computePointAngle(point: THREE.Vector3): number;
|
|
4302
|
+
getGripPoints(): three.Vector3[];
|
|
4303
|
+
moveGripPointsAt(index: number, offset: THREE.Vector3): boolean;
|
|
4304
|
+
}
|
|
4305
|
+
|
|
4306
|
+
/** 弧形 */
|
|
4307
|
+
declare class MxDbArcShape extends MxDbCircleArc {
|
|
4308
|
+
constructor();
|
|
4309
|
+
getTypeName(): string;
|
|
4310
|
+
create(): MxDbArcShape;
|
|
4311
|
+
center: three.Vector3;
|
|
4312
|
+
innerRadius: number;
|
|
4313
|
+
outerRadius: number;
|
|
4314
|
+
worldDraw(pWorldDraw: McGiWorldDraw): void;
|
|
4315
|
+
drawArcShape(pWorldDraw: McGiWorldDraw): void;
|
|
4316
|
+
getGripPoints(): THREE.Vector3[];
|
|
4317
|
+
moveGripPointsAt(index: number, offset: THREE.Vector3): boolean;
|
|
4318
|
+
}
|
|
4319
|
+
|
|
4320
|
+
/** 绘制弧形 */
|
|
4321
|
+
declare class MxDbArcShapeDraw extends MxDbArcShape {
|
|
4322
|
+
getTypeName(): string;
|
|
4323
|
+
constructor();
|
|
4324
|
+
outerRadiusPoint: three.Vector3;
|
|
4325
|
+
interRadiusPoint: three.Vector3;
|
|
4326
|
+
worldDraw(pWorldDraw: McGiWorldDraw): void;
|
|
4327
|
+
getGripPoints(): THREE.Vector3[];
|
|
4328
|
+
moveGripPointsAt(index: number, offset: THREE.Vector3): boolean;
|
|
4329
|
+
}
|
|
4330
|
+
|
|
4331
|
+
/** 环形 */
|
|
4332
|
+
declare class MxDbRingShape extends MxDbArcShape {
|
|
4333
|
+
getTypeName(): string;
|
|
4334
|
+
worldDraw(pWorldDraw: McGiWorldDraw): void;
|
|
4335
|
+
}
|
|
4336
|
+
|
|
4337
|
+
/** 星形 */
|
|
4338
|
+
declare class MxDbStarShape extends MxDbShape {
|
|
4339
|
+
getTypeName(): string;
|
|
4340
|
+
constructor();
|
|
4341
|
+
center: three.Vector3;
|
|
4342
|
+
numPoints: number;
|
|
4343
|
+
innerRadius: number;
|
|
4344
|
+
outerRadius: number;
|
|
4345
|
+
worldDraw(pWorldDraw: McGiWorldDraw): void;
|
|
4346
|
+
getGripPoints(): THREE.Vector3[];
|
|
4347
|
+
moveGripPointsAt(index: number, offset: THREE.Vector3): boolean;
|
|
4348
|
+
}
|
|
4349
|
+
|
|
4350
|
+
/** 等边多边形 */
|
|
4351
|
+
declare class MxDbRegularPolygonShape extends MxDbShape {
|
|
4352
|
+
center: three.Vector3;
|
|
4353
|
+
sides: number;
|
|
4354
|
+
radius: number;
|
|
4355
|
+
getTypeName(): string;
|
|
4356
|
+
constructor();
|
|
4357
|
+
worldDraw(pWorldDraw: McGiWorldDraw): void;
|
|
4358
|
+
_getPoints(): {
|
|
4359
|
+
x: number;
|
|
4360
|
+
y: number;
|
|
4361
|
+
}[];
|
|
4362
|
+
getGripPoints(): THREE.Vector3[];
|
|
4363
|
+
moveGripPointsAt(index: number, offset: THREE.Vector3): boolean;
|
|
4364
|
+
}
|
|
4365
|
+
|
|
4119
4366
|
declare const Mx_loadCoreCode: typeof loadCoreCode;
|
|
4120
4367
|
declare const Mx_useCanvasResizeListener: typeof useCanvasResizeListener;
|
|
4121
4368
|
declare const Mx_store: typeof store;
|
|
@@ -4190,6 +4437,24 @@ declare const Mx_MxCADObject: typeof MxCADObject;
|
|
|
4190
4437
|
type Mx_MxDbGroup = MxDbGroup;
|
|
4191
4438
|
type Mx_MxDbGradientLine = MxDbGradientLine;
|
|
4192
4439
|
declare const Mx_MxDbGradientLine: typeof MxDbGradientLine;
|
|
4440
|
+
type Mx_MxDbShape = MxDbShape;
|
|
4441
|
+
declare const Mx_MxDbShape: typeof MxDbShape;
|
|
4442
|
+
type Mx_MxDbEllipseShape = MxDbEllipseShape;
|
|
4443
|
+
declare const Mx_MxDbEllipseShape: typeof MxDbEllipseShape;
|
|
4444
|
+
type Mx_MxDbEllipseArc = MxDbEllipseArc;
|
|
4445
|
+
declare const Mx_MxDbEllipseArc: typeof MxDbEllipseArc;
|
|
4446
|
+
type Mx_MxDbCircleShape = MxDbCircleShape;
|
|
4447
|
+
declare const Mx_MxDbCircleShape: typeof MxDbCircleShape;
|
|
4448
|
+
type Mx_MxDbCircleArc = MxDbCircleArc;
|
|
4449
|
+
declare const Mx_MxDbCircleArc: typeof MxDbCircleArc;
|
|
4450
|
+
type Mx_MxDbArcShapeDraw = MxDbArcShapeDraw;
|
|
4451
|
+
declare const Mx_MxDbArcShapeDraw: typeof MxDbArcShapeDraw;
|
|
4452
|
+
type Mx_MxDbRingShape = MxDbRingShape;
|
|
4453
|
+
declare const Mx_MxDbRingShape: typeof MxDbRingShape;
|
|
4454
|
+
type Mx_MxDbStarShape = MxDbStarShape;
|
|
4455
|
+
declare const Mx_MxDbStarShape: typeof MxDbStarShape;
|
|
4456
|
+
type Mx_MxDbRegularPolygonShape = MxDbRegularPolygonShape;
|
|
4457
|
+
declare const Mx_MxDbRegularPolygonShape: typeof MxDbRegularPolygonShape;
|
|
4193
4458
|
declare namespace Mx {
|
|
4194
4459
|
export {
|
|
4195
4460
|
Mx_loadCoreCode as loadCoreCode,
|
|
@@ -4236,7 +4501,16 @@ declare namespace Mx {
|
|
|
4236
4501
|
Mx_MxCADObject as MxCADObject,
|
|
4237
4502
|
Mx_MxDbGroup as MxDbGroup,
|
|
4238
4503
|
Mx_MxDbGradientLine as MxDbGradientLine,
|
|
4504
|
+
Mx_MxDbShape as MxDbShape,
|
|
4505
|
+
Mx_MxDbEllipseShape as MxDbEllipseShape,
|
|
4506
|
+
Mx_MxDbEllipseArc as MxDbEllipseArc,
|
|
4507
|
+
Mx_MxDbCircleShape as MxDbCircleShape,
|
|
4508
|
+
Mx_MxDbCircleArc as MxDbCircleArc,
|
|
4509
|
+
Mx_MxDbArcShapeDraw as MxDbArcShapeDraw,
|
|
4510
|
+
Mx_MxDbRingShape as MxDbRingShape,
|
|
4511
|
+
Mx_MxDbStarShape as MxDbStarShape,
|
|
4512
|
+
Mx_MxDbRegularPolygonShape as MxDbRegularPolygonShape,
|
|
4239
4513
|
};
|
|
4240
4514
|
}
|
|
4241
4515
|
|
|
4242
|
-
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 };
|
|
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 };
|
|
@@ -1,19 +1,24 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
* 通过三个坐标点绘制一段圆弧
|
|
7
|
-
*/
|
|
8
|
-
export default class Mx3PointArc extends MxDbEntity {
|
|
1
|
+
import McGiWorldDraw from "../McGiWorldDraw";
|
|
2
|
+
import MxDbCircleShape from "../MxDbCircleShape";
|
|
3
|
+
/** 三点动态绘制圆弧 point1圆弧起始点 point2是圆弧结束点, point3圆弧任意一点 */
|
|
4
|
+
export default class Mx3PointArc extends MxDbCircleShape {
|
|
5
|
+
constructor();
|
|
9
6
|
point1: import("three").Vector3;
|
|
10
7
|
point2: import("three").Vector3;
|
|
11
8
|
point3: import("three").Vector3;
|
|
9
|
+
/** 自动确定顺逆时针绘制 */
|
|
10
|
+
autoClockwise: boolean;
|
|
12
11
|
getTypeName(): string;
|
|
13
|
-
create():
|
|
12
|
+
create(): Mx3PointArc;
|
|
14
13
|
worldDraw(pWorldDraw: McGiWorldDraw): void;
|
|
15
14
|
getGripPoints(): THREE.Vector3[];
|
|
15
|
+
/** 计算三个控制点的角度 */
|
|
16
|
+
compute3PointAngle(): number[];
|
|
17
|
+
/** 根据三个控制点更新圆心 */
|
|
18
|
+
upDateCenter(point1: THREE.Vector3, point2: THREE.Vector3, point3: THREE.Vector3): import("three").Vector3;
|
|
19
|
+
/** 根据圆心和一个控制点自动更新半径大小 */
|
|
20
|
+
upDateRadius(point: THREE.Vector3): number;
|
|
21
|
+
/** 根据 三个控制点到圆心的角度 更新顺逆时针绘制 */
|
|
22
|
+
upDataClockwise(angle1: number, angle2: number, angle3: number): void;
|
|
16
23
|
moveGripPointsAt(index: number, offset: THREE.Vector3): boolean;
|
|
17
|
-
dwgIn(obj: any): boolean;
|
|
18
|
-
dwgOut(obj: any): object;
|
|
19
24
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import{calculateArcAngle,calculateArcOrigin,calculateRadiusArc,judgementArcRenderDirection}from"../../tools/three";import MxDbCircleShape from"../MxDbCircleShape";export default class Mx3PointArc extends MxDbCircleShape{constructor(){super(),this.point1=new THREE.Vector3,this.point2=new THREE.Vector3,this.point3=new THREE.Vector3,this.autoClockwise=!0,this._propertyDbKeys=[...this._propertyDbKeys,"point1","point2","point3","autoClockwise"]}getTypeName(){return"Mx3PointArc"}create(){return new Mx3PointArc}worldDraw(t){let{point1:e,point2:i,point3:n}=this;this.upDateCenter(e,i,n),this.upDateRadius(e);const[r,s,o]=this.compute3PointAngle();this.upDataClockwise(r,s,o),this.startAngle=THREE.MathUtils.degToRad(r),this.endAngle=THREE.MathUtils.degToRad(s),this.drawEllipseShape(t)}getGripPoints(){return[this.point1,this.point2,this.point3,this.center]}compute3PointAngle(){const{point1:t,point2:e,point3:i}=this,n=calculateArcAngle(t,this.center,this.radius),r=calculateArcAngle(e,this.center,this.radius),s=calculateArcAngle(i,this.center,this.radius);return[n.angle,r.angle,s.angle]}upDateCenter(t,e,i){return this.center=calculateArcOrigin(t,e,i),this.center}upDateRadius(t){return this.radius=calculateRadiusArc(t,this.center),this.radius}upDataClockwise(t,e,i){const{autoClockwise:n}=this;n&&(this.clockwise=judgementArcRenderDirection(e,t,i))}moveGripPointsAt(t,e){return 0===t?this.point1.add(e):1===t?this.point2.add(e):2===t?this.point3.add(e):3===t&&(this.point1.add(e),this.point2.add(e),this.point3.add(e)),this.upDateCenter(this.point1,this.point2,this.point3),!0}};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import McGiWorldDraw from "../McGiWorldDraw";
|
|
2
|
+
import MxDbCircleArc from "../MxDbCircleArc";
|
|
3
|
+
/** 弧形 */
|
|
4
|
+
export default class MxDbArcShape extends MxDbCircleArc {
|
|
5
|
+
constructor();
|
|
6
|
+
getTypeName(): string;
|
|
7
|
+
create(): MxDbArcShape;
|
|
8
|
+
center: import("three").Vector3;
|
|
9
|
+
innerRadius: number;
|
|
10
|
+
outerRadius: number;
|
|
11
|
+
worldDraw(pWorldDraw: McGiWorldDraw): void;
|
|
12
|
+
drawArcShape(pWorldDraw: McGiWorldDraw): void;
|
|
13
|
+
getGripPoints(): THREE.Vector3[];
|
|
14
|
+
moveGripPointsAt(index: number, offset: THREE.Vector3): boolean;
|
|
15
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import MxDbCircleArc from"../MxDbCircleArc";export default class MxDbArcShape extends MxDbCircleArc{constructor(){super(),this.center=new THREE.Vector3,this.innerRadius=10,this.outerRadius=20,this._propertyDbKeys=[...this._propertyDbKeys,"center","innerRadius","outerRadius"]}getTypeName(){return"MxDbArcShape"}create(){return new MxDbArcShape}worldDraw(e){this.drawArcShape(e)}drawArcShape(e){const{center:t,startAngle:r,endAngle:s,clockwise:i}=this,{x:n,y:a}=t;this.isClosedToCenter=!1;const c=this.createEllipseCurve(n,a,this.innerRadius,this.innerRadius,r,s,i),h=this.createEllipseCurve(n,a,this.outerRadius,this.outerRadius,s,r,!i),o=this.createPaths([c,h]);let u=this.getShapePoints(o);this._draw(e,u),this._drawStoreLine(e,u)}getGripPoints(){return[this.center]}moveGripPointsAt(e,t){return 0===e&&this.center.add(t),!0}};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import McGiWorldDraw from "../McGiWorldDraw";
|
|
2
|
+
import MxDbArcShape from "../MxDbArcShape";
|
|
3
|
+
/** 绘制弧形 */
|
|
4
|
+
export default class MxDbArcShapeDraw extends MxDbArcShape {
|
|
5
|
+
getTypeName(): string;
|
|
6
|
+
constructor();
|
|
7
|
+
outerRadiusPoint: import("three").Vector3;
|
|
8
|
+
interRadiusPoint: import("three").Vector3;
|
|
9
|
+
worldDraw(pWorldDraw: McGiWorldDraw): void;
|
|
10
|
+
getGripPoints(): THREE.Vector3[];
|
|
11
|
+
moveGripPointsAt(index: number, offset: THREE.Vector3): boolean;
|
|
12
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{calculateArcAngle}from"../../tools/three";import MxDbArcShape from"../MxDbArcShape";export default class MxDbArcShapeDraw extends MxDbArcShape{constructor(){super(),this.outerRadiusPoint=new THREE.Vector3,this.interRadiusPoint=new THREE.Vector3,this._propertyDbKeys=[...this._propertyDbKeys,"interRadiusPoint","outerRadiusPoint"]}getTypeName(){return"MxDbArcShapeDraw"}worldDraw(t){this.innerRadius=this.center.distanceTo(this.interRadiusPoint),this.outerRadius=this.center.distanceTo(this.outerRadiusPoint),this.startAngle=THREE.MathUtils.degToRad(calculateArcAngle(this.interRadiusPoint,this.center,this.innerRadius).angle),this.endAngle=THREE.MathUtils.degToRad(calculateArcAngle(this.outerRadiusPoint,this.center,this.outerRadius).angle),this.drawArcShape(t)}getGripPoints(){return[this.center,this.interRadiusPoint,this.outerRadiusPoint]}moveGripPointsAt(t,i){return 0===t&&(this.center.add(i),this.interRadiusPoint.add(i),this.outerRadiusPoint.add(i)),1===t&&this.interRadiusPoint.add(i),2===t&&this.outerRadiusPoint.add(i),!0}};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import McGiWorldDraw from "../McGiWorldDraw";
|
|
2
|
+
import MxDbCircleShape from "../MxDbCircleShape";
|
|
3
|
+
/** 根据圆心、起始点、结束点位置动态绘制圆弧 **/
|
|
4
|
+
export default class MxDbCircleArc extends MxDbCircleShape {
|
|
5
|
+
constructor();
|
|
6
|
+
getTypeName(): string;
|
|
7
|
+
/** 圆弧开始点 设置开始点将自动计算 radius、startAngle、endAngle */
|
|
8
|
+
startPoint: THREE.Vector3;
|
|
9
|
+
setStartPoint(startPoint: THREE.Vector3): this;
|
|
10
|
+
/** 圆弧结束点 设置结束点将自动计算 radius、startAngle、endAngle */
|
|
11
|
+
endPoint: THREE.Vector3;
|
|
12
|
+
setEndPoint(endPoint: THREE.Vector3): this;
|
|
13
|
+
worldDraw(pWorldDraw: McGiWorldDraw): void;
|
|
14
|
+
computePointAngle(point: THREE.Vector3): number;
|
|
15
|
+
getGripPoints(): import("three").Vector3[];
|
|
16
|
+
moveGripPointsAt(index: number, offset: THREE.Vector3): boolean;
|
|
17
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{calculateArcAngle}from"../../tools/three";import MxDbCircleShape from"../MxDbCircleShape";export default class MxDbCircleArc extends MxDbCircleShape{constructor(){super(),this._propertyDbKeys=[...this._propertyDbKeys,"startPoint","endPoint"]}getTypeName(){return"MxDbCircleArc"}setStartPoint(t){return this.startPoint=t,this}setEndPoint(t){return this.endPoint=t,this}worldDraw(t){let{startPoint:e,endPoint:i}=this;if(e&&(this.startAngle=this.computePointAngle(e)),i&&(this.endAngle=this.computePointAngle(i)),e&&i){const{points:e}=this.drawEllipseShape(t);this.startPoint=e[0]}}computePointAngle(t){return this.radius=this.center.distanceTo(t),THREE.MathUtils.degToRad(calculateArcAngle(t,this.center,this.radius).angle)}getGripPoints(){return[this.center,this.startPoint,this.endPoint]}moveGripPointsAt(t,e){return 0===t?(this.center.add(e),this.startPoint.add(e),this.endPoint.add(e)):1===t?this.startPoint.add(e):2===t&&this.endPoint.add(e),!0}};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import MxDbEllipseShape from "../MxDbEllipseShape";
|
|
2
|
+
/*** 圆(弧)形状 */
|
|
3
|
+
export default class MxDbCircleShape extends MxDbEllipseShape {
|
|
4
|
+
getTypeName(): string;
|
|
5
|
+
/*** 圆半径 */
|
|
6
|
+
get radius(): number;
|
|
7
|
+
set radius(radius: number);
|
|
8
|
+
setRadius(radius: number): this;
|
|
9
|
+
setXRadius(xRadius: number): this;
|
|
10
|
+
setYRadius(yRadius: number): this;
|
|
11
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import MxDbEllipseShape from"../MxDbEllipseShape";export default class MxDbCircleShape extends MxDbEllipseShape{getTypeName(){return"MxDbCircleShape"}get radius(){return this.xRadius}set radius(s){this.xRadius=s,this.yRadius=s}setRadius(s){return this.radius=s,this}setXRadius(s){return this.setRadius(s),this}setYRadius(s){return this.setRadius(s),this}};
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
/**
|
|
1
|
+
import McGiWorldDraw from "../McGiWorldDraw";
|
|
2
|
+
import MxDbEllipseShape from "../MxDbEllipseShape";
|
|
3
|
+
/** 通过两个构成矩形的点绘制椭圆形 */
|
|
4
|
+
export default class MxDbEllipse extends MxDbEllipseShape {
|
|
5
|
+
constructor();
|
|
6
|
+
getTypeName(): string;
|
|
7
|
+
create(): MxDbEllipse;
|
|
8
|
+
/** 开始点 */
|
|
9
9
|
point1: import("three").Vector3;
|
|
10
|
-
|
|
10
|
+
setPoint1(point1: THREE.Vector3): this;
|
|
11
|
+
/** 结束点 */
|
|
11
12
|
point2: import("three").Vector3;
|
|
12
|
-
|
|
13
|
+
setPoint2(point2: THREE.Vector3): this;
|
|
14
|
+
isClosedToCenter: boolean;
|
|
15
|
+
closed: boolean;
|
|
13
16
|
worldDraw(pWorldDraw: McGiWorldDraw): void;
|
|
14
17
|
getGripPoints(): THREE.Vector3[];
|
|
15
18
|
moveGripPointsAt(index: number, offset: THREE.Vector3): boolean;
|
|
16
|
-
create(): MxDbEntity;
|
|
17
|
-
dwgIn(obj: any): boolean;
|
|
18
|
-
dwgOut(obj: any): object;
|
|
19
19
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import McGiWorldDrawType from"../McGiWorldDrawType";import MxDbEllipseShape from"../MxDbEllipseShape";export default class MxDbEllipse extends MxDbEllipseShape{constructor(){super(),this.point1=new THREE.Vector3,this.point2=new THREE.Vector3,this.isClosedToCenter=!1,this.closed=!1,this._propertyDbKeys=[...this._propertyDbKeys,"point1","point2"]}getTypeName(){return"MxDbEllipse"}create(){return new MxDbEllipse}setPoint1(t){return this.point1=t,this}setPoint2(t){return this.point2=t,this}worldDraw(t){const{point1:i,point2:e}=this,s=i.clone().set(e.x,i.y,e.z),o=e.clone().set(i.x,e.y,i.z);this.xRadius=i.distanceTo(s)/2,this.yRadius=i.distanceTo(o)/2;const n=i.x>e.x,r=i.y>e.y,p=n?i.x-this.xRadius:i.x+this.xRadius,h=r?i.y-this.yRadius:i.y+this.yRadius;this.center=new THREE.Vector3(p,h,0),this.drawEllipseShape(t),t.getType()===McGiWorldDrawType.kSelectDraw&&t.drawLines([i,new THREE.Vector3(i.x,e.y),e,new THREE.Vector3(e.x,i.y),i])}getGripPoints(){let t=new THREE.Vector3(.5*(this.point2.x+this.point1.x),.5*(this.point2.y+this.point1.y),0);return[this.point1,this.point2,t]}moveGripPointsAt(t,i){return 0===t?this.point1.add(i):1===t?this.point2.add(i):2===t&&(this.point1.add(i),this.point2.add(i)),!0}};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import McGiWorldDraw from "../McGiWorldDraw";
|
|
2
|
+
import MxDbEllipseShape from "../MxDbEllipseShape";
|
|
3
|
+
/**
|
|
4
|
+
* 根据中心点、椭圆开始点和结束点确定椭圆弧
|
|
5
|
+
* */
|
|
6
|
+
export default class MxDbEllipseArc extends MxDbEllipseShape {
|
|
7
|
+
getTypeName(): string;
|
|
8
|
+
constructor();
|
|
9
|
+
/** 椭圆弧决定开始点 控制x轴半径和开始角度 */
|
|
10
|
+
startPoint: THREE.Vector3;
|
|
11
|
+
setStartPoint(startPoint: THREE.Vector3): this;
|
|
12
|
+
/** 椭圆弧决定结束点 控制y轴半径和结束角度*/
|
|
13
|
+
endPoint: THREE.Vector3;
|
|
14
|
+
setEndPoint(endPoint: THREE.Vector3): this;
|
|
15
|
+
/** 控制椭圆弧旋转角度的点 */
|
|
16
|
+
rotationPoint: THREE.Vector3;
|
|
17
|
+
setRotationPoint(rotationPoint: THREE.Vector3): this;
|
|
18
|
+
worldDraw(pWorldDraw: McGiWorldDraw): void;
|
|
19
|
+
getGripPoints(): import("three").Vector3[];
|
|
20
|
+
moveGripPointsAt(index: number, offset: THREE.Vector3): boolean;
|
|
21
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{calculateArcAngle}from"../../tools/three";import MxDbEllipseShape from"../MxDbEllipseShape";export default class MxDbEllipseArc extends MxDbEllipseShape{constructor(){super(),this._propertyDbKeys=[...this._propertyDbKeys,"startPoint","endPoint","rotationPoint"]}getTypeName(){return"MxDbEllipseArc"}setStartPoint(t){return this.startPoint=t,this}setEndPoint(t){return this.endPoint=t,this}setRotationPoint(t){return this.rotationPoint=t,this}worldDraw(t){let{center:i,startPoint:e,endPoint:s,rotationPoint:n}=this;e&&(this.xRadius=i.distanceTo(e),this.startAngle=THREE.MathUtils.degToRad(calculateArcAngle(e,i,this.xRadius).angle)),s&&(this.yRadius=i.distanceTo(s),this.endAngle=THREE.MathUtils.degToRad(calculateArcAngle(s,i,this.yRadius).angle)),n&&(this.rotation=THREE.MathUtils.degToRad(calculateArcAngle(n,i,i.distanceTo(n)).angle)),this.drawEllipseShape(t)}getGripPoints(){return[this.center,this.startPoint,this.endPoint,this.rotationPoint]}moveGripPointsAt(t,i){return 0===t&&(this.center.add(i),this.startPoint.add(i),this.endPoint.add(i),this.rotationPoint.add(i)),1===t&&this.startPoint.add(i),2===t&&this.endPoint.add(i),3===t&&this.rotationPoint.add(i),!0}};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import McGiWorldDraw from "../McGiWorldDraw";
|
|
2
|
+
import MxDbShape from "../MxDbShape";
|
|
3
|
+
/*** 椭圆(弧)形状 */
|
|
4
|
+
export default class MxDbEllipseShape extends MxDbShape {
|
|
5
|
+
constructor();
|
|
6
|
+
getTypeName(): string;
|
|
7
|
+
/** 弧中心点 */
|
|
8
|
+
center: import("three").Vector3;
|
|
9
|
+
setCenter(center: THREE.Vector3): this;
|
|
10
|
+
/** X轴椭圆弧半径 默认当前坐标转换下的10像素 */
|
|
11
|
+
xRadius: number;
|
|
12
|
+
setXRadius(xRadius: number): this;
|
|
13
|
+
/** Y轴椭圆弧半径 默认当前坐标转换下的10像素 */
|
|
14
|
+
yRadius: number;
|
|
15
|
+
setYRadius(yRadius: number): this;
|
|
16
|
+
/** 弧开始角度 默认0*/
|
|
17
|
+
startAngle: number;
|
|
18
|
+
setStartAngle(startAngle: number): this;
|
|
19
|
+
/** 弧结束角度 默认0*/
|
|
20
|
+
endAngle: number;
|
|
21
|
+
setEndAngle(endAngle: number): this;
|
|
22
|
+
/** 以顺时针方向创建(扫过)弧线 默认false */
|
|
23
|
+
clockwise: boolean;
|
|
24
|
+
setClockwise(clockwise: boolean): this;
|
|
25
|
+
/** 旋转角度 */
|
|
26
|
+
rotation: number;
|
|
27
|
+
setRotation(rotation: number): this;
|
|
28
|
+
/** 是否闭合到中心位置 */
|
|
29
|
+
isClosedToCenter: boolean;
|
|
30
|
+
setIsClosedToCenter(isClosedToCenter: boolean): this;
|
|
31
|
+
worldDraw(pWorldDraw: McGiWorldDraw): void;
|
|
32
|
+
/** 绘制椭圆形状 */
|
|
33
|
+
drawEllipseShape(pWorldDraw: McGiWorldDraw): {
|
|
34
|
+
/** 圆心角 */
|
|
35
|
+
centralAngle: number;
|
|
36
|
+
/** 圆弧曲线 */
|
|
37
|
+
curve: import("three").EllipseCurve;
|
|
38
|
+
/** 构成圆弧的向量点 */
|
|
39
|
+
points: import("three").Vector3[];
|
|
40
|
+
};
|
|
41
|
+
/** 创建圆弧 */
|
|
42
|
+
createEllipseCurve(x?: number, y?: number, xRadius?: number, yRadius?: number, startAngle?: number, endAngle?: number, clockwise?: boolean, rotation?: number): import("three").EllipseCurve;
|
|
43
|
+
getClosedLine(points: THREE.Vector3[]): import("three").CatmullRomCurve3;
|
|
44
|
+
getGripPoints(): import("three").Vector3[];
|
|
45
|
+
moveGripPointsAt(index: number, offset: THREE.Vector3): boolean;
|
|
46
|
+
}
|
|
@@ -0,0 +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}};
|