2D viewer based on WebGL.

Hierarchy

  • Viewer2d

Implements

  • ModelListener
  • ObjectStateListener

Constructors

  • Create a new Viewer2d

    Parameters

    • objectStateManager: ObjectStateManager

      The ObjectStateManager manages all object related state such as visibility, color and selection

    • Optional settings: Viewer2dSettings

      Optional settings, will use default settings when not provided

    Returns Viewer2d

Properties

container: HTMLElement
modelManager: ModelManager
objectStateManager: ObjectStateManager

Methods

  • Parameters

    • newVersions: Iterable<Model>
    • allVersions: Iterable<Model>

    Returns Promise<void>

  • Parameters

    • qids: string[]

    Returns void | Promise<void>

  • Parameters

    • qids: string[]

    Returns Promise<void>

  • Parameters

    • qids: string[]
    • color: TinyColor

    Returns void | Promise<void>

  • Parameters

    • qids: string[]

    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

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

  • Parameters

    • qid: string

    Returns void | Promise<unknown>

  • Internal

    Parameters

    • stream: any
    • settings: any
    • labeller: any
    • vid: any
    • geometryBatchId: any
    • bb: any

    Returns void

  • Parameters

    • versions: unknown

    Returns Promise<void>

  • Parameters

    • qids: string[]

    Returns void | Promise<void>

  • Parameters

    • qids: string[]

    Returns Promise<void>

  • Parameters

    • width: number
    • height: number

    Returns void

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

    Example

    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);

    Returns

    A Blob

    Parameters

    Returns Promise<Blob>

  • Parameters

    • buildingStoreyQid: unknown

    Returns void

  • Parameters

    • buildingStoreyQids: string[]

    Returns void

  • To be called whenever the rendering state has changed and updates need to become visible

    Returns void

  • Parameters

    • qids: string[]
    • qidsToUnselect: string[]

    Returns void | Promise<void>

  • Parameters

    • qids: string[]
    • qidsToHide: string[]

    Returns void | Promise<unknown>

  • 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

  • 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

  • {@inheritDoc ObjectStateListener.viewFit}

    Parameters

    • qids: Iterable<string>
    • Optional options: ViewFitOptions

    Returns void

  • {@inheritDoc ObjectStateListener.viewFitModels}

    Parameters

    • versionUuids: Iterable<string>
    • Optional options: ViewFitOptions

    Returns void | Promise<void>

Generated using TypeDoc