CollectionAPI

Interface CollectionAPI

The CollectionAPI is deprecated. Please use nodeId[] instead.

Collections store groups of nodes. They can be created empty or from a list of nodes. There is also the way to create a collection by searching nodes matching a given property.

interface CollectionAPI {
    addToCollection(
        collectionID: number,
        nodeID: number,
        recursive?: boolean,
    ): void;
    createCollection(nodeIDlist?: number[]): number;
    createCollection(): number;
    getCollection(collectionID: number): ICollection;
    getCollectionElements(collectionID: number): Promise<number[]>;
    getCollectionNodeCount(collectionID: number): Promise<number>;
    removeCollection(collectionID: number): void;
    removeFromCollection(
        collectionID: number,
        nodeID: number,
        recursive?: boolean,
    ): void;
    searchByVolume(
        selectionBox: BoxVolume,
        includeOverlappingNodes: boolean,
        rootNodeID?: number,
    ): Promise<number>;
}

Hierarchy (View Summary)

Methods

  • Parameters

    • collectionID: number

      Specifies to which collection the node should be added

    • nodeID: number

      Specifies which node should be added to the collection

    • Optionalrecursive: boolean

      Specifies if the children of the node should also be added to the collection

    Returns void

    addToCollection is deprecated and will be removed in future versions.

    Adds the node given by nodeID to the collection with id collectionID. If recursive is true, the descendants of the node are also added. Returns the number of nodes in the collection.

  • Parameters

    • OptionalnodeIDlist: number[]

      An array of node id's from which a new node collection should be created.

    Returns number

    The id of the newly created node collection.

    createCollection is deprecated and will be removed in future versions. Please use a simple array of node IDs instead.

    Returns the id of a new collection containing the nodes from the given list.

  • Returns number

    The id of the newly created collection.

    createCollection is deprecated and will be removed in future versions. Please use a simple array of node IDs instead.

    Creates a new, empty collection and returns its id.

  • Parameters

    • collectionID: number

      Specifies which collection should be returned

    Returns ICollection

    The collection with the given id

    getCollection is deprecated and will be removed in future versions.

    Returns the collection with the given id.

  • Readonly

    Parameters

    • collectionID: number

      The id of the node collection

    Returns Promise<number[]>

    Array of node IDs representing the node collection

    getCollectionElements is deprecated and will be removed in future versions.

    Returns an array containing the ids of the nodes in the collection. Modifying the returned array results in undefined behavior.

  • Parameters

    • collectionID: number

      The id of the collection

    Returns Promise<number>

    Number of elements in a collection.

    getCollectionNodeCount is deprecated and will be removed in future versions.

    Returns the number of elements inside a collection.

  • Parameters

    • collectionID: number

      Specifies which collection should be removed

    Returns void

    removeCollection is deprecated and will be removed in future versions.

    Removes the collection with the given id.

  • Parameters

    • collectionID: number

      Specifies from which collection the node should be removed

    • nodeID: number

      Specifies which node should be removed from the collection

    • Optionalrecursive: boolean

      Specifies whether the children of the node should be removed from the collection too

    Returns void

    removeFromCollection is deprecated and will be removed in future versions.

    Removes a node given by nodeID from the collection with id collectionID. If recursive is true, the descendants of the node are also removed.

  • Parameters

    • selectionBox: BoxVolume

      3-dimensional search volume.

    • includeOverlappingNodes: boolean

      Specifies whether the search result contains only those nodes which lie entirely in the search volume or if overlapping nodes are also included.

    • OptionalrootNodeID: number

      Restricts the search to a subtree of a node with the given id.

    Returns Promise<number>

    A the id of the created collection of nodes that are fitting the given search criteria.

    searchByVolume is deprecated and will be removed in future versions. Please use InstanceGraphAPI.requestNodeIdsByBoxVolume instead.

    Finds nodes within the given BoxVolume (created using the createBoxVolume() function). If includeOverlappingNodes is false, only nodes fully contained by the box volume are returned. The rootNodeID specifies the node from which the subtree is searched.