| 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) by Kongsberg Oil & Gas Technologies.
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 Kongsberg Oil & Gas Technologies
18 * about acquiring a Coin Professional Edition License.
19 *
20 * See http://www.coin3d.org/ for more information.
21 *
22 * Kongsberg Oil & Gas Technologies, Bygdoy Alle 5, 0257 Oslo, 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/tools/SbLazyPimplPtr.h>
30 #include <Inventor/SbName.h>
31 #include <Inventor/lists/SoPathList.h>
32
33 class SoSearchActionP;
34
35 class COIN_DLL_API SoSearchAction : public SoAction {
36 typedef SoAction inherited;
37
38 SO_ACTION_HEADER(SoSearchAction);
39
40 public:
41 static void initClass(void);
42
43 SoSearchAction(void);
44 virtual ~SoSearchAction(void);
45
46 enum LookFor { NODE = 1, TYPE = 2, NAME = 4 };
47 enum Interest { FIRST, LAST, ALL };
48
49 void setNode(SoNode * const node);
50 SoNode * getNode(void) const;
51 void setType(const SoType type, const SbBool chkderived = TRUE);
52 SoType getType(SbBool & chkderived) const;
53 void setName(const SbName name);
54 SbName getName(void) const;
55 void setFind(const int what);
56 int getFind(void) const;
57 void setInterest(const Interest interest);
58 Interest getInterest(void) const;
59 void setSearchingAll(const SbBool searchall);
60 SbBool isSearchingAll(void) const;
61 SoPath * getPath(void) const;
62 SoPathList & getPaths(void);
63 void reset(void);
64
65 void setFound(void);
66 SbBool isFound(void) const;
67 void addPath(SoPath * const path);
68
69 // Obsoleted global flag, only present for compatibility reasons
70 // with old SGI / TGS Inventor application code.
71 static SbBool duringSearchAll;
72
73 protected:
74 virtual void beginTraversal(SoNode * node);
75
76 private:
77 int lookfor;
78 Interest interest;
79 SbBool searchall, chkderived;
80 SoNode * node;
81 SoType type;
82 SbName name;
83 SoPath * path;
84 SoPathList paths;
85
86 private:
87 SbLazyPimplPtr<SoSearchActionP> pimpl;
88
89 // NOT IMPLEMENTED:
90 SoSearchAction(const SoSearchAction & rhs);
91 SoSearchAction & operator = (const SoSearchAction & rhs);
92 }; // SoSearchAction
93
94 #endif // !COIN_SOSEARCHACTION_H
SoAction::initClass
static void initClass(void)
Definition: SoAction.cpp:366
SoSearchAction::duringSearchAll
static SbBool duringSearchAll
Definition: SoSearchAction.h:71
SoSearchAction
The SoSearchAction class provides methods for searching through scene graphs.Nodes can be searched fo...
Definition: SoSearchAction.h:35
SoPathList
The SoPathList class is a container for pointers to SoPath objects.As this class inherits SoBaseList...
Definition: SoPathList.h:31
SoNode
The SoNode class is the base class for nodes used in scene graphs.Coin is a retained mode 3D visualiz...
Definition: SoNode.h:47
SoPath
The SoPath class is a container class for traversal path descriptions.SoPath objects contain a list o...
Definition: SoPath.h:43
SoAction
The SoAction class is the base class for all traversal actions.Applying actions is the basic mechanis...
Definition: SoAction.h:68
SoAction::beginTraversal
virtual void beginTraversal(SoNode *node)
Definition: SoAction.cpp:1263
SoSearchAction::LookFor
LookFor
Definition: SoSearchAction.h:46
SoType
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
SoSearchAction::Interest
Interest
Definition: SoSearchAction.h:47
SbName
The SbName class stores strings by reference.The class is used by Coin for storing keywords...
Definition: SbName.h:31

Copyright © 1998-2010 by Kongsberg Oil & Gas Technologies. All rights reserved.