1 /*---------------------------------------------------------------------------*\
5 * Copyright (C) 2000-2002 by the OpenSG Forum *
9 * contact: dirk@opensg.org, gerrit.voss@vossg.org, jbehr@zgdv.de *
11 \*---------------------------------------------------------------------------*/
12 /*---------------------------------------------------------------------------*\
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. *
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. *
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. *
28 \*---------------------------------------------------------------------------*/
29 /*---------------------------------------------------------------------------*\
37 \*---------------------------------------------------------------------------*/
39 #ifndef _OSGGEOPUMPGROUP_H_
40 #define _OSGGEOPUMPGROUP_H_
47 #include "OSGBaseTypes.h"
48 #include "OSGBaseFunctions.h"
49 #include "OSGGeometry.h"
55 /*! \brief A group of geometry pumps.
56 \ingroup GrpDrawablesGeometryHelpers
59 class OSG_DRAWABLE_DLLMAPPING GeoPumpGroup
61 /*========================== PUBLIC =================================*/
64 /*---------------------------------------------------------------------*/
65 /*! \name Property Characteristics Handling */
68 typedef UInt32 PropertyCharacteristics
;
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
);
97 /*---------------------------------------------------------------------*/
98 /*! \name Pump Types */
101 typedef void (*GeoPump
) (
103 const GeoIntegralProperty
*lengths
,
104 const GeoIntegralProperty
*types
,
105 const Geometry::MFPropertiesType
*prop
,
106 const Geometry::MFPropIndicesType
*propIdx
,
109 typedef bool (*SetupGeoPump
)(
111 const GeoIntegralProperty
*lengths
,
112 const GeoIntegralProperty
*types
,
113 const Geometry::MFPropertiesType
*prop
,
114 const Geometry::MFPropIndicesType
*propIdx
,
117 typedef bool (*ShutdownGeoPump
)(
119 const GeoIntegralProperty
*lengths
,
120 const GeoIntegralProperty
*types
,
121 const Geometry::MFPropertiesType
*prop
,
122 const Geometry::MFPropIndicesType
*propIdx
);
124 typedef void (*GeoDrawPump
) (
126 const GeoIntegralProperty
*lengths
,
127 const GeoIntegralProperty
*types
,
128 const Geometry::MFPropertiesType
*prop
,
129 const Geometry::MFPropIndicesType
*propIdx
,
134 SetupGeoPump setupPump
;
135 GeoDrawPump drawPump
;
136 ShutdownGeoPump shutdownPump
;
140 /*---------------------------------------------------------------------*/
141 /*! \name Global Get */
144 static GeoPump
findGeoPump (DrawEnv
*pEnv
,
145 PropertyCharacteristics acset
);
147 static SplitGeoPump
findSplitGeoPump(DrawEnv
*pEnv
,
148 PropertyCharacteristics acset
);
151 /*---------------------------------------------------------------------*/
152 /*! \name Pump Group Handling */
155 static inline std::vector
<GeoPumpGroup
*> &getActiveGroups(void);
158 /*========================= PROTECTED ===============================*/
162 /*---------------------------------------------------------------------*/
163 /*! \name Single Group Get */
166 virtual GeoPump
getGeoPump (DrawEnv
*pEnv
,
167 PropertyCharacteristics acset
) = 0;
169 virtual SplitGeoPump
getSplitGeoPump(DrawEnv
*pEnv
,
170 PropertyCharacteristics acset
);
173 /*---------------------------------------------------------------------*/
175 virtual ~GeoPumpGroup(void);
177 /*========================== PRIVATE ================================*/
181 static std::vector
<GeoPumpGroup
*> *_activeGroups
;
183 static InitFuncWrapper actInit
;
185 static bool initActiveGroups (void);
186 static bool terminateActiveGroups(void);
191 #include "OSGGeoPumpGroup.inl"
193 #endif /* _OSGGEOPUMPGROUP_H_ */