Options
All
  • Public
  • Public/Protected
  • All
Menu

A Viewer plugin that provides an HTML tree view to navigate the IFC elements in models.

Hierarchy

Index

Constructors

Properties

id: string

ID for this Plugin, unique within its Viewer.

viewer: Viewer

The Viewer that contains this Plugin.

Accessors

  • get hierarchy(): "storeys" | "containment" | "types"
  • set hierarchy(arg: "storeys" | "containment" | "types"): void
  • get modelTreeViews(): any

Methods

  • addModel(modelId: string, options?: { rootName?: string }): ModelTreeView
  • Adds a model to this tree view.

    The model will be automatically removed when destroyed.

    To automatically add each model as it's created, instead of manually calling this method each time, provide a autoAddModels: true to the TreeViewPlugin constructor.

    Parameters

    • modelId: string

      ID of a model Entity in Scene.models.

    • Optional options: { rootName?: string }
      • Optional rootName?: string

    Returns ModelTreeView

    ModelTreeView for the newly-added model. If this method succeeded in adding the model, then {@link ModelTreeView.valid} will equal true. Otherwise, that property will be false and {@link ModelTreeView.errors} will contain error messages.

  • collapse(): void
  • 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

  • expandToDepth(depth: number): 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

  • 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: "contextmenu", callback: (data: { event: MouseEvent; treeViewNode: TreeViewNode; treeViewPlugin: TreeViewPlugin; viewer: Viewer }) => void): void
  • on(event: "nodeTitleClicked", callback: (data: { event: MouseEvent; treeViewNode: TreeViewNode; treeViewPlugin: TreeViewPlugin; viewer: Viewer }) => void): void
  • Fires on right click to show contextmenu.

    Parameters

    • event: "contextmenu"

      The contextmenu event

    • callback: (data: { event: MouseEvent; treeViewNode: TreeViewNode; treeViewPlugin: TreeViewPlugin; viewer: Viewer }) => void

      Callback fired on the event

        • (data: { event: MouseEvent; treeViewNode: TreeViewNode; treeViewPlugin: TreeViewPlugin; viewer: Viewer }): void
        • Parameters

          Returns void

    Returns void

  • Fires when an title is clicked.

    Parameters

    • event: "nodeTitleClicked"

      The nodeTitleClicked event

    • callback: (data: { event: MouseEvent; treeViewNode: TreeViewNode; treeViewPlugin: TreeViewPlugin; viewer: Viewer }) => void

      Callback fired on the event

        • (data: { event: MouseEvent; treeViewNode: TreeViewNode; treeViewPlugin: TreeViewPlugin; viewer: Viewer }): void
        • Parameters

          Returns void

    Returns void

  • removeModel(modelId: string): void
  • showNode(objectId: string): void
  • Highlights the tree view node that represents the given object Entity.

    This causes the tree view to collapse, then expand to reveal the node, then highlight the node.

    If a node is previously highlighted, de-highlights that node and collapses the tree first.

    Note that if the TreeViewPlugin was configured with pruneEmptyNodes: true (default configuration), then the node won't exist in the tree if it has no Entitys in the Scene. in that case, nothing will happen.

    Within the DOM, the node is represented by an <li> element. This method will add a .highlighted-node class to the element to make it appear highlighted, removing that class when de-highlighting it again. See the CSS rules in the TreeViewPlugin examples for an example of that class.

    Parameters

    • objectId: string

      ID of the Entity.

    Returns void

  • unShowNode(): 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

  • withNodeTree(node: TreeViewNode, callback: (node: TreeViewNode) => void): void
  • Iterates over a subtree of the tree view's {@link TreeViewNode}s, calling the given callback for each node in depth-first pre-order.

    Parameters

    • node: TreeViewNode

      Root of the subtree.

    • callback: (node: TreeViewNode) => void

      Callback called at each {@link TreeViewNode}, with the TreeViewNode given as the argument.

        • (node: TreeViewNode): void
        • Parameters

          • node: TreeViewNode

          Returns void

    Returns void

Generated using TypeDoc