The IGenericNodeTarget graph node target interface. More...
#include "murl_graph_i_generic_node_target.h"
Public Member Functions | |
virtual Bool | Init (IInitTracker *tracker)=0 |
Initialize the node target. More... | |
virtual Bool | DeInit (IDeInitTracker *tracker)=0 |
De-Initialize the node target. More... | |
virtual Bool | IsInitialized () const =0 |
Check if the node target is initialized. More... | |
virtual Bool | IsModified () const =0 |
Check if the node target is modified. More... | |
virtual Bool | SetInitialized (Bool initialized)=0 |
Manually set or reset the initialized state of the target. More... | |
virtual Bool | SetModified (Bool modified)=0 |
Manually set or reset the modified state of the target. More... | |
virtual UInt32 | GetMinNumberOfNodes () const =0 |
Query the minimum number of nodes. More... | |
virtual UInt32 | GetMaxNumberOfNodes () const =0 |
Query the maximum number of nodes. More... | |
virtual Bool | SetNumberOfNodes (UInt32 numberOfNodes)=0 |
Set the total number of nodes. More... | |
virtual UInt32 | GetNumberOfNodes () const =0 |
Get the total number of nodes. More... | |
virtual Bool | SetNodeId (const String &nodeId, UInt32 index)=0 |
Set a single node ID at a given index. More... | |
virtual const String & | GetNodeId (UInt32 index) const =0 |
Get the node ID at a given index. More... | |
virtual Bool | SetNode (ObjectType *object, UInt32 index)=0 |
Set (replace) a single node for referencing at a given position. More... | |
virtual ObjectType * | GetNode (UInt32 index) const =0 |
Get the node at a given index. More... | |
Detailed Description
template<class ObjectType>
interface Murl::Graph::IGenericNodeTarget< ObjectType >
The IGenericNodeTarget graph node target interface.
A generic node target is used to encapsulate (possibly) any number of nodes in a scene graph, referenced by their unique ID or directly by pointer. It provides access methods to add, remove or query the set of nodes that are referenced. By using an IGenericNodeTarget, a graph node's process of handling references to other nodes can be unified, the respective node references may be acquired by either specifying a node ID in an XML scene graph file, or directly set from code when a new node is created from a Logic::IProcessor.
Member Function Documentation
◆ Init()
|
pure virtual |
Initialize the node target.
To be able to reference nodes via their unique IDs in a scene graph, a Graph::IInitTracker must be passed to the node target, which holds a reference to the scene graph's root.
- Parameters
-
tracker The tracker used for node initialization.
- Returns
- true if successful.
◆ DeInit()
|
pure virtual |
De-Initialize the node target.
- Parameters
-
tracker The tracker used for node de-initialization.
- Returns
- true if successful.
◆ IsInitialized()
|
pure virtual |
Check if the node target is initialized.
- Returns
- true if initialized.
◆ IsModified()
|
pure virtual |
Check if the node target is modified.
This method returns true, whenever the set of encapsulated node references changes, either in size or by content. When modified, that state persists until a manual call to SetModified() with parameter false.
- Returns
- true if modified.
◆ SetInitialized()
|
pure virtual |
Manually set or reset the initialized state of the target.
- Parameters
-
initialized The initialized state.
- Returns
- true if successful.
◆ SetModified()
|
pure virtual |
Manually set or reset the modified state of the target.
- Parameters
-
modified The modified state.
- Returns
- true if successful.
◆ GetMinNumberOfNodes()
|
pure virtual |
Query the minimum number of nodes.
This method returns the defined minimum number of node references that must be present for the Init() call to be successful.
- Returns
- The required minimum number of nodes for the target to be valid.
◆ GetMaxNumberOfNodes()
|
pure virtual |
Query the maximum number of nodes.
This method returns the defined maximum number of node references that can be present for the Init() call to be successful.
- Returns
- The required maximum number of nodes for the target to be valid.
◆ SetNumberOfNodes()
|
pure virtual |
Set the total number of nodes.
The given value must be in the range from GetMinNumberOfNodes() to GetMaxNumberOfNodes().
- Parameters
-
numberOfNodes The total number of nodes in the target.
- Returns
- true if successful.
◆ GetNumberOfNodes()
|
pure virtual |
Get the total number of nodes.
- Returns
- The total number of nodes in the target.
◆ SetNodeId()
|
pure virtual |
Set a single node ID at a given index.
You need to make sure that the given index is in the range from 0 to GetNumberOfNodes()-1, use SetNumberOfNodes() to define the actual node count.
- Parameters
-
nodeId A string containing the full path and ID to a node in the scene graph. index The index of the node ID to set, in the range from 0 to GetNumberOfNodes()-1.
- Returns
- true if successful.
◆ GetNodeId()
|
pure virtual |
Get the node ID at a given index.
- Parameters
-
index The node ID index in the range from 0 to GetNumberOfNodes()-1.
- Returns
- The node ID at the given index.
◆ SetNode()
|
pure virtual |
Set (replace) a single node for referencing at a given position.
You need to make sure that the given index is in the range from 0 to GetNumberOfNodes()-1, use SetNumberOfNodes() to define the actual node count.
- Parameters
-
object A pointer to the node. index The zero-based position where to set the node, in the range from 0 to GetNumberOfNodes()-1.
- Returns
- true if successful.
◆ GetNode()
|
pure virtual |
Get the node at a given index.
- Parameters
-
index The node index in the range from 0 to GetNumberOfNodes()
- Returns
- The node at the given index.
The documentation for this interface was generated from the following file:
- murl_graph_i_generic_node_target.h