CollectionAPI¶
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)
- CollectionAPI
Methods
add To Collection
Parameters
- collectionID: number
Specifies to which collection the node should be added
- nodeID: number
Specifies which node should be added to the collection
Optionalrecursive: booleanSpecifies if the children of the node should also be added to the collection
Returns void
- collectionID: number
create 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.
get Collection
Parameters
- collectionID: number
Specifies which collection should be returned
Returns ICollection
The collection with the given id
- collectionID: number
get Collection Elements
ReadonlyParameters
- collectionID: number
The id of the node collection
Returns Promise<number[]>
Array of node IDs representing the node collection
- collectionID: number
get Collection Node Count
remove Collection
remove From Collection
Parameters
- collectionID: number
Specifies from which collection the node should be removed
- nodeID: number
Specifies which node should be removed from the collection
Optionalrecursive: booleanSpecifies whether the children of the node should be removed from the collection too
Returns void
- collectionID: number
search By Volume
- searchByVolume(
selectionBox: BoxVolume,
includeOverlappingNodes: boolean,
rootNodeID?: number,
): Promise<number>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: numberRestricts 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.
Deprecated
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.
- selectionBox: BoxVolume
Deprecated
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.