Open Inventor Release 2024.2.0
 
Loading...
Searching...
No Matches
Applying an Action

When an action is applied to a scene graph, each node encountered in the graph implements its own action behavior. In some cases, a particular type of node does nothing for a particular action. SoMaterial does nothing when an SoGetBoundingBoxAction is applied, for example. In other cases, the action behavior is relatively simple. For example, for most actions, all classes derived from SoGroup do little except traverse their children in a specified order.

When an action is applied, the Inventor database manages a traversal state (similar to the rendering state of OpenGL). The traversal state is an internal class used by Inventor to store transient state elements (parameters) during execution of the action. Typically, this management involves traversing the scene graph from top to bottom and from left to right. The elements in the traversal state are modified by the nodes encountered during this traversal. For certain actions, such as writing to a file (SoWriteAction) and accumulating a transformation matrix (SoGetMatrixAction), little or no traversal state is maintained. In these cases, the database does not need to keep track of all parameters inherited by nodes lower in the graph from the nodes above them.

The following sections focus on individual actions and how they are implemented by different nodes. You don't need to worry about exactly how the database manages the traversal state. You need only a general idea of which nodes implement a given action and how they implement it.

An action can be applied to a node, a path, or a path list. When an action is applied to a node, the graph rooted by that node is traversed. When the action is applied to a path, all nodes in the path chain itself are traversed, as well as all nodes, if any, under the last node in the path. In addition, all nodes that affect the nodes in the path chain are also traversed (typically, these nodes are to the left and above the nodes in the path). Applying an action to a path list is similar to applying the action to each path, except that subgraphs common to two or more paths are traversed only once.