import { BSplineCurve3d } from "../../bspline/BSplineCurve";
import { BSplineCurve3dH } from "../../bspline/BSplineCurve3dH";
import { RecurseToCurvesGeometryHandler } from "../../geometry3d/GeometryHandler";
import { Matrix4d } from "../../geometry4d/Matrix4d";
import { Arc3d } from "../Arc3d";
import { CurveChainWithDistanceIndex } from "../CurveChainWithDistanceIndex";
import { CurveLocationDetailPair } from "../CurveLocationDetail";
import { CurvePrimitive } from "../CurvePrimitive";
import { AnyCurve } from "../CurveTypes";
import { GeometryQuery } from "../GeometryQuery";
import { LineSegment3d } from "../LineSegment3d";
import { LineString3d } from "../LineString3d";
/**
 * Handler class for XY intersections between _geometryB and another geometry.
 * * Instances are initialized and called from CurveCurve.
 * * geometryB is saved for later reference.
 * @internal
 */
export declare class CurveCurveIntersectXY extends RecurseToCurvesGeometryHandler {
    private _extendA0;
    private _extendA1;
    private _geometryB;
    private _extendB0;
    private _extendB1;
    private _results;
    private _worldToLocalPerspective;
    private _worldToLocalAffine;
    private _coincidentGeometryContext;
    private static _workPointA0H;
    private static _workPointA1H;
    private static _workPointB0H;
    private static _workPointB1H;
    private static _workPointAA0;
    private static _workPointAA1;
    private static _workPointBB0;
    private static _workPointBB1;
    private static _workPointA0;
    private static _workPointA1;
    private static _workPointB0;
    private static _workPointB1;
    private _xyzwA0?;
    private _xyzwA1?;
    private _xyzwPlane?;
    private _xyzwB?;
    /**
     * The constructor.
     * @param worldToLocal optional transform (possibly perspective) to project to xy plane for intersection.
     * @param extendA flag for extension of the other geometry.
     * @param geometryB second curve for intersection. Saved for reference by specific handler methods.
     * @param extendB flag for extension of geometryB.
     * @param tolerance optional distance tolerance for coincidence.
     */
    constructor(worldToLocal: Matrix4d | undefined, extendA: boolean, geometryB: AnyCurve | undefined, extendB: boolean, tolerance?: number);
    /** Reset the geometry, leaving all other parts unchanged (and preserving accumulated intersections). */
    resetGeometry(geometryB: AnyCurve): void;
    /** Accept the fraction if it falls inside (possibly extended) fraction range. */
    private acceptFraction;
    /** Test the fraction by strict parameter, but allow toleranced distance test at ends. */
    private acceptFractionOnLine;
    /**
     * Return the results structure for the intersection calculation, structured as an array of CurveLocationDetailPair
     * @param reinitialize if true, a new results structure is created for use by later calls.
     */
    grabPairedResults(reinitialize?: boolean): CurveLocationDetailPair[];
    /**
     * Record the pre-computed intersection between two curves. Filter by extension rules. Record with fraction mapping.
     * @param localFractionA intersection fraction local to the subcurve of cpA between fractionA0 and fractionA1
     * @param cpA the first curve
     * @param fractionA0 start of the subcurve of cpA
     * @param fractionA1 end of the subcurve of cpA
     * @param localFractionB intersection fraction local to the subcurve of cpB between fractionB0 and fractionB1
     * @param cpB the second curve
     * @param fractionB0 start of the subcurve of cpB
     * @param fractionB1 end of the subcurve of cpB
     * @param reversed whether to reverse the details in the recorded intersection pair
     * @param intervalDetails optional data for a coincident segment intersection
     */
    private recordPointWithLocalFractions;
    /**
     * Emit recordPoint for multiple pairs (on full curve).
     * @param cpA first curve primitive (possibly different from curve in detailA, but fraction compatible).
     * @param cpB second curve primitive (possibly different from curve in detailA, but fraction compatible).
     * @param pairs array of pairs.
     * @param reversed true to have order reversed in final structures.
     */
    recordPairs(cpA: CurvePrimitive, cpB: CurvePrimitive, pairs: CurveLocationDetailPair[] | undefined, reversed: boolean): void;
    /** Compute intersection of two line segments. Filter by extension rules. Record with fraction mapping. */
    private computeSegmentSegment3D;
    /**
     * Compute intersection of projected homogeneous line segments. Filter by extension rules. Record with
     * fraction mapping. Assumes caller knows the _worldToLocal is present.
     */
    private computeSegmentSegment3DH;
    private dispatchSegmentSegment;
    private dispatchSegmentArc;
    /**
     * Compute the intersection of two xy-arcs.
     * * Each matrix has [U V C] in (x,y,w) form from homogeneous projection (local to world).
     * * Arcs are ordered so that matrixA is better conditioned.
     */
    private dispatchArcArcThisOrder;
    /**
     * We have 2 xy-arcs.
     * 1- We pick the arc that is closest to circular (larger condition number is closer to circular).
     * 2- Transform it to local coords, where it becomes the unit xy-circle.
     * 3- Use the same map to transform the other arc.
     * 4- Find the intersection of arc and unit circle.
     * 5- Convert intersection angles to fractions and record intersections.
     */
    private dispatchArcArc;
    /** Compute the intersection of an arc and a B-spline curve. */
    private dispatchArcBsplineCurve3d;
    /** Apply the transformation to bezier curves. Optionally construct ranges. */
    private transformBeziers;
    private getRanges;
    private dispatchBezierBezierStrokeFirst;
    private dispatchBSplineCurve3dBSplineCurve3d;
    /**
     * Apply the projection transform (if any) to (xyz, w).
     * @param xyz xyz parts of input point.
     * @param w weight to use for homogeneous effects.
     */
    private projectPoint;
    private mapNPCPlaneToWorld;
    private dispatchSegmentBsplineCurve;
    /** Low level dispatch of linestring with (beziers of) a bspline curve. */
    dispatchLineStringBSplineCurve(lsA: LineString3d, extendA0: boolean, extendA1: boolean, curveB: BSplineCurve3d, extendB0: boolean, extendB1: boolean, reversed: boolean): any;
    /** Detail computation for segment intersecting linestring. */
    computeSegmentLineString(lsA: LineSegment3d, extendA0: boolean, extendA1: boolean, lsB: LineString3d, extendB0: boolean, extendB1: boolean, reversed: boolean): any;
    /** Detail computation for arc intersecting linestring. */
    computeArcLineString(arcA: Arc3d, extendA0: boolean, extendA1: boolean, lsB: LineString3d, extendB0: boolean, extendB1: boolean, reversed: boolean): any;
    /** Detail computation for linestring intersecting linestring. */
    private computeLineStringLineString;
    private static setTransformedWorkPoints;
    /**
     * Low level dispatch of curve collection.
     * We take care of extend variables of geometry's children here if geometry is Path or Loop.
     */
    private dispatchCurveCollection;
    /**
     * Low level dispatch of CurveChainWithDistanceIndex.
     * We take care of extend variables of geometry's children here if geometry.path is Path or Loop.
     */
    private dispatchCurveChainWithDistanceIndex;
    /**
     * Invoke `child.dispatchToGeometryHandler(this)` for each child in the array returned by the query `g.children`.
     * We take care of extend variables of geometry's children here if geometry is Path or Loop.
     */
    handleChildren(g: GeometryQuery): any;
    /** Double dispatch handler for strongly typed segment. */
    handleLineSegment3d(segmentA: LineSegment3d): any;
    /** Double dispatch handler for strongly typed linestring. */
    handleLineString3d(lsA: LineString3d): any;
    /** Double dispatch handler for strongly typed arc. */
    handleArc3d(arc0: Arc3d): any;
    /** Double dispatch handler for strongly typed bspline curve. */
    handleBSplineCurve3d(curve: BSplineCurve3d): any;
    /** Double dispatch handler for strongly typed CurveChainWithDistanceIndex. */
    handleCurveChainWithDistanceIndex(chain: CurveChainWithDistanceIndex): any;
    /** Double dispatch handler for strongly typed homogeneous bspline curve. */
    handleBSplineCurve3dH(_curve: BSplineCurve3dH): any;
}
//# sourceMappingURL=CurveCurveIntersectXY.d.ts.map