"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var ig_gfx_core_1 = require("@intelligentgraphics/ig.gfx.core");
/**
 * Manages the enabled status for postprocessing
 *
 * Postprocessing will be deactivated while gfx updates are in progress
 *
 * @export
 * @class SceneUpdatePostprocessingManager
 */
var SceneUpdatePostprocessingManager = /** @class */ (function () {
    function SceneUpdatePostprocessingManager(plannerManager) {
        var _this = this;
        plannerManager.hooks.sceneUpdateStart.tap("SceneUpdatePostprocessingManager", function () {
            _this.togglePostprocessing(false);
        });
        plannerManager.hooks.sceneUpdateDone.tap("SceneUpdatePostprocessingManager", function () {
            _this.togglePostprocessing(!plannerManager.hasPendingUpdates() &&
                plannerManager.getSceneStatus() !== "preview");
        });
    }
    SceneUpdatePostprocessingManager.prototype.togglePostprocessing = function (enable) {
        ig_gfx_core_1.State.postprocessingOptions.globalEnable = enable;
        ig_gfx_core_1.State.API.RedrawScene();
    };
    return SceneUpdatePostprocessingManager;
}());
exports.SceneUpdatePostprocessingManager = SceneUpdatePostprocessingManager;
