"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.SumLengthsContext = void 0;
const CurveProcessor_1 = require("../CurveProcessor");
/**
 * Algorithmic class: Sum lengths of curves
 * @internal
 */
class SumLengthsContext extends CurveProcessor_1.RecursiveCurveProcessor {
    _sum;
    constructor() {
        super();
        this._sum = 0.0;
    }
    static sumLengths(target) {
        const context = new SumLengthsContext();
        target.announceToCurveProcessor(context);
        return context._sum;
    }
    announceCurvePrimitive(curvePrimitive, _indexInParent) {
        this._sum += curvePrimitive.curveLength();
    }
}
exports.SumLengthsContext = SumLengthsContext;
//# sourceMappingURL=SumLengthsContext.js.map