fixed: auto_ptr -> unique_ptr
[opensg.git] / Source / System / State / Shader / SHL / OSGSimpleSHLChunkBase.h
blobadb2084c670e421085fa649da8300b8367822107
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 SimpleSHLChunk
49 ** **
50 *****************************************************************************
51 \*****************************************************************************/
54 #ifndef _OSGSIMPLESHLCHUNKBASE_H_
55 #define _OSGSIMPLESHLCHUNKBASE_H_
56 #ifdef __sgi
57 #pragma once
58 #endif
61 #include "OSGConfig.h"
62 #include "OSGSystemDef.h"
64 //#include "OSGBaseTypes.h"
66 #include "OSGShaderProgramChunk.h" // Parent
68 #include "OSGBaseFields.h" // VertexProgram type
69 #include "OSGSysFields.h" // CgFrontEnd type
70 #include "OSGShaderProgramVariablesFields.h" // Variables type
72 #include "OSGSimpleSHLChunkFields.h"
74 OSG_BEGIN_NAMESPACE
77 class SimpleSHLChunk;
79 //! \brief SimpleSHLChunk Base Class.
81 class OSG_SYSTEM_DLLMAPPING SimpleSHLChunkBase : public ShaderProgramChunk
83 public:
85 typedef ShaderProgramChunk Inherited;
86 typedef ShaderProgramChunk ParentContainer;
88 typedef Inherited::TypeObject TypeObject;
89 typedef TypeObject::InitPhase InitPhase;
91 OSG_GEN_INTERNALPTR(SimpleSHLChunk);
93 /*========================== PUBLIC =================================*/
95 public:
97 enum
99 VertexProgramFieldId = Inherited::NextFieldId,
100 TessControlProgramFieldId = VertexProgramFieldId + 1,
101 TessEvaluationProgramFieldId = TessControlProgramFieldId + 1,
102 GeometryProgramFieldId = TessEvaluationProgramFieldId + 1,
103 FragmentProgramFieldId = GeometryProgramFieldId + 1,
104 CgFrontEndFieldId = FragmentProgramFieldId + 1,
105 VariablesFieldId = CgFrontEndFieldId + 1,
106 VariableLocationsFieldId = VariablesFieldId + 1,
107 ProceduralVariableLocationsFieldId = VariableLocationsFieldId + 1,
108 GLIdFieldId = ProceduralVariableLocationsFieldId + 1,
109 PointSizeFieldId = GLIdFieldId + 1,
110 NextFieldId = PointSizeFieldId + 1
113 static const OSG::BitVector VertexProgramFieldMask =
114 (TypeTraits<BitVector>::One << VertexProgramFieldId);
115 static const OSG::BitVector TessControlProgramFieldMask =
116 (TypeTraits<BitVector>::One << TessControlProgramFieldId);
117 static const OSG::BitVector TessEvaluationProgramFieldMask =
118 (TypeTraits<BitVector>::One << TessEvaluationProgramFieldId);
119 static const OSG::BitVector GeometryProgramFieldMask =
120 (TypeTraits<BitVector>::One << GeometryProgramFieldId);
121 static const OSG::BitVector FragmentProgramFieldMask =
122 (TypeTraits<BitVector>::One << FragmentProgramFieldId);
123 static const OSG::BitVector CgFrontEndFieldMask =
124 (TypeTraits<BitVector>::One << CgFrontEndFieldId);
125 static const OSG::BitVector VariablesFieldMask =
126 (TypeTraits<BitVector>::One << VariablesFieldId);
127 static const OSG::BitVector VariableLocationsFieldMask =
128 (TypeTraits<BitVector>::One << VariableLocationsFieldId);
129 static const OSG::BitVector ProceduralVariableLocationsFieldMask =
130 (TypeTraits<BitVector>::One << ProceduralVariableLocationsFieldId);
131 static const OSG::BitVector GLIdFieldMask =
132 (TypeTraits<BitVector>::One << GLIdFieldId);
133 static const OSG::BitVector PointSizeFieldMask =
134 (TypeTraits<BitVector>::One << PointSizeFieldId);
135 static const OSG::BitVector NextFieldMask =
136 (TypeTraits<BitVector>::One << NextFieldId);
138 typedef SFString SFVertexProgramType;
139 typedef SFString SFTessControlProgramType;
140 typedef SFString SFTessEvaluationProgramType;
141 typedef SFString SFGeometryProgramType;
142 typedef SFString SFFragmentProgramType;
143 typedef SFBool SFCgFrontEndType;
144 typedef SFUnrecChildShaderProgramVariablesPtr SFVariablesType;
145 typedef MFInt32 MFVariableLocationsType;
146 typedef MFInt32 MFProceduralVariableLocationsType;
147 typedef SFUInt32 SFGLIdType;
148 typedef SFBool SFPointSizeType;
150 /*---------------------------------------------------------------------*/
151 /*! \name Class Get */
152 /*! \{ */
154 static FieldContainerType &getClassType (void);
155 static UInt32 getClassTypeId (void);
156 static UInt16 getClassGroupId(void);
158 /*! \} */
159 /*---------------------------------------------------------------------*/
160 /*! \name FieldContainer Get */
161 /*! \{ */
163 virtual FieldContainerType &getType (void);
164 virtual const FieldContainerType &getType (void) const;
166 virtual UInt32 getContainerSize(void) const;
168 /*! \} */
169 /*---------------------------------------------------------------------*/
170 /*! \name Field Get */
171 /*! \{ */
174 SFString *editSFVertexProgram (void);
175 const SFString *getSFVertexProgram (void) const;
177 SFString *editSFTessControlProgram(void);
178 const SFString *getSFTessControlProgram (void) const;
180 SFString *editSFTessEvaluationProgram(void);
181 const SFString *getSFTessEvaluationProgram (void) const;
183 SFString *editSFGeometryProgram(void);
184 const SFString *getSFGeometryProgram (void) const;
186 SFString *editSFFragmentProgram(void);
187 const SFString *getSFFragmentProgram (void) const;
189 SFBool *editSFCgFrontEnd (void);
190 const SFBool *getSFCgFrontEnd (void) const;
191 const SFUnrecChildShaderProgramVariablesPtr *getSFVariables (void) const;
192 SFUnrecChildShaderProgramVariablesPtr *editSFVariables (void);
194 SFUInt32 *editSFGLId (void);
195 const SFUInt32 *getSFGLId (void) const;
197 SFBool *editSFPointSize (void);
198 const SFBool *getSFPointSize (void) const;
201 std::string &editVertexProgram (void);
202 const std::string &getVertexProgram (void) const;
204 std::string &editTessControlProgram(void);
205 const std::string &getTessControlProgram (void) const;
207 std::string &editTessEvaluationProgram(void);
208 const std::string &getTessEvaluationProgram (void) const;
210 std::string &editGeometryProgram(void);
211 const std::string &getGeometryProgram (void) const;
213 std::string &editFragmentProgram(void);
214 const std::string &getFragmentProgram (void) const;
216 bool &editCgFrontEnd (void);
217 bool getCgFrontEnd (void) const;
219 ShaderProgramVariables * getVariables (void) const;
221 UInt32 &editGLId (void);
222 UInt32 getGLId (void) const;
224 bool &editPointSize (void);
225 bool getPointSize (void) const;
227 /*! \} */
228 /*---------------------------------------------------------------------*/
229 /*! \name Field Set */
230 /*! \{ */
232 void setVertexProgram (const std::string &value);
233 void setTessControlProgram(const std::string &value);
234 void setTessEvaluationProgram(const std::string &value);
235 void setGeometryProgram(const std::string &value);
236 void setFragmentProgram(const std::string &value);
237 void setCgFrontEnd (const bool value);
238 void setVariables (ShaderProgramVariables * const value);
239 void setGLId (const UInt32 value);
240 void setPointSize (const bool value);
242 /*! \} */
243 /*---------------------------------------------------------------------*/
244 /*! \name Ptr Field Set */
245 /*! \{ */
247 /*! \} */
248 /*---------------------------------------------------------------------*/
249 /*! \name Ptr MField Set */
250 /*! \{ */
252 /*! \} */
253 /*---------------------------------------------------------------------*/
254 /*! \name Binary Access */
255 /*! \{ */
257 virtual SizeT getBinSize (ConstFieldMaskArg whichField);
258 virtual void copyToBin (BinaryDataHandler &pMem,
259 ConstFieldMaskArg whichField);
260 virtual void copyFromBin(BinaryDataHandler &pMem,
261 ConstFieldMaskArg whichField);
264 /*! \} */
265 /*---------------------------------------------------------------------*/
266 /*! \name Construction */
267 /*! \{ */
269 static SimpleSHLChunkTransitPtr create (void);
270 static SimpleSHLChunk *createEmpty (void);
272 static SimpleSHLChunkTransitPtr createLocal (
273 BitVector bFlags = FCLocal::All);
275 static SimpleSHLChunk *createEmptyLocal(
276 BitVector bFlags = FCLocal::All);
278 static SimpleSHLChunkTransitPtr createDependent (BitVector bFlags);
280 /*! \} */
281 /*---------------------------------------------------------------------*/
282 /*! \name Copy */
283 /*! \{ */
285 virtual FieldContainerTransitPtr shallowCopy (void) const;
286 virtual FieldContainerTransitPtr shallowCopyLocal(
287 BitVector bFlags = FCLocal::All) const;
288 virtual FieldContainerTransitPtr shallowCopyDependent(
289 BitVector bFlags) const;
291 /*! \} */
292 /*========================= PROTECTED ===============================*/
294 protected:
296 static TypeObject _type;
298 static void classDescInserter(TypeObject &oType);
299 static const Char8 *getClassname (void );
301 /*---------------------------------------------------------------------*/
302 /*! \name Fields */
303 /*! \{ */
305 SFString _sfVertexProgram;
306 SFString _sfTessControlProgram;
307 SFString _sfTessEvaluationProgram;
308 SFString _sfGeometryProgram;
309 SFString _sfFragmentProgram;
310 SFBool _sfCgFrontEnd;
311 SFUnrecChildShaderProgramVariablesPtr _sfVariables;
312 MFInt32 _mfVariableLocations;
313 MFInt32 _mfProceduralVariableLocations;
314 SFUInt32 _sfGLId;
315 SFBool _sfPointSize;
317 /*! \} */
318 /*---------------------------------------------------------------------*/
319 /*! \name Constructors */
320 /*! \{ */
322 SimpleSHLChunkBase(void);
323 SimpleSHLChunkBase(const SimpleSHLChunkBase &source);
325 /*! \} */
326 /*---------------------------------------------------------------------*/
327 /*! \name Destructors */
328 /*! \{ */
330 virtual ~SimpleSHLChunkBase(void);
332 /*! \} */
333 /*---------------------------------------------------------------------*/
334 /*! \name onCreate */
335 /*! \{ */
337 void onCreate(const SimpleSHLChunk *source = NULL);
339 /*! \} */
340 /*---------------------------------------------------------------------*/
341 /*! \name Child linking */
342 /*! \{ */
344 virtual bool unlinkChild(FieldContainer * const pChild,
345 UInt16 const childFieldId);
347 /*! \} */
348 /*---------------------------------------------------------------------*/
349 /*! \name Generic Field Access */
350 /*! \{ */
352 GetFieldHandlePtr getHandleVertexProgram (void) const;
353 EditFieldHandlePtr editHandleVertexProgram (void);
354 GetFieldHandlePtr getHandleTessControlProgram (void) const;
355 EditFieldHandlePtr editHandleTessControlProgram(void);
356 GetFieldHandlePtr getHandleTessEvaluationProgram (void) const;
357 EditFieldHandlePtr editHandleTessEvaluationProgram(void);
358 GetFieldHandlePtr getHandleGeometryProgram (void) const;
359 EditFieldHandlePtr editHandleGeometryProgram(void);
360 GetFieldHandlePtr getHandleFragmentProgram (void) const;
361 EditFieldHandlePtr editHandleFragmentProgram(void);
362 GetFieldHandlePtr getHandleCgFrontEnd (void) const;
363 EditFieldHandlePtr editHandleCgFrontEnd (void);
364 GetFieldHandlePtr getHandleVariables (void) const;
365 EditFieldHandlePtr editHandleVariables (void);
366 GetFieldHandlePtr getHandleVariableLocations (void) const;
367 EditFieldHandlePtr editHandleVariableLocations(void);
368 GetFieldHandlePtr getHandleProceduralVariableLocations (void) const;
369 EditFieldHandlePtr editHandleProceduralVariableLocations(void);
370 GetFieldHandlePtr getHandleGLId (void) const;
371 EditFieldHandlePtr editHandleGLId (void);
372 GetFieldHandlePtr getHandlePointSize (void) const;
373 EditFieldHandlePtr editHandlePointSize (void);
375 /*! \} */
376 /*---------------------------------------------------------------------*/
377 /*! \name Field Get */
378 /*! \{ */
381 MFInt32 *editMFVariableLocations(void);
382 const MFInt32 *getMFVariableLocations (void) const;
384 MFInt32 *editMFProceduralVariableLocations(void);
385 const MFInt32 *getMFProceduralVariableLocations (void) const;
388 MFInt32 ::reference editVariableLocations(const UInt32 index);
389 Int32 getVariableLocations (const UInt32 index) const;
391 MFInt32 ::reference editProceduralVariableLocations(const UInt32 index);
392 Int32 getProceduralVariableLocations (const UInt32 index) const;
394 /*! \} */
395 /*---------------------------------------------------------------------*/
396 /*! \name Field Set */
397 /*! \{ */
400 /*! \} */
401 /*---------------------------------------------------------------------*/
402 /*! \name Ptr MField Set */
403 /*! \{ */
405 /*! \} */
406 /*---------------------------------------------------------------------*/
407 /*! \name Sync */
408 /*! \{ */
410 #ifdef OSG_MT_CPTR_ASPECT
411 virtual void execSyncV( FieldContainer &oFrom,
412 ConstFieldMaskArg whichField,
413 AspectOffsetStore &oOffsets,
414 ConstFieldMaskArg syncMode ,
415 const UInt32 uiSyncInfo);
417 void execSync ( SimpleSHLChunkBase *pFrom,
418 ConstFieldMaskArg whichField,
419 AspectOffsetStore &oOffsets,
420 ConstFieldMaskArg syncMode ,
421 const UInt32 uiSyncInfo);
422 #endif
424 /*! \} */
425 /*---------------------------------------------------------------------*/
426 /*! \name Edit */
427 /*! \{ */
429 /*! \} */
430 /*---------------------------------------------------------------------*/
431 /*! \name Aspect Create */
432 /*! \{ */
434 #ifdef OSG_MT_CPTR_ASPECT
435 virtual FieldContainer *createAspectCopy(
436 const FieldContainer *pRefAspect) const;
437 #endif
439 /*! \} */
440 /*---------------------------------------------------------------------*/
441 /*! \name Edit */
442 /*! \{ */
443 /*! \} */
444 /*---------------------------------------------------------------------*/
445 /*! \name Sync */
446 /*! \{ */
448 virtual void resolveLinks(void);
450 /*! \} */
451 /*========================== PRIVATE ================================*/
453 private:
454 /*---------------------------------------------------------------------*/
456 // prohibit default functions (move to 'public' if you need one)
457 void operator =(const SimpleSHLChunkBase &source);
460 typedef SimpleSHLChunkBase *SimpleSHLChunkBaseP;
462 OSG_END_NAMESPACE
464 #endif /* _OSGSIMPLESHLCHUNKBASE_H_ */