A SERVICE OF

logo

The Order In Which Actions Are Passed Between Nodes
87
Figure 7-1 The Flow of an Action Through A Scene Graph
A top-down traversal means that a node can never affect a node above it. For example,
node 3 in Figure 7-1 cannot affect nodes 4 and 5, however, node 4 can affect node 5. So,
that branch of the scene graph is traversed in the following way when an action is
applied to the root node:
1. The action traverses from node 1 to any of its children.
2. When the action visits node 2, node 2 propagates the action to one of its children.
3. If the action propagates to node 3, the action takes effect and the attribute variables
are reset to their values prior to node 3 after which the action visits node four.
4. The action then traverses nodes 4 and 5 at which point the traversal state is reset to
its state prior to node 2.
5. The action then traverses to any of the other child nodes of node 1.
Each node can immediately change the image in the frame buffer according to the
content to the node.
Whether all of the children of a group node are evaluated depends on the group node
type. For example, in Figure 7-1, if the number 1 node is of type csSwitch, the traversal
may visit all, one, or none of nodes 2, 6, 7, 9, and 10.
1
2
3
4
5
6
7
8
9
10
Root node