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) => void | Promise<unknown>);
    unloaded?: ((qids) => void | Promise<void>);
    addedToSelectionSet?(qids, type): void | Promise<void>;
    addedToVisibleSet?(qids): void | Promise<void>;
    colorChanged?(qids, color): void | Promise<void>;
    colorReset?(qids): void | Promise<void>;
    hoverOff?(qid): void;
    hoverOn?(qid, previousQid, screenspaceLocation): void;
    primarySelectionChanged?(qid): void | Promise<unknown>;
    removedFromSelectionSet?(qids, type): void | Promise<void>;
    removedFromVisibleSet?(qids, type?): void | Promise<void>;
    setBuildingStoreyVisibleExclusive?(qid): void | Promise<void>;
    setBuildingStoreysVisibleExclusive?(buildingStoreyQids, hideOpenings): void | Promise<void>;
    setToSelectionSet?(qids, qidsToUnselect, type): void | Promise<void>;
    setVisibleSet?(shown, hidden, force): void | Promise<unknown>;
    viewFit?(qids, options?): void | Promise<void>;
    viewFitModels?(versionUuids, options?): void | Promise<void>;
}

Implemented by

    Properties

    setLabels?: ((labels) => void | Promise<unknown>)

    Type declaration

      • (labels): void | Promise<unknown>
      • Parameters

        Returns void | Promise<unknown>

    unloaded?: ((qids) => void | Promise<void>)

    Type declaration

      • (qids): void | Promise<void>
      • Parameters

        • qids: Iterable<string>

        Returns void | Promise<void>

    Methods

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

      Parameters

      • qids: Iterable<string>
      • type: string

      Returns void | Promise<void>

      Qids

      Iterable<@bimworks/jssdk!Qid> that provides the @bimworks/jssdk!Qids of the objects added to the selection set. @type:

    • 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>
      • Optional type: 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

      • qids: Iterable<string>
      • qidsToUnselect: Iterable<string>
      • type: string

      Returns void | Promise<void>

      Qids

      Iterable<@bimworks/jssdk!Qid> that provides the @bimworks/jssdk!Qids of the objects added to the selection set. @type:

    • 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

      • Optional options: 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

      • Optional options: ViewFitOptions

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

      Returns void | Promise<void>