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
32class COIN_DLL_API SoSearchAction : public SoAction {
33 typedef SoAction inherited;
34
35 SO_ACTION_HEADER(SoSearchAction);
36
37public:
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
70protected:
71 virtual void beginTraversal(SoNode * node);
72
73private:
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
The SbName class stores strings by reference.
Definition SbName.h:31
The SoAction class is the base class for all traversal actions.
Definition SoAction.h:67
static void initClass(void)
Definition SoAction.cpp:392
virtual void beginTraversal(SoNode *node)
Definition SoAction.cpp:1208
The SoNode class is the base class for nodes used in scene graphs.
Definition SoNode.h:47
The SoPathList class is a container for pointers to SoPath objects.
Definition SoPathList.h:31
The SoPath class is a container class for traversal path descriptions.
Definition SoPath.h:43
The SoSearchAction class provides methods for searching through scene graphs.
Definition SoSearchAction.h:32
Interest
Definition SoSearchAction.h:44
LookFor
Definition SoSearchAction.h:43
static SbBool duringSearchAll
Definition SoSearchAction.h:68
The SoType class is the basis for the run-time type system in Coin.
Definition SoType.h:50

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

Generated on Mon Jan 22 2024 for Coin by Doxygen. 1.10.0