"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.TransformInPlaceContext = void 0;
const CurveProcessor_1 = require("../CurveProcessor");
/** Algorithmic class: Transform curves in place.
 * @internal
 */
class TransformInPlaceContext extends CurveProcessor_1.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++;
    }
}
exports.TransformInPlaceContext = TransformInPlaceContext;
//# sourceMappingURL=TransformInPlaceContext.js.map