Skip to main content
Version: 3.x

Interface: NodesApiClient

@cognite/reveal/extensions/datasource.NodesApiClient

Client for retrieving metadata information about CAD nodes.

Methods

determineNodeAncestorsByNodeId

determineNodeAncestorsByNodeId(modelId, revisionId, nodeId, generation): Promise<{ subtreeSize: number ; treeIndex: number }>

Determine ancestor subtree span of a given node. If the node doesn't have an ancestor at the generation given, the span of the root node is returned.

Parameters

NameTypeDescription
modelIdnumberID of 3D model
revisionIdnumberID of 3D model revision
nodeIdnumberNode ID of node
generationnumberGeneration to retrieve (0 means node itself, 1 is parent, 2 grand-parent etc).

Returns

Promise<{ subtreeSize: number ; treeIndex: number }>

Defined in

packages/nodes-api/src/NodesApiClient.ts:51


determineTreeIndexAndSubtreeSizesByNodeIds

determineTreeIndexAndSubtreeSizesByNodeIds(modelId, revisionId, nodeIds): Promise<{ subtreeSize: number ; treeIndex: number }[]>

Determines tree index and subtreeSize (i.e. span of the subtree a node is parent of) given a set of node IDs.

Parameters

NameType
modelIdnumber
revisionIdnumber
nodeIdsnumber[]

Returns

Promise<{ subtreeSize: number ; treeIndex: number }[]>

Defined in

packages/nodes-api/src/NodesApiClient.ts:37


getBoundingBoxesByNodeIds

getBoundingBoxesByNodeIds(modelId, revisionId, nodeIds): Promise<Box3[]>

Determines the bounds of the individual nodes provided. Note that the returned boxes will be in "CDF coordinates" and not transformed using the model transformation for the given model.

Parameters

NameTypeDescription
modelIdnumberID of 3D model
revisionIdnumberID of 3D model revision
nodeIdsnumber[]Node IDs of nodes

Returns

Promise<Box3[]>

Defined in

packages/nodes-api/src/NodesApiClient.ts:67


mapNodeIdsToTreeIndices

mapNodeIdsToTreeIndices(modelId, revisionId, nodeIds): Promise<number[]>

Maps a set of "node IDs" that identify nodes, to the respective "tree indexes".

Parameters

NameType
modelIdnumber
revisionIdnumber
nodeIdsnumber[]

Returns

Promise<number[]>

Defined in

packages/nodes-api/src/NodesApiClient.ts:27


mapTreeIndicesToNodeIds

mapTreeIndicesToNodeIds(modelId, revisionId, treeIndices): Promise<number[]>

Maps a set of "tree indexes" that identify nodes, to the respective "node IDs".

Parameters

NameType
modelIdnumber
revisionIdnumber
treeIndicesnumber[]

Returns

Promise<number[]>

Defined in

packages/nodes-api/src/NodesApiClient.ts:17