import { AppObjectEntity, MemoizedVector2, Vector2, } from "@vived/core";
import { Transform3D } from "../../Transform3D";
export var ZSpaceDevice;
(function (ZSpaceDevice) {
    ZSpaceDevice["MAKO"] = "MAKO";
    ZSpaceDevice["INSPIRE"] = "INSPIRE";
    ZSpaceDevice["AIO"] = "AIO";
})(ZSpaceDevice || (ZSpaceDevice = {}));
export class ZSpaceDisplayEntity extends AppObjectEntity {
}
ZSpaceDisplayEntity.type = "ZSpaceDisplayEntity";
export function makeZSpaceDisplayEntity(appObj) {
    return new ZSpaceDisplayEntityImp(appObj);
}
class ZSpaceDisplayEntityImp extends ZSpaceDisplayEntity {
    get displaySizeMeters() {
        return this.memoizedSizeMeters.val;
    }
    set displaySizeMeters(val) {
        this.memoizedSizeMeters.val = val;
    }
    get displaySizePixels() {
        return this.memoizedSizePixels.val;
    }
    set displaySizePixels(val) {
        this.memoizedSizePixels.val = val;
    }
    get metersPerPixel() {
        if (this.memoizedSizePixels.val.x === 0)
            return 0;
        return this.memoizedSizeMeters.val.x / this.memoizedSizePixels.val.x;
    }
    get pixelPerMeter() {
        if (this.memoizedSizeMeters.val.x === 0)
            return 0;
        return this.memoizedSizePixels.val.x / this.memoizedSizeMeters.val.x;
    }
    setForDevice(device) {
        if (device === ZSpaceDevice.AIO) {
            this.displaySizeMeters = new Vector2(0.521, 0.293);
        }
        else {
            this.displaySizeMeters = new Vector2(0.344, 0.193);
        }
        this.displaySizePixels = new Vector2(1920, 1080);
    }
    setForSize(width, height) {
        this.displaySizeMeters = new Vector2(width, height);
        this.displaySizePixels = new Vector2(1920, 1080);
    }
    constructor(appObject) {
        super(appObject, ZSpaceDisplayEntity.type);
        this.memoizedSizeMeters = new MemoizedVector2(Vector2.One(), this.notifyOnChange);
        this.memoizedSizePixels = new MemoizedVector2(Vector2.One(), this.notifyOnChange);
        this.transform = Transform3D.addIfMissing(appObject);
    }
}
//# sourceMappingURL=ZSpaceDisplayEntity.js.map