import { State } from "@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) {
        State.postprocessingOptions.globalEnable = enable;
        State.API.RedrawScene();
    };
    return SceneUpdatePostprocessingManager;
}());
export { SceneUpdatePostprocessingManager };
