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 | (Overrides SoSearchActionEnableElements.) |
![]() | Equals | (Inherited from Object.) |
![]() | ForwardTraversal | Traverse a node that is not part of the current scenegraph. |
![]() | GetContinueActionInBranchFlag | This function indicates if the action must stop in the current branch. |
![]() | GetCurPath | (Inherited from SoAction.) |
![]() | GetDerivedIsOK | Gets flag to allow search on a type to match derived types. |
![]() | 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 | (Inherited from SoAction.) |
![]() | GetNumItemsFound | Get the number of search items that were successfully found. |
![]() | GetOriginalPathListAppliedTo | (Inherited from SoAction.) |
![]() | GetPath | Returns resulting path, or NULL if no path was found. |
![]() | GetPathAppliedTo | (Inherited from SoAction.) |
![]() | GetPathCode(SbNativeArrayInt32) | 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. |
![]() | GetPathCode(SbNativeInt32Array) | Obsolete. 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 | (Inherited from SoAction.) |
![]() | 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 SoSceneManager associated with this action. |
![]() | GetSearchString | Gets the search path string. |
![]() | GetSeparatorChar | Gets separator char for search string. |
![]() | GetState | (Inherited from SoAction.) |
![]() | GetType | Gets the Type of the current instance. (Inherited from Object.) |
![]() | GetType(Boolean) | Returns the node type to search for. |
![]() | GetWhatAppliedTo | (Inherited from SoAction.) |
![]() | HasTerminated | (Inherited from SoAction.) |
![]() | 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 | (Inherited from SoAction.) |
![]() | 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 | (Inherited from SoAction.) |
![]() | 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 | (Inherited from SoAction.) |
![]() | UseAlternateRep | Tell the action to use alternate representations during traversal when available. |
This class extends 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 SoNode.getByName or 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. 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 SoCylinder node in the second wheel.
Most of the methods inherited from 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 SoBaseKit discusses the methods SoBaseKit.isSearchingChildren() and SoBaseKit.setSearchingChildren(), which allow you to query and control this behavior.