import McGiWorldDraw from "../McGiWorldDraw"; import MxDbEntity from "../MxDbEntity"; import MxFilters from "../MxFilters"; import { UnstableColor } from "../MxType"; /** 动态绘制形状 * 基于THREE.Shape计算实现的形状 * 通过扩展可以实现各种2d 3d形状 * **/ export default class MxDbShape extends MxDbEntity { protected _paths: THREE.CurvePath; protected points: THREE.Vector3[]; protected closedLine: THREE.Curve; protected isLoadMaterialFromPath: boolean; protected material: THREE.MeshLambertMaterial | null; /** 描边颜色 */ stroke: UnstableColor; setStroke(stroke: UnstableColor): this; /** 描边线段的宽度 */ strokeLineWidth: number; setStrokeLineWidth(strokeLineWidth: number): this; /** 描边是否为虚线 */ isStrokeDashLine: boolean; setIsStrokeDashLine(isStrokeDashLine: boolean): this; /** 填充 */ isFill: boolean; setIsFill(isFill: boolean): this; /** 填充图片路径 */ protected _fillImageSrc: string | false | null; get fillImageSrc(): string | false | null; set fillImageSrc(src: string | false | null); setFillImageSrc(fillImageSrc: string): this; /** * fillImageParam 填充背景图片的参数设置(如果使用了滤镜则部分参数功能失效) * */ fillImageParam: { offset?: THREE.Vector2; repeat?: THREE.Vector2; rotation?: number; center?: THREE.Vector2; } | undefined; /** 线段细分数值 */ curveSegments: number; setCurveSegments(curveSegments: number): this; /** 闭合 */ closed: boolean; setClosed(closed: boolean): this; /** * 设置滤镜对象{@link MxFilters} 默认为undefined | null 则不使用该滤镜效果 * */ filter: MxFilters | undefined | null; /** 圆角半径 (一个向量点对应一个角的半径值)*/ cornerRadius: number[] | number; /** * 设置圆角 圆角的半径(如果参数为数组则一个角度对应一个圆角半径) * @param { number | number[] } radius 圆角半径 为数组时[3, 2, 1, 4]分别对应左上角圆角半径3 右上角2 右下角1 左下角4; 或者直接设置半径值 则四个角统一半径 * */ setCornerRadius(radius: number | number[], isScreenCoord?: boolean): void; /** 需要输入和输出的属性 */ protected _propertyDbKeys: string[]; getTypeName(): string; /** 获取坐标集合 */ getShapePoints(paths: THREE.CurvePath): import("three").Vector3[]; /*** 创建路径 */ createPaths(shapes: THREE.Curve | THREE.Curve[]): import("three").CurvePath; /** 动态绘制函数*/ _draw(pWorldDraw: McGiWorldDraw, vertices: THREE.Vector3[]): void; /** 获取生成圆角后的点 */ getCornerRadiusPoints(points: THREE.Vector3[]): import("three").Vector3[]; /** 绘制描边 */ _drawStoreLine(pWorldDraw: McGiWorldDraw, points: THREE.Vector3[], draw?: (pWorldDraw: McGiWorldDraw) => void): void; /** 获取线段闭合后的曲线点数 */ getClosedPoints(points: THREE.Vector3[]): import("three").Vector3[]; /** 获取长度 */ getTotalLength(): number; /** 获取面积 */ getArea(): number; worldDraw(pWorldDraw: McGiWorldDraw): void; /** 图片填充 */ _fillImg(pWorldDraw: McGiWorldDraw, points: THREE.Vector3[]): void; getGripPoints(): THREE.Vector3[]; moveGripPointsAt(index: number, offset: THREE.Vector3): boolean; dwgIn(obj: any): boolean; dwgOut(obj: any): object; }