import { RecursiveCurveProcessor } from "../CurveProcessor";
/** Algorithmic class: Transform curves in place.
 * @internal
 */
export class TransformInPlaceContext extends RecursiveCurveProcessor {
    numFail;
    numOK;
    transform;
    constructor(transform) { super(); this.numFail = 0; this.numOK = 0; this.transform = transform; }
    static tryTransformInPlace(target, transform) {
        const context = new TransformInPlaceContext(transform);
        target.announceToCurveProcessor(context);
        return context.numFail === 0;
    }
    announceCurvePrimitive(curvePrimitive, _indexInParent) {
        if (!curvePrimitive.tryTransformInPlace(this.transform))
            this.numFail++;
        else
            this.numOK++;
    }
}
//# sourceMappingURL=TransformInPlaceContext.js.map