![]() |
Murl Engine Lua Addon API
Version 1.0 beta
|
The INamespace graph node interface.
When interacting with a scene graph, it is useful and often necessary to retrieve a reference to a specific node from within a large graph via a given node ID.
Generally, such node IDs must be unique; to facilitate organization of node hierarchies it is possible to restrict this uniqueness to the sub-graph below a given INamespace node. In such a case, a specific node can be found in the graph by prepending the namespace's ID followed by a slash ('/') to the actual node ID. This scheme also works for nested namespaces, by simply concatenating such namespace prefixes.
When referring to a specific node from a given other node, the path to the target node can be expressed very much like the notation commonly used in a UNIX-like file path, with '.' representing the current namespace, '..' the parent, and a leading '/' the root namespace.
Example, assuming the graph is instantiated at root level:
Note, when targeting a node from a Logic::IProcessor, it is always assumed to start the search from the root level, i.e. namespaces must always be specified.
A namespace node can also be referenced from another node; the given ID represents both a separator for its children as well as a regular ID.
See Graph::INode::SetId() for a description of valid IDs.
Get the constant Graph::INode interface. This method returns a constant pointer to the node's Graph::INode interface, to be able to query common node properties such as active state, visibility or ID.
Murl.Graph.INode GetNodeInterface()
Register a given node with this namespace. This method registers a given node with the current namespace, using a given (single) node ID. Registering will only succeed if the given ID is valid and not empty, no other node or namespace is already registered with the same ID, and the ID does not represent a complex path.
Boolean RegisterNode(String name, Murl.Graph.INode node)
name | The ID of the node to register. |
node | The node to register. |
Unregister a given node from this namespace. This method unregisters a previously registered node from the current namespace, using a given (single) node ID. Unregistering will fail if no node is currently registered with the given ID, or the registered node does not match the given input node.
Boolean UnregisterNode(String name, Murl.Graph.INode node)
name | The ID of the node to unregister. |
node | The node to unregister. |
Register a given sub-namespace with this namespace. This method registers a given other namespace with the current namespace, using a given (single) node ID. Registering will only succeed if the given ID is valid and not empty, no other node or namespace is already registered with the same ID, and the ID does not represent a complex path.
Boolean RegisterSubNamespace(String name, Murl.Graph.INamespace nameSpace)
name | The ID of the sub-namespace to register. |
nameSpace | The sub-namespace to register. |
Unregister a given sub-namespace from this namespace. This method unregisters a previously registered other namespace from the current namespace, using a given (single) node ID. Unregistering will fail if no namespace is currently registered with the given ID, or the registered sub-namespace does not match the given input namespace.
Boolean UnregisterSubNamespace(String name, Murl.Graph.INamespace nameSpace)
name | The ID of the sub-namespace to unregister. |
nameSpace | The sub-namespace to unregister. |
Find a mutable node within the namespace's sub-graph. This method tries to find and return the node at the given path within the sub-graph below this namespace.
Murl.Graph.INode FindNode(String nodeIdPath)
nodeIdPath | The node ID to find, with optional path specification when searching in sub-namespaces. |