fixed: auto_ptr -> unique_ptr
[opensg.git] / Source / System / NodeCores / Drawables / Geometry / Base / OSGGeoPumpGroup.h
blob79d2d588fe8beb348487885b785516f595cb049d
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 _OSGGEOPUMPGROUP_H_
40 #define _OSGGEOPUMPGROUP_H_
41 #ifdef __sgi
42 #pragma once
43 #endif
45 #include "utility"
47 #include "OSGBaseTypes.h"
48 #include "OSGBaseFunctions.h"
49 #include "OSGGeometry.h"
51 OSG_BEGIN_NAMESPACE
53 class Window;
55 /*! \brief A group of geometry pumps.
56 \ingroup GrpDrawablesGeometryHelpers
59 class OSG_DRAWABLE_DLLMAPPING GeoPumpGroup
61 /*========================== PUBLIC =================================*/
62 public:
64 /*---------------------------------------------------------------------*/
65 /*! \name Property Characteristics Handling */
66 /*! \{ */
68 typedef UInt32 PropertyCharacteristics;
70 enum
72 NonIndexed = 0x00000001L,
73 SingleIndexed = 0x00000002L,
74 MultiIndexed = 0x00000004L,
75 IndexMask = 0x00000007L,
77 NonTraditionalProperties = 0x00000008L,
78 // this is actually set at render time dynamically
79 UsesShader = 0x00000010L,
81 AllPropsVAO = 0x00000100L,
82 AllPropIdxVAO = 0x00000200L,
83 AllVAOMask = 0x00000300L
87 static std::string describePropertyCharacteristics(
88 PropertyCharacteristics ac);
90 static PropertyCharacteristics characterizeGeometry(Geometry *geo);
92 static PropertyCharacteristics
93 characterizeGeometry(const Geometry::MFPropertiesType *prop,
94 const Geometry::MFPropIndicesType *propIdx);
96 /*! \} */
97 /*---------------------------------------------------------------------*/
98 /*! \name Pump Types */
99 /*! \{ */
101 typedef void (*GeoPump) (
102 DrawEnv *pEnv,
103 const GeoIntegralProperty *lengths,
104 const GeoIntegralProperty *types,
105 const Geometry::MFPropertiesType *prop,
106 const Geometry::MFPropIndicesType *propIdx,
107 UInt32 uiNumInst);
109 typedef bool (*SetupGeoPump)(
110 DrawEnv *pEnv,
111 const GeoIntegralProperty *lengths,
112 const GeoIntegralProperty *types,
113 const Geometry::MFPropertiesType *prop,
114 const Geometry::MFPropIndicesType *propIdx,
115 bool withFallback);
117 typedef bool (*ShutdownGeoPump)(
118 DrawEnv *pEnv,
119 const GeoIntegralProperty *lengths,
120 const GeoIntegralProperty *types,
121 const Geometry::MFPropertiesType *prop,
122 const Geometry::MFPropIndicesType *propIdx);
124 typedef void (*GeoDrawPump) (
125 DrawEnv *pEnv,
126 const GeoIntegralProperty *lengths,
127 const GeoIntegralProperty *types,
128 const Geometry::MFPropertiesType *prop,
129 const Geometry::MFPropIndicesType *propIdx,
130 UInt32 uiNumInst);
132 struct SplitGeoPump
134 SetupGeoPump setupPump;
135 GeoDrawPump drawPump;
136 ShutdownGeoPump shutdownPump;
139 /*! \} */
140 /*---------------------------------------------------------------------*/
141 /*! \name Global Get */
142 /*! \{ */
144 static GeoPump findGeoPump (DrawEnv *pEnv,
145 PropertyCharacteristics acset);
147 static SplitGeoPump findSplitGeoPump(DrawEnv *pEnv,
148 PropertyCharacteristics acset);
150 /*! \} */
151 /*---------------------------------------------------------------------*/
152 /*! \name Pump Group Handling */
153 /*! \{ */
155 static inline std::vector<GeoPumpGroup*> &getActiveGroups(void);
157 /*! \} */
158 /*========================= PROTECTED ===============================*/
160 protected:
162 /*---------------------------------------------------------------------*/
163 /*! \name Single Group Get */
164 /*! \{ */
166 virtual GeoPump getGeoPump (DrawEnv *pEnv,
167 PropertyCharacteristics acset) = 0;
169 virtual SplitGeoPump getSplitGeoPump(DrawEnv *pEnv,
170 PropertyCharacteristics acset);
172 /*! \} */
173 /*---------------------------------------------------------------------*/
175 virtual ~GeoPumpGroup(void);
177 /*========================== PRIVATE ================================*/
179 private:
181 static std::vector<GeoPumpGroup *> *_activeGroups;
183 static InitFuncWrapper actInit;
185 static bool initActiveGroups (void);
186 static bool terminateActiveGroups(void);
189 OSG_END_NAMESPACE
191 #include "OSGGeoPumpGroup.inl"
193 #endif /* _OSGGEOPUMPGROUP_H_ */