1 /*---------------------------------------------------------------------------*\
5 * Copyright (C) 2000-2013 by the OpenSG Forum *
9 * contact: dirk@opensg.org, gerrit.voss@vossg.org, carsten_neumann@gmx.net *
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 /*****************************************************************************\
40 *****************************************************************************
42 ** This file is automatically generated. **
44 ** Any changes made to this file WILL be lost when it is **
45 ** regenerated, which can become necessary at any time. **
47 ** Do not change this file, changes should be done in the derived **
48 ** class ShaderExecutableVarChunk
50 *****************************************************************************
51 \*****************************************************************************/
54 #ifndef _OSGSHADEREXECUTABLEVARCHUNKBASE_H_
55 #define _OSGSHADEREXECUTABLEVARCHUNKBASE_H_
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"
77 class ShaderExecutableVarChunk
;
79 //! \brief ShaderExecutableVarChunk Base Class.
81 class OSG_SYSTEM_DLLMAPPING ShaderExecutableVarChunkBase
: public StateChunk
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 =================================*/
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 */
126 static FieldContainerType
&getClassType (void);
127 static UInt32
getClassTypeId (void);
128 static UInt16
getClassGroupId(void);
131 /*---------------------------------------------------------------------*/
132 /*! \name FieldContainer Get */
135 virtual FieldContainerType
&getType (void);
136 virtual const FieldContainerType
&getType (void) const;
138 virtual UInt32
getContainerSize(void) const;
141 /*---------------------------------------------------------------------*/
142 /*! \name Field Get */
145 const SFUnrecChildShaderProgramVariablesPtr
*getSFVariables (void) const;
146 SFUnrecChildShaderProgramVariablesPtr
*editSFVariables (void);
149 ShaderProgramVariables
* getVariables (void) const;
152 /*---------------------------------------------------------------------*/
153 /*! \name Field Set */
156 void setVariables (ShaderProgramVariables
* const value
);
159 /*---------------------------------------------------------------------*/
160 /*! \name Ptr Field Set */
164 /*---------------------------------------------------------------------*/
165 /*! \name Ptr MField Set */
169 /*---------------------------------------------------------------------*/
170 /*! \name Binary Access */
173 virtual SizeT
getBinSize (ConstFieldMaskArg whichField
);
174 virtual void copyToBin (BinaryDataHandler
&pMem
,
175 ConstFieldMaskArg whichField
);
176 virtual void copyFromBin(BinaryDataHandler
&pMem
,
177 ConstFieldMaskArg whichField
);
181 /*---------------------------------------------------------------------*/
182 /*! \name Construction */
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
);
197 /*---------------------------------------------------------------------*/
201 virtual FieldContainerTransitPtr
shallowCopy (void) const;
202 virtual FieldContainerTransitPtr
shallowCopyLocal(
203 BitVector bFlags
= FCLocal::All
) const;
204 virtual FieldContainerTransitPtr
shallowCopyDependent(
205 BitVector bFlags
) const;
208 /*========================= PROTECTED ===============================*/
212 static TypeObject _type
;
214 static void classDescInserter(TypeObject
&oType
);
215 static const Char8
*getClassname (void );
217 /*---------------------------------------------------------------------*/
221 MFUncountedShaderProgramVariableChunkPtr _mfProgramVarChunks
;
222 SFUnrecChildShaderProgramVariablesPtr _sfVariables
;
223 MFInt32 _mfVariableLocations
;
224 SFUInt32 _sfActiveShader
;
227 /*---------------------------------------------------------------------*/
228 /*! \name Constructors */
231 ShaderExecutableVarChunkBase(void);
232 ShaderExecutableVarChunkBase(const ShaderExecutableVarChunkBase
&source
);
235 /*---------------------------------------------------------------------*/
236 /*! \name Destructors */
239 virtual ~ShaderExecutableVarChunkBase(void);
242 /*---------------------------------------------------------------------*/
243 /*! \name onCreate */
246 void onCreate(const ShaderExecutableVarChunk
*source
= NULL
);
249 /*---------------------------------------------------------------------*/
250 /*! \name Child linking */
253 virtual bool unlinkChild(FieldContainer
* const pChild
,
254 UInt16
const childFieldId
);
257 /*---------------------------------------------------------------------*/
258 /*! \name Generic Field Access */
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);
271 /*---------------------------------------------------------------------*/
272 /*! \name Field Get */
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;
290 /*---------------------------------------------------------------------*/
291 /*! \name Field Set */
294 void setActiveShader (const UInt32 value
);
297 /*---------------------------------------------------------------------*/
298 /*! \name Ptr MField Set */
302 /*---------------------------------------------------------------------*/
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
);
321 /*---------------------------------------------------------------------*/
326 /*---------------------------------------------------------------------*/
327 /*! \name Aspect Create */
330 #ifdef OSG_MT_CPTR_ASPECT
331 virtual FieldContainer
*createAspectCopy(
332 const FieldContainer
*pRefAspect
) const;
336 /*---------------------------------------------------------------------*/
340 /*---------------------------------------------------------------------*/
344 virtual void resolveLinks(void);
347 /*========================== PRIVATE ================================*/
350 /*---------------------------------------------------------------------*/
352 // prohibit default functions (move to 'public' if you need one)
353 void operator =(const ShaderExecutableVarChunkBase
&source
);
356 typedef ShaderExecutableVarChunkBase
*ShaderExecutableVarChunkBaseP
;
360 #endif /* _OSGSHADEREXECUTABLEVARCHUNKBASE_H_ */