man SoSearchAction () - searches for nodes in a scene graph
NAME
SoSearchAction - searches for nodes in a scene graph
INHERITS FROM
SoAction > SoSearchAction
SYNOPSIS
#include <Inventor/actions/SoSearchAction.h>
enum LookFor {
c
}
c
}
Search for a particular node (by pointer)
c
}
c
}
Search for a particular type of node
c
}
c
}
Search for a node with a particular name
}
enum Interest {
c
}
c
}
Return only the first path found
c
}
c
}
Return only the last path found
c
}
c
}
Return all paths found
}
Methods from class SoSearchAction:
c
}
c
}
SoSearchAction()
c
}
c
}
setNode(SoNode *n)
c
}
c
}
getNode() const
c
}
c
}
setType(SoType t, SbBool derivedIsOk = TRUE)
c
}
c
}
getType(SbBool &derivedIsOk) const
c
}
c
}
setName(const SbName &n)
c
}
c
}
getName() const
c
}
c
}
setFind(int what)
c
}
c
}
getFind()
c
}
c
}
setInterest(Interest interest)
c
}
c
}
getInterest() const
c
}
c
}
setSearchingAll(SbBool flag)
c
}
c
}
isSearchingAll() const
c
}
c
}
getPath() const
c
}
c
}
getPaths()
c
}
c
}
reset()
Methods from class SoAction:
c
}
c
}
apply(SoNode *node)
c
}
c
}
apply(SoPath *path)
c
}
c
}
apply(const SoPathList &pathList, SbBool obeysRules = FALSE)
c
}
c
}
getClassTypeId()
c
}
c
}
getTypeId()
c
}
c
}
isOfType(SoType type)
c
}
c
}
invalidateState()
DESCRIPTION
This class is used to search scene graphs for specific nodes, nodes of a specific type, nodes with a specific name, or any combination of these. It can search for just the first or last node satisfying the criteria or for all such nodes. The actions return paths to each node found. Note that by default nodekits do not search their children when a search action is applied. The man page for SoBaseKit discusses the methods SoBaseKit::isSearchingChildren() and SoBaseKit::setSearchingChildren(), which allow you to query and control this behavior.
METHODS
c
}
c
}
SoSearchAction()
Constructor.
c
}
c
}
setNode(SoNode *n)
c
}
c
}
getNode() const
Sets/returns the node to search for.
c
}
c
}
setType(SoType t, SbBool derivedIsOk = TRUE)
c
}
c
}
getType(SbBool &derivedIsOk) const
Sets/returns the node type to search for. If derivedIsOk is TRUE, a node that is of a type that is derived from t will pass this search criterion.
c
}
c
}
setName(const SbName &n)
c
}
c
}
getName() const
Sets/returns the name of the node to search for.
c
}
c
}
setFind(int what)
c
}
c
}
getFind()
Sets/returns what to look for; what is a bitmask of LookFor enum values. Default is no flags at all. Note that setting a node, type, and/or name to search for activates the relevant flag, so you may never need to
call this method directly.
c
}
c
}
setInterest(Interest interest)
c
}
c
}
getInterest() const
Sets/returns which paths to return. Default is FIRST.
c
}
c
}
setSearchingAll(SbBool flag)
c
}
c
}
isSearchingAll() const
Sets/returns whether searching uses regular traversal or whether it traverses every single node. For example, if this flag is FALSE, an SoSwitch node will traverse only the child or children it would normally traverse
for an action. If the flag is TRUE, the switch would always traverse all of its children. The default is FALSE.
c
}
c
}
getPath() const
Returns resulting path, or NULL if no path was found. This should be used if the interest is FIRST or LAST.
c
}
c
}
getPaths()
Returns resulting path list. This should be used if the interest is ALL.
c
}
c
}
reset()
Resets options back to default values; clears list of returned paths. This can be used to apply the action again with a different set of search criteria.
SEE ALSO
SoPath, SoBaseKit