meteoJS/modelviewer/resourcesTreeNode . ResourcesTreeNode
Source: modelviewer/
Internal class to manage the available resources inside the
Node class. Each
ResourcesTreeNode object is linked to a Node object. It is a many to one
relation. The hierarchy of the ResourcesTree is analogue to the Node
hierarchy. But the tree is build via the
Variable objects.
So, this class is not only linked to a Node object, but subsequently for a
VariableCollection object.
If a Resource for a
certain Variable object from this VariableCollection is added, then a
child ResourcesTreeNode object is inserted in the tree (if it doesn't exists)
for the Variable object.
Properties
new ResourcesTreeNode([options])
Parameter
| Name | Type | Optional | Description |
|---|---|---|---|
|
options |
|
Yes |
Options. |
Properties
node module:meteoJS/modelviewer/node.Node
Linked Node object.
parent (undefined or module:meteoJS/modelviewer/resourcesTreeNode.ResourcesTreeNode)
The parent object of this ResourcesTree-Node.
variableCollection module:meteoJS/modelviewer/variableCollection.VariableCollection
Linked VariableCollection object.
Methods
buildChildrenTreeForResource(options) → (undefined or module:meteoJS/modelviewer/resourcesTreeNode.ResourcesTreeNode)
Build tree
Parameters
| Name | Type | Optional | Description | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
options |
Object |
|
Options. Values in
|
- Returns
-
(undefined or module:meteoJS/modelviewer/resourcesTreeNode.ResourcesTreeNode)
findNodeByVariables(...variables) → (undefined or module:meteoJS/modelviewer/resourcesTreeNode.ResourcesTreeNode)
Returns the bottom most ResourcesTreeNode object. On the way from the top ResourcesTreeNode to this object, for every passed Variable object a suitable ResourcesTreeNode is passed.
Parameter
| Name | Type | Optional | Description |
|---|---|---|---|
|
variables |
|
variables A set of Variable objects. Value can be repeated. |
- Returns
-
(undefined or module:meteoJS/modelviewer/resourcesTreeNode.ResourcesTreeNode)Bottom most object.
getChildByVariable(variable) → module:meteoJS/modelviewer/resourcesTreeNode.ResourcesTreeNode
Returns the child corresponding to the passed variable.
Parameter
| Name | Type | Optional | Description |
|---|---|---|---|
|
variable |
|
Variable. |
- Returns
-
module:meteoJS/modelviewer/resourcesTreeNode.ResourcesTreeNodeChild ResourcesTreeNode object for the passed variable.
removeChild()
Removes a child in the Resources-Tree. If this was the only child of this Resources-Tree-Node, then remove this Tree-Node from the parent.