SoSearchPathAction Class |
Searches for a node in a scene graph using a sequence of search criteria.
Namespace: OIV.Inventor.Actions
The SoSearchPathAction type exposes the following members.
Name | Description | |
---|---|---|
SoSearchPathAction | Constructor. |
Name | Description | |
---|---|---|
AddPath | (Inherited from SoSearchAction.) | |
Apply(SoNode) | Initiates an action on the graph defined by a node. | |
Apply(SoPath) | Initiates an action on the graph defined by a path. | |
Apply(SoPathList) | Calls Apply(pathList, false). (Inherited from SoAction.) | |
Apply(SoPathList, Boolean) | Initiates an action on the graph defined by a list of paths. | |
ClearApplyResult | When applied, an action may reference nodes or create objects (e.g. | |
EnableElement | ||
EnableElements | Obsolete.
Returns the list of enabled elements for a given action subclass.
(Inherited from SoAction.) | |
Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.) | |
ForwardTraversal(SoNode) | Traverse a node that is not part of the current scenegraph. | |
ForwardTraversal(SoPath) | Traverse a path that is not part of the current scenegraph. | |
GetContinueActionInBranchFlag | This function indicates if the action must stop in the current branch. | |
GetCurPath | Returns the path accumulated during traversal, i.e., the chain of nodes from the root of the traversed graph to the current node being traversed. | |
GetDerivedIsOK | Gets flag to allow search on a type to match derived types. | |
GetDistribMode | Returns the distribution mode of this action across a cluster (ScaleViz-Cluster only). | |
GetFind | Returns what to look for. | |
GetHashCode |
Overrides GetHashCode().
(Inherited from SoNetBase.) | |
GetInterest | Returns which paths to return. | |
GetName | Returns the name of the node to search for. | |
GetNode | Returns the node to search for. | |
GetNodeAppliedTo | Returns the node the action is being applied to. | |
GetNumItemsFound | Get the number of search items that were successfully found. | |
GetOriginalPathListAppliedTo | Returns the original path list the action is being applied to. | |
GetPath | Returns resulting path, or NULL if no path was found. | |
GetPathAppliedTo | Returns the path the action is being applied to. | |
GetPathCode | Returns path code based on where current node (the node at the end of the current path) lies with respect to the path(s) the action is being applied to. | |
GetPathListAppliedTo | Returns the path list the action is being applied to. | |
GetPaths | Returns resulting path list. | |
GetPipeId | Gets pipe identifier in the range [1..N] associated to this render action while running a ScaleViz Multipipe configuration. | |
GetSceneManager | Return the OIV.Inventor.SoSceneManager associated with this action. | |
GetSearchString | Gets the search path string. | |
GetSeparatorChar | Gets separator char for search string. | |
GetState | Gets the state from the action. | |
GetType | Gets the Type of the current instance. (Inherited from Object.) | |
GetType(Boolean) | Returns the node type to search for. | |
GetWhatAppliedTo | Returns code indicating what action is being applied to. | |
HasTerminated | Returns true if the traversal has reached a termination condition. | |
InvalidateState | Invalidates the current traversal state in the action, forcing it to be recreated when the action is next applied. | |
IsBeingApplied | Returns true if this action is currently being applied. | |
IsFound | (Inherited from SoSearchAction.) | |
IsLastPathListAppliedTo | Returns true if the current list is the last one from the original. | |
IsSearchingAll | Returns false if searching uses regular traversal, true if it traverses every single node. | |
IsUsingAlternateRep | Returns true if current action is using alternate representations. | |
PostDelayedTraversal | Method called by SoMultiPassManager after delayed pass traversals. | |
PreDelayedTraversal | Method called by SoMultiPassManager before delayed pass traversals. | |
Reset | Reset options back to default values, clears returned path. | |
ResetContinueActionInBranchFlag | This function resets the continue action flag. | |
SetDerivedIsOK | Sets flag to allow search on a type to match derived types. | |
SetFind | Sets what to look for; what is a bitmask of LookFor enum values. | |
SetFound | (Overrides SoSearchActionSetFound.) | |
SetInterest | Sets which paths to return. | |
SetName | Sets the name of the node to search for. | |
SetNode | Sets the node to search for. | |
SetPipeId | Sets pipe identifier in the range [1..N] associated to this render action while running a ScaleViz Multipipe configuration. | |
SetSceneManager | Set the scene manager associated with this action (if any ). | |
SetSearchingAll | Sets whether searching uses regular traversal or whether it traverses every single node. | |
SetSearchString | Sets the search path string. | |
SetSeparatorChar | Sets separator char for search string. | |
SetType(Type) | Calls SetType(t, true). (Inherited from SoSearchAction.) | |
SetType(Type, Boolean) | Sets the node type to search for. | |
SetUpState | Creates state if it is NULL or it is no longer valid because new elements have been enabled since it was created. | |
StopActionInBranch | This function stops the action in the current Scene Graph branch. | |
ToString | Returns a string that represents the current object. (Inherited from Object.) | |
Traverse | Does traversal of a graph rooted by a node. | |
UseAlternateRep | Tell the action to use alternate representations during traversal when available. |
This class extends OIV.Inventor.Actions.SoSearchAction to search for a sequence of items defined in a string, e.g., "Wheel1/Hub/Bearing". Each item can be a
Node name, or
Node type (type name in angle brackets, e.g., "<Cone>").
When the action finds a node that satisfies the current search item, it effectively restarts the search from that node, using the next search item. This means that the search for each item (after the first) is confined to the subgraph under the node that satisfied the previous search item. In most cases each item (except possibly the last one) will be a grouping node, but this is not enforced by the action.
Finding nodes by name is a useful technique for modifying a scene graph, but using OIV.Inventor.Nodes.SoNode.GetByName(System.String) or OIV.Inventor.Actions.SoSearchAction requires assigning a unique name to every (interesting) node. Often the same subgraph will be used multiple times and it would be convenient to assign each instance of the subgraph a unique name, but reuse the same names for the nodes inside the subgraph. OIV.Inventor.Actions.SoSearchPathAction allows this kind of hierarchical naming.
Given a scene graph with hierarchical names, for example:
DEF Wheel1 Separator { DEF Hub Separator { DEF Bolt Separator { Cylinder { height 3 } } } } DEF Wheel2 Separator { DEF Hub Separator { DEF Bolt Separator { Cylinder { height 13 } } } }
"Wheel1/Hub/Bolt" would find "Bolt" in the first wheel. Intermediate names may be omitted if the search string is still unambiguous. For example "Wheel1/Bolt" would find the same node in this simple case. "Wheel2/Hub/Bolt/<Cylinder>" would return a path including the leaf OIV.Inventor.Nodes.SoCylinder node in the second wheel.
Most of the methods inherited from OIV.Inventor.Actions.SoSearchAction are ignored and do not return useful information (set/getNode, set/getName, etc.). Relevant inherited methods are set/isSearchingAll, getPath, and reset.
Note that by default nodekits do not search their children when a search action is applied. The reference page for OIV.Inventor.Nodekits.SoBaseKit discusses the methods OIV.Inventor.Nodekits.SoBaseKit.IsSearchingChildren() and OIV.Inventor.Nodekits.SoBaseKit.SetSearchingChildren(System.Boolean), which allow you to query and control this behavior.