/*---------------------------------------------------------------------------------------------
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
* See LICENSE.md in the project root for license terms and full copyright notice.
*--------------------------------------------------------------------------------------------*/
import { RecursiveCurveProcessorWithStack } from "../CurveProcessor";
import { LineSegment3d } from "../LineSegment3d";
import { LineString3d } from "../LineString3d";
/** Algorithmic class: Count LineSegment3d and LineString3d primitives.
 * @internal
 */
export class CountLinearPartsSearchContext extends RecursiveCurveProcessorWithStack {
    numLineSegment;
    numLineString;
    numOther;
    constructor() {
        super();
        this.numLineSegment = 0;
        this.numLineString = 0;
        this.numOther = 0;
    }
    static hasNonLinearPrimitives(target) {
        const context = new CountLinearPartsSearchContext();
        target.announceToCurveProcessor(context);
        return context.numOther > 0;
    }
    announceCurvePrimitive(curve, _indexInParent) {
        if (curve instanceof LineSegment3d)
            this.numLineSegment++;
        else if (curve instanceof LineString3d)
            this.numLineString++;
        else
            this.numOther++;
    }
}
//# sourceMappingURL=CountLinearPartsSearchContext.js.map