other versions
- wheezy-backports 3.1.4~abc9f50-3~bpo70+1
- jessie 3.1.4~abc9f50-7
SoSearchAction(3) | Coin | SoSearchAction(3) |
NAME¶
SoSearchAction - The SoSearchAction class provides methods for searching through scene graphs. Nodes can be searched for by pointer, type, and name, or a combination of those criteria. Types can be interpreted as exact types, or the type can match nodes derived from it. Every single node can be searched, or normal traversal rules can be followed when searching (this is especially important to note with regard to switch nodes).SYNOPSIS¶
#include <Inventor/actions/SoSearchAction.h> Inherits SoAction.Public Types¶
enum LookFor { NODE = 1, TYPE = 2, NAME = 4 }
Public Member Functions¶
virtual SoType getTypeId (void) const
Static Public Member Functions¶
static SoType getClassTypeId (void)
Static Public Attributes¶
static SbBool duringSearchAll = FALSE
Protected Member Functions¶
virtual const
Static Protected Member Functions¶
static SoEnabledElementsList * getClassEnabledElements (void)
Additional Inherited Members¶
Detailed Description¶
The SoSearchAction class provides methods for searching through scene graphs. Nodes can be searched for by pointer, type, and name, or a combination of those criteria. Types can be interpreted as exact types, or the type can match nodes derived from it. Every single node can be searched, or normal traversal rules can be followed when searching (this is especially important to note with regard to switch nodes).Member Enumeration Documentation¶
enum SoSearchAction::LookFor¶
Specify the search criterion. This can be a bitwise combination of the available values.enum SoSearchAction::Interest¶
Values used when specifiying what node(s) we are interested in: the first one found, the last one or all of them.Constructor & Destructor Documentation¶
SoSearchAction::SoSearchAction (void)¶
Initializes internal settings with default values. With the default settings, the SoSearchAction will ignore all nodes.SoSearchAction::~SoSearchAction (void) [virtual]¶
Destructor.Member Function Documentation¶
SoType SoSearchAction::getTypeId (void) const [virtual]¶
Returns the type identification of an action derived from a class inheriting SoAction. This is used for run-time type checking and 'downward' casting. Usage example:void bar(SoAction * action) { if (action->getTypeId() == SoGLRenderAction::getClassTypeId()) { // safe downward cast, know the type SoGLRenderAction * glrender = (SoGLRenderAction *)action; } return; // ignore if not renderaction }For application programmers wanting to extend the library with new actions: this method needs to be overridden in all subclasses. This is typically done as part of setting up the full type system for extension classes, which is usually accomplished by using the pre-defined macros available through Inventor/nodes/SoSubAction.h: SO_ACTION_SOURCE, SO_ACTION_INIT_CLASS and SO_ACTION_CONSTRUCTOR. For more information on writing Coin extensions, see the SoAction class documentation. Returns the actual type id of an object derived from a class inheriting SoAction. Needs to be overridden in all subclasses. Implements SoAction.
SoType SoSearchAction::getClassTypeId (void) [static]¶
Returns the run-time type object associated with instances of this class. Reimplemented from SoAction.void SoSearchAction::addMethod (const SoTypetype, SoActionMethodmethod) [static]¶
This API member is considered internal to the library, as it is not likely to be of interest to the application programmer.void SoSearchAction::enableElement (const SoTypetype, const intstackindex) [static]¶
This API member is considered internal to the library, as it is not likely to be of interest to the application programmer.const SoEnabledElementsList & SoSearchAction::getEnabledElements (void) const [protected], [virtual]¶
Returns a list of the elements used by action instances of this class upon traversal operations. Reimplemented from SoAction.SoEnabledElementsList * SoSearchAction::getClassEnabledElements (void) [static], [protected]¶
This API member is considered internal to the library, as it is not likely to be of interest to the application programmer. This method not available in the original OIV API, see SoSubAction.h for explanation. Reimplemented from SoAction.SoActionMethodList * SoSearchAction::getClassActionMethods (void) [static], [protected]¶
This API member is considered internal to the library, as it is not likely to be of interest to the application programmer. This method not available in the original OIV API, see SoSubAction.h for explanation. Reimplemented from SoAction.void SoSearchAction::initClass (void) [static]¶
Initializes the run-time type system for this class, and sets up the enabled elements and action method list. Reimplemented from SoAction.void SoSearchAction::setNode (SoNode *constnodeptr)¶
Sets the node pointer to search for. The action will be configured to set the search 'interest' to LookFor NODE, so there is no need to call SoSearchAction::setFind().SoNode * SoSearchAction::getNode (void) const¶
Returns the node the SoSearchAction instance is configured to search for. Note that this method does not return what was found when you applied the action - it only returns what was specifically set by the user with setNode(). What the action found is returned by getPath() and getPaths().void SoSearchAction::setType (const SoTypetypearg, const SbBoolchkderivedarg = TRUE)¶
Configures the SoSearchAction instance to search for nodes of the given type, and nodes of classes derived from the given type if chkderived is TRUE. The action will be configured to set the search 'interest' to LookFor TYPE, so there is no need to call SoSearchAction::setFind().SoType SoSearchAction::getType (SbBool &chkderivedref) const¶
Returns the node type which is searched for, and whether derived classes of that type also returns a match.void SoSearchAction::setName (const SbNamenamearg)¶
Configures the SoSearchAction instance to search for nodes with the given name. The action will be configured to set the search 'interest' to LookFor NAME, so there is no need to call SoSearchAction::setFind(). See Also:SoNode::getByName()
SbName SoSearchAction::getName (void) const¶
Returns the name the SoSearchAction instance is configured to search for.void SoSearchAction::setFind (const intwhat)¶
Configures what to search for in the scene graph. what is a bitmask of LookFor flags. Default find configuration is to ignore all nodes, but the setFind() configuration is updated automatically when any one of SoSearchAction::setNode(), SoSearchAction::setType() or SoSearchAction::setName() is called.int SoSearchAction::getFind (void) const¶
Returns the search configuration of the action instance.void SoSearchAction::setInterest (const Interestinterestarg)¶
Configures whether only the first, the last, or all the searching matches are of interest. Default configuration is FIRST.SoSearchAction::Interest SoSearchAction::getInterest (void) const¶
Returns whether only the first, the last, or all the searching matches will be saved.void SoSearchAction::setSearchingAll (const SbBoolsearchallarg)¶
Specifies whether normal graph traversal should be done ( searchall is FALSE, which is the default setting), or if every single node should be searched ( searchall is TRUE). If the searchall flag is TRUE, even nodes considered 'hidden' by other actions are searched (like for instance the disabled children of SoSwitch nodes). SoBaseKit::setSearchingChildren() must be used to search for nodes under node kits.SbBool SoSearchAction::isSearchingAll (void) const¶
Returns the traversal method configuration of the action.SoPath * SoSearchAction::getPath (void) const¶
Returns the path to the node of interest that matched the search criterions. If no match was found, NULL is returned. Note that if ALL matches are of interest, the result of a search action must be fetched through SoSearchAction::getPaths(). There is one frequently asked question about the paths that are returned from either this method or the getPaths() method below: 'why am I not getting the complete path as expected?' Well, then you probably have to cast the path to a SoFullPath, since certain nodes (nodekits, many VRML97 nodes) have hidden children. SoPath::getTail() will return the first node that has hidden children, or the tail if none of the nodes have hidden children. SoFullPath::getTail() will always return the actual tail. Just do like this:SoFullPath * path = (SoFullPath *) searchaction->getPath(); SoVRMLCoordinate * vrmlcord = (SoVRMLCoordinate *) path->getTail();
SoPathList & SoSearchAction::getPaths (void)¶
Returns a pathlist of all nodes that matched the search criterions. Note that if interest were only FIRST or LAST, SoSearchAction::getPath() should be used instead of this method. See Also:getPath()
void SoSearchAction::reset (void)¶
Resets all the SoSearchAction internals back to their default values.void SoSearchAction::setFound (void)¶
This API member is considered internal to the library, as it is not likely to be of interest to the application programmer. Marks the SoSearchAction instance as terminated.SbBool SoSearchAction::isFound (void) const¶
This API member is considered internal to the library, as it is not likely to be of interest to the application programmer. Returns whether the search action was terminated. Note that this value does not reflect whether the node(s) that was searched for was found or not. Use the result of getPath() / getPaths() if that is what you really are looking for.void SoSearchAction::addPath (SoPath *constpathptr)¶
This API member is considered internal to the library, as it is not likely to be of interest to the application programmer. Sets the path, or adds the path to the path list, depending on the interest configuration. The path is not copied, so it can not be modified after being added without side effects.void SoSearchAction::beginTraversal (SoNode *node) [protected], [virtual]¶
This virtual method is called from SoAction::apply(), and is the entry point for the actual scenegraph traversal. It can be overridden to initialize the action at traversal start, for specific initializations in the action subclasses inheriting SoAction. Default method just calls traverse(), which any overridden implementation of the method must do too (or call SoAction::beginTraversal()) to trigger the scenegraph traversal. Reimplemented from SoAction.Member Data Documentation¶
SbBool SoSearchAction::duringSearchAll = FALSE [static]¶
Obsoleted global flag, only present for compatibility reasons with old SGI / TGS Inventor application code. It's set to TRUE when an SoSearchAction traversal with SoSearchAction::isSearchingAll() equal to TRUE is started, and is reset to FALSE again after traversal has finished. (The flag is used by SGI / TGS Inventor in SoSwitch::affectsState() to know when SoSwitch::whichChild should behave as SoSwitch::SO_SWITCH_ALL. We have a better solution for this problem in Coin.)Author¶
Generated automatically by Doxygen for Coin from the source code.Sat Oct 12 2013 | Version 4.0.0a |