SOSEARCHACTION(3iv)
SoSearchAction π β¨
okay bestie, gather round, because we're talking about SoSearchAction(3IV) β the lil action class that goes snooping around your scene graph looking for nodes. yes she's nosy. yes she's iconic. let's get into it π΅οΈβοΈπ
πΈ NAME πΈ
SoSearchAction β searches for nodes in a scene graph π
π¦ INHERITS FROM π¦
SoAction > SoSearchAction
β¨ SYNOPSIS β¨
#include <Inventor/actions/SoSearchAction.h>
the enum situation, bestie:
enum LookFor {
SoSearchAction::NODE Search for a particular node (by pointer)
SoSearchAction::TYPE Search for a particular type of node
SoSearchAction::NAME Search for a node with a particular name
}
enum Interest {
SoSearchAction::FIRST Return only the first path found
SoSearchAction::LAST Return only the last path found
SoSearchAction::ALL Return all paths found
}
and the methods she got from her own class, SoSearchAction:
SoSearchAction()
void setNode(SoNode *n)
SoNode * getNode() const
void setType(SoType t, SbBool derivedIsOk = TRUE)
SoType getType(SbBool &derivedIsOk) const
void setName(const SbName &n)
const SbName & getName() const
void setFind(int what)
int getFind()
void setInterest(Interest interest)
Interest getInterest() const
void setSearchingAll(SbBool flag)
SbBool isSearchingAll() const
SoPath * getPath() const
SoPathList & getPaths()
void reset()
plus everything she inherited from SoAction:
virtual void apply(SoNode *node)
virtual void apply(SoPath *path)
virtual void apply(const SoPathList &pathList, SbBool obeysRules =
FALSE)
static SoType getClassTypeId()
virtual SoType getTypeId()
virtual SbBool isOfType(SoType type)
virtual void invalidateState()
π DESCRIPTION π
so, what's the vibe? this class is your scene-graph detective π΅οΈβοΈ. you use it to search scene graphs for specific nodes, nodes of a specific type, nodes with a specific name, or any combination of these. she can hunt down just the first or the last node that matches your criteria, or all the nodes that match. and then β the payoff β the action hands you back the paths to each node it found. paths to your faves. we love a queen who delivers π
β οΈ real talk: by default, nodekits do not search their children when a search action is applied. the man page forSoBaseKitdiscusses the methodsSoBaseKit::isSearchingChildren()andSoBaseKit::setSearchingChildren(), which let you query and control this behavior. so if your search is coming up empty, that might be why, bestie π
π METHODS π
SoSearchAction()
Constructor. that's it, that's the whole thing. she's born π«
void setNode(SoNode *n) / SoNode * getNode() const
Sets/returns the node to search for. π―
void setType(SoType t, SbBool derivedIsOk = TRUE) / SoType getType(SbBool &derivedIsOk) const
Sets/returns the node type to search for. and here's the tea β: if derivedIsOk is TRUE, a node that is of a type that is derived from t will pass this search criterion. so she's flexible, not picky. as she should be π
void setName(const SbName &n) / const SbName & getName() const
Sets/returns the name of the node to search for. name-drop and she'll find it π·οΈ
void setFind(int what) / int getFind()
Sets/returns what to look for; what is a bitmask of LookFor enum values. default is no flags at all. and here's the fun part β setting a node, type, and/or name to search for activates the relevant flag, so you may never need to call this method directly. she does it for you, no cap π«Ά
void setInterest(Interest interest) / Interest getInterest() const
Sets/returns which paths to return. default is FIRST. first come, first served, main character energy π
void setSearchingAll(SbBool flag) / SbBool 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. π
SoPath * getPath() const
Returns resulting path, or NULL if no path was found. π should be used if the interest is FIRST or LAST. remember that, bestie, don't use her for ALL, it's giving wrong tool for the job.
SoPathList & getPaths()
Returns resulting path list. should be used if the interest is ALL. now this is the one for collecting everything π
void 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. she's got a reset button and honestly? we all need one π§
π SEE ALSO π
SoPathSoBaseKit
π and that's the whole page, babe. this wasSoSearchAction(3IV), manual pageSoSearchAction(3IV)()β version and date baked right into that footer, cute. go search some scene graphs. slay. periodt. π πβ¨
π¦ where this page comes from
- debian bookworm: inventor-doc 2.1.5-10+dfsg-2 Β· LGPL-2.0-or-later
- debian trixie: inventor-doc 2.1.6+ds-2 Β· LGPL-2.0-or-later
- ubuntu jammy: inventor-doc 2.1.5-10-24
- ubuntu noble: inventor-doc 2.1.5-10+dfsg-2.1build2 Β· LGPL-2.0-or-later
- ubuntu questing: inventor-doc 2.1.6+ds-2
- ubuntu resolute: inventor-doc 2.1.6.1+ds-1 Β· LGPL-2.0-or-later
- ubuntu stonking: inventor-doc 2.1.6.1+ds-1 Β· LGPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms