Murl::Graph::IGenericNodeTarget< ObjectType > Interface Template Referenceabstract

The IGenericNodeTarget graph node target interface. More...

#include "murl_graph_i_generic_node_target.h"

Inheritance diagram for Murl::Graph::IGenericNodeTarget< ObjectType >:

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 StringGetNodeId (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()

template<class ObjectType >
virtual Bool Murl::Graph::IGenericNodeTarget< ObjectType >::Init ( IInitTracker tracker)
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
trackerThe tracker used for node initialization.
Returns
true if successful.

◆ DeInit()

template<class ObjectType >
virtual Bool Murl::Graph::IGenericNodeTarget< ObjectType >::DeInit ( IDeInitTracker tracker)
pure virtual

De-Initialize the node target.

Parameters
trackerThe tracker used for node de-initialization.
Returns
true if successful.

◆ IsInitialized()

template<class ObjectType >
virtual Bool Murl::Graph::IGenericNodeTarget< ObjectType >::IsInitialized ( ) const
pure virtual

Check if the node target is initialized.

Returns
true if initialized.

◆ IsModified()

template<class ObjectType >
virtual Bool Murl::Graph::IGenericNodeTarget< ObjectType >::IsModified ( ) const
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()

template<class ObjectType >
virtual Bool Murl::Graph::IGenericNodeTarget< ObjectType >::SetInitialized ( Bool  initialized)
pure virtual

Manually set or reset the initialized state of the target.

Parameters
initializedThe initialized state.
Returns
true if successful.

◆ SetModified()

template<class ObjectType >
virtual Bool Murl::Graph::IGenericNodeTarget< ObjectType >::SetModified ( Bool  modified)
pure virtual

Manually set or reset the modified state of the target.

Parameters
modifiedThe modified state.
Returns
true if successful.

◆ GetMinNumberOfNodes()

template<class ObjectType >
virtual UInt32 Murl::Graph::IGenericNodeTarget< ObjectType >::GetMinNumberOfNodes ( ) const
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()

template<class ObjectType >
virtual UInt32 Murl::Graph::IGenericNodeTarget< ObjectType >::GetMaxNumberOfNodes ( ) const
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()

template<class ObjectType >
virtual Bool Murl::Graph::IGenericNodeTarget< ObjectType >::SetNumberOfNodes ( UInt32  numberOfNodes)
pure virtual

Set the total number of nodes.

The given value must be in the range from GetMinNumberOfNodes() to GetMaxNumberOfNodes().

Parameters
numberOfNodesThe total number of nodes in the target.
Returns
true if successful.

◆ GetNumberOfNodes()

template<class ObjectType >
virtual UInt32 Murl::Graph::IGenericNodeTarget< ObjectType >::GetNumberOfNodes ( ) const
pure virtual

Get the total number of nodes.

Returns
The total number of nodes in the target.

◆ SetNodeId()

template<class ObjectType >
virtual Bool Murl::Graph::IGenericNodeTarget< ObjectType >::SetNodeId ( const String nodeId,
UInt32  index 
)
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
nodeIdA string containing the full path and ID to a node in the scene graph.
indexThe index of the node ID to set, in the range from 0 to GetNumberOfNodes()-1.
Returns
true if successful.

◆ GetNodeId()

template<class ObjectType >
virtual const String& Murl::Graph::IGenericNodeTarget< ObjectType >::GetNodeId ( UInt32  index) const
pure virtual

Get the node ID at a given index.

Parameters
indexThe node ID index in the range from 0 to GetNumberOfNodes()-1.
Returns
The node ID at the given index.

◆ SetNode()

template<class ObjectType >
virtual Bool Murl::Graph::IGenericNodeTarget< ObjectType >::SetNode ( ObjectType *  object,
UInt32  index 
)
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
objectA pointer to the node.
indexThe zero-based position where to set the node, in the range from 0 to GetNumberOfNodes()-1.
Returns
true if successful.

◆ GetNode()

template<class ObjectType >
virtual ObjectType* Murl::Graph::IGenericNodeTarget< ObjectType >::GetNode ( UInt32  index) const
pure virtual

Get the node at a given index.

Parameters
indexThe 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


Copyright © 2011-2024 Spraylight GmbH.