Options
All
  • Public
  • Public/Protected
  • All
Menu

Class TreeNode

Hierarchy

  • TreeNode

Implements

Index

Constructors

  • Creation of a node that can be used in the node tree.

    Parameters

    • Optional name: string

      the name of the node

    • Optional parent: ITreeNode

      the parent of this node

    • Optional data: ITreeNodeData[]

      the array of data

    • Optional transformations: ITransformation[]

      the array of transformations

    Returns TreeNode

Accessors

  • get boneInverses(): mat4[]
  • set boneInverses(value: mat4[]): void
  • The inverse matrices for the bones, if specified.

    Returns mat4[]

  • The inverse matrices for the bones, if specified.

    Parameters

    • value: mat4[]

    Returns void

  • The optional bones that build a skeleton for animations.

    Returns ITreeNode[]

  • The optional bones that build a skeleton for animations.

    Parameters

    Returns void

  • get boundingBox(): IBox
  • get boundingBoxViewport(): {}
  • The bounding box of this tree node for each viewport. As there can be properties where tree nodes are excluded from the viewport, the bounding boxes may be different per viewport. The boundingBox property can be used as the general bounding box without any viewport specific exclusions.

    Returns {}

  • get convertedObject(): {}
  • set convertedObject(value: {}): void
  • The converted object of the tree node.

    Returns {}

    • [key: string]: unknown
  • The converted object of the tree node.

    Parameters

    • value: {}
      • [key: string]: unknown

    Returns void

  • The data of this tree node. The data can include Geometry, Materials, Lights, Cameras, but also informational or custom data.

    Can be added and remove via addData and removeData.

    Returns ITreeNodeData[]

  • get displayName(): undefined | string
  • set displayName(value: undefined | string): void
  • An optional name that can be used for display purposes. If not specified, the name property will be used.

    Returns undefined | string

  • An optional name that can be used for display purposes. If not specified, the name property will be used.

    Parameters

    • value: undefined | string

    Returns void

  • get excludeViewports(): string[]
  • set excludeViewports(value: string[]): void
  • get id(): string
  • The ID of the tree node.

    Returns string

  • get intersectionTest(): boolean
  • set intersectionTest(value: boolean): void
  • If for this node, global intersection tests should be performed. (default: true)

    Returns boolean

  • If for this node, global intersection tests should be performed. (default: true)

    Parameters

    • value: boolean

    Returns void

  • get name(): string
  • set name(value: string): void
  • The name of the tree node.

    Returns string

  • The name of the tree node.

    Parameters

    • value: string

    Returns void

  • get nodeMatrix(): mat4
  • get originalId(): string
  • set originalId(value: string): void
  • The original ID of the tree node, if it was copied.

    Returns string

  • The original ID of the tree node, if it was copied.

    Parameters

    • value: string

    Returns void

  • get originalName(): undefined | string
  • set originalName(value: undefined | string): void
  • The original name of the tree node, if one was supplied.

    Returns undefined | string

  • The original name of the tree node, if one was supplied.

    Parameters

    • value: undefined | string

    Returns void

  • get restrictViewports(): string[]
  • set restrictViewports(value: string[]): void
  • get skinNode(): boolean
  • set skinNode(value: boolean): void
  • Property to mark this node as a skin node. (default: false)

    Returns boolean

  • Property to mark this node as a skin node. (default: false)

    Parameters

    • value: boolean

    Returns void

  • get updateCallback(): null | ((newVersion: string, oldVersion: string) => void)
  • set updateCallback(value: null | ((newVersion: string, oldVersion: string) => void)): void
  • The update callback for the tree node. This callback is called when the node is updated, e.g. when the version changes.

    Returns null | ((newVersion: string, oldVersion: string) => void)

  • The update callback for the tree node. This callback is called when the node is updated, e.g. when the version changes.

    Parameters

    • value: null | ((newVersion: string, oldVersion: string) => void)

    Returns void

  • get updateCallbackConvertedObject(): null | ((newObj: unknown, oldObj: unknown, viewport: string) => void)
  • set updateCallbackConvertedObject(value: null | ((newObj: unknown, oldObj: unknown, viewport: string) => void)): void
  • The update callback for the converted object of the tree node.

    Returns null | ((newObj: unknown, oldObj: unknown, viewport: string) => void)

  • The update callback for the converted object of the tree node.

    Parameters

    • value: null | ((newObj: unknown, oldObj: unknown, viewport: string) => void)

    Returns void

  • get version(): string
  • set version(value: string): void
  • The version of the tree node. If the version changes, the node will be marked for an update. A version change can be triggered via updateVersion.

    Returns string

  • The version of the tree node. If the version changes, the node will be marked for an update. A version change can be triggered via updateVersion.

    Parameters

    • value: string

    Returns void

  • get visible(): boolean
  • set visible(value: boolean): void
  • Option to make this tree node visible. (default: true)

    Returns boolean

  • Option to make this tree node visible. (default: true)

    Parameters

    • value: boolean

    Returns void

  • get worldMatrix(): mat4
  • The world matrix of the tree node. This includes also the transformations of all parents.

    Returns mat4

Methods

  • Clones this node and all its children. The data objects like GeometryData, MaterialData, etc. are cloned as well. Depending on the size of the node and the amount of children, this can therefore be relatively slow.

    Returns ITreeNode

  • Clones this node and all its children. The data objects like GeometryData, MaterialData, etc. are not copied in this case.

    Returns ITreeNode

  • Test this node and all it's descendants for nodes with the specified name and return them in an array.

    Parameters

    • name: string

    Returns ITreeNode[]

  • getNodesByNameWithRegex(regex: RegExp): ITreeNode[]
  • Test this nodes name and all it's descendants name for nodes for the specified regex and return them in an array.

    Parameters

    • regex: RegExp

    Returns ITreeNode[]

  • getOriginalNamePath(): string
  • Return the path to this node with the original names. If no original name is set, the entry is left empty.

    Returns string

  • getPath(): string
  • Return the path to this node.

    Returns string

  • Check for existence of a child from the children of this node.

    Parameters

    Returns boolean

  • traverse(callback: ((node: ITreeNode) => void)): void
  • Traverse this node and all it's children and executes the callback for all of them

    Parameters

    Returns void

  • updateVersion(parents?: boolean, children?: boolean): void
  • Update the version.

    Parameters

    • Optional parents: boolean
    • Optional children: boolean

    Returns void