Options
All
  • Public
  • Public/Protected
  • All
Menu

Class XKTLoaderPlugin

Viewer plugin that loads models from xeokit's optimized .XKT format.

Hierarchy

Index

Constructors

Properties

id: string

ID for this Plugin, unique within its Viewer.

viewer: Viewer

The Viewer that contains this Plugin.

Accessors

  • get excludeTypes(): string[]
  • set excludeTypes(arg: string[]): void
  • Gets the blacklist of IFC types that are never loaded by this XKTLoaderPlugin.

    When loading models with metadata, causes this XKTLoaderPlugin to not load objects whose types are in this list. An object's type is indicated by its MetaObject's MetaObject.type.

    Default value is undefined.

    Returns string[]

  • Sets the blacklist of IFC types that are never loaded by this XKTLoaderPlugin.

    When loading models with metadata, causes this XKTLoaderPlugin to not load objects whose types are in this list. An object's type is indicated by its MetaObject's MetaObject.type.

    Default value is undefined.

    Parameters

    • arg: string[]

    Returns void

  • get excludeUnclassifiedObjects(): boolean
  • set excludeUnclassifiedObjects(arg: boolean): void
  • Gets whether we load objects that don't have IFC types.

    When loading models with metadata and this is true, XKTLoaderPlugin will not load objects that don't have IFC types.

    Default value is false.

    Returns boolean

  • Sets whether we load objects that don't have IFC types.

    When loading models with metadata and this is true, XKTLoaderPlugin will not load objects that don't have IFC types.

    Default value is false.

    Parameters

    • arg: boolean

    Returns void

  • get globalizeObjectIds(): boolean
  • set globalizeObjectIds(arg: boolean): void
  • get includeTypes(): string[]
  • set includeTypes(arg: string[]): void
  • get reuseGeometries(): boolean
  • set reuseGeometries(arg: boolean): void
  • Gets whether XKTLoaderPlugin enables geometry reuse when loading models.

    Default value is true.

    Returns boolean

  • Sets whether XKTLoaderPlugin enables geometry reuse when loading models.

    Default value is true.

    Geometry reuse saves memory, but can impact Viewer performance when there are many reused geometries. For this reason, we can set this false to disable geometry reuse for models loaded by this XKTLoaderPlugin (which will then "expand" the geometry instances into batches instead).

    The result will be be less WebGL draw calls (which are expensive), at the cost of increased memory footprint.

    See .769 for more info.

    Parameters

    • arg: boolean

    Returns void

  • get supportedVersions(): string[]

Methods

  • 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

  • Loads an .xkt model into this XKTLoaderPlugin's Viewer.

    Since xeokit/xeokit-sdk 1.9.0, XKTLoaderPlugin has supported XKT 8, which bundles the metamodel data (eg. an IFC element hierarchy) in the XKT file itself. For XKT 8, we therefore no longer need to load the metamodel data from a separate accompanying JSON file, as we did with previous XKT versions. However, if we do choose to specify a separate metamodel JSON file to load (eg. for backward compatibility in data pipelines), then that metamodel will be loaded and the metamodel in the XKT 8 file will be ignored.

    Parameters

    Returns VBOSceneModel

    Entity representing the model, which will have Entity.isModel set true and will be registered by Entity.id in Scene.models.

  • 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: string, callback: () => void): void
  • Subscribes to an event fired at this Plugin.

    Parameters

    • event: string

      The event

    • callback: () => void

      Callback fired on the event

        • (): void
        • Returns void

    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

Generated using TypeDoc