meteoJS/modelviewer/node . Node
Source: modelviewer/
A node has always a correspondent VariableCollection. With the node objects
a hierarchy of the collections is build up. This hierarchy is mainly used
to achieve a good user experience. This way, the menus in the
modelviewer-container
could be setup to present the user only available fields or levels or only
activate buttons which are available for a certain model and run.
Additionally a node contains a list of resources, this is used internally
in module:meteoJS/modelviewer/resources.Resources
.
Properties
new Node(variableCollection)
Parameter
Name | Type | Optional | Description |
---|---|---|---|
variableCollection |
|
|
This node belongs to this collection. |
Properties
children Array of module:meteoJS/modelviewer/node.Node
Child nodes.
parents Array of module:meteoJS/modelviewer/node.Node
Parent nodes.
resources Array of module:meteoJS/modelviewer/resource.Resource
All contained resources.
variableCollection module:meteoJS/modelviewer/variableCollection.VariableCollection
VariableCollection correspondent to this node.
Methods
_addParent(node)
Adds a parent node.
Parameter
Name | Type | Optional | Description |
---|---|---|---|
node |
|
Node to add. |
append(...resources) → integer
Append resources.
Parameter
Name | Type | Optional | Description |
---|---|---|---|
resources |
|
Resources. Value can be repeated. |
- Returns
-
integer
Count of really added resources.
appendChild(...nodes) → module:meteoJS/modelviewer/node.Node
Appends a node as a child.
Parameter
Name | Type | Optional | Description |
---|---|---|---|
nodes |
|
Node to append. Value can be repeated. |
- Fires
- module:meteoJS/modelviewer/node#append:child
- Returns
getResourcesByVariables([exactlyMatch], ...variables) → Array of module:meteoJS/modelviewer/resource.Resource
Returns all or a part of the resources contained in this node. The returned resources are defined by all of the passed variables.
Parameters
Name | Type | Optional | Description |
---|---|---|---|
exactlyMatch |
boolean |
Yes |
Only return resources, which are defined exactly by the passed variables. Defaults to |
variables |
|
Variables. Value can be repeated. |
- Returns
-
Array of module:meteoJS/modelviewer/resource.Resource
Resources.
hasResourcesByVariables([exactlyMatch], ...variables) → boolean
Returns if there exists resources which are defined by all of the passed variables.
Parameters
Name | Type | Optional | Description |
---|---|---|---|
exactlyMatch |
boolean |
Yes |
Only returns true, if there exists at least one resource, which is defined exactly by the passed variables. Defaults to |
variables |
|
Variables. Value can be repeated. |
- Returns
-
boolean
Exists at least one resource.
remove(...resources) → integer
Removes resources.
Parameter
Name | Type | Optional | Description |
---|---|---|---|
resources |
|
Resources. Value can be repeated. |
- Returns
-
integer
Count of really removed resources.