An interface that can be implemented to be notified about certain ObjectStateManager related events. All of the methods allow the ability to return a Promise. When a Promise is returned, the ObjectStateManager will wait before it will trigger the next listener until the Promise resolves. Keep that in mind when returning a Promise.

interface ObjectStateListener {
    setLabels?: ((labels: Iterable<Label>) => void | Promise<unknown>);
    unloaded?: ((qids: Iterable<string>) => void | Promise<void>);
    addedToSelectionSet?(qids: Iterable<string>, type: string): void | Promise<void>;
    addedToVisibleSet?(qids: Iterable<string>): void | Promise<void>;
    colorChanged?(qids: Iterable<string>, color: Color): void | Promise<void>;
    colorReset?(qids: Iterable<string>): void | Promise<void>;
    hoverOff?(qid: string): void;
    hoverOn?(qid: string, previousQid: string, screenspaceLocation: vec2): void;
    primarySelectionChanged?(qid: string): void | Promise<unknown>;
    removedFromSelectionSet?(qids: Iterable<string>, type: string): void | Promise<void>;
    removedFromVisibleSet?(qids: Iterable<string>, type?: string): void | Promise<void>;
    setBuildingStoreyVisibleExclusive?(qid: string): void | Promise<void>;
    setBuildingStoreysVisibleExclusive?(buildingStoreyQids: Iterable<string>, hideOpenings: boolean): void | Promise<void>;
    setToSelectionSet?(qids: Iterable<string>, qidsToUnselect: Iterable<string>, type: string): void | Promise<void>;
    setVisibleSet?(shown: Iterable<string>, hidden: Iterable<string>, force: boolean): void | Promise<unknown>;
    viewFit?(qids: Iterable<string>, options?: ViewFitOptions): void | Promise<void>;
    viewFitModels?(versionUuids: Iterable<string>, options?: ViewFitOptions): void | Promise<void>;
}

Implemented by

    Properties

    setLabels?: ((labels: Iterable<Label>) => void | Promise<unknown>)
    unloaded?: ((qids: Iterable<string>) => void | Promise<void>)

    Methods

    • This method will get called when objects have been added to the selection.

      Parameters

      Returns void | Promise<void>

    • Called then the given object is not being hovered on anymore

      Parameters

      • qid: string

        The Qid of the object that is not being hovered over anymore

      Returns void

    • Called then the given object is being hovered on

      Parameters

      • qid: string

        The Qid of the object being hovered over

      • previousQid: string

        The Qid of the previous objects that was being hovered over

      • screenspaceLocation: vec2

        The screenspace location of the hover event. This can be useful to for example place a popup/tooltip at that location. Screenspace location is x, y coordinate between 0, 0 and canvas width,height

      Returns void

    • Parameters

      • qids: Iterable<string>
      • type: string

      Returns void | Promise<void>

    • Parameters

      • qids: Iterable<string>
      • Optionaltype: string

      Returns void | Promise<void>

    • Parameters

      • buildingStoreyQids: Iterable<string>
      • hideOpenings: boolean

      Returns void | Promise<void>

    • This method will get called when the set of selected objects has been

      Parameters

      Returns void | Promise<void>

    • Parameters

      • shown: Iterable<string>
      • hidden: Iterable<string>
      • force: boolean

      Returns void | Promise<unknown>

    • Fit the given object into view.

      Parameters

      • qids: Iterable<string>

        The Qids of the objects to fit

      • Optionaloptions: ViewFitOptions

        To provide a buffer around the objects. A percentage, where 0 means no buffer and 100 means only buffer

      Returns void | Promise<void>

    • Fit the given models into view.

      Parameters

      • versionUuids: Iterable<string>

        The models to fit

      • Optionaloptions: ViewFitOptions

        To provide a buffer around the objects. A percentage, where 0 means no buffer and 100 means only buffer

      Returns void | Promise<void>