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) 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
33class SoSearchActionP;
34
35class COIN_DLL_API SoSearchAction : public SoAction {
36 typedef SoAction inherited;
37
38 SO_ACTION_HEADER(SoSearchAction);
39
40public:
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
73protected:
74 virtual void beginTraversal(SoNode * node);
75
76private:
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
86private:
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
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:68
static void initClass(void)
Definition SoAction.cpp:366
virtual void beginTraversal(SoNode *node)
Definition SoAction.cpp:1263
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:35
Interest
Definition SoSearchAction.h:47
LookFor
Definition SoSearchAction.h:46
static SbBool duringSearchAll
Definition SoSearchAction.h:71
The SoType class is the basis for the run-time type system in Coin.
Definition SoType.h:50

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

Generated on Wed Jul 17 2024 for Coin by Doxygen 1.12.0.