Scene Graph

The scene graph mainly includes two functions: node management and node operation logic management.

1、Node management

Node management functions include:

  • add node
template<class TNode, class ...Args> 
    std::shared_ptr<TNode> addNode(Args&& ... args)
template<class TNode>
    std::shared_ptr<TNode> addNode(std::shared_ptr<TNode> tNode)

Where TNode represents the derived type of the node, and Args is the parameter required by the node construction process

  • delete node
void deleteNode(std::shared_ptr<Node> node);

2、Node operation logic management

  • Update run queue
void updateExecutionQueue();

The timing of the update mainly depends on whether the nodes in the scene graph and the connection relationship have changed. Once any item is changed, the node execution queue of the scene will update the run queue first the next time the node function is executed.

  • update node status
void propagateNode(std::shared_ptr<Node> node);

When the running state of a specific node changes, for example, the configuration parameters of the node are changed, the scene graph can update the state of all subsequent nodes that depend on the node by calling the propagateNode() function.

3、Function expansion

To be added…