Options
All
  • Public
  • Public/Protected
  • All
Menu

Class StoreyViewsPlugin

A Viewer plugin that provides methods for visualizing IfcBuildingStoreys.

Hierarchy

Index

Constructors

Properties

id: string

ID for this Plugin, unique within its Viewer.

modelStoreys: {}

A set of {@link Storey}s for each MetaModel.

These are created and destroyed automatically as models are loaded and destroyed.

Type declaration

  • [key: string]: {}
    • [key: string]: Storey
storeys: {}

A {@link Storey} for each ````IfcBuildingStorey```.

There will be a {@link Storey} for every existing MetaObject whose MetaObject.type equals "IfcBuildingStorey".

These are created and destroyed automatically as models are loaded and destroyed.

Type declaration

  • [key: string]: Storey
viewer: Viewer

The Viewer that contains this Plugin.

Accessors

Methods

  • createStoreyMap(storeyId: string, options?: { format?: "png" | "jpeg"; height?: number; width?: number }): StoreyMap
  • Creates a 2D map of the given storey.

    Parameters

    • storeyId: string

      ID of the IfcBuildingStorey object.

    • Optional options: { format?: "png" | "jpeg"; height?: number; width?: number }
      • Optional format?: "png" | "jpeg"
      • Optional height?: number
      • Optional width?: number

    Returns StoreyMap

    The StoreyMap.

  • destroy(): void
  • error(msg: string): void
  • Logs an error message to the JavaScript developer console, prefixed with the ID of this Plugin.

    Parameters

    • msg: string

      The error message

    Returns void

  • fire(event: string, value: any): void
  • Fires an event at this Plugin.

    Parameters

    • event: string

      The event type name

    • value: any

      The event parameters

    Returns void

  • getStoreyContainingWorldPos(worldPos: number[]): string
  • Gets the ID of the storey that contains the given 3D World-space position. .

    Parameters

    • worldPos: number[]

      3D World-space position.

    Returns string

    ID of the storey containing the position, or null if the position falls outside all the storeys.

  • gotoStoreyCamera(storeyId: string, options?: { done?: Function; projection?: string }): void
  • log(msg: string): void
  • Logs a message to the JavaScript developer console, prefixed with the ID of this Plugin.

    Parameters

    • msg: string

      The error message

    Returns void

  • on(event: "storeys", callback: (storyes: {}) => void): void
  • Fires when the storeys are updated (after a model is added or removed).

    Parameters

    • event: "storeys"

      The storeys event

    • callback: (storyes: {}) => void

      Callback fired on the event

        • (storyes: {}): void
        • Parameters

          • storyes: {}
            • [key: string]: Storey

          Returns void

    Returns void

  • pickStoreyMap(storeyMap: StoreyMap, imagePos: number[], options?: { pickSurface?: boolean }): PickResult
  • Attempts to pick an Entity at the given pixel coordinates within a StoreyMap image.

    Parameters

    • storeyMap: StoreyMap

      The StoreyMap.

    • imagePos: number[]

      2D pixel coordinates within the bounds of {@link StoreyMap.imageData}.

    • Optional options: { pickSurface?: boolean }
      • Optional pickSurface?: boolean

    Returns PickResult

    The pick result, if an Entity was successfully picked, else null.

  • showStoreyObjects(storeyId: string, options?: { hideOthers?: boolean; useObjectStates?: boolean }): void
  • Shows the Entitys within the given storey.

    Optionally hides all other Entitys.

    Optionally sets the visual appearance of each of the Entitys according to its IFC type. The appearance of IFC types in plan views is configured by StoreyViewsPlugin.objectStates.

    See also: ObjectsMemento, which saves and restores a memento of the visual state of the Entity's that represent objects within a Scene.

    Parameters

    • storeyId: string

      ID of the IfcBuildingStorey object.

    • Optional options: { hideOthers?: boolean; useObjectStates?: boolean }
      • Optional hideOthers?: boolean
      • Optional useObjectStates?: boolean

    Returns void

  • warn(msg: string): void
  • Logs a warning message to the JavaScript developer console, prefixed with the ID of this Plugin.

    Parameters

    • msg: string

      The error message

    Returns void

  • withStoreyObjects(storeyId: string, callback: Function): void
  • worldDirToStoreyMap(storeyMap: StoreyMap, worldDir: number[], imageDir: number[]): void
  • Converts a 3D World-space direction vector to a 2D vector within a StoreyMap image.

    Parameters

    • storeyMap: StoreyMap

      The StoreyMap.

    • worldDir: number[]

      3D World-space direction vector.

    • imageDir: number[]

      Normalized 2D direction vector.

    Returns void

  • worldPosToStoreyMap(storeyMap: StoreyMap, worldPos: number[], imagePos: number[]): boolean
  • Converts a 3D World-space position to a 2D position within a StoreyMap image.

    Use StoreyViewsPlugin.pickStoreyMap to convert 2D image positions to 3D world-space.

    Parameters

    • storeyMap: StoreyMap

      The StoreyMap.

    • worldPos: number[]

      3D World-space position within the storey.

    • imagePos: number[]

      2D pixel position within the {@link StoreyMap.imageData}.

    Returns boolean

    True if imagePos is within the bounds of the {@link StoreyMap.imageData}, else false if it falls outside.

Generated using TypeDoc