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 ShaderProgramVariables
50 *****************************************************************************
51 \*****************************************************************************/
54 #ifndef _OSGSHADERPROGRAMVARIABLESBASE_H_
55 #define _OSGSHADERPROGRAMVARIABLESBASE_H_
61 #include "OSGConfig.h"
62 #include "OSGSystemDef.h"
64 //#include "OSGBaseTypes.h"
66 #include "OSGAttachment.h" // Parent
68 #include "OSGShaderValueVariableFields.h" // Variables type
69 #include "OSGShaderProcVariableFields.h" // ProceduralVariables type
70 #include "OSGSysFields.h" // VariableChanged type
72 #include "OSGShaderProgramVariablesFields.h"
77 class ShaderProgramVariables
;
79 //! \brief ShaderProgramVariables Base Class.
81 class OSG_SYSTEM_DLLMAPPING ShaderProgramVariablesBase
: public Attachment
85 typedef Attachment Inherited
;
86 typedef Attachment ParentContainer
;
88 typedef Inherited::TypeObject TypeObject
;
89 typedef TypeObject::InitPhase InitPhase
;
91 OSG_GEN_INTERNALPTR(ShaderProgramVariables
);
93 /*========================== PUBLIC =================================*/
99 VariablesFieldId
= Inherited::NextFieldId
,
100 ProceduralVariablesFieldId
= VariablesFieldId
+ 1,
101 VariableChangedFieldId
= ProceduralVariablesFieldId
+ 1,
102 NextFieldId
= VariableChangedFieldId
+ 1
105 static const OSG::BitVector VariablesFieldMask
=
106 (TypeTraits
<BitVector
>::One
<< VariablesFieldId
);
107 static const OSG::BitVector ProceduralVariablesFieldMask
=
108 (TypeTraits
<BitVector
>::One
<< ProceduralVariablesFieldId
);
109 static const OSG::BitVector VariableChangedFieldMask
=
110 (TypeTraits
<BitVector
>::One
<< VariableChangedFieldId
);
111 static const OSG::BitVector NextFieldMask
=
112 (TypeTraits
<BitVector
>::One
<< NextFieldId
);
114 typedef MFUnrecShaderValueVariablePtr MFVariablesType
;
115 typedef MFUnrecChildShaderProcVariablePtr MFProceduralVariablesType
;
116 typedef MFUInt8 MFVariableChangedType
;
118 /*---------------------------------------------------------------------*/
119 /*! \name Class Get */
122 static FieldContainerType
&getClassType (void);
123 static UInt32
getClassTypeId (void);
124 static UInt16
getClassGroupId(void);
127 /*---------------------------------------------------------------------*/
128 /*! \name FieldContainer Get */
131 virtual FieldContainerType
&getType (void);
132 virtual const FieldContainerType
&getType (void) const;
134 virtual UInt32
getContainerSize(void) const;
137 /*---------------------------------------------------------------------*/
138 /*! \name Field Get */
142 MFUInt8
*editMFVariableChanged(void);
143 const MFUInt8
*getMFVariableChanged (void) const;
146 MFUInt8 ::reference
editVariableChanged(const UInt32 index
);
147 UInt8
getVariableChanged (const UInt32 index
) const;
150 /*---------------------------------------------------------------------*/
151 /*! \name Field Set */
156 /*---------------------------------------------------------------------*/
157 /*! \name Ptr Field Set */
161 /*---------------------------------------------------------------------*/
162 /*! \name Ptr MField Set */
166 /*---------------------------------------------------------------------*/
167 /*! \name Binary Access */
170 virtual SizeT
getBinSize (ConstFieldMaskArg whichField
);
171 virtual void copyToBin (BinaryDataHandler
&pMem
,
172 ConstFieldMaskArg whichField
);
173 virtual void copyFromBin(BinaryDataHandler
&pMem
,
174 ConstFieldMaskArg whichField
);
178 /*---------------------------------------------------------------------*/
179 /*! \name Construction */
182 static ShaderProgramVariablesTransitPtr
create (void);
183 static ShaderProgramVariables
*createEmpty (void);
185 static ShaderProgramVariablesTransitPtr
createLocal (
186 BitVector bFlags
= FCLocal::All
);
188 static ShaderProgramVariables
*createEmptyLocal(
189 BitVector bFlags
= FCLocal::All
);
191 static ShaderProgramVariablesTransitPtr
createDependent (BitVector bFlags
);
194 /*---------------------------------------------------------------------*/
198 virtual FieldContainerTransitPtr
shallowCopy (void) const;
199 virtual FieldContainerTransitPtr
shallowCopyLocal(
200 BitVector bFlags
= FCLocal::All
) const;
201 virtual FieldContainerTransitPtr
shallowCopyDependent(
202 BitVector bFlags
) const;
205 /*========================= PROTECTED ===============================*/
209 static TypeObject _type
;
211 static void classDescInserter(TypeObject
&oType
);
212 static const Char8
*getClassname (void );
214 /*---------------------------------------------------------------------*/
218 MFUnrecShaderValueVariablePtr _mfVariables
;
219 MFUnrecChildShaderProcVariablePtr _mfProceduralVariables
;
220 MFUInt8 _mfVariableChanged
;
223 /*---------------------------------------------------------------------*/
224 /*! \name Constructors */
227 ShaderProgramVariablesBase(void);
228 ShaderProgramVariablesBase(const ShaderProgramVariablesBase
&source
);
231 /*---------------------------------------------------------------------*/
232 /*! \name Destructors */
235 virtual ~ShaderProgramVariablesBase(void);
238 /*---------------------------------------------------------------------*/
239 /*! \name onCreate */
242 void onCreate(const ShaderProgramVariables
*source
= NULL
);
245 /*---------------------------------------------------------------------*/
246 /*! \name Child linking */
249 virtual bool unlinkChild(FieldContainer
* const pChild
,
250 UInt16
const childFieldId
);
253 /*---------------------------------------------------------------------*/
254 /*! \name Generic Field Access */
257 GetFieldHandlePtr
getHandleVariables (void) const;
258 EditFieldHandlePtr
editHandleVariables (void);
259 GetFieldHandlePtr
getHandleProceduralVariables (void) const;
260 EditFieldHandlePtr
editHandleProceduralVariables(void);
261 GetFieldHandlePtr
getHandleVariableChanged (void) const;
262 EditFieldHandlePtr
editHandleVariableChanged(void);
265 /*---------------------------------------------------------------------*/
266 /*! \name Field Get */
269 const MFUnrecShaderValueVariablePtr
*getMFVariables (void) const;
270 const MFUnrecChildShaderProcVariablePtr
*getMFProceduralVariables (void) const;
273 ShaderValueVariable
* getVariables (const UInt32 index
) const;
275 ShaderProcVariable
* getProceduralVariables(const UInt32 index
) const;
278 /*---------------------------------------------------------------------*/
279 /*! \name Field Set */
284 /*---------------------------------------------------------------------*/
285 /*! \name Ptr MField Set */
289 /*---------------------------------------------------------------------*/
293 #ifdef OSG_MT_CPTR_ASPECT
294 virtual void execSyncV( FieldContainer
&oFrom
,
295 ConstFieldMaskArg whichField
,
296 AspectOffsetStore
&oOffsets
,
297 ConstFieldMaskArg syncMode
,
298 const UInt32 uiSyncInfo
);
300 void execSync ( ShaderProgramVariablesBase
*pFrom
,
301 ConstFieldMaskArg whichField
,
302 AspectOffsetStore
&oOffsets
,
303 ConstFieldMaskArg syncMode
,
304 const UInt32 uiSyncInfo
);
308 /*---------------------------------------------------------------------*/
313 /*---------------------------------------------------------------------*/
314 /*! \name Aspect Create */
317 #ifdef OSG_MT_CPTR_ASPECT
318 virtual FieldContainer
*createAspectCopy(
319 const FieldContainer
*pRefAspect
) const;
323 /*---------------------------------------------------------------------*/
327 /*---------------------------------------------------------------------*/
331 virtual void resolveLinks(void);
334 /*========================== PRIVATE ================================*/
337 /*---------------------------------------------------------------------*/
339 // prohibit default functions (move to 'public' if you need one)
340 void operator =(const ShaderProgramVariablesBase
&source
);
343 typedef ShaderProgramVariablesBase
*ShaderProgramVariablesBaseP
;
347 #endif /* _OSGSHADERPROGRAMVARIABLESBASE_H_ */