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 @param: qid: The Qid of the object that is not being hovered over anymore

      Parameters

      • qid: string

      Returns void

    • Called then the given object is being hovered on

      Parameters

      • qid: string
      • previousQid: string
      • screenspaceLocation: vec2

      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>