Autodesk.Viewing.Private
InstanceTree
new InstanceTree(nodeAccess, objectCount, maxDepth)
Parameters
nodeAccess* | |
objectCount* | |
maxDepth* |
* Required
Methods
isNodeVisibleLocked(dbId)
Whether a node id’s visiblitly is locked.
Parameters
dbId* number | The node’s database id |
* Required
Returns
type | description |
---|---|
boolean |
isNodeExplodeLocked(dbId)
Whether a node id’s explode is locked.
Parameters
dbId* number | The node’s database id |
* Required
Returns
type | description |
---|---|
boolean |
getNodeType(dbId)
Gets the type associated with the node, such as assmebly, layer, model, geometry, etc.
Parameters
dbId* number | The node’s database id |
* Required
Returns
type | description |
---|---|
number | one of NODE_TYPE |
isNodeSelectable(dbId)
Whether the node is a selectable entity.
Parameters
dbId* number | The node’s database id |
* Required
Returns
type | description |
---|---|
boolean |
getNodeParentId(dbId)
Gets the database id of the node’s parent.
Parameters
dbId* number | The node’s database id |
* Required
Returns
type | description |
---|---|
number |
getRootId()
Gets the model’s root database id.
Returns
type | description |
---|---|
number |
getNodeName(dbId, includeCount)
Gets the name associated to the id.
Parameters
dbId* number | The node’s database id |
includeCount* boolean | True if must include count |
* Required
Returns
type | description |
---|---|
string |
getChildCount(dbId)
Gets get number of children under the specified id.
Parameters
dbId* number | The node’s database id |
* Required
Returns
type | description |
---|---|
number |
getNodeBox(dbId, dst)
Sets the bounding box values for a particular id on the 2nd argument provided. There is no return value.
Parameters
dbId* number | The node’s database id |
dst* Float32Array | An array holding 6 number values: (min-x, min-y, min-z, max-x, max-y, max-z) |
* Required
enumNodeFragments(node, callback, recursive)
Parameters
node* number | The id of a node. |
callback* Autodesk.Viewing.Private.InstanceTree~onEnumNodeFragments | The function that will be called for each fragment. Note that if the callback function returns a truthy value, a loop over the fragments and child nodes will be interrupted and the callback result will be forwarded back to the caller. |
recursive boolean | Whether the callback function gets called for child nodes, too. |
* Required
enumNodeChildren(node, callback, recursive)
Parameters
node* number | The id of a node. |
callback* Autodesk.Viewing.Private.InstanceTree~onEnumNodeChildren | The function that will be called for each child node. Note that if the callback function returns a truthy value, a loop over the child nodes will be interrupted and the callback result will be forwarded back to the caller. |
recursive boolean | Whether the callback function gets called for indirect child nodes, too. |
* Required
search(text)
Search the tree for nodes whose names match the given string.
Parameters
text* string | The search term (not case sensitive). |
* Required
Returns
type | description |
---|---|
Array.<number> |
|