import { AppObjectController } from "@vived/core";
import { StylusEntity } from "../../Stylus";
import { TryShowHoverLabel } from "../UseCases";
export class ZSpaceStylusHoverLabel extends AppObjectController {
}
ZSpaceStylusHoverLabel.type = "StylusHoverLabelController";
export function makeStylusHoverLabelController(appObject) {
    return new ZSpaceStylusHoverLabelImp(appObject);
}
class ZSpaceStylusHoverLabelImp extends ZSpaceStylusHoverLabel {
    constructor(appObject) {
        super(appObject, ZSpaceStylusHoverLabel.type);
        this.allow = () => {
            return true;
        };
        this.onStylusMove = () => {
            if (!this.stylus) {
                return;
            }
            if (!this.allow()) {
                return;
            }
            this.tryShowStylusHoverLabel?.tryShowWorldHoverLabel(this.stylus.pickRay);
        };
        this.stylus = StylusEntity.get(this.appObjects);
        this.tryShowStylusHoverLabel = TryShowHoverLabel.get(this.appObjects);
        if (!this.stylus) {
            this.error("Cannot find StylusEntity");
        }
        else if (!this.tryShowStylusHoverLabel) {
            this.error("Cannot find TryShowHoverLabel");
        }
        else {
            this.stylus.registerController(this);
        }
    }
}
//# sourceMappingURL=StylusHoverLabel.js.map