BIM.works SDKs - v1.5.0-b164
    Preparing search index...

    An instance of ObjectStateManager keeps track of all the viewer-related state and distributes this state to other components, usually viewers. This state includes:

    • Visibility of objects
    • User-changed colors of objects
    • Selection of objects
    • Object labelling
    • View fitting of objects

    Most applications will have one ObjectStateManager, but you can have more. The most common scenatio is to have one ObjectStateManager, one Viewer3d and one Viewer2d. Both viewers being connected to the same ObjectStateManager so that the state is kept in sync.

    Index

    Constructors

    Methods

    • Add the provided objects to the currently pickable set of objects

      Parameters

      • query: string | Iterable<Qid, any, any>

        Either a query or Iterable of Qid

      • Optionalforce: boolean

        Whether to force this change, when forced, any viewer-specific settings are overruled

      • Optionaltype: string

        Always "BIM"

      Returns Promise<void>

    • Add a set of objects to the selected set

      Parameters

      • query: string | Iterable<Qid, any, any>
      • Optionaltype: string

      Returns Promise<void>

    • Add the provided objects to the currently visible set of objects *

      Parameters

      • query: string | Iterable<Qid, any, any>

        Either a query or Iterable of Qid *

      • Optionalforce: boolean

        Whether to force this change, when forced, any viewer-specific settings are overruled *

      • Optionaltype: string

        Always "BIM"

      Returns Promise<void>

    • Change the color of a given set of objects. When changing the colors of multiple sets of objects, use the more efficient changeColorMulti method.

      Parameters

      • query: string | Iterable<Qid, any, any>

        A query or iterable of Qids, the objects to change color

      • color: Color

        The new color, many representations are supported including "#00FF00", "#F0", "[r, g, b, a]" and "red"

      Returns Promise<void>

      A Promise that triggers when all connected listeners have applied the change

    • Change the state of the given qid to not being hovered on anymore. In the Viewer3d tis will fade out the green glow over time.

      Parameters

      • qid: Qid

        The Qid of the object not being hovered over anymore

      Returns void

    • Change the state of the given qid to being hovered on. In the Viewer3d this will give the object a green glow

      Parameters

      • qid: Qid

        The Qid of the object being hovered over

      • OptionalscreenspaceLocation: vec2

        The screen space location of the hover event. This is not relevant/available in all situations and can be null

      Returns void

    • Remove objects from the set of pickable objects

      Parameters

      • query: string | Iterable<Qid, any, any>

        Either a query or Iterable of Qid

      • Optionalforce: boolean

        Whether to force this change, when forced, any viewer-specific settings are overruled

      • Optionaltype: string

        Always "BIM"

      Returns Promise<void>

    • Remove the provided objects from the current selection

      Parameters

      • query: string | Iterable<Qid, any, any>
      • Optionaltype: string

      Returns Promise<void>

    • Remove objects from the set of visible objects

      Parameters

      • query: string | Iterable<Qid, any, any>

        Either a query or Iterable of Qid

      • Optionalforce: boolean

        Whether to force this change, when forced, any viewer-specific settings are overruled

      • Optionaltype: string

        Always "BIM"

      Returns Promise<void>

    • Resets the internal ObjectStateManager state to the default state, which means:

      • Visibility is reset to the original visibility, by default this leaves out the types IFCOPENINGELEMENT, IFCPROJECT, IFCBUILDING, IFCBUILDINGSTOREY and IFCZONE
      • Color, all objects are reset to their original color
      • Selection, any selected objects will be unselected

      All of these changes trigger the regular listeners and therefore the connected viewers.

      Returns Promise<void>

    • Parameters

      • query: string | Iterable<Qid, any, any>

        A query or iterable of Qids, the objects to reset color

      Returns Promise<void>

      A Promise that triggers when all connected listeners have applied the change

    • Parameters

      • buildingStoreyQids: Iterable<Qid>
      • visible: boolean

      Returns Promise<void>

    • Parameters

      • query: string | Iterable<Qid, any, any>
      • OptionalhideOpenings: boolean

      Returns Promise<unknown>

    • Change the labels of objects. Depending on the viewer labels are visualized differently.

      Parameters

      • labels: Label[]

        An array of Label

      Returns void

    • Update the set of pickable objects, replacing any previous pickable state

      Parameters

      • query: string | Iterable<Qid, any, any>

        Either a query or Iterable of Qid

      • Optionalforce: boolean

        Whether to force this change, when forced, any viewer-specific settings are overruled

      • Optionaltype: string

        Always "BIM"

      Returns Promise<void>

    • Replace the currently selected set by the provided set of objects

      Parameters

      • query: string | Iterable<Qid, any, any>
      • Optionaltype: string

      Returns Promise<void>

    • Update the set of visible objects, replacing any previous visibily state

      Parameters

      • query: string | Iterable<Qid, any, any>

        Either a query or Iterable of Qid

      • Optionalforce: boolean

        Whether to force this change, when forced, any viewer-specific settings are overruled

      • Optionaltype: string

        Always "BIM"

      Returns Promise<void>

    • Calling this method will update all connected viewers in a way that all of them are afterwards showing at least all of the queried objects.

      Parameters

      • query: string | Iterable<Qid, any, any>

        A query or iterable of Qids, the objects to reset color

      • options: ViewFitOptions

      Returns Promise<void>