"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.makeLandmarkFactory = makeLandmarkFactory;
const PM_1 = require("../../Hideable/PM");
const PM_2 = require("../../Label/PM");
const UC_1 = require("../../Label/UC");
const OverlayColor_1 = require("../../OverlayColor");
const Selection_1 = require("../../Selection");
const Transform3D_1 = require("../../Transform3D");
const Entities_1 = require("../Entities");
const PM_3 = require("../PM");
const UseCases_1 = require("../UseCases");
function makeLandmarkFactory(appObjects) {
    return function landmarkFactory(id) {
        const appObject = appObjects.getOrCreate(id);
        let landmarkEntity = Entities_1.LandmarkEntity.get(appObject);
        if (!landmarkEntity) {
            landmarkEntity = (0, Entities_1.makeLandmarkEntity)(appObject);
        }
        // UCs
        new OverlayColor_1.SetOverlayColorUC(appObject);
        new UC_1.SetCustomLabelUC(appObject);
        new UC_1.ClearCustomLabelUC(appObject);
        (0, UseCases_1.makeSetLandmarkSizeUC)(appObject);
        (0, UseCases_1.makeDeleteLandmarkUC)(appObject);
        // PMs
        (0, Transform3D_1.makeTransform3DPM)(appObject);
        (0, OverlayColor_1.makeOverlayColorPM)(appObject);
        (0, Selection_1.makeSelectableStatePM)(appObject);
        (0, PM_1.makeIsHiddenPM)(appObject);
        (0, PM_2.makeLabelPM)(appObject);
        (0, PM_3.makeLandmarkSizePM)(appObject);
        const selection = Selection_1.Selection.get(appObject.appObjectRepo);
        if (selection) {
            selection.addSelectable(landmarkEntity.selectable);
        }
        return landmarkEntity;
    };
}
//# sourceMappingURL=landmarkFactory.js.map