import { AppObjectPM, getSingletonComponent, } from "@vived/core";
import { ZSpaceEntity } from "../Entities/ZSpaceEntity";
export class ZSpaceViewerScalePM extends AppObjectPM {
}
ZSpaceViewerScalePM.type = "ZSpaceViewerScalePM";
ZSpaceViewerScalePM.get = (appObjects) => getSingletonComponent(ZSpaceViewerScalePM.type, appObjects);
export function makeZSpaceViewerScalePM(appObject) {
    return new ZSpaceViewerScalePMImp(appObject);
}
class ZSpaceViewerScalePMImp extends ZSpaceViewerScalePM {
    get zSpace() {
        return this.getCachedSingleton(ZSpaceEntity.type);
    }
    vmsAreEqual(a, b) {
        return a === b;
    }
    constructor(appObject) {
        super(appObject, ZSpaceViewerScalePM.type);
        this.onZSpaceChange = () => {
            if (!this.zSpace)
                return;
            this.doUpdateView(this.zSpace.viewerScale);
        };
        this.zSpace?.addChangeObserver(this.onZSpaceChange);
        this.onZSpaceChange();
        this.appObjects.registerSingleton(this);
    }
}
//# sourceMappingURL=ZSpaceViewerScalePM.js.map