Viewer
    Preparing search index...

    Interface ITreeNode

    interface ITreeNode {
        boundingBox: IBox;
        boundingBoxViewport: { [key: string]: IBox };
        children: ITreeNode[];
        convertedObject: { [key: string]: unknown };
        data: ITreeNodeData[];
        excludeViewports: string[];
        id: string;
        intersectionTest: boolean;
        name: string;
        nodeMatrix: mat4;
        originalId: string;
        restrictViewports: string[];
        transformations: ITransformation[];
        updateCallback: ((newVersion: string, oldVersion: string) => void) | null;
        updateCallbackConvertedObject:
            | ((newObj: unknown, oldObj: unknown, viewport: string) => void)
            | null;
        version: string;
        visible: boolean;
        worldMatrix: mat4;
        addChild(child: ITreeNode | ITreeNode[]): boolean;
        addData(data: ITreeNodeData | ITreeNodeData[]): boolean;
        addTransformation(transformation: ITransformation): boolean;
        clone(): ITreeNode;
        cloneInstance(): ITreeNode;
        getChild(id: string): ITreeNode | undefined;
        getData(id: string): ITreeNodeData | undefined;
        getNodesByName(name: string): ITreeNode[];
        getNodesByNameWithRegex(regex: RegExp): ITreeNode[];
        getOriginalNamePath(): string;
        getPath(): string;
        getTransformation(id: string): ITransformation | undefined;
        hasChild(child: ITreeNode): boolean;
        hasData(data: ITreeNodeData): boolean;
        hasTransformation(transformation: ITransformation): boolean;
        removeChild(child: ITreeNode | ITreeNode[]): boolean;
        removeData(data: ITreeNodeData | ITreeNodeData[]): boolean;
        removeTransformation(transformation: ITransformation): boolean;
        traverse(callback: (node: ITreeNode) => void): void;
        traverseData(callback: (data: ITreeNodeData) => void): void;
        updateVersion(parents?: boolean, children?: boolean): void;
        displayName?: string;
        originalName?: string;
        parent?: ITreeNode;
    }

    Implemented by

    Index

    Properties

    boundingBox: IBox

    The bounding box of this tree node.

    boundingBoxViewport: { [key: string]: IBox }

    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.

    children: ITreeNode[]

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

    convertedObject: { [key: string]: unknown }

    The converted object of the tree node.

    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.

    transformations: ITransformation[]

    The transformation to be applied to this tree node.

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

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

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

    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 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 ITreeNode | undefined

    • Returns the data item with the specified id

      Parameters

      • id: string

      Returns ITreeNodeData | undefined

    • 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[]

    • 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[]

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

      Returns string

    • Return the path to this node.

      Returns string

    • Returns the transformation with the specified id

      Parameters

      • id: string

      Returns ITransformation | undefined

    • 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 transformation from this node.

      Parameters

      Returns boolean

    • 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

    • Update the version.

      Parameters

      • Optionalparents: boolean

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

      • Optionalchildren: boolean

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

      Returns void