mxdraw 0.1.118 → 0.1.120
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 +297 -25
- 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/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/MxDbText.d.ts +10 -5
- package/dist/lib/MxModule/MxDbText/MxDbText.js +1 -1
- package/dist/lib/MxModule/MxDbText/SpriteText.d.ts +11 -2
- 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
|
@@ -1752,6 +1752,15 @@ declare class MxDrawObject {
|
|
|
1752
1752
|
* ```
|
|
1753
1753
|
*/
|
|
1754
1754
|
getMxObjectImplement(): any;
|
|
1755
|
+
/**
|
|
1756
|
+
* 得到所有布局名
|
|
1757
|
+
* @example
|
|
1758
|
+
* ```typescript
|
|
1759
|
+
*
|
|
1760
|
+
*
|
|
1761
|
+
* ```
|
|
1762
|
+
*/
|
|
1763
|
+
getAllLayoutName(): string[];
|
|
1755
1764
|
}
|
|
1756
1765
|
|
|
1757
1766
|
/**
|
|
@@ -3161,10 +3170,14 @@ declare class MxDbSVGText {
|
|
|
3161
3170
|
move: boolean;
|
|
3162
3171
|
/** 文字移动到距图片远处,自动绘制一个连接线 */
|
|
3163
3172
|
drawConnectingLine: boolean;
|
|
3173
|
+
/** 连接线的临时绘制对象 */
|
|
3174
|
+
_connectingLine: THREE.Line | null;
|
|
3164
3175
|
/** 字体样式 */
|
|
3165
3176
|
fontStyle: string;
|
|
3166
3177
|
/** 下划线 */
|
|
3167
3178
|
underline: boolean;
|
|
3179
|
+
/** 下划线的临时绘制对象 */
|
|
3180
|
+
_underLine: THREE.Line | null;
|
|
3168
3181
|
}
|
|
3169
3182
|
|
|
3170
3183
|
/** @module MxDbSVG*/
|
|
@@ -3343,21 +3356,143 @@ declare class MxDb2LineAngularDimension extends MxDbEntity {
|
|
|
3343
3356
|
getTypeName(): string;
|
|
3344
3357
|
}
|
|
3345
3358
|
|
|
3346
|
-
/**
|
|
3347
|
-
*
|
|
3348
|
-
*
|
|
3349
|
-
|
|
3350
|
-
|
|
3359
|
+
/** 动态绘制形状
|
|
3360
|
+
* 基于THREE.Shape计算实现的2d形状 通过extrude3dConfig 配置可挤压缓冲为3d形状
|
|
3361
|
+
* **/
|
|
3362
|
+
declare class MxDbShape extends MxDbEntity {
|
|
3363
|
+
protected _paths: THREE.CurvePath<THREE.Vector3 | THREE.Vector2>;
|
|
3364
|
+
protected points: THREE.Vector3[];
|
|
3365
|
+
protected closedLine: THREE.Curve<THREE.Vector3>;
|
|
3366
|
+
/** 描边颜色 */
|
|
3367
|
+
stroke: UnstableColor;
|
|
3368
|
+
setStroke(stroke: UnstableColor): this;
|
|
3369
|
+
/** 描边线段的宽度 */
|
|
3370
|
+
strokeLineWidth: number;
|
|
3371
|
+
setStrokeLineWidth(strokeLineWidth: number): this;
|
|
3372
|
+
/** 描边是否为虚线 */
|
|
3373
|
+
isStrokeDashLine: boolean;
|
|
3374
|
+
setIsStrokeDashLine(isStrokeDashLine: boolean): this;
|
|
3375
|
+
/** 填充 */
|
|
3376
|
+
isFill: boolean;
|
|
3377
|
+
setIsFill(isFill: boolean): this;
|
|
3378
|
+
/** 线段细分数值 */
|
|
3379
|
+
curveSegments: number;
|
|
3380
|
+
setCurveSegments(curveSegments: number): this;
|
|
3381
|
+
/** 闭合 */
|
|
3382
|
+
closed: boolean;
|
|
3383
|
+
setClosed(closed: boolean): this;
|
|
3384
|
+
/** 圆角半径 (一个向量点对应一个角的半径值)*/
|
|
3385
|
+
cornerRadius: number[] | number;
|
|
3386
|
+
/**
|
|
3387
|
+
* 设置圆角 圆角的半径(如果参数为数组则一个角度对应一个圆角半径)
|
|
3388
|
+
* @param { number | number[] } radius 圆角半径 为数组时[3, 2, 1, 4]分别对应左上角圆角半径3 右上角2 右下角1 左下角4; 或者直接设置半径值 则四个角统一半径
|
|
3389
|
+
* */
|
|
3390
|
+
setCornerRadius(radius: number | number[], isScreenCoord?: boolean): void;
|
|
3391
|
+
/** 需要输入和输出的属性 */
|
|
3392
|
+
protected _propertyDbKeys: string[];
|
|
3393
|
+
getTypeName(): string;
|
|
3394
|
+
/** 获取坐标集合 */
|
|
3395
|
+
getShapePoints(paths: THREE.CurvePath<THREE.Vector3 | THREE.Vector2>): three.Vector3[];
|
|
3396
|
+
/*** 创建路径 */
|
|
3397
|
+
createPaths(shapes: THREE.Curve<THREE.Vector3 | THREE.Vector2> | THREE.Curve<THREE.Vector3 | THREE.Vector2>[]): three.CurvePath<three.Vector3 | three.Vector2>;
|
|
3398
|
+
/** 动态绘制函数*/
|
|
3399
|
+
_draw(pWorldDraw: McGiWorldDraw, vertices: THREE.Vector3[]): void;
|
|
3400
|
+
/** 获取生成圆角后的点 */
|
|
3401
|
+
getCornerRadiusPoints(points: THREE.Vector3[]): three.Vector3[];
|
|
3402
|
+
/** 绘制描边 */
|
|
3403
|
+
_drawStoreLine(pWorldDraw: McGiWorldDraw, points: THREE.Vector3[], draw?: (pWorldDraw: McGiWorldDraw) => void): void;
|
|
3404
|
+
/** 获取线段闭合后的曲线点数 */
|
|
3405
|
+
getClosedPoints(points: THREE.Vector3[]): three.Vector3[];
|
|
3406
|
+
/** 获取闭合线段 */
|
|
3407
|
+
getClosedLine(points: THREE.Vector3[]): THREE.Curve<THREE.Vector3>;
|
|
3408
|
+
/** 获取长度 */
|
|
3409
|
+
getTotalLength(): number;
|
|
3410
|
+
/** 获取面积 */
|
|
3411
|
+
getArea(): number;
|
|
3412
|
+
worldDraw(pWorldDraw: McGiWorldDraw): void;
|
|
3413
|
+
getGripPoints(): THREE.Vector3[];
|
|
3414
|
+
moveGripPointsAt(index: number, offset: THREE.Vector3): boolean;
|
|
3415
|
+
dwgIn(obj: any): boolean;
|
|
3416
|
+
dwgOut(obj: any): object;
|
|
3417
|
+
}
|
|
3418
|
+
|
|
3419
|
+
/*** 椭圆(弧)形状 */
|
|
3420
|
+
declare class MxDbEllipseShape extends MxDbShape {
|
|
3421
|
+
constructor();
|
|
3422
|
+
getTypeName(): string;
|
|
3423
|
+
/** 弧中心点 */
|
|
3424
|
+
center: three.Vector3;
|
|
3425
|
+
setCenter(center: THREE.Vector3): this;
|
|
3426
|
+
/** X轴椭圆弧半径 默认当前坐标转换下的10像素 */
|
|
3427
|
+
xRadius: number;
|
|
3428
|
+
setXRadius(xRadius: number): this;
|
|
3429
|
+
/** Y轴椭圆弧半径 默认当前坐标转换下的10像素 */
|
|
3430
|
+
yRadius: number;
|
|
3431
|
+
setYRadius(yRadius: number): this;
|
|
3432
|
+
/** 弧开始角度 默认0*/
|
|
3433
|
+
startAngle: number;
|
|
3434
|
+
setStartAngle(startAngle: number): this;
|
|
3435
|
+
/** 弧结束角度 默认0*/
|
|
3436
|
+
endAngle: number;
|
|
3437
|
+
setEndAngle(endAngle: number): this;
|
|
3438
|
+
/** 以顺时针方向创建(扫过)弧线 默认false */
|
|
3439
|
+
clockwise: boolean;
|
|
3440
|
+
setClockwise(clockwise: boolean): this;
|
|
3441
|
+
/** 旋转角度 */
|
|
3442
|
+
rotation: number;
|
|
3443
|
+
setRotation(rotation: number): this;
|
|
3444
|
+
/** 是否闭合到中心位置 */
|
|
3445
|
+
isClosedToCenter: boolean;
|
|
3446
|
+
setIsClosedToCenter(isClosedToCenter: boolean): this;
|
|
3447
|
+
worldDraw(pWorldDraw: McGiWorldDraw): void;
|
|
3448
|
+
/** 绘制椭圆形状 */
|
|
3449
|
+
drawEllipseShape(pWorldDraw: McGiWorldDraw): {
|
|
3450
|
+
/** 圆心角 */
|
|
3451
|
+
centralAngle: number;
|
|
3452
|
+
/** 圆弧曲线 */
|
|
3453
|
+
curve: three.EllipseCurve;
|
|
3454
|
+
/** 构成圆弧的向量点 */
|
|
3455
|
+
points: three.Vector3[];
|
|
3456
|
+
};
|
|
3457
|
+
/** 创建圆弧 */
|
|
3458
|
+
createEllipseCurve(x?: number, y?: number, xRadius?: number, yRadius?: number, startAngle?: number, endAngle?: number, clockwise?: boolean, rotation?: number): three.EllipseCurve;
|
|
3459
|
+
getClosedLine(points: THREE.Vector3[]): three.CatmullRomCurve3;
|
|
3460
|
+
getGripPoints(): three.Vector3[];
|
|
3461
|
+
moveGripPointsAt(index: number, offset: THREE.Vector3): boolean;
|
|
3462
|
+
}
|
|
3463
|
+
|
|
3464
|
+
/*** 圆(弧)形状 */
|
|
3465
|
+
declare class MxDbCircleShape extends MxDbEllipseShape {
|
|
3466
|
+
getTypeName(): string;
|
|
3467
|
+
/*** 圆半径 */
|
|
3468
|
+
get radius(): number;
|
|
3469
|
+
set radius(radius: number);
|
|
3470
|
+
setRadius(radius: number): this;
|
|
3471
|
+
setXRadius(xRadius: number): this;
|
|
3472
|
+
setYRadius(yRadius: number): this;
|
|
3473
|
+
}
|
|
3474
|
+
|
|
3475
|
+
/** 三点动态绘制圆弧 point1圆弧起始点 point2是圆弧结束点, point3圆弧任意一点 */
|
|
3476
|
+
declare class Mx3PointArc extends MxDbCircleShape {
|
|
3477
|
+
constructor();
|
|
3351
3478
|
point1: three.Vector3;
|
|
3352
3479
|
point2: three.Vector3;
|
|
3353
3480
|
point3: three.Vector3;
|
|
3481
|
+
/** 自动确定顺逆时针绘制 */
|
|
3482
|
+
autoClockwise: boolean;
|
|
3354
3483
|
getTypeName(): string;
|
|
3355
|
-
create():
|
|
3484
|
+
create(): Mx3PointArc;
|
|
3356
3485
|
worldDraw(pWorldDraw: McGiWorldDraw): void;
|
|
3357
3486
|
getGripPoints(): THREE.Vector3[];
|
|
3487
|
+
/** 计算三个控制点的角度 */
|
|
3488
|
+
compute3PointAngle(): number[];
|
|
3489
|
+
/** 根据三个控制点更新圆心 */
|
|
3490
|
+
upDateCenter(point1: THREE.Vector3, point2: THREE.Vector3, point3: THREE.Vector3): three.Vector3;
|
|
3491
|
+
/** 根据圆心和一个控制点自动更新半径大小 */
|
|
3492
|
+
upDateRadius(point: THREE.Vector3): number;
|
|
3493
|
+
/** 根据 三个控制点到圆心的角度 更新顺逆时针绘制 */
|
|
3494
|
+
upDataClockwise(angle1: number, angle2: number, angle3: number): void;
|
|
3358
3495
|
moveGripPointsAt(index: number, offset: THREE.Vector3): boolean;
|
|
3359
|
-
dwgIn(obj: any): boolean;
|
|
3360
|
-
dwgOut(obj: any): object;
|
|
3361
3496
|
}
|
|
3362
3497
|
|
|
3363
3498
|
/** @module MxDbCoord*/
|
|
@@ -3820,25 +3955,28 @@ declare class MxDbRectBoxLeadComment extends MxDbEntity {
|
|
|
3820
3955
|
protected onViewChange(): boolean;
|
|
3821
3956
|
}
|
|
3822
3957
|
|
|
3823
|
-
/**
|
|
3824
|
-
|
|
3825
|
-
|
|
3826
|
-
|
|
3827
|
-
|
|
3958
|
+
/** 通过两个构成矩形的点绘制椭圆形 */
|
|
3959
|
+
declare class MxDbEllipse extends MxDbEllipseShape {
|
|
3960
|
+
constructor();
|
|
3961
|
+
getTypeName(): string;
|
|
3962
|
+
create(): MxDbEllipse;
|
|
3963
|
+
/** 开始点 */
|
|
3828
3964
|
point1: three.Vector3;
|
|
3829
|
-
|
|
3965
|
+
setPoint1(point1: THREE.Vector3): this;
|
|
3966
|
+
/** 结束点 */
|
|
3830
3967
|
point2: three.Vector3;
|
|
3831
|
-
|
|
3968
|
+
setPoint2(point2: THREE.Vector3): this;
|
|
3969
|
+
isClosedToCenter: boolean;
|
|
3970
|
+
closed: boolean;
|
|
3832
3971
|
worldDraw(pWorldDraw: McGiWorldDraw): void;
|
|
3833
3972
|
getGripPoints(): THREE.Vector3[];
|
|
3834
3973
|
moveGripPointsAt(index: number, offset: THREE.Vector3): boolean;
|
|
3835
|
-
create(): MxDbEntity;
|
|
3836
|
-
dwgIn(obj: any): boolean;
|
|
3837
|
-
dwgOut(obj: any): object;
|
|
3838
3974
|
}
|
|
3839
3975
|
|
|
3840
3976
|
declare type SpriteTextColorType = THREE.Color | string | number | CanvasGradient | CanvasPattern | undefined;
|
|
3841
3977
|
declare type SpriteTextObj = SpriteText;
|
|
3978
|
+
declare type TextFontWeight = 'normal' | 'bold' | 'lighter' | 'bolder' | 'inherit' | number;
|
|
3979
|
+
declare type TextFontStyle = 'normal' | 'italic' | 'oblique';
|
|
3842
3980
|
declare class SpriteText extends THREE.Sprite {
|
|
3843
3981
|
constructor(options?: SpriteTextOptions);
|
|
3844
3982
|
text: string;
|
|
@@ -3851,7 +3989,7 @@ declare class SpriteText extends THREE.Sprite {
|
|
|
3851
3989
|
borderColor: SpriteTextColorType;
|
|
3852
3990
|
fontFace: string;
|
|
3853
3991
|
fontSize: number;
|
|
3854
|
-
fontWeight:
|
|
3992
|
+
fontWeight: TextFontWeight;
|
|
3855
3993
|
strokeWidth: number;
|
|
3856
3994
|
strokeColor: SpriteTextColorType;
|
|
3857
3995
|
textAlign: CanvasTextAlign;
|
|
@@ -3861,6 +3999,9 @@ declare class SpriteText extends THREE.Sprite {
|
|
|
3861
3999
|
textShadowOffsetY: number;
|
|
3862
4000
|
angle: number;
|
|
3863
4001
|
textScale: number;
|
|
4002
|
+
underline: boolean;
|
|
4003
|
+
fontStyle: TextFontStyle;
|
|
4004
|
+
fontVariant: string;
|
|
3864
4005
|
private _genCanvas;
|
|
3865
4006
|
dispose(): void;
|
|
3866
4007
|
}
|
|
@@ -3877,7 +4018,7 @@ interface SpriteTextOptions {
|
|
|
3877
4018
|
strokeColor?: SpriteTextColorType;
|
|
3878
4019
|
fontFace?: string;
|
|
3879
4020
|
fontSize?: number;
|
|
3880
|
-
fontWeight?:
|
|
4021
|
+
fontWeight?: TextFontWeight;
|
|
3881
4022
|
textAlign?: CanvasTextAlign;
|
|
3882
4023
|
textBaseline?: CanvasTextBaseline;
|
|
3883
4024
|
textShadowBlur?: number;
|
|
@@ -3886,6 +4027,9 @@ interface SpriteTextOptions {
|
|
|
3886
4027
|
textShadowOffsetY?: number;
|
|
3887
4028
|
angle?: number;
|
|
3888
4029
|
scale?: number;
|
|
4030
|
+
underline?: boolean;
|
|
4031
|
+
fontStyle?: TextFontStyle;
|
|
4032
|
+
fontVariant?: string;
|
|
3889
4033
|
}
|
|
3890
4034
|
|
|
3891
4035
|
/**
|
|
@@ -3949,7 +4093,7 @@ declare class MxDbText extends MxDbEntity {
|
|
|
3949
4093
|
set borderColor(borderColor: SpriteTextColorType);
|
|
3950
4094
|
setBorderColor(borderColor: SpriteTextColorType): this;
|
|
3951
4095
|
private _fontFace;
|
|
3952
|
-
/**
|
|
4096
|
+
/** 客户端字体 */
|
|
3953
4097
|
get fontFace(): string;
|
|
3954
4098
|
set fontFace(fontFace: string);
|
|
3955
4099
|
setFontFace(fontFace: string): this;
|
|
@@ -3960,9 +4104,9 @@ declare class MxDbText extends MxDbEntity {
|
|
|
3960
4104
|
setFontSize(fontSize: number): this;
|
|
3961
4105
|
private _fontWeight;
|
|
3962
4106
|
/** 字体粗细 */
|
|
3963
|
-
get fontWeight():
|
|
3964
|
-
set fontWeight(fontWeight:
|
|
3965
|
-
setFontWeight(fontWeight:
|
|
4107
|
+
get fontWeight(): TextFontWeight;
|
|
4108
|
+
set fontWeight(fontWeight: TextFontWeight);
|
|
4109
|
+
setFontWeight(fontWeight: TextFontWeight): this;
|
|
3966
4110
|
private _strokeWidth;
|
|
3967
4111
|
/** 笔划宽度 */
|
|
3968
4112
|
get strokeWidth(): number;
|
|
@@ -4008,6 +4152,11 @@ declare class MxDbText extends MxDbEntity {
|
|
|
4008
4152
|
get scale(): number;
|
|
4009
4153
|
set scale(scale: number);
|
|
4010
4154
|
setScale(scale: number): this;
|
|
4155
|
+
private _underline;
|
|
4156
|
+
/** 下划线 */
|
|
4157
|
+
get underline(): boolean;
|
|
4158
|
+
set underline(underline: boolean);
|
|
4159
|
+
setUnderline(underline: boolean): void;
|
|
4011
4160
|
/** SpriteText实例 */
|
|
4012
4161
|
protected spriteText: SpriteTextObj;
|
|
4013
4162
|
getTypeName(): string;
|
|
@@ -4099,6 +4248,102 @@ declare class MxDbGradientLine extends MxDbEntity {
|
|
|
4099
4248
|
dwgOut(obj: any): object;
|
|
4100
4249
|
}
|
|
4101
4250
|
|
|
4251
|
+
/**
|
|
4252
|
+
* 根据中心点、椭圆开始点和结束点确定椭圆弧
|
|
4253
|
+
* */
|
|
4254
|
+
declare class MxDbEllipseArc extends MxDbEllipseShape {
|
|
4255
|
+
getTypeName(): string;
|
|
4256
|
+
constructor();
|
|
4257
|
+
/** 椭圆弧决定开始点 控制x轴半径和开始角度 */
|
|
4258
|
+
startPoint: THREE.Vector3;
|
|
4259
|
+
setStartPoint(startPoint: THREE.Vector3): this;
|
|
4260
|
+
/** 椭圆弧决定结束点 控制y轴半径和结束角度*/
|
|
4261
|
+
endPoint: THREE.Vector3;
|
|
4262
|
+
setEndPoint(endPoint: THREE.Vector3): this;
|
|
4263
|
+
/** 控制椭圆弧旋转角度的点 */
|
|
4264
|
+
rotationPoint: THREE.Vector3;
|
|
4265
|
+
setRotationPoint(rotationPoint: THREE.Vector3): this;
|
|
4266
|
+
worldDraw(pWorldDraw: McGiWorldDraw): void;
|
|
4267
|
+
getGripPoints(): three.Vector3[];
|
|
4268
|
+
moveGripPointsAt(index: number, offset: THREE.Vector3): boolean;
|
|
4269
|
+
}
|
|
4270
|
+
|
|
4271
|
+
/** 根据圆心、起始点、结束点位置动态绘制圆弧 **/
|
|
4272
|
+
declare class MxDbCircleArc extends MxDbCircleShape {
|
|
4273
|
+
constructor();
|
|
4274
|
+
getTypeName(): string;
|
|
4275
|
+
/** 圆弧开始点 设置开始点将自动计算 radius、startAngle、endAngle */
|
|
4276
|
+
startPoint: THREE.Vector3;
|
|
4277
|
+
setStartPoint(startPoint: THREE.Vector3): this;
|
|
4278
|
+
/** 圆弧结束点 设置结束点将自动计算 radius、startAngle、endAngle */
|
|
4279
|
+
endPoint: THREE.Vector3;
|
|
4280
|
+
setEndPoint(endPoint: THREE.Vector3): this;
|
|
4281
|
+
worldDraw(pWorldDraw: McGiWorldDraw): void;
|
|
4282
|
+
computePointAngle(point: THREE.Vector3): number;
|
|
4283
|
+
getGripPoints(): three.Vector3[];
|
|
4284
|
+
moveGripPointsAt(index: number, offset: THREE.Vector3): boolean;
|
|
4285
|
+
}
|
|
4286
|
+
|
|
4287
|
+
/** 弧形 */
|
|
4288
|
+
declare class MxDbArcShape extends MxDbCircleArc {
|
|
4289
|
+
constructor();
|
|
4290
|
+
getTypeName(): string;
|
|
4291
|
+
create(): MxDbArcShape;
|
|
4292
|
+
center: three.Vector3;
|
|
4293
|
+
innerRadius: number;
|
|
4294
|
+
outerRadius: number;
|
|
4295
|
+
worldDraw(pWorldDraw: McGiWorldDraw): void;
|
|
4296
|
+
drawArcShape(pWorldDraw: McGiWorldDraw): void;
|
|
4297
|
+
getGripPoints(): THREE.Vector3[];
|
|
4298
|
+
moveGripPointsAt(index: number, offset: THREE.Vector3): boolean;
|
|
4299
|
+
}
|
|
4300
|
+
|
|
4301
|
+
/** 绘制弧形 */
|
|
4302
|
+
declare class MxDbArcShapeDraw extends MxDbArcShape {
|
|
4303
|
+
getTypeName(): string;
|
|
4304
|
+
constructor();
|
|
4305
|
+
outerRadiusPoint: three.Vector3;
|
|
4306
|
+
interRadiusPoint: three.Vector3;
|
|
4307
|
+
worldDraw(pWorldDraw: McGiWorldDraw): void;
|
|
4308
|
+
getGripPoints(): THREE.Vector3[];
|
|
4309
|
+
moveGripPointsAt(index: number, offset: THREE.Vector3): boolean;
|
|
4310
|
+
}
|
|
4311
|
+
|
|
4312
|
+
/** 环形 */
|
|
4313
|
+
declare class MxDbRingShape extends MxDbArcShape {
|
|
4314
|
+
getTypeName(): string;
|
|
4315
|
+
worldDraw(pWorldDraw: McGiWorldDraw): void;
|
|
4316
|
+
}
|
|
4317
|
+
|
|
4318
|
+
/** 星形 */
|
|
4319
|
+
declare class MxDbStarShape extends MxDbShape {
|
|
4320
|
+
getTypeName(): string;
|
|
4321
|
+
constructor();
|
|
4322
|
+
center: three.Vector3;
|
|
4323
|
+
numPoints: number;
|
|
4324
|
+
innerRadius: number;
|
|
4325
|
+
outerRadius: number;
|
|
4326
|
+
worldDraw(pWorldDraw: McGiWorldDraw): void;
|
|
4327
|
+
getGripPoints(): THREE.Vector3[];
|
|
4328
|
+
moveGripPointsAt(index: number, offset: THREE.Vector3): boolean;
|
|
4329
|
+
}
|
|
4330
|
+
|
|
4331
|
+
/** 等边多边形 */
|
|
4332
|
+
declare class MxDbRegularPolygonShape extends MxDbShape {
|
|
4333
|
+
center: three.Vector3;
|
|
4334
|
+
sides: number;
|
|
4335
|
+
radius: number;
|
|
4336
|
+
getTypeName(): string;
|
|
4337
|
+
constructor();
|
|
4338
|
+
worldDraw(pWorldDraw: McGiWorldDraw): void;
|
|
4339
|
+
_getPoints(): {
|
|
4340
|
+
x: number;
|
|
4341
|
+
y: number;
|
|
4342
|
+
}[];
|
|
4343
|
+
getGripPoints(): THREE.Vector3[];
|
|
4344
|
+
moveGripPointsAt(index: number, offset: THREE.Vector3): boolean;
|
|
4345
|
+
}
|
|
4346
|
+
|
|
4102
4347
|
declare const Mx_loadCoreCode: typeof loadCoreCode;
|
|
4103
4348
|
declare const Mx_useCanvasResizeListener: typeof useCanvasResizeListener;
|
|
4104
4349
|
declare const Mx_store: typeof store;
|
|
@@ -4173,6 +4418,24 @@ declare const Mx_MxCADObject: typeof MxCADObject;
|
|
|
4173
4418
|
type Mx_MxDbGroup = MxDbGroup;
|
|
4174
4419
|
type Mx_MxDbGradientLine = MxDbGradientLine;
|
|
4175
4420
|
declare const Mx_MxDbGradientLine: typeof MxDbGradientLine;
|
|
4421
|
+
type Mx_MxDbShape = MxDbShape;
|
|
4422
|
+
declare const Mx_MxDbShape: typeof MxDbShape;
|
|
4423
|
+
type Mx_MxDbEllipseShape = MxDbEllipseShape;
|
|
4424
|
+
declare const Mx_MxDbEllipseShape: typeof MxDbEllipseShape;
|
|
4425
|
+
type Mx_MxDbEllipseArc = MxDbEllipseArc;
|
|
4426
|
+
declare const Mx_MxDbEllipseArc: typeof MxDbEllipseArc;
|
|
4427
|
+
type Mx_MxDbCircleShape = MxDbCircleShape;
|
|
4428
|
+
declare const Mx_MxDbCircleShape: typeof MxDbCircleShape;
|
|
4429
|
+
type Mx_MxDbCircleArc = MxDbCircleArc;
|
|
4430
|
+
declare const Mx_MxDbCircleArc: typeof MxDbCircleArc;
|
|
4431
|
+
type Mx_MxDbArcShapeDraw = MxDbArcShapeDraw;
|
|
4432
|
+
declare const Mx_MxDbArcShapeDraw: typeof MxDbArcShapeDraw;
|
|
4433
|
+
type Mx_MxDbRingShape = MxDbRingShape;
|
|
4434
|
+
declare const Mx_MxDbRingShape: typeof MxDbRingShape;
|
|
4435
|
+
type Mx_MxDbStarShape = MxDbStarShape;
|
|
4436
|
+
declare const Mx_MxDbStarShape: typeof MxDbStarShape;
|
|
4437
|
+
type Mx_MxDbRegularPolygonShape = MxDbRegularPolygonShape;
|
|
4438
|
+
declare const Mx_MxDbRegularPolygonShape: typeof MxDbRegularPolygonShape;
|
|
4176
4439
|
declare namespace Mx {
|
|
4177
4440
|
export {
|
|
4178
4441
|
Mx_loadCoreCode as loadCoreCode,
|
|
@@ -4219,7 +4482,16 @@ declare namespace Mx {
|
|
|
4219
4482
|
Mx_MxCADObject as MxCADObject,
|
|
4220
4483
|
Mx_MxDbGroup as MxDbGroup,
|
|
4221
4484
|
Mx_MxDbGradientLine as MxDbGradientLine,
|
|
4485
|
+
Mx_MxDbShape as MxDbShape,
|
|
4486
|
+
Mx_MxDbEllipseShape as MxDbEllipseShape,
|
|
4487
|
+
Mx_MxDbEllipseArc as MxDbEllipseArc,
|
|
4488
|
+
Mx_MxDbCircleShape as MxDbCircleShape,
|
|
4489
|
+
Mx_MxDbCircleArc as MxDbCircleArc,
|
|
4490
|
+
Mx_MxDbArcShapeDraw as MxDbArcShapeDraw,
|
|
4491
|
+
Mx_MxDbRingShape as MxDbRingShape,
|
|
4492
|
+
Mx_MxDbStarShape as MxDbStarShape,
|
|
4493
|
+
Mx_MxDbRegularPolygonShape as MxDbRegularPolygonShape,
|
|
4222
4494
|
};
|
|
4223
4495
|
}
|
|
4224
4496
|
|
|
4225
|
-
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 };
|
|
4497
|
+
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}};
|