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

    2D viewer based on WebGL.

    Implements

    Index

    Constructors

    Properties

    container: HTMLElement
    modelManager: ModelManager
    objectStateManager: ObjectStateManager

    Methods

    • Objects were added to the set of visible objects

      Parameters

      • qids: Iterable<Qid>

        An Iterable of all the objects that were added

      Returns Promise<void>

      This method can return a Promise, if it does, subsequent listeners will only be notified after the returned Promise has resolved

    • TODO: write description

      Parameters

      • newVersions: Iterable<Model>

        The new versions that were added

      • allVersions: Iterable<Model>

        A list of all the currently loaded versions

      Returns Promise<void>

    • Called when the color of the given objects has been reset

      Parameters

      • qids: Iterable<Qid>

        The Qids of the objects for which the color has been reset

      Returns void | Promise<void>

    • Destroys the viewer and any (heavy) resources associated with it. As long as there is a reference to the Viewer2d instance it won't be completely destroyed.

      Returns void

    • Get the height of the viewer in pixels

      Returns number

    • Get the width of the viewer in pixels

      Returns number

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

      Parameters

      • qid: Qid

        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: Qid

        The Qid of the object being hovered over

      • previousQid: Qid

        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

    • This method must be called before loading any of the models. Keep in mind that this method is async, and models can only be loaded after the returned Promise has resolved.

      Returns Promise<void>

    • Returns boolean

      Whether rendering of generated door opening directions is currently enabled

    • Returns boolean

      Whether face rendering is currently enabled

    • Returns boolean

      Whether IFC line rendering is currently enabled

    • Returns boolean

      Whether wireframe rendering is currently enabled

    • Objects have been removed from the selection set

      Parameters

      • qids: Iterable<Qid>

        The Qids of the objects that have been removed from the selection set

      Returns void | Promise<void>

    • Objects were removed from the set of visible objects

      Parameters

      • qids: Iterable<Qid>

        An Iterable of all the objects that were removed

      Returns Promise<void>

      This method can return a Promise, if it does, subsequent listeners will only be notified after the returned Promise has resolved

    • Parameters

      • width: number
      • height: number

      Returns void

    • Will take a screenshot of the contents of the Viewer2d.

      Parameters

      Returns Promise<Blob>

      A Blob

      The returned Blob can for example be downloaded by the user, using the following example

      	const width = viewer2d.width;
      const height = viewer2d.height;
      const filename = `screencapture-${width}x${height}.png`;
      Utils.downloadBlob(blob, filename);
    • To be called whenever the rendering state has changed and updates need to become visible

      Returns void

    • The set of visible objects has been replaced to the given set

      Parameters

      • qids: Iterable<Qid>

        The objects that have been made visible

      • qidsToHide: Iterable<Qid>

        The objects that have been made invisible

      Returns void | Promise<unknown>

      This method can return a Promise, if it does, subsequent listeners will only be notified after the returned Promise has resolved

    • Starts the viewer. The viewer will only redraw when needed.

      Returns void

    • Stops the viewer. When the viewer is stopped, the view is not updated anymore. Any changes to the viewer will be accumulated and become visible as soon as the viewer is started again The main reason for stopping the viewer would be for performance, for example when the viewer is currently hidden

      Returns void

    • Toggle whether (generated) door openings are rendered. This only works for models that have been processed when the repository setting features.generate_door_openings had been enabled. Some models contains door opening direction geometry as IFC lines, in those cases it's best to disabled rendering generated door openings.

      Parameters

      • enabled: boolean

        True when enabled

      Returns void

    • Toggle whether faces are rendered.

      Parameters

      • enabled: boolean

        True when enabled

      Returns void

    • Toggle whether ifc lines are rendered. IFC Lines are all lines that have been defined in the original IFC file, such as Axis and FootPrint representations.

      Parameters

      • enabled: boolean

        True when enabled

      Returns void

    • Toggles whether the text labels are shown

      Returns void

    • Toggle whether wireframes are rendered. Wireframes are usually drawn to emphesize the edges and generally make the model look better

      Parameters

      • enabled: boolean

        True when enabled

      Returns 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>