"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.setupSceneRoot = setupSceneRoot;
const Tools_1 = require("../../Tools");
const Transform3D_1 = require("../../Transform3D");
const Controllers_1 = require("../Controllers");
const Entities_1 = require("../Entities");
const UC_1 = require("../UC");
function setupSceneRoot(appObjects, defaultData) {
    const ao = appObjects.getOrCreate("SceneRoot");
    const entity = (0, Entities_1.makeSceneRootEntity)(ao);
    if (defaultData) {
        entity.applyDefaultData(defaultData);
    }
    // UCs
    (0, UC_1.makeBumpSceneRootScaleAboutPixelPointUC)(ao);
    (0, UC_1.makeCenterSceneRootOnPixelPickUC)(ao);
    (0, UC_1.makeDragScaleSceneRootUC)(ao);
    (0, UC_1.makeFocusOnPixelUC)(ao);
    (0, UC_1.makeOrbitSceneRootUC)(ao);
    (0, UC_1.makePanSceneRootUC)(ao);
    (0, UC_1.makePinchSceneRootUC)(ao);
    new UC_1.ScaleSceneRootWithRay(ao);
    (0, UC_1.makeSerializeSceneRoot)(ao);
    (0, Transform3D_1.makeStylusMoveTransformUC)(ao);
    const scaleUC = (0, Transform3D_1.makeScaleTransformUC)(ao);
    scaleUC.pixelSensitivity = 0.01;
    const rayScale = (0, Transform3D_1.makeRayPanScaleTransformUC)(ao);
    rayScale.sensitivity = 10;
    // PMs
    (0, Transform3D_1.makeTransform3DPM)(ao);
    // Controllers
    new Controllers_1.MouseClickToFocus(ao);
    new Controllers_1.MouseOrbit(ao);
    new Controllers_1.MousePan(ao);
    new Controllers_1.MouseRoll(ao);
    new Controllers_1.MouseScale(ao);
    new Controllers_1.DoubleTapToFocus(ao);
    new Controllers_1.TouchOrbit(ao);
    new Controllers_1.TouchPan(ao);
    new Controllers_1.TouchPinch(ao);
    new Controllers_1.TouchScale(ao);
    new Controllers_1.SceneRootMoveSC(ao);
    new Transform3D_1.PanScaleTransformSC(ao);
    // Setup Tools
    const toolRepo = Tools_1.ToolRepository.get(appObjects);
    if (!toolRepo) {
        appObjects.submitWarning("setupSceneRoot", "Unable to find tool repo");
        return ao;
    }
    toolRepo.makeToolFromData({
        toolType: "ORBIT",
        isDefault: false,
        label: "Orbit",
        shortcutLabel: "o",
        hotkeys: [{ keyCode: "KeyO" }],
    });
    toolRepo.makeToolFromData({
        toolType: "PAN",
        isDefault: true,
        label: "Pan",
        shortcutLabel: "x",
        hotkeys: [{ keyCode: "KeyX" }],
    });
    toolRepo.makeToolFromData({
        toolType: "ZOOM",
        isDefault: false,
        label: "Zoom",
        shortcutLabel: "z",
        hotkeys: [{ keyCode: "KeyZ" }],
    });
    return ao;
}
//# sourceMappingURL=setupSceneRoot.js.map