Open Inventor Release 2024.2.1
 
Loading...
Searching...
No Matches
SoSearchPathAction.h
1/*=======================================================================
2 *** THE CONTENT OF THIS WORK IS PROPRIETARY TO FEI S.A.S, (FEI S.A.S.), ***
3 *** AND IS DISTRIBUTED UNDER A LICENSE AGREEMENT. ***
4 *** ***
5 *** REPRODUCTION, DISCLOSURE, OR USE, IN WHOLE OR IN PART, OTHER THAN AS ***
6 *** SPECIFIED IN THE LICENSE ARE NOT TO BE UNDERTAKEN EXCEPT WITH PRIOR ***
7 *** WRITTEN AUTHORIZATION OF FEI S.A.S. ***
8 *** ***
9 *** RESTRICTED RIGHTS LEGEND ***
10 *** USE, DUPLICATION, OR DISCLOSURE BY THE GOVERNMENT OF THE CONTENT OF THIS ***
11 *** WORK OR RELATED DOCUMENTATION IS SUBJECT TO RESTRICTIONS AS SET FORTH IN ***
12 *** SUBPARAGRAPH (C)(1) OF THE COMMERCIAL COMPUTER SOFTWARE RESTRICTED RIGHT ***
13 *** CLAUSE AT FAR 52.227-19 OR SUBPARAGRAPH (C)(1)(II) OF THE RIGHTS IN ***
14 *** TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 52.227-7013. ***
15 *** ***
16 *** COPYRIGHT (C) 1996-2014 BY FEI S.A.S, ***
17 *** BORDEAUX, FRANCE ***
18 *** ALL RIGHTS RESERVED ***
19**=======================================================================*/
20/*=======================================================================
21** Author : Mike Heck (Apr 2000)
22**=======================================================================*/
23
24
25#ifndef _SO_SEARCHPATH_ACTION_
26#define _SO_SEARCHPATH_ACTION_
27
28// Note: Not necessary to include SoSubAction.h because it is already
29// included by SoSearchAction.h
30#include <Inventor/actions/SoSearchAction.h>
31
117
118 SO_ACTION_HEADER(SoSearchPathAction);
119
120 public:
121
127
132
136 void reset();
137
141 void setSearchString( const char *searchString );
146 { return m_strSearchString; };
147
151 void setSeparatorChar( const char sepChar )
152 { m_cSepChar = sepChar; }
156 char getSeparatorChar() const
157 { return m_cSepChar; }
158
162 void setDerivedIsOK( const SbBool derivedIsOK )
163 { m_bDerivedIsOK = derivedIsOK; };
168 { return m_bDerivedIsOK; };
169
177 { return m_nItemNum; };
178
179 private:
180 // Notifies action that the current node satisfies the current search item.
181 virtual void setFound();
182
183 private:
184 static void initClass();
185 static void exitClass();
186
187 // Static and instance-specific callbacks called during traversal
188 static void searchStatic(SoAction *action, SoNode *node);
189 virtual void search (SoNode *node);
190
191 private:
192 // Initiates action on graph
193 virtual void beginTraversal(SoNode *node);
194
195 // Classify search item and call appropriate SearchAction method
196 SbBool setSearchParameters( const char* item );
197
198 // Result of setupNextSearchItem
199 enum ItemSetupResult {
200 NO_MORE_ITEMS,
201 VALID_ITEM,
202 INVALID_ITEM
203 };
204
205 // Extract next search item from search string and get ready to go.
206 ItemSetupResult setupNextSearchItem();
207
208 SbString m_strSearchString; // Search string
209 char *m_pStartChar; // Points to next search item
210 char m_cSepChar; // Char that separates search items
211 SbBool m_bDerivedIsOK; // Will type search match derived types
212 int m_nItemNum; // Which search item is active (for error reporting)
213
214 private:
215
216};
217
218#endif /* _SO_SEARCHPATH_ACTION_ */
219
Class for smart character strings.
Definition SbString.h:202
Abstract base class for all actions.
Definition SoAction.h:132
Abstract base class for all database nodes.
Definition SoNode.h:145
Searches for nodes in a scene graph.
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> Searches for a n...
char getSeparatorChar() const
Gets separator char for search string.
void setSearchString(const char *searchString)
Sets the search path string.
int getNumItemsFound() const
Get the number of search items that were successfully found.
const SbString & getSearchString() const
Gets the search path string.
void setDerivedIsOK(const SbBool derivedIsOK)
Sets flag to allow search on a type to match derived types.
void reset()
Reset options back to default values, clears returned path.
SoSearchPathAction()
Constructor.
SbBool getDerivedIsOK() const
Gets flag to allow search on a type to match derived types.
void setSeparatorChar(const char sepChar)
Sets separator char for search string.
virtual ~SoSearchPathAction()
Destructor.
int SbBool
Boolean type.
Definition SbBase.h:87