changed: gcc8 base update
[opensg.git] / Source / System / State / Shader / Base / OSGShaderProgramVariablesBase.h
blob20e500c136b7d0b5fad0386645f44cf0dacbcb69
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 ShaderProgramVariables
49 ** **
50 *****************************************************************************
51 \*****************************************************************************/
54 #ifndef _OSGSHADERPROGRAMVARIABLESBASE_H_
55 #define _OSGSHADERPROGRAMVARIABLESBASE_H_
56 #ifdef __sgi
57 #pragma once
58 #endif
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"
74 OSG_BEGIN_NAMESPACE
77 class ShaderProgramVariables;
79 //! \brief ShaderProgramVariables Base Class.
81 class OSG_SYSTEM_DLLMAPPING ShaderProgramVariablesBase : public Attachment
83 public:
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 =================================*/
95 public:
97 enum
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 */
120 /*! \{ */
122 static FieldContainerType &getClassType (void);
123 static UInt32 getClassTypeId (void);
124 static UInt16 getClassGroupId(void);
126 /*! \} */
127 /*---------------------------------------------------------------------*/
128 /*! \name FieldContainer Get */
129 /*! \{ */
131 virtual FieldContainerType &getType (void);
132 virtual const FieldContainerType &getType (void) const;
134 virtual UInt32 getContainerSize(void) const;
136 /*! \} */
137 /*---------------------------------------------------------------------*/
138 /*! \name Field Get */
139 /*! \{ */
142 MFUInt8 *editMFVariableChanged(void);
143 const MFUInt8 *getMFVariableChanged (void) const;
146 MFUInt8 ::reference editVariableChanged(const UInt32 index);
147 UInt8 getVariableChanged (const UInt32 index) const;
149 /*! \} */
150 /*---------------------------------------------------------------------*/
151 /*! \name Field Set */
152 /*! \{ */
155 /*! \} */
156 /*---------------------------------------------------------------------*/
157 /*! \name Ptr Field Set */
158 /*! \{ */
160 /*! \} */
161 /*---------------------------------------------------------------------*/
162 /*! \name Ptr MField Set */
163 /*! \{ */
165 /*! \} */
166 /*---------------------------------------------------------------------*/
167 /*! \name Binary Access */
168 /*! \{ */
170 virtual SizeT getBinSize (ConstFieldMaskArg whichField);
171 virtual void copyToBin (BinaryDataHandler &pMem,
172 ConstFieldMaskArg whichField);
173 virtual void copyFromBin(BinaryDataHandler &pMem,
174 ConstFieldMaskArg whichField);
177 /*! \} */
178 /*---------------------------------------------------------------------*/
179 /*! \name Construction */
180 /*! \{ */
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);
193 /*! \} */
194 /*---------------------------------------------------------------------*/
195 /*! \name Copy */
196 /*! \{ */
198 virtual FieldContainerTransitPtr shallowCopy (void) const;
199 virtual FieldContainerTransitPtr shallowCopyLocal(
200 BitVector bFlags = FCLocal::All) const;
201 virtual FieldContainerTransitPtr shallowCopyDependent(
202 BitVector bFlags) const;
204 /*! \} */
205 /*========================= PROTECTED ===============================*/
207 protected:
209 static TypeObject _type;
211 static void classDescInserter(TypeObject &oType);
212 static const Char8 *getClassname (void );
214 /*---------------------------------------------------------------------*/
215 /*! \name Fields */
216 /*! \{ */
218 MFUnrecShaderValueVariablePtr _mfVariables;
219 MFUnrecChildShaderProcVariablePtr _mfProceduralVariables;
220 MFUInt8 _mfVariableChanged;
222 /*! \} */
223 /*---------------------------------------------------------------------*/
224 /*! \name Constructors */
225 /*! \{ */
227 ShaderProgramVariablesBase(void);
228 ShaderProgramVariablesBase(const ShaderProgramVariablesBase &source);
230 /*! \} */
231 /*---------------------------------------------------------------------*/
232 /*! \name Destructors */
233 /*! \{ */
235 virtual ~ShaderProgramVariablesBase(void);
237 /*! \} */
238 /*---------------------------------------------------------------------*/
239 /*! \name onCreate */
240 /*! \{ */
242 void onCreate(const ShaderProgramVariables *source = NULL);
244 /*! \} */
245 /*---------------------------------------------------------------------*/
246 /*! \name Child linking */
247 /*! \{ */
249 virtual bool unlinkChild(FieldContainer * const pChild,
250 UInt16 const childFieldId);
252 /*! \} */
253 /*---------------------------------------------------------------------*/
254 /*! \name Generic Field Access */
255 /*! \{ */
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);
264 /*! \} */
265 /*---------------------------------------------------------------------*/
266 /*! \name Field Get */
267 /*! \{ */
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;
277 /*! \} */
278 /*---------------------------------------------------------------------*/
279 /*! \name Field Set */
280 /*! \{ */
283 /*! \} */
284 /*---------------------------------------------------------------------*/
285 /*! \name Ptr MField Set */
286 /*! \{ */
288 /*! \} */
289 /*---------------------------------------------------------------------*/
290 /*! \name Sync */
291 /*! \{ */
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);
305 #endif
307 /*! \} */
308 /*---------------------------------------------------------------------*/
309 /*! \name Edit */
310 /*! \{ */
312 /*! \} */
313 /*---------------------------------------------------------------------*/
314 /*! \name Aspect Create */
315 /*! \{ */
317 #ifdef OSG_MT_CPTR_ASPECT
318 virtual FieldContainer *createAspectCopy(
319 const FieldContainer *pRefAspect) const;
320 #endif
322 /*! \} */
323 /*---------------------------------------------------------------------*/
324 /*! \name Edit */
325 /*! \{ */
326 /*! \} */
327 /*---------------------------------------------------------------------*/
328 /*! \name Sync */
329 /*! \{ */
331 virtual void resolveLinks(void);
333 /*! \} */
334 /*========================== PRIVATE ================================*/
336 private:
337 /*---------------------------------------------------------------------*/
339 // prohibit default functions (move to 'public' if you need one)
340 void operator =(const ShaderProgramVariablesBase &source);
343 typedef ShaderProgramVariablesBase *ShaderProgramVariablesBaseP;
345 OSG_END_NAMESPACE
347 #endif /* _OSGSHADERPROGRAMVARIABLESBASE_H_ */