fixed: auto_ptr -> unique_ptr
[opensg.git] / Source / System / State / Base / OSGBlendChunkBase.h
blob262be096fb5b6eac4a759d9dc298aa918731c67a
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 BlendChunk
49 ** **
50 *****************************************************************************
51 \*****************************************************************************/
54 #ifndef _OSGBLENDCHUNKBASE_H_
55 #define _OSGBLENDCHUNKBASE_H_
56 #ifdef __sgi
57 #pragma once
58 #endif
61 #include "OSGConfig.h"
62 #include "OSGSystemDef.h"
64 //#include "OSGBaseTypes.h"
66 #include "OSGStateChunk.h" // Parent
68 #include "OSGBaseFields.h" // SrcFactor type
69 #include "OSGSysFields.h" // AlphaValue type
71 #include "OSGBlendChunkFields.h"
73 OSG_BEGIN_NAMESPACE
76 class BlendChunk;
78 //! \brief BlendChunk Base Class.
80 class OSG_SYSTEM_DLLMAPPING BlendChunkBase : public StateChunk
82 public:
84 typedef StateChunk Inherited;
85 typedef StateChunk ParentContainer;
87 typedef Inherited::TypeObject TypeObject;
88 typedef TypeObject::InitPhase InitPhase;
90 OSG_GEN_INTERNALPTR(BlendChunk);
92 /*========================== PUBLIC =================================*/
94 public:
96 enum
98 SrcFactorFieldId = Inherited::NextFieldId,
99 DestFactorFieldId = SrcFactorFieldId + 1,
100 EquationFieldId = DestFactorFieldId + 1,
101 ColorFieldId = EquationFieldId + 1,
102 AlphaFuncFieldId = ColorFieldId + 1,
103 AlphaValueFieldId = AlphaFuncFieldId + 1,
104 AlphaSrcFactorFieldId = AlphaValueFieldId + 1,
105 AlphaDestFactorFieldId = AlphaSrcFactorFieldId + 1,
106 NextFieldId = AlphaDestFactorFieldId + 1
109 static const OSG::BitVector SrcFactorFieldMask =
110 (TypeTraits<BitVector>::One << SrcFactorFieldId);
111 static const OSG::BitVector DestFactorFieldMask =
112 (TypeTraits<BitVector>::One << DestFactorFieldId);
113 static const OSG::BitVector EquationFieldMask =
114 (TypeTraits<BitVector>::One << EquationFieldId);
115 static const OSG::BitVector ColorFieldMask =
116 (TypeTraits<BitVector>::One << ColorFieldId);
117 static const OSG::BitVector AlphaFuncFieldMask =
118 (TypeTraits<BitVector>::One << AlphaFuncFieldId);
119 static const OSG::BitVector AlphaValueFieldMask =
120 (TypeTraits<BitVector>::One << AlphaValueFieldId);
121 static const OSG::BitVector AlphaSrcFactorFieldMask =
122 (TypeTraits<BitVector>::One << AlphaSrcFactorFieldId);
123 static const OSG::BitVector AlphaDestFactorFieldMask =
124 (TypeTraits<BitVector>::One << AlphaDestFactorFieldId);
125 static const OSG::BitVector NextFieldMask =
126 (TypeTraits<BitVector>::One << NextFieldId);
128 typedef SFGLenum SFSrcFactorType;
129 typedef SFGLenum SFDestFactorType;
130 typedef SFGLenum SFEquationType;
131 typedef SFColor4f SFColorType;
132 typedef SFGLenum SFAlphaFuncType;
133 typedef SFReal32 SFAlphaValueType;
134 typedef SFGLenum SFAlphaSrcFactorType;
135 typedef SFGLenum SFAlphaDestFactorType;
137 /*---------------------------------------------------------------------*/
138 /*! \name Class Get */
139 /*! \{ */
141 static FieldContainerType &getClassType (void);
142 static UInt32 getClassTypeId (void);
143 static UInt16 getClassGroupId(void);
145 /*! \} */
146 /*---------------------------------------------------------------------*/
147 /*! \name FieldContainer Get */
148 /*! \{ */
150 virtual FieldContainerType &getType (void);
151 virtual const FieldContainerType &getType (void) const;
153 virtual UInt32 getContainerSize(void) const;
155 /*! \} */
156 /*---------------------------------------------------------------------*/
157 /*! \name Field Get */
158 /*! \{ */
161 SFGLenum *editSFSrcFactor (void);
162 const SFGLenum *getSFSrcFactor (void) const;
164 SFGLenum *editSFDestFactor (void);
165 const SFGLenum *getSFDestFactor (void) const;
167 SFGLenum *editSFEquation (void);
168 const SFGLenum *getSFEquation (void) const;
170 SFColor4f *editSFColor (void);
171 const SFColor4f *getSFColor (void) const;
173 SFGLenum *editSFAlphaFunc (void);
174 const SFGLenum *getSFAlphaFunc (void) const;
176 SFReal32 *editSFAlphaValue (void);
177 const SFReal32 *getSFAlphaValue (void) const;
179 SFGLenum *editSFAlphaSrcFactor (void);
180 const SFGLenum *getSFAlphaSrcFactor (void) const;
182 SFGLenum *editSFAlphaDestFactor(void);
183 const SFGLenum *getSFAlphaDestFactor (void) const;
186 GLenum &editSrcFactor (void);
187 const GLenum &getSrcFactor (void) const;
189 GLenum &editDestFactor (void);
190 const GLenum &getDestFactor (void) const;
192 GLenum &editEquation (void);
193 const GLenum &getEquation (void) const;
195 Color4f &editColor (void);
196 const Color4f &getColor (void) const;
198 GLenum &editAlphaFunc (void);
199 const GLenum &getAlphaFunc (void) const;
201 Real32 &editAlphaValue (void);
202 Real32 getAlphaValue (void) const;
204 GLenum &editAlphaSrcFactor (void);
205 const GLenum &getAlphaSrcFactor (void) const;
207 GLenum &editAlphaDestFactor(void);
208 const GLenum &getAlphaDestFactor (void) const;
210 /*! \} */
211 /*---------------------------------------------------------------------*/
212 /*! \name Field Set */
213 /*! \{ */
215 void setSrcFactor (const GLenum &value);
216 void setDestFactor (const GLenum &value);
217 void setEquation (const GLenum &value);
218 void setColor (const Color4f &value);
219 void setAlphaFunc (const GLenum &value);
220 void setAlphaValue (const Real32 value);
221 void setAlphaSrcFactor (const GLenum &value);
222 void setAlphaDestFactor(const GLenum &value);
224 /*! \} */
225 /*---------------------------------------------------------------------*/
226 /*! \name Ptr MField Set */
227 /*! \{ */
229 /*! \} */
230 /*---------------------------------------------------------------------*/
231 /*! \name Binary Access */
232 /*! \{ */
234 virtual SizeT getBinSize (ConstFieldMaskArg whichField);
235 virtual void copyToBin (BinaryDataHandler &pMem,
236 ConstFieldMaskArg whichField);
237 virtual void copyFromBin(BinaryDataHandler &pMem,
238 ConstFieldMaskArg whichField);
241 /*! \} */
242 /*---------------------------------------------------------------------*/
243 /*! \name Construction */
244 /*! \{ */
246 static BlendChunkTransitPtr create (void);
247 static BlendChunk *createEmpty (void);
249 static BlendChunkTransitPtr createLocal (
250 BitVector bFlags = FCLocal::All);
252 static BlendChunk *createEmptyLocal(
253 BitVector bFlags = FCLocal::All);
255 static BlendChunkTransitPtr createDependent (BitVector bFlags);
257 /*! \} */
258 /*---------------------------------------------------------------------*/
259 /*! \name Copy */
260 /*! \{ */
262 virtual FieldContainerTransitPtr shallowCopy (void) const;
263 virtual FieldContainerTransitPtr shallowCopyLocal(
264 BitVector bFlags = FCLocal::All) const;
265 virtual FieldContainerTransitPtr shallowCopyDependent(
266 BitVector bFlags) const;
268 /*! \} */
269 /*========================= PROTECTED ===============================*/
271 protected:
273 static TypeObject _type;
275 static void classDescInserter(TypeObject &oType);
276 static const Char8 *getClassname (void );
278 /*---------------------------------------------------------------------*/
279 /*! \name Fields */
280 /*! \{ */
282 SFGLenum _sfSrcFactor;
283 SFGLenum _sfDestFactor;
284 SFGLenum _sfEquation;
285 SFColor4f _sfColor;
286 SFGLenum _sfAlphaFunc;
287 SFReal32 _sfAlphaValue;
288 SFGLenum _sfAlphaSrcFactor;
289 SFGLenum _sfAlphaDestFactor;
291 /*! \} */
292 /*---------------------------------------------------------------------*/
293 /*! \name Constructors */
294 /*! \{ */
296 BlendChunkBase(void);
297 BlendChunkBase(const BlendChunkBase &source);
299 /*! \} */
300 /*---------------------------------------------------------------------*/
301 /*! \name Destructors */
302 /*! \{ */
304 virtual ~BlendChunkBase(void);
306 /*! \} */
307 /*---------------------------------------------------------------------*/
308 /*! \name onCreate */
309 /*! \{ */
312 /*! \} */
313 /*---------------------------------------------------------------------*/
314 /*! \name Generic Field Access */
315 /*! \{ */
317 GetFieldHandlePtr getHandleSrcFactor (void) const;
318 EditFieldHandlePtr editHandleSrcFactor (void);
319 GetFieldHandlePtr getHandleDestFactor (void) const;
320 EditFieldHandlePtr editHandleDestFactor (void);
321 GetFieldHandlePtr getHandleEquation (void) const;
322 EditFieldHandlePtr editHandleEquation (void);
323 GetFieldHandlePtr getHandleColor (void) const;
324 EditFieldHandlePtr editHandleColor (void);
325 GetFieldHandlePtr getHandleAlphaFunc (void) const;
326 EditFieldHandlePtr editHandleAlphaFunc (void);
327 GetFieldHandlePtr getHandleAlphaValue (void) const;
328 EditFieldHandlePtr editHandleAlphaValue (void);
329 GetFieldHandlePtr getHandleAlphaSrcFactor (void) const;
330 EditFieldHandlePtr editHandleAlphaSrcFactor (void);
331 GetFieldHandlePtr getHandleAlphaDestFactor (void) const;
332 EditFieldHandlePtr editHandleAlphaDestFactor(void);
334 /*! \} */
335 /*---------------------------------------------------------------------*/
336 /*! \name Sync */
337 /*! \{ */
339 #ifdef OSG_MT_CPTR_ASPECT
340 virtual void execSyncV( FieldContainer &oFrom,
341 ConstFieldMaskArg whichField,
342 AspectOffsetStore &oOffsets,
343 ConstFieldMaskArg syncMode ,
344 const UInt32 uiSyncInfo);
346 void execSync ( BlendChunkBase *pFrom,
347 ConstFieldMaskArg whichField,
348 AspectOffsetStore &oOffsets,
349 ConstFieldMaskArg syncMode ,
350 const UInt32 uiSyncInfo);
351 #endif
353 /*! \} */
354 /*---------------------------------------------------------------------*/
355 /*! \name Edit */
356 /*! \{ */
358 /*! \} */
359 /*---------------------------------------------------------------------*/
360 /*! \name Aspect Create */
361 /*! \{ */
363 #ifdef OSG_MT_CPTR_ASPECT
364 virtual FieldContainer *createAspectCopy(
365 const FieldContainer *pRefAspect) const;
366 #endif
368 /*! \} */
369 /*---------------------------------------------------------------------*/
370 /*! \name Edit */
371 /*! \{ */
372 /*! \} */
373 /*---------------------------------------------------------------------*/
374 /*! \name Sync */
375 /*! \{ */
377 virtual void resolveLinks(void);
379 /*! \} */
380 /*========================== PRIVATE ================================*/
382 private:
383 /*---------------------------------------------------------------------*/
385 // prohibit default functions (move to 'public' if you need one)
386 void operator =(const BlendChunkBase &source);
389 typedef BlendChunkBase *BlendChunkBaseP;
391 OSG_END_NAMESPACE
393 #endif /* _OSGBLENDCHUNKBASE_H_ */