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 ShaderProgramVariableChunk
50 *****************************************************************************
51 \*****************************************************************************/
54 #ifndef _OSGSHADERPROGRAMVARIABLECHUNKBASE_H_
55 #define _OSGSHADERPROGRAMVARIABLECHUNKBASE_H_
61 #include "OSGConfig.h"
62 #include "OSGSystemDef.h"
64 //#include "OSGBaseTypes.h"
66 #include "OSGStateChunk.h" // Parent
68 #include "OSGShaderProgramVariablesFields.h" // Variables type
69 #include "OSGChangedFunctorCallbackFields.h" // DestroyedFunctors type
71 #include "OSGShaderProgramVariableChunkFields.h"
76 class ShaderProgramVariableChunk
;
78 //! \brief ShaderProgramVariableChunk Base Class.
80 class OSG_SYSTEM_DLLMAPPING ShaderProgramVariableChunkBase
: public StateChunk
84 typedef StateChunk Inherited
;
85 typedef StateChunk ParentContainer
;
87 typedef Inherited::TypeObject TypeObject
;
88 typedef TypeObject::InitPhase InitPhase
;
90 OSG_GEN_INTERNALPTR(ShaderProgramVariableChunk
);
92 /*========================== PUBLIC =================================*/
98 VariablesFieldId
= Inherited::NextFieldId
,
99 DestroyedFunctorsFieldId
= VariablesFieldId
+ 1,
100 NextFieldId
= DestroyedFunctorsFieldId
+ 1
103 static const OSG::BitVector VariablesFieldMask
=
104 (TypeTraits
<BitVector
>::One
<< VariablesFieldId
);
105 static const OSG::BitVector DestroyedFunctorsFieldMask
=
106 (TypeTraits
<BitVector
>::One
<< DestroyedFunctorsFieldId
);
107 static const OSG::BitVector NextFieldMask
=
108 (TypeTraits
<BitVector
>::One
<< NextFieldId
);
110 typedef SFUnrecChildShaderProgramVariablesPtr SFVariablesType
;
111 typedef MFChangedFunctorCallback MFDestroyedFunctorsType
;
113 /*---------------------------------------------------------------------*/
114 /*! \name Class Get */
117 static FieldContainerType
&getClassType (void);
118 static UInt32
getClassTypeId (void);
119 static UInt16
getClassGroupId(void);
122 /*---------------------------------------------------------------------*/
123 /*! \name FieldContainer Get */
126 virtual FieldContainerType
&getType (void);
127 virtual const FieldContainerType
&getType (void) const;
129 virtual UInt32
getContainerSize(void) const;
132 /*---------------------------------------------------------------------*/
133 /*! \name Field Get */
136 const SFUnrecChildShaderProgramVariablesPtr
*getSFVariables (void) const;
137 SFUnrecChildShaderProgramVariablesPtr
*editSFVariables (void);
140 ShaderProgramVariables
* getVariables (void) const;
143 /*---------------------------------------------------------------------*/
144 /*! \name Field Set */
147 void setVariables (ShaderProgramVariables
* const value
);
150 /*---------------------------------------------------------------------*/
151 /*! \name Ptr Field Set */
155 /*---------------------------------------------------------------------*/
156 /*! \name Ptr MField Set */
160 /*---------------------------------------------------------------------*/
161 /*! \name Binary Access */
164 virtual SizeT
getBinSize (ConstFieldMaskArg whichField
);
165 virtual void copyToBin (BinaryDataHandler
&pMem
,
166 ConstFieldMaskArg whichField
);
167 virtual void copyFromBin(BinaryDataHandler
&pMem
,
168 ConstFieldMaskArg whichField
);
172 /*---------------------------------------------------------------------*/
173 /*! \name Construction */
176 static ShaderProgramVariableChunkTransitPtr
create (void);
177 static ShaderProgramVariableChunk
*createEmpty (void);
179 static ShaderProgramVariableChunkTransitPtr
createLocal (
180 BitVector bFlags
= FCLocal::All
);
182 static ShaderProgramVariableChunk
*createEmptyLocal(
183 BitVector bFlags
= FCLocal::All
);
185 static ShaderProgramVariableChunkTransitPtr
createDependent (BitVector bFlags
);
188 /*---------------------------------------------------------------------*/
192 virtual FieldContainerTransitPtr
shallowCopy (void) const;
193 virtual FieldContainerTransitPtr
shallowCopyLocal(
194 BitVector bFlags
= FCLocal::All
) const;
195 virtual FieldContainerTransitPtr
shallowCopyDependent(
196 BitVector bFlags
) const;
199 /*========================= PROTECTED ===============================*/
203 static TypeObject _type
;
205 static void classDescInserter(TypeObject
&oType
);
206 static const Char8
*getClassname (void );
208 /*---------------------------------------------------------------------*/
212 SFUnrecChildShaderProgramVariablesPtr _sfVariables
;
213 MFChangedFunctorCallback _mfDestroyedFunctors
;
216 /*---------------------------------------------------------------------*/
217 /*! \name Constructors */
220 ShaderProgramVariableChunkBase(void);
221 ShaderProgramVariableChunkBase(const ShaderProgramVariableChunkBase
&source
);
224 /*---------------------------------------------------------------------*/
225 /*! \name Destructors */
228 virtual ~ShaderProgramVariableChunkBase(void);
231 /*---------------------------------------------------------------------*/
232 /*! \name onCreate */
235 void onCreate(const ShaderProgramVariableChunk
*source
= NULL
);
238 /*---------------------------------------------------------------------*/
239 /*! \name Child linking */
242 virtual bool unlinkChild(FieldContainer
* const pChild
,
243 UInt16
const childFieldId
);
246 /*---------------------------------------------------------------------*/
247 /*! \name Generic Field Access */
250 GetFieldHandlePtr
getHandleVariables (void) const;
251 EditFieldHandlePtr
editHandleVariables (void);
252 GetFieldHandlePtr
getHandleDestroyedFunctors (void) const;
253 EditFieldHandlePtr
editHandleDestroyedFunctors(void);
256 /*---------------------------------------------------------------------*/
260 #ifdef OSG_MT_CPTR_ASPECT
261 virtual void execSyncV( FieldContainer
&oFrom
,
262 ConstFieldMaskArg whichField
,
263 AspectOffsetStore
&oOffsets
,
264 ConstFieldMaskArg syncMode
,
265 const UInt32 uiSyncInfo
);
267 void execSync ( ShaderProgramVariableChunkBase
*pFrom
,
268 ConstFieldMaskArg whichField
,
269 AspectOffsetStore
&oOffsets
,
270 ConstFieldMaskArg syncMode
,
271 const UInt32 uiSyncInfo
);
275 /*---------------------------------------------------------------------*/
280 /*---------------------------------------------------------------------*/
281 /*! \name Aspect Create */
284 #ifdef OSG_MT_CPTR_ASPECT
285 virtual FieldContainer
*createAspectCopy(
286 const FieldContainer
*pRefAspect
) const;
290 /*---------------------------------------------------------------------*/
294 /*---------------------------------------------------------------------*/
298 virtual void resolveLinks(void);
301 /*========================== PRIVATE ================================*/
304 /*---------------------------------------------------------------------*/
306 // prohibit default functions (move to 'public' if you need one)
307 void operator =(const ShaderProgramVariableChunkBase
&source
);
310 typedef ShaderProgramVariableChunkBase
*ShaderProgramVariableChunkBaseP
;
314 #endif /* _OSGSHADERPROGRAMVARIABLECHUNKBASE_H_ */