fixed: stay with old cmake qt link setup (policy CMP0020)
[opensg.git] / Source / System / GraphOp / OSGSharePtrGraphOp.h
blob2dd95665bfe066f33734df351a9016b6350142dc
1 /*---------------------------------------------------------------------------*\
2 * OpenSG *
3 * *
4 * *
5 * Copyright (C) 2000-2002 by the OpenSG Forum *
6 * *
7 * www.opensg.org *
8 * *
9 * contact: dirk@opensg.org, gerrit.voss@vossg.org, jbehr@zgdv.de *
10 * *
11 \*---------------------------------------------------------------------------*/
12 /*---------------------------------------------------------------------------*\
13 * License *
14 * *
15 * This library is free software; you can redistribute it and/or modify it *
16 * under the terms of the GNU Library General Public License as published *
17 * by the Free Software Foundation, version 2. *
18 * *
19 * This library is distributed in the hope that it will be useful, but *
20 * WITHOUT ANY WARRANTY; without even the implied warranty of *
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
22 * Library General Public License for more details. *
23 * *
24 * You should have received a copy of the GNU Library General Public *
25 * License along with this library; if not, write to the Free Software *
26 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. *
27 * *
28 \*---------------------------------------------------------------------------*/
29 /*---------------------------------------------------------------------------*\
30 * Changes *
31 * *
32 * *
33 * *
34 * *
35 * *
36 * *
37 \*---------------------------------------------------------------------------*/
39 #ifndef _OSGSHAREPTRGRAPHOP_H_
40 #define _OSGSHAREPTRGRAPHOP_H_
42 #ifdef __sgi
43 # pragma once
44 #endif
46 #include <map>
47 #include <set>
48 #include <vector>
50 #include "OSGGraphOp.h"
51 #include "OSGUtilDef.h"
52 #include "OSGTime.h"
54 OSG_BEGIN_NAMESPACE
56 /*! \ingroup GrpUtilGraphOp
57 \ingroup GrpLibOSGUtil
60 class OSG_UTIL_DLLMAPPING SharePtrGraphOp : public GraphOp
62 /*========================== PUBLIC =================================*/
64 public:
66 /*---------------------------------------------------------------------*/
67 /*! \name Types */
68 /*! \{ */
70 typedef GraphOp Inherited;
71 typedef SharePtrGraphOp Self;
73 OSG_GEN_INTERNAL_MEMOBJPTR(SharePtrGraphOp);
75 /*! \} */
76 /*---------------------------------------------------------------------*/
77 /*! \name Class Get */
78 /*! \{ */
80 static const char *getClassname(void) { return "SharePtrGraphOp"; };
82 /*! \} */
83 /*---------------------------------------------------------------------*/
84 /*! \name Constructors */
85 /*! \{ */
87 static ObjTransitPtr create(void);
89 virtual GraphOpTransitPtr clone (void);
91 /*! \} */
92 /*---------------------------------------------------------------------*/
93 /*! \name Main methods */
94 /*! \{ */
96 bool traverse(Node *root);
98 /*! \} */
99 /*---------------------------------------------------------------------*/
100 /*! \name Parameters */
101 /*! \{ */
103 void setParams(const std::string params);
105 void setIncludes(const std::string &includes);
106 void setExcludes(const std::string &excludes);
108 std::string usage(void);
110 /*! \} */
112 /*========================= PROTECTED ===============================*/
114 protected:
116 /*---------------------------------------------------------------------*/
117 /*! \name Destructors */
118 /*! \{ */
120 SharePtrGraphOp(const char* name = "SharePtr");
121 virtual ~SharePtrGraphOp(void );
123 /*! \} */
124 /*========================== PRIVATE ================================*/
126 private:
128 virtual Action::ResultE traverseEnter(Node * const node );
129 virtual Action::ResultE traverseLeave(Node * const node,
130 Action::ResultE res );
132 typedef std::set<UInt32 > FCIdSet;
133 typedef FCIdSet::iterator FCIdSetIt;
134 typedef FCIdSet::const_iterator FCIdSetConstIt;
136 typedef std::set<FieldContainerUnrecPtr> FCSet;
137 typedef FCSet::iterator FCSetIt;
139 typedef std::map<UInt32, FCSet > FCTypeMap;
140 typedef FCTypeMap::iterator FCTypeMapIt;
142 typedef std::map<UInt32, UInt32 > ShareCount;
143 typedef ShareCount::iterator ShareCountIt;
145 FieldContainer *shareFC(FieldContainer *fc);
147 bool checkInSet (UInt32 fcTypeId, const FCIdSet &idSet);
148 bool checkIncludeSet(UInt32 fcTypeId );
149 bool checkExcludeSet(UInt32 fcTypeId );
151 FCTypeMap _typeMap;
153 FCIdSet _includeSet;
154 FCIdSet _excludeSet;
156 // FCIdSet _visitedSet;
158 ShareCount _shareCount;
159 Time _totalTime;
160 Time _compareTime;
163 OSG_GEN_MEMOBJPTR(SharePtrGraphOp);
165 OSG_END_NAMESPACE
167 #endif /* _OSGSHAREPTRGRAPHOP_H_ */