import { Geom3 } from '@jscad/modeling/src/geometries/geom3';
import { BoxGeometry, BufferGeometry, Frustum, Geometry, LineBasicMaterial, LineSegments, Matrix3, Matrix4, Mesh, Object3D, UVGenerator, Vector3 } from "three";
import { Line2 } from "three/examples/jsm/lines/Line2";
import { Status } from "../../Common/Status";
import { ObjectSnapMode } from "../../Editor/ObjectSnapMode";
import { Box3Ext } from "../../Geometry/Box";
import { EdgesGeometry } from "../../Geometry/EdgeGeometry";
import { OBB } from "../../Geometry/OBB/obb";
import { RenderType } from "../../GraphicsSystem/RenderType";
import { CADFiler } from "../CADFiler";
import { ObjectId } from "../ObjectId";
import { PhysicalMaterialRecord } from "../PhysicalMaterialRecord";
import { Shape } from "../Shape";
import { Circle } from "./Circle";
import { DragPointType } from "./DragPointType";
import { Entity } from "./Entity";
import { Polyline } from "./Polyline";
import { Region } from "./Region";
export type ExtrudeContourCurve = Polyline | Circle;
export type ExtrudeContour = Polyline | Circle | ExtrudeSolid | Region;
export declare const MaxDrawGrooveCount = 1000;
export declare class ExtrudeSolid extends Entity {
    private _DisplayAccuracy;
    protected height: number;
    protected width: number;
    /**
     * 拉伸实体的厚度
     * 我们允许它是一个负数,但是这个时候这个实体已经是一个无效的拉伸实体了.
     * 允许负数,用来校验凹槽的合理性.
     */
    protected thickness: number;
    protected isRect: boolean;
    protected bevelEnabled: boolean;
    IsKnife: boolean;
    RelevanceMeats: ObjectId[];
    RelevanceKnifs: ObjectId[];
    __OriginalId__: ObjectId;
    __OriginalEnt__: this;
    /**
     * 拉伸形状
     * 出于优化考虑,可能未初始化,请注意调用this.ContourCurve
     * 形状位于WCS 0点位置,不随OCS变化而变化
     * 注意:这个时针不一定为逆时针
     */
    protected contourCurve: ExtrudeContourCurve;
    /**
     * 正面和反面的凹槽造型
     */
    protected grooves: ExtrudeSolid[];
    protected knifeRadius: number;
    protected groovesAddLength: number;
    protected groovesAddWidth: number;
    protected groovesAddDepth: number;
    __TempIndexVersion__: {
        Index: number;
        Version: number;
    };
    constructor();
    set Material(materialId: ObjectId<PhysicalMaterialRecord>);
    get Material(): ObjectId<PhysicalMaterialRecord>;
    get DisplayAccuracy(): number;
    set DisplayAccuracy(v: number);
    get KnifeRadius(): number;
    set KnifeRadius(v: number);
    get BoundingBox(): Box3Ext;
    get BoundingBoxInOCS(): Box3Ext;
    get OBB(): OBB;
    get GroovesAddLength(): number;
    set GroovesAddLength(v: number);
    get GroovesAddWidth(): number;
    set GroovesAddWidth(v: number);
    get GroovesAddDepth(): number;
    set GroovesAddDepth(v: number);
    ApplyMatrix(m: Matrix4): this;
    protected ApplyScaleMatrix(m: Matrix4): this;
    protected ApplyMirrorMatrix(m: Matrix4): this;
    get Width(): number;
    get Height(): number;
    get Thickness(): number;
    set Thickness(thickness: number);
    get Grooves(): ExtrudeSolid[];
    get SideModelingMap(): Map<any, any>;
    get Side2DModelingMap(): Map<any, any>;
    /**
     * 返回未拷贝的轮廓曲线
     */
    get ContourCurve(): ExtrudeContourCurve;
    set ContourCurve(cu: ExtrudeContourCurve);
    /**
     * 生成矩形轮廓(强制)
     */
    GeneralRectContour(): void;
    /**
     * 转换成矩形拉伸实体
     */
    ConverToRectSolid(width?: number, height?: number, thickness?: number): this;
    /**
     * 更新拉伸实体的轮廓
     * @param curve 曲线已经存在WCS坐标系0点
     */
    SetContourCurve(curve: ExtrudeContourCurve): void;
    /**
     * 在不改变Normal和实体显示的情况下,修改X轴的指向
     * @param xAxis
     */
    SetXAxis(xAxis: Vector3): this;
    /**
     * 检验轮廓曲线,通常当轮廓曲线被修改时,都需要检验轮廓曲线,并更新实体大小和轮廓位置.
     * >计算轮廓大小
     * >判断是否矩形
     * >修正轮廓基点
     * >保证轮廓是逆时针(不再设置)
     */
    CheckContourCurve(): void;
    get IsRect(): boolean;
    /**
     * 这个拉伸实体的面域形状
     */
    get Shape(): Shape;
    private GetShape;
    /**
     * 实体合并(不会删除target)
     */
    Join(target: this): Status;
    get Volume(): number;
    /**
     * 被切割
     * @param extrudes 切割刀
     * @param [output=undefined] 如果实体被分裂,那么输出分裂的其他实体(如果为空,则尝试入当前实体的容器中)
     * @param [checkIntersect=true] 检查相交,性能优化
     * @returns 切割是否成功
     */
    Subtract(extrudes: ExtrudeSolid[], output?: ExtrudeSolid[], checkIntersect?: boolean): boolean;
    ParseGrooves(knifeExtrudes: ExtrudeSolid[]): {
        grooves: ExtrudeSolid[];
        needCutSideGrooves: ExtrudeSolid[];
        relevanceSideModelMap: Map<number, ExtrudeSolid[]>;
    };
    RelevanceSubtract(knif: ExtrudeSolid, check?: boolean): void;
    /**
    * 当实体被分裂后,加入新图纸时,需要修复关联拉槽
    */
    RepairRelevance(): void;
    AppendGroove(groove: ExtrudeSolid): void;
    /**
     * 添加槽进板件,并且自动分裂.
     * 通常槽已经校验过准确性,所以不在校验
     */
    AppendGrooves(grooves: ExtrudeSolid[], output?: ExtrudeSolid[], outSplitExtrudeSolid?: ExtrudeSolid[]): void;
    AppendSideModel(relevanceSideModelMap: Map<number, ExtrudeSolid[]>): void;
    GetObjectSnapPoints(snapMode: ObjectSnapMode, pickPoint: Vector3, lastPoint: Vector3, viewXform?: Matrix3, frustum?: Frustum): Vector3[];
    protected GetStrectchGroovePointCountList(dragType: DragPointType): number[];
    GetGripOrStretchPoints(dragType: DragPointType): Vector3[];
    MoveGripOrStretchPoints(indexList: number[], vec: Vector3, dragType: DragPointType): void;
    GetGripPoints(): Array<Vector3>;
    MoveGripPoints(indexList: number[], vec: Vector3): void;
    GetStretchPoints(): Vector3[];
    MoveStretchPoints(indexList: Array<number>, vec: Vector3): void;
    /**
     * 只对自身的轮廓和厚度进行拉伸,忽略子实体
     */
    MoveGripOrStretchPointsOnly(indexList: Array<number>, vec: Vector3, dragType: DragPointType): void;
    IsStretchThickness(indexs: number[]): boolean;
    /**
     * 当调用Draw时,可以生成bsp信息
     */
    private csg;
    get CSG(): Geom3;
    /**
    * (步骤1.2.)
    * 将目标拉伸实体转换成在板件内部可用的凹槽实体
    * @param target 该对象可能被修改(内部不拷贝该实体)
    * @param useClone 转换后的实体是目标实体拷贝后修改的
    */
    ConverToLocalGroove(target: ExtrudeSolid): ExtrudeSolid[];
    /**
     * (步骤2)
     * 更新凹槽位置和厚度(校验凹槽的Z轴位置是否存在交集)
     */
    GrooveCheckPosition(target: ExtrudeSolid): Status;
    /**
     * (步骤3)
     * 计算凹槽合并
     */
    GrooveCheckMerge(checkGrooveContourCurve?: boolean): void;
    /**
    * (步骤4.1)
    * 计算凹槽轮廓在本实体中的约束状态(可能分裂)
    * @param groove 凹槽(不拷贝,直接被修改)
    * @returns this[] 凹槽在本实体中正确的约束状态.(可能分裂成为多个)
    */
    private GrooveCheckContour;
    /** (步骤4.2.1) 针对圆弧板-修正路径 */
    AdjustPath(ext: ExtrudeSolid, outline: Polyline | Circle): void;
    /** (步骤4.2.2) 针对圆弧板-修正位置 */
    AdjustPosition(ext: ExtrudeSolid, basePoint: Vector3): void;
    /** (步骤4.2.3) 针对圆弧板-修正起点 */
    AdjustBasePoint(oldBasePoint: Vector3, oldPathWCS: Polyline): void;
    /**
     * (步骤4.2)
     * 计算本实体被全身的凹槽差集后正确的实体轮廓,和有可能的分裂实体
     * @param splitEntitys 分裂出来的实体
     * @returns [Status] Status : 消失不见
     */
    ContourCheckSubtract(splitEntitys: this[]): boolean;
    IsLazyGrooveCheck: boolean;
    IsNeedGrooveCheck: boolean;
    /**
     * 无法知道修改了轮廓是否为更新到内部凹槽.
     * 无法知道修改了内部凹槽之后是否会更新到轮廓.
     * 所以默认全部校验内部的凹槽
     */
    GrooveCheckAll(splitEntitys: this[]): void;
    /** 校验内部槽并且自动分裂 */
    GrooveCheckAllAutoSplit(output?: ExtrudeSolid[], outSplitExtrudeSolid?: ExtrudeSolid[]): void;
    HandleSplitEntities(splitEntitys: this[], oriThis?: this): void;
    LazyGrooveCheckAll(): void;
    GetPrintObject3D(): (Line2 | Mesh<BufferGeometry, import("three").ShaderMaterial>)[];
    /** 获取边框 */
    GetEdgeObject3D(renderType: RenderType): Line2 | LineSegments<BufferGeometry, LineBasicMaterial>;
    InitDrawObject(renderType?: RenderType): Object3D;
    get UCGenerator(): UVGenerator;
    __CacheKnifVersion__: {
        [key: number]: number;
    };
    get NeedUpdateRelevanceGroove(): boolean;
    __CacheVolume__: number;
    __CacheSplitExtrudes: this[];
    _WorkerCalcedBufferGeometryMap: Map<ExtrudeSolid, BufferGeometry[]>;
    /**
     * 计算关联拉槽,更新绘制对象(MeshGeometry和EdgeGeometry)
     */
    protected CalcRelevanceGroove(): void;
    /**
     * 如果实体被切割,那么将返回分裂的实体数组,否则返回自身
     */
    get SplitExtrudes(): this[];
    protected GetRelevanceKnifes(knifs: ExtrudeSolid[]): void;
    ClearRelevance(en?: ExtrudeSolid): void;
    protected _MeshGeometry: BufferGeometry;
    get MeshGeometry(): BufferGeometry;
    UpdateMeshGeom(geo: BufferGeometry | Geometry): BufferGeometry;
    protected get Has2DPath(): boolean;
    protected get HasSide2DPath(): boolean;
    protected get HasSideModel(): boolean;
    protected _EdgeGeometry: EdgesGeometry | BufferGeometry;
    get EdgeGeometry(): BufferGeometry;
    UpdateUV(geo: Geometry, ocs: Matrix4, isRev?: boolean): void;
    GenWorldUV(geo: BufferGeometry): void;
    DeferUpdate(): void;
    UpdateDrawGeometry(): void;
    ClearDraw(): this;
    UpdateDrawObject(renderType: RenderType, obj: Object3D): Object3D;
    UpdateDrawObjectMaterial(renderType: RenderType, obj: Object3D): void;
    private GetConceptualMaterial;
    private GetModelGroove;
    private GetSideModelGroove;
    UpdateJigMaterial(color?: number): void;
    /**
     * 简化的文件读取和写入,只写入必要的数据,没有id,没有其他版本号
     */
    ReadFileLite(file: CADFiler): void;
    WriteFileLite(file: CADFiler): void;
    private ReadFileOnly;
    private WriteFileOnly;
    protected _ReadFile(file: CADFiler): void;
    WriteFile(file: CADFiler): void;
}
export declare function FastMeshGeometry(width: number, height: number, thickness: number): BoxGeometry;
//# sourceMappingURL=Extrude.d.ts.map