"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
/** An operation that returns the objects to their initial place (position and orientation). */
var CancelOperation = /** @class */ (function () {
    /**
     * The constructor.
     * @param operation The operation that will be used in start and motion phase
     * @param positions The initial positions
     * @param rotations The inital rotations
     */
    function CancelOperation(operation, positions, rotations) {
        this.operation = operation;
        this.initialTransformation = positions.map(function (pos, index) {
            return {
                position: pos,
                rotation: rotations[index],
            };
        });
    }
    CancelOperation.prototype.executeStart = function (request) {
        this.operation.executeStart(request);
    };
    CancelOperation.prototype.executeMotion = function (request) {
        return this.operation.executeMotion(request);
    };
    CancelOperation.prototype.executeEnd = function (request) {
        return {
            transformations: this.initialTransformation,
            snapMatches: [],
            isInvalid: false,
        };
    };
    return CancelOperation;
}());
exports.CancelOperation = CancelOperation;
