Coin Logo http://www.sim.no
http://www.coin3d.org

SoSearchAction.h
1 #ifndef COIN_SOSEARCHACTION_H
2 #define COIN_SOSEARCHACTION_H
3 
4 /**************************************************************************\
5  *
6  * This file is part of the Coin 3D visualization library.
7  * Copyright (C) 1998-2007 by Systems in Motion. All rights reserved.
8  *
9  * This library is free software; you can redistribute it and/or
10  * modify it under the terms of the GNU General Public License
11  * ("GPL") version 2 as published by the Free Software Foundation.
12  * See the file LICENSE.GPL at the root directory of this source
13  * distribution for additional information about the GNU GPL.
14  *
15  * For using Coin with software that can not be combined with the GNU
16  * GPL, and for taking advantage of the additional benefits of our
17  * support services, please contact Systems in Motion about acquiring
18  * a Coin Professional Edition License.
19  *
20  * See http://www.coin3d.org/ for more information.
21  *
22  * Systems in Motion, Postboks 1283, Pirsenteret, 7462 Trondheim, NORWAY.
23  * http://www.sim.no/ sales@sim.no coin-support@coin3d.org
24  *
25 \**************************************************************************/
26 
27 #include <Inventor/actions/SoAction.h>
28 #include <Inventor/actions/SoSubAction.h>
29 #include <Inventor/SbName.h>
30 #include <Inventor/lists/SoPathList.h>
31 
32 class COIN_DLL_API SoSearchAction : public SoAction {
33  typedef SoAction inherited;
34 
35  SO_ACTION_HEADER(SoSearchAction);
36 
37 public:
38  SoSearchAction(void);
39  virtual ~SoSearchAction();
40 
41  static void initClass(void);
42 
43  enum LookFor { NODE = 1, TYPE = 2, NAME = 4 };
44  enum Interest { FIRST, LAST, ALL };
45 
46  void setNode(SoNode * const node);
47  SoNode * getNode(void) const;
48  void setType(const SoType type, const SbBool chkderived = TRUE);
49  SoType getType(SbBool & chkderived) const;
50  void setName(const SbName name);
51  SbName getName(void) const;
52  void setFind(const int what);
53  int getFind(void) const;
54  void setInterest(const Interest interest);
55  Interest getInterest(void) const;
56  void setSearchingAll(const SbBool searchall);
57  SbBool isSearchingAll(void) const;
58  SoPath * getPath(void) const;
59  SoPathList & getPaths(void);
60  void reset(void);
61 
62  void setFound(void);
63  SbBool isFound(void) const;
64  void addPath(SoPath * const path);
65 
66  // Obsoleted global flag, only present for compatibility reasons
67  // with old SGI / TGS Inventor application code.
68  static SbBool duringSearchAll;
69 
70 protected:
71  virtual void beginTraversal(SoNode * node);
72 
73 private:
74  int lookfor;
75  Interest interest;
76  SbBool searchall, chkderived;
77  SoNode * node;
78  SoType type;
79  SbName name;
80  SoPath * path;
81  SoPathList paths;
82 };
83 
84 #endif // !COIN_SOSEARCHACTION_H
static void initClass(void)
Definition: SoAction.cpp:392
static SbBool duringSearchAll
Definition: SoSearchAction.h:68
The SoSearchAction class provides methods for searching through scene graphs.Nodes can be searched fo...
Definition: SoSearchAction.h:32
The SoPathList class is a container for pointers to SoPath objects.As this class inherits SoBaseList...
Definition: SoPathList.h:31
The SoNode class is the base class for nodes used in scene graphs.Coin is a retained mode 3D visualiz...
Definition: SoNode.h:47
The SoPath class is a container class for traversal path descriptions.SoPath objects contain a list o...
Definition: SoPath.h:43
The SoAction class is the base class for all traversal actions.Applying actions is the basic mechanis...
Definition: SoAction.h:67
virtual void beginTraversal(SoNode *node)
Definition: SoAction.cpp:1208
LookFor
Definition: SoSearchAction.h:43
The SoType class is the basis for the run-time type system in Coin.Many of the classes in the Coin li...
Definition: SoType.h:50
Interest
Definition: SoSearchAction.h:44
The SbName class stores strings by reference.The class is used by Coin for storing keywords...
Definition: SbName.h:31

Copyright © 1998-2007 by Systems in Motion AS. All rights reserved.

Generated on Fri Feb 17 2017 for Coin by Doxygen. 1.8.13