Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface ITreeNode

Hierarchy

  • ITreeNode

Implemented by

Index

Properties

boneInverses: mat4[]

The inverse matrices for the bones, if specified.

bones: ITreeNode[]

The optional bones that build a skeleton for animations.

boundingBox: IBox

The bounding box of this tree node.

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.

Type declaration

children: ITreeNode[]

The children of this tree node. Can be added and remove via addChild and removeChild.

convertedObject: {}

The converted object of the tree node.

Type declaration

  • [key: string]: unknown

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.

excludeViewports: string[]

The viewports to exclude this tree node from.

id: string

The ID of the tree node.

intersectionTest: boolean

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

name: string

The name of the tree node.

nodeMatrix: mat4

The matrix of the tree node. This is computed via all transformations in the transformations property.

originalId: string

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

restrictViewports: string[]

The viewports to restrict this tree node to.

skinNode: boolean

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

transformations: ITransformation[]

The transformation to be applied to this tree node.

updateCallback: 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.

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

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

version: 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.

visible: boolean

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

worldMatrix: mat4

The world matrix of the tree node. This includes also the transformations of all parents.

displayName?: string

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

originalName?: string

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

parent?: ITreeNode

The parent of the tree node. This property is automatically managed by addChild and removeChild.

Methods

  • Add a child to the children of this node.

    Parameters

    Returns boolean

  • Add a data item to node.

    Parameters

    Returns boolean

  • Add a transformation to this node.

    Parameters

    Returns boolean

  • 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

  • Returns the child with the specified id

    Parameters

    • id: string

    Returns undefined | ITreeNode

  • Returns the data item with the specified id

    Parameters

    • id: string

    Returns undefined | ITreeNodeData

  • 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

  • Returns the transformation with the specified id

    Parameters

    • id: string

    Returns undefined | ITransformation

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

    Parameters

    Returns boolean

  • Check for existence of a data item of this node.

    Parameters

    Returns boolean

  • Check for existence of a transformation of this node.

    Parameters

    Returns boolean

  • Remove a child from the children of this node.

    Parameters

    Returns boolean

  • Remove a data item from this node.

    Parameters

    Returns boolean

  • Remove a transformation from 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

  • Traverse this node and all it's children and executes the callback for all data items of them

    Parameters

    Returns void

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

    Parameters

    • Optional parents: boolean

      if true, the version of all parents will be updated as well (default: true)

    • Optional children: boolean

      if true, the version of all children will be updated as well (default: true)

    Returns void