import { makeIsHiddenPM } from "../../Hideable/PM";
import { makeLabelPM } from "../../Label/PM";
import { ClearCustomLabelUC, SetCustomLabelUC } from "../../Label/UC";
import { makeOverlayColorPM, SetOverlayColorUC } from "../../OverlayColor";
import { makeSelectableStatePM, Selection } from "../../Selection";
import { makeTransform3DPM } from "../../Transform3D";
import { LandmarkEntity, makeLandmarkEntity } from "../Entities";
import { makeLandmarkSizePM } from "../PM";
import { makeDeleteLandmarkUC, makeSetLandmarkSizeUC } from "../UseCases";
export function makeLandmarkFactory(appObjects) {
    return function landmarkFactory(id) {
        const appObject = appObjects.getOrCreate(id);
        let landmarkEntity = LandmarkEntity.get(appObject);
        if (!landmarkEntity) {
            landmarkEntity = makeLandmarkEntity(appObject);
        }
        // UCs
        new SetOverlayColorUC(appObject);
        new SetCustomLabelUC(appObject);
        new ClearCustomLabelUC(appObject);
        makeSetLandmarkSizeUC(appObject);
        makeDeleteLandmarkUC(appObject);
        // PMs
        makeTransform3DPM(appObject);
        makeOverlayColorPM(appObject);
        makeSelectableStatePM(appObject);
        makeIsHiddenPM(appObject);
        makeLabelPM(appObject);
        makeLandmarkSizePM(appObject);
        const selection = Selection.get(appObject.appObjectRepo);
        if (selection) {
            selection.addSelectable(landmarkEntity.selectable);
        }
        return landmarkEntity;
    };
}
//# sourceMappingURL=landmarkFactory.js.map