mxdraw 0.1.119 → 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 +274 -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/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/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
|
@@ -3170,10 +3170,14 @@ declare class MxDbSVGText {
|
|
|
3170
3170
|
move: boolean;
|
|
3171
3171
|
/** 文字移动到距图片远处,自动绘制一个连接线 */
|
|
3172
3172
|
drawConnectingLine: boolean;
|
|
3173
|
+
/** 连接线的临时绘制对象 */
|
|
3174
|
+
_connectingLine: THREE.Line | null;
|
|
3173
3175
|
/** 字体样式 */
|
|
3174
3176
|
fontStyle: string;
|
|
3175
3177
|
/** 下划线 */
|
|
3176
3178
|
underline: boolean;
|
|
3179
|
+
/** 下划线的临时绘制对象 */
|
|
3180
|
+
_underLine: THREE.Line | null;
|
|
3177
3181
|
}
|
|
3178
3182
|
|
|
3179
3183
|
/** @module MxDbSVG*/
|
|
@@ -3352,21 +3356,143 @@ declare class MxDb2LineAngularDimension extends MxDbEntity {
|
|
|
3352
3356
|
getTypeName(): string;
|
|
3353
3357
|
}
|
|
3354
3358
|
|
|
3355
|
-
/**
|
|
3356
|
-
*
|
|
3357
|
-
*
|
|
3358
|
-
|
|
3359
|
-
|
|
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();
|
|
3360
3478
|
point1: three.Vector3;
|
|
3361
3479
|
point2: three.Vector3;
|
|
3362
3480
|
point3: three.Vector3;
|
|
3481
|
+
/** 自动确定顺逆时针绘制 */
|
|
3482
|
+
autoClockwise: boolean;
|
|
3363
3483
|
getTypeName(): string;
|
|
3364
|
-
create():
|
|
3484
|
+
create(): Mx3PointArc;
|
|
3365
3485
|
worldDraw(pWorldDraw: McGiWorldDraw): void;
|
|
3366
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;
|
|
3367
3495
|
moveGripPointsAt(index: number, offset: THREE.Vector3): boolean;
|
|
3368
|
-
dwgIn(obj: any): boolean;
|
|
3369
|
-
dwgOut(obj: any): object;
|
|
3370
3496
|
}
|
|
3371
3497
|
|
|
3372
3498
|
/** @module MxDbCoord*/
|
|
@@ -3829,26 +3955,28 @@ declare class MxDbRectBoxLeadComment extends MxDbEntity {
|
|
|
3829
3955
|
protected onViewChange(): boolean;
|
|
3830
3956
|
}
|
|
3831
3957
|
|
|
3832
|
-
/**
|
|
3833
|
-
|
|
3834
|
-
|
|
3835
|
-
|
|
3836
|
-
|
|
3958
|
+
/** 通过两个构成矩形的点绘制椭圆形 */
|
|
3959
|
+
declare class MxDbEllipse extends MxDbEllipseShape {
|
|
3960
|
+
constructor();
|
|
3961
|
+
getTypeName(): string;
|
|
3962
|
+
create(): MxDbEllipse;
|
|
3963
|
+
/** 开始点 */
|
|
3837
3964
|
point1: three.Vector3;
|
|
3838
|
-
|
|
3965
|
+
setPoint1(point1: THREE.Vector3): this;
|
|
3966
|
+
/** 结束点 */
|
|
3839
3967
|
point2: three.Vector3;
|
|
3840
|
-
|
|
3968
|
+
setPoint2(point2: THREE.Vector3): this;
|
|
3969
|
+
isClosedToCenter: boolean;
|
|
3970
|
+
closed: boolean;
|
|
3841
3971
|
worldDraw(pWorldDraw: McGiWorldDraw): void;
|
|
3842
3972
|
getGripPoints(): THREE.Vector3[];
|
|
3843
3973
|
moveGripPointsAt(index: number, offset: THREE.Vector3): boolean;
|
|
3844
|
-
create(): MxDbEntity;
|
|
3845
|
-
dwgIn(obj: any): boolean;
|
|
3846
|
-
dwgOut(obj: any): object;
|
|
3847
3974
|
}
|
|
3848
3975
|
|
|
3849
3976
|
declare type SpriteTextColorType = THREE.Color | string | number | CanvasGradient | CanvasPattern | undefined;
|
|
3850
3977
|
declare type SpriteTextObj = SpriteText;
|
|
3851
3978
|
declare type TextFontWeight = 'normal' | 'bold' | 'lighter' | 'bolder' | 'inherit' | number;
|
|
3979
|
+
declare type TextFontStyle = 'normal' | 'italic' | 'oblique';
|
|
3852
3980
|
declare class SpriteText extends THREE.Sprite {
|
|
3853
3981
|
constructor(options?: SpriteTextOptions);
|
|
3854
3982
|
text: string;
|
|
@@ -3872,6 +4000,8 @@ declare class SpriteText extends THREE.Sprite {
|
|
|
3872
4000
|
angle: number;
|
|
3873
4001
|
textScale: number;
|
|
3874
4002
|
underline: boolean;
|
|
4003
|
+
fontStyle: TextFontStyle;
|
|
4004
|
+
fontVariant: string;
|
|
3875
4005
|
private _genCanvas;
|
|
3876
4006
|
dispose(): void;
|
|
3877
4007
|
}
|
|
@@ -3898,6 +4028,8 @@ interface SpriteTextOptions {
|
|
|
3898
4028
|
angle?: number;
|
|
3899
4029
|
scale?: number;
|
|
3900
4030
|
underline?: boolean;
|
|
4031
|
+
fontStyle?: TextFontStyle;
|
|
4032
|
+
fontVariant?: string;
|
|
3901
4033
|
}
|
|
3902
4034
|
|
|
3903
4035
|
/**
|
|
@@ -4116,6 +4248,102 @@ declare class MxDbGradientLine extends MxDbEntity {
|
|
|
4116
4248
|
dwgOut(obj: any): object;
|
|
4117
4249
|
}
|
|
4118
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
|
+
|
|
4119
4347
|
declare const Mx_loadCoreCode: typeof loadCoreCode;
|
|
4120
4348
|
declare const Mx_useCanvasResizeListener: typeof useCanvasResizeListener;
|
|
4121
4349
|
declare const Mx_store: typeof store;
|
|
@@ -4190,6 +4418,24 @@ declare const Mx_MxCADObject: typeof MxCADObject;
|
|
|
4190
4418
|
type Mx_MxDbGroup = MxDbGroup;
|
|
4191
4419
|
type Mx_MxDbGradientLine = MxDbGradientLine;
|
|
4192
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;
|
|
4193
4439
|
declare namespace Mx {
|
|
4194
4440
|
export {
|
|
4195
4441
|
Mx_loadCoreCode as loadCoreCode,
|
|
@@ -4236,7 +4482,16 @@ declare namespace Mx {
|
|
|
4236
4482
|
Mx_MxCADObject as MxCADObject,
|
|
4237
4483
|
Mx_MxDbGroup as MxDbGroup,
|
|
4238
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,
|
|
4239
4494
|
};
|
|
4240
4495
|
}
|
|
4241
4496
|
|
|
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 };
|
|
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}};
|
|
@@ -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}};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import McGiWorldDraw from "../McGiWorldDraw";
|
|
2
|
+
import MxDbShape from "../MxDbShape";
|
|
3
|
+
/** 等边多边形 */
|
|
4
|
+
export default class MxDbRegularPolygonShape extends MxDbShape {
|
|
5
|
+
center: import("three").Vector3;
|
|
6
|
+
sides: number;
|
|
7
|
+
radius: number;
|
|
8
|
+
getTypeName(): string;
|
|
9
|
+
constructor();
|
|
10
|
+
worldDraw(pWorldDraw: McGiWorldDraw): void;
|
|
11
|
+
_getPoints(): {
|
|
12
|
+
x: number;
|
|
13
|
+
y: number;
|
|
14
|
+
}[];
|
|
15
|
+
getGripPoints(): THREE.Vector3[];
|
|
16
|
+
moveGripPointsAt(index: number, offset: THREE.Vector3): boolean;
|
|
17
|
+
}
|
|
@@ -0,0 +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}};
|