A path represents a scene graph or subgraph. It contains a list of pointers to nodes forming a chain from some root to some descendent. Each node in the chain is a child of the previous node. Paths are
used to refer to some object in a scene graph precisely and unambiguously, even if there are many instances of the object. Therefore, paths are returned by both the
SoRayPickAction and
SoSearchAction.
When an action is applied to
a path, only the nodes in the subgraph defined by the path are traversed. These include: the nodes in the path chain, all nodes (if any) below the last node in the path, and all nodes whose effects are
inherited by any of these nodes.
SoPath attempts to maintain consistency of paths even when the structure of the scene graph changes. For example, removing a child from its parent when both are in a path chain
cuts the path chain at that point, leaving the top part intact. Removing the node to the left of a node in a path adjusts the index for that node. Replacing a child of a node when both the parent and the
child are in the chain replaces the child in the chain with the new child, truncating the path below the new child.
Note that only public children of nodes are accessible from an
SoPath. Nodes like node kits
that limit access to their children may provide other ways to get more information, such as by using the
SoNodeKitPath class.