import { typeSpecificityEnum } from "../../occ-helper";
export class OCCTCurves {
    constructor(occ, och) {
        this.occ = occ;
        this.och = och;
    }
    geom2dEllipse(inputs) {
        const axis2d = this.och.gpAx2d(inputs.center, inputs.direction);
        const res = new this.occ.Geom2d_Ellipse_2(axis2d, inputs.radiusMajor, inputs.radiusMinor, inputs.sense);
        axis2d.delete();
        return res;
    }
    geom2dCircle(inputs) {
        const axis2d = this.och.gpAx2d(inputs.center, inputs.direction);
        const res = new this.occ.Geom2d_Circle_2(axis2d, inputs.radius, inputs.sense);
        axis2d.delete();
        return res;
    }
    geom2dTrimmedCurve(inputs) {
        const handleCurve = new this.occ.Handle_Geom2d_Curve_2(inputs.shape);
        const trimmed = new this.occ.Geom2d_TrimmedCurve(handleCurve, inputs.u1, inputs.u2, inputs.sense, inputs.theAdjustPeriodic);
        return trimmed;
    }
    geom2dSegment(inputs) {
        const pt1 = this.och.gpPnt2d(inputs.start);
        const pt2 = this.och.gpPnt2d(inputs.end);
        const res = new this.occ.GCE2d_MakeSegment_1(pt1, pt2);
        const resValue = res.Value();
        const r = resValue.get();
        pt1.delete();
        pt2.delete();
        res.delete();
        return r;
    }
    get2dPointFrom2dCurveOnParam(inputs) {
        const pt2d = inputs.shape.Value(inputs.param);
        const pt = [pt2d.X(), pt2d.Y()];
        pt2d.delete();
        return pt;
    }
    geomCircleCurve(inputs) {
        return this.och.createCircle(inputs.radius, inputs.center, inputs.direction, typeSpecificityEnum.curve);
    }
    geomEllipseCurve(inputs) {
        return this.och.createEllipse(inputs.radiusMinor, inputs.radiusMajor, inputs.center, inputs.direction, typeSpecificityEnum.curve);
    }
}
