/*---------------------------------------------------------------------------------------------
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
* See LICENSE.md in the project root for license terms and full copyright notice.
*--------------------------------------------------------------------------------------------*/
import { RecursiveCurveProcessor } from "../CurveProcessor";
/**
 * Algorithmic class: Sum lengths of curves
 * @internal
 */
export class SumLengthsContext extends 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();
    }
}
//# sourceMappingURL=SumLengthsContext.js.map