The INamespace graph node interface. More...
#include "murl_graph_i_namespace.h"
Public Member Functions | |
virtual INode * | GetNodeInterface ()=0 |
Get the mutable Graph::INode interface. More... | |
virtual const INode * | GetNodeInterface () const =0 |
Get the constant Graph::INode interface. More... | |
virtual Bool | RegisterNode (const String &name, INode *node)=0 |
Register a given node with this namespace. More... | |
virtual Bool | UnregisterNode (const String &name, INode *node)=0 |
Unregister a given node from this namespace. More... | |
virtual Bool | RegisterSubNamespace (const String &name, INamespace *nameSpace)=0 |
Register a given sub-namespace with this namespace. More... | |
virtual Bool | UnregisterSubNamespace (const String &name, INamespace *nameSpace)=0 |
Unregister a given sub-namespace from this namespace. More... | |
virtual INode * | FindNode (const String &nodeIdPath)=0 |
Find a mutable node within the namespace's sub-graph. More... | |
virtual const INode * | FindNode (const String &nodeIdPath) const =0 |
Find a constant node within the namespace's sub-graph. More... | |
Detailed Description
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.
Member Function Documentation
◆ GetNodeInterface() [1/2]
|
pure virtual |
Get the mutable Graph::INode interface.
This method returns a mutable pointer to the node's Graph::INode interface, to be able to query or modify common node properties such as active state, visibility or ID.
- Returns
- The mutable Graph::INode interface, or null if not available
Referenced by Murl::Logic::GraphObservableNode< NodeType >::FindNode().
◆ GetNodeInterface() [2/2]
|
pure virtual |
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.
- Returns
- The constant Graph::INode interface, or null if not available
◆ RegisterNode()
|
pure virtual |
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.
- Parameters
-
name The ID of the node to register. node The node to register.
- Returns
- true if successful.
◆ UnregisterNode()
|
pure virtual |
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.
- Parameters
-
name The ID of the node to unregister. node The node to unregister.
- Returns
- true if successful.
◆ RegisterSubNamespace()
|
pure virtual |
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.
- Parameters
-
name The ID of the sub-namespace to register. nameSpace The sub-namespace to register.
- Returns
- true if successful.
◆ UnregisterSubNamespace()
|
pure virtual |
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.
- Parameters
-
name The ID of the sub-namespace to unregister. nameSpace The sub-namespace to unregister.
- Returns
- true if successful.
◆ FindNode() [1/2]
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.
- Parameters
-
nodeIdPath The node ID to find, with optional path specification when searching in sub-namespaces.
- Returns
- A pointer to the requested node, or null if not found.
Referenced by Murl::Logic::GraphObservableNode< NodeType >::FindNode().
◆ FindNode() [2/2]
|
pure virtual |
Find a constant 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.
- Parameters
-
nodeIdPath The node ID to find, with optional path specification when searching in sub-namespaces.
- Returns
- A pointer to the requested node, or null if not found.
The documentation for this interface was generated from the following file:
- murl_graph_i_namespace.h