fixed: auto_ptr -> unique_ptr
[opensg.git] / Source / System / State / Shader / Chunks / OSGShaderExecutableVarChunkBase.h
blob2d776cd4954072427afec1af22f3731cb62acbcc
1 /*---------------------------------------------------------------------------*\
2 * OpenSG *
3 * *
4 * *
5 * Copyright (C) 2000-2013 by the OpenSG Forum *
6 * *
7 * www.opensg.org *
8 * *
9 * contact: dirk@opensg.org, gerrit.voss@vossg.org, carsten_neumann@gmx.net *
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 /*****************************************************************************\
40 *****************************************************************************
41 ** **
42 ** This file is automatically generated. **
43 ** **
44 ** Any changes made to this file WILL be lost when it is **
45 ** regenerated, which can become necessary at any time. **
46 ** **
47 ** Do not change this file, changes should be done in the derived **
48 ** class ShaderExecutableVarChunk
49 ** **
50 *****************************************************************************
51 \*****************************************************************************/
54 #ifndef _OSGSHADEREXECUTABLEVARCHUNKBASE_H_
55 #define _OSGSHADEREXECUTABLEVARCHUNKBASE_H_
56 #ifdef __sgi
57 #pragma once
58 #endif
61 #include "OSGConfig.h"
62 #include "OSGSystemDef.h"
64 //#include "OSGBaseTypes.h"
66 #include "OSGStateChunk.h" // Parent
68 #include "OSGShaderProgramVariableChunkFields.h" // ProgramVarChunks type
69 #include "OSGShaderProgramVariablesFields.h" // Variables type
70 #include "OSGSysFields.h" // VariableLocations type
72 #include "OSGShaderExecutableVarChunkFields.h"
74 OSG_BEGIN_NAMESPACE
77 class ShaderExecutableVarChunk;
79 //! \brief ShaderExecutableVarChunk Base Class.
81 class OSG_SYSTEM_DLLMAPPING ShaderExecutableVarChunkBase : public StateChunk
83 public:
85 typedef StateChunk Inherited;
86 typedef StateChunk ParentContainer;
88 typedef Inherited::TypeObject TypeObject;
89 typedef TypeObject::InitPhase InitPhase;
91 OSG_GEN_INTERNALPTR(ShaderExecutableVarChunk);
93 /*========================== PUBLIC =================================*/
95 public:
97 enum
99 ProgramVarChunksFieldId = Inherited::NextFieldId,
100 VariablesFieldId = ProgramVarChunksFieldId + 1,
101 VariableLocationsFieldId = VariablesFieldId + 1,
102 ActiveShaderFieldId = VariableLocationsFieldId + 1,
103 NextFieldId = ActiveShaderFieldId + 1
106 static const OSG::BitVector ProgramVarChunksFieldMask =
107 (TypeTraits<BitVector>::One << ProgramVarChunksFieldId);
108 static const OSG::BitVector VariablesFieldMask =
109 (TypeTraits<BitVector>::One << VariablesFieldId);
110 static const OSG::BitVector VariableLocationsFieldMask =
111 (TypeTraits<BitVector>::One << VariableLocationsFieldId);
112 static const OSG::BitVector ActiveShaderFieldMask =
113 (TypeTraits<BitVector>::One << ActiveShaderFieldId);
114 static const OSG::BitVector NextFieldMask =
115 (TypeTraits<BitVector>::One << NextFieldId);
117 typedef MFUncountedShaderProgramVariableChunkPtr MFProgramVarChunksType;
118 typedef SFUnrecChildShaderProgramVariablesPtr SFVariablesType;
119 typedef MFInt32 MFVariableLocationsType;
120 typedef SFUInt32 SFActiveShaderType;
122 /*---------------------------------------------------------------------*/
123 /*! \name Class Get */
124 /*! \{ */
126 static FieldContainerType &getClassType (void);
127 static UInt32 getClassTypeId (void);
128 static UInt16 getClassGroupId(void);
130 /*! \} */
131 /*---------------------------------------------------------------------*/
132 /*! \name FieldContainer Get */
133 /*! \{ */
135 virtual FieldContainerType &getType (void);
136 virtual const FieldContainerType &getType (void) const;
138 virtual UInt32 getContainerSize(void) const;
140 /*! \} */
141 /*---------------------------------------------------------------------*/
142 /*! \name Field Get */
143 /*! \{ */
145 const SFUnrecChildShaderProgramVariablesPtr *getSFVariables (void) const;
146 SFUnrecChildShaderProgramVariablesPtr *editSFVariables (void);
149 ShaderProgramVariables * getVariables (void) const;
151 /*! \} */
152 /*---------------------------------------------------------------------*/
153 /*! \name Field Set */
154 /*! \{ */
156 void setVariables (ShaderProgramVariables * const value);
158 /*! \} */
159 /*---------------------------------------------------------------------*/
160 /*! \name Ptr Field Set */
161 /*! \{ */
163 /*! \} */
164 /*---------------------------------------------------------------------*/
165 /*! \name Ptr MField Set */
166 /*! \{ */
168 /*! \} */
169 /*---------------------------------------------------------------------*/
170 /*! \name Binary Access */
171 /*! \{ */
173 virtual SizeT getBinSize (ConstFieldMaskArg whichField);
174 virtual void copyToBin (BinaryDataHandler &pMem,
175 ConstFieldMaskArg whichField);
176 virtual void copyFromBin(BinaryDataHandler &pMem,
177 ConstFieldMaskArg whichField);
180 /*! \} */
181 /*---------------------------------------------------------------------*/
182 /*! \name Construction */
183 /*! \{ */
185 static ShaderExecutableVarChunkTransitPtr create (void);
186 static ShaderExecutableVarChunk *createEmpty (void);
188 static ShaderExecutableVarChunkTransitPtr createLocal (
189 BitVector bFlags = FCLocal::All);
191 static ShaderExecutableVarChunk *createEmptyLocal(
192 BitVector bFlags = FCLocal::All);
194 static ShaderExecutableVarChunkTransitPtr createDependent (BitVector bFlags);
196 /*! \} */
197 /*---------------------------------------------------------------------*/
198 /*! \name Copy */
199 /*! \{ */
201 virtual FieldContainerTransitPtr shallowCopy (void) const;
202 virtual FieldContainerTransitPtr shallowCopyLocal(
203 BitVector bFlags = FCLocal::All) const;
204 virtual FieldContainerTransitPtr shallowCopyDependent(
205 BitVector bFlags) const;
207 /*! \} */
208 /*========================= PROTECTED ===============================*/
210 protected:
212 static TypeObject _type;
214 static void classDescInserter(TypeObject &oType);
215 static const Char8 *getClassname (void );
217 /*---------------------------------------------------------------------*/
218 /*! \name Fields */
219 /*! \{ */
221 MFUncountedShaderProgramVariableChunkPtr _mfProgramVarChunks;
222 SFUnrecChildShaderProgramVariablesPtr _sfVariables;
223 MFInt32 _mfVariableLocations;
224 SFUInt32 _sfActiveShader;
226 /*! \} */
227 /*---------------------------------------------------------------------*/
228 /*! \name Constructors */
229 /*! \{ */
231 ShaderExecutableVarChunkBase(void);
232 ShaderExecutableVarChunkBase(const ShaderExecutableVarChunkBase &source);
234 /*! \} */
235 /*---------------------------------------------------------------------*/
236 /*! \name Destructors */
237 /*! \{ */
239 virtual ~ShaderExecutableVarChunkBase(void);
241 /*! \} */
242 /*---------------------------------------------------------------------*/
243 /*! \name onCreate */
244 /*! \{ */
246 void onCreate(const ShaderExecutableVarChunk *source = NULL);
248 /*! \} */
249 /*---------------------------------------------------------------------*/
250 /*! \name Child linking */
251 /*! \{ */
253 virtual bool unlinkChild(FieldContainer * const pChild,
254 UInt16 const childFieldId);
256 /*! \} */
257 /*---------------------------------------------------------------------*/
258 /*! \name Generic Field Access */
259 /*! \{ */
261 GetFieldHandlePtr getHandleProgramVarChunks (void) const;
262 EditFieldHandlePtr editHandleProgramVarChunks(void);
263 GetFieldHandlePtr getHandleVariables (void) const;
264 EditFieldHandlePtr editHandleVariables (void);
265 GetFieldHandlePtr getHandleVariableLocations (void) const;
266 EditFieldHandlePtr editHandleVariableLocations(void);
267 GetFieldHandlePtr getHandleActiveShader (void) const;
268 EditFieldHandlePtr editHandleActiveShader (void);
270 /*! \} */
271 /*---------------------------------------------------------------------*/
272 /*! \name Field Get */
273 /*! \{ */
276 MFInt32 *editMFVariableLocations(void);
277 const MFInt32 *getMFVariableLocations (void) const;
279 SFUInt32 *editSFActiveShader (void);
280 const SFUInt32 *getSFActiveShader (void) const;
283 MFInt32 ::reference editVariableLocations(const UInt32 index);
284 Int32 getVariableLocations (const UInt32 index) const;
286 UInt32 &editActiveShader (void);
287 UInt32 getActiveShader (void) const;
289 /*! \} */
290 /*---------------------------------------------------------------------*/
291 /*! \name Field Set */
292 /*! \{ */
294 void setActiveShader (const UInt32 value);
296 /*! \} */
297 /*---------------------------------------------------------------------*/
298 /*! \name Ptr MField Set */
299 /*! \{ */
301 /*! \} */
302 /*---------------------------------------------------------------------*/
303 /*! \name Sync */
304 /*! \{ */
306 #ifdef OSG_MT_CPTR_ASPECT
307 virtual void execSyncV( FieldContainer &oFrom,
308 ConstFieldMaskArg whichField,
309 AspectOffsetStore &oOffsets,
310 ConstFieldMaskArg syncMode ,
311 const UInt32 uiSyncInfo);
313 void execSync ( ShaderExecutableVarChunkBase *pFrom,
314 ConstFieldMaskArg whichField,
315 AspectOffsetStore &oOffsets,
316 ConstFieldMaskArg syncMode ,
317 const UInt32 uiSyncInfo);
318 #endif
320 /*! \} */
321 /*---------------------------------------------------------------------*/
322 /*! \name Edit */
323 /*! \{ */
325 /*! \} */
326 /*---------------------------------------------------------------------*/
327 /*! \name Aspect Create */
328 /*! \{ */
330 #ifdef OSG_MT_CPTR_ASPECT
331 virtual FieldContainer *createAspectCopy(
332 const FieldContainer *pRefAspect) const;
333 #endif
335 /*! \} */
336 /*---------------------------------------------------------------------*/
337 /*! \name Edit */
338 /*! \{ */
339 /*! \} */
340 /*---------------------------------------------------------------------*/
341 /*! \name Sync */
342 /*! \{ */
344 virtual void resolveLinks(void);
346 /*! \} */
347 /*========================== PRIVATE ================================*/
349 private:
350 /*---------------------------------------------------------------------*/
352 // prohibit default functions (move to 'public' if you need one)
353 void operator =(const ShaderExecutableVarChunkBase &source);
356 typedef ShaderExecutableVarChunkBase *ShaderExecutableVarChunkBaseP;
358 OSG_END_NAMESPACE
360 #endif /* _OSGSHADEREXECUTABLEVARCHUNKBASE_H_ */