"use strict";
/*---------------------------------------------------------------------------------------------
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
* See LICENSE.md in the project root for license terms and full copyright notice.
*--------------------------------------------------------------------------------------------*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.TransferWithSplitArcs = void 0;
/** @packageDocumentation
 * @module Curve
 */
const Arc3d_1 = require("../Arc3d");
const CloneCurvesContext_1 = require("./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
 */
class TransferWithSplitArcs extends CloneCurvesContext_1.CloneCurvesContext {
    constructor() {
        super(undefined);
    }
    doClone(primitive) {
        if (primitive instanceof Arc3d_1.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;
    }
}
exports.TransferWithSplitArcs = TransferWithSplitArcs;
//# sourceMappingURL=TransferWithSplitArcs.js.map