/*---------------------------------------------------------------------------------------------
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
* See LICENSE.md in the project root for license terms and full copyright notice.
*--------------------------------------------------------------------------------------------*/
/** @packageDocumentation
 * @module Curve
 */
import { Arc3d } from "../Arc3d";
import { CloneCurvesContext } from "./CloneCurvesContext";
/**
 * Algorithmic class for shallow-copying a CurveCollection with each full-sweep arc replaced by two half-sweep arcs.
 * * Often useful for building graphs from loops.
 * @internal
 */
export class TransferWithSplitArcs extends CloneCurvesContext {
    constructor() {
        super(undefined);
    }
    doClone(primitive) {
        if (primitive instanceof Arc3d && primitive.sweep.isFullCircle) // replace full arc with two half arcs
            return [primitive.clonePartialCurve(0.0, 0.5), primitive.clonePartialCurve(0.5, 1)];
        return primitive;
    }
    static clone(target) {
        const context = new TransferWithSplitArcs();
        target.announceToCurveProcessor(context);
        return context._result;
    }
}
//# sourceMappingURL=TransferWithSplitArcs.js.map